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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 GEMDQMSourceDigi (const edm::ParameterSet &cfg)
 
 ~GEMDQMSourceDigi () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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 
)
overrideprotectedvirtual

Implements edm::stream::EDAnalyzerBase.

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 
)
inlineoverrideprotectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 34 of file GEMDQMSourceDigi.cc.

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

Implements DQMEDAnalyzer.

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 &   
)
inlineoverrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

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 
)
inlineoverrideprotectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 35 of file GEMDQMSourceDigi.cc.

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

Reimplemented from edm::stream::EDAnalyzerBase.

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().