CbmRoot
Loading...
Searching...
No Matches
PairAnalysisVarManager.h
Go to the documentation of this file.
1#ifndef PAIRANALYSISVARMANAGER_H
2#define PAIRANALYSISVARMANAGER_H
3/* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4 * based on the ALICE-dielectron package */
5
6//#############################################################
7//# #
8//# Class for management of available variables #
9//# #
10//# Authors: #
11//# Julian Book, Uni Ffm / Julian.Book@cern.ch #
12//# #
13//#############################################################
14
15#include <CbmCluster.h>
16#include <CbmDefs.h>
17#include <CbmGlobalTrack.h>
18#include <CbmKFVertex.h>
19#include <CbmMCTrack.h>
20#include <CbmMuchPixelHit.h>
21#include <CbmMuchTrack.h>
22#include <CbmMvdHit.h>
23#include <CbmPixelHit.h>
25#include <CbmRichHit.h>
26#include <CbmRichRing.h>
27#include <CbmRichUtil.h>
28#include <CbmStsHit.h>
29#include <CbmStsTrack.h>
30#include <CbmTofHit.h>
31#include <CbmTrackMatchNew.h>
32#include <CbmTrdCluster.h>
33#include <CbmTrdHit.h>
34#include <CbmTrdTrack.h>
35#include <CbmVertex.h>
36
37#include <FairEventHeader.h>
38#include <FairMCEventHeader.h>
39#include <FairMCPoint.h>
40#include <FairRootManager.h>
41#include <FairTrackParam.h>
42
43#include <TBits.h>
44#include <TDatabasePDG.h>
45#include <TFormula.h>
46#include <TMatrixFSym.h>
47#include <TNamed.h>
48#include <TPDGCode.h>
49#include <TRandom3.h>
50#include <TVector2.h>
51#include <TVector3.h>
52
53#include "PairAnalysisEvent.h"
54#include "PairAnalysisHelper.h"
55#include "PairAnalysisMC.h"
56#include "PairAnalysisPair.h"
57#include "PairAnalysisPairLV.h"
58#include "PairAnalysisTrack.h"
59#include "assert.h"
60
61//________________________________________________________________
62class PairAnalysisVarManager : public TNamed {
63
64public:
66 {
67 // Constant information
68 kMEL = 1, // pdg mass of electrons
69 kMMU, // pdg mass of muons
70 kMPI, // pdg mass of pions
71 kMKA, // pdg mass of kaons
72 kMPR, // pdg mass of protons
73 kMK0, // pdg mass of neutral kaons
74 kMLA, // pdg mass of lambdas
75 kMPair, // pdg mass of pair
76 kEbeam, // beam energy
77 kThermalScaling, // scaling for uniform mass distributions
79 // Hit specific variables
80 kPosX = kConstMax, // X position [cm]
81 kPosY, // Y position [cm]
82 kPosZ, // Z position [cm]
83 kLinksMC, // number of matched MC links
84 kTrdLayer, // plane/layer id
85 kTrdPads, // number of pads contributing to cluster/hit
86 kTrdCols, // number of pads columns contributing to cluster/hit
87 kTrdRows, // number of pads rows contributing to cluster/hit
88 kEloss, // TRD energy loss dEdx+TR
89 // kElossdEdx, // TRD energy loss dEdx only
90 // kElossTR, // TRD energy loss TR only
91 kNPhotons, // RICH number of photons in this hit
92 kPmtId, // RICH photomultiplier number
93 kBeta, // TOF beta
94 kTofPidDeltaBetaEL, // delta of TOF beta to expected beta for electrons
95 kTofPidDeltaBetaMU, // delta of TOF beta to expected beta for muons
96 kTofPidDeltaBetaPI, // delta of TOF beta to expected beta for pions
97 kTofPidDeltaBetaKA, // delta of TOF beta to expected beta for kaons
98 kTofPidDeltaBetaPR, // delta of TOF beta to expected beta for protons
99 kMassSq, // TOF mass squared
101 // Particle specific variables
102 kPx = kHitMax, // px
103 kPy, // py
104 kPz, // pz
105 kPt, // transverse momentum
106 kPtSq, // transverse momentum squared
107 kP, // momentum
108 kXv, // vertex position in x
109 kYv, // vertex position in y
110 kZv, // vertex position in z
111 kOneOverPt, // 1/pt
112 kPhi, // phi angle
113 kTheta, // theta polar angle
114 kEta, // pseudo-rapidity
115 kY, // rapidity
116 kYlab, // rapidity lab
117 kE, // energy
118 kM, // mass
119 kCharge, // charge
120 kMt, // transverse mass sqrt(m^2+pt^2)
121 kChi2NDFtoVtx, // chi2/ndf impact parameter STS(+MVD) track to primary vertex in (sigmas)
122 kImpactParXY, // Impact parameter in XY plane
123 kImpactParZ, // Impact parameter in Z
124 kInclAngle, // inclination angle
126 // Track specific variables
127 // global track
128 kTrackLength = kParticleMax, // Track length (cm)
129 kTrackChi2NDF, // chi2/ndf
130 kPin, // first point momentum (GeV/c)
131 kPtin, // first point transverse momentum (GeV/c)
132 kPout, // last point momentum (GeV/c)
133 kPtout, // last point transverse momentum (GeV/c)
134 // trd track information
135 kTrdSignal, // TRD energy loss dEdx+TR (keV)
136 kTrdPidWkn, // PID value Wkn method
137 kTrdPidANN, // PID value Artificial Neural Network (ANN-method)
138 kTrdPidLikeEL, // PID value Likelihood method: electron
139 kTrdPidLikePI, // PID value Likelihood method: pion
140 kTrdPidLikeKA, // PID value Likelihood method: kaon
141 kTrdPidLikePR, // PID value Likelihood method: proton
142 kTrdPidLikeMU, // PID value Likelihood method: muon
143 kTrdHits, // number of TRD hits
144 kTrdChi2NDF, // chi2/ndf TRD
145 kTrdPin, // first point TRD momentum (GeV/c)
146 kTrdPtin, // first point TRD transverse momentum (GeV/c)
147 kTrdPhiin, // first point TRD azimuthal angle (rad)
148 kTrdThetain, // first point TRD polar angle (rad)
149 kTrdPout, // last point TRD momentum (GeV/c)
150 kTrdPtout, // last point TRD transverse momentum (GeV/c)
151 kTrdThetaCorr, // correction factor for theta track angle
152 kTrdPhiCorr, // correction factor for phi track angle
153 // kTrdTrackLength, // track length in cm of the trd tracklet
154 // sts track information
155 kMvdhasEntr, // weather track enters first MVD station
156 kMvdHits, // number of MVD hits
157 kMvdHitClosest, // Distance to the closest hit in the firstreconstructed MVD station
158 kStsHitClosest, // Distance to the closest hit in the firstreconstructed STS station
159 kMvdHitClosestOpeningAngle, // opening angle calculated between the reconstructed track and the track associated to the closest hit in the first mvd station
160 kStsHitClosestOpeningAngle, // opening angle calculated between the reconstructed track and the track associated to the closest hit in the first sts station
161 kMvdHitClosestMom, // sqrt( p_rec * p_closest_mvd)
162 kStsHitClosestMom, // sqrt( p_rec * p_closest_sts)
163 kMvdFirstHitPosZ, // position of the first hit in the MVD (cm)
164 kMvdFirstExtX, // x-position of the extrapolated track at the first MVD station (cm)
165 kMvdFirstExtY, // y-position of the extrapolated track at the first MVD station (cm)
166 // kImpactParZ, // Impact parameter of track at target z, in units of its error
167 kStsHits, // number of STS hits
168 kStsMvdHits, // number of STS hits
169 kStsChi2NDF, // chi2/ndf STS
170 kStsPin, // first point STS momentum (GeV/c)
171 kStsPtin, // first point STS transverse momentum (GeV/c)
172 kStsPout, // last point STS momentum (GeV/c)
173 kStsPtout, // last point STS transverse momentum (GeV/c)
174 kStsXv, // STS point: x-coordinate
175 kStsYv, // STS point: y-coordinate
176 kStsZv, // STS point: z-coordinate
177 kStsFirstHitPosZ, // position of the first hit in the STS (cm)
178 // rich ring information
179 kRichhasProj, // weather rich ring has a projection onto the pmt plane
180 kRichPidANN, // PID value Artificial Neural Network (ANN-method)
181 kRichHitsOnRing, // number of RICH hits on the ring
182 kRichHits, // number of RICH hits (ANN input)
183 kRichChi2NDF, // chi2/ndf ring fit (ANN input)
184 kRichRadius, // ring radius
185 kRichAxisA, // major semi-axis (ANN input)
186 kRichAxisB, // minor semi-axis (ANN input)
187 kRichCenterX, // ring center in x
188 kRichCenterY, // ring center in y
189 kRichDistance, // distance between ring center and track (ANN input)
190 kRichRadialPos, // radial psoition = sqrt(x**2+abs(y-110)**2), (ANN input)
191 kRichRadialAngle, // radial angle (0||1||2)*pi +- atan( abs((+-100-y)/-x) ), (ANN input)
192 kRichPhi, // phi rotation angle of ellipse (ANN input)
193 // tof track information
194 kTofHits, // number of TOF hits
195 // much track information
196 kMuchHits, // number of MUCH hits
197 kMuchHitsPixel, // number of MUCH pixel hits
198 kMuchChi2NDF, // chi2/ndf MUCH
199 // technical variables
200 kRndmTrack, // randomly created number (used to apply special selection cuts)
201 kPRes, // momentum resolution
203
204 // Pair specific variables
205 kChi2NDF = kTrackMax, // Chi^2/NDF
206 kDecayLength, // decay length p*t (cm)
207 kR, // xy-distance to origin (cm)
208 kOpeningAngle, // opening angle
209 kCosPointingAngle, // cosine of the pointing angle
210 kArmAlpha, // Armenteros-Podolanski alpha
211 kArmPt, // Armenteros-Podolanski pt
212 // helicity picture: Z-axis is considered the direction of the mother's 3-momentum vector
213 kThetaHE, // theta in mother's rest frame in the helicity picture
214 kPhiHE, // phi in mother's rest frame in the helicity picture
215 kThetaSqHE, // squared value of kThetaHE
216 kCos2PhiHE, // Cosine of 2*phi in mother's rest frame in the helicity picture
217 kCosTilPhiHE, // Shifted phi depending on kThetaHE
218 // Collins-Soper picture: Z-axis is considered the direction of the vectorial difference between
219 // the 3-mom vectors of target and projectile beams
220 kThetaCS, // theta in mother's rest frame in Collins-Soper picture
221 kPhiCS, // phi in mother's rest frame in Collins-Soper picture
222 kThetaSqCS, // squared value of kThetaCS
223 kCos2PhiCS, // Cosine of 2*phi in mother's rest frame in the Collins-Soper picture
224 kCosTilPhiCS, // Shifted phi depending on kThetaCS
225 kPsiPair, // phi in mother's rest frame in Collins-Soper picture
226 kStsMvdFirstDaughter, // number of STS and MVD hits of the first daughter particle
227 kStsMvdSecondDaughter, // number of STS and MVD hits
228 kStsMvdTrdFirstDaughter, // number of STS and MVD hitsof the first daughter particle
229 kStsMvdTrdSecondDaughter, // number of STS and MVD hits
230 kStsMvdRichFirstDaughter, // number of STS and MVD hitsof the first daughter particle
231 kStsMvdRichSecondDaughter, // number of STS and MVD hits
232 kStsFirstDaughter, // number of STS hits of the first daughter particle
233 kStsSecondDaughter, // number of STS hits of the second daughter particle
234 kMvdFirstDaughter, // number of MVD hits of the first daughter particle
235 kMvdSecondDaughter, // number of MVD hits of the second daughter particle
236 kTrdFirstDaughter, // number of TRD hits of the first daughter particle
237 kTrdSecondDaughter, // number of TRD hits of the second daughter particle
238 kRichFirstDaughter, // number of RICH hits of the first daughter particle
239 kRichSecondDaughter, // number of RICH hits of the second daughter particle
240 kStsHitDist, // distance to the closest hit in the first sts station
241 kMvdHitDist, // distance to the closest hit in the first mvd station
242 kPhivPair, // angle between ee plane and the magnetic field (can be useful for conversion rejection)
243
244 kLegDist, // distance of the legs
245 kLegDistXY, // distance of the legs in XY
246 kDeltaEta, // Absolute value of Delta Eta for the legs
247 kDeltaPhi, // Absolute value of Delta Phi for the legs
248 kLegsP, // sqrt of p_leg1*p_leg2
249 kMerr, // error of mass calculation
250 kDCA, // distance of closest approach TODO: not implemented yet
251 kPairType, // type of the pair, like like sign ++ unlikesign ...
252 kMomAsymDau1, // momentum fraction of daughter1
253 kMomAsymDau2, // momentum fraction of daughter2
254 kPairEff, // pair efficiency
255 kOneOverPairEff, // 1 / pair efficiency (correction factor)
256 kOneOverPairEffSq, // 1 / pair efficiency squared (correction factor)
257 kRndmPair, // radomly created number (used to apply special signal reduction cuts)
258 kPairs, // number of Ev1PM pair candidates after all cuts
260
261 // Event specific variables
267 kXRes, // primary vertex x-resolution
268 kYRes, // primary vertex y-resolution
269 kZRes, // primary vertex z-resolution
270 kMaxPt, // track with maximum pt
271
272 kRndmRej, // random rejection probability by the pair pre filter
273 kNTrk, // number of tracks
274 kTracks, // track after all cuts
276
277 kCentrality, // event centrality fraction
278 kNevents, // event counter
279 kEvStartTime, // reconstructed event start time
280 kRunNumber, // run number
281 kYbeam, // beam rapdity
282 kMixingBin, // event mixing pool number
283 kTotalTRDHits, // size of trd hit array
285
286 // MC information
287 // Hit specific variables
288 kPosXMC = kNMaxValues, // X position [cm]
289 kPosYMC, // Y position [cm]
290 kPosZMC, // Z position [cm]
291 kElossMC, // energy loss dEdx+TR
293 // Particle specific MC variables
295 kPyMC, // py
296 kPzMC, // pz
297 kPtMC, // transverse momentum
298 kPtSqMC, // transverse momentum squared
299 kPMC, // momentum
300 kXvMC, // vertex position in x
301 kYvMC, // vertex position in y
302 kRvMC, // vertex position as (x^2 + y^2)
303 kZvMC, // vertex position in z
304 kPhivMC, // vertex position in phi
305 kThetavMC, // vertex position in theta
307 kPhiMC, // phi angle
308 kThetaMC, // theta angle
309 kEtaMC, // pseudo-rapidity
310 kYMC, // rapidity
311 kYlabMC, // rapidity lab
312 kBetaGammaMC, // beta gamma
313 kEMC, // energy
314 kEMotherMC, // energy of the mother
315 kMMC, // mass
316 kChargeMC, // charge
317 kPdgCode, // PDG code
318 kPdgCodeMother, // PDG code of the mother
319 kPdgCodeGrandMother, // PDG code of the grand mother
320 kGeantId, // geant process id (see TMCProcess)
321 kWeight, // weight NxBR
323
324 // Track specific MC variables
325 kTrdHitsMC = kParticleMaxMC, // number of TRD hits
326 kMvdHitsMC, // number of MVD hits
327 kStsHitsMC, // number of STS hits
328 kStsMvdHitsMC, // number of STS hits
329 kTofHitsMC, // number of TOF hits
330 kMuchHitsMC, // number of MUCH hits
331 kRichHitsMC, // number of RICH hits
332 kTrdMCTracks, // number of TRD MC Points in reconstructed track
333 kRichMCPoints, // number of TRD MC Points in reconstructed track
334 kTrdTrueHits, // number of true TRD hits in reconstructed track
335 kTrdDistHits, // number of distorted TRD hits in reconstructed track
336 kTrdFakeHits, // number of fake TRD hits in reconstructed track
337 kTrdDistortion, // level of distortion of reconstructed track [0,1]
338 kStsTrueHits, // number of true STS hits in reconstructed track
339 kStsDistHits, // number of distorted STS hits in reconstructed track
340 kStsFakeHits, // number of fake STS hits in reconstructed track
341 kTrdisMC, // status bit for matching btw. glbl. and local MC track
342 kMvdisMC, // status bit for matching btw. glbl. and local MC track
343 kStsisMC, // status bit for matching btw. glbl. and local MC track
344 kMuchisMC, // status bit for matching btw. glbl. and local MC track
345 kRichisMC, // status bit for matching btw. glbl. and local MC track
346 kTofisMC, // status bit for matching btw. glbl. and local MC track
348
349 // Pair specific MC variables
350 kOpeningAngleMC = kTrackMaxMC, // opening angle
351 kCosPointingAngleMC, // cosine of the pointing angle
352 kStsMvdFirstDaughterMC, // number of STS and MVD hits
353 kStsMvdSecondDaughterMC, // number of STS and MVD hits
354 // kPhivPairMC, // angle between d1d2 plane and the magnetic field
356
357 // Event specific MCvariables
358 kNTrkMC = kPairMaxMC, // number of MC tracks
362 kStsMatches, // number of matched STS tracks
363 kTrdMatches, // number of matched TRD tracks
364 kVageMatches, // number of MC tracks (STS) matched to multiple reconstr. track
365 kTotalTRDHitsMC, // size of trd MC point array
366 kImpactParam, // impact parameter from MC header
367 kNPrimMC, // primary particles from MC header
369 };
370
371
373 PairAnalysisVarManager(const char* name, const char* title);
374 virtual ~PairAnalysisVarManager();
375
376 static void InitFormulas();
377
378 static void Fill(const TObject* particle, Double_t* const values);
379 static void FillVarMCParticle(const CbmMCTrack* p1, const CbmMCTrack* p2, Double_t* const values);
380 static void FillSum(const TObject* particle, Double_t* const values);
381
382 static void CalculateHitTypes(const PairAnalysisTrack* track, ECbmModuleId idet, Int_t* trueH, Int_t* distH,
383 Int_t* fakeH);
384
385 // Setter
386 static void SetFillMap(TBits* map) { fgFillMap = map; }
387 static void SetEvent(PairAnalysisEvent* const ev);
388 static void SetEventData(const Double_t data[PairAnalysisVarManager::kNMaxValuesMC]);
389 static void SetValue(ValueTypes var, Double_t val) { fgData[var] = val; }
390
391 // Getter
393 static const CbmKFVertex* GetKFVertex() { return fgKFVertex; }
394 static const char* GetValueName(Int_t i) { return (i >= 0 && i < kNMaxValuesMC) ? fgkParticleNames[i][0] : ""; }
395 static const char* GetValueLabel(Int_t i) { return (i >= 0 && i < kNMaxValuesMC) ? fgkParticleNames[i][1] : ""; }
396 static const char* GetValueUnit(Int_t i) { return (i >= 0 && i < kNMaxValuesMC) ? fgkParticleNames[i][2] : ""; }
397 static Double_t* GetData() { return fgData; }
398 static Double_t GetValue(ValueTypes val) { return fgData[val]; }
399 static UInt_t GetValueType(const char* valname);
400 static UInt_t GetValueTypeMC(UInt_t var);
401
402 static UInt_t* GetArray(ValueTypes var0, ValueTypes var1 = kNMaxValuesMC, ValueTypes var2 = kNMaxValuesMC,
407
408 // data member
409 static TFormula* fgFormula[kNMaxValuesMC]; // variable formulas
410
411private:
412 // data member
413 static Double_t fgData[kNMaxValuesMC];
414 static const char* fgkParticleNames[kNMaxValuesMC][3]; // variable names
415 //static const char* fgkParticleNamesMC[kNMaxValuesMC]; // MC variable names
416 static PairAnalysisEvent* fgEvent; // current event pointer
417 static CbmKFVertex* fgKFVertex; // kf vertex @TODO: OBSOLETE/UNUSED?
418 static CbmVertex* fgVertexMC; // MC vertex
419 static TBits* fgFillMap; // map for filling variables
420 static Int_t fgCurrentRun; // current run number
421
422 // fill functions
423 static Bool_t Req(ValueTypes var) { return (fgFillMap ? fgFillMap->TestBitNumber(var) : kTRUE); }
424
425 static void FillVarConstants(Double_t* const values);
426 static void FillVarPairAnalysisEvent(const PairAnalysisEvent* event, Double_t* const values);
427 static void FillVarVertex(const CbmVertex* vertex, Double_t* const values);
428 static void FillVarPairAnalysisTrack(const PairAnalysisTrack* track, Double_t* const values);
429 static void FillVarGlobalTrack(const CbmGlobalTrack* track, Double_t* const values);
430 static void FillVarStsTrack(const CbmStsTrack* track, Double_t* const values);
431 static void FillVarMuchTrack(const CbmMuchTrack* track, Double_t* const values);
432 static void FillVarTrdTrack(const CbmTrdTrack* track, Double_t* const values);
433 static void FillVarRichRing(const CbmRichRing* track, Double_t* const values);
434 static void FillVarMCTrack(const CbmMCTrack* particle, Double_t* const values);
435 static void FillVarPairAnalysisPair(const PairAnalysisPair* pair, Double_t* const values);
436 static void FillVarMvdHit(const CbmMvdHit* hit, Double_t* const values);
437 static void FillVarStsHit(const CbmStsHit* hit, Double_t* const values);
438 static void FillVarMuchHit(const CbmMuchPixelHit* hit, Double_t* const values);
439 static void FillVarTrdHit(const CbmTrdHit* hit, Double_t* const values);
440 static void FillVarRichHit(const CbmRichHit* hit, Double_t* const values);
441 static void FillVarTofHit(const CbmTofHit* hit, Double_t* const values);
442 static void FillVarPixelHit(const CbmPixelHit* hit, Double_t* const values);
443 static void FillVarTrdCluster(const CbmTrdCluster* cluster, Double_t* const values);
444 static void FillVarMCPoint(const FairMCPoint* hit, Double_t* const values);
445 static void FillSumVarMCPoint(const FairMCPoint* hit, Double_t* const values);
446 static void FillVarMCHeader(const FairMCEventHeader* header, Double_t* const values);
447
448 // setter
449 static void ResetArrayData(Int_t to, Double_t* const values);
450 static void ResetArrayDataMC(Int_t to, Double_t* const values);
451
454
456 1); // Variables management for event, pair, track, hit infos (static)
457};
458
459
460//Inline functions
461inline void PairAnalysisVarManager::Fill(const TObject* object, Double_t* const values)
462{
463 //
464 // Main function to fill all available variables according to the type
465 //
466
467 //Protect
468 if (!object) return;
469
470 if (object->IsA() == PairAnalysisEvent::Class())
471 FillVarPairAnalysisEvent(static_cast<const PairAnalysisEvent*>(object), values);
472 else if (object->IsA() == CbmVertex::Class())
473 FillVarVertex(static_cast<const CbmVertex*>(object), values);
474 else if (object->IsA() == PairAnalysisTrack::Class())
475 FillVarPairAnalysisTrack(static_cast<const PairAnalysisTrack*>(object), values);
476 else if (object->IsA() == CbmGlobalTrack::Class())
477 FillVarGlobalTrack(static_cast<const CbmGlobalTrack*>(object), values);
478 else if (object->IsA() == CbmStsTrack::Class())
479 FillVarStsTrack(static_cast<const CbmStsTrack*>(object), values);
480 else if (object->IsA() == CbmMuchTrack::Class())
481 FillVarMuchTrack(static_cast<const CbmMuchTrack*>(object), values);
482 else if (object->IsA() == CbmTrdTrack::Class())
483 FillVarTrdTrack(static_cast<const CbmTrdTrack*>(object), values);
484 else if (object->IsA() == CbmRichRing::Class())
485 FillVarRichRing(static_cast<const CbmRichRing*>(object), values);
486 else if (object->IsA() == CbmMCTrack::Class())
487 FillVarMCTrack(static_cast<const CbmMCTrack*>(object), values);
488 else if (object->InheritsFrom(PairAnalysisPair::Class()))
489 FillVarPairAnalysisPair(static_cast<const PairAnalysisPair*>(object), values);
490 else if (object->IsA() == CbmMvdHit::Class())
491 FillVarMvdHit(static_cast<const CbmMvdHit*>(object), values);
492 else if (object->IsA() == CbmStsHit::Class())
493 FillVarStsHit(static_cast<const CbmStsHit*>(object), values);
494 else if (object->IsA() == CbmMuchPixelHit::Class())
495 FillVarMuchHit(static_cast<const CbmMuchPixelHit*>(object), values);
496 else if (object->IsA() == CbmTrdHit::Class())
497 FillVarTrdHit(static_cast<const CbmTrdHit*>(object), values);
498 else if (object->IsA() == CbmRichHit::Class())
499 FillVarRichHit(static_cast<const CbmRichHit*>(object), values);
500 else if (object->IsA() == CbmTofHit::Class())
501 FillVarTofHit(static_cast<const CbmTofHit*>(object), values);
502 else if (object->InheritsFrom(FairMCPoint::Class()))
503 FillVarMCPoint(static_cast<const FairMCPoint*>(object), values);
504 else
505 printf("PairAnalysisVarManager::Fill: Type %s is not supported by "
506 "PairAnalysisVarManager! \n",
507 object->ClassName());
508}
509
510
511inline void PairAnalysisVarManager::FillSum(const TObject* object, Double_t* const values)
512{
513 //
514 // Main function to incremenebt available variables according to the type
515 //
516
517 //Protect
518 if (!object) return;
519 else if (object->InheritsFrom(FairMCPoint::Class()))
520 FillSumVarMCPoint(static_cast<const FairMCPoint*>(object), values);
521 else
522 printf("PairAnalysisVarManager::FillSum: Type %s is not supported by "
523 "PairAnalysisVarManager! \n",
524 object->ClassName());
525}
526
527inline void PairAnalysisVarManager::ResetArrayData(Int_t to, Double_t* const values)
528{
529 // Protect
530 if (to >= kNMaxValues) return;
531 // Reset
532 for (Int_t i = kConstMax; i < to; ++i) {
533 values[i] = 0.;
534 }
535 // reset values different from zero
536 if (to >= kTrackMax && to > kParticleMax) {
537 values[kTrdPidANN] = -999.;
538 values[kRichPidANN] = -999.;
539 }
540 if (to >= kHitMax && to > kConstMax) {
541 values[kMassSq] = -999.;
542 values[kBeta] = -999.;
543 values[kTofPidDeltaBetaEL] = -999.;
544 values[kTofPidDeltaBetaMU] = -999.;
545 values[kTofPidDeltaBetaPI] = -999.;
546 values[kTofPidDeltaBetaKA] = -999.;
547 values[kTofPidDeltaBetaPR] = -999.;
548 }
549}
550
551
552inline void PairAnalysisVarManager::ResetArrayDataMC(Int_t to, Double_t* const values)
553{
554 // Protect
555 if (to >= kNMaxValuesMC) return;
556 // Reset
557 for (Int_t i = kNMaxValues; i < to; ++i)
558 values[i] = 0.;
559 // reset values different from zero
560 // /*
561 values[kPdgCode] = -99999.;
562 values[kPdgCodeMother] = -99999.;
563 values[kPdgCodeGrandMother] = -99999.;
564 // */
565 //valuesMC[kNumberOfDaughters] = -999.;
566 if (to >= kHitMaxMC && to > kNMaxValues) {
567 values[kPosXMC] = -999.;
568 values[kPosYMC] = -999.;
569 values[kPosZMC] = -999.;
570 values[kElossMC] = -999.;
571 }
572}
573
574inline void PairAnalysisVarManager::FillVarPairAnalysisEvent(const PairAnalysisEvent* event, Double_t* const values)
575{
576 //
577 // Fill event information available into an array
578 //
579
580 // Reset array
583
584 // Protect
585 if (!event) return;
586
587 // Set
588 values[kNTrk] = event->GetNumberOfTracks();
589 values[kStsMatches] = event->GetNumberOfMatches(ECbmModuleId::kSts);
590 values[kTrdMatches] = event->GetNumberOfMatches(ECbmModuleId::kTrd);
591 values[kVageMatches] = event->GetNumberOfVageMatches();
592 values[kTotalTRDHits] = event->GetNumberOfHits(ECbmModuleId::kTrd);
593 const Double_t proMass = TDatabasePDG::Instance()->GetParticle(2212)->Mass();
594 Double_t beta = TMath::Sqrt(values[kEbeam] * values[kEbeam] - proMass * proMass) / (values[kEbeam] + proMass);
595 values[kYbeam] = TMath::ATanH(beta);
596 // Printf("beam rapidity new: %f",values[kYbeam]);
597 values[kNTrkMC] = event->GetNumberOfMCTracks();
598 values[kTotalTRDHitsMC] = event->GetNumberOfPoints(ECbmModuleId::kTrd);
599
600
601 // Set vertex
602 FillVarVertex(event->GetPrimaryVertex(), values);
603
604 // Set header information
605 FillVarMCHeader(event->GetMCHeader(), values);
606 values[kEvStartTime] = event->GetEvStartTime();
607}
608
609inline void PairAnalysisVarManager::FillVarMCHeader(const FairMCEventHeader* header, Double_t* const values)
610{
611 //
612 // Fill MCheader information available into an array
613 //
614
615 // Protect
616 if (!header) return;
617
618 // Reset
619 // ResetArrayData(kNMaxValues, values);
621
622 // Set
623 // values[k] = header->GetPhi(); // event plane angle [rad]
624
625 // accessors via first FairMCEventHeader
626 values[kXvPrimMC] = header->GetX();
627 values[kYvPrimMC] = header->GetY();
628 values[kZvPrimMC] = header->GetZ();
629 values[kImpactParam] = header->GetB(); // [fm]
630 values[kNPrimMC] = header->GetNPrim();
631
632 // Fill mc vertex data member
633 TMatrixFSym mat(3);
634 fgVertexMC->SetVertex(values[kXvPrimMC], values[kYvPrimMC], values[kZvPrimMC], -999., 1., values[kNPrimMC], mat);
635}
636
637inline void PairAnalysisVarManager::FillVarVertex(const CbmVertex* vertex, Double_t* const values)
638{
639 //
640 // Fill vertex information available into an array
641 //
642
643 // Protect
644 if (!vertex) return;
645
646 // Reset
647 // ResetArrayData(kNMaxValues, values);
648
649 // Set
650 values[kXvPrim] = vertex->GetX();
651 values[kYvPrim] = vertex->GetY();
652 values[kZvPrim] = vertex->GetZ();
653 values[kNVtxContrib] = vertex->GetNTracks();
654 values[kVtxChi] = vertex->GetChi2();
655 values[kVtxNDF] = vertex->GetNDF();
656}
657
658
659inline void PairAnalysisVarManager::FillVarPairAnalysisTrack(const PairAnalysisTrack* track, Double_t* const values)
660{
661 //
662 // Fill track information for the all track and its sub tracks
663 //
664
665 // Reset
666 ResetArrayData(kTrackMax, values);
668
669 // Protect
670 if (!track) return;
671
672 // Set track specific variables
673 Fill(track->GetGlobalTrack(), values);
674 Fill(track->GetStsTrack(), values);
675 Fill(track->GetMuchTrack(), values);
676 Fill(track->GetTrdTrack(), values);
677 Fill(track->GetRichRing(), values);
678
679 values[kP] = track->P();
680
681 // Calculate first hit position for sts and mvd
682 Double_t minSts = 9999.;
683 Int_t compIndex = 0;
684 Double_t xref = 0.;
685 Double_t yref = 0.;
686 Double_t zref = 0.;
687 TClonesArray* hits = fgEvent->GetHits(ECbmModuleId::kSts);
688 TObjArray* PaPaTracks = fgEvent->GetTracks();
689 CbmStsTrack* ststrack1 = (CbmStsTrack*) track->GetStsTrack();
690 if (hits /*&& Req(kStsFirstHitPosZ)*/) {
691 for (Int_t ihit = 0; ihit < ststrack1->GetNofStsHits(); ihit++) {
692 Int_t idx = ststrack1->GetStsHitIndex(ihit);
693 if (idx > hits->GetEntriesFast()) continue;
694 CbmStsHit* hit = (CbmStsHit*) hits->At(idx);
695 if (hit && minSts > hit->GetZ()) {
696 minSts = hit->GetZ();
697 xref = hit->GetX();
698 yref = hit->GetY();
699 zref = hit->GetZ();
700 }
701 }
702 }
703 Double_t minStsClosest = 9999.;
704 if (PaPaTracks && hits) {
705 for (Int_t iTracks = 0; iTracks < PaPaTracks->GetEntriesFast(); iTracks++) {
706 PairAnalysisTrack* ptrk = (PairAnalysisTrack*) PaPaTracks->At(iTracks);
707 if (!ptrk) continue;
708 CbmStsTrack* ststrack2 = (CbmStsTrack*) ptrk->GetStsTrack();
709 for (Int_t ihit = 0; ihit < ststrack2->GetNofStsHits(); ihit++) {
710 Int_t idx = ststrack2->GetStsHitIndex(ihit);
711 if (idx > hits->GetEntriesFast() || idx < 0) continue;
712 CbmStsHit* hit = (CbmStsHit*) hits->At(idx);
713 Double_t xdiff = hit->GetX() - xref;
714 Double_t ydiff = hit->GetY() - yref;
715 Double_t zdiff = hit->GetZ() - zref;
716 Double_t dist = TMath::Sqrt(xdiff * xdiff + ydiff * ydiff + zdiff * zdiff);
717 if (hit && dist < minStsClosest && dist > 0.) {
718 minStsClosest = dist;
719 compIndex = iTracks;
720 }
721 }
722 }
723 PairAnalysisTrack* ptrk = (PairAnalysisTrack*) PaPaTracks->At(compIndex);
724 PairAnalysisTrack* reftrack = new PairAnalysisTrack(*track);
725 if (ptrk && reftrack) {
727 if (pair) {
728 if (reftrack->PdgCode() < 1.e8 && ptrk->PdgCode() < 1.e8)
729 pair->SetTracks(reftrack, reftrack->PdgCode(), ptrk, ptrk->PdgCode());
730 values[kStsHitClosestOpeningAngle] = pair->OpeningAngle();
731 values[kStsHitClosestMom] = TMath::Sqrt(ptrk->P() * reftrack->P());
732 delete pair;
733 }
734 delete reftrack;
735 }
736 }
737
738 Double_t minMvd = 9999.;
739 xref = 0.;
740 yref = 0.;
741 zref = 0.;
743 CbmStsTrack* mvdtrack1 = (CbmStsTrack*) track->GetStsTrack();
744 if (hits) {
745 for (Int_t ihit = 0; ihit < mvdtrack1->GetNofMvdHits(); ihit++) {
746 Int_t idx = mvdtrack1->GetMvdHitIndex(ihit);
747 if (idx > hits->GetEntriesFast()) continue;
748 CbmMvdHit* hit = (CbmMvdHit*) hits->At(idx);
749 if (hit && minMvd > hit->GetZ()) {
750 minMvd = hit->GetZ();
751 xref = hit->GetX();
752 yref = hit->GetY();
753 zref = hit->GetZ();
754 }
755 }
756 }
757 Double_t minMvdClosest = 9999.;
758 if (PaPaTracks && hits) {
759 for (Int_t iTracks = 0; iTracks < PaPaTracks->GetEntriesFast(); iTracks++) {
760 PairAnalysisTrack* ptrk = (PairAnalysisTrack*) PaPaTracks->At(iTracks);
761 if (!ptrk) continue;
762 CbmStsTrack* mvdtrack2 = (CbmStsTrack*) ptrk->GetStsTrack();
763 for (Int_t ihit = 0; ihit < mvdtrack2->GetNofMvdHits(); ihit++) {
764 Int_t idx = mvdtrack2->GetMvdHitIndex(ihit);
765 if (idx > hits->GetEntriesFast()) continue;
766 CbmMvdHit* hit = (CbmMvdHit*) hits->At(idx);
767 Double_t xdiff = hit->GetX() - xref;
768 Double_t ydiff = hit->GetY() - yref;
769 Double_t zdiff = hit->GetZ() - zref;
770 Double_t dist = TMath::Sqrt(xdiff * xdiff + ydiff * ydiff + zdiff * zdiff);
771 if (hit && dist < minMvdClosest && dist > 0.) {
772 minMvdClosest = dist;
773 compIndex = iTracks;
774 }
775 }
776 }
777 PairAnalysisTrack* ptrk = (PairAnalysisTrack*) PaPaTracks->At(compIndex);
778 PairAnalysisTrack* reftrack = new PairAnalysisTrack(*track);
779 if (ptrk && reftrack) {
781 if (pair) {
782 if (reftrack->PdgCode() < 1.e8 && ptrk->PdgCode() < 1.e8)
783 pair->SetTracks(reftrack, reftrack->PdgCode(), ptrk, ptrk->PdgCode());
784 values[kMvdHitClosestOpeningAngle] = pair->OpeningAngle();
785 values[kMvdHitClosestMom] = TMath::Sqrt(ptrk->P() * reftrack->P());
786 delete pair;
787 }
788 delete reftrack;
789 }
790 }
791
792 values[kStsHitClosest] = minStsClosest;
793 values[kMvdHitClosest] = minMvdClosest;
794
795
796 values[kRichDistance] = 1.; //CbmRichUtil::GetRingTrackDistance(track->GetGlobalIndex());
797 values[kRichPidANN] =
798 CbmRichElectronIdAnn::GetInstance().CalculateAnnValue(track->GetGlobalIndex(), values[kP]); // fgRichElIdA
799
800 // acceptance defintions
801 FairTrackParam* param = NULL;
802 if ((param = track->GetRichProj())) { // RICH
803 values[kRichhasProj] = (TMath::Abs(param->GetX() + param->GetY()) > 0.);
804 }
805 if ((param = track->GetMvdEntrance())) { // MVD
806 values[kMvdFirstExtX] = param->GetX();
807 values[kMvdFirstExtY] = param->GetY();
808 Double_t innerLimit = 0.5; //cm, TODO: no hardcoding
809 Double_t outerLimit = 2.5; //cm
810 values[kMvdhasEntr] = ((TMath::Abs(param->GetX()) > innerLimit && TMath::Abs(param->GetX()) < outerLimit
811 && TMath::Abs(param->GetY()) < outerLimit)
812 || (TMath::Abs(param->GetY()) > innerLimit && TMath::Abs(param->GetY()) < outerLimit
813 && TMath::Abs(param->GetX()) < outerLimit));
814 }
815
816 // mc
817 Fill(track->GetMCTrack(), values); // this contains particle infos as well
818
819 if (track->GetMCTrack()) {
820 values[kPRes] = TMath::Abs(values[kP] - track->GetMCTrack()->GetP()) / track->GetMCTrack()->GetP();
821 }
822
823 if (track->GetTrackMatch(ECbmModuleId::kTrd)) { // track match specific (accessors via CbmTrackMatchNew)
824 values[kTrdMCTracks] = track->GetTrackMatch(ECbmModuleId::kTrd)->GetNofLinks(); //number of different! mc tracks
825
826 Int_t trueHits = 0, distHits = 0, fakeHits = 0;
827 CalculateHitTypes(track, ECbmModuleId::kTrd, &trueHits, &distHits, &fakeHits);
828
829 values[kTrdTrueHits] = trueHits;
830 values[kTrdDistHits] = distHits;
831 values[kTrdFakeHits] = fakeHits;
832 // values[kTrdDistortion] = dist/links;
833 /* values[kTrdTrueHits] = tmtch->GetNofTrueHits(); //NOTE: changed defintion */
834 /* values[kTrdFakeHits] = tmtch->GetNofWrongHits(); //NOTE: changed definition */
835 }
836 if (track->GetTrackMatch(ECbmModuleId::kSts)) {
837 Int_t trueHits = 0, distHits = 0, fakeHits = 0;
838 CalculateHitTypes(track, ECbmModuleId::kSts, &trueHits, &distHits, &fakeHits);
839
840 values[kStsTrueHits] = trueHits;
841 values[kStsDistHits] = distHits;
842 values[kStsFakeHits] = fakeHits;
843 }
846 }
847 values[kStsisMC] = track->TestBit(BIT(14 + ToIntegralType(ECbmModuleId::kSts)));
848 values[kMuchisMC] = track->TestBit(BIT(14 + ToIntegralType(ECbmModuleId::kMuch)));
849 values[kTrdisMC] = track->TestBit(BIT(14 + ToIntegralType(ECbmModuleId::kTrd)));
850 values[kRichisMC] = track->TestBit(BIT(14 + ToIntegralType(ECbmModuleId::kRich)));
851 values[kMvdisMC] = track->TestBit(BIT(14 + ToIntegralType(ECbmModuleId::kMvd)));
852 values[kTofisMC] = track->TestBit(BIT(14 + ToIntegralType(ECbmModuleId::kTof)));
853 values[kWeight] = track->GetWeight();
854
855 //Apply correct weighting to tracks from inmed and qgp. For this we need the mass of the mother
857 if (mc->HasMC() && track->GetMCTrack()) {
858 CbmMCTrack* mainMCtrack = track->GetMCTrack();
859 Int_t mainMotherId = mainMCtrack->GetMotherId();
860 CbmMCTrack* mother = mc->GetMCTrackFromMCEvent(mainMotherId);
861 if (mother) {
862 Int_t mainMotherPdg = mother->GetPdgCode();
863 if (values[kThermalScaling] == 3) {
864 Double_t mass[170] = {
865 0.0195, 0.0395, 0.0595, 0.0795, 0.0995, 0.1195, 0.1395, 0.1595, 0.1795, 0.1995, 0.2195, 0.2395, 0.2595,
866 0.2795, 0.2995, 0.3195, 0.3395, 0.3595, 0.3795, 0.3995, 0.4195, 0.4395, 0.4595, 0.4795, 0.4995, 0.5195,
867 0.5395, 0.5595, 0.5795, 0.5995, 0.6195, 0.6395, 0.6595, 0.6795, 0.6995, 0.7195, 0.7395, 0.7595, 0.7795,
868 0.7995, 0.8195, 0.8395, 0.8595, 0.8795, 0.8995, 0.9195, 0.9395, 0.9595, 0.9795, 0.9995, 1.0195, 1.0395,
869 1.0595, 1.0795, 1.0995, 1.1195, 1.1395, 1.1595, 1.1795, 1.1995, 1.2195, 1.2395, 1.2595, 1.2795, 1.2995,
870 1.3195, 1.3395, 1.3595, 1.3795, 1.3995, 1.4195, 1.4395, 1.4595, 1.4795, 1.4995, 1.5195, 1.5395, 1.5595,
871 1.5795, 1.5995, 1.6195, 1.6395, 1.6595, 1.6795, 1.6995, 1.7195, 1.7395, 1.7595, 1.7795, 1.7995, 1.8195,
872 1.8395, 1.8595, 1.8795, 1.8995, 1.9195, 1.9395, 1.9595, 1.9795, 1.9995, 2.0195, 2.0395, 2.0595, 2.0795,
873 2.0995, 2.1195, 2.1395, 2.1595, 2.1795, 2.1995, 2.2195, 2.2395, 2.2595, 2.2795, 2.2995, 2.3195, 2.3395,
874 2.3595, 2.3795, 2.3995, 2.4195, 2.4395, 2.4595, 2.4795, 2.4995, 2.5195, 2.5395, 2.5595, 2.5795, 2.5995,
875 2.6195, 2.6395, 2.6595, 2.6795, 2.6995, 2.7195, 2.7395, 2.7595, 2.7795, 2.7995, 2.8195, 2.8395, 2.8595,
876 2.8795, 2.8995, 2.9195, 2.9395, 2.9595, 2.9795, 2.9995, 3.0195, 3.0395, 3.0595, 3.0795, 3.0995, 3.1195,
877 3.1395, 3.1595, 3.1795, 3.1995, 3.2195, 3.2395, 3.2595, 3.2795, 3.2995, 3.3195, 3.3395, 3.3595, 3.3795,
878 3.3995};
879
880 if (mainMotherPdg == 99009011) {
881 //inmed 12AGeV
882 Double_t scale[170] = {
883 41.706, 18.918, 11.465, 8.4388, 5.9176, 4.9025, 3.8087, 3.0387, 2.5856,
884 2.1142, 1.7603, 1.5327, 1.28, 1.1579, 1.0367, 0.89355, 0.81317, 0.71582,
885 0.65863, 0.59678, 0.53702, 0.45378, 0.41238, 0.37502, 0.33593, 0.28791, 0.26352,
886 0.23939, 0.21167, 0.19479, 0.19204, 0.17492, 0.15811, 0.15479, 0.14935, 0.13803,
887 0.1354, 0.11993, 0.1046, 0.08226, 0.073183, 0.055433, 0.043467, 0.033975, 0.028025,
888 0.021504, 0.016863, 0.014108, 0.01094, 0.0088095, 0.007324, 0.0057162, 0.0046817, 0.0037459,
889 0.0030017, 0.0024459, 0.0020671, 0.0016089, 0.0013754, 0.0011223, 0.00096256, 0.00081647, 0.00072656,
890 0.00060776, 0.00051243, 0.00045705, 0.00039636, 0.00036259, 0.00033248, 0.0002953, 0.00027328, 0.00023776,
891 0.00022163, 0.00019852, 0.000186, 0.00016846, 0.00015469, 0.00014169, 0.00013343, 0.00011594, 0.00010722,
892 0.00010205, 9.1907e-05, 8.3718e-05, 7.5457e-05, 6.7192e-05, 6.2202e-05, 5.7372e-05, 4.8314e-05, 4.5502e-05,
893 4.1334e-05, 3.7429e-05, 3.2131e-05, 3.0103e-05, 2.6125e-05, 2.3601e-05, 2.1167e-05, 1.94e-05, 1.7025e-05,
894 1.5496e-05, 1.3704e-05, 1.1866e-05, 1.1135e-05, 9.8842e-06, 8.9101e-06, 7.9225e-06, 7.0706e-06, 6.3536e-06,
895 5.3786e-06, 4.7179e-06, 4.2128e-06, 4.0015e-06, 3.4118e-06, 3.1864e-06, 2.734e-06, 2.3844e-06, 2.173e-06,
896 1.8774e-06, 1.6468e-06, 1.501e-06, 1.3597e-06, 1.2113e-06, 1.0384e-06, 9.4105e-07, 8.4223e-07, 7.434e-07,
897 6.5049e-07, 5.8824e-07, 5.3603e-07, 4.6756e-07, 4.1173e-07, 3.5872e-07, 3.2764e-07, 2.9889e-07, 2.5989e-07,
898 2.219e-07, 1.9468e-07, 1.816e-07, 1.5707e-07, 1.3565e-07, 1.2619e-07, 1.0919e-07, 1.0071e-07, 8.4632e-08,
899 7.6459e-08, 6.829e-08, 6.2046e-08, 5.5335e-08, 4.5937e-08, 4.2426e-08, 3.567e-08, 3.4051e-08, 2.9627e-08,
900 2.5249e-08, 2.2767e-08, 2.1054e-08, 1.7873e-08, 1.574e-08, 1.3713e-08, 1.23e-08, 1.1045e-08, 9.5536e-09,
901 8.5859e-09, 7.7217e-09, 6.9958e-09, 6.0992e-09, 5.3453e-09, 4.7659e-09, 4.3313e-09, 3.6575e-09};
902 TSpline3* weight = new TSpline3("inmedwghts", mass, scale, 170);
903 TLorentzVector mom;
904 mother->Get4Momentum(mom);
905 Double_t corrw = weight->Eval(mom.M()); //mother->GetMass()
906 values[kWeight] *= corrw;
907 delete weight;
908 }
909 if (mainMotherPdg == 99009111) {
910 Double_t scale[170] = {
911 39.496, 17.961, 11.024, 8.2093, 5.8331, 4.8995, 3.8612, 3.1258, 2.7006,
912 2.2465, 1.908, 1.699, 1.4435, 1.3253, 1.2059, 1.049, 0.96753, 0.86685,
913 0.81407, 0.75959, 0.70663, 0.61951, 0.58586, 0.55534, 0.51902, 0.46377, 0.4415,
914 0.41412, 0.37414, 0.34883, 0.34494, 0.31141, 0.2762, 0.26331, 0.24693, 0.22286,
915 0.21697, 0.1972, 0.1841, 0.16097, 0.16352, 0.14345, 0.13096, 0.11911, 0.11399,
916 0.10111, 0.0913, 0.08764, 0.077745, 0.071417, 0.067561, 0.05987, 0.055543, 0.050193,
917 0.045244, 0.04128, 0.03898, 0.03365, 0.031622, 0.028217, 0.026215, 0.023919, 0.022648,
918 0.019915, 0.017524, 0.016145, 0.014357, 0.013362, 0.012368, 0.011036, 0.010198, 0.0088275,
919 0.0081762, 0.0072697, 0.00675, 0.0060424, 0.0054788, 0.0049588, 0.0046174, 0.0039685, 0.00363,
920 0.0034204, 0.0030534, 0.0027606, 0.0024723, 0.0021893, 0.0020174, 0.0018545, 0.0015584, 0.0014661,
921 0.0013315, 0.0012065, 0.0010375, 0.00097456, 0.00084865, 0.00076982, 0.00069371, 0.00063931, 0.00056442,
922 0.00051712, 0.00046054, 0.00040174, 0.00037996, 0.00034009, 0.00030921, 0.00027738, 0.00024981, 0.00022659,
923 0.00019366, 0.00017153, 0.00015469, 0.00014841, 0.00012783, 0.00012061, 0.00010456, 9.2145e-05, 8.4856e-05,
924 7.4087e-05, 6.5675e-05, 6.0496e-05, 5.5386e-05, 4.9865e-05, 4.3202e-05, 3.9571e-05, 3.5821e-05, 3.201e-05,
925 2.8322e-05, 2.5886e-05, 2.384e-05, 2.1016e-05, 1.8703e-05, 1.6467e-05, 1.5199e-05, 1.4011e-05, 1.2311e-05,
926 1.0621e-05, 9.4155e-06, 8.874e-06, 7.7548e-06, 6.7662e-06, 6.3589e-06, 5.5585e-06, 5.1791e-06, 4.3965e-06,
927 4.012e-06, 3.6195e-06, 3.3215e-06, 2.9918e-06, 2.5084e-06, 2.3397e-06, 1.9865e-06, 1.915e-06, 1.6826e-06,
928 1.448e-06, 1.3183e-06, 1.231e-06, 1.0551e-06, 9.3811e-07, 8.2511e-07, 7.4714e-07, 6.7735e-07, 5.9142e-07,
929 5.3654e-07, 4.8709e-07, 4.4543e-07, 3.9199e-07, 3.4674e-07, 3.1203e-07, 2.862e-07, 2.4391e-07};
930 TSpline3* weight = new TSpline3("inmedwghts", mass, scale, 170);
931 TLorentzVector mom;
932 mother->Get4Momentum(mom);
933 Double_t corrw = weight->Eval(mom.M());
934 values[kWeight] *= corrw;
935 delete weight;
936 }
937 }
938 }
939 }
940
941 // Reset
943
944 // Set DATA default (refitted sts track to primary vertex)
945 values[kPx] = track->Px();
946 values[kPy] = track->Py();
947 values[kPz] = track->Pz();
948 values[kPt] = track->Pt();
949 values[kPtSq] = track->Pt() * track->Pt();
950 values[kP] = track->P();
951
952 values[kXv] = track->Xv();
953 values[kYv] = track->Yv();
954 values[kZv] = track->Zv();
955
956 values[kOneOverPt] = (track->Pt() > 1.0e-3 ? track->OneOverPt() : 0.0);
957 values[kPhi] = (TMath::IsNaN(track->Phi()) ? -999. : TVector2::Phi_0_2pi(track->Phi()));
958 values[kTheta] = track->Theta();
959 // values[kEta] = track->Eta();
960 values[kY] = track->Y() - values[kYbeam];
961 values[kYlab] = track->Y();
962 values[kE] = track->E();
963 values[kM] = track->M();
964 values[kCharge] = track->Charge();
965 values[kMt] = TMath::Sqrt(values[kMPair] * values[kMPair] + values[kPtSq]);
966 values[kPdgCode] = track->PdgCode();
967 values[kChi2NDFtoVtx] = track->ChiToVertex();
968 values[kImpactParXY] = TMath::Sqrt(TMath::Power(TMath::Abs(values[kXv] - values[kXvPrim]), 2)
969 + TMath::Power(TMath::Abs(values[kYv] - values[kYvPrim]), 2));
970 values[kImpactParZ] = TMath::Abs(values[kZv] - values[kZvPrim]);
971
972 // special
974 // values[kTrackLength] = track->GetGlobalTrack()->GetLength(); // cm
975 values[kInclAngle] = TMath::ASin(track->Pt() / track->P());
976 Fill(track->GetTofHit(), values);
977 values[kTofHits] = (track->GetTofHit() ? 1. : 0.);
978 values[kRndmTrack] = gRandom->Rndm();
979}
980
981inline void PairAnalysisVarManager::FillVarGlobalTrack(const CbmGlobalTrack* track, Double_t* const values)
982{
983 //
984 // Fill track information for the global track into array
985 //
986
987 // Protect
988 if (!track) return;
989
990 // Set
991 values[kTrackChi2NDF] = (track->GetNDF() > 0. ? track->GetChi2() / track->GetNDF() : -999.);
992 values[kTrackLength] = track->GetLength(); // cm
993 // accessors via first FairTrackParam
994 TVector3 mom;
995 track->GetParamFirst()->Momentum(mom);
996 values[kPin] = mom.Mag();
997 values[kPtin] = mom.Pt();
998 track->GetParamLast()->Momentum(mom);
999 values[kPout] = mom.Mag();
1000 values[kPtout] = mom.Pt();
1001 values[kCharge] = (track->GetParamFirst()->GetQp() > 0. ? +1. : -1.);
1002}
1003
1004inline void PairAnalysisVarManager::FillVarRichRing(const CbmRichRing* track, Double_t* const values)
1005{
1006 //
1007 // Fill track information for the trd track into array
1008 //
1009
1010 // Protect
1011 if (!track) return;
1012
1013 // Set
1014 //Do Select is no longer supported use CbmRichElectronIdAnn::GetInstance().CalculateAnnValue(globalTrackIndex, momentum);
1015 // values[kRichPidANN] = -1; // fgRichElIdAnn->DoSelect(const_cast<CbmRichRing*>(track), values[kP]); // PID value ANN method
1016 values[kRichHitsOnRing] = track->GetNofHitsOnRing();
1017 values[kRichHits] = track->GetNofHits();
1018 values[kRichChi2NDF] = (track->GetNDF() > 0. ? track->GetChi2() / track->GetNDF() : -999.);
1019 values[kRichRadius] = track->GetRadius();
1020 values[kRichAxisA] = track->GetAaxis();
1021 values[kRichAxisB] = track->GetBaxis();
1022 values[kRichCenterX] = track->GetCenterX();
1023 values[kRichCenterY] = track->GetCenterY();
1024 // CbmRichRing::GetDistance() method is no longer supported
1025 // If you wan to use cuts update code using CbmRichUtil::GetRingTrackDistance()
1026 // values[kRichDistance] = 1.;
1027 values[kRichRadialPos] = track->GetRadialPosition();
1028 values[kRichRadialAngle] = track->GetRadialAngle();
1029 values[kRichPhi] = track->GetPhi();
1030}
1031
1032inline void PairAnalysisVarManager::FillVarTrdTrack(const CbmTrdTrack* track, Double_t* const values)
1033{
1034 //
1035 // Fill track information for the trd track into array
1036 //
1037
1038 // Protect
1039 if (!track) return;
1040
1041 // Calculate eloss
1042 TClonesArray* hits = fgEvent->GetHits(ECbmModuleId::kTrd);
1043 if (hits && track->GetELoss() < 1.e-8 /*&& Req(kTrdSignal)*/) {
1044 Double_t eloss = 0;
1045 for (Int_t ihit = 0; ihit < track->GetNofHits(); ihit++) {
1046 Int_t idx = track->GetHitIndex(ihit);
1047 CbmTrdHit* hit = (CbmTrdHit*) hits->At(idx);
1048 if (hit) {
1049 eloss += hit->GetELoss(); // dEdx + TR
1050 }
1051 }
1052 // printf("track %p \t eloss %.3e \n",track,eloss);
1053 const_cast<CbmTrdTrack*>(track)->SetELoss(eloss); // NOTE: this is the sum
1054 }
1055
1056 // Set
1057 values[kTrdSignal] = track->GetELoss() * 1.e+6; //GeV->keV, NOTE: see corrections,normalisation below (angles,#hits)
1058 values[kTrdPidWkn] = track->GetPidWkn(); // PID value Wkn method
1059 values[kTrdPidANN] = track->GetPidANN(); // PID value ANN method
1060 // PID value Likelihood method
1061 values[kTrdPidLikeEL] = track->GetPidLikeEL();
1062 values[kTrdPidLikePI] = track->GetPidLikePI();
1063 values[kTrdPidLikeKA] = track->GetPidLikeKA();
1064 values[kTrdPidLikePR] = track->GetPidLikePR();
1065 values[kTrdPidLikeMU] = track->GetPidLikeMU();
1066 // accessors via CbmTrack
1067 values[kTrdHits] = track->GetNofHits();
1068 values[kTrdChi2NDF] = (track->GetNDF() > 0. ? track->GetChiSq() / track->GetNDF() : -999.);
1069 // accessors via first FairTrackParam
1070 TVector3 mom;
1071 track->GetParamFirst()->Momentum(mom);
1072 values[kTrdPin] = mom.Mag();
1073 values[kTrdPtin] = mom.Pt();
1074 values[kTrdThetain] = mom.Theta();
1075 values[kTrdPhiin] = mom.Phi();
1076 // correction factors
1077 values[kTrdThetaCorr] = 1. / mom.CosTheta();
1078 values[kTrdPhiCorr] = 1. / TMath::Cos(mom.Phi());
1079 // apply correction and normalisation
1080 values[kTrdSignal] /= values[kTrdHits]; // * values[kTrdThetaCorr] * values[kTrdPhiCorr]);
1081
1082 track->GetParamLast()->Momentum(mom);
1083 values[kTrdPout] = mom.Mag();
1084 values[kTrdPtout] = mom.Pt();
1085 // values[kTrdCharge] = (track->GetParamFirst()->GetQp()>0. ? +1. : -1. );
1086 /* TVector3 pos1; */
1087 /* track->GetParamFirst()->Position(pos1); */
1088 /* TVector3 pos2; */
1089 /* track->GetParamLast()->Position(pos2); */
1090 // values[kTrdTrackLength] = (pos2!=pos1 ? (pos2-=pos1).Mag() : 1.);
1091}
1092
1093inline void PairAnalysisVarManager::FillVarStsTrack(const CbmStsTrack* track, Double_t* const values)
1094{
1095 //
1096 // Fill track information for the Sts track into array
1097 //
1098
1099 // Protect
1100 if (!track) return;
1101
1102 // Calculate first hit position for sts and mvd
1103 Double_t minSts = 9999.;
1104 TClonesArray* hits = fgEvent->GetHits(ECbmModuleId::kSts);
1105 if (hits /*&& Req(kStsFirstHitPosZ)*/) {
1106 for (Int_t ihit = 0; ihit < track->GetNofStsHits(); ihit++) {
1107 Int_t idx = track->GetStsHitIndex(ihit);
1108 CbmStsHit* hit = (CbmStsHit*) hits->At(idx);
1109 if (hit && minSts > hit->GetZ()) {
1110 minSts = hit->GetZ();
1111 // Printf("hit %d idx %d position %.5f",ihit,idx,min);
1112 }
1113 }
1114 }
1115 Double_t minMvd = 9999.;
1117 if (hits) {
1118 for (Int_t ihit = 0; ihit < track->GetNofMvdHits(); ihit++) {
1119 Int_t idx = track->GetMvdHitIndex(ihit);
1120 CbmMvdHit* hit = (CbmMvdHit*) hits->At(idx);
1121 if (hit && minMvd > hit->GetZ()) { minMvd = hit->GetZ(); }
1122 }
1123 }
1124
1125 // Set
1126 values[kMvdHits] = track->GetNofMvdHits();
1127 // values[kImpactParZ] = track->GetB(); //Impact parameter of track at target z, in units of its error
1128 // printf(" mom %f impactparz %f \n",values[kPout],values[kImpactParZ]);
1129 // accessors via CbmTrack
1130 values[kStsHits] = track->GetNofStsHits();
1131 values[kStsMvdHits] = track->GetNofStsHits() + track->GetNofMvdHits();
1132 values[kStsChi2NDF] = (track->GetNDF() > 0. ? track->GetChiSq() / track->GetNDF() : -999.);
1133 // accessors via first FairTrackParam
1134 TVector3 mom;
1135 track->GetParamFirst()->Momentum(mom);
1136 values[kStsPin] = mom.Mag();
1137 values[kStsPtin] = mom.Pt();
1138 track->GetParamFirst()->Position(mom);
1139 values[kStsXv] = mom.X();
1140 values[kStsYv] = mom.Y();
1141 values[kStsZv] = mom.Z();
1142 track->GetParamLast()->Momentum(mom);
1143 values[kStsPout] = mom.Mag();
1144 values[kStsPtout] = mom.Pt();
1145 // values[kStsCharge] = (track->GetParamFirst()->GetQp()>0. ? +1. : -1. );
1146
1147 values[kMvdFirstHitPosZ] = minMvd;
1148 values[kStsFirstHitPosZ] = minSts;
1149}
1150
1151inline void PairAnalysisVarManager::FillVarMuchTrack(const CbmMuchTrack* track, Double_t* const values)
1152{
1153 //
1154 // Fill track information for the Much track into array
1155 //
1156
1157 // Protect
1158 if (!track) return;
1159
1160 // Calculate straw, (TODO:trigger) and pixel hits
1161 values[kMuchHitsPixel] = 0.;
1162 for (Int_t ihit = 0; ihit < track->GetNofHits(); ihit++) {
1163 // Int_t idx = track->GetHitIndex(ihit);
1164 Int_t hitType = track->GetHitType(ihit);
1166 }
1167
1168 // Set
1169 // accessors via CbmTrack
1170 values[kMuchHits] = track->GetNofHits();
1171 values[kMuchChi2NDF] = (track->GetNDF() > 0. ? track->GetChiSq() / track->GetNDF() : -999.);
1172}
1173
1175 Double_t* const values)
1176{
1177 //
1178 // fill 2 track information starting from MC legs
1179 //
1180
1181 // Reset
1183
1184 // Protect
1185 if (!p1 || !p2) return;
1186
1187 // Get the MC interface if available
1189 if (!mc->HasMC()) return;
1190
1191 // Set
1192 CbmMCTrack* mother = nullptr;
1193 // CbmMCTrack* smother = nullptr;
1194 Int_t mLabel1 = p1->GetMotherId();
1195 Int_t mLabel2 = p2->GetMotherId();
1196 if (mLabel1 == mLabel2) mother = mc->GetMCTrackFromMCEvent(mLabel1);
1197 /* mother = mc->GetMCTrackFromMCEvent(mLabel1); */
1198 /* smother = mc->GetMCTrackFromMCEvent(mLabel2); */
1199
1201 pair->SetMCTracks(p1, p2);
1202
1203 if (mother) {
1204 FillVarMCTrack(mother, values);
1207 // FillVarMCTrack(smother, values);
1208 }
1209 else {
1210 values[kPxMC] = pair->Px();
1211 values[kPyMC] = pair->Py();
1212 values[kPzMC] = pair->Pz();
1213 values[kPtMC] = pair->Pt();
1214 values[kPtSqMC] = pair->Pt() * pair->Pt();
1215 values[kPMC] = pair->P();
1216
1217 values[kXvMC] = pair->Xv();
1218 values[kYvMC] = pair->Yv();
1219 if (mother)
1220 if (mother->GetPdgCode() == 22)
1221 std::cout << pair->Xv() << " " << pair->Xv() * pair->Xv() << " "
1222 << TMath::Sqrt(pair->Xv() * pair->Xv() + pair->Yv() * pair->Yv()) << " " << pair->Zv() << std::endl;
1223 values[kRvMC] = TMath::Sqrt(pair->Xv() * pair->Xv() + pair->Yv() * pair->Yv());
1224 values[kZvMC] = pair->Zv();
1225 //TODO values[kTMC] = 0.;
1226
1227 values[kOneOverPtMC] = (pair->Pt() > 1.0e-3 ? pair->OneOverPt() : 0.0);
1228 values[kPhiMC] = (TMath::IsNaN(pair->Phi()) ? -999. : TVector2::Phi_0_2pi(pair->Phi()));
1229 values[kThetaMC] = pair->Theta();
1230 // values[kEtaMC] = pair->Eta();
1231 values[kYMC] = pair->Y() - values[kYbeam];
1232 values[kYlabMC] = pair->Y();
1233 values[kEMC] = pair->E();
1234 values[kMMC] = pair->M();
1235 values[kChargeMC] = p1->GetCharge() * p2->GetCharge();
1236 }
1237 values[kOpeningAngleMC] = pair->OpeningAngle();
1238 values[kCosPointingAngleMC] = fgVertexMC ? pair->GetCosPointingAngle(fgVertexMC) : -1;
1239 // values[kPhivPairMC] = pair->PhivPair(1.);
1240
1241
1242 // delete the surplus pair
1243 delete pair;
1244}
1245
1246inline void PairAnalysisVarManager::FillVarMCTrack(const CbmMCTrack* particle, Double_t* const values)
1247{
1248 //
1249 // fill particle information from MC leg
1250 //
1251
1252 // Reset
1254
1255 // Protect
1256 if (!particle) return;
1257
1258 // Get the MC interface if available
1260 if (!mc->HasMC()) return;
1261
1262 // Set
1263 Int_t mLabel1 = particle->GetMotherId();
1264 CbmMCTrack* mother = mc->GetMCTrackFromMCEvent(mLabel1);
1265
1266 values[kPdgCode] = particle->GetPdgCode();
1267 values[kPdgCodeMother] = (mother ? mother->GetPdgCode() : -99999.);
1268
1269 if (mother) {
1270 // if(particle->GetPdgCode() == 11 || particle->GetPdgCode() == -11) std::cout<< particle->GetPdgCode() <<" " << mother->GetPdgCode() <<" "<< particle->GetGeantProcessId() <<std::endl;
1271 if (mother->GetPdgCode() == 22) values[kPdgCodeMother] = 1;
1272 if (mother->GetPdgCode() == 111) values[kPdgCodeMother] = 3;
1273 if (mother->GetPdgCode() == 211 || mother->GetPdgCode() == -211) values[kPdgCodeMother] = 5;
1274 if (mother->GetPdgCode() == 2212) values[kPdgCodeMother] = 7;
1275 if (mother->GetPdgCode() == 99009011 || mother->GetPdgCode() == 99009111) values[kPdgCodeMother] = 9;
1276 }
1277
1278
1279 values[kEMotherMC] = (mother ? mother->GetEnergy() : -99999.);
1280 CbmMCTrack* granni = nullptr;
1281 if (mother) granni = mc->GetMCTrackMother(mother);
1282 values[kPdgCodeGrandMother] = (granni ? granni->GetPdgCode() : -99999.); //mc->GetMotherPDG(mother);
1283 values[kGeantId] = particle->GetGeantProcessId();
1284
1285 values[kPxMC] = particle->GetPx();
1286 values[kPyMC] = particle->GetPy();
1287 values[kPzMC] = particle->GetPz();
1288 values[kPtMC] = particle->GetPt();
1289 values[kPtSqMC] = particle->GetPt() * particle->GetPt();
1290 values[kPMC] = particle->GetP();
1291
1292 values[kXvMC] = particle->GetStartX();
1293 values[kYvMC] = particle->GetStartY();
1294 values[kZvMC] = particle->GetStartZ();
1295 // if(mother) if(mother->GetPdgCode() == 22) std::cout<<particle->GetStartX()<<" "<<particle->GetStartX()*particle->GetStartX()<<" "<< TMath::Sqrt( particle->GetStartX()*particle->GetStartX() + particle->GetStartY()*particle->GetStartY() ) <<" " << particle->GetStartZ()<<std::endl;
1296 values[kRvMC] =
1297 TMath::Sqrt(particle->GetStartX() * particle->GetStartX() + particle->GetStartY() * particle->GetStartY());
1298
1299 TVector3 vtx;
1300 particle->GetStartVertex(vtx);
1301 values[kPhivMC] = vtx.Phi();
1302 values[kThetavMC] = vtx.Theta();
1303 //TODO values[kTMC] = particle->GetStartT(); [ns]
1304
1305 TLorentzVector mom;
1306 if (particle) particle->Get4Momentum(mom);
1307 values[kOneOverPtMC] = (particle->GetPt() > 1.0e-3 ? 1. / particle->GetPt() : 0.0);
1308 values[kPhiMC] = (TMath::IsNaN(mom.Phi()) ? -999. : TVector2::Phi_0_2pi(mom.Phi()));
1309 values[kThetaMC] = mom.Theta();
1310 // values[kEtaMC] = mom.Eta();
1311 values[kYMC] = particle->GetRapidity() - values[kYbeam];
1312 ;
1313 values[kYlabMC] = particle->GetRapidity();
1314 Double_t pom = particle->GetP() / particle->GetMass();
1315 Double_t beta = pom / TMath::Sqrt(pom * pom + 1.);
1316 // Double_t gamma = 1./ TMath::Sqrt(1.-pom*pom);
1317 values[kBetaGammaMC] = 1. / TMath::Sqrt(1. - beta * beta);
1318 values[kEMC] = particle->GetEnergy();
1319 values[kMMC] = mom.M(); //particle->GetMass();
1320 values[kChargeMC] = particle->GetCharge();
1321
1322 // detector info
1323 values[kRichHitsMC] = particle->GetNPoints(ECbmModuleId::kRich);
1324 values[kTrdHitsMC] = particle->GetNPoints(ECbmModuleId::kTrd);
1325 values[kMvdHitsMC] = particle->GetNPoints(ECbmModuleId::kMvd);
1326 values[kStsHitsMC] = particle->GetNPoints(ECbmModuleId::kSts);
1328 values[kTofHitsMC] = particle->GetNPoints(ECbmModuleId::kTof);
1329 values[kMuchHitsMC] = particle->GetNPoints(ECbmModuleId::kMuch);
1330}
1331
1332inline void PairAnalysisVarManager::FillVarPairAnalysisPair(const PairAnalysisPair* pair, Double_t* const values)
1333{
1334 //
1335 // Fill pair information available for histogramming into an array
1336 //
1337
1338 // Reset
1339 ResetArrayData(kPairMax, values);
1341
1342 // Protect
1343 if (!pair) return;
1344
1345 // set the beamenergy (needed by some variables)
1346 pair->SetBeamEnergy(values[kEbeam]);
1347
1348 // first fill mc info to avoid kWeight beeing reset
1349 // TODO: check if it makes sence only for pairtypes of SE
1350 FillVarMCParticle(pair->GetFirstDaughter()->GetMCTrack(), pair->GetSecondDaughter()->GetMCTrack(), values);
1351
1352 // Set
1353 values[kPairType] = pair->GetType();
1354
1355 values[kPx] = pair->Px();
1356 values[kPy] = pair->Py();
1357 values[kPz] = pair->Pz();
1358 values[kPt] = pair->Pt();
1359 values[kPtSq] = pair->Pt() * pair->Pt();
1360 values[kP] = pair->P();
1361
1362 values[kXv] = pair->Xv();
1363 values[kYv] = pair->Yv();
1364 values[kZv] = pair->Zv();
1365
1366 values[kOneOverPt] = (pair->Pt() > 1.0e-3 ? pair->OneOverPt() : 0.0);
1367 values[kPhi] = (TMath::IsNaN(pair->Phi()) ? -999. : TVector2::Phi_0_2pi(pair->Phi()));
1368 values[kTheta] = pair->Theta();
1369 // values[kEta] = pair->Eta();
1370 values[kY] = pair->Y() - values[kYbeam];
1371 values[kYlab] = pair->Y();
1372 values[kE] = pair->E();
1373 values[kM] = pair->M();
1374 values[kCharge] = pair->Charge();
1375 values[kMt] = TMath::Sqrt(values[kMPair] * values[kMPair] + values[kPtSq]);
1376
1378 /* values[kPdgCode]=-1; */
1379 /* values[kPdgCodeMother]=-1; */
1380 /* values[kPdgCodeGrandMother]=-1; */
1381 values[kWeight] = pair->GetWeight();
1382
1383 if (pair->GetFirstDaughter()->GetMCTrack() || pair->GetSecondDaughter()->GetMCTrack()) {
1385 if (!mc->HasMC()) return;
1386
1387 // Set
1388
1389 Int_t motherCode = -99999.;
1390 Int_t mLabel1 = -1;
1391 Double_t mMass1 = 0.;
1392 if (pair->GetFirstDaughter()->GetMCTrack()) {
1393 mLabel1 = pair->GetFirstDaughter()->GetMCTrack()->GetMotherId();
1394 CbmMCTrack* mother = mc->GetMCTrackFromMCEvent(mLabel1);
1395 motherCode = (mother ? mother->GetPdgCode() : -99999.);
1396 if (mother) {
1397 TLorentzVector mom;
1398 mother->Get4Momentum(mom);
1399 mMass1 = mom.M();
1400 }
1401 }
1402 Int_t secondMother = -99999.;
1403 Int_t mLabel2 = -1;
1404 Double_t mMass2 = 0.;
1405 if (pair->GetSecondDaughter()->GetMCTrack()) {
1406 mLabel2 = pair->GetSecondDaughter()->GetMCTrack()->GetMotherId();
1407 CbmMCTrack* sm = mc->GetMCTrackFromMCEvent(mLabel2);
1408 secondMother = (sm ? sm->GetPdgCode() : -99999.);
1409 if (sm) {
1410 TLorentzVector mom;
1411 sm->Get4Momentum(mom);
1412 mMass2 = mom.M();
1413 }
1414 }
1415
1416 if (values[kThermalScaling] == 3) {
1417 Double_t mass[170] = {
1418 0.0195, 0.0395, 0.0595, 0.0795, 0.0995, 0.1195, 0.1395, 0.1595, 0.1795, 0.1995, 0.2195, 0.2395, 0.2595, 0.2795,
1419 0.2995, 0.3195, 0.3395, 0.3595, 0.3795, 0.3995, 0.4195, 0.4395, 0.4595, 0.4795, 0.4995, 0.5195, 0.5395, 0.5595,
1420 0.5795, 0.5995, 0.6195, 0.6395, 0.6595, 0.6795, 0.6995, 0.7195, 0.7395, 0.7595, 0.7795, 0.7995, 0.8195, 0.8395,
1421 0.8595, 0.8795, 0.8995, 0.9195, 0.9395, 0.9595, 0.9795, 0.9995, 1.0195, 1.0395, 1.0595, 1.0795, 1.0995, 1.1195,
1422 1.1395, 1.1595, 1.1795, 1.1995, 1.2195, 1.2395, 1.2595, 1.2795, 1.2995, 1.3195, 1.3395, 1.3595, 1.3795, 1.3995,
1423 1.4195, 1.4395, 1.4595, 1.4795, 1.4995, 1.5195, 1.5395, 1.5595, 1.5795, 1.5995, 1.6195, 1.6395, 1.6595, 1.6795,
1424 1.6995, 1.7195, 1.7395, 1.7595, 1.7795, 1.7995, 1.8195, 1.8395, 1.8595, 1.8795, 1.8995, 1.9195, 1.9395, 1.9595,
1425 1.9795, 1.9995, 2.0195, 2.0395, 2.0595, 2.0795, 2.0995, 2.1195, 2.1395, 2.1595, 2.1795, 2.1995, 2.2195, 2.2395,
1426 2.2595, 2.2795, 2.2995, 2.3195, 2.3395, 2.3595, 2.3795, 2.3995, 2.4195, 2.4395, 2.4595, 2.4795, 2.4995, 2.5195,
1427 2.5395, 2.5595, 2.5795, 2.5995, 2.6195, 2.6395, 2.6595, 2.6795, 2.6995, 2.7195, 2.7395, 2.7595, 2.7795, 2.7995,
1428 2.8195, 2.8395, 2.8595, 2.8795, 2.8995, 2.9195, 2.9395, 2.9595, 2.9795, 2.9995, 3.0195, 3.0395, 3.0595, 3.0795,
1429 3.0995, 3.1195, 3.1395, 3.1595, 3.1795, 3.1995, 3.2195, 3.2395, 3.2595, 3.2795, 3.2995, 3.3195, 3.3395, 3.3595,
1430 3.3795, 3.3995};
1431
1432 if (motherCode == 99009011 || secondMother == 99009011) {
1433 //inmed 12AGeV
1434 Double_t scale[170] = {
1435 41.706, 18.918, 11.465, 8.4388, 5.9176, 4.9025, 3.8087, 3.0387, 2.5856,
1436 2.1142, 1.7603, 1.5327, 1.28, 1.1579, 1.0367, 0.89355, 0.81317, 0.71582,
1437 0.65863, 0.59678, 0.53702, 0.45378, 0.41238, 0.37502, 0.33593, 0.28791, 0.26352,
1438 0.23939, 0.21167, 0.19479, 0.19204, 0.17492, 0.15811, 0.15479, 0.14935, 0.13803,
1439 0.1354, 0.11993, 0.1046, 0.08226, 0.073183, 0.055433, 0.043467, 0.033975, 0.028025,
1440 0.021504, 0.016863, 0.014108, 0.01094, 0.0088095, 0.007324, 0.0057162, 0.0046817, 0.0037459,
1441 0.0030017, 0.0024459, 0.0020671, 0.0016089, 0.0013754, 0.0011223, 0.00096256, 0.00081647, 0.00072656,
1442 0.00060776, 0.00051243, 0.00045705, 0.00039636, 0.00036259, 0.00033248, 0.0002953, 0.00027328, 0.00023776,
1443 0.00022163, 0.00019852, 0.000186, 0.00016846, 0.00015469, 0.00014169, 0.00013343, 0.00011594, 0.00010722,
1444 0.00010205, 9.1907e-05, 8.3718e-05, 7.5457e-05, 6.7192e-05, 6.2202e-05, 5.7372e-05, 4.8314e-05, 4.5502e-05,
1445 4.1334e-05, 3.7429e-05, 3.2131e-05, 3.0103e-05, 2.6125e-05, 2.3601e-05, 2.1167e-05, 1.94e-05, 1.7025e-05,
1446 1.5496e-05, 1.3704e-05, 1.1866e-05, 1.1135e-05, 9.8842e-06, 8.9101e-06, 7.9225e-06, 7.0706e-06, 6.3536e-06,
1447 5.3786e-06, 4.7179e-06, 4.2128e-06, 4.0015e-06, 3.4118e-06, 3.1864e-06, 2.734e-06, 2.3844e-06, 2.173e-06,
1448 1.8774e-06, 1.6468e-06, 1.501e-06, 1.3597e-06, 1.2113e-06, 1.0384e-06, 9.4105e-07, 8.4223e-07, 7.434e-07,
1449 6.5049e-07, 5.8824e-07, 5.3603e-07, 4.6756e-07, 4.1173e-07, 3.5872e-07, 3.2764e-07, 2.9889e-07, 2.5989e-07,
1450 2.219e-07, 1.9468e-07, 1.816e-07, 1.5707e-07, 1.3565e-07, 1.2619e-07, 1.0919e-07, 1.0071e-07, 8.4632e-08,
1451 7.6459e-08, 6.829e-08, 6.2046e-08, 5.5335e-08, 4.5937e-08, 4.2426e-08, 3.567e-08, 3.4051e-08, 2.9627e-08,
1452 2.5249e-08, 2.2767e-08, 2.1054e-08, 1.7873e-08, 1.574e-08, 1.3713e-08, 1.23e-08, 1.1045e-08, 9.5536e-09,
1453 8.5859e-09, 7.7217e-09, 6.9958e-09, 6.0992e-09, 5.3453e-09, 4.7659e-09, 4.3313e-09, 3.6575e-09};
1454 TSpline3* weight = new TSpline3("inmedwghts", mass, scale, 170);
1455 Double_t corrw = 0.;
1456 //Same mother: apply weight only once
1457 if (mLabel1 == mLabel2) {
1458 corrw = weight->Eval(mMass1);
1459 values[kWeight] *= corrw;
1460 }
1461 else { // different mothers -> apply weight for each track that comes from thermal source
1462 if (motherCode == 99009011) {
1463 corrw = weight->Eval(mMass1);
1464 values[kWeight] *= corrw;
1465 }
1466 if (secondMother == 99009011) {
1467 corrw = weight->Eval(mMass2);
1468 values[kWeight] *= corrw;
1469 }
1470 }
1471
1472 delete weight;
1473 }
1474 if (motherCode == 99009111 || secondMother == 99009111) {
1475 Double_t scale[170] = {
1476 39.496, 17.961, 11.024, 8.2093, 5.8331, 4.8995, 3.8612, 3.1258, 2.7006,
1477 2.2465, 1.908, 1.699, 1.4435, 1.3253, 1.2059, 1.049, 0.96753, 0.86685,
1478 0.81407, 0.75959, 0.70663, 0.61951, 0.58586, 0.55534, 0.51902, 0.46377, 0.4415,
1479 0.41412, 0.37414, 0.34883, 0.34494, 0.31141, 0.2762, 0.26331, 0.24693, 0.22286,
1480 0.21697, 0.1972, 0.1841, 0.16097, 0.16352, 0.14345, 0.13096, 0.11911, 0.11399,
1481 0.10111, 0.0913, 0.08764, 0.077745, 0.071417, 0.067561, 0.05987, 0.055543, 0.050193,
1482 0.045244, 0.04128, 0.03898, 0.03365, 0.031622, 0.028217, 0.026215, 0.023919, 0.022648,
1483 0.019915, 0.017524, 0.016145, 0.014357, 0.013362, 0.012368, 0.011036, 0.010198, 0.0088275,
1484 0.0081762, 0.0072697, 0.00675, 0.0060424, 0.0054788, 0.0049588, 0.0046174, 0.0039685, 0.00363,
1485 0.0034204, 0.0030534, 0.0027606, 0.0024723, 0.0021893, 0.0020174, 0.0018545, 0.0015584, 0.0014661,
1486 0.0013315, 0.0012065, 0.0010375, 0.00097456, 0.00084865, 0.00076982, 0.00069371, 0.00063931, 0.00056442,
1487 0.00051712, 0.00046054, 0.00040174, 0.00037996, 0.00034009, 0.00030921, 0.00027738, 0.00024981, 0.00022659,
1488 0.00019366, 0.00017153, 0.00015469, 0.00014841, 0.00012783, 0.00012061, 0.00010456, 9.2145e-05, 8.4856e-05,
1489 7.4087e-05, 6.5675e-05, 6.0496e-05, 5.5386e-05, 4.9865e-05, 4.3202e-05, 3.9571e-05, 3.5821e-05, 3.201e-05,
1490 2.8322e-05, 2.5886e-05, 2.384e-05, 2.1016e-05, 1.8703e-05, 1.6467e-05, 1.5199e-05, 1.4011e-05, 1.2311e-05,
1491 1.0621e-05, 9.4155e-06, 8.874e-06, 7.7548e-06, 6.7662e-06, 6.3589e-06, 5.5585e-06, 5.1791e-06, 4.3965e-06,
1492 4.012e-06, 3.6195e-06, 3.3215e-06, 2.9918e-06, 2.5084e-06, 2.3397e-06, 1.9865e-06, 1.915e-06, 1.6826e-06,
1493 1.448e-06, 1.3183e-06, 1.231e-06, 1.0551e-06, 9.3811e-07, 8.2511e-07, 7.4714e-07, 6.7735e-07, 5.9142e-07,
1494 5.3654e-07, 4.8709e-07, 4.4543e-07, 3.9199e-07, 3.4674e-07, 3.1203e-07, 2.862e-07, 2.4391e-07};
1495 TSpline3* weight = new TSpline3("inmedwghts", mass, scale, 170);
1496
1497 Double_t corrw = 0.;
1498 //Same mother: apply weight only once
1499 if (mLabel1 == mLabel2) {
1500 corrw = weight->Eval(mMass1);
1501 values[kWeight] *= corrw;
1502 }
1503 else { // different mothers -> apply weight for each track that comes from thermal source
1504 if (motherCode == 99009111) {
1505 corrw = weight->Eval(mMass1);
1506 values[kWeight] *= corrw;
1507 }
1508 if (secondMother == 99009111) {
1509 corrw = weight->Eval(mMass2);
1510 values[kWeight] *= corrw;
1511 }
1512 }
1513
1514 delete weight;
1515 }
1516 }
1517
1518 //inmed 3.42AGeV
1519 if (values[kThermalScaling] == 7) {
1520 if (motherCode == 99009011 || secondMother == 99009011) {
1521 Double_t mass[125] = {
1522 0.0195, 0.0395, 0.0595, 0.0795, 0.0995, 0.1195, 0.1395, 0.1595, 0.1795, 0.1995, 0.2195, 0.2395, 0.2595,
1523 0.2795, 0.2995, 0.3195, 0.3395, 0.3595, 0.3795, 0.3995, 0.4195, 0.4395, 0.4595, 0.4795, 0.4995, 0.5195,
1524 0.5395, 0.5595, 0.5795, 0.5995, 0.6195, 0.6395, 0.6595, 0.6795, 0.6995, 0.7195, 0.7395, 0.7595, 0.7795,
1525 0.7995, 0.8195, 0.8395, 0.8595, 0.8795, 0.8995, 0.9195, 0.9395, 0.9595, 0.9795, 0.9995, 1.0195, 1.0395,
1526 1.0595, 1.0795, 1.0995, 1.1195, 1.1395, 1.1595, 1.1795, 1.1995, 1.2195, 1.2395, 1.2595, 1.2795, 1.2995,
1527 1.3195, 1.3395, 1.3595, 1.3795, 1.3995, 1.4195, 1.4395, 1.4595, 1.4795, 1.4995, 1.5195, 1.5395, 1.5595,
1528 1.5795, 1.5995, 1.6195, 1.6395, 1.6595, 1.6795, 1.6995, 1.7195, 1.7395, 1.7595, 1.7795, 1.7995, 1.8195,
1529 1.8395, 1.8595, 1.8795, 1.8995, 1.9195, 1.9395, 1.9595, 1.9795, 1.9995, 2.0195, 2.0395, 2.0595, 2.0795,
1530 2.0995, 2.1195, 2.1395, 2.1595, 2.1795, 2.1995, 2.2195, 2.2395, 2.2595, 2.2795, 2.2995, 2.3195, 2.3395,
1531 2.3595, 2.3795, 2.3995, 2.4195, 2.4395, 2.4595, 2.4795, 2.4995};
1532
1533 Double_t scale[125] = {
1534 28.6773, 13.4566, 8.3913, 5.74418, 4.17493, 3.14912, 2.43708, 1.92407,
1535 1.54338, 1.25305, 1.02766, 0.850101, 0.713646, 0.605398, 0.516448, 0.445862,
1536 0.385488, 0.333449, 0.288725, 0.24875, 0.213922, 0.183566, 0.157146, 0.134313,
1537 0.1147, 0.0980171, 0.0839555, 0.0724097, 0.0630874, 0.0554402, 0.0492184, 0.0442134,
1538 0.0401273, 0.0367131, 0.0336863, 0.0308175, 0.0278289, 0.0244174, 0.0206308, 0.016819,
1539 0.013354, 0.0104392, 0.00810048, 0.00626932, 0.0048523, 0.00376027, 0.00291833, 0.00226873,
1540 0.00176674, 0.00137874, 0.001079, 0.000847372, 0.000668582, 0.000530747, 0.000424646, 0.000342751,
1541 0.000278383, 0.000228662, 0.000190229, 0.000159555, 0.00013539, 0.000115883, 0.000100173, 8.7451e-05,
1542 7.6779e-05, 6.78659e-05, 6.0253e-05, 5.37112e-05, 4.80505e-05, 4.30558e-05, 3.86565e-05, 3.47273e-05,
1543 3.11767e-05, 2.79639e-05, 2.50662e-05, 2.24603e-05, 2.01029e-05, 1.79612e-05, 1.60183e-05, 1.42617e-05,
1544 1.26788e-05, 1.1252e-05, 9.96625e-06, 8.81064e-06, 7.7753e-06, 6.85058e-06, 6.02588e-06, 5.29153e-06,
1545 4.63923e-06, 4.06136e-06, 3.55071e-06, 3.1002e-06, 2.70338e-06, 2.35454e-06, 2.04847e-06, 1.78043e-06,
1546 1.54601e-06, 1.34124e-06, 1.16263e-06, 1.00705e-06, 8.71694e-07, 7.54053e-07, 6.51895e-07, 5.63264e-07,
1547 4.86443e-07, 4.19912e-07, 3.6233e-07, 3.12522e-07, 2.69465e-07, 2.32265e-07, 2.00144e-07, 1.72419e-07,
1548 1.48498e-07, 1.27867e-07, 1.10079e-07, 9.47489e-08, 8.15401e-08, 7.01617e-08, 6.03625e-08, 5.19253e-08,
1549 4.46624e-08, 3.84113e-08, 3.3032e-08, 2.84035e-08, 2.44235e-08};
1550 TSpline3* weight = new TSpline3("inmedwghts", mass, scale, 125);
1551 Double_t corrw = 0.;
1552 //Same mother: apply weight only once
1553 if (mLabel1 == mLabel2) {
1554 corrw = weight->Eval(mMass1);
1555 values[kWeight] *= corrw;
1556 }
1557 else { // different mothers -> apply weight for each track that comes from thermal source
1558 if (motherCode == 99009011) {
1559 corrw = weight->Eval(mMass1);
1560 values[kWeight] *= corrw;
1561 }
1562 if (secondMother == 99009011) {
1563 corrw = weight->Eval(mMass2);
1564 values[kWeight] *= corrw;
1565 }
1566 }
1567 delete weight;
1568 }
1569 } //end thermal 7
1570 } //end pair->GetMC ...
1571
1572
1573 if (pair->GetFirstDaughter() && pair->GetFirstDaughter()->GetStsTrack()) {
1574 values[kStsMvdFirstDaughter] = pair->GetFirstDaughter()->GetStsTrack()->GetNofStsHits()
1575 + pair->GetFirstDaughter()->GetStsTrack()->GetNofMvdHits();
1576 }
1577 if (pair->GetSecondDaughter() && pair->GetSecondDaughter()->GetStsTrack())
1578 values[kStsMvdSecondDaughter] = pair->GetSecondDaughter()->GetStsTrack()->GetNofStsHits()
1579 + pair->GetSecondDaughter()->GetStsTrack()->GetNofMvdHits();
1580
1581
1582 if (pair->GetFirstDaughter() && pair->GetFirstDaughter()->GetStsTrack()) {
1583 values[kStsMvdFirstDaughter] = pair->GetFirstDaughter()->GetStsTrack()->GetNofStsHits()
1584 + pair->GetFirstDaughter()->GetStsTrack()->GetNofMvdHits();
1585 values[kStsFirstDaughter] = pair->GetFirstDaughter()->GetStsTrack()->GetNofStsHits();
1586 values[kMvdFirstDaughter] = pair->GetFirstDaughter()->GetStsTrack()->GetNofMvdHits();
1587
1588 if (pair->GetFirstDaughter()->GetTrdTrack()) {
1589 values[kStsMvdTrdFirstDaughter] = pair->GetFirstDaughter()->GetStsTrack()->GetNofStsHits()
1590 + pair->GetFirstDaughter()->GetStsTrack()->GetNofMvdHits()
1591 + pair->GetFirstDaughter()->GetTrdTrack()->GetNofHits();
1592 values[kTrdFirstDaughter] = pair->GetFirstDaughter()->GetTrdTrack()->GetNofHits();
1593 }
1594 else {
1595 values[kStsMvdTrdFirstDaughter] = 0;
1596 values[kTrdFirstDaughter] = 0;
1597 }
1598
1599 if (pair->GetFirstDaughter()->GetRichRing()) {
1600 values[kStsMvdRichFirstDaughter] = pair->GetFirstDaughter()->GetStsTrack()->GetNofStsHits()
1601 + pair->GetFirstDaughter()->GetStsTrack()->GetNofMvdHits() + 1;
1602 values[kRichFirstDaughter] = pair->GetFirstDaughter()->GetRichRing()->GetNofHits();
1603 }
1604 else {
1605 values[kStsMvdRichFirstDaughter] = 0;
1606 values[kRichFirstDaughter] = 0;
1607 }
1608 }
1609 if (pair->GetSecondDaughter() && pair->GetSecondDaughter()->GetStsTrack()) {
1610 values[kStsMvdSecondDaughter] = pair->GetSecondDaughter()->GetStsTrack()->GetNofStsHits()
1611 + pair->GetSecondDaughter()->GetStsTrack()->GetNofMvdHits();
1612
1613
1614 values[kStsSecondDaughter] = pair->GetSecondDaughter()->GetStsTrack()->GetNofStsHits();
1615 values[kMvdSecondDaughter] = pair->GetSecondDaughter()->GetStsTrack()->GetNofMvdHits();
1616
1617 if (pair->GetSecondDaughter()->GetTrdTrack()) {
1618 values[kStsMvdTrdSecondDaughter] = pair->GetSecondDaughter()->GetStsTrack()->GetNofStsHits()
1619 + pair->GetSecondDaughter()->GetStsTrack()->GetNofMvdHits()
1620 + pair->GetSecondDaughter()->GetTrdTrack()->GetNofHits();
1621 values[kTrdSecondDaughter] = pair->GetSecondDaughter()->GetTrdTrack()->GetNofHits();
1622 }
1623 else {
1624 values[kStsMvdTrdSecondDaughter] = 0;
1625 values[kTrdSecondDaughter] = 0;
1626 }
1627
1628 if (pair->GetSecondDaughter()->GetRichRing()) {
1629 values[kStsMvdRichSecondDaughter] = pair->GetSecondDaughter()->GetStsTrack()->GetNofStsHits()
1630 + pair->GetSecondDaughter()->GetStsTrack()->GetNofMvdHits() + 1;
1631 values[kRichSecondDaughter] = pair->GetSecondDaughter()->GetRichRing()->GetNofHits();
1632 }
1633 else {
1634 values[kStsMvdRichSecondDaughter] = 0;
1635 values[kRichSecondDaughter] = 0;
1636 }
1637 }
1638
1639
1640 if (pair->GetFirstDaughter() && pair->GetFirstDaughter()->GetStsTrack() && pair->GetSecondDaughter()
1641 && pair->GetSecondDaughter()->GetStsTrack()) {
1642
1643 TClonesArray* hits = fgEvent->GetHits(ECbmModuleId::kSts);
1644 if (hits && pair->GetFirstDaughter()->GetStsTrack()->GetNofStsHits() > 0
1645 && pair->GetSecondDaughter()->GetStsTrack()->GetNofStsHits() > 0) {
1646
1647 CbmStsHit* hitx = NULL;
1648 CbmStsHit* hity = NULL;
1649 Double_t minStsA = 9999.;
1650 if (hits) {
1651 for (Int_t ihit = 0; ihit < pair->GetFirstDaughter()->GetStsTrack()->GetNofStsHits(); ihit++) {
1652 Int_t idx = pair->GetFirstDaughter()->GetStsTrack()->GetStsHitIndex(ihit);
1653 CbmStsHit* hit = (CbmStsHit*) hits->At(idx);
1654 if (hit && minStsA > hit->GetZ()) {
1655 hitx = hit;
1656 minStsA = hit->GetZ();
1657 }
1658 }
1659 }
1660 Double_t minStsB = 9999.;
1661 if (hits) {
1662 for (Int_t ihit = 0; ihit < pair->GetSecondDaughter()->GetStsTrack()->GetNofStsHits(); ihit++) {
1663 Int_t idx = pair->GetSecondDaughter()->GetStsTrack()->GetStsHitIndex(ihit);
1664 CbmStsHit* hit = (CbmStsHit*) hits->At(idx);
1665 if (hit && minStsB > hit->GetZ()) {
1666 hity = hit;
1667 minStsB = hit->GetZ();
1668 }
1669 }
1670 }
1671 if (hitx && hity && minStsA < 9999 && minStsB < 9999) {
1672 Double_t xdiff = hitx->GetX() - hity->GetX();
1673 Double_t ydiff = hitx->GetY() - hity->GetY();
1674 Double_t zdiff = hitx->GetZ() - hity->GetZ();
1675 Double_t dist = TMath::Sqrt(xdiff * xdiff + ydiff * ydiff + zdiff * zdiff);
1676 values[kStsHitDist] = dist;
1677 }
1678 }
1679 else {
1680 values[kStsHitDist] = -1;
1681 }
1682
1683
1685 if (hits && pair->GetFirstDaughter()->GetStsTrack()->GetNofMvdHits() > 0
1686 && pair->GetSecondDaughter()->GetStsTrack()->GetNofMvdHits() > 0) {
1687 CbmMvdHit* hitx = NULL;
1688 CbmMvdHit* hity = NULL;
1689 Double_t minMvdA = 9999.;
1690 if (hits) {
1691 for (Int_t ihit = 0; ihit < pair->GetFirstDaughter()->GetStsTrack()->GetNofMvdHits(); ihit++) {
1692 Int_t idx = pair->GetFirstDaughter()->GetStsTrack()->GetMvdHitIndex(ihit);
1693 CbmMvdHit* hit = (CbmMvdHit*) hits->At(idx);
1694 if (hit && minMvdA > hit->GetZ()) {
1695 hitx = hit;
1696 minMvdA = hit->GetZ();
1697 }
1698 }
1699 }
1700 Double_t minMvdB = 9999.;
1701 if (hits) {
1702 for (Int_t ihit = 0; ihit < pair->GetSecondDaughter()->GetStsTrack()->GetNofMvdHits(); ihit++) {
1703 Int_t idx = pair->GetSecondDaughter()->GetStsTrack()->GetMvdHitIndex(ihit);
1704 CbmMvdHit* hit = (CbmMvdHit*) hits->At(idx);
1705 if (hit && minMvdB > hit->GetZ()) {
1706 hity = hit;
1707 minMvdB = hit->GetZ();
1708 }
1709 }
1710 }
1711 if (hitx && hity && minMvdA < 9999 && minMvdB < 9999) {
1712 Double_t xdiff = hitx->GetX() - hity->GetX();
1713 Double_t ydiff = hitx->GetY() - hity->GetY();
1714 Double_t zdiff = hitx->GetZ() - hity->GetZ();
1715 Double_t dist = TMath::Sqrt(xdiff * xdiff + ydiff * ydiff + zdiff * zdiff);
1716 values[kMvdHitDist] = dist;
1717 }
1718 }
1719 else {
1720 values[kMvdHitDist] = -1;
1721 }
1722 }
1723
1724
1725 Double_t thetaHE = 0;
1726 Double_t phiHE = 0;
1727 Double_t thetaCS = 0;
1728 Double_t phiCS = 0;
1729 if (Req(kThetaHE) || Req(kPhiHE) || Req(kThetaCS) || Req(kPhiCS)) {
1730 pair->GetThetaPhiCM(thetaHE, phiHE, thetaCS, phiCS);
1731
1732 values[kThetaHE] = thetaHE;
1733 values[kPhiHE] = phiHE;
1734 values[kThetaSqHE] = thetaHE * thetaHE;
1735 values[kCos2PhiHE] = TMath::Cos(2.0 * phiHE);
1736 values[kCosTilPhiHE] =
1737 (thetaHE > 0) ? (TMath::Cos(phiHE - TMath::Pi() / 4.)) : (TMath::Cos(phiHE - 3 * TMath::Pi() / 4.));
1738 values[kThetaCS] = thetaCS;
1739 values[kPhiCS] = phiCS;
1740 values[kThetaSqCS] = thetaCS * thetaCS;
1741 values[kCos2PhiCS] = TMath::Cos(2.0 * phiCS);
1742 values[kCosTilPhiCS] =
1743 (thetaCS > 0) ? (TMath::Cos(phiCS - TMath::Pi() / 4.)) : (TMath::Cos(phiCS - 3 * TMath::Pi() / 4.));
1744 }
1745
1746 values[kChi2NDF] = pair->GetChi2() / pair->GetNdf();
1747 values[kDecayLength] = pair->GetDecayLength();
1748 values[kR] = pair->GetR();
1749 values[kOpeningAngle] = pair->OpeningAngle();
1750 values[kCosPointingAngle] = fgEvent ? pair->GetCosPointingAngle(fgEvent->GetPrimaryVertex()) : -1;
1751
1752 values[kLegDist] = pair->DistanceDaughters();
1753 values[kLegDistXY] = pair->DistanceDaughtersXY();
1754 // values[kDeltaEta] = pair->DeltaEta();
1755 // values[kDeltaPhi] = pair->DeltaPhi();
1756 values[kLegsP] = TMath::Sqrt(pair->DaughtersP());
1757
1758 // Armenteros-Podolanski quantities
1759 values[kArmAlpha] = pair->GetArmAlpha();
1760 values[kArmPt] = pair->GetArmPt();
1761
1762 //if(Req(kPsiPair)) values[kPsiPair] = fgEvent ? pair->PsiPair(fgEvent->GetMagneticField()) : -5;
1763 //if(Req(kPhivPair)) values[kPhivPair] = pair->PhivPair(1.);
1764
1765 // impact parameter
1766 Double_t d0z0[2] = {-999., -999.};
1767 if (fgEvent) pair->GetDCA(fgEvent->GetPrimaryVertex(), d0z0);
1768 values[kImpactParXY] = d0z0[0];
1769 values[kImpactParZ] = d0z0[1];
1770
1771 values[kRndmPair] = gRandom->Rndm();
1772}
1773
1774
1775inline void PairAnalysisVarManager::FillVarPixelHit(const CbmPixelHit* hit, Double_t* const values)
1776{
1777 //
1778 // Fill hit information for the rich hit into array
1779 //
1780
1781 // Protect
1782 if (!hit) return;
1783
1784 // accessors via CbmPixelHit
1785 values[kPosX] = hit->GetX();
1786 values[kPosY] = hit->GetY();
1787 // accessors via CbmHit
1788 values[kPosZ] = hit->GetZ();
1789 // accessors via CbmMatch
1790 values[kLinksMC] = (hit->GetMatch() ? hit->GetMatch()->GetNofLinks() : 0.);
1791}
1792
1793inline void PairAnalysisVarManager::FillVarStsHit(const CbmStsHit* hit, Double_t* const values)
1794{
1795 //
1796 // Fill hit information for the sts hit into array
1797 //
1798
1799 // Reset array
1800 ResetArrayData(kHitMax, values);
1801
1802 // Protect
1803 if (!hit) return;
1804
1805 // accessors via CbmPixelHit & CbmHit
1806 FillVarPixelHit(hit, values);
1807
1808 // Set
1809 // ...
1810}
1811
1812inline void PairAnalysisVarManager::FillVarMvdHit(const CbmMvdHit* hit, Double_t* const values)
1813{
1814 //
1815 // Fill hit information for the mvd hit into array
1816 //
1817
1818 // Reset array
1819 ResetArrayData(kHitMax, values);
1820
1821 // Protect
1822 if (!hit) return;
1823
1824 // accessors via CbmPixelHit & CbmHit
1825 FillVarPixelHit(hit, values);
1826
1827 // Set
1828 // TODO: add center of gravity?
1829 // ...
1830}
1831
1832inline void PairAnalysisVarManager::FillVarMuchHit(const CbmMuchPixelHit* hit, Double_t* const values)
1833{
1834 //
1835 // Fill hit information for the much hit into array
1836 //
1837
1838 // Reset array
1839 ResetArrayData(kHitMax, values);
1840
1841 // Protect
1842 if (!hit) return;
1843
1844 // accessors via CbmPixelHit & CbmHit
1845 FillVarPixelHit(hit, values);
1846
1847 // Set
1848 // ...
1849}
1850
1851inline void PairAnalysisVarManager::FillVarRichHit(const CbmRichHit* hit, Double_t* const values)
1852{
1853 //
1854 // Fill hit information for the rich hit into array
1855 //
1856
1857 // Reset array
1858 ResetArrayData(kHitMax, values);
1859
1860 // Protect
1861 if (!hit) return;
1862
1863 // accessors via CbmPixelHit & CbmHit
1864 FillVarPixelHit(hit, values);
1865
1866 // Set
1867 values[kNPhotons] = 1; //hit->GetNPhotons();
1868 values[kPmtId] = hit->GetPmtId();
1869}
1870
1871inline void PairAnalysisVarManager::FillVarTrdHit(const CbmTrdHit* hit, Double_t* const values)
1872{
1873 //
1874 // Fill hit information for the trd hit into array
1875 //
1876
1877 // Reset array
1878 ResetArrayData(kHitMax, values);
1879
1880 // Protect
1881 if (!hit) return;
1882
1883 // accessors via CbmPixelHit & CbmHit
1884 FillVarPixelHit(hit, values);
1885
1886 // accessors via CbmCluster & CbmTrdCluster
1887 TClonesArray* cluster = fgEvent->GetCluster(ECbmModuleId::kTrd);
1888 if (cluster->GetEntriesFast() > 0) {
1889 const CbmTrdCluster* cls = static_cast<const CbmTrdCluster*>(cluster->At(hit->GetRefId()));
1890 FillVarTrdCluster(cls, values);
1891 // if(cls) std::cout << (cls->ToString()).data();
1892 }
1893
1894 // Set
1895 values[kTrdLayer] = hit->GetPlaneId(); //layer id
1897 values[kEloss] = hit->GetELoss() * 1.e+6; //GeV->keV, dEdx + TR
1898 // values[kElossdEdx] = hit->GetELossdEdX() * 1.e+6; //GeV->keV, dEdx
1899 // values[kElossTR] = hit->GetELossTR() * 1.e+6; //GeV->keV, TR
1900 // Printf("eloss trd: %.3e (%.3e TR, %.3e dEdx)",hit->GetELoss(),hit->GetELossTR(),hit->GetELossdEdX());
1901}
1902
1903inline void PairAnalysisVarManager::FillVarTofHit(const CbmTofHit* hit, Double_t* const values)
1904{
1905 //
1906 // Fill hit information for the tof hit into array
1907 //
1908
1909 // Reset array
1910 ResetArrayData(kHitMax, values);
1911
1912 // Protect
1913 if (!hit) return;
1914
1915 // accessors via CbmPixelHit & CbmHit
1916 FillVarPixelHit(hit, values);
1917
1918 // Set
1919 values[kBeta] = values[kTrackLength] / 100 / ((hit->GetTime() - values[kEvStartTime]) * 1e-9) / TMath::C();
1920 // PID value detla beta
1921 values[kTofPidDeltaBetaEL] =
1922 values[kBeta] - (values[kP] / TMath::Sqrt(values[kMEL] * values[kMEL] + values[kP] * values[kP]));
1923 values[kTofPidDeltaBetaMU] =
1924 values[kBeta] - (values[kP] / TMath::Sqrt(values[kMMU] * values[kMMU] + values[kP] * values[kP]));
1925 values[kTofPidDeltaBetaPI] =
1926 values[kBeta] - (values[kP] / TMath::Sqrt(values[kMPI] * values[kMPI] + values[kP] * values[kP]));
1927 values[kTofPidDeltaBetaKA] =
1928 values[kBeta] - (values[kP] / TMath::Sqrt(values[kMKA] * values[kMKA] + values[kP] * values[kP]));
1929 values[kTofPidDeltaBetaPR] =
1930 values[kBeta] - (values[kP] / TMath::Sqrt(values[kMPR] * values[kMPR] + values[kP] * values[kP]));
1931
1932 values[kMassSq] = values[kP] * values[kP] * (TMath::Power(1. / values[kBeta], 2) - 1);
1933
1934 // Printf("track length: %f beta: %f",values[kTrackLength],values[kBeta]);
1935 // Double_t mass2 = TMath::Power(momentum, 2.) * (TMath::Power(time/ trackLength, 2) - 1);
1936}
1937
1938inline void PairAnalysisVarManager::FillVarTrdCluster(const CbmTrdCluster* cluster, Double_t* const values)
1939{
1940 //
1941 // Fill cluster information for the trd cluster into array
1942 //
1943
1944 // Reset array
1945 // ResetArrayDataMC( kHitMaxMC, values);
1946
1947 // Protect
1948 if (!cluster) return;
1949
1950 // accessors via CbmCluster
1951 values[kTrdPads] = cluster->GetNofDigis();
1952
1953 // Set
1954 values[kTrdCols] = cluster->GetNCols();
1955 values[kTrdRows] = cluster->GetNRows();
1956}
1957
1958inline void PairAnalysisVarManager::FillVarMCPoint(const FairMCPoint* hit, Double_t* const values)
1959{
1960 //
1961 // Fill MC hit information
1962 //
1963
1964 // Reset array
1965 ResetArrayDataMC(kHitMaxMC, values);
1966
1967 // Protect
1968 if (!hit) return;
1969
1970 // Set
1971 values[kPosXMC] = hit->GetX();
1972 values[kPosYMC] = hit->GetY();
1973 values[kPosZMC] = hit->GetZ();
1974 values[kElossMC] = hit->GetEnergyLoss() * 1.e+6; //GeV->keV, dEdx
1975}
1976
1977inline void PairAnalysisVarManager::FillSumVarMCPoint(const FairMCPoint* hit, Double_t* const values)
1978{
1979 //
1980 // Sum upMC hit information
1981 //
1982
1983 // DO NOT reset array
1984
1985 // Protect
1986 if (!hit) return;
1987
1988 // Set
1989 values[kPosXMC] += hit->GetX();
1990 values[kPosYMC] += hit->GetY();
1991 values[kPosZMC] += hit->GetZ();
1992 values[kElossMC] += hit->GetEnergyLoss() * 1.e+6; //GeV->keV, dEdx
1993}
1994
1995inline void PairAnalysisVarManager::FillVarConstants(Double_t* const values)
1996{
1997 //
1998 // Fill constant information available into an array
1999 // make use of TPDGCode
2000 //
2001
2002 // Set
2003 values[kMEL] = TDatabasePDG::Instance()->GetParticle(kElectron)->Mass();
2004 values[kMMU] = TDatabasePDG::Instance()->GetParticle(kMuonMinus)->Mass();
2005 values[kMPI] = TDatabasePDG::Instance()->GetParticle(kPiPlus)->Mass();
2006 values[kMKA] = TDatabasePDG::Instance()->GetParticle(kKPlus)->Mass();
2007 values[kMPR] = TDatabasePDG::Instance()->GetParticle(kProton)->Mass();
2008 values[kMK0] = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass();
2009 values[kMLA] = TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass();
2010 values[kMPair] = fgData[kMPair];
2011 values[kEbeam] = fgData[kEbeam];
2012}
2013
2015{
2016 //
2017 // set event and vertex
2018 //
2019
2020 // Set
2021 fgEvent = ev;
2022
2023 // Reset
2024 if (fgKFVertex) delete fgKFVertex;
2025 fgKFVertex = nullptr;
2026 if (fgVertexMC) fgVertexMC->Reset();
2027 else
2028 fgVertexMC = new CbmVertex();
2029
2030 // Set
2032 if (ev && ev->GetPrimaryVertex()) fgKFVertex = new CbmKFVertex(*ev->GetPrimaryVertex());
2034}
2035
2037{
2038 /* for (Int_t i=0; i<kNMaxValuesMC;++i) fgData[i]=0.; */
2039 for (Int_t i = kPairMax; i < kNMaxValues; ++i)
2040 fgData[i] = data[i];
2041 for (Int_t i = kPairMaxMC; i < kNMaxValuesMC; ++i)
2042 fgData[i] = data[i];
2043}
2044
2045
2047 Int_t* distH, Int_t* fakeH)
2048{
2049
2050 CbmTrack* trkl = track->GetTrack(idet);
2051 CbmRichRing* ring = track->GetRichRing();
2052 Int_t nhits = 0;
2053 switch (idet) {
2054 case ECbmModuleId::kMvd:
2055 if (trkl) nhits = static_cast<CbmStsTrack*>(trkl)->GetNofMvdHits();
2056 break;
2057 case ECbmModuleId::kSts:
2058 if (trkl) nhits = static_cast<CbmStsTrack*>(trkl)->GetNofStsHits();
2059 break;
2061 case ECbmModuleId::kTrd:
2062 if (trkl) nhits = trkl->GetNofHits();
2063 break;
2064 case ECbmModuleId::kTof:
2065 nhits = 1; /* one is maximum */
2066 break;
2068 if (ring) nhits = ring->GetNofHits();
2069 break;
2070 default: return;
2071 }
2072
2073 CbmTrackMatchNew* tmtch = track->GetTrackMatch(idet);
2074 Int_t mctrk =
2075 (tmtch && tmtch->GetNofHits() > 0 && tmtch->GetNofLinks() > 0 ? tmtch->GetMatchedLink().GetIndex() : -1);
2076
2078 if (mc) {
2079
2081 TClonesArray* hits = fgEvent->GetHits(idet);
2082 TClonesArray* pnts = fgEvent->GetPoints(idet);
2083
2084 //Int_t links = 0; //Only needed for kTrdDistortion
2085 //Double_t dist = 0.;
2086 *trueH = 0;
2087 *distH = 0;
2088 *fakeH = (mctrk > -1 ? 0 : nhits);
2089 if (hits && pnts && mctrk > -1) {
2090 for (Int_t ihit = 0; ihit < nhits; ihit++) {
2091
2092 CbmHit* hit = NULL;
2093 Int_t idx = -1;
2094 switch (idet) {
2095 case ECbmModuleId::kMvd: idx = static_cast<CbmStsTrack*>(trkl)->GetMvdHitIndex(ihit); break;
2096 case ECbmModuleId::kSts: idx = static_cast<CbmStsTrack*>(trkl)->GetStsHitIndex(ihit); break;
2098 case ECbmModuleId::kTrd: idx = trkl->GetHitIndex(ihit); break;
2099 case ECbmModuleId::kTof: hit = track->GetTofHit(); break;
2100 case ECbmModuleId::kRich: idx = ring->GetHit(ihit); break;
2101 default: continue;
2102 }
2103
2104 if (idet != ECbmModuleId::kTof && idx > -1) { hit = dynamic_cast<CbmHit*>(hits->At(idx)); }
2105
2106 if (!hit) {
2107 (*fakeH)++;
2108 continue;
2109 }
2110 CbmMatch* mtch = hit->GetMatch();
2111 if (!mtch) {
2112 (*fakeH)++;
2113 continue;
2114 }
2115
2116 Bool_t btrueH = kTRUE;
2117 Bool_t bfakeH = kTRUE;
2118 Int_t nlinks = mtch->GetNofLinks();
2119 //links += nlinks;
2120 for (Int_t iLink = 0; iLink < nlinks; iLink++) {
2121 // if(nlinks!=1) { fakeH++; continue; }
2122 FairMCPoint* pnt = static_cast<FairMCPoint*>(pnts->At(mtch->GetLink(iLink).GetIndex()));
2123 // hit defintion
2124 if (!pnt) btrueH = kFALSE;
2125 else {
2126 Int_t lbl = pnt->GetTrackID();
2127 Int_t lblM = mc->GetMothersLabel(lbl);
2128 Int_t lblG = mc->GetMothersLabel(lblM);
2129 if (lbl != mctrk && lblM != mctrk && lblG != mctrk) {
2130 btrueH = kFALSE;
2131 //dist += 1.;
2132 }
2133 else
2134 bfakeH = kFALSE;
2135 }
2136 }
2137 // increase counters
2138 if (btrueH) (*trueH)++;
2139 if (bfakeH) (*fakeH)++;
2140 if (!btrueH && !bfakeH) (*distH)++;
2141 }
2142 }
2143 /* values[kTrdDistortion] = dist/links; */
2144 }
2145}
2146
2147
2149 ValueTypes var4, ValueTypes var5, ValueTypes var6, ValueTypes var7,
2150 ValueTypes var8, ValueTypes var9)
2151{
2152 //
2153 // build var array for e.g. TFormula's, THnBase's
2154 //
2155 static UInt_t arr[10] = {0};
2156 arr[0] = static_cast<UInt_t>(var0);
2157 arr[1] = static_cast<UInt_t>(var1);
2158 arr[2] = static_cast<UInt_t>(var2);
2159 arr[3] = static_cast<UInt_t>(var3);
2160 arr[4] = static_cast<UInt_t>(var4);
2161 arr[5] = static_cast<UInt_t>(var5);
2162 arr[6] = static_cast<UInt_t>(var6);
2163 arr[7] = static_cast<UInt_t>(var7);
2164 arr[8] = static_cast<UInt_t>(var8);
2165 arr[9] = static_cast<UInt_t>(var9);
2166 return arr;
2167}
2168
2170{
2171 if (fgFormula[1]) return;
2172 for (Int_t i = 1; i < kNMaxValuesMC - 1; ++i) {
2173 fgFormula[i] = new TFormula(fgkParticleNames[i][0], "[0]");
2174 fgFormula[i]->SetParameter(0, i);
2175 fgFormula[i]->SetParName(0, fgkParticleNames[i][0]);
2176 }
2177}
2178
2179#endif
Base class for cluster objects.
XPU_D constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
Definition CbmDefs.h:29
ECbmModuleId
Definition CbmDefs.h:39
@ kMvd
Micro-Vertex Detector.
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kSts
Silicon Tracking System.
@ kMuch
Muon detection system.
@ kRich
Ring-Imaging Cherenkov Detector.
Class for pixel hits in MUCH detector.
Implementation of the electron identification algorithm in the RICH detector using Artificial Neural ...
Data class for a reconstructed hit in the STS.
Data class for STS tracks.
static vector< vector< QAHit > > hits
Data Container for TRD clusters.
Class for hits in TRD detector.
#define BIT(n)
Definition RTypes.h:14
int32_t GetNofDigis() const
Number of digis in cluster.
Definition CbmCluster.h:69
const FairTrackParam * GetParamLast() const
double GetChi2() const
int32_t GetNDF() const
const FairTrackParam * GetParamFirst() const
double GetLength() const
double GetTime() const
Definition CbmHit.h:76
double GetZ() const
Definition CbmHit.h:71
CbmMatch * GetMatch() const
Definition CbmHit.h:75
int32_t GetRefId() const
Definition CbmHit.h:73
double GetPz() const
Definition CbmMCTrack.h:72
double GetCharge() const
Charge of the associated particle.
double GetPt() const
Definition CbmMCTrack.h:97
double GetP() const
Definition CbmMCTrack.h:98
double GetPx() const
Definition CbmMCTrack.h:70
uint32_t GetGeantProcessId() const
Definition CbmMCTrack.h:67
double GetStartZ() const
Definition CbmMCTrack.h:75
int32_t GetMotherId() const
Definition CbmMCTrack.h:69
double GetMass() const
Mass of the associated particle.
double GetStartX() const
Definition CbmMCTrack.h:73
int32_t GetPdgCode() const
Definition CbmMCTrack.h:68
void Get4Momentum(TLorentzVector &momentum) const
Definition CbmMCTrack.h:173
double GetStartY() const
Definition CbmMCTrack.h:74
double GetPy() const
Definition CbmMCTrack.h:71
double GetRapidity() const
void GetStartVertex(TVector3 &vertex) const
Definition CbmMCTrack.h:176
int32_t GetNPoints(ECbmModuleId detId) const
double GetEnergy() const
Definition CbmMCTrack.h:162
const CbmLink & GetLink(int32_t i) const
Definition CbmMatch.h:39
int32_t GetNofLinks() const
Definition CbmMatch.h:42
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
double GetY() const
Definition CbmPixelHit.h:74
double GetX() const
Definition CbmPixelHit.h:73
double CalculateAnnValue(int globalTrackIndex, double momentum)
Calculate output value of the ANN.
static CbmRichElectronIdAnn & GetInstance()
virtual int32_t GetPmtId() const
Definition CbmRichHit.h:64
double GetRadialAngle() const
uint32_t GetHit(int32_t i) const
Definition CbmRichRing.h:39
float GetRadius() const
Definition CbmRichRing.h:79
double GetAaxis() const
Definition CbmRichRing.h:80
int32_t GetNofHits() const
Definition CbmRichRing.h:37
float GetCenterX() const
Definition CbmRichRing.h:77
double GetChi2() const
Definition CbmRichRing.h:92
int32_t GetNofHitsOnRing() const
Definition CbmRichRing.h:96
double GetPhi() const
Definition CbmRichRing.h:84
double GetNDF() const
Definition CbmRichRing.h:93
float GetCenterY() const
Definition CbmRichRing.h:78
float GetRadialPosition() const
double GetBaxis() const
Definition CbmRichRing.h:81
data class for a reconstructed 3-d hit in the STS
Definition CbmStsHit.h:35
int32_t GetNofMvdHits() const
Definition CbmStsTrack.h:87
int32_t GetMvdHitIndex(int32_t iHit) const
Definition CbmStsTrack.h:75
int32_t GetStsHitIndex(int32_t iHit) const
int32_t GetNofStsHits() const
Definition CbmStsTrack.h:93
int32_t GetNofHits() const
const FairTrackParam * GetParamLast() const
Definition CbmTrack.h:69
int32_t GetNDF() const
Definition CbmTrack.h:64
virtual int32_t GetNofHits() const
Definition CbmTrack.h:58
const FairTrackParam * GetParamFirst() const
Definition CbmTrack.h:68
int32_t GetHitIndex(int32_t iHit) const
Definition CbmTrack.h:59
HitType GetHitType(int32_t iHit) const
Definition CbmTrack.h:60
double GetChiSq() const
Definition CbmTrack.h:63
Data Container for TRD clusters.
uint16_t GetNRows() const
uint16_t GetNCols() const
data class for a reconstructed Energy-4D measurement in the TRD
Definition CbmTrdHit.h:40
double GetELoss() const
Definition CbmTrdHit.h:79
int32_t GetPlaneId() const
Inherited from CbmBaseHit.
Definition CbmTrdHit.h:73
double GetPidLikeEL() const
Definition CbmTrdTrack.h:43
double GetELoss() const
Definition CbmTrdTrack.h:42
double GetPidLikeMU() const
Definition CbmTrdTrack.h:47
double GetPidANN() const
Definition CbmTrdTrack.h:41
double GetPidLikeKA() const
Definition CbmTrdTrack.h:45
double GetPidLikePI() const
Definition CbmTrdTrack.h:44
double GetPidLikePR() const
Definition CbmTrdTrack.h:46
double GetPidWkn() const
Definition CbmTrdTrack.h:40
double GetZ() const
Definition CbmVertex.h:69
void Reset()
double GetChi2() const
Definition CbmVertex.h:70
int32_t GetNDF() const
Definition CbmVertex.h:71
int32_t GetNTracks() const
Definition CbmVertex.h:72
void SetVertex(double x, double y, double z, double chi2, int32_t ndf, int32_t nTracks, const TMatrixFSym &covMat)
double GetY() const
Definition CbmVertex.h:68
double GetX() const
Definition CbmVertex.h:67
TClonesArray * GetCluster(ECbmModuleId det) const
TClonesArray * GetHits(ECbmModuleId det) const
TObjArray * GetTracks() const
FairMCEventHeader * GetMCHeader() const
CbmVertex * GetPrimaryVertex() const
TClonesArray * GetPoints(ECbmModuleId det) const
static PairAnalysisMC * Instance()
Int_t GetMothersLabel(Int_t daughterLabel) const
CbmMCTrack * GetMCTrackMother(const PairAnalysisTrack *_track)
Bool_t HasMC() const
CbmMCTrack * GetMCTrackFromMCEvent(Int_t label) const
Double_t P() const
Double_t Phi() const
CbmStsTrack * GetStsTrack() const
CbmTrackMatchNew * GetTrackMatch(ECbmModuleId det) const
CbmTrack * GetTrack(ECbmModuleId det) const
Double_t OneOverPt() const
Double_t Y() const
CbmMCTrack * GetMCTrack() const
Double_t Theta() const
Double_t Xv() const
Double_t ChiToVertex() const
Double_t Zv() const
CbmTofHit * GetTofHit() const
CbmMuchTrack * GetMuchTrack() const
Int_t GetGlobalIndex() const
Double_t Pt() const
Double_t Px() const
Double_t M() const
Double_t E() const
Double_t GetWeight() const
Double_t Py() const
CbmTrdTrack * GetTrdTrack() const
Short_t Charge() const
FairTrackParam * GetRichProj() const
Double_t Pz() const
CbmRichRing * GetRichRing() const
CbmGlobalTrack * GetGlobalTrack() const
FairTrackParam * GetMvdEntrance() const
Double_t Yv() const
static void SetEventData(const Double_t data[PairAnalysisVarManager::kNMaxValuesMC])
static CbmKFVertex * fgKFVertex
static void FillVarConstants(Double_t *const values)
static void FillVarMuchTrack(const CbmMuchTrack *track, Double_t *const values)
static void FillVarTrdCluster(const CbmTrdCluster *cluster, Double_t *const values)
@ kCentrality
number of primary vertex contibutors
@ kXRes
nof degrees of freedom
static void FillVarPixelHit(const CbmPixelHit *hit, Double_t *const values)
static const char * fgkParticleNames[kNMaxValuesMC][3]
data
static TFormula * fgFormula[kNMaxValuesMC]
static Double_t fgData[kNMaxValuesMC]
static void FillVarGlobalTrack(const CbmGlobalTrack *track, Double_t *const values)
static void FillVarPairAnalysisEvent(const PairAnalysisEvent *event, Double_t *const values)
static Bool_t Req(ValueTypes var)
static void FillVarTrdHit(const CbmTrdHit *hit, Double_t *const values)
static void FillVarTrdTrack(const CbmTrdTrack *track, Double_t *const values)
static void FillVarTofHit(const CbmTofHit *hit, Double_t *const values)
static void SetFillMap(TBits *map)
static UInt_t * GetArray(ValueTypes var0, ValueTypes var1=kNMaxValuesMC, ValueTypes var2=kNMaxValuesMC, ValueTypes var3=kNMaxValuesMC, ValueTypes var4=kNMaxValuesMC, ValueTypes var5=kNMaxValuesMC, ValueTypes var6=kNMaxValuesMC, ValueTypes var7=kNMaxValuesMC, ValueTypes var8=kNMaxValuesMC, ValueTypes var9=kNMaxValuesMC)
static const char * GetValueName(Int_t i)
static void FillSumVarMCPoint(const FairMCPoint *hit, Double_t *const values)
ClassDef(PairAnalysisVarManager, 1)
static void SetEvent(PairAnalysisEvent *const ev)
PairAnalysisVarManager & operator=(const PairAnalysisVarManager &c)
static void FillVarRichHit(const CbmRichHit *hit, Double_t *const values)
static const char * GetValueUnit(Int_t i)
static void FillVarMuchHit(const CbmMuchPixelHit *hit, Double_t *const values)
static UInt_t GetValueTypeMC(UInt_t var)
static void FillVarMCParticle(const CbmMCTrack *p1, const CbmMCTrack *p2, Double_t *const values)
static void FillVarPairAnalysisPair(const PairAnalysisPair *pair, Double_t *const values)
static void SetValue(ValueTypes var, Double_t val)
static void FillVarMCPoint(const FairMCPoint *hit, Double_t *const values)
static void FillVarMvdHit(const CbmMvdHit *hit, Double_t *const values)
static PairAnalysisEvent * GetCurrentEvent()
static void FillVarVertex(const CbmVertex *vertex, Double_t *const values)
static const CbmKFVertex * GetKFVertex()
static void FillVarStsTrack(const CbmStsTrack *track, Double_t *const values)
static UInt_t GetValueType(const char *valname)
PairAnalysisVarManager(const PairAnalysisVarManager &c)
static void FillVarRichRing(const CbmRichRing *track, Double_t *const values)
static void Fill(const TObject *particle, Double_t *const values)
static void FillVarPairAnalysisTrack(const PairAnalysisTrack *track, Double_t *const values)
static void ResetArrayData(Int_t to, Double_t *const values)
static void FillVarMCHeader(const FairMCEventHeader *header, Double_t *const values)
static const char * GetValueLabel(Int_t i)
static void FillVarMCTrack(const CbmMCTrack *particle, Double_t *const values)
static Double_t GetValue(ValueTypes val)
static void ResetArrayDataMC(Int_t to, Double_t *const values)
static void FillVarStsHit(const CbmStsHit *hit, Double_t *const values)
static void FillSum(const TObject *particle, Double_t *const values)
static PairAnalysisEvent * fgEvent
static void CalculateHitTypes(const PairAnalysisTrack *track, ECbmModuleId idet, Int_t *trueH, Int_t *distH, Int_t *fakeH)