Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:24

0001 #ifndef JetReco_JetExtendedAssociation_h
0002 #define JetReco_JetExtendedAssociation_h
0003 
0004 /** \class JetExtendedAssociation
0005  *
0006  * \short Association between jets and extended Jet information
0007  *
0008  * \author Fedor Ratnikov, Sept. 9, 2007
0009  *
0010  ************************************************************/
0011 
0012 #include "DataFormats/Common/interface/AssociationVector.h"
0013 #include "DataFormats/JetReco/interface/JetCollection.h"
0014 #include "DataFormats/Common/interface/Ref.h"
0015 #include "DataFormats/Common/interface/RefToBase.h"
0016 #include "DataFormats/Common/interface/RefVector.h"
0017 #include "DataFormats/Math/interface/LorentzVector.h"
0018 
0019 namespace fwlite {
0020   class Event;
0021 }
0022 
0023 namespace reco {
0024   namespace JetExtendedAssociation {
0025     class JetExtendedData;
0026     typedef math::PtEtaPhiELorentzVectorF LorentzVector;
0027     typedef reco::JetExtendedAssociation::JetExtendedData Value;
0028     typedef std::vector<Value> Values;
0029     typedef edm::AssociationVector<reco::JetRefBaseProd, Values> Container;
0030     typedef Container::value_type value_type;
0031     typedef Container::transient_vector_type transient_vector_type;
0032     typedef edm::Ref<Container> Ref;
0033     typedef edm::RefProd<Container> RefProd;
0034     typedef edm::RefVector<Container> RefVector;
0035 
0036     /// Number of tracks associated in the vertex
0037     int tracksAtVertexNumber(const Container&, const reco::JetBaseRef&);
0038     /// Number of tracks associated in the vertex
0039     int tracksAtVertexNumber(const Container&, const reco::Jet&);
0040     /// p4 of tracks associated in the vertex
0041     const LorentzVector& tracksAtVertexP4(const Container&, const reco::JetBaseRef&);
0042     const LorentzVector& tracksAtVertexP4(const Container&, const reco::Jet&);
0043     /// Number of tracks associated at calo face
0044     int tracksAtCaloNumber(const Container&, const reco::JetBaseRef&);
0045     /// Number of tracks associated at calo face
0046     int tracksAtCaloNumber(const Container&, const reco::Jet&);
0047     /// p4 of tracks associated at calo face
0048     const LorentzVector& tracksAtCaloP4(const Container&, const reco::JetBaseRef&);
0049     /// p4 of tracks associated at calo face
0050     const LorentzVector& tracksAtCaloP4(const Container&, const reco::Jet&);
0051 
0052     /// associate jet with value. Returns false and associate nothing if jet is already associated
0053     bool setValue(Container&, const reco::JetBaseRef&, const JetExtendedData&);
0054     /// associate jet with value. Returns false and associate nothing if jet is already associated
0055     bool setValue(Container*, const reco::JetBaseRef&, const JetExtendedData&);
0056     /// get value for the association. Throw exception if no association found
0057     const JetExtendedData& getValue(const Container&, const reco::JetBaseRef&);
0058     /// get value for the association. Throw exception if no association found
0059     const JetExtendedData& getValue(const Container&, const reco::Jet&);
0060     /// fill list of all jets associated with values. Return # of jets in the list
0061     std::vector<reco::JetBaseRef> allJets(const Container&);
0062     /// check if jet is associated
0063     bool hasJet(const Container&, const reco::JetBaseRef&);
0064     /// check if jet is associated
0065     bool hasJet(const Container&, const reco::Jet&);
0066 
0067     class JetExtendedData {
0068     public:
0069       JetExtendedData();
0070       ~JetExtendedData() {}
0071       int mTracksAtVertexNumber;
0072       LorentzVector mTracksAtVertexP4;
0073       int mTracksAtCaloNumber;
0074       LorentzVector mTracksAtCaloP4;
0075     };
0076   }  // namespace JetExtendedAssociation
0077 }  // namespace reco
0078 
0079 #endif