@@ -41,7 +41,9 @@ using namespace o2::constants::physics;
4141using namespace o2 ::framework;
4242using namespace o2 ::framework::expressions;
4343
44- enum PdgCode { kEta = 221 , kOmega = 223 , kEtaPrime = 331 };
44+ enum PdgCode { kEta = 221 ,
45+ kOmega = 223 ,
46+ kEtaPrime = 331 };
4547
4648enum SourceType {
4749 NotElec = 0 , // not electron
@@ -87,8 +89,8 @@ struct HfTaskSingleElectron {
8789 Configurable<int > tpcNCrossedRowMin{" tpcNCrossedRowMin" , 70 ,
8890 " max of TPC n cluster crossed rows" };
8991 Configurable<float > tpcNClsFoundOverFindableMin{
90- " tpcNClsFoundOverFindableMin" , 0.8 ,
91- " min # of TPC found/findable clusters" };
92+ " tpcNClsFoundOverFindableMin" , 0.8 ,
93+ " min # of TPC found/findable clusters" };
9294 Configurable<float > tpcChi2perNClMax{" tpcChi2perNClMax" , 4 .,
9395 " min # of tpc chi2 per clusters" };
9496 Configurable<int > itsIBClsMin{" itsIBClsMin" , 3 ,
@@ -116,12 +118,12 @@ struct HfTaskSingleElectron {
116118 // using declarations
117119 using MyCollisions = soa::Join<aod::Collisions, aod::EvSels>;
118120 using TracksEl =
119- soa::Join<aod::Tracks, aod::TrackSelection, aod::TrackSelectionExtension,
120- aod::TracksExtra, aod::TracksDCA, aod::pidTOFFullEl,
121- aod::pidTPCFullEl>;
121+ soa::Join<aod::Tracks, aod::TrackSelection, aod::TrackSelectionExtension,
122+ aod::TracksExtra, aod::TracksDCA, aod::pidTOFFullEl,
123+ aod::pidTPCFullEl>;
122124 using McTracksEl =
123- soa::Join<aod::Tracks, aod::TrackExtra, aod::TracksDCA, aod::pidTOFFullEl,
124- aod::pidTPCFullEl, aod::McTrackLabels>;
125+ soa::Join<aod::Tracks, aod::TrackExtra, aod::TracksDCA, aod::pidTOFFullEl,
126+ aod::pidTPCFullEl, aod::McTrackLabels>;
125127
126128 // Filter
127129 Filter collZFilter = nabs(aod::collision::posZ) < posZMax;
@@ -130,17 +132,20 @@ struct HfTaskSingleElectron {
130132
131133 // ConfigurableAxis
132134 ConfigurableAxis axisPtEl{
133- " axisPtEl" ,
134- {VARIABLE_WIDTH, 0 .5f , 0 .6f , 0 .7f , 0 .8f , 0 .9f , 1 .f , 1 .1f ,
135- 1 .2f , 1 .3f , 1 .4f , 1 .5f , 1 .75f , 2 .0f , 2 .25f , 2 .5f ,
136- 2 .75f , 3 .f , 3 .5f , 4 .0f , 5 .0f , 6 .0f , 8 .0f , 10 .0f },
137- " electron pt bins" };
135+ " axisPtEl" ,
136+ {VARIABLE_WIDTH, 0 .5f , 0 .6f , 0 .7f , 0 .8f , 0 .9f , 1 .f , 1 .1f ,
137+ 1 .2f , 1 .3f , 1 .4f , 1 .5f , 1 .75f , 2 .0f , 2 .25f , 2 .5f ,
138+ 2 .75f , 3 .f , 3 .5f , 4 .0f , 5 .0f , 6 .0f , 8 .0f , 10 .0f },
139+ " electron pt bins" };
138140
139141 // Histogram registry
140142 HistogramRegistry histos{
141- " histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
143+ " histos" ,
144+ {},
145+ OutputObjHandlingPolicy::AnalysisObject};
142146
143- void init (InitContext const &) {
147+ void init (InitContext const &)
148+ {
144149 // AxisSpec
145150 const AxisSpec axisEvt{4 , 0 ., 4 ., " nEvents" };
146151 const AxisSpec axisNCont{100 , 0 ., 100 ., " nCont" };
@@ -193,7 +198,9 @@ struct HfTaskSingleElectron {
193198 histos.add (" hPdgCo" , " " , kTH1D , {{10001 , -0.5 , 10000.5 }});
194199 }
195200
196- template <typename TrackType> bool trackSel (const TrackType &track) {
201+ template <typename TrackType>
202+ bool trackSel (const TrackType& track)
203+ {
197204 if ((track.pt () > ptTrackMax) || (track.pt () < ptTrackMin)) {
198205 return false ;
199206 }
@@ -233,7 +240,8 @@ struct HfTaskSingleElectron {
233240 }
234241
235242 template <typename TrackType>
236- int getElecSource (const TrackType &track, double &mpt, int &mpdg) {
243+ int getElecSource (const TrackType& track, double & mpt, int & mpdg)
244+ {
237245 auto mcpart = track.mcParticle ();
238246 if (std::abs (mcpart.pdgCode ()) != kElectron ) {
239247 return NotElec;
@@ -247,15 +255,15 @@ struct HfTaskSingleElectron {
247255 int ggrmotherPt = -999 .; // mother, grand mother, grand grand mother pt
248256
249257 auto partMother =
250- mcpart.template mothers_as <aod::McParticles>(); // first mother particle
251- // of electron
252- auto partMotherCopy = partMother; // copy of the first mother
253- auto mctrack = partMother; // will change all the time
258+ mcpart.template mothers_as <aod::McParticles>(); // first mother particle
259+ // of electron
260+ auto partMotherCopy = partMother; // copy of the first mother
261+ auto mctrack = partMother; // will change all the time
254262
255263 motherPt = partMother.front ().pt (); // first mother pt
256264 motherPdg = std::abs (partMother.front ().pdgCode ()); // first mother pdg
257- mpt = motherPt; // copy of first mother pt
258- mpdg = motherPdg; // copy of first mother pdg
265+ mpt = motherPt; // copy of first mother pt
266+ mpdg = motherPdg; // copy of first mother pdg
259267
260268 // check if electron from charm hadrons
261269 if ((static_cast <int >(motherPdg / 100 .) % 10 ) == kCharm ||
@@ -265,7 +273,7 @@ struct HfTaskSingleElectron {
265273 while (partMother.size ()) {
266274 mctrack = partMother.front ().template mothers_as <aod::McParticles>();
267275 if (mctrack.size ()) {
268- auto const & grmothersIdsVec = mctrack.front ().mothersIds ();
276+ auto const & grmothersIdsVec = mctrack.front ().mothersIds ();
269277
270278 if (grmothersIdsVec.empty ()) {
271279 return DirectCharm;
@@ -283,13 +291,13 @@ struct HfTaskSingleElectron {
283291 }
284292 } else if ((static_cast <int >(motherPdg / 100 .) % 10 ) == kBottom ||
285293 (static_cast <int >(motherPdg / 1000 .) % 10 ) ==
286- kBottom ) { // check if electron from beauty hadrons
294+ kBottom ) { // check if electron from beauty hadrons
287295 return DirectBeauty;
288296 } else if (motherPdg ==
289297 kGamma ) { // check if electron from photon conversion
290298 mctrack = partMother.front ().template mothers_as <aod::McParticles>();
291299 if (mctrack.size ()) {
292- auto const & grmothersIdsVec = mctrack.front ().mothersIds ();
300+ auto const & grmothersIdsVec = mctrack.front ().mothersIds ();
293301 if (grmothersIdsVec.empty ()) {
294302 return DirectGamma;
295303 }
@@ -300,7 +308,7 @@ struct HfTaskSingleElectron {
300308 partMother = mctrack;
301309 mctrack = partMother.front ().template mothers_as <aod::McParticles>();
302310 if (mctrack.size ()) {
303- auto const & ggrmothersIdsVec = mctrack.front ().mothersIds ();
311+ auto const & ggrmothersIdsVec = mctrack.front ().mothersIds ();
304312 if (ggrmothersIdsVec.empty ()) {
305313 if (grmotherPdg == kPi0 ) {
306314 return GammaPi0;
@@ -377,17 +385,17 @@ struct HfTaskSingleElectron {
377385 } else { // check if electron from Dalitz decays
378386 mctrack = partMother.front ().template mothers_as <aod::McParticles>();
379387 if (mctrack.size ()) {
380- auto const & grmothersIdsVec = mctrack.front ().mothersIds ();
388+ auto const & grmothersIdsVec = mctrack.front ().mothersIds ();
381389 if (grmothersIdsVec.empty ()) {
382390 static const std::map<int , SourceType> pdgToSource = {
383- {kPi0 , Pi0},
384- {PdgCode::kEta , Eta},
385- {PdgCode::kOmega , Omega},
386- {kPhi , Phi},
387- {PdgCode::kEtaPrime , EtaPrime},
388- {kRho770_0 , Rho0},
389- {kKPlus , Ke3},
390- {kK0Long , K0l}};
391+ {kPi0 , Pi0},
392+ {PdgCode::kEta , Eta},
393+ {PdgCode::kOmega , Omega},
394+ {kPhi , Phi},
395+ {PdgCode::kEtaPrime , EtaPrime},
396+ {kRho770_0 , Rho0},
397+ {kKPlus , Ke3},
398+ {kK0Long , K0l}};
391399
392400 auto it = pdgToSource.find (motherPdg);
393401 if (it != pdgToSource.end ()) {
@@ -447,8 +455,9 @@ struct HfTaskSingleElectron {
447455 return Else;
448456 }
449457
450- void processData (soa::Filtered<MyCollisions>::iterator const &collision,
451- TracksEl const &tracks) {
458+ void processData (soa::Filtered<MyCollisions>::iterator const & collision,
459+ TracksEl const & tracks)
460+ {
452461 float const flagAnalysedEvt = 0.5 ;
453462
454463 if (!collision.sel8 ()) {
@@ -462,7 +471,7 @@ struct HfTaskSingleElectron {
462471 histos.fill (HIST (" VtxZ" ), collision.posZ ());
463472 histos.fill (HIST (" nEvents" ), flagAnalysedEvt);
464473
465- for (const auto & track : tracks) {
474+ for (const auto & track : tracks) {
466475
467476 if (!trackSel (track)) {
468477 continue ;
@@ -514,8 +523,9 @@ struct HfTaskSingleElectron {
514523 }
515524 PROCESS_SWITCH (HfTaskSingleElectron, processData, " For real data" , true );
516525
517- void processMc (soa::Filtered<MyCollisions>::iterator const &collision,
518- McTracksEl const &tracks, aod::McParticles const &) {
526+ void processMc (soa::Filtered<MyCollisions>::iterator const & collision,
527+ McTracksEl const & tracks, aod::McParticles const &)
528+ {
519529 float const flagAnalysedEvt = 0.5 ;
520530
521531 if (!collision.sel8 ()) {
@@ -529,7 +539,7 @@ struct HfTaskSingleElectron {
529539 histos.fill (HIST (" VtxZ" ), collision.posZ ());
530540 histos.fill (HIST (" nEvents" ), flagAnalysedEvt);
531541
532- for (const auto & track : tracks) {
542+ for (const auto & track : tracks) {
533543
534544 if (!trackSel (track)) {
535545 continue ;
@@ -596,6 +606,7 @@ struct HfTaskSingleElectron {
596606 PROCESS_SWITCH (HfTaskSingleElectron, processMc, " For real data" , false );
597607};
598608
599- WorkflowSpec defineDataProcessing (ConfigContext const &cfgc) {
609+ WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
610+ {
600611 return WorkflowSpec{adaptAnalysisTask<HfTaskSingleElectron>(cfgc)};
601612}
0 commit comments