diff --git a/macro/beamtime/mcbm2020/build_event_win.C b/macro/beamtime/mcbm2020/build_event_win.C index 42dff9606cf5cb1478e0b460cab0be6ac32011da..dee2275414fad8ec055ac5a5a7276229bb04cc55 100644 --- a/macro/beamtime/mcbm2020/build_event_win.C +++ b/macro/beamtime/mcbm2020/build_event_win.C @@ -14,8 +14,8 @@ void build_event_win(UInt_t uRunId = 0, // --- Set log output levels FairLogger::GetLogger(); - //gLogger->SetLogScreenLevel("INFO"); - gLogger->SetLogScreenLevel("DEBUG"); + gLogger->SetLogScreenLevel("INFO"); + // gLogger->SetLogScreenLevel("DEBUG"); gLogger->SetLogVerbosityLevel("MEDIUM"); // MC file @@ -36,7 +36,7 @@ void build_event_win(UInt_t uRunId = 0, fRun->SetSource(inputSource); 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); fRun->SetSink(outputSink); @@ -71,7 +71,7 @@ void build_event_win(UInt_t uRunId = 0, /// Change the selection window limits for T0 as ref eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100); 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::kRich, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50); @@ -81,7 +81,7 @@ void build_event_win(UInt_t uRunId = 0, /* /// Use TOF as reference eventBuilder->SetReferenceDetector( kEventBuilderDetTof ); - eventBuilder->AddDetector( kEventBuilderDetT0 ); + eventBuilder->AddDetector(kEventBuilderDetT0); /// Change the selection window limits for TOF as ref /// => Should always be after changes of detector lists! diff --git a/macro/beamtime/mcbm2020/build_event_win_kronos.C b/macro/beamtime/mcbm2020/build_event_win_kronos.C index b5d71e57289e562aea89569e9ae3f0131420dc19..341a117f8466f9fc9d24b7097ea1ed11fad1855d 100644 --- a/macro/beamtime/mcbm2020/build_event_win_kronos.C +++ b/macro/beamtime/mcbm2020/build_event_win_kronos.C @@ -64,7 +64,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0, fRun->SetSource(inputSource); 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); fRun->SetSink(outputSink); @@ -99,7 +99,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0, /// Change the selection window limits for T0 as ref eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100); 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::kRich, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50); @@ -109,7 +109,7 @@ void build_event_win_kronos(UInt_t uRunIdx = 0, /* /// Use TOF as reference eventBuilder->SetReferenceDetector( kEventBuilderDetTof ); - eventBuilder->AddDetector( kEventBuilderDetT0 ); + eventBuilder->AddDetector(kEventBuilderDetT0); /// Change the selection window limits for TOF as ref /// => Should always be after changes of detector lists! diff --git a/macro/beamtime/mcbm2020/mcbm_build_and_reco.C b/macro/beamtime/mcbm2020/mcbm_build_and_reco.C index 34ca01145f8bb3ef9f03d4c20d5738d2562051dd..1102e135d50a41e5f365bae6bfeadfa7b62d173d 100644 --- a/macro/beamtime/mcbm2020/mcbm_build_and_reco.C +++ b/macro/beamtime/mcbm2020/mcbm_build_and_reco.C @@ -45,7 +45,6 @@ void mcbm_build_and_reco(UInt_t uRunId = 831, TList* parFileList = new TList(); // ------------------------------------------------------------------------ - // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); @@ -65,7 +64,7 @@ void mcbm_build_and_reco(UInt_t uRunId = 831, // Define output file for FairMonitor histograms TString monitorFile {outFile}; - monitorFile.ReplaceAll("rec", "rec.monitor"); + monitorFile.ReplaceAll("reco", "reco.monitor"); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); // ------------------------------------------------------------------------ @@ -248,7 +247,6 @@ void mcbm_build_and_reco(UInt_t uRunId = 831, std::cout << "-I- : Added task " << trdHit->GetName() << std::endl; // ------------------------------------------------------------------------ - // ----- Local reconstruction in TOF ---------------------------------- // ------------------------------------------------------------------------ // TOF defaults @@ -493,8 +491,8 @@ void mcbm_build_and_reco(UInt_t uRunId = 831, parIo2->open(parFileList, "in"); rtdb->setSecondInput(parIo2); - parIo3->open(parFileOut.Data(), "RECREATE"); + parIo3->open(parFileOut.Data(), "RECREATE"); // ------------------------------------------------------------------------ diff --git a/macro/beamtime/mcbm2020/mcbm_build_and_reco_kronos.C b/macro/beamtime/mcbm2020/mcbm_build_and_reco_kronos.C index fd8becba1052fbc63cd632e56e4b538fb874a8af..629bcd8eb4868f80ceefcecedf984d1aa5816cb0 100644 --- a/macro/beamtime/mcbm2020/mcbm_build_and_reco_kronos.C +++ b/macro/beamtime/mcbm2020/mcbm_build_and_reco_kronos.C @@ -97,7 +97,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, // Define output file for FairMonitor histograms TString monitorFile {outFile}; - monitorFile.ReplaceAll("rec", "rec.monitor"); + monitorFile.ReplaceAll("reco", "reco.monitor"); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); // ------------------------------------------------------------------------ @@ -132,7 +132,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, /// Change the selection window limits for T0 as ref eventBuilder->SetTriggerWindow(ECbmModuleId::kSts, -50, 100); 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::kRich, -50, 50); eventBuilder->SetTriggerWindow(ECbmModuleId::kPsd, -50, 50); @@ -142,7 +142,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, /* /// Use TOF as reference eventBuilder->SetReferenceDetector( kEventBuilderDetTof ); - eventBuilder->AddDetector( kEventBuilderDetT0 ); + eventBuilder->AddDetector(kEventBuilderDetT0); /// Change the selection window limits for TOF as ref /// => Should always be after changes of detector lists! @@ -323,7 +323,7 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, TString cTrkFile = parDir + "/tof/" + Form("%s_tofFindTracks.hst.root", cCalId.Data()); Int_t iTrackingSetup = 1; - Int_t iCalOpt = 0; + Int_t iCalOpt = 1; CbmTofTrackFinder* tofTrackFinder = new CbmTofTrackFinderNN(); tofTrackFinder->SetMaxTofTimeDifference(0.2); // in ns/cm @@ -518,8 +518,10 @@ void mcbm_build_and_reco_kronos(UInt_t uRunIdx = 28, FairParRootFileIo* parIo3 = new FairParRootFileIo(); parIo1->open(parFileIn.Data(), "READ"); rtdb->setFirstInput(parIo1); + parIo2->open(parFileList, "in"); rtdb->setSecondInput(parIo2); + parIo3->open(parFileOut.Data(), "RECREATE"); // ------------------------------------------------------------------------ diff --git a/macro/beamtime/mcbm2020/mcbm_event_reco.C b/macro/beamtime/mcbm2020/mcbm_event_reco.C index 4c5f4a77747a4f310c23c66928d7292ac6dfd453..a9a4b40c27dd366ee15ca1b848fbea71a391e5cb 100644 --- a/macro/beamtime/mcbm2020/mcbm_event_reco.C +++ b/macro/beamtime/mcbm2020/mcbm_event_reco.C @@ -23,10 +23,12 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { // ----- 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 outFile = Form("./data/reco_mcbm_%i.root", runId); + TString inFile = Form("./data/unp_mcbm_%i.root", runId); + TString parFileIn = Form("./data/unp_mcbm_params_%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 ---- // This is currently only required by the TRD (parameters) std::string geoSetupTag = "mcbm_beam_2020_03"; @@ -37,7 +39,6 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { TList* parFileList = new TList(); // ------------------------------------------------------------------------ - // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); @@ -55,7 +56,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { // Define output file for FairMonitor histograms TString monitorFile {outFile}; - monitorFile.ReplaceAll("rec", "rec.monitor"); + monitorFile.ReplaceAll("reco", "reco.monitor"); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); // ------------------------------------------------------------------------ @@ -72,9 +73,9 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { eventBuilder->SetEventBuilderAlgo(EventBuilderAlgo::FixedTimeWindow); eventBuilder->SetFixedTimeWindow(200.); eventBuilder->SetTriggerMinNumberT0(1); - // eventBuilder->SetTriggerMinNumberTrd(1); //eventBuilder->SetTriggerMinNumberSts(0); eventBuilder->SetTriggerMinNumberMuch(1); + // eventBuilder->SetTriggerMinNumberTrd(1); eventBuilder->SetTriggerMinNumberTof(10); // eventBuilder->SetFillHistos(kTRUE); run->AddTask(eventBuilder); @@ -412,11 +413,12 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { FairRuntimeDb* rtdb = run->GetRuntimeDb(); FairParRootFileIo* parIo1 = new FairParRootFileIo(); FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); - parIo1->open(parFile.Data(), "UPDATE"); - parIo2->open(parFileList, "in"); + FairParRootFileIo* parIo3 = new FairParRootFileIo(); + parIo1->open(parFileIn.Data(), "READ"); rtdb->setFirstInput(parIo1); parIo2->open(parFileList, "in"); rtdb->setSecondInput(parIo2); + parIo3->open(parFileOut.Data(), "RECREATE"); // ------------------------------------------------------------------------ @@ -424,7 +426,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { std::cout << std::endl; std::cout << "-I- " << myName << ": Initialise run" << std::endl; run->Init(); - rtdb->setOutput(parIo1); + rtdb->setOutput(parIo3); rtdb->saveOutput(); rtdb->print(); // ------------------------------------------------------------------------ @@ -445,7 +447,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = -1) { 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 << "Parameter file is " << parFileOut << std::endl; std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; std::cout << std::endl; diff --git a/macro/beamtime/mcbm2020/mcbm_event_reco_kronos.C b/macro/beamtime/mcbm2020/mcbm_event_reco_kronos.C index b99fd0b0cc8fe6484b46d5c099bc4340da256a3a..b360afcd2fc5c0b58e4433a56f2fd4ec3cdfed4f 100644 --- a/macro/beamtime/mcbm2020/mcbm_event_reco_kronos.C +++ b/macro/beamtime/mcbm2020/mcbm_event_reco_kronos.C @@ -15,9 +15,10 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { // ----- 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 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) { Form("/lustre/cbm/users/ploizeau/mcbm2020/unp_evt_data_7f229b3f_20201103/" "unp_mcbm_params_%i.root", runId); - TString parFileOut = Form("./data/reco_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 ---- @@ -60,7 +61,7 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { // Define output file for FairMonitor histograms TString monitorFile {outFile}; - monitorFile.ReplaceAll("rec", "rec.monitor"); + monitorFile.ReplaceAll("reco", "reco.monitor"); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); // ------------------------------------------------------------------------ @@ -79,7 +80,9 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { eventBuilder->SetTriggerMinNumberT0(1); //eventBuilder->SetTriggerMinNumberSts(0); eventBuilder->SetTriggerMinNumberMuch(1); + // eventBuilder->SetTriggerMinNumberTrd(1); eventBuilder->SetTriggerMinNumberTof(10); + // eventBuilder->SetFillHistos(kTRUE); run->AddTask(eventBuilder); // ------------------------------------------------------------------------ @@ -88,8 +91,6 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { // ----- Local reconstruction in MUCH --------------------------------- Int_t flag = 1; - TString parDir = - TString(gSystem->Getenv("VMCWORKDIR")) + TString("/parameters"); TString muchDigiFile( parDir + "/much/much_v19c_mcbm_digi_sector.root"); // MUCH digi file CbmMuchFindHitsGem* muchFindHits = @@ -181,7 +182,212 @@ void mcbm_event_reco(Int_t runId = 831, Int_t nTimeslices = 300) { // ----- 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); + 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); + tofFindTracks->SetStation(27, 5, 0, 0); + break; + } + tofFindTracks->SetMinNofHits(iMinNofHits); + tofFindTracks->SetNStations(iNStations); + tofFindTracks->SetNReqStations(iNReqStations); + //tofFindTracks->PrintSetup(); + run->AddTask(tofFindTracks); + } break; + case 1: { + } + case 0: + default:; + } // ----- Local reconstruction of RICH Hits ------------------------------ CbmRichMCbmHitProducer* hitProdRich = new CbmRichMCbmHitProducer(); diff --git a/macro/beamtime/mcbm2020/mcbm_reco.C b/macro/beamtime/mcbm2020/mcbm_reco.C index 9f8847891c250e7d57892e17bfb0a9ba5bc8df52..8ac6d6027b656988cf30f7f3fd62a18c0f6a59ea 100644 --- a/macro/beamtime/mcbm2020/mcbm_reco.C +++ b/macro/beamtime/mcbm2020/mcbm_reco.C @@ -23,9 +23,10 @@ void mcbm_reco(Int_t runId = 831, Int_t nTimeslices = 0) { // ----- 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 outFile = Form("./data/reco_mcbm_%i.root", runId); + TString inFile = Form("./data/unp_mcbm_%i.root", runId); + TString parFileIn = Form("./data/unp_mcbm_params_%i.root", runId); + TString parFileOut = Form("./data/reco_mcbm_params_%i.root", runId); + TString outFile = Form("./data/reco_mcbm_%i.root", runId); // ------------------------------------------------------------------------ // --- Load the geometry setup ---- @@ -55,7 +56,7 @@ void mcbm_reco(Int_t runId = 831, Int_t nTimeslices = 0) { // Define output file for FairMonitor histograms TString monitorFile {outFile}; - monitorFile.ReplaceAll("rec", "rec.monitor"); + monitorFile.ReplaceAll("reco", "reco.monitor"); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); // ------------------------------------------------------------------------ @@ -222,11 +223,12 @@ void mcbm_reco(Int_t runId = 831, Int_t nTimeslices = 0) { FairRuntimeDb* rtdb = run->GetRuntimeDb(); FairParRootFileIo* parIo1 = new FairParRootFileIo(); FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); - parIo1->open(parFile.Data(), "UPDATE"); - parIo2->open(parFileList, "in"); + FairParRootFileIo* parIo3 = new FairParRootFileIo(); + parIo1->open(parFileIn.Data(), "READ"); rtdb->setFirstInput(parIo1); parIo2->open(parFileList, "in"); rtdb->setSecondInput(parIo2); + parIo3->open(parFileOut.Data(), "RECREATE"); // ------------------------------------------------------------------------ @@ -234,7 +236,7 @@ void mcbm_reco(Int_t runId = 831, Int_t nTimeslices = 0) { std::cout << std::endl; std::cout << "-I- " << myName << ": Initialise run" << std::endl; run->Init(); - rtdb->setOutput(parIo1); + rtdb->setOutput(parIo3); rtdb->saveOutput(); rtdb->print(); // ------------------------------------------------------------------------ @@ -255,7 +257,7 @@ void mcbm_reco(Int_t runId = 831, Int_t nTimeslices = 0) { 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 << "Parameter file is " << parFileOut << std::endl; std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; std::cout << std::endl; diff --git a/macro/beamtime/mcbm2020/mcbm_reco_kronos.C b/macro/beamtime/mcbm2020/mcbm_reco_kronos.C index 2df53707813399d5cfb12e9b62643f87004ea662..16c3edc1bee9c4bbddc02efd3ab5bb0c0d6a9236 100644 --- a/macro/beamtime/mcbm2020/mcbm_reco_kronos.C +++ b/macro/beamtime/mcbm2020/mcbm_reco_kronos.C @@ -17,7 +17,8 @@ void mcbm_reco_kronos(Int_t runId = 831, Int_t nTimeslices = 0) { 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/"; - // ------------------------------------------------------------------------ + TString parDir = srcDir + "/parameters"; + // ------------------------------------------------------------------------ // ----- In- and output file names ------------------------------------ @@ -59,7 +60,7 @@ void mcbm_reco_kronos(Int_t runId = 831, Int_t nTimeslices = 0) { // Define output file for FairMonitor histograms TString monitorFile {outFile}; - monitorFile.ReplaceAll("rec", "rec.monitor"); + monitorFile.ReplaceAll("reco", "reco.monitor"); FairMonitor::GetMonitor()->EnableMonitor(kTRUE, monitorFile); // ------------------------------------------------------------------------ @@ -74,8 +75,6 @@ void mcbm_reco_kronos(Int_t runId = 831, Int_t nTimeslices = 0) { // ----- Local reconstruction in MUCH --------------------------------- Int_t flag = 1; - TString parDir = - TString(gSystem->Getenv("VMCWORKDIR")) + TString("/parameters"); TString muchDigiFile( parDir + "/much/much_v19c_mcbm_digi_sector.root"); // MUCH digi file CbmMuchFindHitsGem* muchFindHits = @@ -148,6 +147,7 @@ void mcbm_reco_kronos(Int_t runId = 831, Int_t nTimeslices = 0) { } } // -- end trd parameters + // -- beginn trd reco Double_t triggerThreshold = 0.5e-6; // Default CbmTrdClusterFinder* trdCluster = new CbmTrdClusterFinder(); trdCluster->SetNeighbourEnable(true, false); @@ -164,7 +164,39 @@ void mcbm_reco_kronos(Int_t runId = 831, Int_t nTimeslices = 0) { // ----- 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; // ----- Local reconstruction of RICH Hits ------------------------------ CbmRichMCbmHitProducer* hitProdRich = new CbmRichMCbmHitProducer();