22 reco_(conf.getParameter<bool>(
"correctForTimeslew"),
23 conf.getParameter<bool>(
"correctForPhaseContainment"),
24 conf.getParameter<double>(
"correctionPhaseNS")),
26 inputLabel_(conf.getParameter<edm::InputTag>(
"digiLabel")),
27 correctTiming_(conf.getParameter<bool>(
"correctTiming")),
28 setNoiseFlags_(conf.getParameter<bool>(
"setNoiseFlags")),
29 setHSCPFlags_(conf.getParameter<bool>(
"setHSCPFlags")),
30 setSaturationFlags_(conf.getParameter<bool>(
"setSaturationFlags")),
31 setTimingTrustFlags_(conf.getParameter<bool>(
"setTimingTrustFlags")),
32 setPulseShapeFlags_(conf.getParameter<bool>(
"setPulseShapeFlags")),
33 dropZSmarkedPassed_(conf.getParameter<bool>(
"dropZSmarkedPassed")),
34 firstAuxTS_(conf.getParameter<int>(
"firstAuxTS")),
35 firstSample_(conf.getParameter<int>(
"firstSample")),
36 samplesToAdd_(conf.getParameter<int>(
"samplesToAdd")),
37 tsFromDB_(conf.getParameter<bool>(
"tsFromDB")),
38 useLeakCorrection_( conf.getParameter<bool>(
"useLeakCorrection")),
79 if (!strcasecmp(subd.c_str(),
"HBHE")) {
81 bool timingShapedCutsFlags = conf.
getParameter<
bool>(
"setTimingShapedCutsFlags");
82 if (timingShapedCutsFlags)
98 psdigi.
getParameter<std::vector<edm::ParameterSet> >(
"pulseShapeParameterSets")
120 psPulseShape.
getParameter<
double>(
"MinimumChargeThreshold"),
121 psPulseShape.
getParameter<
double>(
"TS4TS5ChargeThreshold"),
122 psPulseShape.
getParameter<
unsigned int>(
"TrianglePeakTS"),
123 psPulseShape.
getParameter<std::vector<double> >(
"LinearThreshold"),
124 psPulseShape.
getParameter<std::vector<double> >(
"LinearCut"),
125 psPulseShape.
getParameter<std::vector<double> >(
"RMS8MaxThreshold"),
126 psPulseShape.
getParameter<std::vector<double> >(
"RMS8MaxCut"),
127 psPulseShape.
getParameter<std::vector<double> >(
"LeftSlopeThreshold"),
128 psPulseShape.
getParameter<std::vector<double> >(
"LeftSlopeCut"),
129 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeThreshold"),
130 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeCut"),
131 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeSmallThreshold"),
132 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeSmallCut"),
133 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold"),
134 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5LowerCut"),
135 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold"),
136 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5UpperCut"),
141 produces<HBHERecHitCollection>();
142 }
else if (!strcasecmp(subd.c_str(),
"HO")) {
144 produces<HORecHitCollection>();
145 }
else if (!strcasecmp(subd.c_str(),
"HF")) {
164 psS9S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
165 psS9S1.
getParameter<std::vector<double> >(
"shortETParams"),
166 psS9S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
167 psS9S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
168 psS9S1.
getParameter<std::vector<double> >(
"longETParams"),
175 psS8S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
176 psS8S1.
getParameter<std::vector<double> >(
"shortETParams"),
177 psS8S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
178 psS8S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
179 psS8S1.
getParameter<std::vector<double> >(
"longETParams"),
186 psPET.
getParameter<std::vector<double> >(
"shortEnergyParams"),
187 psPET.
getParameter<std::vector<double> >(
"shortETParams"),
189 psPET.
getParameter<std::vector<double> >(
"longEnergyParams"),
190 psPET.
getParameter<std::vector<double> >(
"longETParams"),
196 produces<HFRecHitCollection>();
197 }
else if (!strcasecmp(subd.c_str(),
"ZDC")) {
200 produces<ZDCRecHitCollection>();
201 }
else if (!strcasecmp(subd.c_str(),
"CALIB")) {
204 produces<HcalCalibRecHitCollection>();
206 std::cout <<
"HcalHitReconstructor is not associated with a specific subdetector!" << std::endl;
306 rec->reserve(digi->size());
310 std::vector<HBHEDataFrame> HBDigis;
311 std::vector<int> RecHitIndex;
314 int favorite_capid = 0;
316 long capid_votes[4] = {0,0,0,0};
317 for (i=digi->begin(); i!=digi->end(); i++) {
318 capid_votes[(*i)[0].capid()]++;
320 for (
int k = 0;
k < 4;
k++)
321 if (capid_votes[
k] > capid_votes[favorite_capid])
325 for (i=digi->begin(); i!=digi->end(); i++) {
380 if (i->zsMarkAndPass())
continue;
383 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
384 const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
393 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
394 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
396 auxflag+=((i->sample(fTS).capid())<<28);
397 (rec->back()).setAux(auxflag);
399 (rec->back()).setFlags(0);
417 for(
int j=0;
j!=i->size(); DigiEnergy += i->sample(
j++).nominal_fC());
420 HBDigis.push_back(*i);
421 RecHitIndex.push_back(rec->size()-1);
440 rec->reserve(digi->size());
445 int favorite_capid = 0;
447 long capid_votes[4] = {0,0,0,0};
448 for (i=digi->begin(); i!=digi->end(); i++) {
449 capid_votes[(*i)[0].capid()]++;
451 for (
int k = 0;
k < 4;
k++)
452 if (capid_votes[
k] > capid_votes[favorite_capid])
456 for (i=digi->begin(); i!=digi->end(); i++) {
485 if (i->zsMarkAndPass())
continue;
488 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
489 const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
498 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
499 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
501 auxflag+=((i->sample(fTS).capid())<<28);
502 (rec->back()).setAux(auxflag);
504 (rec->back()).setFlags(0);
526 rec->reserve(digi->size());
531 int favorite_capid = 0;
533 long capid_votes[4] = {0,0,0,0};
534 for (i=digi->begin(); i!=digi->end(); i++) {
535 capid_votes[(*i)[0].capid()]++;
537 for (
int k = 0;
k < 4;
k++)
538 if (capid_votes[
k] > capid_votes[favorite_capid])
542 for (i=digi->begin(); i!=digi->end(); i++) {
571 if (i->zsMarkAndPass())
continue;
574 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
575 const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
597 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
598 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
600 auxflag+=((i->sample(fTS).capid())<<28);
601 (rec->back()).setAux(auxflag);
604 (rec->back()).setFlags(0);
631 int depth=i->id().depth();
632 int ieta=i->id().ieta();
634 if (depth==2 ||
abs(ieta)==29 )
641 int depth=i->id().depth();
642 int ieta=i->id().ieta();
644 if (depth==2 ||
abs(ieta)==29 )
651 int depth=i->id().depth();
652 int ieta=i->id().ieta();
654 if (depth==1 &&
abs(ieta)!=29 )
667 rec->reserve(digi->size());
673 for (i=digi->begin(); i!=digi->end(); i++) {
681 if (i->zsMarkAndPass())
continue;
684 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
685 const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
unsigned int firstSample() const
T getParameter(std::string const &) const
void HFSetFlagFromS9S1(HFRecHit &hf, HFRecHitCollection &rec, const HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
HBHERecHit reconstruct(const HBHEDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
void setHFTimingTrustFlag(HFRecHit &rechit, const HFDataFrame &digi)
unsigned int pileupCleaningID() const
HcalADCSaturationFlag * saturationFlagSetter_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
uint32_t HFdigiflagSamplesToAdd() const
void beginRun(edm::EventSetup const &es)
bool correctForPhaseContainment() const
void hfSetFlagFromDigi(HFRecHit &hf, const HFDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib)
virtual ~HcalHitReconstructor()
std::vector< HBHEDataFrame >::const_iterator const_iterator
void setTopo(const HcalTopology *topo) const
const Item * getValues(DetId fId, bool throwOnFail=true) const
void resetParamsFromDB(int firstSample, int samplesToAdd, int expectedPeak, double minthreshold, const std::vector< double > &coef)
virtual void endRun(edm::Run const &r, edm::EventSetup const &es) overridefinal
void HFSetFlagFromPET(HFRecHit &hf, HFRecHitCollection &rec, const HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
uint32_t rawId() const
get the raw id
HcalTopology * theTopology
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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
void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, const std::vector< HBHEDataFrame > &, const std::vector< int > &)
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
unsigned int samplesToAdd() const
edm::EDGetTokenT< HODigiCollection > tok_ho_
virtual void produce(edm::Event &e, const edm::EventSetup &c)
HcalHitReconstructor(const edm::ParameterSet &ps)
float correctionPhaseNS() const
std::vector< HFRecHit >::iterator iterator
std::vector< double > HFdigiflagCoefficients() const
HcalHF_PETalgorithm * hfPET_
HcalHF_S9S1algorithm * hfS9S1_
HBHEPulseShapeFlagSetter * hbhePulseShapeFlagSetter_
static const int SubdetectorId
void setRecoParams(bool correctForTimeslew, bool correctForPulse, bool setLeakCorrection, int pileupCleaningID, float phaseNS)
virtual void beginRun(edm::Run const &r, edm::EventSetup const &es) overridefinal
void SetTimingShapedFlags(HBHERecHit &hbhe)
uint32_t HFdigiflagFirstSample() const
void setForData(int runnum)
T const * product() const
HBHEStatusBitSetter * hbheFlagSetter_
HBHETimeProfileStatusBitSetter * hbheHSCPFlagSetter_
HBHETimingShapedFlagSetter * hbheTimingShapedFlagSetter_
HcalHF_S9S1algorithm * hfS8S1_
void SetFlagsFromRecHits(const HcalTopology *topo, HBHERecHitCollection &rec)
HcalOtherSubdetector subdetOther_
static void Correct(HBHERecHit &rechit, const HBHEDataFrame &digi, int favorite_capid)
void SetPulseShapeFlags(HBHERecHit &hbhe, const HBHEDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib)
edm::InputTag inputLabel_
unsigned int firstAuxTS() const
bool setTimingTrustFlags_
HFTimingTrustFlag * HFTimingTrustFlagSetter_
uint32_t getValue() const
void SetFlagsFromDigi(const HcalTopology *topo, HBHERecHit &hbhe, const HBHEDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib, int firstSample=3, int samplesToAdd=4)
edm::EDGetTokenT< HFDigiCollection > tok_hf_
const HcalFlagHFDigiTimeParams * HFDigiTimeParams
const HcalTopology * topo() const
double HFdigiflagMinEThreshold() const
bool useLeakCorrection() const