MpdFemtoTrack.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. /**
  2. * \class MpdFemtoTrack
  3. * \brief Main class holding track information
  4. *
  5. * MpdFemtoTrack holds all the necessary information about a track that is
  6. * required during femtoscopic analysis. This class is filled with information
  7. * from the input stream by the reader. A particle has a link back to the Track
  8. * it was created from, so we do not copy the information.
  9. *
  10. * \author Grigory Nigmatkulov (NRNU MEPhI)
  11. * \date May 18, 2019
  12. * \email nigmatkulov@gmail.com
  13. */
  14. #ifndef MpdFemtoTrack_h
  15. #define MpdFemtoTrack_h
  16. // C++ headers
  17. #include <cmath>
  18. #include <limits>
  19. // MpdFemtoMaker headers
  20. // Base
  21. #include "MpdFemtoHiddenInfo.h"
  22. // Infrastructure
  23. #include "MpdFemtoTypes.h"
  24. #include "MpdFemtoPhysicalHelix.h"
  25. // ROOT headers
  26. #include "TMath.h"
  27. #include "TVector3.h"
  28. #include "TLorentzVector.h"
  29. //_________________
  30. class MpdFemtoTrack {
  31. public:
  32. /// Constructor
  33. MpdFemtoTrack();
  34. /// Copy constructor
  35. MpdFemtoTrack(const MpdFemtoTrack& track);
  36. /// Copy constructor
  37. MpdFemtoTrack& operator=(const MpdFemtoTrack& track);
  38. /// Destructor
  39. virtual ~MpdFemtoTrack();
  40. //
  41. // Getters
  42. //
  43. /// ID of the track
  44. unsigned short id() const {
  45. return mId;
  46. }
  47. /// ID of the track
  48. unsigned short Id() const {
  49. return id();
  50. }
  51. /// Particle type: 1-primary, 0-global
  52. short type() const {
  53. return ( isPrimary()) ? 1 : 0;
  54. }
  55. /// Particle type: 1-primary, 0-global
  56. short Type() const {
  57. return type();
  58. }
  59. /// Return true if track is primary, false if not
  60. bool isPrimary() const {
  61. return ( pMom().Mag() > 0) ? true : false;
  62. }
  63. /// Return true if track is primary, false if not
  64. bool IsPrimary() const {
  65. return isPrimary();
  66. }
  67. /// Track charge
  68. short charge() const {
  69. return ( mNHits > 0) ? 1 : -1;
  70. }
  71. /// Track charge
  72. short Charge() const {
  73. return charge();
  74. }
  75. /// Track flag (redundant)
  76. unsigned short flag() const {
  77. return mFlag;
  78. }
  79. /// Track flag (redundant)
  80. unsigned short Flag() const {
  81. return flag();
  82. }
  83. /// Number of hits
  84. unsigned short nHits() const {
  85. return (unsigned short) TMath::Abs(mNHits);
  86. }
  87. /// Number of hits
  88. unsigned short NHits() const {
  89. return nHits();
  90. }
  91. /// Number of hits
  92. unsigned short numberOfHits() const {
  93. return nHits();
  94. }
  95. /// Number of fitted points
  96. unsigned short nHitsFit() const {
  97. return nHits();
  98. }
  99. /// Number of fitted points
  100. unsigned short NHitsFit() const {
  101. return nHits();
  102. }
  103. /// Number of possible points
  104. unsigned short nHitsPossible() const {
  105. return (unsigned short) mNHitsPoss;
  106. }
  107. /// Number of possible points
  108. unsigned short nHitsPoss() const {
  109. return nHitsPossible();
  110. }
  111. /// Number of possible points
  112. unsigned short NHitsPoss() const {
  113. return nHitsPossible();
  114. }
  115. /// Number of possible points
  116. unsigned short nHitsMax() const {
  117. return nHitsPossible();
  118. }
  119. /// Number of hits used for dE/dx estimation
  120. unsigned short nHitsDedx() const {
  121. return (unsigned short) mNHitsDedx;
  122. }
  123. /// Number of hits used for dE/dx estimation
  124. unsigned short NHitsDedx() const {
  125. return nHitsDedx();
  126. }
  127. /// Ratio of nHits/nHitsPossible
  128. float nHitsFit2PossRatio() const {
  129. return ( nHitsPossible() > 0) ? (float) nHits() / nHitsPossible() : 0;
  130. }
  131. /// Ratio of nHits/nHitsPossible
  132. float NHitsFit2PossRatio() const {
  133. return nHitsFit2PossRatio();
  134. }
  135. /// nSigma(electron) by dE/dx
  136. float nSigmaElectron() const {
  137. return (float) mNSigmaElectron / 1000.f;
  138. }
  139. /// nSigma(electron) by dE/dx
  140. float NSigmaElectron() const {
  141. return nSigmaElectron();
  142. }
  143. /// nSigma(pion) by dE/dx
  144. float nSigmaPion() const {
  145. return (float) mNSigmaPion / 1000.f;
  146. }
  147. /// nSigma(pion) by dE/dx
  148. float NSigmaPion() const {
  149. return nSigmaPion();
  150. }
  151. /// nSigma(kaon) by dE/dx
  152. float nSigmaKaon() const {
  153. return (float) mNSigmaKaon / 1000.f;
  154. }
  155. /// nSigma(kaon) by dE/dx
  156. float NSigmaKaon() const {
  157. return nSigmaKaon();
  158. }
  159. /// nSigma(proton) by dE/dx
  160. float nSigmaProton() const {
  161. return (float) mNSigmaProton / 1000.f;
  162. }
  163. /// nSigma(proton) by dE/dx
  164. float NSigmaProton() const {
  165. return nSigmaProton();
  166. }
  167. /// Probability to be electron
  168. float pidProbElectron() const {
  169. return (float) mPidProbElectron / 10000.f;
  170. }
  171. /// Probability to be electron
  172. float PidProbElectron() const {
  173. return pidProbElectron();
  174. }
  175. /// Probability to be pion
  176. float pidProbPion() const {
  177. return (float) mPidProbPion / 10000.f;
  178. }
  179. /// Probability to be pion
  180. float PidProbPion() const {
  181. return pidProbPion();
  182. }
  183. /// Probability to be kaon
  184. float pidProbKaon() const {
  185. return (float) mPidProbKaon / 10000.f;
  186. }
  187. /// Probability to be kaon
  188. float PidProbKaon() const {
  189. return pidProbKaon();
  190. }
  191. /// Probability to be proton
  192. float pidProbProton() const {
  193. return (float) mPidProbProton / 10000.f;
  194. }
  195. /// Probability to be proton
  196. float PidProbProton() const {
  197. return pidProbProton();
  198. }
  199. /// dE/dx of the track in (GeV/cm)
  200. double dEdx() const {
  201. return (double) mDedx * 1e-9;
  202. }
  203. /// dE/dx of the track in (GeV/cm)
  204. double Dedx() const {
  205. return dEdx();
  206. }
  207. /// dE/dx of the track in (keV/cm)
  208. double dEdxInKeV() const {
  209. return (double) mDedx * 1e-3;
  210. }
  211. /// dE/dx of the track in (keV/cm)
  212. double DedxInKeV() const {
  213. return dEdxInKeV();
  214. }
  215. /// Momentum of the track. Return momentum of the primary track
  216. /// if track is primary
  217. TVector3 momentum() const {
  218. return ( isPrimary()) ? pMom() : gMom();
  219. }
  220. /// Momentum of the track. Return momentum of the primary track
  221. /// if track is primary
  222. TVector3 Momentum() const {
  223. return momentum();
  224. }
  225. /// Momentum of the track. Return momentum of the primary track
  226. /// if track is primary
  227. TVector3 p() const {
  228. return momentum();
  229. }
  230. /// Momentum of the primary track
  231. TVector3 pMom() const {
  232. return TVector3(mPrimaryPx, mPrimaryPy, mPrimaryPz);
  233. }
  234. /// Momentum of the track (magnitude). Return momentum of the primary
  235. /// track if track is primary, and global if not primary
  236. float ptot() const {
  237. return ( isPrimary()) ? pMom().Mag() : gPtot();
  238. }
  239. /// Squared momentum of the track (squared magnitude). Return momentum
  240. /// of the primary track if track is primary, and global if not primary
  241. float ptot2() const {
  242. return ( isPrimary()) ? pMom().Mag2() : gPtot2();
  243. }
  244. /// Transverse momentum of the track. Return momentum of the primary
  245. /// track if track is primary, and global if not primary
  246. float pt() const {
  247. return ( isPrimary()) ? pMom().Perp() : gPt();
  248. }
  249. /// Squared transverse momentum of the track. Return momentum of the primary
  250. /// track if track is primary, and global if not primary
  251. float pt2() const {
  252. return ( isPrimary()) ? pMom().Perp2() : gPt2();
  253. }
  254. /// Pseudorapidity of the track. Return pseudorapidity of the primary
  255. /// track if track is primary, and global if not primary
  256. float eta() const {
  257. return ( isPrimary()) ? pMom().PseudoRapidity() : gEta();
  258. }
  259. /// Pseudorapidity of the track. Return pseudorapidity of the primary
  260. /// track if track is primary, and global if not primary
  261. float Eta() const {
  262. return eta();
  263. }
  264. /// Pseudorapidity of the track. Return pseudorapidity of the primary
  265. /// track if track is primary, and global if not primary
  266. float pseudoRapidity() const {
  267. return ( isPrimary()) ? eta() : gEta();
  268. }
  269. /// Pseudorapidity of the track. Return pseudorapidity of the primary
  270. /// track if track is primary, and global if not primary
  271. float PseudoRapidity() const {
  272. return pseudoRapidity();
  273. }
  274. /// Azimuthal angle of the track. Return azimuthal angle of the primary
  275. /// track if track is primary, and global if not primary
  276. float phi() const {
  277. return ( isPrimary()) ? pMom().Phi() : gPhi();
  278. }
  279. /// Azimuthal angle of the track. Return azimuthal angle of the primary
  280. /// track if track is primary, and global if not primary
  281. float Phi() const {
  282. return phi();
  283. }
  284. /// Polar angle of the track. Return polar angle of the primary
  285. /// track if track is primary, and global if not primary
  286. float theta() const {
  287. return ( isPrimary()) ? pMom().Theta() : gTheta();
  288. }
  289. /// Polar angle of the track. Return polar angle of the primary
  290. /// track if track is primary, and global if not primary
  291. float Theta() const {
  292. return theta();
  293. }
  294. /// Momentum of the global track
  295. TVector3 gMom() const {
  296. return TVector3(mGlobalPx, mGlobalPy, mGlobalPz);
  297. }
  298. /// Momentum of the global track (magnitude)
  299. float gPtot() const {
  300. return gMom().Mag();
  301. }
  302. /// Squared momentum of the global track (squared magnitude)
  303. float gPtot2() const {
  304. return gMom().Mag2();
  305. }
  306. /// Transverse momentum of the global track
  307. float gPt() const {
  308. return gMom().Perp();
  309. }
  310. /// Squared transverse momentum of the global track
  311. float gPt2() const {
  312. return gMom().Perp2();
  313. }
  314. /// Pseudorapidity of the global track
  315. float gEta() const {
  316. return gMom().Eta();
  317. }
  318. /// Polar angle of the global track
  319. float gTheta() const {
  320. return gMom().Theta();
  321. }
  322. /// Azimuthal angle of the global track
  323. float gPhi() const {
  324. return gMom().Phi();
  325. }
  326. /// Primary vertex position
  327. TVector3 primaryVertex() const {
  328. return TVector3(mPrimaryVertexX, mPrimaryVertexY, mPrimaryVertexZ);
  329. }
  330. /// Primary vertex position
  331. TVector3 PrimaryVertex() const {
  332. return primaryVertex();
  333. }
  334. /// Origin of the track
  335. TVector3 origin() const {
  336. return ( primaryVertex() + gDCA());
  337. }
  338. /// Origin of the track
  339. TVector3 Origin() const {
  340. return origin();
  341. }
  342. /// DCA of the track to the primary vertex
  343. TVector3 gDCA() const {
  344. return TVector3(mDcaX, mDcaY, mDcaZ);
  345. }
  346. /// DCA of the track to the primary vertex in the transverse plane
  347. float gDCAxy() const {
  348. return gDCA().Perp();
  349. }
  350. /// DCA of the track to the primary vertex in z direction
  351. float gDCAz() const {
  352. return gDCA().Z();
  353. }
  354. /// chi2 of the track
  355. float chi2() const {
  356. return (float) mChi2 * 0.001;
  357. }
  358. /// chi2 of the track
  359. float Chi2() const {
  360. return chi2();
  361. }
  362. /// Topology (hit) map
  363. unsigned long topologyMap() const {
  364. return mMap;
  365. }
  366. /// Topology (hit) map
  367. unsigned long TopologyMap() const {
  368. return mMap;
  369. }
  370. /// Velocity of the track from TOF
  371. float beta() const {
  372. return ( isPrimary() && isTofTrack()) ? (float) mTofBeta / 20000.f : -999;
  373. }
  374. /// Velocity of the track from TOF
  375. float Beta() const {
  376. return beta();
  377. }
  378. /// If track has signal in TOF
  379. bool isTofTrack() const {
  380. return ( mTofBeta <= 0) ? false : true;
  381. }
  382. /// If track has signal in TOF
  383. bool IsTofTrack() const {
  384. return isTofTrack();
  385. }
  386. /// Inversed velocity
  387. float invBeta() const {
  388. return ( isPrimary() && isTofTrack()) ? 1. / beta() : -999.;
  389. }
  390. /// Inversed velocity
  391. float InvBeta() const {
  392. return invBeta();
  393. }
  394. /// Square of inversed velocity
  395. float invBeta2() const {
  396. return ( isPrimary() && isTofTrack()) ? invBeta() * invBeta() : -999.;
  397. }
  398. /// Square of inversed velocity
  399. float InvBeta2() const {
  400. return invBeta2();
  401. }
  402. /// Squared mass (from TOF)
  403. float massSqr() const;
  404. /// Squared mass (from TOF)
  405. float MassSqr() const {
  406. return massSqr();
  407. }
  408. /// Return magnetic field (in kilogaus)
  409. float bField() const {
  410. return mBField;
  411. }
  412. /// 1/beta - 1/beta(e)
  413. float invBetaDiffElectron() const;
  414. /// 1/beta - 1/beta(pion)
  415. float invBetaDiffPion() const;
  416. /// 1/beta - 1/beta(kaon)
  417. float invBetaDiffKaon() const;
  418. /// 1/beta - 1/beta(proton)
  419. float invBetaDiffProton() const;
  420. /// Helix of the primary track
  421. MpdFemtoPhysicalHelix helix() const;
  422. /// Helix of the primary track
  423. MpdFemtoPhysicalHelix Helix() const {
  424. return helix();
  425. }
  426. /// Helix of the global track
  427. MpdFemtoPhysicalHelix gHelix() const;
  428. //
  429. // Setters
  430. //
  431. /// Set track unique ID
  432. void setId(const unsigned short& id) {
  433. mId = (unsigned short) id;
  434. }
  435. /// Set track unique ID
  436. void SetId(const unsigned short& id) {
  437. setId(id);
  438. }
  439. /// Set track flag
  440. void setFlag(const short& flag) {
  441. mFlag = flag;
  442. }
  443. /// Set track flag
  444. void SetFlag(const short& flag) {
  445. setFlag(flag);
  446. }
  447. /// Set number of hits. IMPORTANT: must be charge*nHits
  448. void setNHits(const short& nhits) {
  449. mNHits = (char) nhits;
  450. }
  451. /// Set number of hits. IMPORTANT: must be charge*nHits
  452. void SetNHits(const short& nhits) {
  453. setNHits(nhits);
  454. }
  455. /// Set number of possible hits
  456. void setNHitsPossible(const short& nh) {
  457. mNHitsPoss = (unsigned char) nh;
  458. }
  459. /// Set number of possible hits
  460. void SetNHitsPossible(const short& nh) {
  461. setNHitsPossible(nh);
  462. }
  463. /// Set number of hits used for dE/dx estimation
  464. void setNHitsDedx(const short& nh) {
  465. mNHitsDedx = (unsigned char) nh;
  466. }
  467. /// Set number of hits used for dE/dx estimation
  468. void SetNHitsDedx(const short& nh) {
  469. setNHitsDedx(nh);
  470. }
  471. /// Set chi2 of the track reconstruction
  472. void setChi2(const float& chi2);
  473. /// Set chi2 of the track reconstruction
  474. void SetChi2(const float& chi2) {
  475. setChi2(chi2);
  476. }
  477. /// Set dE/dx (from GeV/cm)
  478. void setDedx(const double& dEdx);
  479. /// Set dE/dx (from GeV/cm)
  480. void SetDedx(const double& dEdx) {
  481. setDedx(dEdx);
  482. }
  483. /// Set dE/dx (from keV/cm)
  484. void setDedxFromKeV(const double& dEdx);
  485. /// Set dE/dx (from keV/cm)
  486. void SetDedxFromKeV(const double& dEdx) {
  487. setDedxFromKeV(dEdx);
  488. }
  489. /// Set nSigma(electron)
  490. void setNSigmaElectron(const float& nsigma);
  491. /// Set nSigma(electron)
  492. void SetNSigmaElectron(const float& nsigma) {
  493. setNSigmaElectron(nsigma);
  494. }
  495. /// Set nSigma(pion)
  496. void setNSigmaPion(const float& nsigma);
  497. /// Set nSigma(pion)
  498. void SetNSigmaPion(const float& nsigma) {
  499. setNSigmaPion(nsigma);
  500. }
  501. /// Set nSigma(kaon)
  502. void setNSigmaKaon(const float& nsigma);
  503. /// Set nSigma(kaon)
  504. void SetNSigmaKaon(const float& nsigma) {
  505. setNSigmaKaon(nsigma);
  506. }
  507. /// Set nSigma(proton)
  508. void setNSigmaProton(const float& nsigma);
  509. /// Set nSigma(proton)
  510. void SetNSigmaProton(const float& nsigma) {
  511. setNSigmaProton(nsigma);
  512. }
  513. /// Set probability of track to be electron
  514. void setPidProbElectron(const float& prob);
  515. /// Set probability of track to be electron
  516. void SetPidProbElectron(const float& prob) {
  517. setPidProbElectron(prob);
  518. }
  519. /// Set probability of track to be pion
  520. void setPidProbPion(const float& prob);
  521. /// Set probability of track to be pion
  522. void SetPidProbPion(const float& prob) {
  523. setPidProbPion(prob);
  524. }
  525. /// Set probability of track to be kaon
  526. void setPidProbKaon(const float& prob);
  527. /// Set probability of track to be kaon
  528. void SetPidProbKaon(const float& prob) {
  529. setPidProbKaon(prob);
  530. }
  531. /// Set probability of track to be proton
  532. void setPidProbProton(const float& prob);
  533. /// Set probability of track to be proton
  534. void SetPidProbProton(const float& prob) {
  535. setPidProbProton(prob);
  536. }
  537. /// Set DCA of the track to primary vertex (x,y,z)
  538. void setDca(const float& x, const float& y, const float& z) {
  539. mDcaX = x;
  540. mDcaY = y;
  541. mDcaZ = z;
  542. }
  543. /// Set DCA of the track to primary vertex (x,y,z)
  544. void SetDca(const float& x, const float& y, const float& z) {
  545. setDca(x, y, z);
  546. }
  547. /// Set DCAx of the track to primary vertex
  548. void setDcaX(const float& x) {
  549. mDcaX = x;
  550. }
  551. /// Set DCAx of the track to primary vertex
  552. void SetDcaX(const float& x) {
  553. setDcaX(x);
  554. }
  555. /// Set DCAy of the track to primary vertex
  556. void setDcaY(const float& y) {
  557. mDcaY = y;
  558. }
  559. /// Set DCAy of the track to primary vertex
  560. void SetDcaY(const float& y) {
  561. setDcaY(y);
  562. }
  563. /// Set DCAz of the track to primary vertex
  564. void setDcaZ(const float& z) {
  565. mDcaZ = z;
  566. }
  567. /// Set DCAz of the track to primary vertex
  568. void SetDcaZ(const float& z) {
  569. setDcaZ(z);
  570. }
  571. /// Set momentum of the primary track (x,y,z)
  572. void setP(const float& px, const float& py, const float& pz) {
  573. mPrimaryPx = px;
  574. mPrimaryPy = py;
  575. mPrimaryPz = pz;
  576. }
  577. /// Set momentum of the primary track (x,y,z)
  578. void SetP(const float& px, const float& py, const float& pz) {
  579. setP(px, py, pz);
  580. }
  581. /// Set momentum of the primary track (TVector3)
  582. void setP(const TVector3& mom) {
  583. mPrimaryPx = mom.X();
  584. mPrimaryPy = mom.Y();
  585. mPrimaryPz = mom.Z();
  586. }
  587. /// Set momentum of the primary track (TVector3)
  588. void SetP(const TVector3& mom) {
  589. setP(mom);
  590. }
  591. /// Set px of the primary track
  592. void setPx(const float& px) {
  593. mPrimaryPx = px;
  594. }
  595. /// Set px of the primary track
  596. void SetPx(const float& px) {
  597. setPx(px);
  598. }
  599. /// Set py of the primary track
  600. void setPy(const float& py) {
  601. mPrimaryPy = py;
  602. }
  603. /// Set py of the primary track
  604. void SetPy(const float& py) {
  605. setPy(py);
  606. }
  607. /// Set pz of the primary track
  608. void setPz(const float& pz) {
  609. mPrimaryPz = pz;
  610. }
  611. /// Set pz of the primary track
  612. void SetPz(const float& pz) {
  613. setPz(pz);
  614. }
  615. /// Set momentum of the global track (x,y,z)
  616. void setGlobalP(const float& px, const float& py, const float& pz) {
  617. mGlobalPx = px;
  618. mGlobalPy = py;
  619. mGlobalPz = pz;
  620. }
  621. /// Set momentum of the global track (x,y,z)
  622. void SetGlobalP(const float& px, const float& py, const float& pz) {
  623. setGlobalP(px, py, pz);
  624. }
  625. /// Set momentum of the global track (TVector3)
  626. void setGlobalP(const TVector3& mom) {
  627. mGlobalPx = mom.X();
  628. mGlobalPy = mom.Y();
  629. mGlobalPz = mom.Z();
  630. }
  631. /// Set momentum of the global track (TVector3)
  632. void SetGlobalP(const TVector3& mom) {
  633. setGlobalP(mom);
  634. }
  635. /// Set px of the global track
  636. void setGlobalPx(const float& px) {
  637. mGlobalPx = px;
  638. }
  639. /// Set px of the global track
  640. void SetGlobalPx(const float& px) {
  641. setGlobalPx(px);
  642. }
  643. /// Set py of the global track
  644. void setGlobalPy(const float& py) {
  645. mGlobalPy = py;
  646. }
  647. /// Set py of the global track
  648. void SetGlobalPy(const float& py) {
  649. setGlobalPy(py);
  650. }
  651. /// Set pz of the global track
  652. void setGlobalPz(const float& pz) {
  653. mGlobalPz = pz;
  654. }
  655. /// Set pz of the global track
  656. void SetGlobalPz(const float& pz) {
  657. setGlobalPz(pz);
  658. }
  659. /// Set primary vertex position (x,y,z)
  660. void setPrimaryVertex(const float& x, const float& y, const float& z) {
  661. mPrimaryVertexX = x;
  662. mPrimaryVertexY = y;
  663. mPrimaryVertexZ = z;
  664. }
  665. /// Set primary vertex position (x,y,z)
  666. void SetPrimaryVertex(const float& x, const float& y, const float& z) {
  667. setPrimaryVertex(x, y, z);
  668. }
  669. /// Set primary vertex position (TVector3)
  670. void setPrimaryVertex(const TVector3& vtx) {
  671. mPrimaryVertexX = vtx.X();
  672. mPrimaryVertexY = vtx.Y();
  673. mPrimaryVertexZ = vtx.Z();
  674. }
  675. /// Set primary vertex position (TVector3)
  676. void SetPrimaryVertex(const TVector3& vtx) {
  677. setPrimaryVertex(vtx);
  678. }
  679. /// Set x position of the primary vertex
  680. void setPrimaryVertexX(const float& x) {
  681. mPrimaryVertexX = x;
  682. }
  683. /// Set x position of the primary vertex
  684. void SetPrimaryVertexX(const float& x) {
  685. setPrimaryVertexX(x);
  686. }
  687. /// Set y position of the primary vertex
  688. void setPrimaryVertexY(const float& y) {
  689. mPrimaryVertexY = y;
  690. }
  691. /// Set y position of the primary vertex
  692. void SetPrimaryVertexY(const float& y) {
  693. setPrimaryVertexY(y);
  694. }
  695. /// Set z position of the primary vertex
  696. void setPrimaryVertexZ(const float& z) {
  697. mPrimaryVertexZ = z;
  698. }
  699. /// Set z position of the primary vertex
  700. void SetPrimaryVertexZ(const float& z) {
  701. setPrimaryVertexZ(z);
  702. }
  703. /// Set magnetic field strength
  704. void setMagneticField(const float& bField) {
  705. mBField = bField;
  706. }
  707. /// Set magnetic field strength
  708. void SetMagneticField(const float& bField) {
  709. setMagneticField(bField);
  710. }
  711. /// Set magnetic field strength
  712. void setBField(const float& bField) {
  713. setMagneticField(bField);
  714. }
  715. /// Set magnetic field strength
  716. void SetBField(const float& bField) {
  717. setMagneticField(bField);
  718. }
  719. /// Set topology (hit) map
  720. void setTopologyMap(const unsigned long &map) {
  721. mMap = map;
  722. }
  723. /// Set topology (hit) map
  724. void SetTopologyMap(const unsigned int &map) {
  725. setTopologyMap(map);
  726. }
  727. /// Set velocity (from TOF)
  728. void setBeta(const float &beta);
  729. /// Set velocity (from TOF)
  730. void SetBeta(const float &beta) {
  731. setBeta(beta);
  732. }
  733. // Theoretical information that should be created and coppied manually
  734. /// Set hidden information
  735. void setHiddenInfo(MpdFemtoHiddenInfo* aHiddenInfo) {
  736. mHiddenInfo = aHiddenInfo;
  737. }
  738. /// Set hidden information
  739. void SetHiddenInfo(MpdFemtoHiddenInfo* aHiddenInfo) {
  740. setHiddenInfo(aHiddenInfo);
  741. }
  742. /// If hidden info is valid
  743. bool validHiddenInfo() const {
  744. return (mHiddenInfo) ? true : false;
  745. }
  746. /// If hidden info is valid
  747. bool ValidHiddenInfo() const {
  748. return validHiddenInfo();
  749. }
  750. /// Retrieve hidden info
  751. MpdFemtoHiddenInfo* getHiddenInfo() const {
  752. return mHiddenInfo;
  753. }
  754. /// Retrieve hidden info
  755. MpdFemtoHiddenInfo* hiddenInfo() const {
  756. return getHiddenInfo();
  757. }
  758. /// Retrieve hidden info
  759. MpdFemtoHiddenInfo* GetHiddenInfo() const {
  760. return getHiddenInfo();
  761. }
  762. private:
  763. /// Unique track ID
  764. unsigned short mId;
  765. /// Flag (redundant)
  766. short mFlag;
  767. /// Number of hits and charge (encoding: nHits*charge)
  768. char mNHits;
  769. /// Number of possible hits
  770. unsigned char mNHitsPoss;
  771. /// Number of hits used for dE/dx estimation
  772. unsigned char mNHitsDedx;
  773. /// Chi2 of the track reconstruction (compression factor = *1000)
  774. unsigned short mChi2;
  775. /// Ionization energy loss (in eV/cm) (compression factor = *10^9)
  776. unsigned short mDedx;
  777. /// Number of sigma for electron estimated via dE/dx
  778. /// in TPC (compression factor = *1000)
  779. short mNSigmaElectron;
  780. /// Number of sigma for pion estimated via dE/dx
  781. /// in TPC (compression factor = *1000)
  782. short mNSigmaPion;
  783. /// Number of sigma for kaon estimated via dE/dx
  784. /// in TPC (compression factor = *1000)
  785. short mNSigmaKaon;
  786. /// Number of sigma for proton estimated via dE/dx
  787. /// in TPC (compression factor = *1000)
  788. short mNSigmaProton;
  789. /// Probability of the track to be electron
  790. /// (compression factor = *10000)
  791. unsigned short mPidProbElectron;
  792. /// Probability of the track to be pion
  793. /// (compression factor = *10000)
  794. unsigned short mPidProbPion;
  795. /// Probability of the track to be kaon
  796. /// (compression factor = *10000)
  797. unsigned short mPidProbKaon;
  798. /// Probability of the track to be proton
  799. /// (compression factor = *10000)
  800. unsigned short mPidProbProton;
  801. /// Topology map
  802. unsigned long mMap;
  803. /// Time-of-Flight information. 0 correseponds
  804. /// to the absence of the signal (compression = *20000)
  805. unsigned short mTofBeta;
  806. /// px of the primary track momentum (0 - if not primary)
  807. float mPrimaryPx;
  808. /// py of the primary track momentum (0 - if not primary)
  809. float mPrimaryPy;
  810. /// pz of the primary track momentum (0 - if not primary)
  811. float mPrimaryPz;
  812. /// px of global track at DCA to primary vertex
  813. float mGlobalPx;
  814. /// py of global track at DCA to primary vertex
  815. float mGlobalPy;
  816. /// pz of global track at DCA to primary vertex
  817. float mGlobalPz;
  818. /// DCAx of the global track to primary vertex (cm)
  819. float mDcaX;
  820. /// DCAy of the global track to primary vertex (cm)
  821. float mDcaY;
  822. /// DCAz of the global track to primary vertex (cm)
  823. float mDcaZ;
  824. // Primary vertex position ( dca2pvtx = trackOrigin - vertexPosition )
  825. /// x position of the primary vertex
  826. float mPrimaryVertexX;
  827. /// y position of the primary vertex
  828. float mPrimaryVertexY;
  829. /// z position of the primary vertex
  830. float mPrimaryVertexZ;
  831. /// Magnetic field strength (needed for helix esitmation)
  832. float mBField;
  833. /// Hidden info (to work with MC data)
  834. MpdFemtoHiddenInfo* mHiddenInfo; //!
  835. ClassDef(MpdFemtoTrack, 2)
  836. };
  837. #endif // #define MpdFemtoTrack_h