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::RecoSummaryTask Class Reference

#include <RecoSummaryTask.h>

Inheritance diagram for ecaldqm::RecoSummaryTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

void addDependencies (DependencySet &) override
 
bool analyze (void const *, Collections) override
 
void endEvent (edm::Event const &, edm::EventSetup const &)
 
bool filterRunType (short const *) override
 
 RecoSummaryTask ()
 
void runOnBasicClusters (edm::View< reco::CaloCluster > const &, Collections)
 
void runOnRecHits (EcalRecHitCollection const &, Collections)
 
void runOnReducedRecHits (EcalRecHitCollection const &, Collections)
 
 ~RecoSummaryTask ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void beginEvent (edm::Event const &, edm::EventSetup const &)
 
 DQWorkerTask ()
 
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

EcalRecHitCollection const * ebHits_
 
EcalRecHitCollection const * eeHits_
 
float rechitThresholdEB_
 
float rechitThresholdEE_
 

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 13 of file RecoSummaryTask.h.

Constructor & Destructor Documentation

ecaldqm::RecoSummaryTask::RecoSummaryTask ( )

Definition at line 15 of file RecoSummaryTask.cc.

15  :
16  DQWorkerTask(),
19  ebHits_(0),
20  eeHits_(0)
21  {
22  }
EcalRecHitCollection const * ebHits_
EcalRecHitCollection const * eeHits_
ecaldqm::RecoSummaryTask::~RecoSummaryTask ( )
inline

Definition at line 16 of file RecoSummaryTask.h.

16 {}

Member Function Documentation

void ecaldqm::RecoSummaryTask::addDependencies ( DependencySet _dependencies)
overridevirtual
bool ecaldqm::RecoSummaryTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 38 of file RecoSummaryTask.h.

References compareJSON::const, ecaldqm::kEBBasicCluster, ecaldqm::kEBRecHit, ecaldqm::kEBReducedRecHit, ecaldqm::kEEBasicCluster, ecaldqm::kEERecHit, ecaldqm::kEEReducedRecHit, runOnBasicClusters(), runOnRecHits(), and runOnReducedRecHits().

38  {
39  switch(_collection){
40  case kEBRecHit:
41  case kEERecHit:
42  if(_p) runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
43  return true;
44  break;
45  case kEBReducedRecHit:
46  case kEEReducedRecHit:
47  if(_p) runOnReducedRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
48  return true;
49  break;
50  case kEBBasicCluster:
51  case kEEBasicCluster:
52  if(_p) runOnBasicClusters(*static_cast<edm::View<reco::CaloCluster> const*>(_p), _collection);
53  return true;
54  break;
55  default:
56  break;
57  }
58  return false;
59  }
void runOnReducedRecHits(EcalRecHitCollection const &, Collections)
void runOnRecHits(EcalRecHitCollection const &, Collections)
void runOnBasicClusters(edm::View< reco::CaloCluster > const &, Collections)
string const
Definition: compareJSON.py:14
void ecaldqm::RecoSummaryTask::endEvent ( edm::Event const &  ,
edm::EventSetup const &   
)
virtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 54 of file RecoSummaryTask.cc.

References ebHits_, and eeHits_.

55  {
56  ebHits_ = 0;
57  eeHits_ = 0;
58  }
EcalRecHitCollection const * ebHits_
EcalRecHitCollection const * eeHits_
bool ecaldqm::RecoSummaryTask::filterRunType ( short const *  _runType)
overridevirtual
void ecaldqm::RecoSummaryTask::runOnBasicClusters ( edm::View< reco::CaloCluster > const &  _bcs,
Collections  _collection 
)

Definition at line 138 of file RecoSummaryTask.cc.

References edm::View< T >::begin(), reco::CaloID::DET_ECAL_BARREL, reco::CaloID::DET_ECAL_ENDCAP, ebHits_, EcalBarrel, EcalEndcap, eeHits_, edm::View< T >::end(), plotBeamSpotDB::first, GeomDetEnumerators::isBarrel(), ecaldqm::kEBBasicCluster, and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

139  {
140  bool isBarrel(_collection == kEBBasicCluster);
141 
142  MESet& meRecoFlag(MEs_.at("RecoFlagBasicCluster"));
143 
144  EcalRecHitCollection const* hitCol(isBarrel ? ebHits_ : eeHits_);
145  int subdet(isBarrel ? EcalBarrel : EcalEndcap);
146 
147  for(edm::View<reco::CaloCluster>::const_iterator bcItr(_bcs.begin()); bcItr != _bcs.end(); ++bcItr){
148  if(bcItr->caloID().detectors() != 0){
149  if(isBarrel && !bcItr->caloID().detector(reco::CaloID::DET_ECAL_BARREL)) continue;
150  if(!isBarrel && !bcItr->caloID().detector(reco::CaloID::DET_ECAL_ENDCAP)) continue;
151  }
152 
153  std::vector<std::pair<DetId, float> > const& haf(bcItr->hitsAndFractions());
154  for(unsigned iH(0); iH != haf.size(); ++iH){
155  if(isBarrel && haf[iH].first.subdetId() != EcalBarrel) continue;
156  if(!isBarrel && haf[iH].first.subdetId() != EcalEndcap) continue;
157  EcalRecHitCollection::const_iterator hItr(hitCol->find(haf[iH].first));
158  if(hItr == hitCol->end()) continue;
159  meRecoFlag.fill(subdet, hItr->recoFlag());
160  }
161  }
162  }
bool isBarrel(GeomDetEnumerators::SubDetector m)
std::vector< EcalRecHit >::const_iterator const_iterator
EcalRecHitCollection const * ebHits_
const_iterator begin() const
EcalRecHitCollection const * eeHits_
MESetCollection MEs_
Definition: DQWorker.h:75
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:85
const_iterator end() const
void ecaldqm::RecoSummaryTask::runOnRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collection 
)

Definition at line 61 of file RecoSummaryTask.cc.

References edm::SortedCollection< T, SORT >::begin(), ebHits_, EcalBarrel, EcalEndcap, eeHits_, edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, GeomDetEnumerators::isBarrel(), ecaldqm::kEBRecHit, ecaldqm::DQWorker::MEs_, rechitThresholdEB_, rechitThresholdEE_, and EcalTools::swissCross().

Referenced by analyze().

62  {
63  bool isBarrel(_collection == kEBRecHit);
64 
65  MESet& meEnergyMax(MEs_.at("EnergyMax"));
66  MESet& meChi2(MEs_.at("Chi2"));
67  MESet& meTime(MEs_.at("Time"));
68  MESet* meSwissCross(isBarrel ? &MEs_.at("SwissCross") : 0);
69  MESet& meRecoFlag(MEs_.at("RecoFlagAll"));
70 
71  double maxE[2] = {-1. -1};
72  int subdet(isBarrel ? EcalBarrel : EcalEndcap);
73 
74  for(EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr){
75  meRecoFlag.fill(subdet, hitItr->recoFlag());
76  float energy(hitItr->energy());
77 
78  int signedSubdet;
79  float rechitThreshold;
80 
81  if(isBarrel){
82  signedSubdet = EcalBarrel;
83  rechitThreshold = rechitThresholdEB_;
84 
85  if(energy > 3.){
86  EBDetId ebId(hitItr->id());
87  if(ebId.ieta() != 85)
88  meSwissCross->fill(EcalTools::swissCross(ebId, _hits, 0.));
89  }
90 
91  if(energy > maxE[0]) maxE[0] = energy;
92  }
93  else{
94  rechitThreshold = rechitThresholdEE_;
95 
96  EEDetId eeId(hitItr->id());
97  if(eeId.zside() < 0){
98  signedSubdet = -EcalEndcap;
99  if(energy > maxE[0]) maxE[0] = energy;
100  }
101  else{
102  signedSubdet = EcalEndcap;
103  if(energy > maxE[1]) maxE[1] = energy;
104  }
105  }
106 
107  if(energy > rechitThreshold){
108  meChi2.fill(signedSubdet, hitItr->chi2());
109  meTime.fill(signedSubdet, hitItr->time());
110  }
111  }
112 
113  if(isBarrel){
114  meEnergyMax.fill(EcalBarrel, maxE[0]);
115 
116  ebHits_ = &_hits;
117  }
118  else{
119  meEnergyMax.fill(-EcalEndcap, maxE[0]);
120  meEnergyMax.fill(EcalEndcap, maxE[1]);
121 
122  eeHits_ = &_hits;
123  }
124  }
bool isBarrel(GeomDetEnumerators::SubDetector m)
std::vector< EcalRecHit >::const_iterator const_iterator
EcalRecHitCollection const * ebHits_
EcalRecHitCollection const * eeHits_
MESetCollection MEs_
Definition: DQWorker.h:75
static float swissCross(const DetId &id, const EcalRecHitCollection &recHits, float recHitThreshold, bool avoidIeta85=true)
the good old 1-e4/e1. Ignore hits below recHitThreshold
Definition: EcalTools.cc:11
void ecaldqm::RecoSummaryTask::runOnReducedRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collections 
)

Definition at line 127 of file RecoSummaryTask.cc.

References edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), ecaldqm::kEBReducedRecHit, and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

128  {
129  MESet& meRecoFlag(MEs_.at("RecoFlagReduced"));
130 
131  int subdet(_collections == kEBReducedRecHit ? EcalBarrel : EcalEndcap);
132 
133  for(EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr)
134  meRecoFlag.fill(subdet, hitItr->recoFlag());
135  }
std::vector< EcalRecHit >::const_iterator const_iterator
MESetCollection MEs_
Definition: DQWorker.h:75
void ecaldqm::RecoSummaryTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 25 of file RecoSummaryTask.cc.

References edm::ParameterSet::getUntrackedParameter(), rechitThresholdEB_, and rechitThresholdEE_.

26  {
27  rechitThresholdEB_ = _params.getUntrackedParameter<double>("rechitThresholdEB");
28  rechitThresholdEE_ = _params.getUntrackedParameter<double>("rechitThresholdEE");
29  }

Member Data Documentation

EcalRecHitCollection const* ecaldqm::RecoSummaryTask::ebHits_
private

Definition at line 34 of file RecoSummaryTask.h.

Referenced by endEvent(), runOnBasicClusters(), and runOnRecHits().

EcalRecHitCollection const* ecaldqm::RecoSummaryTask::eeHits_
private

Definition at line 35 of file RecoSummaryTask.h.

Referenced by endEvent(), runOnBasicClusters(), and runOnRecHits().

float ecaldqm::RecoSummaryTask::rechitThresholdEB_
private

Definition at line 32 of file RecoSummaryTask.h.

Referenced by runOnRecHits(), and setParams().

float ecaldqm::RecoSummaryTask::rechitThresholdEE_
private

Definition at line 33 of file RecoSummaryTask.h.

Referenced by runOnRecHits(), and setParams().