CMS 3D CMS Logo

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