123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803 |
- /** TrackingNtupleObjs.hpp created on 2018-06-07 15:07:37.572190 by generate_class.py
- * AVOID EDITING THIS FILE BY HAND!! Instead edit TrackingNtupleObjs.yaml and re-run
- * generate_class.py
- */
- #include "filval.hpp"
- #include "root_filval.hpp"
- #include<cmath>
- #include "TrackingNtuple.h"
- using namespace std;
- using namespace fv;
- using namespace fv_root;
- typedef TreeDataSet<TrackingNtuple> TrackingDataSet;
- struct Seed;
- class SeedCollection {
- public:
- class iter {
- public:
- iter(SeedCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- Seed operator*();
- private:
- SeedCollection* collection;
- size_t idx;
- };
- TrackingDataSet* tds;
- Value<vector<short>>* val_fitok;
- bool fitok_loaded;
- Value<vector<float>>* val_px;
- bool px_loaded;
- Value<vector<float>>* val_py;
- bool py_loaded;
- Value<vector<float>>* val_pz;
- bool pz_loaded;
- Value<vector<float>>* val_pt;
- bool pt_loaded;
- Value<vector<float>>* val_eta;
- bool eta_loaded;
- Value<vector<float>>* val_phi;
- bool phi_loaded;
- Value<vector<float>>* val_dxy;
- bool dxy_loaded;
- Value<vector<float>>* val_dz;
- bool dz_loaded;
- Value<vector<float>>* val_ptErr;
- bool ptErr_loaded;
- Value<vector<float>>* val_etaErr;
- bool etaErr_loaded;
- Value<vector<float>>* val_phiErr;
- bool phiErr_loaded;
- Value<vector<float>>* val_dxyErr;
- bool dxyErr_loaded;
- Value<vector<float>>* val_dzErr;
- bool dzErr_loaded;
- Value<vector<float>>* val_chi2;
- bool chi2_loaded;
- Value<vector<int>>* val_q;
- bool q_loaded;
- Value<vector<unsigned int>>* val_nValid;
- bool nValid_loaded;
- Value<vector<unsigned int>>* val_nPixel;
- bool nPixel_loaded;
- Value<vector<unsigned int>>* val_nGlued;
- bool nGlued_loaded;
- Value<vector<unsigned int>>* val_nStrip;
- bool nStrip_loaded;
- Value<vector<unsigned int>>* val_algo;
- bool algo_loaded;
- Value<vector<int>>* val_trkIdx;
- bool trkIdx_loaded;
- Value<vector<vector<float>>>* val_shareFrac;
- bool shareFrac_loaded;
- Value<vector<vector<int>>>* val_simTrkIdx;
- bool simTrkIdx_loaded;
- Value<vector<unsigned int>>* val_offset;
- bool offset_loaded;
- Value<vector<float>>* val_Et;
- bool Et_loaded;
- Value<vector<float>>* val_hoe;
- bool hoe_loaded;
- Value<vector<vector<int>>>* val_isBarrel;
- bool isBarrel_loaded;
- Value<vector<vector<int>>>* val_layerOrDiskNr;
- bool layerOrDiskNr_loaded;
- Value<vector<vector<int>>>* val_isValidPos;
- bool isValidPos_loaded;
- Value<vector<vector<float>>>* val_dRZPos;
- bool dRZPos_loaded;
- Value<vector<vector<float>>>* val_dPhiPos;
- bool dPhiPos_loaded;
- Value<vector<vector<int>>>* val_isValidNeg;
- bool isValidNeg_loaded;
- Value<vector<vector<float>>>* val_dRZNeg;
- bool dRZNeg_loaded;
- Value<vector<vector<float>>>* val_dPhiNeg;
- bool dPhiNeg_loaded;
- Value<vector<short>>* val_isECALDriven;
- bool isECALDriven_loaded;
- Value<vector<int>>* val_sclIdx;
- bool sclIdx_loaded;
- SeedCollection() { }
- void init(TrackingDataSet* tds){
- this->tds = tds;
- }
- size_t size() {
- if (!this->fitok_loaded) {
- this->val_fitok = this->tds->track_branch_obj<vector<short>>("see_fitok");
- this->fitok_loaded = true;
- }
- return (*this->val_fitok)().size();
- }
- Seed operator[](size_t);
- iter begin() { return iter(this, 0); }
- iter end() { return iter(this, size()); }
- };
- struct Seed {
- SeedCollection* collection;
- size_t idx;
- Seed(SeedCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const short& fitok() const {
- if (!collection->fitok_loaded) {
- collection->val_fitok = collection->tds->track_branch_obj<vector<short>>("see_fitok");
- collection->fitok_loaded = true;
- }
- return (*collection->val_fitok)().at(idx);
- }
- const float& px() const {
- if (!collection->px_loaded) {
- collection->val_px = collection->tds->track_branch_obj<vector<float>>("see_px");
- collection->px_loaded = true;
- }
- return (*collection->val_px)().at(idx);
- }
- const float& py() const {
- if (!collection->py_loaded) {
- collection->val_py = collection->tds->track_branch_obj<vector<float>>("see_py");
- collection->py_loaded = true;
- }
- return (*collection->val_py)().at(idx);
- }
- const float& pz() const {
- if (!collection->pz_loaded) {
- collection->val_pz = collection->tds->track_branch_obj<vector<float>>("see_pz");
- collection->pz_loaded = true;
- }
- return (*collection->val_pz)().at(idx);
- }
- const float& pt() const {
- if (!collection->pt_loaded) {
- collection->val_pt = collection->tds->track_branch_obj<vector<float>>("see_pt");
- collection->pt_loaded = true;
- }
- return (*collection->val_pt)().at(idx);
- }
- const float& eta() const {
- if (!collection->eta_loaded) {
- collection->val_eta = collection->tds->track_branch_obj<vector<float>>("see_eta");
- collection->eta_loaded = true;
- }
- return (*collection->val_eta)().at(idx);
- }
- const float& phi() const {
- if (!collection->phi_loaded) {
- collection->val_phi = collection->tds->track_branch_obj<vector<float>>("see_phi");
- collection->phi_loaded = true;
- }
- return (*collection->val_phi)().at(idx);
- }
- const float& dxy() const {
- if (!collection->dxy_loaded) {
- collection->val_dxy = collection->tds->track_branch_obj<vector<float>>("see_dxy");
- collection->dxy_loaded = true;
- }
- return (*collection->val_dxy)().at(idx);
- }
- const float& dz() const {
- if (!collection->dz_loaded) {
- collection->val_dz = collection->tds->track_branch_obj<vector<float>>("see_dz");
- collection->dz_loaded = true;
- }
- return (*collection->val_dz)().at(idx);
- }
- const float& ptErr() const {
- if (!collection->ptErr_loaded) {
- collection->val_ptErr = collection->tds->track_branch_obj<vector<float>>("see_ptErr");
- collection->ptErr_loaded = true;
- }
- return (*collection->val_ptErr)().at(idx);
- }
- const float& etaErr() const {
- if (!collection->etaErr_loaded) {
- collection->val_etaErr = collection->tds->track_branch_obj<vector<float>>("see_etaErr");
- collection->etaErr_loaded = true;
- }
- return (*collection->val_etaErr)().at(idx);
- }
- const float& phiErr() const {
- if (!collection->phiErr_loaded) {
- collection->val_phiErr = collection->tds->track_branch_obj<vector<float>>("see_phiErr");
- collection->phiErr_loaded = true;
- }
- return (*collection->val_phiErr)().at(idx);
- }
- const float& dxyErr() const {
- if (!collection->dxyErr_loaded) {
- collection->val_dxyErr = collection->tds->track_branch_obj<vector<float>>("see_dxyErr");
- collection->dxyErr_loaded = true;
- }
- return (*collection->val_dxyErr)().at(idx);
- }
- const float& dzErr() const {
- if (!collection->dzErr_loaded) {
- collection->val_dzErr = collection->tds->track_branch_obj<vector<float>>("see_dzErr");
- collection->dzErr_loaded = true;
- }
- return (*collection->val_dzErr)().at(idx);
- }
- const float& chi2() const {
- if (!collection->chi2_loaded) {
- collection->val_chi2 = collection->tds->track_branch_obj<vector<float>>("see_chi2");
- collection->chi2_loaded = true;
- }
- return (*collection->val_chi2)().at(idx);
- }
- const int& q() const {
- if (!collection->q_loaded) {
- collection->val_q = collection->tds->track_branch_obj<vector<int>>("see_q");
- collection->q_loaded = true;
- }
- return (*collection->val_q)().at(idx);
- }
- const unsigned int& nValid() const {
- if (!collection->nValid_loaded) {
- collection->val_nValid = collection->tds->track_branch_obj<vector<unsigned int>>("see_nValid");
- collection->nValid_loaded = true;
- }
- return (*collection->val_nValid)().at(idx);
- }
- const unsigned int& nPixel() const {
- if (!collection->nPixel_loaded) {
- collection->val_nPixel = collection->tds->track_branch_obj<vector<unsigned int>>("see_nPixel");
- collection->nPixel_loaded = true;
- }
- return (*collection->val_nPixel)().at(idx);
- }
- const unsigned int& nGlued() const {
- if (!collection->nGlued_loaded) {
- collection->val_nGlued = collection->tds->track_branch_obj<vector<unsigned int>>("see_nGlued");
- collection->nGlued_loaded = true;
- }
- return (*collection->val_nGlued)().at(idx);
- }
- const unsigned int& nStrip() const {
- if (!collection->nStrip_loaded) {
- collection->val_nStrip = collection->tds->track_branch_obj<vector<unsigned int>>("see_nStrip");
- collection->nStrip_loaded = true;
- }
- return (*collection->val_nStrip)().at(idx);
- }
- const unsigned int& algo() const {
- if (!collection->algo_loaded) {
- collection->val_algo = collection->tds->track_branch_obj<vector<unsigned int>>("see_algo");
- collection->algo_loaded = true;
- }
- return (*collection->val_algo)().at(idx);
- }
- const int& trkIdx() const {
- if (!collection->trkIdx_loaded) {
- collection->val_trkIdx = collection->tds->track_branch_obj<vector<int>>("see_trkIdx");
- collection->trkIdx_loaded = true;
- }
- return (*collection->val_trkIdx)().at(idx);
- }
- const vector<float>& shareFrac() const {
- if (!collection->shareFrac_loaded) {
- collection->val_shareFrac = collection->tds->track_branch_obj<vector<vector<float>>>("see_shareFrac");
- collection->shareFrac_loaded = true;
- }
- return (*collection->val_shareFrac)().at(idx);
- }
- const vector<int>& simTrkIdx() const {
- if (!collection->simTrkIdx_loaded) {
- collection->val_simTrkIdx = collection->tds->track_branch_obj<vector<vector<int>>>("see_simTrkIdx");
- collection->simTrkIdx_loaded = true;
- }
- return (*collection->val_simTrkIdx)().at(idx);
- }
- const unsigned int& offset() const {
- if (!collection->offset_loaded) {
- collection->val_offset = collection->tds->track_branch_obj<vector<unsigned int>>("see_offset");
- collection->offset_loaded = true;
- }
- return (*collection->val_offset)().at(idx);
- }
- const float& Et() const {
- if (!collection->Et_loaded) {
- collection->val_Et = collection->tds->track_branch_obj<vector<float>>("see_Et");
- collection->Et_loaded = true;
- }
- return (*collection->val_Et)().at(idx);
- }
- const float& hoe() const {
- if (!collection->hoe_loaded) {
- collection->val_hoe = collection->tds->track_branch_obj<vector<float>>("see_hoe");
- collection->hoe_loaded = true;
- }
- return (*collection->val_hoe)().at(idx);
- }
- const vector<int>& isBarrel() const {
- if (!collection->isBarrel_loaded) {
- collection->val_isBarrel = collection->tds->track_branch_obj<vector<vector<int>>>("see_isBarrel");
- collection->isBarrel_loaded = true;
- }
- return (*collection->val_isBarrel)().at(idx);
- }
- const vector<int>& layerOrDiskNr() const {
- if (!collection->layerOrDiskNr_loaded) {
- collection->val_layerOrDiskNr = collection->tds->track_branch_obj<vector<vector<int>>>("see_layerOrDiskNr");
- collection->layerOrDiskNr_loaded = true;
- }
- return (*collection->val_layerOrDiskNr)().at(idx);
- }
- const vector<int>& isValidPos() const {
- if (!collection->isValidPos_loaded) {
- collection->val_isValidPos = collection->tds->track_branch_obj<vector<vector<int>>>("see_isValidPos");
- collection->isValidPos_loaded = true;
- }
- return (*collection->val_isValidPos)().at(idx);
- }
- const vector<float>& dRZPos() const {
- if (!collection->dRZPos_loaded) {
- collection->val_dRZPos = collection->tds->track_branch_obj<vector<vector<float>>>("see_dRZPos");
- collection->dRZPos_loaded = true;
- }
- return (*collection->val_dRZPos)().at(idx);
- }
- const vector<float>& dPhiPos() const {
- if (!collection->dPhiPos_loaded) {
- collection->val_dPhiPos = collection->tds->track_branch_obj<vector<vector<float>>>("see_dPhiPos");
- collection->dPhiPos_loaded = true;
- }
- return (*collection->val_dPhiPos)().at(idx);
- }
- const vector<int>& isValidNeg() const {
- if (!collection->isValidNeg_loaded) {
- collection->val_isValidNeg = collection->tds->track_branch_obj<vector<vector<int>>>("see_isValidNeg");
- collection->isValidNeg_loaded = true;
- }
- return (*collection->val_isValidNeg)().at(idx);
- }
- const vector<float>& dRZNeg() const {
- if (!collection->dRZNeg_loaded) {
- collection->val_dRZNeg = collection->tds->track_branch_obj<vector<vector<float>>>("see_dRZNeg");
- collection->dRZNeg_loaded = true;
- }
- return (*collection->val_dRZNeg)().at(idx);
- }
- const vector<float>& dPhiNeg() const {
- if (!collection->dPhiNeg_loaded) {
- collection->val_dPhiNeg = collection->tds->track_branch_obj<vector<vector<float>>>("see_dPhiNeg");
- collection->dPhiNeg_loaded = true;
- }
- return (*collection->val_dPhiNeg)().at(idx);
- }
- const short& isECALDriven() const {
- if (!collection->isECALDriven_loaded) {
- collection->val_isECALDriven = collection->tds->track_branch_obj<vector<short>>("see_isECALDriven");
- collection->isECALDriven_loaded = true;
- }
- return (*collection->val_isECALDriven)().at(idx);
- }
- const int& sclIdx() const {
- if (!collection->sclIdx_loaded) {
- collection->val_sclIdx = collection->tds->track_branch_obj<vector<int>>("see_sclIdx");
- collection->sclIdx_loaded = true;
- }
- return (*collection->val_sclIdx)().at(idx);
- }
- };
- bool operator==(const Seed& obj1, const Seed& obj2) {
- return obj1.idx == obj2.idx;
- }
- Seed SeedCollection::iter::operator*() {
- return {collection, idx};
- }
- Seed SeedCollection::operator[](size_t idx) {
- return {this, idx};
- }
- struct Track;
- class TrackCollection {
- public:
- class iter {
- public:
- iter(TrackCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- Track operator*();
- private:
- TrackCollection* collection;
- size_t idx;
- };
- TrackingDataSet* tds;
- Value<vector<float>>* val_px;
- bool px_loaded;
- Value<vector<float>>* val_py;
- bool py_loaded;
- Value<vector<float>>* val_pz;
- bool pz_loaded;
- Value<vector<float>>* val_pt;
- bool pt_loaded;
- Value<vector<float>>* val_inner_px;
- bool inner_px_loaded;
- Value<vector<float>>* val_inner_py;
- bool inner_py_loaded;
- Value<vector<float>>* val_inner_pz;
- bool inner_pz_loaded;
- Value<vector<float>>* val_inner_pt;
- bool inner_pt_loaded;
- Value<vector<float>>* val_outer_px;
- bool outer_px_loaded;
- Value<vector<float>>* val_outer_py;
- bool outer_py_loaded;
- Value<vector<float>>* val_outer_pz;
- bool outer_pz_loaded;
- Value<vector<float>>* val_outer_pt;
- bool outer_pt_loaded;
- Value<vector<float>>* val_eta;
- bool eta_loaded;
- Value<vector<float>>* val_lambda;
- bool lambda_loaded;
- Value<vector<float>>* val_cotTheta;
- bool cotTheta_loaded;
- Value<vector<float>>* val_phi;
- bool phi_loaded;
- Value<vector<float>>* val_dxy;
- bool dxy_loaded;
- Value<vector<float>>* val_dz;
- bool dz_loaded;
- Value<vector<float>>* val_ptErr;
- bool ptErr_loaded;
- Value<vector<float>>* val_etaErr;
- bool etaErr_loaded;
- Value<vector<float>>* val_lambdaErr;
- bool lambdaErr_loaded;
- Value<vector<float>>* val_phiErr;
- bool phiErr_loaded;
- Value<vector<float>>* val_dxyErr;
- bool dxyErr_loaded;
- Value<vector<float>>* val_dzErr;
- bool dzErr_loaded;
- Value<vector<float>>* val_refpoint_x;
- bool refpoint_x_loaded;
- Value<vector<float>>* val_refpoint_y;
- bool refpoint_y_loaded;
- Value<vector<float>>* val_refpoint_z;
- bool refpoint_z_loaded;
- Value<vector<float>>* val_nChi2;
- bool nChi2_loaded;
- Value<vector<int>>* val_q;
- bool q_loaded;
- Value<vector<unsigned int>>* val_nValid;
- bool nValid_loaded;
- Value<vector<unsigned int>>* val_nInvalid;
- bool nInvalid_loaded;
- Value<vector<unsigned int>>* val_nPixel;
- bool nPixel_loaded;
- Value<vector<unsigned int>>* val_nStrip;
- bool nStrip_loaded;
- Value<vector<unsigned int>>* val_nPixelLay;
- bool nPixelLay_loaded;
- Value<vector<unsigned int>>* val_nStripLay;
- bool nStripLay_loaded;
- Value<vector<unsigned int>>* val_n3DLay;
- bool n3DLay_loaded;
- Value<vector<unsigned int>>* val_nOuterLost;
- bool nOuterLost_loaded;
- Value<vector<unsigned int>>* val_nInnerLost;
- bool nInnerLost_loaded;
- Value<vector<unsigned int>>* val_algo;
- bool algo_loaded;
- Value<vector<unsigned int>>* val_originalAlgo;
- bool originalAlgo_loaded;
- Value<vector<ULong64_t>>* val_algoMask;
- bool algoMask_loaded;
- Value<vector<unsigned int>>* val_stopReason;
- bool stopReason_loaded;
- Value<vector<short>>* val_isHP;
- bool isHP_loaded;
- Value<vector<int>>* val_seedIdx;
- bool seedIdx_loaded;
- Value<vector<float>>* val_vtxx;
- bool vtxx_loaded;
- Value<vector<float>>* val_vtxy;
- bool vtxy_loaded;
- Value<vector<float>>* val_vtxz;
- bool vtxz_loaded;
- Value<vector<vector<float>>>* val_shareFrac;
- bool shareFrac_loaded;
- Value<vector<vector<int>>>* val_simTrkIdx;
- bool simTrkIdx_loaded;
- Value<vector<int>>* val_genIdx;
- bool genIdx_loaded;
- Value<vector<float>>* val_genDR;
- bool genDR_loaded;
- TrackCollection() { }
- void init(TrackingDataSet* tds){
- this->tds = tds;
- }
- size_t size() {
- if (!this->px_loaded) {
- this->val_px = this->tds->track_branch_obj<vector<float>>("trk_px");
- this->px_loaded = true;
- }
- return (*this->val_px)().size();
- }
- Track operator[](size_t);
- iter begin() { return iter(this, 0); }
- iter end() { return iter(this, size()); }
- };
- struct Track {
- TrackCollection* collection;
- size_t idx;
- Track(TrackCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const float& px() const {
- if (!collection->px_loaded) {
- collection->val_px = collection->tds->track_branch_obj<vector<float>>("trk_px");
- collection->px_loaded = true;
- }
- return (*collection->val_px)().at(idx);
- }
- const float& py() const {
- if (!collection->py_loaded) {
- collection->val_py = collection->tds->track_branch_obj<vector<float>>("trk_py");
- collection->py_loaded = true;
- }
- return (*collection->val_py)().at(idx);
- }
- const float& pz() const {
- if (!collection->pz_loaded) {
- collection->val_pz = collection->tds->track_branch_obj<vector<float>>("trk_pz");
- collection->pz_loaded = true;
- }
- return (*collection->val_pz)().at(idx);
- }
- const float& pt() const {
- if (!collection->pt_loaded) {
- collection->val_pt = collection->tds->track_branch_obj<vector<float>>("trk_pt");
- collection->pt_loaded = true;
- }
- return (*collection->val_pt)().at(idx);
- }
- const float& inner_px() const {
- if (!collection->inner_px_loaded) {
- collection->val_inner_px = collection->tds->track_branch_obj<vector<float>>("trk_inner_px");
- collection->inner_px_loaded = true;
- }
- return (*collection->val_inner_px)().at(idx);
- }
- const float& inner_py() const {
- if (!collection->inner_py_loaded) {
- collection->val_inner_py = collection->tds->track_branch_obj<vector<float>>("trk_inner_py");
- collection->inner_py_loaded = true;
- }
- return (*collection->val_inner_py)().at(idx);
- }
- const float& inner_pz() const {
- if (!collection->inner_pz_loaded) {
- collection->val_inner_pz = collection->tds->track_branch_obj<vector<float>>("trk_inner_pz");
- collection->inner_pz_loaded = true;
- }
- return (*collection->val_inner_pz)().at(idx);
- }
- const float& inner_pt() const {
- if (!collection->inner_pt_loaded) {
- collection->val_inner_pt = collection->tds->track_branch_obj<vector<float>>("trk_inner_pt");
- collection->inner_pt_loaded = true;
- }
- return (*collection->val_inner_pt)().at(idx);
- }
- const float& outer_px() const {
- if (!collection->outer_px_loaded) {
- collection->val_outer_px = collection->tds->track_branch_obj<vector<float>>("trk_outer_px");
- collection->outer_px_loaded = true;
- }
- return (*collection->val_outer_px)().at(idx);
- }
- const float& outer_py() const {
- if (!collection->outer_py_loaded) {
- collection->val_outer_py = collection->tds->track_branch_obj<vector<float>>("trk_outer_py");
- collection->outer_py_loaded = true;
- }
- return (*collection->val_outer_py)().at(idx);
- }
- const float& outer_pz() const {
- if (!collection->outer_pz_loaded) {
- collection->val_outer_pz = collection->tds->track_branch_obj<vector<float>>("trk_outer_pz");
- collection->outer_pz_loaded = true;
- }
- return (*collection->val_outer_pz)().at(idx);
- }
- const float& outer_pt() const {
- if (!collection->outer_pt_loaded) {
- collection->val_outer_pt = collection->tds->track_branch_obj<vector<float>>("trk_outer_pt");
- collection->outer_pt_loaded = true;
- }
- return (*collection->val_outer_pt)().at(idx);
- }
- const float& eta() const {
- if (!collection->eta_loaded) {
- collection->val_eta = collection->tds->track_branch_obj<vector<float>>("trk_eta");
- collection->eta_loaded = true;
- }
- return (*collection->val_eta)().at(idx);
- }
- const float& lambda() const {
- if (!collection->lambda_loaded) {
- collection->val_lambda = collection->tds->track_branch_obj<vector<float>>("trk_lambda");
- collection->lambda_loaded = true;
- }
- return (*collection->val_lambda)().at(idx);
- }
- const float& cotTheta() const {
- if (!collection->cotTheta_loaded) {
- collection->val_cotTheta = collection->tds->track_branch_obj<vector<float>>("trk_cotTheta");
- collection->cotTheta_loaded = true;
- }
- return (*collection->val_cotTheta)().at(idx);
- }
- const float& phi() const {
- if (!collection->phi_loaded) {
- collection->val_phi = collection->tds->track_branch_obj<vector<float>>("trk_phi");
- collection->phi_loaded = true;
- }
- return (*collection->val_phi)().at(idx);
- }
- const float& dxy() const {
- if (!collection->dxy_loaded) {
- collection->val_dxy = collection->tds->track_branch_obj<vector<float>>("trk_dxy");
- collection->dxy_loaded = true;
- }
- return (*collection->val_dxy)().at(idx);
- }
- const float& dz() const {
- if (!collection->dz_loaded) {
- collection->val_dz = collection->tds->track_branch_obj<vector<float>>("trk_dz");
- collection->dz_loaded = true;
- }
- return (*collection->val_dz)().at(idx);
- }
- const float& ptErr() const {
- if (!collection->ptErr_loaded) {
- collection->val_ptErr = collection->tds->track_branch_obj<vector<float>>("trk_ptErr");
- collection->ptErr_loaded = true;
- }
- return (*collection->val_ptErr)().at(idx);
- }
- const float& etaErr() const {
- if (!collection->etaErr_loaded) {
- collection->val_etaErr = collection->tds->track_branch_obj<vector<float>>("trk_etaErr");
- collection->etaErr_loaded = true;
- }
- return (*collection->val_etaErr)().at(idx);
- }
- const float& lambdaErr() const {
- if (!collection->lambdaErr_loaded) {
- collection->val_lambdaErr = collection->tds->track_branch_obj<vector<float>>("trk_lambdaErr");
- collection->lambdaErr_loaded = true;
- }
- return (*collection->val_lambdaErr)().at(idx);
- }
- const float& phiErr() const {
- if (!collection->phiErr_loaded) {
- collection->val_phiErr = collection->tds->track_branch_obj<vector<float>>("trk_phiErr");
- collection->phiErr_loaded = true;
- }
- return (*collection->val_phiErr)().at(idx);
- }
- const float& dxyErr() const {
- if (!collection->dxyErr_loaded) {
- collection->val_dxyErr = collection->tds->track_branch_obj<vector<float>>("trk_dxyErr");
- collection->dxyErr_loaded = true;
- }
- return (*collection->val_dxyErr)().at(idx);
- }
- const float& dzErr() const {
- if (!collection->dzErr_loaded) {
- collection->val_dzErr = collection->tds->track_branch_obj<vector<float>>("trk_dzErr");
- collection->dzErr_loaded = true;
- }
- return (*collection->val_dzErr)().at(idx);
- }
- const float& refpoint_x() const {
- if (!collection->refpoint_x_loaded) {
- collection->val_refpoint_x = collection->tds->track_branch_obj<vector<float>>("trk_refpoint_x");
- collection->refpoint_x_loaded = true;
- }
- return (*collection->val_refpoint_x)().at(idx);
- }
- const float& refpoint_y() const {
- if (!collection->refpoint_y_loaded) {
- collection->val_refpoint_y = collection->tds->track_branch_obj<vector<float>>("trk_refpoint_y");
- collection->refpoint_y_loaded = true;
- }
- return (*collection->val_refpoint_y)().at(idx);
- }
- const float& refpoint_z() const {
- if (!collection->refpoint_z_loaded) {
- collection->val_refpoint_z = collection->tds->track_branch_obj<vector<float>>("trk_refpoint_z");
- collection->refpoint_z_loaded = true;
- }
- return (*collection->val_refpoint_z)().at(idx);
- }
- const float& nChi2() const {
- if (!collection->nChi2_loaded) {
- collection->val_nChi2 = collection->tds->track_branch_obj<vector<float>>("trk_nChi2");
- collection->nChi2_loaded = true;
- }
- return (*collection->val_nChi2)().at(idx);
- }
- const int& q() const {
- if (!collection->q_loaded) {
- collection->val_q = collection->tds->track_branch_obj<vector<int>>("trk_q");
- collection->q_loaded = true;
- }
- return (*collection->val_q)().at(idx);
- }
- const unsigned int& nValid() const {
- if (!collection->nValid_loaded) {
- collection->val_nValid = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nValid");
- collection->nValid_loaded = true;
- }
- return (*collection->val_nValid)().at(idx);
- }
- const unsigned int& nInvalid() const {
- if (!collection->nInvalid_loaded) {
- collection->val_nInvalid = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nInvalid");
- collection->nInvalid_loaded = true;
- }
- return (*collection->val_nInvalid)().at(idx);
- }
- const unsigned int& nPixel() const {
- if (!collection->nPixel_loaded) {
- collection->val_nPixel = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nPixel");
- collection->nPixel_loaded = true;
- }
- return (*collection->val_nPixel)().at(idx);
- }
- const unsigned int& nStrip() const {
- if (!collection->nStrip_loaded) {
- collection->val_nStrip = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nStrip");
- collection->nStrip_loaded = true;
- }
- return (*collection->val_nStrip)().at(idx);
- }
- const unsigned int& nPixelLay() const {
- if (!collection->nPixelLay_loaded) {
- collection->val_nPixelLay = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nPixelLay");
- collection->nPixelLay_loaded = true;
- }
- return (*collection->val_nPixelLay)().at(idx);
- }
- const unsigned int& nStripLay() const {
- if (!collection->nStripLay_loaded) {
- collection->val_nStripLay = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nStripLay");
- collection->nStripLay_loaded = true;
- }
- return (*collection->val_nStripLay)().at(idx);
- }
- const unsigned int& n3DLay() const {
- if (!collection->n3DLay_loaded) {
- collection->val_n3DLay = collection->tds->track_branch_obj<vector<unsigned int>>("trk_n3DLay");
- collection->n3DLay_loaded = true;
- }
- return (*collection->val_n3DLay)().at(idx);
- }
- const unsigned int& nOuterLost() const {
- if (!collection->nOuterLost_loaded) {
- collection->val_nOuterLost = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nOuterLost");
- collection->nOuterLost_loaded = true;
- }
- return (*collection->val_nOuterLost)().at(idx);
- }
- const unsigned int& nInnerLost() const {
- if (!collection->nInnerLost_loaded) {
- collection->val_nInnerLost = collection->tds->track_branch_obj<vector<unsigned int>>("trk_nInnerLost");
- collection->nInnerLost_loaded = true;
- }
- return (*collection->val_nInnerLost)().at(idx);
- }
- const unsigned int& algo() const {
- if (!collection->algo_loaded) {
- collection->val_algo = collection->tds->track_branch_obj<vector<unsigned int>>("trk_algo");
- collection->algo_loaded = true;
- }
- return (*collection->val_algo)().at(idx);
- }
- const unsigned int& originalAlgo() const {
- if (!collection->originalAlgo_loaded) {
- collection->val_originalAlgo = collection->tds->track_branch_obj<vector<unsigned int>>("trk_originalAlgo");
- collection->originalAlgo_loaded = true;
- }
- return (*collection->val_originalAlgo)().at(idx);
- }
- const ULong64_t& algoMask() const {
- if (!collection->algoMask_loaded) {
- collection->val_algoMask = collection->tds->track_branch_obj<vector<ULong64_t>>("trk_algoMask");
- collection->algoMask_loaded = true;
- }
- return (*collection->val_algoMask)().at(idx);
- }
- const unsigned int& stopReason() const {
- if (!collection->stopReason_loaded) {
- collection->val_stopReason = collection->tds->track_branch_obj<vector<unsigned int>>("trk_stopReason");
- collection->stopReason_loaded = true;
- }
- return (*collection->val_stopReason)().at(idx);
- }
- const short& isHP() const {
- if (!collection->isHP_loaded) {
- collection->val_isHP = collection->tds->track_branch_obj<vector<short>>("trk_isHP");
- collection->isHP_loaded = true;
- }
- return (*collection->val_isHP)().at(idx);
- }
- const int& seedIdx() const {
- if (!collection->seedIdx_loaded) {
- collection->val_seedIdx = collection->tds->track_branch_obj<vector<int>>("trk_seedIdx");
- collection->seedIdx_loaded = true;
- }
- return (*collection->val_seedIdx)().at(idx);
- }
- const float& vtxx() const {
- if (!collection->vtxx_loaded) {
- collection->val_vtxx = collection->tds->track_branch_obj<vector<float>>("trk_vtxx");
- collection->vtxx_loaded = true;
- }
- return (*collection->val_vtxx)().at(idx);
- }
- const float& vtxy() const {
- if (!collection->vtxy_loaded) {
- collection->val_vtxy = collection->tds->track_branch_obj<vector<float>>("trk_vtxy");
- collection->vtxy_loaded = true;
- }
- return (*collection->val_vtxy)().at(idx);
- }
- const float& vtxz() const {
- if (!collection->vtxz_loaded) {
- collection->val_vtxz = collection->tds->track_branch_obj<vector<float>>("trk_vtxz");
- collection->vtxz_loaded = true;
- }
- return (*collection->val_vtxz)().at(idx);
- }
- const vector<float>& shareFrac() const {
- if (!collection->shareFrac_loaded) {
- collection->val_shareFrac = collection->tds->track_branch_obj<vector<vector<float>>>("trk_shareFrac");
- collection->shareFrac_loaded = true;
- }
- return (*collection->val_shareFrac)().at(idx);
- }
- const vector<int>& simTrkIdx() const {
- if (!collection->simTrkIdx_loaded) {
- collection->val_simTrkIdx = collection->tds->track_branch_obj<vector<vector<int>>>("trk_simTrkIdx");
- collection->simTrkIdx_loaded = true;
- }
- return (*collection->val_simTrkIdx)().at(idx);
- }
- const int& genIdx() const {
- if (!collection->genIdx_loaded) {
- collection->val_genIdx = collection->tds->track_branch_obj<vector<int>>("trk_genIdx");
- collection->genIdx_loaded = true;
- }
- return (*collection->val_genIdx)().at(idx);
- }
- const float& genDR() const {
- if (!collection->genDR_loaded) {
- collection->val_genDR = collection->tds->track_branch_obj<vector<float>>("trk_genDR");
- collection->genDR_loaded = true;
- }
- return (*collection->val_genDR)().at(idx);
- }
- };
- bool operator==(const Track& obj1, const Track& obj2) {
- return obj1.idx == obj2.idx;
- }
- Track TrackCollection::iter::operator*() {
- return {collection, idx};
- }
- Track TrackCollection::operator[](size_t idx) {
- return {this, idx};
- }
- struct Gen;
- class GenCollection {
- public:
- class iter {
- public:
- iter(GenCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- Gen operator*();
- private:
- GenCollection* collection;
- size_t idx;
- };
- TrackingDataSet* tds;
- Value<vector<float>>* val_px;
- bool px_loaded;
- Value<vector<float>>* val_py;
- bool py_loaded;
- Value<vector<float>>* val_pz;
- bool pz_loaded;
- Value<vector<float>>* val_charge;
- bool charge_loaded;
- Value<vector<int>>* val_pdgId;
- bool pdgId_loaded;
- Value<vector<float>>* val_vx;
- bool vx_loaded;
- Value<vector<float>>* val_vy;
- bool vy_loaded;
- Value<vector<float>>* val_vz;
- bool vz_loaded;
- Value<vector<int>>* val_status;
- bool status_loaded;
- Value<vector<int>>* val_mother;
- bool mother_loaded;
- Value<vector<bool>>* val_isTauDecayProduct;
- bool isTauDecayProduct_loaded;
- Value<vector<bool>>* val_isDirectHadronDecayProduct;
- bool isDirectHadronDecayProduct_loaded;
- Value<vector<bool>>* val_isPrompt;
- bool isPrompt_loaded;
- GenCollection() { }
- void init(TrackingDataSet* tds){
- this->tds = tds;
- }
- size_t size() {
- if (!this->px_loaded) {
- this->val_px = this->tds->track_branch_obj<vector<float>>("gen_px");
- this->px_loaded = true;
- }
- return (*this->val_px)().size();
- }
- Gen operator[](size_t);
- iter begin() { return iter(this, 0); }
- iter end() { return iter(this, size()); }
- };
- struct Gen {
- GenCollection* collection;
- size_t idx;
- Gen(GenCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const float& px() const {
- if (!collection->px_loaded) {
- collection->val_px = collection->tds->track_branch_obj<vector<float>>("gen_px");
- collection->px_loaded = true;
- }
- return (*collection->val_px)().at(idx);
- }
- const float& py() const {
- if (!collection->py_loaded) {
- collection->val_py = collection->tds->track_branch_obj<vector<float>>("gen_py");
- collection->py_loaded = true;
- }
- return (*collection->val_py)().at(idx);
- }
- const float& pz() const {
- if (!collection->pz_loaded) {
- collection->val_pz = collection->tds->track_branch_obj<vector<float>>("gen_pz");
- collection->pz_loaded = true;
- }
- return (*collection->val_pz)().at(idx);
- }
- const float& charge() const {
- if (!collection->charge_loaded) {
- collection->val_charge = collection->tds->track_branch_obj<vector<float>>("gen_charge");
- collection->charge_loaded = true;
- }
- return (*collection->val_charge)().at(idx);
- }
- const int& pdgId() const {
- if (!collection->pdgId_loaded) {
- collection->val_pdgId = collection->tds->track_branch_obj<vector<int>>("gen_pdgId");
- collection->pdgId_loaded = true;
- }
- return (*collection->val_pdgId)().at(idx);
- }
- const float& vx() const {
- if (!collection->vx_loaded) {
- collection->val_vx = collection->tds->track_branch_obj<vector<float>>("gen_vx");
- collection->vx_loaded = true;
- }
- return (*collection->val_vx)().at(idx);
- }
- const float& vy() const {
- if (!collection->vy_loaded) {
- collection->val_vy = collection->tds->track_branch_obj<vector<float>>("gen_vy");
- collection->vy_loaded = true;
- }
- return (*collection->val_vy)().at(idx);
- }
- const float& vz() const {
- if (!collection->vz_loaded) {
- collection->val_vz = collection->tds->track_branch_obj<vector<float>>("gen_vz");
- collection->vz_loaded = true;
- }
- return (*collection->val_vz)().at(idx);
- }
- const int& status() const {
- if (!collection->status_loaded) {
- collection->val_status = collection->tds->track_branch_obj<vector<int>>("gen_status");
- collection->status_loaded = true;
- }
- return (*collection->val_status)().at(idx);
- }
- const int& mother() const {
- if (!collection->mother_loaded) {
- collection->val_mother = collection->tds->track_branch_obj<vector<int>>("gen_mother");
- collection->mother_loaded = true;
- }
- return (*collection->val_mother)().at(idx);
- }
- const bool isTauDecayProduct() const {
- if (!collection->isTauDecayProduct_loaded) {
- collection->val_isTauDecayProduct = collection->tds->track_branch_obj<vector<bool>>("gen_isTauDecayProduct");
- collection->isTauDecayProduct_loaded = true;
- }
- return (*collection->val_isTauDecayProduct)().at(idx);
- }
- const bool isDirectHadronDecayProduct() const {
- if (!collection->isDirectHadronDecayProduct_loaded) {
- collection->val_isDirectHadronDecayProduct = collection->tds->track_branch_obj<vector<bool>>("gen_isDirectHadronDecayProduct");
- collection->isDirectHadronDecayProduct_loaded = true;
- }
- return (*collection->val_isDirectHadronDecayProduct)().at(idx);
- }
- const bool isPrompt() const {
- if (!collection->isPrompt_loaded) {
- collection->val_isPrompt = collection->tds->track_branch_obj<vector<bool>>("gen_isPrompt");
- collection->isPrompt_loaded = true;
- }
- return (*collection->val_isPrompt)().at(idx);
- }
- };
- bool operator==(const Gen& obj1, const Gen& obj2) {
- return obj1.idx == obj2.idx;
- }
- Gen GenCollection::iter::operator*() {
- return {collection, idx};
- }
- Gen GenCollection::operator[](size_t idx) {
- return {this, idx};
- }
- struct SimTrack;
- class SimTrackCollection {
- public:
- class iter {
- public:
- iter(SimTrackCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- SimTrack operator*();
- private:
- SimTrackCollection* collection;
- size_t idx;
- };
- TrackingDataSet* tds;
- Value<vector<int>>* val_event;
- bool event_loaded;
- Value<vector<int>>* val_bunchCrossing;
- bool bunchCrossing_loaded;
- Value<vector<int>>* val_pdgId;
- bool pdgId_loaded;
- Value<vector<float>>* val_px;
- bool px_loaded;
- Value<vector<float>>* val_py;
- bool py_loaded;
- Value<vector<float>>* val_pz;
- bool pz_loaded;
- Value<vector<float>>* val_pt;
- bool pt_loaded;
- Value<vector<float>>* val_eta;
- bool eta_loaded;
- Value<vector<float>>* val_phi;
- bool phi_loaded;
- Value<vector<float>>* val_pca_pt;
- bool pca_pt_loaded;
- Value<vector<float>>* val_pca_eta;
- bool pca_eta_loaded;
- Value<vector<float>>* val_pca_lambda;
- bool pca_lambda_loaded;
- Value<vector<float>>* val_pca_cotTheta;
- bool pca_cotTheta_loaded;
- Value<vector<float>>* val_pca_phi;
- bool pca_phi_loaded;
- Value<vector<float>>* val_pca_dxy;
- bool pca_dxy_loaded;
- Value<vector<float>>* val_pca_dz;
- bool pca_dz_loaded;
- Value<vector<int>>* val_q;
- bool q_loaded;
- Value<vector<unsigned int>>* val_nValid;
- bool nValid_loaded;
- Value<vector<unsigned int>>* val_nPixel;
- bool nPixel_loaded;
- Value<vector<unsigned int>>* val_nStrip;
- bool nStrip_loaded;
- Value<vector<unsigned int>>* val_nLay;
- bool nLay_loaded;
- Value<vector<unsigned int>>* val_nPixelLay;
- bool nPixelLay_loaded;
- Value<vector<unsigned int>>* val_n3DLay;
- bool n3DLay_loaded;
- Value<vector<vector<int>>>* val_trkIdx;
- bool trkIdx_loaded;
- Value<vector<vector<float>>>* val_shareFrac;
- bool shareFrac_loaded;
- Value<vector<int>>* val_parentVtxIdx;
- bool parentVtxIdx_loaded;
- Value<vector<vector<int>>>* val_decayVtxIdx;
- bool decayVtxIdx_loaded;
- Value<vector<vector<int>>>* val_seedIdx;
- bool seedIdx_loaded;
- SimTrackCollection() { }
- void init(TrackingDataSet* tds){
- this->tds = tds;
- }
- size_t size() {
- if (!this->event_loaded) {
- this->val_event = this->tds->track_branch_obj<vector<int>>("sim_event");
- this->event_loaded = true;
- }
- return (*this->val_event)().size();
- }
- SimTrack operator[](size_t);
- iter begin() { return iter(this, 0); }
- iter end() { return iter(this, size()); }
- };
- struct SimTrack {
- SimTrackCollection* collection;
- size_t idx;
- SimTrack(SimTrackCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const int& event() const {
- if (!collection->event_loaded) {
- collection->val_event = collection->tds->track_branch_obj<vector<int>>("sim_event");
- collection->event_loaded = true;
- }
- return (*collection->val_event)().at(idx);
- }
- const int& bunchCrossing() const {
- if (!collection->bunchCrossing_loaded) {
- collection->val_bunchCrossing = collection->tds->track_branch_obj<vector<int>>("sim_bunchCrossing");
- collection->bunchCrossing_loaded = true;
- }
- return (*collection->val_bunchCrossing)().at(idx);
- }
- const int& pdgId() const {
- if (!collection->pdgId_loaded) {
- collection->val_pdgId = collection->tds->track_branch_obj<vector<int>>("sim_pdgId");
- collection->pdgId_loaded = true;
- }
- return (*collection->val_pdgId)().at(idx);
- }
- const float& px() const {
- if (!collection->px_loaded) {
- collection->val_px = collection->tds->track_branch_obj<vector<float>>("sim_px");
- collection->px_loaded = true;
- }
- return (*collection->val_px)().at(idx);
- }
- const float& py() const {
- if (!collection->py_loaded) {
- collection->val_py = collection->tds->track_branch_obj<vector<float>>("sim_py");
- collection->py_loaded = true;
- }
- return (*collection->val_py)().at(idx);
- }
- const float& pz() const {
- if (!collection->pz_loaded) {
- collection->val_pz = collection->tds->track_branch_obj<vector<float>>("sim_pz");
- collection->pz_loaded = true;
- }
- return (*collection->val_pz)().at(idx);
- }
- const float& pt() const {
- if (!collection->pt_loaded) {
- collection->val_pt = collection->tds->track_branch_obj<vector<float>>("sim_pt");
- collection->pt_loaded = true;
- }
- return (*collection->val_pt)().at(idx);
- }
- const float& eta() const {
- if (!collection->eta_loaded) {
- collection->val_eta = collection->tds->track_branch_obj<vector<float>>("sim_eta");
- collection->eta_loaded = true;
- }
- return (*collection->val_eta)().at(idx);
- }
- const float& phi() const {
- if (!collection->phi_loaded) {
- collection->val_phi = collection->tds->track_branch_obj<vector<float>>("sim_phi");
- collection->phi_loaded = true;
- }
- return (*collection->val_phi)().at(idx);
- }
- const float& pca_pt() const {
- if (!collection->pca_pt_loaded) {
- collection->val_pca_pt = collection->tds->track_branch_obj<vector<float>>("sim_pca_pt");
- collection->pca_pt_loaded = true;
- }
- return (*collection->val_pca_pt)().at(idx);
- }
- const float& pca_eta() const {
- if (!collection->pca_eta_loaded) {
- collection->val_pca_eta = collection->tds->track_branch_obj<vector<float>>("sim_pca_eta");
- collection->pca_eta_loaded = true;
- }
- return (*collection->val_pca_eta)().at(idx);
- }
- const float& pca_lambda() const {
- if (!collection->pca_lambda_loaded) {
- collection->val_pca_lambda = collection->tds->track_branch_obj<vector<float>>("sim_pca_lambda");
- collection->pca_lambda_loaded = true;
- }
- return (*collection->val_pca_lambda)().at(idx);
- }
- const float& pca_cotTheta() const {
- if (!collection->pca_cotTheta_loaded) {
- collection->val_pca_cotTheta = collection->tds->track_branch_obj<vector<float>>("sim_pca_cotTheta");
- collection->pca_cotTheta_loaded = true;
- }
- return (*collection->val_pca_cotTheta)().at(idx);
- }
- const float& pca_phi() const {
- if (!collection->pca_phi_loaded) {
- collection->val_pca_phi = collection->tds->track_branch_obj<vector<float>>("sim_pca_phi");
- collection->pca_phi_loaded = true;
- }
- return (*collection->val_pca_phi)().at(idx);
- }
- const float& pca_dxy() const {
- if (!collection->pca_dxy_loaded) {
- collection->val_pca_dxy = collection->tds->track_branch_obj<vector<float>>("sim_pca_dxy");
- collection->pca_dxy_loaded = true;
- }
- return (*collection->val_pca_dxy)().at(idx);
- }
- const float& pca_dz() const {
- if (!collection->pca_dz_loaded) {
- collection->val_pca_dz = collection->tds->track_branch_obj<vector<float>>("sim_pca_dz");
- collection->pca_dz_loaded = true;
- }
- return (*collection->val_pca_dz)().at(idx);
- }
- const int& q() const {
- if (!collection->q_loaded) {
- collection->val_q = collection->tds->track_branch_obj<vector<int>>("sim_q");
- collection->q_loaded = true;
- }
- return (*collection->val_q)().at(idx);
- }
- const unsigned int& nValid() const {
- if (!collection->nValid_loaded) {
- collection->val_nValid = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nValid");
- collection->nValid_loaded = true;
- }
- return (*collection->val_nValid)().at(idx);
- }
- const unsigned int& nPixel() const {
- if (!collection->nPixel_loaded) {
- collection->val_nPixel = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nPixel");
- collection->nPixel_loaded = true;
- }
- return (*collection->val_nPixel)().at(idx);
- }
- const unsigned int& nStrip() const {
- if (!collection->nStrip_loaded) {
- collection->val_nStrip = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nStrip");
- collection->nStrip_loaded = true;
- }
- return (*collection->val_nStrip)().at(idx);
- }
- const unsigned int& nLay() const {
- if (!collection->nLay_loaded) {
- collection->val_nLay = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nLay");
- collection->nLay_loaded = true;
- }
- return (*collection->val_nLay)().at(idx);
- }
- const unsigned int& nPixelLay() const {
- if (!collection->nPixelLay_loaded) {
- collection->val_nPixelLay = collection->tds->track_branch_obj<vector<unsigned int>>("sim_nPixelLay");
- collection->nPixelLay_loaded = true;
- }
- return (*collection->val_nPixelLay)().at(idx);
- }
- const unsigned int& n3DLay() const {
- if (!collection->n3DLay_loaded) {
- collection->val_n3DLay = collection->tds->track_branch_obj<vector<unsigned int>>("sim_n3DLay");
- collection->n3DLay_loaded = true;
- }
- return (*collection->val_n3DLay)().at(idx);
- }
- const vector<int>& trkIdx() const {
- if (!collection->trkIdx_loaded) {
- collection->val_trkIdx = collection->tds->track_branch_obj<vector<vector<int>>>("sim_trkIdx");
- collection->trkIdx_loaded = true;
- }
- return (*collection->val_trkIdx)().at(idx);
- }
- const vector<float>& shareFrac() const {
- if (!collection->shareFrac_loaded) {
- collection->val_shareFrac = collection->tds->track_branch_obj<vector<vector<float>>>("sim_shareFrac");
- collection->shareFrac_loaded = true;
- }
- return (*collection->val_shareFrac)().at(idx);
- }
- const int& parentVtxIdx() const {
- if (!collection->parentVtxIdx_loaded) {
- collection->val_parentVtxIdx = collection->tds->track_branch_obj<vector<int>>("sim_parentVtxIdx");
- collection->parentVtxIdx_loaded = true;
- }
- return (*collection->val_parentVtxIdx)().at(idx);
- }
- const vector<int>& decayVtxIdx() const {
- if (!collection->decayVtxIdx_loaded) {
- collection->val_decayVtxIdx = collection->tds->track_branch_obj<vector<vector<int>>>("sim_decayVtxIdx");
- collection->decayVtxIdx_loaded = true;
- }
- return (*collection->val_decayVtxIdx)().at(idx);
- }
- const vector<int>& seedIdx() const {
- if (!collection->seedIdx_loaded) {
- collection->val_seedIdx = collection->tds->track_branch_obj<vector<vector<int>>>("sim_seedIdx");
- collection->seedIdx_loaded = true;
- }
- return (*collection->val_seedIdx)().at(idx);
- }
- };
- bool operator==(const SimTrack& obj1, const SimTrack& obj2) {
- return obj1.idx == obj2.idx;
- }
- SimTrack SimTrackCollection::iter::operator*() {
- return {collection, idx};
- }
- SimTrack SimTrackCollection::operator[](size_t idx) {
- return {this, idx};
- }
- struct SimVertex;
- class SimVertexCollection {
- public:
- class iter {
- public:
- iter(SimVertexCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- SimVertex operator*();
- private:
- SimVertexCollection* collection;
- size_t idx;
- };
- TrackingDataSet* tds;
- Value<vector<int>>* val_event;
- bool event_loaded;
- Value<vector<int>>* val_bunchCrossing;
- bool bunchCrossing_loaded;
- Value<vector<unsigned int>>* val_processType;
- bool processType_loaded;
- Value<vector<float>>* val_x;
- bool x_loaded;
- Value<vector<float>>* val_y;
- bool y_loaded;
- Value<vector<float>>* val_z;
- bool z_loaded;
- Value<vector<vector<int>>>* val_sourceSimIdx;
- bool sourceSimIdx_loaded;
- Value<vector<vector<int>>>* val_daughterSimIdx;
- bool daughterSimIdx_loaded;
- SimVertexCollection() { }
- void init(TrackingDataSet* tds){
- this->tds = tds;
- }
- size_t size() {
- if (!this->event_loaded) {
- this->val_event = this->tds->track_branch_obj<vector<int>>("simvtx_event");
- this->event_loaded = true;
- }
- return (*this->val_event)().size();
- }
- SimVertex operator[](size_t);
- iter begin() { return iter(this, 0); }
- iter end() { return iter(this, size()); }
- };
- struct SimVertex {
- SimVertexCollection* collection;
- size_t idx;
- SimVertex(SimVertexCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const int& event() const {
- if (!collection->event_loaded) {
- collection->val_event = collection->tds->track_branch_obj<vector<int>>("simvtx_event");
- collection->event_loaded = true;
- }
- return (*collection->val_event)().at(idx);
- }
- const int& bunchCrossing() const {
- if (!collection->bunchCrossing_loaded) {
- collection->val_bunchCrossing = collection->tds->track_branch_obj<vector<int>>("simvtx_bunchCrossing");
- collection->bunchCrossing_loaded = true;
- }
- return (*collection->val_bunchCrossing)().at(idx);
- }
- const unsigned int& processType() const {
- if (!collection->processType_loaded) {
- collection->val_processType = collection->tds->track_branch_obj<vector<unsigned int>>("simvtx_processType");
- collection->processType_loaded = true;
- }
- return (*collection->val_processType)().at(idx);
- }
- const float& x() const {
- if (!collection->x_loaded) {
- collection->val_x = collection->tds->track_branch_obj<vector<float>>("simvtx_x");
- collection->x_loaded = true;
- }
- return (*collection->val_x)().at(idx);
- }
- const float& y() const {
- if (!collection->y_loaded) {
- collection->val_y = collection->tds->track_branch_obj<vector<float>>("simvtx_y");
- collection->y_loaded = true;
- }
- return (*collection->val_y)().at(idx);
- }
- const float& z() const {
- if (!collection->z_loaded) {
- collection->val_z = collection->tds->track_branch_obj<vector<float>>("simvtx_z");
- collection->z_loaded = true;
- }
- return (*collection->val_z)().at(idx);
- }
- const vector<int>& sourceSimIdx() const {
- if (!collection->sourceSimIdx_loaded) {
- collection->val_sourceSimIdx = collection->tds->track_branch_obj<vector<vector<int>>>("simvtx_sourceSimIdx");
- collection->sourceSimIdx_loaded = true;
- }
- return (*collection->val_sourceSimIdx)().at(idx);
- }
- const vector<int>& daughterSimIdx() const {
- if (!collection->daughterSimIdx_loaded) {
- collection->val_daughterSimIdx = collection->tds->track_branch_obj<vector<vector<int>>>("simvtx_daughterSimIdx");
- collection->daughterSimIdx_loaded = true;
- }
- return (*collection->val_daughterSimIdx)().at(idx);
- }
- };
- bool operator==(const SimVertex& obj1, const SimVertex& obj2) {
- return obj1.idx == obj2.idx;
- }
- SimVertex SimVertexCollection::iter::operator*() {
- return {collection, idx};
- }
- SimVertex SimVertexCollection::operator[](size_t idx) {
- return {this, idx};
- }
- struct SuperCluster;
- class SuperClusterCollection {
- public:
- class iter {
- public:
- iter(SuperClusterCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- SuperCluster operator*();
- private:
- SuperClusterCollection* collection;
- size_t idx;
- };
- TrackingDataSet* tds;
- Value<vector<float>>* val_e;
- bool e_loaded;
- Value<vector<float>>* val_px;
- bool px_loaded;
- Value<vector<float>>* val_py;
- bool py_loaded;
- Value<vector<float>>* val_pz;
- bool pz_loaded;
- Value<vector<float>>* val_x;
- bool x_loaded;
- Value<vector<float>>* val_y;
- bool y_loaded;
- Value<vector<float>>* val_z;
- bool z_loaded;
- Value<vector<float>>* val_hoe;
- bool hoe_loaded;
- SuperClusterCollection() { }
- void init(TrackingDataSet* tds){
- this->tds = tds;
- }
- size_t size() {
- if (!this->e_loaded) {
- this->val_e = this->tds->track_branch_obj<vector<float>>("scl_e");
- this->e_loaded = true;
- }
- return (*this->val_e)().size();
- }
- SuperCluster operator[](size_t);
- iter begin() { return iter(this, 0); }
- iter end() { return iter(this, size()); }
- };
- struct SuperCluster {
- SuperClusterCollection* collection;
- size_t idx;
- SuperCluster(SuperClusterCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const float& e() const {
- if (!collection->e_loaded) {
- collection->val_e = collection->tds->track_branch_obj<vector<float>>("scl_e");
- collection->e_loaded = true;
- }
- return (*collection->val_e)().at(idx);
- }
- const float& px() const {
- if (!collection->px_loaded) {
- collection->val_px = collection->tds->track_branch_obj<vector<float>>("scl_px");
- collection->px_loaded = true;
- }
- return (*collection->val_px)().at(idx);
- }
- const float& py() const {
- if (!collection->py_loaded) {
- collection->val_py = collection->tds->track_branch_obj<vector<float>>("scl_py");
- collection->py_loaded = true;
- }
- return (*collection->val_py)().at(idx);
- }
- const float& pz() const {
- if (!collection->pz_loaded) {
- collection->val_pz = collection->tds->track_branch_obj<vector<float>>("scl_pz");
- collection->pz_loaded = true;
- }
- return (*collection->val_pz)().at(idx);
- }
- const float& x() const {
- if (!collection->x_loaded) {
- collection->val_x = collection->tds->track_branch_obj<vector<float>>("scl_x");
- collection->x_loaded = true;
- }
- return (*collection->val_x)().at(idx);
- }
- const float& y() const {
- if (!collection->y_loaded) {
- collection->val_y = collection->tds->track_branch_obj<vector<float>>("scl_y");
- collection->y_loaded = true;
- }
- return (*collection->val_y)().at(idx);
- }
- const float& z() const {
- if (!collection->z_loaded) {
- collection->val_z = collection->tds->track_branch_obj<vector<float>>("scl_z");
- collection->z_loaded = true;
- }
- return (*collection->val_z)().at(idx);
- }
- const float& hoe() const {
- if (!collection->hoe_loaded) {
- collection->val_hoe = collection->tds->track_branch_obj<vector<float>>("scl_hoe");
- collection->hoe_loaded = true;
- }
- return (*collection->val_hoe)().at(idx);
- }
- };
- bool operator==(const SuperCluster& obj1, const SuperCluster& obj2) {
- return obj1.idx == obj2.idx;
- }
- SuperCluster SuperClusterCollection::iter::operator*() {
- return {collection, idx};
- }
- SuperCluster SuperClusterCollection::operator[](size_t idx) {
- return {this, idx};
- }
|