11// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2- // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
2+ // See https://alice-o2.web.cern.ch/copyright for drtails of the copyright holders.
33// All rights not expressly granted are reserved.
44//
55// This software is distributed under the terms of the GNU General Public
@@ -73,7 +73,7 @@ enum Modes {
7373 kPPbar
7474};
7575
76- struct hadronnucleicorrelation {
76+ struct HadronNucleiCorrelation {
7777
7878 static constexpr int betahasTOFthr = -100 ;
7979
@@ -91,10 +91,10 @@ struct hadronnucleicorrelation {
9191
9292 Configurable<std::string> fCorrectionPath {" fCorrectionPath" , " " , " Correction path to file" };
9393 Configurable<std::string> fCorrectionHisto {" fCorrectionHisto" , " " , " Correction histogram" };
94- Configurable<std::string> url {" ccdb-url" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
94+ Configurable<std::string> cfgUrl {" ccdb-url" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
9595
9696 // Event selection
97- Configurable<float > cutzvertex{ " cutzvertex " , 10.0 , " |vertexZ| value limit" };
97+ Configurable<float > cutzVertex{ " cutzVertex " , 10.0 , " |vertexZ| value limit" };
9898
9999 // Track selection
100100 Configurable<double > par0{" par0" , 0.004 , " par 0" };
@@ -122,8 +122,8 @@ struct hadronnucleicorrelation {
122122 Configurable<int > min_itsNCls{" min_itsNCls" , 0 , " minimum allowed number of ITS clasters" };
123123 Configurable<int > maxmixcollsGen{" maxmixcollsGen" , 100 , " maxmixcollsGen" };
124124 Configurable<float > radiusTPC{" radiusTPC" , 1.2 , " TPC radius to calculate phi_star for" };
125- Configurable<float > deta{ " deta " , 0.01 , " minimum allowed defference in eta between two tracks in a pair" };
126- Configurable<float > dphi{ " dphi " , 0.01 , " minimum allowed defference in phi_star between two tracks in a pair" };
125+ Configurable<float > dEta{ " dEta " , 0.01 , " minimum allowed difference in eta between two tracks in a pair" };
126+ Configurable<float > dPhi{ " dPhi " , 0.01 , " minimum allowed difference in phi_star between two tracks in a pair" };
127127
128128 // Mixing parameters
129129 ConfigurableAxis confMultBins{" confMultBins" , {VARIABLE_WIDTH, 0 .0f , 4 .0f , 8 .0f , 12 .0f , 16 .0f , 20 .0f , 24 .0f , 28 .0f , 50 .0f , 100 .0f , 99999 .f }, " Mixing bins - multiplicity" };
@@ -147,12 +147,12 @@ struct hadronnucleicorrelation {
147147 HistogramRegistry QA{" QA" };
148148
149149 using trkType = const FilteredTracks::iterator*;
150- using trkTypeMC = const FilteredTracksMC::iterator*;
150+ // using trkTypeMC = const FilteredTracksMC::iterator*;
151151 // typedef std::shared_ptr<FilteredCollisions::iterator> colType;
152152 // typedef std::shared_ptr<SimCollisions::iterator> MCcolType;
153153
154154 std::unique_ptr<o2::aod::singletrackselector::FemtoPair<trkType>> Pair = std::make_unique<o2::aod::singletrackselector::FemtoPair<trkType>>();
155- std::unique_ptr<o2::aod::singletrackselector::FemtoPair<trkTypeMC>> PairMC = std::make_unique<o2::aod::singletrackselector::FemtoPair<trkTypeMC>>();
155+ // std::unique_ptr<o2::aod::singletrackselector::FemtoPair<trkTypeMC>> PairMC = std::make_unique<o2::aod::singletrackselector::FemtoPair<trkTypeMC>>();
156156
157157 // Data histograms
158158 std::vector<std::shared_ptr<TH3>> hEtaPhi_SE;
@@ -173,7 +173,7 @@ struct hadronnucleicorrelation {
173173
174174 void init (o2::framework::InitContext&)
175175 {
176- ccdb->setURL (url .value );
176+ ccdb->setURL (cfgUrl .value );
177177 ccdb->setCaching (true );
178178 ccdb->setLocalObjectValidityChecking ();
179179 ccdb->setCreatedNotAfter (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count ());
@@ -207,25 +207,25 @@ struct hadronnucleicorrelation {
207207
208208 TString name = " AntiDeAntiPr" ;
209209 switch (mode) {
210- case 1 :
210+ case kDP :
211211 name = " DePr" ;
212212 break ;
213- case 2 :
213+ case kDbarP :
214214 name = " AntiDePr" ;
215215 break ;
216- case 3 :
216+ case kDPbar :
217217 name = " DeAntiPr" ;
218218 break ;
219- case 4 :
219+ case kPbarP :
220220 name = " AntiPrPr" ;
221221 break ;
222- case 5 :
222+ case kPbarPbar :
223223 name = " AntiPrAntiPr" ;
224224 break ;
225- case 6 :
225+ case kPP :
226226 name = " PrPr" ;
227227 break ;
228- case 7 :
228+ case kPPbar :
229229 name = " PrAntiPr" ;
230230 break ;
231231 }
@@ -283,7 +283,7 @@ struct hadronnucleicorrelation {
283283 QA.add (" QA/hnSigmaTOFVsPt_De" , " n#sigma TOF vs p_{T} for d hypothesis (all tracks); p_{T} (GeV/c); n#sigma TOF" , {HistType::kTH2D , {pTAxis, AxisNSigma}});
284284 QA.add (" QA/hnSigmaITSVsPt_Pr" , " n#sigma ITS vs p_{T} for p hypothesis (all tracks); p_{T} (GeV/c); n#sigma ITS" , {HistType::kTH2D , {pTAxis, AxisNSigma}});
285285 QA.add (" QA/hnSigmaITSVsPt_De" , " n#sigma ITS vs p_{T} for d hypothesis (all tracks); p_{T} (GeV/c); n#sigma ITS" , {HistType::kTH2D , {pTAxis, AxisNSigma}});
286- QA.add (" QA/hdetadphistar " , " ;dphi*;deta " , {HistType::kTH2D , {{101 , -0.2 , 0.2 , " dphi *" }, {101 , -0.2 , 0.2 , " deta " }}});
286+ QA.add (" QA/hdEtadPhistar " , " ;dPhi*;dEta " , {HistType::kTH2D , {{101 , -0.2 , 0.2 , " dPhi *" }, {101 , -0.2 , 0.2 , " dEta " }}});
287287
288288 if (!isMC) {
289289 QA.add (" QA/hEtaPr" , Form (" #eta ditribution for p" ), {HistType::kTH1F , {etaAxis}});
@@ -415,7 +415,7 @@ struct hadronnucleicorrelation {
415415 }
416416
417417 // Filters
418- Filter vertexFilter = nabs(o2::aod::singletrackselector::posZ) <= cutzvertex ;
418+ Filter vertexFilter = nabs(o2::aod::singletrackselector::posZ) <= cutzVertex ;
419419 Filter trackFilter = o2::aod::singletrackselector::tpcNClsFound >= min_TPC_nClusters &&
420420 o2::aod::singletrackselector::unPack<singletrackselector::binning::chi2>(o2::aod::singletrackselector::storedTpcChi2NCl) <= max_chi2_TPC &&
421421 o2::aod::singletrackselector::unPack<singletrackselector::binning::rowsOverFindable>(o2::aod::singletrackselector::storedTpcCrossedRowsOverFindableCls) >= min_TPC_nCrossedRowsOverFindableCls &&
@@ -560,8 +560,8 @@ struct hadronnucleicorrelation {
560560 {
561561 Pair->SetPair (&part0, &part1);
562562 Pair->SetIdentical (isIdentical);
563- if (isIdentical && Pair->IsClosePair (deta, dphi , radiusTPC)) {
564- QA.fill (HIST (" QA/hdetadphistar " ), Pair->GetPhiStarDiff (radiusTPC), Pair->GetEtaDiff ());
563+ if (isIdentical && Pair->IsClosePair (dEta, dPhi , radiusTPC)) {
564+ QA.fill (HIST (" QA/hdEtadPhistar " ), Pair->GetPhiStarDiff (radiusTPC), Pair->GetEtaDiff ());
565565 return ;
566566 }
567567
@@ -684,7 +684,7 @@ struct hadronnucleicorrelation {
684684 void processSameEvent (FilteredCollisions::iterator const & collision, FilteredTracks const & tracks)
685685 {
686686
687- if (std::abs (collision.posZ ()) > cutzvertex )
687+ if (std::abs (collision.posZ ()) > cutzVertex )
688688 return ;
689689
690690 registry.fill (HIST (" hNEvents" ), 0.5 );
@@ -757,6 +757,9 @@ struct hadronnucleicorrelation {
757757 }
758758 }
759759
760+ Pair->SetMagField1 (collision.magField ());
761+ Pair->SetMagField2 (collision.magField ());
762+
760763 if (mode == kPbarPbar || mode == kPP ) { // Identical particle combinations
761764
762765 for (const auto & [part0, part1] : combinations (CombinationsStrictlyUpperIndexPolicy (tracks, tracks))) {
@@ -853,7 +856,7 @@ struct hadronnucleicorrelation {
853856 }
854857 }
855858 }
856- PROCESS_SWITCH (hadronnucleicorrelation , processSameEvent, " processSameEvent" , true );
859+ PROCESS_SWITCH (HadronNucleiCorrelation , processSameEvent, " processSameEvent" , true );
857860
858861 void processMixedEvent (FilteredCollisions const & collisions, FilteredTracks const & tracks)
859862 {
@@ -872,6 +875,9 @@ struct hadronnucleicorrelation {
872875 continue ;
873876 }
874877
878+ Pair->SetMagField1 (magFieldTesla1);
879+ Pair->SetMagField2 (magFieldTesla2);
880+
875881 for (const auto & [part0, part1] : combinations (CombinationsFullIndexPolicy (groupPartsOne, groupPartsTwo))) {
876882
877883 if (part0.tpcFractionSharedCls () > max_tpcSharedCls)
@@ -946,12 +952,12 @@ struct hadronnucleicorrelation {
946952 }
947953 }
948954 }
949- PROCESS_SWITCH (hadronnucleicorrelation , processMixedEvent, " processMixedEvent" , true );
955+ PROCESS_SWITCH (HadronNucleiCorrelation , processMixedEvent, " processMixedEvent" , true );
950956
951957 void processMC (FilteredCollisions const &, FilteredTracksMC const & tracks)
952958 {
953959 for (const auto & track : tracks) {
954- if (std::abs (track.template singleCollSel_as <FilteredCollisions>().posZ ()) > cutzvertex )
960+ if (std::abs (track.template singleCollSel_as <FilteredCollisions>().posZ ()) > cutzVertex )
955961 continue ;
956962
957963 if (track.tpcFractionSharedCls () > max_tpcSharedCls)
@@ -1312,12 +1318,12 @@ struct hadronnucleicorrelation {
13121318 }
13131319 } // track
13141320 }
1315- PROCESS_SWITCH (hadronnucleicorrelation , processMC, " processMC" , false );
1321+ PROCESS_SWITCH (HadronNucleiCorrelation , processMC, " processMC" , false );
13161322
13171323 void processSameEventGen (SimCollisions::iterator const & mcCollision, SimParticles const & mcParticles)
13181324 {
13191325
1320- if (std::abs (mcCollision.posZ ()) > cutzvertex )
1326+ if (std::abs (mcCollision.posZ ()) > cutzVertex )
13211327 return ;
13221328
13231329 registry.fill (HIST (" Generated/hNEventsMC" ), 0.5 );
@@ -1439,14 +1445,14 @@ struct hadronnucleicorrelation {
14391445 }
14401446 }
14411447 }
1442- PROCESS_SWITCH (hadronnucleicorrelation , processSameEventGen, " processSameEventGen" , false );
1448+ PROCESS_SWITCH (HadronNucleiCorrelation , processSameEventGen, " processSameEventGen" , false );
14431449
14441450 void processMixedEventGen (SimCollisions const & mcCollisions, SimParticles const & mcParticles)
14451451 {
14461452
14471453 for (const auto & [collision1, collision2] : soa::selfCombinations (colBinningGen, 5 , -1 , mcCollisions, mcCollisions)) {
14481454
1449- // LOGF(info, "Mixed event collisions: (%d, %d) zvtx (%.1f, %.1f) mult (%d, %d)", collision1.globalIndex(), collision2.globalIndex(), collision1.posZ(), collision2.posZ(), collision1.mult (), collision2.mult ());
1455+ // LOGF(info, "Mixed event collisions: (%d, %d) zvtx (%.1f, %.1f) mult (%d, %d)", collision1.globalIndex(), collision2.globalIndex(), collision1.posZ(), collision2.posZ(), collision1.multMCNParticlesEta05 (), collision2.multMCNParticlesEta05 ());
14501456
14511457 auto groupPartsOne = mcParticles.sliceByCached (o2::aod::mcparticle::mcCollisionId, collision1.globalIndex (), cache);
14521458 auto groupPartsTwo = mcParticles.sliceByCached (o2::aod::mcparticle::mcCollisionId, collision2.globalIndex (), cache);
@@ -1506,10 +1512,10 @@ struct hadronnucleicorrelation {
15061512 }
15071513 }
15081514 }
1509- PROCESS_SWITCH (hadronnucleicorrelation , processMixedEventGen, " processMixedEventGen" , false );
1515+ PROCESS_SWITCH (HadronNucleiCorrelation , processMixedEventGen, " processMixedEventGen" , false );
15101516};
15111517
15121518WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
15131519{
1514- return WorkflowSpec{adaptAnalysisTask<hadronnucleicorrelation >(cfgc)};
1520+ return WorkflowSpec{adaptAnalysisTask<HadronNucleiCorrelation >(cfgc)};
15151521}
0 commit comments