@@ -89,7 +89,7 @@ struct NetchargeFluctuations {
8989 // Configurables
9090 Configurable<int64_t > ccdbNoLaterThan{" ccdbNoLaterThan" , std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count (), " latest acceptable timestamp of creation for the object" };
9191 Configurable<std::string> cfgUrlCCDB{" cfgUrlCCDB" , " http://alice-ccdb.cern.ch" , " url of ccdb" };
92- Configurable<std::string> cfgPathCCDB{" cfgPathCCDB" , " Users/n/nimalik/efftest " , " Path for ccdb-object" };
92+ Configurable<std::string> cfgPathCCDB{" cfgPathCCDB" , " Users/n/nimalik/netcharge/p/Run3/LHC24f3d " , " Path for ccdb-object" };
9393 Configurable<bool > cfgLoadEff{" cfgLoadEff" , true , " Load efficiency" };
9494
9595 Configurable<float > vertexZcut{" vertexZcut" , 10 .f , " Vertex Z" };
@@ -111,43 +111,44 @@ struct NetchargeFluctuations {
111111 Configurable<bool > cSel8Trig{" cSel8Trig" , true , " Sel8 (T0A + T0C) Selection Run3" }; // sel8
112112 Configurable<bool > cInt7Trig{" cInt7Trig" , true , " kINT7 MB Trigger" }; // kINT7
113113 Configurable<bool > cSel7Trig{" cSel7Trig" , true , " Sel7 (V0A + V0C) Selection Run2" }; // sel7
114- Configurable<bool > cTFBorder{" cTFBorder" , false , " Timeframe Border Selection" }; // pileup
115- Configurable<bool > cNoItsROBorder{" cNoItsROBorder" , false , " No ITSRO Border Cut" }; // pileup
116- Configurable<bool > cItsTpcVtx{" cItsTpcVtx" , false , " ITS+TPC Vertex Selection" }; // pileup
117114 Configurable<bool > cPileupReject{" cPileupReject" , false , " Pileup rejection" }; // pileup
118- Configurable<bool > cZVtxTimeDiff{" cZVtxTimeDiff" , false , " z-vtx time diff selection" }; // pileup
119115 Configurable<bool > cfgUseGoodItsLayerAllCut{" cfgUseGoodItsLayerAllCut" , false , " Good ITS Layers All" }; // pileup
120116 Configurable<bool > cDcaXy{" cDcaXy" , false , " Dca XY cut" };
121117 Configurable<bool > cDcaZ{" cDcaZ" , false , " Dca Z cut" };
122118 Configurable<bool > cTpcCr{" cTpcCr" , false , " tpc crossrows" };
123119 Configurable<bool > cItsChi{" cItsChi" , false , " ITS chi" };
124120 Configurable<bool > cTpcChi{" cTpcChi" , false , " TPC chi" };
121+ Configurable<bool > cFT0C{" cFT0C" , true , " cent FT0C" };
122+ Configurable<bool > cFT0M{" cFT0M" , false , " cent FT0M" };
123+ ConfigurableAxis centBining{" centBining" , {0 , 5 , 10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 , 100 }, " Centrality/Multiplicity percentile bining" };
124+ Configurable<bool > cTFBorder{" cTFBorder" , false , " Timeframe Border Selection" }; // pileup
125+ Configurable<bool > cNoItsROBorder{" cNoItsROBorder" , false , " No ITSRO Border Cut" }; // pileup
126+ Configurable<bool > cItsTpcVtx{" cItsTpcVtx" , false , " ITS+TPC Vertex Selection" }; // pileup
127+ Configurable<bool > cZVtxTimeDiff{" cZVtxTimeDiff" , false , " z-vtx time diff selection" }; // pileup
125128
126129 // CCDB efficiency histograms
127- TH2D * efficiency = nullptr ;
130+ TH1D * efficiency = nullptr ;
128131
129132 // Initialization
130133 void init (o2::framework::InitContext&)
131134 {
132135 const AxisSpec vtxzAxis = {800 , -20 , 20 , " V_{Z} (cm)" };
133- const AxisSpec dcaAxis = {250 , -0.5 , 0.5 , " DCA_{xy} (cm)" };
134- const AxisSpec dcazAxis = {250 , -0.5 , 0.5 , " DCA_{z} (cm)" };
136+ const AxisSpec dcaAxis = {1000 , -0.5 , 0.5 , " DCA_{xy} (cm)" };
137+ const AxisSpec dcazAxis = {600 , -3 , 3 , " DCA_{z} (cm)" };
135138 const AxisSpec ptAxis = {70 , 0.0 , 7.0 , " #it{p}_{T} (GeV/#it{c})" };
136139 const AxisSpec etaAxis = {20 , -1 ., 1 ., " #eta" };
137140 const AxisSpec deltaEtaAxis = {9 , 0 , 1.8 , " #eta" };
138141 const AxisSpec centAxis = {100 , 0 ., 100 ., " centrality" };
139- const AxisSpec multAxis = {200 , 0 ., 10000 ., " FT0M Amplitude" };
140- const AxisSpec tpcChiAxis = {1400 , 0 ., 7 ., " Chi2" };
141- const AxisSpec itsChiAxis = {800 , 0 ., 40 ., " Chi2" };
142+ const AxisSpec multAxis = {100000 , 0 ., 100000 ., " FT0M Amplitude" };
143+ const AxisSpec tpcChiAxis = {700 , 0 ., 7 ., " Chi2" };
144+ const AxisSpec itsChiAxis = {400 , 0 ., 40 ., " Chi2" };
142145 const AxisSpec crossedRowAxis = {1600 , 0 ., 160 ., " TPC Crossed rows" };
143146 const AxisSpec eventsAxis = {10 , 0 , 10 , " " };
144147 const AxisSpec signAxis = {20 , -10 , 10 , " " };
145148 const AxisSpec nchAxis = {5000 , 0 , 5000 , " Nch" };
146149 const AxisSpec nch1Axis = {1500 , 0 , 1500 , " Nch" };
147150 const AxisSpec nchpAxis = {50000 , 0 , 50000 , " Nch" };
148-
149- std::vector<double > centBining = {0 , 5 , 10 , 20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 , 100 };
150- AxisSpec cent1Axis = {centBining, " Multiplicity percentile from FT0M (%)" };
151+ const AxisSpec cent1Axis{centBining, " Multiplicity percentile from FT0M (%)" };
151152
152153 auto noSubsample = static_cast <int >(cfgNSubsample);
153154 float maxSubsample = 1.0 * noSubsample;
@@ -251,16 +252,37 @@ struct NetchargeFluctuations {
251252 histogramRegistry.add (" subsample/neg_sq" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
252253 histogramRegistry.add (" subsample/posneg" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
253254
255+ histogramRegistry.add (" subsample/gen/pos" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
256+ histogramRegistry.add (" subsample/gen/neg" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
257+ histogramRegistry.add (" subsample/gen/termp" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
258+ histogramRegistry.add (" subsample/gen/termn" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
259+ histogramRegistry.add (" subsample/gen/pos_sq" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
260+ histogramRegistry.add (" subsample/gen/neg_sq" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
261+ histogramRegistry.add (" subsample/gen/posneg" , " " , kTProfile2D , {cent1Axis, subsampleAxis});
262+
263+ histogramRegistry.add (" subsample/delta_eta/pos" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
264+ histogramRegistry.add (" subsample/delta_eta/neg" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
265+ histogramRegistry.add (" subsample/delta_eta/termp" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
266+ histogramRegistry.add (" subsample/delta_eta/termn" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
267+ histogramRegistry.add (" subsample/delta_eta/pos_sq" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
268+ histogramRegistry.add (" subsample/delta_eta/neg_sq" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
269+ histogramRegistry.add (" subsample/delta_eta/posneg" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
270+
271+ histogramRegistry.add (" subsample/delta_eta/gen/pos" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
272+ histogramRegistry.add (" subsample/delta_eta/gen/neg" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
273+ histogramRegistry.add (" subsample/delta_eta/gen/termp" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
274+ histogramRegistry.add (" subsample/delta_eta/gen/termn" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
275+ histogramRegistry.add (" subsample/delta_eta/gen/pos_sq" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
276+ histogramRegistry.add (" subsample/delta_eta/gen/neg_sq" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
277+ histogramRegistry.add (" subsample/delta_eta/gen/posneg" , " " , kTProfile2D , {deltaEtaAxis, subsampleAxis});
278+
254279 if (cfgLoadEff) {
255280 ccdb->setURL (cfgUrlCCDB.value );
256281 ccdb->setCaching (true );
257282 ccdb->setLocalObjectValidityChecking ();
258283
259- // ccdb->setCreatedNotAfter(ccdbNoLaterThan.value);
260- // LOGF(info, "Getting object %s", ccdbPath.value.data());
261-
262284 TList* list = ccdb->getForTimeStamp <TList>(cfgPathCCDB.value , -1 );
263- efficiency = reinterpret_cast <TH2D *>(list->FindObject (" efficiency_Run3" ));
285+ efficiency = reinterpret_cast <TH1D *>(list->FindObject (" efficiency_Run3" ));
264286 if (!efficiency) {
265287 LOGF (info, " FATAL!! Could not find required histograms in CCDB" );
266288 }
@@ -277,8 +299,14 @@ struct NetchargeFluctuations {
277299 if (cSel8Trig && !coll.sel8 ()) {
278300 return false ;
279301 } // require min bias trigger
280- cent = coll.centFT0M (); // centrality for run3
281- mult = coll.multFT0M (); // multiplicity for run3
302+ if (cFT0M) {
303+ cent = coll.centFT0M (); // centrality for run3 using FT0M
304+ mult = coll.multFT0M ();
305+ } else if (cFT0C) {
306+ cent = coll.centFT0C (); // centrality for run3 using FT0C
307+ mult = coll.multFT0C ();
308+ }
309+
282310 } else if constexpr (run == kRun2 ) {
283311 if (cInt7Trig && !coll.alias_bit (kINT7 )) {
284312 return false ;
@@ -358,17 +386,16 @@ struct NetchargeFluctuations {
358386 return true ;
359387 }
360388
361- double getEfficiency (float pt, float eta, TH2D * hEff)
389+ double getEfficiency (float pt, TH1D * hEff)
362390 {
363391 if (!hEff) {
364392 return 1e-6 ;
365393 }
366- int binX = hEff->GetXaxis ()->FindBin (pt);
367- int binY = hEff->GetYaxis ()->FindBin (eta);
368- if (binX < 1 || binX > hEff->GetNbinsX () || binY < 1 || binY > hEff->GetNbinsY ()) {
394+ int bin = hEff->GetXaxis ()->FindBin (pt);
395+ if (bin < 1 || bin > hEff->GetNbinsX ()) {
369396 return 1e-6 ;
370397 }
371- double eff = hEff->GetBinContent (binX, binY );
398+ double eff = hEff->GetBinContent (bin );
372399 return eff;
373400 }
374401
@@ -420,7 +447,7 @@ struct NetchargeFluctuations {
420447 double posWeight = 0 , negWeight = 0 , nchCor = 0 , nchTotalCor = 0 ;
421448 for (const auto & track : tracks) {
422449
423- double eff = getEfficiency (track.pt (), track. eta (), efficiency);
450+ double eff = getEfficiency (track.pt (), efficiency);
424451 if (eff < threshold)
425452 continue ;
426453 double weight = 1.0 / eff;
@@ -490,7 +517,7 @@ struct NetchargeFluctuations {
490517 histogramRegistry.fill (HIST (" QA/cent_hEta" ), cent, track.eta ());
491518 histogramRegistry.fill (HIST (" QA/cent_hPt" ), cent, track.pt ());
492519
493- double eff = getEfficiency (track.pt (), track. eta (), efficiency);
520+ double eff = getEfficiency (track.pt (), efficiency);
494521 if (eff < threshold)
495522 continue ;
496523 double weight = 1.0 / eff;
@@ -574,6 +601,17 @@ struct NetchargeFluctuations {
574601 histogramRegistry.fill (HIST (" gen/cent_nch" ), cent, nchGen);
575602 histogramRegistry.fill (HIST (" gen/nch" ), nchGen);
576603
604+ float lRandom = fRndm ->Rndm ();
605+ int sampleIndex = static_cast <int >(cfgNSubsample * lRandom);
606+
607+ histogramRegistry.fill (HIST (" subsample/gen/pos" ), cent, sampleIndex, posGen);
608+ histogramRegistry.fill (HIST (" subsample/gen/neg" ), cent, sampleIndex, negGen);
609+ histogramRegistry.fill (HIST (" subsample/gen/termp" ), cent, sampleIndex, termPGen);
610+ histogramRegistry.fill (HIST (" subsample/gen/termn" ), cent, sampleIndex, termNGen);
611+ histogramRegistry.fill (HIST (" subsample/gen/pos_sq" ), cent, sampleIndex, posGen * posGen);
612+ histogramRegistry.fill (HIST (" subsample/gen/neg_sq" ), cent, sampleIndex, negGen * negGen);
613+ histogramRegistry.fill (HIST (" subsample/gen/posneg" ), cent, sampleIndex, posNegGen);
614+
577615 } // void
578616
579617 template <RunType run, typename C, typename T>
@@ -593,7 +631,7 @@ struct NetchargeFluctuations {
593631 if (!selTrack (track))
594632 continue ;
595633 nch += 1 ;
596- double eff = getEfficiency (track.pt (), track. eta (), efficiency);
634+ double eff = getEfficiency (track.pt (), efficiency);
597635 if (eff < threshold)
598636 continue ;
599637 double weight = 1.0 / eff;
@@ -630,6 +668,17 @@ struct NetchargeFluctuations {
630668 histogramRegistry.fill (HIST (" data/delta_eta_pos_sq" ), deltaEtaWidth, fpos * fpos);
631669 histogramRegistry.fill (HIST (" data/delta_eta_neg_sq" ), deltaEtaWidth, fneg * fneg);
632670 histogramRegistry.fill (HIST (" data/delta_eta_posneg" ), deltaEtaWidth, posneg);
671+
672+ float lRandom = fRndm ->Rndm ();
673+ int sampleIndex = static_cast <int >(cfgNSubsample * lRandom);
674+
675+ histogramRegistry.fill (HIST (" subsample/delta_eta/pos" ), deltaEtaWidth, sampleIndex, fpos);
676+ histogramRegistry.fill (HIST (" subsample/delta_eta/neg" ), deltaEtaWidth, sampleIndex, fneg);
677+ histogramRegistry.fill (HIST (" subsample/delta_eta/termp" ), deltaEtaWidth, sampleIndex, termp);
678+ histogramRegistry.fill (HIST (" subsample/delta_eta/termn" ), deltaEtaWidth, sampleIndex, termn);
679+ histogramRegistry.fill (HIST (" subsample/delta_eta/pos_sq" ), deltaEtaWidth, sampleIndex, fpos * fpos);
680+ histogramRegistry.fill (HIST (" subsample/delta_eta/neg_sq" ), deltaEtaWidth, sampleIndex, fneg * fneg);
681+ histogramRegistry.fill (HIST (" subsample/delta_eta/posneg" ), deltaEtaWidth, sampleIndex, posneg);
633682 }
634683
635684 template <RunType run, typename C, typename T, typename M, typename P>
@@ -662,7 +711,7 @@ struct NetchargeFluctuations {
662711 continue ;
663712
664713 histogramRegistry.fill (HIST (" data/delta_eta_eta" ), eta);
665- double eff = getEfficiency (track.pt (), eta, efficiency);
714+ double eff = getEfficiency (track.pt (), efficiency);
666715 if (eff < threshold)
667716 continue ;
668717 double weight = 1.0 / eff;
@@ -754,6 +803,17 @@ struct NetchargeFluctuations {
754803 histogramRegistry.fill (HIST (" gen/delta_eta_posneg" ), deltaEtaWidth, posNegGen);
755804 histogramRegistry.fill (HIST (" gen/delta_eta_nch" ), deltaEtaWidth, nchGen);
756805
806+ float lRandom = fRndm ->Rndm ();
807+ int sampleIndex = static_cast <int >(cfgNSubsample * lRandom);
808+
809+ histogramRegistry.fill (HIST (" subsample/delta_eta/gen/pos" ), deltaEtaWidth, sampleIndex, posGen);
810+ histogramRegistry.fill (HIST (" subsample/delta_eta/gen/neg" ), deltaEtaWidth, sampleIndex, negGen);
811+ histogramRegistry.fill (HIST (" subsample/delta_eta/gen/termp" ), deltaEtaWidth, sampleIndex, termPGen);
812+ histogramRegistry.fill (HIST (" subsample/delta_eta/gen/termn" ), deltaEtaWidth, sampleIndex, termNGen);
813+ histogramRegistry.fill (HIST (" subsample/delta_eta/gen/pos_sq" ), deltaEtaWidth, sampleIndex, posGen * posGen);
814+ histogramRegistry.fill (HIST (" subsample/delta_eta/gen/neg_sq" ), deltaEtaWidth, sampleIndex, negGen * negGen);
815+ histogramRegistry.fill (HIST (" subsample/delta_eta/gen/posneg" ), deltaEtaWidth, sampleIndex, posNegGen);
816+
757817 } // void
758818
759819 SliceCache cache;
@@ -771,7 +831,7 @@ struct NetchargeFluctuations {
771831 }
772832 }
773833
774- PROCESS_SWITCH (NetchargeFluctuations, processDataRun3, " Process for Run3 DATA" , true );
834+ PROCESS_SWITCH (NetchargeFluctuations, processDataRun3, " Process for Run3 DATA" , false );
775835
776836 // process function for Data Run2
777837 void processDataRun2 (aod::MyCollisionRun2 const & coll, aod::MyTracks const & tracks)
@@ -799,7 +859,7 @@ struct NetchargeFluctuations {
799859 calculationMcDeltaEta<kRun3 >(coll, inputTracks, mcCollisions, mcParticles, etaMin, etaMax);
800860 }
801861 }
802- PROCESS_SWITCH (NetchargeFluctuations, processMcRun3, " Process reconstructed" , false );
862+ PROCESS_SWITCH (NetchargeFluctuations, processMcRun3, " Process reconstructed" , true );
803863
804864 // process function for MC Run2
805865
0 commit comments