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 Types | Private Member Functions | Private Attributes
HcalTBDigiProducer Class Reference

#include <HcalTBDigiProducer.h>

Inheritance diagram for HcalTBDigiProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 HcalTBDigiProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~HcalTBDigiProducer ()
 
- 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 Types

typedef CaloTDigitizer
< HBHEDigitizerTraits
HBHEDigitizer
 
typedef CaloTDigitizer
< HODigitizerTraits
HODigitizer
 

Private Member Functions

void checkGeometry (const edm::EventSetup &eventSetup)
 
void setPhaseShift (const DetId &detId)
 
void sortHits (const edm::PCaloHitContainer &hits)
 fills the vectors for each subdetector More...
 
void updateGeometry ()
 

Private Attributes

bool doPhaseShift
 
std::string ecalTBInfoLabel
 
std::vector< DetIdhbheCells
 
std::vector< DetIdhoCells
 
HcalAmplifiertheAmplifier
 
HcalCoderFactorytheCoderFactory
 
HcalElectronicsSimtheElectronicsSim
 
const CaloGeometrytheGeometry
 
HBHEDigitizertheHBHEDigitizer
 
HBHEHitFilter theHBHEHitFilter
 
std::vector< PCaloHittheHBHEHits
 
CaloHitResponsetheHBHEResponse
 
CaloVShapetheHcalIntegratedShape
 
CaloVShapetheHcalShape
 
HcalHitCorrectiontheHitCorrection
 
HODigitizertheHODigitizer
 
HOHitFilter theHOHitFilter
 
std::vector< PCaloHittheHOHits
 
CaloHitResponsetheHOResponse
 
HcalTBSimParameterMaptheParameterMap
 
double thisPhaseShift
 
double tunePhaseShift
 

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 24 of file HcalTBDigiProducer.h.

Member Typedef Documentation

Reconstruction algorithm

Definition at line 48 of file HcalTBDigiProducer.h.

Definition at line 49 of file HcalTBDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file HcalTBDigiProducer.cc.

References HcalCoderFactory::DB, doPhaseShift, ecalTBInfoLabel, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), DetId::Hcal, CaloHitResponse::setHitCorrection(), CaloHitResponse::setHitFilter(), HcalTBSimParameterMap::simParameters(), theAmplifier, theCoderFactory, theElectronicsSim, theHBHEDigitizer, theHBHEHitFilter, theHBHEResponse, theHitCorrection, theHODigitizer, theHOHitFilter, theHOResponse, theParameterMap, and tunePhaseShift.

19  :
21  theHcalShape(new HcalShape()),
28 
29  produces<HBHEDigiCollection>();
30  produces<HODigiCollection>();
31 
32  DetId detId(DetId::Hcal, 1);
33  bool syncPhase = (theParameterMap->simParameters(detId)).syncPhase();
34  doPhaseShift = !syncPhase;
35 
38 
39  bool doTimeSlew = ps.getParameter<bool>("doTimeSlew");
40  if(doTimeSlew) {
41  // no time slewing for HF
45  }
46 
47  bool doNoise = ps.getParameter<bool>("doNoise");
51 
54 
55  tunePhaseShift = ps.getUntrackedParameter<double>("tunePhaseShiftTB", 1.);
56  ecalTBInfoLabel = ps.getUntrackedParameter<std::string>("EcalTBInfoLabel","SimEcalTBG4Object");
57  edm::LogInfo("HcalSim") << "HcalTBDigiProducer initialized with doNoise = "
58  << doNoise << ", doTimeSlew = " << doTimeSlew
59  << " and doPhaseShift = " << doPhaseShift
60  << " tunePhasShift = " << tunePhaseShift;
61 
62 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual const CaloSimParameters & simParameters(const DetId &id) const
CaloHitResponse * theHBHEResponse
HBHEHitFilter theHBHEHitFilter
HODigitizer * theHODigitizer
HcalElectronicsSim * theElectronicsSim
HOHitFilter theHOHitFilter
HcalTBSimParameterMap * theParameterMap
CaloTDigitizer< HBHEDigitizerTraits > HBHEDigitizer
std::vector< PCaloHit > theHBHEHits
CaloTDigitizer< HODigitizerTraits > HODigitizer
CaloVShape * theHcalIntegratedShape
void setHitFilter(const CaloVHitFilter *filter)
if you want to reject hits, for example, from a certain subdetector, set this
Creates electronics signals from hits.
HBHEDigitizer * theHBHEDigitizer
shaper for Hcal (not for HF)
Definition: HcalShape.h:15
std::vector< PCaloHit > theHOHits
Definition: DetId.h:20
CaloHitResponse * theHOResponse
HcalHitCorrection * theHitCorrection
HcalAmplifier * theAmplifier
std::string ecalTBInfoLabel
HcalCoderFactory * theCoderFactory
CaloVShape * theHcalShape
void setHitCorrection(const CaloVHitCorrection *hitCorrection)
If you want to correct hits, for attenuation or delay, set this.
HcalTBDigiProducer::~HcalTBDigiProducer ( )
virtual

Definition at line 64 of file HcalTBDigiProducer.cc.

References theAmplifier, theCoderFactory, theElectronicsSim, theHBHEDigitizer, theHBHEResponse, theHcalIntegratedShape, theHcalShape, theHitCorrection, theHODigitizer, theHOResponse, and theParameterMap.

64  {
65 
67  if (theHODigitizer) delete theHODigitizer;
68  if (theParameterMap) delete theParameterMap;
69  if (theHcalShape) delete theHcalShape;
71  if (theHBHEResponse) delete theHBHEResponse;
72  if (theHOResponse) delete theHOResponse;
74  if (theAmplifier) delete theAmplifier;
75  if (theCoderFactory) delete theCoderFactory;
77 }
CaloHitResponse * theHBHEResponse
HODigitizer * theHODigitizer
HcalElectronicsSim * theElectronicsSim
HcalTBSimParameterMap * theParameterMap
CaloVShape * theHcalIntegratedShape
HBHEDigitizer * theHBHEDigitizer
CaloHitResponse * theHOResponse
HcalHitCorrection * theHitCorrection
HcalAmplifier * theAmplifier
HcalCoderFactory * theCoderFactory
CaloVShape * theHcalShape

Member Function Documentation

void HcalTBDigiProducer::checkGeometry ( const edm::EventSetup eventSetup)
private

make sure the digitizer has the correct list of all cells that exist in the geometry

Definition at line 154 of file HcalTBDigiProducer.cc.

References geometry, edm::EventSetup::get(), theGeometry, and updateGeometry().

Referenced by produce().

154  {
155 
156  // TODO find a way to avoid doing this every event
158  eventSetup.get<CaloGeometryRecord>().get(geometry);
159 
160  const CaloGeometry * pGeometry = &*geometry;
161 
162  // see if we need to update
163  if(pGeometry != theGeometry) {
164  theGeometry = pGeometry;
165  updateGeometry();
166  }
167 }
const CaloGeometry * theGeometry
const T & get() const
Definition: EventSetup.h:55
ESHandle< TrackerGeometry > geometry
void HcalTBDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 80 of file HcalTBDigiProducer.cc.

References checkGeometry(), doPhaseShift, ecalTBInfoLabel, HcalHitCorrection::fillChargeSums(), edm::EventSetup::get(), edm::Event::getByLabel(), DetId::Hcal, LogDebug, edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), CaloTDigitizer< Traits >::run(), HcalCoderFactory::setDbService(), HcalAmplifier::setDbService(), setPhaseShift(), theAmplifier, theCoderFactory, theHBHEDigitizer, theHBHEHits, theHitCorrection, theHODigitizer, theHOHits, and thisPhaseShift.

80  {
81 
82  // get the appropriate gains, noises, & widths for this event
84  eventSetup.get<HcalDbRecord>().get(conditions);
85  theAmplifier->setDbService(conditions.product());
86  theCoderFactory->setDbService(conditions.product());
87 
88  // get the correct geometry
89  checkGeometry(eventSetup);
90 
91  theHBHEHits.clear();
92  theHOHits.clear();
93 
94  // Step A: Get Inputs
96  // e.getByType(cf);
97 
98  LogDebug("HcalSim") << "HcalTBDigiProducer::produce trying to ger SimHit";
99  // test access to SimHits
100  const std::string subdet("HcalHits");
101  // std::auto_ptr<MixCollection<PCaloHit> > col(new MixCollection<PCaloHit>(cf.product(), subdet));
102  e.getByLabel("mix", subdet, cf);
103  std::auto_ptr<MixCollection<PCaloHit> > col(new MixCollection<PCaloHit>(cf.product() ));
104 
105  LogDebug("HcalSim") << "HcalTBDigiProducer::produce Collection of SimHit found";
106  if(theHitCorrection != 0) {
108  }
109  LogDebug("HcalSim") << "HcalTBDigiProducer::produce Hits corrected";
110 
111  // Step B: Create empty output
112  std::auto_ptr<HBHEDigiCollection> hbheResult(new HBHEDigiCollection());
113  std::auto_ptr<HODigiCollection> hoResult(new HODigiCollection());
114  LogDebug("HcalSim") << "HcalTBDigiProducer::produce Empty collection created";
115  if (doPhaseShift) {
116 
117  edm::Handle<PEcalTBInfo> theEcalTBInfo;
118  e.getByLabel(ecalTBInfoLabel,theEcalTBInfo);
119  thisPhaseShift = theEcalTBInfo->phaseShift();
120 
121  DetId detIdHB(DetId::Hcal, 1);
122  setPhaseShift(detIdHB);
123  DetId detIdHO(DetId::Hcal, 3);
124  setPhaseShift(detIdHO);
125  }
126 
127  // Step C: Invoke the algorithm, passing in inputs and getting back outputs.
128  theHBHEDigitizer->run(*col, *hbheResult);
129  edm::LogInfo("HcalSim") << "HcalTBDigiProducer: HBHE digis : " << hbheResult->size();
130  theHODigitizer->run(*col, *hoResult);
131  edm::LogInfo("HcalSim") << "HcalTBDigiProducer: HO digis : " << hoResult->size();
132 
133  // Step D: Put outputs into event
134  e.put(hbheResult);
135  e.put(hoResult);
136 
137 }
#define LogDebug(id)
void setPhaseShift(const DetId &detId)
void setDbService(const HcalDbService *service)
the Producer will probably update this every event
HODigitizer * theHODigitizer
std::vector< PCaloHit > theHBHEHits
edm::SortedCollection< HODataFrame > HODigiCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
void run(MixCollection< PCaloHit > &input, DigiCollection &output)
turns hits into digis
HBHEDigitizer * theHBHEDigitizer
void fillChargeSums(MixCollection< PCaloHit > &hits)
void checkGeometry(const edm::EventSetup &eventSetup)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
std::vector< PCaloHit > theHOHits
Definition: DetId.h:20
HcalHitCorrection * theHitCorrection
void setDbService(const HcalDbService *service)
T const * product() const
Definition: ESHandle.h:62
HcalAmplifier * theAmplifier
T const * product() const
Definition: Handle.h:74
std::string ecalTBInfoLabel
HcalCoderFactory * theCoderFactory
edm::SortedCollection< HBHEDataFrame > HBHEDigiCollection
void HcalTBDigiProducer::setPhaseShift ( const DetId detId)
private

Definition at line 195 of file HcalTBDigiProducer.cc.

References ExpressReco_HICollisions_FallBack::parameters, CaloHitResponse::setPhaseShift(), HcalTBSimParameterMap::simParameters(), DetId::subdetId(), CaloSimParameters::syncPhase(), theHBHEResponse, theHOResponse, theParameterMap, thisPhaseShift, and tunePhaseShift.

Referenced by produce().

195  {
196 
198  if ( !parameters.syncPhase() ) {
199  int myDet = detId.subdetId();
200  double passPhaseShift = thisPhaseShift + tunePhaseShift;
201  if (myDet <= 2) {
202  theHBHEResponse->setPhaseShift(passPhaseShift);
203  } else {
204  theHOResponse->setPhaseShift(passPhaseShift);
205  }
206  }
207 }
virtual const CaloSimParameters & simParameters(const DetId &id) const
CaloHitResponse * theHBHEResponse
HcalTBSimParameterMap * theParameterMap
Main class for Parameters in different subdetectors.
void setPhaseShift(const double &thePhaseShift)
setting the phase shift for asynchronous trigger (e.g. test beams)
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
CaloHitResponse * theHOResponse
bool syncPhase() const
choice of the ADC time alignment (synchronous for LHC, asynchronous for test beams) ...
void HcalTBDigiProducer::sortHits ( const edm::PCaloHitContainer hits)
private

fills the vectors for each subdetector

Definition at line 139 of file HcalTBDigiProducer.cc.

References HcalBarrel, HcalEndcap, HcalOuter, theHBHEHits, and theHOHits.

139  {
140 
141  for (edm::PCaloHitContainer::const_iterator hitItr = hits.begin();
142  hitItr != hits.end(); ++hitItr) {
143  HcalSubdetector subdet = HcalDetId(hitItr->id()).subdet();
144  if(subdet == HcalBarrel || subdet == HcalEndcap) {
145  theHBHEHits.push_back(*hitItr);
146  } else if(subdet == HcalOuter) {
147  theHOHits.push_back(*hitItr);
148  } else {
149  edm::LogError("HcalSim") << "Bad HcalHit subdetector " << subdet;
150  }
151  }
152 }
std::vector< PCaloHit > theHBHEHits
HcalSubdetector
Definition: HcalAssistant.h:32
std::vector< PCaloHit > theHOHits
void HcalTBDigiProducer::updateGeometry ( )
private

Definition at line 169 of file HcalTBDigiProducer.cc.

References CaloGeometry::getValidDetIds(), hbheCells, DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, hoCells, LogDebug, CaloTDigitizer< Traits >::setDetIds(), CaloHitResponse::setGeometry(), theGeometry, theHBHEDigitizer, theHBHEResponse, theHODigitizer, and theHOResponse.

Referenced by checkGeometry().

169  {
170 
173 
174  // Get cells for HB and HE
175  hbheCells.clear();
177  std::vector<DetId> heCells = theGeometry->getValidDetIds(DetId::Hcal, HcalEndcap);
178  // combine HB & HE
179  hbheCells.insert(hbheCells.end(), heCells.begin(), heCells.end());
180 
181  // Get cells for HO
182  hoCells.clear();
184 
185  edm::LogInfo("HcalSim") << "HcalTBDigiProducer update Geometry with "
186  << hbheCells.size() << " cells in HB/HE and "
187  << hoCells.size() << " cells in HO";
188 
190  LogDebug("HcalSim") << "HcalTBDigiProducer: Set DetID's for HB/HE";
192  LogDebug("HcalSim") << "HcalTBDigiProducer: Set DetID's for HO";
193 }
#define LogDebug(id)
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
std::vector< DetId > hoCells
CaloHitResponse * theHBHEResponse
HODigitizer * theHODigitizer
const CaloGeometry * theGeometry
HBHEDigitizer * theHBHEDigitizer
std::vector< DetId > hbheCells
CaloHitResponse * theHOResponse
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:90
void setDetIds(const std::vector< DetId > &detIds)

Member Data Documentation

bool HcalTBDigiProducer::doPhaseShift
private

Definition at line 79 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer(), and produce().

std::string HcalTBDigiProducer::ecalTBInfoLabel
private

Definition at line 76 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer(), and produce().

std::vector<DetId> HcalTBDigiProducer::hbheCells
private

Definition at line 71 of file HcalTBDigiProducer.h.

Referenced by updateGeometry().

std::vector<DetId> HcalTBDigiProducer::hoCells
private

Definition at line 72 of file HcalTBDigiProducer.h.

Referenced by updateGeometry().

HcalAmplifier* HcalTBDigiProducer::theAmplifier
private

Definition at line 58 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer(), produce(), and ~HcalTBDigiProducer().

HcalCoderFactory* HcalTBDigiProducer::theCoderFactory
private

Definition at line 59 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer(), produce(), and ~HcalTBDigiProducer().

HcalElectronicsSim* HcalTBDigiProducer::theElectronicsSim
private

Definition at line 60 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer(), and ~HcalTBDigiProducer().

const CaloGeometry* HcalTBDigiProducer::theGeometry
private

Definition at line 70 of file HcalTBDigiProducer.h.

Referenced by checkGeometry(), and updateGeometry().

HBHEDigitizer* HcalTBDigiProducer::theHBHEDigitizer
private
HBHEHitFilter HcalTBDigiProducer::theHBHEHitFilter
private

Definition at line 62 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer().

std::vector<PCaloHit> HcalTBDigiProducer::theHBHEHits
private

Definition at line 74 of file HcalTBDigiProducer.h.

Referenced by produce(), and sortHits().

CaloHitResponse* HcalTBDigiProducer::theHBHEResponse
private
CaloVShape* HcalTBDigiProducer::theHcalIntegratedShape
private

Definition at line 53 of file HcalTBDigiProducer.h.

Referenced by ~HcalTBDigiProducer().

CaloVShape* HcalTBDigiProducer::theHcalShape
private

Definition at line 52 of file HcalTBDigiProducer.h.

Referenced by ~HcalTBDigiProducer().

HcalHitCorrection* HcalTBDigiProducer::theHitCorrection
private

Definition at line 65 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer(), produce(), and ~HcalTBDigiProducer().

HODigitizer* HcalTBDigiProducer::theHODigitizer
private
HOHitFilter HcalTBDigiProducer::theHOHitFilter
private

Definition at line 63 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer().

std::vector<PCaloHit> HcalTBDigiProducer::theHOHits
private

Definition at line 74 of file HcalTBDigiProducer.h.

Referenced by produce(), and sortHits().

CaloHitResponse* HcalTBDigiProducer::theHOResponse
private
HcalTBSimParameterMap* HcalTBDigiProducer::theParameterMap
private

Definition at line 51 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer(), setPhaseShift(), and ~HcalTBDigiProducer().

double HcalTBDigiProducer::thisPhaseShift
private

Definition at line 77 of file HcalTBDigiProducer.h.

Referenced by produce(), and setPhaseShift().

double HcalTBDigiProducer::tunePhaseShift
private

Definition at line 80 of file HcalTBDigiProducer.h.

Referenced by HcalTBDigiProducer(), and setPhaseShift().