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:

Public Member Functions

 GEMDQMSource (const edm::ParameterSet &cfg)
 
 ~GEMDQMSource () override
 

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 beginLuminosityBlock (edm::LuminosityBlock const &lumi, 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 endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup) 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 81 of file GEMDQMSource.cc.

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

82 {
83  tagRecHit_ = consumes<GEMRecHitCollection>(cfg.getParameter<edm::InputTag>("recHitsInputLabel"));
84 }
T getParameter(std::string const &) const
edm::EDGetToken tagRecHit_
Definition: GEMDQMSource.cc:38
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 127 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().

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

Definition at line 36 of file GEMDQMSource.cc.

36 {};
void GEMDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 93 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().

94 {
95  GEMGeometry_ = initGeometry(iSetup);
96  if ( GEMGeometry_ == nullptr) return ;
97 
98  const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
99  for (auto sch : superChambers_){
100  int n_lay = sch->nChambers();
101  for (int l=0;l<n_lay;l++){
102  gemChambers_.push_back(*sch->chamber(l+1));
103  }
104  }
105  ibooker.cd();
106  ibooker.setCurrentFolder("GEM/recHit");
107  for (auto ch : gemChambers_){
108  GEMDetId gid = ch.id();
109  string hName = "recHit_Gemini_"+to_string(gid.chamber())+"_la_"+to_string(gid.layer());
110  string hTitle = "recHit Gemini chamber : "+to_string(gid.chamber())+", layer : "+to_string(gid.layer());
111  recHitME_[ ch.id() ] = ibooker.book1D(hName, hTitle, 24,0,24);
112 
113  string hName_2 = "VFAT_vs_ClusterSize_Gemini_"+to_string(gid.chamber())+"_la_"+to_string(gid.layer());
114  string hTitle_2 = "VFAT vs ClusterSize Gemini chamber : "+to_string(gid.chamber())+", layer : "+to_string(gid.layer());
115  VFAT_vs_ClusterSize_[ ch.id() ] = ibooker.book2D(hName_2, hTitle_2, 9, 1, 10, 24, 0, 24);
116 
117  string hName_fired = "StripFired_Gemini_"+to_string(gid.chamber())+"_la_"+to_string(gid.layer());
118  string hTitle_fired = "StripsFired Gemini chamber : "+to_string(gid.chamber())+", layer : "+to_string(gid.layer());
119  StripsFired_vs_eta_[ ch.id() ] = ibooker.book2D(hName_fired, hTitle_fired, 384, 1, 385, 8, 1,9);
120 
121  string hName_rh = "recHit_x_Gemini_"+to_string(gid.chamber())+"_la_"+to_string(gid.layer());
122  string hTitle_rh = "recHit local x Gemini chamber : "+to_string(gid.chamber())+", layer : "+to_string(gid.layer());
123  rh_vs_eta_[ ch.id() ] = ibooker.book2D(hName_rh, hTitle_rh, 50, -25, 25, 8, 1,9);
124  }
125 }
const GEMGeometry * GEMGeometry_
Definition: GEMDQMSource.cc:46
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:51
return((rh^lh)&mask)
std::unordered_map< UInt_t, MonitorElement * > StripsFired_vs_eta_
Definition: GEMDQMSource.cc:52
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:118
const GEMGeometry * initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMSource.cc:67
std::unordered_map< UInt_t, MonitorElement * > recHitME_
Definition: GEMDQMSource.cc:50
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:55
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
std::unordered_map< UInt_t, MonitorElement * > rh_vs_eta_
Definition: GEMDQMSource.cc:53
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMSource.cc:48
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::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
inlineoverrideprotected

Definition at line 37 of file GEMDQMSource.cc.

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

Definition at line 38 of file GEMDQMSource.cc.

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

Definition at line 86 of file GEMDQMSource.cc.

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

Referenced by ~GEMDQMSource().

87 {
89  desc.add<edm::InputTag>("recHitsInputLabel", edm::InputTag("gemRecHits", ""));
90  descriptions.add("GEMDQMSource", desc);
91 }
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 60 of file GEMDQMSource.cc.

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

Referenced by analyze().

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

Definition at line 67 of file GEMDQMSource.cc.

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

Referenced by analyze(), and bookHistograms().

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

Member Data Documentation

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

Definition at line 48 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().

const GEMGeometry* GEMDQMSource::GEMGeometry_
private

Definition at line 46 of file GEMDQMSource.cc.

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

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

Definition at line 50 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 53 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 52 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().

edm::EDGetToken GEMDQMSource::tagRecHit_
private

Definition at line 38 of file GEMDQMSource.cc.

Referenced by analyze(), and GEMDQMSource().

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

Definition at line 51 of file GEMDQMSource.cc.

Referenced by analyze(), and bookHistograms().