32 if(prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
33 prefixME_.append(
"/");
82 std::cout <<
"HcalNoiseMonitor::beginRun"<< std::endl;
104 std::cout <<
"<HcalNoiseMonitor::setup> Creating histograms" << std::endl;
130 50, -5, 5, 25, 0, 500);
135 50, -15, 5, 25, 0, 500);
140 "Triangle fit left distance vs. TS4", 50, 0, 10, 25, 0, 500);
145 "Triangle fit right distance vs. peak time slice", 50, 0, 10, 25, 0, 500);
162 "(TS4-TS5)/(TS4+TS5), total charge > 20 fC", 100, -1, 1);
166 "(TS4-TS5)/(TS4+TS5) vs. Charge", 25, 0, 400, 75, -1, 1);
227 std::cout <<
"HcalNoiseMonitor::processEvent DQMStore not instantiated!!!"<< std::endl;
235 const HcalCalibrations &Calibrations = hConditions->getHcalCalibrations(
id);
236 const HcalQIECoder *ChannelCoder = hConditions->getHcalCoder(
id);
246 double Charge[10] = {0};
247 for(
int i = 0;
i <
iter->size();
i++)
250 double TotalCharge = 0;
251 for(
int i = 0;
i < 10;
i++)
252 TotalCharge = TotalCharge + Charge[
i];
256 double NominalChi2 = 10000000;
263 double TS4LeftSlope = 100000;
264 double TS4RightSlope = 100000;
267 TS4LeftSlope = Charge[4] / fabs(TriangleResult.
LeftSlope);
269 TS4RightSlope = Charge[4] / fabs(TriangleResult.
RightSlope);
271 if(TS4LeftSlope < -1000 || TS4LeftSlope > 1000)
273 if(TS4RightSlope < -1000 || TS4RightSlope > 1000)
274 TS4RightSlope = 1000;
288 if(Charge[4] + Charge[5] > 1
e-5)
300 int ieta =
id.ieta();
301 int iphi =
id.iphi();
302 int depth =
id.depth();
318 for(reco::HcalNoiseRBXCollection::const_iterator rbx = hRBXCollection->begin();
319 rbx != hRBXCollection->end(); rbx++)
328 std::vector<reco::HcalNoiseHPD> HPDs = RBX.
HPDs();
336 for(std::vector<reco::HcalNoiseHPD>::const_iterator hpd = HPDs.begin(); hpd != HPDs.end(); hpd++)
346 if(NumberRBXHits == 0 || RBXEnergy <= 10)
354 double HighestHPDEnergy = 0;
355 int HighestHPDHits = 0;
357 for(std::vector<reco::HcalNoiseHPD>::const_iterator hpd = HPDs.begin(); hpd != HPDs.end(); hpd++)
378 int NoiseCategory = 0;
379 bool IsRBXNoise =
false;
384 if(RBXEnergy > 1
e-5 && HighestHPDEnergy / RBXEnergy > 0.98)
388 if(HighestHPDHits >= 9)
406 if(RBXE2 / RBXE10 < 0.33)
408 else if(RBXE2 / RBXE10 < 0.8)
410 else if(RBXE2 / RBXE10 > 0.8 && NumberRBXHits > 10)
412 else if(RBXE2 / RBXE10 > 0.8 && NumberRBXHits < 10)
419 if(IsRBXNoise ==
true && RBXE10 > 1
e-5)
437 double MinimumChi2 = 100000;
454 for(
int j = 0;
j < DigiSize;
j++)
459 double Error2 = Charge[
j];
464 SumF2 += F * F / Error2;
465 SumTF += F * Charge[
j] / Error2;
466 SumT2 += Charge[
j] * Charge[
j] / Error2;
479 double Chi2 = SumT2 - SumTF * SumTF / SumF2;
481 if(Chi2 < MinimumChi2)
486 if(MinimumChi2 < 1
e-5)
502 double OverallMinimumChi2 = 1000000;
504 int AvailableDistance[] = {-100, -75, -50, 50, 75, 100};
507 for(
int k = 0;
k < 6;
k++)
509 double SingleMinimumChi2 = 1000000;
517 if(Chi2 < SingleMinimumChi2)
519 SingleMinimumChi2 = Chi2;
528 if(Chi2 < SingleMinimumChi2)
529 SingleMinimumChi2 = Chi2;
533 if(SingleMinimumChi2 < OverallMinimumChi2)
534 OverallMinimumChi2 = SingleMinimumChi2;
537 return OverallMinimumChi2;
559 static std::vector<double> F1;
560 static std::vector<double> F2;
573 for(
int j = 0;
j < DigiSize;
j++)
581 int OffsetTemp = Offset +
j * 25 + Distance;
586 if(OffsetTemp + 25 < (
int)CumulativeIdealPulse.size() && OffsetTemp + 25 >= 0)
587 C1 = CumulativeIdealPulse[OffsetTemp+25];
588 if(OffsetTemp + 25 >= (
int)CumulativeIdealPulse.size())
589 C1 = CumulativeIdealPulse[CumulativeIdealPulse.size()-1];
590 if(OffsetTemp < (
int)CumulativeIdealPulse.size() && OffsetTemp >= 0)
591 C2 = CumulativeIdealPulse[OffsetTemp];
592 if(OffsetTemp >= (
int)CumulativeIdealPulse.size())
593 C2 = CumulativeIdealPulse[CumulativeIdealPulse.size()-1];
600 SumF1F1 += F1[
j] * F1[
j] / Error;
601 SumF1F2 += F1[
j] * F2[
j] / Error;
602 SumF2F2 += F2[
j] * F2[
j] / Error;
603 SumTF1 += F1[
j] * Charge[
j] / Error;
604 SumTF2 += F2[
j] * Charge[
j] / Error;
607 double Height = (SumF1F2 * SumTF2 - SumF2F2 * SumTF1) / (SumF1F2 * SumF1F2 - SumF1F1 * SumF2F2);
608 double Height2 = (SumF1F2 * SumTF1 - SumF1F1 * SumTF2) / (SumF1F2 * SumF1F2 - SumF1F1 * SumF2F2);
611 for(
int j = 0;
j < DigiSize;
j++)
613 double Error = Charge[
j];
617 double Residual = Height * F1[
j] + Height2 * F2[
j] - Charge[
j];
618 Chi2 += Residual * Residual / Error;
640 double SumTS2OverTi = 0;
641 double SumTSOverTi = 0;
642 double SumOverTi = 0;
647 for(
int i = 0;
i < DigiSize;
i++)
653 SumTS2OverTi += 1.*
i *
i / Error2;
654 SumTSOverTi += 1.*
i / Error2;
655 SumOverTi += 1. / Error2;
656 SumTiTS += Charge[
i] *
i / Error2;
657 SumTi += Charge[
i] / Error2;
660 double CM1 = SumTS2OverTi;
661 double CM2 = SumTSOverTi;
662 double CD1 = SumTSOverTi;
663 double CD2 = SumOverTi;
667 double Slope = (C1 * CD2 - C2 * CD1) / (CM1 * CD2 - CM2 * CD1);
668 double Intercept = (C1 * CM2 - C2 * CM1) / (CD1 * CM2 - CD2 * CM1);
672 for(
int i = 0;
i < DigiSize;
i++)
674 double Deviation = Slope *
i + Intercept - Charge[
i];
675 double Error2 = Charge[
i];
678 Chi2 += Deviation * Deviation / Error2;
702 std::vector<double> TempCharge(Charge, Charge + 10);
705 sort(TempCharge.begin(), TempCharge.end());
709 for(
int i = 0;
i < DigiSize - 2;
i++)
711 Total = Total + TempCharge[
i];
712 Total2 = Total2 + TempCharge[
i] * TempCharge[
i];
721 double RMS =
sqrt(Total2 - Total * Total / (DigiSize - 2));
723 double RMS8Max = 99999;
724 if(TempCharge[DigiSize-1] > 1
e-5)
725 RMS8Max = RMS / TempCharge[DigiSize-1];
748 double MinimumRightChi2 = 1000000;
749 double Numerator = 0;
750 double Denominator = 0;
764 double BestSlope = Numerator / Denominator;
791 for(
int i = iTS;
i < DigiSize;
i++)
792 Chi2 += Charge[
i] * Charge[
i];
794 if(Chi2 < MinimumRightChi2)
796 MinimumRightChi2 = Chi2;
802 double MinimumLeftChi2 = 1000000;
815 double BestSlope = Numerator / Denominator;
835 for(
int i = 0;
i < iTS;
i++)
836 Chi2 += Charge[
i] * Charge[
i];
841 if(MinimumLeftChi2 > Chi2)
843 MinimumLeftChi2 = Chi2;
848 result.
Chi2 = MinimumLeftChi2 + MinimumRightChi2;
855 std::vector<double> PulseShape;
860 PulseShape.reserve(350);
861 for(
int i = 0;
i < 200;
i++)
862 PulseShape.push_back(HPDShape.
at(
i));
863 PulseShape.insert(PulseShape.begin(), 150, 0);
868 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)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
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])
MonitorElement * hLambdaRMS8MaxVsTotalCharge
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
MonitorElement * hLinearTestStatistics
edm::InputTag hltresultsLabel_
std::vector< MonitorElement * > depth
MonitorElement * hBadE2E10RBX
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
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
int numRecHits(float threshold=1.5) const
MonitorElement * hBadZeroRBX
void beginRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * hTriangleRightSlopeVsTS4
float bigChargeHighest2TS(unsigned int firstts=4) const
MonitorElement * hRMS8OverMaxTestStatistics
MonitorElement * hTS4TS5RelativeDifference
double PerformDualNominalFit(double Charge[10])
float big5ChargeTotal(void) const
double DualNominalFitSingleTry(double Charge[10], int Offset, int Distance)
MonitorElement * hRBXHitCount
MonitorElement * hE2OverE10Digi5
int totalZeros(void) const
MonitorElement * hRMS8OverMax
MonitorElement * hTriangleLeftSlopeVsTS4
const std::vector< HcalNoiseHPD > HPDs(void) const
void SetupEtaPhiHists(EtaPhiHists &hh, std::string Name, std::string Units)
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)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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)
float bigChargeTotal(void) const
void setCurrentFolder(const std::string &fullpath)
double PerformLinearFit(double Charge[10])
EtaPhiHists hFailLinearEtaPhi