Commit 752258d5 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau
Browse files

[mCBM 2020] Make the kronos and standard macros consistent

- always create new param root file instead of updating
- TRD event window borders same in all macros
- Add TOF reco blocks where missing
- Fix output files names
- Fix monitoring files names
parent 81a4dfbc
...@@ -14,8 +14,8 @@ void build_event_win(UInt_t uRunId = 0, ...@@ -14,8 +14,8 @@ void build_event_win(UInt_t uRunId = 0,
// --- Set log output levels // --- Set log output levels
FairLogger::GetLogger(); FairLogger::GetLogger();
//gLogger->SetLogScreenLevel("INFO"); gLogger->SetLogScreenLevel("INFO");
gLogger->SetLogScreenLevel("DEBUG"); // gLogger->SetLogScreenLevel("DEBUG");
gLogger->SetLogVerbosityLevel("MEDIUM"); gLogger->SetLogVerbosityLevel("MEDIUM");
// MC file // MC file
...@@ -36,7 +36,7 @@ void build_event_win(UInt_t uRunId = 0, ...@@ -36,7 +36,7 @@ void build_event_win(UInt_t uRunId = 0,
fRun->SetSource(inputSource); fRun->SetSource(inputSource);
TString runId = TString::Format("%03u", uRunId); TString runId = TString::Format("%03u", uRunId);
TString outFile = outDir + "/events_win_" + runId + ".root"; TString outFile = outDir + "/mcbm_events_win_" + runId + ".root";
FairRootFileSink* outputSink = new FairRootFileSink(outFile); FairRootFileSink* outputSink = new FairRootFileSink(outFile);
fRun->SetSink(outputSink); fRun->SetSink(outputSink);
...@@ -71,7 +71,7 @@ void build_event_win(UInt_t uRunId = 0, ...@@ -71,7 +71,7 @@ void build_event_win(UInt_t uRunId = 0,
/// Change the selection window limits for T0 as ref /// Change the selection window limits for T0 as ref
eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100); eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100);
eventBuilder->SetTriggerWindow(ECbmModuleId::kMuch, -150, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kMuch, -150, 50);
eventBuilder->SetTriggerWindow(ECbmModuleId::kTrd, -250, 100); eventBuilder->SetTriggerWindow(ECbmModuleId::kTrd, -50, 250);
eventBuilder->SetTriggerWindow(ECbmModuleId::kTof, -150, 10); eventBuilder->SetTriggerWindow(ECbmModuleId::kTof, -150, 10);
eventBuilder->SetTriggerWindow(ECbmModuleId::kRich, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kRich, -50, 50);
eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50);
...@@ -81,7 +81,7 @@ void build_event_win(UInt_t uRunId = 0, ...@@ -81,7 +81,7 @@ void build_event_win(UInt_t uRunId = 0,
/* /*
/// Use TOF as reference /// Use TOF as reference
eventBuilder->SetReferenceDetector( kEventBuilderDetTof ); eventBuilder->SetReferenceDetector( kEventBuilderDetTof );
eventBuilder->AddDetector( kEventBuilderDetT0 ); eventBuilder->AddDetector(kEventBuilderDetT0);
/// Change the selection window limits for TOF as ref /// Change the selection window limits for TOF as ref
/// => Should always be after changes of detector lists! /// => Should always be after changes of detector lists!
......
...@@ -64,7 +64,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0, ...@@ -64,7 +64,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0,
fRun->SetSource(inputSource); fRun->SetSource(inputSource);
TString runId = TString::Format("%03u", uRunId); TString runId = TString::Format("%03u", uRunId);
TString outFile = outDir + "/events_win_" + runId + ".root"; TString outFile = outDir + "/mcbm_events_win_" + runId + ".root";
FairRootFileSink* outputSink = new FairRootFileSink(outFile); FairRootFileSink* outputSink = new FairRootFileSink(outFile);
fRun->SetSink(outputSink); fRun->SetSink(outputSink);
...@@ -99,7 +99,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0, ...@@ -99,7 +99,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0,
/// Change the selection window limits for T0 as ref /// Change the selection window limits for T0 as ref
eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100); eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100);
eventBuilder->SetTriggerWindow(ECbmModuleId::kMuch, -150, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kMuch, -150, 50);
eventBuilder->SetTriggerWindow(ECbmModuleId::kTrd, -250, 100); eventBuilder->SetTriggerWindow(ECbmModuleId::kTrd, -50, 250);
eventBuilder->SetTriggerWindow(ECbmModuleId::kTof, -150, 10); eventBuilder->SetTriggerWindow(ECbmModuleId::kTof, -150, 10);
eventBuilder->SetTriggerWindow(ECbmModuleId::kRich, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kRich, -50, 50);
eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50);
...@@ -109,7 +109,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0, ...@@ -109,7 +109,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0,
/* /*
/// Use TOF as reference /// Use TOF as reference
eventBuilder->SetReferenceDetector( kEventBuilderDetTof ); eventBuilder->SetReferenceDetector( kEventBuilderDetTof );
eventBuilder->AddDetector( kEventBuilderDetT0 ); eventBuilder->AddDetector(kEventBuilderDetT0);
/// Change the selection window limits for TOF as ref /// Change the selection window limits for TOF as ref
/// => Should always be after changes of detector lists! /// => Should always be after changes of detector lists!
......
...@@ -45,7 +45,6 @@ void mcbm_build_and_reco(UInt_t uRunId = 831, ...@@ -45,7 +45,6 @@ void mcbm_build_and_reco(UInt_t uRunId = 831,
TList* parFileList = new TList(); TList* parFileList = new TList();
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// ----- Timer -------------------------------------------------------- // ----- Timer --------------------------------------------------------
TStopwatch timer; TStopwatch timer;
timer.Start(); timer.Start();
...@@ -65,7 +64,7 @@ void mcbm_build_and_reco(UInt_t uRunId = 831, ...@@ -65,7 +64,7 @@ void mcbm_build_and_reco(UInt_t uRunId = 831,
// Define output file for FairMonitor histograms // Define output file for FairMonitor histograms
TString monitorFile {outFile}; TString monitorFile {outFile};
monitorFile.ReplaceAll("rec", "rec.monitor"); monitorFile.ReplaceAll("reco", "reco.monitor");
FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
...@@ -248,7 +247,6 @@ void mcbm_build_and_reco(UInt_t uRunId = 831, ...@@ -248,7 +247,6 @@ void mcbm_build_and_reco(UInt_t uRunId = 831,
std::cout << "-I- : Added task " << trdHit->GetName() << std::endl; std::cout << "-I- : Added task " << trdHit->GetName() << std::endl;
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// ----- Local reconstruction in TOF ---------------------------------- // ----- Local reconstruction in TOF ----------------------------------
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// TOF defaults // TOF defaults
...@@ -493,8 +491,8 @@ void mcbm_build_and_reco(UInt_t uRunId = 831, ...@@ -493,8 +491,8 @@ void mcbm_build_and_reco(UInt_t uRunId = 831,
parIo2->open(parFileList, "in"); parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2); rtdb->setSecondInput(parIo2);
parIo3->open(parFileOut.Data(), "RECREATE");
parIo3->open(parFileOut.Data(), "RECREATE");
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
......
...@@ -97,7 +97,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, ...@@ -97,7 +97,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28,
// Define output file for FairMonitor histograms // Define output file for FairMonitor histograms
TString monitorFile {outFile}; TString monitorFile {outFile};
monitorFile.ReplaceAll("rec", "rec.monitor"); monitorFile.ReplaceAll("reco", "reco.monitor");
FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
...@@ -132,7 +132,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, ...@@ -132,7 +132,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28,
/// Change the selection window limits for T0 as ref /// Change the selection window limits for T0 as ref
eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100); eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100);
eventBuilder->SetTriggerWindow(ECbmModuleId::kMuch, -150, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kMuch, -150, 50);
eventBuilder->SetTriggerWindow(ECbmModuleId::kTrd, -250, 100); eventBuilder->SetTriggerWindow(ECbmModuleId::kTrd, -50, 250);
eventBuilder->SetTriggerWindow(ECbmModuleId::kTof, -150, 10); eventBuilder->SetTriggerWindow(ECbmModuleId::kTof, -150, 10);
eventBuilder->SetTriggerWindow(ECbmModuleId::kRich, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kRich, -50, 50);
eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50);
...@@ -142,7 +142,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, ...@@ -142,7 +142,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28,
/* /*
/// Use TOF as reference /// Use TOF as reference
eventBuilder->SetReferenceDetector( kEventBuilderDetTof ); eventBuilder->SetReferenceDetector( kEventBuilderDetTof );
eventBuilder->AddDetector( kEventBuilderDetT0 ); eventBuilder->AddDetector(kEventBuilderDetT0);
/// Change the selection window limits for TOF as ref /// Change the selection window limits for TOF as ref
/// => Should always be after changes of detector lists! /// => Should always be after changes of detector lists!
...@@ -323,7 +323,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, ...@@ -323,7 +323,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28,
TString cTrkFile = TString cTrkFile =
parDir + "/tof/" + Form("%s_tofFindTracks.hst.root", cCalId.Data()); parDir + "/tof/" + Form("%s_tofFindTracks.hst.root", cCalId.Data());
Int_t iTrackingSetup = 1; Int_t iTrackingSetup = 1;
Int_t iCalOpt = 0; Int_t iCalOpt = 1;
CbmTofTrackFinder* tofTrackFinder = new CbmTofTrackFinderNN(); CbmTofTrackFinder* tofTrackFinder = new CbmTofTrackFinderNN();
tofTrackFinder->SetMaxTofTimeDifference(0.2); // in ns/cm tofTrackFinder->SetMaxTofTimeDifference(0.2); // in ns/cm
...@@ -518,8 +518,10 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, ...@@ -518,8 +518,10 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28,
FairParRootFileIo* parIo3 = new FairParRootFileIo(); FairParRootFileIo* parIo3 = new FairParRootFileIo();
parIo1->open(parFileIn.Data(), "READ"); parIo1->open(parFileIn.Data(), "READ");
rtdb->setFirstInput(parIo1); rtdb->setFirstInput(parIo1);
parIo2->open(parFileList, "in"); parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2); rtdb->setSecondInput(parIo2);
parIo3->open(parFileOut.Data(), "RECREATE"); parIo3->open(parFileOut.Data(), "RECREATE");
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
......
...@@ -23,10 +23,12 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { ...@@ -23,10 +23,12 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) {
// ----- In- and output file names ------------------------------------ // ----- In- and output file names ------------------------------------
TString inFile = Form("./data/unp_mcbm_%i.root", runId); TString inFile = Form("./data/unp_mcbm_%i.root", runId);
TString parFile = Form("./data/unp_mcbm_params_%i.root", runId); TString parFileIn = Form("./data/unp_mcbm_params_%i.root", runId);
TString outFile = Form("./data/reco_mcbm_%i.root", runId); TString parFileOut = Form("./data/reco_mcbm_event_params_%i.root", runId);
TString outFile = Form("./data/reco_mcbm_event_%i.root", runId);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// --- Load the geometry setup ---- // --- Load the geometry setup ----
// This is currently only required by the TRD (parameters) // This is currently only required by the TRD (parameters)
std::string geoSetupTag = "mcbm_beam_2020_03"; std::string geoSetupTag = "mcbm_beam_2020_03";
...@@ -37,7 +39,6 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { ...@@ -37,7 +39,6 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) {
TList* parFileList = new TList(); TList* parFileList = new TList();
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// ----- Timer -------------------------------------------------------- // ----- Timer --------------------------------------------------------
TStopwatch timer; TStopwatch timer;
timer.Start(); timer.Start();
...@@ -55,7 +56,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { ...@@ -55,7 +56,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) {
// Define output file for FairMonitor histograms // Define output file for FairMonitor histograms
TString monitorFile {outFile}; TString monitorFile {outFile};
monitorFile.ReplaceAll("rec", "rec.monitor"); monitorFile.ReplaceAll("reco", "reco.monitor");
FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
...@@ -72,9 +73,9 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { ...@@ -72,9 +73,9 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) {
eventBuilder->SetEventBuilderAlgo(EventBuilderAlgo::FixedTimeWindow); eventBuilder->SetEventBuilderAlgo(EventBuilderAlgo::FixedTimeWindow);
eventBuilder->SetFixedTimeWindow(200.); eventBuilder->SetFixedTimeWindow(200.);
eventBuilder->SetTriggerMinNumberT0(1); eventBuilder->SetTriggerMinNumberT0(1);
// eventBuilder->SetTriggerMinNumberTrd(1);
//eventBuilder->SetTriggerMinNumberSts(0); //eventBuilder->SetTriggerMinNumberSts(0);
eventBuilder->SetTriggerMinNumberMuch(1); eventBuilder->SetTriggerMinNumberMuch(1);
// eventBuilder->SetTriggerMinNumberTrd(1);
eventBuilder->SetTriggerMinNumberTof(10); eventBuilder->SetTriggerMinNumberTof(10);
// eventBuilder->SetFillHistos(kTRUE); // eventBuilder->SetFillHistos(kTRUE);
run->AddTask(eventBuilder); run->AddTask(eventBuilder);
...@@ -412,11 +413,12 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { ...@@ -412,11 +413,12 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) {
FairRuntimeDb* rtdb = run->GetRuntimeDb(); FairRuntimeDb* rtdb = run->GetRuntimeDb();
FairParRootFileIo* parIo1 = new FairParRootFileIo(); FairParRootFileIo* parIo1 = new FairParRootFileIo();
FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
parIo1->open(parFile.Data(), "UPDATE"); FairParRootFileIo* parIo3 = new FairParRootFileIo();
parIo2->open(parFileList, "in"); parIo1->open(parFileIn.Data(), "READ");
rtdb->setFirstInput(parIo1); rtdb->setFirstInput(parIo1);
parIo2->open(parFileList, "in"); parIo2->open(parFileList, "in");
rtdb->setSecondInput(parIo2); rtdb->setSecondInput(parIo2);
parIo3->open(parFileOut.Data(), "RECREATE");
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
...@@ -424,7 +426,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { ...@@ -424,7 +426,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) {
std::cout << std::endl; std::cout << std::endl;
std::cout << "-I- " << myName << ": Initialise run" << std::endl; std::cout << "-I- " << myName << ": Initialise run" << std::endl;
run->Init(); run->Init();
rtdb->setOutput(parIo1); rtdb->setOutput(parIo3);
rtdb->saveOutput(); rtdb->saveOutput();
rtdb->print(); rtdb->print();
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
...@@ -445,7 +447,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { ...@@ -445,7 +447,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) {
std::cout << std::endl << std::endl; std::cout << std::endl << std::endl;
std::cout << "Macro finished successfully." << std::endl; std::cout << "Macro finished successfully." << std::endl;
std::cout << "Output file is " << outFile << std::endl; std::cout << "Output file is " << outFile << std::endl;
std::cout << "Parameter file is " << parFile << std::endl; std::cout << "Parameter file is " << parFileOut << std::endl;
std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s"
<< std::endl; << std::endl;
std::cout << std::endl; std::cout << std::endl;
......
...@@ -15,9 +15,10 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { ...@@ -15,9 +15,10 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
// ----- Environment -------------------------------------------------- // ----- Environment --------------------------------------------------
TString myName = "mcbm_reco"; // this macro's name for screen output TString myName = "mcbm_event_reco"; // this macro's name for screen output
TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory
TString paramDir = srcDir + "/macro/beamtime/mcbm2020/"; TString paramDir = srcDir + "/macro/beamtime/mcbm2020/";
TString parDir = srcDir + "/parameters";
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
...@@ -29,8 +30,8 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { ...@@ -29,8 +30,8 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
Form("/lustre/cbm/users/ploizeau/mcbm2020/unp_evt_data_7f229b3f_20201103/" Form("/lustre/cbm/users/ploizeau/mcbm2020/unp_evt_data_7f229b3f_20201103/"
"unp_mcbm_params_%i.root", "unp_mcbm_params_%i.root",
runId); runId);
TString parFileOut = Form("./data/reco_mcbm_params_%i.root", runId); TString parFileOut = Form("./data/reco_mcbm_event_params_%i.root", runId);
TString outFile = Form("./data/reco_mcbm_%i.root", runId); TString outFile = Form("./data/reco_mcbm_event_%i.root", runId);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// --- Load the geometry setup ---- // --- Load the geometry setup ----
...@@ -60,7 +61,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { ...@@ -60,7 +61,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
// Define output file for FairMonitor histograms // Define output file for FairMonitor histograms
TString monitorFile {outFile}; TString monitorFile {outFile};
monitorFile.ReplaceAll("rec", "rec.monitor"); monitorFile.ReplaceAll("reco", "reco.monitor");
FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
...@@ -79,7 +80,9 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { ...@@ -79,7 +80,9 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
eventBuilder->SetTriggerMinNumberT0(1); eventBuilder->SetTriggerMinNumberT0(1);
//eventBuilder->SetTriggerMinNumberSts(0); //eventBuilder->SetTriggerMinNumberSts(0);
eventBuilder->SetTriggerMinNumberMuch(1); eventBuilder->SetTriggerMinNumberMuch(1);
// eventBuilder->SetTriggerMinNumberTrd(1);
eventBuilder->SetTriggerMinNumberTof(10); eventBuilder->SetTriggerMinNumberTof(10);
// eventBuilder->SetFillHistos(kTRUE);
run->AddTask(eventBuilder); run->AddTask(eventBuilder);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
...@@ -88,8 +91,6 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { ...@@ -88,8 +91,6 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
// ----- Local reconstruction in MUCH --------------------------------- // ----- Local reconstruction in MUCH ---------------------------------
Int_t flag = 1; Int_t flag = 1;
TString parDir =
TString(gSystem->Getenv("VMCWORKDIR")) + TString("/parameters");
TString muchDigiFile( TString muchDigiFile(
parDir + "/much/much_v19c_mcbm_digi_sector.root"); // MUCH digi file parDir + "/much/much_v19c_mcbm_digi_sector.root"); // MUCH digi file
CbmMuchFindHitsGem* muchFindHits = CbmMuchFindHitsGem* muchFindHits =
...@@ -181,7 +182,212 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { ...@@ -181,7 +182,212 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) {
// ----- Local reconstruction in TOF ---------------------------------- // ----- Local reconstruction in TOF ----------------------------------
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// TOF defaults
Int_t calMode = 93;
Int_t calSel = 1;
Int_t calSm = 0;
Int_t RefSel = 0;
Double_t dDeadtime = 50.;
Int_t iSel2 = 500;
TString TofGeoTag = "v20f_mcbm";
TString cCalId = "831.50.3.0";
Int_t iCalSet = 12022500; // calibration settings
TObjString* tofBdfFile =
new TObjString(parDir + "/tof/tof_" + TofGeoTag + ".digibdf.par");
parFileList->Add(tofBdfFile);
std::cout << "-I- Using parameter file " << tofBdfFile->GetString()
<< std::endl;
CbmTofEventClusterizer* tofCluster =
new CbmTofEventClusterizer("TOF Event Clusterizer", 0, 1);
TString cFname = parDir + "/tof/"
+ Form("%s_set%09d_%02d_%01dtofClust.hst.root",
cCalId.Data(),
iCalSet,
calMode,
calSel);
tofCluster->SetCalParFileName(cFname);
tofCluster->SetCalMode(calMode);
tofCluster->SetCalSel(calSel);
tofCluster->PosYMaxScal(0.75); //in % of 2*length
tofCluster->SetChannelDeadtime(dDeadtime); // artificial deadtime in ns
run->AddTask(tofCluster);
std::cout << "-I- Added task " << tofCluster->GetName() << std::endl;
// ----- Track reconstruction ------------------------------------------
Int_t iTrackMode = 2;
switch (iTrackMode) {
case 2: {
Int_t iGenCor = 1;
Double_t dScalFac = 1.;
Double_t dChi2Lim2 = 3.5;
TString cTrkFile =
parDir + "/tof/" + Form("%s_tofFindTracks.hst.root", cCalId.Data());
Int_t iTrackingSetup = 1;
Int_t iCalOpt = 0;
CbmTofTrackFinder* tofTrackFinder = new CbmTofTrackFinderNN();
tofTrackFinder->SetMaxTofTimeDifference(0.2); // in ns/cm
tofTrackFinder->SetTxLIM(0.3); // max slope dx/dz
tofTrackFinder->SetTyLIM(0.3); // max dev from mean slope dy/dz
tofTrackFinder->SetTyMean(0.); // mean slope dy/dz
CbmTofTrackFitter* tofTrackFitter = new CbmTofTrackFitterKF(0, 211);
TFitter* MyFit = new TFitter(1); // initialize Minuit
tofTrackFinder->SetFitter(tofTrackFitter);
CbmTofFindTracks* tofFindTracks =
new CbmTofFindTracks("TOF Track Finder");
tofFindTracks->UseFinder(tofTrackFinder);
tofFindTracks->UseFitter(tofTrackFitter);
tofFindTracks->SetCalOpt(iCalOpt);
// 1 - update offsets, 2 - update walk, 0 - bypass
tofFindTracks->SetCorMode(
iGenCor); // valid options: 0,1,2,3,4,5,6, 10 - 19
tofFindTracks->SetTtTarg(
0.065); // target value for Mar2020 triple stack -> betapeak ~ 0.95
//tofFindTracks->SetTtTarg(0.041); // target value for inverse velocity, > 0.033 ns/cm!
//tofFindTracks->SetTtTarg(0.035); // target value for inverse velocity, > 0.033 ns/cm!
tofFindTracks->SetCalParFileName(
cTrkFile); // Tracker parameter value file name
tofFindTracks->SetBeamCounter(5, 0, 0); // default beam counter
tofFindTracks->SetStationMaxHMul(
30); // Max Hit Multiplicity in any used station
tofFindTracks->SetT0MAX(dScalFac); // in ns
tofFindTracks->SetSIGT(0.08); // default in ns
tofFindTracks->SetSIGX(0.3); // default in cm
tofFindTracks->SetSIGY(0.45); // default in cm
tofFindTracks->SetSIGZ(0.05); // default in cm
tofFindTracks->SetUseSigCalib(
kFALSE); // ignore resolutions in CalPar file
tofTrackFinder->SetSIGLIM(dChi2Lim2
* 2.); // matching window in multiples of chi2
tofTrackFinder->SetChiMaxAccept(dChi2Lim2); // max tracklet chi2
Int_t iMinNofHits = -1;
Int_t iNStations = 0;
Int_t iNReqStations = 3;
switch (iTrackingSetup) {
case 0: // bypass mode
iMinNofHits = -1;
iNStations = 1;
tofFindTracks->SetStation(0, 5, 0, 0); // Diamond
break;
case 1: // for calibration mode of full setup
iMinNofHits = 3;
iNStations = 28;
iNReqStations = 4;
tofFindTracks->SetStation(0, 5, 0, 0);
tofFindTracks->SetStation(1, 0, 2, 2);
tofFindTracks->SetStation(2, 0, 1, 2);
tofFindTracks->SetStation(3, 0, 0, 2);
tofFindTracks->SetStation(4, 0, 2, 1);
tofFindTracks->SetStation(5, 0, 1, 1);
tofFindTracks->SetStation(6, 0, 0, 1);
tofFindTracks->SetStation(7, 0, 2, 3);
tofFindTracks->SetStation(8, 0, 1, 3);
tofFindTracks->SetStation(9, 0, 0, 3);
tofFindTracks->SetStation(10, 0, 2, 0);
tofFindTracks->SetStation(11, 0, 1, 0);
tofFindTracks->SetStation(12, 0, 0, 0);
tofFindTracks->SetStation(13, 0, 2, 4);
tofFindTracks->SetStation(14, 0, 1, 4);
tofFindTracks->SetStation(15, 0, 0, 4);
tofFindTracks->SetStation(16, 0, 4, 0);
tofFindTracks->SetStation(17, 0, 3, 0);
tofFindTracks->SetStation(18, 0, 4, 1);
tofFindTracks->SetStation(19, 0, 3, 1);
tofFindTracks->SetStation(20, 0, 4, 2);
tofFindTracks->SetStation(21, 0, 3, 2);
tofFindTracks->SetStation(22, 0, 4, 3);
tofFindTracks->SetStation(23, 0, 3, 3);
tofFindTracks->SetStation(24, 0, 4, 4);
tofFindTracks->SetStation(25, 0, 3, 4);
tofFindTracks->SetStation(26, 9, 0, 0);
tofFindTracks->SetStation(27, 9, 0, 1);
break;
case 2: // for geometry check mode of full setup
iMinNofHits = 3;
iNStations = 27;
iNReqStations = 4;
tofFindTracks->SetStation(0, 0, 2, 2);
tofFindTracks->SetStation(1, 0, 1, 2);
tofFindTracks->SetStation(2, 0, 0, 2);
tofFindTracks->SetStation(3, 0, 2, 1);
tofFindTracks->SetStation(4, 0, 1, 1);
tofFindTracks->SetStation(5, 0, 0, 1);
tofFindTracks->SetStation(6, 0, 2, 3);
tofFindTracks->SetStation(7, 0, 1, 3);
tofFindTracks->SetStation(8, 0, 0, 3);
tofFindTracks->SetStation(9, 0, 2, 0);
tofFindTracks->SetStation(10, 0, 1, 0);
tofFindTracks->SetStation(11, 0, 0, 0);
tofFindTracks->SetStation(12, 0, 2, 4);
tofFindTracks->SetStation(13, 0, 1, 4);
tofFindTracks->SetStation(14, 0, 0, 4);
tofFindTracks->SetStation(15, 0, 4, 0);
tofFindTracks->SetStation(16, 0, 3, 0);
tofFindTracks->SetStation(17, 0, 4, 1);
tofFindTracks->SetStation(18, 0, 3, 1);
tofFindTracks->SetStation(19, 0, 4, 2);
tofFindTracks->SetStation(20, 0, 3, 2);
tofFindTracks->SetStation(21, 0, 4, 3);
tofFindTracks->SetStation(22, 0, 3, 3);
tofFindTracks->SetStation(23, 0, 4, 4);
tofFindTracks->SetStation(24, 0, 3, 4);
tofFindTracks->SetStation(25, 9, 0, 0);
tofFindTracks->SetStation(26, 9, 0, 1);
break;
case 3: // for reduced bias tracking of full setup
iMinNofHits = 3;
iNStations = 28;
iNReqStations = 4;
tofFindTracks->SetStation(0, 0, 2, 2);
tofFindTracks->SetStation(1, 0, 1, 2);
tofFindTracks->SetStation(2, 0, 0, 2);
tofFindTracks->SetStation(3, 0, 2, 1);
tofFindTracks->SetStation(4, 0, 1, 1);