CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap
const * 
GetTrigTowerMap ()
 
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 setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
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
 
bool splashSwitch_
 
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)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken
< EcalElectronicsMapping,
EcalMappingRcd
elecMapHandle
 
edm::ESGetToken
< EcalElectronicsMapping,
EcalMappingRcd
elecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geomHandle
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
geomHandleEndLumi
 
edm::ESGetToken< CaloTopology,
CaloTopologyRecord
topoHandle
 
edm::ESGetToken< CaloTopology,
CaloTopologyRecord
topoHandleEndLumi
 
edm::ESGetToken
< EcalTrigTowerConstituentsMap,
IdealGeometryRecord
ttMapHandle
 
edm::ESGetToken
< EcalTrigTowerConstituentsMap,
IdealGeometryRecord
ttMapHandleEndLumi
 
- 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

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) {}
float timingVsBXThreshold_
Definition: TimingTask.h:34
float energyThresholdEEFwd_
Definition: TimingTask.h:33
float energyThresholdEE_
Definition: TimingTask.h:32
MESet * meTimeMapByLS
Definition: TimingTask.h:38
float energyThresholdEB_
Definition: TimingTask.h:31
std::vector< int > bxBinEdges_
Definition: TimingTask.h:26
float timeErrorThreshold_
Definition: TimingTask.h:35
ecaldqm::TimingTask::~TimingTask ( )
inlineoverride

Definition at line 13 of file TimingTask.h.

13 {}

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 41 of file TimingTask.h.

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

41  {
42  switch (_collection) {
43  case kEBRecHit:
44  case kEERecHit:
45  if (_p)
46  runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
47  return true;
48  break;
49  case kEBUncalibRecHit:
50  case kEEUncalibRecHit:
51  if (_p)
52  runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
53  return true;
54  break;
55  default:
56  break;
57  }
58  return false;
59  }
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: TimingTask.cc:62
void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const &)
Definition: TimingTask.cc:134
void ecaldqm::TimingTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  _es,
bool const &  ByLumiResetSwitch,
bool &   
)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 51 of file TimingTask.cc.

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

51  {
52  using namespace std;
53  std::vector<int>::iterator pBin = std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing());
54  bxBin_ = static_cast<int>(pBin - bxBinEdges_.begin()) - 0.5;
55  if (ByLumiResetSwitch) {
56  meTimeMapByLS = &MEs_.at("TimeMapByLS");
57  if (timestamp_.iLumi % 10 == 0)
59  }
60  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
MESet & at(const std::string &key)
Definition: MESet.h:399
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Timestamp timestamp_
Definition: DQWorker.h:128
MESetCollection MEs_
Definition: DQWorker.h:125
MESet * meTimeMapByLS
Definition: TimingTask.h:38
std::vector< int > bxBinEdges_
Definition: TimingTask.h:26
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:118
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
bool ecaldqm::TimingTask::filterRunType ( short const *  _runType)
overridevirtual
void ecaldqm::TimingTask::runOnRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collection 
)

Definition at line 62 of file TimingTask.cc.

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

Referenced by analyze().

62  {
63  MESet& meTimeAmp(MEs_.at("TimeAmp"));
64  MESet& meTimeAmpAll(MEs_.at("TimeAmpAll"));
65  MESet& meTimingVsBX(onlineMode_ ? MEs_.at("BarrelTimingVsBX") : MEs_.at("BarrelTimingVsBXFineBinned"));
66  MESet& meTimeAll(MEs_.at("TimeAll"));
67  MESet& meTimeAllMap(MEs_.at("TimeAllMap"));
68  MESet& meTimeMap(MEs_.at("TimeMap")); // contains cumulative run stats => not suitable for Trend plots
69  MESet& meTime1D(MEs_.at("Time1D"));
70  MESet& meChi2(MEs_.at("Chi2"));
71 
72  uint32_t mask(~((0x1 << EcalRecHit::kGood) | (0x1 << EcalRecHit::kOutOfTime)));
73  int signedSubdet;
74 
75  std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit) {
76  if (hit.checkFlagMask(mask))
77  return;
78 
79  DetId id(hit.id());
80 
81  float time(hit.time());
82  float energy(hit.energy());
83 
84  float energyThreshold;
85  if (id.subdetId() == EcalBarrel) {
86  energyThreshold = energyThresholdEB_;
87  signedSubdet = EcalBarrel;
88  } else {
89  energyThreshold = (isForward(id)) ? energyThresholdEEFwd_ : energyThresholdEE_;
90  EEDetId eeId(hit.id());
91  if (eeId.zside() < 0)
92  signedSubdet = -EcalEndcap;
93  else
94  signedSubdet = EcalEndcap;
95  }
96 
97  if (energy > energyThreshold)
98  meChi2.fill(getEcalDQMSetupObjects(), signedSubdet, hit.chi2());
99 
100  if (!splashSwitch_) { //Not applied for splash events
101  float chi2Threshold;
102  if (id.subdetId() == EcalBarrel)
103  chi2Threshold = chi2ThresholdEB_;
104  else
105  chi2Threshold = chi2ThresholdEE_;
106 
107  //Apply cut on chi2 of pulse shape fit
108  if (hit.chi2() > chi2Threshold)
109  return;
110  }
111  // Apply cut based on timing error of rechit
112  if (hit.timeError() > timeErrorThreshold_)
113  return;
114 
115  meTimeAmp.fill(getEcalDQMSetupObjects(), id, energy, time);
116  meTimeAmpAll.fill(getEcalDQMSetupObjects(), id, energy, time);
117 
118  if (energy > timingVsBXThreshold_ && signedSubdet == EcalBarrel)
119  meTimingVsBX.fill(getEcalDQMSetupObjects(), bxBin_, time);
120 
121  if (energy > energyThreshold) {
122  meTimeAll.fill(getEcalDQMSetupObjects(), id, time);
123  meTimeMap.fill(getEcalDQMSetupObjects(), id, time);
125  meTime1D.fill(getEcalDQMSetupObjects(), id, time);
126  meTimeAllMap.fill(getEcalDQMSetupObjects(), id, time);
127  }
128  });
129  }
uint16_t *__restrict__ id
MESet & at(const std::string &key)
Definition: MESet.h:399
bool isForward(DetId const &)
float timingVsBXThreshold_
Definition: TimingTask.h:34
float energyThresholdEEFwd_
Definition: TimingTask.h:33
virtual void fill(EcalDQMSetupObjects const, DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:74
float energyThresholdEE_
Definition: TimingTask.h:32
unsigned int id
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:125
MESet * meTimeMapByLS
Definition: TimingTask.h:38
float energyThresholdEB_
Definition: TimingTask.h:31
float timeErrorThreshold_
Definition: TimingTask.h:35
void ecaldqm::TimingTask::runOnUncalibRecHits ( EcalUncalibratedRecHitCollection const &  _uhits)

Definition at line 134 of file TimingTask.cc.

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

Referenced by analyze().

134  {
135  MESet& meTimeAmpBXm(MEs_.at("TimeAmpBXm"));
136  MESet& meTimeAmpBXp(MEs_.at("TimeAmpBXp"));
137 
138  for (EcalUncalibratedRecHitCollection::const_iterator uhitItr(_uhits.begin()); uhitItr != _uhits.end(); ++uhitItr) {
139  // Apply reconstruction quality cuts
140  if (!uhitItr->checkFlag(EcalUncalibratedRecHit::kGood))
141  continue;
142  DetId id(uhitItr->id());
143  float chi2Threshold = 0.;
144  float ampThreshold = 0.;
145  if (id.subdetId() == EcalBarrel) {
146  chi2Threshold = chi2ThresholdEB_;
147  ampThreshold = 20. * energyThresholdEB_; // 1 GeV ~ 20 ADC in EB
148  } else {
149  chi2Threshold = chi2ThresholdEE_;
150  ampThreshold = 5. * ((isForward(id)) ? energyThresholdEEFwd_ : energyThresholdEE_); // 1 GeV ~ 5 ADC in EE
151  }
152 
153  if (uhitItr->chi2() > chi2Threshold)
154  continue;
155 
156  // Apply amplitude cut based on approx rechit energy
157  float amp(uhitItr->amplitude());
158  if (amp < ampThreshold)
159  continue;
160 
161  // Apply jitter timing cut based on approx rechit timing
162  float timeOff(id.subdetId() == EcalBarrel ? 0.4 : 1.8);
163  float hitTime(uhitItr->jitter() * 25. + timeOff); // 1 jitter ~ 25 ns
164  if (std::abs(hitTime) >= 5.)
165  continue;
166 
167  // Fill MEs
168  meTimeAmpBXm.fill(getEcalDQMSetupObjects(), id, amp, uhitItr->outOfTimeAmplitude(4)); // BX-1
169  meTimeAmpBXp.fill(getEcalDQMSetupObjects(), id, amp, uhitItr->outOfTimeAmplitude(6)); // BX+1
170  }
171  }
uint16_t *__restrict__ id
MESet & at(const std::string &key)
Definition: MESet.h:399
std::vector< T >::const_iterator const_iterator
bool isForward(DetId const &)
float energyThresholdEEFwd_
Definition: TimingTask.h:33
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float energyThresholdEE_
Definition: TimingTask.h:32
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:125
float energyThresholdEB_
Definition: TimingTask.h:31
void ecaldqm::TimingTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 26 of file TimingTask.cc.

References bxBinEdges_, chi2ThresholdEB_, chi2ThresholdEE_, energyThresholdEB_, energyThresholdEE_, energyThresholdEEFwd_, edm::ParameterSet::getUntrackedParameter(), ecaldqm::DQWorker::onlineMode_, splashSwitch_, timeErrorThreshold_, and timingVsBXThreshold_.

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  splashSwitch_ = _params.getUntrackedParameter<bool>("splashSwitch", false);
37  }
float timingVsBXThreshold_
Definition: TimingTask.h:34
float energyThresholdEEFwd_
Definition: TimingTask.h:33
float energyThresholdEE_
Definition: TimingTask.h:32
float energyThresholdEB_
Definition: TimingTask.h:31
std::vector< int > bxBinEdges_
Definition: TimingTask.h:26
float timeErrorThreshold_
Definition: TimingTask.h:35

Member Data Documentation

double ecaldqm::TimingTask::bxBin_
private

Definition at line 27 of file TimingTask.h.

Referenced by beginEvent(), and runOnRecHits().

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

Definition at line 26 of file TimingTask.h.

Referenced by beginEvent(), and setParams().

float ecaldqm::TimingTask::chi2ThresholdEB_
private

Definition at line 29 of file TimingTask.h.

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

float ecaldqm::TimingTask::chi2ThresholdEE_
private

Definition at line 30 of file TimingTask.h.

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

float ecaldqm::TimingTask::energyThresholdEB_
private

Definition at line 31 of file TimingTask.h.

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

float ecaldqm::TimingTask::energyThresholdEE_
private

Definition at line 32 of file TimingTask.h.

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

float ecaldqm::TimingTask::energyThresholdEEFwd_
private

Definition at line 33 of file TimingTask.h.

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

MESet* ecaldqm::TimingTask::meTimeMapByLS
private

Definition at line 38 of file TimingTask.h.

Referenced by beginEvent(), and runOnRecHits().

bool ecaldqm::TimingTask::splashSwitch_
private

Definition at line 36 of file TimingTask.h.

Referenced by runOnRecHits(), and setParams().

float ecaldqm::TimingTask::timeErrorThreshold_
private

Definition at line 35 of file TimingTask.h.

Referenced by runOnRecHits(), and setParams().

float ecaldqm::TimingTask::timingVsBXThreshold_
private

Definition at line 34 of file TimingTask.h.

Referenced by runOnRecHits(), and setParams().