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::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 ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

std::vector< edm::InputTaginputLabel_
 
bool runFrontEndFormatError
 
bool runZS
 
HcalTriggerPrimitiveAlgo theAlgo
 

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)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 10 of file HcalTrigPrimDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file HcalTrigPrimDigiProducer.cc.

References edm::ParameterSet::getUntrackedParameter(), runFrontEndFormatError, runZS, HcalTriggerPrimitiveAlgo::setPeakFinderAlgorithm(), and theAlgo.

28 :
29  theAlgo(ps.getParameter<bool>("peakFilter"),
30  ps.getParameter<std::vector<double> >("weights"),
31  ps.getParameter<int>("latency"),
32  ps.getParameter<uint32_t>("FG_threshold"),
33  ps.getParameter<uint32_t>("ZS_threshold"),
34  ps.getParameter<int>("numberOfSamples"),
35  ps.getParameter<int>("numberOfPresamples"),
36  ps.getParameter<uint32_t>("MinSignalThreshold"),
37  ps.getParameter<uint32_t>("PMTNoiseThreshold")
38  ),
39  inputLabel_(ps.getParameter<std::vector<edm::InputTag> >("inputLabel"))
40 {
41  runZS = ps.getUntrackedParameter<bool>("RunZS", false);
42  runFrontEndFormatError = ps.getUntrackedParameter<bool>("FrontEndFormatError", false);
43  produces<HcalTrigPrimDigiCollection>();
44  theAlgo.setPeakFinderAlgorithm(ps.getUntrackedParameter<int>("PeakFinderAlgorithm", 2));
45 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
HcalTriggerPrimitiveAlgo theAlgo
std::vector< edm::InputTag > inputLabel_
virtual HcalTrigPrimDigiProducer::~HcalTrigPrimDigiProducer ( )
inlinevirtual

Definition at line 15 of file HcalTrigPrimDigiProducer.h.

15 {}

Member Function Documentation

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

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 48 of file HcalTrigPrimDigiProducer.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), edm::Event::getByType(), CaloTPGTranscoder::HcalTPG, inputLabel_, edm::HandleBase::isValid(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), query::result, HcalTriggerPrimitiveAlgo::run(), HcalTriggerPrimitiveAlgo::runFEFormatError(), runFrontEndFormatError, runZS, HcalTriggerPrimitiveAlgo::runZS(), and theAlgo.

48  {
51 
52  e.getByLabel(inputLabel_[0],hbheDigis);
53  e.getByLabel(inputLabel_[1],hfDigis);
54 
55  // Step A: get the conditions, for the decoding
56  edm::ESHandle<HcalTPGCoder> inputCoder;
57  eventSetup.get<HcalTPGRecord>().get(inputCoder);
58 
60  eventSetup.get<CaloTPGRecord>().get(outTranscoder);
61  outTranscoder->setup(eventSetup,CaloTPGTranscoder::HcalTPG);
62 
64  eventSetup.get<HcalLutMetadataRcd>().get(lutMetadata);
65  float rctlsb = lutMetadata->getRctLsb();
66 
67  // Step B: Create empty output
68  std::auto_ptr<HcalTrigPrimDigiCollection> result(new HcalTrigPrimDigiCollection());
69 
70  // Step C: Invoke the algorithm, passing in inputs and getting back outputs.
71  theAlgo.run(inputCoder.product(),outTranscoder->getHcalCompressor().get(),
72  *hbheDigis, *hfDigis, *result, rctlsb);
73 
74  // Step C.1: Run FE Format Error / ZS for real data.
77  eventSetup.get<HcalDbRecord>().get( pSetup );
78  const HcalElectronicsMap *emap = pSetup->getHcalMapping();
79 
81  e.getByType(fedraw);
82 
83  if (fedraw.isValid() && emap != 0)
84  theAlgo.runFEFormatError(fedraw.product(), emap, *result);
85  }
86 
87  if (runZS) theAlgo.runZS(*result);
88 
89  // edm::LogInfo("HcalTrigPrimDigiProducer") << "HcalTrigPrims: " << result->size();
90 
91  // Step D: Put outputs into event
92  e.put(result);
93 
94  outTranscoder->releaseSetup();
95 }
void runFEFormatError(const FEDRawDataCollection *rawraw, const HcalElectronicsMap *emap, HcalTrigPrimDigiCollection &result)
edm::SortedCollection< HcalTriggerPrimitiveDigi > HcalTrigPrimDigiCollection
void run(const HcalTPGCoder *incoder, const HcalTPGCompressor *outcoder, const HBHEDigiCollection &hbheDigis, const HFDigiCollection &hfDigis, HcalTrigPrimDigiCollection &result, float rctlsb)
bool getByType(Handle< PROD > &result) const
Definition: Event.h:397
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
tuple result
Definition: query.py:137
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
void runZS(HcalTrigPrimDigiCollection &tp)
HcalTriggerPrimitiveAlgo theAlgo
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
std::vector< edm::InputTag > inputLabel_

Member Data Documentation

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

Definition at line 22 of file HcalTrigPrimDigiProducer.h.

Referenced by produce().

bool HcalTrigPrimDigiProducer::runFrontEndFormatError
private

Definition at line 23 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().

bool HcalTrigPrimDigiProducer::runZS
private

Definition at line 24 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().

HcalTriggerPrimitiveAlgo HcalTrigPrimDigiProducer::theAlgo
private

Definition at line 21 of file HcalTrigPrimDigiProducer.h.

Referenced by HcalTrigPrimDigiProducer(), and produce().