#ifndef JETREC_JET_H #define JETREC_JET_H //***************************************************************************** // Filename : Jet.h // Author : Ambreesh Gupta, Ed Frank // Created : Sep, 2000 // // DESCRIPTION: // // Jets are the outputs of JetFinders. They are built from ProtoJets. // Jets do not have associated tracks or other physics level capabilities // because that is anticpated to happen at a higher level in downstream // processing, e.g., there will probably soon be a JetPhysicsJet class. // // What is the difference between a Jet and a Cluster? It is not so clear // in the current state of the code as both appear to just be ensembles of // cells. The intention is that they are distinguished by their level of // compositeness. A cluster is assembled from cells and one never intends // to think of the cluster in terms of subsets of cells. On the other hand, // Jets are assembled from ProtoJets and one very likely will think of the // jet's composite nature, e.g., matching a track onto not just a jet but // onto one of its ProtoJet constituents. // // // HISTORY // xxXXXxx agupta. First version // 29Jun01 efrank Docs // 21Sep01 ploch Implement changes as discussed in Tucson Aug 01 // // BUGS: // // //***************************************************************************** #include "GaudiKernel/ContainedObject.h" #include "CLHEP/Vector/LorentzVector.h" #include "NavigationRep/Navigable.h" #include "NavigationRep/NavJetToken.h" // STL #include #include // Gaudi Class ID static const CLID CLID_Jet = 3001; class ProtoJet; class JetOverlapHandler; class Jet : public ContainedObject, public Navigable { typedef list jetList; typedef map jetMap; typedef jetList::const_iterator jetListIt; typedef jetMap::const_iterator jetMapIt; public: // default constructor Jet(); // copy constructor Jet( const Jet& aJet ); // Gaudi class id stuff static const CLID& classID() { return CLID_Jet; } virtual const CLID& clID() const { return CLID_Jet; } // accessors to kinematics HepLorentzVector p() const { return m_p; } virtual double energy() const { return m_p.e(); } double ex() const { return m_p.px(); } double ey() const { return m_p.py(); } double ez() const { return m_p.pz(); } virtual double et() const { return sqrt( pow(ex(),2)+ pow(ey(),2) ); } virtual double eta() const { return m_p.pseudoRapidity(); } virtual double phi() const { return m_p.phi(); } double theta() const { return m_p.theta(); } // Jet builder dynamics bool add( const ProtoJet& aPJ, double weight ); bool add( const Jet& aJet ); bool add( const Jet& aJet, const JetOverlapHandler& aHandler ); // Jet examination and manipulation bool reweight( const ProtoJet& aPJ, double weight ); bool contains( const ProtoJet& aPJ ) const; double getWeight( const ProtoJet& aPJ ) const; bool remove( const ProtoJet& aPj ); //bool remove( const Jet& aJ ); bool remove(); bool isIdentical( const Jet& aJet); void setP( const HepLorentzVector& p ); // access to Jet composition const list getProtoJets() const; const list getOverlap( const Jet& aJet ) const; // equality comparable bool operator != (const Jet& aJet) { return !(this->isIdentical(aJet)) ;} // destructor ~Jet() { }; // print ///////////////////////////////////////////////////////////////////////////// // NOT part of the Tucson agreement, but very helpful. Can go away. ///////////////////////////////////////////////////////////////////////////// void print(); virtual NavJetToken& getNavToken() { return m_jetToken; } // from Navigable base class virtual const NavJetToken& getNavToken() const { return m_jetToken; } protected: // recombination scheme implementation (default) virtual void updateP( const HepLorentzVector& p ) { m_p += p; } // fresh update from all ProtoJets, implements above as default ///////////////////////////////////////////////////////////////////////////// // This method has NOT been discussed and agreed on at Tucson. It just seems // to make updates of the jet kinematics much more straight forward, // especially when removing ProtoJets. ///////////////////////////////////////////////////////////////////////////// virtual void updateP(); private: HepLorentzVector m_p; ///////////////////////////////////////////////////////////////////////////// // Preliminary solution to hold references (actually pointers) to ProtoJets: // // m_ProtoJets: list of pointers to (constant) ProtoJets // m_Weights: maps real number weights to ProtoJet pointers // // Usually the map is sufficient to hold the references. Having the // additional list of ProtoJet pointers speeds up the getProtoJets() method // considerably - this method is used heavily by some algorithms! // // All this has to go away soon! ///////////////////////////////////////////////////////////////////////////// jetMap m_Weights; jetList m_ProtoJets; NavJetToken m_jetToken; }; #endif //JETREC_JET_H