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 
24  edm::ESHandle<GEMGeometry> geom_handle;
25  setup.get<MuonGeometryRecord>().get(geom_handle);
26  const GEMGeometry* gem = &*geom_handle;
27  return gem;
28 }
29 
30 Int_t GEMBaseValidation::getDetOccBinX(Int_t chamber_id, Int_t layer_id) { return 2 * chamber_id + layer_id - 2; }
31 
32 Bool_t GEMBaseValidation::isMuonSimHit(const PSimHit& simhit) { return std::abs(simhit.particleType()) == kMuonPDGId_; }
33 
35  Int_t region_id,
36  const char* name_prefix,
37  const char* title_prefix) {
38  auto name_suffix = GEMUtils::getSuffixName(region_id);
39  auto title_suffix = GEMUtils::getSuffixTitle(region_id);
40 
41  TString name = TString::Format("%s_occ_zr%s", name_prefix, name_suffix.Data());
42  TString title = TString::Format("%s ZR Occupancy :%s;|Z| [cm];R [cm]", title_prefix, title_suffix.Data());
43 
44  Double_t station1_xmin = zr_occ_range_[0];
45  Double_t station1_xmax = zr_occ_range_[1];
46  Double_t station2_xmin = zr_occ_range_[4];
47  Double_t station2_xmax = zr_occ_range_[5];
48 
49  std::vector<Double_t> xbins_vector;
50  for (Double_t i = station1_xmin - 1; i < station2_xmax + 1; i += 0.25) {
51  if (i > station1_xmax + 1 and i < station2_xmin - 1)
52  continue;
53  xbins_vector.push_back(i);
54  }
55 
56  Int_t nbinsx = xbins_vector.size() - 1;
57 
58  Int_t nbinsy = zr_occ_num_bins_[2];
59  Double_t ylow = std::min(zr_occ_range_[2], zr_occ_range_[6]);
60  Double_t yup = std::max(zr_occ_range_[3], zr_occ_range_[7]);
61 
62  auto hist = new TH2F(name, title, nbinsx, &xbins_vector[0], nbinsy, ylow, yup);
63  return booker.book2D(name, hist);
64 }
dqm::impl
Definition: MonitorElement.h:74
GEMBaseValidation::zr_occ_range_
std::vector< Double_t > zr_occ_range_
Definition: GEMBaseValidation.h:88
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
Handle.h
GEMBaseValidation.h
mps_fire.i
i
Definition: mps_fire.py:355
GEMBaseValidation::xy_occ_num_bins_
Int_t xy_occ_num_bins_
Definition: GEMBaseValidation.h:86
GEMBaseValidation::zr_occ_num_bins_
std::vector< Int_t > zr_occ_num_bins_
Definition: GEMBaseValidation.h:87
MessageLogger.h
GEMBaseValidation::detail_plot_
Bool_t detail_plot_
Definition: GEMBaseValidation.h:90
min
T min(T a, T b)
Definition: MathUtil.h:58
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
GEMUtils::getSuffixName
TString getSuffixName(Int_t region_id)
Definition: GEMValidationUtils.cc:5
GEMBaseValidation::isMuonSimHit
Bool_t isMuonSimHit(const PSimHit &)
Definition: GEMBaseValidation.cc:32
GEMBaseValidation::bookZROccupancy
dqm::impl::MonitorElement * bookZROccupancy(DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
Definition: GEMBaseValidation.cc:34
GEMBaseValidation::~GEMBaseValidation
~GEMBaseValidation() override=0
Definition: GEMBaseValidation.cc:21
GEMBaseValidation::initGeometry
const GEMGeometry * initGeometry(const edm::EventSetup &)
Definition: GEMBaseValidation.cc:23
compare.hist
hist
Definition: compare.py:376
edm::ESHandle< GEMGeometry >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMEtaPartitionSpecs.h
edm::ParameterSet
Definition: ParameterSet.h:36
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:89
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
gem
Definition: AMC13Event.h:6
GEMBaseValidation::kMuonPDGId_
const Int_t kMuonPDGId_
Definition: GEMBaseValidation.h:93
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
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
PSimHit::particleType
int particleType() const
Definition: PSimHit.h:89
dqm::implementation::IBooker
Definition: DQMStore.h:43
GEMGeometry
Definition: GEMGeometry.h:24
mixOne_premix_on_sim_cfi.gem
gem
Definition: mixOne_premix_on_sim_cfi.py:194
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PSimHit
Definition: PSimHit.h:15
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
GEMBaseValidation::getDetOccBinX
Int_t getDetOccBinX(Int_t chamber_id, Int_t layer_id)
Definition: GEMBaseValidation.cc:30