CMS 3D CMS Logo

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

#include <HLTrigger/special/plugins/HLTRechitsToDigis.cc>

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

Public Types

enum  ecalRegion { invalidRegion =0, barrel, endcap }
 
- 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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 HLTRechitsToDigis (const edm::ParameterSet &)
 
 ~HLTRechitsToDigis ()
 
- 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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 const
HLTRechitsToDigis::ecalRegion 
stringToRegion (const std::string &region)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

edm::EDGetTokenT
< EBDigiCollection
digisEBInToken_
 
edm::EDGetTokenT
< EEDigiCollection
digisEEInToken_
 
edm::InputTag digisIn_
 
std::string digisOut_
 
edm::InputTag recHits_
 
edm::EDGetTokenT
< EcalRecHitCollection
recHitsToken_
 
ecalRegion region_
 

Additional Inherited Members

- 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: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 42 of file HLTRechitsToDigis.cc.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 72 of file HLTRechitsToDigis.cc.

References barrel, digisEBInToken_, digisEEInToken_, digisIn_, digisOut_, endcap, edm::ParameterSet::getParameter(), invalidRegion, recHits_, recHitsToken_, region_, AlCaHLTBitMon_QueryRunRegistry::string, and stringToRegion().

73 {
74  //region to do rechit digi matching
75  region_ = stringToRegion(iConfig.getParameter<std::string> ("region"));
76 
77  // digis to match to hit collections
78  digisIn_ = iConfig.getParameter<edm::InputTag> ("digisIn");
79  digisOut_ = iConfig.getParameter<std::string> ("digisOut");
80 
81  // hit collections to save digis for
82  recHits_ = iConfig.getParameter<edm::InputTag> ("recHits");
83 
84  // region specific tokens
85  switch(region_) {
86  case barrel:
87  digisEBInToken_ = consumes<EBDigiCollection>(digisIn_);
88  produces<EBDigiCollection>(digisOut_);
89  break;
90  case endcap:
91  digisEEInToken_ = consumes<EEDigiCollection>(digisIn_);
92  produces<EEDigiCollection>(digisOut_);
93  break;
94  case invalidRegion:
95  break;
96  }
97 
98  recHitsToken_ = consumes<EcalRecHitCollection>(recHits_);
99 }
T getParameter(std::string const &) const
edm::EDGetTokenT< EEDigiCollection > digisEEInToken_
static const HLTRechitsToDigis::ecalRegion stringToRegion(const std::string &region)
edm::EDGetTokenT< EcalRecHitCollection > recHitsToken_
edm::InputTag digisIn_
edm::InputTag recHits_
edm::EDGetTokenT< EBDigiCollection > digisEBInToken_
HLTRechitsToDigis::~HLTRechitsToDigis ( )

Definition at line 101 of file HLTRechitsToDigis.cc.

102 {
103  // do anything here that needs to be done at desctruction time
104  // (e.g. close files, deallocate resources etc.)
105 }

Member Function Documentation

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

Definition at line 205 of file HLTRechitsToDigis.cc.

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

205  {
206  //The following says we do not know what parameters are allowed so do no validation
207  // Please change this to state exactly what you do use, even if it is no parameters
209 
210  desc.add<std::string>("region", "barrel")
211  ->setComment("Region of rechits to save Digis for. Allowed values: barrel or endcap.");
212  desc.add<edm::InputTag>("digisIn",edm::InputTag("ecalDigis","ebDigis"))
213  ->setComment("The collection of either barrel or endcap digis which correspond to the rechit collection");
214  desc.add<std::string>("digisOut","pi0EBDigis")
215  ->setComment("Name for the collection of Digis saved by the module");
216  desc.add<edm::InputTag>("recHits",edm::InputTag("hltAlCaPi0EBUncalibrator","pi0EcalRecHitsEB"))
217  ->setComment("Collection of rechits to match Digis to");
218  descriptions.add("hltFindMatchingECALDigisToRechits", desc);
219 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTRechitsToDigis::produce ( edm::Event iEvent,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 120 of file HLTRechitsToDigis.cc.

References barrel, digisEBInToken_, digisEEInToken_, digisOut_, endcap, edm::DataFrameContainer::find(), edm::Event::getByToken(), EcalRecHit::id(), invalidRegion, edm::Event::put(), recHitsToken_, and region_.

120  {
121  using namespace edm;
122  // handles for digis
123  Handle<EBDigiCollection> digisEBHandle;
124  Handle<EEDigiCollection> digisEEHandle;
125 
126  // output collections
127  std::auto_ptr<EBDigiCollection> outputEBDigiCollection( new EBDigiCollection );
128  std::auto_ptr<EEDigiCollection> outputEEDigiCollection( new EEDigiCollection );
129 
130  // calibrated rechits
131  Handle<EcalRecHitCollection> recHitsHandle;
132  iEvent.getByToken(recHitsToken_, recHitsHandle);
133 
134  // match the digis based on the region
135  switch(region_) {
136  case barrel: {
137  iEvent.getByToken(digisEBInToken_, digisEBHandle);
138  const EBDigiCollection* digisEB = digisEBHandle.product();
139 
140  // loop over the collection of rechits and match to digis
142  for (ituneEB = recHitsHandle->begin(); ituneEB != recHitsHandle->end(); ituneEB++) {
143  EcalRecHit hit = (*ituneEB);
144  outputEBDigiCollection->push_back( (*digisEB->find(hit.id())).id(), (*digisEB->find(hit.id())).begin() );
145  }
146 
147  iEvent.put( outputEBDigiCollection, digisOut_);
148  break;
149  }
150 
151  case endcap: {
152  iEvent.getByToken(digisEEInToken_, digisEEHandle);
153  const EEDigiCollection* digisEE = digisEEHandle.product();
154 
155  // loop over the collection of rechits and match to digis
157  for (ituneEE = recHitsHandle->begin(); ituneEE != recHitsHandle->end(); ituneEE++) {
158  EcalRecHit hit = (*ituneEE);
159  outputEEDigiCollection->push_back( (*digisEE->find(hit.id())).id(), (*digisEE->find(hit.id())).begin() );
160  }
161 
162  iEvent.put(outputEEDigiCollection, digisOut_);
163  break;
164  }
165  case invalidRegion: {
166  break;
167  }
168  }
169 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< EEDigiCollection > digisEEInToken_
const_iterator find(id_type i) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
edm::EDGetTokenT< EcalRecHitCollection > recHitsToken_
DetId id() const
get the id
Definition: EcalRecHit.h:76
edm::EDGetTokenT< EBDigiCollection > digisEBInToken_
const HLTRechitsToDigis::ecalRegion HLTRechitsToDigis::stringToRegion ( const std::string &  region)
static

Definition at line 111 of file HLTRechitsToDigis.cc.

References barrel, endcap, and invalidRegion.

Referenced by HLTRechitsToDigis().

111  {
112  if (region == "barrel") return barrel;
113  else if (region == "endcap") return endcap;
114  else return invalidRegion;
115 }

Member Data Documentation

edm::EDGetTokenT<EBDigiCollection> HLTRechitsToDigis::digisEBInToken_
private

Definition at line 55 of file HLTRechitsToDigis.cc.

Referenced by HLTRechitsToDigis(), and produce().

edm::EDGetTokenT<EEDigiCollection> HLTRechitsToDigis::digisEEInToken_
private

Definition at line 56 of file HLTRechitsToDigis.cc.

Referenced by HLTRechitsToDigis(), and produce().

edm::InputTag HLTRechitsToDigis::digisIn_
private

Definition at line 60 of file HLTRechitsToDigis.cc.

Referenced by HLTRechitsToDigis().

std::string HLTRechitsToDigis::digisOut_
private

Definition at line 64 of file HLTRechitsToDigis.cc.

Referenced by HLTRechitsToDigis(), and produce().

edm::InputTag HLTRechitsToDigis::recHits_
private

Definition at line 61 of file HLTRechitsToDigis.cc.

Referenced by HLTRechitsToDigis().

edm::EDGetTokenT<EcalRecHitCollection> HLTRechitsToDigis::recHitsToken_
private

Definition at line 57 of file HLTRechitsToDigis.cc.

Referenced by HLTRechitsToDigis(), and produce().

ecalRegion HLTRechitsToDigis::region_
private

Definition at line 65 of file HLTRechitsToDigis.cc.

Referenced by HLTRechitsToDigis(), and produce().