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 Attributes
HcalTrigPrimDigiProducer Class Reference

#include <HcalTrigPrimDigiProducer.h>

Inheritance diagram for HcalTrigPrimDigiProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HcalTrigPrimDigiProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~HcalTrigPrimDigiProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 ()
 

Private Attributes

std::vector< edm::InputTaginputLabel_
 input tags for HCAL digis More...
 
edm::InputTag inputTagFEDRaw_
 input tag for FEDRawDataCollection More...
 
bool runFrontEndFormatError_
 
bool runZS_
 
HcalTriggerPrimitiveAlgo theAlgo_
 
edm::EDGetTokenT
< HBHEDigiCollection
tok_hbhe_
 
edm::EDGetTokenT
< HFDigiCollection
tok_hf_
 
edm::EDGetTokenT
< FEDRawDataCollection
tok_raw_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 12 of file HcalTrigPrimDigiProducer.h.

Constructor & Destructor Documentation

HcalTrigPrimDigiProducer::HcalTrigPrimDigiProducer ( const edm::ParameterSet ps)
explicit

Definition at line 25 of file HcalTrigPrimDigiProducer.cc.

References edm::ParameterSet::getParameter(), inputLabel_, inputTagFEDRaw_, runFrontEndFormatError_, HcalTriggerPrimitiveAlgo::setPeakFinderAlgorithm(), theAlgo_, tok_hbhe_, tok_hf_, and tok_raw_.

26 :
27  theAlgo_(ps.getParameter<bool>("peakFilter"),
28  ps.getParameter<std::vector<double> >("weights"),
29  ps.getParameter<int>("latency"),
30  ps.getParameter<uint32_t>("FG_threshold"),
31  ps.getParameter<uint32_t>("ZS_threshold"),
32  ps.getParameter<int>("numberOfSamples"),
33  ps.getParameter<int>("numberOfPresamples"),
34  ps.getParameter<int>("numberOfSamplesHF"),
35  ps.getParameter<int>("numberOfPresamplesHF"),
36  ps.getParameter<uint32_t>("MinSignalThreshold"),
37  ps.getParameter<uint32_t>("PMTNoiseThreshold")
38  ),
39  inputLabel_(ps.getParameter<std::vector<edm::InputTag> >("inputLabel")),
40  inputTagFEDRaw_(ps.getParameter<edm::InputTag> ("InputTagFEDRaw")),
41  runZS_(ps.getParameter<bool>("RunZS")),
42  runFrontEndFormatError_(ps.getParameter<bool>("FrontEndFormatError"))
43 {
44  // register for data access
46  tok_raw_ = consumes<FEDRawDataCollection>(inputTagFEDRaw_);
47  }
48  tok_hbhe_ = consumes<HBHEDigiCollection>(inputLabel_[0]);
49  tok_hf_ = consumes<HFDigiCollection>(inputLabel_[1]);
50 
51  produces<HcalTrigPrimDigiCollection>();
52  theAlgo_.setPeakFinderAlgorithm(ps.getParameter<int>("PeakFinderAlgorithm"));
53 }
T getParameter(std::string const &) const
edm::InputTag inputTagFEDRaw_
input tag for FEDRawDataCollection
HcalTriggerPrimitiveAlgo theAlgo_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
std::vector< edm::InputTag > inputLabel_
input tags for HCAL digis
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
virtual HcalTrigPrimDigiProducer::~HcalTrigPrimDigiProducer ( )
inlinevirtual

Definition at line 17 of file HcalTrigPrimDigiProducer.h.

17 {}

Member Function Documentation

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

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 56 of file HcalTrigPrimDigiProducer.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), inputLabel_, inputTagFEDRaw_, edm::HandleBase::isValid(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), query::result, HcalTriggerPrimitiveAlgo::run(), HcalTriggerPrimitiveAlgo::runFEFormatError(), runFrontEndFormatError_, HcalTriggerPrimitiveAlgo::runZS(), runZS_, theAlgo_, tok_hbhe_, tok_hf_, and tok_raw_.

56  {
57 
58  // Step A: get the conditions, for the decoding
59  edm::ESHandle<HcalTPGCoder> inputCoder;
60  eventSetup.get<HcalTPGRecord>().get(inputCoder);
61 
63  eventSetup.get<CaloTPGRecord>().get(outTranscoder);
64 
66  eventSetup.get<HcalLutMetadataRcd>().get(lutMetadata);
67  float rctlsb = lutMetadata->getRctLsb();
68 
70  eventSetup.get<CaloGeometryRecord>().get(pG);
71 
72  // Step B: Create empty output
73  std::auto_ptr<HcalTrigPrimDigiCollection> result(new HcalTrigPrimDigiCollection());
74 
77 
78  iEvent.getByToken(tok_hbhe_,hbheDigis);
79  iEvent.getByToken(tok_hf_,hfDigis);
80 
81  // protect here against missing input collections
82  // there is no protection in HcalTriggerPrimitiveAlgo
83 
84  if (!hbheDigis.isValid()) {
85  edm::LogInfo("HcalTrigPrimDigiProducer")
86  << "\nWarning: HBHEDigiCollection with input tag "
87  << inputLabel_[0]
88  << "\nrequested in configuration, but not found in the event."
89  << "\nQuit returning empty product." << std::endl;
90 
91  // put empty HcalTrigPrimDigiCollection in the event
92  iEvent.put(result);
93 
94  return;
95  }
96 
97  if (!hfDigis.isValid()) {
98  edm::LogInfo("HcalTrigPrimDigiProducer")
99  << "\nWarning: HFDigiCollection with input tag "
100  << inputLabel_[1]
101  << "\nrequested in configuration, but not found in the event."
102  << "\nQuit returning empty product." << std::endl;
103 
104  // put empty HcalTrigPrimDigiCollection in the event
105  iEvent.put(result);
106 
107  return;
108  }
109 
110 
111  // Step C: Invoke the algorithm, passing in inputs and getting back outputs.
112  theAlgo_.run(inputCoder.product(),outTranscoder->getHcalCompressor().get(),
113  *hbheDigis, *hfDigis, *result, &(*pG), rctlsb);
114 
115  // Step C.1: Run FE Format Error / ZS for real data.
117 
119  eventSetup.get<HcalDbRecord> ().get(pSetup);
120  const HcalElectronicsMap *emap = pSetup->getHcalMapping();
121 
123  iEvent.getByToken(tok_raw_, fedHandle);
124 
125  if (fedHandle.isValid() && emap != 0) {
126  theAlgo_.runFEFormatError(fedHandle.product(), emap, *result);
127  } else {
128  edm::LogInfo("HcalTrigPrimDigiProducer")
129  << "\nWarning: FEDRawDataCollection with input tag "
130  << inputTagFEDRaw_
131  << "\nrequested in configuration, but not found in the event."
132  << "\nQuit returning empty product." << std::endl;
133 
134  // produce empty HcalTrigPrimDigiCollection and put it in the event
135  std::auto_ptr < HcalTrigPrimDigiCollection > emptyResult(
137 
138  iEvent.put(emptyResult);
139 
140  return;
141  }
142 
143  }
144 
145  if (runZS_) theAlgo_.runZS(*result);
146 
147  // edm::LogInfo("HcalTrigPrimDigiProducer") << "HcalTrigPrims: " << result->size();
148 
149  // Step D: Put outputs into event
150  iEvent.put(result);
151 }
edm::InputTag inputTagFEDRaw_
input tag for FEDRawDataCollection
void runFEFormatError(const FEDRawDataCollection *rawraw, const HcalElectronicsMap *emap, HcalTrigPrimDigiCollection &result)
edm::SortedCollection< HcalTriggerPrimitiveDigi > HcalTrigPrimDigiCollection
HcalTriggerPrimitiveAlgo theAlgo_
void run(const HcalTPGCoder *incoder, const HcalTPGCompressor *outcoder, const HBHEDigiCollection &hbheDigis, const HFDigiCollection &hfDigis, HcalTrigPrimDigiCollection &result, const HcalTrigTowerGeometry *trigTowerGeometry, float rctlsb)
edm::EDGetTokenT< HFDigiCollection > tok_hf_
int iEvent
Definition: GenABIO.cc:230
tuple result
Definition: query.py:137
bool isValid() const
Definition: HandleBase.h:75
void runZS(HcalTrigPrimDigiCollection &tp)
T const * product() const
Definition: Handle.h:81
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
std::vector< edm::InputTag > inputLabel_
input tags for HCAL digis
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_

Member Data Documentation

std::vector<edm::InputTag> HcalTrigPrimDigiProducer::inputLabel_
private

input tags for HCAL digis

Definition at line 27 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().

edm::InputTag HcalTrigPrimDigiProducer::inputTagFEDRaw_
private

input tag for FEDRawDataCollection

Definition at line 33 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().

bool HcalTrigPrimDigiProducer::runFrontEndFormatError_
private

Definition at line 38 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().

bool HcalTrigPrimDigiProducer::runZS_
private

Definition at line 36 of file HcalTrigPrimDigiProducer.h.

Referenced by produce().

HcalTriggerPrimitiveAlgo HcalTrigPrimDigiProducer::theAlgo_
private

Definition at line 24 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().

edm::EDGetTokenT<HBHEDigiCollection> HcalTrigPrimDigiProducer::tok_hbhe_
private

Definition at line 29 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().

edm::EDGetTokenT<HFDigiCollection> HcalTrigPrimDigiProducer::tok_hf_
private

Definition at line 30 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().

edm::EDGetTokenT<FEDRawDataCollection> HcalTrigPrimDigiProducer::tok_raw_
private

Definition at line 34 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().