CMS 3D CMS Logo

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

#include <HLTrigger/JetMET/plugins/HLTScoutingCaloProducer.cc>

Inheritance diagram for HLTScoutingCaloProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTScoutingCaloProducer (const edm::ParameterSet &)
 
 ~HLTScoutingCaloProducer ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void produce (edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const overridefinal
 

Private Attributes

const edm::EDGetTokenT
< reco::CaloJetCollection
caloJetCollection_
 
const double caloJetEtaCut
 
const double caloJetPtCut
 
const bool doMet
 
const edm::EDGetTokenT
< reco::CaloMETCollection
metCollection_
 
const edm::EDGetTokenT< double > rho_
 
const edm::EDGetTokenT
< reco::VertexCollection
vertexCollection_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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

Description: Producer for ScoutingCaloJets from reco::CaloJet objects

Definition at line 36 of file HLTScoutingCaloProducer.cc.

Constructor & Destructor Documentation

HLTScoutingCaloProducer::HLTScoutingCaloProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 60 of file HLTScoutingCaloProducer.cc.

60  :
61  caloJetCollection_(consumes<reco::CaloJetCollection>(iConfig.getParameter<edm::InputTag>("caloJetCollection"))),
62  vertexCollection_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection"))),
63  metCollection_(consumes<reco::CaloMETCollection>(iConfig.getParameter<edm::InputTag>("metCollection"))),
64  rho_(consumes<double>(iConfig.getParameter<edm::InputTag>("rho"))),
65  caloJetPtCut(iConfig.getParameter<double>("caloJetPtCut")),
66  caloJetEtaCut(iConfig.getParameter<double>("caloJetEtaCut")),
67  doMet(iConfig.getParameter<bool>("doMet"))
68 {
69  //register products
70  produces<ScoutingCaloJetCollection>();
71  produces<ScoutingVertexCollection>();
72  produces<double>("rho");
73  produces<double>("caloMetPt");
74  produces<double>("caloMetPhi");
75 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
const edm::EDGetTokenT< reco::CaloMETCollection > metCollection_
const edm::EDGetTokenT< reco::CaloJetCollection > caloJetCollection_
const edm::EDGetTokenT< double > rho_
HLTScoutingCaloProducer::~HLTScoutingCaloProducer ( )

Definition at line 77 of file HLTScoutingCaloProducer.cc.

78 { }

Member Function Documentation

void HLTScoutingCaloProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 141 of file HLTScoutingCaloProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_25ns14e33_v1_cff::InputTag.

141  {
143  desc.add<edm::InputTag>("caloJetCollection",edm::InputTag("hltAK4CaloJets"));
144  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("hltPixelVertices"));
145  desc.add<edm::InputTag>("metCollection", edm::InputTag("hltMet"));
146  desc.add<edm::InputTag>("rho", edm::InputTag("hltFixedGridRhoFastjetAllCalo"));
147  desc.add<double>("caloJetPtCut", 20.0);
148  desc.add<double>("caloJetEtaCut", 3.0);
149  desc.add<bool>("doMet", true);
150  descriptions.add("hltScoutingCaloProducer", desc);
151 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTScoutingCaloProducer::produce ( edm::StreamID  sid,
edm::Event iEvent,
edm::EventSetup const &  setup 
) const
finaloverrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 82 of file HLTScoutingCaloProducer.cc.

References HLT_25ns14e33_v4_cff::caloJetCollection, caloJetCollection_, caloJetEtaCut, caloJetPtCut, doMet, edm::Event::getByToken(), metsig::jet, HLT_25ns14e33_v4_cff::metCollection, metCollection_, edm::Event::put(), rho, rho_, GoodVertex_cfg::vertexCollection, and vertexCollection_.

83 {
84  using namespace edm;
85 
86  //get calo jets
88  std::auto_ptr<ScoutingCaloJetCollection> outCaloJets(new ScoutingCaloJetCollection());
90  for(auto &jet : *caloJetCollection){
91  if(jet.pt() > caloJetPtCut && fabs(jet.eta()) < caloJetEtaCut){
92  outCaloJets->emplace_back(
93  jet.pt(), jet.eta(), jet.phi(), jet.mass(),
94  jet.jetArea(), jet.maxEInEmTowers(), jet.maxEInHadTowers(),
95  jet.hadEnergyInHB(), jet.hadEnergyInHE(), jet.hadEnergyInHF(),
96  jet.emEnergyInEB(), jet.emEnergyInEE(), jet.emEnergyInHF(),
97  jet.towersArea(), 0.0
98  );
99  }
100  }
101  }
102 
103  //get vertices
105  std::auto_ptr<ScoutingVertexCollection> outVertices(new ScoutingVertexCollection());
107  //produce vertices (only if present; otherwise return an empty collection)
108  for(auto &vtx : *vertexCollection){
109  outVertices->emplace_back(
110  vtx.x(), vtx.y(), vtx.z(), vtx.zError()
111  );
112  }
113  }
114 
115  //get rho
117  std::auto_ptr<double> outRho(new double(-999));
118  if(iEvent.getByToken(rho_, rho)){
119  outRho.reset(new double(*rho));
120  }
121 
122  //get MET
124  std::auto_ptr<double> outMetPt(new double(-999));
125  std::auto_ptr<double> outMetPhi(new double(-999));
127  outMetPt.reset(new double(metCollection->front().pt()));
128  outMetPhi.reset(new double(metCollection->front().phi()));
129  }
130 
131  //put output
132  iEvent.put(outCaloJets);
133  iEvent.put(outVertices);
134  iEvent.put(outRho, "rho");
135  iEvent.put(outMetPt, "caloMetPt");
136  iEvent.put(outMetPhi, "caloMetPhi");
137 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
const edm::EDGetTokenT< reco::CaloMETCollection > metCollection_
Definition: DDAxes.h:10
tuple vertexCollection
std::vector< ScoutingCaloJet > ScoutingCaloJetCollection
const edm::EDGetTokenT< reco::CaloJetCollection > caloJetCollection_
std::vector< ScoutingVertex > ScoutingVertexCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
const edm::EDGetTokenT< double > rho_

Member Data Documentation

const edm::EDGetTokenT<reco::CaloJetCollection> HLTScoutingCaloProducer::caloJetCollection_
private

Definition at line 46 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

const double HLTScoutingCaloProducer::caloJetEtaCut
private

Definition at line 52 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

const double HLTScoutingCaloProducer::caloJetPtCut
private

Definition at line 51 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

const bool HLTScoutingCaloProducer::doMet
private

Definition at line 54 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

const edm::EDGetTokenT<reco::CaloMETCollection> HLTScoutingCaloProducer::metCollection_
private

Definition at line 48 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

const edm::EDGetTokenT<double> HLTScoutingCaloProducer::rho_
private

Definition at line 49 of file HLTScoutingCaloProducer.cc.

Referenced by produce().

const edm::EDGetTokenT<reco::VertexCollection> HLTScoutingCaloProducer::vertexCollection_
private

Definition at line 47 of file HLTScoutingCaloProducer.cc.

Referenced by produce().