@@ -193,11 +193,11 @@ template <const char* prefix>
193193class ClosePairRejectionTrackTrack
194194{
195195 public:
196- void init (o2::framework::HistogramRegistry* registry, std::map<CprHist, std::vector<o2::framework::AxisSpec>>& specs, float detaMax, float dphistarMax, int chargeTrack1 , int chargeTrack2 , bool isActivated)
196+ void init (o2::framework::HistogramRegistry* registry, std::map<CprHist, std::vector<o2::framework::AxisSpec>>& specs, float detaMax, float dphistarMax, int absChargeTrack1 , int absChargeTrack2 , bool isActivated)
197197 {
198198 mIsActivated = isActivated;
199199 if (mIsActivated ) {
200- mCtr .init (registry, specs, detaMax, dphistarMax, chargeTrack1, chargeTrack2 );
200+ mCtr .init (registry, specs, detaMax, dphistarMax, absChargeTrack1, absChargeTrack2 );
201201 }
202202 }
203203
@@ -220,15 +220,13 @@ template <const char* prefix>
220220class ClosePairRejectionTrackV0 // can also be used for any particle type that has pos/neg daughters, like resonances
221221{
222222 public:
223- void init (o2::framework::HistogramRegistry* registry, std::map<CprHist, std::vector<o2::framework::AxisSpec>>& specs, float detaMax, float dphistarMax, int chargeTrack , bool isActivated)
223+ void init (o2::framework::HistogramRegistry* registry, std::map<CprHist, std::vector<o2::framework::AxisSpec>>& specs, float detaMax, float dphistarMax, int absChargeTrack , bool isActivated)
224224 {
225225 mIsActivated = isActivated;
226- mChargeTrack = chargeTrack;
227-
228226 // initialize CPR with charge of the track and the same charge for the daughter particle
229- // absolute charge of the daughter track will be 1, so we just pass the sign
227+ // absolute charge of the daughter track will be 1, so we just pass 1
230228 if (mIsActivated ) {
231- mCtr .init (registry, specs, detaMax, dphistarMax, mChargeTrack , utils::sign ( mChargeTrack ) );
229+ mCtr .init (registry, specs, detaMax, dphistarMax, absChargeTrack, 1 );
232230 }
233231 }
234232
@@ -239,14 +237,12 @@ class ClosePairRejectionTrackV0 // can also be used for any particle type that h
239237 template <typename T1, typename T2, typename T3>
240238 void setPair (const T1& track, const T2& v0, const T3 /* trackTable*/ )
241239 {
242- if (mChargeTrack > 0 ) {
240+ if (track. signedPt () > 0 ) {
243241 auto daughter = v0.template posDau_as <T3>();
244242 mCtr .compute (track, daughter);
245- } else if ( mChargeTrack < 0 ) {
243+ } else {
246244 auto daughter = v0.template negDau_as <T3>();
247245 mCtr .compute (track, daughter);
248- } else {
249- LOG (fatal) << " CPR Track-V0: Sign of the track is 0!" ;
250246 }
251247 }
252248
@@ -259,19 +255,19 @@ class ClosePairRejectionTrackV0 // can also be used for any particle type that h
259255
260256 private:
261257 CloseTrackRejection<prefix> mCtr ;
262- int mChargeTrack = 0 ;
263258 bool mIsActivated = true ;
264259};
265260
266261template <const char * prefix>
267- class ClosePairRejectionTrackCascade // can also be used for any particle type that has pos/neg daughters, like resonances
262+ class ClosePairRejectionTrackCascade
268263{
269264 public:
270- void init (o2::framework::HistogramRegistry* registry, std::map<CprHist, std::vector<o2::framework::AxisSpec>>& specs, float detaMax, float dphistarMax, int chargeTrack, int chargeCascade , bool isActivated)
265+ void init (o2::framework::HistogramRegistry* registry, std::map<CprHist, std::vector<o2::framework::AxisSpec>>& specs, float detaMax, float dphistarMax, int absChargeTrack , bool isActivated)
271266 {
272267 mIsActivated = isActivated;
273268 if (mIsActivated ) {
274- mCtr .init (registry, specs, detaMax, dphistarMax, chargeTrack, chargeCascade);
269+ // charge of cascade is always 1
270+ mCtr .init (registry, specs, detaMax, dphistarMax, absChargeTrack, 1 );
275271 }
276272 }
277273
@@ -302,14 +298,12 @@ template <const char* prefix>
302298class ClosePairRejectionTrackKink
303299{
304300 public:
305- void init (o2::framework::HistogramRegistry* registry, std::map<CprHist, std::vector<o2::framework::AxisSpec>>& specs, float detaMax, float dphistarMax, int chargeTrack, int signKinkCandidate , bool isActivated)
301+ void init (o2::framework::HistogramRegistry* registry, std::map<CprHist, std::vector<o2::framework::AxisSpec>>& specs, float detaMax, float dphistarMax, int absChargeTrack , bool isActivated)
306302 {
307303 mIsActivated = isActivated;
308- // initialize CPR with charge of the track and the charged daughter particle
309- // For kinks, we compare the primary track with the charged daughter
310- // The charged daughter has absolute charge of 1, so we can pass the sign directly
304+ // The charged daughter has absolute charge of 1, so we can pass 1 directly
311305 if (mIsActivated ) {
312- mCtr .init (registry, specs, detaMax, dphistarMax, chargeTrack, signKinkCandidate );
306+ mCtr .init (registry, specs, detaMax, dphistarMax, absChargeTrack, 1 );
313307 }
314308 }
315309
0 commit comments