CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Attributes
cms::JetVertexAssociation Class Reference

#include <JetVertexAssociation.h>

Inheritance diagram for cms::JetVertexAssociation:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 JetVertexAssociation (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &c)
 
 ~JetVertexAssociation ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef std::vector< double > ResultCollection1
 
typedef std::vector< bool > ResultCollection2
 

Private Attributes

std::string jet_algo
 
JetVertexMain m_algo
 
std::string track_algo
 
std::string vertex_algo
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 24 of file JetVertexAssociation.h.

Member Typedef Documentation

typedef std::vector<double> cms::JetVertexAssociation::ResultCollection1
private

Definition at line 35 of file JetVertexAssociation.h.

typedef std::vector<bool> cms::JetVertexAssociation::ResultCollection2
private

Definition at line 36 of file JetVertexAssociation.h.

Constructor & Destructor Documentation

JetVertexAssociation::JetVertexAssociation ( const edm::ParameterSet ps)

Definition at line 62 of file JetVertexAssociation.cc.

62  : m_algo(iConfig),
63  jet_algo(iConfig.getParameter<std::string>("JET_ALGO")),
64  track_algo(iConfig.getParameter<std::string>("TRACK_ALGO")),
65  vertex_algo(iConfig.getParameter<std::string>("VERTEX_ALGO")) {
66 
67 
68 
69  produces<ResultCollection1>("Var");
70  produces<ResultCollection2>("JetType");
71 
72 
73  }
cms::JetVertexAssociation::~JetVertexAssociation ( )
inline

Definition at line 30 of file JetVertexAssociation.h.

30 {}

Member Function Documentation

void JetVertexAssociation::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 75 of file JetVertexAssociation.cc.

References edm::Event::getByLabel(), metsig::jet, jet_algo, fwrapper::jets, m_algo, JetVertexMain::Main(), edm::Event::put(), query::result, track_algo, testEve_cfg::tracks, and vertex_algo.

75  {
76 
78  iEvent.getByLabel(jet_algo, jets);
79 
81  iEvent.getByLabel(track_algo, tracks);
82 
84  iEvent.getByLabel(vertex_algo, vertexes);
85 
86  double SIGNAL_V_Z = 0.;
87  double SIGNAL_V_Z_ERROR = 0.;
88  double ptmax = -100.;
89 
90  VertexCollection::const_iterator vert = vertexes->begin ();
91  if(vertexes->size() > 0 ) {
92  for (; vert != vertexes->end (); vert++) {
93 
94  SIGNAL_V_Z = vert->z();
95  double pt = 0.;
96  reco::Vertex::trackRef_iterator tr = vert->tracks_begin();
97  for (; tr != vert->tracks_end(); tr++) pt += (*tr)->pt();
98  if( pt >= ptmax ){
99 
100  ptmax = pt;
101  SIGNAL_V_Z = vert->z();
102  SIGNAL_V_Z_ERROR = vert->zError();
103 
104  }
105 
106  }
107  }
108 
109  pair<double, bool> result;
110  std::auto_ptr<ResultCollection1> result1 (new ResultCollection1) ;
111  std::auto_ptr<ResultCollection2> result2 (new ResultCollection2) ;
112 
113  CaloJetCollection::const_iterator jet = jets->begin ();
114 
115  if(jets->size() > 0 ) {
116  for (; jet != jets->end (); jet++) {
117  result = m_algo.Main(*jet, tracks, SIGNAL_V_Z, SIGNAL_V_Z_ERROR);
118  result1->push_back(result.first);
119  result2->push_back(result.second);
120 
121  }
122  }
123 
124  iEvent.put(result1, "Var");
125  iEvent.put(result2, "JetType");
126 
127  }
std::pair< double, bool > Main(const reco::CaloJet &jet, edm::Handle< reco::TrackCollection > tracks, double SIGNAL_V_Z, double SIGNAL_V_Z_Error)
std::vector< double > ResultCollection1
int iEvent
Definition: GenABIO.cc:243
vector< PseudoJet > jets
tuple result
Definition: query.py:137
std::vector< bool > ResultCollection2
tuple tracks
Definition: testEve_cfg.py:39
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38

Member Data Documentation

std::string cms::JetVertexAssociation::jet_algo
private

Definition at line 39 of file JetVertexAssociation.h.

Referenced by produce().

JetVertexMain cms::JetVertexAssociation::m_algo
private

Definition at line 38 of file JetVertexAssociation.h.

Referenced by produce().

std::string cms::JetVertexAssociation::track_algo
private

Definition at line 40 of file JetVertexAssociation.h.

Referenced by produce().

std::string cms::JetVertexAssociation::vertex_algo
private

Definition at line 41 of file JetVertexAssociation.h.

Referenced by produce().