CMS 3D CMS Logo

GEMBaseValidation.cc
Go to the documentation of this file.
5 
6 #include <memory>
7 
8 using namespace dqm::impl;
9 
11  : kLogCategory_(log_category) {
12  zr_occ_num_bins_ = ps.getUntrackedParameter<std::vector<Int_t> >("ZROccNumBins");
13  zr_occ_range_ = ps.getUntrackedParameter<std::vector<Double_t> >("ZROccRange");
14  xy_occ_num_bins_ = ps.getUntrackedParameter<Int_t>("XYOccNumBins", 360);
15  // TODO depends on the station.. for detail plots..
16  eta_range_ = ps.getUntrackedParameter<std::vector<Double_t> >("EtaOccRange");
17 
18  detail_plot_ = ps.getParameter<Bool_t>("detailPlot");
19 }
20 
22 
23 Int_t GEMBaseValidation::getDetOccBinX(Int_t chamber_id, Int_t layer_id) { return 2 * chamber_id + layer_id - 2; }
24 
25 Bool_t GEMBaseValidation::isMuonSimHit(const PSimHit& simhit) { return std::abs(simhit.particleType()) == kMuonPDGId_; }
26 
28  Int_t region_id,
29  const char* name_prefix,
30  const char* title_prefix) {
31  auto name_suffix = GEMUtils::getSuffixName(region_id);
32  auto title_suffix = GEMUtils::getSuffixTitle(region_id);
33 
34  TString name = TString::Format("%s_occ_zr%s", name_prefix, name_suffix.Data());
35  TString title = TString::Format("%s ZR Occupancy :%s;|Z| [cm];R [cm]", title_prefix, title_suffix.Data());
36 
37  Double_t station1_xmin = zr_occ_range_[0];
38  Double_t station1_xmax = zr_occ_range_[1];
39  Double_t station2_xmin = zr_occ_range_[4];
40  Double_t station2_xmax = zr_occ_range_[5];
41 
42  std::vector<Double_t> xbins_vector;
43  for (Double_t i = station1_xmin - 1; i < station2_xmax + 1; i += 0.25) {
44  if (i > station1_xmax + 1 and i < station2_xmin - 1)
45  continue;
46  xbins_vector.push_back(i);
47  }
48 
49  Int_t nbinsx = xbins_vector.size() - 1;
50 
51  Int_t nbinsy = zr_occ_num_bins_[2];
52  Double_t ylow = std::min(zr_occ_range_[2], zr_occ_range_[6]);
53  Double_t yup = std::max(zr_occ_range_[3], zr_occ_range_[7]);
54 
55  auto hist = new TH2F(name, title, nbinsx, &xbins_vector[0], nbinsy, ylow, yup);
56  return booker.book2D(name, hist);
57 }
dqm::impl
Definition: MonitorElement.h:74
GEMBaseValidation::zr_occ_range_
std::vector< Double_t > zr_occ_range_
Definition: GEMBaseValidation.h:86
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
Handle.h
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
GEMBaseValidation.h
mps_fire.i
i
Definition: mps_fire.py:428
GEMBaseValidation::xy_occ_num_bins_
Int_t xy_occ_num_bins_
Definition: GEMBaseValidation.h:84
GEMBaseValidation::zr_occ_num_bins_
std::vector< Int_t > zr_occ_num_bins_
Definition: GEMBaseValidation.h:85
MessageLogger.h
GEMBaseValidation::detail_plot_
Bool_t detail_plot_
Definition: GEMBaseValidation.h:88
min
T min(T a, T b)
Definition: MathUtil.h:58
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
GEMUtils::getSuffixName
TString getSuffixName(Int_t region_id)
Definition: GEMValidationUtils.cc:5
GEMBaseValidation::isMuonSimHit
Bool_t isMuonSimHit(const PSimHit &)
Definition: GEMBaseValidation.cc:25
GEMBaseValidation::bookZROccupancy
dqm::impl::MonitorElement * bookZROccupancy(DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
Definition: GEMBaseValidation.cc:27
GEMBaseValidation::~GEMBaseValidation
~GEMBaseValidation() override=0
Definition: GEMBaseValidation.cc:21
compare.hist
hist
Definition: compare.py:376
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMEtaPartitionSpecs.h
edm::ParameterSet
Definition: ParameterSet.h:47
GEMBaseValidation::GEMBaseValidation
GEMBaseValidation(const edm::ParameterSet &, std::string)
Definition: GEMBaseValidation.cc:10
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
GEMBaseValidation::eta_range_
std::vector< Double_t > eta_range_
Definition: GEMBaseValidation.h:87
GEMBaseValidation::kMuonPDGId_
const Int_t kMuonPDGId_
Definition: GEMBaseValidation.h:91
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
GEMUtils::getSuffixTitle
TString getSuffixTitle(Int_t region_id)
Definition: GEMValidationUtils.cc:34
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PSimHit::particleType
int particleType() const
Definition: PSimHit.h:89
dqm::implementation::IBooker
Definition: DQMStore.h:43
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PSimHit
Definition: PSimHit.h:15
GEMBaseValidation::getDetOccBinX
Int_t getDetOccBinX(Int_t chamber_id, Int_t layer_id)
Definition: GEMBaseValidation.cc:23