CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMHitsValidation Class Reference

#include <GEMHitsValidation.h>

Inheritance diagram for GEMHitsValidation:
GEMBaseValidation DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 GEMHitsValidation (const edm::ParameterSet &)
 
 ~GEMHitsValidation () override
 
- Public Member Functions inherited from GEMBaseValidation
MonitorElementBookHistXY (DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
 
MonitorElementBookHistZR (DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
 
 GEMBaseValidation (const edm::ParameterSet &ps)
 
MonitorElementgetDCEta (DQMStore::IBooker &, const GEMStation *, TString, TString)
 
MonitorElementgetSimpleZR (DQMStore::IBooker &, TString, TString)
 
std::string getStationLabel (int i)
 
std::string getSuffixName (int region, int station, int layer)
 
std::string getSuffixName (int region, int station)
 
std::string getSuffixName (int region)
 
std::string getSuffixTitle (int region, int station, int layer)
 
std::string getSuffixTitle (int region, int station)
 
std::string getSuffixTitle (int region)
 
const GEMGeometryinitGeometry (const edm::EventSetup &)
 
unsigned int nPart ()
 
unsigned int nRegion ()
 
unsigned int nStation ()
 
unsigned int nStationForLabel ()
 
void setNStationForLabel (unsigned int number)
 
 ~GEMBaseValidation () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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
 
ESProxyIndex const * esGetTokenIndices (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::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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

bool detailPlot_
 
MonitorElementgem_sh_eloss [2][3][2]
 
MonitorElementgem_sh_elossMu [2][3][2]
 
std::unordered_map< UInt_t, MonitorElement * > gem_sh_simple_elossMu
 
std::unordered_map< UInt_t, MonitorElement * > gem_sh_simple_tofMu
 
MonitorElementgem_sh_tof [2][3][2]
 
MonitorElementgem_sh_tofMu [2][3][2]
 
MonitorElementgem_sh_xy [2][3][2]
 
std::unordered_map< UInt_t, MonitorElement * > gem_sh_xy_st_ch
 
MonitorElementgem_sh_zr [2][3][2]
 
std::unordered_map< UInt_t, MonitorElement * > Hit_dcEta
 
std::unordered_map< UInt_t, MonitorElement * > Hit_simple_zr
 
edm::EDGetToken InputTagToken_
 
int nBinXY_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 GEMBaseValidation
int nBinXY_
 
std::vector< double > nBinZR_
 
std::vector< double > RangeZR_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 7 of file GEMHitsValidation.h.

Constructor & Destructor Documentation

GEMHitsValidation::GEMHitsValidation ( const edm::ParameterSet cfg)
explicit

Definition at line 7 of file GEMHitsValidation.cc.

References detailPlot_, edm::ParameterSet::getParameter(), and InputTagToken_.

7  : GEMBaseValidation(cfg) {
8  InputTagToken_ = consumes<edm::PSimHitContainer>(cfg.getParameter<edm::InputTag>("simInputLabel"));
9  detailPlot_ = cfg.getParameter<bool>("detailPlot");
10 }
T getParameter(std::string const &) const
GEMBaseValidation(const edm::ParameterSet &ps)
edm::EDGetToken InputTagToken_
GEMHitsValidation::~GEMHitsValidation ( )
override

Definition at line 162 of file GEMHitsValidation.cc.

162 {}

Member Function Documentation

void GEMHitsValidation::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Implements GEMBaseValidation.

Definition at line 164 of file GEMHitsValidation.cc.

References funct::abs(), relativeConstraints::chamber, gather_cfg::cout, detailPlot_, fastSimProducer_cff::energyLoss, dqm::impl::MonitorElement::Fill(), gem_sh_eloss, gem_sh_elossMu, gem_sh_simple_elossMu, gem_sh_simple_tofMu, gem_sh_tof, gem_sh_tofMu, gem_sh_xy, gem_sh_xy_st_ch, gem_sh_zr, edm::Event::getByToken(), GEMBaseValidation::getStationLabel(), GEMBaseValidation::getSuffixName(), Hit_dcEta, Hit_simple_zr, hfClusterShapes_cfi::hits, triggerObjects_cff::id, GEMGeometry::idToDet(), GEMBaseValidation::initGeometry(), InputTagToken_, createfilelist::int, edm::HandleBase::isValid(), LogDebug, PV3DBase< T, PVType, FrameType >::perp(), HLT_2018_cff::region, relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::surface(), spr::timeOfFlight(), and Surface::toGlobal().

164  {
165  const GEMGeometry* GEMGeometry_ = initGeometry(iSetup);
166 
168  e.getByToken(InputTagToken_, GEMHits);
169  if (!GEMHits.isValid()) {
170  edm::LogError("GEMHitsValidation") << "Cannot get GEMHits by Token simInputTagToken";
171  return;
172  }
173 
174  for (auto hits = GEMHits->begin(); hits != GEMHits->end(); hits++) {
175  const GEMDetId id(hits->detUnitId());
176  Int_t region = (Int_t)id.region();
177  Int_t station = (Int_t)id.station();
178  Int_t layer = (Int_t)id.layer();
179  Int_t chamber = (Int_t)id.chamber();
180  Int_t nroll = (Int_t)id.roll();
181 
182  //Int_t even_odd = id.chamber()%2;
183  if (GEMGeometry_->idToDet(GEMDetId(hits->detUnitId())) == nullptr) {
184  std::cout << "simHit did not matched with GEMGeometry." << std::endl;
185  continue;
186  }
187  //const LocalPoint p0(0., 0., 0.);
188  //const GlobalPoint Gp0(GEMGeometry_->idToDet(hits->detUnitId())->surface().toGlobal(p0));
189  const LocalPoint hitLP(hits->localPosition());
190 
191  const GlobalPoint hitGP(GEMGeometry_->idToDet(GEMDetId(hits->detUnitId()))->surface().toGlobal(hitLP));
192  Float_t g_r = hitGP.perp();
193  Float_t g_x = hitGP.x();
194  Float_t g_y = hitGP.y();
195  Float_t g_z = hitGP.z();
196  Float_t energyLoss = hits->energyLoss();
197  Float_t timeOfFlight = hits->timeOfFlight();
198 
199  int layer_num = layer - 1;
200  int binX = (chamber - 1) * 2 + layer_num;
201  int binY = nroll;
202 
203  //const LocalPoint hitEP(hits->entryPoint());
204 
205  TString histname_suffix = getSuffixName(region);
206  TString simple_zr_histname = TString::Format("hit_simple_zr%s", histname_suffix.Data());
207  LogDebug("GEMHitsValidation") << simple_zr_histname << std::endl;
208  Hit_simple_zr[simple_zr_histname.Hash()]->Fill(fabs(g_z), g_r);
209 
210  histname_suffix = getSuffixName(region, station);
211  TString dcEta_histname = TString::Format("hit_dcEta%s", histname_suffix.Data());
212  LogDebug("GEMHitsValidation") << dcEta_histname << std::endl;
213  Hit_dcEta[dcEta_histname.Hash()]->Fill(binX, binY);
214 
215  TString tofMu = TString::Format("gem_sh_simple_tofMuon_st%s", getStationLabel(station).c_str());
216  TString elossMu = TString::Format("gem_sh_simple_energylossMuon_st%s", getStationLabel(station).c_str());
217 
218  if (abs(hits->particleType()) == 13) {
219  LogDebug("GEMHitsValidation") << tofMu << std::endl;
220  gem_sh_simple_tofMu[tofMu.Hash()]->Fill(timeOfFlight);
221  LogDebug("GEMHitsValidation") << elossMu << std::endl;
222  gem_sh_simple_elossMu[elossMu.Hash()]->Fill(energyLoss * 1.e9);
223  }
224 
225  if (detailPlot_) {
226  // First, fill variable has no condition.
227  LogDebug("GEMHitsValidation") << "gzgr" << std::endl;
228  gem_sh_zr[(int)(region / 2. + 0.5)][station - 1][layer_num]->Fill(g_z, g_r);
229  LogDebug("GEMHitsValidation") << "gxgy" << std::endl;
230  gem_sh_xy[(int)(region / 2. + 0.5)][station - 1][layer_num]->Fill(g_x, g_y);
231  gem_sh_tof[(int)(region / 2. + 0.5)][station - 1][layer_num]->Fill(timeOfFlight);
232  gem_sh_eloss[(int)(region / 2. + 0.5)][station - 1][layer_num]->Fill(energyLoss * 1.e9);
233  if (abs(hits->particleType()) == 13) {
234  gem_sh_tofMu[(int)(region / 2. + 0.5)][station - 1][layer_num]->Fill(timeOfFlight);
235  gem_sh_elossMu[(int)(region / 2. + 0.5)][station - 1][layer_num]->Fill(energyLoss * 1.e9);
236  }
237  std::string chamber = "";
238  if (id.chamber() % 2 == 1)
239  chamber = "odd";
240  else
241  chamber = "even";
242  TString hist_name = TString::Format("gem_sh_xy%s", (getSuffixName(id.region(), station) + "_" + chamber).c_str());
243 
244  LogDebug("GEMHitsValidation") << hist_name << std::endl;
245  gem_sh_xy_st_ch[hist_name.Hash()]->Fill(g_x, g_y);
246  }
247  }
248 }
#define LogDebug(id)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
MonitorElement * gem_sh_tof[2][3][2]
T perp() const
Definition: PV3DBase.h:69
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::unordered_map< UInt_t, MonitorElement * > Hit_dcEta
MonitorElement * gem_sh_eloss[2][3][2]
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const GEMGeometry * initGeometry(const edm::EventSetup &)
MonitorElement * gem_sh_zr[2][3][2]
void Fill(long long x)
std::string getSuffixName(int region, int station, int layer)
std::unordered_map< UInt_t, MonitorElement * > gem_sh_simple_tofMu
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:70
std::unordered_map< UInt_t, MonitorElement * > gem_sh_xy_st_ch
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
MonitorElement * gem_sh_tofMu[2][3][2]
MonitorElement * gem_sh_elossMu[2][3][2]
edm::EDGetToken InputTagToken_
std::string getStationLabel(int i)
MonitorElement * gem_sh_xy[2][3][2]
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
Definition: CaloSimInfo.cc:17
std::unordered_map< UInt_t, MonitorElement * > Hit_simple_zr
std::unordered_map< UInt_t, MonitorElement * > gem_sh_simple_elossMu
void GEMHitsValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  Run,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 12 of file GEMHitsValidation.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), GEMBaseValidation::BookHistXY(), GEMBaseValidation::BookHistZR(), gather_cfg::cout, detailPlot_, gem_sh_eloss, gem_sh_elossMu, gem_sh_simple_elossMu, gem_sh_simple_tofMu, gem_sh_tof, gem_sh_tofMu, gem_sh_xy, gem_sh_xy_st_ch, gem_sh_zr, GEMBaseValidation::getDCEta(), GEMBaseValidation::getSimpleZR(), GEMBaseValidation::getStationLabel(), GEMBaseValidation::getSuffixName(), GEMBaseValidation::getSuffixTitle(), Hit_dcEta, Hit_simple_zr, GEMBaseValidation::initGeometry(), createfilelist::int, LogDebug, nBinXY_, GEMBaseValidation::nPart(), GEMBaseValidation::nRegion(), GEMBaseValidation::nStation(), HLT_2018_cff::region, GEMGeometry::regions(), relativeConstraints::ring, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

12  {
13  const GEMGeometry* GEMGeometry_ = initGeometry(iSetup);
14  if (GEMGeometry_ == nullptr) {
15  std::cout << "geometry is wrong! Terminated." << std::endl;
16  return;
17  }
18 
19  ibooker.setCurrentFolder("MuonGEMHitsV/GEMHitsTask");
20  edm::LogInfo("MuonGEMHitsValidation") << "+++ Info : # of region : " << nRegion() << std::endl;
21  edm::LogInfo("MuonGEMHitsValidation") << "+++ Info : # of stations : " << nStation() << std::endl;
22  edm::LogInfo("MuonGEMHitsValidation") << "+++ Info : # of eta partition : " << nPart() << std::endl;
23 
24  LogDebug("MuonGEMHitsValidation") << "+++ Info : finish to get geometry information from ES.\n";
25 
26  LogDebug("MuonGEMHitsValidation") << "+++ Region independant part.\n";
27  // Region independant.
28  for (auto& station : GEMGeometry_->regions()[0]->stations()) {
29  int st = station->station();
30  // TOF and Energy loss part are indepent from Region.
31  // Labeling TOF and Energy loss
32  TString hist_name_for_tofMu = TString::Format("gem_sh_simple_tofMuon_st%s", getStationLabel(st).c_str());
33  TString hist_name_for_elossMu = TString::Format("gem_sh_simple_energylossMuon_st%s", getStationLabel(st).c_str());
34  TString hist_label_for_tofMu = TString::Format(
35  "SimHit TOF(Muon only) station : station %s ; Time of flight [ns] ; entries", getStationLabel(st).c_str());
36  TString hist_label_for_elossMu = TString::Format(
37  "SimHit energy loss(Muon only) : station %s ; Energy loss [eV] ; entries", getStationLabel(st).c_str());
38  // set tof's range.
39  double tof_min, tof_max;
40  if (st == 1) {
41  tof_min = 18;
42  tof_max = 22;
43  } else {
44  tof_min = 26;
45  tof_max = 30;
46  }
47  gem_sh_simple_tofMu[hist_name_for_tofMu.Hash()] =
48  ibooker.book1D(hist_name_for_tofMu.Data(), hist_label_for_tofMu.Data(), 40, tof_min, tof_max);
49  gem_sh_simple_elossMu[hist_name_for_elossMu.Hash()] =
50  ibooker.book1D(hist_name_for_elossMu.Data(), hist_label_for_elossMu.Data(), 60, 0., 6000.);
51  }
52 
53  LogDebug("MuonGEMHitsValidation") << "+++ Region+Station part.\n";
54  // Regions, Region+station
55  for (auto& region : GEMGeometry_->regions()) {
56  int re = region->region();
57  TString title_suffix = getSuffixTitle(re);
58  TString histname_suffix = getSuffixName(re);
59  LogDebug("MuonGEMHitsValidation") << "+++ SimpleZR Occupancy\n";
60  TString simpleZR_title = TString::Format("ZR Occupancy%s; |Z|(cm); R(cm)", title_suffix.Data());
61  TString simpleZR_histname = TString::Format("hit_simple_zr%s", histname_suffix.Data());
62 
63  MonitorElement* simpleZR = getSimpleZR(ibooker, simpleZR_title, simpleZR_histname);
64  if (simpleZR != nullptr) {
65  Hit_simple_zr[simpleZR_histname.Hash()] = simpleZR;
66  }
67 
68  for (auto& station : region->stations()) {
69  int st = station->station();
70  TString title_suffix2 = getSuffixTitle(re, st);
71  TString histname_suffix2 = getSuffixName(re, st);
72  LogDebug("MuonGEMHitsValidation") << "+++ dcEta Occupancy\n";
73  TString dcEta_title =
74  TString::Format("Occupancy for detector component %s;;#eta-partition", title_suffix2.Data());
75  TString dcEta_histname = TString::Format("hit_dcEta%s", histname_suffix2.Data());
76  MonitorElement* dcEta = getDCEta(ibooker, station, dcEta_title, dcEta_histname);
77  if (dcEta != nullptr) {
78  Hit_dcEta[dcEta_histname.Hash()] = dcEta;
79  }
80  }
81  }
82 
83  LogDebug("MuonGEMHitsValidation") << "+++ Begining Detail Plots\n";
84  if (detailPlot_) {
85  for (auto& region : GEMGeometry_->regions()) {
86  for (auto& station : region->stations()) {
87  for (auto& ring : station->rings()) {
88  if (ring->ring() != 1)
89  break; // Only Ring1 is interesting.
90  string name_suffix = getSuffixName(region->region(), station->station());
91  string title_suffix = getSuffixTitle(region->region(), station->station());
92 
93  TString hist_name = TString::Format("gem_sh_xy%s", name_suffix.c_str());
94  TString hist_title = TString::Format("Simhit Global XY Plots at %s", title_suffix.c_str());
95  MonitorElement* temp = ibooker.book2D(
96  (hist_name + "_even").Data(), (hist_title + " even").Data(), nBinXY_, -360, 360, nBinXY_, -360, 360);
97  if (temp != nullptr) {
98  LogDebug("MuonGEMHitsValidation") << "ME can be acquired!";
99  } else {
100  LogDebug("MuonGEMHitsValidation") << "ME can not be acquired!";
101  return;
102  }
103  gem_sh_xy_st_ch[(hist_name + "_even").Hash()] = temp;
104 
105  MonitorElement* temp2 = ibooker.book2D(
106  (hist_name + "_odd").Data(), (hist_title + " odd").Data(), nBinXY_, -360, 360, nBinXY_, -360, 360);
107  if (temp2 != nullptr) {
108  LogDebug("MuonGEMHitsValidation") << "ME can be acquired!";
109  } else {
110  LogDebug("MuonGEMHitsValidation") << "ME can not be acquired!";
111  return;
112  }
113  gem_sh_xy_st_ch[(hist_name + "_odd").Hash()] = temp2;
114  }
115  }
116  }
117  for (unsigned int region_num = 0; region_num < nRegion(); region_num++) {
118  for (unsigned int station_num = 0; station_num < nStation(); station_num++) {
119  for (unsigned int layer_num = 0; layer_num < 2; layer_num++) {
120  gem_sh_zr[region_num][station_num][layer_num] =
121  BookHistZR(ibooker, "gem_sh", "SimHit", region_num, station_num, layer_num);
122  gem_sh_xy[region_num][station_num][layer_num] =
123  BookHistXY(ibooker, "gem_sh", "SimHit", region_num, station_num, layer_num);
124 
125  int re = ((unsigned int)region_num) * 2 - 1;
126  std::string suffixname = getSuffixName(re, station_num + 1, layer_num + 1);
127  std::string suffixtitle = getSuffixTitle(re, station_num + 1, layer_num + 1);
128  std::string hist_name_for_tof = std::string("gem_sh_tof_") + suffixname;
129  std::string hist_name_for_tofMu = std::string("gem_sh_tofMuon_") + suffixname;
130  std::string hist_name_for_eloss = std::string("gem_sh_energyloss_") + suffixname;
131  std::string hist_name_for_elossMu = std::string("gem_sh_energylossMuon_") + suffixname;
132  std::string hist_label_for_xy = "SimHit occupancy : region" + suffixtitle + " ; globalX [cm]; globalY[cm]";
133  std::string hist_label_for_tof = "SimHit TOF : region" + suffixtitle + " ; Time of flight [ns] ; entries";
134  std::string hist_label_for_tofMu =
135  "SimHit TOF(Muon only) : " + suffixtitle + " ; Time of flight [ns] ; entries";
136  std::string hist_label_for_eloss = "SimHit energy loss : " + suffixtitle + " ; Energy loss [eV] ; entries";
137  std::string hist_label_for_elossMu =
138  "SimHit energy loss(Muon only) : " + suffixtitle + " ; Energy loss [eV] ; entries";
139 
140  double tof_min, tof_max;
141  if (station_num == 0) {
142  tof_min = 18;
143  tof_max = 22;
144  } else {
145  tof_min = 26;
146  tof_max = 30;
147  }
148  gem_sh_tof[region_num][station_num][layer_num] =
149  ibooker.book1D(hist_name_for_tof.c_str(), hist_label_for_tof.c_str(), 40, tof_min, tof_max);
150  gem_sh_tofMu[region_num][station_num][layer_num] =
151  ibooker.book1D(hist_name_for_tofMu.c_str(), hist_label_for_tofMu.c_str(), 40, tof_min, tof_max);
152  gem_sh_eloss[region_num][station_num][layer_num] =
153  ibooker.book1D(hist_name_for_eloss.c_str(), hist_label_for_eloss.c_str(), 60, 0., 6000.);
154  gem_sh_elossMu[region_num][station_num][layer_num] =
155  ibooker.book1D(hist_name_for_elossMu.c_str(), hist_label_for_elossMu.c_str(), 60, 0., 6000.);
156  }
157  }
158  }
159  }
160 }
#define LogDebug(id)
unsigned int nRegion()
MonitorElement * gem_sh_tof[2][3][2]
unsigned int nStation()
unsigned int nPart()
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
std::unordered_map< UInt_t, MonitorElement * > Hit_dcEta
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
MonitorElement * gem_sh_eloss[2][3][2]
std::string getSuffixTitle(int region, int station, int layer)
const GEMGeometry * initGeometry(const edm::EventSetup &)
MonitorElement * gem_sh_zr[2][3][2]
std::string getSuffixName(int region, int station, int layer)
MonitorElement * getDCEta(DQMStore::IBooker &, const GEMStation *, TString, TString)
std::unordered_map< UInt_t, MonitorElement * > gem_sh_simple_tofMu
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:30
std::string Hash
Definition: Types.h:43
std::unordered_map< UInt_t, MonitorElement * > gem_sh_xy_st_ch
MonitorElement * gem_sh_tofMu[2][3][2]
MonitorElement * gem_sh_elossMu[2][3][2]
std::string getStationLabel(int i)
MonitorElement * gem_sh_xy[2][3][2]
std::unordered_map< UInt_t, MonitorElement * > Hit_simple_zr
MonitorElement * getSimpleZR(DQMStore::IBooker &, TString, TString)
std::unordered_map< UInt_t, MonitorElement * > gem_sh_simple_elossMu

Member Data Documentation

bool GEMHitsValidation::detailPlot_
private

Definition at line 33 of file GEMHitsValidation.h.

Referenced by analyze(), bookHistograms(), and GEMHitsValidation().

MonitorElement* GEMHitsValidation::gem_sh_eloss[2][3][2]
private

Definition at line 20 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMHitsValidation::gem_sh_elossMu[2][3][2]
private

Definition at line 21 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

std::unordered_map<UInt_t, MonitorElement*> GEMHitsValidation::gem_sh_simple_elossMu
private

Definition at line 29 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

std::unordered_map<UInt_t, MonitorElement*> GEMHitsValidation::gem_sh_simple_tofMu
private

Definition at line 28 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMHitsValidation::gem_sh_tof[2][3][2]
private

Definition at line 18 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMHitsValidation::gem_sh_tofMu[2][3][2]
private

Definition at line 19 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMHitsValidation::gem_sh_xy[2][3][2]
private

Definition at line 16 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

std::unordered_map<UInt_t, MonitorElement*> GEMHitsValidation::gem_sh_xy_st_ch
private

Definition at line 23 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMHitsValidation::gem_sh_zr[2][3][2]
private

Definition at line 17 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

std::unordered_map<UInt_t, MonitorElement*> GEMHitsValidation::Hit_dcEta
private

Definition at line 26 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

std::unordered_map<UInt_t, MonitorElement*> GEMHitsValidation::Hit_simple_zr
private

Definition at line 27 of file GEMHitsValidation.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetToken GEMHitsValidation::InputTagToken_
private

Definition at line 31 of file GEMHitsValidation.h.

Referenced by analyze(), and GEMHitsValidation().

int GEMHitsValidation::nBinXY_
private

Definition at line 32 of file GEMHitsValidation.h.

Referenced by bookHistograms().