CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::TimingTask Class Reference

#include <TimingTask.h>

Inheritance diagram for ecaldqm::TimingTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

bool analyze (void const *, Collections) override
 
bool filterRunType (short const *) override
 
void runOnRecHits (EcalRecHitCollection const &, Collections)
 
void runOnUncalibRecHits (EcalUncalibratedRecHitCollection const &)
 
 TimingTask ()
 
 ~TimingTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
const EcalDQMSetupObjects getEcalDQMSetupObjects ()
 
const EcalElectronicsMappingGetElectronicsMap ()
 
const CaloGeometryGetGeometry ()
 
const std::string & getName () const
 
const CaloTopologyGetTopology ()
 
const EcalTrigTowerConstituentsMapGetTrigTowerMap ()
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setSetupObjects (edm::EventSetup const &)
 
void setTime (time_t _t)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
 
void setParams (edm::ParameterSet const &) override
 

Private Attributes

double bxBin_
 
std::vector< int > bxBinEdges_
 
float chi2ThresholdEB_
 
float chi2ThresholdEE_
 
float energyThresholdEB_
 
float energyThresholdEE_
 
float energyThresholdEEFwd_
 
MESetmeTimeMapByLS
 
float timeErrorThreshold_
 
float timingVsBXThreshold_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 10 of file TimingTask.h.

Constructor & Destructor Documentation

◆ TimingTask()

ecaldqm::TimingTask::TimingTask ( )

Definition at line 13 of file TimingTask.cc.

14  : DQWorkerTask(),
15  bxBinEdges_(),
16  bxBin_(0.),
17  chi2ThresholdEB_(0.),
18  chi2ThresholdEE_(0.),
24  meTimeMapByLS(nullptr) {}

◆ ~TimingTask()

ecaldqm::TimingTask::~TimingTask ( )
inlineoverride

Definition at line 13 of file TimingTask.h.

13 {}

Member Function Documentation

◆ analyze()

bool ecaldqm::TimingTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 40 of file TimingTask.h.

40  {
41  switch (_collection) {
42  case kEBRecHit:
43  case kEERecHit:
44  if (_p)
45  runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
46  return true;
47  break;
48  case kEBUncalibRecHit:
49  case kEEUncalibRecHit:
50  if (_p)
51  runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
52  return true;
53  break;
54  default:
55  break;
56  }
57  return false;
58  }

References ecaldqm::kEBRecHit, ecaldqm::kEBUncalibRecHit, ecaldqm::kEERecHit, ecaldqm::kEEUncalibRecHit, runOnRecHits(), and runOnUncalibRecHits().

◆ beginEvent()

void ecaldqm::TimingTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  _es,
bool const &  ByLumiResetSwitch,
bool &   
)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 50 of file TimingTask.cc.

50  {
51  using namespace std;
52  std::vector<int>::iterator pBin = std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing());
53  bxBin_ = static_cast<int>(pBin - bxBinEdges_.begin()) - 0.5;
54  if (ByLumiResetSwitch) {
55  meTimeMapByLS = &MEs_.at("TimeMapByLS");
56  if (timestamp_.iLumi % 10 == 0)
58  }
59  }

References ecaldqm::MESetCollection::at(), edm::EventBase::bunchCrossing(), bxBin_, bxBinEdges_, ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::DQWorker::MEs_, meTimeMapByLS, muonRecoAnalyzer_cfi::pBin, ecaldqm::MESet::reset(), ecaldqm::DQWorker::timestamp_, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.

◆ filterRunType()

bool ecaldqm::TimingTask::filterRunType ( short const *  _runType)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 38 of file TimingTask.cc.

38  {
39  for (int iFED(0); iFED < nDCC; iFED++) {
40  if (_runType[iFED] == EcalDCCHeaderBlock::COSMIC || _runType[iFED] == EcalDCCHeaderBlock::MTCC ||
41  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
42  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL || _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL ||
43  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL)
44  return true;
45  }
46 
47  return false;
48  }

References EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, EcalDCCHeaderBlock::MTCC, ecaldqm::nDCC, EcalDCCHeaderBlock::PHYSICS_GLOBAL, and EcalDCCHeaderBlock::PHYSICS_LOCAL.

◆ runOnRecHits()

void ecaldqm::TimingTask::runOnRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collection 
)

Definition at line 61 of file TimingTask.cc.

61  {
62  MESet& meTimeAmp(MEs_.at("TimeAmp"));
63  MESet& meTimeAmpAll(MEs_.at("TimeAmpAll"));
64  MESet& meTimingVsBX(onlineMode_ ? MEs_.at("BarrelTimingVsBX") : MEs_.at("BarrelTimingVsBXFineBinned"));
65  MESet& meTimeAll(MEs_.at("TimeAll"));
66  MESet& meTimeAllMap(MEs_.at("TimeAllMap"));
67  MESet& meTimeMap(MEs_.at("TimeMap")); // contains cumulative run stats => not suitable for Trend plots
68  MESet& meTime1D(MEs_.at("Time1D"));
69  MESet& meChi2(MEs_.at("Chi2"));
70 
71  uint32_t mask(~((0x1 << EcalRecHit::kGood) | (0x1 << EcalRecHit::kOutOfTime)));
72  int signedSubdet;
73 
74  std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit) {
75  if (hit.checkFlagMask(mask))
76  return;
77 
78  DetId id(hit.id());
79 
80  float time(hit.time());
81  float energy(hit.energy());
82 
84  if (id.subdetId() == EcalBarrel) {
87  } else {
90  }
91 
92  if (id.subdetId() == EcalBarrel)
93  signedSubdet = EcalBarrel;
94  else {
95  EEDetId eeId(hit.id());
96  if (eeId.zside() < 0)
97  signedSubdet = -EcalEndcap;
98  else
99  signedSubdet = EcalEndcap;
100  }
101 
102  if (energy > energyThreshold)
103  meChi2.fill(getEcalDQMSetupObjects(), signedSubdet, hit.chi2());
104 
105  // Apply cut on chi2 of pulse shape fit
106  if (hit.chi2() > chi2Threshold)
107  return;
108 
109  // Apply cut based on timing error of rechit
110  if (hit.timeError() > timeErrorThreshold_)
111  return;
112 
113  meTimeAmp.fill(getEcalDQMSetupObjects(), id, energy, time);
114  meTimeAmpAll.fill(getEcalDQMSetupObjects(), id, energy, time);
115 
116  if (energy > timingVsBXThreshold_ && signedSubdet == EcalBarrel)
117  meTimingVsBX.fill(getEcalDQMSetupObjects(), bxBin_, time);
118 
119  if (energy > energyThreshold) {
120  meTimeAll.fill(getEcalDQMSetupObjects(), id, time);
121  meTimeMap.fill(getEcalDQMSetupObjects(), id, time);
123  meTime1D.fill(getEcalDQMSetupObjects(), id, time);
124  meTimeAllMap.fill(getEcalDQMSetupObjects(), id, time);
125  }
126  });
127  }

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), bxBin_, dtSegmentAnalysisTest_cfi::chi2Threshold, chi2ThresholdEB_, chi2ThresholdEE_, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), HCALHighEnergyHPDFilter_cfi::energy, ClusterTask_cfi::energyThreshold, energyThresholdEB_, energyThresholdEE_, energyThresholdEEFwd_, ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), triggerObjects_cff::id, hit::id, ecaldqm::isForward(), EcalRecHit::kGood, EcalRecHit::kOutOfTime, ecaldqm::DQWorker::MEs_, meTimeMapByLS, ecaldqm::DQWorker::onlineMode_, protons_cff::time, timeErrorThreshold_, timingVsBXThreshold_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by analyze().

◆ runOnUncalibRecHits()

void ecaldqm::TimingTask::runOnUncalibRecHits ( EcalUncalibratedRecHitCollection const &  _uhits)

Definition at line 132 of file TimingTask.cc.

132  {
133  MESet& meTimeAmpBXm(MEs_.at("TimeAmpBXm"));
134  MESet& meTimeAmpBXp(MEs_.at("TimeAmpBXp"));
135 
136  for (EcalUncalibratedRecHitCollection::const_iterator uhitItr(_uhits.begin()); uhitItr != _uhits.end(); ++uhitItr) {
137  // Apply reconstruction quality cuts
138  if (!uhitItr->checkFlag(EcalUncalibratedRecHit::kGood))
139  continue;
140  DetId id(uhitItr->id());
141  float chi2Threshold = 0.;
142  float ampThreshold = 0.;
143  if (id.subdetId() == EcalBarrel) {
145  ampThreshold = 20. * energyThresholdEB_; // 1 GeV ~ 20 ADC in EB
146  } else {
148  ampThreshold = 5. * ((isForward(id)) ? energyThresholdEEFwd_ : energyThresholdEE_); // 1 GeV ~ 5 ADC in EE
149  }
150 
151  if (uhitItr->chi2() > chi2Threshold)
152  continue;
153 
154  // Apply amplitude cut based on approx rechit energy
155  float amp(uhitItr->amplitude());
156  if (amp < ampThreshold)
157  continue;
158 
159  // Apply jitter timing cut based on approx rechit timing
160  float timeOff(id.subdetId() == EcalBarrel ? 0.4 : 1.8);
161  float hitTime(uhitItr->jitter() * 25. + timeOff); // 1 jitter ~ 25 ns
162  if (std::abs(hitTime) >= 5.)
163  continue;
164 
165  // Fill MEs
166  meTimeAmpBXm.fill(getEcalDQMSetupObjects(), id, amp, uhitItr->outOfTimeAmplitude(4)); // BX-1
167  meTimeAmpBXp.fill(getEcalDQMSetupObjects(), id, amp, uhitItr->outOfTimeAmplitude(6)); // BX+1
168  }
169  }

References funct::abs(), ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), dtSegmentAnalysisTest_cfi::chi2Threshold, chi2ThresholdEB_, chi2ThresholdEE_, EcalBarrel, edm::SortedCollection< T, SORT >::end(), energyThresholdEB_, energyThresholdEE_, energyThresholdEEFwd_, ecaldqm::DQWorker::getEcalDQMSetupObjects(), triggerObjects_cff::id, ecaldqm::isForward(), EcalUncalibratedRecHit::kGood, and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

◆ setParams()

void ecaldqm::TimingTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 26 of file TimingTask.cc.

26  {
27  bxBinEdges_ = onlineMode_ ? _params.getUntrackedParameter<std::vector<int> >("bxBins")
28  : _params.getUntrackedParameter<std::vector<int> >("bxBinsFine");
29  chi2ThresholdEB_ = _params.getUntrackedParameter<double>("chi2ThresholdEB");
30  chi2ThresholdEE_ = _params.getUntrackedParameter<double>("chi2ThresholdEE");
31  energyThresholdEB_ = _params.getUntrackedParameter<double>("energyThresholdEB");
32  energyThresholdEE_ = _params.getUntrackedParameter<double>("energyThresholdEE");
33  energyThresholdEEFwd_ = _params.getUntrackedParameter<double>("energyThresholdEEFwd");
34  timingVsBXThreshold_ = _params.getUntrackedParameter<double>("timingVsBXThreshold");
35  timeErrorThreshold_ = _params.getUntrackedParameter<double>("timeErrorThreshold");
36  }

References l1extraParticles_cfi::_params, bxBinEdges_, chi2ThresholdEB_, chi2ThresholdEE_, energyThresholdEB_, energyThresholdEE_, energyThresholdEEFwd_, ecaldqm::DQWorker::onlineMode_, timeErrorThreshold_, and timingVsBXThreshold_.

Member Data Documentation

◆ bxBin_

double ecaldqm::TimingTask::bxBin_
private

Definition at line 27 of file TimingTask.h.

Referenced by beginEvent(), and runOnRecHits().

◆ bxBinEdges_

std::vector<int> ecaldqm::TimingTask::bxBinEdges_
private

Definition at line 26 of file TimingTask.h.

Referenced by beginEvent(), and setParams().

◆ chi2ThresholdEB_

float ecaldqm::TimingTask::chi2ThresholdEB_
private

Definition at line 29 of file TimingTask.h.

Referenced by runOnRecHits(), runOnUncalibRecHits(), and setParams().

◆ chi2ThresholdEE_

float ecaldqm::TimingTask::chi2ThresholdEE_
private

Definition at line 30 of file TimingTask.h.

Referenced by runOnRecHits(), runOnUncalibRecHits(), and setParams().

◆ energyThresholdEB_

float ecaldqm::TimingTask::energyThresholdEB_
private

Definition at line 31 of file TimingTask.h.

Referenced by runOnRecHits(), runOnUncalibRecHits(), and setParams().

◆ energyThresholdEE_

float ecaldqm::TimingTask::energyThresholdEE_
private

Definition at line 32 of file TimingTask.h.

Referenced by runOnRecHits(), runOnUncalibRecHits(), and setParams().

◆ energyThresholdEEFwd_

float ecaldqm::TimingTask::energyThresholdEEFwd_
private

Definition at line 33 of file TimingTask.h.

Referenced by runOnRecHits(), runOnUncalibRecHits(), and setParams().

◆ meTimeMapByLS

MESet* ecaldqm::TimingTask::meTimeMapByLS
private

Definition at line 37 of file TimingTask.h.

Referenced by beginEvent(), and runOnRecHits().

◆ timeErrorThreshold_

float ecaldqm::TimingTask::timeErrorThreshold_
private

Definition at line 35 of file TimingTask.h.

Referenced by runOnRecHits(), and setParams().

◆ timingVsBXThreshold_

float ecaldqm::TimingTask::timingVsBXThreshold_
private

Definition at line 34 of file TimingTask.h.

Referenced by runOnRecHits(), and setParams().

pfDeepBoostedJetPreprocessParams_cfi.upper_bound
upper_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:16
EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
EcalRecHit
Definition: EcalRecHit.h:15
ecaldqm::TimingTask::runOnRecHits
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: TimingTask.cc:61
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
ecaldqm::TimingTask::energyThresholdEB_
float energyThresholdEB_
Definition: TimingTask.h:31
ecaldqm::MESet::fill
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:74
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
protons_cff.time
time
Definition: protons_cff.py:39
dtSegmentAnalysisTest_cfi.chi2Threshold
chi2Threshold
Definition: dtSegmentAnalysisTest_cfi.py:12
EcalUncalibratedRecHit::kGood
Definition: EcalUncalibratedRecHit.h:13
ecaldqm::isForward
bool isForward(DetId const &)
Definition: EcalDQMCommonUtils.cc:243
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:104
EcalBarrel
Definition: EcalSubdetector.h:10
ecaldqm::TimingTask::timingVsBXThreshold_
float timingVsBXThreshold_
Definition: TimingTask.h:34
DetId
Definition: DetId.h:17
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
ecaldqm::TimingTask::energyThresholdEE_
float energyThresholdEE_
Definition: TimingTask.h:32
ecaldqm::MESet::reset
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
ecaldqm::TimingTask::timeErrorThreshold_
float timeErrorThreshold_
Definition: TimingTask.h:35
ecaldqm::kEBUncalibRecHit
Definition: Collections.h:30
ecaldqm::TimingTask::chi2ThresholdEB_
float chi2ThresholdEB_
Definition: TimingTask.h:29
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
ecaldqm::kEBRecHit
Definition: Collections.h:36
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalRecHit::kGood
Definition: EcalRecHit.h:21
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:104
EEDetId
Definition: EEDetId.h:14
muonRecoAnalyzer_cfi.pBin
pBin
Definition: muonRecoAnalyzer_cfi.py:37
EcalEndcap
Definition: EcalSubdetector.h:10
ecaldqm::DQWorker::onlineMode_
bool onlineMode_
Definition: DQWorker.h:111
EcalRecHit::kOutOfTime
Definition: EcalRecHit.h:23
ecaldqm::TimingTask::energyThresholdEEFwd_
float energyThresholdEEFwd_
Definition: TimingTask.h:33
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
ecaldqm::TimingTask::meTimeMapByLS
MESet * meTimeMapByLS
Definition: TimingTask.h:37
ecaldqm::TimingTask::runOnUncalibRecHits
void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const &)
Definition: TimingTask.cc:132
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:40
ecaldqm::kEERecHit
Definition: Collections.h:37
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:128
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
std
Definition: JetResolutionObject.h:76
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ecaldqm::TimingTask::bxBinEdges_
std::vector< int > bxBinEdges_
Definition: TimingTask.h:26
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
ecaldqm::kEEUncalibRecHit
Definition: Collections.h:31
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:107
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
ecaldqm::nDCC
Definition: EcalDQMCommonUtils.h:91
ecaldqm::TimingTask::chi2ThresholdEE_
float chi2ThresholdEE_
Definition: TimingTask.h:30
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ClusterTask_cfi.energyThreshold
energyThreshold
Definition: ClusterTask_cfi.py:3
hit
Definition: SiStripHitEffFromCalibTree.cc:88
ecaldqm::TimingTask::bxBin_
double bxBin_
Definition: TimingTask.h:27