30 #include <boost/foreach.hpp> 45 theHBHESiPMResponse(new
HcalSiPMHitResponse(theParameterMap, theShapes, ps.getParameter<bool>(
"HcalPreMixStage1"),
true)),
47 theHOSiPMResponse(new
HcalSiPMHitResponse(theParameterMap, theShapes, ps.getParameter<bool>(
"HcalPreMixStage1"),
false)),
55 theHFQIE10Amplifier(0),
56 theHBHEQIE11Amplifier(0),
59 theHBHEElectronicsSim(0),
60 theHFElectronicsSim(0),
61 theHOElectronicsSim(0),
62 theZDCElectronicsSim(0),
63 theHFQIE10ElectronicsSim(0),
64 theHBHEQIE11ElectronicsSim(0),
66 theHBHEQIE11HitFilter(),
68 theHFQIE10HitFilter(),
74 theHOSiPMDigitizer(0),
77 theHFQIE10Digitizer(0),
78 theHBHEQIE11Digitizer(0),
86 doHFWindow_(ps.getParameter<bool>(
"doHFWindow")),
87 killHE_(ps.getParameter<bool>(
"killHE")),
88 debugCS_(ps.getParameter<bool>(
"debugCaloSamples")),
89 ignoreTime_(ps.getParameter<bool>(
"ignoreGeantTime")),
90 injectTestHits_(ps.getParameter<bool>(
"injectTestHits")),
91 hitsProducer_(ps.getParameter<
std::
string>(
"hitsProducer")),
94 agingFlagHB(ps.getParameter<bool>(
"HBDarkening")),
95 agingFlagHE(ps.getParameter<bool>(
"HEDarkening")),
99 injectedHitsEnergy_(ps.getParameter<
std::vector<double>>(
"injectTestHitsEnergy")),
100 injectedHitsTime_(ps.getParameter<
std::vector<double>>(
"injectTestHitsTime")),
101 injectedHitsCells_(ps.getParameter<
std::vector<
int>>(
"injectTestHitsCells"))
108 bool PreMix1 = ps.
getParameter<
bool>(
"HcalPreMixStage1");
109 bool PreMix2 = ps.
getParameter<
bool>(
"HcalPreMixStage2");
112 bool agingFlagHF = ps.
getParameter<
bool>(
"HFDarkening");
115 if(PreMix1 && PreMix2) {
117 <<
"HcalDigitizer cannot operate in PreMixing digitization and PreMixing\n" 118 "digi combination modes at the same time. Please set one mode to False\n" 119 "in the configuration file.";
329 std::vector<PCaloHit> hcalHitsOrig = *hcalHandle.product();
331 std::vector<PCaloHit> hcalHits;
332 hcalHits.reserve(hcalHitsOrig.size());
345 for (
unsigned int i=0;
i< hcalHitsOrig.size();
i++) {
349 edm::LogError(
"HcalDigitizer") <<
"bad hcal id found in digitizer. Skipping " <<
id.rawId() <<
" " << hid << std::endl;
362 std::cout <<
"HcalDigitizer format " << hid.
oldFormat() <<
" for " << hid << std::endl;
368 hcalHitsOrig[
i].setID(newid.
rawId());
369 hcalHits.push_back(hcalHitsOrig[
i]);
388 edm::LogInfo(
"HcalDigitizer") <<
"We don't have HCAL hit collection available ";
396 edm::LogInfo(
"HcalDigitizer") <<
"We don't have ZDC hit collection available ";
445 std::unique_ptr<QIE10DigiCollection> hfQIE10Result(
452 std::unique_ptr<QIE11DigiCollection> hbheQIE11Result(
478 edm::LogInfo(
"HcalDigitizer") <<
"HCAL HBHE digis : " << hbheResult->size();
479 edm::LogInfo(
"HcalDigitizer") <<
"HCAL HO digis : " << hoResult->size();
480 edm::LogInfo(
"HcalDigitizer") <<
"HCAL HF digis : " << hfResult->size();
481 edm::LogInfo(
"HcalDigitizer") <<
"HCAL ZDC digis : " << zdcResult->size();
482 edm::LogInfo(
"HcalDigitizer") <<
"HCAL HF QIE10 digis : " << hfQIE10Result->size();
483 edm::LogInfo(
"HcalDigitizer") <<
"HCAL HBHE QIE11 digis : " << hbheQIE11Result->size();
487 std::cout <<
"HCAL HBHE digis : " << hbheResult->size() << std::endl;
488 std::cout <<
"HCAL HO digis : " << hoResult->size() << std::endl;
489 std::cout <<
"HCAL HF digis : " << hfResult->size() << std::endl;
490 std::cout <<
"HCAL ZDC digis : " << zdcResult->size() << std::endl;
491 std::cout <<
"HCAL HF QIE10 digis : " << hfQIE10Result->size() << std::endl;
492 std::cout <<
"HCAL HBHE QIE11 digis : " << hbheQIE11Result->size() << std::endl;
500 e.
put(
std::move(hfQIE10Result),
"HFQIE10DigiCollection");
501 e.
put(
std::move(hbheQIE11Result),
"HBHEQIE11DigiCollection");
523 std::cout << std::endl <<
"========> HcalDigitizer e.put " << std::endl << std::endl;
585 if(zdcCells.empty())
zdcgeo =
false;
586 if(hbCells.empty() && heCells.empty())
hbhegeo =
false;
587 if(hoCells.empty())
hogeo =
false;
588 if(hfCells.empty())
hfgeo =
false;
614 std::vector<DetId> testCells;
625 if(testSubdet==
HcalBarrel) testCells = hbCells;
626 else if(testSubdet==
HcalEndcap) testCells = heCells;
627 else if(testSubdet==
HcalForward) testCells = hfCells;
628 else if(testSubdet==
HcalOuter) testCells = hoCells;
629 else throw cms::Exception(
"Configuration") <<
"Unknown subdet " << testSubdet <<
" for HCAL test hit injection";
635 for(
auto& aCell: testCells){
653 if (qieTypes.topo()==0) {
657 for(std::vector<DetId>::const_iterator detItr = allCells.begin(); detItr != allCells.end(); ++detItr) {
659 if(qieType ==
QIE8) {
661 }
else if(qieType ==
QIE10) {
692 if (qieTypes.topo()==0) {
696 for(std::vector<DetId>::const_iterator detItr = allCells.begin(); detItr != allCells.end(); ++detItr) {
698 if(qieType ==
QIE8) {
701 else if(qieType ==
QIE11) {
736 std::vector<HcalDetId> zecotekDetIds, hamamatsuDetIds;
743 if (mcParams.topo()==0) {
747 for(std::vector<DetId>::const_iterator detItr = allCells.begin(); detItr != allCells.end(); ++detItr) {
748 int shapeType = mcParams.getValues(*detItr)->signalShape();
750 zecotekDetIds.emplace_back(*detItr);
753 hamamatsuDetIds.emplace_back(*detItr);
787 for (
unsigned int ii=0;
ii<hcalHits.size(); ++
ii) {
788 uint32_t tmpId = hcalHits[
ii].id();
792 bool darkened =
false;
812 if(darkened) hcalHits[
ii].setEnergy(hcalHits[
ii].energy()*dweight);
HFHitFilter theHFQIE10HitFilter
std::vector< DetId > theHFQIE10DetIds
int bunchCrossing() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
QIE10Digitizer * theHFQIE10Digitizer
T getParameter(std::string const &) const
std::vector< int > injectedHitsCells_
void setGeometry(const CaloGeometry *geometry)
geometry needed for time-of-flight
void setDbService(const HcalDbService *service)
the Producer will probably update this every event
HBHEHitFilter theHBHEHitFilter
CaloHitResponse * theHFQIE10Response
std::vector< PCaloHit > PCaloHitContainer
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void setQIE10NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
std::vector< CaloSamples > CaloSamplesCollection
const HcalDDDRecConstants * theRecNumber
void add(const std::vector< PCaloHit > &hits, int bunchCrossing, CLHEP::HepRandomEngine *engine)
void setParameterMap(HcalSimParameterMap *map)
HcalSubdetector subdet() const
get the subdetector
virtual const CaloSimParameters & simParameters(const DetId &id) const
HcalElectronicsSim * theHFElectronicsSim
void buildHFQIECells(const std::vector< DetId > &allCells, const edm::EventSetup &eventSetup)
HBHEDigitizer * theHBHEDigitizer
HcalElectronicsSim * theHBHEQIE11ElectronicsSim
HOHitFilter theHOHitFilter
void darkening(std::vector< PCaloHit > &hcalHits)
HFDigitizer * theHFDigitizer
HFHitFilter theHFHitFilter
CaloTDigitizer< HODigitizerTraits, CaloTDigitizerQIE8Run > HODigitizer
void checkGeometry(const edm::EventSetup &eventSetup)
HcalSimParameterMap * theParameterMap
bool validHcal(const HcalDetId &id) const
void setPECorrection(const CaloVPECorrection *peCorrection)
if you want to correct the photoelectrons
CaloTDigitizer< HBHEDigitizerTraits, CaloTDigitizerQIE8Run > HBHEDigitizer
HcalTimeSlewSim * theTimeSlewSim
void buildHBHEQIECells(const std::vector< DetId > &allCells, const edm::EventSetup &eventSetup)
void setGeometry(const HcalDDDRecConstants *&)
HcalAmplifier * theHFAmplifier
HcalCoderFactory * theCoderFactory
HcalHitRelabeller * theRelabeller
edm::SortedCollection< ZDCDataFrame > ZDCDigiCollection
HcalDataFrameContainer< QIE10DataFrame > QIE10DigiCollection
void initializeEvent(edm::Event const &e, edm::EventSetup const &c)
std::unique_ptr< HFRecalibration > m_HFRecalibration
void setDbService(const HcalDbService *service)
void setIonFeedbackSim(HPDIonFeedbackSim *feedbackSim)
HcalAmplifier * theHBHEQIE11Amplifier
uint32_t rawId() const
get the raw id
void accumulate(edm::Event const &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *)
std::vector< double > injectedHitsEnergy_
void setQIE11NoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void setHOZecotekDetIds(const std::vector< HcalDetId > &ids)
const HBHEDarkening * m_HEDarkening
HcalAmplifier * theHBHEAmplifier
edm::SortedCollection< HODataFrame > HODigiCollection
std::string hitsProducer_
HcalElectronicsSim * theHOElectronicsSim
void setElectronicsSim(HcalElectronicsSim *electronicsSim)
void setHitFilter(const CaloVHitFilter *filter)
if you want to reject hits, for example, from a certain subdetector, set this
Creates electronics signals from hits.
void setHFNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
void buildHOSiPMCells(const std::vector< DetId > &allCells, const edm::EventSetup &eventSetup)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
ZDCHitFilter theZDCHitFilter
HPDIonFeedbackSim * theIonFeedback
CaloTDigitizer< ZDCDigitizerTraits, CaloTDigitizerQIE8Run > ZDCDigitizer
CaloHitResponse * theHOResponse
CaloHitResponse * theHOSiPMResponse
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
std::vector< double > injectedHitsTime_
ZDCDigitizer * theZDCDigitizer
static const size_type MAXSAMPLES
void setNoiseSignalGenerator(CaloVNoiseSignalGenerator *generator)
std::vector< DetId > theHOHPDDetIds
int readoutFrameSize() const
for now, the LinearFrames and trhe digis will be one-to-one.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
CaloHitResponse * theZDCResponse
CaloTDigitizer< HFDigitizerTraits, CaloTDigitizerQIE8Run > HFDigitizer
void setNoiseSignalGenerator(const CaloVNoiseSignalGenerator *noiseSignalGenerator)
HcalDataFrameContainer< QIE11DataFrame > QIE11DigiCollection
HcalElectronicsSim * theZDCElectronicsSim
static const int SubdetectorId
void beginRun(const edm::EventSetup &es)
void process(std::vector< PCaloHit > &hcalHits)
void setTimeSlewSim(HcalTimeSlewSim *timeSlewSim)
void setHOHamamatsuDetIds(const std::vector< HcalDetId > &ids)
void accumulateCaloHits(edm::Handle< std::vector< PCaloHit > > const &hcalHits, edm::Handle< std::vector< PCaloHit > > const &zdcHits, int bunchCrossing, CLHEP::HepRandomEngine *, const HcalTopology *h)
HcalAmplifier * theHOAmplifier
std::vector< DetId > theHFQIE8DetIds
void setDbService(const HcalDbService *service)
HcalElectronicsSim * theHBHEElectronicsSim
void run(MixCollection< PCaloHit > &, DigiCollection &)
turns hits into digis
CaloHitResponse * theHBHEResponse
HODigitizer * theHODigitizer
void setDetIds(const std::vector< DetId > &detIds)
std::vector< DetId > theHOSiPMDetIds
HOHitFilter theHOSiPMHitFilter
const CaloGeometry * theGeometry
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
std::vector< DetId > hbheCells
std::vector< std::vector< double > > tmp
ESHandle< TrackerGeometry > geometry
const HBHEDarkening * m_HBDarkening
CaloHitResponse * theHFResponse
CaloTDigitizer< HcalQIE11DigitizerTraits, CaloTDigitizerQIE1011Run > QIE11Digitizer
HcalElectronicsSim * theHFQIE10ElectronicsSim
HODigitizer * theHOSiPMDigitizer
QIE11Digitizer * theHBHEQIE11Digitizer
HBHEHitFilter theHBHEQIE11HitFilter
bool getByLabel(edm::InputTag const &tag, edm::Handle< T > &result) const
void setZDCNoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
std::vector< DetId > theHBHEQIE8DetIds
edm::SortedCollection< HFDataFrame > HFDigiCollection
void beginRun(edm::EventSetup const &es)
void setDebugCaloSamples(bool debug)
CaloHitResponse * theHBHESiPMResponse
CaloTDigitizer< HcalQIE10DigitizerTraits, CaloTDigitizerQIE1011Run > QIE10Digitizer
void updateGeometry(const edm::EventSetup &eventSetup)
void setHBHENoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
T const * product() const
HcalAmplifier * theZDCAmplifier
std::vector< DetId > theHBHEQIE11DetIds
const CaloSamplesCollection & getCaloSamples() const
void setTopo(const HcalTopology *topo)
void setDbService(const HcalDbService *service)
void setDetIds(const std::vector< DetId > &detIds)
void setIgnoreGeantTime(bool gt)
edm::SortedCollection< HBHEDataFrame > HBHEDigiCollection
float degradation(float intlumi, int ieta, int lay) const
std::vector< PCaloHit > injectedHits_
void finalizeEvent(edm::Event &e, edm::EventSetup const &c, CLHEP::HepRandomEngine *)
HcalAmplifier * theHFQIE10Amplifier
void setHONoiseSignalGenerator(HcalBaseSignalGenerator *noiseGenerator)
HcalDigitizer(const edm::ParameterSet &ps, edm::ConsumesCollector &iC)