CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
virtual void beginEvent (edm::Event const &, edm::EventSetup const &)
 
 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 ()
 
virtual ~DQWorkerTask ()
 
- 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 &)
 
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 ()
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

float chi2ThresholdEB_
 
float chi2ThresholdEE_
 
float energyThresholdEB_
 
float energyThresholdEE_
 

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 11 of file TimingTask.cc.

11  :
12  DQWorkerTask(),
13  chi2ThresholdEB_(0.),
14  chi2ThresholdEE_(0.),
17  {
18  }
float energyThresholdEE_
Definition: TimingTask.h:28
float energyThresholdEB_
Definition: TimingTask.h:27
ecaldqm::TimingTask::~TimingTask ( )
inline

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 31 of file TimingTask.h.

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

31  {
32  switch(_collection){
33  case kEBRecHit:
34  case kEERecHit:
35  if(_p) runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
36  return true;
37  break;
38  case kEBUncalibRecHit:
39  case kEEUncalibRecHit:
40  if(_p) runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
41  return true;
42  break;
43  default:
44  break;
45  }
46  return false;
47  }
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: TimingTask.cc:45
void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const &)
Definition: TimingTask.cc:102
bool ecaldqm::TimingTask::filterRunType ( short const *  _runType)
overridevirtual
void ecaldqm::TimingTask::runOnRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collection 
)

Definition at line 45 of file TimingTask.cc.

References edm::SortedCollection< T, SORT >::begin(), chi2ThresholdEB_, chi2ThresholdEE_, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, energyThresholdEB_, energyThresholdEE_, hit::id, ecaldqm::kEBRecHit, EcalRecHit::kGood, EcalRecHit::kOutOfTime, ecaldqm::DQWorker::MEs_, and dtDQMClient_cfg::threshold.

Referenced by analyze().

46  {
47  MESet& meTimeAmp(MEs_.at("TimeAmp"));
48  MESet& meTimeAmpAll(MEs_.at("TimeAmpAll"));
49  MESet& meTimeAll(MEs_.at("TimeAll"));
50  MESet& meTimeAllMap(MEs_.at("TimeAllMap"));
51  MESet& meTimeMap(MEs_.at("TimeMap"));
52  MESet& meTime1D(MEs_.at("Time1D"));
53  MESet& meChi2(MEs_.at("Chi2"));
54 
55  uint32_t mask(~((0x1 << EcalRecHit::kGood) | (0x1 << EcalRecHit::kOutOfTime)));
56  float threshold(_collection == kEBRecHit ? energyThresholdEB_ : energyThresholdEE_);
57  int signedSubdet;
58 
59  std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit){
60  if(hit.checkFlagMask(mask)) return;
61 
62  DetId id(hit.id());
63 
64  float time(hit.time());
65  float energy(hit.energy());
66 
67  float chi2Threshold = ( id.subdetId() == EcalBarrel ) ? chi2ThresholdEB_ : chi2ThresholdEE_;
68  if (id.subdetId() == EcalBarrel) {
69  signedSubdet=EcalBarrel;
70  }
71  else {
72  EEDetId eeId(hit.id());
73  if(eeId.zside() < 0){
74  signedSubdet = -EcalEndcap;
75  }
76  else{
77  signedSubdet = EcalEndcap;
78  }
79  }
80 
81  if(energy > threshold){
82  meChi2.fill(signedSubdet, hit.chi2());
83  }
84 
85  if( hit.chi2() > chi2Threshold ) return;
86 
87  meTimeAmp.fill(id, energy, time);
88  meTimeAmpAll.fill(id, energy, time);
89 
90  if(energy > threshold){
91  meTimeAll.fill(id, time);
92  meTimeMap.fill(id, time);
93  meTime1D.fill(id, time);
94  meTimeAllMap.fill(id, time);
95  }
96  });
97  }
float energyThresholdEE_
Definition: TimingTask.h:28
unsigned int id
Definition: DetId.h:18
MESetCollection MEs_
Definition: DQWorker.h:75
float energyThresholdEB_
Definition: TimingTask.h:27
void ecaldqm::TimingTask::runOnUncalibRecHits ( EcalUncalibratedRecHitCollection const &  _uhits)

Definition at line 102 of file TimingTask.cc.

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

Referenced by analyze().

103  {
104  MESet& meTimeAmpBXm( MEs_.at("TimeAmpBXm") );
105  MESet& meTimeAmpBXp( MEs_.at("TimeAmpBXp") );
106 
107  for( EcalUncalibratedRecHitCollection::const_iterator uhitItr(_uhits.begin()); uhitItr != _uhits.end(); ++uhitItr ) {
108 
109  // Apply reconstruction quality cuts
110  if( !uhitItr->checkFlag(EcalUncalibratedRecHit::kGood) ) continue;
111  DetId id( uhitItr->id() );
112  float chi2Threshold = ( id.subdetId() == EcalBarrel ) ? chi2ThresholdEB_ : chi2ThresholdEE_;
113  if( uhitItr->chi2() > chi2Threshold ) continue;
114 
115  // Apply amplitude cut based on approx rechit energy
116  float amp( uhitItr->amplitude() );
117  float ampThreshold( id.subdetId() == EcalBarrel ? energyThresholdEB_*20. : energyThresholdEE_*5. ); // 1 GeV ~ ( EB:20, EE:5 ) ADC
118  if( amp < ampThreshold ) continue;
119 
120  // Apply jitter timing cut based on approx rechit timing
121  float timeOff( id.subdetId() == EcalBarrel ? 0.4 : 1.8 );
122  float hitTime( uhitItr->jitter()*25. + timeOff ); // 1 jitter ~ 25 ns
123  if( abs(hitTime) >= 5. ) continue;
124 
125  // Fill MEs
126  meTimeAmpBXm.fill( id,amp,uhitItr->outOfTimeAmplitude(4) ); // BX-1
127  meTimeAmpBXp.fill( id,amp,uhitItr->outOfTimeAmplitude(6) ); // BX+1
128 
129  }
130  }
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float energyThresholdEE_
Definition: TimingTask.h:28
Definition: DetId.h:18
MESetCollection MEs_
Definition: DQWorker.h:75
float energyThresholdEB_
Definition: TimingTask.h:27
void ecaldqm::TimingTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 21 of file TimingTask.cc.

References chi2ThresholdEB_, chi2ThresholdEE_, energyThresholdEB_, energyThresholdEE_, and edm::ParameterSet::getUntrackedParameter().

22  {
23  chi2ThresholdEB_ = _params.getUntrackedParameter<double>("chi2ThresholdEB");
24  chi2ThresholdEE_ = _params.getUntrackedParameter<double>("chi2ThresholdEE");
25  energyThresholdEB_ = _params.getUntrackedParameter<double>("energyThresholdEB");
26  energyThresholdEE_ = _params.getUntrackedParameter<double>("energyThresholdEE");
27  }
float energyThresholdEE_
Definition: TimingTask.h:28
float energyThresholdEB_
Definition: TimingTask.h:27

Member Data Documentation

float ecaldqm::TimingTask::chi2ThresholdEB_
private

Definition at line 25 of file TimingTask.h.

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

float ecaldqm::TimingTask::chi2ThresholdEE_
private

Definition at line 26 of file TimingTask.h.

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

float ecaldqm::TimingTask::energyThresholdEB_
private

Definition at line 27 of file TimingTask.h.

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

float ecaldqm::TimingTask::energyThresholdEE_
private

Definition at line 28 of file TimingTask.h.

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