diff --git a/macro/beamtime/mcbm2020/mcbm2020_reco.geo.root b/macro/beamtime/mcbm2020/mcbm2020_reco.geo.root new file mode 100644 index 0000000000000000000000000000000000000000..374443276a0b577ca7cea020876dc79b11d57e98 Binary files /dev/null and b/macro/beamtime/mcbm2020/mcbm2020_reco.geo.root differ diff --git a/macro/beamtime/mcbm2020/mcbm_reco.C b/macro/beamtime/mcbm2020/mcbm_reco.C index e28de7a526ba604c1326366a2e17d96bdb053cb3..1726176163d92417d68e941a0eae5a956d2d41ec 100644 --- a/macro/beamtime/mcbm2020/mcbm_reco.C +++ b/macro/beamtime/mcbm2020/mcbm_reco.C @@ -1,188 +1,202 @@ -// -------------------------------------------------------------------------- -// -// Macro for reconstruction of mcbm data (2019) -// Only STS local reconstruction (cluster + hit finder) for the time being -// -// -------------------------------------------------------------------------- - -void mcbm_reco(Int_t runId = 812, Int_t nTimeslices = 0) { - - // --- Logger settings ---------------------------------------------------- - TString logLevel = "INFO"; - TString logVerbosity = "LOW"; - // ------------------------------------------------------------------------ - - - // ----- Environment -------------------------------------------------- - TString myName = "mcbm_reco"; // this macro's name for screen output - TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory - // TString srcDir1 = gSystem->Getenv("SLURM_INDEX"); // ------------------------------------------------------------------------ - - - // ----- In- and output file names ------------------------------------ - TString inFile = Form(".data/unp_mcbm_%i.root", runId); - TString parFile = Form(".data/unp_mcbm_params_%i.root", runId); - TString geoFile = ".data/test.geo.root"; // to be created by a simulation run - TString outFile = Form(".data/reco_mcbm_%i.root", runId); - // ------------------------------------------------------------------------ - - - // ----- Timer -------------------------------------------------------- - TStopwatch timer; - timer.Start(); - // ------------------------------------------------------------------------ - - - // ---- Debug option ------------------------------------------------- - gDebug = 0; - // ------------------------------------------------------------------------ - - - // ----- FairRunAna --------------------------------------------------- - FairRunAna* run = new FairRunAna(); - FairFileSource* inputSource = new FairFileSource(inFile); - run->SetSource(inputSource); - - run->SetOutputFile(outFile); - run->SetGenerateRunInfo(kTRUE); - run->SetGeomFile(geoFile); - - TString monitorFile {outFile}; - monitorFile.ReplaceAll("rec", "rec.monitor"); - FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); - // ----------------------------------------------------------------------- - - - // ----- Logger settings ---------------------------------------------- - FairLogger::GetLogger()->SetLogScreenLevel(logLevel.Data()); - FairLogger::GetLogger()->SetLogVerbosityLevel(logVerbosity.Data()); - // ------------------------------------------------------------------------ - - - // ----- Reconstruction tasks ----------------------------------------- - - - // ----- Psd hit producer ---------------------------------------------- - CbmPsdMCbmHitProducer* hitProd = new CbmPsdMCbmHitProducer(); - run->AddTask(hitProd); - // ------------------------------------------------------------------------ - - - // ----- Local reconstruction in STS ---------------------------------- - CbmRecoSts* recoSts = new CbmRecoSts(); - //recoSts->SetTimeCutDigisAbs( 100 );// cluster finder: time cut in ns - //recoSts->SetTimeCutClustersAbs(100.); // hit finder: time cut in ns - - // ASIC params: #ADC channels, dyn. range, threshold, time resol., dead time, - // noise RMS, zero-threshold crossing rate - auto parAsic = - new CbmStsParAsic(32, 75000., 3000., 5., 800., 1000., 3.9789e-3); - - // Module params: number of channels, number of channels per ASIC - auto parMod = new CbmStsParModule(2048, 128); - parMod->SetAllAsics(*parAsic); - recoSts->UseModulePar(parMod); - - // Sensor params - auto sensorPar = new CbmStsParSensor(CbmStsSensorClass::kDssdStereo); - sensorPar->SetPar(0, 6.2092); // Extension in x - sensorPar->SetPar(1, 6.2); // Extension in y - sensorPar->SetPar(2, 0.03); // Extension in z - sensorPar->SetPar(3, 5.9692); // Active size in y - sensorPar->SetPar(4, 1024.); // Number of strips front side - sensorPar->SetPar(5, 1024.); // Number of strips back side - sensorPar->SetPar(6, 0.0058); // Strip pitch front side - sensorPar->SetPar(7, 0.0058); // Strip pitch back side - sensorPar->SetPar(8, 7.5); // Stereo angle front side - sensorPar->SetPar(9, 0.0); // Stereo angle back side - recoSts->UseSensorPar(sensorPar); - - // Sensor conditions: full depletion voltage, bias voltage, temperature, - // coupling capacitance, inter-strip capacitance - auto sensorCond = new CbmStsParSensorCond(70., 140., 268., 17.5, 1.); - recoSts->UseSensorCond(sensorCond); - - run->AddTask(recoSts); - std::cout << "-I- : Added task " << recoSts->GetName() << std::endl; - // ------------------------------------------------------------------------ - - - // ----- Local reconstruction of RICH Hits ------------------------------ - CbmRichMCbmHitProducer* hitProd = new CbmRichMCbmHitProducer(); - hitProd->setToTLimits(23.7, 30.0); - hitProd->applyToTCut(); - run->AddTask(hitProd); - // ------------------------------------------------------------------------ - - - // ----- Local reconstruction in RICh -> Finding of Rings --------------- - CbmRichReconstruction* richReco = new CbmRichReconstruction(); - richReco->UseMCbmSetup(); - run->AddTask(richReco); - // ------------------------------------------------------------------------ - - // ----- Parameter database -------------------------------------------- - std::cout << std::endl << std::endl; - std::cout << "-I- " << myName << ": Set runtime DB" << std::endl; - FairRuntimeDb* rtdb = run->GetRuntimeDb(); - FairParRootFileIo* parIo1 = new FairParRootFileIo(); - FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); - parIo1->open(parFile.Data(), "UPDATE"); - rtdb->setFirstInput(parIo1); - // ------------------------------------------------------------------------ - - - // ----- Run initialisation ------------------------------------------- - std::cout << std::endl; - std::cout << "-I- " << myName << ": Initialise run" << std::endl; - run->Init(); - rtdb->setOutput(parIo1); - rtdb->saveOutput(); - rtdb->print(); - // ------------------------------------------------------------------------ - - - // ----- Start run ---------------------------------------------------- - std::cout << std::endl << std::endl; - std::cout << "-I- " << myName << ": Starting run" << std::endl; - run->Run(0, nTimeslices); - // ------------------------------------------------------------------------ - - - // ----- Finish ------------------------------------------------------- - timer.Stop(); - FairMonitor::GetMonitor()->Print(); - Double_t rtime = timer.RealTime(); - Double_t ctime = timer.CpuTime(); - std::cout << std::endl << std::endl; - std::cout << "Macro finished successfully." << std::endl; - std::cout << "Output file is " << outFile << std::endl; - std::cout << "Parameter file is " << parFile << std::endl; - std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" - << std::endl; - std::cout << std::endl; - std::cout << " Test passed" << std::endl; - std::cout << " All ok " << std::endl; - // ------------------------------------------------------------------------ - - - // ----- Resource monitoring ------------------------------------------ - // 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(); - std::cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">"; - std::cout << maxMemory; - std::cout << "</DartMeasurement>" << std::endl; - - Float_t cpuUsage = ctime / rtime; - std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">"; - std::cout << cpuUsage; - std::cout << "</DartMeasurement>" << std::endl; - // ------------------------------------------------------------------------ - - - // ----- Function needed for CTest runtime dependency ----------------- - // RemoveGeoManager(); - // ------------------------------------------------------------------------ -} +// -------------------------------------------------------------------------- +// +// Macro for reconstruction of mcbm data (2019) +// Only STS local reconstruction (cluster + hit finder) for the time being +// +// -------------------------------------------------------------------------- + +void mcbm_reco(Int_t runId = 812, Int_t nTimeslices = 0) { + + // --- Logger settings ---------------------------------------------------- + TString logLevel = "INFO"; + TString logVerbosity = "LOW"; + // ------------------------------------------------------------------------ + + + // ----- Environment -------------------------------------------------- + TString myName = "mcbm_reco"; // this macro's name for screen output + TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory + TString paramDir = srcDir + "/macro/beamtime/mcbm2020/"; + // ------------------------------------------------------------------------ + + + // ----- In- and output file names ------------------------------------ + TString inFile = Form("./data/unp_mcbm_%i.root", runId); + TString parFile = Form("./data/unp_mcbm_params_%i.root", runId); + TString geoFile = paramDir + "mcbm2020_reco.geo.root"; // Created by a simulation run + TString outFile = Form("./data/reco_mcbm_%i.root", runId); + // ------------------------------------------------------------------------ + + + // ----- Timer -------------------------------------------------------- + TStopwatch timer; + timer.Start(); + // ------------------------------------------------------------------------ + + + // ---- Debug option ------------------------------------------------- + gDebug = 0; + // ------------------------------------------------------------------------ + + + // ----- FairRunAna --------------------------------------------------- + FairRunAna* run = new FairRunAna(); + FairFileSource* inputSource = new FairFileSource(inFile); + run->SetSource(inputSource); + + run->SetOutputFile(outFile); + run->SetGenerateRunInfo(kTRUE); + run->SetGeomFile(geoFile); + + TString monitorFile {outFile}; + monitorFile.ReplaceAll("rec", "rec.monitor"); + FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); + // ----------------------------------------------------------------------- + + + // ----- Logger settings ---------------------------------------------- + FairLogger::GetLogger()->SetLogScreenLevel(logLevel.Data()); + FairLogger::GetLogger()->SetLogVerbosityLevel(logVerbosity.Data()); + // ------------------------------------------------------------------------ + + + // ----- Reconstruction tasks ----------------------------------------- + + + // ----- Local reconstruction in STS ---------------------------------- + CbmRecoSts* recoSts = new CbmRecoSts(); + //recoSts->SetTimeCutDigisAbs( 100 );// cluster finder: time cut in ns + //recoSts->SetTimeCutClustersAbs(100.); // hit finder: time cut in ns + + // ASIC params: #ADC channels, dyn. range, threshold, time resol., dead time, + // noise RMS, zero-threshold crossing rate + auto parAsic = + new CbmStsParAsic(32, 75000., 3000., 5., 800., 1000., 3.9789e-3); + + // Module params: number of channels, number of channels per ASIC + auto parMod = new CbmStsParModule(2048, 128); + parMod->SetAllAsics(*parAsic); + recoSts->UseModulePar(parMod); + + // Sensor params + auto sensorPar = new CbmStsParSensor(CbmStsSensorClass::kDssdStereo); + sensorPar->SetPar(0, 6.2092); // Extension in x + sensorPar->SetPar(1, 6.2); // Extension in y + sensorPar->SetPar(2, 0.03); // Extension in z + sensorPar->SetPar(3, 5.9692); // Active size in y + sensorPar->SetPar(4, 1024.); // Number of strips front side + sensorPar->SetPar(5, 1024.); // Number of strips back side + sensorPar->SetPar(6, 0.0058); // Strip pitch front side + sensorPar->SetPar(7, 0.0058); // Strip pitch back side + sensorPar->SetPar(8, 7.5); // Stereo angle front side + sensorPar->SetPar(9, 0.0); // Stereo angle back side + recoSts->UseSensorPar(sensorPar); + + // Sensor conditions: full depletion voltage, bias voltage, temperature, + // coupling capacitance, inter-strip capacitance + auto sensorCond = new CbmStsParSensorCond(70., 140., 268., 17.5, 1.); + recoSts->UseSensorCond(sensorCond); + + run->AddTask(recoSts); + std::cout << "-I- : Added task " << recoSts->GetName() << std::endl; + // ------------------------------------------------------------------------ + + + // ----- Local reconstruction in MUCH --------------------------------- + // ------------------------------------------------------------------------ + + + // ----- Local reconstruction in TRD ---------------------------------- + // ------------------------------------------------------------------------ + + + // ----- Local reconstruction in TOF ---------------------------------- + // ------------------------------------------------------------------------ + + + // ----- Local reconstruction of RICH Hits ------------------------------ + CbmRichMCbmHitProducer* hitProdRich = new CbmRichMCbmHitProducer(); + hitProdRich->setToTLimits(23.7, 30.0); + hitProdRich->applyToTCut(); + run->AddTask(hitProdRich); + // ------------------------------------------------------------------------ + + // ----- Local reconstruction in RICh -> Finding of Rings --------------- + CbmRichReconstruction* richReco = new CbmRichReconstruction(); + richReco->UseMCbmSetup(); + run->AddTask(richReco); + // ------------------------------------------------------------------------ + + + // ----- Psd hit producer ---------------------------------------------- + CbmPsdMCbmHitProducer* hitProdPsd = new CbmPsdMCbmHitProducer(); + run->AddTask(hitProdPsd); + // ------------------------------------------------------------------------ + + // ----- Parameter database -------------------------------------------- + std::cout << std::endl << std::endl; + std::cout << "-I- " << myName << ": Set runtime DB" << std::endl; + FairRuntimeDb* rtdb = run->GetRuntimeDb(); + FairParRootFileIo* parIo1 = new FairParRootFileIo(); + FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); + parIo1->open(parFile.Data(), "UPDATE"); + rtdb->setFirstInput(parIo1); + // ------------------------------------------------------------------------ + + + // ----- Run initialisation ------------------------------------------- + std::cout << std::endl; + std::cout << "-I- " << myName << ": Initialise run" << std::endl; + run->Init(); + rtdb->setOutput(parIo1); + rtdb->saveOutput(); + rtdb->print(); + // ------------------------------------------------------------------------ + + + // ----- Start run ---------------------------------------------------- + std::cout << std::endl << std::endl; + std::cout << "-I- " << myName << ": Starting run" << std::endl; + run->Run(0, nTimeslices); + // ------------------------------------------------------------------------ + + + // ----- Finish ------------------------------------------------------- + timer.Stop(); + FairMonitor::GetMonitor()->Print(); + Double_t rtime = timer.RealTime(); + Double_t ctime = timer.CpuTime(); + std::cout << std::endl << std::endl; + std::cout << "Macro finished successfully." << std::endl; + std::cout << "Output file is " << outFile << std::endl; + std::cout << "Parameter file is " << parFile << std::endl; + std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" + << std::endl; + std::cout << std::endl; + // ------------------------------------------------------------------------ + + + // ----- Resource monitoring ------------------------------------------ + // 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(); + std::cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">"; + std::cout << maxMemory; + std::cout << "</DartMeasurement>" << std::endl; + + Float_t cpuUsage = ctime / rtime; + std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">"; + std::cout << cpuUsage; + std::cout << "</DartMeasurement>" << std::endl; + // ------------------------------------------------------------------------ + + + // ----- Function needed for CTest runtime dependency ----------------- + // RemoveGeoManager(); + // ------------------------------------------------------------------------ + + /// --- Screen output for automatic tests + std::cout << " Test passed" << std::endl; + std::cout << " All ok " << std::endl; +} diff --git a/macro/beamtime/mcbm2020/mcbm_reco_kronos.C b/macro/beamtime/mcbm2020/mcbm_reco_kronos.C index d09949951334701e5a719adf7dc3978838884f9c..ab222e04305154610b2ee37163a6a7adae00d802 100644 --- a/macro/beamtime/mcbm2020/mcbm_reco_kronos.C +++ b/macro/beamtime/mcbm2020/mcbm_reco_kronos.C @@ -1,197 +1,206 @@ -// -------------------------------------------------------------------------- -// -// Macro for reconstruction of mcbm data (2019) -// Only STS local reconstruction (cluster + hit finder) for the time being -// -// -------------------------------------------------------------------------- - -void mcbm_reco(Int_t runId = 812, Int_t nTimeslices = 0) { - - // --- Logger settings ---------------------------------------------------- - TString logLevel = "INFO"; - TString logVerbosity = "LOW"; - // ------------------------------------------------------------------------ - - - // ----- Environment -------------------------------------------------- - TString myName = "mcbm_reco"; // this macro's name for screen output - TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory - // TString srcDir1 = gSystem->Getenv("SLURM_INDEX"); // ------------------------------------------------------------------------ - - - // ----- In- and output file names ------------------------------------ - TString inFile = Form("/lustre/cbm/users/ploizeau/mcbm2020/" - "unp_evt_data_7f229b3f_20201103/unp_mcbm_%i.root", - runId); - TString parFile = - Form("/lustre/cbm/users/ploizeau/mcbm2020/unp_evt_data_7f229b3f_20201103/" - "unp_mcbm_params_%i.root", - runId); - TString geoFile = - "/lustre/cbm/users/alberica/cbmroot/macro/beamtime/mcbm2020/data/" - "test.geo.root"; // to be created by a simulation run - TString outFile = Form("/lustre/cbm/users/ploizeau/mcbm2020/" - "unp_evt_data_7f229b3f_20201103/reco_mcbm_%i.root", - runId); - // ------------------------------------------------------------------------ - - - // ----- Timer -------------------------------------------------------- - TStopwatch timer; - timer.Start(); - // ------------------------------------------------------------------------ - - - // ---- Debug option ------------------------------------------------- - gDebug = 0; - // ------------------------------------------------------------------------ - - - // ----- FairRunAna --------------------------------------------------- - FairRunAna* run = new FairRunAna(); - FairFileSource* inputSource = new FairFileSource(inFile); - run->SetSource(inputSource); - - run->SetOutputFile(outFile); - run->SetGenerateRunInfo(kTRUE); - run->SetGeomFile(geoFile); - - TString monitorFile {outFile}; - monitorFile.ReplaceAll("rec", "rec.monitor"); - FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); - // ----------------------------------------------------------------------- - - - // ----- Logger settings ---------------------------------------------- - FairLogger::GetLogger()->SetLogScreenLevel(logLevel.Data()); - FairLogger::GetLogger()->SetLogVerbosityLevel(logVerbosity.Data()); - // ------------------------------------------------------------------------ - - - // ----- Reconstruction tasks ----------------------------------------- - - - // ----- Psd hit producer ---------------------------------------------- - CbmPsdMCbmHitProducer* hitProd = new CbmPsdMCbmHitProducer(); - run->AddTask(hitProd); - // ------------------------------------------------------------------------ - - - // ----- Local reconstruction in STS ---------------------------------- - CbmRecoSts* recoSts = new CbmRecoSts(); - //recoSts->SetTimeCutDigisAbs( 100 );// cluster finder: time cut in ns - //recoSts->SetTimeCutClustersAbs(100.); // hit finder: time cut in ns - - // ASIC params: #ADC channels, dyn. range, threshold, time resol., dead time, - // noise RMS, zero-threshold crossing rate - auto parAsic = - new CbmStsParAsic(32, 75000., 3000., 5., 800., 1000., 3.9789e-3); - - // Module params: number of channels, number of channels per ASIC - auto parMod = new CbmStsParModule(2048, 128); - parMod->SetAllAsics(*parAsic); - recoSts->UseModulePar(parMod); - - // Sensor params - auto sensorPar = new CbmStsParSensor(CbmStsSensorClass::kDssdStereo); - sensorPar->SetPar(0, 6.2092); // Extension in x - sensorPar->SetPar(1, 6.2); // Extension in y - sensorPar->SetPar(2, 0.03); // Extension in z - sensorPar->SetPar(3, 5.9692); // Active size in y - sensorPar->SetPar(4, 1024.); // Number of strips front side - sensorPar->SetPar(5, 1024.); // Number of strips back side - sensorPar->SetPar(6, 0.0058); // Strip pitch front side - sensorPar->SetPar(7, 0.0058); // Strip pitch back side - sensorPar->SetPar(8, 7.5); // Stereo angle front side - sensorPar->SetPar(9, 0.0); // Stereo angle back side - recoSts->UseSensorPar(sensorPar); - - // Sensor conditions: full depletion voltage, bias voltage, temperature, - // coupling capacitance, inter-strip capacitance - auto sensorCond = new CbmStsParSensorCond(70., 140., 268., 17.5, 1.); - recoSts->UseSensorCond(sensorCond); - - run->AddTask(recoSts); - std::cout << "-I- : Added task " << recoSts->GetName() << std::endl; - // ------------------------------------------------------------------------ - - - // ----- Local reconstruction of RICH Hits ------------------------------ - CbmRichMCbmHitProducer* hitProd = new CbmRichMCbmHitProducer(); - hitProd->setToTLimits(23.7, 30.0); - hitProd->applyToTCut(); - run->AddTask(hitProd); - // ------------------------------------------------------------------------ - - - // ----- Local reconstruction in RICh -> Finding of Rings --------------- - CbmRichReconstruction* richReco = new CbmRichReconstruction(); - richReco->UseMCbmSetup(); - run->AddTask(richReco); - // ------------------------------------------------------------------------ - - // ----- Parameter database -------------------------------------------- - std::cout << std::endl << std::endl; - std::cout << "-I- " << myName << ": Set runtime DB" << std::endl; - FairRuntimeDb* rtdb = run->GetRuntimeDb(); - FairParRootFileIo* parIo1 = new FairParRootFileIo(); - FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); - parIo1->open(parFile.Data(), "UPDATE"); - rtdb->setFirstInput(parIo1); - // ------------------------------------------------------------------------ - - - // ----- Run initialisation ------------------------------------------- - std::cout << std::endl; - std::cout << "-I- " << myName << ": Initialise run" << std::endl; - run->Init(); - rtdb->setOutput(parIo1); - rtdb->saveOutput(); - rtdb->print(); - // ------------------------------------------------------------------------ - - - // ----- Start run ---------------------------------------------------- - std::cout << std::endl << std::endl; - std::cout << "-I- " << myName << ": Starting run" << std::endl; - run->Run(0, nTimeslices); - // ------------------------------------------------------------------------ - - - // ----- Finish ------------------------------------------------------- - timer.Stop(); - FairMonitor::GetMonitor()->Print(); - Double_t rtime = timer.RealTime(); - Double_t ctime = timer.CpuTime(); - std::cout << std::endl << std::endl; - std::cout << "Macro finished successfully." << std::endl; - std::cout << "Output file is " << outFile << std::endl; - std::cout << "Parameter file is " << parFile << std::endl; - std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" - << std::endl; - std::cout << std::endl; - std::cout << " Test passed" << std::endl; - std::cout << " All ok " << std::endl; - // ------------------------------------------------------------------------ - - - // ----- Resource monitoring ------------------------------------------ - // 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(); - std::cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">"; - std::cout << maxMemory; - std::cout << "</DartMeasurement>" << std::endl; - - Float_t cpuUsage = ctime / rtime; - std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">"; - std::cout << cpuUsage; - std::cout << "</DartMeasurement>" << std::endl; - // ------------------------------------------------------------------------ - - - // ----- Function needed for CTest runtime dependency ----------------- - // RemoveGeoManager(); - // ------------------------------------------------------------------------ -} +// -------------------------------------------------------------------------- +// +// Macro for reconstruction of mcbm data (2019) +// Only STS local reconstruction (cluster + hit finder) for the time being +// +// -------------------------------------------------------------------------- + +void mcbm_reco(Int_t runId = 812, Int_t nTimeslices = 0) { + + // --- Logger settings ---------------------------------------------------- + TString logLevel = "INFO"; + TString logVerbosity = "LOW"; + // ------------------------------------------------------------------------ + + + // ----- Environment -------------------------------------------------- + TString myName = "mcbm_reco"; // this macro's name for screen output + TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory + // TString srcDir1 = gSystem->Getenv("SLURM_INDEX"); // ------------------------------------------------------------------------ + + + // ----- In- and output file names ------------------------------------ + TString inFile = Form("/lustre/cbm/users/ploizeau/mcbm2020/" + "unp_evt_data_7f229b3f_20201103/unp_mcbm_%i.root", + runId); + TString parFile = + Form("/lustre/cbm/users/ploizeau/mcbm2020/unp_evt_data_7f229b3f_20201103/" + "unp_mcbm_params_%i.root", + runId); + TString geoFile = "./mcbm2020_reco.geo.root"; // Created by a simulation run + TString outFile = Form("./data/reco_mcbm_%i.root", runId); + // ------------------------------------------------------------------------ + + + // ----- Timer -------------------------------------------------------- + TStopwatch timer; + timer.Start(); + // ------------------------------------------------------------------------ + + + // ---- Debug option ------------------------------------------------- + gDebug = 0; + // ------------------------------------------------------------------------ + + + // ----- FairRunAna --------------------------------------------------- + FairRunAna* run = new FairRunAna(); + FairFileSource* inputSource = new FairFileSource(inFile); + run->SetSource(inputSource); + + run->SetOutputFile(outFile); + run->SetGenerateRunInfo(kTRUE); + run->SetGeomFile(geoFile); + + TString monitorFile {outFile}; + monitorFile.ReplaceAll("rec", "rec.monitor"); + FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); + // ----------------------------------------------------------------------- + + + // ----- Logger settings ---------------------------------------------- + FairLogger::GetLogger()->SetLogScreenLevel(logLevel.Data()); + FairLogger::GetLogger()->SetLogVerbosityLevel(logVerbosity.Data()); + // ------------------------------------------------------------------------ + + + // ----- Reconstruction tasks ----------------------------------------- + + + // ----- Local reconstruction in STS ---------------------------------- + CbmRecoSts* recoSts = new CbmRecoSts(); + //recoSts->SetTimeCutDigisAbs( 100 );// cluster finder: time cut in ns + //recoSts->SetTimeCutClustersAbs(100.); // hit finder: time cut in ns + + // ASIC params: #ADC channels, dyn. range, threshold, time resol., dead time, + // noise RMS, zero-threshold crossing rate + auto parAsic = + new CbmStsParAsic(32, 75000., 3000., 5., 800., 1000., 3.9789e-3); + + // Module params: number of channels, number of channels per ASIC + auto parMod = new CbmStsParModule(2048, 128); + parMod->SetAllAsics(*parAsic); + recoSts->UseModulePar(parMod); + + // Sensor params + auto sensorPar = new CbmStsParSensor(CbmStsSensorClass::kDssdStereo); + sensorPar->SetPar(0, 6.2092); // Extension in x + sensorPar->SetPar(1, 6.2); // Extension in y + sensorPar->SetPar(2, 0.03); // Extension in z + sensorPar->SetPar(3, 5.9692); // Active size in y + sensorPar->SetPar(4, 1024.); // Number of strips front side + sensorPar->SetPar(5, 1024.); // Number of strips back side + sensorPar->SetPar(6, 0.0058); // Strip pitch front side + sensorPar->SetPar(7, 0.0058); // Strip pitch back side + sensorPar->SetPar(8, 7.5); // Stereo angle front side + sensorPar->SetPar(9, 0.0); // Stereo angle back side + recoSts->UseSensorPar(sensorPar); + + // Sensor conditions: full depletion voltage, bias voltage, temperature, + // coupling capacitance, inter-strip capacitance + auto sensorCond = new CbmStsParSensorCond(70., 140., 268., 17.5, 1.); + recoSts->UseSensorCond(sensorCond); + + run->AddTask(recoSts); + std::cout << "-I- : Added task " << recoSts->GetName() << std::endl; + // ------------------------------------------------------------------------ + + + // ----- Local reconstruction in MUCH --------------------------------- + // ------------------------------------------------------------------------ + + + // ----- Local reconstruction in TRD ---------------------------------- + // ------------------------------------------------------------------------ + + + // ----- Local reconstruction in TOF ---------------------------------- + // ------------------------------------------------------------------------ + + + // ----- Local reconstruction of RICH Hits ------------------------------ + CbmRichMCbmHitProducer* hitProdRich = new CbmRichMCbmHitProducer(); + hitProdRich->setToTLimits(23.7, 30.0); + hitProdRich->applyToTCut(); + run->AddTask(hitProdRich); + // ------------------------------------------------------------------------ + + // ----- Local reconstruction in RICh -> Finding of Rings --------------- + CbmRichReconstruction* richReco = new CbmRichReconstruction(); + richReco->UseMCbmSetup(); + run->AddTask(richReco); + // ------------------------------------------------------------------------ + + + // ----- Psd hit producer ---------------------------------------------- + CbmPsdMCbmHitProducer* hitProdPsd = new CbmPsdMCbmHitProducer(); + run->AddTask(hitProdPsd); + // ------------------------------------------------------------------------ + + // ----- Parameter database -------------------------------------------- + std::cout << std::endl << std::endl; + std::cout << "-I- " << myName << ": Set runtime DB" << std::endl; + FairRuntimeDb* rtdb = run->GetRuntimeDb(); + FairParRootFileIo* parIo1 = new FairParRootFileIo(); + FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); + parIo1->open(parFile.Data(), "UPDATE"); + rtdb->setFirstInput(parIo1); + // ------------------------------------------------------------------------ + + + // ----- Run initialisation ------------------------------------------- + std::cout << std::endl; + std::cout << "-I- " << myName << ": Initialise run" << std::endl; + run->Init(); + rtdb->setOutput(parIo1); + rtdb->saveOutput(); + rtdb->print(); + // ------------------------------------------------------------------------ + + + // ----- Start run ---------------------------------------------------- + std::cout << std::endl << std::endl; + std::cout << "-I- " << myName << ": Starting run" << std::endl; + run->Run(0, nTimeslices); + // ------------------------------------------------------------------------ + + + // ----- Finish ------------------------------------------------------- + timer.Stop(); + FairMonitor::GetMonitor()->Print(); + Double_t rtime = timer.RealTime(); + Double_t ctime = timer.CpuTime(); + std::cout << std::endl << std::endl; + std::cout << "Macro finished successfully." << std::endl; + std::cout << "Output file is " << outFile << std::endl; + std::cout << "Parameter file is " << parFile << std::endl; + std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" + << std::endl; + std::cout << std::endl; + // ------------------------------------------------------------------------ + + + // ----- Resource monitoring ------------------------------------------ + // 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(); + std::cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">"; + std::cout << maxMemory; + std::cout << "</DartMeasurement>" << std::endl; + + Float_t cpuUsage = ctime / rtime; + std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">"; + std::cout << cpuUsage; + std::cout << "</DartMeasurement>" << std::endl; + // ------------------------------------------------------------------------ + + + // ----- Function needed for CTest runtime dependency ----------------- + // RemoveGeoManager(); + // ------------------------------------------------------------------------ + + /// --- Screen output for automatic tests + std::cout << " Test passed" << std::endl; + std::cout << " All ok " << std::endl; +}