17
17
18
18
#include < experimental/type_traits>
19
19
#include " JHistManager.h"
20
+ #include " JQVectors.h"
20
21
#include < TComplex.h>
21
22
#include < tuple>
22
23
@@ -82,26 +83,34 @@ class JFFlucAnalysis
82
83
flags |= _flags;
83
84
}
84
85
86
+ enum { kH0 ,
87
+ kH1 ,
88
+ kH2 ,
89
+ kH3 ,
90
+ kH4 ,
91
+ kH5 ,
92
+ kH6 ,
93
+ kH7 ,
94
+ kH8 ,
95
+ kH9 ,
96
+ kH10 ,
97
+ kH11 ,
98
+ kH12 ,
99
+ kNH }; // harmonics
100
+ enum { kK0 ,
101
+ kK1 ,
102
+ kK2 ,
103
+ kK3 ,
104
+ kK4 ,
105
+ nKL }; // order
106
+ using JQVectorsT = JQVectors<TComplex, kNH , nKL, true >;
107
+ inline void SetJQVectors (const JQVectorsT* _pqvecs) { pqvecs = _pqvecs; }
108
+
85
109
template <class T >
86
110
using hasWeightNUA = decltype(std::declval<T&>().weightNUA());
87
111
template <class T >
88
112
using hasWeightEff = decltype(std::declval<T&>().weightEff());
89
113
90
- template <class JInputClassIter >
91
- inline std::tuple<double , double > GetWeights (const JInputClassIter& track)
92
- {
93
- Double_t phiNUACorr, effCorr;
94
- if constexpr (std::experimental::is_detected<hasWeightNUA, const JInputClassIter>::value)
95
- phiNUACorr = track.weightNUA ();
96
- else
97
- phiNUACorr = 1.0 ;
98
- if constexpr (std::experimental::is_detected<hasWeightEff, const JInputClassIter>::value)
99
- effCorr = track.weightEff ();
100
- else
101
- effCorr = 1.0 ;
102
- return {phiNUACorr, effCorr};
103
- }
104
-
105
114
template <class JInputClass >
106
115
inline void FillQA (JInputClass& inputInst)
107
116
{
@@ -122,76 +131,24 @@ class JFFlucAnalysis
122
131
if (TMath::Abs (track.eta ()) < fEta_min || TMath::Abs (track.eta ()) > fEta_max )
123
132
continue ;
124
133
125
- auto [phiNUACorr, effCorr] = GetWeights<const typename JInputClass::iterator>(track);
126
- Double_t effCorrInv = 1.0 / effCorr;
127
- fh_eta[fCBin ]->Fill (track.eta (), effCorrInv);
128
- fh_pt[fCBin ]->Fill (track.pt (), effCorrInv);
129
- fh_phi[fCBin ][(UInt_t)(track.eta () > 0.0 )]->Fill (track.phi (), effCorrInv / phiNUACorr);
134
+ Double_t corrInv = 1.0 ;
135
+ using JInputClassIter = typename JInputClass::iterator;
136
+ if constexpr (std::experimental::is_detected<hasWeightEff, const JInputClassIter>::value)
137
+ corrInv /= track.weightEff ();
138
+ fh_eta[fCBin ]->Fill (track.eta (), corrInv);
139
+ fh_pt[fCBin ]->Fill (track.pt (), corrInv);
140
+ if constexpr (std::experimental::is_detected<hasWeightNUA, const JInputClassIter>::value)
141
+ corrInv /= track.weightNUA ();
142
+ fh_phi[fCBin ][(UInt_t)(track.eta () > 0.0 )]->Fill (track.phi (), corrInv);
130
143
}
131
144
132
145
for (UInt_t iaxis = 0 ; iaxis < 3 ; iaxis++)
133
146
fh_vertex[iaxis]->Fill (fVertex [iaxis]);
134
- };
135
-
136
- #define NK nKL // avoid cpplint "variable size array" error when in reality it is fixed size TComplex q[nKL]
137
- template <class JInputClass >
138
- inline void CalculateQvectorsQC (JInputClass& inputInst)
139
- {
140
- // calculate Q-vector for QC method ( no subgroup )
141
- for (UInt_t ih = 0 ; ih < kNH ; ih++) {
142
- for (UInt_t ik = 0 ; ik < nKL; ++ik) {
143
- QvectorQC[ih][ik] = TComplex (0 , 0 );
144
- for (UInt_t isub = 0 ; isub < 2 ; isub++)
145
- QvectorQCgap[isub][ih][ik] = TComplex (0 , 0 );
146
- }
147
- } // for max harmonics
148
- for (auto & track : inputInst) {
149
- // pt cuts already applied in task.
150
- if (track.eta () < -fEta_max || track.eta () > fEta_max )
151
- continue ;
152
-
153
- auto [phiNUACorr, effCorr] = GetWeights<const typename JInputClass::iterator>(track);
154
-
155
- UInt_t isub = (UInt_t)(track.eta () > 0.0 );
156
- for (UInt_t ih = 0 ; ih < kNH ; ih++) {
157
- Double_t tf = 1.0 ;
158
- TComplex q[NK];
159
- for (UInt_t ik = 0 ; ik < nKL; ik++) {
160
- q[ik] = TComplex (tf * TMath::Cos (ih * track.phi ()), tf * TMath::Sin (ih * track.phi ()));
161
- QvectorQC[ih][ik] += q[ik];
162
-
163
- if (TMath::Abs (track.eta ()) > fEta_min )
164
- QvectorQCgap[isub][ih][ik] += q[ik];
165
-
166
- tf *= 1.0 / (phiNUACorr * effCorr);
167
- }
168
- }
169
- }
170
- };
147
+ }
171
148
172
149
static Double_t pttJacek[74 ];
173
150
static UInt_t NpttJacek;
174
151
175
- enum { kH0 ,
176
- kH1 ,
177
- kH2 ,
178
- kH3 ,
179
- kH4 ,
180
- kH5 ,
181
- kH6 ,
182
- kH7 ,
183
- kH8 ,
184
- kH9 ,
185
- kH10 ,
186
- kH11 ,
187
- kH12 ,
188
- kNH }; // harmonics
189
- enum { kK0 ,
190
- kK1 ,
191
- kK2 ,
192
- kK3 ,
193
- kK4 ,
194
- nKL }; // order
195
152
#define kcNH kH6 // max second dimension + 1
196
153
private:
197
154
const Double_t* fVertex ; // !
@@ -209,8 +166,7 @@ class JFFlucAnalysis
209
166
Double_t fEta_min ;
210
167
Double_t fEta_max ;
211
168
212
- TComplex QvectorQC[kNH ][nKL];
213
- TComplex QvectorQCgap[2 ][kNH ][nKL]; // ksub
169
+ const JQVectorsT* pqvecs;
214
170
215
171
JHistManager* fHMG ; // !
216
172
0 commit comments