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 Member Functions | Private Attributes
reco::GlobalHaloDataProducer Class Reference

#include <GlobalHaloDataProducer.h>

Inheritance diagram for reco::GlobalHaloDataProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GlobalHaloDataProducer (const edm::ParameterSet &)
 
 ~GlobalHaloDataProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT
< reco::CaloMETCollection
calomet_token_
 
edm::EDGetTokenT< edm::View
< reco::Candidate > > 
calotower_token_
 
float CaloTowerEtThreshold
 
edm::EDGetTokenT< CSCHaloDatacschalo_token_
 
edm::EDGetTokenT
< CSCRecHit2DCollection
cscrechit_token_
 
edm::EDGetTokenT
< CSCSegmentCollection
cscsegment_token_
 
edm::EDGetTokenT< EcalHaloDataecalhalo_token_
 
float EcalMaxMatchingRadius
 
float EcalMinMatchingRadius
 
edm::EDGetTokenT< HcalHaloDatahcalhalo_token_
 
float HcalMaxMatchingRadius
 
float HcalMinMatchingRadius
 
edm::InputTag IT_CaloTower
 
edm::InputTag IT_CSCHaloData
 
edm::InputTag IT_CSCRecHit
 
edm::InputTag IT_CSCSegment
 
edm::InputTag IT_EcalHaloData
 
edm::InputTag IT_HcalHaloData
 
edm::InputTag IT_met
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 182 of file GlobalHaloDataProducer.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file GlobalHaloDataProducer.cc.

References edm::ParameterSet::getParameter().

16 {
17  //Higher Level Reco
18  IT_met = iConfig.getParameter<edm::InputTag>("metLabel");
19  IT_CaloTower = iConfig.getParameter<edm::InputTag>("calotowerLabel");
20  IT_CSCSegment = iConfig.getParameter<edm::InputTag>("CSCSegmentLabel");
21  IT_CSCRecHit = iConfig.getParameter<edm::InputTag>("CSCRecHitLabel");
22 
23  //Halo Data from Sub-detectors
24  IT_CSCHaloData = iConfig.getParameter<edm::InputTag>("CSCHaloDataLabel");
25  IT_EcalHaloData = iConfig.getParameter<edm::InputTag> ("EcalHaloDataLabel");
26  IT_HcalHaloData = iConfig.getParameter<edm::InputTag> ("HcalHaloDataLabel");
27 
28  EcalMinMatchingRadius = (float)iConfig.getParameter<double>("EcalMinMatchingRadiusParam");
29  EcalMaxMatchingRadius = (float)iConfig.getParameter<double>("EcalMaxMatchingRadiusParam");
30  HcalMinMatchingRadius = (float)iConfig.getParameter<double>("HcalMinMatchingRadiusParam");
31  HcalMaxMatchingRadius = (float)iConfig.getParameter<double>("HcalMaxMatchingRadiusParam");
32  CaloTowerEtThreshold = (float)iConfig.getParameter<double>("CaloTowerEtThresholdParam");
33 
34  calotower_token_ = consumes<edm::View<Candidate> >(IT_CaloTower);
35  calomet_token_ = consumes<reco::CaloMETCollection>(IT_met);
36  cscsegment_token_ = consumes<CSCSegmentCollection>(IT_CSCSegment);
37  cscrechit_token_ = consumes<CSCRecHit2DCollection>(IT_CSCRecHit);
38  cschalo_token_ = consumes<CSCHaloData>(IT_CSCHaloData);
39  ecalhalo_token_ = consumes<EcalHaloData>(IT_EcalHaloData);
40  hcalhalo_token_ = consumes<HcalHaloData>(IT_HcalHaloData);
41 
42  produces<GlobalHaloData>();
43 }
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCSegmentCollection > cscsegment_token_
edm::EDGetTokenT< edm::View< reco::Candidate > > calotower_token_
edm::EDGetTokenT< reco::CaloMETCollection > calomet_token_
edm::EDGetTokenT< EcalHaloData > ecalhalo_token_
edm::EDGetTokenT< HcalHaloData > hcalhalo_token_
edm::EDGetTokenT< CSCHaloData > cschalo_token_
edm::EDGetTokenT< CSCRecHit2DCollection > cscrechit_token_
GlobalHaloDataProducer::~GlobalHaloDataProducer ( )

Definition at line 115 of file GlobalHaloDataProducer.cc.

115 {}

Member Function Documentation

void GlobalHaloDataProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 45 of file GlobalHaloDataProducer.cc.

References GlobalHaloAlgo::Calculate(), edm::EventSetup::get(), edm::Event::getByToken(), GlobalHaloData_cfi::GlobalHaloData, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), edm::Handle< T >::product(), edm::Event::put(), GlobalHaloAlgo::SetCaloTowerEtThreshold(), GlobalHaloAlgo::SetEcalMatchingRadius(), and GlobalHaloAlgo::SetHcalMatchingRadius().

46 {
47  //Get CSC Geometry
48  edm::ESHandle<CSCGeometry> TheCSCGeometry;
49  iSetup.get<MuonGeometryRecord>().get(TheCSCGeometry);
50 
51  //Get Global Tracking Geometry
52  edm::ESHandle<GlobalTrackingGeometry> TheGlobalTrackingGeometry;
53  iSetup.get<GlobalTrackingGeometryRecord>().get(TheGlobalTrackingGeometry);
54 
55  //Get CaloGeometry
56  edm::ESHandle<CaloGeometry> TheCaloGeometry;
57  iSetup.get<CaloGeometryRecord>().get(TheCaloGeometry);
58 
59  //Get CaloTowers
60  edm::Handle<edm::View<Candidate> > TheCaloTowers;
61  // iEvent.getByLabel(IT_CaloTower,TheCaloTowers);
62  iEvent.getByToken(calotower_token_, TheCaloTowers);
63 
64  //Get MET
66  // iEvent.getByLabel(IT_met, TheCaloMET);
67  iEvent.getByToken(calomet_token_, TheCaloMET);
68 
69  //Get CSCSegments
70  edm::Handle<CSCSegmentCollection> TheCSCSegments;
71  // iEvent.getByLabel(IT_CSCSegment, TheCSCSegments);
72  iEvent.getByToken(cscsegment_token_, TheCSCSegments);
73 
74  //Get CSCRecHits
76  // iEvent.getByLabel(IT_CSCRecHit, TheCSCRecHits );
77  iEvent.getByToken(cscrechit_token_, TheCSCRecHits);
78 
79  //Get CSCHaloData
80  edm::Handle<reco::CSCHaloData> TheCSCHaloData;
81  // iEvent.getByLabel(IT_CSCHaloData, TheCSCHaloData );
82  iEvent.getByToken(cschalo_token_, TheCSCHaloData);
83 
84  // Get EcalHaloData
85  edm::Handle<reco::EcalHaloData> TheEcalHaloData;
86  // iEvent.getByLabel(IT_EcalHaloData, TheEcalHaloData );
87  iEvent.getByToken(ecalhalo_token_, TheEcalHaloData);
88 
89  // Get HcalHaloData
90  edm::Handle<reco::HcalHaloData> TheHcalHaloData;
91  // iEvent.getByLabel(IT_HcalHaloData, TheHcalHaloData );
92  iEvent.getByToken(hcalhalo_token_, TheHcalHaloData);
93 
94  // Run the GlobalHaloAlgo to reconstruct the GlobalHaloData object
95  GlobalHaloAlgo GlobalAlgo;
99  // GlobalHaloData GlobalData;
100 
101  if(TheCaloGeometry.isValid() && TheCaloMET.isValid() && TheCaloTowers.isValid() && TheCSCHaloData.isValid() && TheEcalHaloData.isValid() && TheHcalHaloData.isValid() )
102  {
103  std::auto_ptr<GlobalHaloData> GlobalData( new GlobalHaloData(GlobalAlgo.Calculate(*TheCaloGeometry, *TheCSCGeometry, *(&TheCaloMET.product()->front()), TheCaloTowers, TheCSCSegments, TheCSCRecHits, *TheCSCHaloData.product(), *TheEcalHaloData.product(), *TheHcalHaloData.product() )) );
104  iEvent.put(GlobalData);
105  }
106  else
107  {
108  std::auto_ptr<GlobalHaloData> GlobalData( new GlobalHaloData() ) ;
109  iEvent.put(GlobalData);
110  }
111 
112  return;
113 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
reco::GlobalHaloData Calculate(const CaloGeometry &TheCaloGeometry, const CSCGeometry &TheCSCGeometry, const reco::CaloMET &TheCaloMET, edm::Handle< edm::View< reco::Candidate > > &TheCaloTowers, edm::Handle< CSCSegmentCollection > &TheCSCSegments, edm::Handle< CSCRecHit2DCollection > &TheCSCRecHits, const reco::CSCHaloData &TheCSCHaloData, const reco::EcalHaloData &TheEcalHaloData, const reco::HcalHaloData &TheHcalHaloData)
edm::EDGetTokenT< CSCSegmentCollection > cscsegment_token_
void SetHcalMatchingRadius(float min, float max)
edm::EDGetTokenT< edm::View< reco::Candidate > > calotower_token_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
bool isValid() const
Definition: HandleBase.h:76
void SetEcalMatchingRadius(float min, float max)
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::CaloMETCollection > calomet_token_
const T & get() const
Definition: EventSetup.h:55
void SetCaloTowerEtThreshold(float EtMin)
edm::EDGetTokenT< EcalHaloData > ecalhalo_token_
edm::EDGetTokenT< HcalHaloData > hcalhalo_token_
bool isValid() const
Definition: ESHandle.h:47
edm::EDGetTokenT< CSCHaloData > cschalo_token_
edm::EDGetTokenT< CSCRecHit2DCollection > cscrechit_token_

Member Data Documentation

edm::EDGetTokenT<reco::CaloMETCollection> reco::GlobalHaloDataProducer::calomet_token_
private

Definition at line 202 of file GlobalHaloDataProducer.h.

edm::EDGetTokenT<edm::View<reco::Candidate> > reco::GlobalHaloDataProducer::calotower_token_
private

Definition at line 201 of file GlobalHaloDataProducer.h.

float reco::GlobalHaloDataProducer::CaloTowerEtThreshold
private

Definition at line 213 of file GlobalHaloDataProducer.h.

edm::EDGetTokenT<CSCHaloData> reco::GlobalHaloDataProducer::cschalo_token_
private

Definition at line 205 of file GlobalHaloDataProducer.h.

edm::EDGetTokenT<CSCRecHit2DCollection> reco::GlobalHaloDataProducer::cscrechit_token_
private

Definition at line 204 of file GlobalHaloDataProducer.h.

edm::EDGetTokenT<CSCSegmentCollection> reco::GlobalHaloDataProducer::cscsegment_token_
private

Definition at line 203 of file GlobalHaloDataProducer.h.

edm::EDGetTokenT<EcalHaloData> reco::GlobalHaloDataProducer::ecalhalo_token_
private

Definition at line 206 of file GlobalHaloDataProducer.h.

float reco::GlobalHaloDataProducer::EcalMaxMatchingRadius
private

Definition at line 210 of file GlobalHaloDataProducer.h.

float reco::GlobalHaloDataProducer::EcalMinMatchingRadius
private

Definition at line 209 of file GlobalHaloDataProducer.h.

edm::EDGetTokenT<HcalHaloData> reco::GlobalHaloDataProducer::hcalhalo_token_
private

Definition at line 207 of file GlobalHaloDataProducer.h.

float reco::GlobalHaloDataProducer::HcalMaxMatchingRadius
private

Definition at line 212 of file GlobalHaloDataProducer.h.

float reco::GlobalHaloDataProducer::HcalMinMatchingRadius
private

Definition at line 211 of file GlobalHaloDataProducer.h.

edm::InputTag reco::GlobalHaloDataProducer::IT_CaloTower
private

Definition at line 192 of file GlobalHaloDataProducer.h.

edm::InputTag reco::GlobalHaloDataProducer::IT_CSCHaloData
private

Definition at line 197 of file GlobalHaloDataProducer.h.

edm::InputTag reco::GlobalHaloDataProducer::IT_CSCRecHit
private

Definition at line 194 of file GlobalHaloDataProducer.h.

edm::InputTag reco::GlobalHaloDataProducer::IT_CSCSegment
private

Definition at line 195 of file GlobalHaloDataProducer.h.

edm::InputTag reco::GlobalHaloDataProducer::IT_EcalHaloData
private

Definition at line 198 of file GlobalHaloDataProducer.h.

edm::InputTag reco::GlobalHaloDataProducer::IT_HcalHaloData
private

Definition at line 199 of file GlobalHaloDataProducer.h.

edm::InputTag reco::GlobalHaloDataProducer::IT_met
private

Definition at line 193 of file GlobalHaloDataProducer.h.