CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalNoiseMonitor Class Reference

#include <HcalNoiseMonitor.h>

Inheritance diagram for HcalNoiseMonitor:
HcalBaseDQMonitor edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &s)
 
void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
void cleanup ()
 
 HcalNoiseMonitor (const edm::ParameterSet &ps)
 
void reset ()
 
void setup ()
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap)
 
 ~HcalNoiseMonitor ()
 
- Public Member Functions inherited from HcalBaseDQMonitor
 HcalBaseDQMonitor (const edm::ParameterSet &ps)
 
 HcalBaseDQMonitor ()
 
virtual ~HcalBaseDQMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

double CalculateRMS8Max (double Charge[10])
 
double DualNominalFitSingleTry (double Charge[10], int Offset, int Distance)
 
double PerformDualNominalFit (double Charge[10])
 
double PerformLinearFit (double Charge[10])
 
double PerformNominalFit (double Charge[10])
 
TriangleFitResult PerformTriangleFit (double Charge[10])
 
void ReadHcalPulse ()
 

Private Attributes

std::vector< double > CumulativeIdealPulse
 
MonitorElementhBadCountHPD
 
MonitorElementhBadE2E10RBX
 
MonitorElementhBadNoOtherCountHPD
 
MonitorElementhBadZeroRBX
 
MonitorElementhE2OverE10Digi
 
MonitorElementhE2OverE10Digi5
 
MonitorElementhE2OverE10RBX
 
EtaPhiHists hFailIsolationEtaPhi
 
EtaPhiHists hFailLinearEtaPhi
 
EtaPhiHists hFailRMSMaxEtaPhi
 
EtaPhiHists hFailTriangleEtaPhi
 
MonitorElementhHcalNoiseCategory
 
MonitorElementhHPDHitCount
 
MonitorElementhLambdaLinearVsTotalCharge
 
MonitorElementhLambdaRMS8MaxVsTotalCharge
 
MonitorElementhLinearChi2
 
MonitorElementhLinearTestStatistics
 
edm::InputTag hltresultsLabel_
 
MonitorElementhMaxZeros
 
MonitorElementhNominalChi2
 
MonitorElementhRBXHitCount
 
MonitorElementhRMS8OverMax
 
MonitorElementhRMS8OverMaxTestStatistics
 
MonitorElementhTotalZeros
 
MonitorElementhTriangleLeftSlopeVsTS4
 
MonitorElementhTriangleRightSlopeVsTS4
 
MonitorElementhTS4TS5RelativeDifference
 
MonitorElementhTS4TS5RelativeDifferenceVsCharge
 
double mE2E10MinEnergy
 
int mMaxADCZeros
 
double mMaxE2E10
 
int mMaxHPDHitCount
 
int mMaxHPDNoOtherHitCount
 
double mMinE2E10
 
double mTotalZeroMinEnergy
 
int mTrianglePeakTS
 
int period_
 
edm::InputTag rawdataLabel_
 
bool setupDone_
 
edm::EDGetTokenT
< HBHEDigiCollection
tok_hbhe_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_hbherec_
 
edm::EDGetTokenT
< reco::HcalNoiseRBXCollection
tok_noise_
 
std::vector< std::string > triggers_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from HcalBaseDQMonitor
virtual void beginJob ()
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
virtual void endJob (void)
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
virtual void endRun (const edm::Run &run, const edm::EventSetup &c)
 
void getLogicalMap (const edm::EventSetup &c)
 
bool IsAllowedCalibType ()
 
bool LumiInOrder (int lumisec)
 
void SetupEtaPhiHists (EtaPhiHists &hh, std::string Name, std::string Units)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from HcalBaseDQMonitor
std::vector< int > AllowedCalibTypes_
 
int badChannelStatusMask_
 
int currentLS
 
int currenttype_
 
DQMStoredbe_
 
int debug_
 
bool enableCleanup_
 
bool eventAllowed_
 
bool HBpresent_
 
bool HEpresent_
 
bool HFpresent_
 
bool HOpresent_
 
int ievt_
 
std::map< unsigned int, int > KnownBadCells_
 
int levt_
 
HcalLogicalMaplogicalMap_
 
bool makeDiagnostics_
 
MonitorElementmeIevt_
 
MonitorElementmeLevt_
 
bool mergeRuns_
 
MonitorElementmeTevt_
 
MonitorElementmeTevtHist_
 
bool needLogicalMap_
 
int NLumiBlocks_
 
bool Online_
 
std::string prefixME_
 
MonitorElementProblemsCurrentLB
 
MonitorElementProblemsVsLB
 
MonitorElementProblemsVsLB_HB
 
MonitorElementProblemsVsLB_HBHEHF
 
MonitorElementProblemsVsLB_HE
 
MonitorElementProblemsVsLB_HF
 
MonitorElementProblemsVsLB_HO
 
bool skipOutOfOrderLS_
 
std::string subdir_
 
int tevt_
 

Detailed Description

Definition at line 16 of file HcalNoiseMonitor.h.

Constructor & Destructor Documentation

HcalNoiseMonitor::HcalNoiseMonitor ( const edm::ParameterSet ps)

Definition at line 25 of file HcalNoiseMonitor.cc.

References HcalBaseDQMonitor::AllowedCalibTypes_, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::enableCleanup_, edm::ParameterSet::getUntrackedParameter(), hltresultsLabel_, HcalBaseDQMonitor::makeDiagnostics_, mE2E10MinEnergy, HcalBaseDQMonitor::mergeRuns_, mMaxADCZeros, mMaxE2E10, mMaxHPDHitCount, mMaxHPDNoOtherHitCount, mMinE2E10, mTotalZeroMinEnergy, mTrianglePeakTS, HcalBaseDQMonitor::NLumiBlocks_, HcalBaseDQMonitor::Online_, period_, HcalBaseDQMonitor::prefixME_, rawdataLabel_, setupDone_, HcalBaseDQMonitor::skipOutOfOrderLS_, AlCaHLTBitMon_QueryRunRegistry::string, HcalBaseDQMonitor::subdir_, tok_hbhe_, tok_hbherec_, tok_noise_, and triggers_.

26 {
27  Online_ = ps.getUntrackedParameter<bool>("online",false);
28  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
29  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
30  debug_ = ps.getUntrackedParameter<int>("debug",0);
31  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
32  if(prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
33  prefixME_.append("/");
34  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","NoiseMonitor_Hcal");
35  if(subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
36  subdir_.append("/");
37  subdir_=prefixME_+subdir_;
38  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
39  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",false);
40  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
41  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
42 
43  triggers_=ps.getUntrackedParameter<std::vector<std::string> >("nzsHLTnames");
44  //["HLT_HcalPhiSym","HLT_HcalNoise_8E29]
45  period_=ps.getUntrackedParameter<int>("NoiseeventPeriod",4096); //4096
47  hltresultsLabel_ = ps.getUntrackedParameter<edm::InputTag>("HLTResultsLabel");
48  tok_hbhe_ = consumes<HBHEDigiCollection>(ps.getUntrackedParameter<edm::InputTag>("hbheDigiLabel"));
49  tok_hbherec_ = consumes<HBHERecHitCollection>(ps.getUntrackedParameter<edm::InputTag>("hbheRechitLabel"));
50  tok_noise_ = consumes<reco::HcalNoiseRBXCollection>(ps.getUntrackedParameter<edm::InputTag>("noiseLabel"));
51 
52  mTrianglePeakTS = 4; // for now...
53 
54  mE2E10MinEnergy = ps.getUntrackedParameter<double>("E2E10MinEnergy");
55  mMinE2E10 = ps.getUntrackedParameter<double>("MinE2E10");
56  mMaxE2E10 = ps.getUntrackedParameter<double>("MaxE2E10");
57  mMaxHPDHitCount = ps.getUntrackedParameter<int>("MaxHPDHitCount");
58  mMaxHPDNoOtherHitCount = ps.getUntrackedParameter<int>("MaxHPDNoOtherHitCount");
59  mMaxADCZeros = ps.getUntrackedParameter<int>("MaxADCZeros");
60  mTotalZeroMinEnergy = ps.getUntrackedParameter<double>("TotalZeroMinEnergy");
61  setupDone_ = false;
62 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_noise_
std::vector< int > AllowedCalibTypes_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
edm::InputTag hltresultsLabel_
std::vector< std::string > triggers_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherec_
edm::InputTag rawdataLabel_
HcalNoiseMonitor::~HcalNoiseMonitor ( )

Definition at line 64 of file HcalNoiseMonitor.cc.

64 {}

Member Function Documentation

void HcalNoiseMonitor::analyze ( edm::Event const &  e,
edm::EventSetup const &  s 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 208 of file HcalNoiseMonitor.cc.

References HcalCoderDb::adc2fC(), reco::HcalNoiseRBX::allChargeHighest2TS(), reco::HcalNoiseRBX::allChargeTotal(), HcalBaseDQMonitor::analyze(), reco::HcalNoiseHPD::big5ChargeHighest2TS(), reco::HcalNoiseHPD::big5ChargeTotal(), reco::HcalNoiseHPD::bigChargeHighest2TS(), reco::HcalNoiseHPD::bigChargeTotal(), CalculateRMS8Max(), gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, EtaPhiHists::depth, alignCSCRings::e, MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), hBadCountHPD, hBadE2E10RBX, hBadNoOtherCountHPD, hBadZeroRBX, HcalCaloFlagLabels::HBHEFlatNoise, HcalCaloFlagLabels::HBHEIsolatedNoise, HcalCaloFlagLabels::HBHESpikeNoise, HcalCaloFlagLabels::HBHETriangleNoise, hE2OverE10Digi, hE2OverE10Digi5, hE2OverE10RBX, hFailIsolationEtaPhi, hFailLinearEtaPhi, hFailRMSMaxEtaPhi, hFailTriangleEtaPhi, hHcalNoiseCategory, hHPDHitCount, hLambdaLinearVsTotalCharge, hLambdaRMS8MaxVsTotalCharge, hLinearChi2, hLinearTestStatistics, hMaxZeros, hNominalChi2, reco::HcalNoiseRBX::HPDs(), hRBXHitCount, hRMS8OverMax, hRMS8OverMaxTestStatistics, hTotalZeros, hTriangleLeftSlopeVsTS4, hTriangleRightSlopeVsTS4, hTS4TS5RelativeDifference, hTS4TS5RelativeDifferenceVsCharge, i, reco::HcalNoiseRBX::idnumber(), reco::HcalNoiseHPD::idnumber(), getDQMSummary::iter, TriangleFitResult::LeftSlope, fff_deletion::log, reco::HcalNoiseRBX::maxZeros(), mE2E10MinEnergy, mMaxADCZeros, mMaxE2E10, mMaxHPDHitCount, mMaxHPDNoOtherHitCount, mMinE2E10, mTotalZeroMinEnergy, NULL, reco::HcalNoiseRBX::numRecHits(), reco::HcalNoiseHPD::numRecHits(), HcalCalibrations::pedestal(), PerformLinearFit(), PerformNominalFit(), PerformTriangleFit(), reco::HcalNoiseRBX::recHitEnergy(), reco::HcalNoiseHPD::recHitEnergy(), TriangleFitResult::RightSlope, tok_hbhe_, tok_hbherec_, tok_noise_, and reco::HcalNoiseRBX::totalZeros().

209 {
211  iEvent.getByToken(tok_hbhe_,hHBHEDigis);
212 
213  edm::ESHandle<HcalDbService> hConditions;
214  iSetup.get<HcalDbRecord>().get(hConditions);
215 
217  iEvent.getByToken(tok_hbherec_, hRecHits);
218 
220  iEvent.getByToken(tok_noise_,hRBXCollection);
221 
223 
224  if(dbe_ == NULL)
225  {
226  if(debug_ > 0)
227  std::cout << "HcalNoiseMonitor::processEvent DQMStore not instantiated!!!"<< std::endl;
228  return;
229  }
230 
231  // loop over digis
232  for(HBHEDigiCollection::const_iterator iter = hHBHEDigis->begin(); iter != hHBHEDigis->end(); iter++)
233  {
234  HcalDetId id = iter->id();
235  const HcalCalibrations &Calibrations = hConditions->getHcalCalibrations(id);
236  const HcalQIECoder *ChannelCoder = hConditions->getHcalCoder(id);
237  const HcalQIEShape *Shape = hConditions->getHcalShape(ChannelCoder);
238  HcalCoderDb Coder(*ChannelCoder, *Shape);
239  CaloSamples Tool;
240  Coder.adc2fC(*iter, Tool);
241 
242  // int ieta = id.ieta();
243  // int iphi = id.iphi();
244  // int depth = id.depth();
245 
246  double Charge[10] = {0};
247  for(int i = 0; i < iter->size(); i++)
248  Charge[i] = Tool[i] - Calibrations.pedestal(iter->sample(i).capid());
249 
250  double TotalCharge = 0;
251  for(int i = 0; i < 10; i++)
252  TotalCharge = TotalCharge + Charge[i];
253 
254  if(TotalCharge > 20)
255  {
256  double NominalChi2 = 10000000;
257  NominalChi2 = PerformNominalFit(Charge);
258 
259  double LinearChi2 = PerformLinearFit(Charge);
260  double RMS8Max = CalculateRMS8Max(Charge);
261  TriangleFitResult TriangleResult = PerformTriangleFit(Charge);
262 
263  double TS4LeftSlope = 100000;
264  double TS4RightSlope = 100000;
265 
266  if(TriangleResult.LeftSlope > 1e-5)
267  TS4LeftSlope = Charge[4] / fabs(TriangleResult.LeftSlope);
268  if(TriangleResult.RightSlope < -1e-5)
269  TS4RightSlope = Charge[4] / fabs(TriangleResult.RightSlope);
270 
271  if(TS4LeftSlope < -1000 || TS4LeftSlope > 1000)
272  TS4LeftSlope = 1000;
273  if(TS4RightSlope < -1000 || TS4RightSlope > 1000)
274  TS4RightSlope = 1000;
275 
276  hNominalChi2->Fill(NominalChi2);
277  hLinearChi2->Fill(LinearChi2);
278  hLinearTestStatistics->Fill(log(LinearChi2) - log(NominalChi2));
279  hRMS8OverMax->Fill(RMS8Max);
280  hRMS8OverMaxTestStatistics->Fill(log(RMS8Max) - log(NominalChi2));
281 
282  hLambdaLinearVsTotalCharge->Fill(log(LinearChi2) - log(NominalChi2), TotalCharge);
283  hLambdaRMS8MaxVsTotalCharge->Fill(log(RMS8Max) - log(NominalChi2), TotalCharge);
284  hTriangleLeftSlopeVsTS4->Fill(TS4LeftSlope, Charge[4]);
285  hTriangleRightSlopeVsTS4->Fill(TS4RightSlope, Charge[4]);
286  }
287 
288  if(Charge[4] + Charge[5] > 1e-5)
289  {
290  hTS4TS5RelativeDifference->Fill((Charge[4] - Charge[5]) / (Charge[4] + Charge[5]));
291  hTS4TS5RelativeDifferenceVsCharge->Fill(TotalCharge, (Charge[4] - Charge[5]) / (Charge[4] + Charge[5]));
292  }
293  }
294 
295  // loop over rechits - noise bits (fit-based, isolation)
296  for(HBHERecHitCollection::const_iterator iter = hRecHits->begin(); iter != hRecHits->end(); iter++)
297  {
298  HcalDetId id = iter->id();
299 
300  int ieta = id.ieta();
301  int iphi = id.iphi();
302  int depth = id.depth();
303 
304  if(iter->flagField(HcalCaloFlagLabels::HBHEFlatNoise) == 1)
305  hFailLinearEtaPhi.depth[depth-1]->Fill(ieta, iphi);
306 
307  if(iter->flagField(HcalCaloFlagLabels::HBHESpikeNoise) == 1)
308  hFailRMSMaxEtaPhi.depth[depth-1]->Fill(ieta, iphi);
309 
310  if(iter->flagField(HcalCaloFlagLabels::HBHETriangleNoise) == 1)
311  hFailTriangleEtaPhi.depth[depth-1]->Fill(ieta, iphi);
312 
313  if(iter->flagField(HcalCaloFlagLabels::HBHEIsolatedNoise) == 1)
314  hFailIsolationEtaPhi.depth[depth-1]->Fill(ieta, iphi);
315  }
316 
317  // Code analagous to Yifei's
318  for(reco::HcalNoiseRBXCollection::const_iterator rbx = hRBXCollection->begin();
319  rbx != hRBXCollection->end(); rbx++)
320  {
321  const reco::HcalNoiseRBX RBX = *rbx;
322 
323  int NumberRBXHits = RBX.numRecHits(1.5);
324  double RBXEnergy = RBX.recHitEnergy(1.5);
325  double RBXE2 = RBX.allChargeHighest2TS();
326  double RBXE10 = RBX.allChargeTotal();
327 
328  std::vector<reco::HcalNoiseHPD> HPDs = RBX.HPDs();
329 
330  int RBXID = RBX.idnumber();
331 
332  if(RBXEnergy > mTotalZeroMinEnergy && RBX.totalZeros() >= mMaxADCZeros)
333  hBadZeroRBX->Fill(RBXID);
334  if(RBXEnergy > mE2E10MinEnergy && RBXE10 > 1e-5 && (RBXE2 / RBXE10 > mMaxE2E10 || RBXE2 / RBXE10 < mMinE2E10))
335  hBadE2E10RBX->Fill(RBXID);
336  for(std::vector<reco::HcalNoiseHPD>::const_iterator hpd = HPDs.begin(); hpd != HPDs.end(); hpd++)
337  {
338  reco::HcalNoiseHPD HPD = *hpd;
339  int HPDHitCount = HPD.numRecHits(1.5);
340  if(HPDHitCount >= mMaxHPDHitCount)
341  hBadCountHPD->Fill(HPD.idnumber());
342  if(HPDHitCount == NumberRBXHits && HPDHitCount >= mMaxHPDNoOtherHitCount)
344  }
345 
346  if(NumberRBXHits == 0 || RBXEnergy <= 10)
347  continue;
348 
349  hRBXHitCount->Fill(NumberRBXHits);
350 
351  hMaxZeros->Fill(RBX.maxZeros());
352  hTotalZeros->Fill(RBX.totalZeros());
353 
354  double HighestHPDEnergy = 0;
355  int HighestHPDHits = 0;
356 
357  for(std::vector<reco::HcalNoiseHPD>::const_iterator hpd = HPDs.begin(); hpd != HPDs.end(); hpd++)
358  {
359  reco::HcalNoiseHPD HPD = *hpd;
360 
361  if(HPD.recHitEnergy(1.5) > HighestHPDEnergy)
362  {
363  HighestHPDEnergy = HPD.recHitEnergy(1.5);
364  HighestHPDHits = HPD.numRecHits(1.5);
365  }
366 
367  if(HPD.numRecHits(5) < 1)
368  continue;
369 
370  if(HPD.bigChargeTotal() > 1e-5)
372  if(HPD.big5ChargeTotal() > 1e-5)
374 
375  hHPDHitCount->Fill(HPD.numRecHits(1.5));
376  }
377 
378  int NoiseCategory = 0;
379  bool IsRBXNoise = false;
380  // bool IsHPDNoise = false;
381  // bool IsHPDIonFeedback = false;
382  // bool IsHPDDischarge = false;
383 
384  if(RBXEnergy > 1e-5 && HighestHPDEnergy / RBXEnergy > 0.98)
385  {
386  // IsHPDNoise = true;
387 
388  if(HighestHPDHits >= 9)
389  {
390  // IsHPDDischarge = true;
391  NoiseCategory = 7;
392  }
393  else
394  {
395  // IsHPDIonFeedback = true;
396  NoiseCategory = 8;
397  }
398  }
399  else
400  {
401  IsRBXNoise = true;
402  NoiseCategory = 1;
403 
404  if(RBXE10 > 1e-5)
405  {
406  if(RBXE2 / RBXE10 < 0.33)
407  NoiseCategory = 2;
408  else if(RBXE2 / RBXE10 < 0.8)
409  NoiseCategory = 3;
410  else if(RBXE2 / RBXE10 > 0.8 && NumberRBXHits > 10)
411  NoiseCategory = 4;
412  else if(RBXE2 / RBXE10 > 0.8 && NumberRBXHits < 10) // [hic]
413  NoiseCategory = 5;
414  }
415  }
416 
417  hHcalNoiseCategory->Fill(NoiseCategory);
418 
419  if(IsRBXNoise == true && RBXE10 > 1e-5)
420  hE2OverE10RBX->Fill(RBXE2 / RBXE10);
421  }
422 
423  return;
424 }
MonitorElement * hBadCountHPD
MonitorElement * hE2OverE10Digi
MonitorElement * hBadNoOtherCountHPD
MonitorElement * hTS4TS5RelativeDifferenceVsCharge
int i
Definition: DBlmapReader.cc:9
double PerformNominalFit(double Charge[10])
MonitorElement * hE2OverE10RBX
float allChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseRBX.cc:65
int idnumber(void) const
Definition: HcalNoiseHPD.cc:32
MonitorElement * hMaxZeros
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
int maxZeros(void) const
Definition: HcalNoiseRBX.cc:90
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > tok_noise_
TriangleFitResult PerformTriangleFit(double Charge[10])
MonitorElement * hLambdaRMS8MaxVsTotalCharge
std::vector< HBHEDataFrame >::const_iterator const_iterator
double CalculateRMS8Max(double Charge[10])
int numRecHits(double threshold=1.5) const
MonitorElement * hHcalNoiseCategory
#define NULL
Definition: scimark2.h:8
double pedestal(int fCapId) const
get pedestal for capid=0..3
MonitorElement * hNominalChi2
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
EtaPhiHists hFailRMSMaxEtaPhi
void Fill(long long x)
MonitorElement * hTotalZeros
MonitorElement * hLinearChi2
MonitorElement * hLinearTestStatistics
int iEvent
Definition: GenABIO.cc:230
std::vector< MonitorElement * > depth
MonitorElement * hBadE2E10RBX
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:99
float allChargeTotal(void) const
Definition: HcalNoiseRBX.cc:57
EtaPhiHists hFailTriangleEtaPhi
float big5ChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseHPD.cc:81
int numRecHits(float threshold=1.5) const
MonitorElement * hBadZeroRBX
MonitorElement * hTriangleRightSlopeVsTS4
float bigChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseHPD.cc:51
MonitorElement * hRMS8OverMaxTestStatistics
MonitorElement * hTS4TS5RelativeDifference
float big5ChargeTotal(void) const
Definition: HcalNoiseHPD.cc:72
MonitorElement * hRBXHitCount
MonitorElement * hE2OverE10Digi5
int totalZeros(void) const
Definition: HcalNoiseRBX.cc:82
MonitorElement * hRMS8OverMax
MonitorElement * hTriangleLeftSlopeVsTS4
const std::vector< HcalNoiseHPD > HPDs(void) const
Definition: HcalNoiseRBX.cc:33
float recHitEnergy(float threshold=1.5) const
int idnumber(void) const
Definition: HcalNoiseRBX.cc:28
tuple cout
Definition: gather_cfg.py:121
MonitorElement * hHPDHitCount
EtaPhiHists hFailIsolationEtaPhi
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherec_
MonitorElement * hLambdaLinearVsTotalCharge
float bigChargeTotal(void) const
Definition: HcalNoiseHPD.cc:42
double PerformLinearFit(double Charge[10])
EtaPhiHists hFailLinearEtaPhi
Abstract Class of shape.
Definition: Shape.h:14
void HcalNoiseMonitor::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 79 of file HcalNoiseMonitor.cc.

References HcalBaseDQMonitor::beginRun(), gather_cfg::cout, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::mergeRuns_, reset(), setup(), and HcalBaseDQMonitor::tevt_.

80 {
81  if(debug_ > 1)
82  std::cout <<"HcalNoiseMonitor::beginRun"<< std::endl;
83 
85 
86  if(tevt_ == 0)
87  setup();
88 
89  if(mergeRuns_ == false)
90  reset();
91 
92  return;
93 }
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
tuple cout
Definition: gather_cfg.py:121
double HcalNoiseMonitor::CalculateRMS8Max ( double  Charge[10])
private

Definition at line 688 of file HcalNoiseMonitor.cc.

References alignCSCRings::e, i, python.multivaluedict::sort(), and mathSSE::sqrt().

Referenced by analyze().

689 {
690  //
691  // CalculateRMS8Max
692  //
693  // returns "RMS" divided by the largest charge in the time slices
694  // "RMS" is calculated using all but the two largest time slices.
695  // The "RMS" is not quite the actual RMS (see note below), but the value is only
696  // used for determining max values, and is not quoted as the actual RMS anywhere.
697  //
698 
699  int DigiSize = 10;
700 
701  // Copy Charge vector again, since we are passing references around
702  std::vector<double> TempCharge(Charge, Charge + 10);
703 
704  // Sort TempCharge vector from smallest to largest charge
705  sort(TempCharge.begin(), TempCharge.end());
706 
707  double Total = 0;
708  double Total2 = 0;
709  for(int i = 0; i < DigiSize - 2; i++)
710  {
711  Total = Total + TempCharge[i];
712  Total2 = Total2 + TempCharge[i] * TempCharge[i];
713  }
714 
715  // This isn't quite the RMS (both Total2 and Total*Total need to be
716  // divided by an extra (DigiSize-2) within the sqrt to get the RMS.)
717  // We're only using this value for relative comparisons, though; we
718  // aren't explicitly interpreting it as the RMS. It might be nice
719  // to either change the calculation or rename the variable in the future, though.
720 
721  double RMS = sqrt(Total2 - Total * Total / (DigiSize - 2));
722 
723  double RMS8Max = 99999;
724  if(TempCharge[DigiSize-1] > 1e-5)
725  RMS8Max = RMS / TempCharge[DigiSize-1];
726  if(RMS8Max < 1e-5) // protection against zero
727  RMS8Max = 1e-5;
728 
729  return RMS8Max;
730 }
int i
Definition: DBlmapReader.cc:9
T sqrt(T t)
Definition: SSEVec.h:48
void HcalNoiseMonitor::cleanup ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 70 of file HcalNoiseMonitor.cc.

References HcalBaseDQMonitor::dbe_, DQMStore::removeContents(), DQMStore::setCurrentFolder(), and HcalBaseDQMonitor::subdir_.

71 {
72  if(dbe_)
73  {
76  }
77 }
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3085
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
double HcalNoiseMonitor::DualNominalFitSingleTry ( double  Charge[10],
int  Offset,
int  Distance 
)
private

Definition at line 540 of file HcalNoiseMonitor.cc.

References CumulativeIdealPulse, alignCSCRings::e, and j.

Referenced by PerformDualNominalFit().

541 {
542  //
543  // Does a fit to dual signal pulse hypothesis given offset and distance of the two target pulses
544  //
545  // The only parameters to fit here are the two pulse heights of in-time and out-of-time components
546  // since offset is given
547  // The calculation here is based from writing down the Chi2 formula and minimize against the two parameters,
548  // ie., Chi2 = Sum{((T[i] - a1 * F1[i] - a2 * F2[i]) / (Sigma[i]))^2}, where T[i] is the input pulse shape,
549  // and F1[i], F2[i] are the two ideal pulse components
550  //
551 
552  int DigiSize = 10;
553 
554  if(Offset < 0 || Offset + 250 >= (int)CumulativeIdealPulse.size())
555  return 1000000;
556  if(CumulativeIdealPulse[Offset+250] - CumulativeIdealPulse[Offset] < 1e-5)
557  return 1000000;
558 
559  static std::vector<double> F1;
560  static std::vector<double> F2;
561 
562  F1.resize(DigiSize);
563  F2.resize(DigiSize);
564 
565  double SumF1F1 = 0;
566  double SumF1F2 = 0;
567  double SumF2F2 = 0;
568  double SumTF1 = 0;
569  double SumTF2 = 0;
570 
571  double Error = 0;
572 
573  for(int j = 0; j < DigiSize; j++)
574  {
575  // this is the TS value for in-time component - no problem we can do a subtraction directly
576  F1[j] = CumulativeIdealPulse[Offset+j*25+25] - CumulativeIdealPulse[Offset+j*25];
577 
578  // However for the out-of-time component the index might go out-of-bound.
579  // Let's protect against this.
580 
581  int OffsetTemp = Offset + j * 25 + Distance;
582 
583  double C1 = 0; // lower-indexed value in the cumulative pulse shape
584  double C2 = 0; // higher-indexed value in the cumulative pulse shape
585 
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];
594  F2[j] = C1 - C2;
595 
596  Error = Charge[j];
597  if(Error < 1)
598  Error = 1;
599 
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;
605  }
606 
607  double Height = (SumF1F2 * SumTF2 - SumF2F2 * SumTF1) / (SumF1F2 * SumF1F2 - SumF1F1 * SumF2F2);
608  double Height2 = (SumF1F2 * SumTF1 - SumF1F1 * SumTF2) / (SumF1F2 * SumF1F2 - SumF1F1 * SumF2F2);
609 
610  double Chi2 = 0;
611  for(int j = 0; j < DigiSize; j++)
612  {
613  double Error = Charge[j];
614  if(Error < 1)
615  Error = 1;
616 
617  double Residual = Height * F1[j] + Height2 * F2[j] - Charge[j];
618  Chi2 += Residual * Residual / Error;
619  }
620 
621  // Safety protection in case of zero
622  if(Chi2 < 1e-5)
623  Chi2 = 1e-5;
624 
625  return Chi2;
626 }
int j
Definition: DBlmapReader.cc:9
std::vector< double > CumulativeIdealPulse
Definition: Chi2.h:17
double HcalNoiseMonitor::PerformDualNominalFit ( double  Charge[10])
private

Definition at line 492 of file HcalNoiseMonitor.cc.

References CumulativeIdealPulse, DualNominalFitSingleTry(), i, and gen::k.

493 {
494  //
495  // Perform dual nominal fit and returns the chi2
496  //
497  // In this function we do a scan over possible "distance" (number of time slices between two components)
498  // and overall offset for the two components; first coarse, then finer
499  // All the fitting is done in the DualNominalFitSingleTry function
500  //
501 
502  double OverallMinimumChi2 = 1000000;
503 
504  int AvailableDistance[] = {-100, -75, -50, 50, 75, 100};
505 
506  // loop over possible pulse distances between two components
507  for(int k = 0; k < 6; k++)
508  {
509  double SingleMinimumChi2 = 1000000;
510  int MinOffset = 0;
511 
512  // scan coarsely through different offsets and find the minimum
513  for(int i = 0; i + 250 < (int)CumulativeIdealPulse.size(); i += 10)
514  {
515  double Chi2 = DualNominalFitSingleTry(Charge, i, AvailableDistance[k]);
516 
517  if(Chi2 < SingleMinimumChi2)
518  {
519  SingleMinimumChi2 = Chi2;
520  MinOffset = i;
521  }
522  }
523 
524  // around the minimum, scan finer for better a better minimum
525  for(int i = MinOffset - 15; i + 250 < (int)CumulativeIdealPulse.size() && i < MinOffset + 15; i++)
526  {
527  double Chi2 = DualNominalFitSingleTry(Charge, i, AvailableDistance[k]);
528  if(Chi2 < SingleMinimumChi2)
529  SingleMinimumChi2 = Chi2;
530  }
531 
532  // update overall minimum chi2
533  if(SingleMinimumChi2 < OverallMinimumChi2)
534  OverallMinimumChi2 = SingleMinimumChi2;
535  }
536 
537  return OverallMinimumChi2;
538 }
int i
Definition: DBlmapReader.cc:9
double DualNominalFitSingleTry(double Charge[10], int Offset, int Distance)
int k[5][pyjets_maxn]
std::vector< double > CumulativeIdealPulse
Definition: Chi2.h:17
double HcalNoiseMonitor::PerformLinearFit ( double  Charge[10])
private

Definition at line 628 of file HcalNoiseMonitor.cc.

References alignCSCRings::e, and i.

Referenced by analyze().

629 {
630  //
631  // Performs a straight-line fit over all time slices, and returns the chi2 value
632  //
633  // The calculation here is based from writing down the formula for chi2 and minimize
634  // with respect to the parameters in the fit, ie., slope and intercept of the straight line
635  // By doing two differentiation, we will get two equations, and the best parameters are determined by these
636  //
637 
638  int DigiSize = 10;
639 
640  double SumTS2OverTi = 0;
641  double SumTSOverTi = 0;
642  double SumOverTi = 0;
643  double SumTiTS = 0;
644  double SumTi = 0;
645 
646  double Error2 = 0;
647  for(int i = 0; i < DigiSize; i++)
648  {
649  Error2 = Charge[i];
650  if(Charge[i] < 1)
651  Error2 = 1;
652 
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;
658  }
659 
660  double CM1 = SumTS2OverTi; // Coefficient in front of slope in equation 1
661  double CM2 = SumTSOverTi; // Coefficient in front of slope in equation 2
662  double CD1 = SumTSOverTi; // Coefficient in front of intercept in equation 1
663  double CD2 = SumOverTi; // Coefficient in front of intercept in equation 2
664  double C1 = SumTiTS; // Constant coefficient in equation 1
665  double C2 = SumTi; // Constant coefficient in equation 2
666 
667  double Slope = (C1 * CD2 - C2 * CD1) / (CM1 * CD2 - CM2 * CD1);
668  double Intercept = (C1 * CM2 - C2 * CM1) / (CD1 * CM2 - CD2 * CM1);
669 
670  // now that the best parameters are found, calculate chi2 from those
671  double Chi2 = 0;
672  for(int i = 0; i < DigiSize; i++)
673  {
674  double Deviation = Slope * i + Intercept - Charge[i];
675  double Error2 = Charge[i];
676  if(Charge[i] < 1)
677  Error2 = 1;
678  Chi2 += Deviation * Deviation / Error2;
679  }
680 
681  // safety protection in case of perfect fit
682  if(Chi2 < 1e-5)
683  Chi2 = 1e-5;
684 
685  return Chi2;
686 }
int i
Definition: DBlmapReader.cc:9
Definition: Chi2.h:17
double HcalNoiseMonitor::PerformNominalFit ( double  Charge[10])
private

Definition at line 426 of file HcalNoiseMonitor.cc.

References CumulativeIdealPulse, alignCSCRings::e, F(), i, and j.

Referenced by analyze().

427 {
428  //
429  // Performs a fit to the ideal pulse shape. Returns best chi2
430  //
431  // A scan over different timing offset (for the ideal pulse) is carried out,
432  // and for each offset setting a one-parameter fit is performed
433  //
434 
435  int DigiSize = 10;
436 
437  double MinimumChi2 = 100000;
438 
439  double F = 0;
440 
441  double SumF2 = 0;
442  double SumTF = 0;
443  double SumT2 = 0;
444 
445  for(int i = 0; i + 250 < (int)CumulativeIdealPulse.size(); i++)
446  {
448  continue;
449 
450  SumF2 = 0;
451  SumTF = 0;
452  SumT2 = 0;
453 
454  for(int j = 0; j < DigiSize; j++)
455  {
456  // get ideal pulse component for this time slice....
457  F = CumulativeIdealPulse[i+j*25+25] - CumulativeIdealPulse[i+j*25];
458 
459  double Error2 = Charge[j];
460  if(Error2 < 1)
461  Error2 = 1;
462 
463  // ...and increment various summations
464  SumF2 += F * F / Error2;
465  SumTF += F * Charge[j] / Error2;
466  SumT2 += Charge[j] * Charge[j] / Error2;
467  }
468 
469  /* chi2= sum((Charge[j]-aF)^2/|Charge[j]|
470  ( |Charge[j]| = assumed sigma^2 for Charge[j]; a bit wonky for Charge[j]<1 )
471  chi2 = sum(|Charge[j]|) - 2*sum(aF*Charge[j]/|Charge[j]|) +sum( a^2*F^2/|Charge[j]|)
472  chi2 minimimized when d(chi2)/da = 0:
473  a = sum(F*Charge[j])/sum(F^2)
474  ...
475  chi2= sum(|Q[j]|) - sum(Q[j]/|Q[j]|*F)*sum(Q[j]/|Q[j]|*F)/sum(F^2/|Q[j]|), where Q = Charge
476  chi2 = SumT2 - SumTF*SumTF/SumF2
477  */
478 
479  double Chi2 = SumT2 - SumTF * SumTF / SumF2;
480 
481  if(Chi2 < MinimumChi2)
482  MinimumChi2 = Chi2;
483  }
484 
485  // safety protection in case of perfect fit - don't want the log(...) to explode
486  if(MinimumChi2 < 1e-5)
487  MinimumChi2 = 1e-5;
488 
489  return MinimumChi2;
490 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
std::vector< double > CumulativeIdealPulse
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
Definition: Chi2.h:17
TriangleFitResult HcalNoiseMonitor::PerformTriangleFit ( double  Charge[10])
private

Definition at line 732 of file HcalNoiseMonitor.cc.

References TriangleFitResult::Chi2, i, TriangleFitResult::LeftSlope, mTrianglePeakTS, query::result, and TriangleFitResult::RightSlope.

Referenced by analyze().

733 {
734  //
735  // Perform a "triangle fit", and extract the slopes
736  //
737  // Left-hand side and right-hand side are not correlated to each other - do them separately
738  //
739 
741  result.Chi2 = 0;
742  result.LeftSlope = 0;
743  result.RightSlope = 0;
744 
745  int DigiSize = 10;
746 
747  // right side, starting from TS4
748  double MinimumRightChi2 = 1000000;
749  double Numerator = 0;
750  double Denominator = 0;
751 
752  for(int iTS = mTrianglePeakTS + 2; iTS <= DigiSize; iTS++) // the place where first TS center in flat line
753  {
754  // fit a straight line to the triangle part
755  Numerator = 0;
756  Denominator = 0;
757 
758  for(int i = mTrianglePeakTS + 1; i < iTS; i++)
759  {
760  Numerator += (i - mTrianglePeakTS) * (Charge[i] - Charge[mTrianglePeakTS]);
761  Denominator += (i - mTrianglePeakTS) * (i - mTrianglePeakTS);
762  }
763 
764  double BestSlope = Numerator / Denominator;
765  if(BestSlope > 0)
766  BestSlope = 0;
767 
768  // check if the slope is reasonable
769  if(iTS != DigiSize)
770  {
771  if(BestSlope > -1 * Charge[mTrianglePeakTS] / (iTS - mTrianglePeakTS))
772  BestSlope = -1 * Charge[mTrianglePeakTS] / (iTS - mTrianglePeakTS);
773  if(BestSlope < -1 * Charge[mTrianglePeakTS] / (iTS - 1 - mTrianglePeakTS))
774  BestSlope = -1 * Charge[mTrianglePeakTS] / (iTS - 1 - mTrianglePeakTS);
775  }
776  else
777  {
778  if(BestSlope < -1 * Charge[mTrianglePeakTS] / (iTS - 1 - mTrianglePeakTS))
779  BestSlope = -1 * Charge[mTrianglePeakTS] / (iTS - 1 - mTrianglePeakTS);
780  }
781 
782  // calculate partial chi2
783 
784  // The shape I'm fitting is more like a tent than a triangle.
785  // After the end of triangle edge assume a flat line
786 
787  double Chi2 = 0;
788  for(int i = mTrianglePeakTS + 1; i < iTS; i++)
789  Chi2 += (Charge[mTrianglePeakTS] - Charge[i] + (i - mTrianglePeakTS) * BestSlope)
790  * (Charge[mTrianglePeakTS] - Charge[i] + (i - mTrianglePeakTS) * BestSlope);
791  for(int i = iTS; i < DigiSize; i++) // Assumes fit line = 0 for iTS > fit
792  Chi2 += Charge[i] * Charge[i];
793 
794  if(Chi2 < MinimumRightChi2)
795  {
796  MinimumRightChi2 = Chi2;
797  result.RightSlope = BestSlope;
798  }
799  } // end of right-hand side loop
800 
801  // left side
802  double MinimumLeftChi2 = 1000000;
803 
804  for(int iTS = 0; iTS < (int)mTrianglePeakTS; iTS++) // the first time after linear fit ends
805  {
806  // fit a straight line to the triangle part
807  Numerator = 0;
808  Denominator = 0;
809  for(int i = iTS; i < (int)mTrianglePeakTS; i++)
810  {
811  Numerator = Numerator + (i - mTrianglePeakTS) * (Charge[i] - Charge[mTrianglePeakTS]);
812  Denominator = Denominator + (i - mTrianglePeakTS) * (i - mTrianglePeakTS);
813  }
814 
815  double BestSlope = Numerator / Denominator;
816  if(BestSlope < 0)
817  BestSlope = 0;
818 
819  // check slope
820  if(iTS != 0)
821  {
822  if(BestSlope > Charge[mTrianglePeakTS] / (mTrianglePeakTS - iTS))
823  BestSlope = Charge[mTrianglePeakTS] / (mTrianglePeakTS - iTS);
824  if(BestSlope < Charge[mTrianglePeakTS] / (mTrianglePeakTS + 1 - iTS))
825  BestSlope = Charge[mTrianglePeakTS] / (mTrianglePeakTS + 1 - iTS);
826  }
827  else
828  {
829  if(BestSlope > Charge[mTrianglePeakTS] / (mTrianglePeakTS - iTS))
830  BestSlope = Charge[mTrianglePeakTS] / (mTrianglePeakTS - iTS);
831  }
832 
833  // calculate minimum chi2
834  double Chi2 = 0;
835  for(int i = 0; i < iTS; i++)
836  Chi2 += Charge[i] * Charge[i];
837  for(int i = iTS; i < (int)mTrianglePeakTS; i++)
838  Chi2 += (Charge[mTrianglePeakTS] - Charge[i] + (i - mTrianglePeakTS) * BestSlope)
839  * (Charge[mTrianglePeakTS] - Charge[i] + (i - mTrianglePeakTS) * BestSlope);
840 
841  if(MinimumLeftChi2 > Chi2)
842  {
843  MinimumLeftChi2 = Chi2;
844  result.LeftSlope = BestSlope;
845  }
846  } // end of left-hand side loop
847 
848  result.Chi2 = MinimumLeftChi2 + MinimumRightChi2;
849 
850  return result;
851 }
int i
Definition: DBlmapReader.cc:9
tuple result
Definition: query.py:137
Definition: Chi2.h:17
void HcalNoiseMonitor::ReadHcalPulse ( )
private

Definition at line 853 of file HcalNoiseMonitor.cc.

References HcalPulseShape::at(), CumulativeIdealPulse, HcalPulseShapes::hbShape(), and i.

Referenced by setup().

854 {
855  std::vector<double> PulseShape;
856 
857  HcalPulseShapes Shapes;
858  HcalPulseShapes::Shape HPDShape = Shapes.hbShape();
859 
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); // Safety margin of a lot of zeros in the beginning
864 
865  CumulativeIdealPulse.reserve(350);
866  CumulativeIdealPulse.clear();
867  CumulativeIdealPulse.push_back(0);
868  for(unsigned int i = 1; i < PulseShape.size(); i++)
869  CumulativeIdealPulse.push_back(CumulativeIdealPulse[i-1] + PulseShape[i]);
870 }
int i
Definition: DBlmapReader.cc:9
float at(double time) const
std::vector< double > CumulativeIdealPulse
const Shape & hbShape() const
void HcalNoiseMonitor::reset ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 66 of file HcalNoiseMonitor.cc.

Referenced by beginRun().

67 {
68 }
void HcalNoiseMonitor::setup ( void  )
virtual

Reimplemented from HcalBaseDQMonitor.

Definition at line 96 of file HcalNoiseMonitor.cc.

References DQMStore::book1D(), DQMStore::book2D(), gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, hBadCountHPD, hBadE2E10RBX, hBadNoOtherCountHPD, hBadZeroRBX, hE2OverE10Digi, hE2OverE10Digi5, hE2OverE10RBX, hFailIsolationEtaPhi, hFailLinearEtaPhi, hFailRMSMaxEtaPhi, hFailTriangleEtaPhi, hHcalNoiseCategory, hHPDHitCount, hLambdaLinearVsTotalCharge, hLambdaRMS8MaxVsTotalCharge, hLinearChi2, hLinearTestStatistics, hMaxZeros, hNominalChi2, hRBXHitCount, hRMS8OverMax, hRMS8OverMaxTestStatistics, hTotalZeros, hTriangleLeftSlopeVsTS4, hTriangleRightSlopeVsTS4, hTS4TS5RelativeDifference, hTS4TS5RelativeDifferenceVsCharge, ReadHcalPulse(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), HcalBaseDQMonitor::setup(), setupDone_, HcalBaseDQMonitor::SetupEtaPhiHists(), and HcalBaseDQMonitor::subdir_.

Referenced by beginRun().

97 {
98  if (setupDone_)
99  return;
100  setupDone_ = true;
102 
103  if(debug_ > 1)
104  std::cout << "<HcalNoiseMonitor::setup> Creating histograms" << std::endl;
105 
106  if(dbe_)
107  {
109 
110  // Fit-based
111  dbe_->setCurrentFolder(subdir_ + "DoubleChi2/");
112 
113  hNominalChi2 = dbe_->book1D("Nominal_fit_chi2", "Nominal fit chi2, total charge > 20 fC", 100, 0, 200);
114  hNominalChi2->setAxisTitle("Nominal fit #chi^{2}", 1);
115 
116  hLinearChi2 = dbe_->book1D("Linear_fit_chi2", "Linear fit chi2, total charge > 20 fC", 100, 0, 200);
117  hLinearChi2->setAxisTitle("Linear fit #chi^{2}", 1);
118 
119  hLinearTestStatistics = dbe_->book1D("Lambda_linear", "#Lambda_{linear}, total charge > 20 fC", 100, -10, 10);
120  hLinearTestStatistics->setAxisTitle("#Lambda_{linear}", 1);
121 
122  hRMS8OverMax = dbe_->book1D("RMS8_over_Max", "RMS8/max, total charge > 20 fC", 100, 0, 2);
123  hRMS8OverMax->setAxisTitle("RMS8/max", 1);
124 
125  hRMS8OverMaxTestStatistics = dbe_->book1D("Lambda_RMS8_over_max", "#Lambda_{RMS8/Max}, total charge > 20 fC",
126  100, -30, 10);
127  hRMS8OverMaxTestStatistics->setAxisTitle("#Lambda_{RMS8/Max}", 1);
128 
129  hLambdaLinearVsTotalCharge = dbe_->book2D("Lambda_linear_vs_total_charge", "#Lambda_{Linear}",
130  50, -5, 5, 25, 0, 500);
131  hLambdaLinearVsTotalCharge->setAxisTitle("#Lambda_{linear}", 1);
132  hLambdaLinearVsTotalCharge->setAxisTitle("Total charge", 2);
133 
134  hLambdaRMS8MaxVsTotalCharge = dbe_->book2D("Lambda_RMS8Max_vs_total_charge", "#Lambda_{RMS8/Max}",
135  50, -15, 5, 25, 0, 500);
136  hLambdaRMS8MaxVsTotalCharge->setAxisTitle("#Lambda_{RMS8/Max}", 1);
137  hLambdaRMS8MaxVsTotalCharge->setAxisTitle("Total charge", 2);
138 
139  hTriangleLeftSlopeVsTS4 = dbe_->book2D("Triangle_fit_left_slope",
140  "Triangle fit left distance vs. TS4", 50, 0, 10, 25, 0, 500);
141  hTriangleLeftSlopeVsTS4->setAxisTitle("Left slope", 1);
142  hTriangleLeftSlopeVsTS4->setAxisTitle("Peak time slice", 2);
143 
144  hTriangleRightSlopeVsTS4 = dbe_->book2D("Triangle_fit_right_slope",
145  "Triangle fit right distance vs. peak time slice", 50, 0, 10, 25, 0, 500);
146  hTriangleRightSlopeVsTS4->setAxisTitle("Left slope", 1);
147  hTriangleRightSlopeVsTS4->setAxisTitle("Peak time slice", 2);
148 
149  SetupEtaPhiHists(hFailLinearEtaPhi, "Fail_linear_Eta_Phi_Map", "");
150  SetupEtaPhiHists(hFailRMSMaxEtaPhi, "Fail_RMS8Max_Eta_Phi_Map", "");
151  SetupEtaPhiHists(hFailTriangleEtaPhi, "Fail_triangle_Eta_Phi_Map", "");
152 
153  // High-level isolation filter
154  dbe_->setCurrentFolder(subdir_ + "IsolationVariable/");
155 
156  SetupEtaPhiHists(hFailIsolationEtaPhi, "Fail_isolation_Eta_Phi_Map", "");
157 
158  // TS4 vs. TS5 variable
159  dbe_->setCurrentFolder(subdir_ + "TS4TS5Variable/");
160 
161  hTS4TS5RelativeDifference = dbe_->book1D("TS4_TS5_relative_difference",
162  "(TS4-TS5)/(TS4+TS5), total charge > 20 fC", 100, -1, 1);
163  hTS4TS5RelativeDifference->setAxisTitle("(TS4 - TS5) / (TS4 + TS5)", 1);
164 
165  hTS4TS5RelativeDifferenceVsCharge = dbe_->book2D("TS4_TS5_relative_difference_charge",
166  "(TS4-TS5)/(TS4+TS5) vs. Charge", 25, 0, 400, 75, -1, 1);
168  hTS4TS5RelativeDifferenceVsCharge->setAxisTitle("(TS4 - TS5) / (TS4 + TS5)", 2);
169 
170  // Noise summary object
171  dbe_->setCurrentFolder(subdir_ + "NoiseMonitoring/");
172 
173  hMaxZeros = dbe_->book1D("Max_Zeros", "Max zeros", 15, -0.5, 14.5);
174 
175  hTotalZeros = dbe_->book1D("Total_Zeros", "Total zeros", 15, -0.5, 14.5);
176 
177  hE2OverE10Digi = dbe_->book1D("E2OverE10Digi", "E2/E10 of the highest digi in an HPD", 100, 0, 2);
178 
179  hE2OverE10Digi5 = dbe_->book1D("E2OverE10Digi5", "E2/E10 of the highest 5 digi in an HPD", 100, 0, 2);
180 
181  hE2OverE10RBX = dbe_->book1D("E2OverE10RBX", "E2/E10 of RBX", 100, 0, 2);
182 
183  hHPDHitCount = dbe_->book1D("HPDHitCount", "HPD hit count (1.5 GeV)", 19, -0.5, 18.5);
184 
185  hRBXHitCount = dbe_->book1D("RBXHitCount", "Number of hits in RBX", 74, -0.5, 73.5);
186 
187  hHcalNoiseCategory = dbe_->book1D("Hcal_noise_category", "Hcal noise category", 10, 0.5, 10.5);
188  hHcalNoiseCategory->setBinLabel(1, "RBX noise", 1);
189  hHcalNoiseCategory->setBinLabel(2, "RBX pedestal flatter", 1);
190  hHcalNoiseCategory->setBinLabel(3, "RBX pedestal sharper", 1);
191  hHcalNoiseCategory->setBinLabel(4, "RBX flash large hit count", 1);
192  hHcalNoiseCategory->setBinLabel(5, "RBX flash small hit count", 1);
193  hHcalNoiseCategory->setBinLabel(7, "HPD discharge", 1);
194  hHcalNoiseCategory->setBinLabel(8, "HPD ion feedback", 1);
195 
196  hBadZeroRBX = dbe_->book1D("BadZeroRBX", "RBX with bad ADC zero counts", 72, 0.5, 72.5);
197  hBadCountHPD = dbe_->book1D("BadCountHPD", "HPD with bad hit counts", 72 * 4, 0.5, 72 * 4 + 0.5);
198  hBadNoOtherCountHPD = dbe_->book1D("BadNoOtherCountHPD", "HPD with bad \"no other\" hit counts", 72 * 4, 0.5, 72 * 4 + 0.5);
199  hBadE2E10RBX = dbe_->book1D("BadE2E10RBX", "RBX with bad E2/E10 value", 72, 0.5, 72.5);
200  }
201 
202  ReadHcalPulse();
203 
204  return;
205 }
MonitorElement * hBadCountHPD
MonitorElement * hE2OverE10Digi
MonitorElement * hBadNoOtherCountHPD
MonitorElement * hTS4TS5RelativeDifferenceVsCharge
MonitorElement * hE2OverE10RBX
MonitorElement * hMaxZeros
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
MonitorElement * hLambdaRMS8MaxVsTotalCharge
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)
MonitorElement * hHcalNoiseCategory
MonitorElement * hNominalChi2
EtaPhiHists hFailRMSMaxEtaPhi
MonitorElement * hTotalZeros
MonitorElement * hLinearChi2
MonitorElement * hLinearTestStatistics
MonitorElement * hBadE2E10RBX
EtaPhiHists hFailTriangleEtaPhi
MonitorElement * hBadZeroRBX
MonitorElement * hTriangleRightSlopeVsTS4
MonitorElement * hRMS8OverMaxTestStatistics
MonitorElement * hTS4TS5RelativeDifference
MonitorElement * hRBXHitCount
MonitorElement * hE2OverE10Digi5
MonitorElement * hRMS8OverMax
MonitorElement * hTriangleLeftSlopeVsTS4
void SetupEtaPhiHists(EtaPhiHists &hh, std::string Name, std::string Units)
tuple cout
Definition: gather_cfg.py:121
MonitorElement * hHPDHitCount
EtaPhiHists hFailIsolationEtaPhi
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
virtual void setup(void)
MonitorElement * hLambdaLinearVsTotalCharge
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
EtaPhiHists hFailLinearEtaPhi
void HcalNoiseMonitor::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap 
)

Member Data Documentation

std::vector<double> HcalNoiseMonitor::CumulativeIdealPulse
private
MonitorElement* HcalNoiseMonitor::hBadCountHPD
private

Definition at line 89 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hBadE2E10RBX
private

Definition at line 91 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hBadNoOtherCountHPD
private

Definition at line 90 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hBadZeroRBX
private

Definition at line 88 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hE2OverE10Digi
private

Definition at line 81 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hE2OverE10Digi5
private

Definition at line 82 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hE2OverE10RBX
private

Definition at line 83 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

EtaPhiHists HcalNoiseMonitor::hFailIsolationEtaPhi
private

Definition at line 72 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

EtaPhiHists HcalNoiseMonitor::hFailLinearEtaPhi
private

Definition at line 67 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

EtaPhiHists HcalNoiseMonitor::hFailRMSMaxEtaPhi
private

Definition at line 68 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

EtaPhiHists HcalNoiseMonitor::hFailTriangleEtaPhi
private

Definition at line 69 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hHcalNoiseCategory
private

Definition at line 86 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hHPDHitCount
private

Definition at line 84 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hLambdaLinearVsTotalCharge
private

Definition at line 62 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hLambdaRMS8MaxVsTotalCharge
private

Definition at line 63 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hLinearChi2
private

Definition at line 57 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hLinearTestStatistics
private

Definition at line 58 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

edm::InputTag HcalNoiseMonitor::hltresultsLabel_
private

Definition at line 49 of file HcalNoiseMonitor.h.

Referenced by HcalNoiseMonitor().

MonitorElement* HcalNoiseMonitor::hMaxZeros
private

Definition at line 79 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hNominalChi2
private

Definition at line 56 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hRBXHitCount
private

Definition at line 85 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hRMS8OverMax
private

Definition at line 59 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hRMS8OverMaxTestStatistics
private

Definition at line 60 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hTotalZeros
private

Definition at line 80 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hTriangleLeftSlopeVsTS4
private

Definition at line 64 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hTriangleRightSlopeVsTS4
private

Definition at line 65 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hTS4TS5RelativeDifference
private

Definition at line 75 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

MonitorElement* HcalNoiseMonitor::hTS4TS5RelativeDifferenceVsCharge
private

Definition at line 76 of file HcalNoiseMonitor.h.

Referenced by analyze(), and setup().

double HcalNoiseMonitor::mE2E10MinEnergy
private

Definition at line 38 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

int HcalNoiseMonitor::mMaxADCZeros
private

Definition at line 43 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

double HcalNoiseMonitor::mMaxE2E10
private

Definition at line 40 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

int HcalNoiseMonitor::mMaxHPDHitCount
private

Definition at line 41 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

int HcalNoiseMonitor::mMaxHPDNoOtherHitCount
private

Definition at line 42 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

double HcalNoiseMonitor::mMinE2E10
private

Definition at line 39 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

double HcalNoiseMonitor::mTotalZeroMinEnergy
private

Definition at line 44 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

int HcalNoiseMonitor::mTrianglePeakTS
private

Definition at line 37 of file HcalNoiseMonitor.h.

Referenced by HcalNoiseMonitor(), and PerformTriangleFit().

int HcalNoiseMonitor::period_
private

Definition at line 33 of file HcalNoiseMonitor.h.

Referenced by HcalNoiseMonitor().

edm::InputTag HcalNoiseMonitor::rawdataLabel_
private

Definition at line 48 of file HcalNoiseMonitor.h.

Referenced by HcalNoiseMonitor().

bool HcalNoiseMonitor::setupDone_
private

Definition at line 34 of file HcalNoiseMonitor.h.

Referenced by HcalNoiseMonitor(), and setup().

edm::EDGetTokenT<HBHEDigiCollection> HcalNoiseMonitor::tok_hbhe_
private

Definition at line 51 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

edm::EDGetTokenT<HBHERecHitCollection> HcalNoiseMonitor::tok_hbherec_
private

Definition at line 52 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

edm::EDGetTokenT<reco::HcalNoiseRBXCollection> HcalNoiseMonitor::tok_noise_
private

Definition at line 53 of file HcalNoiseMonitor.h.

Referenced by analyze(), and HcalNoiseMonitor().

std::vector<std::string> HcalNoiseMonitor::triggers_
private

Definition at line 32 of file HcalNoiseMonitor.h.

Referenced by HcalNoiseMonitor().