CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HGCalRecHitValidation Class Reference
Inheritance diagram for HGCalRecHitValidation:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  energysum
 
struct  HitsInfo
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
 HGCalRecHitValidation (const edm::ParameterSet &)
 
 ~HGCalRecHitValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void fillHitsInfo ()
 
void fillHitsInfo (HitsInfo &hits)
 
void fillOccupancyMap (std::map< int, int > &OccupancyMap, int layer)
 
template<class T1 , class T2 >
void recHitValidation (DetId &detId, int layer, const T1 *geom, T2 it)
 

Private Attributes

std::vector< MonitorElement * > energy_
 
std::vector< MonitorElement * > EtaPhi_Minus_
 
std::vector< MonitorElement * > EtaPhi_Plus_
 
std::vector< MonitorElement * > HitOccupancy_Minus_
 
std::vector< MonitorElement * > HitOccupancy_Plus_
 
bool ifHCAL_
 
unsigned int layers_
 
MonitorElementMeanHitOccupancy_Minus_
 
MonitorElementMeanHitOccupancy_Plus_
 
std::string nameDetector_
 
std::map< int, int > OccupancyMap_minus
 
std::map< int, int > OccupancyMap_plus
 
edm::EDGetToken recHitSource_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 41 of file HGCalRecHitValidation.cc.

Constructor & Destructor Documentation

HGCalRecHitValidation::HGCalRecHitValidation ( const edm::ParameterSet iConfig)
explicit

Definition at line 92 of file HGCalRecHitValidation.cc.

References Exception, edm::ParameterSet::getParameter(), ifHCAL_, nameDetector_, recHitSource_, and groupFilesInBlocks::temp.

92  :
93  nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
94  ifHCAL_(iConfig.getParameter<bool>("ifHCAL")),
95  verbosity_(iConfig.getUntrackedParameter<int>("Verbosity",0)) {
96 
97  auto temp = iConfig.getParameter<edm::InputTag>("RecHitSource");
98  if (nameDetector_ == "HGCalEESensitive" ||
99  nameDetector_ == "HGCalHESiliconSensitive" ||
100  nameDetector_ == "HGCalHEScintillatorSensitive") {
101  recHitSource_ = consumes<HGCRecHitCollection>(temp);
102  } else if (nameDetector_ == "HCal") {
103  if (ifHCAL_) recHitSource_ = consumes<HBHERecHitCollection>(temp);
104  else recHitSource_ = consumes<HGChebRecHitCollection>(temp);
105  } else {
106  throw cms::Exception("BadHGCRecHitSource")
107  << "HGCal DetectorName given as " << nameDetector_ << " must be: "
108  << "\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", "
109  << "\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
110  }
111 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
HGCalRecHitValidation::~HGCalRecHitValidation ( )
inlineoverride

Member Function Documentation

void HGCalRecHitValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 123 of file HGCalRecHitValidation.cc.

References HcalDetId::depth(), edm::EventID::event(), fillHitsInfo(), relativeConstraints::geom, motionPolicyChamber::geom0, HGCalTopology::geomMode(), edm::EventSetup::get(), edm::Event::getByToken(), HcalEndcap, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, edm::EventBase::id(), ifHCAL_, edm::ESHandleBase::isValid(), edm::HandleBase::isValid(), HGCScintillatorDetId::layer(), HGCalDetId::layer(), HGCSiliconDetId::layer(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, nameDetector_, OccupancyMap_minus, OccupancyMap_plus, convertSQLiteXML::ok, edm::Handle< T >::product(), edm::ESHandle< T >::product(), recHitSource_, recHitValidation(), edm::SortedCollection< T, SORT >::size(), DetId::subdetId(), HGCalGeometry::topology(), HGCalGeometryMode::Trapezoid, and verbosity_.

Referenced by ~HGCalRecHitValidation().

124  {
125  OccupancyMap_plus.clear();
126  OccupancyMap_minus.clear();
127 
128  bool ok(true);
129  unsigned int ntot(0), nused(0);
130  if (nameDetector_ == "HCal") {
132  iSetup.get<CaloGeometryRecord>().get(geom);
133  if (!geom.isValid()) {
134  edm::LogVerbatim("HGCalValidation") << "Cannot get valid HGCalGeometry "
135  << "Object for " << nameDetector_;
136  } else {
137  const CaloGeometry* geom0 = geom.product();
138 
139  if (ifHCAL_) {
141  iEvent.getByToken(recHitSource_, hbhecoll);
142  if (hbhecoll.isValid()) {
143  if (verbosity_>0)
144  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with "
145  << hbhecoll->size()
146  << " element(s)";
147  for (const auto & it : *(hbhecoll.product())) {
148  DetId detId = it.id();
149  ntot++;
150  if (detId.subdetId() == HcalEndcap) {
151  nused++;
152  int layer = HcalDetId(detId).depth();
153  recHitValidation(detId, layer, geom0, &it);
154  }
155  }
156  } else {
157  ok = false;
158  edm::LogVerbatim("HGCalValidation") << "HBHERecHitCollection Handle does not "
159  << "exist !!!";
160  }
161  } else {
163  iEvent.getByToken(recHitSource_, hbhecoll);
164  if (hbhecoll.isValid()) {
165  if (verbosity_>0)
166  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with "
167  << hbhecoll->size()
168  << " element(s)";
169  for (const auto & it : *(hbhecoll.product())) {
170  DetId detId = it.id();
171  ntot++; nused++;
172  int layer = HcalDetId(detId).depth();
173  recHitValidation(detId, layer, geom0, &it);
174  }
175  } else {
176  ok = false;
177  edm::LogVerbatim("HGCalValidation") << "HGChebRecHitCollection Handle does not "
178  << "exist !!!";
179  }
180  }
181  }
182  } else {
184  iSetup.get<IdealGeometryRecord>().get(nameDetector_, geom);
185  if (!geom.isValid()) {
186  edm::LogVerbatim("HGCalValidation") << "Cannot get valid HGCalGeometry Object for "
187  << nameDetector_;
188  } else {
189  const HGCalGeometry* geom0 = geom.product();
191  int geomType = (((mode == HGCalGeometryMode::Hexagon8) ||
192  (mode == HGCalGeometryMode::Hexagon8Full)) ? 1 :
193  ((mode == HGCalGeometryMode::Trapezoid) ? 2 : 0));
194 
195  edm::Handle<HGCRecHitCollection> theRecHitContainers;
196  iEvent.getByToken(recHitSource_, theRecHitContainers);
197  if (theRecHitContainers.isValid()) {
198  if (verbosity_>0)
199  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with "
200  << theRecHitContainers->size()
201  << " element(s)";
202  for (const auto & it : *(theRecHitContainers.product())) {
203  ntot++; nused++;
204  DetId detId = it.id();
205  int layer = ((geomType == 0) ? HGCalDetId(detId).layer() :
206  ((geomType == 1) ? HGCSiliconDetId(detId).layer() :
207  HGCScintillatorDetId(detId).layer()));
208  recHitValidation(detId, layer, geom0, &it);
209  }
210  } else {
211  ok = false;
212  edm::LogVerbatim("HGCalValidation") << "HGCRecHitCollection Handle does not "
213  << "exist !!!";
214  }
215  }
216  }
217  if (ok) fillHitsInfo();
218  edm::LogVerbatim("HGCalValidation") << "Event " << iEvent.id().event()
219  << " with " << ntot << " total and "
220  << nused << " used recHits";
221 }
HGCalGeometryMode::GeometryMode geomMode() const
Geometry mode.
Definition: HGCalTopology.h:86
EventNumber_t event() const
Definition: EventID.h:41
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
int depth() const
get the tower depth
Definition: HcalDetId.h:162
std::map< int, int > OccupancyMap_minus
int layer() const
get the layer #
const HGCalTopology & topology() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
bool isValid() const
Definition: HandleBase.h:74
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:81
int layer() const
get the layer #
std::map< int, int > OccupancyMap_plus
edm::EventID id() const
Definition: EventBase.h:60
size_type size() const
T get() const
Definition: EventSetup.h:63
bool isValid() const
Definition: ESHandle.h:47
T const * product() const
Definition: ESHandle.h:86
void recHitValidation(DetId &detId, int layer, const T1 *geom, T2 it)
int layer() const
get the layer #
Definition: HGCalDetId.h:48
void HGCalRecHitValidation::bookHistograms ( DQMStore::IBooker iB,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 303 of file HGCalRecHitValidation.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DEFINE_FWK_MODULE, energy_, EtaPhi_Minus_, EtaPhi_Plus_, HitOccupancy_Minus_, HitOccupancy_Plus_, layers_, MeanHitOccupancy_Minus_, MeanHitOccupancy_Plus_, nameDetector_, pi, and DQMStore::IBooker::setCurrentFolder().

Referenced by ~HGCalRecHitValidation().

305  {
306 
307  iB.setCurrentFolder("HGCAL/HGCalRecHitsV/"+nameDetector_);
308  std::ostringstream histoname;
309  for (unsigned int ilayer = 0; ilayer < layers_; ilayer++ ) {
310  histoname.str(""); histoname << "HitOccupancy_Plus_layer_" << ilayer;
311  HitOccupancy_Plus_.push_back(iB.book1D( histoname.str().c_str(), "RecHitOccupancy_Plus", 100, 0, 10000));
312  histoname.str(""); histoname << "HitOccupancy_Minus_layer_" << ilayer;
313  HitOccupancy_Minus_.push_back(iB.book1D( histoname.str().c_str(), "RecHitOccupancy_Minus", 100, 0, 10000));
314 
315  histoname.str(""); histoname << "EtaPhi_Plus_" << "layer_" << ilayer;
316  EtaPhi_Plus_.push_back(iB.book2D(histoname.str().c_str(), "Occupancy", 31, 1.45, 3.0, 72, -CLHEP::pi, CLHEP::pi));
317  histoname.str(""); histoname << "EtaPhi_Minus_" << "layer_" << ilayer;
318  EtaPhi_Minus_.push_back(iB.book2D(histoname.str().c_str(), "Occupancy", 31, -3.0, -1.45, 72, -CLHEP::pi, CLHEP::pi));
319 
320  histoname.str(""); histoname << "energy_layer_" << ilayer;
321  energy_.push_back(iB.book1D(histoname.str().c_str(),"energy_",100,0,0.002));
322  }//loop over layers ends here
323 
324  histoname.str(""); histoname << "SUMOfRecHitOccupancy_Plus";
325  MeanHitOccupancy_Plus_= iB.book1D( histoname.str().c_str(), "SUMOfRecHitOccupancy_Plus", layers_, -0.5, layers_-0.5);
326  histoname.str(""); histoname << "SUMOfRecHitOccupancy_Minus";
327  MeanHitOccupancy_Minus_ = iB.book1D( histoname.str().c_str(), "SUMOfRecHitOccupancy_Minus", layers_, -0.5,layers_-0.5);
328 }
std::vector< MonitorElement * > EtaPhi_Minus_
std::vector< MonitorElement * > EtaPhi_Plus_
std::vector< MonitorElement * > HitOccupancy_Minus_
const Double_t pi
MonitorElement * MeanHitOccupancy_Plus_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * MeanHitOccupancy_Minus_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
std::vector< MonitorElement * > HitOccupancy_Plus_
std::vector< MonitorElement * > energy_
void HGCalRecHitValidation::dqmBeginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
override

Definition at line 287 of file HGCalRecHitValidation.cc.

References edm::EventSetup::get(), HcalDDDRecConstants::getMaxDepth(), HGCalDDDConstants::layers(), layers_, and nameDetector_.

Referenced by ~HGCalRecHitValidation().

288  {
289 
290  if (nameDetector_ == "HCal") {
292  iSetup.get<HcalRecNumberingRecord>().get( pHRNDC );
293  const HcalDDDRecConstants *hcons = &(*pHRNDC);
294  layers_ = hcons->getMaxDepth(1);
295  } else {
297  iSetup.get<IdealGeometryRecord>().get(nameDetector_, pHGDC);
298  const HGCalDDDConstants & hgcons_ = (*pHGDC);
299  layers_ = hgcons_.layers(true);
300  }
301 }
unsigned int layers(bool reco) const
int getMaxDepth(const int &type) const
T get() const
Definition: EventSetup.h:63
void HGCalRecHitValidation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 114 of file HGCalRecHitValidation.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~HGCalRecHitValidation().

114  {
116  desc.add<std::string>("DetectorName","HGCalEESensitive");
117  desc.add<edm::InputTag>("RecHitSource",edm::InputTag("HGCalRecHit","HGCEERecHits"));
118  desc.add<bool>("ifHCAL",false);
119  desc.addUntracked<int>("Verbosity",0);
120  descriptions.add("hgcalRecHitValidationEE",desc);
121 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HGCalRecHitValidation::fillHitsInfo ( )
private

Definition at line 261 of file HGCalRecHitValidation.cc.

References HitOccupancy_Minus_, HitOccupancy_Plus_, OccupancyMap_minus, and OccupancyMap_plus.

Referenced by analyze(), recHitValidation(), and ~HGCalRecHitValidation().

261  {
262 
263  for (auto itr = OccupancyMap_plus.begin() ; itr != OccupancyMap_plus.end(); ++itr) {
264  int layer = (*itr).first;
265  int occupancy = (*itr).second;
266  HitOccupancy_Plus_.at(layer)->Fill(occupancy);
267  }
268 
269  for (auto itr = OccupancyMap_minus.begin() ; itr != OccupancyMap_minus.end(); ++itr) {
270  int layer = (*itr).first;
271  int occupancy = (*itr).second;
272  HitOccupancy_Minus_.at(layer)->Fill(occupancy);
273  }
274 
275 }
std::vector< MonitorElement * > HitOccupancy_Minus_
std::map< int, int > OccupancyMap_minus
std::map< int, int > OccupancyMap_plus
std::vector< MonitorElement * > HitOccupancy_Plus_
void HGCalRecHitValidation::fillHitsInfo ( HitsInfo hits)
private

Definition at line 277 of file HGCalRecHitValidation.cc.

References HGCalRecHitValidation::HitsInfo::energy, energy_, HGCalRecHitValidation::HitsInfo::eta, EtaPhi_Minus_, EtaPhi_Plus_, HGCalRecHitValidation::HitsInfo::layer, and HGCalRecHitValidation::HitsInfo::phi.

277  {
278 
279  unsigned int ilayer = hits.layer -1;
280  energy_.at(ilayer)->Fill(hits.energy);
281 
282  EtaPhi_Plus_.at(ilayer)->Fill(hits.eta , hits.phi);
283  EtaPhi_Minus_.at(ilayer)->Fill(hits.eta, hits.phi);
284 
285 }
std::vector< MonitorElement * > EtaPhi_Minus_
std::vector< MonitorElement * > EtaPhi_Plus_
std::vector< MonitorElement * > energy_
void HGCalRecHitValidation::fillOccupancyMap ( std::map< int, int > &  OccupancyMap,
int  layer 
)
private

Definition at line 256 of file HGCalRecHitValidation.cc.

Referenced by recHitValidation(), and ~HGCalRecHitValidation().

256  {
257  if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer]++;
258  else OccupancyMap[layer] = 1;
259 }
template<class T1 , class T2 >
void HGCalRecHitValidation::recHitValidation ( DetId detId,
int  layer,
const T1 *  geom,
T2  it 
)
private

Definition at line 224 of file HGCalRecHitValidation.cc.

References HGCalRecHitValidation::HitsInfo::energy, HGCalRecHitValidation::HitsInfo::eta, PV3DBase< T, PVType, FrameType >::eta(), fillHitsInfo(), fillOccupancyMap(), HGCalRecHitValidation::HitsInfo::layer, layers_, min(), OccupancyMap_minus, OccupancyMap_plus, HGCalRecHitValidation::HitsInfo::phi, PV3DBase< T, PVType, FrameType >::phi(), verbosity_, HGCalRecHitValidation::HitsInfo::x, PV3DBase< T, PVType, FrameType >::x(), HGCalRecHitValidation::HitsInfo::y, PV3DBase< T, PVType, FrameType >::y(), HGCalRecHitValidation::HitsInfo::z, and PV3DBase< T, PVType, FrameType >::z().

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

225  {
226 
227  const GlobalPoint& global = geom->getPosition(detId);
228  double energy = it->energy();
229 
230  float globalx = global.x();
231  float globaly = global.y();
232  float globalz = global.z();
233 
234  HitsInfo hinfo;
235  hinfo.energy = energy;
236  hinfo.x = globalx;
237  hinfo.y = globaly;
238  hinfo.z = globalz;
239  hinfo.layer = std::min((unsigned)layer,layers_);
240  hinfo.phi = global.phi();
241  hinfo.eta = global.eta();
242 
243  if (verbosity_>1)
244  edm::LogVerbatim("HGCalValidation") << "-------------------------- gx = "
245  << globalx << " gy = " << globaly
246  << " gz = " << globalz << " phi = "
247  << hinfo.phi << " eta = " << hinfo.eta << " lay = " << hinfo.layer;
248 
249  fillHitsInfo(hinfo);
250 
251  if (hinfo.eta > 0) fillOccupancyMap(OccupancyMap_plus, hinfo.layer -1);
252  else fillOccupancyMap(OccupancyMap_minus, hinfo.layer -1);
253 
254 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
std::map< int, int > OccupancyMap_minus
T z() const
Definition: PV3DBase.h:64
T min(T a, T b)
Definition: MathUtil.h:58
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
T eta() const
Definition: PV3DBase.h:76
std::map< int, int > OccupancyMap_plus
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

std::vector<MonitorElement*> HGCalRecHitValidation::energy_
private

Definition at line 85 of file HGCalRecHitValidation.cc.

Referenced by bookHistograms(), and fillHitsInfo().

std::vector<MonitorElement*> HGCalRecHitValidation::EtaPhi_Minus_
private

Definition at line 84 of file HGCalRecHitValidation.cc.

Referenced by bookHistograms(), and fillHitsInfo().

std::vector<MonitorElement*> HGCalRecHitValidation::EtaPhi_Plus_
private

Definition at line 83 of file HGCalRecHitValidation.cc.

Referenced by bookHistograms(), and fillHitsInfo().

std::vector<MonitorElement*> HGCalRecHitValidation::HitOccupancy_Minus_
private

Definition at line 87 of file HGCalRecHitValidation.cc.

Referenced by bookHistograms(), and fillHitsInfo().

std::vector<MonitorElement*> HGCalRecHitValidation::HitOccupancy_Plus_
private

Definition at line 86 of file HGCalRecHitValidation.cc.

Referenced by bookHistograms(), and fillHitsInfo().

bool HGCalRecHitValidation::ifHCAL_
private

Definition at line 77 of file HGCalRecHitValidation.cc.

Referenced by analyze(), and HGCalRecHitValidation().

unsigned int HGCalRecHitValidation::layers_
private

Definition at line 79 of file HGCalRecHitValidation.cc.

Referenced by bookHistograms(), dqmBeginRun(), and recHitValidation().

MonitorElement* HGCalRecHitValidation::MeanHitOccupancy_Minus_
private

Definition at line 89 of file HGCalRecHitValidation.cc.

Referenced by bookHistograms().

MonitorElement* HGCalRecHitValidation::MeanHitOccupancy_Plus_
private

Definition at line 88 of file HGCalRecHitValidation.cc.

Referenced by bookHistograms().

std::string HGCalRecHitValidation::nameDetector_
private
std::map<int, int> HGCalRecHitValidation::OccupancyMap_minus
private

Definition at line 81 of file HGCalRecHitValidation.cc.

Referenced by analyze(), fillHitsInfo(), and recHitValidation().

std::map<int, int> HGCalRecHitValidation::OccupancyMap_plus
private

Definition at line 80 of file HGCalRecHitValidation.cc.

Referenced by analyze(), fillHitsInfo(), and recHitValidation().

edm::EDGetToken HGCalRecHitValidation::recHitSource_
private

Definition at line 76 of file HGCalRecHitValidation.cc.

Referenced by analyze(), and HGCalRecHitValidation().

int HGCalRecHitValidation::verbosity_
private

Definition at line 78 of file HGCalRecHitValidation.cc.

Referenced by analyze(), and recHitValidation().