1717#include " PWGLF/DataModel/ReducedDoublePhiTables.h"
1818
1919#include " Common/CCDB/EventSelectionParams.h"
20+ #include " Common/Core/Zorro.h"
21+ #include " Common/Core/ZorroSummary.h"
2022#include " Common/DataModel/Centrality.h"
2123#include " Common/DataModel/EventSelection.h"
2224#include " Common/DataModel/Multiplicity.h"
@@ -55,19 +57,35 @@ struct doublephitable {
5557 Produces<aod::RedPhiEvents> redPhiEvents;
5658 Produces<aod::PhiTracks> phiTrack;
5759
60+ Service<o2::ccdb::BasicCCDBManager> ccdb;
61+ o2::ccdb::CcdbApi ccdbApi;
62+
63+ Zorro zorro;
64+ OutputObj<ZorroSummary> zorroSummary{" zorroSummary" };
65+
66+ // / Event selection
67+ struct : ConfigurableGroup {
68+ std::string prefix = std::string(" EventSel" );
69+ Configurable<bool > ConfEvtSelectZvtx{" ConfEvtSelectZvtx" , true , " Event selection includes max. z-Vertex" };
70+ Configurable<float > ConfEvtZvtx{" ConfEvtZvtx" , 10 .f , " Evt sel: Max. z-Vertex (cm)" };
71+ Configurable<bool > ConfEvtSel8{" ConfEvtSel8" , true , " Event selection sel8" };
72+ } EventSel;
73+
5874 // events
5975 Configurable<float > cfgCutVertex{" cfgCutVertex" , 10 .0f , " Accepted z-vertex range" };
6076 // Configurable<float> cfgCutCentralityMax{"cfgCutCentralityMax", 0.0f, "Accepted maximum Centrality"};
6177 // Configurable<float> cfgCutCentralityMin{"cfgCutCentralityMin", 100.0f, "Accepted minimum Centrality"};
6278 // track
79+ Configurable<std::string> url{" ccdb-url" , " http://alice-ccdb.cern.ch" , " ccdb-url" };
80+ Configurable<bool > useTrigger{" useTrigger" , true , " use Trigger" };
6381 Configurable<bool > useGlobalTrack{" useGlobalTrack" , true , " use Global track" };
6482 Configurable<float > cfgCutTOFBeta{" cfgCutTOFBeta" , 0.0 , " cut TOF beta" };
6583 Configurable<float > cfgCutCharge{" cfgCutCharge" , 0.0 , " cut on Charge" };
6684 Configurable<float > cfgCutPT{" cfgCutPT" , 0.2 , " PT cut on daughter track" };
6785 Configurable<float > cfgCutEta{" cfgCutEta" , 0.8 , " Eta cut on daughter track" };
6886 Configurable<float > cfgCutDCAxy{" cfgCutDCAxy" , 2 .0f , " DCAxy range for tracks" };
6987 Configurable<float > cfgCutDCAz{" cfgCutDCAz" , 2 .0f , " DCAz range for tracks" };
70- Configurable<float > nsigmaCutTPC{" nsigmacutTPC" , 3 .0 , " Value of the TPC Nsigma cut" };
88+ Configurable<float > nsigmaCutTPC{" nsigmacutTPC" , - 2 .0 , " Value of the TPC Nsigma cut" };
7189 Configurable<float > nsigmaCutTOF{" nsigmaCutTOF" , 3.0 , " Value of the TOF Nsigma cut" };
7290 Configurable<int > cfgITScluster{" cfgITScluster" , 0 , " Number of ITS cluster" };
7391 Configurable<int > cfgTPCcluster{" cfgTPCcluster" , 70 , " Number of TPC cluster" };
@@ -77,12 +95,13 @@ struct doublephitable {
7795 ConfigurableAxis configThnAxisPt{" configThnAxisPt" , {100 , 0.0 , 10 .}, " #it{p}_{T} (GeV/#it{c})" };
7896 Configurable<float > minPhiMass{" minPhiMass" , 1.01 , " Minimum phi mass" };
7997 Configurable<float > maxPhiMass{" maxPhiMass" , 1.03 , " Maximum phi mass" };
98+ Configurable<float > nsigmaCutTPCPreSel{" nsigmacutTPCPreSel" , 3.0 , " Value of the TPC Nsigma cut Pre selection" };
8099
81100 Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex;
82101 // Filter centralityFilter = (nabs(aod::cent::centFT0C) < cfgCutCentralityMax && nabs(aod::cent::centFT0C) > cfgCutCentralityMin);
83102 Filter acceptanceFilter = (nabs(aod::track::eta) < cfgCutEta && nabs(aod::track::pt) > cfgCutPT);
84103 Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgCutDCAxy) && (nabs(aod::track::dcaZ) < cfgCutDCAz);
85- Filter PIDcutFilter = nabs(aod::pidtpc::tpcNSigmaKa) < nsigmaCutTPC ;
104+ Filter PIDcutFilter = nabs(aod::pidtpc::tpcNSigmaKa) < nsigmaCutTPCPreSel ;
86105
87106 using EventCandidates = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Ms>>;
88107 using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTOFbeta, aod::pidTPCFullKa, aod::pidTOFFullKa>>;
@@ -91,6 +110,7 @@ struct doublephitable {
91110 Partition<TrackCandidates> posTracks = aod::track::signed1Pt > cfgCutCharge;
92111 Partition<TrackCandidates> negTracks = aod::track::signed1Pt < cfgCutCharge;
93112
113+ OutputObj<TH1D > hProcessedEvents{TH1D (" hProcessedEvents" , " ;; Number of events" , 4 , 0 .0f , 4 .0f )};
94114 // Histogram
95115 HistogramRegistry qaRegistry{" QAHistos" , {
96116 {" hEventstat" , " hEventstat" , {HistType::kTH1F , {{2 , 0 .0f , 2 .0f }}}},
@@ -102,51 +122,64 @@ struct doublephitable {
102122
103123 double massKa = o2::constants::physics::MassKPlus;
104124
125+ void init (o2::framework::InitContext&)
126+ {
127+ ccdb->setURL (url.value );
128+ ccdbApi.init (url);
129+ ccdb->setCaching (true );
130+ ccdb->setLocalObjectValidityChecking ();
131+ ccdb->setCreatedNotAfter (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count ());
132+ zorroSummary.setObject (zorro.getZorroSummary ());
133+ hProcessedEvents->GetXaxis ()->SetBinLabel (1 , " All Trigger events" );
134+ hProcessedEvents->GetXaxis ()->SetBinLabel (2 , " Events with Double Phi Trigger" );
135+ hProcessedEvents->GetXaxis ()->SetBinLabel (3 , " Events eith trigger and Evsel" );
136+ hProcessedEvents->GetXaxis ()->SetBinLabel (4 , " Final Event" );
137+ }
138+ template <typename T>
139+ bool isSelectedEvent (T const & col)
140+ {
141+ if (EventSel.ConfEvtSelectZvtx && std::abs (col.posZ ()) > EventSel.ConfEvtZvtx ) {
142+ return false ;
143+ }
144+ if (EventSel.ConfEvtSel8 && !col.sel8 ()) {
145+ return false ;
146+ }
147+ return true ;
148+ }
105149 template <typename T>
106150 bool selectionTrack (const T& candidate)
107151 {
108- if (useGlobalTrack && !(candidate.isGlobalTrack () && candidate.isPVContributor () && candidate.itsNCls () > cfgITScluster && candidate.tpcNClsFound () > cfgTPCcluster)) {
152+ if (useGlobalTrack && !(candidate.isGlobalTrack () && candidate.isPVContributor () && candidate.itsNCls () > cfgITScluster && candidate.tpcNClsCrossedRows () > cfgTPCcluster)) {
109153 return false ;
110154 }
111155 return true ;
112156 }
113157 template <typename T>
114158 bool selectionPID (const T& candidate)
115159 {
116- if (! candidate.hasTOF () && TMath::Abs ( candidate.tpcNSigmaKa ()) < nsigmaCutTPC ) {
160+ if (candidate.pt () < 0.5 && candidate. tpcNSigmaKa () > nsigmaCutTPC && candidate.tpcNSigmaKa () < 3.0 ) {
117161 return true ;
118162 }
119- if (candidate.hasTOF () && candidate.beta () > cfgCutTOFBeta && TMath::Abs (candidate.tpcNSigmaKa ()) < nsigmaCutTPC && TMath::Abs (candidate.tofNSigmaKa ()) < nsigmaCutTOF) {
120- return true ;
163+ if (candidate.pt () >= 0.5 ) {
164+ if (!candidate.hasTOF () && candidate.tpcNSigmaKa () > nsigmaCutTPC && candidate.tpcNSigmaKa () < 2.0 ) {
165+ return true ;
166+ }
167+ if (candidate.hasTOF () && candidate.beta () > cfgCutTOFBeta && TMath::Sqrt (candidate.tpcNSigmaKa () * candidate.tpcNSigmaKa () + candidate.tofNSigmaKa () * candidate.tofNSigmaKa ()) < nsigmaCutTOF) {
168+ return true ;
169+ }
121170 }
122171 return false ;
123172 }
124- // deep angle cut on pair to remove photon conversion
125- template <typename T1 , typename T2 >
126- bool selectionPair (const T1 & candidate1, const T2 & candidate2)
127- {
128- double pt1, pt2, pz1, pz2, p1, p2, angle;
129- pt1 = candidate1.pt ();
130- pt2 = candidate2.pt ();
131- pz1 = candidate1.pz ();
132- pz2 = candidate2.pz ();
133- p1 = candidate1.p ();
134- p2 = candidate2.p ();
135- angle = TMath::ACos ((pt1 * pt2 + pz1 * pz2) / (p1 * p2));
136- if (isDeepAngle && angle < cfgDeepAngle) {
137- return false ;
138- }
139- return true ;
140- }
141173
174+ int currentRunNumber = -999 ;
175+ int lastRunNumber = -999 ;
142176 ROOT ::Math::PxPyPzMVector KaonPlus, KaonMinus, PhiMesonMother, PhiVectorDummy, Phid1dummy, Phid2dummy;
143177 void processPhiReducedTable (EventCandidates::iterator const & collision, TrackCandidates const &, aod::BCsWithTimestamps const &)
144178 {
145179 o2::aod::ITSResponse itsResponse;
146180 bool keepEventDoublePhi = false ;
147181 int numberPhi = 0 ;
148- auto currentRunNumber = collision.bc_as <aod::BCsWithTimestamps>().runNumber ();
149- auto bc = collision.bc_as <aod::BCsWithTimestamps>();
182+
150183 std::vector<int64_t > Phid1Index = {};
151184 std::vector<int64_t > Phid2Index = {};
152185
@@ -167,7 +200,25 @@ struct doublephitable {
167200 int Npostrack = 0 ;
168201 int Nnegtrack = 0 ;
169202 float centrality = collision.centFT0M ();
170- if (collision.sel8 () && collision.selection_bit (aod::evsel::kNoTimeFrameBorder ) && collision.selection_bit (aod::evsel::kNoITSROFrameBorder ) && collision.selection_bit (aod::evsel::kNoSameBunchPileup ) && collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV )) {
203+ currentRunNumber = collision.bc_as <aod::BCsWithTimestamps>().runNumber ();
204+ auto bc = collision.bc_as <aod::BCsWithTimestamps>();
205+ hProcessedEvents->Fill (0.5 );
206+ bool zorroSelected = false ;
207+ if (currentRunNumber != lastRunNumber) {
208+ zorro.initCCDB (ccdb.service , bc.runNumber (), bc.timestamp (), " fTriggerEventDoublePhi" );
209+ zorro.populateHistRegistry (qaRegistry, bc.runNumber ());
210+ lastRunNumber = currentRunNumber;
211+ }
212+ if (useTrigger) {
213+ zorroSelected = zorro.isSelected (collision.template bc_as <aod::BCsWithTimestamps>().globalBC ());
214+ } else {
215+ zorroSelected = true ;
216+ }
217+ if (zorroSelected) {
218+ hProcessedEvents->Fill (1.5 );
219+ }
220+ if (zorroSelected && isSelectedEvent (collision)) {
221+ hProcessedEvents->Fill (2.5 );
171222 auto posThisColl = posTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
172223 auto negThisColl = negTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
173224 for (auto track1 : posThisColl) {
@@ -179,7 +230,7 @@ struct doublephitable {
179230 if (!selectionPID (track1)) {
180231 continue ;
181232 }
182- if (!(itsResponse.nSigmaITS <o2::track::PID ::Kaon>(track1) > -3 .0 && itsResponse.nSigmaITS <o2::track::PID ::Kaon>(track1) < 3.0 )) {
233+ if (track1. pt () > 0.4 && track1. pt () < 1.0 && !(itsResponse.nSigmaITS <o2::track::PID ::Kaon>(track1) > -2 .0 && itsResponse.nSigmaITS <o2::track::PID ::Kaon>(track1) < 3.0 )) {
183234 continue ;
184235 }
185236 Npostrack = Npostrack + 1 ;
@@ -188,7 +239,12 @@ struct doublephitable {
188239 qaRegistry.fill (HIST (" hNsigmaPtkaonTOF" ), track1.tofNSigmaKa (), track1.pt ());
189240 }
190241 auto track1ID = track1.globalIndex ();
242+
191243 for (auto track2 : negThisColl) {
244+ auto track2ID = track2.globalIndex ();
245+ if (track2ID == track1ID) {
246+ continue ;
247+ }
192248 // track selection
193249 if (!selectionTrack (track2)) {
194250 continue ;
@@ -197,18 +253,11 @@ struct doublephitable {
197253 if (!selectionPID (track2)) {
198254 continue ;
199255 }
200- if (Npostrack == 1 ) {
201- Nnegtrack = Nnegtrack + 1 ;
202- }
203- auto track2ID = track2.globalIndex ();
204- if (track2ID == track1ID) {
256+ if (track2.pt () > 0.4 && track2.pt () < 1.0 && !(itsResponse.nSigmaITS <o2::track::PID ::Kaon>(track2) > -2.0 && itsResponse.nSigmaITS <o2::track::PID ::Kaon>(track2) < 3.0 )) {
205257 continue ;
206258 }
207- if (!(itsResponse.nSigmaITS <o2::track::PID ::Kaon>(track2) > -3.0 && itsResponse.nSigmaITS <o2::track::PID ::Kaon>(track2) < 3.0 )) {
208- continue ;
209- }
210- if (!selectionPair (track1, track2)) {
211- continue ;
259+ if (Npostrack == 1 ) {
260+ Nnegtrack = Nnegtrack + 1 ;
212261 }
213262 KaonPlus = ROOT::Math::PxPyPzMVector (track1.px (), track1.py (), track1.pz (), massKa);
214263 KaonMinus = ROOT::Math::PxPyPzMVector (track2.px (), track2.py (), track2.pz (), massKa);
@@ -252,11 +301,12 @@ struct doublephitable {
252301 }
253302 }
254303 } // select collision
255- if (numberPhi > 1 && Npostrack > 1 && Nnegtrack > 1 ) {
304+ if (numberPhi > 1 && zorroSelected && Nnegtrack > 1 && Npostrack > 1 ) {
256305 keepEventDoublePhi = true ;
306+ hProcessedEvents->Fill (3.5 );
257307 }
258308 qaRegistry.fill (HIST (" hEventstat" ), 0.5 );
259- if (keepEventDoublePhi && numberPhi > 1 && Npostrack > 1 && Nnegtrack > 1 && (phiresonance.size () == phiresonanced1.size ()) && (phiresonance.size () == phiresonanced2.size ())) {
309+ if (keepEventDoublePhi && numberPhi > 1 && (phiresonance.size () == phiresonanced1.size ()) && (phiresonance.size () == phiresonanced2.size ())) {
260310 qaRegistry.fill (HIST (" hEventstat" ), 1.5 );
261311 // ///////// Fill collision table///////////////
262312 redPhiEvents (bc.globalBC (), currentRunNumber, bc.timestamp (), collision.posZ (), collision.numContrib (), Npostrack, Nnegtrack, centrality);
0 commit comments