diff --git a/macro/beamtime/mcbm2022/.gitignore b/macro/beamtime/mcbm2022/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d02b7938421327f5d673a27c83198d0dd62b88f5 --- /dev/null +++ b/macro/beamtime/mcbm2022/.gitignore @@ -0,0 +1,4 @@ +*.hst.root +L1material.root +TofBadChannels.txt +rec/ diff --git a/macro/beamtime/mcbm2022/mcbm_digievent_display.C b/macro/beamtime/mcbm2022/mcbm_digievent_display.C index d53c3c81aa275cc29a5db60dbea664fe2017fd78..381502c1af5fb6b0b4c80753b3eaf7278a1805d4 100644 --- a/macro/beamtime/mcbm2022/mcbm_digievent_display.C +++ b/macro/beamtime/mcbm2022/mcbm_digievent_display.C @@ -9,6 +9,16 @@ // // -------------------------------------------------------------------------- +/** + ** HOWTO: + ** 1) Create the subfolder "rec/<RUN ID>" + ** 2) Copy from nh lustre folder the digievent and param files for <RUN ID>.4.0000 into the data subfolder + ** 3) Copy from nh lustre folder the ini_Clusterizer.C and ini_trks.C macros in the current macro folder + ** 4) Copy from nh lustre folder mcbm_beam_2022_05_23_nickel.geo.root into "macro/mcbm/data" + ** 5) Copy from nh lustre folder AlignmentMatrices_mcbm_beam_2022_05_23_nickel.root into the data subfolder + ** 6) Change the log level at l.259 of reco/L1/CbmL1.cxx from "fatal" to "warn" and recompile + **/ + #include <math.h> #include <stdio.h> #include <string.h> @@ -18,9 +28,9 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, Int_t nTimeslices = 10, Int_t iFirstTimeslice = 0, - Int_t iACut = 0, + Int_t iACut = 0, TString cFId = "4.0000", - TString sInpDir = "./data/", + TString sInpDir = "./data/", TString sOutDir = "./rec/", Int_t iUnpFileIndex = -1) { @@ -188,7 +198,9 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, // ----- FairRunAna --------------------------------------------------- FairRunAna* run = new FairRunAna(); FairFileSource* inputSource; - if (iUnpFileIndex == -1) { inputSource = new FairFileSource(inFile + ".root"); } + if (iUnpFileIndex == -1) { + inputSource = new FairFileSource(inFile + ".root"); + } else { inputSource = new FairFileSource(inFile + "-0.root"); for (int i = 1; i < iUnpFileIndex; i++) { @@ -202,7 +214,7 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, run->SetGeomFile(geoFile); // Define output file for FairMonitor histograms - TString monitorFile {outFile}; + TString monitorFile{outFile}; monitorFile.ReplaceAll("dis", "dis.monitor"); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); // ------------------------------------------------------------------------ @@ -221,14 +233,14 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, // (Fairsoft Apr21p2 or newer is needed) - TString alignmentMatrixFileName = "AlignmentMatrices_" + geoSetupTag + ".root"; + TString alignmentMatrixFileName = "data/AlignmentMatrices_" + geoSetupTag + ".root"; if (alignmentMatrixFileName.Length() != 0) { std::cout << "-I- " << myName << ": Applying alignment for file " << alignmentMatrixFileName << std::endl; // Define the basic structure which needs to be filled with information // This structure is stored in the output file and later passed to the // FairRoot framework to do the (miss)alignment - std::map<std::string, TGeoHMatrix>* matrices {nullptr}; + std::map<std::string, TGeoHMatrix>* matrices{nullptr}; // read matrices from disk LOG(info) << "Filename: " << alignmentMatrixFileName; @@ -242,7 +254,9 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, exit(1); } - if (matrices) { run->AddAlignmentMatrices(*matrices); } + if (matrices) { + run->AddAlignmentMatrices(*matrices); + } else { LOG(error) << "Alignment required but no matrices found." << "\n Exiting"; @@ -480,6 +494,17 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, run->AddTask(kalman); CbmL1* l1 = new CbmL1(); l1->SetMcbmMode(); + + if (!geoSetup->IsActive(ECbmModuleId::kMuch)) { + // Disable tracking with MUCH stations if not present or disabled in setup + l1->DisableTrackingStation(cbm::algo::ca::EDetectorID::kMuch, 0); + l1->DisableTrackingStation(cbm::algo::ca::EDetectorID::kMuch, 1); + l1->DisableTrackingStation(cbm::algo::ca::EDetectorID::kMuch, 2); + } + // l1->SetMisalignmentSts(.2, .2, 10.); + // l1->SetMisalignmentTrd(2., 2., 10.); + // l1->SetMisalignmentTof(.2, .2, 10.); + run->AddTask(l1); CbmL1GlobalTrackFinder* globalTrackFinder = new CbmL1GlobalTrackFinder(); @@ -493,7 +518,9 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, // e.g for RICH: CbmRichMCbmQaReal* qaTask = new CbmRichMCbmQaReal(); Int_t taskId = 1; - if (taskId < 0) { qaTask->SetOutputDir(Form("result_run%d", uRunId)); } + if (taskId < 0) { + qaTask->SetOutputDir(Form("result_run%d", uRunId)); + } else { qaTask->SetOutputDir(Form("result_run%d_%05d", uRunId, taskId)); } @@ -527,7 +554,7 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, tofExtendTracks->SetCutStationMaxHitMul(100.); tofExtendTracks->SetNTrkTofMax(50); //run->AddTask(tofExtendTracks); - + /* // ------------------------------------------------------------------------ // Hadron analysis, lambda search // @@ -1253,7 +1280,7 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, break; default: std::cout << "-I- " << myName << ": Analysis cuts not available! Stop here." << std::endl; return kFALSE; } - + */ //run->AddTask(HadronAna); // causes crash due to global track vertex fit // ----- Parameter database -------------------------------------------- @@ -1280,7 +1307,7 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, fMan->SetXMLConfig(sXmlGeoConfig); fMan->SetDisplayMcbm(false); // ---------------------------------------------------------------------------------------------------------------- // - /* + /* CbmEvDisTracks* Tracks = new CbmEvDisTracks("TofTracks", 1, kFALSE, kTRUE); //name, verbosity, RnrChildren points, RnrChildren track fMan->AddTask(Tracks); @@ -1297,7 +1324,7 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, */ /* CbmPixelHitSetDraw* TrdHits = new CbmPixelHitSetDraw("TrdHit", kYellow, kOpenSquare); - fMan->AddTask(TrdHits); + fMan->AddTask(TrdHits); CbmPixelHitSetDraw* RichHits = new CbmPixelHitSetDraw("RichHit", kGreen, kOpenSquare); fMan->AddTask(RichHits); @@ -1353,7 +1380,7 @@ Bool_t mcbm_digievent_display(UInt_t uRunId = 2391, // ----- Function needed for CTest runtime dependency ----------------- - RemoveGeoManager(); + // RemoveGeoManager(); // ------------------------------------------------------------------------ //gSystem->Exec(Form("./RmLocalCopy.sh %s %s", sInpDir.Data(), cFileName.Data() ));