2424#include " Common/DataModel/EventSelection.h"
2525#include " Common/DataModel/PIDResponse.h"
2626#include " CommonConstants/PhysicsConstants.h"
27+ #include " PWGLF/DataModel/LFKinkDecayTables.h"
2728
2829using namespace o2 ;
2930using namespace o2 ::framework;
3031using namespace o2 ::framework::expressions;
31- using std::array;
32+
33+ using CollisionsFull = soa::Join<aod::Collisions, aod::EvSel>;
3234using FullTracksExtIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullPr, aod::pidTPCFullAl, aod::pidTPCFullTr, aod::pidTPCFullPi>;
3335using MCLabeledTracksIU = soa::Join<FullTracksExtIU, aod::McTrackLabels>;
3436
@@ -97,17 +99,51 @@ Channel getDecayChannelH4S(TMCParticle const& particle)
9799 return kNDecayChannel ;
98100}
99101// --------------------------------------------------------------
102+ struct Hyperhelium4sigmaAnalysis {
103+ // Histograms are defined with HistogramRegistry
104+ HistogramRegistry registry{" registry" , {}};
105+
106+ // Configurable for event selection
107+ Configurable<float > cutzvertex{" cutzvertex" , 10 .0f , " Accepted z-vertex range (cm)" };
108+ Configurable<float > cutNSigmaAl{" cutNSigmaAl" , 5 , " NSigmaTPCAlpha" };
109+
110+ void init (InitContext const &)
111+ {
112+ // Axes
113+ const AxisSpec vertexZAxis{100 , -15 ., 15 ., " vrtx_{Z} [cm]" };
114+ const AxisSpec ptAxis{50 , -10 , 10 , " #it{p}_{T} (GeV/#it{c})" };
115+ const AxisSpec nSigmaAxis{100 , -5 , 5 , " n#sigma_{#pi}" };
116+ const AxisSpec massAxis{100 , 3.85 , 4.25 , " m (GeV/#it{c}^{2})" };
117+
118+ registry.add (" hVertexZRec" , " hVertexZRec" , {HistType::kTH1F , {vertexZAxis}});
100119
120+ registry.add (" h2MassHyperhelium4sigmaPt" , " h2MassHyperhelium4sigmaPt" , {HistType::kTH2F , {ptAxis, massAxis}});
121+ registry.add (" h2NSigmaAlPt" , " h2NSigmaAlPt" , {HistType::kTH2F , {ptAxis, nSigmaAxis}});
122+ }
123+
124+ void process (soa::Join<aod::Collisions, aod::EvSels>::iterator const & collision,
125+ aod::KinkCands const & KinkCands, FullTracksExtIU const &)
126+ {
127+ if (std::abs (collision.posZ ()) > cutzvertex || !collision.sel8 ()) {
128+ return ;
129+ }
130+ registry.fill (HIST (" hVertexZRec" ), collision.posZ ());
131+ for (const auto & kinkCand : KinkCands) {
132+ auto dauTrack = kinkCand.trackDaug_as <FullTracksExtIU>();
133+ if (std::abs (dauTrack.tpcNSigmaAl ()) > cutNSigmaAl) {
134+ continue ;
135+ }
136+ registry.fill (HIST (" h2MassHyperhelium4sigmaPt" ), kinkCand.mothSign () * kinkCand.ptMoth (), kinkCand.mSigmaMinus ());
137+ registry.fill (HIST (" h2NSigmaAlPt" ), kinkCand.mothSign () * kinkCand.ptDaug (), dauTrack.tpcNSigmaAl ());
138+ }
139+ }
140+ };
141+
142+ // --------------------------------------------------------------
101143// check the performance of mcparticle
102- struct Hyperhelium4sigmaAnalysis {
144+ struct Hyperhelium4sigmaQa {
103145 // Basic checks
104- HistogramRegistry registry{
105- " registry" ,
106- {
107- {" hCollCounter" , " hCollCounter" , {HistType::kTH1F , {{2 , 0 .0f , 2 .0f }}}},
108- {" hMcCollCounter" , " hMcCollCounter" , {HistType::kTH1F , {{2 , 0 .0f , 2 .0f }}}},
109- },
110- };
146+ HistogramRegistry registry{" registry" , {}};
111147
112148 ConfigurableAxis ptBins{" ptBins" , {200 , 0 .f , 10 .f }, " Binning for #it{p}_{T} (GeV/#it{c})" };
113149 ConfigurableAxis ctBins{" ctBins" , {100 , 0 .f , 25 .f }, " Binning for c#it{t} (cm)" };
@@ -117,40 +153,44 @@ struct Hyperhelium4sigmaAnalysis {
117153
118154 void init (InitContext&)
119155 {
120- const AxisSpec ptAxis{ptBins, " #it{p}_{T} (GeV/#it{c})" };
121- const AxisSpec ctAxis{ctBins, " c#it{t} (cm)" };
122- const AxisSpec rigidityAxis{rigidityBins, " p/z (GeV/#it{c})" };
123- const AxisSpec nsigmaAxis{nsigmaBins, " TPC n#sigma" };
124- const AxisSpec invMassAxis{invMassBins, " Inv Mass (GeV/#it{c}^{2})" };
125-
126- registry.get <TH1>(HIST (" hCollCounter" ))->GetXaxis ()->SetBinLabel (1 , " Reconstructed Collisions" );
127- registry.get <TH1>(HIST (" hCollCounter" ))->GetXaxis ()->SetBinLabel (2 , " Selected" );
128- registry.get <TH1>(HIST (" hMcCollCounter" ))->GetXaxis ()->SetBinLabel (1 , " MC Collisions" );
129- registry.get <TH1>(HIST (" hMcCollCounter" ))->GetXaxis ()->SetBinLabel (2 , " Reconstructed" );
130-
131- auto hGenHyperHelium4SigmaCounter = registry.add <TH1>(" hGenHyperHelium4SigmaCounter" , " " , HistType::kTH1F , {{10 , 0 .f , 10 .f }});
132- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (1 , " H4S All" );
133- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (2 , " Matter" );
134- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (3 , " AntiMatter" );
135- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (4 , " #alpha + #pi^{0}" );
136- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (5 , " #bar{#alpha} + #pi^{0}" );
137- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (6 , " t + p + #pi^{0}" );
138- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (7 , " #bar{t} + #bar{p} + #pi^{0}" );
139- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (8 , " t + n + #pi^{+}" );
140- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (9 , " #bar{t} + #bar{n} + #pi^{+}" );
141- registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (10 , " Unexpected" );
142-
143- auto hEvtSelectedHyperHelium4SigmaCounter = registry.add <TH1>(" hEvtSelectedHyperHelium4SigmaCounter" , " " , HistType::kTH1F , {{2 , 0 .f , 2 .f }});
144- registry.get <TH1>(HIST (" hEvtSelectedHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (1 , " Generated" );
145- registry.get <TH1>(HIST (" hEvtSelectedHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (2 , " Survived" );
146-
147- registry.add <TH1>(" hGenHyperHelium4SigmaPt" , " " , HistType::kTH1F , {ptAxis});
148- registry.add <TH1>(" hGenHyperHelium4SigmaCt" , " " , HistType::kTH1F , {ctAxis});
149- registry.add <TH1>(" hMcRecoInvMass" , " " , HistType::kTH1F , {invMassAxis});
150-
151- registry.add <TH2>(" hDauHelium4TPCNSigma" , " " , HistType::kTH2F , {rigidityAxis, nsigmaAxis});
152- registry.add <TH2>(" hDauTritonTPCNSigma" , " " , HistType::kTH2F , {rigidityAxis, nsigmaAxis});
153- registry.add <TH2>(" hDauProtonTPCNSigma" , " " , HistType::kTH2F , {rigidityAxis, nsigmaAxis});
156+ if (doprocessMC == true ) {
157+ const AxisSpec ptAxis{ptBins, " #it{p}_{T} (GeV/#it{c})" };
158+ const AxisSpec ctAxis{ctBins, " c#it{t} (cm)" };
159+ const AxisSpec rigidityAxis{rigidityBins, " p/z (GeV/#it{c})" };
160+ const AxisSpec nsigmaAxis{nsigmaBins, " TPC n#sigma" };
161+ const AxisSpec invMassAxis{invMassBins, " Inv Mass (GeV/#it{c}^{2})" };
162+
163+ auto hCollCounter = registry.add <TH1>(" hCollCounter" , " hCollCounter" , HistType::kTH1F , {{2 , 0 .0f , 2 .0f }});
164+ registry.get <TH1>(HIST (" hCollCounter" ))->GetXaxis ()->SetBinLabel (1 , " Reconstructed Collisions" );
165+ registry.get <TH1>(HIST (" hCollCounter" ))->GetXaxis ()->SetBinLabel (2 , " Selected" );
166+ auto hMcCollCounter = registry.add <TH1>(" hMcCollCounter" , " hMcCollCounter" , HistType::kTH1F , {{2 , 0 .0f , 2 .0f }});
167+ registry.get <TH1>(HIST (" hMcCollCounter" ))->GetXaxis ()->SetBinLabel (1 , " MC Collisions" );
168+ registry.get <TH1>(HIST (" hMcCollCounter" ))->GetXaxis ()->SetBinLabel (2 , " Reconstructed" );
169+
170+ auto hGenHyperHelium4SigmaCounter = registry.add <TH1>(" hGenHyperHelium4SigmaCounter" , " " , HistType::kTH1F , {{10 , 0 .f , 10 .f }});
171+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (1 , " H4S All" );
172+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (2 , " Matter" );
173+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (3 , " AntiMatter" );
174+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (4 , " #alpha + #pi^{0}" );
175+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (5 , " #bar{#alpha} + #pi^{0}" );
176+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (6 , " t + p + #pi^{0}" );
177+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (7 , " #bar{t} + #bar{p} + #pi^{0}" );
178+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (8 , " t + n + #pi^{+}" );
179+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (9 , " #bar{t} + #bar{n} + #pi^{+}" );
180+ registry.get <TH1>(HIST (" hGenHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (10 , " Unexpected" );
181+
182+ auto hEvtSelectedHyperHelium4SigmaCounter = registry.add <TH1>(" hEvtSelectedHyperHelium4SigmaCounter" , " " , HistType::kTH1F , {{2 , 0 .f , 2 .f }});
183+ registry.get <TH1>(HIST (" hEvtSelectedHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (1 , " Generated" );
184+ registry.get <TH1>(HIST (" hEvtSelectedHyperHelium4SigmaCounter" ))->GetXaxis ()->SetBinLabel (2 , " Survived" );
185+
186+ registry.add <TH1>(" hGenHyperHelium4SigmaPt" , " " , HistType::kTH1F , {ptAxis});
187+ registry.add <TH1>(" hGenHyperHelium4SigmaCt" , " " , HistType::kTH1F , {ctAxis});
188+ registry.add <TH1>(" hMcRecoInvMass" , " " , HistType::kTH1F , {invMassAxis});
189+
190+ registry.add <TH2>(" hDauHelium4TPCNSigma" , " " , HistType::kTH2F , {rigidityAxis, nsigmaAxis});
191+ registry.add <TH2>(" hDauTritonTPCNSigma" , " " , HistType::kTH2F , {rigidityAxis, nsigmaAxis});
192+ registry.add <TH2>(" hDauProtonTPCNSigma" , " " , HistType::kTH2F , {rigidityAxis, nsigmaAxis});
193+ }
154194 }
155195
156196 // Configurable<bool> eventSel8Cut{"eventSel8Cut", true, "flag to enable event sel8 selection"};
@@ -183,7 +223,13 @@ struct Hyperhelium4sigmaAnalysis {
183223 }
184224 }
185225
186- void process (aod::McCollisions const & mcCollisions, aod::McParticles const & particlesMC, o2::soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels, o2::aod::EvSels> const & collisions, MCLabeledTracksIU const & tracks)
226+ void processData (o2::aod::Collisions const &)
227+ {
228+ // dummy process function;
229+ }
230+ PROCESS_SWITCH (Hyperhelium4sigmaQa, processData, " process data" , true );
231+
232+ void processMC (aod::McCollisions const & mcCollisions, aod::McParticles const & particlesMC, o2::soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels, o2::aod::EvSels> const & collisions, MCLabeledTracksIU const & tracks)
187233 {
188234 setTrackIDForMC (particlesMC, tracks);
189235 std::vector<int64_t > selectedEvents (collisions.size ());
@@ -328,11 +374,13 @@ struct Hyperhelium4sigmaAnalysis {
328374 }
329375 }
330376 }
377+ PROCESS_SWITCH (Hyperhelium4sigmaQa, processMC, " do QA for MC prodcutions" , false );
331378};
332379
333380WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
334381{
335382 return WorkflowSpec{
336383 adaptAnalysisTask<Hyperhelium4sigmaAnalysis>(cfgc),
384+ adaptAnalysisTask<Hyperhelium4sigmaQa>(cfgc),
337385 };
338386}
0 commit comments