CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
reco::HcalNoiseInfoProducer Class Reference

#include <HcalNoiseInfoProducer.h>

Inheritance diagram for reco::HcalNoiseInfoProducer:
edm::stream::EDProducer<>

Public Member Functions

 HcalNoiseInfoProducer (const edm::ParameterSet &)
 
 ~HcalNoiseInfoProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void fillcalotwrs (edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
 
void filldigis (edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &)
 
void filljetinfo (edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
 
void fillOtherSummaryVariables (HcalNoiseSummary &summary, const CommonHcalNoiseRBXData &data) const
 
void fillrechits (edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
 
void filltracks (edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::vector< float > adc2fC
 
std::vector< float > adc2fCHF
 
HcalNoiseAlgo algo_
 
double calibdigiHBHEthreshold_
 
std::vector< int > calibdigiHBHEtimeslices_
 
double calibdigiHFthreshold_
 
std::vector< int > calibdigiHFtimeslices_
 
edm::EDGetTokenT< CaloTowerCollectioncalotower_token_
 
std::string caloTowerCollName_
 
std::string digiCollName_
 
bool fillCaloTowers_
 
bool fillDigis_
 
bool fillLaserMonitor_
 
bool fillRecHits_
 
bool fillTracks_
 
edm::EDGetTokenT< HBHEDigiCollectionhbhedigi_token_
 
edm::EDGetTokenT< HBHERecHitCollectionhbherechit_token_
 
uint32_t HcalAcceptSeverityLevel_
 
edm::EDGetTokenT< HcalCalibDigiCollectionhcalcalibdigi_token_
 
std::vector< int > HcalRecHitFlagsToBeExcluded_
 
edm::EDGetTokenT< reco::PFJetCollectionjet_token_
 
std::string jetCollName_
 
std::vector< int > laserMonCBoxList_
 
edm::EDGetTokenT< QIE10DigiCollectionlasermondigi_token_
 
std::vector< int > laserMonIEtaList_
 
std::vector< int > laserMonIPhiList_
 
unsigned laserMonitorSamples_
 
int laserMonitorTSEnd_
 
int laserMonitorTSStart_
 
int maxCaloTowerIEta_
 
int maxjetindex_
 
double maxNHF_
 
int maxProblemRBXs_
 
double maxTrackEta_
 
double minHighHitE_
 
double minLowHitE_
 
double minR45HitE_
 
double minRecHitE_
 
double minTrackPt_
 
std::string recHitCollName_
 
const HcalTopologytheHcalTopology_
 
double totalCalibCharge
 
double totalLasmonCharge
 
edm::EDGetTokenT< reco::TrackCollectiontrack_token_
 
std::string trackCollName_
 
double TS4TS5EnergyThreshold_
 
std::vector< std::pair< double, double > > TS4TS5LowerCut_
 
std::vector< std::pair< double, double > > TS4TS5UpperCut_
 
bool useCalibDigi_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 48 of file HcalNoiseInfoProducer.h.

Constructor & Destructor Documentation

HcalNoiseInfoProducer::HcalNoiseInfoProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 33 of file HcalNoiseInfoProducer.cc.

References adc2fC, adc2fCHF, calibdigiHBHEthreshold_, calibdigiHBHEtimeslices_, calibdigiHFthreshold_, calibdigiHFtimeslices_, calotower_token_, caloTowerCollName_, digiCollName_, fillCaloTowers_, fillDigis_, fillLaserMonitor_, fillRecHits_, fillTracks_, edm::ParameterSet::getParameter(), hbhedigi_token_, hbherechit_token_, HcalAcceptSeverityLevel_, hcalcalibdigi_token_, HcalRecHitFlagsToBeExcluded_, mps_fire::i, HLT_2018_cff::InputTag, createfilelist::int, jet_token_, jetCollName_, laserMonCBoxList_, lasermondigi_token_, laserMonIEtaList_, laserMonIPhiList_, laserMonitorSamples_, laserMonitorTSEnd_, laserMonitorTSStart_, maxCaloTowerIEta_, maxjetindex_, maxNHF_, maxProblemRBXs_, maxTrackEta_, minHighHitE_, minLowHitE_, minR45HitE_, minRecHitE_, minTrackPt_, recHitCollName_, AlCaHLTBitMon_QueryRunRegistry::string, track_token_, trackCollName_, TS4TS5EnergyThreshold_, TS4TS5LowerCut_, and TS4TS5UpperCut_.

33  : algo_(iConfig) {
34  // set the parameters
35  fillDigis_ = iConfig.getParameter<bool>("fillDigis");
36  fillRecHits_ = iConfig.getParameter<bool>("fillRecHits");
37  fillCaloTowers_ = iConfig.getParameter<bool>("fillCaloTowers");
38  fillTracks_ = iConfig.getParameter<bool>("fillTracks");
39  fillLaserMonitor_ = iConfig.getParameter<bool>("fillLaserMonitor");
40 
41  maxProblemRBXs_ = iConfig.getParameter<int>("maxProblemRBXs");
42 
43  maxCaloTowerIEta_ = iConfig.getParameter<int>("maxCaloTowerIEta");
44  maxTrackEta_ = iConfig.getParameter<double>("maxTrackEta");
45  minTrackPt_ = iConfig.getParameter<double>("minTrackPt");
46 
47  digiCollName_ = iConfig.getParameter<std::string>("digiCollName");
48  recHitCollName_ = iConfig.getParameter<std::string>("recHitCollName");
49  caloTowerCollName_ = iConfig.getParameter<std::string>("caloTowerCollName");
50  trackCollName_ = iConfig.getParameter<std::string>("trackCollName");
51 
52  jetCollName_ = iConfig.getParameter<std::string>("jetCollName");
53  maxNHF_ = iConfig.getParameter<double>("maxNHF");
54  maxjetindex_ = iConfig.getParameter<int>("maxjetindex");
55  jet_token_ = consumes<reco::PFJetCollection>(edm::InputTag(jetCollName_));
56 
57  minRecHitE_ = iConfig.getParameter<double>("minRecHitE");
58  minLowHitE_ = iConfig.getParameter<double>("minLowHitE");
59  minHighHitE_ = iConfig.getParameter<double>("minHighHitE");
60 
61  minR45HitE_ = iConfig.getParameter<double>("minR45HitE");
62 
63  HcalAcceptSeverityLevel_ = iConfig.getParameter<uint32_t>("HcalAcceptSeverityLevel");
64  HcalRecHitFlagsToBeExcluded_ = iConfig.getParameter<std::vector<int>>("HcalRecHitFlagsToBeExcluded");
65 
66  // Digi threshold and time slices to use for HBHE and HF calibration digis
68  calibdigiHBHEtimeslices_ = std::vector<int>();
70  calibdigiHFtimeslices_ = std::vector<int>();
71 
72  calibdigiHBHEthreshold_ = iConfig.getParameter<double>("calibdigiHBHEthreshold");
73  calibdigiHBHEtimeslices_ = iConfig.getParameter<std::vector<int>>("calibdigiHBHEtimeslices");
74  calibdigiHFthreshold_ = iConfig.getParameter<double>("calibdigiHFthreshold");
75  calibdigiHFtimeslices_ = iConfig.getParameter<std::vector<int>>("calibdigiHFtimeslices");
76 
77  TS4TS5EnergyThreshold_ = iConfig.getParameter<double>("TS4TS5EnergyThreshold");
78 
79  std::vector<double> TS4TS5UpperThresholdTemp = iConfig.getParameter<std::vector<double>>("TS4TS5UpperThreshold");
80  std::vector<double> TS4TS5UpperCutTemp = iConfig.getParameter<std::vector<double>>("TS4TS5UpperCut");
81  std::vector<double> TS4TS5LowerThresholdTemp = iConfig.getParameter<std::vector<double>>("TS4TS5LowerThreshold");
82  std::vector<double> TS4TS5LowerCutTemp = iConfig.getParameter<std::vector<double>>("TS4TS5LowerCut");
83 
84  for (int i = 0; i < (int)TS4TS5UpperThresholdTemp.size() && i < (int)TS4TS5UpperCutTemp.size(); i++)
85  TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[i], TS4TS5UpperCutTemp[i]));
86  sort(TS4TS5UpperCut_.begin(), TS4TS5UpperCut_.end());
87 
88  for (int i = 0; i < (int)TS4TS5LowerThresholdTemp.size() && i < (int)TS4TS5LowerCutTemp.size(); i++)
89  TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[i], TS4TS5LowerCutTemp[i]));
90  sort(TS4TS5LowerCut_.begin(), TS4TS5LowerCut_.end());
91 
92  // if digis are filled, then rechits must also be filled
93  if (fillDigis_ && !fillRecHits_) {
94  fillRecHits_ = true;
95  edm::LogWarning("HCalNoiseInfoProducer") << " forcing fillRecHits to be true if fillDigis is true.\n";
96  }
97 
98  // get the fiber configuration vectors
99  laserMonCBoxList_ = iConfig.getParameter<std::vector<int>>("laserMonCBoxList");
100  laserMonIPhiList_ = iConfig.getParameter<std::vector<int>>("laserMonIPhiList");
101  laserMonIEtaList_ = iConfig.getParameter<std::vector<int>>("laserMonIEtaList");
102 
103  // check that the vectors have the same size, if not
104  // disable the laser monitor
105  if (!((laserMonCBoxList_.size() == laserMonIEtaList_.size()) &&
106  (laserMonCBoxList_.size() == laserMonIPhiList_.size()))) {
107  edm::LogWarning("MisConfiguration") << "Must provide equally sized lists for laserMonCBoxList, laserMonIEtaList, "
108  "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>{
118  -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,
119  12.5, 13.5, 15., 17., 19., 21., 23., 25., 27., 29.5, 32.5, 35.5, 38.5,
120  42., 46., 50., 54.5, 59.5, 64.5, 59.5, 64.5, 69.5, 74.5, 79.5, 84.5, 89.5,
121  94.5, 99.5, 104.5, 109.5, 114.5, 119.5, 124.5, 129.5, 137., 147., 157., 167., 177.,
122  187., 197., 209.5, 224.5, 239.5, 254.5, 272., 292., 312., 334.5, 359.5, 384.5, 359.5,
123  384.5, 409.5, 434.5, 459.5, 484.5, 509.5, 534.5, 559.5, 584.5, 609.5, 634.5, 659.5, 684.5,
124  709.5, 747., 797., 847., 897., 947., 997., 1047., 1109.5, 1184.5, 1259.5, 1334.5, 1422.,
125  1522., 1622., 1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5, 2234.5, 2359.5, 2484.5, 2609.5, 2734.5,
126  2859.5, 2984.5, 3109.5, 3234.5, 3359.5, 3484.5, 3609.5, 3797., 4047., 4297., 4547., 4797., 5047.,
127  5297., 5609.5, 5984.5, 6359.5, 6734.5, 7172., 7672., 8172., 8734.5, 9359.5, 9984.5};
128 
129  // adc -> fC for qie10, for laser monitor
130  // Taken from page 3 in
131  // https://cms-docdb.cern.ch/cgi-bin/DocDB/RetrieveFile?docid=12570&filename=QIE10_final.pdf&version=5
132  adc2fCHF = std::vector<float>{// - - - - - - - range 0 - - - - - - - -
133  //subrange0
134  1.58,
135  4.73,
136  7.88,
137  11.0,
138  14.2,
139  17.3,
140  20.5,
141  23.6,
142  26.8,
143  29.9,
144  33.1,
145  36.2,
146  39.4,
147  42.5,
148  45.7,
149  48.8,
150  //subrange1
151  53.6,
152  60.1,
153  66.6,
154  73.0,
155  79.5,
156  86.0,
157  92.5,
158  98.9,
159  105,
160  112,
161  118,
162  125,
163  131,
164  138,
165  144,
166  151,
167  //subrange2
168  157,
169  164,
170  170,
171  177,
172  186,
173  199,
174  212,
175  225,
176  238,
177  251,
178  264,
179  277,
180  289,
181  302,
182  315,
183  328,
184  //subrange3
185  341,
186  354,
187  367,
188  380,
189  393,
190  406,
191  418,
192  431,
193  444,
194  464,
195  490,
196  516,
197  542,
198  568,
199  594,
200  620,
201 
202  // - - - - - - - range 1 - - - - - - - -
203  //subrange0
204  569,
205  594,
206  619,
207  645,
208  670,
209  695,
210  720,
211  745,
212  771,
213  796,
214  821,
215  846,
216  871,
217  897,
218  922,
219  947,
220  //subrange1
221  960,
222  1010,
223  1060,
224  1120,
225  1170,
226  1220,
227  1270,
228  1320,
229  1370,
230  1430,
231  1480,
232  1530,
233  1580,
234  1630,
235  1690,
236  1740,
237  //subrange2
238  1790,
239  1840,
240  1890,
241  1940,
242  2020,
243  2120,
244  2230,
245  2330,
246  2430,
247  2540,
248  2640,
249  2740,
250  2850,
251  2950,
252  3050,
253  3150,
254  //subrange3
255  3260,
256  3360,
257  3460,
258  3570,
259  3670,
260  3770,
261  3880,
262  3980,
263  4080,
264  4240,
265  4450,
266  4650,
267  4860,
268  5070,
269  5280,
270  5490,
271 
272  // - - - - - - - range 2 - - - - - - - -
273  //subrange0
274  5080,
275  5280,
276  5480,
277  5680,
278  5880,
279  6080,
280  6280,
281  6480,
282  6680,
283  6890,
284  7090,
285  7290,
286  7490,
287  7690,
288  7890,
289  8090,
290  //subrange1
291  8400,
292  8810,
293  9220,
294  9630,
295  10000,
296  10400,
297  10900,
298  11300,
299  11700,
300  12100,
301  12500,
302  12900,
303  13300,
304  13700,
305  14100,
306  14500,
307  //subrange2
308  15000,
309  15400,
310  15800,
311  16200,
312  16800,
313  17600,
314  18400,
315  19300,
316  20100,
317  20900,
318  21700,
319  22500,
320  23400,
321  24200,
322  25000,
323  25800,
324  //subrange3
325  26600,
326  27500,
327  28300,
328  29100,
329  29900,
330  30700,
331  31600,
332  32400,
333  33200,
334  34400,
335  36100,
336  37700,
337  39400,
338  41000,
339  42700,
340  44300,
341 
342  // - - - - - - - range 3 - - - - - - - - -
343  //subrange0
344  41100,
345  42700,
346  44300,
347  45900,
348  47600,
349  49200,
350  50800,
351  52500,
352  54100,
353  55700,
354  57400,
355  59000,
356  60600,
357  62200,
358  63900,
359  65500,
360  //subrange1
361  68000,
362  71300,
363  74700,
364  78000,
365  81400,
366  84700,
367  88000,
368  91400,
369  94700,
370  98100,
371  101000,
372  105000,
373  108000,
374  111000,
375  115000,
376  118000,
377  //subrange2
378  121000,
379  125000,
380  128000,
381  131000,
382  137000,
383  145000,
384  152000,
385  160000,
386  168000,
387  176000,
388  183000,
389  191000,
390  199000,
391  206000,
392  214000,
393  222000,
394  //subrange3
395  230000,
396  237000,
397  245000,
398  253000,
399  261000,
400  268000,
401  276000,
402  284000,
403  291000,
404  302000,
405  316000,
406  329000,
407  343000,
408  356000,
409  370000,
410  384000};
411 
412  hbhedigi_token_ = consumes<HBHEDigiCollection>(edm::InputTag(digiCollName_));
413  hcalcalibdigi_token_ = consumes<HcalCalibDigiCollection>(edm::InputTag("hcalDigis"));
414  lasermondigi_token_ = consumes<QIE10DigiCollection>(iConfig.getParameter<edm::InputTag>("lasermonDigis"));
415  hbherechit_token_ = consumes<HBHERecHitCollection>(edm::InputTag(recHitCollName_));
416  calotower_token_ = consumes<CaloTowerCollection>(edm::InputTag(caloTowerCollName_));
417  track_token_ = consumes<reco::TrackCollection>(edm::InputTag(trackCollName_));
418 
419  // we produce a vector of HcalNoiseRBXs
420  produces<HcalNoiseRBXCollection>();
421  // we also produce a noise summary
422  produces<HcalNoiseSummary>();
423 }
T getParameter(std::string const &) const
edm::EDGetTokenT< QIE10DigiCollection > lasermondigi_token_
std::vector< int > calibdigiHFtimeslices_
std::vector< int > HcalRecHitFlagsToBeExcluded_
std::vector< std::pair< double, double > > TS4TS5LowerCut_
edm::EDGetTokenT< reco::PFJetCollection > jet_token_
edm::EDGetTokenT< HcalCalibDigiCollection > hcalcalibdigi_token_
edm::EDGetTokenT< HBHEDigiCollection > hbhedigi_token_
std::vector< std::pair< double, double > > TS4TS5UpperCut_
edm::EDGetTokenT< reco::TrackCollection > track_token_
edm::EDGetTokenT< HBHERecHitCollection > hbherechit_token_
std::vector< int > calibdigiHBHEtimeslices_
edm::EDGetTokenT< CaloTowerCollection > calotower_token_
HcalNoiseInfoProducer::~HcalNoiseInfoProducer ( )
override

Definition at line 425 of file HcalNoiseInfoProducer.cc.

425 {}

Member Function Documentation

void HcalNoiseInfoProducer::fillcalotwrs ( edm::Event iEvent,
const edm::EventSetup iSetup,
HcalNoiseRBXArray array,
HcalNoiseSummary summary 
) const
private

Definition at line 1292 of file HcalNoiseInfoProducer.cc.

References edm::SortedCollection< T, SORT >::begin(), calotower_token_, caloTowerCollName_, CaloTower::emEnergy(), HcalNoiseSummary::emenergy_, edm::SortedCollection< T, SORT >::end(), Exception, reco::HcalNoiseRBXArray::findHPD(), edm::Event::getByToken(), CaloTower::hadEnergy(), HcalNoiseSummary::hadenergy_, patZpeak::handle, CaloTower::ietaAbs(), edm::HandleBase::isValid(), maxCaloTowerIEta_, and edm::errors::ProductNotFound.

Referenced by produce().

1295  {
1296  // get the calotowers
1298  // iEvent.getByLabel(caloTowerCollName_, handle);
1299  iEvent.getByToken(calotower_token_, handle);
1300 
1301  if (!handle.isValid()) {
1303  << " could not find CaloTowerCollection named " << caloTowerCollName_ << "\n.";
1304  return;
1305  }
1306 
1307  summary.emenergy_ = summary.hadenergy_ = 0.0;
1308 
1309  // loop over all of the calotower information
1310  for (CaloTowerCollection::const_iterator it = handle->begin(); it != handle->end(); ++it) {
1311  const CaloTower& twr = (*it);
1312 
1313  // create a persistent reference to the tower
1314  edm::Ref<CaloTowerCollection> myRef(handle, it - handle->begin());
1315 
1316  // get all of the hpd's that are pointed to by the calotower
1317  std::vector<std::vector<HcalNoiseHPD>::iterator> hpditervec;
1318  array.findHPD(twr, hpditervec);
1319 
1320  // loop over the hpd's and add the reference to the RefVectors
1321  for (std::vector<std::vector<HcalNoiseHPD>::iterator>::iterator it = hpditervec.begin(); it != hpditervec.end();
1322  ++it)
1323  (*it)->calotowers_.push_back(myRef);
1324 
1325  // skip over anything with |ieta|>maxCaloTowerIEta
1326  if (twr.ietaAbs() > maxCaloTowerIEta_) {
1327  summary.emenergy_ += twr.emEnergy();
1328  summary.hadenergy_ += twr.hadEnergy();
1329  }
1330  }
1331 
1332  return;
1333 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< CaloTower >::const_iterator const_iterator
double emEnergy() const
Definition: CaloTower.h:134
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
bool isValid() const
Definition: HandleBase.h:70
double hadEnergy() const
Definition: CaloTower.h:135
const_iterator end() const
int ietaAbs() const
Definition: CaloTower.h:205
const_iterator begin() const
edm::EDGetTokenT< CaloTowerCollection > calotower_token_
void HcalNoiseInfoProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 427 of file HcalNoiseInfoProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

427  {
429  // define hit energy thesholds
430  desc.add<double>("minRecHitE", 1.5);
431  desc.add<double>("minLowHitE", 10.0);
432  desc.add<double>("minHighHitE", 25.0);
433  desc.add<double>("minR45HitE", 5.0);
434 
435  // define energy threshold for "problematic" cuts
436  desc.add<double>("pMinERatio", 25.0);
437  desc.add<double>("pMinEZeros", 5.0);
438  desc.add<double>("pMinEEMF", 10.0);
439 
440  // define energy threshold for loose/tight/high level cuts
441  desc.add<double>("minERatio", 50.0);
442  desc.add<double>("minEZeros", 10.0);
443  desc.add<double>("minEEMF", 50.0);
444 
445  // define problematic RBX
446  desc.add<double>("pMinE", 40.0);
447  desc.add<double>("pMinRatio", 0.75);
448  desc.add<double>("pMaxRatio", 0.85);
449  desc.add<int>("pMinHPDHits", 10);
450  desc.add<int>("pMinRBXHits", 20);
451  desc.add<int>("pMinHPDNoOtherHits", 7);
452  desc.add<int>("pMinZeros", 4);
453  desc.add<double>("pMinLowEHitTime", -6.0);
454  desc.add<double>("pMaxLowEHitTime", 6.0);
455  desc.add<double>("pMinHighEHitTime", -4.0);
456  desc.add<double>("pMaxHighEHitTime", 5.0);
457  desc.add<double>("pMaxHPDEMF", -0.02);
458  desc.add<double>("pMaxRBXEMF", 0.02);
459  desc.add<int>("pMinRBXRechitR45Count", 1);
460  desc.add<double>("pMinRBXRechitR45Fraction", 0.1);
461  desc.add<double>("pMinRBXRechitR45EnergyFraction", 0.1);
462 
463  // define loose noise cuts
464  desc.add<double>("lMinRatio", -999.0);
465  desc.add<double>("lMaxRatio", 999.0);
466  desc.add<int>("lMinHPDHits", 17);
467  desc.add<int>("lMinRBXHits", 999);
468  desc.add<int>("lMinHPDNoOtherHits", 10);
469  desc.add<int>("lMinZeros", 10);
470  desc.add<double>("lMinLowEHitTime", -9999.0);
471  desc.add<double>("lMaxLowEHitTime", 9999.0);
472  desc.add<double>("lMinHighEHitTime", -9999.0);
473  desc.add<double>("lMaxHighEHitTime", 9999.0);
474 
475  // define tight noise cuts
476  desc.add<double>("tMinRatio", -999.0);
477  desc.add<double>("tMaxRatio", 999.0);
478  desc.add<int>("tMinHPDHits", 16);
479  desc.add<int>("tMinRBXHits", 50);
480  desc.add<int>("tMinHPDNoOtherHits", 9);
481  desc.add<int>("tMinZeros", 8);
482  desc.add<double>("tMinLowEHitTime", -9999.0);
483  desc.add<double>("tMaxLowEHitTime", 9999.0);
484  desc.add<double>("tMinHighEHitTime", -7.0);
485  desc.add<double>("tMaxHighEHitTime", 6.0);
486 
487  // define high level noise cuts
488  desc.add<double>("hlMaxHPDEMF", -9999.0);
489  desc.add<double>("hlMaxRBXEMF", 0.01);
490 
491  // Calibration digi noise variables (used for finding laser noise events)
492  desc.add<double>("calibdigiHBHEthreshold", 15)
493  ->setComment(
494  "minimum threshold in fC of any HBHE \
495  calib digi to be counted in summary");
496  desc.add<std::vector<int>>("calibdigiHBHEtimeslices",
497  {
498  3,
499  4,
500  5,
501  6,
502  })
503  ->setComment("time slices to use when determining charge of HBHE calib digis");
504  desc.add<double>("calibdigiHFthreshold", -999)
505  ->setComment("minimum threshold in fC of any HF calib digi to be counted in summary");
506  desc.add<std::vector<int>>("calibdigiHFtimeslices",
507  {
508  0,
509  1,
510  2,
511  3,
512  4,
513  5,
514  6,
515  7,
516  8,
517  9,
518  })
519  ->setComment("time slices to use when determining charge of HF calib digis");
520 
521  // RBX-wide TS4TS5 variable
522  desc.add<double>("TS4TS5EnergyThreshold", 50);
523  desc.add<std::vector<double>>("TS4TS5UpperThreshold",
524  {
525  70,
526  90,
527  100,
528  400,
529  4000,
530  });
531  desc.add<std::vector<double>>("TS4TS5UpperCut",
532  {
533  1,
534  0.8,
535  0.75,
536  0.72,
537  0.72,
538  });
539  desc.add<std::vector<double>>("TS4TS5LowerThreshold",
540  {
541  100,
542  120,
543  150,
544  200,
545  300,
546  400,
547  500,
548  });
549  desc.add<std::vector<double>>("TS4TS5LowerCut",
550  {
551  -1,
552  -0.7,
553  -0.4,
554  -0.2,
555  -0.08,
556  0,
557  0.1,
558  });
559 
560  // rechit R45 population filter variables
561  // this comes in groups of four: (a_Count, a_Fraction, a_EnergyFraction, const)
562  // flag as noise if (count * a_count + fraction * a_fraction + energyfraction * a_energyfraction + const) > 0
563  desc.add<std::vector<double>>("lRBXRecHitR45Cuts",
564  {
565  0.0,
566  1.0,
567  0.0,
568  -0.5,
569  0.0,
570  0.0,
571  1.0,
572  -0.5,
573  })
574  ->setComment(
575  "first 4 entries : equivalent to 'fraction > 0.5' \
576  last 4 entries : equivalent to 'energy fraction > 0.5'");
577  desc.add<std::vector<double>>("tRBXRecHitR45Cuts",
578  {
579  0.0,
580  1.0,
581  0.0,
582  -0.2,
583  0.0,
584  0.0,
585  1.0,
586  -0.2,
587  })
588  ->setComment(
589  "first 4 entries : equivalent to 'fraction > 0.2' \
590  last 4 entries : equivalent to 'energy fraction > 0.2'");
591 
592  // define the channels used for laser monitoring
593  // note that the order here indicates the time order
594  // of the channels
595  desc.add<std::vector<int>>("laserMonCBoxList",
596  {
597  5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
598  })
599  ->setComment("time ordered list of the cBox values of laser monitor channels");
600  desc.add<std::vector<int>>("laserMonIPhiList",
601  {23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0})
602  ->setComment("time ordered list of the iPhi values of laser monitor channels");
603  desc.add<std::vector<int>>("laserMonIEtaList",
604  {
605  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
606  })
607  ->setComment("time ordered list of the iEta values of laser monitor channels");
608 
609  // boundaries for total charge integration
610  desc.add<int>("laserMonTSStart", 0)->setComment("lower bound of laser monitor charge integration window");
611  desc.add<int>("laserMonTSEnd", -1)
612  ->setComment("upper bound of laser monitor charge integration window (-1 = no bound)");
613  desc.add<unsigned>("laserMonSamples", 4)->setComment("Number of laser monitor samples to take per channel");
614 
615  // what to fill
616  desc.add<bool>("fillDigis", true);
617  desc.add<bool>("fillRecHits", true);
618  desc.add<bool>("fillCaloTowers", true);
619  desc.add<bool>("fillTracks", true);
620  desc.add<bool>("fillLaserMonitor", true);
621 
622  // maximum number of RBXs to fill
623  // if you want to record all RBXs above some energy threshold,
624  // change maxProblemRBXs to 999 and pMinE (above) to the threshold you want
625  desc.add<int>("maxProblemRBXs", 72)
626  ->setComment(
627  "maximum number of RBXs to fill. if you want to record \
628  all RBXs above some energy threshold,change maxProblemRBXs to \
629  999 and pMinE (above) to the threshold you want");
630  ;
631 
632  // parameters for calculating summary variables
633  desc.add<int>("maxCaloTowerIEta", 20);
634  desc.add<double>("maxTrackEta", 2.0);
635  desc.add<double>("minTrackPt", 1.0);
636  desc.add<double>("maxNHF", 0.9);
637  desc.add<int>("maxjetindex", 0);
638 
639  // collection names
640  desc.add<std::string>("digiCollName", "hcalDigis");
641  desc.add<std::string>("recHitCollName", "hbhereco");
642  desc.add<std::string>("caloTowerCollName", "towerMaker");
643  desc.add<std::string>("trackCollName", "generalTracks");
644  desc.add<std::string>("jetCollName", "ak4PFJets");
645  desc.add<edm::InputTag>("lasermonDigis", edm::InputTag("hcalDigis", "LASERMON"));
646 
647  // severity level
648  desc.add<unsigned int>("HcalAcceptSeverityLevel", 9);
649 
650  // which hcal calo flags to mask
651  // (HBHEIsolatedNoise=11, HBHEFlatNoise=12, HBHESpikeNoise=13,
652  // HBHETriangleNoise=14, HBHETS4TS5Noise=15, HBHENegativeNoise=27)
653  desc.add<std::vector<int>>("HcalRecHitFlagsToBeExcluded",
654  {
655  11,
656  12,
657  13,
658  14,
659  15,
660  27,
661  })
662  ->setComment(
663  "which hcal calo flags to mask (HBHEIsolatedNoise=11, \
664  HBHEFlatNoise=12, HBHESpikeNoise=13, \
665  HBHETriangleNoise=14, HBHETS4TS5Noise=15, HBHENegativeNoise=27)");
666  ;
667 
668  descriptions.add("hcalnoise", desc);
669 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HcalNoiseInfoProducer::filldigis ( edm::Event iEvent,
const edm::EventSetup iSetup,
HcalNoiseRBXArray array,
HcalNoiseSummary summary 
)
private

Definition at line 863 of file HcalNoiseInfoProducer.cc.

References ecalMGPA::adc(), HcalCoderDb::adc2fC(), adc2fC, adc2fCHF, reco::HcalNoiseRBX::allCharge_, edm::RefVector< C, T, F >::begin(), edm::SortedCollection< T, SORT >::begin(), reco::HcalNoiseHPD::big5Charge_, reco::HcalNoiseHPD::bigCharge_, HcalNoiseSummary::calibCharge_, HcalNoiseSummary::calibChargegt15TS45_, HcalNoiseSummary::calibChargeTS45_, HcalNoiseSummary::calibCountgt15TS45_, HcalNoiseSummary::calibCountHF_, HcalNoiseSummary::calibCountTS45_, calibdigiHBHEthreshold_, calibdigiHBHEtimeslices_, calibdigiHFthreshold_, calibdigiHFtimeslices_, HcalCalibDetId::calibFlavor(), AlignmentProducer_cff::calibrations, HcalCalibDetId::cboxChannel(), ALCARECOTkAlJpsiMuMu_cff::charge, counter, digiCollName_, HcalSeverityLevelComputer::dropChannel(), edm::RefVector< C, T, F >::end(), edm::SortedCollection< T, SORT >::end(), Exception, fillLaserMonitor_, reco::HcalNoiseRBXArray::findHPD(), reco::HcalNoiseRBXArray::findRBX(), edm::EventSetup::get(), edm::Event::getByToken(), HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), patZpeak::handle, hbhedigi_token_, HcalBarrel, hcalcalibdigi_token_, HcalChannelStatus::HcalCellExcludeFromHBHENoiseSummary, HcalEndcap, HcalForward, HcalCalibDetId::HOCrosstalk, mps_fire::i, HBHEDataFrame::id(), LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, HcalChannelStatus::isBitSet(), isum, edm::HandleBase::isValid(), laserMonCBoxList_, lasermondigi_token_, laserMonIEtaList_, laserMonIPhiList_, laserMonitorSamples_, laserMonitorTSEnd_, laserMonitorTSStart_, HcalNoiseSummary::lasmonCharge_, reco::HcalNoiseHPD::maxZeros_, convertSQLiteXML::ok, HcalCalibrations::pedestal(), edm::ESHandle< T >::product(), edm::errors::ProductNotFound, DetId::rawId(), TrackInfoProducer_cfi::rechits, reco::HcalNoiseHPD::rechits_, CaloSamples::size(), totalCalibCharge, totalLasmonCharge, reco::HcalNoiseHPD::totalZeros_, and HBHEDataFrame::zsMarkAndPass().

Referenced by produce().

866  {
867  // Some initialization
868  totalCalibCharge = 0;
869  totalLasmonCharge = 0;
870 
871  // 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)
872  int NcalibTS45 = 0;
873  int NcalibTS45gt15 = 0;
874  int NcalibHFgtX = 0;
875 
876  double chargecalibTS45 = 0;
877  double chargecalibgt15TS45 = 0;
878 
879  // get the conditions and channel quality
880  edm::ESHandle<HcalDbService> conditions;
881  iSetup.get<HcalDbRecord>().get(conditions);
883  iSetup.get<HcalChannelQualityRcd>().get("withTopo", qualhandle);
884  const HcalChannelQuality* myqual = qualhandle.product();
886  iSetup.get<HcalSeverityLevelComputerRcd>().get(mycomputer);
887  const HcalSeverityLevelComputer* mySeverity = mycomputer.product();
888 
889  // get the digis
891  // iEvent.getByLabel(digiCollName_, handle);
892  iEvent.getByToken(hbhedigi_token_, handle);
893 
894  if (!handle.isValid()) {
896  << " could not find HBHEDigiCollection named " << digiCollName_ << "\n.";
897  return;
898  }
899 
900  // loop over all of the digi information
901  for (HBHEDigiCollection::const_iterator it = handle->begin(); it != handle->end(); ++it) {
902  const HBHEDataFrame& digi = (*it);
903  HcalDetId cell = digi.id();
904  DetId detcell = (DetId)cell;
905 
906  // check on cells to be ignored and dropped
907  const HcalChannelStatus* mydigistatus = myqual->getValues(detcell.rawId());
908  if (mySeverity->dropChannel(mydigistatus->getValue()))
909  continue;
910  if (digi.zsMarkAndPass())
911  continue;
912  // Drop if exclude bit set
914  continue;
915 
916  // get the calibrations and coder
917  const HcalCalibrations& calibrations = conditions->getHcalCalibrations(cell);
918  const HcalQIECoder* channelCoder = conditions->getHcalCoder(cell);
919  const HcalQIEShape* shape = conditions->getHcalShape(channelCoder);
920  HcalCoderDb coder(*channelCoder, *shape);
921 
922  // match the digi to an rbx and hpd
923  HcalNoiseRBX& rbx = (*array.findRBX(digi));
924  HcalNoiseHPD& hpd = (*array.findHPD(digi));
925 
926  // determine if the digi is one the highest energy hits in the HPD
927  // this works because the rechits are sorted by energy (see fillrechits() below)
928  bool isBig = false, isBig5 = false, isRBX = false;
929  int counter = 0;
931  for (edm::RefVector<HBHERecHitCollection>::const_iterator rit = rechits.begin(); rit != rechits.end();
932  ++rit, ++counter) {
933  const HcalDetId& detid = (*rit)->idFront();
934  if (DetId(detid) == digi.id()) {
935  if (counter == 0)
936  isBig = isBig5 = true; // digi is also the highest energy rechit
937  if (counter < 5)
938  isBig5 = true; // digi is one of 5 highest energy rechits
939  isRBX = true;
940  }
941  }
942 
943  // loop over each of the digi's time slices
944  int totalzeros = 0;
945  CaloSamples tool;
946  coder.adc2fC(digi, tool);
947  for (int ts = 0; ts < tool.size(); ++ts) {
948  // count zero's
949  if (digi[ts].adc() == 0) {
950  ++hpd.totalZeros_;
951  ++totalzeros;
952  }
953 
954  // get the fC's
955  double corrfc = tool[ts] - calibrations.pedestal(digi[ts].capid());
956 
957  // fill the relevant digi arrays
958  if (isBig)
959  hpd.bigCharge_[ts] += corrfc;
960  if (isBig5)
961  hpd.big5Charge_[ts] += corrfc;
962  if (isRBX)
963  rbx.allCharge_[ts] += corrfc;
964  }
965 
966  // record the maximum number of zero's found
967  if (totalzeros > hpd.maxZeros_)
968  hpd.maxZeros_ = totalzeros;
969  }
970 
971  // get the calibration digis
973  // iEvent.getByLabel("hcalDigis", hCalib);
974  iEvent.getByToken(hcalcalibdigi_token_, hCalib);
975 
976  // get the lasermon digis
978  iEvent.getByToken(lasermondigi_token_, hLasermon);
979 
980  // get total charge in calibration channels
981  if (hCalib.isValid() == true) {
982  for (HcalCalibDigiCollection::const_iterator digi = hCalib->begin(); digi != hCalib->end(); digi++) {
983  if (digi->id().hcalSubdet() == 0)
984  continue;
985 
986  for (unsigned i = 0; i < (unsigned)digi->size(); i++)
987  totalCalibCharge = totalCalibCharge + adc2fC[digi->sample(i).adc() & 0xff];
988 
989  HcalCalibDetId myid = (HcalCalibDetId)digi->id();
991  continue; // ignore HOCrosstalk channels
992  if (digi->zsMarkAndPass())
993  continue; // skip "mark-and-pass" channels when computing charge in calib channels
994 
995  if (digi->id().hcalSubdet() == HcalForward) // check HF
996  {
997  double sumChargeHF = 0;
998  for (unsigned int i = 0; i < calibdigiHFtimeslices_.size(); ++i) {
999  // skip unphysical time slices
1000  if (calibdigiHFtimeslices_[i] < 0 || calibdigiHFtimeslices_[i] > digi->size())
1001  continue;
1002  sumChargeHF += adc2fC[digi->sample(calibdigiHFtimeslices_[i]).adc() & 0xff];
1003  }
1004  if (sumChargeHF > calibdigiHFthreshold_)
1005  ++NcalibHFgtX;
1006  } // end of HF check
1007  else if (digi->id().hcalSubdet() == HcalBarrel || digi->id().hcalSubdet() == HcalEndcap) // now check HBHE
1008  {
1009  double sumChargeHBHE = 0;
1010  for (unsigned int i = 0; i < calibdigiHBHEtimeslices_.size(); ++i) {
1011  // skip unphysical time slices
1012  if (calibdigiHBHEtimeslices_[i] < 0 || calibdigiHBHEtimeslices_[i] > digi->size())
1013  continue;
1014  sumChargeHBHE += adc2fC[digi->sample(calibdigiHBHEtimeslices_[i]).adc() & 0xff];
1015  }
1016  ++NcalibTS45;
1017  chargecalibTS45 += sumChargeHBHE;
1018  if (sumChargeHBHE > calibdigiHBHEthreshold_) {
1019  ++NcalibTS45gt15;
1020  chargecalibgt15TS45 += sumChargeHBHE;
1021  }
1022  } // end of HBHE check
1023  } // loop on HcalCalibDigiCollection
1024 
1025  } // if (hCalib.isValid()==true)
1026  if (fillLaserMonitor_ && (hLasermon.isValid() == true)) {
1027  int icombts = -1;
1028  float max_charge = 0;
1029  int max_ts = -1;
1030  std::vector<float> comb_charge;
1031 
1032  unsigned nch = laserMonCBoxList_.size();
1033  // loop over channels in the order provided
1034  for (unsigned ich = 0; ich < nch; ++ich) {
1035  int cboxch = laserMonCBoxList_[ich];
1036  int iphi = laserMonIPhiList_[ich];
1037  int ieta = laserMonIEtaList_[ich];
1038 
1039  // loop over digis, find the digi that matches this channel
1040  for (const QIE10DataFrame& df : (*hLasermon)) {
1041  HcalCalibDetId calibId(df.id());
1042 
1043  int ch_cboxch = calibId.cboxChannel();
1044  int ch_iphi = calibId.iphi();
1045  int ch_ieta = calibId.ieta();
1046 
1047  if (cboxch == ch_cboxch && iphi == ch_iphi && ieta == ch_ieta) {
1048  unsigned ts_size = df.samples();
1049 
1050  // loop over time slices
1051  for (unsigned its = 0; its < ts_size; ++its) {
1052  // if we are on the last channel, use all the data
1053  // otherwise only take the unique samples
1054  if (((ich + 1) < nch) && its >= laserMonitorSamples_)
1055  continue;
1056 
1057  bool ok = df[its].ok();
1058  int adc = df[its].adc();
1059 
1060  icombts++;
1061  // apply integration limits
1062  if (icombts < laserMonitorTSStart_)
1063  continue;
1064  if (laserMonitorTSEnd_ > 0 && icombts > laserMonitorTSEnd_)
1065  continue;
1066 
1067  if (ok && adc >= 0) { // protection against QIE reset or bad ADC values
1068 
1069  float charge = adc2fCHF[adc];
1070  if (charge > max_charge) {
1071  max_charge = charge;
1072  max_ts = icombts;
1073  }
1074 
1075  comb_charge.push_back(charge);
1076  } // if( ok && adc >= 0 )
1077  } // loop over time slices
1078  } // if( cboxch == ch_cboxch && iphi == ch_iphi && ieta == ch_ieta )
1079  } // loop over digi collection
1080  } // loop over channel list
1081 
1082  // do not continue with the calculation
1083  // if the vector was not filled
1084  if (comb_charge.empty()) {
1085  totalLasmonCharge = -1;
1086  } else {
1087  // integrate from +- 3 TS around the time sample
1088  // having the maximum charge
1089  int start_ts = max_ts - 3;
1090  int end_ts = max_ts + 3;
1091 
1092  // Change the integration limits
1093  // if outside of the range
1094  if (start_ts < 0)
1095  start_ts = 0;
1096  if (end_ts >= int(comb_charge.size()))
1097  end_ts = comb_charge.size() - 1;
1098 
1099  for (int isum = start_ts; isum <= end_ts; ++isum) {
1100  totalLasmonCharge += comb_charge[isum];
1101  }
1102  }
1103  } // if( fillLaserMonitor_ && (hLasermon.isValid() == true) )
1104 
1105  summary.calibCharge_ = totalCalibCharge;
1106  summary.lasmonCharge_ = totalLasmonCharge;
1107  summary.calibCountTS45_ = NcalibTS45;
1108  summary.calibCountgt15TS45_ = NcalibTS45gt15;
1109  summary.calibChargeTS45_ = chargecalibTS45;
1110  summary.calibChargegt15TS45_ = chargecalibgt15TS45;
1111  summary.calibCountHF_ = NcalibHFgtX;
1112 
1113  return;
1114 }
edm::EDGetTokenT< QIE10DigiCollection > lasermondigi_token_
std::vector< int > calibdigiHFtimeslices_
bool zsMarkAndPass() const
was ZS MarkAndPass?
Definition: HBHEDataFrame.h:31
CalibDetType calibFlavor() const
get the flavor of this calibration detid
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:27
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< T >::const_iterator const_iterator
std::vector< float > bigCharge_
Definition: HcalNoiseHPD.h:137
std::vector< float > big5Charge_
Definition: HcalNoiseHPD.h:138
const Item * getValues(DetId fId, bool throwOnFail=true) const
double isum
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223
edm::RefVector< HBHERecHitCollection > rechits_
Definition: HcalNoiseHPD.h:141
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
edm::EDGetTokenT< HcalCalibDigiCollection > hcalcalibdigi_token_
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
bool dropChannel(const uint32_t &mystatus) const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
edm::EDGetTokenT< HBHEDigiCollection > hbhedigi_token_
bool isValid() const
Definition: HandleBase.h:70
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:43
const_iterator end() const
std::vector< float > allCharge_
Definition: HcalNoiseRBX.h:108
Definition: DetId.h:17
constexpr double pedestal(int fCapId) const
get pedestal for capid=0..3
HcalQIESample const & sample(int i) const
access a sample
Definition: HBHEDataFrame.h:40
int size() const
get the size
Definition: CaloSamples.h:24
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
bool isBitSet(unsigned int bitnumber) const
int cboxChannel() const
get the calibration box channel (if relevant)
static std::atomic< unsigned int > counter
T get() const
Definition: EventSetup.h:73
std::vector< int > calibdigiHBHEtimeslices_
const HcalDetId & id() const
Definition: HBHEDataFrame.h:23
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
T const * product() const
Definition: ESHandle.h:86
const_iterator begin() const
void HcalNoiseInfoProducer::filljetinfo ( edm::Event iEvent,
const edm::EventSetup iSetup,
HcalNoiseSummary summary 
) const
private

Definition at line 1336 of file HcalNoiseInfoProducer.cc.

References edm::Event::getByToken(), HcalNoiseSummary::goodJetFoundInLowBVRegion_, edm::HandleBase::isValid(), metsig::jet, jet_token_, jetCollName_, maxjetindex_, maxNHF_, and reco::btau::neutralHadronEnergyFraction.

Referenced by produce().

1338  {
1339  bool goodJetFoundInLowBVRegion = false; // checks whether a jet is in
1340  // a low BV region, where false
1341  // noise flagging rate is higher.
1342  if (!jetCollName_.empty()) {
1344  iEvent.getByToken(jet_token_, pfjet_h);
1345 
1346  if (pfjet_h.isValid()) {
1347  int jetindex = 0;
1348  for (reco::PFJetCollection::const_iterator jet = pfjet_h->begin(); jet != pfjet_h->end(); ++jet) {
1349  if (jetindex > maxjetindex_)
1350  break; // only look at jets with
1351  // indices up to maxjetindex_
1352 
1353  // Check whether jet is in low-BV region (0<eta<1.4, -1.8<phi<-1.4)
1354  if (jet->eta() > 0.0 && jet->eta() < 1.4 && jet->phi() > -1.8 && jet->phi() < -1.4) {
1355  // Look for a good jet in low BV region;
1356  // if found, we will keep event
1357  if (maxNHF_ < 0.0 || jet->neutralHadronEnergyFraction() < maxNHF_) {
1358  goodJetFoundInLowBVRegion = true;
1359  break;
1360  }
1361  }
1362  ++jetindex;
1363  }
1364  }
1365  }
1366 
1367  summary.goodJetFoundInLowBVRegion_ = goodJetFoundInLowBVRegion;
1368 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< reco::PFJetCollection > jet_token_
bool isValid() const
Definition: HandleBase.h:70
void HcalNoiseInfoProducer::fillOtherSummaryVariables ( HcalNoiseSummary summary,
const CommonHcalNoiseRBXData data 
) const
private

Definition at line 759 of file HcalNoiseInfoProducer.cc.

References algo_, HcalNoiseSummary::cnthit10_, HcalNoiseSummary::cnthit25_, CommonHcalNoiseRBXData::e10ts(), CommonHcalNoiseRBXData::e2ts(), HcalNoiseSummary::filterstatus_, HcalNoiseSummary::hasBadRBXRechitR45Loose_, HcalNoiseSummary::hasBadRBXRechitR45Tight_, HcalNoiseSummary::hasBadRBXTS4TS5_, CommonHcalNoiseRBXData::highEHitTimeSqrd(), HcalNoiseSummary::hlnoisetwrs_, CommonHcalNoiseRBXData::HPDEMF(), join(), HcalNoiseSummary::loosenoisetwrs_, CommonHcalNoiseRBXData::lowEHitTimeSqrd(), HcalNoiseSummary::max10_, HcalNoiseSummary::max10GeVHitTime(), HcalNoiseSummary::max25_, HcalNoiseSummary::max25GeVHitTime(), HcalNoiseSummary::maxe10ts_, HcalNoiseSummary::maxE2Over10TS(), HcalNoiseSummary::maxe2ts_, CommonHcalNoiseRBXData::maxHighEHitTime(), HcalNoiseSummary::maxHPDHits(), HcalNoiseSummary::maxhpdhits_, HcalNoiseSummary::maxhpdhitsnoother_, HcalNoiseSummary::maxHPDNoOtherHits(), CommonHcalNoiseRBXData::maxLowEHitTime(), HcalNoiseSummary::maxRBXHits(), HcalNoiseSummary::maxrbxhits_, HcalNoiseSummary::maxZeros(), HcalNoiseSummary::maxzeros_, HcalNoiseSummary::min10_, HcalNoiseSummary::min10GeVHitTime(), HcalNoiseSummary::min25_, HcalNoiseSummary::min25GeVHitTime(), HcalNoiseSummary::mine10ts_, HcalNoiseSummary::minE2Over10TS(), HcalNoiseSummary::mine2ts_, CommonHcalNoiseRBXData::minHighEHitTime(), HcalNoiseSummary::minHPDEMF(), HcalNoiseSummary::minhpdemf_, CommonHcalNoiseRBXData::minLowEHitTime(), HcalNoiseSummary::minRBXEMF(), HcalNoiseSummary::minrbxemf_, CommonHcalNoiseRBXData::numHighEHits(), CommonHcalNoiseRBXData::numHPDHits(), CommonHcalNoiseRBXData::numHPDNoOtherHits(), CommonHcalNoiseRBXData::numLowEHits(), CommonHcalNoiseRBXData::numRBXHits(), CommonHcalNoiseRBXData::numZeros(), HcalNoiseAlgo::passEMFThreshold(), HcalNoiseAlgo::passHighLevelNoiseFilter(), HcalNoiseAlgo::passLooseHits(), HcalNoiseAlgo::passLooseNoiseFilter(), HcalNoiseAlgo::passLooseRatio(), HcalNoiseAlgo::passLooseRBXRechitR45(), HcalNoiseAlgo::passLooseTiming(), HcalNoiseAlgo::passLooseZeros(), HcalNoiseAlgo::passRatioThreshold(), HcalNoiseAlgo::passTightHits(), HcalNoiseAlgo::passTightNoiseFilter(), HcalNoiseAlgo::passTightRatio(), HcalNoiseAlgo::passTightRBXRechitR45(), HcalNoiseAlgo::passTightTiming(), HcalNoiseAlgo::passTightZeros(), CommonHcalNoiseRBXData::PassTS4TS5(), HcalNoiseAlgo::passZerosThreshold(), CommonHcalNoiseRBXData::ratio(), CommonHcalNoiseRBXData::RBXEMF(), CommonHcalNoiseRBXData::rbxTowers(), HcalNoiseSummary::rms10_, HcalNoiseSummary::rms25_, HcalNoiseSummary::tightnoisetwrs_, CommonHcalNoiseRBXData::validRatio(), testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

Referenced by produce().

760  {
761  // charge ratio
762  if (algo_.passRatioThreshold(data) && data.validRatio()) {
763  if (data.ratio() < summary.minE2Over10TS()) {
764  summary.mine2ts_ = data.e2ts();
765  summary.mine10ts_ = data.e10ts();
766  }
767  if (data.ratio() > summary.maxE2Over10TS()) {
768  summary.maxe2ts_ = data.e2ts();
769  summary.maxe10ts_ = data.e10ts();
770  }
771  }
772 
773  // ADC zeros
774  if (algo_.passZerosThreshold(data)) {
775  if (data.numZeros() > summary.maxZeros()) {
776  summary.maxzeros_ = data.numZeros();
777  }
778  }
779 
780  // hits count
781  if (data.numHPDHits() > summary.maxHPDHits()) {
782  summary.maxhpdhits_ = data.numHPDHits();
783  }
784  if (data.numRBXHits() > summary.maxRBXHits()) {
785  summary.maxrbxhits_ = data.numRBXHits();
786  }
787  if (data.numHPDNoOtherHits() > summary.maxHPDNoOtherHits()) {
788  summary.maxhpdhitsnoother_ = data.numHPDNoOtherHits();
789  }
790 
791  // TS4TS5
792  if (data.PassTS4TS5() == false)
793  summary.hasBadRBXTS4TS5_ = true;
794 
795  if (algo_.passLooseRBXRechitR45(data) == false)
796  summary.hasBadRBXRechitR45Loose_ = true;
797  if (algo_.passTightRBXRechitR45(data) == false)
798  summary.hasBadRBXRechitR45Tight_ = true;
799 
800  // hit timing
801  if (data.minLowEHitTime() < summary.min10GeVHitTime()) {
802  summary.min10_ = data.minLowEHitTime();
803  }
804  if (data.maxLowEHitTime() > summary.max10GeVHitTime()) {
805  summary.max10_ = data.maxLowEHitTime();
806  }
807  summary.rms10_ += data.lowEHitTimeSqrd();
808  summary.cnthit10_ += data.numLowEHits();
809  if (data.minHighEHitTime() < summary.min25GeVHitTime()) {
810  summary.min25_ = data.minHighEHitTime();
811  }
812  if (data.maxHighEHitTime() > summary.max25GeVHitTime()) {
813  summary.max25_ = data.maxHighEHitTime();
814  }
815  summary.rms25_ += data.highEHitTimeSqrd();
816  summary.cnthit25_ += data.numHighEHits();
817 
818  // EMF
819  if (algo_.passEMFThreshold(data)) {
820  if (summary.minHPDEMF() > data.HPDEMF()) {
821  summary.minhpdemf_ = data.HPDEMF();
822  }
823  if (summary.minRBXEMF() > data.RBXEMF()) {
824  summary.minrbxemf_ = data.RBXEMF();
825  }
826  }
827 
828  // summary flag
829  if (!algo_.passLooseRatio(data))
830  summary.filterstatus_ |= 0x1;
831  if (!algo_.passLooseHits(data))
832  summary.filterstatus_ |= 0x2;
833  if (!algo_.passLooseZeros(data))
834  summary.filterstatus_ |= 0x4;
835  if (!algo_.passLooseTiming(data))
836  summary.filterstatus_ |= 0x8;
837 
838  if (!algo_.passTightRatio(data))
839  summary.filterstatus_ |= 0x100;
840  if (!algo_.passTightHits(data))
841  summary.filterstatus_ |= 0x200;
842  if (!algo_.passTightZeros(data))
843  summary.filterstatus_ |= 0x400;
844  if (!algo_.passTightTiming(data))
845  summary.filterstatus_ |= 0x800;
846 
847  if (!algo_.passHighLevelNoiseFilter(data))
848  summary.filterstatus_ |= 0x10000;
849 
850  // summary refvectors
852  if (!algo_.passLooseNoiseFilter(data))
853  join(summary.loosenoisetwrs_, data.rbxTowers());
854  if (!algo_.passTightNoiseFilter(data))
855  join(summary.tightnoisetwrs_, data.rbxTowers());
856  if (!algo_.passHighLevelNoiseFilter(data))
857  join(summary.hlnoisetwrs_, data.rbxTowers());
858 
859  return;
860 }
double e10ts(void) const
Definition: HcalNoiseAlgo.h:27
double HPDEMF(void) const
Definition: HcalNoiseAlgo.h:42
double e2ts(void) const
Definition: HcalNoiseAlgo.h:26
edm::RefVector< CaloTowerCollection > hlnoisetwrs_
double lowEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:35
bool passTightRatio(const CommonHcalNoiseRBXData &) const
double minLowEHitTime(void) const
Definition: HcalNoiseAlgo.h:33
bool passLooseRatio(const CommonHcalNoiseRBXData &) const
bool passTightRBXRechitR45(const CommonHcalNoiseRBXData &) const
double maxHighEHitTime(void) const
Definition: HcalNoiseAlgo.h:38
bool passTightTiming(const CommonHcalNoiseRBXData &) const
double maxLowEHitTime(void) const
Definition: HcalNoiseAlgo.h:34
int numLowEHits(void) const
Definition: HcalNoiseAlgo.h:36
double ratio(void) const
Definition: HcalNoiseAlgo.h:25
float maxE2Over10TS(void) const
edm::RefVector< CaloTowerCollection > loosenoisetwrs_
bool passLooseRBXRechitR45(const CommonHcalNoiseRBXData &) const
float min25GeVHitTime(void) const
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
double RBXEMF(void) const
Definition: HcalNoiseAlgo.h:41
int numRBXHits(void) const
Definition: HcalNoiseAlgo.h:30
float min10GeVHitTime(void) const
double highEHitTimeSqrd(void) const
Definition: HcalNoiseAlgo.h:39
float minE2Over10TS(void) const
bool passLooseZeros(const CommonHcalNoiseRBXData &) const
int maxRBXHits(void) const
bool passTightZeros(const CommonHcalNoiseRBXData &) const
int numHighEHits(void) const
Definition: HcalNoiseAlgo.h:40
bool passRatioThreshold(const CommonHcalNoiseRBXData &) const
int numHPDNoOtherHits(void) const
Definition: HcalNoiseAlgo.h:31
int numZeros(void) const
Definition: HcalNoiseAlgo.h:32
bool passZerosThreshold(const CommonHcalNoiseRBXData &) const
float minHPDEMF(void) const
bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const
edm::RefVector< CaloTowerCollection > rbxTowers(void) const
Definition: HcalNoiseAlgo.h:44
bool passLooseHits(const CommonHcalNoiseRBXData &) const
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
int maxZeros(void) const
edm::RefVector< CaloTowerCollection > tightnoisetwrs_
bool passLooseTiming(const CommonHcalNoiseRBXData &) const
bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const
int maxHPDNoOtherHits(void) const
double minHighEHitTime(void) const
Definition: HcalNoiseAlgo.h:37
float minRBXEMF(void) const
bool PassTS4TS5(void) const
Definition: HcalNoiseAlgo.h:43
bool passEMFThreshold(const CommonHcalNoiseRBXData &) const
int maxHPDHits(void) const
int numHPDHits(void) const
Definition: HcalNoiseAlgo.h:29
float max25GeVHitTime(void) const
float max10GeVHitTime(void) const
bool validRatio(void) const
Definition: HcalNoiseAlgo.h:28
bool passTightHits(const CommonHcalNoiseRBXData &) const
void HcalNoiseInfoProducer::fillrechits ( edm::Event iEvent,
const edm::EventSetup iSetup,
HcalNoiseRBXArray array,
HcalNoiseSummary summary 
) const
private

Definition at line 1117 of file HcalNoiseInfoProducer.cc.

References HBHERecHit::auxPhase1(), edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), HcalNoiseSummary::energyInLaserRegion_, HcalNoiseSummary::energyInNonLaserRegion_, HBHERecHit::eraw(), EgHLTOffHistBins_cfi::et, Exception, reco::HcalNoiseRBXArray::findHPD(), CaloRecHit::flags(), HcalNoiseSummary::flatnoisee_, HcalNoiseSummary::flatnoiseet_, edm::EventSetup::get(), CaloRecHitAuxSetter::getBit(), edm::Event::getByToken(), CaloGeometry::getPosition(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), runTauDisplay::gp, patZpeak::handle, HcalCaloFlagLabels::HBHEFlatNoise, HcalCaloFlagLabels::HBHEIsolatedNoise, HcalCaloFlagLabels::HBHENegativeNoise, hbherechit_token_, HcalCaloFlagLabels::HBHESpikeNoise, HcalCaloFlagLabels::HBHETriangleNoise, HcalCaloFlagLabels::HBHETS4TS5Noise, HcalAcceptSeverityLevel_, HcalChannelStatus::HcalCellExcludeFromHBHENoiseSummary, HcalChannelStatus::HcalCellExcludeFromHBHENoiseSummaryR45, HcalRecHitFlagsToBeExcluded_, HcalNoiseSummary::hitsInLaserRegion_, HcalNoiseSummary::hitsInNonLaserRegion_, mps_fire::i, HBHERecHit::id(), HBHERecHit::idFront(), HcalChannelStatus::isBitSet(), HcalNoiseSummary::isolnoisee_, HcalNoiseSummary::isolnoiseet_, edm::HandleBase::isValid(), HcalNoiseSummary::negativenoisee_, HcalNoiseSummary::negativenoiseet_, HcalNoiseSummary::nflatnoise_, HcalNoiseSummary::nisolnoise_, HcalNoiseSummary::nnegativenoise_, HcalNoiseSummary::nspikenoise_, HcalNoiseSummary::ntrianglenoise_, HcalNoiseSummary::nts4ts5noise_, HBHERecHitAuxSetter::OFF_COMBINED, HBHERecHitAuxSetter::OFF_TDC_TIME, edm::ESHandle< T >::product(), edm::errors::ProductNotFound, recHitCollName_, HcalNoiseSummary::rechitCount15_, HcalNoiseSummary::rechitCount_, HcalNoiseSummary::rechitEnergy15_, HcalNoiseSummary::rechitEnergy_, HcalSeverityLevelComputer::recoveredRecHit(), reco::HcalNoiseHPD::refrechitset_, interestingDetIdCollectionProducer_cfi::severityLevel, HcalNoiseSummary::spikenoisee_, HcalNoiseSummary::spikenoiseet_, HcalNoiseSummary::trianglenoisee_, HcalNoiseSummary::trianglenoiseet_, HcalNoiseSummary::ts4ts5noisee_, and HcalNoiseSummary::ts4ts5noiseet_.

Referenced by produce().

1120  {
1121  // get the HCAL channel status map
1122  edm::ESHandle<HcalChannelQuality> hcalChStatus;
1123  iSetup.get<HcalChannelQualityRcd>().get("withTopo", hcalChStatus);
1124  const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product();
1125 
1126  // get the severity level computer
1127  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
1128  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
1129  const HcalSeverityLevelComputer* hcalSevLvlComputer = hcalSevLvlComputerHndl.product();
1130 
1131  // get the calo geometry
1133  iSetup.get<CaloGeometryRecord>().get(pG);
1134  const CaloGeometry* geo = pG.product();
1135 
1136  // get the rechits
1138  // iEvent.getByLabel(recHitCollName_, handle);
1139  iEvent.getByToken(hbherechit_token_, handle);
1140 
1141  if (!handle.isValid()) {
1143  << " could not find HBHERecHitCollection named " << recHitCollName_ << "\n.";
1144  return;
1145  }
1146 
1147  summary.rechitCount_ = 0;
1148  summary.rechitCount15_ = 0;
1149  summary.rechitEnergy_ = 0;
1150  summary.rechitEnergy15_ = 0;
1151 
1152  summary.hitsInLaserRegion_ = 0;
1153  summary.hitsInNonLaserRegion_ = 0;
1154  summary.energyInLaserRegion_ = 0;
1155  summary.energyInNonLaserRegion_ = 0;
1156 
1157  // loop over all of the rechit information
1158  for (HBHERecHitCollection::const_iterator it = handle->begin(); it != handle->end(); ++it) {
1159  const HBHERecHit& rechit = (*it);
1160 
1161  // skip bad rechits (other than those flagged by the isolated noise, triangle, flat, and spike algorithms)
1162  const DetId id = rechit.idFront();
1163 
1164  uint32_t recHitFlag = rechit.flags();
1165  uint32_t isolbitset = (1 << HcalCaloFlagLabels::HBHEIsolatedNoise);
1166  uint32_t flatbitset = (1 << HcalCaloFlagLabels::HBHEFlatNoise);
1167  uint32_t spikebitset = (1 << HcalCaloFlagLabels::HBHESpikeNoise);
1168  uint32_t trianglebitset = (1 << HcalCaloFlagLabels::HBHETriangleNoise);
1169  uint32_t ts4ts5bitset = (1 << HcalCaloFlagLabels::HBHETS4TS5Noise);
1170  uint32_t negativebitset = (1 << HcalCaloFlagLabels::HBHENegativeNoise);
1171  for (unsigned int i = 0; i < HcalRecHitFlagsToBeExcluded_.size(); i++) {
1172  uint32_t bitset = (1 << HcalRecHitFlagsToBeExcluded_[i]);
1173  recHitFlag = (recHitFlag & bitset) ? recHitFlag - bitset : recHitFlag;
1174  }
1175  const HcalChannelStatus* dbStatus = dbHcalChStatus->getValues(id);
1176 
1177  // Ignore rechit if exclude bit set, regardless of severity of other bits
1179  continue;
1180 
1181  int severityLevel = hcalSevLvlComputer->getSeverityLevel(id, recHitFlag, dbStatus->getValue());
1182  bool isRecovered = hcalSevLvlComputer->recoveredRecHit(id, recHitFlag);
1183  if (severityLevel != 0 && !isRecovered && severityLevel > static_cast<int>(HcalAcceptSeverityLevel_))
1184  continue;
1185 
1186  // do some rechit counting and energies
1187  summary.rechitCount_ = summary.rechitCount_ + 1;
1188  summary.rechitEnergy_ = summary.rechitEnergy_ + rechit.eraw();
1189  if (dbStatus->isBitSet(
1191  HcalBadLaserSignal)) // hit comes from a region where no laser calibration pulse is normally seen
1192  {
1193  ++summary.hitsInNonLaserRegion_;
1194  summary.energyInNonLaserRegion_ += rechit.eraw();
1195  } else // hit comes from region where laser calibration pulse is seen
1196  {
1197  ++summary.hitsInLaserRegion_;
1198  summary.energyInLaserRegion_ += rechit.eraw();
1199  }
1200 
1201  if (rechit.eraw() > 1.5) {
1202  summary.rechitCount15_ = summary.rechitCount15_ + 1;
1203  summary.rechitEnergy15_ = summary.rechitEnergy15_ + rechit.eraw();
1204  }
1205 
1206  // Exclude uncollapsed QIE11 channels
1209  continue;
1210 
1211  // if it was ID'd as isolated noise, update the summary object
1212  if (rechit.flags() & isolbitset) {
1213  summary.nisolnoise_++;
1214  summary.isolnoisee_ += rechit.eraw();
1215  GlobalPoint gp = geo->getPosition(rechit.id());
1216  double et = rechit.eraw() * gp.perp() / gp.mag();
1217  summary.isolnoiseet_ += et;
1218  }
1219 
1220  if (rechit.flags() & flatbitset) {
1221  summary.nflatnoise_++;
1222  summary.flatnoisee_ += rechit.eraw();
1223  GlobalPoint gp = geo->getPosition(rechit.id());
1224  double et = rechit.eraw() * gp.perp() / gp.mag();
1225  summary.flatnoiseet_ += et;
1226  }
1227 
1228  if (rechit.flags() & spikebitset) {
1229  summary.nspikenoise_++;
1230  summary.spikenoisee_ += rechit.eraw();
1231  GlobalPoint gp = geo->getPosition(rechit.id());
1232  double et = rechit.eraw() * gp.perp() / gp.mag();
1233  summary.spikenoiseet_ += et;
1234  }
1235 
1236  if (rechit.flags() & trianglebitset) {
1237  summary.ntrianglenoise_++;
1238  summary.trianglenoisee_ += rechit.eraw();
1239  GlobalPoint gp = geo->getPosition(rechit.id());
1240  double et = rechit.eraw() * gp.perp() / gp.mag();
1241  summary.trianglenoiseet_ += et;
1242  }
1243 
1244  if (rechit.flags() & ts4ts5bitset) {
1245  // only add to TS4TS5 if the bit is not marked as "HcalCellExcludeFromHBHENoiseSummaryR45"
1247  summary.nts4ts5noise_++;
1248  summary.ts4ts5noisee_ += rechit.eraw();
1249  GlobalPoint gp = geo->getPosition(rechit.id());
1250  double et = rechit.eraw() * gp.perp() / gp.mag();
1251  summary.ts4ts5noiseet_ += et;
1252  }
1253  }
1254 
1255  if (rechit.flags() & negativebitset) {
1256  summary.nnegativenoise_++;
1257  summary.negativenoisee_ += rechit.eraw();
1258  GlobalPoint gp = geo->getPosition(rechit.id());
1259  double et = rechit.eraw() * gp.perp() / gp.mag();
1260  summary.negativenoiseet_ += et;
1261  }
1262 
1263  // find the hpd that the rechit is in
1264  HcalNoiseHPD& hpd = (*array.findHPD(rechit));
1265 
1266  // create a persistent reference to the rechit
1267  edm::Ref<HBHERecHitCollection> myRef(handle, it - handle->begin());
1268 
1269  // store it in a place so that it remains sorted by energy
1270  hpd.refrechitset_.insert(myRef);
1271 
1272  } // end loop over rechits
1273 
1274  // loop over all HPDs and transfer the information from refrechitset_ to rechits_;
1275  for (HcalNoiseRBXArray::iterator rbxit = array.begin(); rbxit != array.end(); ++rbxit) {
1276  for (std::vector<HcalNoiseHPD>::iterator hpdit = rbxit->hpds_.begin(); hpdit != rbxit->hpds_.end(); ++hpdit) {
1277  // loop over all of the entries in the set and add them to rechits_
1278  for (std::set<edm::Ref<HBHERecHitCollection>, RefHBHERecHitEnergyComparison>::const_iterator it =
1279  hpdit->refrechitset_.begin();
1280  it != hpdit->refrechitset_.end();
1281  ++it) {
1282  hpdit->rechits_.push_back(*it);
1283  }
1284  }
1285  }
1286  // now the rechits in all the HPDs are sorted by energy!
1287 
1288  return;
1289 }
std::vector< int > HcalRecHitFlagsToBeExcluded_
T perp() const
Definition: PV3DBase.h:69
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
HcalDetId id() const
get the id
Definition: HBHERecHit.h:39
uint32_t auxPhase1() const
Definition: HBHERecHit.h:54
std::set< edm::Ref< HBHERecHitCollection >, RefHBHERecHitEnergyComparison > refrechitset_
Definition: HcalNoiseHPD.h:145
std::vector< T >::const_iterator const_iterator
HcalDetId idFront() const
Definition: HBHERecHit.cc:5
const Item * getValues(DetId fId, bool throwOnFail=true) const
static const unsigned OFF_TDC_TIME
T mag() const
Definition: PV3DBase.h:64
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
bool isValid() const
Definition: HandleBase.h:70
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
const_iterator end() const
Definition: DetId.h:17
edm::EDGetTokenT< HBHERecHitCollection > hbherechit_token_
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
bool isBitSet(unsigned int bitnumber) const
T get() const
Definition: EventSetup.h:73
double energyInNonLaserRegion_
static const unsigned OFF_COMBINED
float eraw() const
Definition: HBHERecHit.h:45
uint32_t getValue() const
T const * product() const
Definition: ESHandle.h:86
constexpr uint32_t flags() const
Definition: CaloRecHit.h:34
const_iterator begin() const
void HcalNoiseInfoProducer::filltracks ( edm::Event iEvent,
const edm::EventSetup iSetup,
HcalNoiseSummary summary 
) const
private

Definition at line 1371 of file HcalNoiseInfoProducer.cc.

References DEFINE_FWK_MODULE, reco::TrackBase::eta(), edm::Event::getByToken(), patZpeak::handle, edm::HandleBase::isValid(), maxTrackEta_, minTrackPt_, reco::TrackBase::p(), reco::TrackBase::pt(), track_token_, and HcalNoiseSummary::trackenergy_.

Referenced by produce().

1373  {
1375  // iEvent.getByLabel(trackCollName_, handle);
1376  iEvent.getByToken(track_token_, handle);
1377 
1378  // don't throw exception, just return quietly
1379  if (!handle.isValid()) {
1380  // throw edm::Exception(edm::errors::ProductNotFound)
1381  // << " could not find trackCollection named " << trackCollName_ << "\n.";
1382  return;
1383  }
1384 
1385  summary.trackenergy_ = 0.0;
1386  for (reco::TrackCollection::const_iterator iTrack = handle->begin(); iTrack != handle->end(); ++iTrack) {
1387  reco::Track trk = *iTrack;
1388  if (trk.pt() < minTrackPt_ || fabs(trk.eta()) > maxTrackEta_)
1389  continue;
1390 
1391  summary.trackenergy_ += trk.p();
1392  }
1393 
1394  return;
1395 }
double p() const
momentum vector magnitude
Definition: TrackBase.h:599
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:617
double pt() const
track transverse momentum
Definition: TrackBase.h:602
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::TrackCollection > track_token_
void HcalNoiseInfoProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 676 of file HcalNoiseInfoProducer.cc.

References algo_, data, CommonHcalNoiseRBXData::energy(), fillCaloTowers_, fillcalotwrs(), filldigis(), fillDigis_, filljetinfo(), fillOtherSummaryVariables(), fillrechits(), fillRecHits_, filltracks(), fillTracks_, edm::EventSetup::get(), HcalNoiseAlgo::isProblematic(), maxProblemRBXs_, minHighHitE_, minLowHitE_, minR45HitE_, minRecHitE_, eostools::move(), HcalNoiseSummary::nproblemRBXs_, HcalNoiseAlgo::passHighLevelNoiseFilter(), HcalNoiseAlgo::passLooseNoiseFilter(), HcalNoiseAlgo::passTightNoiseFilter(), edm::ESHandle< T >::product(), edm::Event::put(), edmLumisInFiles::summary, theHcalTopology_, TS4TS5EnergyThreshold_, TS4TS5LowerCut_, and TS4TS5UpperCut_.

676  {
677  // this is what we're going to actually write to the EDM
678  auto result1 = std::make_unique<HcalNoiseRBXCollection>();
679  auto result2 = std::make_unique<HcalNoiseSummary>();
680 
681  // define an empty HcalNoiseRBXArray that we're going to fill
682  HcalNoiseRBXArray rbxarray;
683  HcalNoiseSummary& summary = *result2;
684 
685  // Get topology class to use later
687  iSetup.get<HcalRecNumberingRecord>().get(topo);
688  theHcalTopology_ = topo.product();
689 
690  // fill them with the various components
691  // digi assumes that rechit information is available
692  if (fillRecHits_)
693  fillrechits(iEvent, iSetup, rbxarray, summary);
694  if (fillDigis_)
695  filldigis(iEvent, iSetup, rbxarray, summary);
696  if (fillCaloTowers_)
697  fillcalotwrs(iEvent, iSetup, rbxarray, summary);
698  if (fillTracks_)
699  filltracks(iEvent, iSetup, summary);
700 
701  filljetinfo(iEvent, iSetup, summary);
702 
703  // select those RBXs which are interesting
704  // also look for the highest energy RBX
705  HcalNoiseRBXArray::iterator maxit = rbxarray.begin();
706  double maxenergy = -999;
707  bool maxwritten = false;
708  for (HcalNoiseRBXArray::iterator rit = rbxarray.begin(); rit != rbxarray.end(); ++rit) {
709  HcalNoiseRBX& rbx = (*rit);
711  minRecHitE_,
712  minLowHitE_,
713  minHighHitE_,
717  minR45HitE_);
718 
719  // find the highest energy rbx
720  if (data.energy() > maxenergy) {
721  maxenergy = data.energy();
722  maxit = rit;
723  maxwritten = false;
724  }
725 
726  // find out if the rbx is problematic/noisy/etc.
727  bool writerbx = algo_.isProblematic(data) || !algo_.passLooseNoiseFilter(data) ||
729 
730  // fill variables in the summary object not filled elsewhere
732 
733  if (writerbx) {
734  summary.nproblemRBXs_++;
735  if (summary.nproblemRBXs_ <= maxProblemRBXs_) {
736  result1->push_back(rbx);
737  if (maxit == rit)
738  maxwritten = true;
739  }
740  }
741  } // end loop over rbxs
742 
743  // if we still haven't written the maximum energy rbx, write it now
744  if (!maxwritten) {
745  HcalNoiseRBX& rbx = (*maxit);
746 
747  // add the RBX to the event
748  result1->push_back(rbx);
749  }
750 
751  // put the rbxcollection and summary into the EDM
752  iEvent.put(std::move(result1));
753  iEvent.put(std::move(result2));
754 
755  return;
756 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool isProblematic(const CommonHcalNoiseRBXData &) const
void fillrechits(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
std::vector< std::pair< double, double > > TS4TS5LowerCut_
void fillcalotwrs(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &) const
bool passHighLevelNoiseFilter(const CommonHcalNoiseRBXData &) const
void filljetinfo(edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
std::vector< std::pair< double, double > > TS4TS5UpperCut_
bool passLooseNoiseFilter(const CommonHcalNoiseRBXData &) const
void filldigis(edm::Event &, const edm::EventSetup &, HcalNoiseRBXArray &, HcalNoiseSummary &)
bool passTightNoiseFilter(const CommonHcalNoiseRBXData &) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
T get() const
Definition: EventSetup.h:73
const HcalTopology * theHcalTopology_
void filltracks(edm::Event &, const edm::EventSetup &, HcalNoiseSummary &) const
void fillOtherSummaryVariables(HcalNoiseSummary &summary, const CommonHcalNoiseRBXData &data) const
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

std::vector<float> reco::HcalNoiseInfoProducer::adc2fC
private

Definition at line 144 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

std::vector<float> reco::HcalNoiseInfoProducer::adc2fCHF
private

Definition at line 145 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

HcalNoiseAlgo reco::HcalNoiseInfoProducer::algo_
private

Definition at line 118 of file HcalNoiseInfoProducer.h.

Referenced by fillOtherSummaryVariables(), and produce().

double reco::HcalNoiseInfoProducer::calibdigiHBHEthreshold_
private

Definition at line 123 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

std::vector<int> reco::HcalNoiseInfoProducer::calibdigiHBHEtimeslices_
private

Definition at line 124 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

double reco::HcalNoiseInfoProducer::calibdigiHFthreshold_
private

Definition at line 126 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

std::vector<int> reco::HcalNoiseInfoProducer::calibdigiHFtimeslices_
private

Definition at line 127 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

edm::EDGetTokenT<CaloTowerCollection> reco::HcalNoiseInfoProducer::calotower_token_
private

Definition at line 110 of file HcalNoiseInfoProducer.h.

Referenced by fillcalotwrs(), and HcalNoiseInfoProducer().

std::string reco::HcalNoiseInfoProducer::caloTowerCollName_
private

Definition at line 102 of file HcalNoiseInfoProducer.h.

Referenced by fillcalotwrs(), and HcalNoiseInfoProducer().

std::string reco::HcalNoiseInfoProducer::digiCollName_
private

Definition at line 100 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

bool reco::HcalNoiseInfoProducer::fillCaloTowers_
private

Definition at line 84 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

bool reco::HcalNoiseInfoProducer::fillDigis_
private

Definition at line 82 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

bool reco::HcalNoiseInfoProducer::fillLaserMonitor_
private

Definition at line 86 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

bool reco::HcalNoiseInfoProducer::fillRecHits_
private

Definition at line 83 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

bool reco::HcalNoiseInfoProducer::fillTracks_
private

Definition at line 85 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

edm::EDGetTokenT<HBHEDigiCollection> reco::HcalNoiseInfoProducer::hbhedigi_token_
private

Definition at line 106 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

edm::EDGetTokenT<HBHERecHitCollection> reco::HcalNoiseInfoProducer::hbherechit_token_
private

Definition at line 109 of file HcalNoiseInfoProducer.h.

Referenced by fillrechits(), and HcalNoiseInfoProducer().

uint32_t reco::HcalNoiseInfoProducer::HcalAcceptSeverityLevel_
private

Definition at line 133 of file HcalNoiseInfoProducer.h.

Referenced by fillrechits(), and HcalNoiseInfoProducer().

edm::EDGetTokenT<HcalCalibDigiCollection> reco::HcalNoiseInfoProducer::hcalcalibdigi_token_
private

Definition at line 107 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

std::vector<int> reco::HcalNoiseInfoProducer::HcalRecHitFlagsToBeExcluded_
private

Definition at line 134 of file HcalNoiseInfoProducer.h.

Referenced by fillrechits(), and HcalNoiseInfoProducer().

edm::EDGetTokenT<reco::PFJetCollection> reco::HcalNoiseInfoProducer::jet_token_
private

Definition at line 112 of file HcalNoiseInfoProducer.h.

Referenced by filljetinfo(), and HcalNoiseInfoProducer().

std::string reco::HcalNoiseInfoProducer::jetCollName_
private

Definition at line 104 of file HcalNoiseInfoProducer.h.

Referenced by filljetinfo(), and HcalNoiseInfoProducer().

std::vector<int> reco::HcalNoiseInfoProducer::laserMonCBoxList_
private

Definition at line 136 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

edm::EDGetTokenT<QIE10DigiCollection> reco::HcalNoiseInfoProducer::lasermondigi_token_
private

Definition at line 108 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

std::vector<int> reco::HcalNoiseInfoProducer::laserMonIEtaList_
private

Definition at line 138 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

std::vector<int> reco::HcalNoiseInfoProducer::laserMonIPhiList_
private

Definition at line 137 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

unsigned reco::HcalNoiseInfoProducer::laserMonitorSamples_
private

Definition at line 142 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

int reco::HcalNoiseInfoProducer::laserMonitorTSEnd_
private

Definition at line 141 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

int reco::HcalNoiseInfoProducer::laserMonitorTSStart_
private

Definition at line 140 of file HcalNoiseInfoProducer.h.

Referenced by filldigis(), and HcalNoiseInfoProducer().

int reco::HcalNoiseInfoProducer::maxCaloTowerIEta_
private

Definition at line 92 of file HcalNoiseInfoProducer.h.

Referenced by fillcalotwrs(), and HcalNoiseInfoProducer().

int reco::HcalNoiseInfoProducer::maxjetindex_
private

Definition at line 96 of file HcalNoiseInfoProducer.h.

Referenced by filljetinfo(), and HcalNoiseInfoProducer().

double reco::HcalNoiseInfoProducer::maxNHF_
private

Definition at line 95 of file HcalNoiseInfoProducer.h.

Referenced by filljetinfo(), and HcalNoiseInfoProducer().

int reco::HcalNoiseInfoProducer::maxProblemRBXs_
private

Definition at line 89 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

double reco::HcalNoiseInfoProducer::maxTrackEta_
private

Definition at line 93 of file HcalNoiseInfoProducer.h.

Referenced by filltracks(), and HcalNoiseInfoProducer().

double reco::HcalNoiseInfoProducer::minHighHitE_
private

Definition at line 117 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

double reco::HcalNoiseInfoProducer::minLowHitE_
private

Definition at line 117 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

double reco::HcalNoiseInfoProducer::minR45HitE_
private

Definition at line 117 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

double reco::HcalNoiseInfoProducer::minRecHitE_
private

Definition at line 117 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

double reco::HcalNoiseInfoProducer::minTrackPt_
private

Definition at line 94 of file HcalNoiseInfoProducer.h.

Referenced by filltracks(), and HcalNoiseInfoProducer().

std::string reco::HcalNoiseInfoProducer::recHitCollName_
private

Definition at line 101 of file HcalNoiseInfoProducer.h.

Referenced by fillrechits(), and HcalNoiseInfoProducer().

const HcalTopology* reco::HcalNoiseInfoProducer::theHcalTopology_
private

Definition at line 98 of file HcalNoiseInfoProducer.h.

Referenced by produce().

double reco::HcalNoiseInfoProducer::totalCalibCharge
private

Definition at line 114 of file HcalNoiseInfoProducer.h.

Referenced by filldigis().

double reco::HcalNoiseInfoProducer::totalLasmonCharge
private

Definition at line 115 of file HcalNoiseInfoProducer.h.

Referenced by filldigis().

edm::EDGetTokenT<reco::TrackCollection> reco::HcalNoiseInfoProducer::track_token_
private

Definition at line 111 of file HcalNoiseInfoProducer.h.

Referenced by filltracks(), and HcalNoiseInfoProducer().

std::string reco::HcalNoiseInfoProducer::trackCollName_
private

Definition at line 103 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer().

double reco::HcalNoiseInfoProducer::TS4TS5EnergyThreshold_
private

Definition at line 129 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

std::vector<std::pair<double, double> > reco::HcalNoiseInfoProducer::TS4TS5LowerCut_
private

Definition at line 131 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

std::vector<std::pair<double, double> > reco::HcalNoiseInfoProducer::TS4TS5UpperCut_
private

Definition at line 130 of file HcalNoiseInfoProducer.h.

Referenced by HcalNoiseInfoProducer(), and produce().

bool reco::HcalNoiseInfoProducer::useCalibDigi_
private

Definition at line 120 of file HcalNoiseInfoProducer.h.