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 | Private Member Functions | Private Attributes
HcalSignalGenerator< HCALDIGITIZERTRAITS > Class Template Reference

#include <HcalSignalGenerator.h>

Inheritance diagram for HcalSignalGenerator< HCALDIGITIZERTRAITS >:
HcalBaseSignalGenerator CaloVNoiseSignalGenerator

Public Types

typedef
HCALDIGITIZERTRAITS::DigiCollection 
COLLECTION
 
typedef HCALDIGITIZERTRAITS::Digi DIGI
 

Public Member Functions

virtual void fill (edm::ModuleCallingContext const *mcc)
 
 HcalSignalGenerator ()
 
 HcalSignalGenerator (const edm::InputTag &inputTag, const edm::EDGetTokenT< COLLECTION > &t)
 
void initializeEvent (const edm::Event *event, const edm::EventSetup *eventSetup)
 
void initializeEvent (const edm::EventPrincipal *eventPrincipal, const edm::EventSetup *eventSetup)
 some users use EventPrincipals, not Events. We support both More...
 
virtual ~HcalSignalGenerator ()
 
- Public Member Functions inherited from HcalBaseSignalGenerator
 HcalBaseSignalGenerator ()
 
void setElectronicsSim (HcalElectronicsSim *electronicsSim)
 
void setParameterMap (HcalSimParameterMap *map)
 
virtual ~HcalBaseSignalGenerator ()
 
- Public Member Functions inherited from CaloVNoiseSignalGenerator
 CaloVNoiseSignalGenerator ()
 
bool contains (const DetId &detId) const
 
void fillEvent ()
 fill theNoiseSignals with one event's worth of noise, in units of pe More...
 
void getNoiseSignals (std::vector< CaloSamples > &noiseSignals)
 
void setNoiseSignals (const std::vector< CaloSamples > &noiseSignals)
 
virtual ~CaloVNoiseSignalGenerator ()
 

Private Member Functions

CaloSamples samplesInPE (const DIGI &digi)
 

Private Attributes

edm::ESHandle< HcalDbServicetheConditions
 
const edm::EventtheEvent
 these fields are set in initializeEvent() More...
 
const edm::EventPrincipaltheEventPrincipal
 
edm::InputTag theInputTag
 these come from the ParameterSet More...
 
edm::EDGetTokenT< COLLECTIONtok_
 

Additional Inherited Members

- Protected Member Functions inherited from HcalBaseSignalGenerator
void fC2pe (CaloSamples &samples) const
 
- Protected Member Functions inherited from CaloVNoiseSignalGenerator
virtual void fillNoiseSignals ()
 
- Protected Attributes inherited from HcalBaseSignalGenerator
HcalElectronicsSimtheElectronicsSim
 
HcalSimParameterMaptheParameterMap
 
- Protected Attributes inherited from CaloVNoiseSignalGenerator
std::vector< CaloSamplestheNoiseSignals
 

Detailed Description

template<class HCALDIGITIZERTRAITS>
class HcalSignalGenerator< HCALDIGITIZERTRAITS >

Definition at line 28 of file HcalSignalGenerator.h.

Member Typedef Documentation

template<class HCALDIGITIZERTRAITS>
typedef HCALDIGITIZERTRAITS::DigiCollection HcalSignalGenerator< HCALDIGITIZERTRAITS >::COLLECTION

Definition at line 32 of file HcalSignalGenerator.h.

template<class HCALDIGITIZERTRAITS>
typedef HCALDIGITIZERTRAITS::Digi HcalSignalGenerator< HCALDIGITIZERTRAITS >::DIGI

Definition at line 31 of file HcalSignalGenerator.h.

Constructor & Destructor Documentation

template<class HCALDIGITIZERTRAITS>
HcalSignalGenerator< HCALDIGITIZERTRAITS >::HcalSignalGenerator ( )
inline
template<class HCALDIGITIZERTRAITS>
HcalSignalGenerator< HCALDIGITIZERTRAITS >::HcalSignalGenerator ( const edm::InputTag inputTag,
const edm::EDGetTokenT< COLLECTION > &  t 
)
inline

Definition at line 36 of file HcalSignalGenerator.h.

38  { }
edm::InputTag theInputTag
these come from the ParameterSet
const edm::Event * theEvent
these fields are set in initializeEvent()
const edm::EventPrincipal * theEventPrincipal
edm::EDGetTokenT< COLLECTION > tok_
template<class HCALDIGITIZERTRAITS>
virtual HcalSignalGenerator< HCALDIGITIZERTRAITS >::~HcalSignalGenerator ( )
inlinevirtual

Definition at line 40 of file HcalSignalGenerator.h.

40 {}

Member Function Documentation

template<class HCALDIGITIZERTRAITS>
virtual void HcalSignalGenerator< HCALDIGITIZERTRAITS >::fill ( edm::ModuleCallingContext const *  mcc)
inlinevirtual

Definition at line 58 of file HcalSignalGenerator.h.

Referenced by edm::DataMixingHcalDigiWorkerProd::addHcalPileups().

59  {
60  theNoiseSignals.clear();
62  const COLLECTION * digis = 0;
63  // try accessing by whatever is set, Event or EventPrincipal
64  if(theEvent)
65  {
66  if( theEvent->getByToken(tok_, pDigis) ) {
67  digis = pDigis.product(); // get a ptr to the product
68  LogTrace("HcalSignalGenerator") << "total # digis for " << theInputTag << " " << digis->size();
69  }
70  else
71  {
72  throw cms::Exception("HcalSignalGenerator") << "Cannot find input data " << theInputTag;
73  }
74  }
75  else if(theEventPrincipal)
76  {
77  boost::shared_ptr<edm::Wrapper<COLLECTION> const> digisPTR =
78  edm::getProductByTag<COLLECTION>(*theEventPrincipal, theInputTag, mcc );
79  if(digisPTR) {
80  digis = digisPTR->product();
81  }
82  }
83  else
84  {
85  throw cms::Exception("HcalSignalGenerator") << "No Event or EventPrincipal was set";
86  }
87 
88  if (digis)
89  {
90  // loop over digis, adding these to the existing maps
91  for(typename COLLECTION::const_iterator it = digis->begin();
92  it != digis->end(); ++it)
93  {
94  // for the first signal, set the starting cap id
95  if((it == digis->begin()) && theElectronicsSim)
96  {
97  int startingCapId = (*it)[0].capid();
98  theElectronicsSim->setStartingCapId(startingCapId);
99  theParameterMap->setFrameSize(it->id(), it->size());
100  }
101 
102  theNoiseSignals.push_back(samplesInPE(*it));
103  }
104  }
105  }
edm::InputTag theInputTag
these come from the ParameterSet
void setStartingCapId(int startingCapId)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
HCALDIGITIZERTRAITS::DigiCollection COLLECTION
const edm::Event * theEvent
these fields are set in initializeEvent()
CaloSamples samplesInPE(const DIGI &digi)
std::vector< CaloSamples > theNoiseSignals
const edm::EventPrincipal * theEventPrincipal
void setFrameSize(const DetId &detId, int frameSize)
HcalSimParameterMap * theParameterMap
edm::EDGetTokenT< COLLECTION > tok_
#define LogTrace(id)
HcalElectronicsSim * theElectronicsSim
T const * product() const
Definition: Handle.h:81
template<class HCALDIGITIZERTRAITS>
void HcalSignalGenerator< HCALDIGITIZERTRAITS >::initializeEvent ( const edm::Event event,
const edm::EventSetup eventSetup 
)
inline

Definition at line 43 of file HcalSignalGenerator.h.

Referenced by edm::DataMixingHcalDigiWorkerProd::addHcalPileups().

44  {
45  theEvent = event;
46  eventSetup->get<HcalDbRecord>().get(theConditions);
48  }
const edm::Event * theEvent
these fields are set in initializeEvent()
edm::ESHandle< HcalDbService > theConditions
HcalSimParameterMap * theParameterMap
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void setDbService(const HcalDbService *service)
template<class HCALDIGITIZERTRAITS>
void HcalSignalGenerator< HCALDIGITIZERTRAITS >::initializeEvent ( const edm::EventPrincipal eventPrincipal,
const edm::EventSetup eventSetup 
)
inline

some users use EventPrincipals, not Events. We support both

Definition at line 51 of file HcalSignalGenerator.h.

52  {
53  theEventPrincipal = eventPrincipal;
54  eventSetup->get<HcalDbRecord>().get(theConditions);
56  }
edm::ESHandle< HcalDbService > theConditions
const edm::EventPrincipal * theEventPrincipal
HcalSimParameterMap * theParameterMap
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void setDbService(const HcalDbService *service)
template<class HCALDIGITIZERTRAITS>
CaloSamples HcalSignalGenerator< HCALDIGITIZERTRAITS >::samplesInPE ( const DIGI digi)
inlineprivate

Definition at line 109 of file HcalSignalGenerator.h.

Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::fill().

110  {
111  // calibration, for future reference: (same block for all Hcal types)
112  HcalDetId cell = digi.id();
113  // const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
114  const HcalQIECoder* channelCoder = theConditions->getHcalCoder (cell);
115  const HcalQIEShape* channelShape = theConditions->getHcalShape (cell);
116  HcalCoderDb coder (*channelCoder, *channelShape);
118  coder.adc2fC(digi, result);
119  fC2pe(result);
120  return result;
121  }
void fC2pe(CaloSamples &samples) const
edm::ESHandle< HcalDbService > theConditions
tuple result
Definition: query.py:137

Member Data Documentation

template<class HCALDIGITIZERTRAITS>
edm::ESHandle<HcalDbService> HcalSignalGenerator< HCALDIGITIZERTRAITS >::theConditions
private
template<class HCALDIGITIZERTRAITS>
const edm::Event* HcalSignalGenerator< HCALDIGITIZERTRAITS >::theEvent
private
template<class HCALDIGITIZERTRAITS>
const edm::EventPrincipal* HcalSignalGenerator< HCALDIGITIZERTRAITS >::theEventPrincipal
private
template<class HCALDIGITIZERTRAITS>
edm::InputTag HcalSignalGenerator< HCALDIGITIZERTRAITS >::theInputTag
private

these come from the ParameterSet

Definition at line 129 of file HcalSignalGenerator.h.

Referenced by HcalSignalGenerator< HBHEDigitizerTraits >::fill().

template<class HCALDIGITIZERTRAITS>
edm::EDGetTokenT<COLLECTION> HcalSignalGenerator< HCALDIGITIZERTRAITS >::tok_
private