CMS 3D CMS Logo

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

#include <GEMBaseValidation.h>

Inheritance diagram for GEMBaseValidation:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... > GEMCoPadDigiValidation GEMHitsValidation GEMPadDigiValidation GEMRecHitsValidation GEMStripDigiValidation

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override=0
 
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 one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Attributes

int nBinXY_
 
std::vector< double > nBinZR_
 
std::vector< double > RangeZR_
 

Private Attributes

bool detailPlot_
 
edm::EDGetToken InputTagToken_
 
std::vector< std::string > layerLabel
 
unsigned int npart
 
unsigned int nregion
 
unsigned int nstation
 
unsigned int nstationForLabel
 
std::vector< std::string > regionLabel
 

Detailed Description

Definition at line 18 of file GEMBaseValidation.h.

Constructor & Destructor Documentation

GEMBaseValidation::GEMBaseValidation ( const edm::ParameterSet ps)
explicit

Definition at line 8 of file GEMBaseValidation.cc.

References edm::ParameterSet::getUntrackedParameter().

9 {
10  nBinZR_ = ps.getUntrackedParameter< std::vector<double> >("nBinGlobalZR") ;
11  RangeZR_ = ps.getUntrackedParameter< std::vector<double> >("RangeGlobalZR");
12  nBinXY_ = ps.getUntrackedParameter< int >("nBinGlobalXY",360) ;
13 
14  regionLabel.push_back("-1");
15  regionLabel.push_back("1" );
16 
17 
18  layerLabel.push_back("1");
19  layerLabel.push_back("2");
20 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > regionLabel
std::vector< double > RangeZR_
std::vector< std::string > layerLabel
std::vector< double > nBinZR_
GEMBaseValidation::~GEMBaseValidation ( )
override

Definition at line 88 of file GEMBaseValidation.cc.

88  {
89 }

Member Function Documentation

void GEMBaseValidation::analyze ( const edm::Event e,
const edm::EventSetup  
)
overridepure virtual
MonitorElement * GEMBaseValidation::BookHistXY ( DQMStore::IBooker ibooker,
const char *  name,
const char *  label,
unsigned int  region_num,
unsigned int  station_num,
unsigned int  layer_num = 99 
)

Definition at line 163 of file GEMBaseValidation.cc.

References DQMStore::IBooker::book2D(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMRecHitsValidation::bookHistograms(), GEMHitsValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMStripDigiValidation::bookHistograms().

163  {
164  string hist_name, hist_title;
165  if ( layer_num == 0 || layer_num==1 ) {
166  hist_name = name+string("_xy") + getSuffixName( region_num, station_num+1, layer_num+1) ;
167  hist_title = label+string(" occupancy : ")+getSuffixTitle( region_num, station_num+1, layer_num+1 )+ " ; globalX [cm]; globalY[cm]";
168  }
169  else {
170  hist_name = name+string("_xy") + getSuffixName( region_num, station_num+1);
171  hist_title = label+string(" occupancy : region")+getSuffixTitle( region_num, station_num+1) +" ; globalX [cm]; globalY[cm]";
172  }
173  return ibooker.book2D( hist_name, hist_title, nBinXY_, -360,360,nBinXY_,-360,360);
174 }
std::string getSuffixTitle(int region, int station, int layer)
std::string getSuffixName(int region, int station, int layer)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * GEMBaseValidation::BookHistZR ( DQMStore::IBooker ibooker,
const char *  name,
const char *  label,
unsigned int  region_num,
unsigned int  station_num,
unsigned int  layer_num = 99 
)

Definition at line 133 of file GEMBaseValidation.cc.

References DQMStore::IBooker::book2D(), createfilelist::int, LogDebug, AlCaHLTBitMon_QueryRunRegistry::string, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, Phase2TrackerMonitorDigi_cff::ymax, and Phase2TrackerMonitorDigi_cff::ymin.

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMRecHitsValidation::bookHistograms(), GEMHitsValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMStripDigiValidation::bookHistograms().

133  {
134  string hist_name, hist_title;
135  if ( layer_num == 0 || layer_num==1 ) {
136  hist_name = name+string("_zr") + getSuffixName(region_num, station_num+1, layer_num+1);
137  hist_title = label+string(" occupancy : region")+getSuffixTitle( region_num, station_num+1, layer_num+1)+" ; globalZ[cm] ; globalR[cm]";
138  }
139  else {
140  hist_name = name+string("_zr") + getSuffixName(region_num, station_num+1);
141  hist_title = label+string(" occupancy : region")+getSuffixTitle( region_num, station_num+1)+" ; globalZ[cm] ; globalR[cm]";
142  }
143  LogDebug("GEMBaseValidation")<<hist_name<<" "<<hist_title<<std::endl;
144  int xbin = (int)nBinZR_[station_num];
145  int ybin = (int)nBinZR_[ nBinZR_.size()/2+station_num];
146  double xmin = 0;
147  double xmax = 0;
148  double ymin = 0;
149  double ymax = 0;
150  ymin = RangeZR_[ RangeZR_.size()/2 + station_num*2 + 0];
151  ymax = RangeZR_[ RangeZR_.size()/2 + station_num*2 + 1];
152  if ( region_num ==0 ) {
153  xmin = -RangeZR_[ station_num*2 + 1];
154  xmax = -RangeZR_[ station_num*2 + 0];
155  }
156  else {
157  xmin = RangeZR_[ station_num*2 + 0];
158  xmax = RangeZR_[ station_num*2 + 1];
159  }
160  return ibooker.book2D( hist_name, hist_title, xbin, xmin, xmax, ybin,ymin, ymax);
161 }
#define LogDebug(id)
std::string getSuffixTitle(int region, int station, int layer)
std::vector< double > RangeZR_
std::string getSuffixName(int region, int station, int layer)
std::vector< double > nBinZR_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * GEMBaseValidation::getDCEta ( DQMStore::IBooker ibooker,
const GEMStation station,
TString  title,
TString  histname 
)

Definition at line 107 of file GEMBaseValidation.cc.

References DQMStore::IBooker::book2D(), training_settings::idx, diffTwoXMLs::label, LogDebug, GEMStation::region(), GEMStation::rings(), and GEMStation::station().

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMRecHitsValidation::bookHistograms(), GEMHitsValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMStripDigiValidation::bookHistograms().

107  {
108  if( station->rings().front()->superChambers().empty() ) {
109  LogDebug("MuonBaseValidation")<<"+++ Error! can not get superChambers. Skip "<<getSuffixTitle(station->region(), station->station())<<" on "<<histname<<"\n";
110  return nullptr;
111  }
112 
113 // int nXbins = station->rings().front()->nSuperChambers()*2; //Fine for the complete geometry, but not for the Slice Test geometry
114  int nXbins = 72; //Maximum number of chambers is for GE1/1
115  int nYbins = station->rings().front()->superChambers().front()->chambers().front()->nEtaPartitions();
116 
117  TH2F* dcEta_temp = new TH2F(title,histname,nXbins, 0, nXbins, nYbins, 1, nYbins+1);
118  int idx = 0 ;
119 
120 // for(unsigned int sCh = 1; sCh <= station->superChambers().size(); sCh++){
121  for(unsigned int sCh = 1; sCh <= 36; sCh++){
122  for(unsigned int Ch = 1; Ch <= 2; Ch++){
123  idx++;
124  TString label = TString::Format("ch%d_la%d", sCh, Ch);
125  dcEta_temp->GetXaxis()->SetBinLabel(idx, label.Data());
126  }
127  }
128  MonitorElement* dcEta = ibooker.book2D( histname, dcEta_temp);
129  return dcEta;
130 }
#define LogDebug(id)
int region() const
Get the region.
Definition: GEMStation.cc:85
int station() const
Get the station.
Definition: GEMStation.cc:89
std::string getSuffixTitle(int region, int station, int layer)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
const std::vector< const GEMRing * > & rings() const
Return the rings in the station.
Definition: GEMStation.cc:69
MonitorElement * GEMBaseValidation::getSimpleZR ( DQMStore::IBooker ibooker,
TString  title,
TString  histname 
)

Definition at line 91 of file GEMBaseValidation.cc.

References DQMStore::IBooker::book2D(), and mps_fire::i.

Referenced by GEMCoPadDigiValidation::bookHistograms(), GEMRecHitsValidation::bookHistograms(), GEMHitsValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), and GEMStripDigiValidation::bookHistograms().

91  {
92  std::vector<double> xbins_vector;
93  double station1_xmin = RangeZR_[ 0 ];
94  double station1_xmax = RangeZR_[ 1 ];
95  double station2_xmin = RangeZR_[ 2 ];
96  double station2_xmax = RangeZR_[ 3 ];
97 
98  for( double i= station1_xmin-1 ; i< station2_xmax+1; i=i+0.25 ) {
99  if ( i > station1_xmax+1 && i<station2_xmin-1 ) continue;
100  xbins_vector.push_back(i);
101  }
102  TH2F* simpleZR_temp = new TH2F(title,histname, xbins_vector.size()-1, (double*)&xbins_vector[0], 50,120,330);
103  MonitorElement* simpleZR = ibooker.book2D( histname, simpleZR_temp);
104  return simpleZR;
105 }
std::vector< double > RangeZR_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
string GEMBaseValidation::getStationLabel ( int  i)

Definition at line 80 of file GEMBaseValidation.cc.

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

80  {
81  string stationLabel[] = {"1","2"};
82  return stationLabel[i-1];
83 }
string GEMBaseValidation::getSuffixName ( int  region,
int  station,
int  layer 
)
string GEMBaseValidation::getSuffixName ( int  region,
int  station 
)

Definition at line 53 of file GEMBaseValidation.cc.

References gather_cfg::cout, and AlCaHLTBitMon_QueryRunRegistry::string.

53  {
54  if ( region == -1 ) region =0 ;
55  else if ( region >1 ) std::cout<<"Name)Alert! Region must be -1 or 1 : "<<region<<" "<<station<<std::endl;
56  return string("_r")+regionLabel[region]+"_st"+getStationLabel(station);
57 }
std::vector< std::string > regionLabel
std::string getStationLabel(int i)
string GEMBaseValidation::getSuffixName ( int  region)

Definition at line 58 of file GEMBaseValidation.cc.

References gather_cfg::cout, and AlCaHLTBitMon_QueryRunRegistry::string.

58  {
59  if ( region == -1 ) region =0 ;
60  else if ( region >1 ) std::cout<<"Name)Alert! Region must be -1 or 1 : "<<region<<std::endl;
61  return string("_r")+regionLabel[region];
62 }
std::vector< std::string > regionLabel
string GEMBaseValidation::getSuffixTitle ( int  region,
int  station,
int  layer 
)

Definition at line 64 of file GEMBaseValidation.cc.

References gather_cfg::cout, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GEMRecHitsValidation::BookHist1D(), GEMCoPadDigiValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), GEMHitsValidation::bookHistograms(), GEMRecHitsValidation::bookHistograms(), and GEMStripDigiValidation::bookHistograms().

64  {
65  if ( region == -1 ) region =0 ;
66  else if ( region >1 ) std::cout<<"Title)Alert! Region must be -1 or 1 : "<<region<<" "<<station<<" "<<layer<<std::endl;
67  return string("Region ")+regionLabel[region]+" Station "+getStationLabel(station)+" Layer "+layerLabel[layer-1];
68 }
std::vector< std::string > regionLabel
std::vector< std::string > layerLabel
std::string getStationLabel(int i)
string GEMBaseValidation::getSuffixTitle ( int  region,
int  station 
)

Definition at line 69 of file GEMBaseValidation.cc.

References gather_cfg::cout, and AlCaHLTBitMon_QueryRunRegistry::string.

69  {
70  if ( region == -1 ) region =0 ;
71  else if ( region >1 ) std::cout<<"Title)Alert! Region must be -1 or 1 : "<<region<<" "<<station<<std::endl;
72  return string("Region ")+regionLabel[region]+" Station "+getStationLabel(station);
73 }
std::vector< std::string > regionLabel
std::string getStationLabel(int i)
string GEMBaseValidation::getSuffixTitle ( int  region)

Definition at line 74 of file GEMBaseValidation.cc.

References gather_cfg::cout, and AlCaHLTBitMon_QueryRunRegistry::string.

74  {
75  if ( region == -1 ) region =0 ;
76  else if ( region >1 ) std::cout<<"Title)Alert! Region must be -1 or 1 : "<<region<<std::endl;
77  return string("Region ")+regionLabel[region];
78 }
std::vector< std::string > regionLabel
const GEMGeometry * GEMBaseValidation::initGeometry ( const edm::EventSetup )

Definition at line 22 of file GEMBaseValidation.cc.

References GEMGeometry::chambers(), MillePedeFileConverter_cfg::e, GEMGeometry::etaPartitions(), edm::EventSetup::get(), LogDebug, npart, GEMGeometry::regions(), and GEMGeometry::superChambers().

Referenced by GEMHitsValidation::analyze(), GEMRecHitsValidation::analyze(), GEMCoPadDigiValidation::bookHistograms(), GEMPadDigiValidation::bookHistograms(), GEMHitsValidation::bookHistograms(), GEMRecHitsValidation::bookHistograms(), and GEMStripDigiValidation::bookHistograms().

22  {
23  const GEMGeometry* GEMGeometry_ = nullptr;
24  try {
26  iSetup.get<MuonGeometryRecord>().get(hGeom);
27  GEMGeometry_ = &*hGeom;
28  }
30  edm::LogError("MuonGEMBaseValidation") << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
31  return nullptr;
32  }
33 
34  LogDebug("MuonBaseValidation") << "GEMGeometry_->regions().size() " << GEMGeometry_->regions().size() << "\n";
35  LogDebug("MuonBaseValidation") << "GEMGeometry_->stations().size() " << GEMGeometry_->regions().front()->stations().size() << "\n";
36  LogDebug("MuonBaseValidation") << "GEMGeometry_->superChambers().size() " << GEMGeometry_->superChambers().size() << "\n";
37  LogDebug("MuonBaseValidation") << "GEMGeometry_->chambers().size() " << GEMGeometry_->chambers().size() << "\n";
38  LogDebug("MuonBaseValidation") << "GEMGeometry_->etaPartitions().size() " << GEMGeometry_->etaPartitions().size() << "\n";
39 
40  nregion = GEMGeometry_->regions().size();
41  nstation = GEMGeometry_->regions().front()->stations().size() ;
43  npart = GEMGeometry_->chambers().front()->etaPartitions().size();
44 
45  return GEMGeometry_;
46 }
#define LogDebug(id)
unsigned int nstationForLabel
unsigned int nregion
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:43
unsigned int nstation
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:63
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:55
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:59
unsigned int GEMBaseValidation::nPart ( )
inline

Definition at line 43 of file GEMBaseValidation.h.

References npart.

Referenced by GEMHitsValidation::bookHistograms().

43 { return npart; }
unsigned int GEMBaseValidation::nRegion ( )
inline

Definition at line 40 of file GEMBaseValidation.h.

References nregion.

Referenced by GEMHitsValidation::bookHistograms(), and GEMRecHitsValidation::bookHistograms().

40 { return nregion; }
unsigned int nregion
unsigned int GEMBaseValidation::nStation ( )
inline

Definition at line 41 of file GEMBaseValidation.h.

References nstation.

Referenced by GEMHitsValidation::bookHistograms(), and GEMRecHitsValidation::bookHistograms().

41 { return nstation; }
unsigned int nstation
unsigned int GEMBaseValidation::nStationForLabel ( )
inline

Definition at line 42 of file GEMBaseValidation.h.

References nstationForLabel.

42 { return nstationForLabel; }
unsigned int nstationForLabel
void GEMBaseValidation::setNStationForLabel ( unsigned int  number)
inline

Definition at line 45 of file GEMBaseValidation.h.

References nstationForLabel.

45 { nstationForLabel = number; }
unsigned int nstationForLabel

Member Data Documentation

bool GEMBaseValidation::detailPlot_
private

Definition at line 56 of file GEMBaseValidation.h.

edm::EDGetToken GEMBaseValidation::InputTagToken_
private

Definition at line 54 of file GEMBaseValidation.h.

std::vector< std::string > GEMBaseValidation::layerLabel
private

Definition at line 53 of file GEMBaseValidation.h.

int GEMBaseValidation::nBinXY_
protected

Definition at line 47 of file GEMBaseValidation.h.

std::vector<double> GEMBaseValidation::nBinZR_
protected

Definition at line 48 of file GEMBaseValidation.h.

unsigned int GEMBaseValidation::npart
private

Definition at line 55 of file GEMBaseValidation.h.

Referenced by nPart().

unsigned int GEMBaseValidation::nregion
private

Definition at line 55 of file GEMBaseValidation.h.

Referenced by nRegion().

unsigned int GEMBaseValidation::nstation
private

Definition at line 55 of file GEMBaseValidation.h.

Referenced by nStation().

unsigned int GEMBaseValidation::nstationForLabel
private

Definition at line 55 of file GEMBaseValidation.h.

Referenced by nStationForLabel(), and setNStationForLabel().

std::vector<double> GEMBaseValidation::RangeZR_
protected

Definition at line 49 of file GEMBaseValidation.h.

std::vector< std::string > GEMBaseValidation::regionLabel
private

Definition at line 52 of file GEMBaseValidation.h.