Skip to content
Snippets Groups Projects
Commit b9e901b0 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

mCBM 2019: bring macros to mCBM branch stand

- Explicitely enable TimesliceMetaData output to file for the source class
parent b5b94da4
Branches
Tags
1 merge request!10First part of mCBM changes to data to monitors, tasks and unpackers
......@@ -16,31 +16,46 @@ void check_events(Int_t nEvents = 10, UInt_t uRunId=0, TString inDir="data/", TS
TString workDir = gSystem->Getenv("VMCWORKDIR");
TString runId = TString::Format("%u", uRunId);
TString runId = TString::Format("%03u", uRunId);
TString ParFile = inDir + "/unp_mcbm_params_" + runId + ".root";
TString InputFile = inDir + "/unp_mcbm_" + runId + ".root";
TString InputFileEvent="";
if (friendFile.Length() > 0) {
if( "" == friendFile )
{
InputFileEvent = inDir + "/events_" + runId + ".root";
} // if( "" == friendFile )
else
{
InputFileEvent = inDir + friendFile;
}
} // else of if( "" == friendFile )
TString OutputFile = inDir + "/test_" + runId + ".out.root";
TList *parFileList = new TList();
// ----- Timer --------------------------------------------------------
TStopwatch timer;
timer.Start();
// ------------------------------------------------------------------------
// ----- Reconstruction run -------------------------------------------
FairRunAna *run= new FairRunAna();
FairFileSource* inputSource = new FairFileSource(InputFile);
if (friendFile.Length() > 0) {
inputSource->AddFriend(InputFileEvent);
}
run->SetSource(inputSource);
run->SetOutputFile(OutputFile);
run->SetEventHeaderPersistence(kFALSE);
// ------------------------------------------------------------------------
// Enable FairMonitor
FairMonitor::GetMonitor()->EnableMonitor(kFALSE);
// ------------------------------------------------------------------------
CbmCheckEvents* checker = new CbmCheckEvents();
run->AddTask(checker);
......@@ -71,4 +86,33 @@ void check_events(Int_t nEvents = 10, UInt_t uRunId=0, TString inDir="data/", TS
//tofClust->Finish();
// ------------------------------------------------------------------------
// default display
// ----- Finish -------------------------------------------------------
timer.Stop();
Double_t rtime = timer.RealTime();
Double_t ctime = timer.CpuTime();
cout << endl << endl;
cout << "Macro finished succesfully." << endl;
cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
cout << endl;
// ------------------------------------------------------------------------
// Extract the maximal used memory an add is as Dart measurement
// This line is filtered by CTest and the value send to CDash
FairSystemInfo sysInfo;
Float_t maxMemory=sysInfo.GetMaxMemory();
cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
cout << maxMemory;
cout << "</DartMeasurement>" << endl;
Float_t cpuUsage=ctime/rtime;
cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
cout << cpuUsage;
cout << "</DartMeasurement>" << endl;
FairMonitor* tempMon = FairMonitor::GetMonitor();
tempMon->Print();
// RemoveGeoManager();
cout << " Test passed" << endl;
cout << " All ok " << endl;
}
......@@ -232,15 +232,24 @@ void unpack_tsa_mcbm(TString inFile = "", UInt_t uRunId = 0, UInt_t nrEvents=0,
unpacker_much->SetTimeOffsetNsAsic( 34, 0.0 ); // Run 384, DPB 5 ASIC 4
unpacker_much->SetTimeOffsetNsAsic( 35, 0.0 ); // Run 384, DPB 5 ASIC 5
unpacker_psd->SetTimeOffsetNs( -180.0 );
break;
} // 384
case 365:
{
unpacker_psd->SetTimeOffsetNs( -1007.0 );
break;
}
default:
break;
} // switch( uRunId )
// --- Source task
CbmMcbm2018Source* source = new CbmMcbm2018Source();
source->SetWriteOutputFlag( kTRUE ); // For writing TS metadata
source->SetFileName(inFile);
// source->SetInputDir(inDir);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment