TrackingNtupleObjs.hpp 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597
  1. /** TrackingNtupleObjs.hpp created on 2018-05-22 17:07:59.784846 by generate_class.py
  2. * AVOID EDITING THIS FILE BY HAND!! Instead edit TrackingNtupleObjs.yaml and re-run
  3. * generate_class.py
  4. */
  5. #include "filval.hpp"
  6. #include "root_filval.hpp"
  7. #include<cmath>
  8. #include "TrackingNtuple.h"
  9. using namespace std;
  10. using namespace fv;
  11. using namespace fv_root;
  12. typedef TreeDataSet<TrackingNtuple> TrackingDataSet;
  13. struct Seed;
  14. class SeedCollection {
  15. public:
  16. class iter {
  17. public:
  18. iter(SeedCollection* collection, size_t idx)
  19. :collection(collection), idx(idx) { }
  20. iter operator++() { ++idx; return *this; }
  21. bool operator!=(const iter & other) { return idx != other.idx; }
  22. Seed operator*();
  23. private:
  24. SeedCollection* collection;
  25. size_t idx;
  26. };
  27. TrackingDataSet* tds;
  28. Value<vector<short>>* val_fitok;
  29. bool fitok_loaded;
  30. Value<vector<float>>* val_px;
  31. bool px_loaded;
  32. Value<vector<float>>* val_py;
  33. bool py_loaded;
  34. Value<vector<float>>* val_pz;
  35. bool pz_loaded;
  36. Value<vector<float>>* val_pt;
  37. bool pt_loaded;
  38. Value<vector<float>>* val_eta;
  39. bool eta_loaded;
  40. Value<vector<float>>* val_phi;
  41. bool phi_loaded;
  42. Value<vector<float>>* val_dxy;
  43. bool dxy_loaded;
  44. Value<vector<float>>* val_dz;
  45. bool dz_loaded;
  46. Value<vector<float>>* val_ptErr;
  47. bool ptErr_loaded;
  48. Value<vector<float>>* val_etaErr;
  49. bool etaErr_loaded;
  50. Value<vector<float>>* val_phiErr;
  51. bool phiErr_loaded;
  52. Value<vector<float>>* val_dxyErr;
  53. bool dxyErr_loaded;
  54. Value<vector<float>>* val_dzErr;
  55. bool dzErr_loaded;
  56. Value<vector<float>>* val_chi2;
  57. bool chi2_loaded;
  58. Value<vector<int>>* val_q;
  59. bool q_loaded;
  60. Value<vector<unsigned int>>* val_nValid;
  61. bool nValid_loaded;
  62. Value<vector<unsigned int>>* val_nPixel;
  63. bool nPixel_loaded;
  64. Value<vector<unsigned int>>* val_nGlued;
  65. bool nGlued_loaded;
  66. Value<vector<unsigned int>>* val_nStrip;
  67. bool nStrip_loaded;
  68. Value<vector<unsigned int>>* val_algo;
  69. bool algo_loaded;
  70. Value<vector<int>>* val_trkIdx;
  71. bool trkIdx_loaded;
  72. Value<vector<vector<float>>>* val_shareFrac;
  73. bool shareFrac_loaded;
  74. Value<vector<vector<int>>>* val_simTrkIdx;
  75. bool simTrkIdx_loaded;
  76. Value<vector<unsigned int>>* val_offset;
  77. bool offset_loaded;
  78. Value<vector<float>>* val_Et;
  79. bool Et_loaded;
  80. Value<vector<float>>* val_hoe;
  81. bool hoe_loaded;
  82. Value<vector<vector<int>>>* val_isBarrel;
  83. bool isBarrel_loaded;
  84. Value<vector<vector<int>>>* val_layerOrDiskNr;
  85. bool layerOrDiskNr_loaded;
  86. Value<vector<vector<int>>>* val_isValidPos;
  87. bool isValidPos_loaded;
  88. Value<vector<vector<float>>>* val_dRZPos;
  89. bool dRZPos_loaded;
  90. Value<vector<vector<float>>>* val_dPhiPos;
  91. bool dPhiPos_loaded;
  92. Value<vector<vector<int>>>* val_isValidNeg;
  93. bool isValidNeg_loaded;
  94. Value<vector<vector<float>>>* val_dRZNeg;
  95. bool dRZNeg_loaded;
  96. Value<vector<vector<float>>>* val_dPhiNeg;
  97. bool dPhiNeg_loaded;
  98. Value<vector<short>>* val_isECALDriven;
  99. bool isECALDriven_loaded;
  100. Value<vector<int>>* val_sclIdx;
  101. bool sclIdx_loaded;
  102. SeedCollection() { }
  103. void init(TrackingDataSet* tds){
  104. this->tds = tds;
  105. }
  106. size_t size() {
  107. if (!this->fitok_loaded) {
  108. this->val_fitok = this->tds->track_branch_obj<vector<short>>("see_fitok");
  109. this->fitok_loaded = true;
  110. }
  111. return (*this->val_fitok)().size();
  112. }
  113. Seed operator[](size_t);
  114. iter begin() { return iter(this, 0); }
  115. iter end() { return iter(this, size()); }
  116. };
  117. struct Seed {
  118. SeedCollection* collection;
  119. size_t idx;
  120. Seed(SeedCollection* collection, const size_t idx)
  121. :collection(collection), idx(idx) { }
  122. const short& fitok() const {
  123. if (!collection->fitok_loaded) {
  124. collection->val_fitok = collection->tds->track_branch_obj<vector<short>>("see_fitok");
  125. collection->fitok_loaded = true;
  126. }
  127. return (*collection->val_fitok)().at(idx);
  128. }
  129. const float& px() const {
  130. if (!collection->px_loaded) {
  131. collection->val_px = collection->tds->track_branch_obj<vector<float>>("see_px");
  132. collection->px_loaded = true;
  133. }
  134. return (*collection->val_px)().at(idx);
  135. }
  136. const float& py() const {
  137. if (!collection->py_loaded) {
  138. collection->val_py = collection->tds->track_branch_obj<vector<float>>("see_py");
  139. collection->py_loaded = true;
  140. }
  141. return (*collection->val_py)().at(idx);
  142. }
  143. const float& pz() const {
  144. if (!collection->pz_loaded) {
  145. collection->val_pz = collection->tds->track_branch_obj<vector<float>>("see_pz");
  146. collection->pz_loaded = true;
  147. }
  148. return (*collection->val_pz)().at(idx);
  149. }
  150. const float& pt() const {
  151. if (!collection->pt_loaded) {
  152. collection->val_pt = collection->tds->track_branch_obj<vector<float>>("see_pt");
  153. collection->pt_loaded = true;
  154. }
  155. return (*collection->val_pt)().at(idx);
  156. }
  157. const float& eta() const {
  158. if (!collection->eta_loaded) {
  159. collection->val_eta = collection->tds->track_branch_obj<vector<float>>("see_eta");
  160. collection->eta_loaded = true;
  161. }
  162. return (*collection->val_eta)().at(idx);
  163. }
  164. const float& phi() const {
  165. if (!collection->phi_loaded) {
  166. collection->val_phi = collection->tds->track_branch_obj<vector<float>>("see_phi");
  167. collection->phi_loaded = true;
  168. }
  169. return (*collection->val_phi)().at(idx);
  170. }
  171. const float& dxy() const {
  172. if (!collection->dxy_loaded) {
  173. collection->val_dxy = collection->tds->track_branch_obj<vector<float>>("see_dxy");
  174. collection->dxy_loaded = true;
  175. }
  176. return (*collection->val_dxy)().at(idx);
  177. }
  178. const float& dz() const {
  179. if (!collection->dz_loaded) {
  180. collection->val_dz = collection->tds->track_branch_obj<vector<float>>("see_dz");
  181. collection->dz_loaded = true;
  182. }
  183. return (*collection->val_dz)().at(idx);
  184. }
  185. const float& ptErr() const {
  186. if (!collection->ptErr_loaded) {
  187. collection->val_ptErr = collection->tds->track_branch_obj<vector<float>>("see_ptErr");
  188. collection->ptErr_loaded = true;
  189. }
  190. return (*collection->val_ptErr)().at(idx);
  191. }
  192. const float& etaErr() const {
  193. if (!collection->etaErr_loaded) {
  194. collection->val_etaErr = collection->tds->track_branch_obj<vector<float>>("see_etaErr");
  195. collection->etaErr_loaded = true;
  196. }
  197. return (*collection->val_etaErr)().at(idx);
  198. }
  199. const float& phiErr() const {
  200. if (!collection->phiErr_loaded) {
  201. collection->val_phiErr = collection->tds->track_branch_obj<vector<float>>("see_phiErr");
  202. collection->phiErr_loaded = true;
  203. }
  204. return (*collection->val_phiErr)().at(idx);
  205. }
  206. const float& dxyErr() const {
  207. if (!collection->dxyErr_loaded) {
  208. collection->val_dxyErr = collection->tds->track_branch_obj<vector<float>>("see_dxyErr");
  209. collection->dxyErr_loaded = true;
  210. }
  211. return (*collection->val_dxyErr)().at(idx);
  212. }
  213. const float& dzErr() const {
  214. if (!collection->dzErr_loaded) {
  215. collection->val_dzErr = collection->tds->track_branch_obj<vector<float>>("see_dzErr");
  216. collection->dzErr_loaded = true;
  217. }
  218. return (*collection->val_dzErr)().at(idx);
  219. }
  220. const float& chi2() const {
  221. if (!collection->chi2_loaded) {
  222. collection->val_chi2 = collection->tds->track_branch_obj<vector<float>>("see_chi2");
  223. collection->chi2_loaded = true;
  224. }
  225. return (*collection->val_chi2)().at(idx);
  226. }
  227. const int& q() const {
  228. if (!collection->q_loaded) {
  229. collection->val_q = collection->tds->track_branch_obj<vector<int>>("see_q");
  230. collection->q_loaded = true;
  231. }
  232. return (*collection->val_q)().at(idx);
  233. }
  234. const unsigned int& nValid() const {
  235. if (!collection->nValid_loaded) {
  236. collection->val_nValid = collection->tds->track_branch_obj<vector<unsigned int>>("see_nValid");
  237. collection->nValid_loaded = true;
  238. }
  239. return (*collection->val_nValid)().at(idx);
  240. }
  241. const unsigned int& nPixel() const {
  242. if (!collection->nPixel_loaded) {
  243. collection->val_nPixel = collection->tds->track_branch_obj<vector<unsigned int>>("see_nPixel");
  244. collection->nPixel_loaded = true;
  245. }
  246. return (*collection->val_nPixel)().at(idx);
  247. }
  248. const unsigned int& nGlued() const {
  249. if (!collection->nGlued_loaded) {
  250. collection->val_nGlued = collection->tds->track_branch_obj<vector<unsigned int>>("see_nGlued");
  251. collection->nGlued_loaded = true;
  252. }
  253. return (*collection->val_nGlued)().at(idx);
  254. }
  255. const unsigned int& nStrip() const {
  256. if (!collection->nStrip_loaded) {
  257. collection->val_nStrip = collection->tds->track_branch_obj<vector<unsigned int>>("see_nStrip");
  258. collection->nStrip_loaded = true;
  259. }
  260. return (*collection->val_nStrip)().at(idx);
  261. }
  262. const unsigned int& algo() const {
  263. if (!collection->algo_loaded) {
  264. collection->val_algo = collection->tds->track_branch_obj<vector<unsigned int>>("see_algo");
  265. collection->algo_loaded = true;
  266. }
  267. return (*collection->val_algo)().at(idx);
  268. }
  269. const int& trkIdx() const {
  270. if (!collection->trkIdx_loaded) {
  271. collection->val_trkIdx = collection->tds->track_branch_obj<vector<int>>("see_trkIdx");
  272. collection->trkIdx_loaded = true;
  273. }
  274. return (*collection->val_trkIdx)().at(idx);
  275. }
  276. const vector<float>& shareFrac() const {
  277. if (!collection->shareFrac_loaded) {
  278. collection->val_shareFrac = collection->tds->track_branch_obj<vector<vector<float>>>("see_shareFrac");
  279. collection->shareFrac_loaded = true;
  280. }
  281. return (*collection->val_shareFrac)().at(idx);
  282. }
  283. const vector<int>& simTrkIdx() const {
  284. if (!collection->simTrkIdx_loaded) {
  285. collection->val_simTrkIdx = collection->tds->track_branch_obj<vector<vector<int>>>("see_simTrkIdx");
  286. collection->simTrkIdx_loaded = true;
  287. }
  288. return (*collection->val_simTrkIdx)().at(idx);
  289. }
  290. const unsigned int& offset() const {
  291. if (!collection->offset_loaded) {
  292. collection->val_offset = collection->tds->track_branch_obj<vector<unsigned int>>("see_offset");
  293. collection->offset_loaded = true;
  294. }
  295. return (*collection->val_offset)().at(idx);
  296. }
  297. const float& Et() const {
  298. if (!collection->Et_loaded) {
  299. collection->val_Et = collection->tds->track_branch_obj<vector<float>>("see_Et");
  300. collection->Et_loaded = true;
  301. }
  302. return (*collection->val_Et)().at(idx);
  303. }
  304. const float& hoe() const {
  305. if (!collection->hoe_loaded) {
  306. collection->val_hoe = collection->tds->track_branch_obj<vector<float>>("see_hoe");
  307. collection->hoe_loaded = true;
  308. }
  309. return (*collection->val_hoe)().at(idx);
  310. }
  311. const vector<int>& isBarrel() const {
  312. if (!collection->isBarrel_loaded) {
  313. collection->val_isBarrel = collection->tds->track_branch_obj<vector<vector<int>>>("see_isBarrel");
  314. collection->isBarrel_loaded = true;
  315. }
  316. return (*collection->val_isBarrel)().at(idx);
  317. }
  318. const vector<int>& layerOrDiskNr() const {
  319. if (!collection->layerOrDiskNr_loaded) {
  320. collection->val_layerOrDiskNr = collection->tds->track_branch_obj<vector<vector<int>>>("see_layerOrDiskNr");
  321. collection->layerOrDiskNr_loaded = true;
  322. }
  323. return (*collection->val_layerOrDiskNr)().at(idx);
  324. }
  325. const vector<int>& isValidPos() const {
  326. if (!collection->isValidPos_loaded) {
  327. collection->val_isValidPos = collection->tds->track_branch_obj<vector<vector<int>>>("see_isValidPos");
  328. collection->isValidPos_loaded = true;
  329. }
  330. return (*collection->val_isValidPos)().at(idx);
  331. }
  332. const vector<float>& dRZPos() const {
  333. if (!collection->dRZPos_loaded) {
  334. collection->val_dRZPos = collection->tds->track_branch_obj<vector<vector<float>>>("see_dRZPos");
  335. collection->dRZPos_loaded = true;
  336. }
  337. return (*collection->val_dRZPos)().at(idx);
  338. }
  339. const vector<float>& dPhiPos() const {
  340. if (!collection->dPhiPos_loaded) {
  341. collection->val_dPhiPos = collection->tds->track_branch_obj<vector<vector<float>>>("see_dPhiPos");
  342. collection->dPhiPos_loaded = true;
  343. }
  344. return (*collection->val_dPhiPos)().at(idx);
  345. }
  346. const vector<int>& isValidNeg() const {
  347. if (!collection->isValidNeg_loaded) {
  348. collection->val_isValidNeg = collection->tds->track_branch_obj<vector<vector<int>>>("see_isValidNeg");
  349. collection->isValidNeg_loaded = true;
  350. }
  351. return (*collection->val_isValidNeg)().at(idx);
  352. }
  353. const vector<float>& dRZNeg() const {
  354. if (!collection->dRZNeg_loaded) {
  355. collection->val_dRZNeg = collection->tds->track_branch_obj<vector<vector<float>>>("see_dRZNeg");
  356. collection->dRZNeg_loaded = true;
  357. }
  358. return (*collection->val_dRZNeg)().at(idx);
  359. }
  360. const vector<float>& dPhiNeg() const {
  361. if (!collection->dPhiNeg_loaded) {
  362. collection->val_dPhiNeg = collection->tds->track_branch_obj<vector<vector<float>>>("see_dPhiNeg");
  363. collection->dPhiNeg_loaded = true;
  364. }
  365. return (*collection->val_dPhiNeg)().at(idx);
  366. }
  367. const short& isECALDriven() const {
  368. if (!collection->isECALDriven_loaded) {
  369. collection->val_isECALDriven = collection->tds->track_branch_obj<vector<short>>("see_isECALDriven");
  370. collection->isECALDriven_loaded = true;
  371. }
  372. return (*collection->val_isECALDriven)().at(idx);
  373. }
  374. const int& sclIdx() const {
  375. if (!collection->sclIdx_loaded) {
  376. collection->val_sclIdx = collection->tds->track_branch_obj<vector<int>>("see_sclIdx");
  377. collection->sclIdx_loaded = true;
  378. }
  379. return (*collection->val_sclIdx)().at(idx);
  380. }
  381. };
  382. Seed SeedCollection::iter::operator*() {
  383. return {collection, idx};
  384. }
  385. Seed SeedCollection::operator[](size_t idx) {
  386. return {this, idx};
  387. }
  388. struct Track;
  389. class TrackCollection {
  390. public:
  391. class iter {
  392. public:
  393. iter(TrackCollection* collection, size_t idx)
  394. :collection(collection), idx(idx) { }
  395. iter operator++() { ++idx; return *this; }
  396. bool operator!=(const iter & other) { return idx != other.idx; }
  397. Track operator*();
  398. private:
  399. TrackCollection* collection;
  400. size_t idx;
  401. };
  402. TrackingDataSet* tds;
  403. Value<vector<float>>* val_px;
  404. bool px_loaded;
  405. Value<vector<float>>* val_py;
  406. bool py_loaded;
  407. Value<vector<float>>* val_pz;
  408. bool pz_loaded;
  409. Value<vector<float>>* val_pt;
  410. bool pt_loaded;
  411. Value<vector<float>>* val_inner_px;
  412. bool inner_px_loaded;
  413. Value<vector<float>>* val_inner_py;
  414. bool inner_py_loaded;
  415. Value<vector<float>>* val_inner_pz;
  416. bool inner_pz_loaded;
  417. Value<vector<float>>* val_inner_pt;
  418. bool inner_pt_loaded;
  419. Value<vector<float>>* val_outer_px;
  420. bool outer_px_loaded;
  421. Value<vector<float>>* val_outer_py;
  422. bool outer_py_loaded;
  423. Value<vector<float>>* val_outer_pz;
  424. bool outer_pz_loaded;
  425. Value<vector<float>>* val_outer_pt;
  426. bool outer_pt_loaded;
  427. Value<vector<float>>* val_eta;
  428. bool eta_loaded;
  429. Value<vector<float>>* val_lambda;
  430. bool lambda_loaded;
  431. Value<vector<float>>* val_cotTheta;
  432. bool cotTheta_loaded;
  433. Value<vector<float>>* val_phi;
  434. bool phi_loaded;
  435. Value<vector<float>>* val_dxy;
  436. bool dxy_loaded;
  437. Value<vector<float>>* val_dz;
  438. bool dz_loaded;
  439. Value<vector<float>>* val_ptErr;
  440. bool ptErr_loaded;
  441. Value<vector<float>>* val_etaErr;
  442. bool etaErr_loaded;
  443. Value<vector<float>>* val_lambdaErr;
  444. bool lambdaErr_loaded;
  445. Value<vector<float>>* val_phiErr;
  446. bool phiErr_loaded;
  447. Value<vector<float>>* val_dxyErr;
  448. bool dxyErr_loaded;
  449. Value<vector<float>>* val_dzErr;
  450. bool dzErr_loaded;
  451. Value<vector<float>>* val_refpoint_x;
  452. bool refpoint_x_loaded;
  453. Value<vector<float>>* val_refpoint_y;
  454. bool refpoint_y_loaded;
  455. Value<vector<float>>* val_refpoint_z;
  456. bool refpoint_z_loaded;
  457. Value<vector<float>>* val_nChi2;
  458. bool nChi2_loaded;
  459. Value<vector<int>>* val_q;
  460. bool q_loaded;
  461. Value<vector<unsigned int>>* val_nValid;
  462. bool nValid_loaded;
  463. Value<vector<unsigned int>>* val_nInvalid;
  464. bool nInvalid_loaded;
  465. Value<vector<unsigned int>>* val_nPixel;
  466. bool nPixel_loaded;
  467. Value<vector<unsigned int>>* val_nStrip;
  468. bool nStrip_loaded;
  469. Value<vector<unsigned int>>* val_nPixelLay;
  470. bool nPixelLay_loaded;
  471. Value<vector<unsigned int>>* val_nStripLay;
  472. bool nStripLay_loaded;
  473. Value<vector<unsigned int>>* val_n3DLay;
  474. bool n3DLay_loaded;
  475. Value<vector<unsigned int>>* val_nOuterLost;
  476. bool nOuterLost_loaded;
  477. Value<vector<unsigned int>>* val_nInnerLost;
  478. bool nInnerLost_loaded;
  479. Value<vector<unsigned int>>* val_algo;
  480. bool algo_loaded;
  481. Value<vector<unsigned int>>* val_originalAlgo;
  482. bool originalAlgo_loaded;
  483. Value<vector<ULong64_t>>* val_algoMask;
  484. bool algoMask_loaded;
  485. Value<vector<unsigned int>>* val_stopReason;
  486. bool stopReason_loaded;
  487. Value<vector<short>>* val_isHP;
  488. bool isHP_loaded;
  489. Value<vector<int>>* val_seedIdx;
  490. bool seedIdx_loaded;
  491. Value<vector<float>>* val_vtxx;
  492. bool vtxx_loaded;
  493. Value<vector<float>>* val_vtxy;
  494. bool vtxy_loaded;
  495. Value<vector<float>>* val_vtxz;
  496. bool vtxz_loaded;
  497. Value<vector<vector<float>>>* val_shareFrac;
  498. bool shareFrac_loaded;
  499. Value<vector<vector<int>>>* val_simTrkIdx;
  500. bool simTrkIdx_loaded;
  501. Value<vector<int>>* val_genIdx;
  502. bool genIdx_loaded;
  503. Value<vector<float>>* val_genDR;
  504. bool genDR_loaded;
  505. TrackCollection() { }
  506. void init(TrackingDataSet* tds){
  507. this->tds = tds;
  508. }
  509. size_t size() {
  510. if (!this->px_loaded) {
  511. this->val_px = this->tds->track_branch_obj<vector<float>>("trk_px");
  512. this->px_loaded = true;
  513. }
  514. return (*this->val_px)().size();
  515. }
  516. Track operator[](size_t);
  517. iter begin() { return iter(this, 0); }
  518. iter end() { return iter(this, size()); }
  519. };
  520. struct Track {
  521. TrackCollection* collection;
  522. size_t idx;
  523. Track(TrackCollection* collection, const size_t idx)
  524. :collection(collection), idx(idx) { }
  525. const float& px() const {
  526. if (!collection->px_loaded) {
  527. collection->val_px = collection->tds->track_branch_obj<vector<float>>("trk_px");
  528. collection->px_loaded = true;
  529. }
  530. return (*collection->val_px)().at(idx);
  531. }
  532. const float& py() const {
  533. if (!collection->py_loaded) {
  534. collection->val_py = collection->tds->track_branch_obj<vector<float>>("trk_py");
  535. collection->py_loaded = true;
  536. }
  537. return (*collection->val_py)().at(idx);
  538. }
  539. const float& pz() const {
  540. if (!collection->pz_loaded) {
  541. collection->val_pz = collection->tds->track_branch_obj<vector<float>>("trk_pz");
  542. collection->pz_loaded = true;
  543. }
  544. return (*collection->val_pz)().at(idx);
  545. }
  546. const float& pt() const {
  547. if (!collection->pt_loaded) {
  548. collection->val_pt = collection->tds->track_branch_obj<vector<float>>("trk_pt");
  549. collection->pt_loaded = true;
  550. }
  551. return (*collection->val_pt)().at(idx);
  552. }
  553. const float& inner_px() const {
  554. if (!collection->inner_px_loaded) {
  555. collection->val_inner_px = collection->tds->track_branch_obj<vector<float>>("trk_inner_px");
  556. collection->inner_px_loaded = true;
  557. }
  558. return (*collection->val_inner_px)().at(idx);
  559. }
  560. const float& inner_py() const {
  561. if (!collection->inner_py_loaded) {
  562. collection->val_inner_py = collection->tds->track_branch_obj<vector<float>>("trk_inner_py");
  563. collection->inner_py_loaded = true;
  564. }
  565. return (*collection->val_inner_py)().at(idx);
  566. }
  567. const float& inner_pz() const {
  568. if (!collection->inner_pz_loaded) {
  569. collection->val_inner_pz = collection->tds->track_branch_obj<vector<float>>("trk_inner_pz");
  570. collection->inner_pz_loaded = true;
  571. }
  572. return (*collection->val_inner_pz)().at(idx);
  573. }
  574. const float& inner_pt() const {
  575. if (!collection->inner_pt_loaded) {
  576. collection->val_inner_pt = collection->tds->track_branch_obj<vector<float>>("trk_inner_pt");
  577. collection->inner_pt_loaded = true;
  578. }
  579. return (*collection->val_inner_pt)().at(idx);
  580. }
  581. const float& outer_px() const {
  582. if (!collection->outer_px_loaded) {
  583. collection->val_outer_px = collection->tds->track_branch_obj<vector<float>>("trk_outer_px");
  584. collection->outer_px_loaded = true;
  585. }
  586. return (*collection->val_outer_px)().at(idx);
  587. }
  588. const float& outer_py() const {
  589. if (!collection->outer_py_loaded) {
  590. collection->val_outer_py = collection->tds->track_branch_obj<vector<float>>("trk_outer_py");
  591. collection->outer_py_loaded = true;
  592. }
  593. return (*collection->val_outer_py)().at(idx);
  594. }
  595. const float& outer_pz() const {
  596. if (!collection->outer_pz_loaded) {
  597. collection->val_outer_pz = collection->tds->track_branch_obj<vector<float>>("trk_outer_pz");
  598. collection->outer_pz_loaded = true;
  599. }
  600. return (*collection->val_outer_pz)().at(idx);
  601. }
  602. const float& outer_pt() const {
  603. if (!collection->outer_pt_loaded) {
  604. collection->val_outer_pt = collection->tds->track_branch_obj<vector<float>>("trk_outer_pt");
  605. collection->outer_pt_loaded = true;
  606. }
  607. return (*collection->val_outer_pt)().at(idx);
  608. }
  609. const float& eta() const {
  610. if (!collection->eta_loaded) {
  611. collection->val_eta = collection->tds->track_branch_obj<vector<float>>("trk_eta");
  612. collection->eta_loaded = true;
  613. }
  614. return (*collection->val_eta)().at(idx);
  615. }
  616. const float& lambda() const {
  617. if (!collection->lambda_loaded) {
  618. collection->val_lambda = collection->tds->track_branch_obj<vector<float>>("trk_lambda");
  619. collection->lambda_loaded = true;
  620. }
  621. return (*collection->val_lambda)().at(idx);
  622. }
  623. const float& cotTheta() const {
  624. if (!collection->cotTheta_loaded) {
  625. collection->val_cotTheta = collection->tds->track_branch_obj<vector<float>>("trk_cotTheta");
  626. collection->cotTheta_loaded = true;
  627. }
  628. return (*collection->val_cotTheta)().at(idx);
  629. }
  630. const float& phi() const {
  631. if (!collection->phi_loaded) {
  632. collection->val_phi = collection->tds->track_branch_obj<vector<float>>("trk_phi");
  633. collection->phi_loaded = true;
  634. }
  635. return (*collection->val_phi)().at(idx);
  636. }
  637. const float& dxy() const {
  638. if (!collection->dxy_loaded) {
  639. collection->val_dxy = collection->tds->track_branch_obj<vector<float>>("trk_dxy");
  640. collection->dxy_loaded = true;
  641. }
  642. return (*collection->val_dxy)().at(idx);
  643. }
  644. const float& dz() const {
  645. if (!collection->dz_loaded) {
  646. collection->val_dz = collection->tds->track_branch_obj<vector<float>>("trk_dz");
  647. collection->dz_loaded = true;
  648. }
  649. return (*collection->val_dz)().at(idx);
  650. }
  651. const float& ptErr() const {
  652. if (!collection->ptErr_loaded) {
  653. collection->val_ptErr = collection->tds->track_branch_obj<vector<float>>("trk_ptErr");
  654. collection->ptErr_loaded = true;
  655. }
  656. return (*collection->val_ptErr)().at(idx);
  657. }
  658. const float& etaErr() const {
  659. if (!collection->etaErr_loaded) {
  660. collection->val_etaErr = collection->tds->track_branch_obj<vector<float>>("trk_etaErr");
  661. collection->etaErr_loaded = true;
  662. }
  663. return (*collection->val_etaErr)().at(idx);
  664. }
  665. const float& lambdaErr() const {
  666. if (!collection->lambdaErr_loaded) {
  667. collection->val_lambdaErr = collection->tds->track_branch_obj<vector<float>>("trk_lambdaErr");
  668. collection->lambdaErr_loaded = true;
  669. }
  670. return (*collection->val_lambdaErr)().at(idx);
  671. }
  672. const float& phiErr() const {
  673. if (!collection->phiErr_loaded) {
  674. collection->val_phiErr = collection->tds->track_branch_obj<vector<float>>("trk_phiErr");
  675. collection->phiErr_loaded = true;
  676. }
  677. return (*collection->val_phiErr)().at(idx);
  678. }
  679. const float& dxyErr() const {
  680. if (!collection->dxyErr_loaded) {
  681. collection->val_dxyErr = collection->tds->track_branch_obj<vector<float>>("trk_dxyErr");
  682. collection->dxyErr_loaded = true;
  683. }
  684. return (*collection->val_dxyErr)().at(idx);
  685. }
  686. const float& dzErr() const {
  687. if (!collection->dzErr_loaded) {
  688. collection->val_dzErr = collection->tds->track_branch_obj<vector<float>>("trk_dzErr");
  689. collection->dzErr_loaded = true;
  690. }
  691. return (*collection->val_dzErr)().at(idx);
  692. }
  693. const float& refpoint_x() const {
  694. if (!collection->refpoint_x_loaded) {
  695. collection->val_refpoint_x = collection->tds->track_branch_obj<vector<float>>("trk_refpoint_x");
  696. collection->refpoint_x_loaded = true;
  697. }
  698. return (*collection->val_refpoint_x)().at(idx);
  699. }
  700. const float& refpoint_y() const {
  701. if (!collection->refpoint_y_loaded) {
  702. collection->val_refpoint_y = collection->tds->track_branch_obj<vector<float>>("trk_refpoint_y");
  703. collection->refpoint_y_loaded = true;
  704. }
  705. return (*collection->val_refpoint_y)().at(idx);
  706. }
  707. const float& refpoint_z() const {
  708. if (!collection->refpoint_z_loaded) {
  709. collection->val_refpoint_z = collection->tds->track_branch_obj<vector<float>>("trk_refpoint_z");
  710. collection->refpoint_z_loaded = true;
  711. }
  712. return (*collection->val_refpoint_z)().at(idx);
  713. }
  714. const float& nChi2() const {
  715. if (!collection->nChi2_loaded) {
  716. collection->val_nChi2 = collection->tds->track_branch_obj<vector<float>>("trk_nChi2");
  717. collection->nChi2_loaded = true;
  718. }
  719. return (*collection->val_nChi2)().at(idx);
  720. }
  721. const int& q() const {
  722. if (!collection->q_loaded) {
  723. collection->val_q = collection->tds->track_branch_obj<vector<int>>("trk_q");
  724. collection->q_loaded = true;
  725. }
  726. return (*collection->val_q)().at(idx);
  727. }
  728. const unsigned int& nValid() const {
  729. if (!collection->nValid_loaded) {
  730. collection->val_nValid = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nValid");
  731. collection->nValid_loaded = true;
  732. }
  733. return (*collection->val_nValid)().at(idx);
  734. }
  735. const unsigned int& nInvalid() const {
  736. if (!collection->nInvalid_loaded) {
  737. collection->val_nInvalid = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nInvalid");
  738. collection->nInvalid_loaded = true;
  739. }
  740. return (*collection->val_nInvalid)().at(idx);
  741. }
  742. const unsigned int& nPixel() const {
  743. if (!collection->nPixel_loaded) {
  744. collection->val_nPixel = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nPixel");
  745. collection->nPixel_loaded = true;
  746. }
  747. return (*collection->val_nPixel)().at(idx);
  748. }
  749. const unsigned int& nStrip() const {
  750. if (!collection->nStrip_loaded) {
  751. collection->val_nStrip = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nStrip");
  752. collection->nStrip_loaded = true;
  753. }
  754. return (*collection->val_nStrip)().at(idx);
  755. }
  756. const unsigned int& nPixelLay() const {
  757. if (!collection->nPixelLay_loaded) {
  758. collection->val_nPixelLay = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nPixelLay");
  759. collection->nPixelLay_loaded = true;
  760. }
  761. return (*collection->val_nPixelLay)().at(idx);
  762. }
  763. const unsigned int& nStripLay() const {
  764. if (!collection->nStripLay_loaded) {
  765. collection->val_nStripLay = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nStripLay");
  766. collection->nStripLay_loaded = true;
  767. }
  768. return (*collection->val_nStripLay)().at(idx);
  769. }
  770. const unsigned int& n3DLay() const {
  771. if (!collection->n3DLay_loaded) {
  772. collection->val_n3DLay = collection->tds->track_branch_obj<vector<unsigned int>>("trk_n3DLay");
  773. collection->n3DLay_loaded = true;
  774. }
  775. return (*collection->val_n3DLay)().at(idx);
  776. }
  777. const unsigned int& nOuterLost() const {
  778. if (!collection->nOuterLost_loaded) {
  779. collection->val_nOuterLost = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nOuterLost");
  780. collection->nOuterLost_loaded = true;
  781. }
  782. return (*collection->val_nOuterLost)().at(idx);
  783. }
  784. const unsigned int& nInnerLost() const {
  785. if (!collection->nInnerLost_loaded) {
  786. collection->val_nInnerLost = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nInnerLost");
  787. collection->nInnerLost_loaded = true;
  788. }
  789. return (*collection->val_nInnerLost)().at(idx);
  790. }
  791. const unsigned int& algo() const {
  792. if (!collection->algo_loaded) {
  793. collection->val_algo = collection->tds->track_branch_obj<vector<unsigned int>>("trk_algo");
  794. collection->algo_loaded = true;
  795. }
  796. return (*collection->val_algo)().at(idx);
  797. }
  798. const unsigned int& originalAlgo() const {
  799. if (!collection->originalAlgo_loaded) {
  800. collection->val_originalAlgo = collection->tds->track_branch_obj<vector<unsigned int>>("trk_originalAlgo");
  801. collection->originalAlgo_loaded = true;
  802. }
  803. return (*collection->val_originalAlgo)().at(idx);
  804. }
  805. const ULong64_t& algoMask() const {
  806. if (!collection->algoMask_loaded) {
  807. collection->val_algoMask = collection->tds->track_branch_obj<vector<ULong64_t>>("trk_algoMask");
  808. collection->algoMask_loaded = true;
  809. }
  810. return (*collection->val_algoMask)().at(idx);
  811. }
  812. const unsigned int& stopReason() const {
  813. if (!collection->stopReason_loaded) {
  814. collection->val_stopReason = collection->tds->track_branch_obj<vector<unsigned int>>("trk_stopReason");
  815. collection->stopReason_loaded = true;
  816. }
  817. return (*collection->val_stopReason)().at(idx);
  818. }
  819. const short& isHP() const {
  820. if (!collection->isHP_loaded) {
  821. collection->val_isHP = collection->tds->track_branch_obj<vector<short>>("trk_isHP");
  822. collection->isHP_loaded = true;
  823. }
  824. return (*collection->val_isHP)().at(idx);
  825. }
  826. const int& seedIdx() const {
  827. if (!collection->seedIdx_loaded) {
  828. collection->val_seedIdx = collection->tds->track_branch_obj<vector<int>>("trk_seedIdx");
  829. collection->seedIdx_loaded = true;
  830. }
  831. return (*collection->val_seedIdx)().at(idx);
  832. }
  833. const float& vtxx() const {
  834. if (!collection->vtxx_loaded) {
  835. collection->val_vtxx = collection->tds->track_branch_obj<vector<float>>("trk_vtxx");
  836. collection->vtxx_loaded = true;
  837. }
  838. return (*collection->val_vtxx)().at(idx);
  839. }
  840. const float& vtxy() const {
  841. if (!collection->vtxy_loaded) {
  842. collection->val_vtxy = collection->tds->track_branch_obj<vector<float>>("trk_vtxy");
  843. collection->vtxy_loaded = true;
  844. }
  845. return (*collection->val_vtxy)().at(idx);
  846. }
  847. const float& vtxz() const {
  848. if (!collection->vtxz_loaded) {
  849. collection->val_vtxz = collection->tds->track_branch_obj<vector<float>>("trk_vtxz");
  850. collection->vtxz_loaded = true;
  851. }
  852. return (*collection->val_vtxz)().at(idx);
  853. }
  854. const vector<float>& shareFrac() const {
  855. if (!collection->shareFrac_loaded) {
  856. collection->val_shareFrac = collection->tds->track_branch_obj<vector<vector<float>>>("trk_shareFrac");
  857. collection->shareFrac_loaded = true;
  858. }
  859. return (*collection->val_shareFrac)().at(idx);
  860. }
  861. const vector<int>& simTrkIdx() const {
  862. if (!collection->simTrkIdx_loaded) {
  863. collection->val_simTrkIdx = collection->tds->track_branch_obj<vector<vector<int>>>("trk_simTrkIdx");
  864. collection->simTrkIdx_loaded = true;
  865. }
  866. return (*collection->val_simTrkIdx)().at(idx);
  867. }
  868. const int& genIdx() const {
  869. if (!collection->genIdx_loaded) {
  870. collection->val_genIdx = collection->tds->track_branch_obj<vector<int>>("trk_genIdx");
  871. collection->genIdx_loaded = true;
  872. }
  873. return (*collection->val_genIdx)().at(idx);
  874. }
  875. const float& genDR() const {
  876. if (!collection->genDR_loaded) {
  877. collection->val_genDR = collection->tds->track_branch_obj<vector<float>>("trk_genDR");
  878. collection->genDR_loaded = true;
  879. }
  880. return (*collection->val_genDR)().at(idx);
  881. }
  882. };
  883. Track TrackCollection::iter::operator*() {
  884. return {collection, idx};
  885. }
  886. Track TrackCollection::operator[](size_t idx) {
  887. return {this, idx};
  888. }
  889. struct SimTrack;
  890. class SimTrackCollection {
  891. public:
  892. class iter {
  893. public:
  894. iter(SimTrackCollection* collection, size_t idx)
  895. :collection(collection), idx(idx) { }
  896. iter operator++() { ++idx; return *this; }
  897. bool operator!=(const iter & other) { return idx != other.idx; }
  898. SimTrack operator*();
  899. private:
  900. SimTrackCollection* collection;
  901. size_t idx;
  902. };
  903. TrackingDataSet* tds;
  904. Value<vector<int>>* val_event;
  905. bool event_loaded;
  906. Value<vector<int>>* val_bunchCrossing;
  907. bool bunchCrossing_loaded;
  908. Value<vector<int>>* val_pdgId;
  909. bool pdgId_loaded;
  910. Value<vector<float>>* val_px;
  911. bool px_loaded;
  912. Value<vector<float>>* val_py;
  913. bool py_loaded;
  914. Value<vector<float>>* val_pz;
  915. bool pz_loaded;
  916. Value<vector<float>>* val_pt;
  917. bool pt_loaded;
  918. Value<vector<float>>* val_eta;
  919. bool eta_loaded;
  920. Value<vector<float>>* val_phi;
  921. bool phi_loaded;
  922. Value<vector<float>>* val_pca_pt;
  923. bool pca_pt_loaded;
  924. Value<vector<float>>* val_pca_eta;
  925. bool pca_eta_loaded;
  926. Value<vector<float>>* val_pca_lambda;
  927. bool pca_lambda_loaded;
  928. Value<vector<float>>* val_pca_cotTheta;
  929. bool pca_cotTheta_loaded;
  930. Value<vector<float>>* val_pca_phi;
  931. bool pca_phi_loaded;
  932. Value<vector<float>>* val_pca_dxy;
  933. bool pca_dxy_loaded;
  934. Value<vector<float>>* val_pca_dz;
  935. bool pca_dz_loaded;
  936. Value<vector<int>>* val_q;
  937. bool q_loaded;
  938. Value<vector<unsigned int>>* val_nValid;
  939. bool nValid_loaded;
  940. Value<vector<unsigned int>>* val_nPixel;
  941. bool nPixel_loaded;
  942. Value<vector<unsigned int>>* val_nStrip;
  943. bool nStrip_loaded;
  944. Value<vector<unsigned int>>* val_nLay;
  945. bool nLay_loaded;
  946. Value<vector<unsigned int>>* val_nPixelLay;
  947. bool nPixelLay_loaded;
  948. Value<vector<unsigned int>>* val_n3DLay;
  949. bool n3DLay_loaded;
  950. Value<vector<vector<int>>>* val_trkIdx;
  951. bool trkIdx_loaded;
  952. Value<vector<vector<float>>>* val_shareFrac;
  953. bool shareFrac_loaded;
  954. Value<vector<int>>* val_parentVtxIdx;
  955. bool parentVtxIdx_loaded;
  956. Value<vector<vector<int>>>* val_decayVtxIdx;
  957. bool decayVtxIdx_loaded;
  958. Value<vector<vector<int>>>* val_seedIdx;
  959. bool seedIdx_loaded;
  960. SimTrackCollection() { }
  961. void init(TrackingDataSet* tds){
  962. this->tds = tds;
  963. }
  964. size_t size() {
  965. if (!this->event_loaded) {
  966. this->val_event = this->tds->track_branch_obj<vector<int>>("sim_event");
  967. this->event_loaded = true;
  968. }
  969. return (*this->val_event)().size();
  970. }
  971. SimTrack operator[](size_t);
  972. iter begin() { return iter(this, 0); }
  973. iter end() { return iter(this, size()); }
  974. };
  975. struct SimTrack {
  976. SimTrackCollection* collection;
  977. size_t idx;
  978. SimTrack(SimTrackCollection* collection, const size_t idx)
  979. :collection(collection), idx(idx) { }
  980. const int& event() const {
  981. if (!collection->event_loaded) {
  982. collection->val_event = collection->tds->track_branch_obj<vector<int>>("sim_event");
  983. collection->event_loaded = true;
  984. }
  985. return (*collection->val_event)().at(idx);
  986. }
  987. const int& bunchCrossing() const {
  988. if (!collection->bunchCrossing_loaded) {
  989. collection->val_bunchCrossing = collection->tds->track_branch_obj<vector<int>>("sim_bunchCrossing");
  990. collection->bunchCrossing_loaded = true;
  991. }
  992. return (*collection->val_bunchCrossing)().at(idx);
  993. }
  994. const int& pdgId() const {
  995. if (!collection->pdgId_loaded) {
  996. collection->val_pdgId = collection->tds->track_branch_obj<vector<int>>("sim_pdgId");
  997. collection->pdgId_loaded = true;
  998. }
  999. return (*collection->val_pdgId)().at(idx);
  1000. }
  1001. const float& px() const {
  1002. if (!collection->px_loaded) {
  1003. collection->val_px = collection->tds->track_branch_obj<vector<float>>("sim_px");
  1004. collection->px_loaded = true;
  1005. }
  1006. return (*collection->val_px)().at(idx);
  1007. }
  1008. const float& py() const {
  1009. if (!collection->py_loaded) {
  1010. collection->val_py = collection->tds->track_branch_obj<vector<float>>("sim_py");
  1011. collection->py_loaded = true;
  1012. }
  1013. return (*collection->val_py)().at(idx);
  1014. }
  1015. const float& pz() const {
  1016. if (!collection->pz_loaded) {
  1017. collection->val_pz = collection->tds->track_branch_obj<vector<float>>("sim_pz");
  1018. collection->pz_loaded = true;
  1019. }
  1020. return (*collection->val_pz)().at(idx);
  1021. }
  1022. const float& pt() const {
  1023. if (!collection->pt_loaded) {
  1024. collection->val_pt = collection->tds->track_branch_obj<vector<float>>("sim_pt");
  1025. collection->pt_loaded = true;
  1026. }
  1027. return (*collection->val_pt)().at(idx);
  1028. }
  1029. const float& eta() const {
  1030. if (!collection->eta_loaded) {
  1031. collection->val_eta = collection->tds->track_branch_obj<vector<float>>("sim_eta");
  1032. collection->eta_loaded = true;
  1033. }
  1034. return (*collection->val_eta)().at(idx);
  1035. }
  1036. const float& phi() const {
  1037. if (!collection->phi_loaded) {
  1038. collection->val_phi = collection->tds->track_branch_obj<vector<float>>("sim_phi");
  1039. collection->phi_loaded = true;
  1040. }
  1041. return (*collection->val_phi)().at(idx);
  1042. }
  1043. const float& pca_pt() const {
  1044. if (!collection->pca_pt_loaded) {
  1045. collection->val_pca_pt = collection->tds->track_branch_obj<vector<float>>("sim_pca_pt");
  1046. collection->pca_pt_loaded = true;
  1047. }
  1048. return (*collection->val_pca_pt)().at(idx);
  1049. }
  1050. const float& pca_eta() const {
  1051. if (!collection->pca_eta_loaded) {
  1052. collection->val_pca_eta = collection->tds->track_branch_obj<vector<float>>("sim_pca_eta");
  1053. collection->pca_eta_loaded = true;
  1054. }
  1055. return (*collection->val_pca_eta)().at(idx);
  1056. }
  1057. const float& pca_lambda() const {
  1058. if (!collection->pca_lambda_loaded) {
  1059. collection->val_pca_lambda = collection->tds->track_branch_obj<vector<float>>("sim_pca_lambda");
  1060. collection->pca_lambda_loaded = true;
  1061. }
  1062. return (*collection->val_pca_lambda)().at(idx);
  1063. }
  1064. const float& pca_cotTheta() const {
  1065. if (!collection->pca_cotTheta_loaded) {
  1066. collection->val_pca_cotTheta = collection->tds->track_branch_obj<vector<float>>("sim_pca_cotTheta");
  1067. collection->pca_cotTheta_loaded = true;
  1068. }
  1069. return (*collection->val_pca_cotTheta)().at(idx);
  1070. }
  1071. const float& pca_phi() const {
  1072. if (!collection->pca_phi_loaded) {
  1073. collection->val_pca_phi = collection->tds->track_branch_obj<vector<float>>("sim_pca_phi");
  1074. collection->pca_phi_loaded = true;
  1075. }
  1076. return (*collection->val_pca_phi)().at(idx);
  1077. }
  1078. const float& pca_dxy() const {
  1079. if (!collection->pca_dxy_loaded) {
  1080. collection->val_pca_dxy = collection->tds->track_branch_obj<vector<float>>("sim_pca_dxy");
  1081. collection->pca_dxy_loaded = true;
  1082. }
  1083. return (*collection->val_pca_dxy)().at(idx);
  1084. }
  1085. const float& pca_dz() const {
  1086. if (!collection->pca_dz_loaded) {
  1087. collection->val_pca_dz = collection->tds->track_branch_obj<vector<float>>("sim_pca_dz");
  1088. collection->pca_dz_loaded = true;
  1089. }
  1090. return (*collection->val_pca_dz)().at(idx);
  1091. }
  1092. const int& q() const {
  1093. if (!collection->q_loaded) {
  1094. collection->val_q = collection->tds->track_branch_obj<vector<int>>("sim_q");
  1095. collection->q_loaded = true;
  1096. }
  1097. return (*collection->val_q)().at(idx);
  1098. }
  1099. const unsigned int& nValid() const {
  1100. if (!collection->nValid_loaded) {
  1101. collection->val_nValid = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nValid");
  1102. collection->nValid_loaded = true;
  1103. }
  1104. return (*collection->val_nValid)().at(idx);
  1105. }
  1106. const unsigned int& nPixel() const {
  1107. if (!collection->nPixel_loaded) {
  1108. collection->val_nPixel = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nPixel");
  1109. collection->nPixel_loaded = true;
  1110. }
  1111. return (*collection->val_nPixel)().at(idx);
  1112. }
  1113. const unsigned int& nStrip() const {
  1114. if (!collection->nStrip_loaded) {
  1115. collection->val_nStrip = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nStrip");
  1116. collection->nStrip_loaded = true;
  1117. }
  1118. return (*collection->val_nStrip)().at(idx);
  1119. }
  1120. const unsigned int& nLay() const {
  1121. if (!collection->nLay_loaded) {
  1122. collection->val_nLay = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nLay");
  1123. collection->nLay_loaded = true;
  1124. }
  1125. return (*collection->val_nLay)().at(idx);
  1126. }
  1127. const unsigned int& nPixelLay() const {
  1128. if (!collection->nPixelLay_loaded) {
  1129. collection->val_nPixelLay = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nPixelLay");
  1130. collection->nPixelLay_loaded = true;
  1131. }
  1132. return (*collection->val_nPixelLay)().at(idx);
  1133. }
  1134. const unsigned int& n3DLay() const {
  1135. if (!collection->n3DLay_loaded) {
  1136. collection->val_n3DLay = collection->tds->track_branch_obj<vector<unsigned int>>("sim_n3DLay");
  1137. collection->n3DLay_loaded = true;
  1138. }
  1139. return (*collection->val_n3DLay)().at(idx);
  1140. }
  1141. const vector<int>& trkIdx() const {
  1142. if (!collection->trkIdx_loaded) {
  1143. collection->val_trkIdx = collection->tds->track_branch_obj<vector<vector<int>>>("sim_trkIdx");
  1144. collection->trkIdx_loaded = true;
  1145. }
  1146. return (*collection->val_trkIdx)().at(idx);
  1147. }
  1148. const vector<float>& shareFrac() const {
  1149. if (!collection->shareFrac_loaded) {
  1150. collection->val_shareFrac = collection->tds->track_branch_obj<vector<vector<float>>>("sim_shareFrac");
  1151. collection->shareFrac_loaded = true;
  1152. }
  1153. return (*collection->val_shareFrac)().at(idx);
  1154. }
  1155. const int& parentVtxIdx() const {
  1156. if (!collection->parentVtxIdx_loaded) {
  1157. collection->val_parentVtxIdx = collection->tds->track_branch_obj<vector<int>>("sim_parentVtxIdx");
  1158. collection->parentVtxIdx_loaded = true;
  1159. }
  1160. return (*collection->val_parentVtxIdx)().at(idx);
  1161. }
  1162. const vector<int>& decayVtxIdx() const {
  1163. if (!collection->decayVtxIdx_loaded) {
  1164. collection->val_decayVtxIdx = collection->tds->track_branch_obj<vector<vector<int>>>("sim_decayVtxIdx");
  1165. collection->decayVtxIdx_loaded = true;
  1166. }
  1167. return (*collection->val_decayVtxIdx)().at(idx);
  1168. }
  1169. const vector<int>& seedIdx() const {
  1170. if (!collection->seedIdx_loaded) {
  1171. collection->val_seedIdx = collection->tds->track_branch_obj<vector<vector<int>>>("sim_seedIdx");
  1172. collection->seedIdx_loaded = true;
  1173. }
  1174. return (*collection->val_seedIdx)().at(idx);
  1175. }
  1176. };
  1177. SimTrack SimTrackCollection::iter::operator*() {
  1178. return {collection, idx};
  1179. }
  1180. SimTrack SimTrackCollection::operator[](size_t idx) {
  1181. return {this, idx};
  1182. }
  1183. struct SimVertex;
  1184. class SimVertexCollection {
  1185. public:
  1186. class iter {
  1187. public:
  1188. iter(SimVertexCollection* collection, size_t idx)
  1189. :collection(collection), idx(idx) { }
  1190. iter operator++() { ++idx; return *this; }
  1191. bool operator!=(const iter & other) { return idx != other.idx; }
  1192. SimVertex operator*();
  1193. private:
  1194. SimVertexCollection* collection;
  1195. size_t idx;
  1196. };
  1197. TrackingDataSet* tds;
  1198. Value<vector<int>>* val_event;
  1199. bool event_loaded;
  1200. Value<vector<int>>* val_bunchCrossing;
  1201. bool bunchCrossing_loaded;
  1202. Value<vector<unsigned int>>* val_processType;
  1203. bool processType_loaded;
  1204. Value<vector<float>>* val_x;
  1205. bool x_loaded;
  1206. Value<vector<float>>* val_y;
  1207. bool y_loaded;
  1208. Value<vector<float>>* val_z;
  1209. bool z_loaded;
  1210. Value<vector<vector<int>>>* val_sourceSimIdx;
  1211. bool sourceSimIdx_loaded;
  1212. Value<vector<vector<int>>>* val_daughterSimIdx;
  1213. bool daughterSimIdx_loaded;
  1214. SimVertexCollection() { }
  1215. void init(TrackingDataSet* tds){
  1216. this->tds = tds;
  1217. }
  1218. size_t size() {
  1219. if (!this->event_loaded) {
  1220. this->val_event = this->tds->track_branch_obj<vector<int>>("simvtx_event");
  1221. this->event_loaded = true;
  1222. }
  1223. return (*this->val_event)().size();
  1224. }
  1225. SimVertex operator[](size_t);
  1226. iter begin() { return iter(this, 0); }
  1227. iter end() { return iter(this, size()); }
  1228. };
  1229. struct SimVertex {
  1230. SimVertexCollection* collection;
  1231. size_t idx;
  1232. SimVertex(SimVertexCollection* collection, const size_t idx)
  1233. :collection(collection), idx(idx) { }
  1234. const int& event() const {
  1235. if (!collection->event_loaded) {
  1236. collection->val_event = collection->tds->track_branch_obj<vector<int>>("simvtx_event");
  1237. collection->event_loaded = true;
  1238. }
  1239. return (*collection->val_event)().at(idx);
  1240. }
  1241. const int& bunchCrossing() const {
  1242. if (!collection->bunchCrossing_loaded) {
  1243. collection->val_bunchCrossing = collection->tds->track_branch_obj<vector<int>>("simvtx_bunchCrossing");
  1244. collection->bunchCrossing_loaded = true;
  1245. }
  1246. return (*collection->val_bunchCrossing)().at(idx);
  1247. }
  1248. const unsigned int& processType() const {
  1249. if (!collection->processType_loaded) {
  1250. collection->val_processType = collection->tds->track_branch_obj<vector<unsigned int>>("simvtx_processType");
  1251. collection->processType_loaded = true;
  1252. }
  1253. return (*collection->val_processType)().at(idx);
  1254. }
  1255. const float& x() const {
  1256. if (!collection->x_loaded) {
  1257. collection->val_x = collection->tds->track_branch_obj<vector<float>>("simvtx_x");
  1258. collection->x_loaded = true;
  1259. }
  1260. return (*collection->val_x)().at(idx);
  1261. }
  1262. const float& y() const {
  1263. if (!collection->y_loaded) {
  1264. collection->val_y = collection->tds->track_branch_obj<vector<float>>("simvtx_y");
  1265. collection->y_loaded = true;
  1266. }
  1267. return (*collection->val_y)().at(idx);
  1268. }
  1269. const float& z() const {
  1270. if (!collection->z_loaded) {
  1271. collection->val_z = collection->tds->track_branch_obj<vector<float>>("simvtx_z");
  1272. collection->z_loaded = true;
  1273. }
  1274. return (*collection->val_z)().at(idx);
  1275. }
  1276. const vector<int>& sourceSimIdx() const {
  1277. if (!collection->sourceSimIdx_loaded) {
  1278. collection->val_sourceSimIdx = collection->tds->track_branch_obj<vector<vector<int>>>("simvtx_sourceSimIdx");
  1279. collection->sourceSimIdx_loaded = true;
  1280. }
  1281. return (*collection->val_sourceSimIdx)().at(idx);
  1282. }
  1283. const vector<int>& daughterSimIdx() const {
  1284. if (!collection->daughterSimIdx_loaded) {
  1285. collection->val_daughterSimIdx = collection->tds->track_branch_obj<vector<vector<int>>>("simvtx_daughterSimIdx");
  1286. collection->daughterSimIdx_loaded = true;
  1287. }
  1288. return (*collection->val_daughterSimIdx)().at(idx);
  1289. }
  1290. };
  1291. SimVertex SimVertexCollection::iter::operator*() {
  1292. return {collection, idx};
  1293. }
  1294. SimVertex SimVertexCollection::operator[](size_t idx) {
  1295. return {this, idx};
  1296. }
  1297. struct SuperCluster;
  1298. class SuperClusterCollection {
  1299. public:
  1300. class iter {
  1301. public:
  1302. iter(SuperClusterCollection* collection, size_t idx)
  1303. :collection(collection), idx(idx) { }
  1304. iter operator++() { ++idx; return *this; }
  1305. bool operator!=(const iter & other) { return idx != other.idx; }
  1306. SuperCluster operator*();
  1307. private:
  1308. SuperClusterCollection* collection;
  1309. size_t idx;
  1310. };
  1311. TrackingDataSet* tds;
  1312. Value<vector<float>>* val_e;
  1313. bool e_loaded;
  1314. Value<vector<float>>* val_px;
  1315. bool px_loaded;
  1316. Value<vector<float>>* val_py;
  1317. bool py_loaded;
  1318. Value<vector<float>>* val_pz;
  1319. bool pz_loaded;
  1320. Value<vector<float>>* val_x;
  1321. bool x_loaded;
  1322. Value<vector<float>>* val_y;
  1323. bool y_loaded;
  1324. Value<vector<float>>* val_z;
  1325. bool z_loaded;
  1326. Value<vector<float>>* val_hoe;
  1327. bool hoe_loaded;
  1328. SuperClusterCollection() { }
  1329. void init(TrackingDataSet* tds){
  1330. this->tds = tds;
  1331. }
  1332. size_t size() {
  1333. if (!this->e_loaded) {
  1334. this->val_e = this->tds->track_branch_obj<vector<float>>("scl_e");
  1335. this->e_loaded = true;
  1336. }
  1337. return (*this->val_e)().size();
  1338. }
  1339. SuperCluster operator[](size_t);
  1340. iter begin() { return iter(this, 0); }
  1341. iter end() { return iter(this, size()); }
  1342. };
  1343. struct SuperCluster {
  1344. SuperClusterCollection* collection;
  1345. size_t idx;
  1346. SuperCluster(SuperClusterCollection* collection, const size_t idx)
  1347. :collection(collection), idx(idx) { }
  1348. const float& e() const {
  1349. if (!collection->e_loaded) {
  1350. collection->val_e = collection->tds->track_branch_obj<vector<float>>("scl_e");
  1351. collection->e_loaded = true;
  1352. }
  1353. return (*collection->val_e)().at(idx);
  1354. }
  1355. const float& px() const {
  1356. if (!collection->px_loaded) {
  1357. collection->val_px = collection->tds->track_branch_obj<vector<float>>("scl_px");
  1358. collection->px_loaded = true;
  1359. }
  1360. return (*collection->val_px)().at(idx);
  1361. }
  1362. const float& py() const {
  1363. if (!collection->py_loaded) {
  1364. collection->val_py = collection->tds->track_branch_obj<vector<float>>("scl_py");
  1365. collection->py_loaded = true;
  1366. }
  1367. return (*collection->val_py)().at(idx);
  1368. }
  1369. const float& pz() const {
  1370. if (!collection->pz_loaded) {
  1371. collection->val_pz = collection->tds->track_branch_obj<vector<float>>("scl_pz");
  1372. collection->pz_loaded = true;
  1373. }
  1374. return (*collection->val_pz)().at(idx);
  1375. }
  1376. const float& x() const {
  1377. if (!collection->x_loaded) {
  1378. collection->val_x = collection->tds->track_branch_obj<vector<float>>("scl_x");
  1379. collection->x_loaded = true;
  1380. }
  1381. return (*collection->val_x)().at(idx);
  1382. }
  1383. const float& y() const {
  1384. if (!collection->y_loaded) {
  1385. collection->val_y = collection->tds->track_branch_obj<vector<float>>("scl_y");
  1386. collection->y_loaded = true;
  1387. }
  1388. return (*collection->val_y)().at(idx);
  1389. }
  1390. const float& z() const {
  1391. if (!collection->z_loaded) {
  1392. collection->val_z = collection->tds->track_branch_obj<vector<float>>("scl_z");
  1393. collection->z_loaded = true;
  1394. }
  1395. return (*collection->val_z)().at(idx);
  1396. }
  1397. const float& hoe() const {
  1398. if (!collection->hoe_loaded) {
  1399. collection->val_hoe = collection->tds->track_branch_obj<vector<float>>("scl_hoe");
  1400. collection->hoe_loaded = true;
  1401. }
  1402. return (*collection->val_hoe)().at(idx);
  1403. }
  1404. };
  1405. SuperCluster SuperClusterCollection::iter::operator*() {
  1406. return {collection, idx};
  1407. }
  1408. SuperCluster SuperClusterCollection::operator[](size_t idx) {
  1409. return {this, idx};
  1410. }