Skip to content

Commit 363203f

Browse files
committed
[PWGCF]Add files for q2 calculation
1 parent 329d23c commit 363203f

File tree

1 file changed

+193
-0
lines changed

1 file changed

+193
-0
lines changed

PWGCF/Flow/Tasks/flowEseCorre.cxx

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
// 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.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
// C++/ROOT includes.
13+
#include <chrono>
14+
#include <string>
15+
#include <vector>
16+
#include <TComplex.h>
17+
#include <TH1F.h>
18+
#include <TH2D.h>
19+
#include <TMath.h>
20+
#include <TVector2.h>
21+
22+
// o2Physics includes.
23+
#include "Framework/AnalysisDataModel.h"
24+
#include "Framework/AnalysisTask.h"
25+
#include "Framework/ASoAHelpers.h"
26+
#include "Framework/HistogramRegistry.h"
27+
#include "Framework/runDataProcessing.h"
28+
#include "Framework/RunningWorkflowInfo.h"
29+
#include "Framework/StaticFor.h"
30+
31+
#include "Common/DataModel/Qvectors.h"
32+
#include "Common/DataModel/EventSelection.h"
33+
#include "Common/DataModel/TrackSelectionTables.h"
34+
#include "Common/DataModel/Centrality.h"
35+
#include "Common/Core/EventPlaneHelper.h"
36+
#include "Common/Core/TrackSelection.h"
37+
38+
#include "CommonConstants/PhysicsConstants.h"
39+
40+
// o2 includes.
41+
42+
using namespace o2;
43+
using namespace o2::framework;
44+
45+
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::FT0sCorrected,
46+
aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As, aod::QvectorFT0CVecs, aod::QvectorTPCposVecs, aod::QvectorTPCnegVecs, aod::QvectorFT0Cs>;
47+
using MyTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TrackSelectionExtension>;
48+
using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;
49+
50+
struct flowEseCorre
51+
{
52+
HistogramRegistry histosQA{"histosQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, false};
53+
54+
Configurable<std::vector<int>> cfgnMods{"cfgnMods", {2}, "Modulation of interest"};
55+
Configurable<std::string> cfgDetName{"cfgDetName", "FT0C", "The name of detector to be analyzed"};
56+
Configurable<std::string> cfgRefAName{"cfgRefAName", "TPCpos", "The name of detector for reference A"};
57+
Configurable<std::string> cfgRefBName{"cfgRefBName", "TPCneg", "The name of detector for reference B"};
58+
59+
Configurable<float> cfgMinPt{"cfgMinPt", 0.15, "Minimum transverse momentum for charged track"};
60+
Configurable<float> cfgMaxEta{"cfgMaxEta", 0.8, "Maximum pseudorapidiy for charged track"};
61+
Configurable<float> cfgMaxDCArToPVcut{"cfgMaxDCArToPVcut", 0.1, "Maximum transverse DCA"};
62+
Configurable<float> cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 1.0, "Maximum longitudinal DCA"};
63+
64+
ConfigurableAxis cfgaxisQvecF{"cfgaxisQvecF", {300, -1, 1}, ""};
65+
ConfigurableAxis cfgaxisQvec{"cfgaxisQvec", {100, -3, 3}, ""};
66+
ConfigurableAxis cfgaxisCent{"cfgaxisCent", {100, 0, 100}, ""};
67+
68+
ConfigurableAxis cfgaxiscos{"cfgaxiscos", {102, -1.02, 1.02}, ""};
69+
ConfigurableAxis cfgaxispt{"cfgaxispt", {100, 0, 10}, ""};
70+
ConfigurableAxis cfgaxisCentMerged{"cfgaxisCentMerged", {20, 0, 100}, ""};
71+
ConfigurableAxis cfgaxisMultnum{"cfgaxisMultnum", {300, 0, 3000}, ""};
72+
73+
EventPlaneHelper helperEP;
74+
75+
void init(InitContext const &)
76+
{
77+
AxisSpec axisCent{cfgaxisCent, "centrality"};
78+
AxisSpec axisQvec{cfgaxisQvec, "Q"};
79+
AxisSpec axisQvecF{cfgaxisQvecF, "Q"};
80+
AxisSpec axisEvtPl = {100, -1.0 * constants::math::PI, constants::math::PI};
81+
82+
AxisSpec axisCos{cfgaxiscos, "angle function"};
83+
AxisSpec axisPt{cfgaxispt, "trasverse momentum"};
84+
AxisSpec axisCentMerged{cfgaxisCentMerged, "merged centrality"};
85+
AxisSpec axisMultnum{cfgaxisMultnum, "statistic of mult"};
86+
87+
histosQA.add(Form("histQvecV2"), "", {HistType::kTH3F, {axisQvecF, axisQvecF, axisCent}});
88+
histosQA.add(Form("histEvtPlV2"), "", {HistType::kTH2F, {axisEvtPl, axisCent}});
89+
histosQA.add(Form("histQvecRes_SigRefAV2"), "", {HistType::kTH2F, {axisQvecF, axisCent}});
90+
histosQA.add(Form("histCosDetV2"), "", {HistType::kTH3F, {axisCentMerged, axisPt, axisCos}});
91+
histosQA.add(Form("histMult_Cent"), "", {HistType::kTH2F, {axisMultnum, axisCent}});
92+
}
93+
94+
template <typename CollType>
95+
bool SelEvent(const CollType &collision)
96+
{
97+
if (!collision.sel8())
98+
{
99+
return 0;
100+
}
101+
if (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))
102+
{
103+
return 0;
104+
}
105+
if (!collision.selection_bit(aod::evsel::kNoSameBunchPileup))
106+
{
107+
return 0;
108+
}
109+
if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))
110+
{
111+
return 0;
112+
}
113+
114+
return 1;
115+
}
116+
117+
template <typename TrackType>
118+
bool SelTrack(const TrackType track)
119+
{
120+
if (track.pt() < cfgMinPt)
121+
return false;
122+
if (std::abs(track.eta()) > cfgMaxEta)
123+
return false;
124+
if (!track.passedITSNCls())
125+
return false;
126+
if (!track.passedITSChi2NDF())
127+
return false;
128+
if (!track.passedITSHits())
129+
return false;
130+
if (!track.passedTPCCrossedRowsOverNCls())
131+
return false;
132+
if (!track.passedTPCChi2NDF())
133+
return false;
134+
if (!track.passedDCAxy())
135+
return false;
136+
if (!track.passedDCAz())
137+
return false;
138+
139+
return true;
140+
}
141+
142+
template <typename CollType>
143+
void fillHistosQvec(const CollType &collision, int nmode)
144+
{
145+
if (nmode == 2)
146+
{
147+
histosQA.fill(HIST("histQvecV2"), collision.qvecFT0CReVec()[0], collision.qvecFT0CImVec()[0], collision.centFT0C());
148+
histosQA.fill(HIST("histEvtPlV2"), helperEP.GetEventPlane(collision.qvecFT0CReVec()[0], collision.qvecFT0CImVec()[0], nmode), collision.centFT0C());
149+
histosQA.fill(HIST("histQvecRes_SigRefAV2"), helperEP.GetResolution(helperEP.GetEventPlane(collision.qvecFT0CReVec()[0], collision.qvecFT0CImVec()[0], nmode), helperEP.GetEventPlane(collision.qvecTPCposReVec()[0], collision.qvecTPCposImVec()[0], nmode), nmode), collision.centFT0C());
150+
histosQA.fill(HIST("histMult_Cent"), collision.sumAmplFT0C(), collision.centFT0C());
151+
}
152+
}
153+
154+
template <typename CollType, typename TrackType>
155+
void fillHistosFlow(const CollType &collision, const TrackType &track, int nmode)
156+
{
157+
if (collision.sumAmplFT0C() < 1e-4)
158+
{
159+
return;
160+
}
161+
for (auto &trk : track)
162+
{
163+
if (!SelTrack(trk))
164+
{
165+
continue;
166+
}
167+
if (nmode == 2)
168+
{
169+
histosQA.fill(HIST("histCosDetV2"), collision.centFT0C(), trk.pt(),
170+
std::cos(static_cast<float>(nmode) * (trk.phi() - helperEP.GetEventPlane(collision.qvecFT0CReVec()[0], collision.qvecFT0CImVec()[0], nmode))));
171+
}
172+
}
173+
}
174+
175+
void process(MyCollisions::iterator const &collision, MyTracks const &tracks)
176+
{
177+
if (!SelEvent(collision))
178+
{
179+
return;
180+
}
181+
for (std::size_t i = 0; i < cfgnMods->size(); i++)
182+
{
183+
fillHistosQvec(collision, cfgnMods->at(i));
184+
fillHistosFlow(collision, tracks, cfgnMods->at(i));
185+
}
186+
}
187+
};
188+
189+
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
190+
{
191+
return WorkflowSpec{
192+
adaptAnalysisTask<qVectorstutorial>(cfgc)};
193+
}

0 commit comments

Comments
 (0)