88// In applying this license CERN does not waive the privileges and immunities
99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
11+
1112// / \author Maxim Virta (maxim.virta@cern.ch)
1213// / \since Jul 2024
14+ // / \brief task for flow measurement
15+ // / \file jEPFlowAnalysis.cxx
1316
1417#include " JEPFlowAnalysis.h"
1518
@@ -45,7 +48,7 @@ struct jEPFlowAnalysis {
4548 JEPFlowAnalysis epAnalysis;
4649 EventPlaneHelper helperEP;
4750 FlowJHistManager histManager;
48- Bool_t debug = kFALSE ;
51+ bool debug = kFALSE ;
4952 Service<o2::ccdb::BasicCCDBManager> ccdb;
5053 o2::ccdb::CcdbApi ccdbApi;
5154
@@ -59,6 +62,8 @@ struct jEPFlowAnalysis {
5962 Configurable<bool > cfgAddEvtSel{" cfgAddEvtSel" , true , " Use event selection" };
6063 Configurable<int > cfgnTotalSystem{" cfgnTotalSystem" , 7 , " Total number of detectors in qVectorsTable" };
6164
65+ Configurable<int > cfgNmode{" cfgNmode" , 1 , " the number of modulations to be calculated" };
66+
6267 Configurable<bool > cfgShiftCorr{" cfgShiftCorr" , false , " additional shift correction" };
6368 Configurable<std::string> cfgShiftPath{" cfgShiftPath" , " Users/j/junlee/Qvector/QvecCalib/Shift" , " Path for Shift" };
6469 Configurable<bool > cfgSPmethod{" cfgSPmethod" , false , " flag for scalar product" };
@@ -77,6 +82,9 @@ struct jEPFlowAnalysis {
7782 int currentRunNumber = -999 ;
7883 int lastRunNumber = -999 ;
7984
85+ int nshift = 10 ;
86+ int nsystem = 3 ;
87+
8088 std::vector<TProfile3D*> shiftprofile{};
8189 std::string fullCCDBShiftCorrPath;
8290
@@ -126,7 +134,7 @@ struct jEPFlowAnalysis {
126134 currentRunNumber = bc.runNumber ();
127135 if (currentRunNumber != lastRunNumber) {
128136 shiftprofile.clear ();
129- for (int i = 2 ; i < 5 ; i++) {
137+ for (int i = 2 ; i < 2 + cfgNmode ; i++) {
130138 fullCCDBShiftCorrPath = cfgShiftPath;
131139 fullCCDBShiftCorrPath += " /v" ;
132140 fullCCDBShiftCorrPath += std::to_string (i);
@@ -137,7 +145,7 @@ struct jEPFlowAnalysis {
137145 }
138146 }
139147
140- for (int i = 2 ; i < 5 ; i++) { // loop over different harmonic orders
148+ for (int i = 2 ; i < 2 + cfgNmode ; i++) { // loop over different harmonic orders
141149 harmInd = cfgnTotalSystem * 4 * (i - 2 ) + 3 ; // harmonic index to access corresponding Q-vector as all Q-vectors are in same vector
142150 EPs[0 ] = helperEP.GetEventPlane (coll.qvecRe ()[DetId + harmInd], coll.qvecIm ()[DetId + harmInd], i);
143151 EPs[1 ] = helperEP.GetEventPlane (coll.qvecRe ()[RefAId + harmInd], coll.qvecIm ()[RefAId + harmInd], i);
@@ -150,7 +158,7 @@ struct jEPFlowAnalysis {
150158 float weight = 1.0 ;
151159
152160 if (cfgShiftCorr) {
153- for (int ishift = 1 ; ishift <= 10 ; ishift++) {
161+ for (int ishift = 1 ; ishift <= nshift ; ishift++) {
154162 auto coeffshiftxDet = shiftprofile.at (i - 2 )->GetBinContent (shiftprofile.at (i - 2 )->FindBin (cent, 0.5 , ishift - 0.5 ));
155163 auto coeffshiftyDet = shiftprofile.at (i - 2 )->GetBinContent (shiftprofile.at (i - 2 )->FindBin (cent, 1.5 , ishift - 0.5 ));
156164 auto coeffshiftxRefA = shiftprofile.at (i - 2 )->GetBinContent (shiftprofile.at (i - 2 )->FindBin (cent, 2.5 , ishift - 0.5 ));
@@ -169,14 +177,14 @@ struct jEPFlowAnalysis {
169177 }
170178
171179 if (cfgSPmethod)
172- weight *= sqrt (pow (coll.qvecRe ()[DetId + harmInd], 2 ) + pow (coll.qvecIm ()[DetId + harmInd], 2 ));
180+ weight *= std:: sqrt (std:: pow (coll.qvecRe ()[DetId + harmInd], 2 ) + std:: pow (coll.qvecIm ()[DetId + harmInd], 2 ));
173181
174182 float resNumA = helperEP.GetResolution (EPs[0 ], EPs[1 ], i);
175183 float resNumB = helperEP.GetResolution (EPs[0 ], EPs[2 ], i);
176184 float resDenom = helperEP.GetResolution (EPs[1 ], EPs[2 ], i);
177185 epAnalysis.FillResolutionHistograms (cent, static_cast <float >(i), resNumA, resNumB, resDenom);
178- for (uint j = 0 ; j < 3 ; j++) { // loop over detectors used
179- for (auto & track : tracks) {
186+ for (uint j = 0 ; j < nsystem ; j++) { // loop over detectors used
187+ for (const auto & track : tracks) {
180188 float vn = std::cos ((i) * (track.phi () - EPs[j]));
181189 float vn_sin = std::sin ((i) * (track.phi () - EPs[j]));
182190 epAnalysis.FillVnHistograms (i, cent, static_cast <float >(j + 1 ), track.pt (), vn * weight, vn_sin * weight);
0 commit comments