diff --git a/macro/beamtime/mcbm2019/unpack_tsa_mcbm.C b/macro/beamtime/mcbm2019/unpack_tsa_mcbm.C index 456dd6069a0f0ff2b15c96bbbc6bf8952ee804ec..9ce3503fa3051d17b5d304c916b2f515df7e6512 100644 --- a/macro/beamtime/mcbm2019/unpack_tsa_mcbm.C +++ b/macro/beamtime/mcbm2019/unpack_tsa_mcbm.C @@ -82,6 +82,7 @@ void unpack_tsa_mcbm(TString inFile = "", CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); CbmMcbm2018UnpackerTaskRich* unpacker_rich = new CbmMcbm2018UnpackerTaskRich(); + CbmMcbm2018UnpackerTaskHodo* unpacker_hodo = new CbmMcbm2018UnpackerTaskHodo(); CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); unpacker_sts->SetMonitorMode(); diff --git a/macro/beamtime/mcbm2019/unpack_tsa_mcbm_kronos.C b/macro/beamtime/mcbm2019/unpack_tsa_mcbm_kronos.C index 635bc828c8d3e7c4b6bcc4eca3dfc19eb4520f51..640d74cf5c76ccceeae58cf4923653c01b1ad4e8 100644 --- a/macro/beamtime/mcbm2019/unpack_tsa_mcbm_kronos.C +++ b/macro/beamtime/mcbm2019/unpack_tsa_mcbm_kronos.C @@ -78,6 +78,7 @@ void unpack_tsa_mcbm_kronos(UInt_t uRunId = 0, CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); CbmMcbm2018UnpackerTaskRich* unpacker_rich = new CbmMcbm2018UnpackerTaskRich(); + CbmMcbm2018UnpackerTaskHodo* unpacker_hodo = new CbmMcbm2018UnpackerTaskHodo(); CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); unpacker_sts->SetMonitorMode(); diff --git a/macro/beamtime/mcbm2019/unpack_tsa_mcbm_mfles.C b/macro/beamtime/mcbm2019/unpack_tsa_mcbm_mfles.C index fe138820e2d4761936928ead80582d0aea3a4645..c946384271164d870e1ae54db5e7cde5cf9f6195 100644 --- a/macro/beamtime/mcbm2019/unpack_tsa_mcbm_mfles.C +++ b/macro/beamtime/mcbm2019/unpack_tsa_mcbm_mfles.C @@ -78,6 +78,7 @@ void unpack_tsa_mcbm_mfles(UInt_t uRunId = 0, CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); CbmMcbm2018UnpackerTaskRich* unpacker_rich = new CbmMcbm2018UnpackerTaskRich(); + CbmMcbm2018UnpackerTaskHodo* unpacker_hodo = new CbmMcbm2018UnpackerTaskHodo(); CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); unpacker_sts->SetMonitorMode(); diff --git a/macro/beamtime/mcbm2020/mcbm_event_reco_ana.C b/macro/beamtime/mcbm2020/mcbm_event_reco_ana.C index b43308c8903fb5b35d2908743c5bf5cf26df2472..4df332b5a2bf3ace024a8286b1504ded9660392b 100644 --- a/macro/beamtime/mcbm2020/mcbm_event_reco_ana.C +++ b/macro/beamtime/mcbm2020/mcbm_event_reco_ana.C @@ -6,7 +6,8 @@ // // -------------------------------------------------------------------------- -void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { +void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) +{ // --- Logger settings ---------------------------------------------------- TString logLevel = "WARN"; @@ -15,7 +16,7 @@ void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { // ----- Environment -------------------------------------------------- - TString myName = "mcbm_event_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"; @@ -79,10 +80,8 @@ void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { // ----- Local reconstruction in MUCH --------------------------------- Int_t flag = 1; - TString muchDigiFile( - parDir + "/much/much_v19c_mcbm_digi_sector.root"); // MUCH digi file - CbmMuchFindHitsGem* muchFindHits = - new CbmMuchFindHitsGem(muchDigiFile.Data(), flag); + TString muchDigiFile(parDir + "/much/much_v19c_mcbm_digi_sector.root"); // MUCH digi file + CbmMuchFindHitsGem* muchFindHits = new CbmMuchFindHitsGem(muchDigiFile.Data(), flag); muchFindHits->SetBeamTimeDigi(kTRUE); run->AddTask(muchFindHits); std::cout << "-I- : Added task " << muchFindHits->GetName() << std::endl; @@ -98,8 +97,7 @@ void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { // 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); + 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); @@ -147,20 +145,13 @@ void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { TString cCalId = "831.50.3.0"; Int_t iCalSet = 12022500; // calibration settings - TObjString* tofBdfFile = - new TObjString(parDir + "/tof/tof_" + TofGeoTag + ".digibdf.par"); + 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); + 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); @@ -174,50 +165,42 @@ void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { 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 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 + 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"); + 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->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 + 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; @@ -347,8 +330,7 @@ void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { CbmRichMCbmHitProducer* hitProdRich = new CbmRichMCbmHitProducer(); hitProdRich->setToTLimits(23.7, 30.0); hitProdRich->applyToTCut(); - TString sRichMapFile = - srcDir + "/macro/rich/mcbm/beamtime/mRICH_Mapping_vert_20190318_elView.geo"; + TString sRichMapFile = srcDir + "/macro/rich/mcbm/beamtime/mRICH_Mapping_vert_20190318_elView.geo"; hitProdRich->SetMappingFile(sRichMapFile.Data()); run->AddTask(hitProdRich); // ------------------------------------------------------------------------ @@ -366,8 +348,7 @@ void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { // ------------------------------------------------------------------------ // --- Analysis by TOF track extension - CbmTofExtendTracks* tofExtendTracks = - new CbmTofExtendTracks("TofExtAna"); + CbmTofExtendTracks* tofExtendTracks = new CbmTofExtendTracks("TofExtAna"); tofExtendTracks->SetCalParFileName("TofExtTracksPar.root"); tofExtendTracks->SetCalOutFileName("TofExtTracksOut.root"); tofExtendTracks->SetCorMode(210); @@ -412,8 +393,7 @@ void mcbm_event_reco_ana(Int_t runId = 831, Int_t nTimeslices = 1000) { 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 << "Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; std::cout << std::endl; // ------------------------------------------------------------------------ diff --git a/macro/beamtime/mcbm2020/mtof_build_and_reco.C b/macro/beamtime/mcbm2020/mtof_build_and_reco.C index 85bab108245fe1dadd377d7acbbcf18d94b9edd0..2523b519476f58fb3eab012c813444a35b3e3965 100644 --- a/macro/beamtime/mcbm2020/mtof_build_and_reco.C +++ b/macro/beamtime/mcbm2020/mtof_build_and_reco.C @@ -3,20 +3,18 @@ // // -------------------------------------------------------------------------- -void mtof_build_and_reco_kronos - ( Int_t nEvents = -1, // number of Timeslices - UInt_t uRunId = 831, - TString setup = "mcbm_beam_2020_03", - TString cCalId = "831.50.3.0", - Int_t iCalSet = 12022500, // calibration settings - TString outDir = "data/", - Double_t Tint = 50., // coincidence time interval - Double_t ReqTofMul = 10., // requested TOF digi multiplicity - Int_t iTrackMode = 2, // 2 for TofTracker - Double_t ReqT0Mul = 1.) { +void mtof_build_and_reco_kronos(Int_t nEvents = -1, // number of Timeslices + UInt_t uRunId = 831, TString setup = "mcbm_beam_2020_03", TString cCalId = "831.50.3.0", + Int_t iCalSet = 12022500, // calibration settings + TString outDir = "data/", + Double_t Tint = 50., // coincidence time interval + Double_t ReqTofMul = 10., // requested TOF digi multiplicity + Int_t iTrackMode = 2, // 2 for TofTracker + Double_t ReqT0Mul = 1.) +{ // ======================================================================== // Adjust this part according to your requirements - TString dataset = Form("data/unp_mcbm_%03u",uRunId); + TString dataset = Form("data/unp_mcbm_%03u", uRunId); // --- Logger settings ---------------------------------------------------- TString logLevel = "INFO"; @@ -26,7 +24,7 @@ void mtof_build_and_reco_kronos Int_t iTofCluMode = 1; // ----- Environment -------------------------------------------------- - TString myName = "mtof_reco"; // this macro's name for screen output + TString myName = "mtof_reco"; // this macro's name for screen output TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory TString parDir = srcDir + "/parameters"; // ------------------------------------------------------------------------ @@ -35,11 +33,8 @@ void mtof_build_and_reco_kronos // ----- File names --------------------------------------------------- TString rawFile = dataset + ".root"; TString parFile = dataset + ".par.root"; - TString recFile = - dataset + Form(".%d.%d", (Int_t) Tint, (Int_t) ReqTofMul) + ".recEvtWin.root"; - TString hstFile = "./hst/" + dataset - + Form(".%d.%d", (Int_t) Tint, (Int_t) ReqTofMul) - + ".recEvtWin.hst.root"; + TString recFile = dataset + Form(".%d.%d", (Int_t) Tint, (Int_t) ReqTofMul) + ".recEvtWin.root"; + TString hstFile = "./hst/" + dataset + Form(".%d.%d", (Int_t) Tint, (Int_t) ReqTofMul) + ".recEvtWin.hst.root"; // ------------------------------------------------------------------------ TString shcmd = "rm -v " + parFile; gSystem->Exec(shcmd.Data()); @@ -74,14 +69,12 @@ void mtof_build_and_reco_kronos pSetup->GetGeoTag(ECbmModuleId::kTof, geoTag); - TObjString* tofBdfFile = - new TObjString(srcDir + "/parameters/tof/tof_" + geoTag + ".digibdf.par"); + TObjString* tofBdfFile = new TObjString(srcDir + "/parameters/tof/tof_" + geoTag + ".digibdf.par"); parFileList->Add(tofBdfFile); - std::cout << "-I- " << myName << ": Using parameter file " - << tofBdfFile->GetString() << std::endl; + std::cout << "-I- " << myName << ": Using parameter file " << tofBdfFile->GetString() << std::endl; - TString geoFile = srcDir + "/geometry/tof/geofile_tof_" + geoTag + ".root"; - TFile* fgeo = new TFile(geoFile); + TString geoFile = srcDir + "/geometry/tof/geofile_tof_" + geoTag + ".root"; + TFile* fgeo = new TFile(geoFile); TGeoManager* geoMan = (TGeoManager*) fgeo->Get("FAIRGeom"); if (NULL == geoMan) { cout << "<E> FAIRGeom not found in geoFile " << geoFile.Data() << endl; @@ -107,8 +100,7 @@ void mtof_build_and_reco_kronos // ----- Input file --------------------------------------------------- std::cout << std::endl; - std::cout << "-I- " << myName << ": Using input file " << rawFile - << std::endl; + std::cout << "-I- " << myName << ": Using input file " << rawFile << std::endl; // ------------------------------------------------------------------------ @@ -129,8 +121,7 @@ void mtof_build_and_reco_kronos //-------- Event builder -------------------------------------------------- // CbmMcbm2019TimeWinEventBuilder* eventBuilder = new CbmMcbm2019TimeWinEventBuilder(); - CbmMcbm2019TimeWinEventBuilderTask* eventBuilder = - new CbmMcbm2019TimeWinEventBuilderTask(); + CbmMcbm2019TimeWinEventBuilderTask* eventBuilder = new CbmMcbm2019TimeWinEventBuilderTask(); eventBuilder->SetFillHistos(kTRUE); @@ -195,9 +186,7 @@ void mtof_build_and_reco_kronos eventBuilder->SetTriggerMaxNumber(ECbmModuleId::kPsd, -1); - if (0 < uRunId) - eventBuilder->SetOutFilename( - Form("%sHistosEvtWin_%03u.root", outDir.Data(), uRunId)); + if (0 < uRunId) eventBuilder->SetOutFilename(Form("%sHistosEvtWin_%03u.root", outDir.Data(), uRunId)); run->AddTask(eventBuilder); @@ -214,33 +203,23 @@ void mtof_build_and_reco_kronos if (pSetup->IsActive(ECbmModuleId::kTof)) { switch (iTofCluMode) { case 1: { - 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); + 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->SetCaldXdYMax(3.); // geometrical matching window in cm - tofCluster->SetCalCluMulMax( - 5.); // Max Counter Cluster Multiplicity for filling calib histos - tofCluster->SetCalRpc(calSm); // select detector for calibration update - tofCluster->SetTRefId( - RefSel); // reference trigger for offset calculation - tofCluster->SetTotMax(20.); // Tot upper limit for walk corection - tofCluster->SetTotMin( - 0.01); //(12000.); // Tot lower limit for walk correction - tofCluster->SetTotPreRange( - 5.); // effective lower Tot limit in ns from peak position - tofCluster->SetTotMean(5.); // Tot calibration target value in ns - tofCluster->SetMaxTimeDist(1.0); // default cluster range in ns - tofCluster->SetDelTofMax( - 15.); // acceptance range for cluster distance in ns (!) - tofCluster->SetSel2MulMax(3); // limit Multiplicity in 2nd selector + tofCluster->SetCaldXdYMax(3.); // geometrical matching window in cm + tofCluster->SetCalCluMulMax(5.); // Max Counter Cluster Multiplicity for filling calib histos + tofCluster->SetCalRpc(calSm); // select detector for calibration update + tofCluster->SetTRefId(RefSel); // reference trigger for offset calculation + tofCluster->SetTotMax(20.); // Tot upper limit for walk corection + tofCluster->SetTotMin(0.01); //(12000.); // Tot lower limit for walk correction + tofCluster->SetTotPreRange(5.); // effective lower Tot limit in ns from peak position + tofCluster->SetTotMean(5.); // Tot calibration target value in ns + tofCluster->SetMaxTimeDist(1.0); // default cluster range in ns + tofCluster->SetDelTofMax(15.); // acceptance range for cluster distance in ns (!) + tofCluster->SetSel2MulMax(3); // limit Multiplicity in 2nd selector tofCluster->SetChannelDeadtime(dDeadtime); // artificial deadtime in ns tofCluster->SetEnableAvWalk(kFALSE); //tofCluster->SetEnableMatchPosScaling(kFALSE); // turn off projection to nominal target @@ -302,8 +281,7 @@ void mtof_build_and_reco_kronos tofCluster->SetSelRpc(iRefRpc); run->AddTask(tofCluster); - std::cout << "-I- " << myName << ": Added task " - << tofCluster->GetName() << std::endl; + std::cout << "-I- " << myName << ": Added task " << tofCluster->GetName() << std::endl; } break; default: { ; @@ -318,50 +296,42 @@ void mtof_build_and_reco_kronos Double_t beamWidthY = 0.1; 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 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 + 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"); + 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->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 + 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; @@ -540,8 +510,7 @@ void mtof_build_and_reco_kronos std::cout << "Macro finished successfully." << std::endl; std::cout << "Output file is " << recFile << std::endl; std::cout << "Parameter file is " << parFile << std::endl; - std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" - << 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; diff --git a/macro/beamtime/mcbm2020/mtof_build_and_reco_kronos.C b/macro/beamtime/mcbm2020/mtof_build_and_reco_kronos.C index 85bab108245fe1dadd377d7acbbcf18d94b9edd0..2523b519476f58fb3eab012c813444a35b3e3965 100644 --- a/macro/beamtime/mcbm2020/mtof_build_and_reco_kronos.C +++ b/macro/beamtime/mcbm2020/mtof_build_and_reco_kronos.C @@ -3,20 +3,18 @@ // // -------------------------------------------------------------------------- -void mtof_build_and_reco_kronos - ( Int_t nEvents = -1, // number of Timeslices - UInt_t uRunId = 831, - TString setup = "mcbm_beam_2020_03", - TString cCalId = "831.50.3.0", - Int_t iCalSet = 12022500, // calibration settings - TString outDir = "data/", - Double_t Tint = 50., // coincidence time interval - Double_t ReqTofMul = 10., // requested TOF digi multiplicity - Int_t iTrackMode = 2, // 2 for TofTracker - Double_t ReqT0Mul = 1.) { +void mtof_build_and_reco_kronos(Int_t nEvents = -1, // number of Timeslices + UInt_t uRunId = 831, TString setup = "mcbm_beam_2020_03", TString cCalId = "831.50.3.0", + Int_t iCalSet = 12022500, // calibration settings + TString outDir = "data/", + Double_t Tint = 50., // coincidence time interval + Double_t ReqTofMul = 10., // requested TOF digi multiplicity + Int_t iTrackMode = 2, // 2 for TofTracker + Double_t ReqT0Mul = 1.) +{ // ======================================================================== // Adjust this part according to your requirements - TString dataset = Form("data/unp_mcbm_%03u",uRunId); + TString dataset = Form("data/unp_mcbm_%03u", uRunId); // --- Logger settings ---------------------------------------------------- TString logLevel = "INFO"; @@ -26,7 +24,7 @@ void mtof_build_and_reco_kronos Int_t iTofCluMode = 1; // ----- Environment -------------------------------------------------- - TString myName = "mtof_reco"; // this macro's name for screen output + TString myName = "mtof_reco"; // this macro's name for screen output TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory TString parDir = srcDir + "/parameters"; // ------------------------------------------------------------------------ @@ -35,11 +33,8 @@ void mtof_build_and_reco_kronos // ----- File names --------------------------------------------------- TString rawFile = dataset + ".root"; TString parFile = dataset + ".par.root"; - TString recFile = - dataset + Form(".%d.%d", (Int_t) Tint, (Int_t) ReqTofMul) + ".recEvtWin.root"; - TString hstFile = "./hst/" + dataset - + Form(".%d.%d", (Int_t) Tint, (Int_t) ReqTofMul) - + ".recEvtWin.hst.root"; + TString recFile = dataset + Form(".%d.%d", (Int_t) Tint, (Int_t) ReqTofMul) + ".recEvtWin.root"; + TString hstFile = "./hst/" + dataset + Form(".%d.%d", (Int_t) Tint, (Int_t) ReqTofMul) + ".recEvtWin.hst.root"; // ------------------------------------------------------------------------ TString shcmd = "rm -v " + parFile; gSystem->Exec(shcmd.Data()); @@ -74,14 +69,12 @@ void mtof_build_and_reco_kronos pSetup->GetGeoTag(ECbmModuleId::kTof, geoTag); - TObjString* tofBdfFile = - new TObjString(srcDir + "/parameters/tof/tof_" + geoTag + ".digibdf.par"); + TObjString* tofBdfFile = new TObjString(srcDir + "/parameters/tof/tof_" + geoTag + ".digibdf.par"); parFileList->Add(tofBdfFile); - std::cout << "-I- " << myName << ": Using parameter file " - << tofBdfFile->GetString() << std::endl; + std::cout << "-I- " << myName << ": Using parameter file " << tofBdfFile->GetString() << std::endl; - TString geoFile = srcDir + "/geometry/tof/geofile_tof_" + geoTag + ".root"; - TFile* fgeo = new TFile(geoFile); + TString geoFile = srcDir + "/geometry/tof/geofile_tof_" + geoTag + ".root"; + TFile* fgeo = new TFile(geoFile); TGeoManager* geoMan = (TGeoManager*) fgeo->Get("FAIRGeom"); if (NULL == geoMan) { cout << "<E> FAIRGeom not found in geoFile " << geoFile.Data() << endl; @@ -107,8 +100,7 @@ void mtof_build_and_reco_kronos // ----- Input file --------------------------------------------------- std::cout << std::endl; - std::cout << "-I- " << myName << ": Using input file " << rawFile - << std::endl; + std::cout << "-I- " << myName << ": Using input file " << rawFile << std::endl; // ------------------------------------------------------------------------ @@ -129,8 +121,7 @@ void mtof_build_and_reco_kronos //-------- Event builder -------------------------------------------------- // CbmMcbm2019TimeWinEventBuilder* eventBuilder = new CbmMcbm2019TimeWinEventBuilder(); - CbmMcbm2019TimeWinEventBuilderTask* eventBuilder = - new CbmMcbm2019TimeWinEventBuilderTask(); + CbmMcbm2019TimeWinEventBuilderTask* eventBuilder = new CbmMcbm2019TimeWinEventBuilderTask(); eventBuilder->SetFillHistos(kTRUE); @@ -195,9 +186,7 @@ void mtof_build_and_reco_kronos eventBuilder->SetTriggerMaxNumber(ECbmModuleId::kPsd, -1); - if (0 < uRunId) - eventBuilder->SetOutFilename( - Form("%sHistosEvtWin_%03u.root", outDir.Data(), uRunId)); + if (0 < uRunId) eventBuilder->SetOutFilename(Form("%sHistosEvtWin_%03u.root", outDir.Data(), uRunId)); run->AddTask(eventBuilder); @@ -214,33 +203,23 @@ void mtof_build_and_reco_kronos if (pSetup->IsActive(ECbmModuleId::kTof)) { switch (iTofCluMode) { case 1: { - 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); + 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->SetCaldXdYMax(3.); // geometrical matching window in cm - tofCluster->SetCalCluMulMax( - 5.); // Max Counter Cluster Multiplicity for filling calib histos - tofCluster->SetCalRpc(calSm); // select detector for calibration update - tofCluster->SetTRefId( - RefSel); // reference trigger for offset calculation - tofCluster->SetTotMax(20.); // Tot upper limit for walk corection - tofCluster->SetTotMin( - 0.01); //(12000.); // Tot lower limit for walk correction - tofCluster->SetTotPreRange( - 5.); // effective lower Tot limit in ns from peak position - tofCluster->SetTotMean(5.); // Tot calibration target value in ns - tofCluster->SetMaxTimeDist(1.0); // default cluster range in ns - tofCluster->SetDelTofMax( - 15.); // acceptance range for cluster distance in ns (!) - tofCluster->SetSel2MulMax(3); // limit Multiplicity in 2nd selector + tofCluster->SetCaldXdYMax(3.); // geometrical matching window in cm + tofCluster->SetCalCluMulMax(5.); // Max Counter Cluster Multiplicity for filling calib histos + tofCluster->SetCalRpc(calSm); // select detector for calibration update + tofCluster->SetTRefId(RefSel); // reference trigger for offset calculation + tofCluster->SetTotMax(20.); // Tot upper limit for walk corection + tofCluster->SetTotMin(0.01); //(12000.); // Tot lower limit for walk correction + tofCluster->SetTotPreRange(5.); // effective lower Tot limit in ns from peak position + tofCluster->SetTotMean(5.); // Tot calibration target value in ns + tofCluster->SetMaxTimeDist(1.0); // default cluster range in ns + tofCluster->SetDelTofMax(15.); // acceptance range for cluster distance in ns (!) + tofCluster->SetSel2MulMax(3); // limit Multiplicity in 2nd selector tofCluster->SetChannelDeadtime(dDeadtime); // artificial deadtime in ns tofCluster->SetEnableAvWalk(kFALSE); //tofCluster->SetEnableMatchPosScaling(kFALSE); // turn off projection to nominal target @@ -302,8 +281,7 @@ void mtof_build_and_reco_kronos tofCluster->SetSelRpc(iRefRpc); run->AddTask(tofCluster); - std::cout << "-I- " << myName << ": Added task " - << tofCluster->GetName() << std::endl; + std::cout << "-I- " << myName << ": Added task " << tofCluster->GetName() << std::endl; } break; default: { ; @@ -318,50 +296,42 @@ void mtof_build_and_reco_kronos Double_t beamWidthY = 0.1; 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 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 + 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"); + 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->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 + 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; @@ -540,8 +510,7 @@ void mtof_build_and_reco_kronos std::cout << "Macro finished successfully." << std::endl; std::cout << "Output file is " << recFile << std::endl; std::cout << "Parameter file is " << parFile << std::endl; - std::cout << "Real time " << rtime << " s, CPU time " << ctime << " s" - << 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; diff --git a/macro/beamtime/mcbm2021/ana_digi_cal.C b/macro/beamtime/mcbm2021/ana_digi_cal.C index 04eafb83947dc2e4b406de3bcc93ca087ce6b8ec..e7a633f2af1bb1a5a61a67c924abfe12853a6cf5 100644 --- a/macro/beamtime/mcbm2021/ana_digi_cal.C +++ b/macro/beamtime/mcbm2021/ana_digi_cal.C @@ -1,15 +1,7 @@ -void ana_digi_cal(Int_t nEvents = 10000000, - Int_t calMode = 53, - Int_t calSel = 0, - Int_t calSm = 900, - Int_t RefSel = 1, - TString cFileId = "Test", - Int_t iCalSet = 910601600, - Bool_t bOut = 0, - Int_t iSel2 = 0, - Double_t dDeadtime = 50, - TString cCalId = "XXX", - Int_t iPlot = 1) { +void ana_digi_cal(Int_t nEvents = 10000000, Int_t calMode = 53, Int_t calSel = 0, Int_t calSm = 900, Int_t RefSel = 1, + TString cFileId = "Test", Int_t iCalSet = 910601600, Bool_t bOut = 0, Int_t iSel2 = 0, + Double_t dDeadtime = 50, TString cCalId = "XXX", Int_t iPlot = 1) +{ Int_t iVerbose = 1; Int_t iBugCor = 0; //Specify log level (INFO, DEBUG, DEBUG1, ...) @@ -35,10 +27,8 @@ void ana_digi_cal(Int_t nEvents = 10000000, TString ParFile = paramDir + "data/" + cFileId + ".params.root"; TString InputFile = paramDir + "data/" + cFileId + ".root"; // TString InputFile = "./data/" + cFileId + ".root"; - TString OutputFile = - paramDir + "data/TofHits_" + cFileId - + Form("_%09d_%03d_%02.0f_Cal", iCalSet, iSel2, dDeadtime) + cCalId - + ".out.root"; + TString OutputFile = paramDir + "data/TofHits_" + cFileId + Form("_%09d_%03d_%02.0f_Cal", iCalSet, iSel2, dDeadtime) + + cCalId + ".out.root"; TString shcmd = "rm -v " + ParFile; gSystem->Exec(shcmd.Data()); @@ -46,12 +36,11 @@ void ana_digi_cal(Int_t nEvents = 10000000, TList* parFileList = new TList(); TString FId = cFileId; - Int_t iNLen=FId.First("."); - TString cRun(FId(0, iNLen)); + Int_t iNLen = FId.First("."); + TString cRun(FId(0, iNLen)); Int_t iRun = cRun.Atoi(); TString TofGeo = ""; - if (iRun < 690) - TofGeo = "v20a_mcbm"; + if (iRun < 690) TofGeo = "v20a_mcbm"; else TofGeo = "v21a_mcbm"; cout << "Geometry version " << TofGeo << endl; @@ -60,13 +49,12 @@ void ana_digi_cal(Int_t nEvents = 10000000, // parFileList->Add(tofDigiFile); // TObjString tofDigiBdfFile = new TObjString( paramDir + "/tof." + FPar + "digibdf.par"); - TObjString* tofDigiBdfFile = - new TObjString(workDir + "/parameters/tof/tof_" + TofGeo + ".digibdf.par"); + TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" + TofGeo + ".digibdf.par"); parFileList->Add(tofDigiBdfFile); - TString geoDir = gSystem->Getenv("VMCWORKDIR"); - TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; - TFile* fgeo = new TFile(geoFile); + TString geoDir = gSystem->Getenv("VMCWORKDIR"); + TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; + TFile* fgeo = new TFile(geoFile); TGeoManager* geoMan = (TGeoManager*) fgeo->Get("FAIRGeom"); if (NULL == geoMan) { cout << "<E> FAIRGeom not found in geoFile" << endl; @@ -87,26 +75,22 @@ void ana_digi_cal(Int_t nEvents = 10000000, //run->SetSink( new FairRootFileSink( OutputFile.Data() ) ); run->SetUserOutputFileName(OutputFile.Data()); run->SetSink(new FairRootFileSink(run->GetUserOutputFileName())); - CbmTofEventClusterizer* tofClust = - new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); + CbmTofEventClusterizer* tofClust = new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); tofClust->SetCalMode(calMode); tofClust->SetCalSel(calSel); - tofClust->SetCaldXdYMax(3.); // geometrical matching window in cm - tofClust->SetCalCluMulMax( - 5.); // Max Counter Cluster Multiplicity for filling calib histos - tofClust->SetCalRpc(calSm); // select detector for calibration update - tofClust->SetTRefId(RefSel); // reference trigger for offset calculation - tofClust->SetTotMax(20.); // Tot upper limit for walk corection - tofClust->SetTotMin(0.); //(12000.); // Tot lower limit for walk correction - tofClust->SetTotPreRange( - 5.); // effective lower Tot limit in ns from peak position + tofClust->SetCaldXdYMax(3.); // geometrical matching window in cm + tofClust->SetCalCluMulMax(5.); // Max Counter Cluster Multiplicity for filling calib histos + tofClust->SetCalRpc(calSm); // select detector for calibration update + tofClust->SetTRefId(RefSel); // reference trigger for offset calculation + tofClust->SetTotMax(20.); // Tot upper limit for walk corection + tofClust->SetTotMin(0.); //(12000.); // Tot lower limit for walk correction + tofClust->SetTotPreRange(5.); // effective lower Tot limit in ns from peak position tofClust->SetTotMean(5.); // Tot calibration target value in ns tofClust->SetMaxTimeDist(1.0); // default cluster range in ns //tofClust->SetMaxTimeDist(0.); //Deb// default cluster range in ns - tofClust->SetDelTofMax( - 5.); // acceptance range for cluster distance in ns (!) - tofClust->SetSel2MulMax(3); // limit Multiplicity in 2nd selector + tofClust->SetDelTofMax(5.); // acceptance range for cluster distance in ns (!) + tofClust->SetSel2MulMax(3); // limit Multiplicity in 2nd selector tofClust->SetChannelDeadtime(dDeadtime); // artificial deadtime in ns tofClust->SetEnableAvWalk(kFALSE); //tofClust->SetEnableMatchPosScaling(kFALSE); // turn off projection to nominal target @@ -121,24 +105,14 @@ void ana_digi_cal(Int_t nEvents = 10000000, Int_t calSelRead = calSel; if (calSel < 0) calSelRead = 0; - TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cFileId.Data(), - iCalSet, - calMode, - calSelRead); + TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cFileId.Data(), iCalSet, calMode, calSelRead); if (cCalId != "XXX") - cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cCalId.Data(), - iCalSet, - calMode, - calSelRead); + cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cCalId.Data(), iCalSet, calMode, calSelRead); tofClust->SetCalParFileName(cFname); - TString cOutFname = - Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); + TString cOutFname = Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); tofClust->SetOutHstFileName(cOutFname); - TString cAnaFile = - Form("%s_%09d%03d_tofAna.hst.root", cFileId.Data(), iCalSet, iSel2); + TString cAnaFile = Form("%s_%09d%03d_tofAna.hst.root", cFileId.Data(), iCalSet, iSel2); switch (calMode) { case -1: // initial check of raw data @@ -279,10 +253,7 @@ void ana_digi_cal(Int_t nEvents = 10000000, tofClust->SetTRefDifMax(2.0); // in ns tofClust->PosYMaxScal(0.7); //in % of length break; - default: - cout << "<E> Calib mode not implemented! stop execution of script" - << endl; - return; + default: cout << "<E> Calib mode not implemented! stop execution of script" << endl; return; } Int_t iBRef = iCalSet % 1000; @@ -452,9 +423,6 @@ void ana_digi_cal(Int_t nEvents = 10000000, ; } } - TString FSave = Form("save_hst(\"CluStatus%d_%d_Cal_%s.hst.root\")", - iCalSet, - iSel2in, - cCalId.Data()); + TString FSave = Form("save_hst(\"CluStatus%d_%d_Cal_%s.hst.root\")", iCalSet, iSel2in, cCalId.Data()); gInterpreter->ProcessLine(FSave.Data()); } diff --git a/macro/beamtime/mcbm2021/ana_digi_cal_all.C b/macro/beamtime/mcbm2021/ana_digi_cal_all.C index d39061e3e7ea5b6d36ee81a07f67a4d403db4e95..4a9294ef3977d88b8b95858ba616089a0b757839 100644 --- a/macro/beamtime/mcbm2021/ana_digi_cal_all.C +++ b/macro/beamtime/mcbm2021/ana_digi_cal_all.C @@ -1,15 +1,7 @@ -void ana_digi_cal_all(Int_t nEvents = 10000000, - Int_t calMode = 53, - Int_t calSel = 0, - Int_t calSm = 900, - Int_t RefSel = 1, - TString cFileId = "Test", - Int_t iCalSet = 910601600, - Bool_t bOut = 0, - Int_t iSel2 = 0, - Double_t dDeadtime = 50, - TString cCalId = "XXX", - Int_t iPlot = 1) { +void ana_digi_cal_all(Int_t nEvents = 10000000, Int_t calMode = 53, Int_t calSel = 0, Int_t calSm = 900, + Int_t RefSel = 1, TString cFileId = "Test", Int_t iCalSet = 910601600, Bool_t bOut = 0, + Int_t iSel2 = 0, Double_t dDeadtime = 50, TString cCalId = "XXX", Int_t iPlot = 1) +{ Int_t iVerbose = 1; Int_t iBugCor = 0; //Specify log level (INFO, DEBUG, DEBUG1, ...) @@ -36,10 +28,8 @@ void ana_digi_cal_all(Int_t nEvents = 10000000, TString ParFile = paramDir + "data/" + cFileId + ".params.root"; TString InputFile = paramDir + "data/" + cFileId + ".root"; // TString InputFile = "./data/" + cFileId + ".root"; - TString OutputFile = - paramDir + "data/TofHits_" + cFileId - + Form("_%09d_%03d_%02.0f_Cal", iCalSet, iSel2, dDeadtime) + cCalId - + ".out.root"; + TString OutputFile = paramDir + "data/TofHits_" + cFileId + Form("_%09d_%03d_%02.0f_Cal", iCalSet, iSel2, dDeadtime) + + cCalId + ".out.root"; TString shcmd = "rm -v " + ParFile; gSystem->Exec(shcmd.Data()); @@ -47,28 +37,26 @@ void ana_digi_cal_all(Int_t nEvents = 10000000, TList* parFileList = new TList(); TString FId = cFileId; - Int_t iNLen=FId.First("."); + Int_t iNLen = FId.First("."); TString cRun(FId(0, iNLen)); Int_t iRun = cRun.Atoi(); TString TofGeo = ""; - if (iRun < 690) - TofGeo = "v20a_mcbm"; + if (iRun < 690) TofGeo = "v20a_mcbm"; else TofGeo = "v21a_mcbm"; - + cout << "Geometry version " << TofGeo << endl; // TObjString *tofDigiFile = new TObjString(workDir + "/parameters/tof/tof_" + TofGeo + ".digi.par"); // TOF digi file // parFileList->Add(tofDigiFile); // TObjString tofDigiBdfFile = new TObjString( paramDir + "/tof." + FPar + "digibdf.par"); - TObjString* tofDigiBdfFile = - new TObjString(workDir + "/parameters/tof/tof_" + TofGeo + ".digibdf.par"); + TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" + TofGeo + ".digibdf.par"); parFileList->Add(tofDigiBdfFile); - TString geoDir = gSystem->Getenv("VMCWORKDIR"); - TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; - TFile* fgeo = new TFile(geoFile); + TString geoDir = gSystem->Getenv("VMCWORKDIR"); + TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; + TFile* fgeo = new TFile(geoFile); TGeoManager* geoMan = (TGeoManager*) fgeo->Get("FAIRGeom"); if (NULL == geoMan) { cout << "<E> FAIRGeom not found in geoFile" << endl; @@ -89,26 +77,22 @@ void ana_digi_cal_all(Int_t nEvents = 10000000, //run->SetSink( new FairRootFileSink( OutputFile.Data() ) ); run->SetUserOutputFileName(OutputFile.Data()); run->SetSink(new FairRootFileSink(run->GetUserOutputFileName())); - CbmTofEventClusterizer* tofClust = - new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); + CbmTofEventClusterizer* tofClust = new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); tofClust->SetCalMode(calMode); tofClust->SetCalSel(calSel); - tofClust->SetCaldXdYMax(3.); // geometrical matching window in cm - tofClust->SetCalCluMulMax( - 5.); // Max Counter Cluster Multiplicity for filling calib histos - tofClust->SetCalRpc(calSm); // select detector for calibration update - tofClust->SetTRefId(RefSel); // reference trigger for offset calculation - tofClust->SetTotMax(20.); // Tot upper limit for walk corection - tofClust->SetTotMin(0.); //(12000.); // Tot lower limit for walk correction - tofClust->SetTotPreRange( - 5.); // effective lower Tot limit in ns from peak position + tofClust->SetCaldXdYMax(3.); // geometrical matching window in cm + tofClust->SetCalCluMulMax(5.); // Max Counter Cluster Multiplicity for filling calib histos + tofClust->SetCalRpc(calSm); // select detector for calibration update + tofClust->SetTRefId(RefSel); // reference trigger for offset calculation + tofClust->SetTotMax(20.); // Tot upper limit for walk corection + tofClust->SetTotMin(0.); //(12000.); // Tot lower limit for walk correction + tofClust->SetTotPreRange(5.); // effective lower Tot limit in ns from peak position tofClust->SetTotMean(5.); // Tot calibration target value in ns tofClust->SetMaxTimeDist(1.0); // default cluster range in ns //tofClust->SetMaxTimeDist(0.); //Deb// default cluster range in ns - tofClust->SetDelTofMax( - 5.); // acceptance range for cluster distance in ns (!) - tofClust->SetSel2MulMax(3); // limit Multiplicity in 2nd selector + tofClust->SetDelTofMax(5.); // acceptance range for cluster distance in ns (!) + tofClust->SetSel2MulMax(3); // limit Multiplicity in 2nd selector tofClust->SetChannelDeadtime(dDeadtime); // artificial deadtime in ns tofClust->SetEnableAvWalk(kFALSE); //tofClust->SetEnableMatchPosScaling(kFALSE); // turn off projection to nominal target @@ -123,24 +107,14 @@ void ana_digi_cal_all(Int_t nEvents = 10000000, Int_t calSelRead = calSel; if (calSel < 0) calSelRead = 0; - TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cFileId.Data(), - iCalSet, - calMode, - calSelRead); + TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cFileId.Data(), iCalSet, calMode, calSelRead); if (cCalId != "XXX") - cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cCalId.Data(), - iCalSet, - calMode, - calSelRead); + cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cCalId.Data(), iCalSet, calMode, calSelRead); tofClust->SetCalParFileName(cFname); - TString cOutFname = - Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); + TString cOutFname = Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); tofClust->SetOutHstFileName(cOutFname); - TString cAnaFile = - Form("%s_%09d%03d_tofAna.hst.root", cFileId.Data(), iCalSet, iSel2); + TString cAnaFile = Form("%s_%09d%03d_tofAna.hst.root", cFileId.Data(), iCalSet, iSel2); switch (calMode) { case -1: // initial check of raw data @@ -281,10 +255,7 @@ void ana_digi_cal_all(Int_t nEvents = 10000000, tofClust->SetTRefDifMax(2.0); // in ns tofClust->PosYMaxScal(0.7); //in % of length break; - default: - cout << "<E> Calib mode not implemented! stop execution of script" - << endl; - return; + default: cout << "<E> Calib mode not implemented! stop execution of script" << endl; return; } Int_t iBRef = iCalSet % 1000; @@ -454,9 +425,6 @@ void ana_digi_cal_all(Int_t nEvents = 10000000, ; } } - TString FSave = Form("save_hst(\"CluStatus%d_%d_Cal_%s.hst.root\")", - iCalSet, - iSel2in, - cCalId.Data()); + TString FSave = Form("save_hst(\"CluStatus%d_%d_Cal_%s.hst.root\")", iCalSet, iSel2in, cCalId.Data()); gInterpreter->ProcessLine(FSave.Data()); } diff --git a/macro/beamtime/mcbm2021/ana_trks.C b/macro/beamtime/mcbm2021/ana_trks.C index 4c917bee1365e98baa08fcf66d6db88d053cbd30..5749bd590255153b9e3faa9b4326062bf34fface 100644 --- a/macro/beamtime/mcbm2021/ana_trks.C +++ b/macro/beamtime/mcbm2021/ana_trks.C @@ -1,24 +1,13 @@ -void ana_trks(Int_t nEvents = 10000, - Int_t iSel = 1, - Int_t iGenCor = 1, - TString cFileId = "48.50.7.1", - TString cSet = "000010020", - Int_t iSel2 = 20, - Int_t iTrackingSetup = 2, - Double_t dScalFac = 1., - Double_t dChi2Lim2 = 500., - Double_t dDeadtime = 50, - TString cCalId = "", - Int_t iAnaCor = 1, - Bool_t bUseSigCalib = kFALSE, - Int_t iCalSet = 30040500, - Int_t iCalOpt = 1, - Int_t iMc = 0) { +void ana_trks(Int_t nEvents = 10000, Int_t iSel = 1, Int_t iGenCor = 1, TString cFileId = "48.50.7.1", + TString cSet = "000010020", Int_t iSel2 = 20, Int_t iTrackingSetup = 2, Double_t dScalFac = 1., + Double_t dChi2Lim2 = 500., Double_t dDeadtime = 50, TString cCalId = "", Int_t iAnaCor = 1, + Bool_t bUseSigCalib = kFALSE, Int_t iCalSet = 30040500, Int_t iCalOpt = 1, Int_t iMc = 0) +{ Int_t iVerbose = 1; if (cCalId == "") cCalId = cFileId; TString FId = cFileId; - Int_t iNLen=FId.First("."); - TString cRun(FId(0, iNLen)); + Int_t iNLen = FId.First("."); + TString cRun(FId(0, iNLen)); Int_t iRun = cRun.Atoi(); // Specify log level (INFO, DEBUG, DEBUG1, ...) //TString logLevel = "FATAL"; @@ -34,30 +23,18 @@ void ana_trks(Int_t nEvents = 10000, TString ParFile = paramDir + "/data/" + cFileId.Data() + ".params.root"; TString InputFile = paramDir + "/data/" + cFileId.Data() + ".root"; - TString InputDigiFile = paramDir + "/data/TofHits_" + cFileId.Data() - + Form("_%s_%02.0f_Cal", cSet.Data(), dDeadtime) + TString InputDigiFile = paramDir + "/data/TofHits_" + cFileId.Data() + Form("_%s_%02.0f_Cal", cSet.Data(), dDeadtime) + cCalId + ".out.root"; if (iMc == 1) { InputFile = paramDir + "/data/" + cFileId.Data() + ".raw.root"; InputDigiFile = paramDir + "/data/" + cFileId.Data() + ".rec.root"; iRun = 700; } - TString OutputFile = paramDir + "/data/TofTrks_" + cFileId.Data() - + Form("_%s_%06d_%03d", cSet.Data(), iSel, iSel2) - + ".out.root"; - TString cHstFile = - paramDir - + Form( - "/hst/%s_%03.0f_%s_%06d_%03d_%03.1f_%03.1f_trk%03d_Cal%s_Ana.hst.root", - cFileId.Data(), - dDeadtime, - cSet.Data(), - iSel, - iSel2, - dScalFac, - dChi2Lim2, - iTrackingSetup, - cCalId.Data()); + TString OutputFile = + paramDir + "/data/TofTrks_" + cFileId.Data() + Form("_%s_%06d_%03d", cSet.Data(), iSel, iSel2) + ".out.root"; + TString cHstFile = paramDir + + Form("/hst/%s_%03.0f_%s_%06d_%03d_%03.1f_%03.1f_trk%03d_Cal%s_Ana.hst.root", cFileId.Data(), + dDeadtime, cSet.Data(), iSel, iSel2, dScalFac, dChi2Lim2, iTrackingSetup, cCalId.Data()); TString cTrkFile = Form("%s_tofFindTracks.hst.root", cCalId.Data()); TString cAnaFile = Form("%s_TrkAnaTestBeam.hst.root", cFileId.Data()); @@ -71,29 +48,27 @@ void ana_trks(Int_t nEvents = 10000, Int_t iGeo = 0; //iMc; if (iGeo == 0) { TString TofGeo = ""; - if (iRun < 690) - TofGeo = "v20a_mcbm"; + if (iRun < 690) TofGeo = "v20a_mcbm"; else TofGeo = "v21a_mcbm"; cout << "Geometry version " << TofGeo << endl; - TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" - + TofGeo + ".digibdf.par"); + TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" + TofGeo + ".digibdf.par"); parFileList->Add(tofDigiBdfFile); - TString geoDir = gSystem->Getenv("VMCWORKDIR"); - TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; - TFile* fgeo = new TFile(geoFile); + TString geoDir = gSystem->Getenv("VMCWORKDIR"); + TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; + TFile* fgeo = new TFile(geoFile); TGeoManager* geoMan = (TGeoManager*) fgeo->Get("FAIRGeom"); if (NULL == geoMan) { cout << "<E> FAIRGeom not found in geoFile" << endl; return; } - } else { + } + else { TString setupName = "mcbm_beam_2021_01"; // ----- Load the geometry setup ------------------------------------- - TString setupFile = - workDir + "/geometry/setup/setup_" + setupName.Data() + ".C"; + TString setupFile = workDir + "/geometry/setup/setup_" + setupName.Data() + ".C"; TString setupFunct = "setup_"; setupFunct = setupFunct + setupName + "()"; std::cout << "-I- Loading macro " << setupFile << std::endl; @@ -142,24 +117,14 @@ void ana_trks(Int_t nEvents = 10000, Int_t calSel = 1; Bool_t bOut = kFALSE; - CbmTofEventClusterizer* tofClust = - new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); - Int_t calSelRead = calSel; + CbmTofEventClusterizer* tofClust = new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); + Int_t calSelRead = calSel; if (calSel < 0) calSelRead = 0; - TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cFileId.Data(), - iCalSet, - calMode, - calSelRead); + TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cFileId.Data(), iCalSet, calMode, calSelRead); if (cCalId != "XXX") - cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cCalId.Data(), - iCalSet, - calMode, - calSelRead); + cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cCalId.Data(), iCalSet, calMode, calSelRead); tofClust->SetCalParFileName(cFname); - TString cOutFname = - Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); + TString cOutFname = Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); tofClust->SetOutHstFileName(cOutFname); // ========================================================================= @@ -190,35 +155,29 @@ void ana_trks(Int_t nEvents = 10000, 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->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.0605); // target value for Mar2020 triple stack -> betapeak ~ 0.95 //tofFindTracks->SetTtTarg(0.058); // target value for Mar2020 double stack //tofFindTracks->SetTtTarg(0.055); // target value Nov2019 (triple stack run 831) //tofFindTracks->SetTtTarg(0.048); // target value Nov2019 (double stack run 714) - tofFindTracks->SetTtTarg( - 0.047); // target value Mar2020, after T0 fix (full run 600) + tofFindTracks->SetTtTarg(0.047); // target value Mar2020, after T0 fix (full run 600) // 0.044); // target value Mar2020, after T0 fix (double stack run 714) //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->SetCalParFileName(cTrkFile); // Tracker parameter value file name + tofFindTracks->SetBeamCounter(5, 0, 0); // default beam counter tofFindTracks->SetR0Lim(20.); - 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( - bUseSigCalib); // ignore resolutions in CalPar file - tofTrackFinder->SetSIGLIM(dChi2Lim2 - * 2.); // matching window in multiples of chi2 - tofTrackFinder->SetChiMaxAccept(dChi2Lim2); // max tracklet chi2 + 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(bUseSigCalib); // 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; @@ -268,7 +227,7 @@ void ana_trks(Int_t nEvents = 10000, tofFindTracks->SetStation(26, 9, 0, 0); tofFindTracks->SetStation(27, 9, 1, 0); tofFindTracks->SetStation(28, 9, 0, 1); - tofFindTracks->SetStation(29, 9, 1, 1); + tofFindTracks->SetStation(29, 9, 1, 1); //tofFindTracks->SetStation(28, 6, 0, 0); //tofFindTracks->SetStation(29, 6, 0, 1); break; @@ -285,7 +244,7 @@ void ana_trks(Int_t nEvents = 10000, tofFindTracks->SetStation(5, 9, 0, 0); tofFindTracks->SetStation(6, 9, 1, 0); tofFindTracks->SetStation(7, 9, 0, 1); - tofFindTracks->SetStation(8, 9, 1, 1); + tofFindTracks->SetStation(8, 9, 1, 1); break; case 2: @@ -463,8 +422,7 @@ void ana_trks(Int_t nEvents = 10000, break; default: - cout << "Tracking setup " << iTrackingSetup << " not implemented " - << endl; + cout << "Tracking setup " << iTrackingSetup << " not implemented " << endl; return; ; } @@ -477,8 +435,7 @@ void ana_trks(Int_t nEvents = 10000, // ========================================================================= // === Analysis === // ========================================================================= - CbmTofAnaTestbeam* tofAnaTestbeam = - new CbmTofAnaTestbeam("TOF TestBeam Analysis", iVerbose); + CbmTofAnaTestbeam* tofAnaTestbeam = new CbmTofAnaTestbeam("TOF TestBeam Analysis", iVerbose); tofAnaTestbeam->SetCorMode(iAnaCor); // 1 - DTD4, 2 - X4, 3 - Y4, 4 - Texp tofAnaTestbeam->SetHitDistMin(30.); // initialization tofAnaTestbeam->SetEnableMatchPosScaling(kTRUE); @@ -488,8 +445,7 @@ void ana_trks(Int_t nEvents = 10000, tofAnaTestbeam->SetSpillBreak(0.); } //CbmTofAnaTestbeam defaults - tofAnaTestbeam->SetR0LimFit( - 20.); // limit distance of fitted track to nominal vertex + tofAnaTestbeam->SetR0LimFit(20.); // limit distance of fitted track to nominal vertex tofAnaTestbeam->SetDXMean(0.); tofAnaTestbeam->SetDYMean(0.); tofAnaTestbeam->SetDTMean(0.); // in ns @@ -497,34 +453,28 @@ void ana_trks(Int_t nEvents = 10000, tofAnaTestbeam->SetDYWidth(1.0); tofAnaTestbeam->SetDTWidth(0.1); // in ns tofAnaTestbeam->SetCalParFileName(cAnaFile); - Double_t dScalFacA = 0.9; // dScalFac is used for tracking - tofAnaTestbeam->SetPosY4Sel( - 0.5 * dScalFacA); // Y Position selection in fraction of strip length - tofAnaTestbeam->SetDTDia(0.); // Time difference to additional diamond - tofAnaTestbeam->SetMul0Max(20); // Max Multiplicity in dut - tofAnaTestbeam->SetMul4Max(30); // Max Multiplicity in Ref - RPC - tofAnaTestbeam->SetMulDMax(3); // Max Multiplicity in Diamond / BeamRef - tofAnaTestbeam->SetTOffD4(14.); // initialization - tofAnaTestbeam->SetDTD4MAX( - 6.); // initialization of Max time difference Ref - BRef + Double_t dScalFacA = 0.9; // dScalFac is used for tracking + tofAnaTestbeam->SetPosY4Sel(0.5 * dScalFacA); // Y Position selection in fraction of strip length + tofAnaTestbeam->SetDTDia(0.); // Time difference to additional diamond + tofAnaTestbeam->SetMul0Max(20); // Max Multiplicity in dut + tofAnaTestbeam->SetMul4Max(30); // Max Multiplicity in Ref - RPC + tofAnaTestbeam->SetMulDMax(3); // Max Multiplicity in Diamond / BeamRef + tofAnaTestbeam->SetTOffD4(14.); // initialization + tofAnaTestbeam->SetDTD4MAX(6.); // initialization of Max time difference Ref - BRef //tofAnaTestbeam->SetTShift(-28000.);// initialization - tofAnaTestbeam->SetPosYS2Sel( - 0.55); // Y Position selection in fraction of strip length - tofAnaTestbeam->SetChS2Sel(0.); // Center of channel selection window - tofAnaTestbeam->SetDChS2Sel(100.); // Width of channel selection window - tofAnaTestbeam->SetSel2TOff(0.); // Shift Sel2 time peak to 0 - tofAnaTestbeam->SetChi2Lim(5.); // initialization of Chi2 selection limit - tofAnaTestbeam->SetChi2Lim2( - 3.); // initialization of Chi2 selection limit for Mref-Sel2 pair - tofAnaTestbeam->SetDutDX( - 15.); // limit inspection of tracklets to selected region - tofAnaTestbeam->SetDutDY( - 15.); // limit inspection of tracklets to selected region - tofAnaTestbeam->SetSIGLIM(3.); // max matching chi2 - tofAnaTestbeam->SetSIGT(0.08); // in ns - tofAnaTestbeam->SetSIGX(0.3); // in cm - tofAnaTestbeam->SetSIGY(0.6); // in cm + tofAnaTestbeam->SetPosYS2Sel(0.55); // Y Position selection in fraction of strip length + tofAnaTestbeam->SetChS2Sel(0.); // Center of channel selection window + tofAnaTestbeam->SetDChS2Sel(100.); // Width of channel selection window + tofAnaTestbeam->SetSel2TOff(0.); // Shift Sel2 time peak to 0 + tofAnaTestbeam->SetChi2Lim(5.); // initialization of Chi2 selection limit + tofAnaTestbeam->SetChi2Lim2(3.); // initialization of Chi2 selection limit for Mref-Sel2 pair + tofAnaTestbeam->SetDutDX(15.); // limit inspection of tracklets to selected region + tofAnaTestbeam->SetDutDY(15.); // limit inspection of tracklets to selected region + tofAnaTestbeam->SetSIGLIM(3.); // max matching chi2 + tofAnaTestbeam->SetSIGT(0.08); // in ns + tofAnaTestbeam->SetSIGX(0.3); // in cm + tofAnaTestbeam->SetSIGY(0.6); // in cm Int_t iRSel = 500; Int_t iRSelTyp = 5; @@ -545,16 +495,12 @@ void ana_trks(Int_t nEvents = 10000, tofAnaTestbeam->SetBeamRefRpc(iRSelRpc); if (iSel2 >= -1) { - tofAnaTestbeam->SetMrpcSel2( - iSel2); // initialization of second selector Mrpc Type - tofAnaTestbeam->SetMrpcSel2Sm( - iSel2Sm); // initialization of second selector Mrpc SmId - tofAnaTestbeam->SetMrpcSel2Rpc( - iSel2Rpc); // initialization of second selector Mrpc RpcId + tofAnaTestbeam->SetMrpcSel2(iSel2); // initialization of second selector Mrpc Type + tofAnaTestbeam->SetMrpcSel2Sm(iSel2Sm); // initialization of second selector Mrpc SmId + tofAnaTestbeam->SetMrpcSel2Rpc(iSel2Rpc); // initialization of second selector Mrpc RpcId } - cout << "AnaTestbeam init for Dut " << iDut << iDutSm << iDutRpc << ", Ref " - << iRef << iRefSm << iRefRpc << endl; + cout << "AnaTestbeam init for Dut " << iDut << iDutSm << iDutRpc << ", Ref " << iRef << iRefSm << iRefRpc << endl; tofAnaTestbeam->SetDut(iDut); // Device under test tofAnaTestbeam->SetDutSm(iDutSm); // Device under test @@ -563,8 +509,8 @@ void ana_trks(Int_t nEvents = 10000, tofAnaTestbeam->SetMrpcRefSm(iRefSm); // Reference RPC tofAnaTestbeam->SetMrpcRefRpc(iRefRpc); // Reference RPC - cout << "dispatch iSel = " << iSel << ", iSel2in = " << iSel2in - << ", iRSelin = " << iRSelin << ", iRSel = " << iRSel << endl; + cout << "dispatch iSel = " << iSel << ", iSel2in = " << iSel2in << ", iRSelin = " << iRSelin << ", iRSel = " << iRSel + << endl; if (1) { switch (iSel) { @@ -598,8 +544,7 @@ void ana_trks(Int_t nEvents = 10000, tofAnaTestbeam->SetSel2TOff(-0.3); // Shift Sel2 time peak to 0 break; case 31: - tofAnaTestbeam->SetSel2TOff( - -0.41); // Shift Sel2 time peak to 0 + tofAnaTestbeam->SetSel2TOff(-0.41); // Shift Sel2 time peak to 0 break; default:; @@ -644,8 +589,7 @@ void ana_trks(Int_t nEvents = 10000, switch (iSel2in) { case 33: - tofAnaTestbeam->SetSel2TOff( - -0.55); // Shift Sel2 time peak to 0 + tofAnaTestbeam->SetSel2TOff(-0.55); // Shift Sel2 time peak to 0 break; default:; diff --git a/macro/beamtime/mcbm2021/ana_trks_eval.C b/macro/beamtime/mcbm2021/ana_trks_eval.C index 5d3c64683f19b8dc06956235c1aec66ee4f94aa0..24437f0258ccfe1e77a4a73352a08b5ed0603244 100644 --- a/macro/beamtime/mcbm2021/ana_trks_eval.C +++ b/macro/beamtime/mcbm2021/ana_trks_eval.C @@ -1,24 +1,13 @@ -void ana_trks_eval(Int_t nEvents = 10000, - Int_t iSel = 1, - Int_t iGenCor = 1, - TString cFileId = "48.50.7.1", - TString cSet = "000010020", - Int_t iSel2 = 20, - Int_t iTrackingSetup = 2, - Double_t dScalFac = 1., - Double_t dChi2Lim2 = 500., - Double_t dDeadtime = 50, - TString cCalId = "", - Int_t iAnaCor = 1, - Bool_t bUseSigCalib = kFALSE, - Int_t iCalSet = 30040500, - Int_t iCalOpt = 1, - Int_t iMc = 0) { +void ana_trks_eval(Int_t nEvents = 10000, Int_t iSel = 1, Int_t iGenCor = 1, TString cFileId = "48.50.7.1", + TString cSet = "000010020", Int_t iSel2 = 20, Int_t iTrackingSetup = 2, Double_t dScalFac = 1., + Double_t dChi2Lim2 = 500., Double_t dDeadtime = 50, TString cCalId = "", Int_t iAnaCor = 1, + Bool_t bUseSigCalib = kFALSE, Int_t iCalSet = 30040500, Int_t iCalOpt = 1, Int_t iMc = 0) +{ Int_t iVerbose = 1; if (cCalId == "") cCalId = cFileId; TString FId = cFileId; - Int_t iNLen=FId.First("."); - TString cRun(FId(0, iNLen)); + Int_t iNLen = FId.First("."); + TString cRun(FId(0, iNLen)); Int_t iRun = cRun.Atoi(); // Specify log level (INFO, DEBUG, DEBUG1, ...) //TString logLevel = "FATAL"; @@ -34,33 +23,20 @@ void ana_trks_eval(Int_t nEvents = 10000, TString ParFile = paramDir + "/data/" + cFileId.Data() + ".params.root"; TString InputFile = paramDir + "/data/" + cFileId.Data() + ".root"; - TString InputDigiFile = paramDir + "/data/TofHits_" + cFileId.Data() - + Form("_%s_%02.0f_Cal", cSet.Data(), dDeadtime) + TString InputDigiFile = paramDir + "/data/TofHits_" + cFileId.Data() + Form("_%s_%02.0f_Cal", cSet.Data(), dDeadtime) + cCalId + ".out.root"; if (iMc == 1) { InputFile = paramDir + "/data/" + cFileId.Data() + ".raw.root"; InputDigiFile = paramDir + "/data/" + cFileId.Data() + ".rec.root"; iRun = 700; } - TString InputTrklFile = paramDir + "/data/TofTrks_" + cFileId.Data() - + Form("_%s_%06d_%03d", cSet.Data(), iSel, iSel2) - + ".out.root"; - TString OutputFile = paramDir + "/data/ana_" + cFileId.Data() - + Form("_%s_%06d_%03d", cSet.Data(), iSel, iSel2) - + ".out.root"; - TString cHstFile = - paramDir - + Form( - "/hst/%s_%03.0f_%s_%06d_%03d_%03.1f_%03.1f_trk%03d_Cal%s_Ana.hst.root", - cFileId.Data(), - dDeadtime, - cSet.Data(), - iSel, - iSel2, - dScalFac, - dChi2Lim2, - iTrackingSetup, - cCalId.Data()); + TString InputTrklFile = + paramDir + "/data/TofTrks_" + cFileId.Data() + Form("_%s_%06d_%03d", cSet.Data(), iSel, iSel2) + ".out.root"; + TString OutputFile = + paramDir + "/data/ana_" + cFileId.Data() + Form("_%s_%06d_%03d", cSet.Data(), iSel, iSel2) + ".out.root"; + TString cHstFile = paramDir + + Form("/hst/%s_%03.0f_%s_%06d_%03d_%03.1f_%03.1f_trk%03d_Cal%s_Ana.hst.root", cFileId.Data(), + dDeadtime, cSet.Data(), iSel, iSel2, dScalFac, dChi2Lim2, iTrackingSetup, cCalId.Data()); TString cTrkFile = Form("%s_tofFindTracks.hst.root", cCalId.Data()); TString cAnaFile = Form("%s_TrkAnaTestBeam.hst.root", cFileId.Data()); @@ -76,29 +52,27 @@ void ana_trks_eval(Int_t nEvents = 10000, Int_t iGeo = 0; if (iGeo == 0) { TString TofGeo = ""; - if (iRun < 690) - TofGeo = "v20a_mcbm"; + if (iRun < 690) TofGeo = "v20a_mcbm"; else TofGeo = "v21a_mcbm"; cout << "Geometry version " << TofGeo << endl; - TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" - + TofGeo + ".digibdf.par"); + TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" + TofGeo + ".digibdf.par"); parFileList->Add(tofDigiBdfFile); - TString geoDir = gSystem->Getenv("VMCWORKDIR"); - TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; - TFile* fgeo = new TFile(geoFile); + TString geoDir = gSystem->Getenv("VMCWORKDIR"); + TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; + TFile* fgeo = new TFile(geoFile); TGeoManager* geoMan = (TGeoManager*) fgeo->Get("FAIRGeom"); if (NULL == geoMan) { cout << "<E> FAIRGeom not found in geoFile" << endl; return; } - } else { + } + else { TString setupName = "mcbm_beam_2021_01"; // ----- Load the geometry setup ------------------------------------- - TString setupFile = - workDir + "/geometry/setup/setup_" + setupName.Data() + ".C"; + TString setupFile = workDir + "/geometry/setup/setup_" + setupName.Data() + ".C"; TString setupFunct = "setup_"; setupFunct = setupFunct + setupName + "()"; std::cout << "-I- Loading macro " << setupFile << std::endl; @@ -148,24 +122,14 @@ void ana_trks_eval(Int_t nEvents = 10000, Int_t calSel = 1; Bool_t bOut = kFALSE; - CbmTofEventClusterizer* tofClust = - new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); - Int_t calSelRead = calSel; + CbmTofEventClusterizer* tofClust = new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); + Int_t calSelRead = calSel; if (calSel < 0) calSelRead = 0; - TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cFileId.Data(), - iCalSet, - calMode, - calSelRead); + TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cFileId.Data(), iCalSet, calMode, calSelRead); if (cCalId != "XXX") - cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cCalId.Data(), - iCalSet, - calMode, - calSelRead); + cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cCalId.Data(), iCalSet, calMode, calSelRead); tofClust->SetCalParFileName(cFname); - TString cOutFname = - Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); + TString cOutFname = Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); tofClust->SetOutHstFileName(cOutFname); // ========================================================================= @@ -196,34 +160,28 @@ void ana_trks_eval(Int_t nEvents = 10000, 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->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.047); // target value for Mar2021 double stack + tofFindTracks->SetTtTarg(0.047); // target value for Mar2021 double stack // 0.0605); // target value for Mar2020 triple stack -> betapeak ~ 0.95 //tofFindTracks->SetTtTarg(0.062); // target value for Mar2020 triple stack -> betapeak ~ 0.95 //tofFindTracks->SetTtTarg(0.058); // target value for Mar2020 double stack //tofFindTracks->SetTtTarg(0.051); // target value Nov2019 //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->SetCalParFileName(cTrkFile); // Tracker parameter value file name + tofFindTracks->SetBeamCounter(5, 0, 0); // default beam counter tofFindTracks->SetR0Lim(20.); - 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( - bUseSigCalib); // ignore resolutions in CalPar file - tofTrackFinder->SetSIGLIM(dChi2Lim2 - * 2.); // matching window in multiples of chi2 - tofTrackFinder->SetChiMaxAccept(dChi2Lim2); // max tracklet chi2 - tofTrackFinder->SetSIGLIMMOD(5.); // max deviation for last hit + 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(bUseSigCalib); // ignore resolutions in CalPar file + tofTrackFinder->SetSIGLIM(dChi2Lim2 * 2.); // matching window in multiples of chi2 + tofTrackFinder->SetChiMaxAccept(dChi2Lim2); // max tracklet chi2 + tofTrackFinder->SetSIGLIMMOD(5.); // max deviation for last hit Int_t iMinNofHits = -1; Int_t iNStations = 0; @@ -273,7 +231,7 @@ void ana_trks_eval(Int_t nEvents = 10000, tofFindTracks->SetStation(26, 9, 0, 0); tofFindTracks->SetStation(27, 9, 1, 0); tofFindTracks->SetStation(28, 9, 0, 1); - tofFindTracks->SetStation(29, 9, 1, 1); + tofFindTracks->SetStation(29, 9, 1, 1); //tofFindTracks->SetStation(28, 6, 0, 0); //tofFindTracks->SetStation(29, 6, 0, 1); break; @@ -290,7 +248,7 @@ void ana_trks_eval(Int_t nEvents = 10000, tofFindTracks->SetStation(5, 9, 0, 0); tofFindTracks->SetStation(6, 9, 1, 0); tofFindTracks->SetStation(7, 9, 0, 1); - tofFindTracks->SetStation(8, 9, 1, 1); + tofFindTracks->SetStation(8, 9, 1, 1); break; case 2: @@ -468,8 +426,7 @@ void ana_trks_eval(Int_t nEvents = 10000, break; default: - cout << "Tracking setup " << iTrackingSetup << " not implemented " - << endl; + cout << "Tracking setup " << iTrackingSetup << " not implemented " << endl; return; ; } @@ -481,8 +438,7 @@ void ana_trks_eval(Int_t nEvents = 10000, // ========================================================================= // === Analysis === // ========================================================================= - CbmTofAnaTestbeam* tofAnaTestbeam = - new CbmTofAnaTestbeam("TOF TestBeam Analysis", iVerbose); + CbmTofAnaTestbeam* tofAnaTestbeam = new CbmTofAnaTestbeam("TOF TestBeam Analysis", iVerbose); tofAnaTestbeam->SetCorMode(iAnaCor); // 1 - DTD4, 2 - X4, 3 - Y4, 4 - Texp tofAnaTestbeam->SetHitDistMin(30.); // initialization tofAnaTestbeam->SetEnableMatchPosScaling(kTRUE); @@ -492,8 +448,7 @@ void ana_trks_eval(Int_t nEvents = 10000, tofAnaTestbeam->SetSpillBreak(0.); } //CbmTofAnaTestbeam defaults - tofAnaTestbeam->SetR0LimFit( - 20.); // limit distance of fitted track to nominal vertex + tofAnaTestbeam->SetR0LimFit(20.); // limit distance of fitted track to nominal vertex tofAnaTestbeam->SetStartSpillTime(0.); tofAnaTestbeam->SetDXMean(0.); @@ -503,34 +458,28 @@ void ana_trks_eval(Int_t nEvents = 10000, tofAnaTestbeam->SetDYWidth(0.8); tofAnaTestbeam->SetDTWidth(0.08); // in ns tofAnaTestbeam->SetCalParFileName(cAnaFile); - Double_t dScalFacA = 0.9; // dScalFac is used for tracking - tofAnaTestbeam->SetPosY4Sel( - 0.5 * dScalFacA); // Y Position selection in fraction of strip length - tofAnaTestbeam->SetDTDia(0.); // Time difference to additional diamond - tofAnaTestbeam->SetMul0Max(20); // Max Multiplicity in dut - tofAnaTestbeam->SetMul4Max(30); // Max Multiplicity in Ref - RPC - tofAnaTestbeam->SetMulDMax(3); // Max Multiplicity in Diamond / BeamRef - tofAnaTestbeam->SetTOffD4(14.); // initialization - tofAnaTestbeam->SetDTD4MAX( - 6.); // initialization of Max time difference Ref - BRef + Double_t dScalFacA = 0.9; // dScalFac is used for tracking + tofAnaTestbeam->SetPosY4Sel(0.5 * dScalFacA); // Y Position selection in fraction of strip length + tofAnaTestbeam->SetDTDia(0.); // Time difference to additional diamond + tofAnaTestbeam->SetMul0Max(20); // Max Multiplicity in dut + tofAnaTestbeam->SetMul4Max(30); // Max Multiplicity in Ref - RPC + tofAnaTestbeam->SetMulDMax(3); // Max Multiplicity in Diamond / BeamRef + tofAnaTestbeam->SetTOffD4(14.); // initialization + tofAnaTestbeam->SetDTD4MAX(6.); // initialization of Max time difference Ref - BRef //tofAnaTestbeam->SetTShift(-28000.);// initialization - tofAnaTestbeam->SetPosYS2Sel( - 0.55); // Y Position selection in fraction of strip length - tofAnaTestbeam->SetChS2Sel(0.); // Center of channel selection window - tofAnaTestbeam->SetDChS2Sel(100.); // Width of channel selection window - tofAnaTestbeam->SetSel2TOff(0.); // Shift Sel2 time peak to 0 - tofAnaTestbeam->SetChi2Lim(5.); // initialization of Chi2 selection limit - tofAnaTestbeam->SetChi2Lim2( - 3.); // initialization of Chi2 selection limit for Mref-Sel2 pair - tofAnaTestbeam->SetDutDX( - 15.); // limit inspection of tracklets to selected region - tofAnaTestbeam->SetDutDY( - 15.); // limit inspection of tracklets to selected region - tofAnaTestbeam->SetSIGLIM(3.); // max matching chi2 - tofAnaTestbeam->SetSIGT(0.08); // in ns - tofAnaTestbeam->SetSIGX(0.3); // in cm - tofAnaTestbeam->SetSIGY(0.6); // in cm + tofAnaTestbeam->SetPosYS2Sel(0.55); // Y Position selection in fraction of strip length + tofAnaTestbeam->SetChS2Sel(0.); // Center of channel selection window + tofAnaTestbeam->SetDChS2Sel(100.); // Width of channel selection window + tofAnaTestbeam->SetSel2TOff(0.); // Shift Sel2 time peak to 0 + tofAnaTestbeam->SetChi2Lim(5.); // initialization of Chi2 selection limit + tofAnaTestbeam->SetChi2Lim2(3.); // initialization of Chi2 selection limit for Mref-Sel2 pair + tofAnaTestbeam->SetDutDX(15.); // limit inspection of tracklets to selected region + tofAnaTestbeam->SetDutDY(15.); // limit inspection of tracklets to selected region + tofAnaTestbeam->SetSIGLIM(3.); // max matching chi2 + tofAnaTestbeam->SetSIGT(0.08); // in ns + tofAnaTestbeam->SetSIGX(0.3); // in cm + tofAnaTestbeam->SetSIGY(0.6); // in cm Int_t iRSel = 500; Int_t iRSelTyp = 5; @@ -551,16 +500,12 @@ void ana_trks_eval(Int_t nEvents = 10000, tofAnaTestbeam->SetBeamRefRpc(iRSelRpc); if (iSel2 >= -1) { - tofAnaTestbeam->SetMrpcSel2( - iSel2); // initialization of second selector Mrpc Type - tofAnaTestbeam->SetMrpcSel2Sm( - iSel2Sm); // initialization of second selector Mrpc SmId - tofAnaTestbeam->SetMrpcSel2Rpc( - iSel2Rpc); // initialization of second selector Mrpc RpcId + tofAnaTestbeam->SetMrpcSel2(iSel2); // initialization of second selector Mrpc Type + tofAnaTestbeam->SetMrpcSel2Sm(iSel2Sm); // initialization of second selector Mrpc SmId + tofAnaTestbeam->SetMrpcSel2Rpc(iSel2Rpc); // initialization of second selector Mrpc RpcId } - cout << "AnaTestbeam init for Dut " << iDut << iDutSm << iDutRpc << ", Ref " - << iRef << iRefSm << iRefRpc << endl; + cout << "AnaTestbeam init for Dut " << iDut << iDutSm << iDutRpc << ", Ref " << iRef << iRefSm << iRefRpc << endl; tofAnaTestbeam->SetDut(iDut); // Device under test tofAnaTestbeam->SetDutSm(iDutSm); // Device under test @@ -569,8 +514,8 @@ void ana_trks_eval(Int_t nEvents = 10000, tofAnaTestbeam->SetMrpcRefSm(iRefSm); // Reference RPC tofAnaTestbeam->SetMrpcRefRpc(iRefRpc); // Reference RPC - cout << "dispatch iSel = " << iSel << ", iSel2in = " << iSel2in - << ", iRSelin = " << iRSelin << ", iRSel = " << iRSel << endl; + cout << "dispatch iSel = " << iSel << ", iSel2in = " << iSel2in << ", iRSelin = " << iRSelin << ", iRSel = " << iRSel + << endl; if (1) { switch (iSel) { @@ -604,8 +549,7 @@ void ana_trks_eval(Int_t nEvents = 10000, tofAnaTestbeam->SetSel2TOff(-0.3); // Shift Sel2 time peak to 0 break; case 31: - tofAnaTestbeam->SetSel2TOff( - -0.41); // Shift Sel2 time peak to 0 + tofAnaTestbeam->SetSel2TOff(-0.41); // Shift Sel2 time peak to 0 break; default:; @@ -622,10 +566,11 @@ void ana_trks_eval(Int_t nEvents = 10000, case 911041: switch (iRSelin) { case 500: - if (iMc == 0) { // data + if (iMc == 0) { // data tofAnaTestbeam->SetTShift(2.); // Shift DTD4 to 0 tofAnaTestbeam->SetTOffD4(15.); // Shift DTD4 to physical value - } else { // MC + } + else { // MC tofAnaTestbeam->SetTShift(-2.); // Shift DTD4 to 0 tofAnaTestbeam->SetTOffD4(15.); // Shift DTD4 to physical value } @@ -640,19 +585,17 @@ void ana_trks_eval(Int_t nEvents = 10000, case 726: case 723: case 721: - tofAnaTestbeam->SetTShift(6.5); // Shift DTD4 to 0 - tofAnaTestbeam->SetSel2TOff( - 0.6); // Shift Sel2 time peak to 0 + tofAnaTestbeam->SetTShift(6.5); // Shift DTD4 to 0 + tofAnaTestbeam->SetSel2TOff(0.6); // Shift Sel2 time peak to 0 break; case 717: default: // 714 //tofAnaTestbeam->SetSel2TOff(-1.3); // Shift Sel2 time peak to 0 - tofAnaTestbeam->SetSel2TOff( - -0.5); // Shift Sel2 time peak to 0 + tofAnaTestbeam->SetSel2TOff(-0.5); // Shift Sel2 time peak to 0 } - } else { // MC - tofAnaTestbeam->SetSel2TOff( - -1.3); // Shift Sel2 time peak to 0 + } + else { // MC + tofAnaTestbeam->SetSel2TOff(-1.3); // Shift Sel2 time peak to 0 } break; case 600: @@ -675,8 +618,7 @@ void ana_trks_eval(Int_t nEvents = 10000, switch (iSel2in) { case 33: - tofAnaTestbeam->SetSel2TOff( - -0.55); // Shift Sel2 time peak to 0 + tofAnaTestbeam->SetSel2TOff(-0.55); // Shift Sel2 time peak to 0 break; default:; @@ -748,9 +690,8 @@ void ana_trks_eval(Int_t nEvents = 10000, TString Display_Status = "pl_over_Mat04D4best.C"; TString Display_Funct; - if (iGenCor < 0) { - Display_Funct = "pl_over_Mat04D4best(1)"; - } else { + if (iGenCor < 0) { Display_Funct = "pl_over_Mat04D4best(1)"; } + else { Display_Funct = "pl_over_Mat04D4best(0)"; } gROOT->LoadMacro(Display_Status); @@ -774,14 +715,12 @@ void ana_trks_eval(Int_t nEvents = 10000, gROOT->LoadMacro("pl_Dut_Res.C"); gROOT->LoadMacro("pl_Dut_Vel.C"); - cout << "Plotting for Dut " << iDut << iDutSm << iDutRpc << ", Ref " << iRef - << iRefSm << iRefRpc << endl; + cout << "Plotting for Dut " << iDut << iDutSm << iDutRpc << ", Ref " << iRef << iRefSm << iRefRpc << endl; gInterpreter->ProcessLine("pl_over_MatD4sel()"); gInterpreter->ProcessLine("pl_TIS()"); gInterpreter->ProcessLine("pl_TIR()"); - gInterpreter->ProcessLine( - Form("pl_Dut_Vel(\"%d%d%d\")", iDut, iDutSm, iDutRpc)); + gInterpreter->ProcessLine(Form("pl_Dut_Vel(\"%d%d%d\")", iDut, iDutSm, iDutRpc)); gInterpreter->ProcessLine("pl_eff_XY()"); gInterpreter->ProcessLine("pl_calib_trk()"); gInterpreter->ProcessLine("pl_vert_trk()"); diff --git a/macro/beamtime/mcbm2021/dis_digi.C b/macro/beamtime/mcbm2021/dis_digi.C index 69dd4706c8fab8f8d0d81cef67ac7d6d0e6b7c59..814d1493fd1021dfe2da22df136687a4058c8985 100644 --- a/macro/beamtime/mcbm2021/dis_digi.C +++ b/macro/beamtime/mcbm2021/dis_digi.C @@ -1,20 +1,8 @@ -void dis_digi(Int_t nEvents = 100, - Int_t calMode = 93, - Int_t calSel = 1, - Int_t calSm = 0, - Int_t RefSel = 1, - TString cFileId = "68.50.7.1", - Int_t iCalSet = 10500, - Bool_t bOut = 0, - Int_t iSel2 = 20, - Double_t dDeadtime = 50, - Int_t iGenCor = 1, - Int_t iTrackingSetup = 1, - Double_t dScalFac = 5., - Double_t dChi2Lim2 = 10., - TString cCalId = "XXX", - Bool_t bUseSigCalib = kFALSE, - Int_t iCalOpt = 1) { +void dis_digi(Int_t nEvents = 100, Int_t calMode = 93, Int_t calSel = 1, Int_t calSm = 0, Int_t RefSel = 1, + TString cFileId = "68.50.7.1", Int_t iCalSet = 10500, Bool_t bOut = 0, Int_t iSel2 = 20, + Double_t dDeadtime = 50, Int_t iGenCor = 1, Int_t iTrackingSetup = 1, Double_t dScalFac = 5., + Double_t dChi2Lim2 = 10., TString cCalId = "XXX", Bool_t bUseSigCalib = kFALSE, Int_t iCalOpt = 1) +{ Int_t iVerbose = 1; if (cCalId == "") cCalId = cFileId; @@ -46,8 +34,7 @@ void dis_digi(Int_t nEvents = 100, TString paramDir = "./"; TString ParFile = paramDir + "data/" + cFileId + ".params.root"; TString InputFile = paramDir + "data/" + cFileId + ".root"; - TString OutputFile = paramDir + "data/disdigi_" + cFileId - + Form("_%09d%03d", iCalSet, iSel2) + ".out.root"; + TString OutputFile = paramDir + "data/disdigi_" + cFileId + Form("_%09d%03d", iCalSet, iSel2) + ".out.root"; TString cTrkFile = Form("%s_tofFindTracks.hst.root", cFileId.Data()); @@ -60,24 +47,22 @@ void dis_digi(Int_t nEvents = 100, Int_t iGeo = 0; //iMc; if (iGeo == 0) { TString TofGeo = ""; - if (iRun < 690) - TofGeo = "v20a_mcbm"; + if (iRun < 690) TofGeo = "v20a_mcbm"; else TofGeo = "v21a_mcbm"; - + cout << "Geometry version " << TofGeo << endl; /* TObjString* tofDigiFile = new TObjString( workDir + "/parameters/tof/tof_" + TofGeo + ".digi.par"); // TOF digi file parFileList->Add(tofDigiFile); */ - TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" - + TofGeo + ".digibdf.par"); + TObjString* tofDigiBdfFile = new TObjString(workDir + "/parameters/tof/tof_" + TofGeo + ".digibdf.par"); parFileList->Add(tofDigiBdfFile); - TString geoDir = gSystem->Getenv("VMCWORKDIR"); - TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; - TFile* fgeo = new TFile(geoFile); + TString geoDir = gSystem->Getenv("VMCWORKDIR"); + TString geoFile = geoDir + "/geometry/tof/geofile_tof_" + TofGeo + ".root"; + TFile* fgeo = new TFile(geoFile); TGeoManager* geoMan = (TGeoManager*) fgeo->Get("FAIRGeom"); if (NULL == geoMan) { cout << "<E> FAIRGeom not found in geoFile" << endl; @@ -101,7 +86,8 @@ void dis_digi(Int_t nEvents = 100, if (iSel2 == 0) { iRSel = iBRef; // use diamond iSel2 = iBRef; - } else { + } + else { if (iSel2 < 0) iSel2 = -iSel2; iRSel = iSel2; } @@ -136,27 +122,22 @@ void dis_digi(Int_t nEvents = 100, run->SetUserOutputFileName(OutputFile.Data()); run->SetSink(new FairRootFileSink(run->GetUserOutputFileName())); - CbmTofEventClusterizer* tofClust = - new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); + CbmTofEventClusterizer* tofClust = new CbmTofEventClusterizer("TOF Event Clusterizer", iVerbose, bOut); tofClust->SetCalMode(calMode); tofClust->SetCalSel(calSel); - tofClust->SetCaldXdYMax(50.); // geometrical matching window in cm - tofClust->SetCalCluMulMax( - 4.); // Max Counter Cluster Multiplicity for filling calib histos - tofClust->SetCalRpc(calSm); // select detector for calibration update - tofClust->SetTRefId(RefSel); // reference trigger for offset calculation - tofClust->SetTotMax(20.); // Tot upper limit for walk corection - tofClust->SetTotMin( - 0.01); //(12000.); // Tot lower limit for walk correction - tofClust->SetTotPreRange( - 2.); // effective lower Tot limit in ns from peak position + tofClust->SetCaldXdYMax(50.); // geometrical matching window in cm + tofClust->SetCalCluMulMax(4.); // Max Counter Cluster Multiplicity for filling calib histos + tofClust->SetCalRpc(calSm); // select detector for calibration update + tofClust->SetTRefId(RefSel); // reference trigger for offset calculation + tofClust->SetTotMax(20.); // Tot upper limit for walk corection + tofClust->SetTotMin(0.01); //(12000.); // Tot lower limit for walk correction + tofClust->SetTotPreRange(2.); // effective lower Tot limit in ns from peak position tofClust->SetTotMean(2.); // Tot calibration target value in ns tofClust->SetMaxTimeDist(1.0); // default cluster range in ns //tofClust->SetMaxTimeDist(0.); //Deb// default cluster range in ns - tofClust->SetDelTofMax( - 60.); // acceptance range for cluster correlation in cm (!) - tofClust->SetSel2MulMax(4); // limit Multiplicity in 2nd selector + tofClust->SetDelTofMax(60.); // acceptance range for cluster correlation in cm (!) + tofClust->SetSel2MulMax(4); // limit Multiplicity in 2nd selector tofClust->SetChannelDeadtime(dDeadtime); // artificial deadtime in ns tofClust->SetEnableAvWalk(kTRUE); tofClust->SetYFitMin(1.E4); @@ -165,18 +146,12 @@ void dis_digi(Int_t nEvents = 100, Int_t calSelRead = calSel; if (calSel < 0) calSelRead = 0; - TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", - cFileId.Data(), - iCalSet, - calMode, - calSelRead); + TString cFname = Form("%s_set%09d_%02d_%01dtofClust.hst.root", cFileId.Data(), iCalSet, calMode, calSelRead); tofClust->SetCalParFileName(cFname); - TString cOutFname = - Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); + TString cOutFname = Form("tofClust_%s_set%09d.hst.root", cFileId.Data(), iCalSet); tofClust->SetOutHstFileName(cOutFname); - TString cAnaFile = - Form("%s_%09d%03d_tofAna.hst.root", cFileId.Data(), iCalSet, iSel2); + TString cAnaFile = Form("%s_%09d%03d_tofAna.hst.root", cFileId.Data(), iCalSet, iSel2); switch (calMode) { case -1: // initial calibration @@ -317,10 +292,7 @@ void dis_digi(Int_t nEvents = 100, tofClust->SetTRefDifMax(0.5); // in ns tofClust->PosYMaxScal(0.7); //in % of length break; - default: - cout << "<E> Calib mode not implemented! stop execution of script" - << endl; - return; + default: cout << "<E> Calib mode not implemented! stop execution of script" << endl; return; } run->AddTask(tofClust); @@ -353,30 +325,24 @@ void dis_digi(Int_t nEvents = 100, 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->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.057); // target value for inverse velocity, > 0.033 ns/cm! + tofFindTracks->SetTtTarg(0.057); // 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->SetCalParFileName(cTrkFile); // Tracker parameter value file name + tofFindTracks->SetBeamCounter(5, 0, 0); // default beam counter tofFindTracks->SetR0Lim(100.); - tofFindTracks->SetStationMaxHMul( - 30); // Max Hit Multiplicity in any used station + 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.6); // default in cm - tofFindTracks->SetSIGZ(0.05); // default in cm - tofFindTracks->SetUseSigCalib( - bUseSigCalib); // ignore resolutions in CalPar file - tofTrackFinder->SetSIGLIM(dChi2Lim2 - * 2.); // matching window in multiples of chi2 - tofTrackFinder->SetChiMaxAccept(dChi2Lim2); // max tracklet chi2 + tofFindTracks->SetT0MAX(dScalFac); // in ns + tofFindTracks->SetSIGT(0.08); // default in ns + tofFindTracks->SetSIGX(0.3); // default in cm + tofFindTracks->SetSIGY(0.6); // default in cm + tofFindTracks->SetSIGZ(0.05); // default in cm + tofFindTracks->SetUseSigCalib(bUseSigCalib); // 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; @@ -557,8 +523,7 @@ void dis_digi(Int_t nEvents = 100, tofFindTracks->SetStation(3, 0, 2, 2); default: - cout << "Tracking setup " << iTrackingSetup << " not implemented " - << endl; + cout << "Tracking setup " << iTrackingSetup << " not implemented " << endl; return; ; } @@ -572,8 +537,7 @@ void dis_digi(Int_t nEvents = 100, // === Analysis === // ========================================================================= - CbmTofAnaTestbeam* tofAnaTestbeam = - new CbmTofAnaTestbeam("TOF TestBeam Analysis", iVerbose); + CbmTofAnaTestbeam* tofAnaTestbeam = new CbmTofAnaTestbeam("TOF TestBeam Analysis", iVerbose); //CbmTofAnaTestbeam defaults tofAnaTestbeam->SetReqTrg(0); // 0 - no selection @@ -584,8 +548,7 @@ void dis_digi(Int_t nEvents = 100, tofAnaTestbeam->SetDYWidth(0.4); tofAnaTestbeam->SetDTWidth(80.); // in ps tofAnaTestbeam->SetCalParFileName(cAnaFile); - tofAnaTestbeam->SetPosY4Sel( - 0.5); // Y Position selection in fraction of strip length + tofAnaTestbeam->SetPosY4Sel(0.5); // Y Position selection in fraction of strip length tofAnaTestbeam->SetDTDia(0.); // Time difference to additional diamond tofAnaTestbeam->SetCorMode(RefSel); // 1 - DTD4, 2 - X4 tofAnaTestbeam->SetMul0Max(30); // Max Multiplicity in dut @@ -594,8 +557,7 @@ void dis_digi(Int_t nEvents = 100, tofAnaTestbeam->SetHitDistMin(30.); // initialization tofAnaTestbeam->SetEnableMatchPosScaling(kTRUE); - tofAnaTestbeam->SetPosYS2Sel( - 0.5); // Y Position selection in fraction of strip length + tofAnaTestbeam->SetPosYS2Sel(0.5); // Y Position selection in fraction of strip length tofAnaTestbeam->SetChS2Sel(0.); // Center of channel selection window tofAnaTestbeam->SetDChS2Sel(100.); // Width of channel selection window tofAnaTestbeam->SetTShift(0.); // Shift DTD4 to 0 @@ -611,12 +573,9 @@ void dis_digi(Int_t nEvents = 100, tofClust->SetSel2Sm(iSel2Sm); tofClust->SetSel2Rpc(iSel2Rpc); - tofAnaTestbeam->SetMrpcSel2( - iSel2); // initialization of second selector Mrpc Type - tofAnaTestbeam->SetMrpcSel2Sm( - iSel2Sm); // initialization of second selector Mrpc SmId - tofAnaTestbeam->SetMrpcSel2Rpc( - iSel2Rpc); // initialization of second selector Mrpc RpcId + tofAnaTestbeam->SetMrpcSel2(iSel2); // initialization of second selector Mrpc Type + tofAnaTestbeam->SetMrpcSel2Sm(iSel2Sm); // initialization of second selector Mrpc SmId + tofAnaTestbeam->SetMrpcSel2Rpc(iSel2Rpc); // initialization of second selector Mrpc RpcId } tofClust->SetDutId(iDut); @@ -656,10 +615,8 @@ void dis_digi(Int_t nEvents = 100, break; case 9: - tofAnaTestbeam->SetChi2Lim( - 100.); // initialization of Chi2 selection limit - tofAnaTestbeam->SetMulDMax( - 3); // Max Multiplicity in BeamRef // Diamond + tofAnaTestbeam->SetChi2Lim(100.); // initialization of Chi2 selection limit + tofAnaTestbeam->SetMulDMax(3); // Max Multiplicity in BeamRef // Diamond tofAnaTestbeam->SetTShift(0.1); // Shift DTD4 to 0 tofAnaTestbeam->SetTOffD4(16.); // Shift DTD4 to physical value tofAnaTestbeam->SetSel2TOff(0.5); // Shift Sel2 time peak to 0 @@ -703,22 +660,15 @@ void dis_digi(Int_t nEvents = 100, FairEventManager* fMan = new FairEventManager(); - CbmEvDisTracks* Tracks = new CbmEvDisTracks( - "Tof Tracks", - 1, - kFALSE, - kTRUE); //name, verbosity, RnrChildren points, RnrChildren track - // CbmEvDisTracks *Tracks = new CbmEvDisTracks("Tof Tracks",1); + CbmEvDisTracks* Tracks = new CbmEvDisTracks("Tof Tracks", 1, kFALSE, + kTRUE); //name, verbosity, RnrChildren points, RnrChildren track + // CbmEvDisTracks *Tracks = new CbmEvDisTracks("Tof Tracks",1); fMan->AddTask(Tracks); - CbmPixelHitSetDraw* TofUHits = - new CbmPixelHitSetDraw("TofUHit", kRed, kOpenCross); + CbmPixelHitSetDraw* TofUHits = new CbmPixelHitSetDraw("TofUHit", kRed, kOpenCross); fMan->AddTask(TofUHits); - CbmPointSetArrayDraw* TofHits = new CbmPointSetArrayDraw( - "TofHit", - 1, - 1, - 4, - kTRUE); //name, colorMode, markerMode, verbosity, RnrChildren + CbmPointSetArrayDraw* TofHits = + new CbmPointSetArrayDraw("TofHit", 1, 1, 4, + kTRUE); //name, colorMode, markerMode, verbosity, RnrChildren // CbmPixelHitSetDraw *TofHits = new CbmPixelHitSetDraw ("TofHit", kRed, kOpenCircle, 4);// kFullSquare); fMan->AddTask(TofHits); diff --git a/macro/beamtime/mcbm2021/pl_all_2D.C b/macro/beamtime/mcbm2021/pl_all_2D.C index dfdf9888bfd93b2e58516235eb7bd77691b40842..c79ca26d4bda87ec1f659cc9bb1948f4d2edd0a5 100644 --- a/macro/beamtime/mcbm2021/pl_all_2D.C +++ b/macro/beamtime/mcbm2021/pl_all_2D.C @@ -1,4 +1,5 @@ -void pl_all_2D(Int_t iOpt = 0, Int_t iNSt = 4) { +void pl_all_2D(Int_t iOpt = 0, Int_t iNSt = 4) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -50,13 +51,13 @@ void pl_all_2D(Int_t iOpt = 0, Int_t iNSt = 4) { can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = Form( - "cl_SmT%01d_sm%03d_rpc%03d_%s", iType[iSt], iSm, iRp, cOpt.Data()); - h = (TH2*) gROOT->FindObjectAny(hname); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_%s", iType[iSt], iSm, iRp, cOpt.Data()); + h = (TH2*) gROOT->FindObjectAny(hname); if (h != NULL) { if (iOpt == 4 || iOpt == 5) { gPad->SetLogz(); } h->Draw("colz"); - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } if (iRp == 10) break; diff --git a/macro/beamtime/mcbm2021/pl_all_3D.C b/macro/beamtime/mcbm2021/pl_all_3D.C index b3f87c24d69085a2151db5ce1b6371bd1c944c20..0f72dbba0db224761f00bc75ad3248e50b0f7cf1 100644 --- a/macro/beamtime/mcbm2021/pl_all_3D.C +++ b/macro/beamtime/mcbm2021/pl_all_3D.C @@ -1,4 +1,5 @@ -void pl_all_3D(Int_t iOpt = 0, Int_t iSel = 0, Int_t iNSt = 4) { +void pl_all_3D(Int_t iOpt = 0, Int_t iSel = 0, Int_t iNSt = 4) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -42,16 +43,13 @@ void pl_all_3D(Int_t iOpt = 0, Int_t iSel = 0, Int_t iNSt = 4) { can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_Sel%02d_Walk2", - iType[iSt], - iSm, - iRp, - iSel); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_Sel%02d_Walk2", iType[iSt], iSm, iRp, iSel); h = (TH3*) gROOT->FindObjectAny(hname); if (h != NULL) { if (iOpt == 4 || iOpt == 5) { gPad->SetLogz(); } h->Project3D(cOpt)->Draw("colz"); - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_CluMul.C b/macro/beamtime/mcbm2021/pl_all_CluMul.C index aac7c6712aed0ca86357848ce7acaa3bde43fbb7..24cffaf29d269aa7486b9d152be4330306da5efe 100644 --- a/macro/beamtime/mcbm2021/pl_all_CluMul.C +++ b/macro/beamtime/mcbm2021/pl_all_CluMul.C @@ -1,4 +1,5 @@ -void pl_all_CluMul(Int_t iNSt = 6, Double_t MulMax = 100) { +void pl_all_CluMul(Int_t iNSt = 6, Double_t MulMax = 100) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -33,14 +34,14 @@ void pl_all_CluMul(Int_t iNSt = 6, Double_t MulMax = 100) { can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_Mul", iType[iSt], iSm, iRp); - h = (TH1*) gROOT->FindObjectAny(hname); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_Mul", iType[iSt], iSm, iRp); + h = (TH1*) gROOT->FindObjectAny(hname); if (h != NULL) { h->GetXaxis()->SetRange(0., MulMax); h->Draw(""); gPad->SetLogy(); - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } if (iRp == 10) break; diff --git a/macro/beamtime/mcbm2021/pl_all_CluPosEvol.C b/macro/beamtime/mcbm2021/pl_all_CluPosEvol.C index 70648848a79d9cc7575dce80ef11c18db4400d9a..3ae8655801684da4b325955ef8407e3b331fcf49 100644 --- a/macro/beamtime/mcbm2021/pl_all_CluPosEvol.C +++ b/macro/beamtime/mcbm2021/pl_all_CluPosEvol.C @@ -1,4 +1,5 @@ -void pl_all_CluPosEvol(Int_t iNSt = 2, Int_t iTmax = 0) { +void pl_all_CluPosEvol(Int_t iNSt = 2, Int_t iTmax = 0) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -37,9 +38,8 @@ void pl_all_CluPosEvol(Int_t iNSt = 2, Int_t iTmax = 0) { for (Int_t iRp = 0; iRp < iRpcNum[iSt]; iRp++) { //cout << "plot rpc at station "<<iSt<<" with "<< iSmNum[iSt] <<" modules of "<<iRpcNum[iSt]<<" Rpcs each"<<endl; gROOT->cd(); - TString hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_PosEvol", iType[iSt], iSm, iRp); - h = (TH1*) gROOT->FindObjectAny(hname); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_PosEvol", iType[iSt], iSm, iRp); + h = (TH1*) gROOT->FindObjectAny(hname); if (h != NULL) { can->cd(iCanv + 1); iCanv++; @@ -51,7 +51,8 @@ void pl_all_CluPosEvol(Int_t iNSt = 2, Int_t iTmax = 0) { if (iTmax > 0) h->GetXaxis()->SetRange(0., iTmax); h->Draw(""); //gPad->SetLogy(); - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_CluRate.C b/macro/beamtime/mcbm2021/pl_all_CluRate.C index cb4168726a5917b3b35d3def60f2d49a837f7617..c48d3b3f2d4a1c41ad0c42f42001b1e22f38faed 100644 --- a/macro/beamtime/mcbm2021/pl_all_CluRate.C +++ b/macro/beamtime/mcbm2021/pl_all_CluRate.C @@ -1,8 +1,5 @@ -void pl_all_CluRate(Int_t iNSt = 4, - Int_t iOpt = 0, - Double_t Tstart = 0., - Double_t Tend = 800., - Int_t iMode = 0) { +void pl_all_CluRate(Int_t iNSt = 4, Int_t iOpt = 0, Double_t Tstart = 0., Double_t Tend = 800., Int_t iMode = 0) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -55,14 +52,8 @@ void pl_all_CluRate(Int_t iNSt = 4, gROOT->cd(); TString hname = ""; switch (iOpt) { - case 0: - hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_rate", iType[iSt], iSm, iRp); - break; - case 1: - hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_rate10s", iType[iSt], iSm, iRp); - break; + case 0: hname = Form("cl_SmT%01d_sm%03d_rpc%03d_rate", iType[iSt], iSm, iRp); break; + case 1: hname = Form("cl_SmT%01d_sm%03d_rpc%03d_rate10s", iType[iSt], iSm, iRp); break; } h = (TH1*) gROOT->FindObjectAny(hname); if (h != NULL) { @@ -85,13 +76,13 @@ void pl_all_CluRate(Int_t iNSt = 4, h->SetLineColor(iCol); h->SetLineStyle(1); h->SetMarkerColor(iCol); - if (iSm == 0 && iRp == 0) - h->Draw("LPE"); + if (iSm == 0 && iRp == 0) h->Draw("LPE"); else h->Draw("LPEsame"); break; } - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_CluTimeEvol.C b/macro/beamtime/mcbm2021/pl_all_CluTimeEvol.C index b186b370e8164234bc55d54560d2fcf24f1ddb96..a7327b020a051436c9e2c1d9d8b3a96bf3ef92bb 100644 --- a/macro/beamtime/mcbm2021/pl_all_CluTimeEvol.C +++ b/macro/beamtime/mcbm2021/pl_all_CluTimeEvol.C @@ -1,4 +1,5 @@ -void pl_all_CluTimeEvol(Int_t iNSt = 2, Int_t iTmax = 0) { +void pl_all_CluTimeEvol(Int_t iNSt = 2, Int_t iTmax = 0) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -37,9 +38,8 @@ void pl_all_CluTimeEvol(Int_t iNSt = 2, Int_t iTmax = 0) { for (Int_t iRp = 0; iRp < iRpcNum[iSt]; iRp++) { //cout << "plot rpc at station "<<iSt<<" with "<< iSmNum[iSt] <<" modules of "<<iRpcNum[iSt]<<" Rpcs each"<<endl; gROOT->cd(); - TString hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_TimeEvol", iType[iSt], iSm, iRp); - h = (TH1*) gROOT->FindObjectAny(hname); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_TimeEvol", iType[iSt], iSm, iRp); + h = (TH1*) gROOT->FindObjectAny(hname); if (h != NULL) { can->cd(iCanv + 1); iCanv++; @@ -51,7 +51,8 @@ void pl_all_CluTimeEvol(Int_t iNSt = 2, Int_t iTmax = 0) { if (iTmax > 0) h->GetXaxis()->SetRange(0., iTmax); h->Draw(""); //gPad->SetLogy(); - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_DTLastHits.C b/macro/beamtime/mcbm2021/pl_all_DTLastHits.C index 185f2e59f585c7ce8949fdfc552f8274f9c550b7..bae663ee28c68fb8ab277380901293e7f09cd213 100644 --- a/macro/beamtime/mcbm2021/pl_all_DTLastHits.C +++ b/macro/beamtime/mcbm2021/pl_all_DTLastHits.C @@ -1,6 +1,5 @@ -void pl_all_DTLastHits(Int_t iNSt = 6, - Double_t Tstart = 1., - Double_t Tend = 1000.) { +void pl_all_DTLastHits(Int_t iNSt = 6, Double_t Tstart = 1., Double_t Tend = 1000.) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -36,14 +35,14 @@ void pl_all_DTLastHits(Int_t iNSt = 6, can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_DTLastHits", iType[iSt], iSm, iRp); - h = (TH1*) gROOT->FindObjectAny(hname); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_DTLastHits", iType[iSt], iSm, iRp); + h = (TH1*) gROOT->FindObjectAny(hname); if (h != NULL) { h->GetXaxis()->SetRange(Tstart, Tend); h->Draw(""); gPad->SetLogy(); - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } if (iRp == 10) break; diff --git a/macro/beamtime/mcbm2021/pl_all_DigiCor.C b/macro/beamtime/mcbm2021/pl_all_DigiCor.C index c6fd1c56e4fa6b18b79e1afbc4cb7cf51cac48fb..bfe2d91bc2e675734087d9b55dcc55ccce90d272 100644 --- a/macro/beamtime/mcbm2021/pl_all_DigiCor.C +++ b/macro/beamtime/mcbm2021/pl_all_DigiCor.C @@ -1,4 +1,5 @@ -void pl_all_DigiCor(Int_t iNDet = 4) { +void pl_all_DigiCor(Int_t iNDet = 4) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); TCanvas* can = new TCanvas("can", "can", 48, 55, 900, 900); @@ -31,13 +32,13 @@ void pl_all_DigiCor(Int_t iNDet = 4) { can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_DigiCor", iType[iCh], iSm, iRpc); - h2 = (TH2*) gROOT->FindObjectAny(hname); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_DigiCor", iType[iCh], iSm, iRpc); + h2 = (TH2*) gROOT->FindObjectAny(hname); if (h2 != NULL) { h2->Draw("colz"); // gPad->SetLogy(); - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_DigiDTFD.C b/macro/beamtime/mcbm2021/pl_all_DigiDTFD.C index 692ed7c5cab3326295d0a3e4d23a143de8e1a013..391fb42d7a55d8b219ea665a0fd0d50e4feca131 100644 --- a/macro/beamtime/mcbm2021/pl_all_DigiDTFD.C +++ b/macro/beamtime/mcbm2021/pl_all_DigiDTFD.C @@ -1,4 +1,5 @@ -void pl_all_DigiDTFD(Int_t iOpt = 0, Double_t dYmax = 0., Int_t iNDet = 2) { +void pl_all_DigiDTFD(Int_t iOpt = 0, Double_t dYmax = 0., Int_t iNDet = 2) +{ Int_t iOpt1 = iOpt % 10; Int_t iOpt2 = (iOpt - iOpt1) / 10 % 10; Int_t iOpt3 = (iOpt - iOpt2 * 10 - iOpt1) / 100 % 10; @@ -54,7 +55,8 @@ void pl_all_DigiDTFD(Int_t iOpt = 0, Double_t dYmax = 0., Int_t iNDet = 2) { iCanv++; gROOT->cd(); iCol = 1; - } else { + } + else { if (iOpt3 == 4) { iCol = 1; if (iCh != iOpt4) continue; @@ -70,15 +72,9 @@ void pl_all_DigiDTFD(Int_t iOpt = 0, Double_t dYmax = 0., Int_t iNDet = 2) { TString hname = ""; switch (iOpt1) { - case 0: - hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_DigiDTFD", iType[iCh], iSm, iRpc); - break; + case 0: hname = Form("cl_SmT%01d_sm%03d_rpc%03d_DigiDTFD", iType[iCh], iSm, iRpc); break; - case 1: - hname = Form( - "cl_SmT%01d_sm%03d_rpc%03d_DigiDTMul", iType[iCh], iSm, iRpc); - break; + case 1: hname = Form("cl_SmT%01d_sm%03d_rpc%03d_DigiDTMul", iType[iCh], iSm, iRpc); break; default:; } @@ -104,11 +100,11 @@ void pl_all_DigiDTFD(Int_t iOpt = 0, Double_t dYmax = 0., Int_t iNDet = 2) { if (iRpc == 0) { if (dYmax > 0.) hp->SetMaximum(dYmax); hp->Draw(); - } else + } + else hp->Draw("same"); } - cout << "plot " << hp->GetName() << " into canv " << iCanv - << " with col " << iCol << endl; + cout << "plot " << hp->GetName() << " into canv " << iCanv << " with col " << iCol << endl; //gPad->SetLogy(); break; @@ -120,19 +116,15 @@ void pl_all_DigiDTFD(Int_t iOpt = 0, Double_t dYmax = 0., Int_t iNDet = 2) { case 3: for (Int_t iCh = 0; iCh < h2->GetNbinsX(); iCh++) { - if (iCh == 0) - h2->ProjectionY( - Form("%s_py%d", h2->GetName(), iCh), iCh + 1, iCh + 1) - ->Draw(); + if (iCh == 0) h2->ProjectionY(Form("%s_py%d", h2->GetName(), iCh), iCh + 1, iCh + 1)->Draw(); else { - h2->ProjectionY( - Form("%s_py%d", h2->GetName(), iCh), iCh + 1, iCh + 1) - ->Draw("same"); + h2->ProjectionY(Form("%s_py%d", h2->GetName(), iCh), iCh + 1, iCh + 1)->Draw("same"); } } break; } - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_DigiDTLD.C b/macro/beamtime/mcbm2021/pl_all_DigiDTLD.C index 2dfff3c824984a1333dbbcda55087d6bd8b7ae62..c6436feca1e9758f3ea584c74d49aab1a2a018a1 100644 --- a/macro/beamtime/mcbm2021/pl_all_DigiDTLD.C +++ b/macro/beamtime/mcbm2021/pl_all_DigiDTLD.C @@ -1,4 +1,5 @@ -void pl_all_DigiDTLD(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { +void pl_all_DigiDTLD(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); TCanvas* can = new TCanvas("can", "can", 48, 55, 900, 900); @@ -40,8 +41,7 @@ void pl_all_DigiDTLD(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_DigiDTLD", iType[iCh], iSm, iRpc); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_DigiDTLD", iType[iCh], iSm, iRpc); switch (iOpt) { case 0:; break; @@ -67,13 +67,11 @@ void pl_all_DigiDTLD(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { gPad->SetLogz(); // Determine time duration an data taking - hnameT = - Form("cl_SmT%01d_sm%03d_rpc%03d_rate", jSmType, jSm, jRp); - hTime = (TH1*) gROOT->FindObjectAny(hnameT); + hnameT = Form("cl_SmT%01d_sm%03d_rpc%03d_rate", jSmType, jSm, jRp); + hTime = (TH1*) gROOT->FindObjectAny(hnameT); for (dTime = 0; dTime < hTime->GetNbinsX(); dTime++) if (hTime->GetBinContent(dTime + 1) == 0) break; - cout << "Normalize for a run duration of " << dTime << " s" - << endl; + cout << "Normalize for a run duration of " << dTime << " s" << endl; // create result histograms hx = h2->ProjectionX(Form("%s_fdead", hname.Data())); @@ -84,15 +82,13 @@ void pl_all_DigiDTLD(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { hy_dead->GetYaxis()->SetTitle("deadtime fraction"); hy_dead->Reset(); for (Int_t iT = hy->GetNbinsX(); iT > 0; iT--) { - dDeadtimeSum += - hy->GetBinContent(iT) * hy->GetXaxis()->GetBinLowEdge(iT); + dDeadtimeSum += hy->GetBinContent(iT) * hy->GetXaxis()->GetBinLowEdge(iT); Double_t dDeadFrac = dDeadtimeSum / h2->GetNbinsX() / dTime; hy_dead->SetBinContent(iT, dDeadFrac); } for (Int_t iCh = 0; iCh < h2->GetNbinsX(); iCh++) { - TH1D* hCh = h2->ProjectionY( - Form("%s_%d_py", hname.Data(), iCh), iCh + 1, iCh + 1); + TH1D* hCh = h2->ProjectionY(Form("%s_%d_py", hname.Data(), iCh), iCh + 1, iCh + 1); Double_t dAll = hCh->GetEntries(); Double_t dTAllMean = hCh->GetMean(); if (dAll > 0) { @@ -104,11 +100,7 @@ void pl_all_DigiDTLD(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { Double_t dLateRatio = dLate * dTLateMean / dTime; cout << Form("Long DT fraction for %s, ch %d: %6.3f, dTAll " "%6.3f, dTLate %6.3f", - hname.Data(), - iCh, - dLateRatio, - dTAllMean, - dTLateMean) + hname.Data(), iCh, dLateRatio, dTAllMean, dTLateMean) << endl; hx->SetBinContent(iCh + 1, dLateRatio); } @@ -123,7 +115,8 @@ void pl_all_DigiDTLD(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { gPad->SetLogy(); break; } - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_DigiMul.C b/macro/beamtime/mcbm2021/pl_all_DigiMul.C index 45aa3fe3710a4f11eed8fd7cde95dbf7c7a12058..d3787d2ca7819ad30565a68119cde23d17c84f7a 100644 --- a/macro/beamtime/mcbm2021/pl_all_DigiMul.C +++ b/macro/beamtime/mcbm2021/pl_all_DigiMul.C @@ -1,4 +1,5 @@ -void pl_all_DigiMul(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { +void pl_all_DigiMul(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); TCanvas* can = new TCanvas("can", "can", 48, 55, 900, 900); @@ -40,8 +41,7 @@ void pl_all_DigiMul(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = - Form("cl_SmT%01d_sm%03d_rpc%03d_DigiMul", iType[iCh], iSm, iRpc); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_DigiMul", iType[iCh], iSm, iRpc); switch (iOpt) { case 0:; break; @@ -66,13 +66,11 @@ void pl_all_DigiMul(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { gPad->SetLogz(); // Determine time duration an data taking - hnameT = - Form("cl_SmT%01d_sm%03d_rpc%03d_rate", jSmType, jSm, jRp); - hTime = (TH1*) gROOT->FindObjectAny(hnameT); + hnameT = Form("cl_SmT%01d_sm%03d_rpc%03d_rate", jSmType, jSm, jRp); + hTime = (TH1*) gROOT->FindObjectAny(hnameT); for (dTime = 0; dTime < hTime->GetNbinsX(); dTime++) if (hTime->GetBinContent(dTime + 1) == 0) break; - cout << "Normalize for a run duration of " << dTime << " s" - << endl; + cout << "Normalize for a run duration of " << dTime << " s" << endl; // create result histograms hx = h2->ProjectionX(Form("%s_fdead", hname.Data())); @@ -83,15 +81,13 @@ void pl_all_DigiMul(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { hy_dead->GetYaxis()->SetTitle("deadtime fraction"); hy_dead->Reset(); for (Int_t iT = hy->GetNbinsX(); iT > 0; iT--) { - dDeadtimeSum += - hy->GetBinContent(iT) * hy->GetXaxis()->GetBinLowEdge(iT); + dDeadtimeSum += hy->GetBinContent(iT) * hy->GetXaxis()->GetBinLowEdge(iT); Double_t dDeadFrac = dDeadtimeSum / h2->GetNbinsX() / dTime; hy_dead->SetBinContent(iT, dDeadFrac); } for (Int_t iCh = 0; iCh < h2->GetNbinsX(); iCh++) { - TH1D* hCh = h2->ProjectionY( - Form("%s_%d_py", hname.Data(), iCh), iCh + 1, iCh + 1); + TH1D* hCh = h2->ProjectionY(Form("%s_%d_py", hname.Data(), iCh), iCh + 1, iCh + 1); Double_t dAll = hCh->GetEntries(); Double_t dTAllMean = hCh->GetMean(); if (dAll > 0) { @@ -103,11 +99,7 @@ void pl_all_DigiMul(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { Double_t dLateRatio = dLate * dTLateMean / dTime; cout << Form("Long DT fraction for %s, ch %d: %6.3f, dTAll " "%6.3f, dTLate %6.3f", - hname.Data(), - iCh, - dLateRatio, - dTAllMean, - dTLateMean) + hname.Data(), iCh, dLateRatio, dTAllMean, dTLateMean) << endl; hx->SetBinContent(iCh + 1, dLateRatio); } @@ -122,7 +114,8 @@ void pl_all_DigiMul(Int_t iNDet = 4, Double_t dDTthr = 2., Int_t iOpt = 0) { gPad->SetLogy(); break; } - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_DigiTot.C b/macro/beamtime/mcbm2021/pl_all_DigiTot.C index 0c29855207c257a61bb0394017e0c59e378a6832..a59bef81ca38534329ee13a6d5a9ed2b3bbb9407 100644 --- a/macro/beamtime/mcbm2021/pl_all_DigiTot.C +++ b/macro/beamtime/mcbm2021/pl_all_DigiTot.C @@ -1,4 +1,5 @@ -void pl_all_DigiTot(Int_t iNDet = 4) { +void pl_all_DigiTot(Int_t iNDet = 4) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); TCanvas* can = new TCanvas("can", "can", 48, 55, 900, 900); @@ -30,13 +31,13 @@ void pl_all_DigiTot(Int_t iNDet = 4) { can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = - Form("hDigiTot_SmT%01d_sm%03d_rpc%03d", iType[iCh], iSm, iRpc); - h2 = (TH2*) gROOT->FindObjectAny(hname); + TString hname = Form("hDigiTot_SmT%01d_sm%03d_rpc%03d", iType[iCh], iSm, iRpc); + h2 = (TH2*) gROOT->FindObjectAny(hname); if (h2 != NULL) { h2->Draw("colz"); // gPad->SetLogy(); - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_Sel2D.C b/macro/beamtime/mcbm2021/pl_all_Sel2D.C index 7eb0725d7efd600ef6729104fbe2ec0bb16c511f..3dfb4c0591dbadf2b3ad9aa0d9d9087c02796c26 100644 --- a/macro/beamtime/mcbm2021/pl_all_Sel2D.C +++ b/macro/beamtime/mcbm2021/pl_all_Sel2D.C @@ -1,7 +1,5 @@ -void pl_all_Sel2D(Int_t iOpt = 0, - Int_t iSel = 0, - Int_t iOpt2 = 0, - Int_t iNSt = 4) { +void pl_all_Sel2D(Int_t iOpt = 0, Int_t iSel = 0, Int_t iOpt2 = 0, Int_t iNSt = 4) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -55,12 +53,7 @@ void pl_all_Sel2D(Int_t iOpt = 0, can->cd(iCanv + 1); iCanv++; gROOT->cd(); - TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_Sel%02d_%s", - iType[iSt], - iSm, - iRp, - iSel, - cOpt.Data()); + TString hname = Form("cl_SmT%01d_sm%03d_rpc%03d_Sel%02d_%s", iType[iSt], iSm, iRp, iSel, cOpt.Data()); h = (TH2*) gROOT->FindObjectAny(hname); if (h != NULL) { h->Draw("colz"); @@ -81,12 +74,11 @@ void pl_all_Sel2D(Int_t iOpt = 0, Double_t dFMean = hp->GetMean(); Double_t dFLim = 2.5 * hp->GetRMS(); if (hp->Integral() > 10) { - TFitResultPtr fRes = hp->Fit( - "gaus", "S", "HEsame", dFMean - dFLim, dFMean + dFLim); - FitHName[NFit] = hp->GetName(); - FitIntegral[NFit] = hp->Integral(); - FitMean[NFit] = fRes->Parameter(1); - FitWidth[NFit] = fRes->Parameter(2); + TFitResultPtr fRes = hp->Fit("gaus", "S", "HEsame", dFMean - dFLim, dFMean + dFLim); + FitHName[NFit] = hp->GetName(); + FitIntegral[NFit] = hp->Integral(); + FitMean[NFit] = fRes->Parameter(1); + FitWidth[NFit] = fRes->Parameter(2); NFit++; ; } @@ -102,10 +94,10 @@ void pl_all_Sel2D(Int_t iOpt = 0, hp = h->ProjectionY(); hp->Draw(); break; - } + } } - - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } if (iRp == 10) break; @@ -114,9 +106,8 @@ void pl_all_Sel2D(Int_t iOpt = 0, } if (iOpt2 > 0) { for (Int_t iFit = 0; iFit < NFit; iFit++) { - cout << "FitRes " << FitHName[iFit] << ", Stat: " << FitIntegral[iFit] - << ", Mean " << FitMean[iFit] << ", Width " << FitWidth[iFit] - << endl; + cout << "FitRes " << FitHName[iFit] << ", Stat: " << FitIntegral[iFit] << ", Mean " << FitMean[iFit] << ", Width " + << FitWidth[iFit] << endl; } } diff --git a/macro/beamtime/mcbm2021/pl_all_Track2D.C b/macro/beamtime/mcbm2021/pl_all_Track2D.C index 564ceb7bf8419c1461dc6e2a2f6a90962410fadc..b99fd15073917528812ff034feb7b04ed07491fc 100644 --- a/macro/beamtime/mcbm2021/pl_all_Track2D.C +++ b/macro/beamtime/mcbm2021/pl_all_Track2D.C @@ -1,4 +1,5 @@ -void pl_all_Track2D(Int_t iOpt = 1, Int_t iNSt = 4) { +void pl_all_Track2D(Int_t iOpt = 1, Int_t iNSt = 4) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -58,17 +59,10 @@ void pl_all_Track2D(Int_t iOpt = 1, Int_t iNSt = 4) { case 4: for (Int_t iSide = 0; iSide < 2; iSide++) for (Int_t iCh = 0; iCh < 32; iCh++) { - hname = Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s", - iType[iSt], - iSm, - iRp, - iCh, - iSide, - cOpt.Data()); + hname = Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s", iType[iSt], iSm, iRp, iCh, iSide, cOpt.Data()); h = (TH2*) gROOT->FindObjectAny(hname); if (h != NULL) { - TProfile* hProf = - h->ProfileX(Form("%s_pfx%d%d", hname.Data(), iCh, iSide)); + TProfile* hProf = h->ProfileX(Form("%s_pfx%d%d", hname.Data(), iCh, iSide)); hProf->SetLineColor(iCol); hProf->SetLineStyle(1); hProf->SetMarkerColor(iCol); @@ -80,18 +74,15 @@ void pl_all_Track2D(Int_t iOpt = 1, Int_t iNSt = 4) { hProf->SetMinimum(-0.4); hProf->GetXaxis()->SetRangeUser(0., 10.); hProf->Draw("LP"); - } else { + } + else { hProf->Draw("LPsame"); } } } break; default: - hname = Form("cal_SmT%01d_sm%03d_rpc%03d_%s", - iType[iSt], - iSm, - iRp, - cOpt.Data()); + hname = Form("cal_SmT%01d_sm%03d_rpc%03d_%s", iType[iSt], iSm, iRp, cOpt.Data()); h = (TH2*) gROOT->FindObjectAny(hname); if (h != NULL) { if (iOpt == 2 || iOpt == 2) { gPad->SetLogz(); } @@ -100,9 +91,8 @@ void pl_all_Track2D(Int_t iOpt = 1, Int_t iNSt = 4) { iDet++; dAvMean += h->ProfileX()->GetMean(2); dAvRMS += h->ProfileX()->GetRMS(2); - cout << "TrackQA " << cOpt.Data() << " for TSR " << iType[iSt] - << iSm << iRp << ": Off " << h->ProfileX()->GetMean(2) - << ", RMS " << h->ProfileX()->GetRMS(2) << endl; + cout << "TrackQA " << cOpt.Data() << " for TSR " << iType[iSt] << iSm << iRp << ": Off " + << h->ProfileX()->GetMean(2) << ", RMS " << h->ProfileX()->GetRMS(2) << endl; } } } @@ -110,13 +100,10 @@ void pl_all_Track2D(Int_t iOpt = 1, Int_t iNSt = 4) { } dAvMean /= (Double_t) iDet; dAvRMS /= (Double_t) iDet; - cout << "TrackQA " << cOpt.Data() << ": AvOff " << dAvMean << ", AvRMS " - << dAvRMS << endl; + cout << "TrackQA " << cOpt.Data() << ": AvOff " << dAvMean << ", AvRMS " << dAvRMS << endl; dAvMean = TMath::Abs(dAvMean); - gROOT->ProcessLine( - Form(".! echo %d > %sAvOff.res", (Int_t)(dAvMean * 1.E4), cOpt.Data())); - gROOT->ProcessLine( - Form(".! echo %d > %sAvRMS.res", (Int_t)(dAvRMS * 1.E4), cOpt.Data())); + gROOT->ProcessLine(Form(".! echo %d > %sAvOff.res", (Int_t)(dAvMean * 1.E4), cOpt.Data())); + gROOT->ProcessLine(Form(".! echo %d > %sAvRMS.res", (Int_t)(dAvRMS * 1.E4), cOpt.Data())); can->SaveAs(Form("pl_all_Track_%s.pdf", cOpt.Data())); } diff --git a/macro/beamtime/mcbm2021/pl_cmp_CluRate.C b/macro/beamtime/mcbm2021/pl_cmp_CluRate.C index 6f2da6ac17eb0095d1732a68062afea898576b13..64f465aa4e82bbac67e01d1a85ed53fd442f101b 100644 --- a/macro/beamtime/mcbm2021/pl_cmp_CluRate.C +++ b/macro/beamtime/mcbm2021/pl_cmp_CluRate.C @@ -1,9 +1,6 @@ -void pl_cmp_CluRate(Int_t iNSt = 3, - Long_t iSet = 900032500, - Int_t iOpt = 0, - Double_t Tstart = 0., - Double_t Tend = 10., - Int_t iMode = 1) { +void pl_cmp_CluRate(Int_t iNSt = 3, Long_t iSet = 900032500, Int_t iOpt = 0, Double_t Tstart = 0., Double_t Tend = 10., + Int_t iMode = 1) +{ // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); @@ -59,12 +56,8 @@ void pl_cmp_CluRate(Int_t iNSt = 3, TString hname = ""; switch (iOpt) { - case 0: - hname = Form("cl_SmT%01d_sm%03d_rpc%03d_rate", iType[iSt], iSm, iRp); - break; - case 1: - hname = Form("cl_SmT%01d_sm%03d_rpc%03d_rate10s", iType[iSt], iSm, iRp); - break; + case 0: hname = Form("cl_SmT%01d_sm%03d_rpc%03d_rate", iType[iSt], iSm, iRp); break; + case 1: hname = Form("cl_SmT%01d_sm%03d_rpc%03d_rate10s", iType[iSt], iSm, iRp); break; } h[iSt] = (TH1*) gROOT->FindObjectAny(hname); if (h[iSt] != NULL) { @@ -87,13 +80,13 @@ void pl_cmp_CluRate(Int_t iNSt = 3, h[iSt]->SetLineColor(iCol); h[iSt]->SetLineStyle(1); h[iSt]->SetMarkerColor(iCol); - if (iSt == 0) - h[iSt]->Draw("LPE"); + if (iSt == 0) h[iSt]->Draw("LPE"); else h[iSt]->Draw("LPEsame"); break; } - } else { + } + else { cout << "Histogram " << hname << " not existing. " << endl; } } @@ -111,8 +104,7 @@ void pl_cmp_CluRate(Int_t iNSt = 3, hrat1[iSt]->SetYTitle(Form("Ratio to %03d", iId_full[0])); hrat1[iSt]->SetMaximum(RatMax); hrat1[iSt]->SetMinimum(RatMin); - if (iSt == 1) - hrat1[iSt]->Draw("LPE"); + if (iSt == 1) hrat1[iSt]->Draw("LPE"); else hrat1[iSt]->Draw("LPEsame"); } @@ -130,8 +122,7 @@ void pl_cmp_CluRate(Int_t iNSt = 3, hrat2[iSt]->SetMaximum(RatMax); hrat2[iSt]->SetMinimum(RatMin); gPad->SetLogy(); - if (iSt == 2) - hrat2[iSt]->Draw("LPE"); + if (iSt == 2) hrat2[iSt]->Draw("LPE"); else hrat2[iSt]->Draw("LPEsame"); } diff --git a/macro/beamtime/mcbm2021/rootlogon.C b/macro/beamtime/mcbm2021/rootlogon.C index 6bb7af029bad823d1892d3d7da020bd1813b54c8..9654d064e8fee382e5fa0f36e786f62a37b1598d 100644 --- a/macro/beamtime/mcbm2021/rootlogon.C +++ b/macro/beamtime/mcbm2021/rootlogon.C @@ -3,8 +3,7 @@ //void rootlogon_nh() //{ pTime = new TDatime(); - cout << " Executing rootlogon.C (nh) at " << pTime->GetDate() << ", " - << pTime->GetTime() << endl; + cout << " Executing rootlogon.C (nh) at " << pTime->GetDate() << ", " << pTime->GetTime() << endl; gStyle->SetOptStat(111); gStyle->SetLineWidth(2.); gStyle->SetFrameLineWidth(2.); @@ -37,49 +36,29 @@ gStyle->SetLineScalePS(1.0); - gSystem->AddIncludePath( - Form("-I%s/include", gSystem->Getenv("FAIRROOTPATH"))); + gSystem->AddIncludePath(Form("-I%s/include", gSystem->Getenv("FAIRROOTPATH"))); gSystem->AddIncludePath(Form("-I%s/roclight", gSystem->Getenv("VMCWORKDIR"))); gSystem->AddIncludePath(Form("-I%s/data", gSystem->Getenv("VMCWORKDIR"))); gSystem->AddIncludePath(Form("-I%s/data/tof", gSystem->Getenv("VMCWORKDIR"))); gSystem->AddIncludePath(Form("-I%s/base ", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/hadaq", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/tdc", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/tdc/v1290", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/tdc/vftx", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/tdc/trb", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/tdc/get4", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/scalers", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/scalers/triglog", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/scalers/scalormu", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/scalers/scal2014", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/scalers/orgen", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/unpMoni", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/calib", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/calib/tdc", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/calib/scaler", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/mapping", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/output", gSystem->Getenv("VMCWORKDIR"))); - gSystem->AddIncludePath( - Form("-I%s/beamtime/tof/display", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/hadaq", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/tdc", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/tdc/v1290", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/tdc/vftx", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/tdc/trb", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/tdc/get4", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/scalers", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/scalers/triglog", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/scalers/scalormu", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/scalers/scal2014", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/scalers/orgen", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/unpMoni", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/calib", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/calib/tdc", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/calib/scaler", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/mapping", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/output", gSystem->Getenv("VMCWORKDIR"))); + gSystem->AddIncludePath(Form("-I%s/beamtime/tof/display", gSystem->Getenv("VMCWORKDIR"))); } diff --git a/macro/beamtime/mcbm2021/unpack_tsa_mcbm.C b/macro/beamtime/mcbm2021/unpack_tsa_mcbm.C index 606074a90bb0d9ed8090d1d4ed53ac32e3cb0167..33436a047f8d024b47dcbde59588db3ec8311560 100644 --- a/macro/beamtime/mcbm2021/unpack_tsa_mcbm.C +++ b/macro/beamtime/mcbm2021/unpack_tsa_mcbm.C @@ -10,11 +10,9 @@ // In order to call later Finish, we make this global FairRunOnline* run = NULL; -void unpack_tsa_mcbm(TString inFile = "", - UInt_t uRunId = 0, - UInt_t nrEvents = 0, - TString outDir = "data", - TString inDir = "") { +void unpack_tsa_mcbm(TString inFile = "", UInt_t uRunId = 0, UInt_t nrEvents = 0, TString outDir = "data", + TString inDir = "") +{ TString srcDir = gSystem->Getenv("VMCWORKDIR"); // --- Specify number of events to be produced. @@ -53,28 +51,23 @@ void unpack_tsa_mcbm(TString inFile = "", // ---- Trd ---- TString geoTagTrd = ""; - bool isActiveTrd = - (geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false; + bool isActiveTrd = (geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false; if (!isActiveTrd) { - LOG(warning) << Form( - "TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters " - "can not be loaded correctly!", - geoSetupTag.data()); - } else { - TString paramFilesTrd( - Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data())); + LOG(warning) << Form("TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters " + "can not be loaded correctly!", + geoSetupTag.data()); + } + else { + TString paramFilesTrd(Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data())); std::vector<std::string> paramFilesVecTrd; CbmTrdParManager::GetParFileExtensions(¶mFilesVecTrd); for (auto parIt : paramFilesVecTrd) { - parFileList->Add( - new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data()))); + parFileList->Add(new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data()))); } // Add timeshift calibration, currently only available for run 831 others to come if (uRunId == 831) - parFileList->Add(new TObjString(Form( - "%s/parameters/trd/mcbm2020_special/CbmMcbm2020TrdTshiftPar_run%d.par", - srcDir.Data(), - uRunId))); + parFileList->Add(new TObjString( + Form("%s/parameters/trd/mcbm2020_special/CbmMcbm2020TrdTshiftPar_run%d.par", srcDir.Data(), uRunId))); } TString paramFileTof = paramDir + "mTofPar.par"; @@ -107,15 +100,12 @@ void unpack_tsa_mcbm(TString inFile = "", std::cout << std::endl; std::cout << ">>> unpack_tsa: Initialising..." << std::endl; - CbmMcbm2018UnpackerTaskSts* unpacker_sts = new CbmMcbm2018UnpackerTaskSts(); - CbmMcbm2018UnpackerTaskMuch* unpacker_much = - new CbmMcbm2018UnpackerTaskMuch(); - CbmMcbm2018UnpackerTaskTrdR* unpacker_trdR = - new CbmMcbm2018UnpackerTaskTrdR(); - CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); - CbmMcbm2018UnpackerTaskRich* unpacker_rich = - new CbmMcbm2018UnpackerTaskRich(); - CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); + CbmMcbm2018UnpackerTaskSts* unpacker_sts = new CbmMcbm2018UnpackerTaskSts(); + CbmMcbm2018UnpackerTaskMuch* unpacker_much = new CbmMcbm2018UnpackerTaskMuch(); + CbmMcbm2018UnpackerTaskTrdR* unpacker_trdR = new CbmMcbm2018UnpackerTaskTrdR(); + CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); + CbmMcbm2018UnpackerTaskRich* unpacker_rich = new CbmMcbm2018UnpackerTaskRich(); + CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); /* * Do not generate plots by default @@ -581,14 +571,13 @@ void unpack_tsa_mcbm(TString inFile = "", source->SetFileName(inFile); - source->AddUnpacker(unpacker_sts, 0x10, ECbmModuleId::kSts); // STS xyter - source->AddUnpacker(unpacker_much, 0x50, ECbmModuleId::kMuch); // MUCH xyter - if (isActiveTrd) - source->AddUnpacker(unpacker_trdR, 0x40, ECbmModuleId::kTrd); // Trd - source->AddUnpacker(unpacker_tof, 0x60, ECbmModuleId::kTof); // gDPB TOF - source->AddUnpacker(unpacker_tof, 0x90, ECbmModuleId::kTof); // gDPB T0 - source->AddUnpacker(unpacker_rich, 0x30, ECbmModuleId::kRich); // RICH trb - source->AddUnpacker(unpacker_psd, 0x80, ECbmModuleId::kPsd); // PSD + source->AddUnpacker(unpacker_sts, 0x10, ECbmModuleId::kSts); // STS xyter + source->AddUnpacker(unpacker_much, 0x50, ECbmModuleId::kMuch); // MUCH xyter + if (isActiveTrd) source->AddUnpacker(unpacker_trdR, 0x40, ECbmModuleId::kTrd); // Trd + source->AddUnpacker(unpacker_tof, 0x60, ECbmModuleId::kTof); // gDPB TOF + source->AddUnpacker(unpacker_tof, 0x90, ECbmModuleId::kTof); // gDPB T0 + source->AddUnpacker(unpacker_rich, 0x30, ECbmModuleId::kRich); // RICH trb + source->AddUnpacker(unpacker_psd, 0x80, ECbmModuleId::kPsd); // PSD // --- Event header FairEventHeader* event = new FairEventHeader(); @@ -624,15 +613,15 @@ void unpack_tsa_mcbm(TString inFile = "", std::cout << ">>> unpack_tsa_mcbm: Starting run..." << std::endl; if (0 == nrEvents) { run->Run(nEvents, 0); // run until end of input file - } else { + } + else { run->Run(0, nrEvents); // process N Events } run->Finish(); timer.Stop(); - std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices" - << std::endl; + std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices" << std::endl; // --- End-of-run info Double_t rtime = timer.RealTime(); @@ -640,8 +629,7 @@ void unpack_tsa_mcbm(TString inFile = "", std::cout << std::endl << std::endl; std::cout << ">>> unpack_tsa_mcbm: Macro finished successfully." << std::endl; std::cout << ">>> unpack_tsa_mcbm: Output file is " << outFile << std::endl; - std::cout << ">>> unpack_tsa_mcbm: Real time " << rtime << " s, CPU time " - << ctime << " s" << std::endl; + std::cout << ">>> unpack_tsa_mcbm: Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; std::cout << std::endl; /// --- Screen output for automatic tests diff --git a/macro/beamtime/mcbm2021/unpack_tsa_mcbm_kronos.C b/macro/beamtime/mcbm2021/unpack_tsa_mcbm_kronos.C index e89b558f14c241adc356c6c8c1497add23341edd..852ce72a215a9a7e8c67c47e1d61fdb26afc1f5a 100644 --- a/macro/beamtime/mcbm2021/unpack_tsa_mcbm_kronos.C +++ b/macro/beamtime/mcbm2021/unpack_tsa_mcbm_kronos.C @@ -10,9 +10,8 @@ // In order to call later Finish, we make this global FairRunOnline* run = NULL; -void unpack_tsa_mcbm_kronos(UInt_t uRunIdx = 99999, - UInt_t nrEvents = 0, - TString outDir = "data") { +void unpack_tsa_mcbm_kronos(UInt_t uRunIdx = 99999, UInt_t nrEvents = 0, TString outDir = "data") +{ UInt_t uRunId = 0; if (99999 != uRunIdx) { std::vector<UInt_t> vuListRunId = { @@ -80,33 +79,27 @@ void unpack_tsa_mcbm_kronos(UInt_t uRunIdx = 99999, // ---- Trd ---- TString geoTagTrd = ""; - bool isActiveTrd = - (geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false; + bool isActiveTrd = (geoSetup->GetGeoTag(ECbmModuleId::kTrd, geoTagTrd)) ? true : false; if (!isActiveTrd) { - LOG(warning) << Form( - "TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters " - "can not be loaded correctly!", - geoSetupTag.data()); - } else { - TString paramFilesTrd( - Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data())); + LOG(warning) << Form("TRD - parameter loading - Trd not found in CbmSetup(%s) -> parameters " + "can not be loaded correctly!", + geoSetupTag.data()); + } + else { + TString paramFilesTrd(Form("%s/parameters/trd/trd_%s", srcDir.Data(), geoTagTrd.Data())); std::vector<std::string> paramFilesVecTrd; CbmTrdParManager::GetParFileExtensions(¶mFilesVecTrd); for (auto parIt : paramFilesVecTrd) { - parFileList->Add( - new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data()))); + parFileList->Add(new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data()))); } // Add timeshift calibration, currently only available for run 831 others to come if (uRunId == 831) - parFileList->Add(new TObjString(Form( - "%s/parameters/trd/mcbm2020_special/CbmMcbm2020TrdTshiftPar_run%d.par", - srcDir.Data(), - uRunId))); + parFileList->Add(new TObjString( + Form("%s/parameters/trd/mcbm2020_special/CbmMcbm2020TrdTshiftPar_run%d.par", srcDir.Data(), uRunId))); } TString paramFileTof = paramDir + "mTofPar.par"; - if (uRunId >= 708 && uRunId < 754) - paramFileTof = paramDir + "mTofPar_2Stack.par"; + if (uRunId >= 708 && uRunId < 754) paramFileTof = paramDir + "mTofPar_2Stack.par"; else if (uRunId >= 754) paramFileTof = paramDir + "mTofPar_3Stack.par"; @@ -133,15 +126,12 @@ void unpack_tsa_mcbm_kronos(UInt_t uRunIdx = 99999, std::cout << std::endl; std::cout << ">>> unpack_tsa: Initialising..." << std::endl; - CbmMcbm2018UnpackerTaskSts* unpacker_sts = new CbmMcbm2018UnpackerTaskSts(); - CbmMcbm2018UnpackerTaskMuch* unpacker_much = - new CbmMcbm2018UnpackerTaskMuch(); - CbmMcbm2018UnpackerTaskTrdR* unpacker_trdR = - new CbmMcbm2018UnpackerTaskTrdR(); - CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); - CbmMcbm2018UnpackerTaskRich* unpacker_rich = - new CbmMcbm2018UnpackerTaskRich(); - CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); + CbmMcbm2018UnpackerTaskSts* unpacker_sts = new CbmMcbm2018UnpackerTaskSts(); + CbmMcbm2018UnpackerTaskMuch* unpacker_much = new CbmMcbm2018UnpackerTaskMuch(); + CbmMcbm2018UnpackerTaskTrdR* unpacker_trdR = new CbmMcbm2018UnpackerTaskTrdR(); + CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); + CbmMcbm2018UnpackerTaskRich* unpacker_rich = new CbmMcbm2018UnpackerTaskRich(); + CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); /* * Do not generate plots by default @@ -605,20 +595,17 @@ void unpack_tsa_mcbm_kronos(UInt_t uRunIdx = 99999, CbmMcbm2018Source* source = new CbmMcbm2018Source(); source->SetWriteOutputFlag(kTRUE); // For writing TS metadata - TString inFile = - Form("/lustre/cbm/users/ploizeau/mcbm2021/data/%3u_node8_*.tsa;", uRunId); - inFile += - Form("/lustre/cbm/users/ploizeau/mcbm2021/data/%3u_node9_*.tsa;", uRunId); + TString inFile = Form("/lustre/cbm/users/ploizeau/mcbm2021/data/%3u_node8_*.tsa;", uRunId); + inFile += Form("/lustre/cbm/users/ploizeau/mcbm2021/data/%3u_node9_*.tsa;", uRunId); source->SetFileName(inFile); - source->AddUnpacker(unpacker_sts, 0x10, ECbmModuleId::kSts); // STS xyter - source->AddUnpacker(unpacker_much, 0x50, ECbmModuleId::kMuch); // MUCH xyter - if (isActiveTrd) - source->AddUnpacker(unpacker_trdR, 0x40, ECbmModuleId::kTrd); // Trd - source->AddUnpacker(unpacker_tof, 0x60, ECbmModuleId::kTof); // gDPB TOF - source->AddUnpacker(unpacker_tof, 0x90, ECbmModuleId::kTof); // gDPB T0 - source->AddUnpacker(unpacker_rich, 0x30, ECbmModuleId::kRich); // RICH trb - source->AddUnpacker(unpacker_psd, 0x80, ECbmModuleId::kPsd); // PSD + source->AddUnpacker(unpacker_sts, 0x10, ECbmModuleId::kSts); // STS xyter + source->AddUnpacker(unpacker_much, 0x50, ECbmModuleId::kMuch); // MUCH xyter + if (isActiveTrd) source->AddUnpacker(unpacker_trdR, 0x40, ECbmModuleId::kTrd); // Trd + source->AddUnpacker(unpacker_tof, 0x60, ECbmModuleId::kTof); // gDPB TOF + source->AddUnpacker(unpacker_tof, 0x90, ECbmModuleId::kTof); // gDPB T0 + source->AddUnpacker(unpacker_rich, 0x30, ECbmModuleId::kRich); // RICH trb + source->AddUnpacker(unpacker_psd, 0x80, ECbmModuleId::kPsd); // PSD // --- Event header FairEventHeader* event = new FairEventHeader(); @@ -654,15 +641,15 @@ void unpack_tsa_mcbm_kronos(UInt_t uRunIdx = 99999, std::cout << ">>> unpack_tsa_mcbm: Starting run..." << std::endl; if (0 == nrEvents) { run->Run(nEvents, 0); // run until end of input file - } else { + } + else { run->Run(0, nrEvents); // process N Events } run->Finish(); timer.Stop(); - std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices" - << std::endl; + std::cout << "Processed " << std::dec << source->GetTsCount() << " timeslices" << std::endl; // --- End-of-run info Double_t rtime = timer.RealTime(); @@ -670,8 +657,7 @@ void unpack_tsa_mcbm_kronos(UInt_t uRunIdx = 99999, std::cout << std::endl << std::endl; std::cout << ">>> unpack_tsa_mcbm: Macro finished successfully." << std::endl; std::cout << ">>> unpack_tsa_mcbm: Output file is " << outFile << std::endl; - std::cout << ">>> unpack_tsa_mcbm: Real time " << rtime << " s, CPU time " - << ctime << " s" << std::endl; + std::cout << ">>> unpack_tsa_mcbm: Real time " << rtime << " s, CPU time " << ctime << " s" << std::endl; std::cout << std::endl; /// --- Screen output for automatic tests diff --git a/macro/beamtime/pulser2020/unpack_pulser_mcbm.C b/macro/beamtime/pulser2020/unpack_pulser_mcbm.C index 2ea071253570131ec3296522506a777a43fcf444..c9380104210c3911d941c55065394337dfd9f0ed 100644 --- a/macro/beamtime/pulser2020/unpack_pulser_mcbm.C +++ b/macro/beamtime/pulser2020/unpack_pulser_mcbm.C @@ -77,6 +77,7 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); CbmMcbm2018UnpackerTaskRich* unpacker_rich = new CbmMcbm2018UnpackerTaskRich(); + CbmMcbm2018UnpackerTaskHodo* unpacker_hodo = new CbmMcbm2018UnpackerTaskHodo(); CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); unpacker_sts->SetMonitorMode(); diff --git a/macro/mcbm/mcbm_digi_nh.C b/macro/mcbm/mcbm_digi_nh.C index bebb600a8f06abed088cf74e447fb67ce5e2df17..e8d434bed83bd7ed96b5f3f83487c7ef6139ed3e 100644 --- a/macro/mcbm/mcbm_digi_nh.C +++ b/macro/mcbm/mcbm_digi_nh.C @@ -77,7 +77,7 @@ void mcbm_digi_nh(Int_t nEvents = 100, // Number of events to process run.SetTimeSliceLength(timeSliceLength); run.SetEventMode(eventMode); run.SetProduceNoise(kFALSE); - run.SetCreateMatches(kFALSE); + run.SetCreateMatches(kTRUE); //run.Deactivate(ECbmModuleId::kSts); run.Deactivate(ECbmModuleId::kRich); diff --git a/macro/mcbm/mcbm_reco_event_tb_nh.C b/macro/mcbm/mcbm_reco_event_tb_nh.C index 7d181efb9f8479670082da89526022731d6e0f40..152e5caad0a304fe8653f118715da77c70b54893 100644 --- a/macro/mcbm/mcbm_reco_event_tb_nh.C +++ b/macro/mcbm/mcbm_reco_event_tb_nh.C @@ -27,7 +27,7 @@ void mcbm_reco_event_tb_nh( // Adjust this part according to your requirements // --- Logger settings ---------------------------------------------------- - TString logLevel = "INFO"; + TString logLevel = "DEBUG"; //TString logVerbosity = "VERYHIGH"; //TString logVerbosity = "HIGH"; //TString logVerbosity = "MEDIUM"; diff --git a/macro/mcbm/run_mcbm_nh.sh b/macro/mcbm/run_mcbm_nh.sh index cd2af4ce4add13e2fad9c258bb02c771fd781cb4..8fd7c40474834753d31b39cf763288771fa1699a 100755 --- a/macro/mcbm/run_mcbm_nh.sh +++ b/macro/mcbm/run_mcbm_nh.sh @@ -35,7 +35,7 @@ fi cMode=$5 if [[ ${cMode} = "" ]]; then -cMode="0E0" +cMode="2T0" fi iStep=${cMode:0:1} @@ -48,8 +48,8 @@ EvtRate=1.e6 # 1/s TSLength=1.e4 # ns Tint=100. # ns ReqTofMul=2 -#NEvt=10 # for debugging -NEvt=100000 # for production +NEvt=10 # for debugging +#NEvt=100000 # for production if [ "$iBase" = "T" ]; then Timebased=kTRUE @@ -112,7 +112,7 @@ else fi ## analysis # for input from FLorian, use $extdir as 3. argument -root -q -b 'mcbm_hadron_analysis.C('$NEvt',"'$RunId'","'$outdir'","'$outdir'","'${mcbmGeo}'",'$Timebased','$EvtRate','$TSLength','$Tint','$ReqTofMul','$iCut')' +root -q -b 'mcbm_hadron_analysis_nh.C('$NEvt',"'$RunId'","'$outdir'","'$outdir'","'${mcbmGeo}'",'$Timebased','$EvtRate','$TSLength','$Tint','$ReqTofMul','$iCut')' mv -v slurm-${SLURM_ARRAY_JOB_ID}_${SLURM_ARRAY_TASK_ID}.out ${outdir}/run_${RunId}.out