Skip to content
Snippets Groups Projects
Commit bb4711dd authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau Committed by Florian Uhlig
Browse files

[mCBM 2021] Add parameters and macro for mTOF HR run

parent deb4102d
No related branches found
No related tags found
1 merge request!323MQ improvements following Virgo testing
.root_hist
/** @file MonitorTof.C
** @author Florian Uhlig <f.uhlig@gsi.de>
** @date 20.06.2016
** Modified by P.-A. Loizeau
** @date 13.10.2019
**
** ROOT macro to read tsa files which have been produced with the new data transport
** Convert data into cbmroot format.
** Uses CbmMcbm2018Source as source task.
*/
// In order to call later Finish, we make this global
FairRunOnline* run = NULL;
/// FIXME: Disable clang formatting to keep easy parameters overview
/* clang-format off */
void MonitorTof(TString inFile = "",
TString sHostname = "localhost",
Int_t iServerRefreshRate = 100,
Int_t iServerHttpPort = 8080,
UInt_t nrEvents = 0,
Bool_t bIgnoreCriticalErrors = kTRUE,
Int_t iGdpbIndex = -1,
TString sHistoFile = "data/HistosMonitorTof.root")
{
/// FIXME: Re-enable clang formatting after parameters initial values setting
/* clang-format on */
TString srcDir = gSystem->Getenv("VMCWORKDIR");
// --- Specify number of events to be produced.
// --- -1 means run until the end of the input file.
Int_t nEvents = -1;
// --- Set log output levels
FairLogger::GetLogger();
gLogger->SetLogScreenLevel("INFO");
// gLogger->SetLogScreenLevel("DEBUG");
// gLogger->SetLogScreenLevel("DEBUG2"); // Print raw messages
gLogger->SetLogVerbosityLevel("LOW");
// --- Define parameter files
TList* parFileList = new TList();
TString paramDir = srcDir + "/macro/beamtime/mcbm2021/";
//TString paramDir = "/scratch/cbmroot_macro/macro/beamtime/mcbm2020/";
TString paramFileTof = paramDir + "mTofPar.par";
TObjString* parTofFileName = new TObjString(paramFileTof);
parFileList->Add(parTofFileName);
// --- Set debug level
gDebug = 0;
std::cout << std::endl;
// ========================================================================
// ========================================================================
std::cout << std::endl;
std::cout << ">>> MonitorTof: Initialising..." << std::endl;
// Get4 Unpacker
CbmMcbm2018MonitorTaskTof* monitor_tof = new CbmMcbm2018MonitorTaskTof();
monitor_tof->SetIgnoreOverlapMs();
monitor_tof->SetHistoryHistoSize(600);
// monitor_tof->SetDebugMonitorMode();
monitor_tof->SetIgnoreCriticalErrors(bIgnoreCriticalErrors);
monitor_tof->SetGdpbIndex(iGdpbIndex);
monitor_tof->SetHistoFilename(sHistoFile);
// --- Source task
CbmMcbm2018Source* source = new CbmMcbm2018Source();
if ("" != inFile) {
// Empty comment to avoid collapsing by clang-format
source->SetFileName(inFile);
} // if( "" != inFile )
else {
source->SetHostName(sHostname);
} // else of if( "" != inFile )
source->SetSubscriberHwm(10);
source->AddUnpacker(monitor_tof, 0x60, ECbmModuleId::kTof); //gDPBs
source->AddUnpacker(monitor_tof, 0x90, ECbmModuleId::kTof); //gDPBs T0
// --- Run
run = new FairRunOnline(source);
run->ActivateHttpServer(iServerRefreshRate,
iServerHttpPort); // refresh each 100 events
/// To avoid the server sucking all Histos from gROOT when no output file is used
/// ===> Need to explicitely add the canvases to the server in the task!
run->GetHttpServer()->GetSniffer()->SetScanGlobalDir(kFALSE);
run->SetAutoFinish(kFALSE);
// ----- Runtime database ---------------------------------------------
FairRuntimeDb* rtdb = run->GetRuntimeDb();
FairParAsciiFileIo* parIn = new FairParAsciiFileIo();
parIn->open(parFileList, "in");
rtdb->setFirstInput(parIn);
run->Init();
// --- Start run
TStopwatch timer;
timer.Start();
std::cout << ">>> MonitorTof: Starting run..." << std::endl;
if (0 == nrEvents) {
run->Run(nEvents, 0); // run until end of input file
}
else {
run->Run(0, nrEvents); // process 2000 Events
}
run->Finish();
timer.Stop();
std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices" << std::endl;
// --- End-of-run info
Double_t rtime = timer.RealTime();
Double_t ctime = timer.CpuTime();
std::cout << std::endl << std::endl;
std::cout << ">>> MonitorTof: Macro finished successfully." << std::endl;
std::cout << ">>> MonitorTof: Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl;
std::cout << std::endl;
/// --- Screen output for automatic tests
std::cout << " Test passed" << std::endl;
std::cout << " All ok " << std::endl;
}
*.root
[CbmMcbm2018TofPar]
//----------------------------------------------------------------------------
NrOfGdpbs: Int_t 10
GdpbIdArray: Int_t \
0x5b7b 0x55c4 0x18c5 0x5f64 0x1889 0x181c 0x1922 0x1925 0x1902 0x65d5
NrOfFeesPerGdpb: Int_t 30
NrOfGet4PerFee: Int_t 8
NrOfChannelsPerGet4: Int_t 4
NrOfGbtx: Int_t 54
NrOfModule: Int_t 9
NrOfRpc: Int_t \
1 0 0 0 0 0 \
1 0 0 0 0 0 \
5 0 0 0 0 0 \
2 0 0 0 0 0 \
5 0 0 0 0 0 \
5 0 0 0 0 0 \
2 0 0 0 0 0 \
5 0 0 0 0 0 \
2 0 0 0 0 0
RpcType: Int_t \
5 -1 -1 -1 -1 -1 \
5 -1 -1 -1 -1 -1 \
0 -1 -1 -1 -1 -1 \
9 -1 -1 -1 -1 -1 \
0 -1 -1 -1 -1 -1 \
0 -1 -1 -1 -1 -1 \
9 -1 -1 -1 -1 -1 \
0 -1 -1 -1 -1 -1 \
6 -1 -1 -1 -1 -1
RpcSide: Int_t \
0 0 0 0 0 0 \
1 0 0 0 0 0 \
1 0 0 0 0 0 \
2 0 0 0 0 0 \
1 0 0 0 0 0 \
0 0 0 0 0 0 \
2 0 0 0 0 0 \
0 0 0 0 0 0 \
7 0 0 0 0 0
ModuleId: Int_t \
0 0 0 0 0 0 \
0 0 0 0 0 0 \
3 0 0 0 0 0 \
0 0 0 0 0 0 \
4 0 0 0 0 0 \
3 0 0 0 0 0 \
1 0 0 0 0 0 \
4 0 0 0 0 0 \
0 0 0 0 0 0
NbMsTot: Int_t 100
NbMsOverlap: Int_t 1
SizeMsInNs: Double_t 102400.0
//SizeMsInNs: Double_t 1638400
StarTriggerDeadtime: Double_t \
1000.0 1000.0 1000.0 1000.0 1000.0
StarTriggerDelay: Double_t \
2000.0 2000.0 2000.0 2000.0 2000.0
// 2000.0 2000.0 2000.0 2000.0 2000.0
//-23000.0 -23000.0 -23000.0 -23000.0 -23000.0
StarTriggerWinSize: Double_t \
2000.0 2000.0 2000.0 2000.0 2000.0
TsDeadtimePeriod: Double_t 62.5
#######################
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment