CMS 3D CMS Logo

HcalNoiseInfoProducer.cc
Go to the documentation of this file.
2 
3 //
4 // HcalNoiseInfoProducer.cc
5 //
6 // description: Implementation of the producer for the HCAL noise information
7 //
8 // author: J.P. Chou, Brown
9 //
10 //
11 
26 
27 using namespace reco;
28 
29 //
30 // constructors and destructor
31 //
32 
34 {
35  // set the parameters
36  fillDigis_ = iConfig.getParameter<bool>("fillDigis");
37  fillRecHits_ = iConfig.getParameter<bool>("fillRecHits");
38  fillCaloTowers_ = iConfig.getParameter<bool>("fillCaloTowers");
39  fillTracks_ = iConfig.getParameter<bool>("fillTracks");
40  fillLaserMonitor_ = iConfig.getParameter<bool>("fillLaserMonitor");
41 
42  maxProblemRBXs_ = iConfig.getParameter<int>("maxProblemRBXs");
43 
44  maxCaloTowerIEta_ = iConfig.getParameter<int>("maxCaloTowerIEta");
45  maxTrackEta_ = iConfig.getParameter<double>("maxTrackEta");
46  minTrackPt_ = iConfig.getParameter<double>("minTrackPt");
47 
48  digiCollName_ = iConfig.getParameter<std::string>("digiCollName");
49  recHitCollName_ = iConfig.getParameter<std::string>("recHitCollName");
50  caloTowerCollName_ = iConfig.getParameter<std::string>("caloTowerCollName");
51  trackCollName_ = iConfig.getParameter<std::string>("trackCollName");
52 
53  jetCollName_ = iConfig.getParameter<std::string>("jetCollName");
54  maxNHF_ = iConfig.getParameter<double>("maxNHF");
55  maxjetindex_ = iConfig.getParameter<int>("maxjetindex");
56  jet_token_ = consumes<reco::PFJetCollection>(edm::InputTag(jetCollName_));
57 
58  minRecHitE_ = iConfig.getParameter<double>("minRecHitE");
59  minLowHitE_ = iConfig.getParameter<double>("minLowHitE");
60  minHighHitE_ = iConfig.getParameter<double>("minHighHitE");
61 
62  minR45HitE_ = iConfig.getParameter<double>("minR45HitE");
63 
64  HcalAcceptSeverityLevel_ = iConfig.getParameter<uint32_t>("HcalAcceptSeverityLevel");
65  HcalRecHitFlagsToBeExcluded_ = iConfig.getParameter<std::vector<int> >("HcalRecHitFlagsToBeExcluded");
66 
67  // Digi threshold and time slices to use for HBHE and HF calibration digis
69  calibdigiHBHEtimeslices_ = std::vector<int>();
71  calibdigiHFtimeslices_ = std::vector<int>();
72 
73  calibdigiHBHEthreshold_ = iConfig.getParameter<double>("calibdigiHBHEthreshold");
74  calibdigiHBHEtimeslices_ = iConfig.getParameter<std::vector<int> >("calibdigiHBHEtimeslices");
75  calibdigiHFthreshold_ = iConfig.getParameter<double>("calibdigiHFthreshold");
76  calibdigiHFtimeslices_ = iConfig.getParameter<std::vector<int> >("calibdigiHFtimeslices");
77 
78  TS4TS5EnergyThreshold_ = iConfig.getParameter<double>("TS4TS5EnergyThreshold");
79 
80  std::vector<double> TS4TS5UpperThresholdTemp = iConfig.getParameter<std::vector<double> >("TS4TS5UpperThreshold");
81  std::vector<double> TS4TS5UpperCutTemp = iConfig.getParameter<std::vector<double> >("TS4TS5UpperCut");
82  std::vector<double> TS4TS5LowerThresholdTemp = iConfig.getParameter<std::vector<double> >("TS4TS5LowerThreshold");
83  std::vector<double> TS4TS5LowerCutTemp = iConfig.getParameter<std::vector<double> >("TS4TS5LowerCut");
84 
85  for(int i = 0; i < (int)TS4TS5UpperThresholdTemp.size() && i < (int)TS4TS5UpperCutTemp.size(); i++)
86  TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[i], TS4TS5UpperCutTemp[i]));
87  sort(TS4TS5UpperCut_.begin(), TS4TS5UpperCut_.end());
88 
89  for(int i = 0; i < (int)TS4TS5LowerThresholdTemp.size() && i < (int)TS4TS5LowerCutTemp.size(); i++)
90  TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[i], TS4TS5LowerCutTemp[i]));
91  sort(TS4TS5LowerCut_.begin(), TS4TS5LowerCut_.end());
92 
93  // if digis are filled, then rechits must also be filled
94  if(fillDigis_ && !fillRecHits_) {
95  fillRecHits_=true;
96  edm::LogWarning("HCalNoiseInfoProducer") << " forcing fillRecHits to be true if fillDigis is true.\n";
97  }
98 
99  // get the fiber configuration vectors
100  laserMonCBoxList_ = iConfig.getParameter<std::vector<int> >("laserMonCBoxList");
101  laserMonIPhiList_ = iConfig.getParameter<std::vector<int> >("laserMonIPhiList");
102  laserMonIEtaList_ = iConfig.getParameter<std::vector<int> >("laserMonIEtaList");
103 
104  // check that the vectors have the same size, if not
105  // disable the laser monitor
106  if( !( (laserMonCBoxList_.size() == laserMonIEtaList_.size() ) &&
107  (laserMonCBoxList_.size() == laserMonIPhiList_.size() ) ) ) {
108  edm::LogWarning("MisConfiguration")<<"Must provide equally sized lists for laserMonCBoxList, laserMonIEtaList, and laserMonIPhiList. Will not fill LaserMon\n";
109  fillLaserMonitor_=false;
110  }
111 
112  // get the integration region with defaults
113  laserMonitorTSStart_ = iConfig.getParameter<int>("laserMonTSStart");
114  laserMonitorTSEnd_ = iConfig.getParameter<int>("laserMonTSEnd");
115  laserMonitorSamples_ = iConfig.getParameter<unsigned>("laserMonSamples");
116 
117  adc2fC= std::vector<float> {-0.5,0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5,11.5,12.5,
118  13.5,15.,17.,19.,21.,23.,25.,27.,29.5,32.5,35.5,38.5,42.,46.,50.,54.5,59.5,
119  64.5,59.5,64.5,69.5,74.5,79.5,84.5,89.5,94.5,99.5,104.5,109.5,114.5,119.5,
120  124.5,129.5,137.,147.,157.,167.,177.,187.,197.,209.5,224.5,239.5,254.5,272.,
121  292.,312.,334.5,359.5,384.5,359.5,384.5,409.5,434.5,459.5,484.5,509.5,534.5,
122  559.5,584.5,609.5,634.5,659.5,684.5,709.5,747.,797.,847.,897.,947.,997.,
123  1047.,1109.5,1184.5,1259.5,1334.5,1422.,1522.,1622.,1734.5,1859.5,1984.5,
124  1859.5,1984.5,2109.5,2234.5,2359.5,2484.5,2609.5,2734.5,2859.5,2984.5,
125  3109.5,3234.5,3359.5,3484.5,3609.5,3797.,4047.,4297.,4547.,4797.,5047.,
126  5297.,5609.5,5984.5,6359.5,6734.5,7172.,7672.,8172.,8734.5,9359.5,9984.5};
127 
128  // adc -> fC for qie10, for laser monitor
129  // Taken from page 3 in
130  // https://cms-docdb.cern.ch/cgi-bin/DocDB/RetrieveFile?docid=12570&filename=QIE10_final.pdf&version=5
131  adc2fCHF = std::vector<float> {
132  // - - - - - - - range 0 - - - - - - - -
133  //subrange0
134  1.58, 4.73, 7.88, 11.0, 14.2, 17.3, 20.5, 23.6,
135  26.8, 29.9, 33.1, 36.2, 39.4, 42.5, 45.7, 48.8,
136  //subrange1
137  53.6, 60.1, 66.6, 73.0, 79.5, 86.0, 92.5, 98.9,
138  105, 112, 118, 125, 131, 138, 144, 151,
139  //subrange2
140  157, 164, 170, 177, 186, 199, 212, 225,
141  238, 251, 264, 277, 289, 302, 315, 328,
142  //subrange3
143  341, 354, 367, 380, 393, 406, 418, 431,
144  444, 464, 490, 516, 542, 568, 594, 620,
145 
146  // - - - - - - - range 1 - - - - - - - -
147  //subrange0
148  569, 594, 619, 645, 670, 695, 720, 745,
149  771, 796, 821, 846, 871, 897, 922, 947,
150  //subrange1
151  960, 1010, 1060, 1120, 1170, 1220, 1270, 1320,
152  1370, 1430, 1480, 1530, 1580, 1630, 1690, 1740,
153  //subrange2
154  1790, 1840, 1890, 1940, 2020, 2120, 2230, 2330,
155  2430, 2540, 2640, 2740, 2850, 2950, 3050, 3150,
156  //subrange3
157  3260, 3360, 3460, 3570, 3670, 3770, 3880, 3980,
158  4080, 4240, 4450, 4650, 4860, 5070, 5280, 5490,
159 
160  // - - - - - - - range 2 - - - - - - - -
161  //subrange0
162  5080, 5280, 5480, 5680, 5880, 6080, 6280, 6480,
163  6680, 6890, 7090, 7290, 7490, 7690, 7890, 8090,
164  //subrange1
165  8400, 8810, 9220, 9630, 10000, 10400, 10900, 11300,
166  11700, 12100, 12500, 12900, 13300, 13700, 14100, 14500,
167  //subrange2
168  15000, 15400, 15800, 16200, 16800, 17600, 18400, 19300,
169  20100, 20900, 21700, 22500, 23400, 24200, 25000, 25800,
170  //subrange3
171  26600, 27500, 28300, 29100, 29900, 30700, 31600, 32400,
172  33200, 34400, 36100, 37700, 39400, 41000, 42700, 44300,
173 
174  // - - - - - - - range 3 - - - - - - - - -
175  //subrange0
176  41100, 42700, 44300, 45900, 47600, 49200, 50800, 52500,
177  54100, 55700, 57400, 59000, 60600, 62200, 63900, 65500,
178  //subrange1
179  68000, 71300, 74700, 78000, 81400, 84700, 88000, 91400,
180  94700, 98100, 101000, 105000, 108000, 111000, 115000, 118000,
181  //subrange2
182  121000, 125000, 128000, 131000, 137000, 145000, 152000, 160000,
183  168000, 176000, 183000, 191000, 199000, 206000, 214000, 222000,
184  //subrange3
185  230000, 237000, 245000, 253000, 261000, 268000, 276000, 284000,
186  291000, 302000, 316000, 329000, 343000, 356000, 370000, 384000
187  };
188 
189  hbhedigi_token_ = consumes<HBHEDigiCollection>(edm::InputTag(digiCollName_));
190  hcalcalibdigi_token_ = consumes<HcalCalibDigiCollection>(edm::InputTag("hcalDigis"));
191  lasermondigi_token_ = consumes<QIE10DigiCollection>(iConfig.getParameter<edm::InputTag>("lasermonDigis"));
192  hbherechit_token_ = consumes<HBHERecHitCollection>(edm::InputTag(recHitCollName_));
193  calotower_token_ = consumes<CaloTowerCollection>(edm::InputTag(caloTowerCollName_));
194  track_token_ = consumes<reco::TrackCollection>(edm::InputTag(trackCollName_));
195 
196  // we produce a vector of HcalNoiseRBXs
197  produces<HcalNoiseRBXCollection>();
198  // we also produce a noise summary
199  produces<HcalNoiseSummary>();
200 }
201 
202 
204 {
205 }
206 
209  // define hit energy thesholds
210  desc.add<double>("minRecHitE", 1.5);
211  desc.add<double>("minLowHitE", 10.0);
212  desc.add<double>("minHighHitE", 25.0);
213  desc.add<double>("minR45HitE", 5.0);
214 
215  // define energy threshold for "problematic" cuts
216  desc.add<double>("pMinERatio", 25.0);
217  desc.add<double>("pMinEZeros", 5.0);
218  desc.add<double>("pMinEEMF", 10.0);
219 
220  // define energy threshold for loose/tight/high level cuts
221  desc.add<double>("minERatio", 50.0);
222  desc.add<double>("minEZeros", 10.0);
223  desc.add<double>("minEEMF", 50.0);
224 
225  // define problematic RBX
226  desc.add<double>("pMinE", 40.0);
227  desc.add<double>("pMinRatio", 0.75);
228  desc.add<double>("pMaxRatio", 0.85);
229  desc.add<int>("pMinHPDHits", 10);
230  desc.add<int>("pMinRBXHits", 20);
231  desc.add<int>("pMinHPDNoOtherHits", 7);
232  desc.add<int>("pMinZeros", 4);
233  desc.add<double>("pMinLowEHitTime", -6.0);
234  desc.add<double>("pMaxLowEHitTime", 6.0);
235  desc.add<double>("pMinHighEHitTime", -4.0);
236  desc.add<double>("pMaxHighEHitTime", 5.0);
237  desc.add<double>("pMaxHPDEMF", -0.02);
238  desc.add<double>("pMaxRBXEMF", 0.02);
239  desc.add<int>("pMinRBXRechitR45Count", 1);
240  desc.add<double>("pMinRBXRechitR45Fraction", 0.1);
241  desc.add<double>("pMinRBXRechitR45EnergyFraction", 0.1);
242 
243  // define loose noise cuts
244  desc.add<double>("lMinRatio", -999.0);
245  desc.add<double>("lMaxRatio", 999.0);
246  desc.add<int>("lMinHPDHits", 17);
247  desc.add<int>("lMinRBXHits", 999);
248  desc.add<int>("lMinHPDNoOtherHits", 10);
249  desc.add<int>("lMinZeros", 10);
250  desc.add<double>("lMinLowEHitTime", -9999.0);
251  desc.add<double>("lMaxLowEHitTime", 9999.0);
252  desc.add<double>("lMinHighEHitTime", -9999.0);
253  desc.add<double>("lMaxHighEHitTime", 9999.0);
254 
255  // define tight noise cuts
256  desc.add<double>("tMinRatio", -999.0);
257  desc.add<double>("tMaxRatio", 999.0);
258  desc.add<int>("tMinHPDHits", 16);
259  desc.add<int>("tMinRBXHits", 50);
260  desc.add<int>("tMinHPDNoOtherHits", 9);
261  desc.add<int>("tMinZeros", 8);
262  desc.add<double>("tMinLowEHitTime", -9999.0);
263  desc.add<double>("tMaxLowEHitTime", 9999.0);
264  desc.add<double>("tMinHighEHitTime", -7.0);
265  desc.add<double>("tMaxHighEHitTime", 6.0);
266 
267  // define high level noise cuts
268  desc.add<double>("hlMaxHPDEMF", -9999.0);
269  desc.add<double>("hlMaxRBXEMF", 0.01);
270 
271  // Calibration digi noise variables (used for finding laser noise events)
272  desc.add<double>("calibdigiHBHEthreshold", 15)->
273  setComment("minimum threshold in fC of any HBHE \
274  calib digi to be counted in summary");
275  desc.add<std::vector<int>>("calibdigiHBHEtimeslices", {3,4,5,6,})->
276  setComment("time slices to use when determining charge of HBHE calib digis");
277  desc.add<double>("calibdigiHFthreshold", -999)->
278  setComment("minimum threshold in fC of any HF calib digi to be counted in summary");
279  desc.add<std::vector<int>>("calibdigiHFtimeslices", {0,1,2,3,4,5,6,7,8,9,})->
280  setComment("time slices to use when determining charge of HF calib digis");
281 
282  // RBX-wide TS4TS5 variable
283  desc.add<double>("TS4TS5EnergyThreshold", 50);
284  desc.add<std::vector<double>>("TS4TS5UpperThreshold", {70,90,100,400,4000,});
285  desc.add<std::vector<double>>("TS4TS5UpperCut", {1,0.8,0.75,0.72,0.72,});
286  desc.add<std::vector<double>>("TS4TS5LowerThreshold", {100,120,150,200,300,400,500,});
287  desc.add<std::vector<double>>("TS4TS5LowerCut", {-1,-0.7,-0.4,-0.2,-0.08,0,0.1,});
288 
289  // rechit R45 population filter variables
290  // this comes in groups of four: (a_Count, a_Fraction, a_EnergyFraction, const)
291  // flag as noise if (count * a_count + fraction * a_fraction + energyfraction * a_energyfraction + const) > 0
292  desc.add<std::vector<double>>("lRBXRecHitR45Cuts",
293  {0.0,1.0,0.0,-0.5,0.0,0.0,1.0,-0.5,})->
294  setComment("first 4 entries : equivalent to 'fraction > 0.5' \
295  last 4 entries : equivalent to 'energy fraction > 0.5'");
296  desc.add<std::vector<double>>("tRBXRecHitR45Cuts",
297  {0.0,1.0,0.0,-0.2,0.0,0.0,1.0,-0.2,})->
298  setComment("first 4 entries : equivalent to 'fraction > 0.2' \
299  last 4 entries : equivalent to 'energy fraction > 0.2'" );
300 
301  // define the channels used for laser monitoring
302  // note that the order here indicates the time order
303  // of the channels
304  desc.add<std::vector<int>>("laserMonCBoxList", {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,})->
305  setComment("time ordered list of the cBox values of laser monitor channels");
306  desc.add<std::vector<int>>("laserMonIPhiList", {23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0})->
307  setComment("time ordered list of the iPhi values of laser monitor channels");
308  desc.add<std::vector<int>>("laserMonIEtaList", {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,})->
309  setComment("time ordered list of the iEta values of laser monitor channels");
310 
311  // boundaries for total charge integration
312  desc.add<int>("laserMonTSStart", 0)->
313  setComment("lower bound of laser monitor charge integration window");
314  desc.add<int>("laserMonTSEnd", -1)->
315  setComment("upper bound of laser monitor charge integration window (-1 = no bound)");
316  desc.add<unsigned>("laserMonSamples", 4)->
317  setComment("Number of laser monitor samples to take per channel");
318 
319  // what to fill
320  desc.add<bool>("fillDigis", true);
321  desc.add<bool>("fillRecHits", true);
322  desc.add<bool>("fillCaloTowers", true);
323  desc.add<bool>("fillTracks", true);
324  desc.add<bool>("fillLaserMonitor", true);
325 
326  // maximum number of RBXs to fill
327  // if you want to record all RBXs above some energy threshold,
328  // change maxProblemRBXs to 999 and pMinE (above) to the threshold you want
329  desc.add<int>("maxProblemRBXs", 72)->
330  setComment("maximum number of RBXs to fill. if you want to record \
331  all RBXs above some energy threshold,change maxProblemRBXs to \
332  999 and pMinE (above) to the threshold you want");
333 ;
334 
335  // parameters for calculating summary variables
336  desc.add<int>("maxCaloTowerIEta", 20);
337  desc.add<double>("maxTrackEta", 2.0);
338  desc.add<double>("minTrackPt", 1.0);
339  desc.add<double>("maxNHF", 0.9);
340  desc.add<int>("maxjetindex", 0);
341 
342  // collection names
343  desc.add<std::string>("digiCollName", "hcalDigis");
344  desc.add<std::string>("recHitCollName", "hbhereco");
345  desc.add<std::string>("caloTowerCollName", "towerMaker");
346  desc.add<std::string>("trackCollName", "generalTracks");
347  desc.add<std::string>("jetCollName", "ak4PFJets");
348  desc.add<edm::InputTag>("lasermonDigis", edm::InputTag( "hcalDigis", "LASERMON"));
349 
350  // severity level
351  desc.add<unsigned int>("HcalAcceptSeverityLevel", 9);
352 
353  // which hcal calo flags to mask
354  // (HBHEIsolatedNoise=11, HBHEFlatNoise=12, HBHESpikeNoise=13,
355  // HBHETriangleNoise=14, HBHETS4TS5Noise=15, HBHENegativeNoise=27)
356  desc.add<std::vector<int>>("HcalRecHitFlagsToBeExcluded", {11,12,13,14,15,27,})->
357  setComment("which hcal calo flags to mask (HBHEIsolatedNoise=11, \
358  HBHEFlatNoise=12, HBHESpikeNoise=13, \
359  HBHETriangleNoise=14, HBHETS4TS5Noise=15, HBHENegativeNoise=27)");
360 ;
361 
362  descriptions.add("hcalnoise", desc);
363 }
364 
365 //
366 // member functions
367 //
368 
369 // ------------ method called to produce the data ------------
370 void
372 {
373  // this is what we're going to actually write to the EDM
374  auto result1 = std::make_unique<HcalNoiseRBXCollection>();
375  auto result2 = std::make_unique<HcalNoiseSummary>();
376 
377  // define an empty HcalNoiseRBXArray that we're going to fill
378  HcalNoiseRBXArray rbxarray;
379  HcalNoiseSummary &summary=*result2;
380 
381  // Get topology class to use later
383  iSetup.get<HcalRecNumberingRecord>().get(topo);
384  theHcalTopology_ = topo.product();
385 
386  // fill them with the various components
387  // digi assumes that rechit information is available
388  if(fillRecHits_) fillrechits(iEvent, iSetup, rbxarray, summary);
389  if(fillDigis_) filldigis(iEvent, iSetup, rbxarray, summary);
390  if(fillCaloTowers_) fillcalotwrs(iEvent, iSetup, rbxarray, summary);
391  if(fillTracks_) filltracks(iEvent, iSetup, summary);
392 
393  filljetinfo(iEvent, iSetup, summary);
394 
395  // select those RBXs which are interesting
396  // also look for the highest energy RBX
397  HcalNoiseRBXArray::iterator maxit=rbxarray.begin();
398  double maxenergy=-999;
399  bool maxwritten=false;
400  for(HcalNoiseRBXArray::iterator rit = rbxarray.begin(); rit!=rbxarray.end(); ++rit) {
401  HcalNoiseRBX &rbx=(*rit);
404 
405  // find the highest energy rbx
406  if(data.energy()>maxenergy) {
407  maxenergy=data.energy();
408  maxit=rit;
409  maxwritten=false;
410  }
411 
412  // find out if the rbx is problematic/noisy/etc.
413  bool writerbx = algo_.isProblematic(data) || !algo_.passLooseNoiseFilter(data) ||
415 
416  // fill variables in the summary object not filled elsewhere
417  fillOtherSummaryVariables(summary, data);
418 
419  if(writerbx) {
420  summary.nproblemRBXs_++;
421  if(summary.nproblemRBXs_<=maxProblemRBXs_) {
422  result1->push_back(rbx);
423  if(maxit==rit) maxwritten=true;
424  }
425  }
426  } // end loop over rbxs
427 
428  // if we still haven't written the maximum energy rbx, write it now
429  if(!maxwritten) {
430  HcalNoiseRBX &rbx=(*maxit);
431 
432  // add the RBX to the event
433  result1->push_back(rbx);
434  }
435 
436  // put the rbxcollection and summary into the EDM
437  iEvent.put(std::move(result1));
438  iEvent.put(std::move(result2));
439 
440  return;
441 }
442 
443 
444 // ------------ here we fill specific variables in the summary object not already accounted for earlier
445 void
447 {
448  // charge ratio
449  if(algo_.passRatioThreshold(data) && data.validRatio()) {
450  if(data.ratio()<summary.minE2Over10TS()) {
451  summary.mine2ts_ = data.e2ts();
452  summary.mine10ts_ = data.e10ts(); }
453  if(data.ratio()>summary.maxE2Over10TS()) {
454  summary.maxe2ts_ = data.e2ts();
455  summary.maxe10ts_ = data.e10ts();
456  }
457  }
458 
459  // ADC zeros
460  if(algo_.passZerosThreshold(data)) {
461  if(data.numZeros()>summary.maxZeros()) {
462  summary.maxzeros_ = data.numZeros();
463  }
464  }
465 
466  // hits count
467  if(data.numHPDHits() > summary.maxHPDHits()) {
468  summary.maxhpdhits_ = data.numHPDHits();
469  }
470  if(data.numRBXHits() > summary.maxRBXHits()) {
471  summary.maxrbxhits_ = data.numRBXHits();
472  }
473  if(data.numHPDNoOtherHits() > summary.maxHPDNoOtherHits()) {
474  summary.maxhpdhitsnoother_ = data.numHPDNoOtherHits();
475  }
476 
477  // TS4TS5
478  if(data.PassTS4TS5() == false)
479  summary.hasBadRBXTS4TS5_ = true;
480 
481  if(algo_.passLooseRBXRechitR45(data) == false)
482  summary.hasBadRBXRechitR45Loose_ = true;
483  if(algo_.passTightRBXRechitR45(data) == false)
484  summary.hasBadRBXRechitR45Tight_ = true;
485 
486  // hit timing
487  if(data.minLowEHitTime()<summary.min10GeVHitTime()) {
488  summary.min10_ = data.minLowEHitTime();
489  }
490  if(data.maxLowEHitTime()>summary.max10GeVHitTime()) {
491  summary.max10_ = data.maxLowEHitTime();
492  }
493  summary.rms10_ += data.lowEHitTimeSqrd();
494  summary.cnthit10_ += data.numLowEHits();
495  if(data.minHighEHitTime()<summary.min25GeVHitTime()) {
496  summary.min25_ = data.minHighEHitTime();
497  }
498  if(data.maxHighEHitTime()>summary.max25GeVHitTime()) {
499  summary.max25_ = data.maxHighEHitTime();
500  }
501  summary.rms25_ += data.highEHitTimeSqrd();
502  summary.cnthit25_ += data.numHighEHits();
503 
504  // EMF
505  if(algo_.passEMFThreshold(data)) {
506  if(summary.minHPDEMF() > data.HPDEMF()) {
507  summary.minhpdemf_ = data.HPDEMF();
508  }
509  if(summary.minRBXEMF() > data.RBXEMF()) {
510  summary.minrbxemf_ = data.RBXEMF();
511  }
512  }
513 
514  // summary flag
515  if(!algo_.passLooseRatio(data)) summary.filterstatus_ |= 0x1;
516  if(!algo_.passLooseHits(data)) summary.filterstatus_ |= 0x2;
517  if(!algo_.passLooseZeros(data)) summary.filterstatus_ |= 0x4;
518  if(!algo_.passLooseTiming(data)) summary.filterstatus_ |= 0x8;
519 
520  if(!algo_.passTightRatio(data)) summary.filterstatus_ |= 0x100;
521  if(!algo_.passTightHits(data)) summary.filterstatus_ |= 0x200;
522  if(!algo_.passTightZeros(data)) summary.filterstatus_ |= 0x400;
523  if(!algo_.passTightTiming(data)) summary.filterstatus_ |= 0x800;
524 
525  if(!algo_.passHighLevelNoiseFilter(data)) summary.filterstatus_ |= 0x10000;
526 
527  // summary refvectors
529  if(!algo_.passLooseNoiseFilter(data))
530  join(summary.loosenoisetwrs_, data.rbxTowers());
531  if(!algo_.passTightNoiseFilter(data))
532  join(summary.tightnoisetwrs_, data.rbxTowers());
534  join(summary.hlnoisetwrs_, data.rbxTowers());
535 
536  return;
537 }
538 
539 
540 // ------------ fill the array with digi information
541 void
543 {
544  // Some initialization
545  totalCalibCharge = 0;
546  totalLasmonCharge = 0;
547 
548  // Starting with this version (updated by Jeff Temple on Dec. 6, 2012), the "TS45" names in the variables are mis-nomers. The actual time slices used are determined from the digiTimeSlices_ variable, which may not be limited to only time slices 4 and 5. For now, "TS45" name kept, because that is what is used in HcalNoiseSummary object (in GetCalibCountTS45, etc.). Likewise, the charge value in 'gt15' is now configurable, though the name remains the same. For HBHE, we track both the number of calibration channels (NcalibTS45) and the number of calibration channels above threshold (NcalibTS45gt15). For HF, we track only the number of channels above the given threshold in the given time window (NcalibHFgtX). Default for HF in 2012 is to use the full time sample with effectively no threshold (threshold=-999)
549  int NcalibTS45=0;
550  int NcalibTS45gt15=0;
551  int NcalibHFgtX=0;
552 
553  double chargecalibTS45=0;
554  double chargecalibgt15TS45=0;
555 
556  // get the conditions and channel quality
557  edm::ESHandle<HcalDbService> conditions;
558  iSetup.get<HcalDbRecord>().get(conditions);
560  iSetup.get<HcalChannelQualityRcd>().get("withTopo",qualhandle);
561  const HcalChannelQuality* myqual = qualhandle.product();
563  iSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
564  const HcalSeverityLevelComputer* mySeverity = mycomputer.product();
565 
566  // get the digis
568  // iEvent.getByLabel(digiCollName_, handle);
569  iEvent.getByToken(hbhedigi_token_, handle);
570 
571  if(!handle.isValid()) {
572  throw edm::Exception(edm::errors::ProductNotFound) << " could not find HBHEDigiCollection named " << digiCollName_ << "\n.";
573  return;
574  }
575 
576  // loop over all of the digi information
577  for(HBHEDigiCollection::const_iterator it=handle->begin(); it!=handle->end(); ++it) {
578  const HBHEDataFrame &digi=(*it);
579  HcalDetId cell = digi.id();
580  DetId detcell=(DetId)cell;
581 
582  // check on cells to be ignored and dropped
583  const HcalChannelStatus* mydigistatus=myqual->getValues(detcell.rawId());
584  if(mySeverity->dropChannel(mydigistatus->getValue())) continue;
585  if(digi.zsMarkAndPass()) continue;
586  // Drop if exclude bit set
587  if ((mydigistatus->getValue() & (1 <<HcalChannelStatus::HcalCellExcludeFromHBHENoiseSummary))==1) continue;
588 
589  // get the calibrations and coder
590  const HcalCalibrations& calibrations=conditions->getHcalCalibrations(cell);
591  const HcalQIECoder* channelCoder = conditions->getHcalCoder (cell);
592  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
593  HcalCoderDb coder (*channelCoder, *shape);
594 
595  // match the digi to an rbx and hpd
596  HcalNoiseRBX &rbx=(*array.findRBX(digi));
597  HcalNoiseHPD &hpd=(*array.findHPD(digi));
598 
599  // determine if the digi is one the highest energy hits in the HPD
600  // this works because the rechits are sorted by energy (see fillrechits() below)
601  bool isBig=false, isBig5=false, isRBX=false;
602  int counter=0;
605  rit!=rechits.end(); ++rit, ++counter) {
606  const HcalDetId & detid = (*rit)->idFront();
607  if(DetId(detid) == digi.id()) {
608  if(counter==0) isBig=isBig5=true; // digi is also the highest energy rechit
609  if(counter<5) isBig5=true; // digi is one of 5 highest energy rechits
610  isRBX=true;
611  }
612  }
613 
614  // loop over each of the digi's time slices
615  int totalzeros=0;
616  CaloSamples tool;
617  coder.adc2fC(digi,tool);
618  for(int ts=0; ts<tool.size(); ++ts) {
619 
620  // count zero's
621  if(digi[ts].adc()==0) {
622  ++hpd.totalZeros_;
623  ++totalzeros;
624  }
625 
626  // get the fC's
627  double corrfc = tool[ts]-calibrations.pedestal(digi[ts].capid());
628 
629  // fill the relevant digi arrays
630  if(isBig) hpd.bigCharge_[ts]+=corrfc;
631  if(isBig5) hpd.big5Charge_[ts]+=corrfc;
632  if(isRBX) rbx.allCharge_[ts]+=corrfc;
633  }
634 
635  // record the maximum number of zero's found
636  if(totalzeros>hpd.maxZeros_)
637  hpd.maxZeros_=totalzeros;
638  }
639 
640  // get the calibration digis
642  // iEvent.getByLabel("hcalDigis", hCalib);
643  iEvent.getByToken(hcalcalibdigi_token_, hCalib);
644 
645 
646  // get the lasermon digis
648  iEvent.getByToken(lasermondigi_token_, hLasermon);
649 
650  // get total charge in calibration channels
651  if(hCalib.isValid() == true)
652  {
653 
654  for(HcalCalibDigiCollection::const_iterator digi = hCalib->begin(); digi != hCalib->end(); digi++)
655  {
656  if(digi->id().hcalSubdet() == 0)
657  continue;
658 
659 
660  for(unsigned i = 0; i < (unsigned)digi->size(); i++)
661  totalCalibCharge = totalCalibCharge + adc2fC[digi->sample(i).adc()&0xff];
662 
663 
664  HcalCalibDetId myid=(HcalCalibDetId)digi->id();
666  continue; // ignore HOCrosstalk channels
667  if(digi->zsMarkAndPass()) continue; // skip "mark-and-pass" channels when computing charge in calib channels
668 
669 
670  if (digi->id().hcalSubdet()==HcalForward) // check HF
671  {
672  double sumChargeHF=0;
673  for (unsigned int i=0;i<calibdigiHFtimeslices_.size();++i)
674  {
675  // skip unphysical time slices
676  if (calibdigiHFtimeslices_[i]<0 || calibdigiHFtimeslices_[i]>digi->size())
677  continue;
678  sumChargeHF+=adc2fC[digi->sample(calibdigiHFtimeslices_[i]).adc()&0xff];
679  }
680  if (sumChargeHF>calibdigiHFthreshold_) ++NcalibHFgtX;
681  } // end of HF check
682  else if (digi->id().hcalSubdet()==HcalBarrel || digi->id().hcalSubdet()==HcalEndcap) // now check HBHE
683  {
684  double sumChargeHBHE=0;
685  for (unsigned int i=0;i<calibdigiHBHEtimeslices_.size();++i)
686  {
687  // skip unphysical time slices
688  if (calibdigiHBHEtimeslices_[i]<0 || calibdigiHBHEtimeslices_[i]>digi->size())
689  continue;
690  sumChargeHBHE+=adc2fC[digi->sample(calibdigiHBHEtimeslices_[i]).adc()&0xff];
691  }
692  ++NcalibTS45;
693  chargecalibTS45+=sumChargeHBHE;
694  if (sumChargeHBHE>calibdigiHBHEthreshold_)
695  {
696  ++NcalibTS45gt15;
697  chargecalibgt15TS45+=sumChargeHBHE;
698  }
699  } // end of HBHE check
700  } // loop on HcalCalibDigiCollection
701 
702  } // if (hCalib.isValid()==true)
703  if( fillLaserMonitor_ && (hLasermon.isValid() == true) ) {
704 
705  int icombts = -1;
706  float max_charge = 0;
707  int max_ts = -1;
708  std::vector<float> comb_charge;
709 
710  unsigned nch = laserMonCBoxList_.size();
711  // loop over channels in the order provided
712  for( unsigned ich = 0; ich < nch; ++ich ) {
713  int cboxch = laserMonCBoxList_[ich];
714  int iphi = laserMonIPhiList_[ich];
715  int ieta = laserMonIEtaList_[ich];
716 
717  // loop over digis, find the digi that matches this channel
718  for(const QIE10DataFrame & df : (*hLasermon)) {
719  HcalCalibDetId calibId( df.id() );
720 
721  int ch_cboxch = calibId.cboxChannel();
722  int ch_iphi = calibId.iphi();
723  int ch_ieta = calibId.ieta();
724 
725  if( cboxch == ch_cboxch && iphi == ch_iphi && ieta == ch_ieta ) {
726 
727  unsigned ts_size = df.samples();
728 
729  // loop over time slices
730  for( unsigned its = 0; its < ts_size; ++its ) {
731  // if we are on the last channel, use all the data
732  // otherwise only take the unique samples
733  if( ( (ich + 1) < nch ) && its >= laserMonitorSamples_ ) continue;
734 
735  bool ok = df[its].ok();
736  int adc = df[its].adc();
737 
738  icombts++;
739  // apply integration limits
740  if( icombts < laserMonitorTSStart_ ) continue;
741  if( laserMonitorTSEnd_ > 0 && icombts > laserMonitorTSEnd_ ) continue;
742 
743  if( ok && adc >= 0 ) { // protection against QIE reset or bad ADC values
744 
745  float charge = adc2fCHF[adc];
746  if( charge > max_charge ) {
747  max_charge = charge;
748  max_ts = icombts;
749  }
750 
751  comb_charge.push_back( charge );
752  } // if( ok && adc >= 0 )
753  } // loop over time slices
754  } // if( cboxch == ch_cboxch && iphi == ch_iphi && ieta == ch_ieta )
755  } // loop over digi collection
756  } // loop over channel list
757 
758  // do not continue with the calculation
759  // if the vector was not filled
760  if( comb_charge.empty() ) {
761  totalLasmonCharge = -1;
762  }
763  else {
764  // integrate from +- 3 TS around the time sample
765  // having the maximum charge
766  int start_ts = max_ts - 3;
767  int end_ts = max_ts + 3;
768 
769  // Change the integration limits
770  // if outside of the range
771  if( start_ts < 0 ) start_ts = 0;
772  if( end_ts >= int(comb_charge.size()) ) end_ts = comb_charge.size() - 1;
773 
774  for( int isum = start_ts; isum <= end_ts; ++isum ) {
775  totalLasmonCharge += comb_charge[isum];
776  }
777  }
778  } // if( fillLaserMonitor_ && (hLasermon.isValid() == true) )
779 
780  summary.calibCharge_ = totalCalibCharge;
782  summary.calibCountTS45_=NcalibTS45;
783  summary.calibCountgt15TS45_=NcalibTS45gt15;
784  summary.calibChargeTS45_=chargecalibTS45;
785  summary.calibChargegt15TS45_=chargecalibgt15TS45;
786  summary.calibCountHF_=NcalibHFgtX;
787 
788  return;
789 }
790 
791 // ------------ fill the array with rec hit information
792 void
794 {
795  // get the HCAL channel status map
797  iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
798  const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product();
799 
800  // get the severity level computer
801  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
802  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
803  const HcalSeverityLevelComputer* hcalSevLvlComputer = hcalSevLvlComputerHndl.product();
804 
805  // get the calo geometry
807  iSetup.get<CaloGeometryRecord>().get(pG);
808  const CaloGeometry* geo = pG.product();
809 
810  // get the rechits
812  // iEvent.getByLabel(recHitCollName_, handle);
813  iEvent.getByToken(hbherechit_token_, handle);
814 
815  if(!handle.isValid()) {
817  << " could not find HBHERecHitCollection named " << recHitCollName_ << "\n.";
818  return;
819  }
820 
821  summary.rechitCount_ = 0;
822  summary.rechitCount15_ = 0;
823  summary.rechitEnergy_ = 0;
824  summary.rechitEnergy15_ = 0;
825 
826  summary.hitsInLaserRegion_=0;
827  summary.hitsInNonLaserRegion_=0;
828  summary.energyInLaserRegion_=0;
829  summary.energyInNonLaserRegion_=0;
830 
831 
832 
833  // loop over all of the rechit information
834  for(HBHERecHitCollection::const_iterator it=handle->begin(); it!=handle->end(); ++it) {
835  const HBHERecHit &rechit=(*it);
836 
837  // skip bad rechits (other than those flagged by the isolated noise, triangle, flat, and spike algorithms)
838  const DetId id = rechit.idFront();
839 
840  uint32_t recHitFlag = rechit.flags();
841  uint32_t isolbitset = (1 << HcalCaloFlagLabels::HBHEIsolatedNoise);
842  uint32_t flatbitset = (1 << HcalCaloFlagLabels::HBHEFlatNoise);
843  uint32_t spikebitset = (1 << HcalCaloFlagLabels::HBHESpikeNoise);
844  uint32_t trianglebitset = (1 << HcalCaloFlagLabels::HBHETriangleNoise);
845  uint32_t ts4ts5bitset = (1 << HcalCaloFlagLabels::HBHETS4TS5Noise);
846  uint32_t negativebitset = (1 << HcalCaloFlagLabels::HBHENegativeNoise);
847  for(unsigned int i=0; i<HcalRecHitFlagsToBeExcluded_.size(); i++) {
848  uint32_t bitset = (1 << HcalRecHitFlagsToBeExcluded_[i]);
849  recHitFlag = (recHitFlag & bitset) ? recHitFlag-bitset : recHitFlag;
850  }
851  const uint32_t dbStatusFlag = dbHcalChStatus->getValues(id)->getValue();
852 
853  // Ignore rechit if exclude bit set, regardless of severity of other bits
854  if ((dbStatusFlag & (1 <<HcalChannelStatus::HcalCellExcludeFromHBHENoiseSummary))==1) continue;
855 
856  int severityLevel = hcalSevLvlComputer->getSeverityLevel(id, recHitFlag, dbStatusFlag);
857  bool isRecovered = hcalSevLvlComputer->recoveredRecHit(id, recHitFlag);
858  if(severityLevel!=0 && !isRecovered && severityLevel>static_cast<int>(HcalAcceptSeverityLevel_)) continue;
859 
860  // do some rechit counting and energies
861  summary.rechitCount_ = summary.rechitCount_ + 1;
862  summary.rechitEnergy_ = summary.rechitEnergy_ + rechit.eraw();
863  if ((dbStatusFlag & (1 <<HcalChannelStatus::HcalBadLaserSignal))==1) // hit comes from a region where no laser calibration pulse is normally seen
864  {
865  ++summary.hitsInNonLaserRegion_;
866  summary.energyInNonLaserRegion_+=rechit.eraw();
867  }
868  else // hit comes from region where laser calibration pulse is seen
869  {
870  ++summary.hitsInLaserRegion_;
871  summary.energyInLaserRegion_+=rechit.eraw();
872  }
873 
874  if(rechit.eraw() > 1.5)
875  {
876  summary.rechitCount15_ = summary.rechitCount15_ + 1;
877  summary.rechitEnergy15_ = summary.rechitEnergy15_ + rechit.eraw();
878  }
879 
880  // Exclude uncollapsed QIE11 channels
883 
884  // if it was ID'd as isolated noise, update the summary object
885  if(rechit.flags() & isolbitset) {
886  summary.nisolnoise_++;
887  summary.isolnoisee_ += rechit.eraw();
888  GlobalPoint gp = geo->getPosition(rechit.id());
889  double et = rechit.eraw()*gp.perp()/gp.mag();
890  summary.isolnoiseet_ += et;
891  }
892 
893  if(rechit.flags() & flatbitset) {
894  summary.nflatnoise_++;
895  summary.flatnoisee_ += rechit.eraw();
896  GlobalPoint gp = geo->getPosition(rechit.id());
897  double et = rechit.eraw()*gp.perp()/gp.mag();
898  summary.flatnoiseet_ += et;
899  }
900 
901  if(rechit.flags() & spikebitset) {
902  summary.nspikenoise_++;
903  summary.spikenoisee_ += rechit.eraw();
904  GlobalPoint gp = geo->getPosition(rechit.id());
905  double et = rechit.eraw()*gp.perp()/gp.mag();
906  summary.spikenoiseet_ += et;
907  }
908 
909  if(rechit.flags() & trianglebitset) {
910  summary.ntrianglenoise_++;
911  summary.trianglenoisee_ += rechit.eraw();
912  GlobalPoint gp = geo->getPosition(rechit.id());
913  double et = rechit.eraw()*gp.perp()/gp.mag();
914  summary.trianglenoiseet_ += et;
915  }
916 
917  if(rechit.flags() & ts4ts5bitset) {
918  if ((dbStatusFlag & (1 <<HcalChannelStatus::HcalCellExcludeFromHBHENoiseSummaryR45))==0) // only add to TS4TS5 if the bit is not marked as "HcalCellExcludeFromHBHENoiseSummaryR45"
919  {
920  summary.nts4ts5noise_++;
921  summary.ts4ts5noisee_ += rechit.eraw();
922  GlobalPoint gp = geo->getPosition(rechit.id());
923  double et = rechit.eraw()*gp.perp()/gp.mag();
924  summary.ts4ts5noiseet_ += et;
925  }
926  }
927 
928  if(rechit.flags() & negativebitset) {
929  summary.nnegativenoise_++;
930  summary.negativenoisee_ += rechit.eraw();
931  GlobalPoint gp = geo->getPosition(rechit.id());
932  double et = rechit.eraw()*gp.perp()/gp.mag();
933  summary.negativenoiseet_ += et;
934  }
935 
936  // find the hpd that the rechit is in
937  HcalNoiseHPD& hpd=(*array.findHPD(rechit));
938 
939  // create a persistent reference to the rechit
940  edm::Ref<HBHERecHitCollection> myRef(handle, it-handle->begin());
941 
942  // store it in a place so that it remains sorted by energy
943  hpd.refrechitset_.insert(myRef);
944 
945  } // end loop over rechits
946 
947  // loop over all HPDs and transfer the information from refrechitset_ to rechits_;
948  for(HcalNoiseRBXArray::iterator rbxit=array.begin(); rbxit!=array.end(); ++rbxit) {
949  for(std::vector<HcalNoiseHPD>::iterator hpdit=rbxit->hpds_.begin(); hpdit!=rbxit->hpds_.end(); ++hpdit) {
950 
951  // loop over all of the entries in the set and add them to rechits_
953  it=hpdit->refrechitset_.begin(); it!=hpdit->refrechitset_.end(); ++it) {
954  hpdit->rechits_.push_back(*it);
955  }
956  }
957  }
958  // now the rechits in all the HPDs are sorted by energy!
959 
960  return;
961 }
962 
963 // ------------ fill the array with calo tower information
964 void
966 {
967  // get the calotowers
969  // iEvent.getByLabel(caloTowerCollName_, handle);
970  iEvent.getByToken(calotower_token_, handle);
971 
972  if(!handle.isValid()) {
974  << " could not find CaloTowerCollection named " << caloTowerCollName_ << "\n.";
975  return;
976  }
977 
978  summary.emenergy_ = summary.hadenergy_ = 0.0;
979 
980  // loop over all of the calotower information
981  for(CaloTowerCollection::const_iterator it = handle->begin(); it!=handle->end(); ++it) {
982  const CaloTower& twr=(*it);
983 
984  // create a persistent reference to the tower
985  edm::Ref<CaloTowerCollection> myRef(handle, it-handle->begin());
986 
987  // get all of the hpd's that are pointed to by the calotower
988  std::vector<std::vector<HcalNoiseHPD>::iterator> hpditervec;
989  array.findHPD(twr, hpditervec);
990 
991  // loop over the hpd's and add the reference to the RefVectors
992  for(std::vector<std::vector<HcalNoiseHPD>::iterator>::iterator it=hpditervec.begin();
993  it!=hpditervec.end(); ++it)
994  (*it)->calotowers_.push_back(myRef);
995 
996  // skip over anything with |ieta|>maxCaloTowerIEta
997  if(twr.ietaAbs()>maxCaloTowerIEta_) {
998  summary.emenergy_ += twr.emEnergy();
999  summary.hadenergy_ += twr.hadEnergy();
1000  }
1001  }
1002 
1003  return;
1004 }
1005 
1006 // ------------ fill the summary info from jets
1007 void
1009 {
1010  bool goodJetFoundInLowBVRegion = false; // checks whether a jet is in
1011  // a low BV region, where false
1012  // noise flagging rate is higher.
1013  if (!jetCollName_.empty())
1014  {
1016  iEvent.getByToken(jet_token_, pfjet_h);
1017 
1018  if (pfjet_h.isValid())
1019  {
1020  int jetindex=0;
1021  for(reco::PFJetCollection::const_iterator jet = pfjet_h->begin();
1022  jet != pfjet_h->end(); ++jet)
1023  {
1024  if (jetindex>maxjetindex_) break; // only look at jets with
1025  // indices up to maxjetindex_
1026 
1027  // Check whether jet is in low-BV region (0<eta<1.4, -1.8<phi<-1.4)
1028  if (jet->eta()>0.0 && jet->eta()<1.4 &&
1029  jet->phi()>-1.8 && jet->phi()<-1.4)
1030  {
1031  // Look for a good jet in low BV region;
1032  // if found, we will keep event
1033  if (maxNHF_<0.0 || jet->neutralHadronEnergyFraction()<maxNHF_)
1034  {
1035  goodJetFoundInLowBVRegion=true;
1036  break;
1037  }
1038  }
1039  ++jetindex;
1040  }
1041  }
1042  }
1043 
1044  summary.goodJetFoundInLowBVRegion_ = goodJetFoundInLowBVRegion;
1045 }
1046 
1047 // ------------ fill the summary with track information
1048 void
1050 {
1052  // iEvent.getByLabel(trackCollName_, handle);
1053  iEvent.getByToken(track_token_, handle);
1054 
1055  // don't throw exception, just return quietly
1056  if(!handle.isValid()) {
1057  // throw edm::Exception(edm::errors::ProductNotFound)
1058  // << " could not find trackCollection named " << trackCollName_ << "\n.";
1059  return;
1060  }
1061 
1062  summary.trackenergy_=0.0;
1063  for(reco::TrackCollection::const_iterator iTrack = handle->begin(); iTrack!=handle->end(); ++iTrack) {
1064  reco::Track trk=*iTrack;
1065  if(trk.pt()<minTrackPt_ || fabs(trk.eta())>maxTrackEta_) continue;
1066 
1067  summary.trackenergy_ += trk.p();
1068  }
1069 
1070  return;
1071 }
1072 
1073 //define this as a plug-in
int adc(sample_type sample)
get the ADC sample (12 bits)
double e10ts(void) const
Definition: HcalNoiseAlgo.h:23
double HPDEMF(void) const
Definition: HcalNoiseAlgo.h:38
double e2ts(void) const
Definition: HcalNoiseAlgo.h:22
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
T getParameter(std::string const &) const
edm::RefVector< CaloTowerCollection > hlnoisetwrs_
edm::EDGetTokenT< QIE10DigiCollection > lasermondigi_token_
double lowEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:31
std::vector< int > calibdigiHFtimeslices_
std::vector< int > HcalRecHitFlagsToBeExcluded_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool isProblematic(const CommonHcalNoiseRBXData &) const
bool passTightRatio(const CommonHcalNoiseRBXData &) const
bool zsMarkAndPass() const
was ZS MarkAndPass?
Definition: HBHEDataFrame.h:35
double minLowEHitTime(void) const
Definition: HcalNoiseAlgo.h:29
bool passLooseRatio(const CommonHcalNoiseRBXData &) const
CalibDetType calibFlavor() const
get the flavor of this calibration detid
void fillrechits(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
bool passTightRBXRechitR45(const CommonHcalNoiseRBXData &) const
double maxHighEHitTime(void) const
Definition: HcalNoiseAlgo.h:34
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
bool passTightTiming(const CommonHcalNoiseRBXData &) const
double maxLowEHitTime(void) const
Definition: HcalNoiseAlgo.h:30
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int numLowEHits(void) const
Definition: HcalNoiseAlgo.h:32
void produce(edm::Event &, const edm::EventSetup &) override
double ratio(void) const
Definition: HcalNoiseAlgo.h:21
std::vector< std::pair< double, double > > TS4TS5LowerCut_
HcalDetId id() const
get the id
Definition: HBHERecHit.h:42
uint32_t auxPhase1() const
Definition: HBHERecHit.h:57
std::set< edm::Ref< HBHERecHitCollection >, RefHBHERecHitEnergyComparison > refrechitset_
Definition: HcalNoiseHPD.h:147
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
std::vector< HBHEDataFrame >::const_iterator const_iterator
std::vector< float > bigCharge_
Definition: HcalNoiseHPD.h:139
float maxE2Over10TS(void) const
edm::RefVector< CaloTowerCollection > loosenoisetwrs_
void fillcalotwrs(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
std::vector< float > big5Charge_
Definition: HcalNoiseHPD.h:140
HcalDetId idFront() const
Definition: HBHERecHit.cc:5
const Item * getValues(DetId fId, bool throwOnFail=true) const
double isum
bool passLooseRBXRechitR45(const CommonHcalNoiseRBXData &) const
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:253
float min25GeVHitTime(void) const
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
double RBXEMF(void) const
Definition: HcalNoiseAlgo.h:37
edm::RefVector< HBHERecHitCollection > rechits_
Definition: HcalNoiseHPD.h:143
edm::EDGetTokenT< reco::PFJetCollection > jet_token_
int numRBXHits(void) const
Definition: HcalNoiseAlgo.h:26
float min10GeVHitTime(void) const
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
static const unsigned OFF_TDC_TIME
double highEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:35
void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const override
Definition: HcalCoderDb.cc:68
int iEvent
Definition: GenABIO.cc:230
float minE2Over10TS(void) const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
bool passLooseZeros(const CommonHcalNoiseRBXData &) const
double emEnergy() const
Definition: CaloTower.h:110
int maxRBXHits(void) const
bool passTightZeros(const CommonHcalNoiseRBXData &) const
void filljetinfo(edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
double pt() const
track transverse momentum
Definition: TrackBase.h:621
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
int numHighEHits(void) const
Definition: HcalNoiseAlgo.h:36
edm::EDGetTokenT< HcalCalibDigiCollection > hcalcalibdigi_token_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:74
bool passRatioThreshold(const CommonHcalNoiseRBXData &) const
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
bool dropChannel(const uint32_t &mystatus) const
int numHPDNoOtherHits(void) const
Definition: HcalNoiseAlgo.h:27
int numZeros(void) const
Definition: HcalNoiseAlgo.h:28
edm::EDGetTokenT< HBHEDigiCollection > hbhedigi_token_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:74
bool passZerosThreshold(const CommonHcalNoiseRBXData &) const
std::vector< std::pair< double, double > > TS4TS5UpperCut_
float minHPDEMF(void) const
bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const
edm::RefVector< CaloTowerCollection > rbxTowers(void) const
Definition: HcalNoiseAlgo.h:40
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
double hadEnergy() const
Definition: CaloTower.h:111
const_iterator end() const
std::vector< float > allCharge_
Definition: HcalNoiseRBX.h:115
edm::EDGetTokenT< reco::TrackCollection > track_token_
Definition: DetId.h:18
bool passLooseHits(const CommonHcalNoiseRBXData &) const
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
edm::EDGetTokenT< HBHERecHitCollection > hbherechit_token_
int size() const
get the size
Definition: CaloSamples.h:24
void filldigis(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &)
int maxZeros(void) const
edm::RefVector< CaloTowerCollection > tightnoisetwrs_
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
et
define resolution functions of each parameter
double energy(void) const
Definition: HcalNoiseAlgo.h:20
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:17
int ietaAbs() const
Definition: CaloTower.h:186
int cboxChannel() const
get the calibration box channel (if relevant)
bool passLooseTiming(const CommonHcalNoiseRBXData &) const
bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const
int maxHPDNoOtherHits(void) const
fixed size matrix
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double minHighEHitTime(void) const
Definition: HcalNoiseAlgo.h:33
static std::atomic< unsigned int > counter
T get() const
Definition: EventSetup.h:63
double energyInNonLaserRegion_
float minRBXEMF(void) const
static const unsigned OFF_COMBINED
std::vector< int > calibdigiHBHEtimeslices_
const HcalTopology * theHcalTopology_
const HcalDetId & id() const
Definition: HBHEDataFrame.h:27
float eraw() const
Definition: HBHERecHit.h:48
bool PassTS4TS5(void) const
Definition: HcalNoiseAlgo.h:39
uint32_t getValue() const
bool passEMFThreshold(const CommonHcalNoiseRBXData &) const
void filltracks(edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
HcalNoiseInfoProducer(const edm::ParameterSet &)
void fillOtherSummaryVariables(HcalNoiseSummary &summary, const CommonHcalNoiseRBXData &data) const
int maxHPDHits(void) const
int numHPDHits(void) const
Definition: HcalNoiseAlgo.h:25
T const * product() const
Definition: ESHandle.h:86
constexpr uint32_t flags() const
Definition: CaloRecHit.h:36
def move(src, dest)
Definition: eostools.py:510
float max25GeVHitTime(void) const
float max10GeVHitTime(void) const
const_iterator begin() const
bool validRatio(void) const
Definition: HcalNoiseAlgo.h:24
bool passTightHits(const CommonHcalNoiseRBXData &) const
edm::EDGetTokenT< CaloTowerCollection > calotower_token_