Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-08-26 00:19:02

0001 #ifndef HLTReco_TriggerRefsCollections_h
0002 #define HLTReco_TriggerRefsCollections_h
0003 
0004 /** \class trigger::TriggerRefsCollections
0005  *
0006  *  Holds the collections of Ref<C>s which describe the physics
0007  *  objects passing trigger cuts.
0008  *
0009  *  This implementation is not completely space-efficient as some
0010  *  physics object containers may stay empty. However, the big
0011  *  advantage is that the solution is generic, i.e., works for all
0012  *  possible HLT filters. Hence we accept the reasonably small
0013  *  overhead of empty containers.
0014  *
0015  *
0016  *  \author Martin Grunewald
0017  *
0018  */
0019 
0020 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
0021 
0022 #include "DataFormats/Common/interface/Ref.h"
0023 #include "DataFormats/Common/interface/RefProd.h"
0024 
0025 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h"
0026 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
0027 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
0028 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0029 #include "DataFormats/Candidate/interface/CompositeCandidateFwd.h"
0030 #include "DataFormats/METReco/interface/METFwd.h"
0031 #include "DataFormats/METReco/interface/CaloMETFwd.h"
0032 #include "DataFormats/METReco/interface/PFMETFwd.h"
0033 #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h"
0034 
0035 #include "DataFormats/L1Trigger/interface/L1HFRingsFwd.h"         // deprecate
0036 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"      // deprecate
0037 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"     // deprecate
0038 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"    // deprecate
0039 #include "DataFormats/L1Trigger/interface/L1EtMissParticleFwd.h"  // deprecate
0040 
0041 #include "DataFormats/L1Trigger/interface/Muon.h"
0042 #include "DataFormats/L1Trigger/interface/MuonShower.h"
0043 #include "DataFormats/L1Trigger/interface/EGamma.h"
0044 #include "DataFormats/L1Trigger/interface/Jet.h"
0045 #include "DataFormats/L1Trigger/interface/Tau.h"
0046 #include "DataFormats/L1Trigger/interface/EtSum.h"
0047 #include "DataFormats/L1TMuonPhase2/interface/TrackerMuon.h"
0048 #include "DataFormats/L1TCorrelator/interface/TkElectron.h"
0049 #include "DataFormats/L1TCorrelator/interface/TkElectronFwd.h"
0050 #include "DataFormats/L1TCorrelator/interface/TkEm.h"
0051 #include "DataFormats/L1TCorrelator/interface/TkEmFwd.h"
0052 #include "DataFormats/L1TParticleFlow/interface/PFJet.h"
0053 #include "DataFormats/L1TParticleFlow/interface/PFTau.h"
0054 #include "DataFormats/L1TParticleFlow/interface/HPSPFTau.h"
0055 #include "DataFormats/L1TParticleFlow/interface/HPSPFTauFwd.h"
0056 
0057 #include "DataFormats/JetReco/interface/PFJetCollection.h"
0058 #include "DataFormats/TauReco/interface/PFTauFwd.h"
0059 
0060 #include <cassert>
0061 #include <vector>
0062 
0063 #include <typeinfo>
0064 
0065 namespace trigger {
0066 
0067   typedef std::vector<reco::RecoEcalCandidateRef> VRphoton;
0068   typedef std::vector<reco::ElectronRef> VRelectron;
0069   typedef std::vector<reco::RecoChargedCandidateRef> VRmuon;
0070   typedef std::vector<reco::CaloJetRef> VRjet;
0071   typedef std::vector<reco::CompositeCandidateRef> VRcomposite;
0072   typedef std::vector<reco::METRef> VRbasemet;
0073   typedef std::vector<reco::CaloMETRef> VRcalomet;
0074   typedef std::vector<reco::IsolatedPixelTrackCandidateRef> VRpixtrack;
0075 
0076   typedef std::vector<l1extra::L1EmParticleRef> VRl1em;          //deprecate
0077   typedef std::vector<l1extra::L1MuonParticleRef> VRl1muon;      //deprecate
0078   typedef std::vector<l1extra::L1JetParticleRef> VRl1jet;        //deprecate
0079   typedef std::vector<l1extra::L1EtMissParticleRef> VRl1etmiss;  //deprecate
0080   typedef std::vector<l1extra::L1HFRingsRef> VRl1hfrings;        //deprecate
0081 
0082   typedef l1t::MuonVectorRef VRl1tmuon;
0083   typedef l1t::MuonShowerVectorRef VRl1tmuonShower;
0084   typedef l1t::EGammaVectorRef VRl1tegamma;
0085   typedef l1t::JetVectorRef VRl1tjet;
0086   typedef l1t::TauVectorRef VRl1ttau;
0087   typedef l1t::EtSumVectorRef VRl1tetsum;
0088 
0089   /* Phase-2 */
0090   // This is a std::vector<TrackerMuonRef>,
0091   // and should be called TrackerMuonVectorRef upstream.
0092   // The L1T group should be made aware of that
0093   typedef l1t::TrackerMuonRefVector VRl1ttkmuon;
0094   typedef l1t::TkElectronVectorRef VRl1ttkele;
0095   typedef l1t::TkEmVectorRef VRl1ttkem;
0096   typedef l1t::PFJetVectorRef VRl1tpfjet;
0097   typedef l1t::HPSPFTauVectorRef VRl1thpspftau;
0098   typedef l1t::PFTauVectorRef VRl1tpftau;
0099   typedef l1t::PFTrackVectorRef VRl1tpftrack;
0100   typedef l1t::EtSumVectorP2Ref VRl1tp2etsum;
0101 
0102   typedef std::vector<reco::PFJetRef> VRpfjet;
0103   typedef std::vector<reco::PFTauRef> VRpftau;
0104   typedef std::vector<reco::PFMETRef> VRpfmet;
0105 
0106   class TriggerRefsCollections {
0107     /// data members
0108   private:
0109     /// physics type ids and Refs
0110     Vids photonIds_;
0111     VRphoton photonRefs_;
0112     Vids electronIds_;
0113     VRelectron electronRefs_;
0114     Vids muonIds_;
0115     VRmuon muonRefs_;
0116     Vids jetIds_;
0117     VRjet jetRefs_;
0118     Vids compositeIds_;
0119     VRcomposite compositeRefs_;
0120     Vids basemetIds_;
0121     VRbasemet basemetRefs_;
0122     Vids calometIds_;
0123     VRcalomet calometRefs_;
0124     Vids pixtrackIds_;
0125     VRpixtrack pixtrackRefs_;
0126 
0127     Vids l1emIds_;
0128     VRl1em l1emRefs_;
0129     Vids l1muonIds_;
0130     VRl1muon l1muonRefs_;
0131     Vids l1jetIds_;
0132     VRl1jet l1jetRefs_;
0133     Vids l1etmissIds_;
0134     VRl1etmiss l1etmissRefs_;
0135     Vids l1hfringsIds_;
0136     VRl1hfrings l1hfringsRefs_;
0137 
0138     Vids l1tmuonIds_;
0139     VRl1tmuon l1tmuonRefs_;
0140     Vids l1tmuonShowerIds_;
0141     VRl1tmuonShower l1tmuonShowerRefs_;
0142     Vids l1tegammaIds_;
0143     VRl1tegamma l1tegammaRefs_;
0144     Vids l1tjetIds_;
0145     VRl1tjet l1tjetRefs_;
0146     Vids l1ttauIds_;
0147     VRl1ttau l1ttauRefs_;
0148     Vids l1tetsumIds_;
0149     VRl1tetsum l1tetsumRefs_;
0150 
0151     /* Phase-2 */
0152     Vids l1ttkmuonIds_;
0153     VRl1ttkmuon l1ttkmuonRefs_;
0154     Vids l1ttkeleIds_;
0155     VRl1ttkele l1ttkeleRefs_;
0156     Vids l1ttkemIds_;
0157     VRl1ttkem l1ttkemRefs_;
0158     Vids l1tpfjetIds_;
0159     VRl1tpfjet l1tpfjetRefs_;
0160     Vids l1tpftauIds_;
0161     VRl1tpftau l1tpftauRefs_;
0162     Vids l1thpspftauIds_;
0163     VRl1thpspftau l1thpspftauRefs_;
0164     Vids l1tpftrackIds_;
0165     VRl1tpftrack l1tpftrackRefs_;
0166     Vids l1tp2etsumIds_;
0167     VRl1tp2etsum l1tp2etsumRefs_;
0168 
0169     Vids pfjetIds_;
0170     VRpfjet pfjetRefs_;
0171     Vids pftauIds_;
0172     VRpftau pftauRefs_;
0173     Vids pfmetIds_;
0174     VRpfmet pfmetRefs_;
0175 
0176     /// methods
0177   public:
0178     /// constructors
0179     TriggerRefsCollections()
0180         : photonIds_(),
0181           photonRefs_(),
0182           electronIds_(),
0183           electronRefs_(),
0184           muonIds_(),
0185           muonRefs_(),
0186           jetIds_(),
0187           jetRefs_(),
0188           compositeIds_(),
0189           compositeRefs_(),
0190           basemetIds_(),
0191           basemetRefs_(),
0192           calometIds_(),
0193           calometRefs_(),
0194           pixtrackIds_(),
0195           pixtrackRefs_(),
0196 
0197           l1emIds_(),
0198           l1emRefs_(),
0199           l1muonIds_(),
0200           l1muonRefs_(),
0201           l1jetIds_(),
0202           l1jetRefs_(),
0203           l1etmissIds_(),
0204           l1etmissRefs_(),
0205           l1hfringsIds_(),
0206           l1hfringsRefs_(),
0207 
0208           l1tmuonIds_(),
0209           l1tmuonRefs_(),
0210           l1tmuonShowerIds_(),
0211           l1tmuonShowerRefs_(),
0212           l1tegammaIds_(),
0213           l1tegammaRefs_(),
0214           l1tjetIds_(),
0215           l1tjetRefs_(),
0216           l1ttauIds_(),
0217           l1ttauRefs_(),
0218           l1tetsumIds_(),
0219           l1tetsumRefs_(),
0220 
0221           /* Phase-2 */
0222           l1ttkmuonIds_(),
0223           l1ttkmuonRefs_(),
0224           l1ttkeleIds_(),
0225           l1ttkeleRefs_(),
0226           l1ttkemIds_(),
0227           l1ttkemRefs_(),
0228           l1tpfjetIds_(),
0229           l1tpfjetRefs_(),
0230           l1tpftauIds_(),
0231           l1tpftauRefs_(),
0232           l1thpspftauIds_(),
0233           l1thpspftauRefs_(),
0234           l1tpftrackIds_(),
0235           l1tpftrackRefs_(),
0236           l1tp2etsumIds_(),
0237           l1tp2etsumRefs_(),
0238 
0239           pfjetIds_(),
0240           pfjetRefs_(),
0241           pftauIds_(),
0242           pftauRefs_(),
0243           pfmetIds_(),
0244           pfmetRefs_() {}
0245 
0246     /// utility
0247     void swap(TriggerRefsCollections& other) {
0248       std::swap(photonIds_, other.photonIds_);
0249       std::swap(photonRefs_, other.photonRefs_);
0250       std::swap(electronIds_, other.electronIds_);
0251       std::swap(electronRefs_, other.electronRefs_);
0252       std::swap(muonIds_, other.muonIds_);
0253       std::swap(muonRefs_, other.muonRefs_);
0254       std::swap(jetIds_, other.jetIds_);
0255       std::swap(jetRefs_, other.jetRefs_);
0256       std::swap(compositeIds_, other.compositeIds_);
0257       std::swap(compositeRefs_, other.compositeRefs_);
0258       std::swap(basemetIds_, other.basemetIds_);
0259       std::swap(basemetRefs_, other.basemetRefs_);
0260       std::swap(calometIds_, other.calometIds_);
0261       std::swap(calometRefs_, other.calometRefs_);
0262       std::swap(pixtrackIds_, other.pixtrackIds_);
0263       std::swap(pixtrackRefs_, other.pixtrackRefs_);
0264 
0265       std::swap(l1emIds_, other.l1emIds_);
0266       std::swap(l1emRefs_, other.l1emRefs_);
0267       std::swap(l1muonIds_, other.l1muonIds_);
0268       std::swap(l1muonRefs_, other.l1muonRefs_);
0269       std::swap(l1jetIds_, other.l1jetIds_);
0270       std::swap(l1jetRefs_, other.l1jetRefs_);
0271       std::swap(l1etmissIds_, other.l1etmissIds_);
0272       std::swap(l1etmissRefs_, other.l1etmissRefs_);
0273       std::swap(l1hfringsIds_, other.l1hfringsIds_);
0274       std::swap(l1hfringsRefs_, other.l1hfringsRefs_);
0275 
0276       std::swap(l1tmuonIds_, other.l1tmuonIds_);
0277       std::swap(l1tmuonRefs_, other.l1tmuonRefs_);
0278       std::swap(l1tmuonShowerIds_, other.l1tmuonShowerIds_);
0279       std::swap(l1tmuonShowerRefs_, other.l1tmuonShowerRefs_);
0280       std::swap(l1tegammaIds_, other.l1tegammaIds_);
0281       std::swap(l1tegammaRefs_, other.l1tegammaRefs_);
0282       std::swap(l1tjetIds_, other.l1tjetIds_);
0283       std::swap(l1tjetRefs_, other.l1tjetRefs_);
0284       std::swap(l1ttauIds_, other.l1ttauIds_);
0285       std::swap(l1ttauRefs_, other.l1ttauRefs_);
0286       std::swap(l1tetsumIds_, other.l1tetsumIds_);
0287       std::swap(l1tetsumRefs_, other.l1tetsumRefs_);
0288 
0289       /* Phase-2 */
0290       std::swap(l1ttkmuonIds_, other.l1ttkmuonIds_);
0291       std::swap(l1ttkmuonRefs_, other.l1ttkmuonRefs_);
0292       std::swap(l1ttkeleIds_, other.l1ttkeleIds_);
0293       std::swap(l1ttkeleRefs_, other.l1ttkeleRefs_);
0294       std::swap(l1ttkemIds_, other.l1ttkemIds_);
0295       std::swap(l1ttkemRefs_, other.l1ttkemRefs_);
0296       std::swap(l1tpfjetIds_, other.l1tpfjetIds_);
0297       std::swap(l1tpfjetRefs_, other.l1tpfjetRefs_);
0298       std::swap(l1tpftauIds_, other.l1tpftauIds_);
0299       std::swap(l1tpftauRefs_, other.l1tpftauRefs_);
0300       std::swap(l1thpspftauIds_, other.l1thpspftauIds_);
0301       std::swap(l1thpspftauRefs_, other.l1thpspftauRefs_);
0302       std::swap(l1tpftrackIds_, other.l1tpftrackIds_);
0303       std::swap(l1tpftrackRefs_, other.l1tpftrackRefs_);
0304       std::swap(l1tp2etsumIds_, other.l1tp2etsumIds_);
0305       std::swap(l1tp2etsumRefs_, other.l1tp2etsumRefs_);
0306 
0307       std::swap(pfjetIds_, other.pfjetIds_);
0308       std::swap(pfjetRefs_, other.pfjetRefs_);
0309       std::swap(pftauIds_, other.pftauIds_);
0310       std::swap(pftauRefs_, other.pftauRefs_);
0311       std::swap(pfmetIds_, other.pfmetIds_);
0312       std::swap(pfmetRefs_, other.pfmetRefs_);
0313     }
0314 
0315     /// setters for L3 collections: (id=physics type, and Ref<C>)
0316     void addObject(int id, const reco::RecoEcalCandidateRef& ref) {
0317       photonIds_.push_back(id);
0318       photonRefs_.push_back(ref);
0319     }
0320     void addObject(int id, const reco::ElectronRef& ref) {
0321       electronIds_.push_back(id);
0322       electronRefs_.push_back(ref);
0323     }
0324     void addObject(int id, const reco::RecoChargedCandidateRef& ref) {
0325       muonIds_.push_back(id);
0326       muonRefs_.push_back(ref);
0327     }
0328     void addObject(int id, const reco::CaloJetRef& ref) {
0329       jetIds_.push_back(id);
0330       jetRefs_.push_back(ref);
0331     }
0332     void addObject(int id, const reco::CompositeCandidateRef& ref) {
0333       compositeIds_.push_back(id);
0334       compositeRefs_.push_back(ref);
0335     }
0336     void addObject(int id, const reco::METRef& ref) {
0337       basemetIds_.push_back(id);
0338       basemetRefs_.push_back(ref);
0339     }
0340     void addObject(int id, const reco::CaloMETRef& ref) {
0341       calometIds_.push_back(id);
0342       calometRefs_.push_back(ref);
0343     }
0344     void addObject(int id, const reco::IsolatedPixelTrackCandidateRef& ref) {
0345       pixtrackIds_.push_back(id);
0346       pixtrackRefs_.push_back(ref);
0347     }
0348 
0349     void addObject(int id, const l1extra::L1EmParticleRef& ref) {
0350       l1emIds_.push_back(id);
0351       l1emRefs_.push_back(ref);
0352     }
0353     void addObject(int id, const l1extra::L1MuonParticleRef& ref) {
0354       l1muonIds_.push_back(id);
0355       l1muonRefs_.push_back(ref);
0356     }
0357     void addObject(int id, const l1extra::L1JetParticleRef& ref) {
0358       l1jetIds_.push_back(id);
0359       l1jetRefs_.push_back(ref);
0360     }
0361     void addObject(int id, const l1extra::L1EtMissParticleRef& ref) {
0362       l1etmissIds_.push_back(id);
0363       l1etmissRefs_.push_back(ref);
0364     }
0365     void addObject(int id, const l1extra::L1HFRingsRef& ref) {
0366       l1hfringsIds_.push_back(id);
0367       l1hfringsRefs_.push_back(ref);
0368     }
0369     void addObject(int id, const l1t::MuonRef& ref) {
0370       l1tmuonIds_.push_back(id);
0371       l1tmuonRefs_.push_back(ref);
0372     }
0373     void addObject(int id, const l1t::MuonShowerRef& ref) {
0374       l1tmuonShowerIds_.push_back(id);
0375       l1tmuonShowerRefs_.push_back(ref);
0376     }
0377     void addObject(int id, const l1t::EGammaRef& ref) {
0378       l1tegammaIds_.push_back(id);
0379       l1tegammaRefs_.push_back(ref);
0380     }
0381     void addObject(int id, const l1t::JetRef& ref) {
0382       l1tjetIds_.push_back(id);
0383       l1tjetRefs_.push_back(ref);
0384     }
0385     void addObject(int id, const l1t::TauRef& ref) {
0386       l1ttauIds_.push_back(id);
0387       l1ttauRefs_.push_back(ref);
0388     }
0389     void addObject(int id, const l1t::EtSumRef& ref) {
0390       l1tetsumIds_.push_back(id);
0391       l1tetsumRefs_.push_back(ref);
0392     }
0393 
0394     /* Phase-2 */
0395     void addObject(int id, const l1t::TrackerMuonRef& ref) {
0396       l1ttkmuonIds_.push_back(id);
0397       l1ttkmuonRefs_.push_back(ref);
0398     }
0399     void addObject(int id, const l1t::TkElectronRef& ref) {
0400       l1ttkeleIds_.push_back(id);
0401       l1ttkeleRefs_.push_back(ref);
0402     }
0403     void addObject(int id, const l1t::TkEmRef& ref) {
0404       l1ttkemIds_.push_back(id);
0405       l1ttkemRefs_.push_back(ref);
0406     }
0407     void addObject(int id, const l1t::PFJetRef& ref) {
0408       l1tpfjetIds_.push_back(id);
0409       l1tpfjetRefs_.push_back(ref);
0410     }
0411     void addObject(int id, const l1t::PFTauRef& ref) {
0412       l1tpftauIds_.push_back(id);
0413       l1tpftauRefs_.push_back(ref);
0414     }
0415     void addObject(int id, const l1t::HPSPFTauRef& ref) {
0416       l1thpspftauIds_.push_back(id);
0417       l1thpspftauRefs_.push_back(ref);
0418     }
0419     void addObject(int id, const l1t::PFTrackRef& ref) {
0420       l1tpftrackIds_.push_back(id);
0421       l1tpftrackRefs_.push_back(ref);
0422     }
0423     void addObject(int id, const l1t::EtSumP2Ref& ref) {
0424       l1tp2etsumIds_.push_back(id);
0425       l1tp2etsumRefs_.push_back(ref);
0426     }
0427     void addObject(int id, const reco::PFJetRef& ref) {
0428       pfjetIds_.push_back(id);
0429       pfjetRefs_.push_back(ref);
0430     }
0431     void addObject(int id, const reco::PFTauRef& ref) {
0432       pftauIds_.push_back(id);
0433       pftauRefs_.push_back(ref);
0434     }
0435     void addObject(int id, const reco::PFMETRef& ref) {
0436       pfmetIds_.push_back(id);
0437       pfmetRefs_.push_back(ref);
0438     }
0439 
0440     ///
0441     size_type addObjects(const Vids& ids, const VRphoton& refs) {
0442       assert(ids.size() == refs.size());
0443       photonIds_.insert(photonIds_.end(), ids.begin(), ids.end());
0444       photonRefs_.insert(photonRefs_.end(), refs.begin(), refs.end());
0445       return photonIds_.size();
0446     }
0447     size_type addObjects(const Vids& ids, const VRelectron& refs) {
0448       assert(ids.size() == refs.size());
0449       electronIds_.insert(electronIds_.end(), ids.begin(), ids.end());
0450       electronRefs_.insert(electronRefs_.end(), refs.begin(), refs.end());
0451       return electronIds_.size();
0452     }
0453     size_type addObjects(const Vids& ids, const VRmuon& refs) {
0454       assert(ids.size() == refs.size());
0455       muonIds_.insert(muonIds_.end(), ids.begin(), ids.end());
0456       muonRefs_.insert(muonRefs_.end(), refs.begin(), refs.end());
0457       return muonIds_.size();
0458     }
0459     size_type addObjects(const Vids& ids, const VRjet& refs) {
0460       assert(ids.size() == refs.size());
0461       jetIds_.insert(jetIds_.end(), ids.begin(), ids.end());
0462       jetRefs_.insert(jetRefs_.end(), refs.begin(), refs.end());
0463       return jetIds_.size();
0464     }
0465     size_type addObjects(const Vids& ids, const VRcomposite& refs) {
0466       assert(ids.size() == refs.size());
0467       compositeIds_.insert(compositeIds_.end(), ids.begin(), ids.end());
0468       compositeRefs_.insert(compositeRefs_.end(), refs.begin(), refs.end());
0469       return compositeIds_.size();
0470     }
0471     size_type addObjects(const Vids& ids, const VRbasemet& refs) {
0472       assert(ids.size() == refs.size());
0473       basemetIds_.insert(basemetIds_.end(), ids.begin(), ids.end());
0474       basemetRefs_.insert(basemetRefs_.end(), refs.begin(), refs.end());
0475       return basemetIds_.size();
0476     }
0477     size_type addObjects(const Vids& ids, const VRcalomet& refs) {
0478       assert(ids.size() == refs.size());
0479       calometIds_.insert(calometIds_.end(), ids.begin(), ids.end());
0480       calometRefs_.insert(calometRefs_.end(), refs.begin(), refs.end());
0481       return calometIds_.size();
0482     }
0483     size_type addObjects(const Vids& ids, const VRpixtrack& refs) {
0484       assert(ids.size() == refs.size());
0485       pixtrackIds_.insert(pixtrackIds_.end(), ids.begin(), ids.end());
0486       pixtrackRefs_.insert(pixtrackRefs_.end(), refs.begin(), refs.end());
0487       return pixtrackIds_.size();
0488     }
0489 
0490     size_type addObjects(const Vids& ids, const VRl1em& refs) {
0491       assert(ids.size() == refs.size());
0492       l1emIds_.insert(l1emIds_.end(), ids.begin(), ids.end());
0493       l1emRefs_.insert(l1emRefs_.end(), refs.begin(), refs.end());
0494       return l1emIds_.size();
0495     }
0496     size_type addObjects(const Vids& ids, const VRl1muon& refs) {
0497       assert(ids.size() == refs.size());
0498       l1muonIds_.insert(l1muonIds_.end(), ids.begin(), ids.end());
0499       l1muonRefs_.insert(l1muonRefs_.end(), refs.begin(), refs.end());
0500       return l1muonIds_.size();
0501     }
0502     size_type addObjects(const Vids& ids, const VRl1jet& refs) {
0503       assert(ids.size() == refs.size());
0504       l1jetIds_.insert(l1jetIds_.end(), ids.begin(), ids.end());
0505       l1jetRefs_.insert(l1jetRefs_.end(), refs.begin(), refs.end());
0506       return l1jetIds_.size();
0507     }
0508     size_type addObjects(const Vids& ids, const VRl1etmiss& refs) {
0509       assert(ids.size() == refs.size());
0510       l1etmissIds_.insert(l1etmissIds_.end(), ids.begin(), ids.end());
0511       l1etmissRefs_.insert(l1etmissRefs_.end(), refs.begin(), refs.end());
0512       return l1etmissIds_.size();
0513     }
0514     size_type addObjects(const Vids& ids, const VRl1tmuon& refs) {
0515       assert(ids.size() == refs.size());
0516       l1tmuonIds_.insert(l1tmuonIds_.end(), ids.begin(), ids.end());
0517       l1tmuonRefs_.insert(l1tmuonRefs_.end(), refs.begin(), refs.end());
0518       return l1tmuonIds_.size();
0519     }
0520     size_type addObjects(const Vids& ids, const VRl1tmuonShower& refs) {
0521       assert(ids.size() == refs.size());
0522       l1tmuonShowerIds_.insert(l1tmuonShowerIds_.end(), ids.begin(), ids.end());
0523       l1tmuonShowerRefs_.insert(l1tmuonShowerRefs_.end(), refs.begin(), refs.end());
0524       return l1tmuonShowerIds_.size();
0525     }
0526     size_type addObjects(const Vids& ids, const VRl1tegamma& refs) {
0527       assert(ids.size() == refs.size());
0528       l1tegammaIds_.insert(l1tegammaIds_.end(), ids.begin(), ids.end());
0529       l1tegammaRefs_.insert(l1tegammaRefs_.end(), refs.begin(), refs.end());
0530       return l1tegammaIds_.size();
0531     }
0532     size_type addObjects(const Vids& ids, const VRl1tjet& refs) {
0533       assert(ids.size() == refs.size());
0534       l1tjetIds_.insert(l1tjetIds_.end(), ids.begin(), ids.end());
0535       l1tjetRefs_.insert(l1tjetRefs_.end(), refs.begin(), refs.end());
0536       return l1tjetIds_.size();
0537     }
0538     size_type addObjects(const Vids& ids, const VRl1ttau& refs) {
0539       assert(ids.size() == refs.size());
0540       l1ttauIds_.insert(l1ttauIds_.end(), ids.begin(), ids.end());
0541       l1ttauRefs_.insert(l1ttauRefs_.end(), refs.begin(), refs.end());
0542       return l1ttauIds_.size();
0543     }
0544     size_type addObjects(const Vids& ids, const VRl1tetsum& refs) {
0545       assert(ids.size() == refs.size());
0546       l1tetsumIds_.insert(l1tetsumIds_.end(), ids.begin(), ids.end());
0547       l1tetsumRefs_.insert(l1tetsumRefs_.end(), refs.begin(), refs.end());
0548       return l1tetsumIds_.size();
0549     }
0550     size_type addObjects(const Vids& ids, const VRl1hfrings& refs) {
0551       assert(ids.size() == refs.size());
0552       l1hfringsIds_.insert(l1hfringsIds_.end(), ids.begin(), ids.end());
0553       l1hfringsRefs_.insert(l1hfringsRefs_.end(), refs.begin(), refs.end());
0554       return l1hfringsIds_.size();
0555     }
0556 
0557     /* Phase-2 */
0558     size_type addObjects(const Vids& ids, const VRl1ttkmuon& refs) {
0559       assert(ids.size() == refs.size());
0560       l1ttkmuonIds_.insert(l1ttkmuonIds_.end(), ids.begin(), ids.end());
0561       l1ttkmuonRefs_.insert(l1ttkmuonRefs_.end(), refs.begin(), refs.end());
0562       return l1ttkmuonIds_.size();
0563     }
0564     size_type addObjects(const Vids& ids, const VRl1ttkele& refs) {
0565       assert(ids.size() == refs.size());
0566       l1ttkeleIds_.insert(l1ttkeleIds_.end(), ids.begin(), ids.end());
0567       l1ttkeleRefs_.insert(l1ttkeleRefs_.end(), refs.begin(), refs.end());
0568       return l1ttkeleIds_.size();
0569     }
0570     size_type addObjects(const Vids& ids, const VRl1ttkem& refs) {
0571       assert(ids.size() == refs.size());
0572       l1ttkemIds_.insert(l1ttkemIds_.end(), ids.begin(), ids.end());
0573       l1ttkemRefs_.insert(l1ttkemRefs_.end(), refs.begin(), refs.end());
0574       return l1ttkemIds_.size();
0575     }
0576     size_type addObjects(const Vids& ids, const VRl1tpfjet& refs) {
0577       assert(ids.size() == refs.size());
0578       l1tpfjetIds_.insert(l1tpfjetIds_.end(), ids.begin(), ids.end());
0579       l1tpfjetRefs_.insert(l1tpfjetRefs_.end(), refs.begin(), refs.end());
0580       return l1tpfjetIds_.size();
0581     }
0582     size_type addObjects(const Vids& ids, const VRl1tpftau& refs) {
0583       assert(ids.size() == refs.size());
0584       l1tpftauIds_.insert(l1tpftauIds_.end(), ids.begin(), ids.end());
0585       l1tpftauRefs_.insert(l1tpftauRefs_.end(), refs.begin(), refs.end());
0586       return l1tpftauIds_.size();
0587     }
0588     size_type addObjects(const Vids& ids, const VRl1thpspftau& refs) {
0589       assert(ids.size() == refs.size());
0590       l1thpspftauIds_.insert(l1thpspftauIds_.end(), ids.begin(), ids.end());
0591       l1thpspftauRefs_.insert(l1thpspftauRefs_.end(), refs.begin(), refs.end());
0592       return l1thpspftauIds_.size();
0593     }
0594     size_type addObjects(const Vids& ids, const VRl1tpftrack& refs) {
0595       assert(ids.size() == refs.size());
0596       l1tpftrackIds_.insert(l1tpftrackIds_.end(), ids.begin(), ids.end());
0597       l1tpftrackRefs_.insert(l1tpftrackRefs_.end(), refs.begin(), refs.end());
0598       return l1tpftrackIds_.size();
0599     }
0600     size_type addObjects(const Vids& ids, const VRl1tp2etsum& refs) {
0601       assert(ids.size() == refs.size());
0602       l1tp2etsumIds_.insert(l1tp2etsumIds_.end(), ids.begin(), ids.end());
0603       l1tp2etsumRefs_.insert(l1tp2etsumRefs_.end(), refs.begin(), refs.end());
0604       return l1tp2etsumIds_.size();
0605     }
0606 
0607     size_type addObjects(const Vids& ids, const VRpfjet& refs) {
0608       assert(ids.size() == refs.size());
0609       pfjetIds_.insert(pfjetIds_.end(), ids.begin(), ids.end());
0610       pfjetRefs_.insert(pfjetRefs_.end(), refs.begin(), refs.end());
0611       return pfjetIds_.size();
0612     }
0613     size_type addObjects(const Vids& ids, const VRpftau& refs) {
0614       assert(ids.size() == refs.size());
0615       pftauIds_.insert(pftauIds_.end(), ids.begin(), ids.end());
0616       pftauRefs_.insert(pftauRefs_.end(), refs.begin(), refs.end());
0617       return pftauIds_.size();
0618     }
0619     size_type addObjects(const Vids& ids, const VRpfmet& refs) {
0620       assert(ids.size() == refs.size());
0621       pfmetIds_.insert(pfmetIds_.end(), ids.begin(), ids.end());
0622       pfmetRefs_.insert(pfmetRefs_.end(), refs.begin(), refs.end());
0623       return pfmetIds_.size();
0624     }
0625 
0626     /// various physics-level getters:
0627     void getObjects(Vids& ids, VRphoton& refs) const { getObjects(ids, refs, 0, photonIds_.size()); }
0628     void getObjects(Vids& ids, VRphoton& refs, size_type begin, size_type end) const {
0629       assert(begin <= end);
0630       assert(end <= photonIds_.size());
0631       const size_type n(end - begin);
0632       ids.resize(n);
0633       refs.resize(n);
0634       size_type j(0);
0635       for (size_type i = begin; i != end; ++i) {
0636         ids[j] = photonIds_[i];
0637         refs[j] = photonRefs_[i];
0638         ++j;
0639       }
0640     }
0641     void getObjects(int id, VRphoton& refs) const { getObjects(id, refs, 0, photonIds_.size()); }
0642     void getObjects(int id, VRphoton& refs, size_type begin, size_type end) const {
0643       assert(begin <= end);
0644       assert(end <= photonIds_.size());
0645       size_type n(0);
0646       for (size_type i = begin; i != end; ++i) {
0647         if (id == photonIds_[i]) {
0648           ++n;
0649         }
0650       }
0651       refs.resize(n);
0652       size_type j(0);
0653       for (size_type i = begin; i != end; ++i) {
0654         if (id == photonIds_[i]) {
0655           refs[j] = photonRefs_[i];
0656           ++j;
0657         }
0658       }
0659       return;
0660     }
0661 
0662     void getObjects(Vids& ids, VRelectron& refs) const { getObjects(ids, refs, 0, electronIds_.size()); }
0663     void getObjects(Vids& ids, VRelectron& refs, size_type begin, size_type end) const {
0664       assert(begin <= end);
0665       assert(end <= electronIds_.size());
0666       const size_type n(end - begin);
0667       ids.resize(n);
0668       refs.resize(n);
0669       size_type j(0);
0670       for (size_type i = begin; i != end; ++i) {
0671         ids[j] = electronIds_[i];
0672         refs[j] = electronRefs_[i];
0673         ++j;
0674       }
0675     }
0676     void getObjects(int id, VRelectron& refs) const { getObjects(id, refs, 0, electronIds_.size()); }
0677     void getObjects(int id, VRelectron& refs, size_type begin, size_type end) const {
0678       assert(begin <= end);
0679       assert(end <= electronIds_.size());
0680       size_type n(0);
0681       for (size_type i = begin; i != end; ++i) {
0682         if (id == electronIds_[i]) {
0683           ++n;
0684         }
0685       }
0686       refs.resize(n);
0687       size_type j(0);
0688       for (size_type i = begin; i != end; ++i) {
0689         if (id == electronIds_[i]) {
0690           refs[j] = electronRefs_[i];
0691           ++j;
0692         }
0693       }
0694       return;
0695     }
0696 
0697     void getObjects(Vids& ids, VRmuon& refs) const { getObjects(ids, refs, 0, muonIds_.size()); }
0698     void getObjects(Vids& ids, VRmuon& refs, size_type begin, size_type end) const {
0699       assert(begin <= end);
0700       assert(end <= muonIds_.size());
0701       const size_type n(end - begin);
0702       ids.resize(n);
0703       refs.resize(n);
0704       size_type j(0);
0705       for (size_type i = begin; i != end; ++i) {
0706         ids[j] = muonIds_[i];
0707         refs[j] = muonRefs_[i];
0708         ++j;
0709       }
0710     }
0711     void getObjects(int id, VRmuon& refs) const { getObjects(id, refs, 0, muonIds_.size()); }
0712     void getObjects(int id, VRmuon& refs, size_type begin, size_type end) const {
0713       assert(begin <= end);
0714       assert(end <= muonIds_.size());
0715       size_type n(0);
0716       for (size_type i = begin; i != end; ++i) {
0717         if (id == muonIds_[i]) {
0718           ++n;
0719         }
0720       }
0721       refs.resize(n);
0722       size_type j(0);
0723       for (size_type i = begin; i != end; ++i) {
0724         if (id == muonIds_[i]) {
0725           refs[j] = muonRefs_[i];
0726           ++j;
0727         }
0728       }
0729       return;
0730     }
0731 
0732     void getObjects(Vids& ids, VRjet& refs) const { getObjects(ids, refs, 0, jetIds_.size()); }
0733     void getObjects(Vids& ids, VRjet& refs, size_type begin, size_type end) const {
0734       assert(begin <= end);
0735       assert(end <= jetIds_.size());
0736       const size_type n(end - begin);
0737       ids.resize(n);
0738       refs.resize(n);
0739       size_type j(0);
0740       for (size_type i = begin; i != end; ++i) {
0741         ids[j] = jetIds_[i];
0742         refs[j] = jetRefs_[i];
0743         ++j;
0744       }
0745     }
0746     void getObjects(int id, VRjet& refs) const { getObjects(id, refs, 0, jetIds_.size()); }
0747     void getObjects(int id, VRjet& refs, size_type begin, size_type end) const {
0748       assert(begin <= end);
0749       assert(end <= jetIds_.size());
0750       size_type n(0);
0751       for (size_type i = begin; i != end; ++i) {
0752         if (id == jetIds_[i]) {
0753           ++n;
0754         }
0755       }
0756       refs.resize(n);
0757       size_type j(0);
0758       for (size_type i = begin; i != end; ++i) {
0759         if (id == jetIds_[i]) {
0760           refs[j] = jetRefs_[i];
0761           ++j;
0762         }
0763       }
0764       return;
0765     }
0766 
0767     void getObjects(Vids& ids, VRcomposite& refs) const { getObjects(ids, refs, 0, compositeIds_.size()); }
0768     void getObjects(Vids& ids, VRcomposite& refs, size_type begin, size_type end) const {
0769       assert(begin <= end);
0770       assert(end <= compositeIds_.size());
0771       const size_type n(end - begin);
0772       ids.resize(n);
0773       refs.resize(n);
0774       size_type j(0);
0775       for (size_type i = begin; i != end; ++i) {
0776         ids[j] = compositeIds_[i];
0777         refs[j] = compositeRefs_[i];
0778         ++j;
0779       }
0780     }
0781     void getObjects(int id, VRcomposite& refs) const { getObjects(id, refs, 0, compositeIds_.size()); }
0782     void getObjects(int id, VRcomposite& refs, size_type begin, size_type end) const {
0783       assert(begin <= end);
0784       assert(end <= compositeIds_.size());
0785       size_type n(0);
0786       for (size_type i = begin; i != end; ++i) {
0787         if (id == compositeIds_[i]) {
0788           ++n;
0789         }
0790       }
0791       refs.resize(n);
0792       size_type j(0);
0793       for (size_type i = begin; i != end; ++i) {
0794         if (id == compositeIds_[i]) {
0795           refs[j] = compositeRefs_[i];
0796           ++j;
0797         }
0798       }
0799       return;
0800     }
0801 
0802     void getObjects(Vids& ids, VRbasemet& refs) const { getObjects(ids, refs, 0, basemetIds_.size()); }
0803     void getObjects(Vids& ids, VRbasemet& refs, size_type begin, size_type end) const {
0804       assert(begin <= end);
0805       assert(end <= basemetIds_.size());
0806       const size_type n(end - begin);
0807       ids.resize(n);
0808       refs.resize(n);
0809       size_type j(0);
0810       for (size_type i = begin; i != end; ++i) {
0811         ids[j] = basemetIds_[i];
0812         refs[j] = basemetRefs_[i];
0813         ++j;
0814       }
0815     }
0816     void getObjects(int id, VRbasemet& refs) const { getObjects(id, refs, 0, basemetIds_.size()); }
0817     void getObjects(int id, VRbasemet& refs, size_type begin, size_type end) const {
0818       assert(begin <= end);
0819       assert(end <= basemetIds_.size());
0820       size_type n(0);
0821       for (size_type i = begin; i != end; ++i) {
0822         if (id == basemetIds_[i]) {
0823           ++n;
0824         }
0825       }
0826       refs.resize(n);
0827       size_type j(0);
0828       for (size_type i = begin; i != end; ++i) {
0829         if (id == basemetIds_[i]) {
0830           refs[j] = basemetRefs_[i];
0831           ++j;
0832         }
0833       }
0834       return;
0835     }
0836 
0837     void getObjects(Vids& ids, VRcalomet& refs) const { getObjects(ids, refs, 0, calometIds_.size()); }
0838     void getObjects(Vids& ids, VRcalomet& refs, size_type begin, size_type end) const {
0839       assert(begin <= end);
0840       assert(end <= calometIds_.size());
0841       const size_type n(end - begin);
0842       ids.resize(n);
0843       refs.resize(n);
0844       size_type j(0);
0845       for (size_type i = begin; i != end; ++i) {
0846         ids[j] = calometIds_[i];
0847         refs[j] = calometRefs_[i];
0848         ++j;
0849       }
0850     }
0851     void getObjects(int id, VRcalomet& refs) const { getObjects(id, refs, 0, calometIds_.size()); }
0852     void getObjects(int id, VRcalomet& refs, size_type begin, size_type end) const {
0853       assert(begin <= end);
0854       assert(end <= calometIds_.size());
0855       size_type n(0);
0856       for (size_type i = begin; i != end; ++i) {
0857         if (id == calometIds_[i]) {
0858           ++n;
0859         }
0860       }
0861       refs.resize(n);
0862       size_type j(0);
0863       for (size_type i = begin; i != end; ++i) {
0864         if (id == calometIds_[i]) {
0865           refs[j] = calometRefs_[i];
0866           ++j;
0867         }
0868       }
0869       return;
0870     }
0871 
0872     void getObjects(Vids& ids, VRpixtrack& refs) const { getObjects(ids, refs, 0, pixtrackIds_.size()); }
0873     void getObjects(Vids& ids, VRpixtrack& refs, size_type begin, size_type end) const {
0874       assert(begin <= end);
0875       assert(end <= pixtrackIds_.size());
0876       const size_type n(end - begin);
0877       ids.resize(n);
0878       refs.resize(n);
0879       size_type j(0);
0880       for (size_type i = begin; i != end; ++i) {
0881         ids[j] = pixtrackIds_[i];
0882         refs[j] = pixtrackRefs_[i];
0883         ++j;
0884       }
0885     }
0886     void getObjects(int id, VRpixtrack& refs) const { getObjects(id, refs, 0, pixtrackIds_.size()); }
0887     void getObjects(int id, VRpixtrack& refs, size_type begin, size_type end) const {
0888       assert(begin <= end);
0889       assert(end <= pixtrackIds_.size());
0890       size_type n(0);
0891       for (size_type i = begin; i != end; ++i) {
0892         if (id == pixtrackIds_[i]) {
0893           ++n;
0894         }
0895       }
0896       refs.resize(n);
0897       size_type j(0);
0898       for (size_type i = begin; i != end; ++i) {
0899         if (id == pixtrackIds_[i]) {
0900           refs[j] = pixtrackRefs_[i];
0901           ++j;
0902         }
0903       }
0904       return;
0905     }
0906 
0907     void getObjects(Vids& ids, VRl1em& refs) const { getObjects(ids, refs, 0, l1emIds_.size()); }
0908     void getObjects(Vids& ids, VRl1em& refs, size_type begin, size_type end) const {
0909       assert(begin <= end);
0910       assert(end <= l1emIds_.size());
0911       const size_type n(end - begin);
0912       ids.resize(n);
0913       refs.resize(n);
0914       size_type j(0);
0915       for (size_type i = begin; i != end; ++i) {
0916         ids[j] = l1emIds_[i];
0917         refs[j] = l1emRefs_[i];
0918         ++j;
0919       }
0920     }
0921     void getObjects(int id, VRl1em& refs) const { getObjects(id, refs, 0, l1emIds_.size()); }
0922     void getObjects(int id, VRl1em& refs, size_type begin, size_type end) const {
0923       assert(begin <= end);
0924       assert(end <= l1emIds_.size());
0925       size_type n(0);
0926       for (size_type i = begin; i != end; ++i) {
0927         if (id == l1emIds_[i]) {
0928           ++n;
0929         }
0930       }
0931       refs.resize(n);
0932       size_type j(0);
0933       for (size_type i = begin; i != end; ++i) {
0934         if (id == l1emIds_[i]) {
0935           refs[j] = l1emRefs_[i];
0936           ++j;
0937         }
0938       }
0939       return;
0940     }
0941 
0942     void getObjects(Vids& ids, VRl1muon& refs) const { getObjects(ids, refs, 0, l1muonIds_.size()); }
0943     void getObjects(Vids& ids, VRl1muon& refs, size_type begin, size_type end) const {
0944       assert(begin <= end);
0945       assert(end <= l1muonIds_.size());
0946       const size_type n(end - begin);
0947       ids.resize(n);
0948       refs.resize(n);
0949       size_type j(0);
0950       for (size_type i = begin; i != end; ++i) {
0951         ids[j] = l1muonIds_[i];
0952         refs[j] = l1muonRefs_[i];
0953         ++j;
0954       }
0955     }
0956     void getObjects(int id, VRl1muon& refs) const { getObjects(id, refs, 0, l1muonIds_.size()); }
0957     void getObjects(int id, VRl1muon& refs, size_type begin, size_type end) const {
0958       assert(begin <= end);
0959       assert(end <= l1muonIds_.size());
0960       size_type n(0);
0961       for (size_type i = begin; i != end; ++i) {
0962         if (id == l1muonIds_[i]) {
0963           ++n;
0964         }
0965       }
0966       refs.resize(n);
0967       size_type j(0);
0968       for (size_type i = begin; i != end; ++i) {
0969         if (id == l1muonIds_[i]) {
0970           refs[j] = l1muonRefs_[i];
0971           ++j;
0972         }
0973       }
0974       return;
0975     }
0976 
0977     void getObjects(Vids& ids, VRl1jet& refs) const { getObjects(ids, refs, 0, l1jetIds_.size()); }
0978     void getObjects(Vids& ids, VRl1jet& refs, size_type begin, size_type end) const {
0979       assert(begin <= end);
0980       assert(end <= l1jetIds_.size());
0981       const size_type n(end - begin);
0982       ids.resize(n);
0983       refs.resize(n);
0984       size_type j(0);
0985       for (size_type i = begin; i != end; ++i) {
0986         ids[j] = l1jetIds_[i];
0987         refs[j] = l1jetRefs_[i];
0988         ++j;
0989       }
0990     }
0991     void getObjects(int id, VRl1jet& refs) const { getObjects(id, refs, 0, l1jetIds_.size()); }
0992     void getObjects(int id, VRl1jet& refs, size_type begin, size_type end) const {
0993       assert(begin <= end);
0994       assert(end <= l1jetIds_.size());
0995       size_type n(0);
0996       for (size_type i = begin; i != end; ++i) {
0997         if (id == l1jetIds_[i]) {
0998           ++n;
0999         }
1000       }
1001       refs.resize(n);
1002       size_type j(0);
1003       for (size_type i = begin; i != end; ++i) {
1004         if (id == l1jetIds_[i]) {
1005           refs[j] = l1jetRefs_[i];
1006           ++j;
1007         }
1008       }
1009       return;
1010     }
1011 
1012     void getObjects(Vids& ids, VRl1etmiss& refs) const { getObjects(ids, refs, 0, l1etmissIds_.size()); }
1013     void getObjects(Vids& ids, VRl1etmiss& refs, size_type begin, size_type end) const {
1014       assert(begin <= end);
1015       assert(end <= l1etmissIds_.size());
1016       const size_type n(end - begin);
1017       ids.resize(n);
1018       refs.resize(n);
1019       size_type j(0);
1020       for (size_type i = begin; i != end; ++i) {
1021         ids[j] = l1etmissIds_[i];
1022         refs[j] = l1etmissRefs_[i];
1023         ++j;
1024       }
1025     }
1026     void getObjects(int id, VRl1etmiss& refs) const { getObjects(id, refs, 0, l1etmissIds_.size()); }
1027     void getObjects(int id, VRl1etmiss& refs, size_type begin, size_type end) const {
1028       assert(begin <= end);
1029       assert(end <= l1etmissIds_.size());
1030       size_type n(0);
1031       for (size_type i = begin; i != end; ++i) {
1032         if (id == l1etmissIds_[i]) {
1033           ++n;
1034         }
1035       }
1036       refs.resize(n);
1037       size_type j(0);
1038       for (size_type i = begin; i != end; ++i) {
1039         if (id == l1etmissIds_[i]) {
1040           refs[j] = l1etmissRefs_[i];
1041           ++j;
1042         }
1043       }
1044       return;
1045     }
1046 
1047     void getObjects(Vids& ids, VRl1hfrings& refs) const { getObjects(ids, refs, 0, l1hfringsIds_.size()); }
1048     void getObjects(Vids& ids, VRl1hfrings& refs, size_type begin, size_type end) const {
1049       assert(begin <= end);
1050       assert(end <= l1hfringsIds_.size());
1051       const size_type n(end - begin);
1052       ids.resize(n);
1053       refs.resize(n);
1054       size_type j(0);
1055       for (size_type i = begin; i != end; ++i) {
1056         ids[j] = l1hfringsIds_[i];
1057         refs[j] = l1hfringsRefs_[i];
1058         ++j;
1059       }
1060     }
1061     void getObjects(int id, VRl1hfrings& refs) const { getObjects(id, refs, 0, l1hfringsIds_.size()); }
1062     void getObjects(int id, VRl1hfrings& refs, size_type begin, size_type end) const {
1063       assert(begin <= end);
1064       assert(end <= l1hfringsIds_.size());
1065       size_type n(0);
1066       for (size_type i = begin; i != end; ++i) {
1067         if (id == l1hfringsIds_[i]) {
1068           ++n;
1069         }
1070       }
1071       refs.resize(n);
1072       size_type j(0);
1073       for (size_type i = begin; i != end; ++i) {
1074         if (id == l1hfringsIds_[i]) {
1075           refs[j] = l1hfringsRefs_[i];
1076           ++j;
1077         }
1078       }
1079       return;
1080     }
1081 
1082     void getObjects(Vids& ids, VRl1tmuon& refs) const { getObjects(ids, refs, 0, l1tmuonIds_.size()); }
1083     void getObjects(Vids& ids, VRl1tmuon& refs, size_type begin, size_type end) const {
1084       assert(begin <= end);
1085       assert(end <= l1tmuonIds_.size());
1086       const size_type n(end - begin);
1087       ids.resize(n);
1088       refs.resize(n);
1089       size_type j(0);
1090       for (size_type i = begin; i != end; ++i) {
1091         ids[j] = l1tmuonIds_[i];
1092         refs[j] = l1tmuonRefs_[i];
1093         ++j;
1094       }
1095     }
1096     void getObjects(int id, VRl1tmuon& refs) const { getObjects(id, refs, 0, l1tmuonIds_.size()); }
1097     void getObjects(int id, VRl1tmuon& refs, size_type begin, size_type end) const {
1098       assert(begin <= end);
1099       assert(end <= l1tmuonIds_.size());
1100       size_type n(0);
1101       for (size_type i = begin; i != end; ++i) {
1102         if (id == l1tmuonIds_[i]) {
1103           ++n;
1104         }
1105       }
1106       refs.resize(n);
1107       size_type j(0);
1108       for (size_type i = begin; i != end; ++i) {
1109         if (id == l1tmuonIds_[i]) {
1110           refs[j] = l1tmuonRefs_[i];
1111           ++j;
1112         }
1113       }
1114       return;
1115     }
1116 
1117     void getObjects(Vids& ids, VRl1tmuonShower& refs) const { getObjects(ids, refs, 0, l1tmuonShowerIds_.size()); }
1118     void getObjects(Vids& ids, VRl1tmuonShower& refs, size_type begin, size_type end) const {
1119       assert(begin <= end);
1120       assert(end <= l1tmuonShowerIds_.size());
1121       const size_type n(end - begin);
1122       ids.resize(n);
1123       refs.resize(n);
1124       size_type j(0);
1125       for (size_type i = begin; i != end; ++i) {
1126         ids[j] = l1tmuonShowerIds_[i];
1127         refs[j] = l1tmuonShowerRefs_[i];
1128         ++j;
1129       }
1130     }
1131     void getObjects(int id, VRl1tmuonShower& refs) const { getObjects(id, refs, 0, l1tmuonShowerIds_.size()); }
1132     void getObjects(int id, VRl1tmuonShower& refs, size_type begin, size_type end) const {
1133       assert(begin <= end);
1134       assert(end <= l1tmuonShowerIds_.size());
1135       size_type n(0);
1136       for (size_type i = begin; i != end; ++i) {
1137         if (id == l1tmuonShowerIds_[i]) {
1138           ++n;
1139         }
1140       }
1141       refs.resize(n);
1142       size_type j(0);
1143       for (size_type i = begin; i != end; ++i) {
1144         if (id == l1tmuonShowerIds_[i]) {
1145           refs[j] = l1tmuonShowerRefs_[i];
1146           ++j;
1147         }
1148       }
1149       return;
1150     }
1151 
1152     void getObjects(Vids& ids, VRl1tegamma& refs) const { getObjects(ids, refs, 0, l1tegammaIds_.size()); }
1153     void getObjects(Vids& ids, VRl1tegamma& refs, size_type begin, size_type end) const {
1154       assert(begin <= end);
1155       assert(end <= l1tegammaIds_.size());
1156       const size_type n(end - begin);
1157       ids.resize(n);
1158       refs.resize(n);
1159       size_type j(0);
1160       for (size_type i = begin; i != end; ++i) {
1161         ids[j] = l1tegammaIds_[i];
1162         refs[j] = l1tegammaRefs_[i];
1163         ++j;
1164       }
1165     }
1166     void getObjects(int id, VRl1tegamma& refs) const { getObjects(id, refs, 0, l1tegammaIds_.size()); }
1167     void getObjects(int id, VRl1tegamma& refs, size_type begin, size_type end) const {
1168       assert(begin <= end);
1169       assert(end <= l1tegammaIds_.size());
1170       size_type n(0);
1171       for (size_type i = begin; i != end; ++i) {
1172         if (id == l1tegammaIds_[i]) {
1173           ++n;
1174         }
1175       }
1176       refs.resize(n);
1177       size_type j(0);
1178       for (size_type i = begin; i != end; ++i) {
1179         if (id == l1tegammaIds_[i]) {
1180           refs[j] = l1tegammaRefs_[i];
1181           ++j;
1182         }
1183       }
1184       return;
1185     }
1186 
1187     void getObjects(Vids& ids, VRl1tjet& refs) const { getObjects(ids, refs, 0, l1tjetIds_.size()); }
1188     void getObjects(Vids& ids, VRl1tjet& refs, size_type begin, size_type end) const {
1189       assert(begin <= end);
1190       assert(end <= l1tjetIds_.size());
1191       const size_type n(end - begin);
1192       ids.resize(n);
1193       refs.resize(n);
1194       size_type j(0);
1195       for (size_type i = begin; i != end; ++i) {
1196         ids[j] = l1tjetIds_[i];
1197         refs[j] = l1tjetRefs_[i];
1198         ++j;
1199       }
1200     }
1201     void getObjects(int id, VRl1tjet& refs) const { getObjects(id, refs, 0, l1tjetIds_.size()); }
1202     void getObjects(int id, VRl1tjet& refs, size_type begin, size_type end) const {
1203       assert(begin <= end);
1204       assert(end <= l1tjetIds_.size());
1205       size_type n(0);
1206       for (size_type i = begin; i != end; ++i) {
1207         if (id == l1tjetIds_[i]) {
1208           ++n;
1209         }
1210       }
1211       refs.resize(n);
1212       size_type j(0);
1213       for (size_type i = begin; i != end; ++i) {
1214         if (id == l1tjetIds_[i]) {
1215           refs[j] = l1tjetRefs_[i];
1216           ++j;
1217         }
1218       }
1219       return;
1220     }
1221 
1222     void getObjects(Vids& ids, VRl1ttau& refs) const { getObjects(ids, refs, 0, l1ttauIds_.size()); }
1223     void getObjects(Vids& ids, VRl1ttau& refs, size_type begin, size_type end) const {
1224       assert(begin <= end);
1225       assert(end <= l1ttauIds_.size());
1226       const size_type n(end - begin);
1227       ids.resize(n);
1228       refs.resize(n);
1229       size_type j(0);
1230       for (size_type i = begin; i != end; ++i) {
1231         ids[j] = l1ttauIds_[i];
1232         refs[j] = l1ttauRefs_[i];
1233         ++j;
1234       }
1235     }
1236     void getObjects(int id, VRl1ttau& refs) const { getObjects(id, refs, 0, l1ttauIds_.size()); }
1237     void getObjects(int id, VRl1ttau& refs, size_type begin, size_type end) const {
1238       assert(begin <= end);
1239       assert(end <= l1ttauIds_.size());
1240       size_type n(0);
1241       for (size_type i = begin; i != end; ++i) {
1242         if (id == l1ttauIds_[i]) {
1243           ++n;
1244         }
1245       }
1246       refs.resize(n);
1247       size_type j(0);
1248       for (size_type i = begin; i != end; ++i) {
1249         if (id == l1ttauIds_[i]) {
1250           refs[j] = l1ttauRefs_[i];
1251           ++j;
1252         }
1253       }
1254       return;
1255     }
1256 
1257     void getObjects(Vids& ids, VRl1tetsum& refs) const { getObjects(ids, refs, 0, l1tetsumIds_.size()); }
1258     void getObjects(Vids& ids, VRl1tetsum& refs, size_type begin, size_type end) const {
1259       assert(begin <= end);
1260       assert(end <= l1tetsumIds_.size());
1261       const size_type n(end - begin);
1262       ids.resize(n);
1263       refs.resize(n);
1264       size_type j(0);
1265       for (size_type i = begin; i != end; ++i) {
1266         ids[j] = l1tetsumIds_[i];
1267         refs[j] = l1tetsumRefs_[i];
1268         ++j;
1269       }
1270     }
1271     void getObjects(int id, VRl1tetsum& refs) const { getObjects(id, refs, 0, l1tetsumIds_.size()); }
1272     void getObjects(int id, VRl1tetsum& refs, size_type begin, size_type end) const {
1273       assert(begin <= end);
1274       assert(end <= l1tetsumIds_.size());
1275       size_type n(0);
1276       for (size_type i = begin; i != end; ++i) {
1277         if (id == l1tetsumIds_[i]) {
1278           ++n;
1279         }
1280       }
1281       refs.resize(n);
1282       size_type j(0);
1283       for (size_type i = begin; i != end; ++i) {
1284         if (id == l1tetsumIds_[i]) {
1285           refs[j] = l1tetsumRefs_[i];
1286           ++j;
1287         }
1288       }
1289       return;
1290     }
1291 
1292     /* Phase-2 */
1293     void getObjects(Vids& ids, VRl1ttkmuon& refs) const { getObjects(ids, refs, 0, l1ttkmuonIds_.size()); }
1294     void getObjects(Vids& ids, VRl1ttkmuon& refs, size_type begin, size_type end) const {
1295       assert(begin <= end);
1296       assert(end <= l1ttkmuonIds_.size());
1297       const size_type n(end - begin);
1298       ids.resize(n);
1299       refs.resize(n);
1300       size_type j(0);
1301       for (size_type i = begin; i != end; ++i) {
1302         ids[j] = l1ttkmuonIds_[i];
1303         refs[j] = l1ttkmuonRefs_[i];
1304         ++j;
1305       }
1306     }
1307     void getObjects(int id, VRl1ttkmuon& refs) const { getObjects(id, refs, 0, l1ttkmuonIds_.size()); }
1308     void getObjects(int id, VRl1ttkmuon& refs, size_type begin, size_type end) const {
1309       assert(begin <= end);
1310       assert(end <= l1ttkmuonIds_.size());
1311       size_type n(0);
1312       for (size_type i = begin; i != end; ++i) {
1313         if (id == l1ttkmuonIds_[i]) {
1314           ++n;
1315         }
1316       }
1317       refs.resize(n);
1318       size_type j(0);
1319       for (size_type i = begin; i != end; ++i) {
1320         if (id == l1ttkmuonIds_[i]) {
1321           refs[j] = l1ttkmuonRefs_[i];
1322           ++j;
1323         }
1324       }
1325       return;
1326     }
1327 
1328     void getObjects(Vids& ids, VRl1ttkele& refs) const { getObjects(ids, refs, 0, l1ttkeleIds_.size()); }
1329     void getObjects(Vids& ids, VRl1ttkele& refs, size_type begin, size_type end) const {
1330       assert(begin <= end);
1331       assert(end <= l1ttkeleIds_.size());
1332       const size_type n(end - begin);
1333       ids.resize(n);
1334       refs.resize(n);
1335       size_type j(0);
1336       for (size_type i = begin; i != end; ++i) {
1337         ids[j] = l1ttkeleIds_[i];
1338         refs[j] = l1ttkeleRefs_[i];
1339         ++j;
1340       }
1341     }
1342     void getObjects(int id, VRl1ttkele& refs) const { getObjects(id, refs, 0, l1ttkeleIds_.size()); }
1343     void getObjects(int id, VRl1ttkele& refs, size_type begin, size_type end) const {
1344       assert(begin <= end);
1345       assert(end <= l1ttkeleIds_.size());
1346       size_type n(0);
1347       for (size_type i = begin; i != end; ++i) {
1348         if (id == l1ttkeleIds_[i]) {
1349           ++n;
1350         }
1351       }
1352       refs.resize(n);
1353       size_type j(0);
1354       for (size_type i = begin; i != end; ++i) {
1355         if (id == l1ttkeleIds_[i]) {
1356           refs[j] = l1ttkeleRefs_[i];
1357           ++j;
1358         }
1359       }
1360       return;
1361     }
1362 
1363     void getObjects(Vids& ids, VRl1ttkem& refs) const { getObjects(ids, refs, 0, l1ttkemIds_.size()); }
1364     void getObjects(Vids& ids, VRl1ttkem& refs, size_type begin, size_type end) const {
1365       assert(begin <= end);
1366       assert(end <= l1ttkemIds_.size());
1367       const size_type n(end - begin);
1368       ids.resize(n);
1369       refs.resize(n);
1370       size_type j(0);
1371       for (size_type i = begin; i != end; ++i) {
1372         ids[j] = l1ttkemIds_[i];
1373         refs[j] = l1ttkemRefs_[i];
1374         ++j;
1375       }
1376     }
1377     void getObjects(int id, VRl1ttkem& refs) const { getObjects(id, refs, 0, l1ttkemIds_.size()); }
1378     void getObjects(int id, VRl1ttkem& refs, size_type begin, size_type end) const {
1379       assert(begin <= end);
1380       assert(end <= l1ttkemIds_.size());
1381       size_type n(0);
1382       for (size_type i = begin; i != end; ++i) {
1383         if (id == l1ttkemIds_[i]) {
1384           ++n;
1385         }
1386       }
1387       refs.resize(n);
1388       size_type j(0);
1389       for (size_type i = begin; i != end; ++i) {
1390         if (id == l1ttkemIds_[i]) {
1391           refs[j] = l1ttkemRefs_[i];
1392           ++j;
1393         }
1394       }
1395       return;
1396     }
1397 
1398     void getObjects(Vids& ids, VRl1tpfjet& refs) const { getObjects(ids, refs, 0, l1tpfjetIds_.size()); }
1399     void getObjects(Vids& ids, VRl1tpfjet& refs, size_type begin, size_type end) const {
1400       assert(begin <= end);
1401       assert(end <= l1tpfjetIds_.size());
1402       const size_type n(end - begin);
1403       ids.resize(n);
1404       refs.resize(n);
1405       size_type j(0);
1406       for (size_type i = begin; i != end; ++i) {
1407         ids[j] = l1tpfjetIds_[i];
1408         refs[j] = l1tpfjetRefs_[i];
1409         ++j;
1410       }
1411     }
1412     void getObjects(int id, VRl1tpfjet& refs) const { getObjects(id, refs, 0, l1tpfjetIds_.size()); }
1413     void getObjects(int id, VRl1tpfjet& refs, size_type begin, size_type end) const {
1414       assert(begin <= end);
1415       assert(end <= l1tpfjetIds_.size());
1416       size_type n(0);
1417       for (size_type i = begin; i != end; ++i) {
1418         if (id == l1tpfjetIds_[i]) {
1419           ++n;
1420         }
1421       }
1422       refs.resize(n);
1423       size_type j(0);
1424       for (size_type i = begin; i != end; ++i) {
1425         if (id == l1tpfjetIds_[i]) {
1426           refs[j] = l1tpfjetRefs_[i];
1427           ++j;
1428         }
1429       }
1430       return;
1431     }
1432 
1433     void getObjects(Vids& ids, VRl1tpftau& refs) const { getObjects(ids, refs, 0, l1tpftauIds_.size()); }
1434     void getObjects(Vids& ids, VRl1tpftau& refs, size_type begin, size_type end) const {
1435       assert(begin <= end);
1436       assert(end <= l1tpftauIds_.size());
1437       const size_type n(end - begin);
1438       ids.resize(n);
1439       refs.resize(n);
1440       size_type j(0);
1441       for (size_type i = begin; i != end; ++i) {
1442         ids[j] = l1tpftauIds_[i];
1443         refs[j] = l1tpftauRefs_[i];
1444         ++j;
1445       }
1446     }
1447     void getObjects(int id, VRl1tpftau& refs) const { getObjects(id, refs, 0, l1tpftauIds_.size()); }
1448     void getObjects(int id, VRl1tpftau& refs, size_type begin, size_type end) const {
1449       assert(begin <= end);
1450       assert(end <= l1tpftauIds_.size());
1451       size_type n(0);
1452       for (size_type i = begin; i != end; ++i) {
1453         if (id == l1tpftauIds_[i]) {
1454           ++n;
1455         }
1456       }
1457       refs.resize(n);
1458       size_type j(0);
1459       for (size_type i = begin; i != end; ++i) {
1460         if (id == l1tpftauIds_[i]) {
1461           refs[j] = l1tpftauRefs_[i];
1462           ++j;
1463         }
1464       }
1465       return;
1466     }
1467 
1468     void getObjects(Vids& ids, VRl1thpspftau& refs) const { getObjects(ids, refs, 0, l1thpspftauIds_.size()); }
1469     void getObjects(Vids& ids, VRl1thpspftau& refs, size_type begin, size_type end) const {
1470       assert(begin <= end);
1471       assert(end <= l1thpspftauIds_.size());
1472       const size_type n(end - begin);
1473       ids.resize(n);
1474       refs.resize(n);
1475       size_type j(0);
1476       for (size_type i = begin; i != end; ++i) {
1477         ids[j] = l1thpspftauIds_[i];
1478         refs[j] = l1thpspftauRefs_[i];
1479         ++j;
1480       }
1481     }
1482     void getObjects(int id, VRl1thpspftau& refs) const { getObjects(id, refs, 0, l1thpspftauIds_.size()); }
1483     void getObjects(int id, VRl1thpspftau& refs, size_type begin, size_type end) const {
1484       assert(begin <= end);
1485       assert(end <= l1thpspftauIds_.size());
1486       size_type n(0);
1487       for (size_type i = begin; i != end; ++i) {
1488         if (id == l1thpspftauIds_[i]) {
1489           ++n;
1490         }
1491       }
1492       refs.resize(n);
1493       size_type j(0);
1494       for (size_type i = begin; i != end; ++i) {
1495         if (id == l1thpspftauIds_[i]) {
1496           refs[j] = l1thpspftauRefs_[i];
1497           ++j;
1498         }
1499       }
1500       return;
1501     }
1502 
1503     void getObjects(Vids& ids, VRl1tpftrack& refs) const { getObjects(ids, refs, 0, l1tpftrackIds_.size()); }
1504     void getObjects(Vids& ids, VRl1tpftrack& refs, size_type begin, size_type end) const {
1505       assert(begin <= end);
1506       assert(end <= l1tpftrackIds_.size());
1507       const size_type n(end - begin);
1508       ids.resize(n);
1509       refs.resize(n);
1510       size_type j(0);
1511       for (size_type i = begin; i != end; ++i) {
1512         ids[j] = l1tpftrackIds_[i];
1513         refs[j] = l1tpftrackRefs_[i];
1514         ++j;
1515       }
1516     }
1517     void getObjects(int id, VRl1tpftrack& refs) const { getObjects(id, refs, 0, l1tpftrackIds_.size()); }
1518     void getObjects(int id, VRl1tpftrack& refs, size_type begin, size_type end) const {
1519       assert(begin <= end);
1520       assert(end <= l1tpftrackIds_.size());
1521       size_type n(0);
1522       for (size_type i = begin; i != end; ++i) {
1523         if (id == l1tpftrackIds_[i]) {
1524           ++n;
1525         }
1526       }
1527       refs.resize(n);
1528       size_type j(0);
1529       for (size_type i = begin; i != end; ++i) {
1530         if (id == l1tpftrackIds_[i]) {
1531           refs[j] = l1tpftrackRefs_[i];
1532           ++j;
1533         }
1534       }
1535       return;
1536     }
1537 
1538     void getObjects(Vids& ids, VRl1tp2etsum& refs) const { getObjects(ids, refs, 0, l1tp2etsumIds_.size()); }
1539     void getObjects(Vids& ids, VRl1tp2etsum& refs, size_type begin, size_type end) const {
1540       assert(begin <= end);
1541       assert(end <= l1tp2etsumIds_.size());
1542       const size_type n(end - begin);
1543       ids.resize(n);
1544       refs.resize(n);
1545       size_type j(0);
1546       for (size_type i = begin; i != end; ++i) {
1547         ids[j] = l1tp2etsumIds_[i];
1548         refs[j] = l1tp2etsumRefs_[i];
1549         ++j;
1550       }
1551     }
1552     void getObjects(int id, VRl1tp2etsum& refs) const { getObjects(id, refs, 0, l1tp2etsumIds_.size()); }
1553     void getObjects(int id, VRl1tp2etsum& refs, size_type begin, size_type end) const {
1554       assert(begin <= end);
1555       assert(end <= l1tp2etsumIds_.size());
1556       size_type n(0);
1557       for (size_type i = begin; i != end; ++i) {
1558         if (id == l1tp2etsumIds_[i]) {
1559           ++n;
1560         }
1561       }
1562       refs.resize(n);
1563       size_type j(0);
1564       for (size_type i = begin; i != end; ++i) {
1565         if (id == l1tp2etsumIds_[i]) {
1566           refs[j] = l1tp2etsumRefs_[i];
1567           ++j;
1568         }
1569       }
1570       return;
1571     }
1572 
1573     void getObjects(Vids& ids, VRpfjet& refs) const { getObjects(ids, refs, 0, pfjetIds_.size()); }
1574     void getObjects(Vids& ids, VRpfjet& refs, size_type begin, size_type end) const {
1575       assert(begin <= end);
1576       assert(end <= pfjetIds_.size());
1577       const size_type n(end - begin);
1578       ids.resize(n);
1579       refs.resize(n);
1580       size_type j(0);
1581       for (size_type i = begin; i != end; ++i) {
1582         ids[j] = pfjetIds_[i];
1583         refs[j] = pfjetRefs_[i];
1584         ++j;
1585       }
1586     }
1587     void getObjects(int id, VRpfjet& refs) const { getObjects(id, refs, 0, pfjetIds_.size()); }
1588     void getObjects(int id, VRpfjet& refs, size_type begin, size_type end) const {
1589       assert(begin <= end);
1590       assert(end <= pfjetIds_.size());
1591       size_type n(0);
1592       for (size_type i = begin; i != end; ++i) {
1593         if (id == pfjetIds_[i]) {
1594           ++n;
1595         }
1596       }
1597       refs.resize(n);
1598       size_type j(0);
1599       for (size_type i = begin; i != end; ++i) {
1600         if (id == pfjetIds_[i]) {
1601           refs[j] = pfjetRefs_[i];
1602           ++j;
1603         }
1604       }
1605       return;
1606     }
1607 
1608     void getObjects(Vids& ids, VRpftau& refs) const { getObjects(ids, refs, 0, pftauIds_.size()); }
1609     void getObjects(Vids& ids, VRpftau& refs, size_type begin, size_type end) const {
1610       assert(begin <= end);
1611       assert(end <= pftauIds_.size());
1612       const size_type n(end - begin);
1613       ids.resize(n);
1614       refs.resize(n);
1615       size_type j(0);
1616       for (size_type i = begin; i != end; ++i) {
1617         ids[j] = pftauIds_[i];
1618         refs[j] = pftauRefs_[i];
1619         ++j;
1620       }
1621     }
1622     void getObjects(int id, VRpftau& refs) const { getObjects(id, refs, 0, pftauIds_.size()); }
1623     void getObjects(int id, VRpftau& refs, size_type begin, size_type end) const {
1624       assert(begin <= end);
1625       assert(end <= pftauIds_.size());
1626       size_type n(0);
1627       for (size_type i = begin; i != end; ++i) {
1628         if (id == pftauIds_[i]) {
1629           ++n;
1630         }
1631       }
1632       refs.resize(n);
1633       size_type j(0);
1634       for (size_type i = begin; i != end; ++i) {
1635         if (id == pftauIds_[i]) {
1636           refs[j] = pftauRefs_[i];
1637           ++j;
1638         }
1639       }
1640       return;
1641     }
1642 
1643     void getObjects(Vids& ids, VRpfmet& refs) const { getObjects(ids, refs, 0, pfmetIds_.size()); }
1644     void getObjects(Vids& ids, VRpfmet& refs, size_type begin, size_type end) const {
1645       assert(begin <= end);
1646       assert(end <= pfmetIds_.size());
1647       const size_type n(end - begin);
1648       ids.resize(n);
1649       refs.resize(n);
1650       size_type j(0);
1651       for (size_type i = begin; i != end; ++i) {
1652         ids[j] = pfmetIds_[i];
1653         refs[j] = pfmetRefs_[i];
1654         ++j;
1655       }
1656     }
1657     void getObjects(int id, VRpfmet& refs) const { getObjects(id, refs, 0, pfmetIds_.size()); }
1658     void getObjects(int id, VRpfmet& refs, size_type begin, size_type end) const {
1659       assert(begin <= end);
1660       assert(end <= pfmetIds_.size());
1661       size_type n(0);
1662       for (size_type i = begin; i != end; ++i) {
1663         if (id == pfmetIds_[i]) {
1664           ++n;
1665         }
1666       }
1667       refs.resize(n);
1668       size_type j(0);
1669       for (size_type i = begin; i != end; ++i) {
1670         if (id == pfmetIds_[i]) {
1671           refs[j] = pfmetRefs_[i];
1672           ++j;
1673         }
1674       }
1675       return;
1676     }
1677 
1678     /// low-level getters for data members
1679     size_type photonSize() const { return photonIds_.size(); }
1680     const Vids& photonIds() const { return photonIds_; }
1681     const VRphoton& photonRefs() const { return photonRefs_; }
1682 
1683     size_type electronSize() const { return electronIds_.size(); }
1684     const Vids& electronIds() const { return electronIds_; }
1685     const VRelectron& electronRefs() const { return electronRefs_; }
1686 
1687     size_type muonSize() const { return muonIds_.size(); }
1688     const Vids& muonIds() const { return muonIds_; }
1689     const VRmuon& muonRefs() const { return muonRefs_; }
1690 
1691     size_type jetSize() const { return jetIds_.size(); }
1692     const Vids& jetIds() const { return jetIds_; }
1693     const VRjet& jetRefs() const { return jetRefs_; }
1694 
1695     size_type compositeSize() const { return compositeIds_.size(); }
1696     const Vids& compositeIds() const { return compositeIds_; }
1697     const VRcomposite& compositeRefs() const { return compositeRefs_; }
1698 
1699     size_type basemetSize() const { return basemetIds_.size(); }
1700     const Vids& basemetIds() const { return basemetIds_; }
1701     const VRbasemet& basemetRefs() const { return basemetRefs_; }
1702 
1703     size_type calometSize() const { return calometIds_.size(); }
1704     const Vids& calometIds() const { return calometIds_; }
1705     const VRcalomet& calometRefs() const { return calometRefs_; }
1706 
1707     size_type pixtrackSize() const { return pixtrackIds_.size(); }
1708     const Vids& pixtrackIds() const { return pixtrackIds_; }
1709     const VRpixtrack& pixtrackRefs() const { return pixtrackRefs_; }
1710 
1711     size_type l1emSize() const { return l1emIds_.size(); }
1712     const Vids& l1emIds() const { return l1emIds_; }
1713     const VRl1em& l1emRefs() const { return l1emRefs_; }
1714 
1715     size_type l1muonSize() const { return l1muonIds_.size(); }
1716     const Vids& l1muonIds() const { return l1muonIds_; }
1717     const VRl1muon& l1muonRefs() const { return l1muonRefs_; }
1718 
1719     size_type l1jetSize() const { return l1jetIds_.size(); }
1720     const Vids& l1jetIds() const { return l1jetIds_; }
1721     const VRl1jet& l1jetRefs() const { return l1jetRefs_; }
1722 
1723     size_type l1etmissSize() const { return l1etmissIds_.size(); }
1724     const Vids& l1etmissIds() const { return l1etmissIds_; }
1725     const VRl1etmiss& l1etmissRefs() const { return l1etmissRefs_; }
1726 
1727     size_type l1hfringsSize() const { return l1hfringsIds_.size(); }
1728     const Vids& l1hfringsIds() const { return l1hfringsIds_; }
1729     const VRl1hfrings& l1hfringsRefs() const { return l1hfringsRefs_; }
1730 
1731     size_type pfjetSize() const { return pfjetIds_.size(); }
1732     const Vids& pfjetIds() const { return pfjetIds_; }
1733     const VRpfjet& pfjetRefs() const { return pfjetRefs_; }
1734 
1735     size_type pftauSize() const { return pftauIds_.size(); }
1736     const Vids& pftauIds() const { return pftauIds_; }
1737     const VRpftau& pftauRefs() const { return pftauRefs_; }
1738 
1739     size_type pfmetSize() const { return pfmetIds_.size(); }
1740     const Vids& pfmetIds() const { return pfmetIds_; }
1741     const VRpfmet& pfmetRefs() const { return pfmetRefs_; }
1742 
1743     size_type l1tmuonSize() const { return l1tmuonIds_.size(); }
1744     const Vids& l1tmuonIds() const { return l1tmuonIds_; }
1745     const VRl1tmuon& l1tmuonRefs() const { return l1tmuonRefs_; }
1746 
1747     size_type l1tmuonShowerSize() const { return l1tmuonShowerIds_.size(); }
1748     const Vids& l1tmuonShowerIds() const { return l1tmuonShowerIds_; }
1749     const VRl1tmuonShower& l1tmuonShowerRefs() const { return l1tmuonShowerRefs_; }
1750 
1751     size_type l1tegammaSize() const { return l1tegammaIds_.size(); }
1752     const Vids& l1tegammaIds() const { return l1tegammaIds_; }
1753     const VRl1tegamma& l1tegammaRefs() const { return l1tegammaRefs_; }
1754 
1755     size_type l1tjetSize() const { return l1tjetIds_.size(); }
1756     const Vids& l1tjetIds() const { return l1tjetIds_; }
1757     const VRl1tjet& l1tjetRefs() const { return l1tjetRefs_; }
1758 
1759     /* Phase-2 */
1760 
1761     size_type l1ttkmuonSize() const { return l1ttkmuonIds_.size(); }
1762     const Vids& l1ttkmuonIds() const { return l1ttkmuonIds_; }
1763     const VRl1ttkmuon& l1ttkmuonRefs() const { return l1ttkmuonRefs_; }
1764 
1765     size_type l1ttkeleSize() const { return l1ttkeleIds_.size(); }
1766     const Vids& l1ttkeleIds() const { return l1ttkeleIds_; }
1767     const VRl1ttkele& l1ttkeleRefs() const { return l1ttkeleRefs_; }
1768 
1769     size_type l1ttkemSize() const { return l1ttkemIds_.size(); }
1770     const Vids& l1ttkemIds() const { return l1ttkemIds_; }
1771     const VRl1ttkem& l1ttkemRefs() const { return l1ttkemRefs_; }
1772 
1773     size_type l1tpfjetSize() const { return l1tpfjetIds_.size(); }
1774     const Vids& l1tpfjetIds() const { return l1tpfjetIds_; }
1775     const VRl1tpfjet& l1tpfjetRefs() const { return l1tpfjetRefs_; }
1776 
1777     size_type l1tpftauSize() const { return l1tpftauIds_.size(); }
1778     const Vids& l1tpftauIds() const { return l1tpftauIds_; }
1779     const VRl1tpftau& l1tpftauRefs() const { return l1tpftauRefs_; }
1780 
1781     size_type l1thpspftauSize() const { return l1thpspftauIds_.size(); }
1782     const Vids& l1thpspftauIds() const { return l1thpspftauIds_; }
1783     const VRl1thpspftau& l1thpspftauRefs() const { return l1thpspftauRefs_; }
1784 
1785     size_type l1tpftrackSize() const { return l1tpftrackIds_.size(); }
1786     const Vids& l1tpftrackIds() const { return l1tpftrackIds_; }
1787     const VRl1tpftrack& l1tpftrackRefs() const { return l1tpftrackRefs_; }
1788 
1789     size_type l1tp2etsumSize() const { return l1tp2etsumIds_.size(); }
1790     const Vids& l1tp2etsumIds() const { return l1tp2etsumIds_; }
1791     const VRl1tp2etsum& l1tp2etsumRefs() const { return l1tp2etsumRefs_; }
1792 
1793     size_type l1ttauSize() const { return l1ttauIds_.size(); }
1794     const Vids& l1ttauIds() const { return l1ttauIds_; }
1795     const VRl1ttau& l1ttauRefs() const { return l1ttauRefs_; }
1796 
1797     size_type l1tetsumSize() const { return l1tetsumIds_.size(); }
1798     const Vids& l1tetsumIds() const { return l1tetsumIds_; }
1799     const VRl1tetsum& l1tetsumRefs() const { return l1tetsumRefs_; }
1800   };
1801 
1802   // picked up via argument dependent lookup, e-g- by boost::swap()
1803   inline void swap(TriggerRefsCollections& first, TriggerRefsCollections& second) { first.swap(second); }
1804 
1805 }  // namespace trigger
1806 
1807 #endif