1616// / \author Biao Zhang <biao.zhang@cern.ch>, CCNU
1717#include " Framework/AnalysisTask.h"
1818#include " Framework/HistogramRegistry.h"
19+ #include " AnalysisCore/HFSelectorCuts.h"
1920#include " AnalysisDataModel/HFSecondaryVertex.h"
2021#include " AnalysisDataModel/HFCandidateSelectionTables.h"
2122
2223using namespace o2 ;
24+ using namespace o2 ::analysis;
25+ using namespace o2 ::analysis::hf_cuts_jpsi_toee;
2326using namespace o2 ::framework;
2427using namespace o2 ::aod::hf_cand_prong2;
2528using namespace o2 ::framework::expressions;
@@ -36,53 +39,57 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
3639struct TaskJpsi {
3740 HistogramRegistry registry{
3841 " registry" ,
39- {{" hmass" , " 2-prong candidates;inv. mass (#e+ e-) (GeV/#it{c}^{2});entries" , {HistType::kTH1F , {{500 , 0 ., 5 .}}}},
40- {" hptcand" , " 2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {{100 , 0 ., 10 .}}}},
42+ {{" hptcand" , " 2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {{100 , 0 ., 10 .}}}},
4143 {" hptprong0" , " 2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {{100 , 0 ., 10 .}}}},
42- {" hptprong1" , " 2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {{100 , 0 ., 10 .}}}},
43- {" hdeclength" , " 2-prong candidates;decay length (cm);entries" , {HistType::kTH1F , {{200 , 0 ., 2 .}}}},
44- {" hdeclengthxy" , " 2-prong candidates;decay length xy (cm);entries" , {HistType::kTH1F , {{200 , 0 ., 2 .}}}},
45- {" hd0Prong0" , " 2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries" , {HistType::kTH1F , {{100 , -1 ., 1 .}}}},
46- {" hd0Prong1" , " 2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries" , {HistType::kTH1F , {{100 , -1 ., 1 .}}}},
47- {" hd0d0" , " 2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries" , {HistType::kTH1F , {{500 , -1 ., 1 .}}}},
48- {" hCPA" , " 2-prong candidates;cosine of pointing angle;entries" , {HistType::kTH1F , {{110 , -1.1 , 1.1 }}}},
49- {" hEta" , " 2-prong candidates;candidate #it{#eta};entries" , {HistType::kTH1F , {{100 , -2 ., 2 .}}}},
50- {" hImpParErr" , " 2-prong candidates;impact parameter error (cm);entries" , {HistType::kTH1F , {{100 , -1 ., 1 .}}}},
51- {" hDecLenErr" , " 2-prong candidates;decay length error (cm);entries" , {HistType::kTH1F , {{100 , 0 ., 1 .}}}},
52- {" hDecLenXYErr" , " 2-prong candidates;decay length xy error (cm);entries" , {HistType::kTH1F , {{100 , 0 ., 1 .}}}}}};
44+ {" hptprong1" , " 2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {{100 , 0 ., 10 .}}}}}};
5345
5446 Configurable<int > d_selectionFlagJpsi{" d_selectionFlagJpsi" , 1 , " Selection Flag for Jpsi" };
5547 Configurable<double > cutYCandMax{" cutYCandMax" , -1 ., " max. cand. rapidity" };
48+ Configurable<std::vector<double >> bins{" pTBins" , std::vector<double >{hf_cuts_jpsi_toee::pTBins_v}, " pT bin limits" };
49+
50+ void init (o2::framework::InitContext&)
51+ {
52+ registry.add (" hmass" , " 2-prong candidates;inv. mass (e^{#plus} e^{#minus}) (GeV/#it{c}^{2});entries" , {HistType::kTH2F , {{500 , 0 ., 5 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
53+ registry.add (" hdeclength" , " 2-prong candidates;decay length (cm);entries" , {HistType::kTH2F , {{200 , 0 ., 2 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
54+ registry.add (" hdeclengthxy" , " 2-prong candidates;decay length xy (cm);entries" , {HistType::kTH2F , {{200 , 0 ., 2 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
55+ registry.add (" hd0Prong0" , " 2-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries" , {HistType::kTH2F , {{100 , -1 ., 1 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
56+ registry.add (" hd0Prong1" , " 2-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries" , {HistType::kTH2F , {{100 , -1 ., 1 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
57+ registry.add (" hd0d0" , " 2-prong candidates;product of DCAxy to prim. vertex (cm^{2});entries" , {HistType::kTH2F , {{500 , -1 ., 1 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
58+ registry.add (" hCPA" , " 2-prong candidates;cosine of pointing angle;entries" , {HistType::kTH2F , {{110 , -1.1 , 1.1 }, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
59+ registry.add (" hEta" , " 2-prong candidates;candidate #it{#eta};entries" , {HistType::kTH2F , {{100 , -2 ., 2 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
60+ registry.add (" hImpParErr" , " 2-prong candidates;impact parameter error (cm);entries" , {HistType::kTH2F , {{100 , -1 ., 1 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
61+ registry.add (" hDecLenErr" , " 2-prong candidates;decay length error (cm);entries" , {HistType::kTH2F , {{100 , 0 ., 1 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
62+ registry.add (" hDecLenXYErr" , " 2-prong candidates;decay length xy error (cm);entries" , {HistType::kTH2F , {{100 , 0 ., 1 .}, {(std::vector<double >)bins, " #it{p}_{T} (GeV/#it{c})" }}});
63+ }
64+
5665 Filter filterSelectCandidates = (aod::hf_selcandidate_jpsi::isSelJpsiToEE >= d_selectionFlagJpsi);
5766
5867 void process (soa::Filtered<soa::Join<aod::HfCandProng2, aod::HFSelJpsiToEECandidate>> const & candidates)
5968 // void process(aod::HfCandProng2 const& candidates)
6069 {
61- // Printf("Candidates: %d", candidates.size());
6270 for (auto & candidate : candidates) {
6371 if (!(candidate.hfflag () & 1 << JpsiToEE)) {
6472 continue ;
6573 }
6674 if (cutYCandMax >= 0 . && std::abs (YJpsi (candidate)) > cutYCandMax) {
67- // Printf("Candidate: Y rejection: %g", YJpsi(candidate));
6875 continue ;
6976 }
7077
71- registry.fill (HIST (" hmass" ), InvMassJpsiToEE (candidate));
78+ registry.fill (HIST (" hmass" ), InvMassJpsiToEE (candidate), candidate. pt () );
7279 registry.fill (HIST (" hptcand" ), candidate.pt ());
7380 registry.fill (HIST (" hptprong0" ), candidate.ptProng0 ());
7481 registry.fill (HIST (" hptprong1" ), candidate.ptProng1 ());
75- registry.fill (HIST (" hdeclength" ), candidate.decayLength ());
76- registry.fill (HIST (" hdeclengthxy" ), candidate.decayLengthXY ());
77- registry.fill (HIST (" hd0Prong0" ), candidate.impactParameter0 ());
78- registry.fill (HIST (" hd0Prong1" ), candidate.impactParameter1 ());
79- registry.fill (HIST (" hd0d0" ), candidate.impactParameterProduct ());
80- registry.fill (HIST (" hCPA" ), candidate.cpa ());
81- registry.fill (HIST (" hEta" ), candidate.eta ());
82- registry.fill (HIST (" hImpParErr" ), candidate.errorImpactParameter0 ());
83- registry.fill (HIST (" hImpParErr" ), candidate.errorImpactParameter1 ());
84- registry.fill (HIST (" hDecLenErr" ), candidate.errorDecayLength ());
85- registry.fill (HIST (" hDecLenXYErr" ), candidate.errorDecayLengthXY ());
82+ registry.fill (HIST (" hdeclength" ), candidate.decayLength (), candidate. pt () );
83+ registry.fill (HIST (" hdeclengthxy" ), candidate.decayLengthXY (), candidate. pt () );
84+ registry.fill (HIST (" hd0Prong0" ), candidate.impactParameter0 (), candidate. pt () );
85+ registry.fill (HIST (" hd0Prong1" ), candidate.impactParameter1 (), candidate. pt () );
86+ registry.fill (HIST (" hd0d0" ), candidate.impactParameterProduct (), candidate. pt () );
87+ registry.fill (HIST (" hCPA" ), candidate.cpa (), candidate. pt () );
88+ registry.fill (HIST (" hEta" ), candidate.eta (), candidate. pt () );
89+ registry.fill (HIST (" hImpParErr" ), candidate.errorImpactParameter0 (), candidate. pt () );
90+ registry.fill (HIST (" hImpParErr" ), candidate.errorImpactParameter1 (), candidate. pt () );
91+ registry.fill (HIST (" hDecLenErr" ), candidate.errorDecayLength (), candidate. pt () );
92+ registry.fill (HIST (" hDecLenXYErr" ), candidate.errorDecayLengthXY (), candidate. pt () );
8693 }
8794 }
8895};
0 commit comments