Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef JetReco_JetFloatAssociation_h
0002 #define JetReco_JetFloatAssociation_h
0003 
0004 /** \class JetFloatAssociation
0005  *
0006  * \short Association between jets and float value
0007  *
0008  * \author Giovanni Petrucciani, Fedor Ratnikov, June 12, 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 
0018 namespace fwlite {
0019   class Event;
0020 }
0021 
0022 namespace reco {
0023   namespace JetFloatAssociation {
0024     typedef float Value;
0025     typedef std::vector<Value> Values;
0026     typedef edm::AssociationVector<reco::JetRefBaseProd, Values> Container;
0027     typedef Container::value_type value_type;
0028     typedef Container::transient_vector_type transient_vector_type;
0029     typedef edm::Ref<Container> Ref;
0030     typedef edm::RefProd<Container> RefProd;
0031     typedef edm::RefVector<Container> RefVector;
0032 
0033     /// get value for the association. Throw exception if no association found
0034     float getValue(const Container&, const reco::JetBaseRef&);
0035     /// get value for the association. Throw exception if no association found
0036     float getValue(const Container&, const reco::Jet&);
0037     /// associate jet with value
0038     bool setValue(Container&, const reco::JetBaseRef&, float);
0039     /// associate jet with value
0040     bool setValue(Container*, const reco::JetBaseRef&, float);
0041     /// fill list of all jets associated with values. Return # of jets in the list
0042     std::vector<reco::JetBaseRef> allJets(const Container&);
0043     /// check if jet is associated
0044     bool hasJet(const Container&, const reco::JetBaseRef&);
0045     /// check if jet is associated
0046     bool hasJet(const Container&, const reco::Jet&);
0047   }  // namespace JetFloatAssociation
0048 }  // namespace reco
0049 
0050 #endif