CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMCoPadDigiValidation Class Reference

#include <GEMCoPadDigiValidation.h>

Inheritance diagram for GEMCoPadDigiValidation:
GEMBaseValidation one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 GEMCoPadDigiValidation (const edm::ParameterSet &)
 
 ~GEMCoPadDigiValidation () override
 
- Public Member Functions inherited from GEMBaseValidation
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
 

Private Attributes

bool detailPlot_
 
edm::EDGetToken InputTagToken_
 
int maxBXGEM_
 
int minBXGEM_
 
int nBinXY_
 
std::unordered_map< UInt_t, MonitorElement * > theCoPad_dcEta
 
std::unordered_map< UInt_t, MonitorElement * > theCoPad_simple_zr
 
MonitorElementtheCSCCoPad [2][3]
 
MonitorElementtheCSCCoPad_bx [2][3]
 
MonitorElementtheCSCCoPad_phipad [2][3]
 
MonitorElementtheCSCCoPad_xy [2][3]
 
std::unordered_map< UInt_t, MonitorElement * > theCSCCoPad_xy_ch
 
MonitorElementtheCSCCoPad_zr [2][3]
 

Additional Inherited Members

- Protected Attributes inherited from GEMBaseValidation
int nBinXY_
 
std::vector< double > nBinZR_
 
std::vector< double > RangeZR_
 

Detailed Description

Definition at line 8 of file GEMCoPadDigiValidation.h.

Constructor & Destructor Documentation

GEMCoPadDigiValidation::GEMCoPadDigiValidation ( const edm::ParameterSet cfg)
explicit

Definition at line 4 of file GEMCoPadDigiValidation.cc.

References detailPlot_, edm::ParameterSet::getParameter(), InputTagToken_, maxBXGEM_, and minBXGEM_.

4  : GEMBaseValidation(cfg)
5 {
6  InputTagToken_ = consumes<GEMCoPadDigiCollection>(cfg.getParameter<edm::InputTag>("CopadLabel"));
7  detailPlot_ = cfg.getParameter<bool>("detailPlot");
8  minBXGEM_ = cfg.getParameter<int>("minBXGEM");
9  maxBXGEM_ = cfg.getParameter<int>("maxBXGEM");
10 }
T getParameter(std::string const &) const
GEMBaseValidation(const edm::ParameterSet &ps)
GEMCoPadDigiValidation::~GEMCoPadDigiValidation ( )
override

Definition at line 85 of file GEMCoPadDigiValidation.cc.

85  {
86 
87 
88 }

Member Function Documentation

void GEMCoPadDigiValidation::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overridevirtual

Implements GEMBaseValidation.

Definition at line 91 of file GEMCoPadDigiValidation.cc.

References GEMEtaPartition::centreOfPad(), GEMSuperChamber::chamber(), relativeConstraints::chamber, detailPlot_, GEMChamber::etaPartition(), MonitorElement::Fill(), edm::EventSetup::get(), GEMBaseValidation::getSuffixName(), GEMGeometry::idToDet(), InputTagToken_, edm::HandleBase::isValid(), LogDebug, maxBXGEM_, minBXGEM_, GEMEtaPartition::npads(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GEMDetId::region(), mathSSE::return(), relativeConstraints::ring, AlCaHLTBitMon_QueryRunRegistry::string, GEMGeometry::superChamber(), GeomDet::surface(), theCoPad_dcEta, theCoPad_simple_zr, theCSCCoPad, theCSCCoPad_bx, theCSCCoPad_phipad, theCSCCoPad_xy, theCSCCoPad_xy_ch, theCSCCoPad_zr, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

93 {
94  const GEMGeometry* GEMGeometry_;
95  try {
97  iSetup.get<MuonGeometryRecord>().get(hGeom);
98  GEMGeometry_ = &*hGeom;
99  }
101  edm::LogError("GEMCoPadDigiValidation") << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
102  return;
103  }
105  e.getByToken(InputTagToken_, gem_digis);
106  if (!gem_digis.isValid()) {
107  edm::LogError("GEMCoPadDigiValidation") << "Cannot get pads by token.";
108  return ;
109  }
110 
111  for (GEMCoPadDigiCollection::DigiRangeIterator cItr=gem_digis->begin(); cItr!=gem_digis->end(); cItr++) {
112  GEMDetId id = (*cItr).first;
113  int re = id.region();
114  int st = id.station();
115  int la = id.layer();
116  Short_t chamber = (Short_t) id.chamber();
118  //loop over digis of given roll
119  for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
120  {
121  // GEM copads are stored per super chamber!
122  GEMDetId schId = GEMDetId(re, id.ring(), st, 0, chamber, 0);
123  Short_t nroll = (*digiItr).roll();
124  LogDebug("GEMCoPadDigiValidation")<<"schId : "<<schId;
125  const GeomDet* gdet = GEMGeometry_->idToDet(schId);
126  if ( gdet == nullptr) {
127  edm::LogError("GEMCoPadDigiValidation")<<schId<<" : This detId cannot be loaded from GEMGeometry // Original"<<id<<" station : "<<st;
128  edm::LogError("GEMCoPadDigiValidation")<<"Getting DetId failed. Discard this gem copad hit. ";
129  continue;
130  }
131  const BoundPlane & surface = gdet->surface();
132  const GEMSuperChamber * superChamber = GEMGeometry_->superChamber(schId);
133  LogDebug("GEMCoPadDigiValidation")<<" #pads in this partition : "<< superChamber->chamber(1)->etaPartition(1)->npads();
134 
135  Short_t pad1 = (Short_t) digiItr->pad(1);
136  Short_t pad2 = (Short_t) digiItr->pad(2);
137  Short_t bx1 = (Short_t) digiItr->bx(1);
138  Short_t bx2 = (Short_t) digiItr->bx(2);
139  LogDebug("GEMCoPadDigiValidation")<<" copad #1 pad : "<<pad1<<" bx : "<<bx1;
140  LogDebug("GEMCoPadDigiValidation")<<" copad #2 pad : "<<pad2<<" bx : "<<bx2;
141 
142  // Filtered using BX
143  if ( bx1 < (Short_t)minBXGEM_ || bx1 > (Short_t)maxBXGEM_) continue;
144  if ( bx2 < (Short_t)minBXGEM_ || bx2 > (Short_t)maxBXGEM_) continue;
145 
146  LocalPoint lp1 = superChamber->chamber(1)->etaPartition(nroll)->centreOfPad(pad1);
147  LocalPoint lp2 = superChamber->chamber(2)->etaPartition(nroll)->centreOfPad(pad2);
148 
149  GlobalPoint gp1 = surface.toGlobal(lp1);
150  GlobalPoint gp2 = surface.toGlobal(lp2);
151  Float_t g_r1 = (Float_t) gp1.perp();
152  Float_t g_r2 = (Float_t) gp2.perp();
153  Float_t g_z1 = (Float_t) gp1.z();
154  Float_t g_z2 = (Float_t) gp2.z();
155 
156  Float_t g_phi = (Float_t) gp1.phi();
157  Float_t g_x = (Float_t) gp1.x();
158  Float_t g_y = (Float_t) gp1.y();
159 
160  int region_num=0;
161  if ( re == -1 ) region_num = 0 ;
162  else if (re == 1 ) region_num = 1;
163  else {
164  edm::LogError("GEMCoPadDigiValidation")<<"region : "<<re<<std::endl;
165  }
166  int binX = (chamber-1)*2+la;
167  int binY = nroll;
168  int station_num = st-1;
169 
170  // Fill normal plots.
171  TString histname_suffix = getSuffixName( re);
172  TString simple_zr_histname = TString::Format("copad_simple_zr%s",histname_suffix.Data());
173  theCoPad_simple_zr[simple_zr_histname.Hash()]->Fill( fabs(g_z1), g_r1);
174  theCoPad_simple_zr[simple_zr_histname.Hash()]->Fill( fabs(g_z2), g_r2);
175 
176  histname_suffix = getSuffixName( re, st ) ;
177  TString dcEta_histname = TString::Format("copad_dcEta%s",histname_suffix.Data());
178  theCoPad_dcEta[dcEta_histname.Hash()]->Fill( binX, binY);
179  theCoPad_dcEta[dcEta_histname.Hash()]->Fill( binX+1, binY);
180 
181  // Fill detail plots.
182  if ( detailPlot_) {
183  theCSCCoPad_xy[region_num][station_num]->Fill(g_x,g_y);
184  theCSCCoPad_phipad[region_num][station_num]->Fill(g_phi,pad1);
185  theCSCCoPad[region_num][station_num]->Fill(pad1);
186  theCSCCoPad_bx[region_num][station_num]->Fill(bx1);
187  theCSCCoPad_bx[region_num][station_num]->Fill(bx2);
188  theCSCCoPad_zr[region_num][station_num]->Fill(g_z1,g_r1);
189  theCSCCoPad_zr[region_num][station_num]->Fill(g_z2,g_r2);
190  std::string name_prefix = getSuffixName( re, st) ;
191  TString hname;
192  if ( chamber %2 == 0 ) { hname = TString::Format("copad_dg_xy%s_even",name_prefix.c_str()); }
193  else { hname = TString::Format("copad_dg_xy%s_odd",name_prefix.c_str()); }
194  theCSCCoPad_xy_ch[hname.Hash()]->Fill(g_x,g_y);
195  }
196  }
197  }
198 }
#define LogDebug(id)
const GEMChamber * chamber(GEMDetId id) const
Return the chamber corresponding to the given id.
MonitorElement * theCSCCoPad_zr[2][3]
T perp() const
Definition: PV3DBase.h:72
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
std::unordered_map< UInt_t, MonitorElement * > theCSCCoPad_xy_ch
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
return((rh^lh)&mask)
void Fill(long long x)
std::string getSuffixName(int region, int station, int layer)
T z() const
Definition: PV3DBase.h:64
std::unordered_map< UInt_t, MonitorElement * > theCoPad_dcEta
int npads() const
number of GEM-CSC trigger readout pads in partition
bool isValid() const
Definition: HandleBase.h:74
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
Definition: GEMDetId.h:53
const GEMSuperChamber * superChamber(GEMDetId id) const
Definition: GEMGeometry.cc:91
MonitorElement * theCSCCoPad_xy[2][3]
MonitorElement * theCSCCoPad[2][3]
const GeomDet * idToDet(DetId) const override
Definition: GEMGeometry.cc:38
MonitorElement * theCSCCoPad_phipad[2][3]
MonitorElement * theCSCCoPad_bx[2][3]
std::vector< GEMCoPadDigi >::const_iterator const_iterator
LocalPoint centreOfPad(int pad) const
std::unordered_map< UInt_t, MonitorElement * > theCoPad_simple_zr
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return the eta partition corresponding to the given id.
Definition: GEMChamber.cc:47
T get() const
Definition: EventSetup.h:62
T x() const
Definition: PV3DBase.h:62
void GEMCoPadDigiValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  Run,
edm::EventSetup const &  iSetup 
)
override

Definition at line 11 of file GEMCoPadDigiValidation.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), GEMBaseValidation::BookHistXY(), GEMBaseValidation::BookHistZR(), detailPlot_, GEMBaseValidation::getDCEta(), GEMBaseValidation::getSimpleZR(), GEMBaseValidation::getSuffixName(), GEMBaseValidation::getSuffixTitle(), GEMBaseValidation::initGeometry(), LogDebug, Pi, PI, GEMGeometry::regions(), mathSSE::return(), DQMStore::IBooker::setCurrentFolder(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, theCoPad_dcEta, theCoPad_simple_zr, theCSCCoPad, theCSCCoPad_bx, theCSCCoPad_phipad, theCSCCoPad_xy, theCSCCoPad_xy_ch, and theCSCCoPad_zr.

11  {
12  const GEMGeometry* GEMGeometry_ = initGeometry(iSetup);
13  if ( GEMGeometry_ == nullptr) return ;
14  LogDebug("GEMCoPadDigiValidation")<<"Geometry is acquired from MuonGeometryRecord\n";
15  ibooker.setCurrentFolder("MuonGEMDigisV/GEMDigisTask");
16  LogDebug("GEMCoPadDigiValidation")<<"ibooker set current folder\n";
17 
18  const double PI = TMath::Pi();
19 
20  int npadsGE11 = GEMGeometry_->regions()[0]->stations()[0]->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
21  int npadsGE21 = 0;
22  int nPads = 0;
23 
24  if (GEMGeometry_->regions()[0]->stations().size()>1 &&!GEMGeometry_->regions()[0]->stations()[1]->superChambers().empty() ) {
25  npadsGE21 = GEMGeometry_->regions()[0]->stations()[1]->superChambers()[0]->chambers()[0]->etaPartitions()[0]->npads();
26  }
27 
28  for( auto& region : GEMGeometry_->regions() ){
29  int re = region->region();
30  TString title_suffix = getSuffixTitle(re);
31  TString histname_suffix = getSuffixName( re) ;
32  TString simpleZR_title = TString::Format("Copad ZR Occupancy%s; |Z|(cm) ; R(cm)",title_suffix.Data());
33  TString simpleZR_histname = TString::Format("copad_simple_zr%s",histname_suffix.Data());
34 
35  auto* simpleZR = getSimpleZR(ibooker, simpleZR_title, simpleZR_histname);
36  if ( simpleZR != nullptr) {
37  theCoPad_simple_zr[simpleZR_histname.Hash() ] = simpleZR;
38  }
39  for( auto& station : region->stations()) {
40  int st = station->station();
41  TString title_suffix2 = getSuffixTitle( re , st) ;
42  TString histname_suffix2 = getSuffixName( re, st) ;
43 
44  TString dcEta_title = TString::Format("Copad's occupancy for detector component %s; # of sub-detector ;#eta-partition",title_suffix2.Data());
45  TString dcEta_histname = TString::Format("copad_dcEta%s",histname_suffix2.Data());
46 
47  auto* dcEta = getDCEta(ibooker, station, dcEta_title, dcEta_histname);
48  if ( dcEta != nullptr) {
49  theCoPad_dcEta[ dcEta_histname.Hash() ] = dcEta;
50  }
51  }
52 
53  if ( detailPlot_) {
54  for( auto& region : GEMGeometry_->regions() ) {
55  int re = region->region();
56  int region_num = (re+1)/2;
57  std::string name_prefix = getSuffixName( re);
58  std::string label_prefix = getSuffixTitle(re);
59  for( auto& station : region->stations() ) {
60  int st = station->station();
61  int station_num = st-1;
62 
63  if ( st == 1 ) nPads = npadsGE11;
64  else nPads = npadsGE21;
65  name_prefix = getSuffixName( re, st) ;
66  label_prefix = getSuffixTitle( re, st) ;
67  theCSCCoPad_phipad[region_num][station_num] = ibooker.book2D( ("copad_dg_phipad"+name_prefix).c_str(), ("Digi occupancy: "+label_prefix+"; phi [rad]; Pad number").c_str(), 280,-PI,PI, nPads/2,0,nPads );
68  theCSCCoPad[region_num][station_num] = ibooker.book1D( ("copad_dg"+name_prefix).c_str(), ("Digi occupancy per pad number: "+label_prefix+";Pad number; entries").c_str(), nPads,0.5,nPads+0.5);
69  theCSCCoPad_bx[region_num][station_num] = ibooker.book1D( ("copad_dg_bx"+name_prefix).c_str(), ("Bunch crossing: "+label_prefix+"; bunch crossing ; entries").c_str(), 11,-5.5,5.5);
70  theCSCCoPad_zr[region_num][station_num] = BookHistZR( ibooker, "copad_dg","CoPad Digi",region_num,station_num);
71  theCSCCoPad_xy[region_num][station_num] = BookHistXY( ibooker, "copad_dg","CoPad Digi",region_num,station_num);
72  TString xy_name = TString::Format("copad_dg_xy%s_odd",name_prefix.c_str());
73  TString xy_title = TString::Format("Digi XY occupancy %s at odd chambers",label_prefix.c_str());
74  theCSCCoPad_xy_ch[ xy_name.Hash()] = ibooker.book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
75  xy_name = TString::Format("copad_dg_xy%s_even",name_prefix.c_str());
76  xy_title = TString::Format("Digi XY occupancy %s at even chambers",label_prefix.c_str());
77  theCSCCoPad_xy_ch[ xy_name.Hash()] = ibooker.book2D(xy_name, xy_title, 360, -360,360, 360, -360, 360);
78  }
79  }
80  }
81  }
82 }
#define LogDebug(id)
const double Pi
MonitorElement * theCSCCoPad_zr[2][3]
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
MonitorElement * getSimpleZR(DQMStore::IBooker &, TString, TString)
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int station_num, unsigned int layer_num=99)
std::unordered_map< UInt_t, MonitorElement * > theCSCCoPad_xy_ch
std::string getSuffixTitle(int region, int station, int layer)
const GEMGeometry * initGeometry(const edm::EventSetup &)
return((rh^lh)&mask)
std::string getSuffixName(int region, int station, int layer)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:43
std::unordered_map< UInt_t, MonitorElement * > theCoPad_dcEta
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
#define PI
Definition: QcdUeDQM.h:36
MonitorElement * theCSCCoPad_xy[2][3]
MonitorElement * theCSCCoPad[2][3]
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * theCSCCoPad_phipad[2][3]
MonitorElement * theCSCCoPad_bx[2][3]
MonitorElement * getDCEta(DQMStore::IBooker &, const GEMStation *, TString, TString)
std::unordered_map< UInt_t, MonitorElement * > theCoPad_simple_zr

Member Data Documentation

bool GEMCoPadDigiValidation::detailPlot_
private

Definition at line 31 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), bookHistograms(), and GEMCoPadDigiValidation().

edm::EDGetToken GEMCoPadDigiValidation::InputTagToken_
private

Definition at line 29 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and GEMCoPadDigiValidation().

int GEMCoPadDigiValidation::maxBXGEM_
private

Definition at line 28 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and GEMCoPadDigiValidation().

int GEMCoPadDigiValidation::minBXGEM_
private

Definition at line 28 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and GEMCoPadDigiValidation().

int GEMCoPadDigiValidation::nBinXY_
private

Definition at line 30 of file GEMCoPadDigiValidation.h.

std::unordered_map< UInt_t , MonitorElement* > GEMCoPadDigiValidation::theCoPad_dcEta
private

Definition at line 26 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

std::unordered_map< UInt_t , MonitorElement* > GEMCoPadDigiValidation::theCoPad_simple_zr
private

Definition at line 27 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMCoPadDigiValidation::theCSCCoPad[2][3]
private

Definition at line 19 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMCoPadDigiValidation::theCSCCoPad_bx[2][3]
private

Definition at line 20 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMCoPadDigiValidation::theCSCCoPad_phipad[2][3]
private

Definition at line 18 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMCoPadDigiValidation::theCSCCoPad_xy[2][3]
private

Definition at line 17 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

std::unordered_map< UInt_t , MonitorElement* > GEMCoPadDigiValidation::theCSCCoPad_xy_ch
private

Definition at line 22 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GEMCoPadDigiValidation::theCSCCoPad_zr[2][3]
private

Definition at line 21 of file GEMCoPadDigiValidation.h.

Referenced by analyze(), and bookHistograms().