TrackingNtupleObjs.hpp 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. /** TrackingNtupleObjs.hpp created on 2018-05-02 13:32:48.869660 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(const 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. const Seed operator*() const;
  23. private:
  24. const SeedCollection* collection;
  25. size_t idx;
  26. };
  27. Value<vector<short>>* val_fitok;
  28. Value<vector<float>>* val_px;
  29. Value<vector<float>>* val_py;
  30. Value<vector<float>>* val_pz;
  31. Value<vector<float>>* val_pt;
  32. Value<vector<float>>* val_eta;
  33. Value<vector<float>>* val_phi;
  34. Value<vector<float>>* val_dxy;
  35. Value<vector<float>>* val_dz;
  36. Value<vector<float>>* val_ptErr;
  37. Value<vector<float>>* val_etaErr;
  38. Value<vector<float>>* val_phiErr;
  39. Value<vector<float>>* val_dxyErr;
  40. Value<vector<float>>* val_dzErr;
  41. Value<vector<float>>* val_chi2;
  42. Value<vector<int>>* val_q;
  43. Value<vector<unsigned int>>* val_nValid;
  44. Value<vector<unsigned int>>* val_nPixel;
  45. Value<vector<unsigned int>>* val_nGlued;
  46. Value<vector<unsigned int>>* val_nStrip;
  47. Value<vector<unsigned int>>* val_algo;
  48. Value<vector<int>>* val_trkIdx;
  49. Value<vector<vector<float>>>* val_shareFrac;
  50. Value<vector<vector<int>>>* val_simTrkIdx;
  51. Value<vector<unsigned int>>* val_offset;
  52. Value<vector<float>>* val_Et;
  53. Value<vector<float>>* val_hoe;
  54. Value<vector<vector<int>>>* val_isBarrel;
  55. Value<vector<vector<int>>>* val_layerOrDiskNr;
  56. Value<vector<vector<int>>>* val_isValidPos;
  57. Value<vector<vector<float>>>* val_dRZPos;
  58. Value<vector<vector<float>>>* val_dPhiPos;
  59. Value<vector<vector<int>>>* val_isValidNeg;
  60. Value<vector<vector<float>>>* val_dRZNeg;
  61. Value<vector<vector<float>>>* val_dPhiNeg;
  62. Value<vector<short>>* val_isECALDriven;
  63. Value<vector<int>>* val_sclIdx;
  64. SeedCollection() { }
  65. void init(TrackingDataSet& tds){
  66. val_fitok = tds.track_branch_obj<vector<short>>("see_fitok");
  67. val_px = tds.track_branch_obj<vector<float>>("see_px");
  68. val_py = tds.track_branch_obj<vector<float>>("see_py");
  69. val_pz = tds.track_branch_obj<vector<float>>("see_pz");
  70. val_pt = tds.track_branch_obj<vector<float>>("see_pt");
  71. val_eta = tds.track_branch_obj<vector<float>>("see_eta");
  72. val_phi = tds.track_branch_obj<vector<float>>("see_phi");
  73. val_dxy = tds.track_branch_obj<vector<float>>("see_dxy");
  74. val_dz = tds.track_branch_obj<vector<float>>("see_dz");
  75. val_ptErr = tds.track_branch_obj<vector<float>>("see_ptErr");
  76. val_etaErr = tds.track_branch_obj<vector<float>>("see_etaErr");
  77. val_phiErr = tds.track_branch_obj<vector<float>>("see_phiErr");
  78. val_dxyErr = tds.track_branch_obj<vector<float>>("see_dxyErr");
  79. val_dzErr = tds.track_branch_obj<vector<float>>("see_dzErr");
  80. val_chi2 = tds.track_branch_obj<vector<float>>("see_chi2");
  81. val_q = tds.track_branch_obj<vector<int>>("see_q");
  82. val_nValid = tds.track_branch_obj<vector<unsigned int>>("see_nValid");
  83. val_nPixel = tds.track_branch_obj<vector<unsigned int>>("see_nPixel");
  84. val_nGlued = tds.track_branch_obj<vector<unsigned int>>("see_nGlued");
  85. val_nStrip = tds.track_branch_obj<vector<unsigned int>>("see_nStrip");
  86. val_algo = tds.track_branch_obj<vector<unsigned int>>("see_algo");
  87. val_trkIdx = tds.track_branch_obj<vector<int>>("see_trkIdx");
  88. val_shareFrac = tds.track_branch_obj<vector<vector<float>>>("see_shareFrac");
  89. val_simTrkIdx = tds.track_branch_obj<vector<vector<int>>>("see_simTrkIdx");
  90. val_offset = tds.track_branch_obj<vector<unsigned int>>("see_offset");
  91. val_Et = tds.track_branch_obj<vector<float>>("see_Et");
  92. val_hoe = tds.track_branch_obj<vector<float>>("see_hoe");
  93. val_isBarrel = tds.track_branch_obj<vector<vector<int>>>("see_isBarrel");
  94. val_layerOrDiskNr = tds.track_branch_obj<vector<vector<int>>>("see_layerOrDiskNr");
  95. val_isValidPos = tds.track_branch_obj<vector<vector<int>>>("see_isValidPos");
  96. val_dRZPos = tds.track_branch_obj<vector<vector<float>>>("see_dRZPos");
  97. val_dPhiPos = tds.track_branch_obj<vector<vector<float>>>("see_dPhiPos");
  98. val_isValidNeg = tds.track_branch_obj<vector<vector<int>>>("see_isValidNeg");
  99. val_dRZNeg = tds.track_branch_obj<vector<vector<float>>>("see_dRZNeg");
  100. val_dPhiNeg = tds.track_branch_obj<vector<vector<float>>>("see_dPhiNeg");
  101. val_isECALDriven = tds.track_branch_obj<vector<short>>("see_isECALDriven");
  102. val_sclIdx = tds.track_branch_obj<vector<int>>("see_sclIdx");
  103. }
  104. size_t size() const { return (*val_fitok)().size();}
  105. const Seed operator[](size_t) const;
  106. iter begin() const { return iter(this, 0); }
  107. iter end() const { return iter(this, size()); }
  108. };
  109. struct Seed {
  110. const SeedCollection* collection;
  111. const size_t idx;
  112. Seed(const SeedCollection* collection, const size_t idx)
  113. :collection(collection), idx(idx) { }
  114. const short& fitok() const {return (*collection->val_fitok)().at(idx);}
  115. const float& px() const {return (*collection->val_px)().at(idx);}
  116. const float& py() const {return (*collection->val_py)().at(idx);}
  117. const float& pz() const {return (*collection->val_pz)().at(idx);}
  118. const float& pt() const {return (*collection->val_pt)().at(idx);}
  119. const float& eta() const {return (*collection->val_eta)().at(idx);}
  120. const float& phi() const {return (*collection->val_phi)().at(idx);}
  121. const float& dxy() const {return (*collection->val_dxy)().at(idx);}
  122. const float& dz() const {return (*collection->val_dz)().at(idx);}
  123. const float& ptErr() const {return (*collection->val_ptErr)().at(idx);}
  124. const float& etaErr() const {return (*collection->val_etaErr)().at(idx);}
  125. const float& phiErr() const {return (*collection->val_phiErr)().at(idx);}
  126. const float& dxyErr() const {return (*collection->val_dxyErr)().at(idx);}
  127. const float& dzErr() const {return (*collection->val_dzErr)().at(idx);}
  128. const float& chi2() const {return (*collection->val_chi2)().at(idx);}
  129. const int& q() const {return (*collection->val_q)().at(idx);}
  130. const unsigned int& nValid() const {return (*collection->val_nValid)().at(idx);}
  131. const unsigned int& nPixel() const {return (*collection->val_nPixel)().at(idx);}
  132. const unsigned int& nGlued() const {return (*collection->val_nGlued)().at(idx);}
  133. const unsigned int& nStrip() const {return (*collection->val_nStrip)().at(idx);}
  134. const unsigned int& algo() const {return (*collection->val_algo)().at(idx);}
  135. const int& trkIdx() const {return (*collection->val_trkIdx)().at(idx);}
  136. const vector<float>& shareFrac() const {return (*collection->val_shareFrac)().at(idx);}
  137. const vector<int>& simTrkIdx() const {return (*collection->val_simTrkIdx)().at(idx);}
  138. const unsigned int& offset() const {return (*collection->val_offset)().at(idx);}
  139. const float& Et() const {return (*collection->val_Et)().at(idx);}
  140. const float& hoe() const {return (*collection->val_hoe)().at(idx);}
  141. const vector<int>& isBarrel() const {return (*collection->val_isBarrel)().at(idx);}
  142. const vector<int>& layerOrDiskNr() const {return (*collection->val_layerOrDiskNr)().at(idx);}
  143. const vector<int>& isValidPos() const {return (*collection->val_isValidPos)().at(idx);}
  144. const vector<float>& dRZPos() const {return (*collection->val_dRZPos)().at(idx);}
  145. const vector<float>& dPhiPos() const {return (*collection->val_dPhiPos)().at(idx);}
  146. const vector<int>& isValidNeg() const {return (*collection->val_isValidNeg)().at(idx);}
  147. const vector<float>& dRZNeg() const {return (*collection->val_dRZNeg)().at(idx);}
  148. const vector<float>& dPhiNeg() const {return (*collection->val_dPhiNeg)().at(idx);}
  149. const short& isECALDriven() const {return (*collection->val_isECALDriven)().at(idx);}
  150. const int& sclIdx() const {return (*collection->val_sclIdx)().at(idx);}
  151. };
  152. const Seed SeedCollection::iter::operator*() const {
  153. return {collection, idx};
  154. }
  155. const Seed SeedCollection::operator[](size_t idx) const {
  156. return {this, idx};
  157. }
  158. struct Track;
  159. class TrackCollection {
  160. public:
  161. class iter {
  162. public:
  163. iter(const TrackCollection* collection, size_t idx)
  164. :collection(collection), idx(idx) { }
  165. iter operator++() { ++idx; return *this; }
  166. bool operator!=(const iter & other) { return idx != other.idx; }
  167. const Track operator*() const;
  168. private:
  169. const TrackCollection* collection;
  170. size_t idx;
  171. };
  172. Value<vector<float>>* val_px;
  173. Value<vector<float>>* val_py;
  174. Value<vector<float>>* val_pz;
  175. Value<vector<float>>* val_pt;
  176. Value<vector<float>>* val_inner_px;
  177. Value<vector<float>>* val_inner_py;
  178. Value<vector<float>>* val_inner_pz;
  179. Value<vector<float>>* val_inner_pt;
  180. Value<vector<float>>* val_outer_px;
  181. Value<vector<float>>* val_outer_py;
  182. Value<vector<float>>* val_outer_pz;
  183. Value<vector<float>>* val_outer_pt;
  184. Value<vector<float>>* val_eta;
  185. Value<vector<float>>* val_lambda;
  186. Value<vector<float>>* val_cotTheta;
  187. Value<vector<float>>* val_phi;
  188. Value<vector<float>>* val_dxy;
  189. Value<vector<float>>* val_dz;
  190. Value<vector<float>>* val_ptErr;
  191. Value<vector<float>>* val_etaErr;
  192. Value<vector<float>>* val_lambdaErr;
  193. Value<vector<float>>* val_phiErr;
  194. Value<vector<float>>* val_dxyErr;
  195. Value<vector<float>>* val_dzErr;
  196. Value<vector<float>>* val_refpoint_x;
  197. Value<vector<float>>* val_refpoint_y;
  198. Value<vector<float>>* val_refpoint_z;
  199. Value<vector<float>>* val_nChi2;
  200. Value<vector<int>>* val_q;
  201. Value<vector<unsigned int>>* val_nValid;
  202. Value<vector<unsigned int>>* val_nInvalid;
  203. Value<vector<unsigned int>>* val_nPixel;
  204. Value<vector<unsigned int>>* val_nStrip;
  205. Value<vector<unsigned int>>* val_nPixelLay;
  206. Value<vector<unsigned int>>* val_nStripLay;
  207. Value<vector<unsigned int>>* val_n3DLay;
  208. Value<vector<unsigned int>>* val_nOuterLost;
  209. Value<vector<unsigned int>>* val_nInnerLost;
  210. Value<vector<unsigned int>>* val_algo;
  211. Value<vector<unsigned int>>* val_originalAlgo;
  212. Value<vector<ULong64_t>>* val_algoMask;
  213. Value<vector<unsigned int>>* val_stopReason;
  214. Value<vector<short>>* val_isHP;
  215. Value<vector<int>>* val_seedIdx;
  216. Value<vector<float>>* val_vtxx;
  217. Value<vector<float>>* val_vtxy;
  218. Value<vector<float>>* val_vtxz;
  219. Value<vector<vector<float>>>* val_shareFrac;
  220. Value<vector<vector<int>>>* val_simTrkIdx;
  221. Value<vector<int>>* val_genIdx;
  222. Value<vector<float>>* val_genDR;
  223. TrackCollection() { }
  224. void init(TrackingDataSet& tds){
  225. val_px = tds.track_branch_obj<vector<float>>("trk_px");
  226. val_py = tds.track_branch_obj<vector<float>>("trk_py");
  227. val_pz = tds.track_branch_obj<vector<float>>("trk_pz");
  228. val_pt = tds.track_branch_obj<vector<float>>("trk_pt");
  229. val_inner_px = tds.track_branch_obj<vector<float>>("trk_inner_px");
  230. val_inner_py = tds.track_branch_obj<vector<float>>("trk_inner_py");
  231. val_inner_pz = tds.track_branch_obj<vector<float>>("trk_inner_pz");
  232. val_inner_pt = tds.track_branch_obj<vector<float>>("trk_inner_pt");
  233. val_outer_px = tds.track_branch_obj<vector<float>>("trk_outer_px");
  234. val_outer_py = tds.track_branch_obj<vector<float>>("trk_outer_py");
  235. val_outer_pz = tds.track_branch_obj<vector<float>>("trk_outer_pz");
  236. val_outer_pt = tds.track_branch_obj<vector<float>>("trk_outer_pt");
  237. val_eta = tds.track_branch_obj<vector<float>>("trk_eta");
  238. val_lambda = tds.track_branch_obj<vector<float>>("trk_lambda");
  239. val_cotTheta = tds.track_branch_obj<vector<float>>("trk_cotTheta");
  240. val_phi = tds.track_branch_obj<vector<float>>("trk_phi");
  241. val_dxy = tds.track_branch_obj<vector<float>>("trk_dxy");
  242. val_dz = tds.track_branch_obj<vector<float>>("trk_dz");
  243. val_ptErr = tds.track_branch_obj<vector<float>>("trk_ptErr");
  244. val_etaErr = tds.track_branch_obj<vector<float>>("trk_etaErr");
  245. val_lambdaErr = tds.track_branch_obj<vector<float>>("trk_lambdaErr");
  246. val_phiErr = tds.track_branch_obj<vector<float>>("trk_phiErr");
  247. val_dxyErr = tds.track_branch_obj<vector<float>>("trk_dxyErr");
  248. val_dzErr = tds.track_branch_obj<vector<float>>("trk_dzErr");
  249. val_refpoint_x = tds.track_branch_obj<vector<float>>("trk_refpoint_x");
  250. val_refpoint_y = tds.track_branch_obj<vector<float>>("trk_refpoint_y");
  251. val_refpoint_z = tds.track_branch_obj<vector<float>>("trk_refpoint_z");
  252. val_nChi2 = tds.track_branch_obj<vector<float>>("trk_nChi2");
  253. val_q = tds.track_branch_obj<vector<int>>("trk_q");
  254. val_nValid = tds.track_branch_obj<vector<unsigned int>>("trk_nValid");
  255. val_nInvalid = tds.track_branch_obj<vector<unsigned int>>("trk_nInvalid");
  256. val_nPixel = tds.track_branch_obj<vector<unsigned int>>("trk_nPixel");
  257. val_nStrip = tds.track_branch_obj<vector<unsigned int>>("trk_nStrip");
  258. val_nPixelLay = tds.track_branch_obj<vector<unsigned int>>("trk_nPixelLay");
  259. val_nStripLay = tds.track_branch_obj<vector<unsigned int>>("trk_nStripLay");
  260. val_n3DLay = tds.track_branch_obj<vector<unsigned int>>("trk_n3DLay");
  261. val_nOuterLost = tds.track_branch_obj<vector<unsigned int>>("trk_nOuterLost");
  262. val_nInnerLost = tds.track_branch_obj<vector<unsigned int>>("trk_nInnerLost");
  263. val_algo = tds.track_branch_obj<vector<unsigned int>>("trk_algo");
  264. val_originalAlgo = tds.track_branch_obj<vector<unsigned int>>("trk_originalAlgo");
  265. val_algoMask = tds.track_branch_obj<vector<ULong64_t>>("trk_algoMask");
  266. val_stopReason = tds.track_branch_obj<vector<unsigned int>>("trk_stopReason");
  267. val_isHP = tds.track_branch_obj<vector<short>>("trk_isHP");
  268. val_seedIdx = tds.track_branch_obj<vector<int>>("trk_seedIdx");
  269. val_vtxx = tds.track_branch_obj<vector<float>>("trk_vtxx");
  270. val_vtxy = tds.track_branch_obj<vector<float>>("trk_vtxy");
  271. val_vtxz = tds.track_branch_obj<vector<float>>("trk_vtxz");
  272. val_shareFrac = tds.track_branch_obj<vector<vector<float>>>("trk_shareFrac");
  273. val_simTrkIdx = tds.track_branch_obj<vector<vector<int>>>("trk_simTrkIdx");
  274. val_genIdx = tds.track_branch_obj<vector<int>>("trk_genIdx");
  275. val_genDR = tds.track_branch_obj<vector<float>>("trk_genDR");
  276. }
  277. size_t size() const { return (*val_px)().size();}
  278. const Track operator[](size_t) const;
  279. iter begin() const { return iter(this, 0); }
  280. iter end() const { return iter(this, size()); }
  281. };
  282. struct Track {
  283. const TrackCollection* collection;
  284. const size_t idx;
  285. Track(const TrackCollection* collection, const size_t idx)
  286. :collection(collection), idx(idx) { }
  287. const float& px() const {return (*collection->val_px)().at(idx);}
  288. const float& py() const {return (*collection->val_py)().at(idx);}
  289. const float& pz() const {return (*collection->val_pz)().at(idx);}
  290. const float& pt() const {return (*collection->val_pt)().at(idx);}
  291. const float& inner_px() const {return (*collection->val_inner_px)().at(idx);}
  292. const float& inner_py() const {return (*collection->val_inner_py)().at(idx);}
  293. const float& inner_pz() const {return (*collection->val_inner_pz)().at(idx);}
  294. const float& inner_pt() const {return (*collection->val_inner_pt)().at(idx);}
  295. const float& outer_px() const {return (*collection->val_outer_px)().at(idx);}
  296. const float& outer_py() const {return (*collection->val_outer_py)().at(idx);}
  297. const float& outer_pz() const {return (*collection->val_outer_pz)().at(idx);}
  298. const float& outer_pt() const {return (*collection->val_outer_pt)().at(idx);}
  299. const float& eta() const {return (*collection->val_eta)().at(idx);}
  300. const float& lambda() const {return (*collection->val_lambda)().at(idx);}
  301. const float& cotTheta() const {return (*collection->val_cotTheta)().at(idx);}
  302. const float& phi() const {return (*collection->val_phi)().at(idx);}
  303. const float& dxy() const {return (*collection->val_dxy)().at(idx);}
  304. const float& dz() const {return (*collection->val_dz)().at(idx);}
  305. const float& ptErr() const {return (*collection->val_ptErr)().at(idx);}
  306. const float& etaErr() const {return (*collection->val_etaErr)().at(idx);}
  307. const float& lambdaErr() const {return (*collection->val_lambdaErr)().at(idx);}
  308. const float& phiErr() const {return (*collection->val_phiErr)().at(idx);}
  309. const float& dxyErr() const {return (*collection->val_dxyErr)().at(idx);}
  310. const float& dzErr() const {return (*collection->val_dzErr)().at(idx);}
  311. const float& refpoint_x() const {return (*collection->val_refpoint_x)().at(idx);}
  312. const float& refpoint_y() const {return (*collection->val_refpoint_y)().at(idx);}
  313. const float& refpoint_z() const {return (*collection->val_refpoint_z)().at(idx);}
  314. const float& nChi2() const {return (*collection->val_nChi2)().at(idx);}
  315. const int& q() const {return (*collection->val_q)().at(idx);}
  316. const unsigned int& nValid() const {return (*collection->val_nValid)().at(idx);}
  317. const unsigned int& nInvalid() const {return (*collection->val_nInvalid)().at(idx);}
  318. const unsigned int& nPixel() const {return (*collection->val_nPixel)().at(idx);}
  319. const unsigned int& nStrip() const {return (*collection->val_nStrip)().at(idx);}
  320. const unsigned int& nPixelLay() const {return (*collection->val_nPixelLay)().at(idx);}
  321. const unsigned int& nStripLay() const {return (*collection->val_nStripLay)().at(idx);}
  322. const unsigned int& n3DLay() const {return (*collection->val_n3DLay)().at(idx);}
  323. const unsigned int& nOuterLost() const {return (*collection->val_nOuterLost)().at(idx);}
  324. const unsigned int& nInnerLost() const {return (*collection->val_nInnerLost)().at(idx);}
  325. const unsigned int& algo() const {return (*collection->val_algo)().at(idx);}
  326. const unsigned int& originalAlgo() const {return (*collection->val_originalAlgo)().at(idx);}
  327. const ULong64_t& algoMask() const {return (*collection->val_algoMask)().at(idx);}
  328. const unsigned int& stopReason() const {return (*collection->val_stopReason)().at(idx);}
  329. const short& isHP() const {return (*collection->val_isHP)().at(idx);}
  330. const int& seedIdx() const {return (*collection->val_seedIdx)().at(idx);}
  331. const float& vtxx() const {return (*collection->val_vtxx)().at(idx);}
  332. const float& vtxy() const {return (*collection->val_vtxy)().at(idx);}
  333. const float& vtxz() const {return (*collection->val_vtxz)().at(idx);}
  334. const vector<float>& shareFrac() const {return (*collection->val_shareFrac)().at(idx);}
  335. const vector<int>& simTrkIdx() const {return (*collection->val_simTrkIdx)().at(idx);}
  336. const int& genIdx() const {return (*collection->val_genIdx)().at(idx);}
  337. const float& genDR() const {return (*collection->val_genDR)().at(idx);}
  338. };
  339. const Track TrackCollection::iter::operator*() const {
  340. return {collection, idx};
  341. }
  342. const Track TrackCollection::operator[](size_t idx) const {
  343. return {this, idx};
  344. }
  345. struct SimTrack;
  346. class SimTrackCollection {
  347. public:
  348. class iter {
  349. public:
  350. iter(const SimTrackCollection* collection, size_t idx)
  351. :collection(collection), idx(idx) { }
  352. iter operator++() { ++idx; return *this; }
  353. bool operator!=(const iter & other) { return idx != other.idx; }
  354. const SimTrack operator*() const;
  355. private:
  356. const SimTrackCollection* collection;
  357. size_t idx;
  358. };
  359. Value<vector<int>>* val_event;
  360. Value<vector<int>>* val_bunchCrossing;
  361. Value<vector<int>>* val_pdgId;
  362. Value<vector<float>>* val_px;
  363. Value<vector<float>>* val_py;
  364. Value<vector<float>>* val_pz;
  365. Value<vector<float>>* val_pt;
  366. Value<vector<float>>* val_eta;
  367. Value<vector<float>>* val_phi;
  368. Value<vector<float>>* val_pca_pt;
  369. Value<vector<float>>* val_pca_eta;
  370. Value<vector<float>>* val_pca_lambda;
  371. Value<vector<float>>* val_pca_cotTheta;
  372. Value<vector<float>>* val_pca_phi;
  373. Value<vector<float>>* val_pca_dxy;
  374. Value<vector<float>>* val_pca_dz;
  375. Value<vector<int>>* val_q;
  376. Value<vector<unsigned int>>* val_nValid;
  377. Value<vector<unsigned int>>* val_nPixel;
  378. Value<vector<unsigned int>>* val_nStrip;
  379. Value<vector<unsigned int>>* val_nLay;
  380. Value<vector<unsigned int>>* val_nPixelLay;
  381. Value<vector<unsigned int>>* val_n3DLay;
  382. Value<vector<vector<int>>>* val_trkIdx;
  383. Value<vector<vector<float>>>* val_shareFrac;
  384. Value<vector<int>>* val_parentVtxIdx;
  385. Value<vector<vector<int>>>* val_decayVtxIdx;
  386. Value<vector<vector<int>>>* val_seedIdx;
  387. SimTrackCollection() { }
  388. void init(TrackingDataSet& tds){
  389. val_event = tds.track_branch_obj<vector<int>>("sim_event");
  390. val_bunchCrossing = tds.track_branch_obj<vector<int>>("sim_bunchCrossing");
  391. val_pdgId = tds.track_branch_obj<vector<int>>("sim_pdgId");
  392. val_px = tds.track_branch_obj<vector<float>>("sim_px");
  393. val_py = tds.track_branch_obj<vector<float>>("sim_py");
  394. val_pz = tds.track_branch_obj<vector<float>>("sim_pz");
  395. val_pt = tds.track_branch_obj<vector<float>>("sim_pt");
  396. val_eta = tds.track_branch_obj<vector<float>>("sim_eta");
  397. val_phi = tds.track_branch_obj<vector<float>>("sim_phi");
  398. val_pca_pt = tds.track_branch_obj<vector<float>>("sim_pca_pt");
  399. val_pca_eta = tds.track_branch_obj<vector<float>>("sim_pca_eta");
  400. val_pca_lambda = tds.track_branch_obj<vector<float>>("sim_pca_lambda");
  401. val_pca_cotTheta = tds.track_branch_obj<vector<float>>("sim_pca_cotTheta");
  402. val_pca_phi = tds.track_branch_obj<vector<float>>("sim_pca_phi");
  403. val_pca_dxy = tds.track_branch_obj<vector<float>>("sim_pca_dxy");
  404. val_pca_dz = tds.track_branch_obj<vector<float>>("sim_pca_dz");
  405. val_q = tds.track_branch_obj<vector<int>>("sim_q");
  406. val_nValid = tds.track_branch_obj<vector<unsigned int>>("sim_nValid");
  407. val_nPixel = tds.track_branch_obj<vector<unsigned int>>("sim_nPixel");
  408. val_nStrip = tds.track_branch_obj<vector<unsigned int>>("sim_nStrip");
  409. val_nLay = tds.track_branch_obj<vector<unsigned int>>("sim_nLay");
  410. val_nPixelLay = tds.track_branch_obj<vector<unsigned int>>("sim_nPixelLay");
  411. val_n3DLay = tds.track_branch_obj<vector<unsigned int>>("sim_n3DLay");
  412. val_trkIdx = tds.track_branch_obj<vector<vector<int>>>("sim_trkIdx");
  413. val_shareFrac = tds.track_branch_obj<vector<vector<float>>>("sim_shareFrac");
  414. val_parentVtxIdx = tds.track_branch_obj<vector<int>>("sim_parentVtxIdx");
  415. val_decayVtxIdx = tds.track_branch_obj<vector<vector<int>>>("sim_decayVtxIdx");
  416. val_seedIdx = tds.track_branch_obj<vector<vector<int>>>("sim_seedIdx");
  417. }
  418. size_t size() const { return (*val_event)().size();}
  419. const SimTrack operator[](size_t) const;
  420. iter begin() const { return iter(this, 0); }
  421. iter end() const { return iter(this, size()); }
  422. };
  423. struct SimTrack {
  424. const SimTrackCollection* collection;
  425. const size_t idx;
  426. SimTrack(const SimTrackCollection* collection, const size_t idx)
  427. :collection(collection), idx(idx) { }
  428. const int& event() const {return (*collection->val_event)().at(idx);}
  429. const int& bunchCrossing() const {return (*collection->val_bunchCrossing)().at(idx);}
  430. const int& pdgId() const {return (*collection->val_pdgId)().at(idx);}
  431. const float& px() const {return (*collection->val_px)().at(idx);}
  432. const float& py() const {return (*collection->val_py)().at(idx);}
  433. const float& pz() const {return (*collection->val_pz)().at(idx);}
  434. const float& pt() const {return (*collection->val_pt)().at(idx);}
  435. const float& eta() const {return (*collection->val_eta)().at(idx);}
  436. const float& phi() const {return (*collection->val_phi)().at(idx);}
  437. const float& pca_pt() const {return (*collection->val_pca_pt)().at(idx);}
  438. const float& pca_eta() const {return (*collection->val_pca_eta)().at(idx);}
  439. const float& pca_lambda() const {return (*collection->val_pca_lambda)().at(idx);}
  440. const float& pca_cotTheta() const {return (*collection->val_pca_cotTheta)().at(idx);}
  441. const float& pca_phi() const {return (*collection->val_pca_phi)().at(idx);}
  442. const float& pca_dxy() const {return (*collection->val_pca_dxy)().at(idx);}
  443. const float& pca_dz() const {return (*collection->val_pca_dz)().at(idx);}
  444. const int& q() const {return (*collection->val_q)().at(idx);}
  445. const unsigned int& nValid() const {return (*collection->val_nValid)().at(idx);}
  446. const unsigned int& nPixel() const {return (*collection->val_nPixel)().at(idx);}
  447. const unsigned int& nStrip() const {return (*collection->val_nStrip)().at(idx);}
  448. const unsigned int& nLay() const {return (*collection->val_nLay)().at(idx);}
  449. const unsigned int& nPixelLay() const {return (*collection->val_nPixelLay)().at(idx);}
  450. const unsigned int& n3DLay() const {return (*collection->val_n3DLay)().at(idx);}
  451. const vector<int>& trkIdx() const {return (*collection->val_trkIdx)().at(idx);}
  452. const vector<float>& shareFrac() const {return (*collection->val_shareFrac)().at(idx);}
  453. const int& parentVtxIdx() const {return (*collection->val_parentVtxIdx)().at(idx);}
  454. const vector<int>& decayVtxIdx() const {return (*collection->val_decayVtxIdx)().at(idx);}
  455. const vector<int>& seedIdx() const {return (*collection->val_seedIdx)().at(idx);}
  456. };
  457. const SimTrack SimTrackCollection::iter::operator*() const {
  458. return {collection, idx};
  459. }
  460. const SimTrack SimTrackCollection::operator[](size_t idx) const {
  461. return {this, idx};
  462. }
  463. struct SimVertex;
  464. class SimVertexCollection {
  465. public:
  466. class iter {
  467. public:
  468. iter(const SimVertexCollection* collection, size_t idx)
  469. :collection(collection), idx(idx) { }
  470. iter operator++() { ++idx; return *this; }
  471. bool operator!=(const iter & other) { return idx != other.idx; }
  472. const SimVertex operator*() const;
  473. private:
  474. const SimVertexCollection* collection;
  475. size_t idx;
  476. };
  477. Value<vector<int>>* val_event;
  478. Value<vector<int>>* val_bunchCrossing;
  479. Value<vector<unsigned int>>* val_processType;
  480. Value<vector<float>>* val_x;
  481. Value<vector<float>>* val_y;
  482. Value<vector<float>>* val_z;
  483. Value<vector<vector<int>>>* val_sourceSimIdx;
  484. Value<vector<vector<int>>>* val_daughterSimIdx;
  485. SimVertexCollection() { }
  486. void init(TrackingDataSet& tds){
  487. val_event = tds.track_branch_obj<vector<int>>("simvtx_event");
  488. val_bunchCrossing = tds.track_branch_obj<vector<int>>("simvtx_bunchCrossing");
  489. val_processType = tds.track_branch_obj<vector<unsigned int>>("simvtx_processType");
  490. val_x = tds.track_branch_obj<vector<float>>("simvtx_x");
  491. val_y = tds.track_branch_obj<vector<float>>("simvtx_y");
  492. val_z = tds.track_branch_obj<vector<float>>("simvtx_z");
  493. val_sourceSimIdx = tds.track_branch_obj<vector<vector<int>>>("simvtx_sourceSimIdx");
  494. val_daughterSimIdx = tds.track_branch_obj<vector<vector<int>>>("simvtx_daughterSimIdx");
  495. }
  496. size_t size() const { return (*val_event)().size();}
  497. const SimVertex operator[](size_t) const;
  498. iter begin() const { return iter(this, 0); }
  499. iter end() const { return iter(this, size()); }
  500. };
  501. struct SimVertex {
  502. const SimVertexCollection* collection;
  503. const size_t idx;
  504. SimVertex(const SimVertexCollection* collection, const size_t idx)
  505. :collection(collection), idx(idx) { }
  506. const int& event() const {return (*collection->val_event)().at(idx);}
  507. const int& bunchCrossing() const {return (*collection->val_bunchCrossing)().at(idx);}
  508. const unsigned int& processType() const {return (*collection->val_processType)().at(idx);}
  509. const float& x() const {return (*collection->val_x)().at(idx);}
  510. const float& y() const {return (*collection->val_y)().at(idx);}
  511. const float& z() const {return (*collection->val_z)().at(idx);}
  512. const vector<int>& sourceSimIdx() const {return (*collection->val_sourceSimIdx)().at(idx);}
  513. const vector<int>& daughterSimIdx() const {return (*collection->val_daughterSimIdx)().at(idx);}
  514. };
  515. const SimVertex SimVertexCollection::iter::operator*() const {
  516. return {collection, idx};
  517. }
  518. const SimVertex SimVertexCollection::operator[](size_t idx) const {
  519. return {this, idx};
  520. }
  521. struct SuperCluster;
  522. class SuperClusterCollection {
  523. public:
  524. class iter {
  525. public:
  526. iter(const SuperClusterCollection* collection, size_t idx)
  527. :collection(collection), idx(idx) { }
  528. iter operator++() { ++idx; return *this; }
  529. bool operator!=(const iter & other) { return idx != other.idx; }
  530. const SuperCluster operator*() const;
  531. private:
  532. const SuperClusterCollection* collection;
  533. size_t idx;
  534. };
  535. Value<vector<float>>* val_e;
  536. Value<vector<float>>* val_px;
  537. Value<vector<float>>* val_py;
  538. Value<vector<float>>* val_pz;
  539. Value<vector<float>>* val_x;
  540. Value<vector<float>>* val_y;
  541. Value<vector<float>>* val_z;
  542. Value<vector<float>>* val_hoe;
  543. SuperClusterCollection() { }
  544. void init(TrackingDataSet& tds){
  545. val_e = tds.track_branch_obj<vector<float>>("scl_e");
  546. val_px = tds.track_branch_obj<vector<float>>("scl_px");
  547. val_py = tds.track_branch_obj<vector<float>>("scl_py");
  548. val_pz = tds.track_branch_obj<vector<float>>("scl_pz");
  549. val_x = tds.track_branch_obj<vector<float>>("scl_x");
  550. val_y = tds.track_branch_obj<vector<float>>("scl_y");
  551. val_z = tds.track_branch_obj<vector<float>>("scl_z");
  552. val_hoe = tds.track_branch_obj<vector<float>>("scl_hoe");
  553. }
  554. size_t size() const { return (*val_e)().size();}
  555. const SuperCluster operator[](size_t) const;
  556. iter begin() const { return iter(this, 0); }
  557. iter end() const { return iter(this, size()); }
  558. };
  559. struct SuperCluster {
  560. const SuperClusterCollection* collection;
  561. const size_t idx;
  562. SuperCluster(const SuperClusterCollection* collection, const size_t idx)
  563. :collection(collection), idx(idx) { }
  564. const float& e() const {return (*collection->val_e)().at(idx);}
  565. const float& px() const {return (*collection->val_px)().at(idx);}
  566. const float& py() const {return (*collection->val_py)().at(idx);}
  567. const float& pz() const {return (*collection->val_pz)().at(idx);}
  568. const float& x() const {return (*collection->val_x)().at(idx);}
  569. const float& y() const {return (*collection->val_y)().at(idx);}
  570. const float& z() const {return (*collection->val_z)().at(idx);}
  571. const float& hoe() const {return (*collection->val_hoe)().at(idx);}
  572. };
  573. const SuperCluster SuperClusterCollection::iter::operator*() const {
  574. return {collection, idx};
  575. }
  576. const SuperCluster SuperClusterCollection::operator[](size_t idx) const {
  577. return {this, idx};
  578. }