32 if(prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
33 prefixME_.append(
"/");
73 std::cout <<
"HcalNoiseMonitor::bookHistograms"<< std::endl;
94 std::cout <<
"<HcalNoiseMonitor::setup> Creating histograms" << std::endl;
101 hNominalChi2 = ib.
book1D(
"Nominal_fit_chi2",
"Nominal fit chi2, total charge > 20 fC", 100, 0, 200);
104 hLinearChi2 = ib.
book1D(
"Linear_fit_chi2",
"Linear fit chi2, total charge > 20 fC", 100, 0, 200);
110 hRMS8OverMax = ib.
book1D(
"RMS8_over_Max",
"RMS8/max, total charge > 20 fC", 100, 0, 2);
118 50, -5, 5, 25, 0, 500);
123 50, -15, 5, 25, 0, 500);
128 "Triangle fit left distance vs. TS4", 50, 0, 10, 25, 0, 500);
133 "Triangle fit right distance vs. peak time slice", 50, 0, 10, 25, 0, 500);
150 "(TS4-TS5)/(TS4+TS5), total charge > 20 fC", 100, -1, 1);
154 "(TS4-TS5)/(TS4+TS5) vs. Charge", 25, 0, 400, 75, -1, 1);
184 hBadZeroRBX = ib.
book1D(
"BadZeroRBX",
"RBX with bad ADC zero counts", 72, 0.5, 72.5);
185 hBadCountHPD = ib.
book1D(
"BadCountHPD",
"HPD with bad hit counts", 72 * 4, 0.5, 72 * 4 + 0.5);
186 hBadNoOtherCountHPD = ib.
book1D(
"BadNoOtherCountHPD",
"HPD with bad \"no other\" hit counts", 72 * 4, 0.5, 72 * 4 + 0.5);
217 const HcalQIECoder *ChannelCoder = hConditions->getHcalCoder(
id);
221 Coder.
adc2fC(*iter, Tool);
227 double Charge[10] = {0};
228 for(
int i = 0;
i < iter->size();
i++)
229 Charge[
i] = Tool[
i] - Calibrations.
pedestal(iter->sample(
i).capid());
231 double TotalCharge = 0;
232 for(
int i = 0;
i < 10;
i++)
233 TotalCharge = TotalCharge + Charge[
i];
237 double NominalChi2 = 10000000;
244 double TS4LeftSlope = 100000;
245 double TS4RightSlope = 100000;
248 TS4LeftSlope = Charge[4] / fabs(TriangleResult.
LeftSlope);
250 TS4RightSlope = Charge[4] / fabs(TriangleResult.
RightSlope);
252 if(TS4LeftSlope < -1000 || TS4LeftSlope > 1000)
254 if(TS4RightSlope < -1000 || TS4RightSlope > 1000)
255 TS4RightSlope = 1000;
269 if(Charge[4] + Charge[5] > 1
e-5)
281 int ieta =
id.
ieta();
282 int iphi =
id.iphi();
283 int depth =
id.depth();
299 for(reco::HcalNoiseRBXCollection::const_iterator rbx = hRBXCollection->begin();
300 rbx != hRBXCollection->end(); rbx++)
309 std::vector<reco::HcalNoiseHPD> HPDs = RBX.
HPDs();
317 for(std::vector<reco::HcalNoiseHPD>::const_iterator hpd = HPDs.begin(); hpd != HPDs.end(); hpd++)
327 if(NumberRBXHits == 0 || RBXEnergy <= 10)
335 double HighestHPDEnergy = 0;
336 int HighestHPDHits = 0;
338 for(std::vector<reco::HcalNoiseHPD>::const_iterator hpd = HPDs.begin(); hpd != HPDs.end(); hpd++)
359 int NoiseCategory = 0;
360 bool IsRBXNoise =
false;
365 if(RBXEnergy > 1
e-5 && HighestHPDEnergy / RBXEnergy > 0.98)
369 if(HighestHPDHits >= 9)
387 if(RBXE2 / RBXE10 < 0.33)
389 else if(RBXE2 / RBXE10 < 0.8)
391 else if(RBXE2 / RBXE10 > 0.8 && NumberRBXHits > 10)
393 else if(RBXE2 / RBXE10 > 0.8 && NumberRBXHits < 10)
400 if(IsRBXNoise ==
true && RBXE10 > 1
e-5)
418 double MinimumChi2 = 100000;
435 for(
int j = 0;
j < DigiSize;
j++)
440 double Error2 = Charge[
j];
445 SumF2 += F * F / Error2;
446 SumTF += F * Charge[
j] / Error2;
447 SumT2 += Charge[
j] * Charge[
j] / Error2;
460 double Chi2 = SumT2 - SumTF * SumTF / SumF2;
462 if(Chi2 < MinimumChi2)
467 if(MinimumChi2 < 1
e-5)
483 double OverallMinimumChi2 = 1000000;
485 int AvailableDistance[] = {-100, -75, -50, 50, 75, 100};
488 for(
int k = 0;
k < 6;
k++)
490 double SingleMinimumChi2 = 1000000;
498 if(Chi2 < SingleMinimumChi2)
500 SingleMinimumChi2 = Chi2;
509 if(Chi2 < SingleMinimumChi2)
510 SingleMinimumChi2 = Chi2;
514 if(SingleMinimumChi2 < OverallMinimumChi2)
515 OverallMinimumChi2 = SingleMinimumChi2;
518 return OverallMinimumChi2;
540 static std::vector<double> F1;
541 static std::vector<double> F2;
554 for(
int j = 0;
j < DigiSize;
j++)
562 int OffsetTemp = Offset +
j * 25 + Distance;
567 if(OffsetTemp + 25 < (
int)CumulativeIdealPulse.size() && OffsetTemp + 25 >= 0)
568 C1 = CumulativeIdealPulse[OffsetTemp+25];
569 if(OffsetTemp + 25 >= (
int)CumulativeIdealPulse.size())
570 C1 = CumulativeIdealPulse[CumulativeIdealPulse.size()-1];
571 if(OffsetTemp < (
int)CumulativeIdealPulse.size() && OffsetTemp >= 0)
572 C2 = CumulativeIdealPulse[OffsetTemp];
573 if(OffsetTemp >= (
int)CumulativeIdealPulse.size())
574 C2 = CumulativeIdealPulse[CumulativeIdealPulse.size()-1];
581 SumF1F1 += F1[
j] * F1[
j] / Error;
582 SumF1F2 += F1[
j] * F2[
j] / Error;
583 SumF2F2 += F2[
j] * F2[
j] / Error;
584 SumTF1 += F1[
j] * Charge[
j] / Error;
585 SumTF2 += F2[
j] * Charge[
j] / Error;
588 double Height = (SumF1F2 * SumTF2 - SumF2F2 * SumTF1) / (SumF1F2 * SumF1F2 - SumF1F1 * SumF2F2);
589 double Height2 = (SumF1F2 * SumTF1 - SumF1F1 * SumTF2) / (SumF1F2 * SumF1F2 - SumF1F1 * SumF2F2);
592 for(
int j = 0;
j < DigiSize;
j++)
594 double Error = Charge[
j];
598 double Residual = Height * F1[
j] + Height2 * F2[
j] - Charge[
j];
599 Chi2 += Residual * Residual / Error;
621 double SumTS2OverTi = 0;
622 double SumTSOverTi = 0;
623 double SumOverTi = 0;
628 for(
int i = 0;
i < DigiSize;
i++)
634 SumTS2OverTi += 1.*
i *
i / Error2;
635 SumTSOverTi += 1.*
i / Error2;
636 SumOverTi += 1. / Error2;
637 SumTiTS += Charge[
i] *
i / Error2;
638 SumTi += Charge[
i] / Error2;
641 double CM1 = SumTS2OverTi;
642 double CM2 = SumTSOverTi;
643 double CD1 = SumTSOverTi;
644 double CD2 = SumOverTi;
648 double Slope = (C1 * CD2 - C2 * CD1) / (CM1 * CD2 - CM2 * CD1);
649 double Intercept = (C1 * CM2 - C2 * CM1) / (CD1 * CM2 - CD2 * CM1);
653 for(
int i = 0;
i < DigiSize;
i++)
655 double Deviation = Slope *
i + Intercept - Charge[
i];
656 double Error2 = Charge[
i];
659 Chi2 += Deviation * Deviation / Error2;
683 std::vector<double> TempCharge(Charge, Charge + 10);
686 sort(TempCharge.begin(), TempCharge.end());
690 for(
int i = 0;
i < DigiSize - 2;
i++)
692 Total = Total + TempCharge[
i];
693 Total2 = Total2 + TempCharge[
i] * TempCharge[
i];
702 double RMS =
sqrt(Total2 - Total * Total / (DigiSize - 2));
704 double RMS8Max = 99999;
705 if(TempCharge[DigiSize-1] > 1
e-5)
706 RMS8Max = RMS / TempCharge[DigiSize-1];
729 double MinimumRightChi2 = 1000000;
730 double Numerator = 0;
731 double Denominator = 0;
745 double BestSlope = Numerator / Denominator;
772 for(
int i = iTS;
i < DigiSize;
i++)
773 Chi2 += Charge[
i] * Charge[
i];
775 if(Chi2 < MinimumRightChi2)
777 MinimumRightChi2 = Chi2;
783 double MinimumLeftChi2 = 1000000;
796 double BestSlope = Numerator / Denominator;
816 for(
int i = 0;
i < iTS;
i++)
817 Chi2 += Charge[
i] * Charge[
i];
822 if(MinimumLeftChi2 > Chi2)
824 MinimumLeftChi2 = Chi2;
829 result.
Chi2 = MinimumLeftChi2 + MinimumRightChi2;
836 std::vector<double> PulseShape;
841 PulseShape.reserve(350);
842 for(
int i = 0;
i < 200;
i++)
843 PulseShape.push_back(HPDShape.
at(
i));
844 PulseShape.insert(PulseShape.begin(), 150, 0);
849 for(
unsigned int i = 1;
i < PulseShape.size();
i++)
int mMaxHPDNoOtherHitCount
MonitorElement * hBadCountHPD
MonitorElement * hE2OverE10Digi
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * hBadNoOtherCountHPD
MonitorElement * hTS4TS5RelativeDifferenceVsCharge
double PerformNominalFit(double Charge[10])
MonitorElement * hE2OverE10RBX
float allChargeHighest2TS(unsigned int firstts=4) const
MonitorElement * hMaxZeros
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
float at(double time) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_noise_
std::vector< int > AllowedCalibTypes_
TriangleFitResult PerformTriangleFit(double Charge[10])
void setup(DQMStore::IBooker &)
MonitorElement * hLambdaRMS8MaxVsTotalCharge
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
std::vector< HBHEDataFrame >::const_iterator const_iterator
double CalculateRMS8Max(double Charge[10])
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int numRecHits(double threshold=1.5) const
MonitorElement * hHcalNoiseCategory
double pedestal(int fCapId) const
get pedestal for capid=0..3
double mTotalZeroMinEnergy
MonitorElement * hNominalChi2
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
EtaPhiHists hFailRMSMaxEtaPhi
MonitorElement * hTotalZeros
MonitorElement * hLinearChi2
void SetupEtaPhiHists(DQMStore::IBooker &ib, EtaPhiHists &hh, std::string Name, std::string Units)
MonitorElement * hLinearTestStatistics
edm::InputTag hltresultsLabel_
std::vector< MonitorElement * > depth
MonitorElement * hBadE2E10RBX
double recHitEnergy(double theshold=1.5) const
float allChargeTotal(void) const
EtaPhiHists hFailTriangleEtaPhi
float big5ChargeHighest2TS(unsigned int firstts=4) const
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
std::vector< IntegratedCalibrationBase * > Calibrations
int numRecHits(float threshold=1.5) const
MonitorElement * hBadZeroRBX
MonitorElement * hTriangleRightSlopeVsTS4
float bigChargeHighest2TS(unsigned int firstts=4) const
int ieta() const
get the cell ieta
MonitorElement * book1D(Args &&...args)
MonitorElement * hRMS8OverMaxTestStatistics
MonitorElement * hTS4TS5RelativeDifference
double PerformDualNominalFit(double Charge[10])
float big5ChargeTotal(void) const
double DualNominalFitSingleTry(double Charge[10], int Offset, int Distance)
MonitorElement * hRBXHitCount
void bookHistograms(DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c)
MonitorElement * hE2OverE10Digi5
int totalZeros(void) const
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
MonitorElement * hRMS8OverMax
MonitorElement * hTriangleLeftSlopeVsTS4
const std::vector< HcalNoiseHPD > HPDs(void) const
std::vector< double > CumulativeIdealPulse
const Shape & hbShape() const
float recHitEnergy(float threshold=1.5) const
void analyze(edm::Event const &e, edm::EventSetup const &s)
MonitorElement * hHPDHitCount
EtaPhiHists hFailIsolationEtaPhi
std::vector< std::string > triggers_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherec_
edm::InputTag rawdataLabel_
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
HcalNoiseMonitor(const edm::ParameterSet &ps)
MonitorElement * hLambdaLinearVsTotalCharge
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
virtual void setup(DQMStore::IBooker &)
float bigChargeTotal(void) const
double PerformLinearFit(double Charge[10])
EtaPhiHists hFailLinearEtaPhi