CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/DataFormats/HLTReco/interface/TriggerRefsCollections.h

Go to the documentation of this file.
00001 #ifndef HLTReco_TriggerRefsCollections_h
00002 #define HLTReco_TriggerRefsCollections_h
00003 
00022 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00023 
00024 #include "DataFormats/Common/interface/Ref.h"
00025 #include "DataFormats/Common/interface/RefProd.h"
00026 
00027 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h"
00028 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
00029 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
00030 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00031 #include "DataFormats/Candidate/interface/CompositeCandidateFwd.h"
00032 #include "DataFormats/METReco/interface/METFwd.h"
00033 #include "DataFormats/METReco/interface/CaloMETFwd.h"
00034 #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h"
00035 
00036 #include "DataFormats/L1Trigger/interface/L1HFRingsFwd.h"
00037 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
00038 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
00039 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
00040 #include "DataFormats/L1Trigger/interface/L1EtMissParticleFwd.h"
00041 
00042 #include "DataFormats/JetReco/interface/PFJetCollection.h"
00043 #include "DataFormats/TauReco/interface/PFTauFwd.h"
00044 
00045 #include <cassert>
00046 #include <vector>
00047 
00048 #include<typeinfo>
00049 
00050 namespace trigger
00051 {
00052 
00053   typedef std::vector<reco::RecoEcalCandidateRef>           VRphoton;
00054   typedef std::vector<reco::ElectronRef>                    VRelectron;
00055   typedef std::vector<reco::RecoChargedCandidateRef>        VRmuon;
00056   typedef std::vector<reco::CaloJetRef>                     VRjet;
00057   typedef std::vector<reco::CompositeCandidateRef>          VRcomposite;
00058   typedef std::vector<reco::METRef>                         VRbasemet;
00059   typedef std::vector<reco::CaloMETRef>                     VRcalomet;
00060   typedef std::vector<reco::IsolatedPixelTrackCandidateRef> VRpixtrack;
00061 
00062   typedef std::vector<l1extra::L1EmParticleRef>             VRl1em;
00063   typedef std::vector<l1extra::L1MuonParticleRef>           VRl1muon;
00064   typedef std::vector<l1extra::L1JetParticleRef>            VRl1jet;
00065   typedef std::vector<l1extra::L1EtMissParticleRef>         VRl1etmiss;
00066   typedef std::vector<l1extra::L1HFRingsRef>                VRl1hfrings;
00067 
00068   typedef std::vector<reco::PFJetRef>                       VRpfjet;
00069   typedef std::vector<reco::PFTauRef>                       VRpftau;
00070 
00071   class TriggerRefsCollections {
00072 
00074   private:
00076     Vids        photonIds_;
00077     VRphoton    photonRefs_;
00078     Vids        electronIds_;
00079     VRelectron  electronRefs_;
00080     Vids        muonIds_;
00081     VRmuon      muonRefs_;
00082     Vids        jetIds_;
00083     VRjet       jetRefs_;
00084     Vids        compositeIds_;
00085     VRcomposite compositeRefs_;
00086     Vids        basemetIds_;
00087     VRbasemet   basemetRefs_;
00088     Vids        calometIds_;
00089     VRcalomet   calometRefs_;
00090     Vids        pixtrackIds_;
00091     VRpixtrack  pixtrackRefs_;
00092 
00093     Vids        l1emIds_;
00094     VRl1em      l1emRefs_;
00095     Vids        l1muonIds_;
00096     VRl1muon    l1muonRefs_;
00097     Vids        l1jetIds_;
00098     VRl1jet     l1jetRefs_;
00099     Vids        l1etmissIds_;
00100     VRl1etmiss  l1etmissRefs_;
00101     Vids        l1hfringsIds_;
00102     VRl1hfrings l1hfringsRefs_;
00103 
00104     Vids        pfjetIds_;
00105     VRpfjet     pfjetRefs_;
00106     Vids        pftauIds_;
00107     VRpftau     pftauRefs_;
00108     
00110   public:
00112     TriggerRefsCollections() :
00113       photonIds_(), photonRefs_(),
00114       electronIds_(), electronRefs_(),
00115       muonIds_(), muonRefs_(),
00116       jetIds_(), jetRefs_(),
00117       compositeIds_(), compositeRefs_(),
00118       basemetIds_(), basemetRefs_(),
00119       calometIds_(), calometRefs_(),
00120       pixtrackIds_(), pixtrackRefs_(),
00121 
00122       l1emIds_(), l1emRefs_(),
00123       l1muonIds_(), l1muonRefs_(),
00124       l1jetIds_(), l1jetRefs_(),
00125       l1etmissIds_(), l1etmissRefs_(),
00126       l1hfringsIds_(), l1hfringsRefs_(),
00127 
00128       pfjetIds_(), pfjetRefs_(),
00129       pftauIds_(), pftauRefs_()
00130       { }
00131 
00133     void swap(TriggerRefsCollections & other) {
00134       std::swap(photonIds_,     other.photonIds_);
00135       std::swap(photonRefs_,    other.photonRefs_);
00136       std::swap(electronIds_,   other.electronIds_);
00137       std::swap(electronRefs_,  other.electronRefs_);
00138       std::swap(muonIds_,       other.muonIds_);
00139       std::swap(muonRefs_,      other.muonRefs_);
00140       std::swap(jetIds_,        other.jetIds_);
00141       std::swap(jetRefs_,       other.jetRefs_);
00142       std::swap(compositeIds_,  other.compositeIds_);
00143       std::swap(compositeRefs_, other.compositeRefs_);
00144       std::swap(basemetIds_,    other.basemetIds_);
00145       std::swap(basemetRefs_,   other.basemetRefs_);
00146       std::swap(calometIds_,    other.calometIds_);
00147       std::swap(calometRefs_,   other.calometRefs_);
00148       std::swap(pixtrackIds_,   other.pixtrackIds_);
00149       std::swap(pixtrackRefs_,  other.pixtrackRefs_);
00150 
00151       std::swap(l1emIds_,       other.l1emIds_);
00152       std::swap(l1emRefs_,      other.l1emRefs_);
00153       std::swap(l1muonIds_,     other.l1muonIds_);
00154       std::swap(l1muonRefs_,    other.l1muonRefs_);
00155       std::swap(l1jetIds_,      other.l1jetIds_);
00156       std::swap(l1jetRefs_,     other.l1jetRefs_);
00157       std::swap(l1etmissIds_,   other.l1etmissIds_);
00158       std::swap(l1etmissRefs_,  other.l1etmissRefs_);
00159       std::swap(l1hfringsIds_,  other.l1hfringsIds_);
00160       std::swap(l1hfringsRefs_, other.l1hfringsRefs_);
00161 
00162       std::swap(pfjetIds_,      other.pfjetIds_);
00163       std::swap(pfjetRefs_,     other.pfjetRefs_);
00164       std::swap(pftauIds_,      other.pftauIds_);
00165       std::swap(pftauRefs_,     other.pftauRefs_);
00166     }
00167 
00169     void addObject(int id, const reco::RecoEcalCandidateRef& ref) {
00170       photonIds_.push_back(id);
00171       photonRefs_.push_back(ref);
00172     }
00173     void addObject(int id, const reco::ElectronRef& ref) {
00174       electronIds_.push_back(id);
00175       electronRefs_.push_back(ref);
00176     }
00177     void addObject(int id, const reco::RecoChargedCandidateRef& ref) {
00178       muonIds_.push_back(id);
00179       muonRefs_.push_back(ref);
00180     }
00181     void addObject(int id, const reco::CaloJetRef& ref) {
00182       jetIds_.push_back(id);
00183       jetRefs_.push_back(ref);
00184     }
00185     void addObject(int id, const reco::CompositeCandidateRef& ref) {
00186       compositeIds_.push_back(id);
00187       compositeRefs_.push_back(ref);
00188     }
00189     void addObject(int id, const reco::METRef& ref) {
00190       basemetIds_.push_back(id);
00191       basemetRefs_.push_back(ref);
00192     }
00193     void addObject(int id, const reco::CaloMETRef& ref) {
00194       calometIds_.push_back(id);
00195       calometRefs_.push_back(ref);
00196     }
00197     void addObject(int id, const reco::IsolatedPixelTrackCandidateRef& ref) {
00198       pixtrackIds_.push_back(id);
00199       pixtrackRefs_.push_back(ref);
00200     }
00201 
00202     void addObject(int id, const l1extra::L1EmParticleRef& ref) {
00203       l1emIds_.push_back(id);
00204       l1emRefs_.push_back(ref);
00205     }
00206     void addObject(int id, const l1extra::L1MuonParticleRef& ref) {
00207       l1muonIds_.push_back(id);
00208       l1muonRefs_.push_back(ref);
00209     }
00210     void addObject(int id, const l1extra::L1JetParticleRef& ref) {
00211       l1jetIds_.push_back(id);
00212       l1jetRefs_.push_back(ref);
00213     }
00214     void addObject(int id, const l1extra::L1EtMissParticleRef& ref) {
00215       l1etmissIds_.push_back(id);
00216       l1etmissRefs_.push_back(ref);
00217     }
00218     void addObject(int id, const l1extra::L1HFRingsRef& ref) {
00219       l1hfringsIds_.push_back(id);
00220       l1hfringsRefs_.push_back(ref);
00221     }
00222 
00223     void addObject(int id, const reco::PFJetRef& ref) {
00224       pfjetIds_.push_back(id);
00225       pfjetRefs_.push_back(ref);
00226     }
00227     void addObject(int id, const reco::PFTauRef& ref) {
00228       pftauIds_.push_back(id);
00229       pftauRefs_.push_back(ref);
00230     }
00231 
00233     size_type addObjects (const Vids& ids, const VRphoton& refs) {
00234       assert(ids.size()==refs.size());
00235       photonIds_.insert(photonIds_.end(),ids.begin(),ids.end());
00236       photonRefs_.insert(photonRefs_.end(),refs.begin(),refs.end());
00237       return photonIds_.size();
00238     }
00239     size_type addObjects (const Vids& ids, const VRelectron& refs) {
00240       assert(ids.size()==refs.size());
00241       electronIds_.insert(electronIds_.end(),ids.begin(),ids.end());
00242       electronRefs_.insert(electronRefs_.end(),refs.begin(),refs.end());
00243       return electronIds_.size();
00244     }
00245     size_type addObjects (const Vids& ids, const VRmuon& refs) {
00246       assert(ids.size()==refs.size());
00247       muonIds_.insert(muonIds_.end(),ids.begin(),ids.end());
00248       muonRefs_.insert(muonRefs_.end(),refs.begin(),refs.end());
00249       return muonIds_.size();
00250     }
00251     size_type addObjects (const Vids& ids, const VRjet& refs) {
00252       assert(ids.size()==refs.size());
00253       jetIds_.insert(jetIds_.end(),ids.begin(),ids.end());
00254       jetRefs_.insert(jetRefs_.end(),refs.begin(),refs.end());
00255       return jetIds_.size();
00256     }
00257     size_type addObjects (const Vids& ids, const VRcomposite& refs) {
00258       assert(ids.size()==refs.size());
00259       compositeIds_.insert(compositeIds_.end(),ids.begin(),ids.end());
00260       compositeRefs_.insert(compositeRefs_.end(),refs.begin(),refs.end());
00261       return compositeIds_.size();
00262     }
00263     size_type addObjects (const Vids& ids, const VRbasemet& refs) {
00264       assert(ids.size()==refs.size());
00265       basemetIds_.insert(basemetIds_.end(),ids.begin(),ids.end());
00266       basemetRefs_.insert(basemetRefs_.end(),refs.begin(),refs.end());
00267       return basemetIds_.size();
00268     }
00269     size_type addObjects (const Vids& ids, const VRcalomet& refs) {
00270       assert(ids.size()==refs.size());
00271       calometIds_.insert(calometIds_.end(),ids.begin(),ids.end());
00272       calometRefs_.insert(calometRefs_.end(),refs.begin(),refs.end());
00273       return calometIds_.size();
00274     }
00275     size_type addObjects (const Vids& ids, const VRpixtrack& refs) {
00276       assert(ids.size()==refs.size());
00277       pixtrackIds_.insert(pixtrackIds_.end(),ids.begin(),ids.end());
00278       pixtrackRefs_.insert(pixtrackRefs_.end(),refs.begin(),refs.end());
00279       return pixtrackIds_.size();
00280     }
00281 
00282     size_type addObjects (const Vids& ids, const VRl1em& refs) {
00283       assert(ids.size()==refs.size());
00284       l1emIds_.insert(l1emIds_.end(),ids.begin(),ids.end());
00285       l1emRefs_.insert(l1emRefs_.end(),refs.begin(),refs.end());
00286       return l1emIds_.size();
00287     }
00288     size_type addObjects (const Vids& ids, const VRl1muon& refs) {
00289       assert(ids.size()==refs.size());
00290       l1muonIds_.insert(l1muonIds_.end(),ids.begin(),ids.end());
00291       l1muonRefs_.insert(l1muonRefs_.end(),refs.begin(),refs.end());
00292       return l1muonIds_.size();
00293     }
00294     size_type addObjects (const Vids& ids, const VRl1jet& refs) {
00295       assert(ids.size()==refs.size());
00296       l1jetIds_.insert(l1jetIds_.end(),ids.begin(),ids.end());
00297       l1jetRefs_.insert(l1jetRefs_.end(),refs.begin(),refs.end());
00298       return l1jetIds_.size();
00299     }
00300     size_type addObjects (const Vids& ids, const VRl1etmiss& refs) {
00301       assert(ids.size()==refs.size());
00302       l1etmissIds_.insert(l1etmissIds_.end(),ids.begin(),ids.end());
00303       l1etmissRefs_.insert(l1etmissRefs_.end(),refs.begin(),refs.end());
00304       return l1etmissIds_.size();
00305     }
00306     size_type addObjects (const Vids& ids, const VRl1hfrings& refs) {
00307       assert(ids.size()==refs.size());
00308       l1hfringsIds_.insert(l1hfringsIds_.end(),ids.begin(),ids.end());
00309       l1hfringsRefs_.insert(l1hfringsRefs_.end(),refs.begin(),refs.end());
00310       return l1hfringsIds_.size();
00311     }
00312 
00313     size_type addObjects (const Vids& ids, const VRpfjet& refs) {
00314       assert(ids.size()==refs.size());
00315       pfjetIds_.insert(pfjetIds_.end(),ids.begin(),ids.end());
00316       pfjetRefs_.insert(pfjetRefs_.end(),refs.begin(),refs.end());
00317       return pfjetIds_.size();
00318     }
00319     size_type addObjects (const Vids& ids, const VRpftau& refs) {
00320       assert(ids.size()==refs.size());
00321       pftauIds_.insert(pftauIds_.end(),ids.begin(),ids.end());
00322       pftauRefs_.insert(pftauRefs_.end(),refs.begin(),refs.end());
00323       return pftauIds_.size();
00324     }
00325 
00327     void getObjects(Vids& ids, VRphoton& refs) const {
00328       getObjects(ids,refs,0,photonIds_.size());
00329     }
00330     void getObjects(Vids& ids, VRphoton& refs, size_type begin, size_type end) const {
00331       assert (begin<=end);
00332       assert (end<=photonIds_.size());
00333       const size_type n(end-begin);
00334       ids.resize(n);
00335       refs.resize(n);
00336       size_type j(0);
00337       for (size_type i=begin; i!=end; ++i) {
00338         ids[j]=photonIds_[i];
00339         refs[j]=photonRefs_[i];
00340         ++j;
00341       }
00342     }
00343     void getObjects(int id, VRphoton& refs) const {
00344       getObjects(id,refs,0,photonIds_.size());
00345     }
00346     void getObjects(int id, VRphoton& refs, size_type begin, size_type end) const {
00347       assert (begin<=end);
00348       assert (end<=photonIds_.size());
00349       size_type n(0);
00350       for (size_type i=begin; i!=end; ++i) {if (id==photonIds_[i]) {++n;}}
00351       refs.resize(n);
00352       size_type j(0);
00353       for (size_type i=begin; i!=end; ++i) {
00354         if (id==photonIds_[i]) {refs[j]=photonRefs_[i]; ++j;}
00355       }
00356       return;
00357     }
00358 
00359     void getObjects(Vids& ids, VRelectron& refs) const {
00360       getObjects(ids,refs,0,electronIds_.size());
00361     }
00362     void getObjects(Vids& ids, VRelectron& refs, size_type begin, size_type end) const {
00363       assert (begin<=end);
00364       assert (end<=electronIds_.size());
00365       const size_type n(end-begin);
00366       ids.resize(n);
00367       refs.resize(n);
00368       size_type j(0);
00369       for (size_type i=begin; i!=end; ++i) {
00370         ids[j]=electronIds_[i];
00371         refs[j]=electronRefs_[i];
00372         ++j;
00373       }
00374     }
00375     void getObjects(int id, VRelectron& refs) const {
00376       getObjects(id,refs,0,electronIds_.size());
00377     }
00378     void getObjects(int id, VRelectron& refs, size_type begin, size_type end) const {
00379       assert (begin<=end);
00380       assert (end<=electronIds_.size());
00381       size_type n(0);
00382       for (size_type i=begin; i!=end; ++i) {if (id==electronIds_[i]) {++n;}}
00383       refs.resize(n);
00384       size_type j(0);
00385       for (size_type i=begin; i!=end; ++i) {
00386         if (id==electronIds_[i]) {refs[j]=electronRefs_[i]; ++j;}
00387       }
00388       return;
00389     }
00390 
00391     void getObjects(Vids& ids, VRmuon& refs) const {
00392       getObjects(ids,refs,0,muonIds_.size());
00393     }
00394     void getObjects(Vids& ids, VRmuon& refs, size_type begin, size_type end) const {
00395       assert (begin<=end);
00396       assert (end<=muonIds_.size());
00397       const size_type n(end-begin);
00398       ids.resize(n);
00399       refs.resize(n);
00400       size_type j(0);
00401       for (size_type i=begin; i!=end; ++i) {
00402         ids[j]=muonIds_[i];
00403         refs[j]=muonRefs_[i];
00404         ++j;
00405       }
00406     }
00407     void getObjects(int id, VRmuon& refs) const {
00408       getObjects(id,refs,0,muonIds_.size());
00409     }
00410     void getObjects(int id, VRmuon& refs, size_type begin, size_type end) const {
00411       assert (begin<=end);
00412       assert (end<=muonIds_.size());
00413       size_type n(0);
00414       for (size_type i=begin; i!=end; ++i) {if (id==muonIds_[i]) {++n;}}
00415       refs.resize(n);
00416       size_type j(0);
00417       for (size_type i=begin; i!=end; ++i) {
00418         if (id==muonIds_[i]) {refs[j]=muonRefs_[i]; ++j;}
00419       }
00420       return;
00421     }
00422 
00423     void getObjects(Vids& ids, VRjet& refs) const {
00424       getObjects(ids,refs,0,jetIds_.size());
00425     }
00426     void getObjects(Vids& ids, VRjet& refs, size_type begin, size_type end) const {
00427       assert (begin<=end);
00428       assert (end<=jetIds_.size());
00429       const size_type n(end-begin);
00430       ids.resize(n);
00431       refs.resize(n);
00432       size_type j(0);
00433       for (size_type i=begin; i!=end; ++i) {
00434         ids[j]=jetIds_[i];
00435         refs[j]=jetRefs_[i];
00436         ++j;
00437       }
00438     }
00439     void getObjects(int id, VRjet& refs) const {
00440       getObjects(id,refs,0,jetIds_.size());
00441     }
00442     void getObjects(int id, VRjet& refs, size_type begin, size_type end) const {
00443       assert (begin<=end);
00444       assert (end<=jetIds_.size());
00445       size_type n(0);
00446       for (size_type i=begin; i!=end; ++i) {if (id==jetIds_[i]) {++n;}}
00447       refs.resize(n);
00448       size_type j(0);
00449       for (size_type i=begin; i!=end; ++i) {
00450         if (id==jetIds_[i]) {refs[j]=jetRefs_[i]; ++j;}
00451       }
00452       return;
00453     }
00454 
00455     void getObjects(Vids& ids, VRcomposite& refs) const {
00456       getObjects(ids,refs,0,compositeIds_.size());
00457     }
00458     void getObjects(Vids& ids, VRcomposite& refs, size_type begin, size_type end) const {
00459       assert (begin<=end);
00460       assert (end<=compositeIds_.size());
00461       const size_type n(end-begin);
00462       ids.resize(n);
00463       refs.resize(n);
00464       size_type j(0);
00465       for (size_type i=begin; i!=end; ++i) {
00466         ids[j]=compositeIds_[i];
00467         refs[j]=compositeRefs_[i];
00468         ++j;
00469       }
00470     }
00471     void getObjects(int id, VRcomposite& refs) const {
00472       getObjects(id,refs,0,compositeIds_.size());
00473     }
00474     void getObjects(int id, VRcomposite& refs, size_type begin, size_type end) const {
00475       assert (begin<=end);
00476       assert (end<=compositeIds_.size());
00477       size_type n(0);
00478       for (size_type i=begin; i!=end; ++i) {if (id==compositeIds_[i]) {++n;}}
00479       refs.resize(n);
00480       size_type j(0);
00481       for (size_type i=begin; i!=end; ++i) {
00482         if (id==compositeIds_[i]) {refs[j]=compositeRefs_[i]; ++j;}
00483       }
00484       return;
00485     }
00486 
00487     void getObjects(Vids& ids, VRbasemet& refs) const {
00488       getObjects(ids,refs,0,basemetIds_.size());
00489     }
00490     void getObjects(Vids& ids, VRbasemet& refs, size_type begin, size_type end) const {
00491       assert (begin<=end);
00492       assert (end<=basemetIds_.size());
00493       const size_type n(end-begin);
00494       ids.resize(n);
00495       refs.resize(n);
00496       size_type j(0);
00497       for (size_type i=begin; i!=end; ++i) {
00498         ids[j]=basemetIds_[i];
00499         refs[j]=basemetRefs_[i];
00500         ++j;
00501       }
00502     }
00503     void getObjects(int id, VRbasemet& refs) const {
00504       getObjects(id,refs,0,basemetIds_.size());
00505     }
00506     void getObjects(int id, VRbasemet& refs, size_type begin, size_type end) const {
00507       assert (begin<=end);
00508       assert (end<=basemetIds_.size());
00509       size_type n(0);
00510       for (size_type i=begin; i!=end; ++i) {if (id==basemetIds_[i]) {++n;}}
00511       refs.resize(n);
00512       size_type j(0);
00513       for (size_type i=begin; i!=end; ++i) {
00514         if (id==basemetIds_[i]) {refs[j]=basemetRefs_[i]; ++j;}
00515       }
00516       return;
00517     }
00518 
00519     void getObjects(Vids& ids, VRcalomet& refs) const {
00520       getObjects(ids,refs,0,calometIds_.size());
00521     }
00522     void getObjects(Vids& ids, VRcalomet& refs, size_type begin, size_type end) const {
00523       assert (begin<=end);
00524       assert (end<=calometIds_.size());
00525       const size_type n(end-begin);
00526       ids.resize(n);
00527       refs.resize(n);
00528       size_type j(0);
00529       for (size_type i=begin; i!=end; ++i) {
00530         ids[j]=calometIds_[i];
00531         refs[j]=calometRefs_[i];
00532         ++j;
00533       }
00534     }
00535     void getObjects(int id, VRcalomet& refs) const {
00536       getObjects(id,refs,0,calometIds_.size());
00537     } 
00538     void getObjects(int id, VRcalomet& refs, size_type begin, size_type end) const {
00539       assert (begin<=end);
00540       assert (end<=calometIds_.size());
00541       size_type n(0);
00542       for (size_type i=begin; i!=end; ++i) {if (id==calometIds_[i]) {++n;}}
00543       refs.resize(n);
00544       size_type j(0);
00545       for (size_type i=begin; i!=end; ++i) {
00546         if (id==calometIds_[i]) {refs[j]=calometRefs_[i]; ++j;}
00547       }
00548       return;
00549     }
00550 
00551     void getObjects(Vids& ids, VRpixtrack& refs) const {
00552       getObjects(ids,refs,0,pixtrackIds_.size());
00553     }
00554     void getObjects(Vids& ids, VRpixtrack& refs, size_type begin, size_type end) const {
00555       assert (begin<=end);
00556       assert (end<=pixtrackIds_.size());
00557       const size_type n(end-begin);
00558       ids.resize(n);
00559       refs.resize(n);
00560       size_type j(0);
00561       for (size_type i=begin; i!=end; ++i) {
00562         ids[j]=pixtrackIds_[i];
00563         refs[j]=pixtrackRefs_[i];
00564         ++j;
00565       }
00566     }
00567     void getObjects(int id, VRpixtrack& refs) const {
00568       getObjects(id,refs,0,pixtrackIds_.size());
00569     } 
00570     void getObjects(int id, VRpixtrack& refs, size_type begin, size_type end) const {
00571       assert (begin<=end);
00572       assert (end<=pixtrackIds_.size());
00573       size_type n(0);
00574       for (size_type i=begin; i!=end; ++i) {if (id==pixtrackIds_[i]) {++n;}}
00575       refs.resize(n);
00576       size_type j(0);
00577       for (size_type i=begin; i!=end; ++i) {
00578         if (id==pixtrackIds_[i]) {refs[j]=pixtrackRefs_[i]; ++j;}
00579       }
00580       return;
00581     }
00582 
00583     void getObjects(Vids& ids, VRl1em& refs) const {
00584       getObjects(ids,refs,0,l1emIds_.size());
00585     }
00586     void getObjects(Vids& ids, VRl1em& refs, size_type begin, size_type end) const {
00587       assert (begin<=end);
00588       assert (end<=l1emIds_.size());
00589       const size_type n(end-begin);
00590       ids.resize(n);
00591       refs.resize(n);
00592       size_type j(0);
00593       for (size_type i=begin; i!=end; ++i) {
00594         ids[j]=l1emIds_[i];
00595         refs[j]=l1emRefs_[i];
00596         ++j;
00597       }
00598     }
00599     void getObjects(int id, VRl1em& refs) const {
00600       getObjects(id,refs,0,l1emIds_.size());
00601     } 
00602     void getObjects(int id, VRl1em& refs, size_type begin, size_type end) const {
00603       assert (begin<=end);
00604       assert (end<=l1emIds_.size());
00605       size_type n(0);
00606       for (size_type i=begin; i!=end; ++i) {if (id==l1emIds_[i]) {++n;}}
00607       refs.resize(n);
00608       size_type j(0);
00609       for (size_type i=begin; i!=end; ++i) {
00610         if (id==l1emIds_[i]) {refs[j]=l1emRefs_[i]; ++j;}
00611       }
00612       return;
00613     }
00614 
00615     void getObjects(Vids& ids, VRl1muon& refs) const {
00616       getObjects(ids,refs,0,l1muonIds_.size());
00617     }
00618     void getObjects(Vids& ids, VRl1muon& refs, size_type begin, size_type end) const {
00619       assert (begin<=end);
00620       assert (end<=l1muonIds_.size());
00621       const size_type n(end-begin);
00622       ids.resize(n);
00623       refs.resize(n);
00624       size_type j(0);
00625       for (size_type i=begin; i!=end; ++i) {
00626         ids[j]=l1muonIds_[i];
00627         refs[j]=l1muonRefs_[i];
00628         ++j;
00629       }
00630     }
00631     void getObjects(int id, VRl1muon& refs) const {
00632       getObjects(id,refs,0,l1muonIds_.size());
00633     } 
00634     void getObjects(int id, VRl1muon& refs, size_type begin, size_type end) const {
00635       assert (begin<=end);
00636       assert (end<=l1muonIds_.size());
00637       size_type n(0);
00638       for (size_type i=begin; i!=end; ++i) {if (id==l1muonIds_[i]) {++n;}}
00639       refs.resize(n);
00640       size_type j(0);
00641       for (size_type i=begin; i!=end; ++i) {
00642         if (id==l1muonIds_[i]) {refs[j]=l1muonRefs_[i]; ++j;}
00643       }
00644       return;
00645     }
00646 
00647     void getObjects(Vids& ids, VRl1jet& refs) const {
00648       getObjects(ids,refs,0,l1jetIds_.size());
00649     }
00650     void getObjects(Vids& ids, VRl1jet& refs, size_type begin, size_type end) const {
00651       assert (begin<=end);
00652       assert (end<=l1jetIds_.size());
00653       const size_type n(end-begin);
00654       ids.resize(n);
00655       refs.resize(n);
00656       size_type j(0);
00657       for (size_type i=begin; i!=end; ++i) {
00658         ids[j]=l1jetIds_[i];
00659         refs[j]=l1jetRefs_[i];
00660         ++j;
00661       }
00662     }
00663     void getObjects(int id, VRl1jet& refs) const {
00664       getObjects(id,refs,0,l1jetIds_.size());
00665     } 
00666     void getObjects(int id, VRl1jet& refs, size_type begin, size_type end) const {
00667       assert (begin<=end);
00668       assert (end<=l1jetIds_.size());
00669       size_type n(0);
00670       for (size_type i=begin; i!=end; ++i) {if (id==l1jetIds_[i]) {++n;}}
00671       refs.resize(n);
00672       size_type j(0);
00673       for (size_type i=begin; i!=end; ++i) {
00674         if (id==l1jetIds_[i]) {refs[j]=l1jetRefs_[i]; ++j;}
00675       }
00676       return;
00677     }
00678 
00679     void getObjects(Vids& ids, VRl1etmiss& refs) const {
00680       getObjects(ids,refs,0,l1etmissIds_.size());
00681     }
00682     void getObjects(Vids& ids, VRl1etmiss& refs, size_type begin, size_type end) const {
00683       assert (begin<=end);
00684       assert (end<=l1etmissIds_.size());
00685       const size_type n(end-begin);
00686       ids.resize(n);
00687       refs.resize(n);
00688       size_type j(0);
00689       for (size_type i=begin; i!=end; ++i) {
00690         ids[j]=l1etmissIds_[i];
00691         refs[j]=l1etmissRefs_[i];
00692         ++j;
00693       }
00694     }
00695     void getObjects(int id, VRl1etmiss& refs) const {
00696       getObjects(id,refs,0,l1etmissIds_.size());
00697     } 
00698     void getObjects(int id, VRl1etmiss& refs, size_type begin, size_type end) const {
00699       assert (begin<=end);
00700       assert (end<=l1etmissIds_.size());
00701       size_type n(0);
00702       for (size_type i=begin; i!=end; ++i) {if (id==l1etmissIds_[i]) {++n;}}
00703       refs.resize(n);
00704       size_type j(0);
00705       for (size_type i=begin; i!=end; ++i) {
00706         if (id==l1etmissIds_[i]) {refs[j]=l1etmissRefs_[i]; ++j;}
00707       }
00708       return;
00709     }
00710 
00711     void getObjects(Vids& ids, VRl1hfrings& refs) const {
00712       getObjects(ids,refs,0,l1hfringsIds_.size());
00713     }
00714     void getObjects(Vids& ids, VRl1hfrings& refs, size_type begin, size_type end) const {
00715       assert (begin<=end);
00716       assert (end<=l1hfringsIds_.size());
00717       const size_type n(end-begin);
00718       ids.resize(n);
00719       refs.resize(n);
00720       size_type j(0);
00721       for (size_type i=begin; i!=end; ++i) {
00722         ids[j]=l1hfringsIds_[i];
00723         refs[j]=l1hfringsRefs_[i];
00724         ++j;
00725       }
00726     }
00727     void getObjects(int id, VRl1hfrings& refs) const {
00728       getObjects(id,refs,0,l1hfringsIds_.size());
00729     } 
00730     void getObjects(int id, VRl1hfrings& refs, size_type begin, size_type end) const {
00731       assert (begin<=end);
00732       assert (end<=l1hfringsIds_.size());
00733       size_type n(0);
00734       for (size_type i=begin; i!=end; ++i) {if (id==l1hfringsIds_[i]) {++n;}}
00735       refs.resize(n);
00736       size_type j(0);
00737       for (size_type i=begin; i!=end; ++i) {
00738         if (id==l1hfringsIds_[i]) {refs[j]=l1hfringsRefs_[i]; ++j;}
00739       }
00740       return;
00741     }
00742 
00743     void getObjects(Vids& ids, VRpfjet& refs) const {
00744       getObjects(ids,refs,0,pfjetIds_.size());
00745     }
00746     void getObjects(Vids& ids, VRpfjet& refs, size_type begin, size_type end) const {
00747       assert (begin<=end);
00748       assert (end<=pfjetIds_.size());
00749       const size_type n(end-begin);
00750       ids.resize(n);
00751       refs.resize(n);
00752       size_type j(0);
00753       for (size_type i=begin; i!=end; ++i) {
00754         ids[j]=pfjetIds_[i];
00755         refs[j]=pfjetRefs_[i];
00756         ++j;
00757       }
00758     }
00759     void getObjects(int id, VRpfjet& refs) const {
00760       getObjects(id,refs,0,pfjetIds_.size());
00761     }
00762     void getObjects(int id, VRpfjet& refs, size_type begin, size_type end) const {
00763       assert (begin<=end);
00764       assert (end<=pfjetIds_.size());
00765       size_type n(0);
00766       for (size_type i=begin; i!=end; ++i) {if (id==pfjetIds_[i]) {++n;}}
00767       refs.resize(n);
00768       size_type j(0);
00769       for (size_type i=begin; i!=end; ++i) {
00770         if (id==pfjetIds_[i]) {refs[j]=pfjetRefs_[i]; ++j;}
00771       }
00772       return;
00773     }
00774 
00775     void getObjects(Vids& ids, VRpftau& refs) const {
00776       getObjects(ids,refs,0,pftauIds_.size());
00777     }
00778     void getObjects(Vids& ids, VRpftau& refs, size_type begin, size_type end) const {
00779       assert (begin<=end);
00780       assert (end<=pftauIds_.size());
00781       const size_type n(end-begin);
00782       ids.resize(n);
00783       refs.resize(n);
00784       size_type j(0);
00785       for (size_type i=begin; i!=end; ++i) {
00786         ids[j]=pftauIds_[i];
00787         refs[j]=pftauRefs_[i];
00788         ++j;
00789       }
00790     }
00791     void getObjects(int id, VRpftau& refs) const {
00792       getObjects(id,refs,0,pftauIds_.size());
00793     }
00794     void getObjects(int id, VRpftau& refs, size_type begin, size_type end) const {
00795       assert (begin<=end);
00796       assert (end<=pftauIds_.size());
00797       size_type n(0);
00798       for (size_type i=begin; i!=end; ++i) {if (id==pftauIds_[i]) {++n;}}
00799       refs.resize(n);
00800       size_type j(0);
00801       for (size_type i=begin; i!=end; ++i) {
00802         if (id==pftauIds_[i]) {refs[j]=pftauRefs_[i]; ++j;}
00803       }
00804       return;
00805     }
00806 
00808     size_type          photonSize()    const {return photonIds_.size();}
00809     const Vids&        photonIds()     const {return photonIds_;}
00810     const VRphoton&    photonRefs()    const {return photonRefs_;}
00811 
00812     size_type          electronSize()  const {return electronIds_.size();}
00813     const Vids&        electronIds()   const {return electronIds_;}
00814     const VRelectron&  electronRefs()  const {return electronRefs_;}
00815 
00816     size_type          muonSize()      const {return muonIds_.size();}
00817     const Vids&        muonIds()       const {return muonIds_;}
00818     const VRmuon&      muonRefs()      const {return muonRefs_;}
00819 
00820     size_type          jetSize()       const {return jetIds_.size();}
00821     const Vids&        jetIds()        const {return jetIds_;}
00822     const VRjet&       jetRefs()       const {return jetRefs_;}
00823 
00824     size_type          compositeSize() const {return compositeIds_.size();}
00825     const Vids&        compositeIds()  const {return compositeIds_;}
00826     const VRcomposite& compositeRefs() const {return compositeRefs_;}
00827 
00828     size_type          basemetSize()   const {return basemetIds_.size();}
00829     const Vids&        basemetIds()    const {return basemetIds_;}
00830     const VRbasemet&   basemetRefs()   const {return basemetRefs_;}
00831 
00832     size_type          calometSize()   const {return calometIds_.size();}
00833     const Vids&        calometIds()    const {return calometIds_;}
00834     const VRcalomet&   calometRefs()   const {return calometRefs_;}
00835 
00836     size_type          pixtrackSize()  const {return pixtrackIds_.size();}
00837     const Vids&        pixtrackIds()   const {return pixtrackIds_;}
00838     const VRpixtrack&  pixtrackRefs()  const {return pixtrackRefs_;}
00839 
00840     size_type          l1emSize()      const {return l1emIds_.size();}
00841     const Vids&        l1emIds()       const {return l1emIds_;}
00842     const VRl1em&      l1emRefs()      const {return l1emRefs_;}
00843 
00844     size_type          l1muonSize()    const {return l1muonIds_.size();}
00845     const Vids&        l1muonIds()     const {return l1muonIds_;}
00846     const VRl1muon&    l1muonRefs()    const {return l1muonRefs_;}
00847 
00848     size_type          l1jetSize()     const {return l1jetIds_.size();}
00849     const Vids&        l1jetIds()      const {return l1jetIds_;}
00850     const VRl1jet&     l1jetRefs()     const {return l1jetRefs_;}
00851 
00852     size_type          l1etmissSize()  const {return l1etmissIds_.size();}
00853     const Vids&        l1etmissIds()   const {return l1etmissIds_;}
00854     const VRl1etmiss&  l1etmissRefs()  const {return l1etmissRefs_;}
00855 
00856     size_type          l1hfringsSize() const {return l1hfringsIds_.size();}
00857     const Vids&        l1hfringsIds()  const {return l1hfringsIds_;}
00858     const VRl1hfrings& l1hfringsRefs() const {return l1hfringsRefs_;}
00859 
00860     size_type          pfjetSize()     const {return pfjetIds_.size();}
00861     const Vids&        pfjetIds()      const {return pfjetIds_;}
00862     const VRpfjet&     pfjetRefs()     const {return pfjetRefs_;}
00863 
00864     size_type          pftauSize()     const {return pftauIds_.size();}
00865     const Vids&        pftauIds()      const {return pftauIds_;}
00866     const VRpftau&     pftauRefs()     const {return pftauRefs_;}
00867 
00868   };
00869 
00870   // picked up via argument dependent lookup, e-g- by boost::swap()
00871   inline void swap(TriggerRefsCollections & first, TriggerRefsCollections & second) {
00872     first.swap(second);
00873   }
00874 
00875 }
00876 
00877 #endif