@@ -97,8 +97,9 @@ struct OnTheFlyTofPid {
9797
9898 struct : ConfigurableGroup {
9999 Configurable<bool > doQAplots{" doQAplots" , true , " do basic velocity plot qa" };
100+ Configurable<bool > doSeparationVsPt{" doSeparationVsPt" , true , " Produce plots vs pt or p" };
100101 Configurable<int > nBinsBeta{" nBinsBeta" , 2200 , " number of bins in beta" };
101- Configurable<int > nBinsP{" nBinsP" , 80 , " number of bins in momentum" };
102+ Configurable<int > nBinsP{" nBinsP" , 80 , " number of bins in momentum/pT depending on doSeparationVsPt " };
102103 Configurable<int > nBinsTrackLengthInner{" nBinsTrackLengthInner" , 300 , " number of bins in track length" };
103104 Configurable<int > nBinsTrackLengthOuter{" nBinsTrackLengthOuter" , 300 , " number of bins in track length" };
104105 Configurable<int > nBinsTrackDeltaLength{" nBinsTrackDeltaLength" , 100 , " number of bins in delta track length" };
@@ -212,22 +213,23 @@ struct OnTheFlyTofPid {
212213 std::string name_title_outer = " h2dOuterNsigmaTrue" + particle_names2[i_true] + " Vs" + particle_names2[i_hyp] + " Hypothesis" ;
213214 std::string name_title_inner_delta = " h2dInnerDeltaTrue" + particle_names2[i_true] + " Vs" + particle_names2[i_hyp] + " Hypothesis" ;
214215 std::string name_title_outer_delta = " h2dOuterDeltaTrue" + particle_names2[i_true] + " Vs" + particle_names2[i_hyp] + " Hypothesis" ;
216+ const AxisSpec axisX{plotsConfig.doSeparationVsPt .value ? axisPt : axisMomentum};
215217 if (i_true == i_hyp) {
216218 const AxisSpec axisNsigmaCorrect{static_cast <int >(plotsConfig.nBinsNsigmaCorrectSpecies ), plotsConfig.minNsigmaRange , plotsConfig.maxNsigmaRange , " N#sigma - True " + particle_names1[i_true] + " vs " + particle_names1[i_hyp] + " hypothesis" };
217- h2dInnerNsigmaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_inner.c_str (), name_title_inner.c_str (), kTH2F , {axisMomentum , axisNsigmaCorrect});
218- h2dOuterNsigmaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_outer.c_str (), name_title_outer.c_str (), kTH2F , {axisMomentum , axisNsigmaCorrect});
219+ h2dInnerNsigmaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_inner.c_str (), name_title_inner.c_str (), kTH2F , {axisX , axisNsigmaCorrect});
220+ h2dOuterNsigmaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_outer.c_str (), name_title_outer.c_str (), kTH2F , {axisX , axisNsigmaCorrect});
219221
220222 const AxisSpec axisDeltaCorrect{static_cast <int >(plotsConfig.nBinsDeltaCorrectSpecies ), plotsConfig.minDeltaRange , plotsConfig.maxDeltaRange , " #Delta - True " + particle_names1[i_true] + " vs " + particle_names1[i_hyp] + " hypothesis" };
221- h2dInnerDeltaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_inner_delta.c_str (), name_title_inner_delta.c_str (), kTH2F , {axisMomentum , axisDeltaCorrect});
222- h2dOuterDeltaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_outer_delta.c_str (), name_title_outer_delta.c_str (), kTH2F , {axisMomentum , axisDeltaCorrect});
223+ h2dInnerDeltaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_inner_delta.c_str (), name_title_inner_delta.c_str (), kTH2F , {axisX , axisDeltaCorrect});
224+ h2dOuterDeltaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_outer_delta.c_str (), name_title_outer_delta.c_str (), kTH2F , {axisX , axisDeltaCorrect});
223225 } else {
224226 const AxisSpec axisNsigmaWrong{static_cast <int >(plotsConfig.nBinsNsigmaWrongSpecies ), plotsConfig.minNsigmaRange , plotsConfig.maxNsigmaRange , " N#sigma - True " + particle_names1[i_true] + " vs " + particle_names1[i_hyp] + " hypothesis" };
225- h2dInnerNsigmaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_inner.c_str (), name_title_inner.c_str (), kTH2F , {axisMomentum , axisNsigmaWrong});
226- h2dOuterNsigmaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_outer.c_str (), name_title_outer.c_str (), kTH2F , {axisMomentum , axisNsigmaWrong});
227+ h2dInnerNsigmaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_inner.c_str (), name_title_inner.c_str (), kTH2F , {axisX , axisNsigmaWrong});
228+ h2dOuterNsigmaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_outer.c_str (), name_title_outer.c_str (), kTH2F , {axisX , axisNsigmaWrong});
227229
228230 const AxisSpec axisDeltaWrong{static_cast <int >(plotsConfig.nBinsDeltaWrongSpecies ), plotsConfig.minDeltaRange , plotsConfig.maxDeltaRange , " #Delta - True " + particle_names1[i_true] + " vs " + particle_names1[i_hyp] + " hypothesis" };
229- h2dInnerDeltaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_inner_delta.c_str (), name_title_inner_delta.c_str (), kTH2F , {axisMomentum , axisDeltaWrong});
230- h2dOuterDeltaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_outer_delta.c_str (), name_title_outer_delta.c_str (), kTH2F , {axisMomentum , axisDeltaWrong});
231+ h2dInnerDeltaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_inner_delta.c_str (), name_title_inner_delta.c_str (), kTH2F , {axisX , axisDeltaWrong});
232+ h2dOuterDeltaTrue[i_true][i_hyp] = histos.add <TH2>(name_title_outer_delta.c_str (), name_title_outer_delta.c_str (), kTH2F , {axisX , axisDeltaWrong});
231233 }
232234 }
233235 }
@@ -460,27 +462,25 @@ struct OnTheFlyTofPid {
460462
461463 // First we compute the number of charged particles in the event if LUTs are loaded
462464 float dNdEta = 0 .f ;
463- if (simConfig.flagTOFLoadDelphesLUTs ) {
464- for (const auto & track : tracks) {
465- if (!track.has_mcParticle ())
466- continue ;
467- auto mcParticle = track.mcParticle ();
468- if (std::abs (mcParticle.eta ()) > simConfig.multiplicityEtaRange ) {
469- continue ;
470- }
471- if (mcParticle.has_daughters ()) {
472- continue ;
473- }
474- const auto & pdgInfo = pdg->GetParticle (mcParticle.pdgCode ());
475- if (!pdgInfo) {
476- // LOG(warning) << "PDG code " << mcParticle.pdgCode() << " not found in the database";
477- continue ;
478- }
479- if (pdgInfo->Charge () == 0 ) {
480- continue ;
481- }
482- dNdEta += 1 .f ;
465+ for (const auto & track : tracks) {
466+ if (!track.has_mcParticle ())
467+ continue ;
468+ auto mcParticle = track.mcParticle ();
469+ if (std::abs (mcParticle.eta ()) > simConfig.multiplicityEtaRange ) {
470+ continue ;
471+ }
472+ if (mcParticle.has_daughters ()) {
473+ continue ;
474+ }
475+ const auto & pdgInfo = pdg->GetParticle (mcParticle.pdgCode ());
476+ if (!pdgInfo) {
477+ // LOG(warning) << "PDG code " << mcParticle.pdgCode() << " not found in the database";
478+ continue ;
479+ }
480+ if (pdgInfo->Charge () == 0 ) {
481+ continue ;
483482 }
483+ dNdEta += 1 .f ;
484484 }
485485 if (plotsConfig.doQAplots ) {
486486 histos.fill (HIST (" h1dNdeta" ), dNdEta);
0 commit comments