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:

Public Member Functions

 GEMDQMSourceDigi (const edm::ParameterSet &cfg)
 
 ~GEMDQMSourceDigi () 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::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 78 of file GEMDQMSourceDigi.cc.

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

79 {
80  tagDigi_ = consumes<GEMDigiCollection>(cfg.getParameter<edm::InputTag>("digisInputLabel"));
81 }
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 113 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().

114 {
115  const GEMGeometry* GEMGeometry_ = initGeometry(eventSetup);
116  if ( GEMGeometry_ == nullptr) return;
117 
119  event.getByToken( this->tagDigi_, gemDigis);
120  for (auto ch : gemChambers_){
121  GEMDetId cId = ch.id();
122  for(auto roll : ch.etaPartitions()){
123  GEMDetId rId = roll->id();
124  const auto& digis_in_det = gemDigis->get(rId);
125  for (auto d = digis_in_det.first; d != digis_in_det.second; ++d){
126  Digi_2D_[ cId ]->Fill(d->strip(), rId.roll());
127  Digi_1D_[ cId ]->Fill(findVFAT(1, roll->nstrips(), d->strip(), rId.roll()));
128  }
129  }
130  }
131 }
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::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
inlineoverrideprotected

Definition at line 34 of file GEMDQMSourceDigi.cc.

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

Definition at line 90 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(), reco::return(), DQMStore::IBooker::setCurrentFolder(), and GEMGeometry::superChambers().

Referenced by dqmBeginRun().

91 {
92  GEMGeometry_ = initGeometry(iSetup);
93  if ( GEMGeometry_ == nullptr) return ;
94 
95  const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
96  for (auto sch : superChambers_){
97  int n_lay = sch->nChambers();
98  for (int l=0;l<n_lay;l++){
99  gemChambers_.push_back(*sch->chamber(l+1));
100  }
101  }
102  ibooker.cd();
103  ibooker.setCurrentFolder("GEM/digi");
104  for (auto ch : gemChambers_){
105  GEMDetId gid = ch.id();
106  string hName_digi = "Digi_Strips_Gemini_"+to_string(gid.chamber())+"_l_"+to_string(gid.layer());
107  string hTitle_digi = "Digi Strip GEMINIm"+to_string(gid.chamber())+"l"+to_string(gid.layer());
108  Digi_2D_[ ch.id() ] = ibooker.book2D(hName_digi, hTitle_digi, 384, 1, 385, 8, 0.5,8.5);
109  Digi_1D_[ ch.id() ] = ibooker.book1D(hName_digi+"_VFAT", hTitle_digi+" VFAT", 24, 0, 24);
110  }
111 }
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)
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:118
const GEMGeometry * GEMGeometry_
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:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
return(e1-e2)*(e1-e2)+dp *dp
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::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
inlineoverrideprotected

Definition at line 35 of file GEMDQMSourceDigi.cc.

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

Definition at line 36 of file GEMDQMSourceDigi.cc.

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

Definition at line 83 of file GEMDQMSourceDigi.cc.

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

Referenced by ~GEMDQMSourceDigi().

84 {
86  desc.add<edm::InputTag>("digisInputLabel", edm::InputTag("muonGEMDigis", ""));
87  descriptions.add("GEMDQMSourceDigi", desc);
88 }
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 56 of file GEMDQMSourceDigi.cc.

Referenced by analyze().

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

Definition at line 63 of file GEMDQMSourceDigi.cc.

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

Referenced by analyze(), and bookHistograms().

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

Member Data Documentation

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

Definition at line 49 of file GEMDQMSourceDigi.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 48 of file GEMDQMSourceDigi.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 46 of file GEMDQMSourceDigi.cc.

Referenced by analyze(), and bookHistograms().

const GEMGeometry* GEMDQMSourceDigi::GEMGeometry_
private

Definition at line 44 of file GEMDQMSourceDigi.cc.

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

edm::EDGetToken GEMDQMSourceDigi::tagDigi_
private

Definition at line 36 of file GEMDQMSourceDigi.cc.

Referenced by analyze(), and GEMDQMSourceDigi().