00001
00002 #ifndef XAODJET_VERSIONS_JET_V1_H
00003 #define XAODJET_VERSIONS_JET_V1_H
00004
00005 #include <map>
00006
00007
00008
00009 #include "AthLinks/ElementLink.h"
00010
00011
00012 #include "xAODBase/IParticle.h"
00013 #include "xAODBase/IParticleContainer.h"
00014 #ifndef SIMULATIONBASE
00015 #include "xAODBTagging/BTaggingContainer.h"
00016 #endif //SIMULATIONBASE
00017
00018
00019
00020 #include "xAODJet/JetConstituentVector.h"
00021 #include "xAODJet/JetAttributes.h"
00022 #include "xAODJet/JetTypes.h"
00023 #include "xAODJet/JetContainerInfo.h"
00024
00025 namespace fastjet {
00026 class PseudoJet;
00027 }
00028
00029 namespace xAOD {
00030 class FastJetLinkBase;
00031
00032
00033
00053 class Jet_v1 : public IParticle {
00054
00055 public:
00056
00057 typedef JetAttribute::AttributeID AttributeID;
00058 typedef JetAttribute::AssoParticlesID AssoParticlesID;
00059
00060
00062 Jet_v1();
00064
00066 Jet_v1(const Jet_v1& );
00067
00068 ~Jet_v1();
00071
00072 Jet_v1& operator=(const Jet_v1& other);
00073
00075 virtual double pt() const;
00077 virtual double eta() const;
00079 virtual double phi() const;
00081 virtual double m() const;
00083 virtual double e() const;
00085 virtual double rapidity() const;
00086
00088 typedef IParticle::FourMom_t FourMom_t;
00089
00091 virtual const FourMom_t& p4() const;
00092
00093
00095 virtual Type::ObjectType type() const;
00096
00097
00098
00099
00104
00106 virtual const JetFourMom_t& jetP4() const;
00107
00109 float px() const;
00111 float py() const;
00113 float pz() const;
00114
00116
00117
00125 JetFourMom_t jetP4(JetScale s) const ;
00127 JetFourMom_t jetP4(const std::string& statename) const ;
00128
00129 void setJetP4(const JetFourMom_t & p4);
00130 void setJetP4(JetScale s, const JetFourMom_t & p4);
00131
00132 void setJetP4(const std::string & sname, const JetFourMom_t & p4);
00133
00134
00137
00138
00139
00140
00142
00156 public:
00158 void addConstituent( const ElementLink< IParticleContainer >& link , float weight=1.0 );
00159
00163 void addConstituent( const IParticle* p, float weight=1.0);
00164
00166 JetConstitScale getConstituentsSignalState() const ;
00168 void setConstituentsSignalState( JetConstitScale t);
00169
00170
00172 JetConstituentVector getConstituents() const ;
00173
00175 size_t numConstituents() const;
00176
00178 const IParticle* rawConstituent(size_t i) const ;
00179
00181 const std::vector< ElementLink< IParticleContainer > >& constituentLinks()const ;
00182
00183
00184 protected:
00185
00186 void setNumConstituents(size_t n);
00187
00190
00191
00192
00193
00204 public:
00205
00207 template<class T>
00208 bool getAttribute( AttributeID type, T & value ) const ;
00210 template<class T>
00211 bool getAttribute(const std::string &name, T &value) const;
00212
00214 template<class T>
00215 T getAttribute(const std::string &name) const ;
00216 template<class T>
00217 T getAttribute(AttributeID type) const ;
00218
00219
00220
00221 template<class T>
00222 void setAttribute(const std::string &name, const T& v) ;
00224 template<class T>
00225 void setAttribute( AttributeID type, const T& value );
00226 #ifndef SIMULATIONBASE
00228 const BTagging* btagging() const;
00230 const ElementLink< BTaggingContainer >& btaggingLink() const;
00232 void setBTaggingLink( const ElementLink< BTaggingContainer>& el );
00233 #endif
00234
00244
00245
00246
00250 template<typename T>
00251 std::vector<const T*> getAssociatedObjects( const std::string &name) const ;
00252 template<typename T>
00253 std::vector<const T*> getAssociatedObjects( AssoParticlesID type) const ;
00254
00259 template<typename T>
00260 bool getAssociatedObjects( const std::string &name, std::vector<const T*>& vec) const ;
00261 template<typename T>
00262 bool getAssociatedObjects( AssoParticlesID type, std::vector<const T*>& vec) const ;
00263
00268 template<typename T>
00269 void setAssociatedObjects( const std::string &name, const std::vector<const T*>& vec) ;
00270 template<typename T>
00271 void setAssociatedObjects( AssoParticlesID type, const std::vector<const T*>& vec) ;
00272
00273
00276 template<typename T>
00277 const T* getAssociatedObject( const std::string &name) const ;
00278 template<typename T>
00279 const T* getAssociatedObject( AssoParticlesID type) const ;
00280
00283 template<typename T>
00284 bool getAssociatedObject( const std::string &name, const T*& vec) const ;
00285 template<typename T>
00286 bool getAssociatedObject( AssoParticlesID type, const T*& vec) const ;
00287
00292 template<typename T>
00293 void setAssociatedObject( const std::string &name, const T* vec) ;
00294 template<typename T>
00295 void setAssociatedObject( AssoParticlesID type, const T* vec) ;
00296
00299
00300
00301
00302
00303
00307
00308 float getSizeParameter() const ;
00309 JetAlgorithmType::ID getAlgorithmType() const ;
00310 JetInput::Type getInputType() const ;
00311
00312 void setSizeParameter(float p) ;
00313 void setAlgorithmType(JetAlgorithmType::ID a) ;
00314 void setInputType(JetInput::Type t) ;
00315
00318
00319
00324 const fastjet::PseudoJet * getPseudoJet() const ;
00327 template<class PSEUDOJET>
00328 void setPseudoJet(const PSEUDOJET * fj);
00329
00330
00332 void toPersistent();
00333
00335 void reset();
00338
00339
00340
00341
00342 private:
00344 mutable FourMom_t m_pxpypze;
00346 mutable bool m_pxpypzeCached;
00347
00349 mutable JetFourMom_t m_momentum;
00351 mutable bool m_momentumCached;
00352
00354 typedef std::map<std::string, std::vector<const IParticle*> > VectIPartMap_t;
00356 mutable VectIPartMap_t m_assoParticleCache;
00357
00358 protected:
00361 FastJetLinkBase * m_fastJetLink;
00362
00363
00364 };
00365
00366
00367 }
00368
00369 #include "xAODJet/versions/Jet_v1.icc"
00370
00371 #endif // XAODJET_VERSIONS_JET_V1_H