CMS 3D CMS Logo

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

Generated on Tue Jun 9 17:31:02 2009 for CMSSW by  doxygen 1.5.4