28 reco_(conf.getParameter<
bool>(
"correctForTimeslew"),
29 conf.getParameter<
bool>(
"correctForPhaseContainment"),
30 conf.getParameter<double>(
"correctionPhaseNS")),
32 inputLabel_(conf.getParameter<
edm::InputTag>(
"digiLabel")),
33 correctTiming_(conf.getParameter<
bool>(
"correctTiming")),
34 setNoiseFlags_(conf.getParameter<
bool>(
"setNoiseFlags")),
35 setHSCPFlags_(conf.getParameter<
bool>(
"setHSCPFlags")),
36 setSaturationFlags_(conf.getParameter<
bool>(
"setSaturationFlags")),
37 setTimingTrustFlags_(conf.getParameter<
bool>(
"setTimingTrustFlags")),
38 setPulseShapeFlags_(conf.getParameter<
bool>(
"setPulseShapeFlags")),
39 setNegativeFlags_(
false),
40 dropZSmarkedPassed_(conf.getParameter<
bool>(
"dropZSmarkedPassed")),
41 firstAuxTS_(conf.getParameter<
int>(
"firstAuxTS")),
42 firstSample_(conf.getParameter<
int>(
"firstSample")),
43 samplesToAdd_(conf.getParameter<
int>(
"samplesToAdd")),
44 tsFromDB_(conf.getParameter<
bool>(
"tsFromDB")),
45 useLeakCorrection_(conf.getParameter<
bool>(
"useLeakCorrection")),
46 dataOOTCorrectionName_(
""),
47 dataOOTCorrectionCategory_(
"Data"),
48 mcOOTCorrectionName_(
""),
49 mcOOTCorrectionCategory_(
"MC"),
70 if (conf.
existsAs<
bool>(
"setNegativeFlags"))
89 if (!strcasecmp(subd.c_str(),
"HO")) {
93 produces<HORecHitCollection>();
94 }
else if (!strcasecmp(subd.c_str(),
"HF")) {
115 psS9S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
116 psS9S1.
getParameter<std::vector<double> >(
"shortETParams"),
117 psS9S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
118 psS9S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
119 psS9S1.
getParameter<std::vector<double> >(
"longETParams"),
126 psS8S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
127 psS8S1.
getParameter<std::vector<double> >(
"shortETParams"),
128 psS8S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
129 psS8S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
130 psS8S1.
getParameter<std::vector<double> >(
"longETParams"),
137 psPET.
getParameter<std::vector<double> >(
"shortEnergyParams"),
138 psPET.
getParameter<std::vector<double> >(
"shortETParams"),
140 psPET.
getParameter<std::vector<double> >(
"longEnergyParams"),
141 psPET.
getParameter<std::vector<double> >(
"longETParams"),
147 produces<HFRecHitCollection>();
148 }
else if (!strcasecmp(subd.c_str(),
"ZDC")) {
151 produces<ZDCRecHitCollection>();
152 }
else if (!strcasecmp(subd.c_str(),
"CALIB")) {
155 produces<HcalCalibRecHitCollection>();
157 edm::LogWarning(
"Configuration") <<
"HcalHitReconstructor is not associated with a specific subdetector!" << std::endl;
263 auto rec = std::make_unique<HORecHitCollection>();
264 rec->reserve(digi->
size());
269 int favorite_capid = 0;
271 long capid_votes[4] = {0,0,0,0};
272 for (i=digi->
begin(); i!=digi->
end(); i++) {
273 capid_votes[(*i)[0].capid()]++;
275 for (
int k = 0;
k < 4;
k++)
276 if (capid_votes[
k] > capid_votes[favorite_capid])
280 for (i=digi->
begin(); i!=digi->
end(); i++) {
309 if (i->zsMarkAndPass())
continue;
322 for (
int xx=fTS;
xx<fTS+4 &&
xx<i->size();++
xx)
323 auxflag+=(i->sample(
xx).adc())<<(7*(
xx-fTS));
325 auxflag+=((i->sample(fTS).capid())<<28);
326 (rec->back()).setAux(auxflag);
349 auto rec = std::make_unique<HFRecHitCollection>();
350 rec->reserve(digi->
size());
355 int favorite_capid = 0;
357 long capid_votes[4] = {0,0,0,0};
358 for (i=digi->
begin(); i!=digi->
end(); i++) {
359 capid_votes[(*i)[0].capid()]++;
361 for (
int k = 0;
k < 4;
k++)
362 if (capid_votes[
k] > capid_votes[favorite_capid])
366 for (i=digi->
begin(); i!=digi->
end(); i++) {
395 if (i->zsMarkAndPass())
continue;
421 for (
int xx=fTS;
xx<fTS+4 &&
xx<i->size();++
xx)
422 auxflag+=(i->sample(
xx).adc())<<(7*(
xx-fTS));
424 auxflag+=((i->sample(fTS).capid())<<28);
425 (rec->back()).setAux(auxflag);
455 int depth=i->id().depth();
456 int ieta=i->id().ieta();
458 if (depth==2 ||
abs(ieta)==29 )
465 int depth=i->id().depth();
466 int ieta=i->id().ieta();
468 if (depth==2 ||
abs(ieta)==29 )
475 int depth=i->id().depth();
476 int ieta=i->id().ieta();
478 if (depth==1 &&
abs(ieta)!=29 )
490 auto rec = std::make_unique<HcalCalibRecHitCollection>();
491 rec->reserve(digi->
size());
497 for (i=digi->
begin(); i!=digi->
end(); i++) {
505 if (i->zsMarkAndPass())
continue;
unsigned int firstSample() const
T getParameter(std::string const &) const
void HFSetFlagFromS9S1(HFRecHit &hf, HFRecHitCollection &rec, const HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
std::string mcOOTCorrectionName_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void beginRun(edm::Run const &r, edm::EventSetup const &es) final
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void setHFTimingTrustFlag(HFRecHit &rechit, const HFDataFrame &digi)
unsigned int pileupCleaningID() const
HcalADCSaturationFlag * saturationFlagSetter_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void produce(edm::Event &e, const edm::EventSetup &c) override
uint32_t HFdigiflagSamplesToAdd() const
void beginRun(edm::EventSetup const &es)
bool correctForPhaseContainment() const
~HcalHitReconstructor() override
void hfSetFlagFromDigi(HFRecHit &hf, const HFDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib)
std::vector< HODataFrame >::const_iterator const_iterator
const Item * getValues(DetId fId, bool throwOnFail=true) const
void resetParamsFromDB(int firstSample, int samplesToAdd, int expectedPeak, double minthreshold, const std::vector< double > &coef)
SetCorrectionFcn setPileupCorrection_
void HFSetFlagFromPET(HFRecHit &hf, HFRecHitCollection &rec, const HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
uint32_t rawId() const
get the raw id
std::string dataOOTCorrectionCategory_
std::unique_ptr< HcalFlagHFDigiTimeParams > HFDigiTimeParams
bool correctForTimeslew() const
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
bool correctTiming() const
Abs< T >::type abs(const T &t)
HcalHFStatusBitFromDigis * hfdigibit_
bool dropChannel(const uint32_t &mystatus) const
uint32_t HFdigiflagExpectedPeak() const
HFRecHit reconstruct(const HFDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
unsigned int samplesToAdd() const
edm::EDGetTokenT< HODigiCollection > tok_ho_
HcalHitReconstructor(const edm::ParameterSet &ps)
float correctionPhaseNS() const
std::vector< HFRecHit >::iterator iterator
const_iterator end() const
std::vector< double > HFdigiflagCoefficients() const
HcalHF_PETalgorithm * hfPET_
HcalHF_S9S1algorithm * hfS9S1_
static const int SubdetectorId
void setRecoParams(bool correctForTimeslew, bool correctForPulse, bool setLeakCorrection, int pileupCleaningID, float phaseNS)
uint32_t HFdigiflagFirstSample() const
correctForPhaseContainment
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
std::string dataOOTCorrectionName_
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
HcalHF_S9S1algorithm * hfS8S1_
HcalOtherSubdetector subdetOther_
static void Correct(HBHERecHit &rechit, const HBHEDataFrame &digi, int favorite_capid)
edm::InputTag inputLabel_
unsigned int firstAuxTS() const
bool setTimingTrustFlags_
void endRun(edm::Run const &r, edm::EventSetup const &es) final
HFTimingTrustFlag * HFTimingTrustFlagSetter_
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
std::string mcOOTCorrectionCategory_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
T const * product() const
void setTopo(const HcalTopology *topo)
const_iterator begin() const
double HFdigiflagMinEThreshold() const
bool useLeakCorrection() const