CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
GEMBaseValidation Class Referenceabstract

#include <GEMBaseValidation.h>

Inheritance diagram for GEMBaseValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator > GEMCoPadDigiValidation GEMPadDigiClusterValidation GEMPadDigiValidation GEMRecHitValidation GEMSimHitValidation GEMStripDigiValidation

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override=0
 
 GEMBaseValidation (const edm::ParameterSet &, std::string)
 
 ~GEMBaseValidation () override=0
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Protected Member Functions

template<typename T >
dqm::impl::MonitorElementbookDetectorOccupancy (DQMStore::IBooker &booker, const T &key, const GEMStation *station, const char *name_prfix, const char *title_prefix)
 
template<typename T >
dqm::impl::MonitorElementbookHist1D (DQMStore::IBooker &booker, const T &key, const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *x_title="", const char *y_title="Entries")
 
template<typename T >
dqm::impl::MonitorElementbookHist2D (DQMStore::IBooker &booker, const T &key, const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup, const char *x_title="", const char *y_title="")
 
template<typename T >
dqm::impl::MonitorElementbookPIDHist (DQMStore::IBooker &booker, const T &key, const char *name, const char *title)
 
template<typename T >
dqm::impl::MonitorElementbookPIDHist (DQMStore::IBooker &booker, const T &key, Int_t ieta, const char *name, const char *title)
 
template<typename T >
dqm::impl::MonitorElementbookPolarOccupancy (DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
 
template<typename T >
dqm::impl::MonitorElementbookXYOccupancy (DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
 
dqm::impl::MonitorElementbookZROccupancy (DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
 
template<typename T >
dqm::impl::MonitorElementbookZROccupancy (DQMStore::IBooker &booker, const T &key, const char *name_prfix, const char *title_prefix)
 
Int_t getDetOccBinX (Int_t num_layers, Int_t chamber_id, Int_t layer_id)
 
Int_t getPidIdx (Int_t pid)
 
Bool_t isMuonSimHit (const PSimHit &)
 
Float_t toDegree (Float_t radian)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Protected Attributes

Bool_t detail_plot_
 
std::vector< Double_t > eta_range_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomToken_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomTokenBeginRun_
 
const std::string kLogCategory_
 
const Int_t kMuonPDGId_ = 13
 
std::vector< Int_t > pid_list_
 
Int_t xy_occ_num_bins_
 
std::vector< Int_t > zr_occ_num_bins_
 
std::vector< Double_t > zr_occ_range_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Detailed Description

Definition at line 19 of file GEMBaseValidation.h.

Constructor & Destructor Documentation

◆ GEMBaseValidation()

GEMBaseValidation::GEMBaseValidation ( const edm::ParameterSet ps,
std::string  log_category 
)
explicit

Definition at line 10 of file GEMBaseValidation.cc.

References detail_plot_, eta_range_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), pid_list_, xy_occ_num_bins_, zr_occ_num_bins_, and zr_occ_range_.

11  : kLogCategory_(log_category) {
12  pid_list_ = ps.getUntrackedParameter<std::vector<Int_t> >("pidList");
13  zr_occ_num_bins_ = ps.getUntrackedParameter<std::vector<Int_t> >("ZROccNumBins");
14  zr_occ_range_ = ps.getUntrackedParameter<std::vector<Double_t> >("ZROccRange");
15  xy_occ_num_bins_ = ps.getUntrackedParameter<Int_t>("XYOccNumBins", 360);
16  // TODO depends on the station.. for detail plots..
17  eta_range_ = ps.getUntrackedParameter<std::vector<Double_t> >("EtaOccRange");
18 
19  detail_plot_ = ps.getParameter<Bool_t>("detailPlot");
20 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< Int_t > zr_occ_num_bins_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< Int_t > pid_list_
std::vector< Double_t > eta_range_
std::vector< Double_t > zr_occ_range_
const std::string kLogCategory_

◆ ~GEMBaseValidation()

GEMBaseValidation::~GEMBaseValidation ( )
overridepure virtual

Definition at line 22 of file GEMBaseValidation.cc.

22 {}

Member Function Documentation

◆ analyze()

void GEMBaseValidation::analyze ( const edm::Event e,
const edm::EventSetup  
)
overridepure virtual

◆ bookDetectorOccupancy()

template<typename T >
dqm::impl::MonitorElement * GEMBaseValidation::bookDetectorOccupancy ( DQMStore::IBooker booker,
const T key,
const GEMStation station,
const char *  name_prfix,
const char *  title_prefix 
)
protected

Definition at line 172 of file GEMBaseValidation.h.

References newFWLiteAna::bin, dqm::implementation::IBooker::book2D(), getDetOccBinX(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), gpuVertexFinder::hist, crabWrapper::key, label, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, totemT2DQMSource_cfi::nbinsy, relativeConstraints::station, and runGCPTkAlMap::title.

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMRecHitValidation::bookHistograms(), GEMSimHitValidation::bookHistograms(), GEMStripDigiValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMPadDigiClusterValidation::bookHistograms().

176  {
177  auto name_suffix = GEMUtils::getSuffixName(key);
178  auto title_suffix = GEMUtils::getSuffixTitle(key);
179 
180  TString name = TString::Format("%s_occ_det%s", name_prefix, name_suffix.Data());
181  TString title = TString::Format("%s Occupancy for detector component :%s", title_prefix, title_suffix.Data());
182 
183  std::vector<const GEMSuperChamber*> superchambers = station->superChambers();
184 
185  Int_t num_superchambers = superchambers.size();
186  Int_t num_chambers = 0;
187  Int_t nbinsy = 0;
188  if (num_superchambers > 0) {
189  num_chambers = superchambers.front()->nChambers();
190  if (num_chambers > 0)
191  nbinsy = superchambers.front()->chambers().front()->nEtaPartitions();
192  }
193  Int_t nbinsx = num_superchambers * num_chambers;
194 
195  if (nbinsx <= 0)
196  nbinsx = 20; // Ensure histogram is not zero size
197  if (nbinsy <= 0)
198  nbinsy = 20;
199  auto hist = new TH2F(name, title, nbinsx, 1 - 0.5, nbinsx + 0.5, nbinsy, 1 - 0.5, nbinsy + 0.5);
200  hist->GetXaxis()->SetTitle("Chamber-Layer");
201  hist->GetYaxis()->SetTitle("Eta Partition");
202 
203  TAxis* x_axis = hist->GetXaxis();
204  for (Int_t chamber_id = 1; chamber_id <= num_superchambers; chamber_id++) {
205  for (Int_t layer_id = 1; layer_id <= num_chambers; layer_id++) {
206  Int_t bin = getDetOccBinX(num_chambers, chamber_id, layer_id);
207  TString label = TString::Format("C%dL%d", chamber_id, layer_id);
208  x_axis->SetBinLabel(bin, label);
209  }
210  }
211 
212  TAxis* y_axis = hist->GetYaxis();
213  for (Int_t bin = 1; bin <= nbinsy; bin++) {
214  y_axis->SetBinLabel(bin, TString::Itoa(bin, 10));
215  }
216 
217  return booker.book2D(name, hist);
218 }
TString getSuffixName(Int_t region_id)
TString getSuffixTitle(Int_t region_id)
char const * label
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:212
Int_t getDetOccBinX(Int_t num_layers, Int_t chamber_id, Int_t layer_id)

◆ bookHist1D()

template<typename T >
dqm::impl::MonitorElement * GEMBaseValidation::bookHist1D ( DQMStore::IBooker booker,
const T key,
const char *  name,
const char *  title,
Int_t  nbinsx,
Double_t  xlow,
Double_t  xup,
const char *  x_title = "",
const char *  y_title = "Entries" 
)
protected

Definition at line 266 of file GEMBaseValidation.h.

References dqm::implementation::IBooker::book1D(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), crabWrapper::key, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, and runGCPTkAlMap::title.

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMRecHitValidation::bookHistograms(), GEMSimHitValidation::bookHistograms(), GEMStripDigiValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMPadDigiClusterValidation::bookHistograms().

274  {
275  auto name_suffix = GEMUtils::getSuffixName(key);
276  auto title_suffix = GEMUtils::getSuffixTitle(key);
277  TString hist_name = TString::Format("%s%s", name, name_suffix.Data());
278  TString hist_title = TString::Format("%s :%s;%s;%s", title, title_suffix.Data(), x_title, y_title);
279  return booker.book1D(hist_name, hist_title, nbinsx, xlow, xup);
280 }
TString getSuffixName(Int_t region_id)
TString getSuffixTitle(Int_t region_id)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ bookHist2D()

template<typename T >
dqm::impl::MonitorElement * GEMBaseValidation::bookHist2D ( DQMStore::IBooker booker,
const T key,
const char *  name,
const char *  title,
Int_t  nbinsx,
Double_t  xlow,
Double_t  xup,
Int_t  nbinsy,
Double_t  ylow,
Double_t  yup,
const char *  x_title = "",
const char *  y_title = "" 
)
protected

Definition at line 283 of file GEMBaseValidation.h.

References dqm::implementation::IBooker::book2D(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), crabWrapper::key, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, totemT2DQMSource_cfi::nbinsy, and runGCPTkAlMap::title.

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMPadDigiClusterValidation::bookHistograms().

294  {
295  auto name_suffix = GEMUtils::getSuffixName(key);
296  auto title_suffix = GEMUtils::getSuffixTitle(key);
297  TString hist_name = TString::Format("%s%s", name, name_suffix.Data());
298  TString hist_title = TString::Format("%s :%s;%s;%s", title, title_suffix.Data(), x_title, y_title);
299  return booker.book2D(hist_name, hist_title, nbinsx, xlow, xup, nbinsy, ylow, yup);
300 }
TString getSuffixName(Int_t region_id)
TString getSuffixTitle(Int_t region_id)
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:212

◆ bookPIDHist() [1/2]

template<typename T >
dqm::impl::MonitorElement * GEMBaseValidation::bookPIDHist ( DQMStore::IBooker booker,
const T key,
const char *  name,
const char *  title 
)
protected

Definition at line 221 of file GEMBaseValidation.h.

References newFWLiteAna::bin, dqm::implementation::IBooker::book1D(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), gpuVertexFinder::hist, heavyIonCSV_trainingSettings::idx, crabWrapper::key, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, pid_list_, and runGCPTkAlMap::title.

Referenced by GEMRecHitValidation::bookHistograms(), GEMStripDigiValidation::bookHistograms(), and GEMSimHitValidation::bookHistograms().

224  {
225  auto name_suffix = GEMUtils::getSuffixName(key);
226  auto title_suffix = GEMUtils::getSuffixTitle(key);
227  TString x_title = "Particle Type";
228  TString y_title = "Particles";
229  TString hist_name = TString::Format("%s%s", name, name_suffix.Data());
230  TString hist_title = TString::Format("%s :%s;%s;%s", title, title_suffix.Data(), x_title.Data(), y_title.Data());
231  Int_t nbinsx = pid_list_.size();
232  auto hist = booker.book1D(hist_name, hist_title, nbinsx + 1, 0, nbinsx + 1);
233  TDatabasePDG* pdgDB = TDatabasePDG::Instance();
234  for (Int_t idx = 0; idx < nbinsx; idx++) {
235  Int_t bin = idx + 1;
236  auto particle_name = pdgDB->GetParticle(pid_list_[idx])->GetName();
237  hist->setBinLabel(bin, particle_name);
238  }
239  hist->setBinLabel(nbinsx + 1, "others");
240  return hist;
241 }
TString getSuffixName(Int_t region_id)
TString getSuffixTitle(Int_t region_id)
std::vector< Int_t > pid_list_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ bookPIDHist() [2/2]

template<typename T >
dqm::impl::MonitorElement * GEMBaseValidation::bookPIDHist ( DQMStore::IBooker booker,
const T key,
Int_t  ieta,
const char *  name,
const char *  title 
)
protected

Definition at line 244 of file GEMBaseValidation.h.

References newFWLiteAna::bin, dqm::implementation::IBooker::book1D(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), gpuVertexFinder::hist, heavyIonCSV_trainingSettings::idx, LEDCalibrationChannels::ieta, crabWrapper::key, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, pid_list_, and runGCPTkAlMap::title.

245  {
246  auto name_suffix = GEMUtils::getSuffixName(key);
247  auto title_suffix = GEMUtils::getSuffixTitle(key);
248  TString x_title = "Particle Type";
249  TString y_title = "Particles";
250  TString hist_name = TString::Format("%s%s-E%d", name, name_suffix.Data(), ieta);
251  TString hist_title =
252  TString::Format("%s :%s-E%d;%s;%s", title, title_suffix.Data(), ieta, x_title.Data(), y_title.Data());
253  Int_t nbinsx = pid_list_.size();
254  auto hist = booker.book1D(hist_name, hist_title, nbinsx + 1, 0, nbinsx + 1);
255  TDatabasePDG* pdgDB = TDatabasePDG::Instance();
256  for (Int_t idx = 0; idx < nbinsx; idx++) {
257  Int_t bin = idx + 1;
258  auto particle_name = pdgDB->GetParticle(pid_list_[idx])->GetName();
259  hist->setBinLabel(bin, particle_name);
260  }
261  hist->setBinLabel(nbinsx + 1, "others");
262  return hist;
263 }
TString getSuffixName(Int_t region_id)
TString getSuffixTitle(Int_t region_id)
std::vector< Int_t > pid_list_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ bookPolarOccupancy()

template<typename T >
dqm::impl::MonitorElement * GEMBaseValidation::bookPolarOccupancy ( DQMStore::IBooker booker,
const T key,
const char *  name_prefix,
const char *  title_prefix 
)
protected

Definition at line 157 of file GEMBaseValidation.h.

References dqm::implementation::IBooker::book2D(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), crabWrapper::key, M_PI, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, and runGCPTkAlMap::title.

Referenced by GEMRecHitValidation::bookHistograms().

160  {
161  auto name_suffix = GEMUtils::getSuffixName(key);
162  auto title_suffix = GEMUtils::getSuffixTitle(key);
163  TString name = TString::Format("%s_occ_polar%s", name_prefix, name_suffix.Data());
164  TString title = TString::Format("%s Polar Occupancy :%s", title_prefix, title_suffix.Data());
165  // TODO # of bins
166  // TODO the x-axis lies in the cnter of Ch1
167  dqm::impl::MonitorElement* me = booker.book2D(name, title, 108, -M_PI, M_PI, 108, 0.0, 360.0);
168  return me;
169 }
TString getSuffixName(Int_t region_id)
TString getSuffixTitle(Int_t region_id)
#define M_PI
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:212

◆ bookXYOccupancy()

template<typename T >
dqm::impl::MonitorElement * GEMBaseValidation::bookXYOccupancy ( DQMStore::IBooker booker,
const T key,
const char *  name_prefix,
const char *  title_prefix 
)
protected

Definition at line 145 of file GEMBaseValidation.h.

References dqm::implementation::IBooker::book2D(), f, GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), crabWrapper::key, Skims_PA_cff::name, runGCPTkAlMap::title, and xy_occ_num_bins_.

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMRecHitValidation::bookHistograms(), GEMSimHitValidation::bookHistograms(), GEMStripDigiValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMPadDigiClusterValidation::bookHistograms().

148  {
149  auto name_suffix = GEMUtils::getSuffixName(key);
150  auto title_suffix = GEMUtils::getSuffixTitle(key);
151  TString name = TString::Format("%s_occ_xy%s", name_prefix, name_suffix.Data());
152  TString title = TString::Format("%s XY Occupancy :%s;X [cm];Y [cm]", title_prefix, title_suffix.Data());
153  return booker.book2D(name, title, xy_occ_num_bins_, -360.0, 360.0, xy_occ_num_bins_, -360.0f, 360.0);
154 }
TString getSuffixName(Int_t region_id)
TString getSuffixTitle(Int_t region_id)
double f[11][100]
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:212

◆ bookZROccupancy() [1/2]

MonitorElement * GEMBaseValidation::bookZROccupancy ( DQMStore::IBooker booker,
Int_t  region_id,
const char *  name_prfix,
const char *  title_prefix 
)
protected

Definition at line 42 of file GEMBaseValidation.cc.

References dqm::implementation::IBooker::book2D(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), gpuVertexFinder::hist, mps_fire::i, SiStripPI::max, SiStripPI::min, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, totemT2DQMSource_cfi::nbinsy, runGCPTkAlMap::title, zr_occ_num_bins_, and zr_occ_range_.

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMRecHitValidation::bookHistograms(), GEMSimHitValidation::bookHistograms(), GEMStripDigiValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMPadDigiClusterValidation::bookHistograms().

45  {
46  auto name_suffix = GEMUtils::getSuffixName(region_id);
47  auto title_suffix = GEMUtils::getSuffixTitle(region_id);
48 
49  TString name = TString::Format("%s_occ_zr%s", name_prefix, name_suffix.Data());
50  TString title = TString::Format("%s ZR Occupancy :%s;|Z| [cm];R [cm]", title_prefix, title_suffix.Data());
51 
52  Double_t station0_xmin = zr_occ_range_[0];
53  Double_t station0_xmax = zr_occ_range_[1];
54  Double_t station1_xmin = zr_occ_range_[4];
55  Double_t station1_xmax = zr_occ_range_[5];
56  Double_t station2_xmin = zr_occ_range_[8];
57  Double_t station2_xmax = zr_occ_range_[9];
58 
59  std::vector<Double_t> xbins_vector;
60  for (Double_t i = station0_xmin - 1; i < station2_xmax + 1; i += 0.25) {
61  if (i > station0_xmax + 1 and i < station1_xmin - 1)
62  continue;
63  if (i > station1_xmax + 1 and i < station2_xmin - 1)
64  continue;
65  xbins_vector.push_back(i);
66  }
67 
68  Int_t nbinsx = xbins_vector.size() - 1;
69 
70  Int_t nbinsy = zr_occ_num_bins_[2];
71  Double_t ylow = std::min(zr_occ_range_[2], std::min(zr_occ_range_[6], zr_occ_range_[10]));
72  Double_t yup = std::max(zr_occ_range_[3], std::max(zr_occ_range_[7], zr_occ_range_[11]));
73 
74  auto hist = new TH2F(name, title, nbinsx, &xbins_vector[0], nbinsy, ylow, yup);
75  return booker.book2D(name, hist);
76 }
TString getSuffixName(Int_t region_id)
std::vector< Int_t > zr_occ_num_bins_
TString getSuffixTitle(Int_t region_id)
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:212
std::vector< Double_t > zr_occ_range_

◆ bookZROccupancy() [2/2]

template<typename T >
dqm::impl::MonitorElement * GEMBaseValidation::bookZROccupancy ( DQMStore::IBooker booker,
const T key,
const char *  name_prfix,
const char *  title_prefix 
)
protected

Definition at line 109 of file GEMBaseValidation.h.

References dqm::implementation::IBooker::book2D(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), crabWrapper::key, kLogCategory_, Skims_PA_cff::name, totemT2DQMSource_cfi::nbinsx, totemT2DQMSource_cfi::nbinsy, runGCPTkAlMap::title, relativeConstraints::value, zr_occ_num_bins_, and zr_occ_range_.

112  {
113  if (std::tuple_size<T>::value < 2) {
114  edm::LogError(kLogCategory_) << "Wrong T" << std::endl;
115  return nullptr;
116  }
117 
118  Int_t station_id = std::get<1>(key);
119 
120  auto name_suffix = GEMUtils::getSuffixName(key);
121  auto title_suffix = GEMUtils::getSuffixTitle(key);
122 
123  TString name = TString::Format("%s_occ_zr%s", name_prefix, name_suffix.Data());
124  TString title = TString::Format("%s ZR Occupancy :%s;|Z| #[cm];R [cm]", title_prefix, title_suffix.Data());
125 
126  // NOTE currently, only GE11 and GE21 are considered.
127  // Look Validation/MuonGEMHits/python/MuonGEMCommonParameters_cfi.py
128  UInt_t nbins_start = 2 * (station_id - 1);
129  Int_t nbinsx = zr_occ_num_bins_[nbins_start];
130  Int_t nbinsy = zr_occ_num_bins_[nbins_start + 1];
131 
132  // st1 xmin xmax, ymin, ymax | st2 xmin, xmax, ymin ymax
133  UInt_t range_start = 4 * (station_id - 1);
134  // absolute z axis
135  Double_t xlow = zr_occ_range_[range_start];
136  Double_t xup = zr_occ_range_[range_start + 1];
137  // R axis
138  Double_t ylow = zr_occ_range_[range_start + 2];
139  Double_t yup = zr_occ_range_[range_start + 3];
140 
141  return booker.book2D(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup);
142 }
TString getSuffixName(Int_t region_id)
std::vector< Int_t > zr_occ_num_bins_
Log< level::Error, false > LogError
TString getSuffixTitle(Int_t region_id)
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:212
std::vector< Double_t > zr_occ_range_
const std::string kLogCategory_

◆ getDetOccBinX()

Int_t GEMBaseValidation::getDetOccBinX ( Int_t  num_layers,
Int_t  chamber_id,
Int_t  layer_id 
)
protected

◆ getPidIdx()

Int_t GEMBaseValidation::getPidIdx ( Int_t  pid)
protected

Definition at line 38 of file GEMBaseValidation.cc.

References spr::find(), and pid_list_.

Referenced by GEMStripDigiValidation::analyze(), GEMRecHitValidation::analyze(), and GEMSimHitValidation::analyze().

38  {
39  return std::find(pid_list_.begin(), pid_list_.end(), pid) - pid_list_.begin();
40 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< Int_t > pid_list_

◆ isMuonSimHit()

Bool_t GEMBaseValidation::isMuonSimHit ( const PSimHit simhit)
protected

◆ toDegree()

Float_t GEMBaseValidation::toDegree ( Float_t  radian)
protected

Definition at line 30 of file GEMBaseValidation.cc.

References M_PI.

Referenced by GEMPadDigiClusterValidation::analyze(), GEMPadDigiValidation::analyze(), GEMStripDigiValidation::analyze(), GEMRecHitValidation::analyze(), and GEMSimHitValidation::analyze().

30  {
31  Float_t degree = radian / M_PI * 180;
32  if (degree < -5)
33  return degree + 360;
34  else
35  return degree;
36 }
#define M_PI

Member Data Documentation

◆ detail_plot_

Bool_t GEMBaseValidation::detail_plot_
protected

◆ eta_range_

std::vector<Double_t> GEMBaseValidation::eta_range_
protected

◆ geomToken_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMBaseValidation::geomToken_
protected

Definition at line 104 of file GEMBaseValidation.h.

◆ geomTokenBeginRun_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMBaseValidation::geomTokenBeginRun_
protected

Definition at line 105 of file GEMBaseValidation.h.

◆ kLogCategory_

const std::string GEMBaseValidation::kLogCategory_
protected

◆ kMuonPDGId_

const Int_t GEMBaseValidation::kMuonPDGId_ = 13
protected

Definition at line 102 of file GEMBaseValidation.h.

Referenced by isMuonSimHit().

◆ pid_list_

std::vector<Int_t> GEMBaseValidation::pid_list_
protected

Definition at line 95 of file GEMBaseValidation.h.

Referenced by bookPIDHist(), GEMBaseValidation(), and getPidIdx().

◆ xy_occ_num_bins_

Int_t GEMBaseValidation::xy_occ_num_bins_
protected

Definition at line 94 of file GEMBaseValidation.h.

Referenced by bookXYOccupancy(), and GEMBaseValidation().

◆ zr_occ_num_bins_

std::vector<Int_t> GEMBaseValidation::zr_occ_num_bins_
protected

Definition at line 96 of file GEMBaseValidation.h.

Referenced by bookZROccupancy(), and GEMBaseValidation().

◆ zr_occ_range_

std::vector<Double_t> GEMBaseValidation::zr_occ_range_
protected

Definition at line 97 of file GEMBaseValidation.h.

Referenced by bookZROccupancy(), and GEMBaseValidation().