1414// / \author Luca Barioglio, TU München, luca.barioglio@cern.ch
1515// / \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch
1616
17+ #include " PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h"
18+ #include " PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h"
19+ #include " PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h"
20+ #include " PWGCF/FemtoUniverse/Core/femtoUtils.h"
21+ #include " PWGCF/FemtoUniverse/DataModel/FemtoDerived.h"
22+
1723#include " DataFormatsParameters/GRPObject.h"
1824#include " Framework/ASoAHelpers.h"
1925#include " Framework/AnalysisTask.h"
2228#include " Framework/StepTHn.h"
2329#include " Framework/runDataProcessing.h"
2430
25- #include " PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h"
26- #include " PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h"
27- #include " PWGCF/FemtoUniverse/Core/femtoUtils.h"
28- #include " PWGCF/FemtoUniverse/DataModel/FemtoDerived.h"
29- #include " PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h"
31+ #include < string>
32+ #include < vector>
3033
3134using namespace o2 ;
3235using namespace o2 ::analysis::femto_universe;
@@ -36,49 +39,49 @@ using namespace o2::soa;
3639
3740namespace
3841{
39- static constexpr int nCuts = 5 ;
42+ static constexpr int NCuts = 5 ;
4043static const std::vector<std::string> cutNames{" MaxPt" , " PIDthr" , " nSigmaTPC" , " nSigmaTPCTOF" , " MaxP" };
41- static const float cutsTable[1 ][nCuts ] = {{4 .05f , 0 .75f , 3 .f , 3 .f , 100 .f }};
44+ static const float cutsTable[1 ][NCuts ] = {{4 .05f , 0 .75f , 3 .f , 3 .f , 100 .f }};
4245
4346} // namespace
4447
45- struct femtoUniverseDebugTrack {
48+ struct FemtoUniverseDebugTrack {
4649 SliceCache cache;
4750
48- Configurable<LabeledArray<float >> ConfCutTable{ " ConfCutTable " , {cutsTable[0 ], nCuts , cutNames}, " Particle selections" };
49- Configurable<int > ConfNspecies{ " ConfNspecies " , 2 , " Number of particle spieces with PID info" };
51+ Configurable<LabeledArray<float >> confCutTable{ " confCutTable " , {cutsTable[0 ], NCuts , cutNames}, " Particle selections" };
52+ Configurable<int > confNspecies{ " confNspecies " , 2 , " Number of particle spieces with PID info" };
5053
5154 struct : o2::framework::ConfigurableGroup {
52- Configurable<int > ConfPDGCodePartOne{ " ConfPDGCodePartOne " , 2212 , " Particle 1 - PDG code" };
53- Configurable<bool > ConfIsTrackIdentified{ " ConfIsTrackIdentified " , true , " Enable PID for the track" };
54- Configurable<bool > ConfIsMC{ " ConfIsMC " , false , " Enable additional Histogramms in the case of a MonteCarlo Run" };
55- Configurable<int > ConfTrackChoicePartOne{ " ConfTrackChoicePartOne " , 1 , " Type of particle (track1): {0:Proton, 1:Pion, 2:Kaon}" };
56- Configurable<int > ConfTrackSign{ " ConfTrackSign " , 1 , " Track sign" };
55+ Configurable<int > confPDGCodePartOne{ " confPDGCodePartOne " , 2212 , " Particle 1 - PDG code" };
56+ Configurable<bool > confIsTrackIdentified{ " confIsTrackIdentified " , true , " Enable PID for the track" };
57+ Configurable<bool > confIsMC{ " confIsMC " , false , " Enable additional Histogramms in the case of a MonteCarlo Run" };
58+ Configurable<int > confTrackChoicePartOne{ " confTrackChoicePartOne " , 1 , " Type of particle (track1): {0:Proton, 1:Pion, 2:Kaon}" };
59+ Configurable<int > confTrackSign{ " confTrackSign " , 1 , " Track sign" };
5760 } trackonefilter;
5861
5962 struct : o2::framework::ConfigurableGroup {
60- Configurable<float > ConfNsigmaCombinedKaon{ " ConfNsigmaCombinedKaon " , 3.0 , " TPC and TOF Kaon Sigma (combined) for momentum > 0.4" };
61- Configurable<float > ConfNsigmaTPCKaon{ " ConfNsigmaTPCKaon " , 3.0 , " TPC Kaon Sigma for momentum < 0.4" };
62- Configurable<float > ConfNsigmaCombinedProton{ " ConfNsigmaCombinedProton " , 3.0 , " TPC and TOF Proton Sigma (combined) for momentum > 0.5" };
63- Configurable<float > ConfNsigmaTPCProton{ " ConfNsigmaTPCProton " , 3.0 , " TPC Proton Sigma for momentum < 0.5" };
64- Configurable<float > ConfNsigmaCombinedPion{ " ConfNsigmaCombinedPion " , 3.0 , " TPC and TOF Pion Sigma (combined) for momentum > 0.5" };
65- Configurable<float > ConfNsigmaTPCPion{ " ConfNsigmaTPCPion " , 3.0 , " TPC Pion Sigma for momentum < 0.5" };
63+ Configurable<float > confNsigmaCombinedKaon{ " confNsigmaCombinedKaon " , 3.0 , " TPC and TOF Kaon Sigma (combined) for momentum > 0.4" };
64+ Configurable<float > confNsigmaTPCKaon{ " confNsigmaTPCKaon " , 3.0 , " TPC Kaon Sigma for momentum < 0.4" };
65+ Configurable<float > confNsigmaCombinedProton{ " confNsigmaCombinedProton " , 3.0 , " TPC and TOF Proton Sigma (combined) for momentum > 0.5" };
66+ Configurable<float > confNsigmaTPCProton{ " confNsigmaTPCProton " , 3.0 , " TPC Proton Sigma for momentum < 0.5" };
67+ Configurable<float > confNsigmaCombinedPion{ " confNsigmaCombinedPion " , 3.0 , " TPC and TOF Pion Sigma (combined) for momentum > 0.5" };
68+ Configurable<float > confNsigmaTPCPion{ " confNsigmaTPCPion " , 3.0 , " TPC Pion Sigma for momentum < 0.5" };
6669 } generalPIDcuts;
6770
68- // Configurable<uint32_t> ConfCutPartOne{"ConfCutPartOne ", 5542474, "Particle 1 - Selection bit from cutCulator"};
69- Configurable<int > ConfPIDPartOne{ " ConfPIDPartOne " , 1 , " Particle 1 - Read from cutCulator" };
70- Configurable<std::vector<float >> ConfTrkPIDnSigmaMax{ " ConfTrkPIDnSigmaMax " , std::vector<float >{3 .5f , 3 .f , 2 .5f }, " This configurable needs to be the same as the one used in the producer task" };
71- ConfigurableAxis ConfTempFitVarBins{ " ConfDTempFitVarBins " , {300 , -0.15 , 0.15 }, " binning of the TempFitVar in the pT vs. TempFitVar plot" };
72- ConfigurableAxis ConfTempFitVarpTBins{ " ConfTempFitVarpTBins " , {20 , 0.5 , 4.05 }, " pT binning of the pT vs. TempFitVar plot" };
71+ // Configurable<uint32_t> confCutPartOne{"confCutPartOne ", 5542474, "Particle 1 - Selection bit from cutCulator"};
72+ Configurable<int > confPIDPartOne{ " confPIDPartOne " , 1 , " Particle 1 - Read from cutCulator" };
73+ Configurable<std::vector<float >> confTrkPIDnSigmaMax{ " confTrkPIDnSigmaMax " , std::vector<float >{3 .5f , 3 .f , 2 .5f }, " This configurable needs to be the same as the one used in the producer task" };
74+ ConfigurableAxis confTempFitVarBins{ " confDTempFitVarBins " , {300 , -0.15 , 0.15 }, " binning of the TempFitVar in the pT vs. TempFitVar plot" };
75+ ConfigurableAxis confTempFitVarpTBins{ " confTempFitVarpTBins " , {20 , 0.5 , 4.05 }, " pT binning of the pT vs. TempFitVar plot" };
7376
7477 FemtoUniverseTrackSelection trackCuts;
7578
7679 using FemtoFullParticles = soa::Join<aod::FDParticles, aod::FDExtParticles>;
77- Partition<FemtoFullParticles> partsOne = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kTrack )) && (aod::femtouniverseparticle::sign == int8_t (trackonefilter.ConfTrackSign )); // && ((aod::femtouniverseparticle::cut & ConfCutPartOne ) == ConfCutPartOne );
80+ Partition<FemtoFullParticles> partsOne = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kTrack )) && (aod::femtouniverseparticle::sign == int8_t (trackonefilter.confTrackSign )); // && ((aod::femtouniverseparticle::cut & confCutPartOne ) == confCutPartOne );
7881 Preslice<FemtoFullParticles> perColReco = aod::femtouniverseparticle::fdCollisionId;
7982
8083 using FemtoFullParticlesMC = soa::Join<aod::FDParticles, aod::FDExtParticles, aod::FDMCLabels>;
81- Partition<FemtoFullParticlesMC> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kTrack )) && (aod::femtouniverseparticle::sign == int8_t (trackonefilter.ConfTrackSign )); // && ((aod::femtouniverseparticle::cut & ConfCutPartOne ) == ConfCutPartOne );
84+ Partition<FemtoFullParticlesMC> partsOneMC = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kTrack )) && (aod::femtouniverseparticle::sign == int8_t (trackonefilter.confTrackSign )); // && ((aod::femtouniverseparticle::cut & confCutPartOne ) == confCutPartOne );
8285 Preslice<FemtoFullParticlesMC> perColGen = aod::femtouniverseparticle::fdCollisionId;
8386
8487 // / Histogramming for Event
@@ -100,17 +103,17 @@ struct femtoUniverseDebugTrack {
100103 // |nsigma_combined| < 3 for p > 0.5
101104
102105 // using configurables:
103- // ConfNsigmaTPCProton -> TPC Kaon Sigma for momentum < 0.5
104- // ConfNsigmaCombinedProton -> TPC and TOF Kaon Sigma (combined) for momentum > 0.5
106+ // confNsigmaTPCProton -> TPC Kaon Sigma for momentum < 0.5
107+ // confNsigmaCombinedProton -> TPC and TOF Kaon Sigma (combined) for momentum > 0.5
105108
106109 if (mom < 0.5 ) {
107- if (TMath::Abs (nsigmaTPCPr) < generalPIDcuts.ConfNsigmaTPCProton ) {
110+ if (std::abs (nsigmaTPCPr) < generalPIDcuts.confNsigmaTPCProton ) {
108111 return true ;
109112 } else {
110113 return false ;
111114 }
112115 } else if (mom > 0.5 ) {
113- if (TMath::Hypot (nsigmaTOFPr, nsigmaTPCPr) < generalPIDcuts.ConfNsigmaCombinedProton ) {
116+ if (std::hypot (nsigmaTOFPr, nsigmaTPCPr) < generalPIDcuts.confNsigmaCombinedProton ) {
114117 return true ;
115118 } else {
116119 return false ;
@@ -125,37 +128,37 @@ struct femtoUniverseDebugTrack {
125128 // |nsigma_combined| < 3 for p > 0.5
126129
127130 // using configurables:
128- // ConfNsigmaTPCTOFKaon -> are we doing TPC TOF PID for Kaons? (boolean)
129- // ConfNsigmaTPCKaon -> TPC Kaon Sigma for momentum < 0.5
130- // ConfNsigmaCombinedKaon -> TPC and TOF Kaon Sigma (combined) for momentum > 0.5
131+ // confNsigmaTPCTOFKaon -> are we doing TPC TOF PID for Kaons? (boolean)
132+ // confNsigmaTPCKaon -> TPC Kaon Sigma for momentum < 0.5
133+ // confNsigmaCombinedKaon -> TPC and TOF Kaon Sigma (combined) for momentum > 0.5
131134 if (mom < 0.3 ) { // 0.0-0.3
132- if (TMath::Abs (nsigmaTPCK) < 3.0 ) {
135+ if (std::abs (nsigmaTPCK) < 3.0 ) {
133136 return true ;
134137 } else {
135138 return false ;
136139 }
137140 } else if (mom < 0.45 ) { // 0.30 - 0.45
138- if (TMath::Abs (nsigmaTPCK) < 2.0 ) {
141+ if (std::abs (nsigmaTPCK) < 2.0 ) {
139142 return true ;
140143 } else {
141144 return false ;
142145 }
143146 } else if (mom < 0.55 ) { // 0.45-0.55
144- if (TMath::Abs (nsigmaTPCK) < 1.0 ) {
147+ if (std::abs (nsigmaTPCK) < 1.0 ) {
145148 return true ;
146149 } else {
147150 return false ;
148151 }
149152 } else if (mom < 1.5 ) { // 0.55-1.5 (now we use TPC and TOF)
150- if ((TMath::Abs (nsigmaTOFK) < 3.0 ) && (TMath::Abs (nsigmaTPCK) < 3.0 )) {
153+ if ((std::abs (nsigmaTOFK) < 3.0 ) && (std::abs (nsigmaTPCK) < 3.0 )) {
151154 {
152155 return true ;
153156 }
154157 } else {
155158 return false ;
156159 }
157160 } else if (mom > 1.5 ) { // 1.5 -
158- if ((TMath::Abs (nsigmaTOFK) < 2.0 ) && (TMath::Abs (nsigmaTPCK) < 3.0 )) {
161+ if ((std::abs (nsigmaTOFK) < 2.0 ) && (std::abs (nsigmaTPCK) < 3.0 )) {
159162 return true ;
160163 } else {
161164 return false ;
@@ -171,17 +174,17 @@ struct femtoUniverseDebugTrack {
171174 // |nsigma_combined| < 3 for p > 0.5
172175
173176 // using configurables:
174- // ConfNsigmaTPCPion -> TPC Kaon Sigma for momentum < 0.5
175- // ConfNsigmaCombinedPion -> TPC and TOF Pion Sigma (combined) for momentum > 0.5
177+ // confNsigmaTPCPion -> TPC Kaon Sigma for momentum < 0.5
178+ // confNsigmaCombinedPion -> TPC and TOF Pion Sigma (combined) for momentum > 0.5
176179 if (true ) {
177180 if (mom < 0.5 ) {
178- if (TMath::Abs (nsigmaTPCPi) < generalPIDcuts.ConfNsigmaTPCPion ) {
181+ if (std::abs (nsigmaTPCPi) < generalPIDcuts.confNsigmaTPCPion ) {
179182 return true ;
180183 } else {
181184 return false ;
182185 }
183186 } else if (mom > 0.5 ) {
184- if (TMath::Hypot (nsigmaTOFPi, nsigmaTPCPi) < generalPIDcuts.ConfNsigmaCombinedPion ) {
187+ if (std::hypot (nsigmaTOFPi, nsigmaTPCPi) < generalPIDcuts.confNsigmaCombinedPion ) {
185188 return true ;
186189 } else {
187190 return false ;
@@ -193,7 +196,7 @@ struct femtoUniverseDebugTrack {
193196
194197 bool IsParticleNSigma (float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK)
195198 {
196- switch (trackonefilter.ConfPDGCodePartOne ) {
199+ switch (trackonefilter.confPDGCodePartOne ) {
197200 case 2212 : // Proton
198201 case -2212 : // anty Proton
199202 return IsProtonNSigma (mom, nsigmaTPCPr, nsigmaTOFPr);
@@ -216,9 +219,9 @@ struct femtoUniverseDebugTrack {
216219 void init (InitContext&)
217220 {
218221 eventHisto.init (&qaRegistry);
219- trackHisto.init (&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins , trackonefilter.ConfIsMC , trackonefilter.ConfPDGCodePartOne .value , true );
220- vPIDPartOne = ConfPIDPartOne .value ;
221- kNsigma = ConfTrkPIDnSigmaMax .value ;
222+ trackHisto.init (&qaRegistry, confTempFitVarpTBins, confTempFitVarBins , trackonefilter.confIsMC , trackonefilter.confPDGCodePartOne .value , true );
223+ vPIDPartOne = confPIDPartOne .value ;
224+ kNsigma = confTrkPIDnSigmaMax .value ;
222225 }
223226
224227 // / Porduce QA plots for sigle track selection in FemtoUniverse framework
@@ -227,13 +230,13 @@ struct femtoUniverseDebugTrack {
227230 {
228231 eventHisto.fillQA (col);
229232 for (auto & part : groupPartsOne) {
230- // if (part.p() > ConfCutTable ->get("MaxP") || part.pt() > ConfCutTable ->get("MaxPt")) {
233+ // if (part.p() > confCutTable ->get("MaxP") || part.pt() > confCutTable ->get("MaxPt")) {
231234 // continue;
232235 // }
233- // if (!isFullPIDSelected(part.pidCut(), part.p(), ConfCutTable ->get("PIDthr"), vPIDPartOne, ConfNspecies , kNsigma, ConfCutTable ->get("nSigmaTPC"), ConfCutTable ->get("nSigmaTPCTOF"))) {
236+ // if (!isFullPIDSelected(part.pidCut(), part.p(), confCutTable ->get("PIDthr"), vPIDPartOne, confNspecies , kNsigma, confCutTable ->get("nSigmaTPC"), confCutTable ->get("nSigmaTPCTOF"))) {
234237 // continue;
235238 // }
236- if (trackonefilter.ConfIsTrackIdentified ) {
239+ if (trackonefilter.confIsTrackIdentified ) {
237240 if (!IsParticleNSigma (part.p (), trackCuts.getNsigmaTPC (part, o2::track::PID::Proton), trackCuts.getNsigmaTOF (part, o2::track::PID::Proton), trackCuts.getNsigmaTPC (part, o2::track::PID::Pion), trackCuts.getNsigmaTOF (part, o2::track::PID::Pion), trackCuts.getNsigmaTPC (part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF (part, o2::track::PID::Kaon))) {
238241 continue ;
239242 }
@@ -250,7 +253,7 @@ struct femtoUniverseDebugTrack {
250253 auto groupPartsOne = partsOne->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
251254 FillDebugHistos<false >(col, groupPartsOne);
252255 }
253- PROCESS_SWITCH (femtoUniverseDebugTrack , processData, " Enable Debug processing for Monte Carlo" , true );
256+ PROCESS_SWITCH (FemtoUniverseDebugTrack , processData, " Enable Debug processing for Monte Carlo" , true );
254257
255258 // / process function when runnning over Monte Carlo with MC truth enabled
256259
@@ -262,13 +265,13 @@ struct femtoUniverseDebugTrack {
262265 auto groupPartsOne = partsOneMC->sliceByCached (aod::femtouniverseparticle::fdCollisionId, col.globalIndex (), cache);
263266 FillDebugHistos<true >(col, groupPartsOne);
264267 }
265- PROCESS_SWITCH (femtoUniverseDebugTrack , processMC, " Enable Debug processing for Monte Carlo" , false );
268+ PROCESS_SWITCH (FemtoUniverseDebugTrack , processMC, " Enable Debug processing for Monte Carlo" , false );
266269};
267270
268271WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
269272{
270273 WorkflowSpec workflow{
271- adaptAnalysisTask<femtoUniverseDebugTrack >(cfgc),
274+ adaptAnalysisTask<FemtoUniverseDebugTrack >(cfgc),
272275 };
273276 return workflow;
274277}
0 commit comments