1919#include " Common/CCDB/EventSelectionParams.h"
2020#include " Common/DataModel/Centrality.h"
2121#include " Common/DataModel/EventSelection.h"
22- #include " Common/DataModel/Multiplicity.h"
2322#include " Common/DataModel/PIDResponseTOF.h"
2423#include " Common/DataModel/PIDResponseTPC.h"
2524#include " Common/DataModel/Qvectors.h"
2625#include " Common/DataModel/TrackSelectionTables.h"
2726
2827#include < CCDB/BasicCCDBManager.h>
29- #include < CCDB/CcdbApi.h>
3028#include < CommonConstants/MathConstants.h>
3129#include < CommonConstants/PhysicsConstants.h>
3230#include < Framework/AnalysisDataModel.h>
33- #include < Framework/AnalysisHelpers.h>
3431#include < Framework/AnalysisTask.h>
3532#include < Framework/Configurable.h>
3633#include < Framework/HistogramRegistry.h>
34+ #include < Framework/HistogramSpec.h>
3735#include < Framework/InitContext.h>
3836#include < Framework/OutputObjHeader.h>
3937#include < Framework/Logger.h>
4038#include < Framework/runDataProcessing.h>
4139
42- #include < Math/Vector4D.h>
4340#include < TVector2.h>
4441#include < TRandom.h>
42+ #include < TLorentzVector.h>
4543
4644#include < cmath>
47- #include < cstdint>
4845#include < string>
4946#include < vector>
5047
@@ -68,6 +65,10 @@ struct Cha01710analysis {
6865
6966 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
7067
68+ Service<o2::ccdb::BasicCCDBManager> ccdb;
69+
70+ Configurable<std::string> cfgUrl{" cfgUrl" , " http://alice-ccdb.cern.ch" , " CCDB URL" };
71+
7172 struct : ConfigurableGroup {
7273 Configurable<int > cfgCentEst{" cfgCentEst" , 1 , " 0: FT0C, 1: FT0M" };
7374 Configurable<float > cfgZVertexMax{" cfgZVertexMax" , 10 .f , " maximum |zPV| (cm)" };
@@ -208,6 +209,11 @@ struct Cha01710analysis {
208209 if (epConfig.cfgQvecHarmonic < minHarm) {
209210 LOGF (fatal, " cfgQvecHarmonic must be >= 2" );
210211 }
212+
213+ ccdb->setURL (cfgUrl.value );
214+ ccdb->setCaching (true );
215+ ccdb->setLocalObjectValidityChecking ();
216+ ccdb->setCreatedNotAfter (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count ());
211217 }
212218
213219 template <typename C>
@@ -345,24 +351,25 @@ struct Cha01710analysis {
345351
346352 float relPhi = TVector2::Phi_0_2pi ((mother.Phi () - eventPlaneDet) * harmonic);
347353 histos.fill (HIST (" Pair/hMassVsK0SMass" ), mother.M (), v0.mK0Short ());
348- if (region == kSignal ) {
354+ if (region != kSignal )
355+ continue ;
356+ if (track.sign () > 0 ) {
357+ histos.fill (HIST (" Pair/hSignalPlus" ), mother.M (), mother.Pt (), centrality, relPhi);
358+ } else if (track.sign () < 0 ) {
359+ histos.fill (HIST (" Pair/hSignalMinus" ), mother.M (), mother.Pt (), centrality, relPhi);
360+ }
361+ for (int i = 0 ; i < cfgNRotations; ++i) {
362+ auto randomPhi = rn->Uniform (o2::constants::math::PI * rotmin, o2::constants::math::PI * rotmax);
363+ randomPhi += kaon.Phi ();
364+ auto kaonRot = ROOT::Math::PxPyPzMVector (kaon.Pt () * std::cos (randomPhi), kaon.Pt () * std::sin (randomPhi), track.pz (), o2::constants::physics::MassKaonCharged);
365+ auto motherRot = k0 + kaonRot;
366+ if (std::abs (motherRot.Rapidity ()) > cfgMotherRapidityMax)
367+ continue ;
368+
349369 if (track.sign () > 0 ) {
350- histos.fill (HIST (" Pair/hSignalPlus " ), mother .M (), mother .Pt (), centrality, relPhi );
370+ histos.fill (HIST (" Pair/hRotatedPlus " ), motherRot .M (), motherRot .Pt (), centrality);
351371 } else if (track.sign () < 0 ) {
352- histos.fill (HIST (" Pair/hSignalMinus" ), mother.M (), mother.Pt (), centrality, relPhi);
353- }
354- for (int i = 0 ; i < cfgNRotations; ++i) {
355- auto randomPhi = rn->Uniform (o2::constants::math::PI * rotmin, o2::constants::math::PI * rotmax);
356- randomPhi += kaon.Phi ();
357- auto kaonRot = ROOT::Math::PxPyPzMVector (kaon.Pt () * std::cos (randomPhi), kaon.Pt () * std::sin (randomPhi), track.pz (), o2::constants::physics::MassKaonCharged);
358- auto motherRot = k0 + kaonRot;
359- if (std::abs (motherRot.Rapidity ()) < cfgMotherRapidityMax) {
360- if (track.sign () > 0 ) {
361- histos.fill (HIST (" Pair/hRotatedPlus" ), motherRot.M (), motherRot.Pt (), centrality);
362- } else if (track.sign () < 0 ) {
363- histos.fill (HIST (" Pair/hRotatedMinus" ), motherRot.M (), motherRot.Pt (), centrality);
364- }
365- }
372+ histos.fill (HIST (" Pair/hRotatedMinus" ), motherRot.M (), motherRot.Pt (), centrality);
366373 }
367374 }
368375 }
0 commit comments