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")),
75 if (!strcasecmp(subd.c_str(),
"HBHE")) {
77 bool timingShapedCutsFlags = conf.
getParameter<
bool>(
"setTimingShapedCutsFlags");
78 if (timingShapedCutsFlags)
94 psdigi.
getParameter<std::vector<edm::ParameterSet> >(
"pulseShapeParameterSets")
116 psPulseShape.
getParameter<
double>(
"MinimumChargeThreshold"),
117 psPulseShape.
getParameter<
double>(
"TS4TS5ChargeThreshold"),
118 psPulseShape.
getParameter<
unsigned int>(
"TrianglePeakTS"),
119 psPulseShape.
getParameter<std::vector<double> >(
"LinearThreshold"),
120 psPulseShape.
getParameter<std::vector<double> >(
"LinearCut"),
121 psPulseShape.
getParameter<std::vector<double> >(
"RMS8MaxThreshold"),
122 psPulseShape.
getParameter<std::vector<double> >(
"RMS8MaxCut"),
123 psPulseShape.
getParameter<std::vector<double> >(
"LeftSlopeThreshold"),
124 psPulseShape.
getParameter<std::vector<double> >(
"LeftSlopeCut"),
125 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeThreshold"),
126 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeCut"),
127 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeSmallThreshold"),
128 psPulseShape.
getParameter<std::vector<double> >(
"RightSlopeSmallCut"),
129 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold"),
130 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5LowerCut"),
131 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold"),
132 psPulseShape.
getParameter<std::vector<double> >(
"TS4TS5UpperCut"),
137 produces<HBHERecHitCollection>();
138 }
else if (!strcasecmp(subd.c_str(),
"HO")) {
140 produces<HORecHitCollection>();
141 }
else if (!strcasecmp(subd.c_str(),
"HF")) {
160 psS9S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
161 psS9S1.
getParameter<std::vector<double> >(
"shortETParams"),
162 psS9S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
163 psS9S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
164 psS9S1.
getParameter<std::vector<double> >(
"longETParams"),
171 psS8S1.
getParameter<std::vector<double> >(
"shortEnergyParams"),
172 psS8S1.
getParameter<std::vector<double> >(
"shortETParams"),
173 psS8S1.
getParameter<std::vector<double> >(
"long_optimumSlope"),
174 psS8S1.
getParameter<std::vector<double> >(
"longEnergyParams"),
175 psS8S1.
getParameter<std::vector<double> >(
"longETParams"),
182 psPET.
getParameter<std::vector<double> >(
"shortEnergyParams"),
183 psPET.
getParameter<std::vector<double> >(
"shortETParams"),
185 psPET.
getParameter<std::vector<double> >(
"longEnergyParams"),
186 psPET.
getParameter<std::vector<double> >(
"longETParams"),
192 produces<HFRecHitCollection>();
193 }
else if (!strcasecmp(subd.c_str(),
"ZDC")) {
196 produces<ZDCRecHitCollection>();
197 }
else if (!strcasecmp(subd.c_str(),
"CALIB")) {
200 produces<HcalCalibRecHitCollection>();
202 std::cout <<
"HcalHitReconstructor is not associated with a specific subdetector!" << std::endl;
302 rec->reserve(digi->size());
306 std::vector<HBHEDataFrame> HBDigis;
307 std::vector<int> RecHitIndex;
310 int favorite_capid = 0;
312 long capid_votes[4] = {0,0,0,0};
313 for (i=digi->begin(); i!=digi->end(); i++) {
314 capid_votes[(*i)[0].capid()]++;
316 for (
int k = 0;
k < 4;
k++)
317 if (capid_votes[
k] > capid_votes[favorite_capid])
321 for (i=digi->begin(); i!=digi->end(); i++) {
376 if (i->zsMarkAndPass())
continue;
379 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
380 const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
389 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
390 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
392 auxflag+=((i->sample(fTS).capid())<<28);
393 (rec->back()).setAux(auxflag);
395 (rec->back()).setFlags(0);
413 for(
int j=0;
j!=i->size(); DigiEnergy += i->sample(
j++).nominal_fC());
416 HBDigis.push_back(*i);
417 RecHitIndex.push_back(rec->size()-1);
436 rec->reserve(digi->size());
441 int favorite_capid = 0;
443 long capid_votes[4] = {0,0,0,0};
444 for (i=digi->begin(); i!=digi->end(); i++) {
445 capid_votes[(*i)[0].capid()]++;
447 for (
int k = 0;
k < 4;
k++)
448 if (capid_votes[
k] > capid_votes[favorite_capid])
452 for (i=digi->begin(); i!=digi->end(); i++) {
481 if (i->zsMarkAndPass())
continue;
484 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
485 const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
494 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
495 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
497 auxflag+=((i->sample(fTS).capid())<<28);
498 (rec->back()).setAux(auxflag);
500 (rec->back()).setFlags(0);
522 rec->reserve(digi->size());
527 int favorite_capid = 0;
529 long capid_votes[4] = {0,0,0,0};
530 for (i=digi->begin(); i!=digi->end(); i++) {
531 capid_votes[(*i)[0].capid()]++;
533 for (
int k = 0;
k < 4;
k++)
534 if (capid_votes[
k] > capid_votes[favorite_capid])
538 for (i=digi->begin(); i!=digi->end(); i++) {
567 if (i->zsMarkAndPass())
continue;
570 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
571 const HcalQIEShape* shape = conditions->getHcalShape (channelCoder);
593 for (
int xx=fTS; xx<fTS+4 && xx<i->size();++xx)
594 auxflag+=(i->sample(xx).adc())<<(7*(xx-fTS));
596 auxflag+=((i->sample(fTS).capid())<<28);
597 (rec->back()).setAux(auxflag);
600 (rec->back()).setFlags(0);
627 int depth=i->id().depth();
628 int ieta=i->id().ieta();
630 if (depth==2 ||
abs(ieta)==29 )
637 int depth=i->id().depth();
638 int ieta=i->id().ieta();
640 if (depth==2 ||
abs(ieta)==29 )
647 int depth=i->id().depth();
648 int ieta=i->id().ieta();
650 if (depth==1 &&
abs(ieta)!=29 )
663 rec->reserve(digi->size());
669 for (i=digi->begin(); i!=digi->end(); i++) {
677 if (i->zsMarkAndPass())
continue;
680 const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
681 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
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)
virtual ~HcalHitReconstructor()
std::vector< T >::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
bool correctTiming() const
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
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_
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
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)
const HcalFlagHFDigiTimeParams * HFDigiTimeParams
const HcalTopology * topo() const
double HFdigiflagMinEThreshold() const
bool useLeakCorrection() const