MpdFemtoParticle.cxx 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672
  1. //
  2. // Main class holding particle information
  3. //
  4. // C++ headers
  5. #include <iostream>
  6. #include <utility>
  7. // MpdFemtoMaker headers
  8. #include "MpdFemtoParticle.h"
  9. #include "math_constants.h"
  10. // ROOT headers
  11. #include "TMath.h"
  12. ClassImp(MpdFemtoParticle)
  13. float MpdFemtoParticle::mPrimPimPar0 = 9.05632e-01;
  14. float MpdFemtoParticle::mPrimPimPar1 = -2.26737e-01;
  15. float MpdFemtoParticle::mPrimPimPar2 = -1.03922e-01;
  16. float MpdFemtoParticle::mPrimPipPar0 = 9.09616e-01;
  17. float MpdFemtoParticle::mPrimPipPar1 = -9.00511e-02;
  18. float MpdFemtoParticle::mPrimPipPar2 = -6.02940e-02;
  19. float MpdFemtoParticle::mPrimPmPar0 = 0.;
  20. float MpdFemtoParticle::mPrimPmPar1 = 0.;
  21. float MpdFemtoParticle::mPrimPmPar2 = 0.;
  22. float MpdFemtoParticle::mPrimPpPar0 = 0.;
  23. float MpdFemtoParticle::mPrimPpPar1 = 0.;
  24. float MpdFemtoParticle::mPrimPpPar2 = 0.;
  25. float MpdFemtoParticle::mInnerTpcRadius = 34.f; //[cm]
  26. float MpdFemtoParticle::mOuterTpcRadius = 133.f; //[cm]
  27. float MpdFemtoParticle::mTpcHalfLength = 163.f; //[cm]
  28. // TODO: investigate pad sizes and pitches between them
  29. float MpdFemtoParticle::tRowRadius[mNumberOfPadrows] = { 34, 35.5, 37, 38.5, 40, 41.5, 43, 44.5,
  30. 46, 47.5, 49, 50.5, 52, 53.5, 55, 56.5,
  31. 58, 59.5, 61, 62.5, 64, 65.5, 67, 68.5,
  32. 70, 71.5, 73,
  33. 74.5, 76.6, 78.7, 80.8, 82.9, 85, 87.1,
  34. 89.2, 91.3, 93.4, 95.5, 97.6, 99.7, 101.8,
  35. 103.9, 106, 108.1, 110.2, 112.3, 114.4, 116.5,
  36. 118.6, 120.7, 122.8, 124.9, 127 };
  37. //_________________
  38. int TpcLocalTransform(TVector3& xgl,
  39. int& iSector,
  40. int& iPadrow,
  41. float& xlocal,
  42. double& ttPhi);
  43. //_________________
  44. MpdFemtoParticle::MpdFemtoParticle() :
  45. mTrack(nullptr),
  46. mV0(nullptr),
  47. mKink(nullptr),
  48. mXi(nullptr),
  49. mPx(0), mPy(0), mPz(0), mEnergy(0),
  50. mTpcTrackEntrancePointX(0),
  51. mTpcTrackEntrancePointY(0),
  52. mTpcTrackEntrancePointZ(0),
  53. mTpcTrackExitPointX(0),
  54. mTpcTrackExitPointY(0),
  55. mTpcTrackExitPointZ(0),
  56. mNominalPosSampleX{}, mNominalPosSampleY{}, mNominalPosSampleZ{},
  57. mTpcV0NegPosSampleX(nullptr),
  58. mTpcV0NegPosSampleY(nullptr),
  59. mTpcV0NegPosSampleZ(nullptr),
  60. mZ{}, mU{}, mSect{},
  61. mV0NegZ(nullptr),
  62. mV0NegU(nullptr),
  63. mV0NegSect(nullptr),
  64. mHiddenInfo(nullptr),
  65. mPurity{},
  66. mPrimaryVertexX(-999),
  67. mPrimaryVertexY(-999),
  68. mPrimaryVertexZ(-999),
  69. mSecondaryVertexX(nullptr),
  70. mSecondaryVertexY(nullptr),
  71. mSecondaryVertexZ(nullptr),
  72. mTpcV0PosEntrancePointX(nullptr),
  73. mTpcV0PosEntrancePointY(nullptr),
  74. mTpcV0PosEntrancePointZ(nullptr),
  75. mTpcV0PosExitPointX(nullptr),
  76. mTpcV0PosExitPointY(nullptr),
  77. mTpcV0PosExitPointZ(nullptr),
  78. mTpcV0NegEntrancePointX(nullptr),
  79. mTpcV0NegEntrancePointY(nullptr),
  80. mTpcV0NegEntrancePointZ(nullptr),
  81. mTpcV0NegExitPointX(nullptr),
  82. mTpcV0NegExitPointY(nullptr),
  83. mTpcV0NegExitPointZ(nullptr) {
  84. // Since we do not know which type of particles will be filled
  85. // we will make arrays for V0 by default
  86. mTpcV0NegPosSampleX = new float[mNumberOfPoints];
  87. mTpcV0NegPosSampleY = new float[mNumberOfPoints];
  88. mTpcV0NegPosSampleZ = new float[mNumberOfPoints];
  89. mV0NegZ = new float[mNumberOfPadrows];
  90. mV0NegU = new float[mNumberOfPadrows];
  91. mV0NegSect = new int[mNumberOfPadrows];
  92. mSecondaryVertexX = new float;
  93. mSecondaryVertexY = new float;
  94. mSecondaryVertexZ = new float;
  95. mTpcV0PosEntrancePointX = new float;
  96. mTpcV0PosEntrancePointY = new float;
  97. mTpcV0PosEntrancePointZ = new float;
  98. mTpcV0PosExitPointX = new float;
  99. mTpcV0PosExitPointY = new float;
  100. mTpcV0PosExitPointZ = new float;
  101. mTpcV0NegEntrancePointX = new float;
  102. mTpcV0NegEntrancePointY = new float;
  103. mTpcV0NegEntrancePointZ = new float;
  104. mTpcV0NegExitPointX = new float;
  105. mTpcV0NegExitPointY = new float;
  106. mTpcV0NegExitPointZ = new float;
  107. }
  108. //_________________
  109. MpdFemtoParticle::MpdFemtoParticle(const MpdFemtoParticle &part) :
  110. mTrack(nullptr), mV0(nullptr), mKink(nullptr),
  111. mXi(nullptr), mPx(part.mPx), mPy(part.mPy),
  112. mPz(part.mPz), mEnergy(part.mEnergy),
  113. mTpcTrackEntrancePointX(part.mTpcTrackEntrancePointX),
  114. mTpcTrackEntrancePointY(part.mTpcTrackEntrancePointY),
  115. mTpcTrackEntrancePointZ(part.mTpcTrackEntrancePointZ),
  116. mTpcTrackExitPointX(part.mTpcTrackExitPointX),
  117. mTpcTrackExitPointY(part.mTpcTrackExitPointY),
  118. mTpcTrackExitPointZ(part.mTpcTrackExitPointZ),
  119. mTpcV0NegPosSampleX(nullptr),
  120. mTpcV0NegPosSampleY(nullptr),
  121. mTpcV0NegPosSampleZ(nullptr),
  122. mV0NegZ(nullptr),
  123. mV0NegU(nullptr),
  124. mV0NegSect(nullptr),
  125. mHiddenInfo(nullptr),
  126. mPrimaryVertexX(part.mPrimaryVertexX),
  127. mPrimaryVertexY(part.mPrimaryVertexY),
  128. mPrimaryVertexZ(part.mPrimaryVertexZ),
  129. mSecondaryVertexX(nullptr),
  130. mSecondaryVertexY(nullptr),
  131. mSecondaryVertexZ(nullptr),
  132. mTpcV0PosEntrancePointX(nullptr),
  133. mTpcV0PosEntrancePointY(nullptr),
  134. mTpcV0PosEntrancePointZ(nullptr),
  135. mTpcV0PosExitPointX(nullptr),
  136. mTpcV0PosExitPointY(nullptr),
  137. mTpcV0PosExitPointZ(nullptr),
  138. mTpcV0NegEntrancePointX(nullptr),
  139. mTpcV0NegEntrancePointY(nullptr),
  140. mTpcV0NegEntrancePointZ(nullptr),
  141. mTpcV0NegExitPointX(nullptr),
  142. mTpcV0NegExitPointY(nullptr),
  143. mTpcV0NegExitPointZ(nullptr) {
  144. memcpy(mNominalPosSampleX, part.mNominalPosSampleX, sizeof (mNominalPosSampleX));
  145. memcpy(mNominalPosSampleY, part.mNominalPosSampleY, sizeof (mNominalPosSampleY));
  146. memcpy(mNominalPosSampleZ, part.mNominalPosSampleZ, sizeof (mNominalPosSampleZ));
  147. if (part.mTpcV0NegPosSampleX) {
  148. if (!mTpcV0NegPosSampleX) {
  149. mTpcV0NegPosSampleX = new float[mNumberOfPoints];
  150. }
  151. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  152. mTpcV0NegPosSampleX[iPoint] = part.mTpcV0NegPosSampleX[iPoint];
  153. }
  154. }
  155. if (part.mTpcV0NegPosSampleY) {
  156. if (!mTpcV0NegPosSampleY) {
  157. mTpcV0NegPosSampleY = new float[mNumberOfPoints];
  158. }
  159. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  160. mTpcV0NegPosSampleY[iPoint] = part.mTpcV0NegPosSampleY[iPoint];
  161. }
  162. }
  163. if (part.mTpcV0NegPosSampleZ) {
  164. if (!mTpcV0NegPosSampleZ) {
  165. mTpcV0NegPosSampleZ = new float[mNumberOfPoints];
  166. }
  167. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  168. mTpcV0NegPosSampleZ[iPoint] = part.mTpcV0NegPosSampleZ[iPoint];
  169. }
  170. }
  171. // Copy hit position information in the TPC local coordinate system
  172. memcpy(mZ, part.mZ, sizeof (mZ));
  173. memcpy(mU, part.mU, sizeof (mU));
  174. memcpy(mSect, part.mSect, sizeof (mSect));
  175. if (part.mV0NegZ) {
  176. if (!mV0NegZ) {
  177. mV0NegZ = new float[mNumberOfPadrows];
  178. }
  179. for (int iPad = 0; iPad < mNumberOfPadrows; iPad++) {
  180. mV0NegZ[iPad] = part.mV0NegZ[iPad];
  181. }
  182. }
  183. if (part.mV0NegU) {
  184. if (!mV0NegU) {
  185. mV0NegU = new float[mNumberOfPadrows];
  186. }
  187. for (int iPad = 0; iPad < mNumberOfPadrows; iPad++) {
  188. mV0NegU[iPad] = part.mV0NegU[iPad];
  189. }
  190. }
  191. if (part.mV0NegSect) {
  192. if (!mV0NegSect) {
  193. mV0NegSect = new int[mNumberOfPadrows];
  194. }
  195. for (int iPad = 0; iPad < mNumberOfPadrows; iPad++) {
  196. mV0NegSect[iPad] = part.mV0NegSect[iPad];
  197. }
  198. }
  199. // Copy purity information
  200. memcpy(mPurity, part.mPurity, sizeof (mPurity));
  201. // Copy secondary vertex information
  202. if (part.mSecondaryVertexX) {
  203. setSecondaryVertexX(*part.mSecondaryVertexX);
  204. }
  205. if (part.mSecondaryVertexY) {
  206. setSecondaryVertexY(*part.mSecondaryVertexY);
  207. }
  208. if (part.mSecondaryVertexZ) {
  209. setSecondaryVertexZ(*part.mSecondaryVertexZ);
  210. }
  211. // Copy V0 entrance/exit point information
  212. if (part.mTpcV0PosEntrancePointX) {
  213. setTpcV0PosEntrancePointX(*part.mTpcV0PosEntrancePointX);
  214. }
  215. if (part.mTpcV0PosEntrancePointY) {
  216. setTpcV0PosEntrancePointY(*part.mTpcV0PosEntrancePointY);
  217. }
  218. if (part.mTpcV0PosEntrancePointZ) {
  219. setTpcV0PosEntrancePointZ(*part.mTpcV0PosEntrancePointZ);
  220. }
  221. if (part.mTpcV0PosExitPointX) {
  222. setTpcV0PosExitPointX(*part.mTpcV0PosExitPointX);
  223. }
  224. if (part.mTpcV0PosExitPointY) {
  225. setTpcV0PosExitPointY(*part.mTpcV0PosExitPointY);
  226. }
  227. if (part.mTpcV0PosExitPointZ) {
  228. setTpcV0PosExitPointZ(*part.mTpcV0PosExitPointZ);
  229. }
  230. if (part.mTpcV0NegEntrancePointX) {
  231. setTpcV0NegEntrancePointX(*part.mTpcV0NegEntrancePointX);
  232. }
  233. if (part.mTpcV0NegEntrancePointY) {
  234. setTpcV0NegEntrancePointY(*part.mTpcV0NegEntrancePointY);
  235. }
  236. if (part.mTpcV0NegEntrancePointZ) {
  237. setTpcV0NegEntrancePointZ(*part.mTpcV0NegEntrancePointZ);
  238. }
  239. if (part.mTpcV0NegExitPointX) {
  240. setTpcV0NegExitPointX(*part.mTpcV0NegExitPointX);
  241. }
  242. if (part.mTpcV0NegExitPointY) {
  243. setTpcV0NegExitPointY(*part.mTpcV0NegExitPointY);
  244. }
  245. if (part.mTpcV0NegExitPointZ) {
  246. setTpcV0NegExitPointZ(*part.mTpcV0NegExitPointZ);
  247. }
  248. if (part.mTrack) {
  249. mTrack = new MpdFemtoTrack(*part.mTrack);
  250. }
  251. if (part.mV0) {
  252. mV0 = new MpdFemtoV0(*part.mV0);
  253. }
  254. if (part.mKink) {
  255. mKink = new MpdFemtoKink(*part.mKink);
  256. }
  257. if (part.mXi) {
  258. mXi = new MpdFemtoXi(*part.mXi);
  259. }
  260. }
  261. //_________________
  262. MpdFemtoParticle& MpdFemtoParticle::operator=(const MpdFemtoParticle& part) {
  263. if (this != &part) {
  264. if (part.mTrack) {
  265. if (!mTrack) {
  266. mTrack = new MpdFemtoTrack(*part.mTrack);
  267. } else {
  268. mTrack = part.mTrack;
  269. }
  270. }
  271. if (part.mV0) {
  272. if (!mV0) {
  273. mV0 = new MpdFemtoV0(*part.mV0);
  274. } else {
  275. mV0 = part.mV0;
  276. }
  277. } //if( part.mV0 )
  278. if (part.mKink) {
  279. if (!mKink) {
  280. mKink = new MpdFemtoKink(*part.mKink);
  281. } else {
  282. mKink = part.mKink;
  283. }
  284. } //if( part.mKink )
  285. if (part.mXi) {
  286. if (!mXi) {
  287. mXi = new MpdFemtoXi(*part.mXi);
  288. } else {
  289. mXi = part.mXi;
  290. }
  291. } //if( part.mXi )
  292. mPx = part.mPx;
  293. mPy = part.mPy;
  294. mPz = part.mPz;
  295. mEnergy = part.mEnergy;
  296. mTpcTrackEntrancePointX = part.mTpcTrackEntrancePointX;
  297. mTpcTrackEntrancePointY = part.mTpcTrackEntrancePointY;
  298. mTpcTrackEntrancePointZ = part.mTpcTrackEntrancePointZ;
  299. mTpcTrackExitPointX = part.mTpcTrackExitPointX;
  300. mTpcTrackExitPointY = part.mTpcTrackExitPointY;
  301. mTpcTrackExitPointZ = part.mTpcTrackExitPointZ;
  302. memcpy(mNominalPosSampleX, part.mNominalPosSampleX, sizeof (mNominalPosSampleX));
  303. memcpy(mNominalPosSampleY, part.mNominalPosSampleY, sizeof (mNominalPosSampleY));
  304. memcpy(mNominalPosSampleZ, part.mNominalPosSampleZ, sizeof (mNominalPosSampleZ));
  305. if (part.mTpcV0NegPosSampleX) {
  306. if (!mTpcV0NegPosSampleX) {
  307. mTpcV0NegPosSampleX = new float;
  308. }
  309. mTpcV0NegPosSampleX = part.mTpcV0NegPosSampleX;
  310. } //if( part.mTpcV0NegPosSampleX )
  311. if (part.mTpcV0NegPosSampleY) {
  312. if (!mTpcV0NegPosSampleY) {
  313. mTpcV0NegPosSampleY = new float;
  314. }
  315. mTpcV0NegPosSampleY = part.mTpcV0NegPosSampleY;
  316. } //if( part.mTpcV0NegPosSampleY )
  317. if (part.mTpcV0NegPosSampleZ) {
  318. if (!mTpcV0NegPosSampleZ) {
  319. mTpcV0NegPosSampleZ = new float;
  320. }
  321. mTpcV0NegPosSampleZ = part.mTpcV0NegPosSampleZ;
  322. } //if( part.mTpcV0NegPosSampleZ )
  323. memcpy(mZ, part.mZ, sizeof ( mZ));
  324. memcpy(mU, part.mU, sizeof ( mU));
  325. memcpy(mSect, part.mSect, sizeof ( mSect));
  326. if (part.mV0NegZ) {
  327. if (!mV0NegZ) {
  328. mV0NegZ = new float;
  329. }
  330. mV0NegZ = part.mV0NegZ;
  331. }
  332. if (part.mV0NegU) {
  333. if (!mV0NegU) {
  334. mV0NegU = new float;
  335. }
  336. mV0NegU = part.mV0NegU;
  337. }
  338. if (part.mV0NegSect) {
  339. if (!mV0NegSect) {
  340. mV0NegSect = new int[mNumberOfPadrows];
  341. }
  342. mV0NegSect = part.mV0NegSect;
  343. }
  344. delete mHiddenInfo;
  345. if (part.mHiddenInfo) {
  346. mHiddenInfo = part.hiddenInfo()->clone();
  347. }
  348. memcpy(mPurity, part.mPurity, sizeof (mPurity));
  349. mPrimaryVertexX = part.mPrimaryVertexX;
  350. mPrimaryVertexY = part.mPrimaryVertexY;
  351. mPrimaryVertexZ = part.mPrimaryVertexZ;
  352. if (part.mSecondaryVertexX) {
  353. if (!mSecondaryVertexX) {
  354. mSecondaryVertexX = new float;
  355. }
  356. mSecondaryVertexX = part.mSecondaryVertexX;
  357. }
  358. if (part.mSecondaryVertexY) {
  359. if (!mSecondaryVertexY) {
  360. mSecondaryVertexY = new float;
  361. }
  362. mSecondaryVertexY = part.mSecondaryVertexY;
  363. }
  364. if (part.mSecondaryVertexZ) {
  365. if (!mSecondaryVertexZ) {
  366. mSecondaryVertexZ = new float;
  367. }
  368. mSecondaryVertexZ = part.mSecondaryVertexZ;
  369. }
  370. // Copy entrance/exit points
  371. if (part.mTpcV0PosEntrancePointX) {
  372. if (!mTpcV0PosEntrancePointX) {
  373. mTpcV0PosEntrancePointX = new float;
  374. }
  375. mTpcV0PosEntrancePointX = part.mTpcV0PosEntrancePointX;
  376. } //if( part.mTpcV0PosEntrancePointX )
  377. if (part.mTpcV0PosEntrancePointY) {
  378. if (!mTpcV0PosEntrancePointY) {
  379. mTpcV0PosEntrancePointY = new float;
  380. }
  381. mTpcV0PosEntrancePointY = part.mTpcV0PosEntrancePointY;
  382. } //if( part.mTpcV0PosEntrancePointY )
  383. if (part.mTpcV0PosEntrancePointZ) {
  384. if (!mTpcV0PosEntrancePointZ) {
  385. mTpcV0PosEntrancePointZ = new float;
  386. }
  387. mTpcV0PosEntrancePointZ = part.mTpcV0PosEntrancePointZ;
  388. } //if( part.mTpcV0PosEntrancePointZ )
  389. if (part.mTpcV0PosExitPointX) {
  390. if (!mTpcV0PosExitPointX) {
  391. mTpcV0PosExitPointX = new float;
  392. }
  393. mTpcV0PosExitPointX = part.mTpcV0PosExitPointX;
  394. } //if( part.mTpcV0PosExitPointX )
  395. if (part.mTpcV0PosExitPointY) {
  396. if (!mTpcV0PosExitPointY) {
  397. mTpcV0PosExitPointY = new float;
  398. }
  399. mTpcV0PosExitPointY = part.mTpcV0PosExitPointY;
  400. } //if( part.mTpcV0PosExitPointY )
  401. if (part.mTpcV0PosExitPointZ) {
  402. if (!mTpcV0PosExitPointZ) {
  403. mTpcV0PosExitPointZ = new float;
  404. }
  405. mTpcV0PosExitPointZ = part.mTpcV0PosExitPointZ;
  406. } //if( part.mTpcV0PosExitPointZ )
  407. if (part.mTpcV0NegEntrancePointX) {
  408. if (!mTpcV0NegEntrancePointX) {
  409. mTpcV0NegEntrancePointX = new float;
  410. }
  411. mTpcV0NegEntrancePointX = part.mTpcV0NegEntrancePointX;
  412. } //if( part.mTpcV0NegEntrancePointX )
  413. if (part.mTpcV0NegEntrancePointY) {
  414. if (!mTpcV0NegEntrancePointY) {
  415. mTpcV0NegEntrancePointY = new float;
  416. }
  417. mTpcV0NegEntrancePointY = part.mTpcV0NegEntrancePointY;
  418. } //if( part.mTpcV0NegEntrancePointY )
  419. if (part.mTpcV0NegEntrancePointZ) {
  420. if (!mTpcV0NegEntrancePointZ) {
  421. mTpcV0NegEntrancePointZ = new float;
  422. }
  423. mTpcV0NegEntrancePointZ = part.mTpcV0NegEntrancePointZ;
  424. } //if( part.mTpcV0NegEntrancePointZ )
  425. if (part.mTpcV0NegExitPointX) {
  426. if (!mTpcV0NegExitPointX) {
  427. mTpcV0NegExitPointX = new float;
  428. }
  429. mTpcV0NegExitPointX = part.mTpcV0NegExitPointX;
  430. } //if( part.mTpcV0NegExitPointX )
  431. if (part.mTpcV0NegExitPointY) {
  432. if (!mTpcV0NegExitPointY) {
  433. mTpcV0NegExitPointY = new float;
  434. }
  435. mTpcV0NegExitPointY = part.mTpcV0NegExitPointY;
  436. } //if( part.mTpcV0NegExitPointY )
  437. if (part.mTpcV0NegExitPointZ) {
  438. if (!mTpcV0NegExitPointZ) {
  439. mTpcV0NegExitPointZ = new float;
  440. }
  441. mTpcV0NegExitPointZ = part.mTpcV0NegExitPointZ;
  442. } //if( part.mTpcV0NegExitPointZ )
  443. }
  444. return *this;
  445. }
  446. //_________________
  447. MpdFemtoParticle::~MpdFemtoParticle() {
  448. if (mTrack) {
  449. delete mTrack;
  450. mTrack = nullptr;
  451. }
  452. if (mV0) {
  453. delete mV0;
  454. mV0 = nullptr;
  455. }
  456. if (mKink) {
  457. delete mKink;
  458. mKink = nullptr;
  459. }
  460. if (mXi) {
  461. delete mXi;
  462. mXi = nullptr;
  463. }
  464. if (mTpcV0NegPosSampleX) delete mTpcV0NegPosSampleX;
  465. if (mTpcV0NegPosSampleY) delete mTpcV0NegPosSampleY;
  466. if (mTpcV0NegPosSampleZ) delete mTpcV0NegPosSampleZ;
  467. if (mV0NegZ) delete mV0NegZ;
  468. if (mV0NegU) delete mV0NegU;
  469. if (mV0NegSect) delete mV0NegSect;
  470. if (mHiddenInfo) delete mHiddenInfo;
  471. if (mSecondaryVertexX) delete mSecondaryVertexX;
  472. if (mSecondaryVertexY) delete mSecondaryVertexY;
  473. if (mSecondaryVertexZ) delete mSecondaryVertexZ;
  474. if (mTpcV0PosEntrancePointX) delete mTpcV0PosEntrancePointX;
  475. if (mTpcV0PosEntrancePointY) delete mTpcV0PosEntrancePointY;
  476. if (mTpcV0PosEntrancePointZ) delete mTpcV0PosEntrancePointZ;
  477. if (mTpcV0PosExitPointX) delete mTpcV0PosExitPointX;
  478. if (mTpcV0PosExitPointY) delete mTpcV0PosExitPointY;
  479. if (mTpcV0PosExitPointZ) delete mTpcV0PosExitPointZ;
  480. if (mTpcV0NegEntrancePointX) delete mTpcV0NegEntrancePointX;
  481. if (mTpcV0NegEntrancePointY) delete mTpcV0NegEntrancePointY;
  482. if (mTpcV0NegEntrancePointZ) delete mTpcV0NegEntrancePointZ;
  483. if (mTpcV0NegExitPointX) delete mTpcV0NegExitPointX;
  484. if (mTpcV0NegExitPointY) delete mTpcV0NegExitPointY;
  485. if (mTpcV0NegExitPointZ) delete mTpcV0NegExitPointZ;
  486. }
  487. //_________________
  488. MpdFemtoParticle::MpdFemtoParticle(const MpdFemtoTrack * const hbtTrack, const double& mass) :
  489. mTrack(new MpdFemtoTrack(*hbtTrack)),
  490. mV0(nullptr),
  491. mKink(nullptr),
  492. mXi(nullptr),
  493. mPx(hbtTrack->p().X()),
  494. mPy(hbtTrack->p().Y()),
  495. mPz(hbtTrack->p().Z()),
  496. mEnergy(TMath::Sqrt(hbtTrack->ptot2() + mass*mass)),
  497. mTpcTrackEntrancePointX(0),
  498. mTpcTrackEntrancePointY(0),
  499. mTpcTrackEntrancePointZ(0),
  500. mTpcTrackExitPointX(0),
  501. mTpcTrackExitPointY(0),
  502. mTpcTrackExitPointZ(0),
  503. mNominalPosSampleX{},
  504. mNominalPosSampleY{},
  505. mNominalPosSampleZ{},
  506. mTpcV0NegPosSampleX(nullptr),
  507. mTpcV0NegPosSampleY(nullptr),
  508. mTpcV0NegPosSampleZ(nullptr),
  509. mZ{}, mU{}, mSect{},
  510. mV0NegZ(nullptr), mV0NegU(nullptr), mV0NegSect(nullptr),
  511. mHiddenInfo(nullptr),
  512. mPrimaryVertexX(hbtTrack->primaryVertex().X()),
  513. mPrimaryVertexY(hbtTrack->primaryVertex().Y()),
  514. mPrimaryVertexZ(hbtTrack->primaryVertex().Z()),
  515. mSecondaryVertexX(nullptr),
  516. mSecondaryVertexY(nullptr),
  517. mSecondaryVertexZ(nullptr),
  518. mTpcV0PosEntrancePointX(nullptr),
  519. mTpcV0PosEntrancePointY(nullptr),
  520. mTpcV0PosEntrancePointZ(nullptr),
  521. mTpcV0PosExitPointX(nullptr),
  522. mTpcV0PosExitPointY(nullptr),
  523. mTpcV0PosExitPointZ(nullptr),
  524. mTpcV0NegEntrancePointX(nullptr),
  525. mTpcV0NegEntrancePointY(nullptr),
  526. mTpcV0NegEntrancePointZ(nullptr),
  527. mTpcV0NegExitPointX(nullptr),
  528. mTpcV0NegExitPointY(nullptr),
  529. mTpcV0NegExitPointZ(nullptr) {
  530. // Primary and secondary vertex positions INTENTIOANLLY set to (0,0,0)
  531. // in order to make all estimations for future pair cuts,
  532. // i.e. in order to remove merged tracks.
  533. // This also implies, that all tracks originate from (0,0,0)
  534. MpdFemtoPhysicalHelix helix = hbtTrack->helix();
  535. TVector3 pVtx(0., 0., 0.);
  536. TVector3 sVtx(0., 0., 0.);
  537. TVector3 entrancePoint(0, 0, 0);
  538. TVector3 exitPoint(0, 0, 0);
  539. TVector3 posSample[mNumberOfPoints];
  540. calculateTpcExitAndEntrancePoints(&helix,
  541. &pVtx,
  542. &sVtx,
  543. &entrancePoint,
  544. &exitPoint,
  545. &posSample[0],
  546. &mZ[0],
  547. &mU[0],
  548. &mSect[0]);
  549. // Set TPC entrance and exit point parameters
  550. setNominalTpcExitPoint(exitPoint);
  551. setNominalTpcEntrancePoint(entrancePoint);
  552. setNominalPosSample(posSample);
  553. // mZ, mU and mSect arrays will be set in calculateTpcExitAndEntrancePoints()
  554. calculatePurity();
  555. mHiddenInfo = nullptr;
  556. if (hbtTrack->validHiddenInfo()) {
  557. mHiddenInfo = hbtTrack->getHiddenInfo()->getParticleHiddenInfo();
  558. }
  559. }
  560. //_________________
  561. MpdFemtoParticle::MpdFemtoParticle(const MpdFemtoV0 * const hbtV0,
  562. const double& mass) :
  563. mTrack(nullptr),
  564. mV0(new MpdFemtoV0(*hbtV0)),
  565. mKink(nullptr),
  566. mXi(nullptr),
  567. mPx(hbtV0->momV0X()),
  568. mPy(hbtV0->momV0Y()),
  569. mPz(hbtV0->momV0Z()),
  570. mEnergy(TMath::Sqrt(hbtV0->ptot2V0() + mass*mass)),
  571. mTpcTrackEntrancePointX(0), mTpcTrackEntrancePointY(0), mTpcTrackEntrancePointZ(0),
  572. mTpcTrackExitPointX(0), mTpcTrackExitPointY(0), mTpcTrackExitPointZ(0),
  573. mNominalPosSampleX{}, mNominalPosSampleY{}, mNominalPosSampleZ{},
  574. mTpcV0NegPosSampleX(nullptr), mTpcV0NegPosSampleY(nullptr), mTpcV0NegPosSampleZ(nullptr),
  575. mZ{}, mU{}, mSect{}, mV0NegZ(nullptr), mV0NegU(nullptr), mV0NegSect(nullptr),
  576. mHiddenInfo(nullptr),mPurity {},
  577. mPrimaryVertexX(hbtV0->primaryVertex().X()),
  578. mPrimaryVertexY(hbtV0->primaryVertex().Y()),
  579. mPrimaryVertexZ(hbtV0->primaryVertex().Z()),
  580. mSecondaryVertexX(nullptr),
  581. mSecondaryVertexY(nullptr),
  582. mSecondaryVertexZ(nullptr) {
  583. // Set secondary vertex information
  584. setSecondaryVertexX(hbtV0->decayPoint().X());
  585. setSecondaryVertexY(hbtV0->decayPoint().Y());
  586. setSecondaryVertexZ(hbtV0->decayPoint().Z());
  587. // Retrieve helix of the positive track
  588. MpdFemtoPhysicalHelix posHelix = hbtV0->helixPos();
  589. TVector3 primVtx(mPrimaryVertexX, mPrimaryVertexY, mPrimaryVertexZ);
  590. TVector3 secVtx(*mSecondaryVertexX, *mSecondaryVertexY, *mSecondaryVertexZ);
  591. TVector3 posEntrancePoint(0, 0, 0);
  592. TVector3 posExitPoint(0, 0, 0);
  593. TVector3 posSamplePos[mNumberOfPoints];
  594. calculateTpcExitAndEntrancePoints(&posHelix,
  595. &primVtx,
  596. &secVtx,
  597. &posEntrancePoint,
  598. &posExitPoint,
  599. &posSamplePos[0],
  600. &mZ[0],
  601. &mU[0],
  602. &mSect[0]);
  603. // Set positive daughter estimated parameters
  604. setTpcV0PosEntrancePoint(posEntrancePoint);
  605. setTpcV0PosExitPoint(posExitPoint);
  606. setNominalPosSample(posSamplePos);
  607. // mZ, mU and mSect arrays will be set in calculateTpcExitAndEntrancePoints(
  608. MpdFemtoPhysicalHelix negHelix = hbtV0->helixNeg();
  609. TVector3 negEntrancePoint(0, 0, 0);
  610. TVector3 negExitPoint(0, 0, 0);
  611. TVector3 negSamplePos[mNumberOfPoints];
  612. mV0NegZ = new float[mNumberOfPadrows];
  613. mV0NegU = new float[mNumberOfPadrows];
  614. mV0NegSect = new int[mNumberOfPadrows];
  615. calculateTpcExitAndEntrancePoints(&negHelix,
  616. &primVtx,
  617. &secVtx,
  618. &negEntrancePoint,
  619. &negExitPoint,
  620. &negSamplePos[0],
  621. &mV0NegZ[0],
  622. &mV0NegU[0],
  623. &mV0NegSect[0]);
  624. // Set positive daughter estimated parameters
  625. setTpcV0NegEntrancePoint(negEntrancePoint);
  626. setTpcV0NegExitPoint(negExitPoint);
  627. setTpcV0NegPosSample(posSamplePos);
  628. // mZ, mU and mSect arrays will be set in calculateTpcExitAndEntrancePoints(
  629. mHiddenInfo = nullptr;
  630. if (hbtV0->validHiddenInfo()) {
  631. mHiddenInfo = hbtV0->getHiddenInfo()->clone();
  632. }
  633. }
  634. //_________________
  635. MpdFemtoParticle::MpdFemtoParticle(const MpdFemtoKink * const hbtKink,
  636. const double& mass) :
  637. mTrack(nullptr),
  638. mV0(nullptr),
  639. mKink(new MpdFemtoKink(*hbtKink)),
  640. mXi(nullptr),
  641. mPx(hbtKink->parent().p().X()),
  642. mPy(hbtKink->parent().p().Y()),
  643. mPz(hbtKink->parent().p().Z()),
  644. mEnergy(TMath::Sqrt(hbtKink->parent().ptot2() + mass*mass)),
  645. mTpcTrackEntrancePointX(0),
  646. mTpcTrackEntrancePointY(0),
  647. mTpcTrackEntrancePointZ(0),
  648. mTpcTrackExitPointX(0),
  649. mTpcTrackExitPointY(0),
  650. mTpcTrackExitPointZ(0),
  651. mNominalPosSampleX{},
  652. mNominalPosSampleY{},
  653. mNominalPosSampleZ{},
  654. mTpcV0NegPosSampleX(nullptr),
  655. mTpcV0NegPosSampleY(nullptr),
  656. mTpcV0NegPosSampleZ(nullptr),
  657. mZ{}, mU{}, mSect{},
  658. mV0NegZ(nullptr), mV0NegU(nullptr), mV0NegSect(nullptr),
  659. mHiddenInfo(nullptr),
  660. mPurity{},
  661. mPrimaryVertexX(hbtKink->primaryVertex().X()),
  662. mPrimaryVertexY(hbtKink->primaryVertex().Y()),
  663. mPrimaryVertexZ(hbtKink->primaryVertex().Z()),
  664. mSecondaryVertexX(nullptr),
  665. mSecondaryVertexY(nullptr),
  666. mSecondaryVertexZ(nullptr),
  667. mTpcV0PosEntrancePointX(nullptr),
  668. mTpcV0PosEntrancePointY(nullptr),
  669. mTpcV0PosEntrancePointZ(nullptr),
  670. mTpcV0PosExitPointX(nullptr),
  671. mTpcV0PosExitPointY(nullptr),
  672. mTpcV0PosExitPointZ(nullptr),
  673. mTpcV0NegEntrancePointX(nullptr),
  674. mTpcV0NegEntrancePointY(nullptr),
  675. mTpcV0NegEntrancePointZ(nullptr),
  676. mTpcV0NegExitPointX(nullptr),
  677. mTpcV0NegExitPointY(nullptr),
  678. mTpcV0NegExitPointZ(nullptr) {
  679. // Some information related to kink analysis should
  680. // be estimated here
  681. }
  682. //_________________
  683. MpdFemtoParticle::MpdFemtoParticle(const MpdFemtoXi * const hbtXi, const double& mass) :
  684. mTrack(nullptr),
  685. mV0(nullptr),
  686. mKink(nullptr),
  687. mXi(new MpdFemtoXi(*hbtXi)),
  688. mPx(hbtXi->momXi().X()),
  689. mPy(hbtXi->momXi().Y()),
  690. mPz(hbtXi->momXi().Z()),
  691. mEnergy(TMath::Sqrt(hbtXi->ptot2Xi() + mass*mass)),
  692. mTpcTrackEntrancePointX(0),
  693. mTpcTrackEntrancePointY(0),
  694. mTpcTrackEntrancePointZ(0),
  695. mTpcTrackExitPointX(0),
  696. mTpcTrackExitPointY(0),
  697. mTpcTrackExitPointZ(0),
  698. mNominalPosSampleX{},
  699. mNominalPosSampleY{},
  700. mNominalPosSampleZ{},
  701. mTpcV0NegPosSampleX(nullptr),
  702. mTpcV0NegPosSampleY(nullptr),
  703. mTpcV0NegPosSampleZ(nullptr),
  704. mZ{}, mU{}, mSect{},
  705. mV0NegZ(nullptr), mV0NegU(nullptr), mV0NegSect(nullptr),
  706. mHiddenInfo(nullptr),mPurity{},
  707. mPrimaryVertexX(hbtXi->bachelor()->primaryVertex().X()),
  708. mPrimaryVertexY(hbtXi->bachelor()->primaryVertex().Y()),
  709. mPrimaryVertexZ(hbtXi->bachelor()->primaryVertex().Z()),
  710. mSecondaryVertexX(nullptr),
  711. mSecondaryVertexY(nullptr),
  712. mSecondaryVertexZ(nullptr),
  713. mTpcV0PosEntrancePointX(nullptr),
  714. mTpcV0PosEntrancePointY(nullptr),
  715. mTpcV0PosEntrancePointZ(nullptr),
  716. mTpcV0PosExitPointX(nullptr),
  717. mTpcV0PosExitPointY(nullptr),
  718. mTpcV0PosExitPointZ(nullptr),
  719. mTpcV0NegEntrancePointX(nullptr),
  720. mTpcV0NegEntrancePointY(nullptr),
  721. mTpcV0NegEntrancePointZ(nullptr),
  722. mTpcV0NegExitPointX(nullptr),
  723. mTpcV0NegExitPointY(nullptr),
  724. mTpcV0NegExitPointZ(nullptr) {
  725. // Some information related to Xi analysis should
  726. // be estimated here
  727. }
  728. //_________________
  729. void MpdFemtoParticle::calculatePurity() {
  730. double tPt = fourMomentum().Perp();
  731. // pi -
  732. mPurity[0] = mPrimPimPar0 * (1. - exp((tPt - mPrimPimPar1) / mPrimPimPar2));
  733. mPurity[0] *= mTrack->pidProbPion();
  734. // pi+
  735. mPurity[1] = mPrimPipPar0 * (1. - exp((tPt - mPrimPipPar1) / mPrimPipPar2));
  736. mPurity[1] *= mTrack->pidProbPion();
  737. // K-
  738. mPurity[2] = mTrack->pidProbKaon();
  739. // K+
  740. mPurity[3] = mTrack->pidProbKaon();
  741. // pbar
  742. mPurity[4] = mTrack->pidProbProton();
  743. // p
  744. mPurity[5] = mTrack->pidProbProton();
  745. }
  746. //_________________
  747. double MpdFemtoParticle::pionPurity() {
  748. return (mTrack->charge() > 0) ? mPurity[1] : mPurity[0];
  749. }
  750. //_________________
  751. double MpdFemtoParticle::kaonPurity() {
  752. return (mTrack->charge() > 0) ? mPurity[3] : mPurity[2];
  753. }
  754. //_________________
  755. double MpdFemtoParticle::protonPurity() {
  756. return (mTrack->charge() > 0) ? mPurity[5] : mPurity[4];
  757. }
  758. //_________________
  759. void MpdFemtoParticle::calculateTpcExitAndEntrancePoints(MpdFemtoPhysicalHelix* tHelix,
  760. TVector3* PrimVert,
  761. TVector3* SecVert,
  762. TVector3* tmpTpcEntrancePoint,
  763. TVector3* tmpTpcExitPoint,
  764. TVector3* tmpPosSample,
  765. float* tmpZ,
  766. float* tmpU,
  767. int* tmpSect) {
  768. // This calculates the exit point of a secondary track,
  769. // either through the endcap or through the Outer Field Cage
  770. // We assume the track to start at tHelix.origin-PrimaryVertex
  771. // it also calculates the entrance point of the secondary track,
  772. // which is the point at which it crosses the inner field cage.
  773. TVector3 ZeroVec(0., 0., 0.);
  774. ZeroVec.SetX(SecVert->x() - PrimVert->x());
  775. ZeroVec.SetY(SecVert->y() - PrimVert->y());
  776. ZeroVec.SetZ(SecVert->z() - PrimVert->z());
  777. double dip, curv, phase;
  778. int h;
  779. curv = tHelix->curvature();
  780. dip = tHelix->dipAngle();
  781. phase = tHelix->phase();
  782. h = tHelix->h();
  783. MpdFemtoHelix hel(curv, dip, phase, ZeroVec, h);
  784. std::pair< double, double > candidates;
  785. // This is how much length to go to leave through sides of TPC
  786. double sideLength;
  787. // This is how much length to go to leave through endcap of TPC
  788. double endLength;
  789. // Figure out how far to go to leave through side...
  790. candidates = hel.pathLength(mTpcHalfLength);
  791. sideLength = (candidates.first > 0) ? candidates.first : candidates.second;
  792. static TVector3 WestEnd(0., 0., mTpcHalfLength);
  793. static TVector3 EastEnd(0., 0., -mTpcHalfLength);
  794. static TVector3 EndCapNormal(0., 0., 1.0);
  795. endLength = hel.pathLength(WestEnd, EndCapNormal);
  796. if (endLength < 0.0) {
  797. endLength = hel.pathLength(EastEnd, EndCapNormal);
  798. }
  799. if (endLength < 0.0) {
  800. std::cout << "void MpdFemtoParticle::calculateTpcExitAndEntrancePoints : "
  801. << "Hey -- I cannot find an exit point out endcaps" << std::endl;
  802. }
  803. // OK, firstExitLength will be the shortest way out of the detector...
  804. double firstExitLength = (endLength < sideLength) ? endLength : sideLength;
  805. // Now then, let's return the POSITION at which particle leaves TPC...
  806. *tmpTpcExitPoint = hel.at(firstExitLength);
  807. // Finally, calculate the position at which the track crosses the inner field cage
  808. candidates = hel.pathLength(mInnerTpcRadius);
  809. sideLength = (candidates.first > 0) ? candidates.first : candidates.second;
  810. *tmpTpcEntrancePoint = hel.at(sideLength);
  811. // Check that the entrance point exists and was found
  812. if (std::isnan(tmpTpcEntrancePoint->X()) ||
  813. std::isnan(tmpTpcEntrancePoint->Y()) ||
  814. std::isnan(tmpTpcEntrancePoint->Z())) {
  815. std::cout << "void MpdFemtoParticle::calculateTpcExitAndEntrancePoints : NAN" << std::endl;
  816. std::cout << "tmpNominalTpcEntrancePoint = ( "
  817. << tmpTpcEntrancePoint->X() << " , "
  818. << tmpTpcEntrancePoint->Y() << " , "
  819. << tmpTpcEntrancePoint->Z() << " ) " << std::endl;
  820. tmpTpcEntrancePoint->SetX(-9999.);
  821. tmpTpcEntrancePoint->SetY(-9999.);
  822. tmpTpcEntrancePoint->SetZ(-9999.);
  823. }
  824. // Check that the exit point exists and was found
  825. if (std::isnan(tmpTpcExitPoint->X()) ||
  826. std::isnan(tmpTpcExitPoint->Y()) ||
  827. std::isnan(tmpTpcExitPoint->Z())) {
  828. std::cout << "void MpdFemtoParticle::calculateTpcExitAndEntrancePoints : NAN" << std::endl;
  829. std::cout << "tmpNominalTpcExitPoint = ( "
  830. << tmpTpcExitPoint->X() << " , "
  831. << tmpTpcExitPoint->Y() << " , "
  832. << tmpTpcExitPoint->Z() << " ) " << std::endl;
  833. tmpTpcExitPoint->SetX(-9999.);
  834. tmpTpcExitPoint->SetY(-9999.);
  835. tmpTpcExitPoint->SetZ(-9999.);
  836. }
  837. // Mike Lisa: OK, let's try something a little more along the lines
  838. // of NA49 and E895 strategy. Calculate the "nominal" position at N
  839. // radii (say N=11) within the TPC, and for a pair cut use the average
  840. // separation of these N
  841. // Grigory Nigmatkulov: For the future measurements N was changed
  842. // to mNumberOfPoints and the *magic numbers* were changed to the
  843. // mInnerTpcRadius and mOuterTpcRadius
  844. int irad = 0;
  845. candidates = hel.pathLength(mInnerTpcRadius);
  846. float step = (mOuterTpcRadius - mInnerTpcRadius) / (mNumberOfPoints - 1);
  847. sideLength = (candidates.first > 0) ? candidates.first : candidates.second;
  848. // Declare and initialize variable outside the loop
  849. float radius = mInnerTpcRadius;
  850. // Loop over radii
  851. while (irad < mNumberOfPoints && !std::isnan(sideLength)) {
  852. radius = mInnerTpcRadius + irad * step;
  853. candidates = hel.pathLength(radius);
  854. sideLength = (candidates.first > 0) ? candidates.first : candidates.second;
  855. tmpPosSample[irad] = hel.at(sideLength);
  856. if (std::isnan(tmpPosSample[irad].x()) ||
  857. std::isnan(tmpPosSample[irad].y()) ||
  858. std::isnan(tmpPosSample[irad].z())) {
  859. std::cout << "tmpPosSample for radius = " << radius << " NAN" << std::endl;
  860. std::cout << "tmpPosSample = ( "
  861. << tmpPosSample[irad].X() << " , "
  862. << tmpPosSample[irad].Y() << " , "
  863. << tmpPosSample[irad].Z() << " ) " << std::endl;
  864. tmpPosSample[irad] = TVector3(-9999., -9999., -9999);
  865. }
  866. // Do not forget to increment radii
  867. irad++;
  868. if (irad < mNumberOfPoints) {
  869. candidates = hel.pathLength(mInnerTpcRadius + irad*step);
  870. sideLength = (candidates.first > 0) ? candidates.first : candidates.second;
  871. }
  872. } //while( irad<11 && !std::isnan(sideLength) )
  873. // In case, when track left TPC, the rest of postions will
  874. // be set to unphysical values
  875. for (int i = irad; i < 11; i++) {
  876. tmpPosSample[i] = TVector3(-9999., -9999., -9999);
  877. }
  878. int tRow, tSect, tOutOfBound;
  879. double tLength, tPhi;
  880. float tU;
  881. TVector3 tPoint(0, 0, 0);
  882. TVector3 tn(0, 0, 0);
  883. TVector3 tr(0, 0, 0);
  884. int ti = 0;
  885. // Test to enter the loop
  886. candidates = hel.pathLength(tRowRadius[ti]);
  887. tLength = (candidates.first > 0) ? candidates.first : candidates.second;
  888. if (std::isnan(tLength)) {
  889. std::cout << "tLength Init tmp NAN" << std::endl;
  890. std::cout << "padrow number = " << ti << " not reached " << std::endl;
  891. std::cout << "*** DO NOT ENTER THE LOOP***" << std::endl;
  892. // Sector
  893. tmpSect[ti] = -1;
  894. } //if ( std::isnan(tLength) )
  895. // Start iteration over all padrows
  896. while (ti < mNumberOfPadrows && !std::isnan(tLength)) {
  897. candidates = hel.pathLength(tRowRadius[ti]);
  898. tLength = (candidates.first > 0) ? candidates.first : candidates.second;
  899. if (std::isnan(tLength)) {
  900. std::cout << "tLength loop 1st NAN" << std::endl;
  901. std::cout << "padrow number = " << ti << " not reached" << std::endl;
  902. std::cout << "*** THIS IS AN ERROR SHOULDN'T LOOP ***" << std::endl;
  903. // Sector
  904. tmpSect[ti] = -1;
  905. } // if ( std::isnan(tLength) )
  906. tPoint = hel.at(tLength);
  907. // Find which sector it is on
  908. TpcLocalTransform(tPoint, tmpSect[ti], tRow, tU, tPhi);
  909. if (std::isnan(tmpSect[ti])) {
  910. std::cout << "***ERROR tmpSect" << std::endl;
  911. }
  912. if (std::isnan(tRow)) {
  913. std::cout << "***ERROR tRow" << std::endl;
  914. }
  915. if (std::isnan(tU)) {
  916. std::cout << "***ERROR tU" << std::endl;
  917. }
  918. if (std::isnan(tPhi)) {
  919. std::cout << "***ERROR tPhi" << std::endl;
  920. }
  921. // calculate crossing plane
  922. tn.SetX(TMath::Cos(tPhi));
  923. tn.SetY(TMath::Sin(tPhi));
  924. tr.SetX(tRowRadius[ti] * TMath::Cos(tPhi));
  925. tr.SetY(tRowRadius[ti] * TMath::Sin(tPhi));
  926. // Find crossing point
  927. tLength = hel.pathLength(tr, tn);
  928. if (std::isnan(tLength)) {
  929. std::cout << "tLength loop 2nd NAN" << std::endl;
  930. std::cout << "padrow number = " << ti << " not reached" << std::endl;
  931. // Sector
  932. tmpSect[ti] = -2;
  933. } //if ( std::isnan(tLength) )
  934. tPoint = hel.at(tLength);
  935. tmpZ[ti] = tPoint.z();
  936. tOutOfBound = TpcLocalTransform(tPoint, tSect, tRow, tmpU[ti], tPhi);
  937. if (std::isnan(tSect)) {
  938. std::cout << "***ERROR tSect 2" << std::endl;
  939. }
  940. if (std::isnan(tRow)) {
  941. std::cout << "***ERROR tRow 2" << std::endl;
  942. }
  943. if (std::isnan(tmpU[ti])) {
  944. std::cout << "***ERROR tmpU[ti] 2" << std::endl;
  945. }
  946. if (std::isnan(tPhi)) {
  947. std::cout << "***ERROR tPhi 2 " << std::endl;
  948. }
  949. if (tOutOfBound ||
  950. ((tmpSect[ti] == tSect) && (tRow != (ti + 1)))) {
  951. // Sector
  952. tmpSect[ti] = -2;
  953. } else {
  954. if (tmpSect[ti] != tSect) {
  955. // Try again on the other sector
  956. tn.SetX(TMath::Cos(tPhi));
  957. tn.SetY(TMath::Sin(tPhi));
  958. tr.SetX(tRowRadius[ti] * TMath::Cos(tPhi));
  959. tr.SetY(tRowRadius[ti] * TMath::Sin(tPhi));
  960. // Find crossing point
  961. tLength = hel.pathLength(tr, tn);
  962. tPoint = hel.at(tLength);
  963. if (std::isnan(tLength)) {
  964. std::cout << "tLength loop 3rd NAN" << std::endl;
  965. std::cout << "padrow number = " << ti << " not reached" << std::endl;
  966. // Sector
  967. tmpSect[ti] = -1;
  968. } //if ( std::isnan(tLength) )
  969. tmpZ[ti] = tPoint.z();
  970. tmpSect[ti] = tSect;
  971. tOutOfBound = TpcLocalTransform(tPoint, tSect, tRow, tmpU[ti], tPhi);
  972. if (std::isnan(tSect)) {
  973. std::cout << "***ERROR tSect 3" << std::endl;
  974. }
  975. if (std::isnan(tRow)) {
  976. std::cout << "***ERROR tRow 3" << std::endl;
  977. }
  978. if (std::isnan(tmpU[ti])) {
  979. std::cout << "***ERROR tmpU[ti] 3" << std::endl;
  980. }
  981. if (std::isnan(tPhi)) {
  982. std::cout << "***ERROR tPhi 3 " << std::endl;
  983. }
  984. if (tOutOfBound || (tSect != tmpSect[ti]) || (tRow != (ti + 1))) {
  985. // Sector
  986. tmpSect[ti] = -1;
  987. } //if( tOutOfBound || ( tSect != tmpSect[ti] ) || ( tRow!=(ti+1) ) )
  988. } //if(tmpSect[ti] != tSect)
  989. } //else
  990. if (std::isnan(tmpSect[ti])) {
  991. std::cout << "*******************ERROR***************************" << std::endl;
  992. std::cout << "MpdFemtoParticle--Fctn tmpSect=" << tmpSect[ti] << std::endl;
  993. std::cout << "*******************ERROR***************************" << std::endl;
  994. }
  995. if (std::isnan(tmpU[ti])) {
  996. std::cout << "*******************ERROR***************************" << std::endl;
  997. std::cout << "MpdFemtoParticle--Fctn tmpU=" << tmpU[ti] << std::endl;
  998. std::cout << "*******************ERROR***************************" << std::endl;
  999. }
  1000. if (std::isnan(tmpZ[ti])) {
  1001. std::cout << "*******************ERROR***************************" << std::endl;
  1002. std::cout << "MpdFemtoParticle--Fctn tmpZ=" << tmpZ[ti] << std::endl;
  1003. std::cout << "*******************ERROR***************************" << std::endl;
  1004. }
  1005. // If padrow ti not reached all other beyond are not reached
  1006. // in this case set sector to -1
  1007. if (tmpSect[ti] == -1) {
  1008. for (int tj = ti; tj < mNumberOfPadrows; tj++) {
  1009. tmpSect[tj] = -1;
  1010. ti = mNumberOfPadrows;
  1011. }
  1012. } //if ( tmpSect[ti] == -1 )
  1013. // Increment padrow
  1014. ti++;
  1015. if (ti < mNumberOfPadrows) {
  1016. candidates = hel.pathLength(tRowRadius[ti]);
  1017. tLength = (candidates.first > 0) ? candidates.first : candidates.second;
  1018. } //if ( ti<mNumberOfPadrows )
  1019. } //while( ti<mNumberOfPadrows && !std::isnan(tLength) )
  1020. }
  1021. //_________________
  1022. void MpdFemtoParticle::setNominalPosSample(float x[mNumberOfPoints],
  1023. float y[mNumberOfPoints],
  1024. float z[mNumberOfPoints]) {
  1025. setNominalPosSampleX(x);
  1026. setNominalPosSampleY(y);
  1027. setNominalPosSampleZ(z); //[mNumberOfPoints]
  1028. }
  1029. //_________________
  1030. void MpdFemtoParticle::setNominalPosSample(TVector3 pos[mNumberOfPoints]) {
  1031. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  1032. setNominalPosSampleX(iPoint, pos[iPoint].X());
  1033. setNominalPosSampleY(iPoint, pos[iPoint].Y());
  1034. setNominalPosSampleZ(iPoint, pos[iPoint].Z());
  1035. }
  1036. }
  1037. //_________________
  1038. void MpdFemtoParticle::setTpcV0NegPosSample(TVector3 pos[mNumberOfPoints]) {
  1039. if (!mTpcV0NegPosSampleX) {
  1040. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSample(TVector3 pos[mNumberOfPoints]) : "
  1041. << "mTpcV0NegPosSampleX instance does not exist" << std::endl;
  1042. return;
  1043. }
  1044. if (!mTpcV0NegPosSampleY) {
  1045. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSample(TVector3 pos[mNumberOfPoints]) : "
  1046. << "mTpcV0NegPosSampleY instance does not exist" << std::endl;
  1047. return;
  1048. }
  1049. if (!mTpcV0NegPosSampleZ) {
  1050. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSample(TVector3 pos[mNumberOfPoints]) : "
  1051. << "mTpcV0NegPosSampleZ instance does not exist" << std::endl;
  1052. return;
  1053. }
  1054. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  1055. setTpcV0NegPosSampleX(iPoint, pos[iPoint].X());
  1056. setTpcV0NegPosSampleY(iPoint, pos[iPoint].Y());
  1057. setTpcV0NegPosSampleZ(iPoint, pos[iPoint].Z());
  1058. }
  1059. }
  1060. //_________________
  1061. void MpdFemtoParticle::setTpcV0NegPosSampleX(const int& i, const float& val) {
  1062. if (!mTpcV0NegPosSampleX) {
  1063. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSampleX(const int& i, const float& val) : "
  1064. << "mTpcV0NegPosSampleX instance does not exist" << std::endl;
  1065. return;
  1066. }
  1067. mTpcV0NegPosSampleX[i] = val;
  1068. }
  1069. //_________________
  1070. void MpdFemtoParticle::setTpcV0NegPosSampleY(const int& i, const float& val) {
  1071. if (!mTpcV0NegPosSampleY) {
  1072. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSampleY(const int& i, const float& val) : "
  1073. << "mTpcV0NegPosSampleY instance does not exist" << std::endl;
  1074. return;
  1075. }
  1076. mTpcV0NegPosSampleY[i] = val;
  1077. }
  1078. //_________________
  1079. void MpdFemtoParticle::setTpcV0NegPosSampleZ(const int& i, const float& val) {
  1080. if (!mTpcV0NegPosSampleZ) {
  1081. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSampleZ(const int& i, const float& val) : "
  1082. << "mTpcV0NegPosSampleZ instance does not exist" << std::endl;
  1083. return;
  1084. }
  1085. mTpcV0NegPosSampleZ[i] = val;
  1086. }
  1087. //_________________
  1088. void MpdFemtoParticle::setNominalPosSampleX(const int& i, const float& val) {
  1089. if (i < 0 || i >= mNumberOfPoints) {
  1090. std::cerr << "void MpdFemtoParticle::setNominalPosSampleX(const int& i, const float& val) : Bad index = " << i
  1091. << std::endl;
  1092. return;
  1093. }
  1094. mNominalPosSampleX[i] = val;
  1095. }
  1096. //_________________
  1097. void MpdFemtoParticle::setNominalPosSampleY(const int& i, const float& val) {
  1098. if (i < 0 || i >= mNumberOfPoints) {
  1099. std::cerr << "void MpdFemtoParticle::setNominalPosSampleY(const int& i, const float& val) : Bad index = " << i
  1100. << std::endl;
  1101. return;
  1102. }
  1103. mNominalPosSampleY[i] = val;
  1104. }
  1105. //_________________
  1106. void MpdFemtoParticle::setNominalPosSampleZ(const int& i, const float& val) {
  1107. if (i < 0 || i >= mNumberOfPoints) {
  1108. std::cerr << "void MpdFemtoParticle::setNominalPosSampleZ(const int& i, const float& val) : Bad index = " << i
  1109. << std::endl;
  1110. return;
  1111. }
  1112. mNominalPosSampleZ[i] = val;
  1113. }
  1114. //_________________
  1115. void MpdFemtoParticle::setNominalPosSampleX(float x[mNumberOfPoints]) {
  1116. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  1117. mNominalPosSampleX[iPoint] = x[iPoint];
  1118. }
  1119. }
  1120. //_________________
  1121. void MpdFemtoParticle::setNominalPosSampleY(float y[mNumberOfPoints]) {
  1122. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  1123. mNominalPosSampleY[iPoint] = y[iPoint];
  1124. }
  1125. }
  1126. //_________________
  1127. void MpdFemtoParticle::setNominalPosSampleZ(float z[mNumberOfPoints]) {
  1128. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  1129. mNominalPosSampleZ[iPoint] = z[iPoint];
  1130. }
  1131. }
  1132. //_________________
  1133. float MpdFemtoParticle::nominalPosSampleX(const int& point) const {
  1134. if (point < 0 || point >= mNumberOfPoints) {
  1135. std::cerr << "float MpdFemtoParticle::nominalPosSampleX : Bad index = "
  1136. << point << std::endl;
  1137. return 0;
  1138. }
  1139. return mNominalPosSampleX[point];
  1140. }
  1141. //_________________
  1142. float MpdFemtoParticle::nominalPosSampleY(const int& point) const {
  1143. if (point < 0 || point >= mNumberOfPoints) {
  1144. std::cerr << "float MpdFemtoParticle::nominalPosSampleY : Bad index = "
  1145. << point << std::endl;
  1146. return 0;
  1147. }
  1148. return mNominalPosSampleY[point];
  1149. }
  1150. //_________________
  1151. float MpdFemtoParticle::nominalPosSampleZ(const int& point) const {
  1152. if (point < 0 || point >= mNumberOfPoints) {
  1153. std::cerr << "float MpdFemtoParticle::nominalPosSampleZ : Bad index = "
  1154. << point << std::endl;
  1155. return 0;
  1156. }
  1157. return mNominalPosSampleZ[point];
  1158. }
  1159. //_________________
  1160. TVector3 MpdFemtoParticle::nominalPosSample(const int& i) const {
  1161. // Check range
  1162. if (i < 0 || i >= mNumberOfPoints) {
  1163. std::cerr << "TVector3 MpdFemtoParticle::nominalPosSample : Bad index = "
  1164. << i << std::endl;
  1165. return TVector3(0, 0, 0);
  1166. }
  1167. return TVector3(nominalPosSampleX(i), nominalPosSampleY(i), nominalPosSampleZ(i));
  1168. }
  1169. //_________________
  1170. void MpdFemtoParticle::setTpcV0NegPosSampleX(float x[mNumberOfPoints]) {
  1171. if (!mTpcV0NegPosSampleX) {
  1172. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSampleX : mTpcV0NegPosSampleX instanse does not exist"
  1173. << std::endl;
  1174. return;
  1175. }
  1176. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  1177. mTpcV0NegPosSampleX[iPoint] = x[iPoint];
  1178. }
  1179. }
  1180. //_________________
  1181. void MpdFemtoParticle::setTpcV0NegPosSampleY(float y[mNumberOfPoints]) {
  1182. if (!mTpcV0NegPosSampleY) {
  1183. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSampleY : mTpcV0NegPosSampleY instanse does not exist"
  1184. << std::endl;
  1185. return;
  1186. }
  1187. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  1188. mTpcV0NegPosSampleY[iPoint] = y[iPoint];
  1189. }
  1190. }
  1191. //_________________
  1192. void MpdFemtoParticle::setTpcV0NegPosSampleZ(float z[mNumberOfPoints]) {
  1193. if (!mTpcV0NegPosSampleZ) {
  1194. std::cerr << "void MpdFemtoParticle::setTpcV0NegPosSampleZ : mTpcV0NegPosSampleZ instanse does not exist"
  1195. << std::endl;
  1196. return;
  1197. }
  1198. for (int iPoint = 0; iPoint < mNumberOfPoints; iPoint++) {
  1199. mTpcV0NegPosSampleZ[iPoint] = z[iPoint];
  1200. }
  1201. }
  1202. //_________________
  1203. void MpdFemtoParticle::setTpcV0NegPosSample(float x[mNumberOfPoints],
  1204. float y[mNumberOfPoints],
  1205. float z[mNumberOfPoints]) {
  1206. setTpcV0NegPosSampleX(x);
  1207. setTpcV0NegPosSampleY(y);
  1208. setTpcV0NegPosSampleZ(z);
  1209. }
  1210. //_________________
  1211. float MpdFemtoParticle::tpcV0NegPosSampleX(const int& point) const {
  1212. if (!mTpcV0NegPosSampleX) {
  1213. std::cerr << "float MpdFemtoParticle::tpcV0NegPosSampleX : mTpcV0NegPosSampleX instanse does not exist"
  1214. << std::endl;
  1215. return 0;
  1216. }
  1217. if (point < 0 || point >= mNumberOfPoints) {
  1218. std::cerr << "float MpdFemtoParticle::tpcV0NegPosSampleX : Bad index = " << point
  1219. << std::endl;
  1220. return 0;
  1221. }
  1222. return mTpcV0NegPosSampleX[point];
  1223. }
  1224. //_________________
  1225. float MpdFemtoParticle::tpcV0NegPosSampleY(const int& point) const {
  1226. if (!mTpcV0NegPosSampleY) {
  1227. std::cerr << "float MpdFemtoParticle::tpcV0NegPosSampleY : mTpcV0NegPosSampleY instanse does not exist"
  1228. << std::endl;
  1229. return 0;
  1230. }
  1231. if (point < 0 || point >= mNumberOfPoints) {
  1232. std::cerr << "float MpdFemtoParticle::tpcV0NegPosSampleY : Bad index = " << point
  1233. << std::endl;
  1234. return 0;
  1235. }
  1236. return mTpcV0NegPosSampleY[point];
  1237. }
  1238. //_________________
  1239. float MpdFemtoParticle::tpcV0NegPosSampleZ(const int& point) const {
  1240. if (!mTpcV0NegPosSampleZ) {
  1241. std::cerr << "float MpdFemtoParticle::tpcV0NegPosSampleZ : mTpcV0NegPosSampleZ instanse does not exist"
  1242. << std::endl;
  1243. return 0;
  1244. }
  1245. if (point < 0 || point >= mNumberOfPoints) {
  1246. std::cerr << "float MpdFemtoParticle::tpcV0NegPosSampleZ : Bad index = " << point
  1247. << std::endl;
  1248. return 0;
  1249. }
  1250. return mTpcV0NegPosSampleZ[point];
  1251. }
  1252. //_________________
  1253. TVector3 MpdFemtoParticle::tpcV0NegPosSample(const int& i) const {
  1254. if (!mTpcV0NegPosSampleX) {
  1255. std::cerr << "TVector3 MpdFemtoParticle::tpcV0NegPosSample : mTpcV0NegPosSampleX instanse does not exist"
  1256. << std::endl;
  1257. return TVector3(0, 0, 0);
  1258. }
  1259. if (!mTpcV0NegPosSampleY) {
  1260. std::cerr << "TVector3 MpdFemtoParticle::tpcV0NegPosSample : mTpcV0NegPosSampleY instanse does not exist"
  1261. << std::endl;
  1262. return TVector3(0, 0, 0);
  1263. }
  1264. if (!mTpcV0NegPosSampleZ) {
  1265. std::cerr << "TVector3 MpdFemtoParticle::tpcV0NegPosSample : mTpcV0NegPosSampleZ instanse does not exist"
  1266. << std::endl;
  1267. return TVector3(0, 0, 0);
  1268. }
  1269. if (i < 0 || i >= mNumberOfPoints) {
  1270. std::cerr << "TVector3 MpdFemtoParticle::tpcV0NegPosSample : Bad point = " << i
  1271. << std::endl;
  1272. return TVector3(0, 0, 0);
  1273. }
  1274. return TVector3(tpcV0NegPosSampleX(i),
  1275. tpcV0NegPosSampleY(i),
  1276. tpcV0NegPosSampleZ(i));
  1277. }
  1278. //_________________
  1279. void MpdFemtoParticle::setZ(float z[mNumberOfPadrows]) {
  1280. for (int iRow = 0; iRow < mNumberOfPadrows; iRow++) {
  1281. mZ[iRow] = z[iRow];
  1282. }
  1283. }
  1284. //_________________
  1285. void MpdFemtoParticle::setU(float u[mNumberOfPadrows]) {
  1286. for (int iRow = 0; iRow < mNumberOfPadrows; iRow++) {
  1287. mU[iRow] = u[iRow];
  1288. }
  1289. }
  1290. //_________________
  1291. void MpdFemtoParticle::setSect(int sect[mNumberOfPadrows]) {
  1292. for (int iRow = 0; iRow < mNumberOfPadrows; iRow++) {
  1293. mSect[iRow] = sect[iRow];
  1294. }
  1295. }
  1296. //_________________
  1297. void MpdFemtoParticle::setV0NegZ(float z[mNumberOfPadrows]) {
  1298. if (!mV0NegZ) {
  1299. std::cerr << "void MpdFemtoParticle::setV0NegZ : mV0NegZ instanse does not exist"
  1300. << std::endl;
  1301. return;
  1302. }
  1303. for (int iRow = 0; iRow < mNumberOfPadrows; iRow++) {
  1304. mV0NegZ[iRow] = z[iRow];
  1305. }
  1306. }
  1307. //_________________
  1308. void MpdFemtoParticle::setV0NegU(float u[mNumberOfPadrows]) {
  1309. if (!mV0NegU) {
  1310. std::cerr << "void MpdFemtoParticle::setV0NegU : mV0NegU instanse does not exist"
  1311. << std::endl;
  1312. return;
  1313. }
  1314. for (int iRow = 0; iRow < mNumberOfPadrows; iRow++) {
  1315. mV0NegU[iRow] = u[iRow];
  1316. }
  1317. }
  1318. //_________________
  1319. void MpdFemtoParticle::setV0NegSect(int sect[mNumberOfPadrows]) {
  1320. if (!mV0NegSect) {
  1321. std::cerr << "void MpdFemtoParticle::setV0NegSect : mV0NegSect instanse does not exist"
  1322. << std::endl;
  1323. return;
  1324. }
  1325. for (int iRow = 0; iRow < mNumberOfPadrows; iRow++) {
  1326. mV0NegSect[iRow] = sect[iRow];
  1327. }
  1328. }
  1329. //_________________
  1330. float MpdFemtoParticle::tpcV0PosExitPointX() const {
  1331. return (mTpcV0PosExitPointX) ? *mTpcV0PosExitPointX : 0.f;
  1332. }
  1333. //_________________
  1334. float MpdFemtoParticle::tpcV0PosExitPointY() const {
  1335. return (mTpcV0PosExitPointY) ? *mTpcV0PosExitPointY : 0.f;
  1336. }
  1337. //_________________
  1338. float MpdFemtoParticle::tpcV0PosExitPointZ() const {
  1339. return (mTpcV0PosExitPointZ) ? *mTpcV0PosExitPointZ : 0.f;
  1340. }
  1341. //_________________
  1342. float MpdFemtoParticle::tpcV0PosEntrancePointX() const {
  1343. return (mTpcV0PosEntrancePointX) ? *mTpcV0PosEntrancePointX : 0.f;
  1344. }
  1345. //_________________
  1346. float MpdFemtoParticle::tpcV0PosEntrancePointY() const {
  1347. return (mTpcV0PosEntrancePointY) ? *mTpcV0PosEntrancePointY : 0.f;
  1348. }
  1349. //_________________
  1350. float MpdFemtoParticle::tpcV0PosEntrancePointZ() const {
  1351. return (mTpcV0PosEntrancePointZ) ? *mTpcV0PosEntrancePointZ : 0.f;
  1352. }
  1353. //_________________
  1354. float MpdFemtoParticle::tpcV0NegExitPointX() const {
  1355. return (mTpcV0NegExitPointX) ? *mTpcV0NegExitPointX : 0.f;
  1356. }
  1357. //_________________
  1358. float MpdFemtoParticle::tpcV0NegExitPointY() const {
  1359. return (mTpcV0NegExitPointY) ? *mTpcV0NegExitPointY : 0.f;
  1360. }
  1361. //_________________
  1362. float MpdFemtoParticle::tpcV0NegExitPointZ() const {
  1363. return (mTpcV0NegExitPointZ) ? *mTpcV0NegExitPointZ : 0.f;
  1364. }
  1365. //_________________
  1366. float MpdFemtoParticle::tpcV0NegEntrancePointX() const {
  1367. return (mTpcV0NegEntrancePointX) ? *mTpcV0NegEntrancePointX : 0.f;
  1368. }
  1369. //_________________
  1370. float MpdFemtoParticle::tpcV0NegEntrancePointY() const {
  1371. return (mTpcV0NegEntrancePointY) ? *mTpcV0NegEntrancePointY : 0.f;
  1372. }
  1373. //_________________
  1374. float MpdFemtoParticle::tpcV0NegEntrancePointZ() const {
  1375. return (mTpcV0NegEntrancePointZ) ? *mTpcV0NegEntrancePointZ : 0.f;
  1376. }
  1377. //_________________
  1378. float MpdFemtoParticle::secondaryVertexX() const {
  1379. return (mSecondaryVertexX) ? *mSecondaryVertexX : 0.f;
  1380. }
  1381. //_________________
  1382. float MpdFemtoParticle::secondaryVertexY() const {
  1383. return (mSecondaryVertexY) ? *mSecondaryVertexY : 0.f;
  1384. }
  1385. //_________________
  1386. float MpdFemtoParticle::secondaryVertexZ() const {
  1387. return (mSecondaryVertexZ) ? *mSecondaryVertexZ : 0.f;
  1388. }
  1389. //_________________
  1390. void MpdFemtoParticle::setSecondaryVertexX(const float& x) {
  1391. if (!mSecondaryVertexX) {
  1392. mSecondaryVertexX = new float;
  1393. }
  1394. *mSecondaryVertexX = x;
  1395. }
  1396. //_________________
  1397. void MpdFemtoParticle::setSecondaryVertexY(const float& y) {
  1398. if (!mSecondaryVertexY) {
  1399. mSecondaryVertexY = new float;
  1400. }
  1401. *mSecondaryVertexY = y;
  1402. }
  1403. //_________________
  1404. void MpdFemtoParticle::setSecondaryVertexZ(const float& z) {
  1405. if (!mSecondaryVertexZ) {
  1406. mSecondaryVertexZ = new float;
  1407. }
  1408. *mSecondaryVertexZ = z;
  1409. }
  1410. //_________________
  1411. void MpdFemtoParticle::setTpcV0PosExitPointX(const float& val) {
  1412. if (!mTpcV0PosExitPointX) {
  1413. mTpcV0PosExitPointX = new float;
  1414. }
  1415. *mTpcV0PosExitPointX = val;
  1416. }
  1417. //_________________
  1418. void MpdFemtoParticle::setTpcV0PosExitPointY(const float& val) {
  1419. if (!mTpcV0PosExitPointY) {
  1420. mTpcV0PosExitPointY = new float;
  1421. }
  1422. *mTpcV0PosExitPointY = val;
  1423. }
  1424. //_________________
  1425. void MpdFemtoParticle::setTpcV0PosExitPointZ(const float& val) {
  1426. if (!mTpcV0PosExitPointZ) {
  1427. mTpcV0PosExitPointZ = new float;
  1428. }
  1429. *mTpcV0PosExitPointZ = val;
  1430. }
  1431. //_________________
  1432. void MpdFemtoParticle::setTpcV0PosEntrancePointX(const float& val) {
  1433. if (!mTpcV0PosEntrancePointX) {
  1434. mTpcV0PosEntrancePointX = new float;
  1435. }
  1436. *mTpcV0PosEntrancePointX = val;
  1437. }
  1438. //_________________
  1439. void MpdFemtoParticle::setTpcV0PosEntrancePointY(const float& val) {
  1440. if (!mTpcV0PosEntrancePointY) {
  1441. mTpcV0PosEntrancePointY = new float;
  1442. }
  1443. *mTpcV0PosEntrancePointY = val;
  1444. }
  1445. //_________________
  1446. void MpdFemtoParticle::setTpcV0PosEntrancePointZ(const float& val) {
  1447. if (!mTpcV0PosEntrancePointZ) {
  1448. mTpcV0PosEntrancePointZ = new float;
  1449. }
  1450. *mTpcV0PosEntrancePointZ = val;
  1451. }
  1452. //_________________
  1453. void MpdFemtoParticle::setTpcV0NegExitPointX(const float& val) {
  1454. if (!mTpcV0NegExitPointX) {
  1455. mTpcV0NegExitPointX = new float;
  1456. }
  1457. *mTpcV0NegExitPointX = val;
  1458. }
  1459. //_________________
  1460. void MpdFemtoParticle::setTpcV0NegExitPointY(const float& val) {
  1461. if (!mTpcV0NegExitPointY) {
  1462. mTpcV0NegExitPointY = new float;
  1463. }
  1464. *mTpcV0NegExitPointY = val;
  1465. }
  1466. //_________________
  1467. void MpdFemtoParticle::setTpcV0NegExitPointZ(const float& val) {
  1468. if (!mTpcV0NegExitPointZ) {
  1469. mTpcV0NegExitPointZ = new float;
  1470. }
  1471. *mTpcV0NegExitPointZ = val;
  1472. }
  1473. //_________________
  1474. void MpdFemtoParticle::setTpcV0NegEntrancePointX(const float& val) {
  1475. if (!mTpcV0NegEntrancePointX) {
  1476. mTpcV0NegEntrancePointX = new float;
  1477. }
  1478. *mTpcV0NegEntrancePointX = val;
  1479. }
  1480. //_________________
  1481. void MpdFemtoParticle::setTpcV0NegEntrancePointY(const float& val) {
  1482. if (!mTpcV0NegEntrancePointY) {
  1483. mTpcV0NegEntrancePointY = new float;
  1484. }
  1485. *mTpcV0NegEntrancePointY = val;
  1486. }
  1487. //_________________
  1488. void MpdFemtoParticle::setTpcV0NegEntrancePointZ(const float& val) {
  1489. if (!mTpcV0NegEntrancePointZ) {
  1490. mTpcV0NegEntrancePointZ = new float;
  1491. }
  1492. *mTpcV0NegEntrancePointZ = val;
  1493. }