24 reco_(conf.getParameter<bool>(
"correctForTimeslew"),
25 conf.getParameter<bool>(
"correctForPhaseContainment"),
26 conf.getParameter<double>(
"correctionPhaseNS")),
28 inputLabel_(conf.getParameter<edm::InputTag>(
"digiLabel")),
29 correctTiming_(conf.getParameter<bool>(
"correctTiming")),
30 setNoiseFlags_(conf.getParameter<bool>(
"setNoiseFlags")),
31 setHSCPFlags_(conf.getParameter<bool>(
"setHSCPFlags")),
32 setSaturationFlags_(conf.getParameter<bool>(
"setSaturationFlags")),
33 setTimingTrustFlags_(conf.getParameter<bool>(
"setTimingTrustFlags")),
34 setPulseShapeFlags_(conf.getParameter<bool>(
"setPulseShapeFlags")),
35 dropZSmarkedPassed_(conf.getParameter<bool>(
"dropZSmarkedPassed")),
36 firstAuxTS_(conf.getParameter<int>(
"firstAuxTS")),
37 firstSample_(conf.getParameter<int>(
"firstSample")),
38 samplesToAdd_(conf.getParameter<int>(
"samplesToAdd")),
39 tsFromDB_(conf.getParameter<bool>(
"tsFromDB")),
40 useLeakCorrection_( conf.getParameter<bool>(
"useLeakCorrection"))
43 std::string subd=conf.
getParameter<std::string>(
"Subdetector");
73 if (!strcasecmp(subd.c_str(),
"HBHE")) {
75 bool timingShapedCutsFlags = conf.
getParameter<
bool>(
"setTimingShapedCutsFlags");
76 if (timingShapedCutsFlags)
92 psdigi.
getParameter<std::vector<edm::ParameterSet> >(
"pulseShapeParameterSets")
114 psPulseShape.
getParameter<
double>(
"MinimumChargeThreshold"),
115 psPulseShape.
getParameter<
double>(
"TS4TS5ChargeThreshold"),
116 psPulseShape.
getParameter<
unsigned int>(
"TrianglePeakTS"),
117 psPulseShape.
getParameter<std::vector<double> >(
"LinearThreshold"),
118 psPulseShape.
getParameter<std::vector<double> >(
"LinearCut"),
119 psPulseShape.
getParameter<std::vector<double> >(
"RMS8MaxThreshold"),
120 psPulseShape.
getParameter<std::vector<double> >(
"RMS8MaxCut"),
121 psPulseShape.
getParameter<std::vector<double> >(
"LeftSlopeThreshold"),
122 psPulseShape.
getParameter<std::vector<double> >(
"LeftSlopeCut"),
123 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeThreshold"),
124 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeCut"),
125 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeSmallThreshold"),
126 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeSmallCut"),
127 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold"),
128 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5LowerCut"),
129 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold"),
130 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5UpperCut"),
135 produces<HBHERecHitCollection>();
136 }
else if (!strcasecmp(subd.c_str(),
"HO")) {
138 produces<HORecHitCollection>();
139 }
else if (!strcasecmp(subd.c_str(),
"HF")) {
158 psS9S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
159 psS9S1.
getParameter<std::vector<double> >(
"shortETParams"),
160 psS9S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
161 psS9S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
162 psS9S1.
getParameter<std::vector<double> >(
"longETParams"),
169 psS8S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
170 psS8S1.
getParameter<std::vector<double> >(
"shortETParams"),
171 psS8S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
172 psS8S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
173 psS8S1.
getParameter<std::vector<double> >(
"longETParams"),
180 psPET.
getParameter<std::vector<double> >(
"shortEnergyParams"),
181 psPET.
getParameter<std::vector<double> >(
"shortETParams"),
183 psPET.
getParameter<std::vector<double> >(
"longEnergyParams"),
184 psPET.
getParameter<std::vector<double> >(
"longETParams"),
190 produces<HFRecHitCollection>();
191 }
else if (!strcasecmp(subd.c_str(),
"ZDC")) {
194 produces<ZDCRecHitCollection>();
195 }
else if (!strcasecmp(subd.c_str(),
"CALIB")) {
198 produces<HcalCalibRecHitCollection>();
200 std::cout <<
"HcalHitReconstructor is not associated with a specific subdetector!" << std::endl;
254 const HcalQIEShape* shape = conditions->getHcalShape ();
277 rec->reserve(digi->size());
281 std::vector<HBHEDataFrame> HBDigis;
282 std::vector<int> RecHitIndex;
285 int favorite_capid = 0;
287 long capid_votes[4] = {0,0,0,0};
288 for (i=digi->begin(); i!=digi->end(); i++) {
289 capid_votes[(*i)[0].capid()]++;
291 for (
int k = 0;
k < 4;
k++)
292 if (capid_votes[
k] > capid_votes[favorite_capid])
299 for (i=digi->begin(); i!=digi->end(); i++) {
352 if (i->zsMarkAndPass())
continue;
355 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
364 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
365 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
367 auxflag+=((i->sample(fTS).capid())<<28);
368 (rec->back()).setAux(auxflag);
370 (rec->back()).setFlags(0);
388 for(
int j=0;
j!=i->size(); DigiEnergy += i->sample(
j++).nominal_fC());
391 HBDigis.push_back(*i);
392 RecHitIndex.push_back(rec->size()-1);
411 rec->reserve(digi->size());
416 int favorite_capid = 0;
418 long capid_votes[4] = {0,0,0,0};
419 for (i=digi->begin(); i!=digi->end(); i++) {
420 capid_votes[(*i)[0].capid()]++;
422 for (
int k = 0;
k < 4;
k++)
423 if (capid_votes[
k] > capid_votes[favorite_capid])
430 for (i=digi->begin(); i!=digi->end(); i++) {
457 if (i->zsMarkAndPass())
continue;
460 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
469 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
470 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
472 auxflag+=((i->sample(fTS).capid())<<28);
473 (rec->back()).setAux(auxflag);
475 (rec->back()).setFlags(0);
497 rec->reserve(digi->size());
502 int favorite_capid = 0;
504 long capid_votes[4] = {0,0,0,0};
505 for (i=digi->begin(); i!=digi->end(); i++) {
506 capid_votes[(*i)[0].capid()]++;
508 for (
int k = 0;
k < 4;
k++)
509 if (capid_votes[
k] > capid_votes[favorite_capid])
516 for (i=digi->begin(); i!=digi->end(); i++) {
543 if (i->zsMarkAndPass())
continue;
546 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
568 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
569 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
571 auxflag+=((i->sample(fTS).capid())<<28);
572 (rec->back()).setAux(auxflag);
575 (rec->back()).setFlags(0);
602 int depth=i->id().depth();
603 int ieta=i->id().ieta();
605 if (depth==2 ||
abs(ieta)==29 )
612 int depth=i->id().depth();
613 int ieta=i->id().ieta();
615 if (depth==2 ||
abs(ieta)==29 )
622 int depth=i->id().depth();
623 int ieta=i->id().ieta();
625 if (depth==1 &&
abs(ieta)!=29 )
638 rec->reserve(digi->size());
644 for (i=digi->begin(); i!=digi->end(); i++) {
652 if (i->zsMarkAndPass())
continue;
655 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
unsigned int firstSample() const
T getParameter(std::string const &) const
HBHERecHit reconstruct(const HBHEDataFrame &digi, int first, int toadd, const HcalCoder &coder, const HcalCalibrations &calibs) const
void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, std::vector< HBHEDataFrame >, std::vector< int >)
void setHFTimingTrustFlag(HFRecHit &rechit, const HFDataFrame &digi)
unsigned int pileupCleaningID() const
HcalADCSaturationFlag * saturationFlagSetter_
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)
void resetParamsFromDB(int firstSample, int samplesToAdd, int expectedPeak, double minthreshold, std::vector< double > coef)
virtual ~HcalHitReconstructor()
std::vector< T >::const_iterator const_iterator
HcalFlagHFDigiTimeParams * HFDigiTimeParams
void SetFlagsFromDigi(HBHERecHit &hbhe, const HBHEDataFrame &digi, const HcalCoder &coder, const HcalCalibrations &calib, int firstSample=3, int samplesToAdd=4)
uint32_t rawId() const
get the raw id
void HFSetFlagFromPET(HFRecHit &hf, HFRecHitCollection &rec, HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool correctForTimeslew() const
bool correctTiming() const
HcalHFStatusBitFromDigis * hfdigibit_
bool dropChannel(const uint32_t &mystatus) const
uint32_t HFdigiflagExpectedPeak() const
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
unsigned int samplesToAdd() const
virtual void produce(edm::Event &e, const edm::EventSetup &c)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
HcalHitReconstructor(const edm::ParameterSet &ps)
float correctionPhaseNS() const
std::vector< T >::iterator iterator
std::vector< double > HFdigiflagCoefficients() const
HcalHF_PETalgorithm * hfPET_
void HFSetFlagFromS9S1(HFRecHit &hf, HFRecHitCollection &rec, HcalChannelQuality *myqual, const HcalSeverityLevelComputer *mySeverity)
HcalHF_S9S1algorithm * hfS9S1_
HBHEPulseShapeFlagSetter * hbhePulseShapeFlagSetter_
static const int SubdetectorId
void setRecoParams(bool correctForTimeslew, bool correctForPulse, bool setLeakCorrection, int pileupCleaningID, float phaseNS)
void SetTimingShapedFlags(HBHERecHit &hbhe)
uint32_t HFdigiflagFirstSample() const
T const * product() const
HBHEStatusBitSetter * hbheFlagSetter_
HBHETimeProfileStatusBitSetter * hbheHSCPFlagSetter_
HBHETimingShapedFlagSetter * hbheTimingShapedFlagSetter_
HcalHF_S9S1algorithm * hfS8S1_
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
virtual void endRun(edm::Run &r, edm::EventSetup const &es)
bool setTimingTrustFlags_
HFTimingTrustFlag * HFTimingTrustFlagSetter_
virtual void beginRun(edm::Run &r, edm::EventSetup const &es)
uint32_t getValue() const
const Item * getValues(DetId fId) const
void SetFlagsFromRecHits(HBHERecHitCollection &rec)
double HFdigiflagMinEThreshold() const
bool useLeakCorrection() const