CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HGCalSimHitStudy Class Reference
Inheritance diagram for HGCalSimHitStudy:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  hitsinfo
 

Public Member Functions

 HGCalSimHitStudy (const edm::ParameterSet &)
 
 ~HGCalSimHitStudy () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Protected Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginJob () override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Member Functions

void analyzeHits (int, const std::string &, const std::vector< PCaloHit > &)
 

Private Attributes

const std::vector< std::string > caloHitSources_
 
const double etamax_
 
const double etamin_
 
std::vector< TH1D * > h_C1_
 
std::vector< TH1D * > h_C2_
 
std::vector< TH1D * > h_E_
 
std::vector< TH2D * > h_EtaPhi_
 
std::vector< TH2D * > h_EtFiZm_
 
std::vector< TH2D * > h_EtFiZp_
 
std::vector< TH1D * > h_LayerZm_
 
std::vector< TH1D * > h_LayerZp_
 
std::vector< TH1D * > h_Ly_
 
std::vector< TH2D * > h_RZ_
 
std::vector< TH1D * > h_T_
 
std::vector< TH1D * > h_W1_
 
std::vector< TH1D * > h_W2_
 
std::vector< TH2D * > h_XY_
 
std::vector< const HGCalDDDConstants * > hgcons_
 
const bool ifLayer_
 
const bool ifNose_
 
std::vector< int > layerFront_
 
std::vector< int > layers_
 
const std::vector< std::string > nameDetectors_
 
const int nbinEta_
 
const int nbinR_
 
const int nbinZ_
 
const int nLayers_
 
const double rmax_
 
const double rmin_
 
std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > tok_hgcGeom_
 
std::vector< edm::EDGetTokenT< edm::PCaloHitContainer > > tok_hits_
 
const int verbosity_
 
const double zmax_
 
const double zmin_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Detailed Description

Definition at line 43 of file HGCalSimHitStudy.cc.

Constructor & Destructor Documentation

◆ HGCalSimHitStudy()

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

Definition at line 84 of file HGCalSimHitStudy.cc.

References caloHitSources_, TFileService::kSharedResource, Skims_PA_cff::name, nameDetectors_, source, tok_hgcGeom_, and tok_hits_.

85  : nameDetectors_(iConfig.getParameter<std::vector<std::string> >("detectorNames")),
86  caloHitSources_(iConfig.getParameter<std::vector<std::string> >("caloHitSources")),
87  rmin_(iConfig.getUntrackedParameter<double>("rMin", 0.0)),
88  rmax_(iConfig.getUntrackedParameter<double>("rMax", 3000.0)),
89  zmin_(iConfig.getUntrackedParameter<double>("zMin", 3000.0)),
90  zmax_(iConfig.getUntrackedParameter<double>("zMax", 6000.0)),
91  etamin_(iConfig.getUntrackedParameter<double>("etaMin", 1.0)),
92  etamax_(iConfig.getUntrackedParameter<double>("etaMax", 3.0)),
93  nbinR_(iConfig.getUntrackedParameter<int>("nBinR", 300)),
94  nbinZ_(iConfig.getUntrackedParameter<int>("nBinZ", 300)),
95  nbinEta_(iConfig.getUntrackedParameter<int>("nBinEta", 200)),
96  nLayers_(iConfig.getUntrackedParameter<int>("layers", 50)),
97  verbosity_(iConfig.getUntrackedParameter<int>("verbosity", 0)),
98  ifNose_(iConfig.getUntrackedParameter<bool>("ifNose", false)),
99  ifLayer_(iConfig.getUntrackedParameter<bool>("ifLayer", false)) {
100  usesResource(TFileService::kSharedResource);
101 
102  for (auto const& name : nameDetectors_)
103  tok_hgcGeom_.emplace_back(
104  esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name}));
105  for (auto const& source : caloHitSources_)
106  tok_hits_.emplace_back(consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", source)));
107 }
static const std::string kSharedResource
Definition: TFileService.h:76
const std::vector< std::string > nameDetectors_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< edm::EDGetTokenT< edm::PCaloHitContainer > > tok_hits_
const double etamin_
T getUntrackedParameter(std::string const &, T const &) const
const double zmin_
const double rmin_
const double etamax_
const double zmax_
const double rmax_
std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > tok_hgcGeom_
static std::string const source
Definition: EdmProvDump.cc:49
const std::vector< std::string > caloHitSources_

◆ ~HGCalSimHitStudy()

HGCalSimHitStudy::~HGCalSimHitStudy ( )
inlineoverride

Definition at line 55 of file HGCalSimHitStudy.cc.

55 {}

Member Function Documentation

◆ analyze()

void HGCalSimHitStudy::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 131 of file HGCalSimHitStudy.cc.

References analyzeHits(), iEvent, edm::HandleBase::isValid(), dqmdumpme::k, nameDetectors_, tok_hits_, and verbosity_.

131  {
132  //Now the hits
133  for (unsigned int k = 0; k < tok_hits_.size(); ++k) {
134  edm::Handle<edm::PCaloHitContainer> theCaloHitContainers;
135  iEvent.getByToken(tok_hits_[k], theCaloHitContainers);
136  if (theCaloHitContainers.isValid()) {
137  if (verbosity_ > 0)
138  edm::LogVerbatim("HGCalValidation") << " PcalohitItr = " << theCaloHitContainers->size();
139  std::vector<PCaloHit> caloHits;
140  caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
141  analyzeHits(k, nameDetectors_[k], caloHits);
142  } else if (verbosity_ > 0) {
143  edm::LogVerbatim("HGCalValidation") << "PCaloHitContainer does not "
144  << "exist for " << nameDetectors_[k];
145  }
146  }
147 }
const std::vector< std::string > nameDetectors_
Log< level::Info, true > LogVerbatim
std::vector< edm::EDGetTokenT< edm::PCaloHitContainer > > tok_hits_
int iEvent
Definition: GenABIO.cc:224
void analyzeHits(int, const std::string &, const std::vector< PCaloHit > &)
bool isValid() const
Definition: HandleBase.h:70

◆ analyzeHits()

void HGCalSimHitStudy::analyzeHits ( int  ih,
const std::string &  name,
const std::vector< PCaloHit > &  hits 
)
private

Definition at line 149 of file HGCalSimHitStudy.cc.

References funct::abs(), hgcalTopologyTester_cfi::cell2, HFNoseDetId::cellU(), HGCSiliconDetId::cellU(), HGCSiliconDetId::cellV(), HFNoseDetId::cellV(), DetId::det(), HCALHighEnergyHPDFilter_cfi::energy, h_C1_, h_C2_, h_E_, h_EtaPhi_, h_EtFiZm_, h_EtFiZp_, h_LayerZm_, h_LayerZp_, h_Ly_, h_RZ_, h_T_, h_W1_, h_W2_, h_XY_, hgcons_, hfClusterShapes_cfi::hits, l1ctLayer2EG_cff::id, hit::id, HGCScintillatorDetId::ieta(), ifLayer_, ifNose_, HGCScintillatorDetId::iphi(), HGCScintillatorDetId::layer(), HFNoseDetId::layer(), HGCSiliconDetId::layer(), phase1PixelTopology::layer, layerFront_, Skims_PA_cff::name, hgcalTopologyTester_cfi::sector2, DetId::subdetId(), protons_cff::time, HGCScintillatorDetId::type(), HFNoseDetId::type(), HGCSiliconDetId::type(), HGCalTestNumbering::unpackHexagonIndex(), verbosity_, HGCSiliconDetId::waferU(), HFNoseDetId::waferU(), HGCSiliconDetId::waferV(), HFNoseDetId::waferV(), geometryCSVtoXML::xy, HGCScintillatorDetId::zside(), HFNoseDetId::zside(), HGCSiliconDetId::zside(), and ecaldqm::zside().

Referenced by analyze().

149  {
150  if (verbosity_ > 0)
151  edm::LogVerbatim("HGCalValidation") << name << " with " << hits.size() << " PcaloHit elements";
152 
153  std::map<uint32_t, hitsinfo> map_hits;
154  map_hits.clear();
155 
156  unsigned int nused(0);
157  for (auto const& hit : hits) {
158  double energy = hit.energy();
159  double time = hit.time();
160  uint32_t id = hit.id();
161  int cell, sector, sector2(0), layer, zside;
162  int subdet(0), cell2(0), type(0);
163  HepGeom::Point3D<float> gcoord;
164  std::pair<float, float> xy;
165  if (ifNose_) {
166  HFNoseDetId detId = HFNoseDetId(id);
167  subdet = detId.subdetId();
168  cell = detId.cellU();
169  cell2 = detId.cellV();
170  sector = detId.waferU();
171  sector2 = detId.waferV();
172  type = detId.type();
173  layer = detId.layer();
174  zside = detId.zside();
175  xy = hgcons_[ih]->locateCell(layer, sector, sector2, cell, cell2, false, true);
176  h_W2_[ih]->Fill(sector2);
177  h_C2_[ih]->Fill(cell2);
178  } else if (hgcons_[ih]->waferHexagon8()) {
179  HGCSiliconDetId detId = HGCSiliconDetId(id);
180  subdet = static_cast<int>(detId.det());
181  cell = detId.cellU();
182  cell2 = detId.cellV();
183  sector = detId.waferU();
184  sector2 = detId.waferV();
185  type = detId.type();
186  layer = detId.layer();
187  zside = detId.zside();
188  xy = hgcons_[ih]->locateCell(layer, sector, sector2, cell, cell2, false, true);
189  h_W2_[ih]->Fill(sector2);
190  h_C2_[ih]->Fill(cell2);
191  } else if (hgcons_[ih]->tileTrapezoid()) {
193  subdet = static_cast<int>(detId.det());
194  sector = detId.ieta();
195  cell = detId.iphi();
196  type = detId.type();
197  layer = detId.layer();
198  zside = detId.zside();
199  xy = hgcons_[ih]->locateCellTrap(layer, sector, cell, false);
200  } else {
201  HGCalTestNumbering::unpackHexagonIndex(id, subdet, zside, layer, sector, type, cell);
202  xy = hgcons_[ih]->locateCell(cell, layer, sector, false);
203  }
204  double zp = hgcons_[ih]->waferZ(layer, false);
205  if (zside < 0)
206  zp = -zp;
207  double xp = (zp < 0) ? -xy.first : xy.first;
208  gcoord = HepGeom::Point3D<float>(xp, xy.second, zp);
209  if (verbosity_ > 2)
210  edm::LogVerbatim("HGCalValidation")
211  << "i/p " << subdet << ":" << zside << ":" << layer << ":" << sector << ":" << sector2 << ":" << cell << ":"
212  << cell2 << " o/p " << xy.first << ":" << xy.second << ":" << zp;
213  nused++;
214  double tof = (gcoord.mag() * CLHEP::mm) / CLHEP::c_light;
215  if (verbosity_ > 1)
216  edm::LogVerbatim("HGCalValidation")
217  << "Detector " << name << " zside = " << zside << " layer = " << layer << " type = " << type
218  << " wafer = " << sector << ":" << sector2 << " cell = " << cell << ":" << cell2 << " positon = " << gcoord
219  << " energy = " << energy << " time = " << time << ":" << tof;
220  time -= tof;
221  if (time < 0)
222  time = 0;
223  hitsinfo hinfo;
224  if (map_hits.count(id) != 0) {
225  hinfo = map_hits[id];
226  } else {
227  hinfo.layer = layer + layerFront_[ih];
228  hinfo.phi = gcoord.getPhi();
229  hinfo.eta = gcoord.getEta();
230  hinfo.time = time;
231  }
232  hinfo.energy += energy;
233  map_hits[id] = hinfo;
234 
235  //Fill in histograms
236  h_RZ_[0]->Fill(std::abs(gcoord.z()), gcoord.rho());
237  h_RZ_[ih + 1]->Fill(std::abs(gcoord.z()), gcoord.rho());
238  if (ifLayer_) {
239  if (hinfo.layer <= static_cast<int>(h_XY_.size()))
240  h_XY_[hinfo.layer - 1]->Fill(gcoord.x(), gcoord.y());
241  } else {
242  h_EtaPhi_[0]->Fill(std::abs(hinfo.eta), hinfo.phi);
243  h_EtaPhi_[ih + 1]->Fill(std::abs(hinfo.eta), hinfo.phi);
244  }
245  h_Ly_[ih]->Fill(layer);
246  h_W1_[ih]->Fill(sector);
247  h_C1_[ih]->Fill(cell);
248  }
249  if (verbosity_ > 0)
250  edm::LogVerbatim("HGCalValidation") << name << " with " << map_hits.size() << ":" << nused << " detector elements"
251  << " being hit";
252 
253  for (auto const& hit : map_hits) {
254  hitsinfo hinfo = hit.second;
255  if (verbosity_ > 1)
256  edm::LogVerbatim("HGCalValidation")
257  << " ---------------------- eta = " << hinfo.eta << " phi = " << hinfo.phi << " layer = " << hinfo.layer
258  << " E = " << hinfo.energy << " T = " << hinfo.time;
259  h_E_[0]->Fill(hinfo.energy);
260  h_E_[ih + 1]->Fill(hinfo.energy);
261  h_T_[0]->Fill(hinfo.time);
262  h_T_[ih + 1]->Fill(hinfo.time);
263  if (hinfo.eta > 0) {
264  if (!ifLayer_) {
265  h_EtFiZp_[0]->Fill(std::abs(hinfo.eta), hinfo.phi, hinfo.energy);
266  h_EtFiZp_[ih + 1]->Fill(std::abs(hinfo.eta), hinfo.phi, hinfo.energy);
267  }
268  h_LayerZp_[0]->Fill(hinfo.layer, hinfo.energy);
269  h_LayerZp_[ih + 1]->Fill(hinfo.layer, hinfo.energy);
270  } else {
271  if (!ifLayer_) {
272  h_EtFiZm_[0]->Fill(std::abs(hinfo.eta), hinfo.phi, hinfo.energy);
273  h_EtFiZm_[ih + 1]->Fill(std::abs(hinfo.eta), hinfo.phi, hinfo.energy);
274  }
275  h_LayerZm_[0]->Fill(hinfo.layer, hinfo.energy);
276  h_LayerZm_[ih + 1]->Fill(hinfo.layer, hinfo.energy);
277  }
278  }
279 }
std::vector< TH2D * > h_XY_
Log< level::Info, true > LogVerbatim
std::vector< TH1D * > h_LayerZm_
std::vector< TH2D * > h_RZ_
std::vector< TH1D * > h_T_
std::vector< TH1D * > h_W1_
int layer() const
get the layer #
Definition: HFNoseDetId.h:57
std::vector< TH2D * > h_EtFiZm_
std::vector< int > layerFront_
std::vector< TH1D * > h_C1_
int waferU() const
Definition: HFNoseDetId.h:76
int cellU() const
get the cell #&#39;s in u,v or in x,y
int zside(DetId const &)
int type() const
get/set the type
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr std::array< uint8_t, layerIndexSize > layer
int layer() const
get the layer #
int iphi() const
get the phi index
std::vector< TH1D * > h_LayerZp_
int layer() const
get the layer #
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< TH2D * > h_EtFiZp_
int waferU() const
int cellU() const
get the cell #&#39;s in u,v or in x,y
Definition: HFNoseDetId.h:60
std::vector< TH1D * > h_C2_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
int zside() const
get the z-side of the cell (1/-1)
int type() const
get the type
Definition: HFNoseDetId.h:51
unsigned int id
int waferV() const
int cellV() const
Definition: HFNoseDetId.h:61
int zside() const
get the z-side of the cell (1/-1)
int waferV() const
Definition: HFNoseDetId.h:79
int cellV() const
std::vector< TH1D * > h_Ly_
std::vector< TH1D * > h_E_
int type() const
get the type
std::vector< const HGCalDDDConstants * > hgcons_
std::vector< TH1D * > h_W2_
std::vector< TH2D * > h_EtaPhi_
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
int zside() const
get the z-side of the cell (1/-1)
Definition: HFNoseDetId.h:54

◆ beginJob()

void HGCalSimHitStudy::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 293 of file HGCalSimHitStudy.cc.

References etamax_, etamin_, compareTotals::fs, h_C1_, h_C2_, h_E_, h_EtaPhi_, h_EtFiZm_, h_EtFiZp_, h_LayerZm_, h_LayerZp_, h_Ly_, h_RZ_, h_T_, h_W1_, h_W2_, h_XY_, ifLayer_, M_PI, Skims_PA_cff::name, nameDetectors_, nbinEta_, nbinR_, nbinZ_, nLayers_, rmax_, rmin_, runGCPTkAlMap::title, zmax_, and zmin_.

293  {
295 
296  std::ostringstream name, title;
297  for (unsigned int ih = 0; ih <= nameDetectors_.size(); ++ih) {
298  name.str("");
299  title.str("");
300  if (ih == 0) {
301  name << "RZ_AllDetectors";
302  title << "R vs Z for All Detectors";
303  } else {
304  name << "RZ_" << nameDetectors_[ih - 1];
305  title << "R vs Z for " << nameDetectors_[ih - 1];
306  }
307  h_RZ_.emplace_back(
308  fs->make<TH2D>(name.str().c_str(), title.str().c_str(), nbinZ_, zmin_, zmax_, nbinR_, rmin_, rmax_));
309  if (ifLayer_) {
310  if (ih == 0) {
311  for (int ly = 0; ly < nLayers_; ++ly) {
312  name.str("");
313  title.str("");
314  name << "XY_L" << (ly + 1);
315  title << "Y vs X at Layer " << (ly + 1);
316  h_XY_.emplace_back(
317  fs->make<TH2D>(name.str().c_str(), title.str().c_str(), nbinR_, -rmax_, rmax_, nbinR_, -rmax_, rmax_));
318  }
319  }
320  } else {
321  name.str("");
322  title.str("");
323  if (ih == 0) {
324  name << "EtaPhi_AllDetectors";
325  title << "#phi vs #eta for All Detectors";
326  } else {
327  name << "EtaPhi_" << nameDetectors_[ih - 1];
328  title << "#phi vs #eta for " << nameDetectors_[ih - 1];
329  }
330  h_EtaPhi_.emplace_back(
331  fs->make<TH2D>(name.str().c_str(), title.str().c_str(), nbinEta_, etamin_, etamax_, 200, -M_PI, M_PI));
332  name.str("");
333  title.str("");
334  if (ih == 0) {
335  name << "EtFiZp_AllDetectors";
336  title << "#phi vs #eta (+z) for All Detectors";
337  } else {
338  name << "EtFiZp_" << nameDetectors_[ih - 1];
339  title << "#phi vs #eta (+z) for " << nameDetectors_[ih - 1];
340  }
341  h_EtFiZp_.emplace_back(
342  fs->make<TH2D>(name.str().c_str(), title.str().c_str(), nbinEta_, etamin_, etamax_, 200, -M_PI, M_PI));
343  name.str("");
344  title.str("");
345  if (ih == 0) {
346  name << "EtFiZm_AllDetectors";
347  title << "#phi vs #eta (-z) for All Detectors";
348  } else {
349  name << "EtFiZm_" << nameDetectors_[ih - 1];
350  title << "#phi vs #eta (-z) for " << nameDetectors_[ih - 1];
351  }
352  h_EtFiZm_.emplace_back(
353  fs->make<TH2D>(name.str().c_str(), title.str().c_str(), nbinEta_, etamin_, etamax_, 200, -M_PI, M_PI));
354  }
355  name.str("");
356  title.str("");
357  if (ih == 0) {
358  name << "LayerZp_AllDetectors";
359  title << "Energy vs Layer (+z) for All Detectors";
360  } else {
361  name << "LayerZp_" << nameDetectors_[ih - 1];
362  title << "Energy vs Layer (+z) for " << nameDetectors_[ih - 1];
363  }
364  h_LayerZp_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 60, 0.0, 60.0));
365  name.str("");
366  title.str("");
367  if (ih == 0) {
368  name << "LayerZm_AllDetectors";
369  title << "Energy vs Layer (-z) for All Detectors";
370  } else {
371  name << "LayerZm_" << nameDetectors_[ih - 1];
372  title << "Energy vs Layer (-z) for " << nameDetectors_[ih - 1];
373  }
374  h_LayerZm_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 60, 0.0, 60.0));
375 
376  name.str("");
377  title.str("");
378  if (ih == 0) {
379  name << "E_AllDetectors";
380  title << "Energy Deposit for All Detectors";
381  } else {
382  name << "E_" << nameDetectors_[ih - 1];
383  title << "Energy Deposit for " << nameDetectors_[ih - 1];
384  }
385  h_E_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 1000, 0.0, 1.0));
386 
387  name.str("");
388  title.str("");
389  if (ih == 0) {
390  name << "T_AllDetectors";
391  title << "Time for All Detectors";
392  } else {
393  name << "T_" << nameDetectors_[ih - 1];
394  title << "Time for " << nameDetectors_[ih - 1];
395  }
396  h_T_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 1000, 0.0, 200.0));
397  }
398 
399  for (unsigned int ih = 0; ih < nameDetectors_.size(); ++ih) {
400  name.str("");
401  title.str("");
402  name << "LY_" << nameDetectors_[ih];
403  title << "Layer number for " << nameDetectors_[ih];
404  h_Ly_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 200, 0, 100));
405  if (nameDetectors_[ih] == "HGCalHEScintillatorSensitive") {
406  name.str("");
407  title.str("");
408  name << "IR_" << nameDetectors_[ih];
409  title << "Radius index for " << nameDetectors_[ih];
410  h_W1_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 200, -50, 50));
411  name.str("");
412  title.str("");
413  name << "FI_" << nameDetectors_[ih];
414  title << "#phi index for " << nameDetectors_[ih];
415  h_C1_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 720, 0, 360));
416  } else {
417  name.str("");
418  title.str("");
419  name << "WU_" << nameDetectors_[ih];
420  title << "u index of wafers for " << nameDetectors_[ih];
421  h_W1_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 200, -50, 50));
422  name.str("");
423  title.str("");
424  name << "WV_" << nameDetectors_[ih];
425  title << "v index of wafers for " << nameDetectors_[ih];
426  h_W2_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 100, -50, 50));
427  name.str("");
428  title.str("");
429  name << "CU_" << nameDetectors_[ih];
430  title << "u index of cells for " << nameDetectors_[ih];
431  h_C1_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 100, 0, 50));
432  name.str("");
433  title.str("");
434  name << "CV_" << nameDetectors_[ih];
435  title << "v index of cells for " << nameDetectors_[ih];
436  h_C2_.emplace_back(fs->make<TH1D>(name.str().c_str(), title.str().c_str(), 100, 0, 50));
437  }
438  }
439 }
const std::vector< std::string > nameDetectors_
std::vector< TH2D * > h_XY_
std::vector< TH1D * > h_LayerZm_
std::vector< TH2D * > h_RZ_
std::vector< TH1D * > h_T_
std::vector< TH1D * > h_W1_
std::vector< TH2D * > h_EtFiZm_
std::vector< TH1D * > h_C1_
const double etamin_
const double zmin_
std::vector< TH1D * > h_LayerZp_
std::vector< TH2D * > h_EtFiZp_
std::vector< TH1D * > h_C2_
const double rmin_
#define M_PI
const double etamax_
const double zmax_
const double rmax_
std::vector< TH1D * > h_Ly_
std::vector< TH1D * > h_E_
std::vector< TH1D * > h_W2_
std::vector< TH2D * > h_EtaPhi_

◆ beginRun()

void HGCalSimHitStudy::beginRun ( edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 282 of file HGCalSimHitStudy.cc.

References edm::EventSetup::getData(), hgcons_, dqmdumpme::k, layerFront_, layers_, nameDetectors_, tok_hgcGeom_, and verbosity_.

282  {
283  for (unsigned int k = 0; k < nameDetectors_.size(); ++k) {
284  hgcons_.emplace_back(&iSetup.getData(tok_hgcGeom_[k]));
285  layers_.emplace_back(hgcons_.back()->layers(false));
286  layerFront_.emplace_back(hgcons_.back()->firstLayer());
287  if (verbosity_ > 0)
288  edm::LogVerbatim("HGCalValidation") << nameDetectors_[k] << " defined with " << layers_.back() << " Layers with "
289  << layerFront_.back() << " in front";
290  }
291 }
const std::vector< std::string > nameDetectors_
Log< level::Info, true > LogVerbatim
std::vector< int > layerFront_
std::vector< int > layers_
std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > tok_hgcGeom_
std::vector< const HGCalDDDConstants * > hgcons_

◆ endRun()

void HGCalSimHitStudy::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprotected

Definition at line 62 of file HGCalSimHitStudy.cc.

62 {}

◆ fillDescriptions()

void HGCalSimHitStudy::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 109 of file HGCalSimHitStudy.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, names, and CalibrationSummaryClient_cfi::sources.

109  {
111  std::vector<std::string> names = {"HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"};
112  std::vector<std::string> sources = {"HGCHitsEE", "HGCHitsHEfront", "HGCHitsHEback"};
113  desc.add<std::vector<std::string> >("detectorNames", names);
114  desc.add<std::vector<std::string> >("caloHitSources", sources);
115  desc.addUntracked<double>("rMin", 0.0);
116  desc.addUntracked<double>("rMax", 3000.0);
117  desc.addUntracked<double>("zMin", 3000.0);
118  desc.addUntracked<double>("zMax", 6000.0);
119  desc.addUntracked<double>("etaMin", 1.0);
120  desc.addUntracked<double>("etaMax", 3.0);
121  desc.addUntracked<int>("nBinR", 300);
122  desc.addUntracked<int>("nBinZ", 300);
123  desc.addUntracked<int>("nBinEta", 200);
124  desc.addUntracked<int>("layers", 50);
125  desc.addUntracked<int>("verbosity", 0);
126  desc.addUntracked<bool>("ifNose", false);
127  desc.addUntracked<bool>("ifLayer", false);
128  descriptions.add("hgcalSimHitStudy", desc);
129 }
const std::string names[nVars_]
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ caloHitSources_

const std::vector<std::string> HGCalSimHitStudy::caloHitSources_
private

Definition at line 68 of file HGCalSimHitStudy.cc.

Referenced by HGCalSimHitStudy().

◆ etamax_

const double HGCalSimHitStudy::etamax_
private

Definition at line 70 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ etamin_

const double HGCalSimHitStudy::etamin_
private

Definition at line 70 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ h_C1_

std::vector<TH1D*> HGCalSimHitStudy::h_C1_
private

Definition at line 81 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_C2_

std::vector<TH1D*> HGCalSimHitStudy::h_C2_
private

Definition at line 81 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_E_

std::vector<TH1D*> HGCalSimHitStudy::h_E_
private

Definition at line 80 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_EtaPhi_

std::vector<TH2D*> HGCalSimHitStudy::h_EtaPhi_
private

Definition at line 79 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_EtFiZm_

std::vector<TH2D*> HGCalSimHitStudy::h_EtFiZm_
private

Definition at line 79 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_EtFiZp_

std::vector<TH2D*> HGCalSimHitStudy::h_EtFiZp_
private

Definition at line 79 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_LayerZm_

std::vector<TH1D*> HGCalSimHitStudy::h_LayerZm_
private

Definition at line 80 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_LayerZp_

std::vector<TH1D*> HGCalSimHitStudy::h_LayerZp_
private

Definition at line 80 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_Ly_

std::vector<TH1D*> HGCalSimHitStudy::h_Ly_
private

Definition at line 81 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_RZ_

std::vector<TH2D*> HGCalSimHitStudy::h_RZ_
private

Definition at line 79 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_T_

std::vector<TH1D*> HGCalSimHitStudy::h_T_
private

Definition at line 80 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_W1_

std::vector<TH1D*> HGCalSimHitStudy::h_W1_
private

Definition at line 81 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_W2_

std::vector<TH1D*> HGCalSimHitStudy::h_W2_
private

Definition at line 81 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ h_XY_

std::vector<TH2D*> HGCalSimHitStudy::h_XY_
private

Definition at line 79 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ hgcons_

std::vector<const HGCalDDDConstants*> HGCalSimHitStudy::hgcons_
private

Definition at line 74 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginRun().

◆ ifLayer_

const bool HGCalSimHitStudy::ifLayer_
private

Definition at line 72 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginJob().

◆ ifNose_

const bool HGCalSimHitStudy::ifNose_
private

Definition at line 72 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits().

◆ layerFront_

std::vector<int> HGCalSimHitStudy::layerFront_
private

Definition at line 76 of file HGCalSimHitStudy.cc.

Referenced by analyzeHits(), and beginRun().

◆ layers_

std::vector<int> HGCalSimHitStudy::layers_
private

Definition at line 76 of file HGCalSimHitStudy.cc.

Referenced by beginRun().

◆ nameDetectors_

const std::vector<std::string> HGCalSimHitStudy::nameDetectors_
private

Definition at line 68 of file HGCalSimHitStudy.cc.

Referenced by analyze(), beginJob(), beginRun(), and HGCalSimHitStudy().

◆ nbinEta_

const int HGCalSimHitStudy::nbinEta_
private

Definition at line 71 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ nbinR_

const int HGCalSimHitStudy::nbinR_
private

Definition at line 71 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ nbinZ_

const int HGCalSimHitStudy::nbinZ_
private

Definition at line 71 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ nLayers_

const int HGCalSimHitStudy::nLayers_
private

Definition at line 71 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ rmax_

const double HGCalSimHitStudy::rmax_
private

Definition at line 69 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ rmin_

const double HGCalSimHitStudy::rmin_
private

Definition at line 69 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ tok_hgcGeom_

std::vector<edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord> > HGCalSimHitStudy::tok_hgcGeom_
private

Definition at line 73 of file HGCalSimHitStudy.cc.

Referenced by beginRun(), and HGCalSimHitStudy().

◆ tok_hits_

std::vector<edm::EDGetTokenT<edm::PCaloHitContainer> > HGCalSimHitStudy::tok_hits_
private

Definition at line 75 of file HGCalSimHitStudy.cc.

Referenced by analyze(), and HGCalSimHitStudy().

◆ verbosity_

const int HGCalSimHitStudy::verbosity_
private

Definition at line 71 of file HGCalSimHitStudy.cc.

Referenced by analyze(), analyzeHits(), and beginRun().

◆ zmax_

const double HGCalSimHitStudy::zmax_
private

Definition at line 69 of file HGCalSimHitStudy.cc.

Referenced by beginJob().

◆ zmin_

const double HGCalSimHitStudy::zmin_
private

Definition at line 69 of file HGCalSimHitStudy.cc.

Referenced by beginJob().