CMS 3D CMS Logo

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

Public Member Functions

 GEMDQMSourceDigi (const edm::ParameterSet &cfg)
 
 ~GEMDQMSourceDigi () 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::unordered_map< UInt_t, MonitorElement * > Digi_1D_
 
std::unordered_map< UInt_t, MonitorElement * > Digi_2D_
 
std::vector< GEMChambergemChambers_
 
const GEMGeometryGEMGeometry_
 
edm::EDGetToken tagDigi_
 

Detailed Description

Definition at line 24 of file GEMDQMSourceDigi.cc.

Constructor & Destructor Documentation

GEMDQMSourceDigi::GEMDQMSourceDigi ( const edm::ParameterSet cfg)

Definition at line 76 of file GEMDQMSourceDigi.cc.

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

77 {
78  tagDigi_ = consumes<GEMDigiCollection>(cfg.getParameter<edm::InputTag>("digisInputLabel"));
79 }
T getParameter(std::string const &) const
edm::EDGetToken tagDigi_
GEMDQMSourceDigi::~GEMDQMSourceDigi ( )
inlineoverride

Definition at line 28 of file GEMDQMSourceDigi.cc.

References fillDescriptions().

28 {};

Member Function Documentation

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

Definition at line 111 of file GEMDQMSourceDigi.cc.

References edmIntegrityCheck::d, DEFINE_FWK_MODULE, Digi_1D_, Digi_2D_, findVFAT(), gemChambers_, GEMGeometry_, initGeometry(), GEMDetId::roll(), and tagDigi_.

Referenced by dqmBeginRun().

112 {
113  const GEMGeometry* GEMGeometry_ = initGeometry(eventSetup);
114  if ( GEMGeometry_ == nullptr) return;
115 
117  event.getByToken( this->tagDigi_, gemDigis);
118  for (auto ch : gemChambers_){
119  GEMDetId cId = ch.id();
120  for(auto roll : ch.etaPartitions()){
121  GEMDetId rId = roll->id();
122  const auto& digis_in_det = gemDigis->get(rId);
123  for (auto d = digis_in_det.first; d != digis_in_det.second; ++d){
124  Digi_2D_[ cId ]->Fill(d->strip(), rId.roll());
125  Digi_1D_[ cId ]->Fill(findVFAT(1, roll->nstrips(), d->strip(), rId.roll()));
126  }
127  }
128  }
129 }
int roll() const
Definition: GEMDetId.h:80
const GEMGeometry * initGeometry(edm::EventSetup const &iSetup)
std::vector< GEMChamber > gemChambers_
int findVFAT(float min_, float max_, float x_, int roll_)
const GEMGeometry * GEMGeometry_
std::unordered_map< UInt_t, MonitorElement * > Digi_1D_
edm::EDGetToken tagDigi_
std::unordered_map< UInt_t, MonitorElement * > Digi_2D_
void GEMDQMSourceDigi::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 88 of file GEMDQMSourceDigi.cc.

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

Referenced by dqmBeginRun().

89 {
90  GEMGeometry_ = initGeometry(iSetup);
91  if ( GEMGeometry_ == nullptr) return ;
92 
93  const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
94  for (auto sch : superChambers_){
95  int n_lay = sch->nChambers();
96  for (int l=0;l<n_lay;l++){
97  gemChambers_.push_back(*sch->chamber(l+1));
98  }
99  }
100  ibooker.cd();
101  ibooker.setCurrentFolder("GEM/digi");
102  for (auto ch : gemChambers_){
103  GEMDetId gid = ch.id();
104  string hName_digi = "Digi_Strips_Gemini_"+to_string(gid.chamber())+"_l_"+to_string(gid.layer());
105  string hTitle_digi = "Digi Strip GEMINIm"+to_string(gid.chamber())+"l"+to_string(gid.layer());
106  Digi_2D_[ ch.id() ] = ibooker.book2D(hName_digi, hTitle_digi, 384, 1, 385, 8, 0.5,8.5);
107  Digi_1D_[ ch.id() ] = ibooker.book1D(hName_digi+"_VFAT", hTitle_digi+" VFAT", 24, 0, 24);
108  }
109 }
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
Definition: GEMDetId.h:74
const GEMGeometry * initGeometry(edm::EventSetup const &iSetup)
return((rh^lh)&mask)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::vector< GEMChamber > gemChambers_
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 * GEMGeometry_
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 * > Digi_1D_
std::unordered_map< UInt_t, MonitorElement * > Digi_2D_
void GEMDQMSourceDigi::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprotected

Definition at line 31 of file GEMDQMSourceDigi.cc.

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

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

Definition at line 34 of file GEMDQMSourceDigi.cc.

34 {};
void GEMDQMSourceDigi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 81 of file GEMDQMSourceDigi.cc.

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

Referenced by ~GEMDQMSourceDigi().

82 {
84  desc.add<edm::InputTag>("digisInputLabel", edm::InputTag("muonGEMDigis", ""));
85  descriptions.add("GEMDQMSourceDigi", desc);
86 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int GEMDQMSourceDigi::findVFAT ( float  min_,
float  max_,
float  x_,
int  roll_ 
)
private

Definition at line 54 of file GEMDQMSourceDigi.cc.

Referenced by analyze().

54  {
55  float step = max_/3;
56  if ( x_ < (min_+step) ) { return 8 - roll_;}
57  else if ( x_ < (min_+2*step) ) { return 16 - roll_;}
58  else { return 24 - roll_;}
59 }
step
Definition: StallMonitor.cc:94
const GEMGeometry * GEMDQMSourceDigi::initGeometry ( edm::EventSetup const &  iSetup)
private

Definition at line 61 of file GEMDQMSourceDigi.cc.

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

Referenced by analyze(), and bookHistograms().

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

Member Data Documentation

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSourceDigi::Digi_1D_
private

Definition at line 47 of file GEMDQMSourceDigi.cc.

Referenced by analyze(), and bookHistograms().

std::unordered_map<UInt_t, MonitorElement*> GEMDQMSourceDigi::Digi_2D_
private

Definition at line 46 of file GEMDQMSourceDigi.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 44 of file GEMDQMSourceDigi.cc.

Referenced by analyze(), and bookHistograms().

const GEMGeometry* GEMDQMSourceDigi::GEMGeometry_
private

Definition at line 42 of file GEMDQMSourceDigi.cc.

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

edm::EDGetToken GEMDQMSourceDigi::tagDigi_
private

Definition at line 34 of file GEMDQMSourceDigi.cc.

Referenced by analyze(), and GEMDQMSourceDigi().