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 ()
 
- 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 &)
 
void recoverStats ()
 
virtual void setTokens (edm::ConsumesCollector &)
 
void softReset ()
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
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 &)
 
std::string const & getName () const
 
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 setTime (time_t _t)
 
virtual ~DQWorker ()(false)
 

Private Member Functions

void beginEvent (edm::Event const &, edm::EventSetup const &) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) 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 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::DQWorkerTask
std::set< std::string > resettable_
 
- 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 14 of file TimingTask.cc.

14  :
15  DQWorkerTask(),
16  bxBinEdges_(),
17  bxBin_(0.),
18  chi2ThresholdEB_(0.),
19  chi2ThresholdEE_(0.),
25  meTimeMapByLS(nullptr)
26  {
27  }
float timingVsBXThreshold_
Definition: TimingTask.h:35
float energyThresholdEEFwd_
Definition: TimingTask.h:34
float energyThresholdEE_
Definition: TimingTask.h:33
MESet * meTimeMapByLS
Definition: TimingTask.h:38
float energyThresholdEB_
Definition: TimingTask.h:32
std::vector< int > bxBinEdges_
Definition: TimingTask.h:27
float timeErrorThreshold_
Definition: TimingTask.h:36
ecaldqm::TimingTask::~TimingTask ( )
inline

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().

Referenced by ~TimingTask().

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 69 of file TimingTask.cc.

References edm::EventBase::bunchCrossing(), bxBin_, bxBinEdges_, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.

Referenced by ~TimingTask().

70  {
71  using namespace std;
72  std::vector<int>::iterator pBin = std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing());
73  bxBin_ = static_cast<int>(pBin - bxBinEdges_.begin()) - 0.5;
74  }
std::vector< int > bxBinEdges_
Definition: TimingTask.h:27
void ecaldqm::TimingTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 58 of file TimingTask.cc.

References ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::DQWorker::MEs_, meTimeMapByLS, ecaldqm::MESet::reset(), and ecaldqm::DQWorker::timestamp_.

Referenced by ~TimingTask().

59  {
60  // Fill separate MEs with only 10 LSs worth of stats
61  // Used to correctly fill Presample Trend plots:
62  // 1 pt:10 LS in Trend plots
63  meTimeMapByLS = &MEs_.at("TimeMapByLS");
64  if ( timestamp_.iLumi % 10 == 0 )
66  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
virtual void reset(double=0., double=0., double=0.)
Definition: MESet.cc:98
Timestamp timestamp_
Definition: DQWorker.h:78
MESetCollection MEs_
Definition: DQWorker.h:75
MESet * meTimeMapByLS
Definition: TimingTask.h:38
bool ecaldqm::TimingTask::filterRunType ( short const *  _runType)
overridevirtual
void ecaldqm::TimingTask::runOnRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collection 
)

Definition at line 77 of file TimingTask.cc.

References edm::SortedCollection< T, SORT >::begin(), bxBin_, chi2ThresholdEB_, chi2ThresholdEE_, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), energyThresholdEB_, energyThresholdEE_, energyThresholdEEFwd_, ecaldqm::MESet::fill(), triggerObjects_cff::id, hit::id, ecaldqm::isForward(), EcalRecHit::kGood, EcalRecHit::kOutOfTime, RecoTauDiscriminantConfiguration::mask, ecaldqm::DQWorker::MEs_, meTimeMapByLS, ecaldqm::DQWorker::onlineMode_, ntuplemaker::time, timeErrorThreshold_, timingVsBXThreshold_, and globals_cff::x1.

Referenced by analyze(), and ~TimingTask().

78  {
79  MESet& meTimeAmp(MEs_.at("TimeAmp"));
80  MESet& meTimeAmpAll(MEs_.at("TimeAmpAll"));
81  MESet& meTimingVsBX(onlineMode_? MEs_.at("BarrelTimingVsBX"): MEs_.at("BarrelTimingVsBXFineBinned"));
82  MESet& meTimeAll(MEs_.at("TimeAll"));
83  MESet& meTimeAllMap(MEs_.at("TimeAllMap"));
84  MESet& meTimeMap(MEs_.at("TimeMap")); // contains cumulative run stats => not suitable for Trend plots
85  MESet& meTime1D(MEs_.at("Time1D"));
86  MESet& meChi2(MEs_.at("Chi2"));
87 
88  uint32_t mask(~((0x1 << EcalRecHit::kGood) | (0x1 << EcalRecHit::kOutOfTime)));
89  int signedSubdet;
90 
91  std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit){
92  if(hit.checkFlagMask(mask)) return;
93 
94  DetId id(hit.id());
95 
96  float time(hit.time());
97  float energy(hit.energy());
98 
99  float chi2Threshold, energyThreshold;
100  if (id.subdetId() == EcalBarrel) {
101  chi2Threshold = chi2ThresholdEB_;
102  energyThreshold = energyThresholdEB_;
103  }
104  else {
105  chi2Threshold = chi2ThresholdEE_;
106  energyThreshold = (isForward(id)) ? energyThresholdEEFwd_ : energyThresholdEE_;
107  }
108 
109  if ( id.subdetId() == EcalBarrel )
110  signedSubdet = EcalBarrel;
111  else {
112  EEDetId eeId( hit.id() );
113  if ( eeId.zside() < 0 )
114  signedSubdet = -EcalEndcap;
115  else
116  signedSubdet = EcalEndcap;
117  }
118 
119  if (energy > energyThreshold) meChi2.fill(signedSubdet, hit.chi2());
120 
121  // Apply cut on chi2 of pulse shape fit
122  if ( hit.chi2() > chi2Threshold ) return;
123 
124  // Apply cut based on timing error of rechit
125  if (hit.timeError() > timeErrorThreshold_) return;
126 
127  meTimeAmp.fill(id, energy, time);
128  meTimeAmpAll.fill(id, energy, time);
129 
130  if (energy > timingVsBXThreshold_ && signedSubdet == EcalBarrel) meTimingVsBX.fill(bxBin_, time);
131 
132  if(energy > energyThreshold){
133  meTimeAll.fill(id, time);
134  meTimeMap.fill(id, time);
135  meTimeMapByLS->fill(id, time);
136  meTime1D.fill(id, time);
137  meTimeAllMap.fill(id, time);
138  }
139  });
140  }
bool isForward(DetId const &)
float timingVsBXThreshold_
Definition: TimingTask.h:35
float energyThresholdEEFwd_
Definition: TimingTask.h:34
float energyThresholdEE_
Definition: TimingTask.h:33
unsigned int id
Definition: DetId.h:18
virtual void fill(DetId const &, double=1., double=1., double=1.)
Definition: MESet.h:45
MESetCollection MEs_
Definition: DQWorker.h:75
MESet * meTimeMapByLS
Definition: TimingTask.h:38
float energyThresholdEB_
Definition: TimingTask.h:32
float timeErrorThreshold_
Definition: TimingTask.h:36
void ecaldqm::TimingTask::runOnUncalibRecHits ( EcalUncalibratedRecHitCollection const &  _uhits)

Definition at line 145 of file TimingTask.cc.

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

Referenced by analyze(), and ~TimingTask().

146  {
147  MESet& meTimeAmpBXm( MEs_.at("TimeAmpBXm") );
148  MESet& meTimeAmpBXp( MEs_.at("TimeAmpBXp") );
149 
150  for( EcalUncalibratedRecHitCollection::const_iterator uhitItr(_uhits.begin()); uhitItr != _uhits.end(); ++uhitItr ) {
151 
152  // Apply reconstruction quality cuts
153  if( !uhitItr->checkFlag(EcalUncalibratedRecHit::kGood) ) continue;
154  DetId id( uhitItr->id() );
155  float chi2Threshold = 0.;
156  float ampThreshold = 0.;
157  if (id.subdetId() == EcalBarrel) {
158  chi2Threshold = chi2ThresholdEB_;
159  ampThreshold = 20.*energyThresholdEB_; // 1 GeV ~ 20 ADC in EB
160  }
161  else {
162  chi2Threshold = chi2ThresholdEE_;
163  ampThreshold = 5.*((isForward(id)) ? energyThresholdEEFwd_ : energyThresholdEE_); // 1 GeV ~ 5 ADC in EE
164  }
165 
166  if( uhitItr->chi2() > chi2Threshold ) continue;
167 
168  // Apply amplitude cut based on approx rechit energy
169  float amp( uhitItr->amplitude() );
170  if( amp < ampThreshold ) continue;
171 
172  // Apply jitter timing cut based on approx rechit timing
173  float timeOff( id.subdetId() == EcalBarrel ? 0.4 : 1.8 );
174  float hitTime( uhitItr->jitter()*25. + timeOff ); // 1 jitter ~ 25 ns
175  if( std::abs(hitTime) >= 5. ) continue;
176 
177  // Fill MEs
178  meTimeAmpBXm.fill( id,amp,uhitItr->outOfTimeAmplitude(4) ); // BX-1
179  meTimeAmpBXp.fill( id,amp,uhitItr->outOfTimeAmplitude(6) ); // BX+1
180 
181  }
182  }
std::vector< T >::const_iterator const_iterator
bool isForward(DetId const &)
float energyThresholdEEFwd_
Definition: TimingTask.h:34
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float energyThresholdEE_
Definition: TimingTask.h:33
Definition: DetId.h:18
MESetCollection MEs_
Definition: DQWorker.h:75
float energyThresholdEB_
Definition: TimingTask.h:32
void ecaldqm::TimingTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 30 of file TimingTask.cc.

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

Referenced by ~TimingTask().

31  {
32  bxBinEdges_ = onlineMode_? _params.getUntrackedParameter<std::vector<int> >("bxBins"): _params.getUntrackedParameter<std::vector<int> >("bxBinsFine");
33  chi2ThresholdEB_ = _params.getUntrackedParameter<double>("chi2ThresholdEB");
34  chi2ThresholdEE_ = _params.getUntrackedParameter<double>("chi2ThresholdEE");
35  energyThresholdEB_ = _params.getUntrackedParameter<double>("energyThresholdEB");
36  energyThresholdEE_ = _params.getUntrackedParameter<double>("energyThresholdEE");
37  energyThresholdEEFwd_ = _params.getUntrackedParameter<double>("energyThresholdEEFwd");
38  timingVsBXThreshold_ = _params.getUntrackedParameter<double>("timingVsBXThreshold");
39  timeErrorThreshold_ = _params.getUntrackedParameter<double>("timeErrorThreshold");
40  }
float timingVsBXThreshold_
Definition: TimingTask.h:35
float energyThresholdEEFwd_
Definition: TimingTask.h:34
float energyThresholdEE_
Definition: TimingTask.h:33
float energyThresholdEB_
Definition: TimingTask.h:32
std::vector< int > bxBinEdges_
Definition: TimingTask.h:27
float timeErrorThreshold_
Definition: TimingTask.h:36

Member Data Documentation

double ecaldqm::TimingTask::bxBin_
private

Definition at line 28 of file TimingTask.h.

Referenced by beginEvent(), and runOnRecHits().

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

Definition at line 27 of file TimingTask.h.

Referenced by beginEvent(), and setParams().

float ecaldqm::TimingTask::chi2ThresholdEB_
private

Definition at line 30 of file TimingTask.h.

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

float ecaldqm::TimingTask::chi2ThresholdEE_
private

Definition at line 31 of file TimingTask.h.

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

float ecaldqm::TimingTask::energyThresholdEB_
private

Definition at line 32 of file TimingTask.h.

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

float ecaldqm::TimingTask::energyThresholdEE_
private

Definition at line 33 of file TimingTask.h.

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

float ecaldqm::TimingTask::energyThresholdEEFwd_
private

Definition at line 34 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 beginLuminosityBlock(), and runOnRecHits().

float ecaldqm::TimingTask::timeErrorThreshold_
private

Definition at line 36 of file TimingTask.h.

Referenced by runOnRecHits(), and setParams().

float ecaldqm::TimingTask::timingVsBXThreshold_
private

Definition at line 35 of file TimingTask.h.

Referenced by runOnRecHits(), and setParams().