123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549 |
- /** TrackingNtupleObjs.hpp created on 2018-01-21 23:00:12.588429 by generate_class.py
- * AVOID EDITING THIS FILE BY HAND!! Instead edit TrackingNtupleObjs.yaml and re-run
- * generate_class.py
- */
- #include "filval/filval.hpp"
- #include "filval/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(const SeedCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- const Seed operator*() const;
- private:
- const SeedCollection* collection;
- size_t idx;
- };
- Value<vector<short>>* val_fitok;
- Value<vector<float>>* val_px;
- Value<vector<float>>* val_py;
- Value<vector<float>>* val_pz;
- Value<vector<float>>* val_pt;
- Value<vector<float>>* val_eta;
- Value<vector<float>>* val_phi;
- Value<vector<float>>* val_dxy;
- Value<vector<float>>* val_dz;
- Value<vector<float>>* val_ptErr;
- Value<vector<float>>* val_etaErr;
- Value<vector<float>>* val_phiErr;
- Value<vector<float>>* val_dxyErr;
- Value<vector<float>>* val_dzErr;
- Value<vector<float>>* val_chi2;
- Value<vector<int>>* val_q;
- Value<vector<unsigned int>>* val_nValid;
- Value<vector<unsigned int>>* val_nPixel;
- Value<vector<unsigned int>>* val_nGlued;
- Value<vector<unsigned int>>* val_nStrip;
- Value<vector<unsigned int>>* val_algo;
- Value<vector<int>>* val_trkIdx;
- Value<vector<vector<float>>>* val_shareFrac;
- Value<vector<vector<int>>>* val_simTrkIdx;
- Value<vector<unsigned int>>* val_offset;
- Value<vector<vector<int>>>* val_isBarrel;
- Value<vector<vector<int>>>* val_layerOrDiskNr;
- Value<vector<vector<int>>>* val_isValidPos;
- Value<vector<vector<float>>>* val_dRZPos;
- Value<vector<vector<float>>>* val_dPhiPos;
- Value<vector<vector<int>>>* val_isValidNeg;
- Value<vector<vector<float>>>* val_dRZNeg;
- Value<vector<vector<float>>>* val_dPhiNeg;
- SeedCollection() { }
- void init(TrackingDataSet& tds){
- val_fitok = tds.track_branch_obj<vector<short>>("see_fitok");
- val_px = tds.track_branch_obj<vector<float>>("see_px");
- val_py = tds.track_branch_obj<vector<float>>("see_py");
- val_pz = tds.track_branch_obj<vector<float>>("see_pz");
- val_pt = tds.track_branch_obj<vector<float>>("see_pt");
- val_eta = tds.track_branch_obj<vector<float>>("see_eta");
- val_phi = tds.track_branch_obj<vector<float>>("see_phi");
- val_dxy = tds.track_branch_obj<vector<float>>("see_dxy");
- val_dz = tds.track_branch_obj<vector<float>>("see_dz");
- val_ptErr = tds.track_branch_obj<vector<float>>("see_ptErr");
- val_etaErr = tds.track_branch_obj<vector<float>>("see_etaErr");
- val_phiErr = tds.track_branch_obj<vector<float>>("see_phiErr");
- val_dxyErr = tds.track_branch_obj<vector<float>>("see_dxyErr");
- val_dzErr = tds.track_branch_obj<vector<float>>("see_dzErr");
- val_chi2 = tds.track_branch_obj<vector<float>>("see_chi2");
- val_q = tds.track_branch_obj<vector<int>>("see_q");
- val_nValid = tds.track_branch_obj<vector<unsigned int>>("see_nValid");
- val_nPixel = tds.track_branch_obj<vector<unsigned int>>("see_nPixel");
- val_nGlued = tds.track_branch_obj<vector<unsigned int>>("see_nGlued");
- val_nStrip = tds.track_branch_obj<vector<unsigned int>>("see_nStrip");
- val_algo = tds.track_branch_obj<vector<unsigned int>>("see_algo");
- val_trkIdx = tds.track_branch_obj<vector<int>>("see_trkIdx");
- val_shareFrac = tds.track_branch_obj<vector<vector<float>>>("see_shareFrac");
- val_simTrkIdx = tds.track_branch_obj<vector<vector<int>>>("see_simTrkIdx");
- val_offset = tds.track_branch_obj<vector<unsigned int>>("see_offset");
- val_isBarrel = tds.track_branch_obj<vector<vector<int>>>("see_isBarrel");
- val_layerOrDiskNr = tds.track_branch_obj<vector<vector<int>>>("see_layerOrDiskNr");
- val_isValidPos = tds.track_branch_obj<vector<vector<int>>>("see_isValidPos");
- val_dRZPos = tds.track_branch_obj<vector<vector<float>>>("see_dRZPos");
- val_dPhiPos = tds.track_branch_obj<vector<vector<float>>>("see_dPhiPos");
- val_isValidNeg = tds.track_branch_obj<vector<vector<int>>>("see_isValidNeg");
- val_dRZNeg = tds.track_branch_obj<vector<vector<float>>>("see_dRZNeg");
- val_dPhiNeg = tds.track_branch_obj<vector<vector<float>>>("see_dPhiNeg");
- }
- size_t size() const { return val_fitok->get_value().size();}
- const Seed operator[](size_t) const;
- iter begin() const { return iter(this, 0); }
- iter end() const { return iter(this, size()); }
- };
- struct Seed {
- const SeedCollection* collection;
- const size_t idx;
- Seed(const SeedCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const short& fitok() const {return collection->val_fitok->get_value().at(idx);}
- const float& px() const {return collection->val_px->get_value().at(idx);}
- const float& py() const {return collection->val_py->get_value().at(idx);}
- const float& pz() const {return collection->val_pz->get_value().at(idx);}
- const float& pt() const {return collection->val_pt->get_value().at(idx);}
- const float& eta() const {return collection->val_eta->get_value().at(idx);}
- const float& phi() const {return collection->val_phi->get_value().at(idx);}
- const float& dxy() const {return collection->val_dxy->get_value().at(idx);}
- const float& dz() const {return collection->val_dz->get_value().at(idx);}
- const float& ptErr() const {return collection->val_ptErr->get_value().at(idx);}
- const float& etaErr() const {return collection->val_etaErr->get_value().at(idx);}
- const float& phiErr() const {return collection->val_phiErr->get_value().at(idx);}
- const float& dxyErr() const {return collection->val_dxyErr->get_value().at(idx);}
- const float& dzErr() const {return collection->val_dzErr->get_value().at(idx);}
- const float& chi2() const {return collection->val_chi2->get_value().at(idx);}
- const int& q() const {return collection->val_q->get_value().at(idx);}
- const unsigned int& nValid() const {return collection->val_nValid->get_value().at(idx);}
- const unsigned int& nPixel() const {return collection->val_nPixel->get_value().at(idx);}
- const unsigned int& nGlued() const {return collection->val_nGlued->get_value().at(idx);}
- const unsigned int& nStrip() const {return collection->val_nStrip->get_value().at(idx);}
- const unsigned int& algo() const {return collection->val_algo->get_value().at(idx);}
- const int& trkIdx() const {return collection->val_trkIdx->get_value().at(idx);}
- const vector<float>& shareFrac() const {return collection->val_shareFrac->get_value().at(idx);}
- const vector<int>& simTrkIdx() const {return collection->val_simTrkIdx->get_value().at(idx);}
- const unsigned int& offset() const {return collection->val_offset->get_value().at(idx);}
- const vector<int>& isBarrel() const {return collection->val_isBarrel->get_value().at(idx);}
- const vector<int>& layerOrDiskNr() const {return collection->val_layerOrDiskNr->get_value().at(idx);}
- const vector<int>& isValidPos() const {return collection->val_isValidPos->get_value().at(idx);}
- const vector<float>& dRZPos() const {return collection->val_dRZPos->get_value().at(idx);}
- const vector<float>& dPhiPos() const {return collection->val_dPhiPos->get_value().at(idx);}
- const vector<int>& isValidNeg() const {return collection->val_isValidNeg->get_value().at(idx);}
- const vector<float>& dRZNeg() const {return collection->val_dRZNeg->get_value().at(idx);}
- const vector<float>& dPhiNeg() const {return collection->val_dPhiNeg->get_value().at(idx);}
- };
- const Seed SeedCollection::iter::operator*() const {
- return {collection, idx};
- }
- const Seed SeedCollection::operator[](size_t idx) const {
- return {this, idx};
- }
- struct Track;
- class TrackCollection {
- public:
- class iter {
- public:
- iter(const TrackCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- const Track operator*() const;
- private:
- const TrackCollection* collection;
- size_t idx;
- };
- Value<vector<float>>* val_px;
- Value<vector<float>>* val_py;
- Value<vector<float>>* val_pz;
- Value<vector<float>>* val_pt;
- Value<vector<float>>* val_inner_px;
- Value<vector<float>>* val_inner_py;
- Value<vector<float>>* val_inner_pz;
- Value<vector<float>>* val_inner_pt;
- Value<vector<float>>* val_outer_px;
- Value<vector<float>>* val_outer_py;
- Value<vector<float>>* val_outer_pz;
- Value<vector<float>>* val_outer_pt;
- Value<vector<float>>* val_eta;
- Value<vector<float>>* val_lambda;
- Value<vector<float>>* val_cotTheta;
- Value<vector<float>>* val_phi;
- Value<vector<float>>* val_dxy;
- Value<vector<float>>* val_dz;
- Value<vector<float>>* val_ptErr;
- Value<vector<float>>* val_etaErr;
- Value<vector<float>>* val_lambdaErr;
- Value<vector<float>>* val_phiErr;
- Value<vector<float>>* val_dxyErr;
- Value<vector<float>>* val_dzErr;
- Value<vector<float>>* val_refpoint_x;
- Value<vector<float>>* val_refpoint_y;
- Value<vector<float>>* val_refpoint_z;
- Value<vector<float>>* val_nChi2;
- Value<vector<int>>* val_q;
- Value<vector<unsigned int>>* val_nValid;
- Value<vector<unsigned int>>* val_nInvalid;
- Value<vector<unsigned int>>* val_nPixel;
- Value<vector<unsigned int>>* val_nStrip;
- Value<vector<unsigned int>>* val_nPixelLay;
- Value<vector<unsigned int>>* val_nStripLay;
- Value<vector<unsigned int>>* val_n3DLay;
- Value<vector<unsigned int>>* val_nOuterLost;
- Value<vector<unsigned int>>* val_nInnerLost;
- Value<vector<unsigned int>>* val_algo;
- Value<vector<unsigned int>>* val_originalAlgo;
- Value<vector<ULong64_t>>* val_algoMask;
- Value<vector<unsigned int>>* val_stopReason;
- Value<vector<short>>* val_isHP;
- Value<vector<int>>* val_seedIdx;
- Value<vector<float>>* val_vtxx;
- Value<vector<float>>* val_vtxy;
- Value<vector<float>>* val_vtxz;
- Value<vector<vector<float>>>* val_shareFrac;
- Value<vector<vector<int>>>* val_simTrkIdx;
- Value<vector<int>>* val_genIdx;
- Value<vector<float>>* val_genDR;
- TrackCollection() { }
- void init(TrackingDataSet& tds){
- val_px = tds.track_branch_obj<vector<float>>("trk_px");
- val_py = tds.track_branch_obj<vector<float>>("trk_py");
- val_pz = tds.track_branch_obj<vector<float>>("trk_pz");
- val_pt = tds.track_branch_obj<vector<float>>("trk_pt");
- val_inner_px = tds.track_branch_obj<vector<float>>("trk_inner_px");
- val_inner_py = tds.track_branch_obj<vector<float>>("trk_inner_py");
- val_inner_pz = tds.track_branch_obj<vector<float>>("trk_inner_pz");
- val_inner_pt = tds.track_branch_obj<vector<float>>("trk_inner_pt");
- val_outer_px = tds.track_branch_obj<vector<float>>("trk_outer_px");
- val_outer_py = tds.track_branch_obj<vector<float>>("trk_outer_py");
- val_outer_pz = tds.track_branch_obj<vector<float>>("trk_outer_pz");
- val_outer_pt = tds.track_branch_obj<vector<float>>("trk_outer_pt");
- val_eta = tds.track_branch_obj<vector<float>>("trk_eta");
- val_lambda = tds.track_branch_obj<vector<float>>("trk_lambda");
- val_cotTheta = tds.track_branch_obj<vector<float>>("trk_cotTheta");
- val_phi = tds.track_branch_obj<vector<float>>("trk_phi");
- val_dxy = tds.track_branch_obj<vector<float>>("trk_dxy");
- val_dz = tds.track_branch_obj<vector<float>>("trk_dz");
- val_ptErr = tds.track_branch_obj<vector<float>>("trk_ptErr");
- val_etaErr = tds.track_branch_obj<vector<float>>("trk_etaErr");
- val_lambdaErr = tds.track_branch_obj<vector<float>>("trk_lambdaErr");
- val_phiErr = tds.track_branch_obj<vector<float>>("trk_phiErr");
- val_dxyErr = tds.track_branch_obj<vector<float>>("trk_dxyErr");
- val_dzErr = tds.track_branch_obj<vector<float>>("trk_dzErr");
- val_refpoint_x = tds.track_branch_obj<vector<float>>("trk_refpoint_x");
- val_refpoint_y = tds.track_branch_obj<vector<float>>("trk_refpoint_y");
- val_refpoint_z = tds.track_branch_obj<vector<float>>("trk_refpoint_z");
- val_nChi2 = tds.track_branch_obj<vector<float>>("trk_nChi2");
- val_q = tds.track_branch_obj<vector<int>>("trk_q");
- val_nValid = tds.track_branch_obj<vector<unsigned int>>("trk_nValid");
- val_nInvalid = tds.track_branch_obj<vector<unsigned int>>("trk_nInvalid");
- val_nPixel = tds.track_branch_obj<vector<unsigned int>>("trk_nPixel");
- val_nStrip = tds.track_branch_obj<vector<unsigned int>>("trk_nStrip");
- val_nPixelLay = tds.track_branch_obj<vector<unsigned int>>("trk_nPixelLay");
- val_nStripLay = tds.track_branch_obj<vector<unsigned int>>("trk_nStripLay");
- val_n3DLay = tds.track_branch_obj<vector<unsigned int>>("trk_n3DLay");
- val_nOuterLost = tds.track_branch_obj<vector<unsigned int>>("trk_nOuterLost");
- val_nInnerLost = tds.track_branch_obj<vector<unsigned int>>("trk_nInnerLost");
- val_algo = tds.track_branch_obj<vector<unsigned int>>("trk_algo");
- val_originalAlgo = tds.track_branch_obj<vector<unsigned int>>("trk_originalAlgo");
- val_algoMask = tds.track_branch_obj<vector<ULong64_t>>("trk_algoMask");
- val_stopReason = tds.track_branch_obj<vector<unsigned int>>("trk_stopReason");
- val_isHP = tds.track_branch_obj<vector<short>>("trk_isHP");
- val_seedIdx = tds.track_branch_obj<vector<int>>("trk_seedIdx");
- val_vtxx = tds.track_branch_obj<vector<float>>("trk_vtxx");
- val_vtxy = tds.track_branch_obj<vector<float>>("trk_vtxy");
- val_vtxz = tds.track_branch_obj<vector<float>>("trk_vtxz");
- val_shareFrac = tds.track_branch_obj<vector<vector<float>>>("trk_shareFrac");
- val_simTrkIdx = tds.track_branch_obj<vector<vector<int>>>("trk_simTrkIdx");
- val_genIdx = tds.track_branch_obj<vector<int>>("trk_genIdx");
- val_genDR = tds.track_branch_obj<vector<float>>("trk_genDR");
- }
- size_t size() const { return val_px->get_value().size();}
- const Track operator[](size_t) const;
- iter begin() const { return iter(this, 0); }
- iter end() const { return iter(this, size()); }
- };
- struct Track {
- const TrackCollection* collection;
- const size_t idx;
- Track(const TrackCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const float& px() const {return collection->val_px->get_value().at(idx);}
- const float& py() const {return collection->val_py->get_value().at(idx);}
- const float& pz() const {return collection->val_pz->get_value().at(idx);}
- const float& pt() const {return collection->val_pt->get_value().at(idx);}
- const float& inner_px() const {return collection->val_inner_px->get_value().at(idx);}
- const float& inner_py() const {return collection->val_inner_py->get_value().at(idx);}
- const float& inner_pz() const {return collection->val_inner_pz->get_value().at(idx);}
- const float& inner_pt() const {return collection->val_inner_pt->get_value().at(idx);}
- const float& outer_px() const {return collection->val_outer_px->get_value().at(idx);}
- const float& outer_py() const {return collection->val_outer_py->get_value().at(idx);}
- const float& outer_pz() const {return collection->val_outer_pz->get_value().at(idx);}
- const float& outer_pt() const {return collection->val_outer_pt->get_value().at(idx);}
- const float& eta() const {return collection->val_eta->get_value().at(idx);}
- const float& lambda() const {return collection->val_lambda->get_value().at(idx);}
- const float& cotTheta() const {return collection->val_cotTheta->get_value().at(idx);}
- const float& phi() const {return collection->val_phi->get_value().at(idx);}
- const float& dxy() const {return collection->val_dxy->get_value().at(idx);}
- const float& dz() const {return collection->val_dz->get_value().at(idx);}
- const float& ptErr() const {return collection->val_ptErr->get_value().at(idx);}
- const float& etaErr() const {return collection->val_etaErr->get_value().at(idx);}
- const float& lambdaErr() const {return collection->val_lambdaErr->get_value().at(idx);}
- const float& phiErr() const {return collection->val_phiErr->get_value().at(idx);}
- const float& dxyErr() const {return collection->val_dxyErr->get_value().at(idx);}
- const float& dzErr() const {return collection->val_dzErr->get_value().at(idx);}
- const float& refpoint_x() const {return collection->val_refpoint_x->get_value().at(idx);}
- const float& refpoint_y() const {return collection->val_refpoint_y->get_value().at(idx);}
- const float& refpoint_z() const {return collection->val_refpoint_z->get_value().at(idx);}
- const float& nChi2() const {return collection->val_nChi2->get_value().at(idx);}
- const int& q() const {return collection->val_q->get_value().at(idx);}
- const unsigned int& nValid() const {return collection->val_nValid->get_value().at(idx);}
- const unsigned int& nInvalid() const {return collection->val_nInvalid->get_value().at(idx);}
- const unsigned int& nPixel() const {return collection->val_nPixel->get_value().at(idx);}
- const unsigned int& nStrip() const {return collection->val_nStrip->get_value().at(idx);}
- const unsigned int& nPixelLay() const {return collection->val_nPixelLay->get_value().at(idx);}
- const unsigned int& nStripLay() const {return collection->val_nStripLay->get_value().at(idx);}
- const unsigned int& n3DLay() const {return collection->val_n3DLay->get_value().at(idx);}
- const unsigned int& nOuterLost() const {return collection->val_nOuterLost->get_value().at(idx);}
- const unsigned int& nInnerLost() const {return collection->val_nInnerLost->get_value().at(idx);}
- const unsigned int& algo() const {return collection->val_algo->get_value().at(idx);}
- const unsigned int& originalAlgo() const {return collection->val_originalAlgo->get_value().at(idx);}
- const ULong64_t& algoMask() const {return collection->val_algoMask->get_value().at(idx);}
- const unsigned int& stopReason() const {return collection->val_stopReason->get_value().at(idx);}
- const short& isHP() const {return collection->val_isHP->get_value().at(idx);}
- const int& seedIdx() const {return collection->val_seedIdx->get_value().at(idx);}
- const float& vtxx() const {return collection->val_vtxx->get_value().at(idx);}
- const float& vtxy() const {return collection->val_vtxy->get_value().at(idx);}
- const float& vtxz() const {return collection->val_vtxz->get_value().at(idx);}
- const vector<float>& shareFrac() const {return collection->val_shareFrac->get_value().at(idx);}
- const vector<int>& simTrkIdx() const {return collection->val_simTrkIdx->get_value().at(idx);}
- const int& genIdx() const {return collection->val_genIdx->get_value().at(idx);}
- const float& genDR() const {return collection->val_genDR->get_value().at(idx);}
- };
- const Track TrackCollection::iter::operator*() const {
- return {collection, idx};
- }
- const Track TrackCollection::operator[](size_t idx) const {
- return {this, idx};
- }
- struct SimTrack;
- class SimTrackCollection {
- public:
- class iter {
- public:
- iter(const SimTrackCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- const SimTrack operator*() const;
- private:
- const SimTrackCollection* collection;
- size_t idx;
- };
- Value<vector<int>>* val_event;
- Value<vector<int>>* val_bunchCrossing;
- Value<vector<int>>* val_pdgId;
- Value<vector<float>>* val_px;
- Value<vector<float>>* val_py;
- Value<vector<float>>* val_pz;
- Value<vector<float>>* val_pt;
- Value<vector<float>>* val_eta;
- Value<vector<float>>* val_phi;
- Value<vector<float>>* val_pca_pt;
- Value<vector<float>>* val_pca_eta;
- Value<vector<float>>* val_pca_lambda;
- Value<vector<float>>* val_pca_cotTheta;
- Value<vector<float>>* val_pca_phi;
- Value<vector<float>>* val_pca_dxy;
- Value<vector<float>>* val_pca_dz;
- Value<vector<int>>* val_q;
- Value<vector<unsigned int>>* val_nValid;
- Value<vector<unsigned int>>* val_nPixel;
- Value<vector<unsigned int>>* val_nStrip;
- Value<vector<unsigned int>>* val_nLay;
- Value<vector<unsigned int>>* val_nPixelLay;
- Value<vector<unsigned int>>* val_n3DLay;
- Value<vector<vector<int>>>* val_trkIdx;
- Value<vector<vector<float>>>* val_shareFrac;
- Value<vector<int>>* val_parentVtxIdx;
- Value<vector<vector<int>>>* val_decayVtxIdx;
- Value<vector<vector<int>>>* val_seedIdx;
- SimTrackCollection() { }
- void init(TrackingDataSet& tds){
- val_event = tds.track_branch_obj<vector<int>>("sim_event");
- val_bunchCrossing = tds.track_branch_obj<vector<int>>("sim_bunchCrossing");
- val_pdgId = tds.track_branch_obj<vector<int>>("sim_pdgId");
- val_px = tds.track_branch_obj<vector<float>>("sim_px");
- val_py = tds.track_branch_obj<vector<float>>("sim_py");
- val_pz = tds.track_branch_obj<vector<float>>("sim_pz");
- val_pt = tds.track_branch_obj<vector<float>>("sim_pt");
- val_eta = tds.track_branch_obj<vector<float>>("sim_eta");
- val_phi = tds.track_branch_obj<vector<float>>("sim_phi");
- val_pca_pt = tds.track_branch_obj<vector<float>>("sim_pca_pt");
- val_pca_eta = tds.track_branch_obj<vector<float>>("sim_pca_eta");
- val_pca_lambda = tds.track_branch_obj<vector<float>>("sim_pca_lambda");
- val_pca_cotTheta = tds.track_branch_obj<vector<float>>("sim_pca_cotTheta");
- val_pca_phi = tds.track_branch_obj<vector<float>>("sim_pca_phi");
- val_pca_dxy = tds.track_branch_obj<vector<float>>("sim_pca_dxy");
- val_pca_dz = tds.track_branch_obj<vector<float>>("sim_pca_dz");
- val_q = tds.track_branch_obj<vector<int>>("sim_q");
- val_nValid = tds.track_branch_obj<vector<unsigned int>>("sim_nValid");
- val_nPixel = tds.track_branch_obj<vector<unsigned int>>("sim_nPixel");
- val_nStrip = tds.track_branch_obj<vector<unsigned int>>("sim_nStrip");
- val_nLay = tds.track_branch_obj<vector<unsigned int>>("sim_nLay");
- val_nPixelLay = tds.track_branch_obj<vector<unsigned int>>("sim_nPixelLay");
- val_n3DLay = tds.track_branch_obj<vector<unsigned int>>("sim_n3DLay");
- val_trkIdx = tds.track_branch_obj<vector<vector<int>>>("sim_trkIdx");
- val_shareFrac = tds.track_branch_obj<vector<vector<float>>>("sim_shareFrac");
- val_parentVtxIdx = tds.track_branch_obj<vector<int>>("sim_parentVtxIdx");
- val_decayVtxIdx = tds.track_branch_obj<vector<vector<int>>>("sim_decayVtxIdx");
- val_seedIdx = tds.track_branch_obj<vector<vector<int>>>("sim_seedIdx");
- }
- size_t size() const { return val_event->get_value().size();}
- const SimTrack operator[](size_t) const;
- iter begin() const { return iter(this, 0); }
- iter end() const { return iter(this, size()); }
- };
- struct SimTrack {
- const SimTrackCollection* collection;
- const size_t idx;
- SimTrack(const SimTrackCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const int& event() const {return collection->val_event->get_value().at(idx);}
- const int& bunchCrossing() const {return collection->val_bunchCrossing->get_value().at(idx);}
- const int& pdgId() const {return collection->val_pdgId->get_value().at(idx);}
- const float& px() const {return collection->val_px->get_value().at(idx);}
- const float& py() const {return collection->val_py->get_value().at(idx);}
- const float& pz() const {return collection->val_pz->get_value().at(idx);}
- const float& pt() const {return collection->val_pt->get_value().at(idx);}
- const float& eta() const {return collection->val_eta->get_value().at(idx);}
- const float& phi() const {return collection->val_phi->get_value().at(idx);}
- const float& pca_pt() const {return collection->val_pca_pt->get_value().at(idx);}
- const float& pca_eta() const {return collection->val_pca_eta->get_value().at(idx);}
- const float& pca_lambda() const {return collection->val_pca_lambda->get_value().at(idx);}
- const float& pca_cotTheta() const {return collection->val_pca_cotTheta->get_value().at(idx);}
- const float& pca_phi() const {return collection->val_pca_phi->get_value().at(idx);}
- const float& pca_dxy() const {return collection->val_pca_dxy->get_value().at(idx);}
- const float& pca_dz() const {return collection->val_pca_dz->get_value().at(idx);}
- const int& q() const {return collection->val_q->get_value().at(idx);}
- const unsigned int& nValid() const {return collection->val_nValid->get_value().at(idx);}
- const unsigned int& nPixel() const {return collection->val_nPixel->get_value().at(idx);}
- const unsigned int& nStrip() const {return collection->val_nStrip->get_value().at(idx);}
- const unsigned int& nLay() const {return collection->val_nLay->get_value().at(idx);}
- const unsigned int& nPixelLay() const {return collection->val_nPixelLay->get_value().at(idx);}
- const unsigned int& n3DLay() const {return collection->val_n3DLay->get_value().at(idx);}
- const vector<int>& trkIdx() const {return collection->val_trkIdx->get_value().at(idx);}
- const vector<float>& shareFrac() const {return collection->val_shareFrac->get_value().at(idx);}
- const int& parentVtxIdx() const {return collection->val_parentVtxIdx->get_value().at(idx);}
- const vector<int>& decayVtxIdx() const {return collection->val_decayVtxIdx->get_value().at(idx);}
- const vector<int>& seedIdx() const {return collection->val_seedIdx->get_value().at(idx);}
- };
- const SimTrack SimTrackCollection::iter::operator*() const {
- return {collection, idx};
- }
- const SimTrack SimTrackCollection::operator[](size_t idx) const {
- return {this, idx};
- }
- struct SimVertex;
- class SimVertexCollection {
- public:
- class iter {
- public:
- iter(const SimVertexCollection* collection, size_t idx)
- :collection(collection), idx(idx) { }
- iter operator++() { ++idx; return *this; }
- bool operator!=(const iter & other) { return idx != other.idx; }
- const SimVertex operator*() const;
- private:
- const SimVertexCollection* collection;
- size_t idx;
- };
- Value<vector<int>>* val_event;
- Value<vector<int>>* val_bunchCrossing;
- Value<vector<unsigned int>>* val_processType;
- Value<vector<float>>* val_x;
- Value<vector<float>>* val_y;
- Value<vector<float>>* val_z;
- Value<vector<vector<int>>>* val_sourceSimIdx;
- Value<vector<vector<int>>>* val_daughterSimIdx;
- SimVertexCollection() { }
- void init(TrackingDataSet& tds){
- val_event = tds.track_branch_obj<vector<int>>("simvtx_event");
- val_bunchCrossing = tds.track_branch_obj<vector<int>>("simvtx_bunchCrossing");
- val_processType = tds.track_branch_obj<vector<unsigned int>>("simvtx_processType");
- val_x = tds.track_branch_obj<vector<float>>("simvtx_x");
- val_y = tds.track_branch_obj<vector<float>>("simvtx_y");
- val_z = tds.track_branch_obj<vector<float>>("simvtx_z");
- val_sourceSimIdx = tds.track_branch_obj<vector<vector<int>>>("simvtx_sourceSimIdx");
- val_daughterSimIdx = tds.track_branch_obj<vector<vector<int>>>("simvtx_daughterSimIdx");
- }
- size_t size() const { return val_event->get_value().size();}
- const SimVertex operator[](size_t) const;
- iter begin() const { return iter(this, 0); }
- iter end() const { return iter(this, size()); }
- };
- struct SimVertex {
- const SimVertexCollection* collection;
- const size_t idx;
- SimVertex(const SimVertexCollection* collection, const size_t idx)
- :collection(collection), idx(idx) { }
- const int& event() const {return collection->val_event->get_value().at(idx);}
- const int& bunchCrossing() const {return collection->val_bunchCrossing->get_value().at(idx);}
- const unsigned int& processType() const {return collection->val_processType->get_value().at(idx);}
- const float& x() const {return collection->val_x->get_value().at(idx);}
- const float& y() const {return collection->val_y->get_value().at(idx);}
- const float& z() const {return collection->val_z->get_value().at(idx);}
- const vector<int>& sourceSimIdx() const {return collection->val_sourceSimIdx->get_value().at(idx);}
- const vector<int>& daughterSimIdx() const {return collection->val_daughterSimIdx->get_value().at(idx);}
- };
- const SimVertex SimVertexCollection::iter::operator*() const {
- return {collection, idx};
- }
- const SimVertex SimVertexCollection::operator[](size_t idx) const {
- return {this, idx};
- }
|