CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TimingTask.cc
Go to the documentation of this file.
1 #include "../interface/TimingTask.h"
2 
4 
6 
8 
9 namespace ecaldqm
10 {
12  DQWorkerTask(),
13  energyThresholdEB_(0.),
14  energyThresholdEE_(0.)
15  {
16  }
17 
18  void
20  {
21  energyThresholdEB_ = _params.getUntrackedParameter<double>("energyThresholdEB");
22  energyThresholdEE_ = _params.getUntrackedParameter<double>("energyThresholdEE");
23  }
24 
25  bool
26  TimingTask::filterRunType(short const* _runType)
27  {
28  for(int iFED(0); iFED < nDCC; iFED++){
29  if(_runType[iFED] == EcalDCCHeaderBlock::COSMIC ||
30  _runType[iFED] == EcalDCCHeaderBlock::MTCC ||
31  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
32  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL ||
33  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL ||
34  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL) return true;
35  }
36 
37  return false;
38  }
39 
40  void
42  {
43  MESet& meTimeAmp(MEs_.at("TimeAmp"));
44  MESet& meTimeAmpAll(MEs_.at("TimeAmpAll"));
45  MESet& meTimeAll(MEs_.at("TimeAll"));
46  MESet& meTimeAllMap(MEs_.at("TimeAllMap"));
47  MESet& meTimeMap(MEs_.at("TimeMap"));
48  MESet& meTime1D(MEs_.at("Time1D"));
49 
50  uint32_t mask(~((0x1 << EcalRecHit::kGood) | (0x1 << EcalRecHit::kOutOfTime)));
51  float threshold(_collection == kEBRecHit ? energyThresholdEB_ : energyThresholdEE_);
52 
53  std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit){
54  if(hit.checkFlagMask(mask)) return;
55 
56  DetId id(hit.id());
57 
58  float time(hit.time());
59  float energy(hit.energy());
60 
61  float chi2Threshold = ( id.subdetId() == EcalBarrel ) ? 16. : 50.;
62  if ( hit.chi2() > chi2Threshold ) return;
63 
64  meTimeAmp.fill(id, energy, time);
65  meTimeAmpAll.fill(id, energy, time);
66 
67  if(energy > threshold){
68  meTimeAll.fill(id, time);
69  meTimeMap.fill(id, time);
70  meTime1D.fill(id, time);
71  meTimeAllMap.fill(id, time);
72  }
73  });
74  }
75 
77 }
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:108
void setParams(edm::ParameterSet const &) override
Definition: TimingTask.cc:19
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: TimingTask.cc:41
float energyThresholdEE_
Definition: TimingTask.h:25
unsigned int id
const_iterator end() const
Definition: DetId.h:18
MESetCollection MEs_
Definition: DQWorker.h:75
float energyThresholdEB_
Definition: TimingTask.h:24
bool filterRunType(short const *) override
Definition: TimingTask.cc:26
const_iterator begin() const