CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
GEMDQMSource Class Reference
Inheritance diagram for GEMDQMSource:

Public Member Functions

 GEMDQMSource (const edm::ParameterSet &cfg)
 
 ~GEMDQMSource () override
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 

Private Member Functions

int findVFAT (float min_, float max_, float x_, int roll_)
 
const GEMGeometryinitGeometry (edm::EventSetup const &iSetup)
 

Private Attributes

float fGlobXMax_
 
float fGlobXMin_
 
float fGlobYMax_
 
float fGlobYMin_
 
std::vector< GEMChambergemChambers_
 
const GEMGeometryGEMGeometry_
 
int nClusterSizeBinNum_
 
int nIdxFirstStrip_
 
std::unordered_map< UInt_t, MonitorElement * > recGlobalPos
 
std::unordered_map< UInt_t, MonitorElement * > recHitME_
 
std::unordered_map< UInt_t, MonitorElement * > rh_vs_eta_
 
std::unordered_map< UInt_t, MonitorElement * > StripsFired_vs_eta_
 
edm::EDGetToken tagRecHit_
 
std::unordered_map< UInt_t, MonitorElement * > VFAT_vs_ClusterSize_
 

Detailed Description

Definition at line 25 of file GEMDQMSource.cc.

Constructor & Destructor Documentation

◆ GEMDQMSource()

GEMDQMSource::GEMDQMSource ( const edm::ParameterSet cfg)

Definition at line 86 of file GEMDQMSource.cc.

86  {
87  tagRecHit_ = consumes<GEMRecHitCollection>(cfg.getParameter<edm::InputTag>("recHitsInputLabel"));
88 
89  nIdxFirstStrip_ = cfg.getParameter<int>("idxFirstStrip");
90  nClusterSizeBinNum_ = cfg.getParameter<int>("ClusterSizeBinNum");
91 
92  fGlobXMin_ = cfg.getParameter<double>("global_x_bound_min");
93  fGlobXMax_ = cfg.getParameter<double>("global_x_bound_max");
94  fGlobYMin_ = cfg.getParameter<double>("global_y_bound_min");
95  fGlobYMax_ = cfg.getParameter<double>("global_y_bound_max");
96 }

References looper::cfg.

◆ ~GEMDQMSource()

GEMDQMSource::~GEMDQMSource ( )
inlineoverride

Definition at line 28 of file GEMDQMSource.cc.

28 {};

Member Function Documentation

◆ analyze()

void GEMDQMSource::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 196 of file GEMDQMSource.cc.

196  {
197  const GEMGeometry* GEMGeometry_ = initGeometry(eventSetup);
198  if (GEMGeometry_ == nullptr)
199  return;
200 
202  event.getByToken(this->tagRecHit_, gemRecHits);
203  if (!gemRecHits.isValid()) {
204  edm::LogError("GEMDQMSource") << "GEM recHit is not valid.\n";
205  return;
206  }
207  for (const auto& ch : gemChambers_) {
208  GEMDetId cId = ch.id();
209  for (auto roll : ch.etaPartitions()) {
210  GEMDetId rId = roll->id();
211  const auto& recHitsRange = gemRecHits->get(rId);
212  auto gemRecHit = recHitsRange.first;
213  for (auto hit = gemRecHit; hit != recHitsRange.second; ++hit) {
214  Int_t nIdxStrip = hit->firstClusterStrip() + 0.5 * hit->clusterSize() - nIdxFirstStrip_;
215  Int_t nVfat = 8 * ((Int_t)(nIdxStrip / (roll->nstrips() / 3)) + 1) - rId.roll(); // Strip:Start at 0
216  recHitME_[cId]->Fill(nVfat);
217  rh_vs_eta_[cId]->Fill(hit->localPosition().x(), rId.roll());
218  Int_t nCLSOverflow = (hit->clusterSize() <= nClusterSizeBinNum_ ? hit->clusterSize() : nClusterSizeBinNum_);
219  VFAT_vs_ClusterSize_[cId]->Fill(nCLSOverflow, nVfat);
220  for (int i = hit->firstClusterStrip(); i < (hit->firstClusterStrip() + hit->clusterSize()); i++) {
221  StripsFired_vs_eta_[cId]->Fill(i, rId.roll());
222  }
223 
224  GlobalPoint recHitGP = GEMGeometry_->idToDet(hit->gemId())->surface().toGlobal(hit->localPosition());
225  GEMDetId idLayer(rId.region(), rId.ring(), rId.station(), rId.layer(), 0, 0);
226  recGlobalPos[idLayer]->Fill(recHitGP.x(), recHitGP.y());
227  }
228  }
229  }
230 }

References muonGEMRecHitPSet::gemRecHit, gemRecHits_cfi::gemRecHits, mps_fire::i, GEMGeometry::idToDet(), GEMDetId::layer(), GEMDetId::region(), GEMDetId::ring(), GEMDetId::roll(), GEMDetId::station(), GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), hit::x, and PV3DBase< T, PVType, FrameType >::y().

◆ bookHistograms()

void GEMDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 113 of file GEMDQMSource.cc.

113  {
114  std::vector<GEMDetId> listLayerOcc;
115 
116  GEMGeometry_ = initGeometry(iSetup);
117  if (GEMGeometry_ == nullptr)
118  return;
119 
120  const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
121  for (auto sch : superChambers_) {
122  int n_lay = sch->nChambers();
123  for (int l = 0; l < n_lay; l++) {
124  Bool_t bExist = false;
125  for (const auto& ch : gemChambers_)
126  if (ch.id() == sch->chamber(l + 1)->id())
127  bExist = true;
128  if (bExist)
129  continue;
130 
131  gemChambers_.push_back(*sch->chamber(l + 1));
132  }
133  }
134 
135  ibooker.cd();
136  ibooker.setCurrentFolder("GEM/recHit");
137 
138  for (const auto& ch : gemChambers_) {
139  GEMDetId gid = ch.id();
140 
141  std::string strIdxName = "Gemini_" + to_string(gid.chamber()) + "_GE" + (gid.region() > 0 ? "p" : "m") +
142  to_string(gid.station()) + "_" + to_string(gid.layer());
143  std::string strIdxTitle = "GEMINIm" + to_string(gid.chamber()) + " in GE" + (gid.region() > 0 ? "+" : "-") +
144  to_string(gid.station()) + "/" + to_string(gid.layer());
145 
146  std::string strStId = (gid.region() > 0 ? "p" : "m") + std::to_string(gid.station());
147  std::string strStT = (gid.region() > 0 ? "+" : "-") + std::to_string(gid.station());
148 
149  std::string strLa = std::to_string(gid.layer());
150  std::string strCh = std::to_string(gid.chamber());
151 
152  string hName = "recHit_" + strIdxName;
153  string hTitle = "recHit " + strIdxTitle;
154  hTitle += ";VFAT;";
155  recHitME_[gid] = ibooker.book1D(hName, hTitle, 24, 0, 24);
156 
157  string hName_2 = "VFAT_vs_ClusterSize_" + strIdxName;
158  string hTitle_2 = "VFAT vs ClusterSize " + strIdxTitle;
159  hTitle_2 += ";Cluster size;VFAT";
160  VFAT_vs_ClusterSize_[gid] =
161  ibooker.book2D(hName_2, hTitle_2, nClusterSizeBinNum_, 1, nClusterSizeBinNum_ + 1, 24, 0, 24);
162 
163  string hName_fired = "StripFired_" + strIdxName;
164  string hTitle_fired = "StripsFired " + strIdxTitle;
165  hTitle_fired += ";Strip;iEta";
166  StripsFired_vs_eta_[gid] = ibooker.book2D(hName_fired, hTitle_fired, 384, 1, 385, 8, 1, 9);
167 
168  string hName_rh = "recHit_x_" + strIdxName;
169  string hTitle_rh = "recHit local x " + strIdxTitle;
170  hTitle_rh += ";Local x (cm);iEta";
171  rh_vs_eta_[gid] = ibooker.book2D(hName_rh, hTitle_rh, 50, -25, 25, 8, 1, 9);
172 
173  GEMDetId lid(gid.region(), gid.ring(), gid.station(), gid.layer(), 0, 0);
174  Int_t nIdxOcc = 0;
175 
176  for (; nIdxOcc < (Int_t)listLayerOcc.size(); nIdxOcc++)
177  if (listLayerOcc[nIdxOcc] == lid)
178  break;
179  if (nIdxOcc >= (Int_t)listLayerOcc.size())
180  listLayerOcc.push_back(lid);
181  }
182 
183  for (auto gid : listLayerOcc) {
184  std::string strIdxName =
185  std::string("GE") + (gid.region() > 0 ? "p" : "m") + to_string(gid.station()) + "_" + to_string(gid.layer());
186  std::string strIdxTitle =
187  std::string("GE") + (gid.region() > 0 ? "+" : "-") + to_string(gid.station()) + "/" + to_string(gid.layer());
188 
189  string hName_rh = "recHit_globalPos_Gemini_" + strIdxName;
190  string hTitle_rh = "recHit global position Gemini chamber : " + strIdxTitle;
191  hTitle_rh += ";Global X (cm);Global Y (cm)";
192  recGlobalPos[gid] = ibooker.book2D(hName_rh, hTitle_rh, 100, fGlobXMin_, fGlobXMax_, 100, fGlobYMin_, fGlobYMax_);
193  }
194 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), GEMDetId::chamber(), cmsLHEtoEOSManager::l, GEMDetId::layer(), GEMDetId::region(), GEMDetId::ring(), dqm::implementation::NavigatorBase::setCurrentFolder(), GEMDetId::station(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ dqmBeginRun()

void GEMDQMSource::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprotected

Definition at line 32 of file GEMDQMSource.cc.

32 {};

◆ fillDescriptions()

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

Definition at line 98 of file GEMDQMSource.cc.

98  {
100  desc.add<edm::InputTag>("recHitsInputLabel", edm::InputTag("gemRecHits", ""));
101 
102  desc.add<int>("idxFirstStrip", 0);
103  desc.add<int>("ClusterSizeBinNum", 9);
104 
105  desc.add<double>("global_x_bound_min", -350);
106  desc.add<double>("global_x_bound_max", 350);
107  desc.add<double>("global_y_bound_min", -260);
108  desc.add<double>("global_y_bound_max", 260);
109 
110  descriptions.add("GEMDQMSource", desc);
111 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

◆ findVFAT()

int GEMDQMSource::findVFAT ( float  min_,
float  max_,
float  x_,
int  roll_ 
)
private

Definition at line 62 of file GEMDQMSource.cc.

62  {
63  float step = abs(max_ - min_) / 3.0;
64  if (x_ < (min(min_, max_) + step)) {
65  return 8 - roll_;
66  } else if (x_ < (min(min_, max_) + 2.0 * step)) {
67  return 16 - roll_;
68  } else {
69  return 24 - roll_;
70  }
71 }

References funct::abs(), and min().

◆ initGeometry()

const GEMGeometry * GEMDQMSource::initGeometry ( edm::EventSetup const &  iSetup)
private

Definition at line 73 of file GEMDQMSource.cc.

73  {
74  const GEMGeometry* GEMGeometry_ = nullptr;
75  try {
77  iSetup.get<MuonGeometryRecord>().get(hGeom);
78  GEMGeometry_ = &*hGeom;
80  edm::LogError("MuonGEMBaseValidation") << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
81  return nullptr;
82  }
83  return GEMGeometry_;
84 }

References MillePedeFileConverter_cfg::e, edm::EventSetup::get(), and get.

Member Data Documentation

◆ fGlobXMax_

float GEMDQMSource::fGlobXMax_
private

Definition at line 39 of file GEMDQMSource.cc.

◆ fGlobXMin_

float GEMDQMSource::fGlobXMin_
private

Definition at line 39 of file GEMDQMSource.cc.

◆ fGlobYMax_

float GEMDQMSource::fGlobYMax_
private

Definition at line 40 of file GEMDQMSource.cc.

◆ fGlobYMin_

float GEMDQMSource::fGlobYMin_
private

Definition at line 40 of file GEMDQMSource.cc.

◆ gemChambers_

std::vector<GEMChamber> GEMDQMSource::gemChambers_
private

Definition at line 50 of file GEMDQMSource.cc.

◆ GEMGeometry_

const GEMGeometry* GEMDQMSource::GEMGeometry_
private

Definition at line 48 of file GEMDQMSource.cc.

◆ nClusterSizeBinNum_

int GEMDQMSource::nClusterSizeBinNum_
private

Definition at line 43 of file GEMDQMSource.cc.

◆ nIdxFirstStrip_

int GEMDQMSource::nIdxFirstStrip_
private

Definition at line 42 of file GEMDQMSource.cc.

◆ recGlobalPos

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::recGlobalPos
private

Definition at line 56 of file GEMDQMSource.cc.

◆ recHitME_

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::recHitME_
private

Definition at line 52 of file GEMDQMSource.cc.

◆ rh_vs_eta_

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::rh_vs_eta_
private

Definition at line 55 of file GEMDQMSource.cc.

◆ StripsFired_vs_eta_

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::StripsFired_vs_eta_
private

Definition at line 54 of file GEMDQMSource.cc.

◆ tagRecHit_

edm::EDGetToken GEMDQMSource::tagRecHit_
private

Definition at line 37 of file GEMDQMSource.cc.

◆ VFAT_vs_ClusterSize_

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::VFAT_vs_ClusterSize_
private

Definition at line 53 of file GEMDQMSource.cc.

mps_fire.i
i
Definition: mps_fire.py:428
muonGEMRecHitPSet.gemRecHit
gemRecHit
Definition: muonGEMRecHitPSet.py:3
GEMDetId::ring
constexpr int ring() const
Definition: GEMDetId.h:173
GEMDQMSource::nIdxFirstStrip_
int nIdxFirstStrip_
Definition: GEMDQMSource.cc:42
step
step
Definition: StallMonitor.cc:94
GEMDetId::layer
constexpr int layer() const
Definition: GEMDetId.h:187
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
min
T min(T a, T b)
Definition: MathUtil.h:58
GEMGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:25
GEMDetId::region
constexpr int region() const
Definition: GEMDetId.h:168
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
GEMDQMSource::StripsFired_vs_eta_
std::unordered_map< UInt_t, MonitorElement * > StripsFired_vs_eta_
Definition: GEMDQMSource.cc:54
edm::Handle< GEMRecHitCollection >
GEMDQMSource::nClusterSizeBinNum_
int nClusterSizeBinNum_
Definition: GEMDQMSource.cc:43
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GEMDQMSource::tagRecHit_
edm::EDGetToken tagRecHit_
Definition: GEMDQMSource.cc:37
edm::ESHandle< GEMGeometry >
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
GEMDQMSource::GEMGeometry_
const GEMGeometry * GEMGeometry_
Definition: GEMDQMSource.cc:48
Point3DBase< float, GlobalTag >
GEMDQMSource::fGlobYMax_
float fGlobYMax_
Definition: GEMDQMSource.cc:40
GEMDQMSource::rh_vs_eta_
std::unordered_map< UInt_t, MonitorElement * > rh_vs_eta_
Definition: GEMDQMSource.cc:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMDQMSource::initGeometry
const GEMGeometry * initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMSource.cc:73
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:180
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
GEMDQMSource::fGlobXMax_
float fGlobXMax_
Definition: GEMDQMSource.cc:39
GEMDetId::roll
constexpr int roll() const
Definition: GEMDetId.h:191
GEMDetId
Definition: GEMDetId.h:18
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GEMDQMSource::fGlobXMin_
float fGlobXMin_
Definition: GEMDQMSource.cc:39
GEMDQMSource::recGlobalPos
std::unordered_map< UInt_t, MonitorElement * > recGlobalPos
Definition: GEMDQMSource.cc:56
GEMDQMSource::fGlobYMin_
float fGlobYMin_
Definition: GEMDQMSource.cc:40
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
looper.cfg
cfg
Definition: looper.py:297
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
edm::eventsetup::NoProxyException
Definition: NoProxyException.h:31
GEMDetId::station
constexpr int station() const
Definition: GEMDetId.h:176
GEMGeometry
Definition: GEMGeometry.h:24
GEMDQMSource::VFAT_vs_ClusterSize_
std::unordered_map< UInt_t, MonitorElement * > VFAT_vs_ClusterSize_
Definition: GEMDQMSource.cc:53
gemRecHits_cfi.gemRecHits
gemRecHits
Definition: gemRecHits_cfi.py:7
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GEMGeometry::superChambers
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:36
GEMDQMSource::gemChambers_
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMSource.cc:50
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
GEMDQMSource::recHitME_
std::unordered_map< UInt_t, MonitorElement * > recHitME_
Definition: GEMDQMSource.cc:52
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37