CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
GEMDQMSource Class Reference
Inheritance diagram for GEMDQMSource:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 GEMDQMSource (const edm::ParameterSet &cfg)
 
 ~GEMDQMSource () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 

Private Member Functions

int findVFAT (float min_, float max_, float x_, int roll_)
 
const GEMGeometryinitGeometry (edm::EventSetup const &iSetup)
 

Private Attributes

std::vector< GEMChambergemChambers_
 
const GEMGeometryGEMGeometry_
 
std::unordered_map< UInt_t, MonitorElement * > recHitME_
 
std::unordered_map< UInt_t, MonitorElement * > rh_vs_eta_
 
std::unordered_map< UInt_t, MonitorElement * > StripsFired_vs_eta_
 
edm::EDGetToken tagRecHit_
 
std::unordered_map< UInt_t, MonitorElement * > VFAT_vs_ClusterSize_
 

Detailed Description

Definition at line 26 of file GEMDQMSource.cc.

Constructor & Destructor Documentation

GEMDQMSource::GEMDQMSource ( const edm::ParameterSet cfg)

Definition at line 79 of file GEMDQMSource.cc.

References edm::ParameterSet::getParameter(), and tagRecHit_.

80 {
81  tagRecHit_ = consumes<GEMRecHitCollection>(cfg.getParameter<edm::InputTag>("recHitsInputLabel"));
82 }
T getParameter(std::string const &) const
edm::EDGetToken tagRecHit_
Definition: GEMDQMSource.cc:36
GEMDQMSource::~GEMDQMSource ( )
inlineoverride

Definition at line 30 of file GEMDQMSource.cc.

References fillDescriptions().

30 {};

Member Function Documentation

void GEMDQMSource::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 125 of file GEMDQMSource.cc.

References DEFINE_FWK_MODULE, findVFAT(), gemChambers_, GEMGeometry_, gemRecHits_cfi::gemRecHits, mps_fire::i, initGeometry(), edm::HandleBase::isValid(), recHitME_, mathSSE::return(), rh_vs_eta_, GEMDetId::roll(), StripsFired_vs_eta_, tagRecHit_, VFAT_vs_ClusterSize_, and hit::x.

Referenced by dqmBeginRun().

126 {
127  const GEMGeometry* GEMGeometry_ = initGeometry(eventSetup);
128  if ( GEMGeometry_ == nullptr) return;
129 
131  event.getByToken( this->tagRecHit_, gemRecHits);
132  if (!gemRecHits.isValid()) {
133  edm::LogError("GEMDQMSource") << "GEM recHit is not valid.\n";
134  return ;
135  }
136  for (auto ch : gemChambers_){
137  GEMDetId cId = ch.id();
138  for(auto roll : ch.etaPartitions()){
139  GEMDetId rId = roll->id();
140  const auto& recHitsRange = gemRecHits->get(rId);
141  auto gemRecHit = recHitsRange.first;
142  for ( auto hit = gemRecHit; hit != recHitsRange.second; ++hit ) {
143  int nVfat = findVFAT(1.0, 385.0, hit->firstClusterStrip()+0.5*hit->clusterSize(), rId.roll());
144  recHitME_[ cId ]->Fill(nVfat);
145  rh_vs_eta_[ cId ]->Fill(hit->localPosition().x(), rId.roll());
146  VFAT_vs_ClusterSize_[ cId ]->Fill(hit->clusterSize(), nVfat);
147  for(int i = hit->firstClusterStrip(); i < (hit->firstClusterStrip() + hit->clusterSize()); i++){
148  StripsFired_vs_eta_[ cId ]->Fill(i, rId.roll());
149  }
150  }
151  }
152  }
153 }
edm::EDGetToken tagRecHit_
Definition: GEMDQMSource.cc:36
int findVFAT(float min_, float max_, float x_, int roll_)
Definition: GEMDQMSource.cc:58
const GEMGeometry * GEMGeometry_
Definition: GEMDQMSource.cc:44
int roll() const
Definition: GEMDetId.h:80
std::unordered_map< UInt_t, MonitorElement * > VFAT_vs_ClusterSize_
Definition: GEMDQMSource.cc:49
return((rh^lh)&mask)
std::unordered_map< UInt_t, MonitorElement * > StripsFired_vs_eta_
Definition: GEMDQMSource.cc:50
bool isValid() const
Definition: HandleBase.h:74
const GEMGeometry * initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMSource.cc:65
std::unordered_map< UInt_t, MonitorElement * > recHitME_
Definition: GEMDQMSource.cc:48
std::unordered_map< UInt_t, MonitorElement * > rh_vs_eta_
Definition: GEMDQMSource.cc:51
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMSource.cc:46
void GEMDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 91 of file GEMDQMSource.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), GEMDetId::chamber(), gemChambers_, GEMGeometry_, initGeometry(), checklumidiff::l, GEMDetId::layer(), recHitME_, mathSSE::return(), rh_vs_eta_, DQMStore::IBooker::setCurrentFolder(), StripsFired_vs_eta_, GEMGeometry::superChambers(), and VFAT_vs_ClusterSize_.

Referenced by dqmBeginRun().

92 {
93  GEMGeometry_ = initGeometry(iSetup);
94  if ( GEMGeometry_ == nullptr) return ;
95 
96  const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
97  for (auto sch : superChambers_){
98  int n_lay = sch->nChambers();
99  for (int l=0;l<n_lay;l++){
100  gemChambers_.push_back(*sch->chamber(l+1));
101  }
102  }
103  ibooker.cd();
104  ibooker.setCurrentFolder("GEM/recHit");
105  for (auto ch : gemChambers_){
106  GEMDetId gid = ch.id();
107  string hName = "recHit_Gemini_"+to_string(gid.chamber())+"_la_"+to_string(gid.layer());
108  string hTitle = "recHit Gemini chamber : "+to_string(gid.chamber())+", layer : "+to_string(gid.layer());
109  recHitME_[ ch.id() ] = ibooker.book1D(hName, hTitle, 24,0,24);
110 
111  string hName_2 = "VFAT_vs_ClusterSize_Gemini_"+to_string(gid.chamber())+"_la_"+to_string(gid.layer());
112  string hTitle_2 = "VFAT vs ClusterSize Gemini chamber : "+to_string(gid.chamber())+", layer : "+to_string(gid.layer());
113  VFAT_vs_ClusterSize_[ ch.id() ] = ibooker.book2D(hName_2, hTitle_2, 9, 1, 10, 24, 0, 24);
114 
115  string hName_fired = "StripFired_Gemini_"+to_string(gid.chamber())+"_la_"+to_string(gid.layer());
116  string hTitle_fired = "StripsFired Gemini chamber : "+to_string(gid.chamber())+", layer : "+to_string(gid.layer());
117  StripsFired_vs_eta_[ ch.id() ] = ibooker.book2D(hName_fired, hTitle_fired, 384, 1, 385, 8, 1,9);
118 
119  string hName_rh = "recHit_x_Gemini_"+to_string(gid.chamber())+"_la_"+to_string(gid.layer());
120  string hTitle_rh = "recHit local x Gemini chamber : "+to_string(gid.chamber())+", layer : "+to_string(gid.layer());
121  rh_vs_eta_[ ch.id() ] = ibooker.book2D(hName_rh, hTitle_rh, 50, -25, 25, 8, 1,9);
122  }
123 }
const GEMGeometry * GEMGeometry_
Definition: GEMDQMSource.cc:44
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: GEMDetId.h:74
std::unordered_map< UInt_t, MonitorElement * > VFAT_vs_ClusterSize_
Definition: GEMDQMSource.cc:49
return((rh^lh)&mask)
std::unordered_map< UInt_t, MonitorElement * > StripsFired_vs_eta_
Definition: GEMDQMSource.cc:50
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
int layer() const
Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the o...
Definition: GEMDetId.h:69
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
const GEMGeometry * initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMSource.cc:65
std::unordered_map< UInt_t, MonitorElement * > recHitME_
Definition: GEMDQMSource.cc:48
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:55
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
std::unordered_map< UInt_t, MonitorElement * > rh_vs_eta_
Definition: GEMDQMSource.cc:51
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMSource.cc:46
void GEMDQMSource::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprotected

Definition at line 33 of file GEMDQMSource.cc.

References analyze(), bookHistograms(), and MillePedeFileConverter_cfg::e.

33 {};
void GEMDQMSource::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
inlineoverrideprotected

Definition at line 36 of file GEMDQMSource.cc.

36 {};
void GEMDQMSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 84 of file GEMDQMSource.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

Referenced by ~GEMDQMSource().

85 {
87  desc.add<edm::InputTag>("recHitsInputLabel", edm::InputTag("gemRecHits", ""));
88  descriptions.add("GEMDQMSource", desc);
89 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int GEMDQMSource::findVFAT ( float  min_,
float  max_,
float  x_,
int  roll_ 
)
private

Definition at line 58 of file GEMDQMSource.cc.

References funct::abs(), and min().

Referenced by analyze().

58  {
59  float step = abs(max_-min_)/3.0;
60  if ( x_ < (min(min_,max_)+step) ) { return 8 - roll_;}
61  else if ( x_ < (min(min_,max_)+2.0*step) ) { return 16 - roll_;}
62  else { return 24 - roll_;}
63 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
step
Definition: StallMonitor.cc:94
const GEMGeometry * GEMDQMSource::initGeometry ( edm::EventSetup const &  iSetup)
private

Definition at line 65 of file GEMDQMSource.cc.

References MillePedeFileConverter_cfg::e, GEMGeometry_, and edm::EventSetup::get().

Referenced by analyze(), and bookHistograms().

65  {
66  const GEMGeometry* GEMGeometry_ = nullptr;
67  try {
69  iSetup.get<MuonGeometryRecord>().get(hGeom);
70  GEMGeometry_ = &*hGeom;
71  }
73  edm::LogError("MuonGEMBaseValidation") << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
74  return nullptr;
75  }
76  return GEMGeometry_;
77 }
const GEMGeometry * GEMGeometry_
Definition: GEMDQMSource.cc:44

Member Data Documentation

std::vector<GEMChamber> GEMDQMSource::gemChambers_
private

Definition at line 46 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().

const GEMGeometry* GEMDQMSource::GEMGeometry_
private

Definition at line 44 of file GEMDQMSource.cc.

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

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::recHitME_
private

Definition at line 48 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::rh_vs_eta_
private

Definition at line 51 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::StripsFired_vs_eta_
private

Definition at line 50 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().

edm::EDGetToken GEMDQMSource::tagRecHit_
private

Definition at line 36 of file GEMDQMSource.cc.

Referenced by analyze(), and GEMDQMSource().

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSource::VFAT_vs_ClusterSize_
private

Definition at line 49 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().