1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597 |
- /** TrackingNtupleObjs.hpp created on 2018-05-22 17:07:59.784846 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);
- }
- };
- 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);
- }
- };
- Track TrackCollection::iter::operator*() {
- return {collection, idx};
- }
- Track TrackCollection::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);
- }
- };
- 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);
- }
- };
- 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);
- }
- };
- SuperCluster SuperClusterCollection::iter::operator*() {
- return {collection, idx};
- }
- SuperCluster SuperClusterCollection::operator[](size_t idx) {
- return {this, idx};
- }
|