CMS 3D CMS Logo

pat::GenericParticle Class Reference

Analysis-level Generic Particle class (e.g. More...

#include <DataFormats/PatCandidates/interface/GenericParticle.h>

Inheritance diagram for pat::GenericParticle:

pat::PATObject< reco::RecoCandidate > reco::RecoCandidate reco::LeafCandidate reco::Candidate reco::Particle

List of all members.

Public Member Functions

float caloIso () const
 Return the sum of ecal and hcal isolation variable that were stored in this object when produced, or -1.0 if at least one is missing.
virtual CaloTowerRef caloTower () const
 reference to a CaloTower (might be transient ref if CaloTower is embedded) returns null ref if there is no calotower
virtual GenericParticleclone () const
 returns a clone of the Candidate object
virtual reco::TrackRef combinedMuon () const
 reference to a combined muon Track (might be transient ref if SuperCluster is embedded) returns null ref if there is no combined muon track
float ecalIso () const
 Return the ecal isolation variable that was stored in this object when produced, or -1.0 if there is none.
void ecalIsoDeposit (const IsoDeposit &dep)
const IsoDepositecalIsoDeposit () const
void embedCaloTower ()
 embeds the calotower instead of keeping a reference to it
void embedCombined ()
 embeds the combined track instead of keeping a reference to it
void embedGsfTrack ()
 embeds the gsf track instead of keeping a reference to it
void embedStandalone ()
 embeds the stand-alone track instead of keeping a reference to it
void embedSuperCluster ()
 embeds the supercluster instead of keeping a reference to it
void embedTrack ()
 embeds the master track instead of keeping a reference to it
void embedTracks ()
 embeds the other tracks instead of keeping references
 GenericParticle (const edm::Ptr< reco::Candidate > &aGenericParticleRef)
 constructor from ref to Candidate
 GenericParticle (const edm::RefToBase< reco::Candidate > &aGenericParticleRef)
 constructor from ref to Candidate
 GenericParticle (const reco::Candidate &aGenericParticle)
 constructor from Candidate
 GenericParticle ()
 default constructor
virtual reco::GsfTrackRef gsfTrack () const
 reference to a GsfTrack (might be transient ref if SuperCluster is embedded) returns null ref if there is no gsf track
float hcalIso () const
 Return the hcal isolation variable that was stored in this object when produced, or -1.0 if there is none.
void hcalIsoDeposit (const IsoDeposit &dep)
const IsoDeposithcalIsoDeposit () const
const IsoDepositisoDeposit (IsolationKeys key) const
 Returns the IsoDeposit associated with some key, or a null pointer if it is not available.
float isolation (IsolationKeys key) const
 Returns the isolation variable for a specifc key (or pseudo-key like CaloIso), or -1.0 if not available.
virtual size_t numberOfTracks () const
 number of multiple tracks (not including the master one)
virtual bool overlap (const Candidate &) const
 Checks for overlap with another candidate.
float quality ()
 returns a user defined quality value, if set by the user to some meaningful value
virtual void setCaloTower (const CaloTowerRef &ref, bool embed=false)
 sets calotower reference (or even embed it into the object)
virtual void setCombinedMuon (const reco::TrackRef &ref, bool embed=false)
 sets combined muon track reference (or even embed it into the object)
void setECalIso (float caloIso)
 Sets ecal isolation variable.
virtual void setGsfTrack (const reco::GsfTrackRef &ref, bool embed=false)
 sets gsf track reference (or even embed it into the object)
void setHCalIso (float caloIso)
 Sets hcal isolation variable.
void setIsoDeposit (IsolationKeys key, const IsoDeposit &dep)
 Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
void setIsolation (IsolationKeys key, float value)
 Sets the isolation variable for a specifc key.
void setQuality (float quality)
 sets a user defined quality value
virtual void setStandAloneMuon (const reco::TrackRef &ref, bool embed=false)
 sets stand-alone muon track reference (or even embed it into the object)
virtual void setSuperCluster (const reco::SuperClusterRef &ref, bool embed=false)
 sets supercluster reference (or even embed it into the object)
virtual void setTrack (const reco::TrackRef &ref, bool embed=false)
 sets master track reference (or even embed it into the object)
void setTrackIso (float trackIso)
 Sets tracker isolation variable.
virtual void setTracks (const reco::TrackRefVector &refs, bool embed=false)
 sets multiple track references (or even embed the tracks into the object - whatch out for disk size issues!)
void setUserIso (float value, uint8_t index=0)
 Sets user isolation variable index.
void setVertexAssociation (const pat::VertexAssociation &assoc)
 Set a single vertex association.
void setVertexAssociations (const std::vector< pat::VertexAssociation > &assocs)
 Set multiple vertex associations.
virtual reco::TrackRef standAloneMuon () const
 reference to a stand-alone muon Track (might be transient ref if SuperCluster is embedded) returns null ref if there is no stand-alone muon track
virtual reco::SuperClusterRef superCluster () const
 reference to a SuperCluster (might be transient ref if SuperCluster is embedded) returns null ref if there is no supercluster
virtual reco::TrackRef track (size_t idx) const
 reference to one of a set of multiple tracks (might be transient refs if Tracks are embedded) throws exception if idx >= numberOfTracks()
virtual reco::TrackRef track () const
 reference to a master track (might be transient refs if Tracks are embedded) returns null ref if there is no master track
void trackerIsoDeposit (const IsoDeposit &dep)
const IsoDeposittrackerIsoDeposit () const
float trackIso () const
 Return the tracker isolation variable that was stored in this object when produced, or -1.0 if there is none.
float userIso (uint8_t index=0) const
 Return the user defined isolation variable index that was stored in this object when produced, or -1.0 if there is none.
void userIsoDeposit (const IsoDeposit &dep, uint8_t index=0)
const IsoDeposituserIsoDeposit (uint8_t index=0) const
const pat::VertexAssociationvertexAssociation (size_t index=0) const
 Vertex association (or associations, if any). Return null pointer if none has been set.
const std::vector
< pat::VertexAssociation > & 
vertexAssociations () const
 Vertex associations. Can be empty if it was not enabled in the config file.
virtual ~GenericParticle ()
 destructor

Protected Types

typedef std::vector< std::pair
< IsolationKeys,
pat::IsoDeposit > > 
IsoDepositPairs

Protected Member Functions

void fillInFrom (const reco::Candidate &cand)

Protected Attributes

CaloTowerCollection caloTower_
CaloTowerRef caloTowerRef_
reco::TrackCollection combinedTrack_
reco::TrackRef combinedTrackRef_
reco::GsfTrackCollection gsfTrack_
reco::GsfTrackRef gsfTrackRef_
IsoDepositPairs isoDeposits_
std::vector< float > isolations_
float quality_
reco::TrackCollection standaloneTrack_
reco::TrackRef standaloneTrackRef_
reco::SuperClusterCollection superCluster_
reco::SuperClusterRef superClusterRef_
reco::TrackCollection track_
reco::TrackRef trackRef_
reco::TrackRefVector trackRefs_
reco::TrackCollection tracks_
std::vector
< pat::VertexAssociation
vtxAss_


Detailed Description

Analysis-level Generic Particle class (e.g.

for hadron or muon not fully reconstructed)

GenericParticle implements the analysis-level generic particle class within the 'pat' namespace.

Author:
Giovanni Petrucciani
Version:
Id
GenericParticle.h,v 1.5 2008/10/08 11:44:31 fronga Exp

Definition at line 42 of file GenericParticle.h.


Member Typedef Documentation

typedef std::vector<std::pair<IsolationKeys, pat::IsoDeposit> > pat::GenericParticle::IsoDepositPairs [protected]

Definition at line 249 of file GenericParticle.h.


Constructor & Destructor Documentation

GenericParticle::GenericParticle (  ) 

default constructor

Definition at line 12 of file GenericParticle.cc.

Referenced by clone().

00012                                  :
00013     PATObject<reco::RecoCandidate>()
00014 {
00015 }

pat::GenericParticle::GenericParticle ( const reco::Candidate aGenericParticle  ) 

constructor from Candidate

pat::GenericParticle::GenericParticle ( const edm::RefToBase< reco::Candidate > &  aGenericParticleRef  ) 

constructor from ref to Candidate

pat::GenericParticle::GenericParticle ( const edm::Ptr< reco::Candidate > &  aGenericParticleRef  ) 

constructor from ref to Candidate

GenericParticle::~GenericParticle (  )  [virtual]

destructor

Definition at line 45 of file GenericParticle.cc.

00045                                   {
00046 }


Member Function Documentation

float pat::GenericParticle::caloIso (  )  const [inline]

Return the sum of ecal and hcal isolation variable that were stored in this object when produced, or -1.0 if at least one is missing.

Definition at line 164 of file GenericParticle.h.

References pat::CaloIso, and isolation().

00164 { return isolation(CaloIso); }

virtual CaloTowerRef pat::GenericParticle::caloTower (  )  const [inline, virtual]

reference to a CaloTower (might be transient ref if CaloTower is embedded) returns null ref if there is no calotower

Reimplemented from reco::RecoCandidate.

Definition at line 90 of file GenericParticle.h.

References caloTower_, caloTowerRef_, and edm::SortedCollection< T, SORT >::empty().

00090 { return caloTower_.empty() ? caloTowerRef_ : CaloTowerRef(&caloTower_, 0); }

virtual GenericParticle* pat::GenericParticle::clone ( void   )  const [inline, virtual]

returns a clone of the Candidate object

Reimplemented from reco::LeafCandidate.

Definition at line 57 of file GenericParticle.h.

References GenericParticle().

00057 { return new GenericParticle(*this); }

virtual reco::TrackRef pat::GenericParticle::combinedMuon (  )  const [inline, virtual]

reference to a combined muon Track (might be transient ref if SuperCluster is embedded) returns null ref if there is no combined muon track

Reimplemented from reco::RecoCandidate.

Definition at line 84 of file GenericParticle.h.

References combinedTrack_, and combinedTrackRef_.

00084 { return (combinedTrack_.empty() ? combinedTrackRef_ : reco::TrackRef(&combinedTrack_, 0)); }

float pat::GenericParticle::ecalIso (  )  const [inline]

Return the ecal isolation variable that was stored in this object when produced, or -1.0 if there is none.

Definition at line 166 of file GenericParticle.h.

References pat::ECalIso, and isolation().

00166 { return isolation(ECalIso); }

void pat::GenericParticle::ecalIsoDeposit ( const IsoDeposit dep  )  [inline]

Definition at line 211 of file GenericParticle.h.

References pat::ECalIso, and setIsoDeposit().

00211 { setIsoDeposit(ECalIso, dep); }

const IsoDeposit* pat::GenericParticle::ecalIsoDeposit (  )  const [inline]

Definition at line 205 of file GenericParticle.h.

References pat::ECalIso, and isoDeposit().

00205 { return isoDeposit(ECalIso); }

void GenericParticle::embedCaloTower (  ) 

embeds the calotower instead of keeping a reference to it

Definition at line 138 of file GenericParticle.cc.

References caloTower_, caloTowerRef_, edm::SortedCollection< T, SORT >::empty(), edm::Ref< C, T, F >::isNonnull(), and edm::SortedCollection< T, SORT >::push_back().

Referenced by pat::PATGenericParticleProducer::produce(), and setCaloTower().

00138                                      { 
00139     if (!caloTower_.empty()) CaloTowerCollection().swap(caloTower_); 
00140     if (caloTowerRef_.isNonnull()) caloTower_.push_back(*caloTowerRef_); // import
00141     caloTowerRef_ = CaloTowerRef(); // clear, to save space (zeroes compress better)
00142 }

void GenericParticle::embedCombined (  ) 

embeds the combined track instead of keeping a reference to it

Definition at line 119 of file GenericParticle.cc.

References combinedTrack_, combinedTrackRef_, and edm::Ref< C, T, F >::isNonnull().

Referenced by pat::PATGenericParticleProducer::produce(), and setCombinedMuon().

00119                                     { 
00120     combinedTrack_.clear();
00121     if (combinedTrackRef_.isNonnull()) combinedTrack_.push_back(*combinedTrackRef_); // import
00122     combinedTrackRef_ = reco::TrackRef(); // clear, to save space (zeroes compress better)
00123 }

void GenericParticle::embedGsfTrack (  ) 

embeds the gsf track instead of keeping a reference to it

Definition at line 125 of file GenericParticle.cc.

References gsfTrack_, gsfTrackRef_, and edm::Ref< C, T, F >::isNonnull().

Referenced by pat::PATGenericParticleProducer::produce(), and setGsfTrack().

00125                                     { 
00126     gsfTrack_.clear();
00127     if (gsfTrackRef_.isNonnull()) gsfTrack_.push_back(*gsfTrackRef_); // import
00128     gsfTrackRef_ = reco::GsfTrackRef(); // clear, to save space (zeroes compress better)
00129 }

void GenericParticle::embedStandalone (  ) 

embeds the stand-alone track instead of keeping a reference to it

Definition at line 113 of file GenericParticle.cc.

References edm::Ref< C, T, F >::isNonnull(), standaloneTrack_, and standaloneTrackRef_.

Referenced by pat::PATGenericParticleProducer::produce(), and setStandAloneMuon().

00113                                       { 
00114     standaloneTrack_.clear();
00115     if (standaloneTrackRef_.isNonnull()) standaloneTrack_.push_back(*standaloneTrackRef_); // import
00116     standaloneTrackRef_ = reco::TrackRef(); // clear, to save space (zeroes compress better)
00117 }

void GenericParticle::embedSuperCluster (  ) 

embeds the supercluster instead of keeping a reference to it

Definition at line 132 of file GenericParticle.cc.

References edm::Ref< C, T, F >::isNonnull(), superCluster_, and superClusterRef_.

Referenced by pat::PATGenericParticleProducer::produce(), and setSuperCluster().

00132                                         { 
00133     superCluster_.clear();
00134     if (superClusterRef_.isNonnull()) superCluster_.push_back(*superClusterRef_); // import
00135     superClusterRef_ = reco::SuperClusterRef(); // clear, to save space (zeroes compress better)
00136 }

void GenericParticle::embedTrack (  ) 

embeds the master track instead of keeping a reference to it

Definition at line 98 of file GenericParticle.cc.

References edm::Ref< C, T, F >::isNonnull(), track_, and trackRef_.

Referenced by pat::PATGenericParticleProducer::produce(), and setTrack().

00098                                  { 
00099     track_.clear();
00100     if (trackRef_.isNonnull()) track_.push_back(*trackRef_); // import
00101     trackRef_ = reco::TrackRef(); // clear, to save space (zeroes compress better)
00102 }

void GenericParticle::embedTracks (  ) 

embeds the other tracks instead of keeping references

Definition at line 104 of file GenericParticle.cc.

References edm::RefVector< C, T, F >::begin(), edm::RefVector< C, T, F >::end(), it, edm::RefVector< C, T, F >::size(), trackRefs_, and tracks_.

Referenced by pat::PATGenericParticleProducer::produce(), and setTracks().

00104                                   { 
00105     tracks_.clear();
00106     tracks_.reserve(trackRefs_.size());
00107     for (reco::TrackRefVector::const_iterator it = trackRefs_.begin(); it != trackRefs_.end(); ++it) {
00108         if (it->isNonnull()) tracks_.push_back(**it); // embed track
00109     }
00110     trackRefs_ = reco::TrackRefVector(); // clear, to save space
00111 }

void GenericParticle::fillInFrom ( const reco::Candidate cand  )  [protected]

Definition at line 145 of file GenericParticle.cc.

References reco::Particle::charge(), i, reco::Particle::pdgId(), reco::Particle::polarP4(), edm::RefVector< C, T, F >::push_back(), setCaloTower(), reco::Particle::setCharge(), setCombinedMuon(), setGsfTrack(), reco::Particle::setP4(), reco::Particle::setPdgId(), setStandAloneMuon(), reco::Particle::setStatus(), setSuperCluster(), setTrack(), setTracks(), reco::Particle::setVertex(), reco::Particle::status(), tracks, and reco::Particle::vertex().

00145                                                           {
00146     // first, kinematics & status
00147     setCharge(cand.charge());
00148     setP4(cand.polarP4());
00149     setVertex(cand.vertex());
00150     setPdgId(cand.pdgId());
00151     setStatus(cand.status());
00152     // then RECO part, if available
00153     const reco::RecoCandidate *rc = dynamic_cast<const reco::RecoCandidate *>(&cand);
00154     if (rc != 0) {
00155         setTrack(rc->track());    
00156         setGsfTrack(rc->gsfTrack());    
00157         setStandAloneMuon(rc->standAloneMuon());    
00158         setCombinedMuon(rc->combinedMuon());
00159         setSuperCluster(rc->superCluster());    
00160         setCaloTower(rc->caloTower());    
00161         size_t ntracks = rc->numberOfTracks();
00162         if (ntracks > 0) {
00163             reco::TrackRefVector tracks;
00164             for (size_t i = 0; i < ntracks; ++i) {
00165                 tracks.push_back(rc->track(i));
00166             }
00167             setTracks(tracks);
00168         }
00169     }
00170 }

virtual reco::GsfTrackRef pat::GenericParticle::gsfTrack (  )  const [inline, virtual]

reference to a GsfTrack (might be transient ref if SuperCluster is embedded) returns null ref if there is no gsf track

Reimplemented from reco::RecoCandidate.

Definition at line 78 of file GenericParticle.h.

References gsfTrack_, and gsfTrackRef_.

00078 { return (gsfTrack_.empty() ? gsfTrackRef_ : reco::GsfTrackRef(&gsfTrack_, 0)); }

float pat::GenericParticle::hcalIso (  )  const [inline]

Return the hcal isolation variable that was stored in this object when produced, or -1.0 if there is none.

Definition at line 168 of file GenericParticle.h.

References pat::HCalIso, and isolation().

00168 { return isolation(HCalIso); }

void pat::GenericParticle::hcalIsoDeposit ( const IsoDeposit dep  )  [inline]

Definition at line 212 of file GenericParticle.h.

References pat::HCalIso, and setIsoDeposit().

00212 { setIsoDeposit(HCalIso, dep); }

const IsoDeposit* pat::GenericParticle::hcalIsoDeposit (  )  const [inline]

Definition at line 206 of file GenericParticle.h.

References pat::HCalIso, and isoDeposit().

00206 { return isoDeposit(HCalIso); }

const IsoDeposit* pat::GenericParticle::isoDeposit ( IsolationKeys  key  )  const [inline]

Returns the IsoDeposit associated with some key, or a null pointer if it is not available.

Definition at line 185 of file GenericParticle.h.

References isoDeposits_, and it.

Referenced by ecalIsoDeposit(), hcalIsoDeposit(), trackerIsoDeposit(), and userIsoDeposit().

00185                                                              {
00186           for (IsoDepositPairs::const_iterator it = isoDeposits_.begin(), ed = isoDeposits_.end(); 
00187                   it != ed; ++it) 
00188           {
00189               if (it->first == key) return & it->second;
00190           }
00191           return 0;
00192       } 

float pat::GenericParticle::isolation ( IsolationKeys  key  )  const [inline]

Returns the isolation variable for a specifc key (or pseudo-key like CaloIso), or -1.0 if not available.

Definition at line 129 of file GenericParticle.h.

References pat::CaloIso, pat::ECalIso, pat::HCalIso, and isolations_.

Referenced by caloIso(), ecalIso(), hcalIso(), trackIso(), and userIso().

00129                                                { 
00130           if (key >= 0) {
00131               //if (key >= isolations_.size()) throw cms::Excepton("Missing Data") << "Isolation corresponding to key " << key << " was not stored for this particle.";
00132               if (size_t(key) >= isolations_.size()) return -1.0;
00133               return isolations_[key];
00134           } else switch (key) {
00135               case CaloIso:  
00136                   //if (isolations_.size() <= HCalIso) throw cms::Excepton("Missing Data") << "CalIsoo Isolation was not stored for this particle.";
00137                   if (isolations_.size() <= HCalIso) return -1.0; 
00138                   return isolations_[ECalIso] + isolations_[HCalIso];
00139               default:
00140                   return -1.0;
00141                   //throw cms::Excepton("Missing Data") << "Isolation corresponding to key " << key << " was not stored for this particle.";
00142           }
00143       }

virtual size_t pat::GenericParticle::numberOfTracks (  )  const [inline, virtual]

number of multiple tracks (not including the master one)

Reimplemented from reco::RecoCandidate.

Definition at line 75 of file GenericParticle.h.

References edm::RefVector< C, T, F >::size(), trackRefs_, and tracks_.

Referenced by track().

00075 { return tracks_.empty() ? trackRefs_.size() : tracks_.size(); }

virtual bool pat::GenericParticle::overlap ( const Candidate &   )  const [virtual]

Checks for overlap with another candidate.

It will return 'true' if the other candidate is a RecoCandidate, and if they reference to at least one same non null track, supercluster or calotower (except for the multiple tracks) NOTE: It won't work with embedded references

float pat::GenericParticle::quality (  )  [inline]

returns a user defined quality value, if set by the user to some meaningful value

Definition at line 123 of file GenericParticle.h.

References quality_.

00123 { return quality_; }

void GenericParticle::setCaloTower ( const CaloTowerRef ref,
bool  embed = false 
) [virtual]

sets calotower reference (or even embed it into the object)

Definition at line 86 of file GenericParticle.cc.

References caloTower_, caloTowerRef_, embedCaloTower(), and edm::SortedCollection< T, SORT >::empty().

Referenced by fillInFrom().

00086                                                                       {
00087     caloTowerRef_ = ref;
00088     if (embed) { 
00089         embedCaloTower(); 
00090     } else if (!caloTower_.empty()) { 
00091         CaloTowerCollection().swap(caloTower_); 
00092     }
00093 }

void GenericParticle::setCombinedMuon ( const reco::TrackRef ref,
bool  embed = false 
) [virtual]

sets combined muon track reference (or even embed it into the object)

Definition at line 68 of file GenericParticle.cc.

References combinedTrack_, combinedTrackRef_, and embedCombined().

Referenced by fillInFrom().

00068                                                                          {
00069     combinedTrackRef_ = ref;
00070     if (embed) embedCombined(); else combinedTrack_.clear();
00071 }

void pat::GenericParticle::setECalIso ( float  caloIso  )  [inline]

Sets ecal isolation variable.

Definition at line 176 of file GenericParticle.h.

References pat::ECalIso, and setIsolation().

void GenericParticle::setGsfTrack ( const reco::GsfTrackRef ref,
bool  embed = false 
) [virtual]

sets gsf track reference (or even embed it into the object)

Definition at line 74 of file GenericParticle.cc.

References embedGsfTrack(), gsfTrack_, and gsfTrackRef_.

Referenced by fillInFrom().

00074                                                                         {
00075     gsfTrackRef_ = ref;
00076     if (embed) embedGsfTrack(); else gsfTrack_.clear();
00077 }

void pat::GenericParticle::setHCalIso ( float  caloIso  )  [inline]

Sets hcal isolation variable.

Definition at line 178 of file GenericParticle.h.

References pat::HCalIso, and setIsolation().

void pat::GenericParticle::setIsoDeposit ( IsolationKeys  key,
const IsoDeposit dep 
) [inline]

Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.

Definition at line 195 of file GenericParticle.h.

References isoDeposits_, and it.

Referenced by ecalIsoDeposit(), hcalIsoDeposit(), pat::PATGenericParticleProducer::produce(), trackerIsoDeposit(), and userIsoDeposit().

00195                                                                    {
00196           IsoDepositPairs::iterator it = isoDeposits_.begin(), ed = isoDeposits_.end();
00197           for (; it != ed; ++it) {
00198               if (it->first == key) { it->second = dep; return; }
00199           }
00200           isoDeposits_.push_back(std::make_pair(key,dep));
00201       } 

void pat::GenericParticle::setIsolation ( IsolationKeys  key,
float  value 
) [inline]

Sets the isolation variable for a specifc key.

Note that you can't set isolation for a pseudo-key like CaloIso

Definition at line 147 of file GenericParticle.h.

References Exception, and isolations_.

Referenced by pat::PATGenericParticleProducer::produce(), setECalIso(), setHCalIso(), setTrackIso(), and setUserIso().

00147                                                         {
00148           if (key >= 0) {
00149               if (size_t(key) >= isolations_.size()) isolations_.resize(key+1, -1.0);
00150               isolations_[key] = value;
00151           } else {
00152               throw cms::Exception("Illegal Argument") << 
00153                   "The key for which you're setting isolation does not correspond " <<
00154                   "to an individual isolation but to the sum of more independent isolations " <<
00155                   "(e.g. Calo = ECal + HCal), so you can't SET the value, just GET it.\n" <<
00156                   "Please set up each component independly.\n";
00157           }
00158       }

void pat::GenericParticle::setQuality ( float  quality  )  [inline]

sets a user defined quality value

Definition at line 125 of file GenericParticle.h.

References quality_.

Referenced by pat::PATGenericParticleProducer::produce().

00125 { quality_ = quality; }

void GenericParticle::setStandAloneMuon ( const reco::TrackRef ref,
bool  embed = false 
) [virtual]

sets stand-alone muon track reference (or even embed it into the object)

Definition at line 62 of file GenericParticle.cc.

References embedStandalone(), standaloneTrack_, and standaloneTrackRef_.

Referenced by fillInFrom().

00062                                                                            {
00063     standaloneTrackRef_ = ref;
00064     if (embed) embedStandalone(); else standaloneTrack_.clear();
00065 }

void GenericParticle::setSuperCluster ( const reco::SuperClusterRef ref,
bool  embed = false 
) [virtual]

sets supercluster reference (or even embed it into the object)

Definition at line 80 of file GenericParticle.cc.

References embedSuperCluster(), superCluster_, and superClusterRef_.

Referenced by fillInFrom().

00080                                                                                 {
00081     superClusterRef_ = ref;
00082     if (embed) embedSuperCluster(); else superCluster_.clear();
00083 }

void GenericParticle::setTrack ( const reco::TrackRef ref,
bool  embed = false 
) [virtual]

sets master track reference (or even embed it into the object)

Definition at line 50 of file GenericParticle.cc.

References embedTrack(), track_, and trackRef_.

Referenced by fillInFrom().

00050                                                                   {
00051     trackRef_ = ref;
00052     if (embed) embedTrack(); else track_.clear();
00053 }

void pat::GenericParticle::setTrackIso ( float  trackIso  )  [inline]

Sets tracker isolation variable.

Definition at line 174 of file GenericParticle.h.

References setIsolation(), and pat::TrackerIso.

void GenericParticle::setTracks ( const reco::TrackRefVector refs,
bool  embed = false 
) [virtual]

sets multiple track references (or even embed the tracks into the object - whatch out for disk size issues!)

Definition at line 56 of file GenericParticle.cc.

References embedTracks(), trackRefs_, and tracks_.

Referenced by fillInFrom().

00056                                                                           {
00057     trackRefs_ = refs;
00058     if (embed) embedTracks(); else tracks_.clear();
00059 }

void pat::GenericParticle::setUserIso ( float  value,
uint8_t  index = 0 
) [inline]

Sets user isolation variable index.

Definition at line 180 of file GenericParticle.h.

References setIsolation(), and pat::UserBaseIso.

void pat::GenericParticle::setVertexAssociation ( const pat::VertexAssociation assoc  )  [inline]

Set a single vertex association.

Definition at line 220 of file GenericParticle.h.

References vtxAss_.

Referenced by pat::PATGenericParticleProducer::produce().

00220 { vtxAss_ = std::vector<pat::VertexAssociation>(1, assoc); }

void pat::GenericParticle::setVertexAssociations ( const std::vector< pat::VertexAssociation > &  assocs  )  [inline]

Set multiple vertex associations.

Definition at line 222 of file GenericParticle.h.

References vtxAss_.

00222 { vtxAss_ = assocs; }

virtual reco::TrackRef pat::GenericParticle::standAloneMuon (  )  const [inline, virtual]

reference to a stand-alone muon Track (might be transient ref if SuperCluster is embedded) returns null ref if there is no stand-alone muon track

Reimplemented from reco::RecoCandidate.

Definition at line 81 of file GenericParticle.h.

References standaloneTrack_, and standaloneTrackRef_.

virtual reco::SuperClusterRef pat::GenericParticle::superCluster (  )  const [inline, virtual]

reference to a SuperCluster (might be transient ref if SuperCluster is embedded) returns null ref if there is no supercluster

Reimplemented from reco::RecoCandidate.

Definition at line 87 of file GenericParticle.h.

References superCluster_, and superClusterRef_.

virtual reco::TrackRef pat::GenericParticle::track ( size_t  idx  )  const [inline, virtual]

reference to one of a set of multiple tracks (might be transient refs if Tracks are embedded) throws exception if idx >= numberOfTracks()

Reimplemented from reco::RecoCandidate.

Definition at line 70 of file GenericParticle.h.

References Exception, numberOfTracks(), trackRefs_, and tracks_.

00070                                                      {  
00071             if (idx >= numberOfTracks()) throw cms::Exception("Index out of bounds") << "Requested track " << idx << " out of " << numberOfTracks() << ".\n";
00072             return (tracks_.empty() ? trackRefs_[idx] : reco::TrackRef(&tracks_, idx) );
00073       }

virtual reco::TrackRef pat::GenericParticle::track ( void   )  const [inline, virtual]

reference to a master track (might be transient refs if Tracks are embedded) returns null ref if there is no master track

Reimplemented from reco::RecoCandidate.

Definition at line 67 of file GenericParticle.h.

References track_, and trackRef_.

00067 { return track_.empty() ? trackRef_ : reco::TrackRef(&track_, 0); }

void pat::GenericParticle::trackerIsoDeposit ( const IsoDeposit dep  )  [inline]

Definition at line 210 of file GenericParticle.h.

References setIsoDeposit(), and pat::TrackerIso.

00210 { setIsoDeposit(TrackerIso, dep); }

const IsoDeposit* pat::GenericParticle::trackerIsoDeposit (  )  const [inline]

Definition at line 204 of file GenericParticle.h.

References isoDeposit(), and pat::TrackerIso.

00204 { return isoDeposit(TrackerIso); }

float pat::GenericParticle::trackIso (  )  const [inline]

Return the tracker isolation variable that was stored in this object when produced, or -1.0 if there is none.

Definition at line 162 of file GenericParticle.h.

References isolation(), and pat::TrackerIso.

00162 { return isolation(TrackerIso); }

float pat::GenericParticle::userIso ( uint8_t  index = 0  )  const [inline]

Return the user defined isolation variable index that was stored in this object when produced, or -1.0 if there is none.

Definition at line 170 of file GenericParticle.h.

References isolation(), and pat::UserBaseIso.

00170 { return isolation(IsolationKeys(UserBaseIso + index)); }

void pat::GenericParticle::userIsoDeposit ( const IsoDeposit dep,
uint8_t  index = 0 
) [inline]

Definition at line 213 of file GenericParticle.h.

References setIsoDeposit(), and pat::UserBaseIso.

const IsoDeposit* pat::GenericParticle::userIsoDeposit ( uint8_t  index = 0  )  const [inline]

Definition at line 207 of file GenericParticle.h.

References isoDeposit(), and pat::UserBaseIso.

00207 { return isoDeposit(IsolationKeys(UserBaseIso + index)); }

const pat::VertexAssociation* pat::GenericParticle::vertexAssociation ( size_t  index = 0  )  const [inline]

Vertex association (or associations, if any). Return null pointer if none has been set.

Definition at line 216 of file GenericParticle.h.

References vtxAss_.

00216 { return vtxAss_.size() > index ? & vtxAss_[index] : 0; }

const std::vector<pat::VertexAssociation>& pat::GenericParticle::vertexAssociations (  )  const [inline]

Vertex associations. Can be empty if it was not enabled in the config file.

Definition at line 218 of file GenericParticle.h.

References vtxAss_.

00218 { return vtxAss_; }


Member Data Documentation

CaloTowerCollection pat::GenericParticle::caloTower_ [protected]

Definition at line 234 of file GenericParticle.h.

Referenced by caloTower(), embedCaloTower(), and setCaloTower().

CaloTowerRef pat::GenericParticle::caloTowerRef_ [protected]

Definition at line 233 of file GenericParticle.h.

Referenced by caloTower(), embedCaloTower(), and setCaloTower().

reco::TrackCollection pat::GenericParticle::combinedTrack_ [protected]

Definition at line 226 of file GenericParticle.h.

Referenced by combinedMuon(), embedCombined(), and setCombinedMuon().

reco::TrackRef pat::GenericParticle::combinedTrackRef_ [protected]

Definition at line 225 of file GenericParticle.h.

Referenced by combinedMuon(), embedCombined(), and setCombinedMuon().

reco::GsfTrackCollection pat::GenericParticle::gsfTrack_ [protected]

Definition at line 230 of file GenericParticle.h.

Referenced by embedGsfTrack(), gsfTrack(), and setGsfTrack().

reco::GsfTrackRef pat::GenericParticle::gsfTrackRef_ [protected]

Definition at line 229 of file GenericParticle.h.

Referenced by embedGsfTrack(), gsfTrack(), and setGsfTrack().

IsoDepositPairs pat::GenericParticle::isoDeposits_ [protected]

Definition at line 250 of file GenericParticle.h.

Referenced by isoDeposit(), and setIsoDeposit().

std::vector<float> pat::GenericParticle::isolations_ [protected]

Definition at line 251 of file GenericParticle.h.

Referenced by isolation(), and setIsolation().

float pat::GenericParticle::quality_ [protected]

Definition at line 246 of file GenericParticle.h.

Referenced by quality(), and setQuality().

reco::TrackCollection pat::GenericParticle::standaloneTrack_ [protected]

Definition at line 226 of file GenericParticle.h.

Referenced by embedStandalone(), setStandAloneMuon(), and standAloneMuon().

reco::TrackRef pat::GenericParticle::standaloneTrackRef_ [protected]

Definition at line 225 of file GenericParticle.h.

Referenced by embedStandalone(), setStandAloneMuon(), and standAloneMuon().

reco::SuperClusterCollection pat::GenericParticle::superCluster_ [protected]

Definition at line 238 of file GenericParticle.h.

Referenced by embedSuperCluster(), setSuperCluster(), and superCluster().

reco::SuperClusterRef pat::GenericParticle::superClusterRef_ [protected]

Definition at line 237 of file GenericParticle.h.

Referenced by embedSuperCluster(), setSuperCluster(), and superCluster().

reco::TrackCollection pat::GenericParticle::track_ [protected]

Definition at line 226 of file GenericParticle.h.

Referenced by embedTrack(), setTrack(), and track().

reco::TrackRef pat::GenericParticle::trackRef_ [protected]

Definition at line 225 of file GenericParticle.h.

Referenced by embedTrack(), setTrack(), and track().

reco::TrackRefVector pat::GenericParticle::trackRefs_ [protected]

Definition at line 241 of file GenericParticle.h.

Referenced by embedTracks(), numberOfTracks(), setTracks(), and track().

reco::TrackCollection pat::GenericParticle::tracks_ [protected]

Definition at line 242 of file GenericParticle.h.

Referenced by embedTracks(), numberOfTracks(), setTracks(), and track().

std::vector<pat::VertexAssociation> pat::GenericParticle::vtxAss_ [protected]

Definition at line 254 of file GenericParticle.h.

Referenced by setVertexAssociation(), setVertexAssociations(), vertexAssociation(), and vertexAssociations().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:49:33 2009 for CMSSW by  doxygen 1.5.4