#include <HcalTBDigiProducer.h>
Definition at line 24 of file HcalTBDigiProducer.h.
typedef CaloTDigitizer<HBHEDigitizerTraits> HcalTBDigiProducer::HBHEDigitizer [private] |
Reconstruction algorithm
Definition at line 48 of file HcalTBDigiProducer.h.
typedef CaloTDigitizer<HODigitizerTraits> HcalTBDigiProducer::HODigitizer [private] |
Definition at line 49 of file HcalTBDigiProducer.h.
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.
: theParameterMap(new HcalTBSimParameterMap(ps)), theHcalShape(new HcalShape()), theHcalIntegratedShape(new CaloShapeIntegrator(theHcalShape)), theHBHEResponse(new CaloHitResponse(theParameterMap, theHcalIntegratedShape)), theHOResponse(new CaloHitResponse(theParameterMap, theHcalIntegratedShape)), theAmplifier(0), theCoderFactory(0), theElectronicsSim(0), theHitCorrection(0), theHBHEDigitizer(0), theHODigitizer(0), theHBHEHits(), theHOHits(), thisPhaseShift(0) { produces<HBHEDigiCollection>(); produces<HODigiCollection>(); DetId detId(DetId::Hcal, 1); bool syncPhase = (theParameterMap->simParameters(detId)).syncPhase(); doPhaseShift = !syncPhase; theHBHEResponse->setHitFilter(&theHBHEHitFilter); theHOResponse->setHitFilter(&theHOHitFilter); bool doTimeSlew = ps.getParameter<bool>("doTimeSlew"); if(doTimeSlew) { // no time slewing for HF theHitCorrection = new HcalHitCorrection(theParameterMap); theHBHEResponse->setHitCorrection(theHitCorrection); theHOResponse->setHitCorrection(theHitCorrection); } bool doNoise = ps.getParameter<bool>("doNoise"); theAmplifier = new HcalAmplifier(theParameterMap, doNoise); theCoderFactory = new HcalCoderFactory(HcalCoderFactory::DB); theElectronicsSim = new HcalElectronicsSim(theAmplifier, theCoderFactory); theHBHEDigitizer = new HBHEDigitizer(theHBHEResponse, theElectronicsSim, doNoise); theHODigitizer = new HODigitizer(theHOResponse, theElectronicsSim, doNoise); tunePhaseShift = ps.getUntrackedParameter<double>("tunePhaseShiftTB", 1.); ecalTBInfoLabel = ps.getUntrackedParameter<std::string>("EcalTBInfoLabel","SimEcalTBG4Object"); edm::LogInfo("HcalSim") << "HcalTBDigiProducer initialized with doNoise = " << doNoise << ", doTimeSlew = " << doTimeSlew << " and doPhaseShift = " << doPhaseShift << " tunePhasShift = " << tunePhaseShift; }
HcalTBDigiProducer::~HcalTBDigiProducer | ( | ) | [virtual] |
Definition at line 64 of file HcalTBDigiProducer.cc.
References theAmplifier, theCoderFactory, theElectronicsSim, theHBHEDigitizer, theHBHEResponse, theHcalIntegratedShape, theHcalShape, theHitCorrection, theHODigitizer, theHOResponse, and theParameterMap.
{ if (theHBHEDigitizer) delete theHBHEDigitizer; if (theHODigitizer) delete theHODigitizer; if (theParameterMap) delete theParameterMap; if (theHcalShape) delete theHcalShape; if (theHcalIntegratedShape) delete theHcalIntegratedShape; if (theHBHEResponse) delete theHBHEResponse; if (theHOResponse) delete theHOResponse; if (theElectronicsSim) delete theElectronicsSim; if (theAmplifier) delete theAmplifier; if (theCoderFactory) delete theCoderFactory; if (theHitCorrection) delete theHitCorrection; }
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().
{ // TODO find a way to avoid doing this every event edm::ESHandle<CaloGeometry> geometry; eventSetup.get<CaloGeometryRecord>().get(geometry); const CaloGeometry * pGeometry = &*geometry; // see if we need to update if(pGeometry != theGeometry) { theGeometry = pGeometry; updateGeometry(); } }
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::ESHandle< T >::product(), edm::Handle< T >::product(), edm::Event::put(), CaloTDigitizer< Traits >::run(), HcalCoderFactory::setDbService(), HcalAmplifier::setDbService(), setPhaseShift(), theAmplifier, theCoderFactory, theHBHEDigitizer, theHBHEHits, theHitCorrection, theHODigitizer, theHOHits, and thisPhaseShift.
{ // get the appropriate gains, noises, & widths for this event edm::ESHandle<HcalDbService> conditions; eventSetup.get<HcalDbRecord>().get(conditions); theAmplifier->setDbService(conditions.product()); theCoderFactory->setDbService(conditions.product()); // get the correct geometry checkGeometry(eventSetup); theHBHEHits.clear(); theHOHits.clear(); // Step A: Get Inputs edm::Handle<CrossingFrame<PCaloHit> > cf; // e.getByType(cf); LogDebug("HcalSim") << "HcalTBDigiProducer::produce trying to ger SimHit"; // test access to SimHits const std::string subdet("HcalHits"); // std::auto_ptr<MixCollection<PCaloHit> > col(new MixCollection<PCaloHit>(cf.product(), subdet)); e.getByLabel("mix", subdet, cf); std::auto_ptr<MixCollection<PCaloHit> > col(new MixCollection<PCaloHit>(cf.product() )); LogDebug("HcalSim") << "HcalTBDigiProducer::produce Collection of SimHit found"; if(theHitCorrection != 0) { theHitCorrection->fillChargeSums(*col); } LogDebug("HcalSim") << "HcalTBDigiProducer::produce Hits corrected"; // Step B: Create empty output std::auto_ptr<HBHEDigiCollection> hbheResult(new HBHEDigiCollection()); std::auto_ptr<HODigiCollection> hoResult(new HODigiCollection()); LogDebug("HcalSim") << "HcalTBDigiProducer::produce Empty collection created"; if (doPhaseShift) { edm::Handle<PEcalTBInfo> theEcalTBInfo; e.getByLabel(ecalTBInfoLabel,theEcalTBInfo); thisPhaseShift = theEcalTBInfo->phaseShift(); DetId detIdHB(DetId::Hcal, 1); setPhaseShift(detIdHB); DetId detIdHO(DetId::Hcal, 3); setPhaseShift(detIdHO); } // Step C: Invoke the algorithm, passing in inputs and getting back outputs. theHBHEDigitizer->run(*col, *hbheResult); edm::LogInfo("HcalSim") << "HcalTBDigiProducer: HBHE digis : " << hbheResult->size(); theHODigitizer->run(*col, *hoResult); edm::LogInfo("HcalSim") << "HcalTBDigiProducer: HO digis : " << hoResult->size(); // Step D: Put outputs into event e.put(hbheResult); e.put(hoResult); }
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().
{ const CaloSimParameters & parameters = theParameterMap->simParameters(detId); if ( !parameters.syncPhase() ) { int myDet = detId.subdetId(); double passPhaseShift = thisPhaseShift + tunePhaseShift; if (myDet <= 2) { theHBHEResponse->setPhaseShift(passPhaseShift); } else { theHOResponse->setPhaseShift(passPhaseShift); } } }
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.
{ for (edm::PCaloHitContainer::const_iterator hitItr = hits.begin(); hitItr != hits.end(); ++hitItr) { HcalSubdetector subdet = HcalDetId(hitItr->id()).subdet(); if(subdet == HcalBarrel || subdet == HcalEndcap) { theHBHEHits.push_back(*hitItr); } else if(subdet == HcalOuter) { theHOHits.push_back(*hitItr); } else { edm::LogError("HcalSim") << "Bad HcalHit subdetector " << subdet; } } }
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().
{ theHBHEResponse->setGeometry(theGeometry); theHOResponse->setGeometry(theGeometry); // Get cells for HB and HE hbheCells.clear(); hbheCells = theGeometry->getValidDetIds(DetId::Hcal, HcalBarrel); std::vector<DetId> heCells = theGeometry->getValidDetIds(DetId::Hcal, HcalEndcap); // combine HB & HE hbheCells.insert(hbheCells.end(), heCells.begin(), heCells.end()); // Get cells for HO hoCells.clear(); hoCells = theGeometry->getValidDetIds(DetId::Hcal, HcalOuter); edm::LogInfo("HcalSim") << "HcalTBDigiProducer update Geometry with " << hbheCells.size() << " cells in HB/HE and " << hoCells.size() << " cells in HO"; theHBHEDigitizer->setDetIds(hbheCells); LogDebug("HcalSim") << "HcalTBDigiProducer: Set DetID's for HB/HE"; theHODigitizer->setDetIds(hoCells); LogDebug("HcalSim") << "HcalTBDigiProducer: Set DetID's for HO"; }
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().
Definition at line 59 of file HcalTBDigiProducer.h.
Referenced by HcalTBDigiProducer(), produce(), and ~HcalTBDigiProducer().
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().
Definition at line 67 of file HcalTBDigiProducer.h.
Referenced by HcalTBDigiProducer(), produce(), updateGeometry(), and ~HcalTBDigiProducer().
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().
Definition at line 55 of file HcalTBDigiProducer.h.
Referenced by HcalTBDigiProducer(), setPhaseShift(), updateGeometry(), and ~HcalTBDigiProducer().
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().
Definition at line 65 of file HcalTBDigiProducer.h.
Referenced by HcalTBDigiProducer(), produce(), and ~HcalTBDigiProducer().
HODigitizer* HcalTBDigiProducer::theHODigitizer [private] |
Definition at line 68 of file HcalTBDigiProducer.h.
Referenced by HcalTBDigiProducer(), produce(), updateGeometry(), and ~HcalTBDigiProducer().
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] |
Definition at line 56 of file HcalTBDigiProducer.h.
Referenced by HcalTBDigiProducer(), setPhaseShift(), updateGeometry(), and ~HcalTBDigiProducer().
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().