MpdFemtoModelHiddenInfo.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. /**
  2. * \class MpdFemtoModelHiddenInfo
  3. * \brief The hidden information for model calculations
  4. *
  5. * Stores information needed for the weight generation - the true
  6. * simulated momenta, freeze-out coordinates from model and particle PID
  7. *
  8. * \author Grigory Nigmatkulov (NRNU MEPhI)
  9. * \date May 18, 2019
  10. * \email nigmatkulov@gmail.com
  11. */
  12. #ifndef MpdFemtoModelHiddenInfo_h
  13. #define MpdFemtoModelHiddenInfo_h
  14. // C++ headers
  15. #include <limits>
  16. // MpdFemtoMaker headers
  17. #include "MpdFemtoHiddenInfo.h"
  18. #include "MpdFemtoTypes.h"
  19. // ROOT headers
  20. #include "TVector3.h"
  21. #include "TLorentzVector.h"
  22. #include "TDatabasePDG.h"
  23. #include "TParticlePDG.h"
  24. #include "TParticle.h"
  25. //_________________
  26. class MpdFemtoModelHiddenInfo : public MpdFemtoHiddenInfo {
  27. public:
  28. /// Default constructor
  29. MpdFemtoModelHiddenInfo();
  30. /// Copy constructor
  31. MpdFemtoModelHiddenInfo(const MpdFemtoModelHiddenInfo &aInfo);
  32. /// Assignment operator
  33. MpdFemtoModelHiddenInfo& operator=(const MpdFemtoModelHiddenInfo& aInfo);
  34. /// Destructor
  35. virtual ~MpdFemtoModelHiddenInfo();
  36. /// Return true momentum of the particle (px,py,pz)
  37. TVector3 trueMomentum() const;
  38. /// Return true momentum of the particle (px,py,pz)
  39. TVector3 TrueMomentum() const {
  40. return trueMomentum();
  41. }
  42. /// Return momentum of the mother track (px,py,pz)
  43. TVector3 motherMomentum() const;
  44. /// Return momentum of the mother track (px,py,pz)
  45. TVector3 MotherMomentum() const {
  46. return motherMomentum();
  47. }
  48. /// Return emission point (x,y,z,t)
  49. TLorentzVector emissionPoint() const;
  50. /// Return emission point (x,y,z,t)
  51. TLorentzVector EmissionPoint() const {
  52. return emissionPoint();
  53. }
  54. /// PDG code
  55. int pdgId() const {
  56. return mPDGPid;
  57. }
  58. /// PDG code
  59. int PdgId() const {
  60. return pdgId();
  61. }
  62. /// PDG code
  63. int pdgPid() const {
  64. return pdgId();
  65. }
  66. /// PDG code
  67. int PdgPid() const {
  68. return pdgId();
  69. }
  70. /// PDG code of the mother particle
  71. int motherPdgCode() const {
  72. return mMotherPdg;
  73. }
  74. /// PDG code of the mother particle
  75. int MotherPdgCode() const {
  76. return motherPdgCode();
  77. }
  78. /// Particle mass
  79. float mass() const {
  80. return TDatabasePDG::Instance()->GetParticle(pdgPid())->Mass();
  81. }
  82. /// Particle mass
  83. float Mass() const {
  84. return mass();
  85. }
  86. /// Particle charge
  87. float charge() const {
  88. return TDatabasePDG::Instance()->GetParticle(pdgPid())->Charge();
  89. }
  90. /// Particle charge
  91. float Charge() const {
  92. return charge();
  93. }
  94. /// Return mother's mass
  95. float motherMass() const {
  96. return TDatabasePDG::Instance()->GetParticle(motherPdgCode())->Mass();
  97. }
  98. /// Return mother's mass
  99. float MotherMass() const {
  100. return motherMass();
  101. }
  102. /// Return mother's charge
  103. float motherCharge() const {
  104. return TDatabasePDG::Instance()->GetParticle(motherPdgCode())->Charge();
  105. }
  106. /// Return mother's charge
  107. float MotherCharge() const {
  108. return motherCharge();
  109. }
  110. /// Return true momentum of the positive track (px,py,pz)
  111. TVector3 trueMomentumPos() const;
  112. /// Return true momentum of the positive track (px,py,pz)
  113. TVector3 TrueMomentumPos() const {
  114. return trueMomentumPos();
  115. }
  116. /// Return emission point of the positive track (x,y,z,t)
  117. TLorentzVector emissionPointPos() const;
  118. /// Return emission point of the positive track (x,y,z,t)
  119. TLorentzVector EmissionPointPos() const {
  120. return emissionPointPos();
  121. }
  122. /// Return PDG code of the positive track
  123. int pdgPidPos() const {
  124. return mPDGPidPos;
  125. }
  126. /// Return PDG code of the positive track
  127. int PdgPidPos() const {
  128. return pdgPidPos();
  129. }
  130. /// Return mass of the positive track
  131. float massPos() const {
  132. return TDatabasePDG::Instance()->GetParticle(pdgPidPos())->Mass();
  133. }
  134. /// Return mass of the positive track
  135. float MassPos() const {
  136. return massPos();
  137. }
  138. /// Return true momentum of the negative track (px,py,pz)
  139. TVector3 trueMomentumNeg() const;
  140. /// Return true momentum of the negative track (px,py,pz)
  141. TVector3 TrueMomentumNeg() const {
  142. return trueMomentumNeg();
  143. }
  144. /// Return emission point of the negative track (x,y,z,t)
  145. TLorentzVector emissionPointNeg() const;
  146. /// Return emission point of the negative track (x,y,z,t)
  147. TLorentzVector EmissionPointNeg() const {
  148. return emissionPointNeg();
  149. };
  150. /// Return PDG code of the negative track
  151. int pdgPidNeg() const {
  152. return mPDGPidNeg;
  153. }
  154. /// Return PDG code of the negative track
  155. int PdgPidNeg() const {
  156. return pdgPidNeg();
  157. }
  158. /// Return mass of the positive track
  159. float massNeg() const {
  160. return TDatabasePDG::Instance()->GetParticle(pdgPidNeg())->Mass();
  161. }
  162. /// Return mass of the positive track
  163. float MassNeg() const {
  164. return massNeg();
  165. }
  166. /// Return origin:
  167. /// \param -1 unknown
  168. /// \param 0 physical primary
  169. /// \param 1 secondary from weak decay
  170. /// \param 2 secondary from material
  171. int origin() const {
  172. return (int) mOrigin;
  173. }
  174. /// Return origin:
  175. /// \param -1 unknown
  176. /// \param 0 physical primary
  177. /// \param 1 secondary from weak decay
  178. /// \param 2 secondary from material
  179. int Origin() const {
  180. return origin();
  181. }
  182. /// Set true momentum of the particle
  183. void setTrueMomentum(TVector3 *aMom);
  184. /// Set true momentum of the particle
  185. void SetTrueMomentum(TVector3 *aMom) {
  186. setTrueMomentum(aMom);
  187. }
  188. /// Set true momentum of the particle
  189. void setTrueMomentum(const TVector3& aMom);
  190. /// Set true momentum of the particle
  191. void SetTrueMomentum(const TVector3& aMom) {
  192. SetTrueMomentum(aMom);
  193. }
  194. /// Set true momentum of the particle
  195. void setTrueMomentum(const double& aPx, const double& aPy, const double& aPz);
  196. /// Set true momentum of the particle
  197. void SetTrueMomentum(const double& aPx, const double& aPy, const double& aPz) {
  198. setTrueMomentum(aPx, aPy, aPz);
  199. }
  200. /// Set momentum of the mother track
  201. void setMotherMomentum(TVector3 *aMom);
  202. /// Set momentum of the mother track
  203. void SetMotherMomentum(TVector3 *aMom) {
  204. setMotherMomentum(aMom);
  205. }
  206. /// Set momentum of the mother track
  207. void setMotherMomentum(const TVector3& aMom);
  208. /// Set momentum of the mother track
  209. void SetMotherMomentum(const TVector3& aMom) {
  210. setMotherMomentum(aMom);
  211. }
  212. /// Set momentum of the mother track
  213. void setMotherMomentum(const double& aPx, const double& aPy, const double& aPz);
  214. /// Set momentum of the mother track
  215. void SetMotherMomentum(const double& aPx, const double& aPy, const double& aPz) {
  216. setMotherMomentum(aPx, aPy, aPz);
  217. }
  218. /// Set emission point position (x,y,z,t)
  219. void setEmissionPoint(TLorentzVector *aPos);
  220. /// Set emission point position (x,y,z,t)
  221. void SetEmissionPoint(TLorentzVector *aPos) {
  222. setEmissionPoint(aPos);
  223. }
  224. /// Set emission point position (x,y,z,t)
  225. void setEmissionPoint(const TLorentzVector& aPos);
  226. /// Set emission point position (x,y,z,t)
  227. void SetEmissionPoint(const TLorentzVector& aPos) {
  228. setEmissionPoint(aPos);
  229. }
  230. /// Set emission point position (x,y,z,t)
  231. void setEmissionPoint(const double& aRx, const double& aRy, const double& aRz, const double& aT);
  232. /// Set emission point position (x,y,z,t)
  233. void SetEmissionPoint(const double& aRx, const double& aRy, const double& aRz, const double& aT) {
  234. setEmissionPoint(aRx, aRy, aRz, aT);
  235. }
  236. /// Set PDG code
  237. void setPdgPid(const int& aPid) {
  238. mPDGPid = aPid;
  239. }
  240. /// Set PDG code
  241. void setPDGPid(const int& aPid) {
  242. setPDGPid(aPid);
  243. }
  244. /// Set PDG code
  245. void SetPdgPid(const int& aPid) {
  246. setPdgPid(aPid);
  247. }
  248. /// Set PDG code of the mother particle
  249. void setMotherPdgCode(const int& motherPdg) {
  250. mMotherPdg = motherPdg;
  251. }
  252. /// Set PDG code of the mother particle
  253. void SetMotherPdgCode(const int& motherPdg) {
  254. setMotherPdgCode(motherPdg);
  255. }
  256. /// Set true momentum of the positive track (px,py,pz)
  257. void setTrueMomentumPos(TVector3 *aMom);
  258. /// Set true momentum of the positive track (px,py,pz)
  259. void SetTrueMomentumPos(TVector3 *aMom) {
  260. setTrueMomentumPos(aMom);
  261. }
  262. /// Set true momentum of the positive track (px,py,pz)
  263. void setTrueMomentumPos(const TVector3& aMom);
  264. /// Set true momentum of the positive track (px,py,pz)
  265. void SetTrueMomentumPos(const TVector3& aMom) {
  266. setTrueMomentumPos(aMom);
  267. }
  268. /// Set true momentum of the positive track (px,py,pz)
  269. void setTrueMomentumPos(const double& aPx, const double& aPy, const double& aPz);
  270. /// Set true momentum of the positive track (px,py,pz)
  271. void SetTrueMomentumPos(const double& aPx, const double& aPy, const double& aPz) {
  272. setTrueMomentumPos(aPx, aPy, aPz);
  273. }
  274. /// Set emission point position of the positive track (x,y,z,t)
  275. void setEmissionPointPos(TLorentzVector *aPos);
  276. /// Set emission point position of the positive track (x,y,z,t)
  277. void SetEmissionPointPos(TLorentzVector *aPos) {
  278. setEmissionPointPos(aPos);
  279. }
  280. /// Set emission point position of the positive track (x,y,z,t)
  281. void setEmissionPointPos(const TLorentzVector& aPos);
  282. /// Set emission point position of the positive track (x,y,z,t)
  283. void SetEmissionPointPos(const TLorentzVector& aPos) {
  284. setEmissionPointPos(aPos);
  285. }
  286. /// Set emission point position of the positive track (x,y,z,t)
  287. void setEmissionPointPos(const double& aRx, const double& aRy, const double& aRz, const double& aT);
  288. /// Set emission point position of the positive track (x,y,z,t)
  289. void SetEmissionPointPos(const double& aRx, const double& aRy, const double& aRz, const double& aT) {
  290. setEmissionPointPos(aRx, aRy, aRz, aT);
  291. }
  292. /// Set PDG code of the positive track
  293. void setPdgPidPos(const int& aPid) {
  294. mPDGPidPos = aPid;
  295. }
  296. /// Set PDG code of the positive track
  297. void setPDGPidPos(const int& aPid) {
  298. setPdgPidPos(aPid);
  299. }
  300. /// Set PDG code of the positive track
  301. void SetPdgPidPos(const int& aPid) {
  302. setPdgPidPos(aPid);
  303. }
  304. /// Set true momentum of the negative track (px,py,pz)
  305. void setTrueMomentumNeg(TVector3 *aMom);
  306. /// Set true momentum of the negative track (px,py,pz)
  307. void SetTrueMomentumNeg(TVector3 *aMom) {
  308. setTrueMomentumNeg(aMom);
  309. }
  310. /// Set true momentum of the negative track (px,py,pz)
  311. void setTrueMomentumNeg(const TVector3& aMom);
  312. /// Set true momentum of the negative track (px,py,pz)
  313. void SetTrueMomentumNeg(const TVector3& aMom) {
  314. setTrueMomentumNeg(aMom);
  315. }
  316. /// Set true momentum of the negative track (px,py,pz)
  317. void setTrueMomentumNeg(const double& aPx, const double& aPy, const double& aPz);
  318. /// Set true momentum of the negative track (px,py,pz)
  319. void SetTrueMomentumNeg(const double& aPx, const double& aPy, const double& aPz) {
  320. setTrueMomentumNeg(aPx, aPy, aPz);
  321. }
  322. /// Set emission point position of the negative track (x,y,z,t)
  323. void setEmissionPointNeg(TLorentzVector *aNeg);
  324. /// Set emission point position of the negative track (x,y,z,t)
  325. void SetEmissionPointNeg(TLorentzVector *aNeg) {
  326. setEmissionPointNeg(aNeg);
  327. }
  328. /// Set emission point position of the negative track (x,y,z,t)
  329. void setEmissionPointNeg(const TLorentzVector& aNeg);
  330. /// Set emission point position of the negative track (x,y,z,t)
  331. void SetEmissionPointNeg(const TLorentzVector& aNeg) {
  332. setEmissionPointNeg(aNeg);
  333. }
  334. /// Set emission point position of the negative track (x,y,z,t)
  335. void setEmissionPointNeg(const double& aRx, const double& aRy, const double& aRz, const double& aT);
  336. /// Set emission point position of the negative track (x,y,z,t)
  337. void SetEmissionPointNeg(const double& aRx, const double& aRy, const double& aRz, const double& aT) {
  338. setEmissionPointNeg(aRx, aRy, aRz, aT);
  339. }
  340. /// Set PDG code of the negative track
  341. void setPdgPidNeg(const int& aPid) {
  342. mPDGPidNeg = aPid;
  343. }
  344. /// Set PDG code of the negative track
  345. void setPDGPidNeg(const int& aPid) {
  346. setPdgPidNeg(aPid);
  347. }
  348. /// Set PDG code of the negative track
  349. void SetPdgPidNeg(const int& aPid) {
  350. setPdgPidNeg(aPid);
  351. }
  352. /// Set origin:
  353. /// \param 0 physical primary
  354. /// \param 1 secondary from weak decay
  355. /// \param 2 secondary from material
  356. void setOrigin(const int& origin) {
  357. mOrigin = ((origin > 2 || origin < 0) ? -1 : (char) origin);
  358. }
  359. /// Set origin:
  360. /// \param 0 physical primary
  361. /// \param 1 secondary from weak decay
  362. /// \param 2 secondary from material
  363. void SetOrigin(const int& origin) {
  364. setOrigin(origin);
  365. }
  366. // !!! MANDATORY !!!
  367. /// Copy the hidden info from MpdFemtoTrack to MpdFemtoParticle
  368. virtual MpdFemtoHiddenInfo* clone() const {
  369. return getParticleHiddenInfo();
  370. }
  371. /// Copy the hidden info from MpdFemtoTrack to MpdFemtoParticle
  372. virtual MpdFemtoHiddenInfo* Clone() const {
  373. return clone();
  374. }
  375. protected:
  376. /// Return copy of the hidden info
  377. virtual MpdFemtoHiddenInfo* getParticleHiddenInfo() const;
  378. /// Return copy of the hidden info
  379. virtual MpdFemtoHiddenInfo* GetParticleHiddenInfo() const {
  380. return getParticleHiddenInfo();
  381. }
  382. /// X component of true (simulated) momentum
  383. float *mTrueMomentumX;
  384. /// Y component of true (simulated) momentum
  385. float *mTrueMomentumY;
  386. /// Z component of true (simulated) momentum
  387. float *mTrueMomentumZ;
  388. /// X component of momentum of mother particle
  389. float *mMotherMomentumX;
  390. /// Y component of momentum of mother particle
  391. float *mMotherMomentumY;
  392. /// Z component of momentum of mother particle
  393. float *mMotherMomentumZ;
  394. /// Emission point coordinate X
  395. float *mEmissionPointX;
  396. /// Emission point coordinate Y
  397. float *mEmissionPointY;
  398. /// Emission point coordinate Z
  399. float *mEmissionPointZ;
  400. /// Emission point coordinate T
  401. float *mEmissionPointT;
  402. /// True PID of the particle
  403. int mPDGPid;
  404. /// PDG code of particle's mother
  405. int mMotherPdg;
  406. /// X component of the daughter particle momentum
  407. float *mTrueMomentumPosX;
  408. /// Y component of the daughter particle momentum
  409. float *mTrueMomentumPosY;
  410. /// Z component of the daughter particle momentum
  411. float *mTrueMomentumPosZ;
  412. /// X coordinate of the emission point coordinates of positive daughter
  413. float *mEmissionPointPosX;
  414. /// Y coordinate of the emission point coordinates of positive daughter
  415. float *mEmissionPointPosY;
  416. /// Z coordinate of the emission point coordinates of positive daughter
  417. float *mEmissionPointPosZ;
  418. /// T coordinate of the emission point coordinates of positive daughter
  419. float *mEmissionPointPosT;
  420. /// True PID of positive daughter
  421. int mPDGPidPos;
  422. /// X component of the daughter particle momentum
  423. float *mTrueMomentumNegX;
  424. /// Y component of the daughter particle momentum
  425. float *mTrueMomentumNegY;
  426. /// Z component of the daughter particle momentum
  427. float *mTrueMomentumNegZ;
  428. /// X coordinate of the emission point coordinates of negative daughter
  429. float *mEmissionPointNegX;
  430. /// Y coordinate of the emission point coordinates of negative daughter
  431. float *mEmissionPointNegY;
  432. /// Z coordinate of the emission point coordinates of negative daughter
  433. float *mEmissionPointNegZ;
  434. /// T coordinate of the emission point coordinates of negative daughter
  435. float *mEmissionPointNegT;
  436. /// True PID of negative daughter
  437. int mPDGPidNeg;
  438. /// Origin of particles:
  439. /// \param -1 unknown
  440. /// \param 0 physical primary
  441. /// \param 1 secondary from weak decay
  442. /// \param 2 secondary from material
  443. char mOrigin;
  444. ClassDef(MpdFemtoModelHiddenInfo, 1)
  445. };
  446. #endif // MpdFemtoModelHiddenInfo_h