CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
GEMDQMBase Class Reference

#include <GEMDQMBase.h>

Inheritance diagram for GEMDQMBase:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator > GEMDAQStatusSource GEMDigiSource GEMRecHitSource

Classes

class  BookingHelper
 
class  MEMapInfT
 
class  MEStationInfo
 

Public Types

typedef MEMapInfT< MEMap2Ids,
ME2IdsKey
MEMap2Inf
 
typedef MEMapInfT< MEMap3Ids,
ME3IdsKey
MEMap3Inf
 
typedef MEMapInfT< MEMap4Ids,
ME4IdsKey
MEMap4Inf
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 GEMDQMBase (const edm::ParameterSet &cfg)
 
 ~GEMDQMBase () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Public Attributes

std::string log_category_
 

Protected Member Functions

template<typename T >
bool checkRefs (const std::vector< T * > &)
 
dqm::impl::MonitorElementCreateSummaryHist (DQMStore::IBooker &ibooker, TString strName)
 
int GenerateMEPerChamber (DQMStore::IBooker &ibooker)
 
int getDetOccXBin (const int, const int, const int)
 
int getIEtaFromVFAT (const int station, const int vfat)
 
int getIEtaFromVFATGE11 (const int vfat)
 
int getMaxVFAT (const int)
 
int getNumEtaPartitions (const GEMStation *)
 
int getVFATNumber (const int, const int, const int)
 
int getVFATNumberByDigi (const int, const int, const int)
 
int getVFATNumberGE11 (const int, const int, const int)
 
int initGeometry (edm::EventSetup const &iSetup)
 
ME2IdsKey key3Tokey2 (ME3IdsKey key)
 
ME3IdsKey key4Tokey3 (ME4IdsKey key)
 
int keyToChamber (ME4IdsKey key)
 
int keyToIEta (ME3IdsKey key)
 
int keyToIEta (ME4IdsKey key)
 
int keyToLayer (ME3IdsKey key)
 
int keyToLayer (ME4IdsKey key)
 
int keyToRegion (ME2IdsKey key)
 
int keyToRegion (ME3IdsKey key)
 
int keyToRegion (ME4IdsKey key)
 
int keyToStation (ME2IdsKey key)
 
int keyToStation (ME3IdsKey key)
 
int keyToStation (ME4IdsKey key)
 
int loadChambers ()
 
virtual int ProcessWithMEMap2 (BookingHelper &bh, ME2IdsKey key)
 
virtual int ProcessWithMEMap2AbsReWithEta (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap2WithEta (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap3 (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap3WithChamber (BookingHelper &bh, ME4IdsKey key)
 
virtual int ProcessWithMEMap4 (BookingHelper &bh, ME4IdsKey key)
 
Float_t restrictAngle (const Float_t fTheta, const Float_t fStart)
 
int SortingLayers (std::vector< ME3IdsKey > &listLayers)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Protected Attributes

std::vector< GEMChambergemChambers_
 
const GEMGeometryGEMGeometry_
 
edm::ESGetToken< GEMGeometry,
MuonGeometryRecord
geomToken_
 
std::map< ME3IdsKey,
MEStationInfo
mapStationInfo_
 
std::map< ME3IdsKey, int > mapStationToIdx_
 
std::map< ME3IdsKey, bool > MEMap2AbsReWithEtaCheck_
 
std::map< ME2IdsKey, bool > MEMap2Check_
 
std::map< ME3IdsKey, bool > MEMap2WithEtaCheck_
 
std::map< ME3IdsKey, bool > MEMap3Check_
 
std::map< ME4IdsKey, bool > MEMap3WithChCheck_
 
std::map< ME4IdsKey, bool > MEMap4Check_
 
int nMaxNumCh_
 
Int_t nNumEtaPartitionGE0_
 
Int_t nNumEtaPartitionGE11_
 
Int_t nNumEtaPartitionGE21_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Additional Inherited Members

- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 

Detailed Description

Definition at line 29 of file GEMDQMBase.h.

Member Typedef Documentation

Definition at line 455 of file GEMDQMBase.h.

Definition at line 456 of file GEMDQMBase.h.

Definition at line 457 of file GEMDQMBase.h.

Constructor & Destructor Documentation

GEMDQMBase::GEMDQMBase ( const edm::ParameterSet cfg)
explicit

Definition at line 7 of file GEMDQMBase.cc.

References edm::BeginRun, edm::ParameterSet::getUntrackedParameter(), log_category_, nNumEtaPartitionGE0_, nNumEtaPartitionGE11_, nNumEtaPartitionGE21_, and AlCaHLTBitMon_QueryRunRegistry::string.

7  : geomToken_(esConsumes<edm::Transition::BeginRun>()) {
8  log_category_ = cfg.getUntrackedParameter<std::string>("logCategory");
9 
13 }
T getUntrackedParameter(std::string const &, T const &) const
Int_t nNumEtaPartitionGE11_
Definition: GEMDQMBase.h:567
std::string log_category_
Definition: GEMDQMBase.h:496
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMDQMBase.h:551
Int_t nNumEtaPartitionGE0_
Definition: GEMDQMBase.h:566
Int_t nNumEtaPartitionGE21_
Definition: GEMDQMBase.h:568
GEMDQMBase::~GEMDQMBase ( )
inlineoverride

Definition at line 496 of file GEMDQMBase.h.

496 {};

Member Function Documentation

template<typename T >
bool GEMDQMBase::checkRefs ( const std::vector< T * > &  refs)
inlineprotected

Definition at line 573 of file GEMDQMBase.h.

Referenced by getNumEtaPartitions().

573  {
574  if (refs.empty())
575  return false;
576  if (refs.front() == nullptr)
577  return false;
578  return true;
579 }
dqm::impl::MonitorElement * GEMDQMBase::CreateSummaryHist ( DQMStore::IBooker ibooker,
TString  strName 
)
protected

Definition at line 125 of file GEMDQMBase.cc.

References funct::abs(), dqm::implementation::IBooker::book2D(), GEMUtils::getSuffixName(), mps_fire::i, submitPVResolutionJobs::key, keyToLayer(), keyToRegion(), keyToStation(), label, mapStationInfo_, mapStationToIdx_, nMaxNumCh_, HLT_FULL_cff::region, dqm::impl::MonitorElement::setXTitle(), and SortingLayers().

Referenced by GEMDigiSource::bookHistograms(), and GEMDAQStatusSource::bookHistograms().

125  {
126  std::vector<ME3IdsKey> listLayers;
127  for (auto const& [key, stationInfo] : mapStationInfo_)
128  listLayers.push_back(key);
129  SortingLayers(listLayers);
130  for (Int_t i = 0; i < (Int_t)listLayers.size(); i++)
131  mapStationToIdx_[listLayers[i]] = i + 1;
132 
133  auto h2Res =
134  ibooker.book2D(strName, "", nMaxNumCh_, 0.5, nMaxNumCh_ + 0.5, listLayers.size(), 0.5, listLayers.size() + 0.5);
135  h2Res->setXTitle("Chamber");
136  h2Res->setYTitle("Layer");
137 
138  if (h2Res == nullptr)
139  return nullptr;
140 
141  for (Int_t i = 1; i <= nMaxNumCh_; i++)
142  h2Res->setBinLabel(i, Form("%i", i), 1);
143  for (Int_t i = 1; i <= (Int_t)listLayers.size(); i++) {
144  auto key = listLayers[i - 1];
145  auto strInfo = GEMUtils::getSuffixName(key); // NOTE: It starts with '_'
146  auto region = keyToRegion(key);
147  auto label = Form("GE%i%i-%cL%i;%s",
148  std::abs(region),
149  keyToStation(key),
150  (region > 0 ? 'P' : 'M'),
151  keyToLayer(key),
152  strInfo.Data());
153  h2Res->setBinLabel(i, label, 2);
154  Int_t nNumCh = mapStationInfo_[key].nNumChambers_;
155  h2Res->setBinContent(0, i, nNumCh);
156  }
157 
158  return h2Res;
159 }
TString getSuffixName(Int_t region_id)
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:564
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:512
std::map< ME3IdsKey, int > mapStationToIdx_
Definition: GEMDQMBase.h:563
int keyToLayer(ME3IdsKey key)
Definition: GEMDQMBase.h:518
char const * label
virtual void setXTitle(std::string const &title)
tuple key
prepare the HTCondor submission files and eventually submit them
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:515
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
int SortingLayers(std::vector< ME3IdsKey > &listLayers)
Definition: GEMDQMBase.cc:106
int nMaxNumCh_
Definition: GEMDQMBase.h:562
int GEMDQMBase::GenerateMEPerChamber ( DQMStore::IBooker ibooker)
protected

Definition at line 161 of file GEMDQMBase.cc.

References funct::abs(), GEMDetId::chamber(), gemChambers_, GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), GEMDetId::ieta(), GEMDetId::layer(), MEMap2AbsReWithEtaCheck_, MEMap2Check_, MEMap2WithEtaCheck_, MEMap3Check_, MEMap3WithChCheck_, MEMap4Check_, ProcessWithMEMap2(), ProcessWithMEMap2AbsReWithEta(), ProcessWithMEMap2WithEta(), ProcessWithMEMap3(), ProcessWithMEMap3WithChamber(), ProcessWithMEMap4(), GEMDetId::region(), and GEMDetId::station().

Referenced by GEMRecHitSource::bookHistograms(), GEMDigiSource::bookHistograms(), and GEMDAQStatusSource::bookHistograms().

161  {
162  MEMap2Check_.clear();
163  MEMap2WithEtaCheck_.clear();
164  MEMap2AbsReWithEtaCheck_.clear();
165  MEMap3Check_.clear();
166  MEMap3WithChCheck_.clear();
167  MEMap4Check_.clear();
168  for (const auto& ch : gemChambers_) {
169  GEMDetId gid = ch.id();
170  ME2IdsKey key2{gid.region(), gid.station()};
171  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
172  ME4IdsKey key3WithChamber{gid.region(), gid.station(), gid.layer(), gid.chamber()};
173  if (!MEMap2Check_[key2]) {
174  auto strSuffixName = GEMUtils::getSuffixName(key2);
175  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2);
176  BookingHelper bh2(ibooker, strSuffixName, strSuffixTitle);
177  ProcessWithMEMap2(bh2, key2);
178  MEMap2Check_[key2] = true;
179  }
180  if (!MEMap3Check_[key3]) {
181  auto strSuffixName = GEMUtils::getSuffixName(key3);
182  auto strSuffixTitle = GEMUtils::getSuffixTitle(key3);
183  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
184  ProcessWithMEMap3(bh3, key3);
185  MEMap3Check_[key3] = true;
186  }
187  if (!MEMap3WithChCheck_[key3WithChamber]) {
188  Int_t nCh = gid.chamber();
189  Int_t nLa = gid.layer();
190  char cLS = (nCh % 2 == 0 ? 'L' : 'S'); // FIXME: Is it general enough?
191  auto strSuffixName = GEMUtils::getSuffixName(key2) + Form("-%02iL%i-%c", nCh, nLa, cLS);
192  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + Form("-%02iL%i-%c", nCh, nLa, cLS);
193  BookingHelper bh3Ch(ibooker, strSuffixName, strSuffixTitle);
194  ProcessWithMEMap3WithChamber(bh3Ch, key3WithChamber);
195  MEMap3WithChCheck_[key3WithChamber] = true;
196  }
197  for (auto iEta : ch.etaPartitions()) {
198  GEMDetId eId = iEta->id();
199  ME4IdsKey key4{gid.region(), gid.station(), gid.layer(), eId.ieta()};
200  ME3IdsKey key2WithEta{gid.region(), gid.station(), eId.ieta()};
201  ME3IdsKey key2AbsReWithEta{std::abs(gid.region()), gid.station(), eId.ieta()};
202  if (!MEMap4Check_[key4]) {
203  auto strSuffixName = GEMUtils::getSuffixName(key3) + Form("-E%02i", eId.ieta());
204  auto strSuffixTitle = GEMUtils::getSuffixTitle(key3) + Form("-E%02i", eId.ieta());
205  BookingHelper bh4(ibooker, strSuffixName, strSuffixTitle);
206  ProcessWithMEMap4(bh4, key4);
207  MEMap4Check_[key4] = true;
208  }
209  if (!MEMap2WithEtaCheck_[key2WithEta]) {
210  auto strSuffixName = GEMUtils::getSuffixName(key2) + Form("-E%02i", eId.ieta());
211  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + Form("-E%02i", eId.ieta());
212  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
213  ProcessWithMEMap2WithEta(bh3, key2WithEta);
214  MEMap2WithEtaCheck_[key2WithEta] = true;
215  }
216  if (!MEMap2AbsReWithEtaCheck_[key2AbsReWithEta]) {
217  auto strSuffixName = Form("_GE%d1-E%02i", gid.station(), eId.ieta());
218  auto strSuffixTitle = Form(" GE%d1-E%02i", gid.station(), eId.ieta());
219  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
220  ProcessWithMEMap2AbsReWithEta(bh3, key2AbsReWithEta);
221  MEMap2AbsReWithEtaCheck_[key2AbsReWithEta] = true;
222  }
223  }
224  }
225  return 0;
226 }
virtual int ProcessWithMEMap4(BookingHelper &bh, ME4IdsKey key)
Definition: GEMDQMBase.h:509
TString getSuffixName(Int_t region_id)
virtual int ProcessWithMEMap2AbsReWithEta(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:507
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
TString getSuffixTitle(Int_t region_id)
constexpr int ieta() const
Definition: GEMDetId.h:199
std::map< ME3IdsKey, bool > MEMap2AbsReWithEtaCheck_
Definition: GEMDQMBase.h:557
std::map< ME2IdsKey, bool > MEMap2Check_
Definition: GEMDQMBase.h:555
virtual int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:508
std::map< ME3IdsKey, bool > MEMap3Check_
Definition: GEMDQMBase.h:558
constexpr int region() const
Definition: GEMDetId.h:171
virtual int ProcessWithMEMap3WithChamber(BookingHelper &bh, ME4IdsKey key)
Definition: GEMDQMBase.h:510
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMBase.h:553
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< ME4IdsKey, bool > MEMap4Check_
Definition: GEMDQMBase.h:560
constexpr int chamber() const
Definition: GEMDetId.h:183
constexpr int layer() const
Definition: GEMDetId.h:190
constexpr int station() const
Definition: GEMDetId.h:179
virtual int ProcessWithMEMap2WithEta(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:506
std::map< ME3IdsKey, bool > MEMap2WithEtaCheck_
Definition: GEMDQMBase.h:556
std::tuple< Int_t, Int_t > ME2IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
std::map< ME4IdsKey, bool > MEMap3WithChCheck_
Definition: GEMDQMBase.h:559
virtual int ProcessWithMEMap2(BookingHelper &bh, ME2IdsKey key)
Definition: GEMDQMBase.h:505
int GEMDQMBase::getDetOccXBin ( const int  chamber,
const int  layer,
const int  n_chambers 
)
inlineprotected

Definition at line 614 of file GEMDQMBase.h.

614  {
615  return n_chambers * (chamber - 1) + layer;
616 }
constexpr std::array< uint8_t, layerIndexSize > layer
int GEMDQMBase::getIEtaFromVFAT ( const int  station,
const int  vfat 
)
inlineprotected

Definition at line 606 of file GEMDQMBase.h.

References getIEtaFromVFATGE11().

Referenced by GEMDQMBase::MEMapInfT< M, K >::SetLabelForVFATs().

606  {
607  if (station == 1)
608  return getIEtaFromVFATGE11(vfat);
609  return getIEtaFromVFATGE11(vfat); // FIXME: What about GE21 and GE0?
610 }
int getIEtaFromVFATGE11(const int vfat)
Definition: GEMDQMBase.h:612
int GEMDQMBase::getIEtaFromVFATGE11 ( const int  vfat)
inlineprotected

Definition at line 612 of file GEMDQMBase.h.

References nNumEtaPartitionGE11_.

Referenced by getIEtaFromVFAT().

612 { return 8 - (vfat % nNumEtaPartitionGE11_); }
Int_t nNumEtaPartitionGE11_
Definition: GEMDQMBase.h:567
int GEMDQMBase::getMaxVFAT ( const int  station)
inlineprotected

Definition at line 582 of file GEMDQMBase.h.

References GEMeMap::maxVFatGE11_, and GEMeMap::maxVFatGE21_.

Referenced by loadChambers().

582  {
583  if (station == 1)
584  return GEMeMap::maxVFatGE11_;
585  else if (station == 2)
586  return GEMeMap::maxVFatGE21_;
587  else
588  return -1;
589 }
static const int maxVFatGE21_
Definition: GEMeMap.h:68
static const int maxVFatGE11_
Definition: GEMeMap.h:67
int GEMDQMBase::getNumEtaPartitions ( const GEMStation station)
protected

Definition at line 30 of file GEMDQMBase.cc.

References chambers, checkRefs(), log_category_, and GEMStation::superChambers().

Referenced by loadChambers().

30  {
31  const auto&& superchambers = station->superChambers();
32  if (not checkRefs(superchambers)) {
33  edm::LogError(log_category_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl;
34  return 0;
35  }
36 
37  const auto& chambers = superchambers.front()->chambers();
38  if (not checkRefs(chambers)) {
39  edm::LogError(log_category_) << "failed to get a valid vector of GEMChamber ptrs" << std::endl;
40  return 0;
41  }
42 
43  return chambers.front()->nEtaPartitions();
44 }
bool checkRefs(const std::vector< T * > &)
Definition: GEMDQMBase.h:573
Log< level::Error, false > LogError
std::string log_category_
Definition: GEMDQMBase.h:496
std::vector< const GEMSuperChamber * > superChambers() const
Return the super chambers in the region.
Definition: GEMStation.cc:44
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
int GEMDQMBase::getVFATNumber ( const int  station,
const int  ieta,
const int  vfat_phi 
)
inlineprotected

Definition at line 591 of file GEMDQMBase.h.

References getVFATNumberGE11().

Referenced by GEMDAQStatusSource::analyze(), and getVFATNumberByDigi().

591  {
592  if (station == 1)
593  return getVFATNumberGE11(station, ieta, vfat_phi);
594  return getVFATNumberGE11(station, ieta, vfat_phi); // FIXME: What about GE21 and GE0?
595 }
int getVFATNumberGE11(const int, const int, const int)
Definition: GEMDQMBase.h:597
int GEMDQMBase::getVFATNumberByDigi ( const int  station,
const int  ieta,
const int  digi 
)
inlineprotected

Definition at line 601 of file GEMDQMBase.h.

References getVFATNumber(), and GEMeMap::maxChan_.

Referenced by GEMDigiSource::analyze().

601  {
602  const int vfat_phi = digi / GEMeMap::maxChan_;
603  return getVFATNumber(station, ieta, vfat_phi);
604 }
int getVFATNumber(const int, const int, const int)
Definition: GEMDQMBase.h:591
static const int maxChan_
Definition: GEMeMap.h:72
int GEMDQMBase::getVFATNumberGE11 ( const int  station,
const int  ieta,
const int  vfat_phi 
)
inlineprotected

Definition at line 597 of file GEMDQMBase.h.

References nNumEtaPartitionGE11_.

Referenced by getVFATNumber().

597  {
598  return vfat_phi * nNumEtaPartitionGE11_ + (nNumEtaPartitionGE11_ - ieta);
599 }
Int_t nNumEtaPartitionGE11_
Definition: GEMDQMBase.h:567
int GEMDQMBase::initGeometry ( edm::EventSetup const &  iSetup)
protected

Definition at line 15 of file GEMDQMBase.cc.

References alignCSCRings::e, GEMGeometry_, geomToken_, edm::EventSetup::getData(), and log_category_.

Referenced by GEMRecHitSource::bookHistograms(), GEMDigiSource::bookHistograms(), and GEMDAQStatusSource::bookHistograms().

15  {
16  GEMGeometry_ = nullptr;
17  try {
18  //edm::ESHandle<GEMGeometry> hGeom;
19  //iSetup.get<MuonGeometryRecord>().get(hGeom);
20  GEMGeometry_ = &iSetup.getData(geomToken_);
22  edm::LogError(log_category_) << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
23  return -1;
24  }
25 
26  return 0;
27 }
Log< level::Error, false > LogError
std::string log_category_
Definition: GEMDQMBase.h:496
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMDQMBase.h:551
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:550
ME2IdsKey GEMDQMBase::key3Tokey2 ( ME3IdsKey  key)
inlineprotected

Definition at line 524 of file GEMDQMBase.h.

References keyToRegion(), and keyToStation().

524  {
525  auto keyNew = ME2IdsKey{keyToRegion(key), keyToStation(key)};
526  return keyNew;
527  };
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:512
tuple key
prepare the HTCondor submission files and eventually submit them
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:515
std::tuple< Int_t, Int_t > ME2IdsKey
ME3IdsKey GEMDQMBase::key4Tokey3 ( ME4IdsKey  key)
inlineprotected

Definition at line 529 of file GEMDQMBase.h.

References keyToLayer(), keyToRegion(), and keyToStation().

Referenced by GEMRecHitSource::analyze(), GEMDAQStatusSource::analyze(), GEMDAQStatusSource::FillStatusSummaryPlot(), GEMRecHitSource::ProcessWithMEMap3WithChamber(), GEMDigiSource::ProcessWithMEMap3WithChamber(), and GEMDAQStatusSource::ProcessWithMEMap3WithChamber().

529  {
530  auto keyNew = ME3IdsKey{keyToRegion(key), keyToStation(key), keyToLayer(key)};
531  return keyNew;
532  };
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:512
int keyToLayer(ME3IdsKey key)
Definition: GEMDQMBase.h:518
tuple key
prepare the HTCondor submission files and eventually submit them
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:515
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
int GEMDQMBase::keyToChamber ( ME4IdsKey  key)
inlineprotected

Definition at line 520 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

Referenced by GEMDAQStatusSource::analyze(), and GEMDAQStatusSource::FillStatusSummaryPlot().

520 { return std::get<3>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToIEta ( ME3IdsKey  key)
inlineprotected

Definition at line 521 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

Referenced by GEMRecHitSource::analyze().

521 { return std::get<2>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToIEta ( ME4IdsKey  key)
inlineprotected

Definition at line 522 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

522 { return std::get<3>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToLayer ( ME3IdsKey  key)
inlineprotected

Definition at line 518 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

Referenced by CreateSummaryHist(), and key4Tokey3().

518 { return std::get<2>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToLayer ( ME4IdsKey  key)
inlineprotected

Definition at line 519 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

519 { return std::get<2>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToRegion ( ME2IdsKey  key)
inlineprotected

Definition at line 512 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

Referenced by CreateSummaryHist(), key3Tokey2(), and key4Tokey3().

512 { return std::get<0>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToRegion ( ME3IdsKey  key)
inlineprotected

Definition at line 513 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

513 { return std::get<0>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToRegion ( ME4IdsKey  key)
inlineprotected

Definition at line 514 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

514 { return std::get<0>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToStation ( ME2IdsKey  key)
inlineprotected

Definition at line 515 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

Referenced by CreateSummaryHist(), key3Tokey2(), and key4Tokey3().

515 { return std::get<1>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToStation ( ME3IdsKey  key)
inlineprotected

Definition at line 516 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

516 { return std::get<1>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::keyToStation ( ME4IdsKey  key)
inlineprotected

Definition at line 517 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

517 { return std::get<1>(key); };
tuple key
prepare the HTCondor submission files and eventually submit them
int GEMDQMBase::loadChambers ( )
protected

Definition at line 46 of file GEMDQMBase.cc.

References gemChambers_, GEMGeometry_, getMaxVFAT(), getNumEtaPartitions(), cmsLHEtoEOSManager::l, mapStationInfo_, SiStripPI::max, GEMeMap::maxChan_, nMaxNumCh_, nNumEtaPartitionGE0_, nNumEtaPartitionGE11_, nNumEtaPartitionGE21_, HLT_FULL_cff::region, GEMGeometry::regions(), relativeConstraints::station, and GEMGeometry::superChambers().

Referenced by GEMRecHitSource::bookHistograms(), GEMDigiSource::bookHistograms(), and GEMDAQStatusSource::bookHistograms().

46  {
47  if (GEMGeometry_ == nullptr)
48  return -1;
49  gemChambers_.clear();
50  const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
51  for (auto sch : superChambers_) { // FIXME: This loop can be merged into the below loop
52  int n_lay = sch->nChambers();
53  for (int l = 0; l < n_lay; l++) {
54  Bool_t bExist = false;
55  if (not sch->chamber(l + 1))
56  continue;
57  for (const auto& ch : gemChambers_) {
58  if (ch.id() == sch->chamber(l + 1)->id()) {
59  bExist = true;
60  break;
61  }
62  }
63  if (bExist)
64  continue;
65  gemChambers_.push_back(*sch->chamber(l + 1));
66  }
67  }
68 
69  // Borrowed from DQMOffline/Muon/src/GEMOfflineMonitor.cc
70  nMaxNumCh_ = 0;
71  for (const GEMRegion* region : GEMGeometry_->regions()) {
72  const int region_number = region->region();
73 
74  for (const GEMStation* station : region->stations()) {
75  const auto&& superchambers = station->superChambers();
76 
77  const int station_number = station->station();
78  const int num_superchambers = superchambers.size();
79  const int num_layers = superchambers.front()->nChambers();
80  const int max_vfat = getMaxVFAT(station->station()); // the number of VFATs per GEMEtaPartition
81  const int num_etas = getNumEtaPartitions(station); // the number of eta partitions per GEMChamber
82  const int num_vfat = num_etas * max_vfat; // the number of VFATs per GEMChamber
83  const int num_digi = GEMeMap::maxChan_; // the number of digis (channels) per VFAT
84 
85  nMaxNumCh_ = std::max(nMaxNumCh_, num_superchambers);
86 
87  for (int layer_number = 1; layer_number <= num_layers; layer_number++) {
88  ME3IdsKey key3(region_number, station_number, layer_number);
89  mapStationInfo_[key3] =
90  MEStationInfo(region_number, station_number, layer_number, num_superchambers, num_etas, num_vfat, num_digi);
91  mapStationInfo_[key3].fMinPhi_ = -0.088344; // FIXME
92  }
93  }
94  }
95 
96  if (mapStationInfo_.find(ME3IdsKey(-1, 0, 1)) != mapStationInfo_.end())
97  nNumEtaPartitionGE0_ = mapStationInfo_[ME3IdsKey(-1, 0, 1)].nNumEtaPartitions_;
98  if (mapStationInfo_.find(ME3IdsKey(-1, 1, 1)) != mapStationInfo_.end())
99  nNumEtaPartitionGE11_ = mapStationInfo_[ME3IdsKey(-1, 1, 1)].nNumEtaPartitions_;
100  if (mapStationInfo_.find(ME3IdsKey(-1, 2, 1)) != mapStationInfo_.end())
101  nNumEtaPartitionGE21_ = mapStationInfo_[ME3IdsKey(-1, 2, 1)].nNumEtaPartitions_;
102 
103  return 0;
104 }
Int_t nNumEtaPartitionGE11_
Definition: GEMDQMBase.h:567
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:564
static const int maxChan_
Definition: GEMeMap.h:72
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:30
int getNumEtaPartitions(const GEMStation *)
Definition: GEMDQMBase.cc:30
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMBase.h:553
int getMaxVFAT(const int)
Definition: GEMDQMBase.h:582
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:36
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:550
int nMaxNumCh_
Definition: GEMDQMBase.h:562
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
Int_t nNumEtaPartitionGE0_
Definition: GEMDQMBase.h:566
Int_t nNumEtaPartitionGE21_
Definition: GEMDQMBase.h:568
virtual int GEMDQMBase::ProcessWithMEMap2 ( BookingHelper bh,
ME2IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDigiSource.

Definition at line 505 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

505 { return 0; }; // must be overrided
virtual int GEMDQMBase::ProcessWithMEMap2AbsReWithEta ( BookingHelper bh,
ME3IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMRecHitSource.

Definition at line 507 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

507 { return 0; }; // must be overrided
virtual int GEMDQMBase::ProcessWithMEMap2WithEta ( BookingHelper bh,
ME3IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDigiSource, and GEMRecHitSource.

Definition at line 506 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

506 { return 0; }; // must be overrided
virtual int GEMDQMBase::ProcessWithMEMap3 ( BookingHelper bh,
ME3IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDAQStatusSource, GEMDigiSource, and GEMRecHitSource.

Definition at line 508 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

508 { return 0; }; // must be overrided
virtual int GEMDQMBase::ProcessWithMEMap3WithChamber ( BookingHelper bh,
ME4IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDAQStatusSource, GEMDigiSource, and GEMRecHitSource.

Definition at line 510 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

510 { return 0; }; // must be overrided
virtual int GEMDQMBase::ProcessWithMEMap4 ( BookingHelper bh,
ME4IdsKey  key 
)
inlineprotectedvirtual

Definition at line 509 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

509 { return 0; }; // must be overrided
Float_t GEMDQMBase::restrictAngle ( const Float_t  fTheta,
const Float_t  fStart 
)
inlineprotected

Definition at line 618 of file GEMDQMBase.h.

References M_PI.

Referenced by GEMRecHitSource::analyze(), and GEMDigiSource::analyze().

618  {
619  Float_t fLoop = (fTheta - fStart) / (2 * M_PI);
620  int nLoop = (fLoop >= 0 ? (int)fLoop : (int)fLoop - 1);
621  return fTheta - nLoop * 2 * M_PI;
622 }
#define M_PI
int GEMDQMBase::SortingLayers ( std::vector< ME3IdsKey > &  listLayers)
protected

Definition at line 106 of file GEMDQMBase.cc.

References funct::abs().

Referenced by CreateSummaryHist().

106  {
107  std::sort(listLayers.begin(), listLayers.end(), [](ME3IdsKey key1, ME3IdsKey key2) {
108  Int_t re1 = std::get<0>(key1), st1 = std::get<1>(key1), la1 = std::get<2>(key1);
109  Int_t re2 = std::get<0>(key2), st2 = std::get<1>(key2), la2 = std::get<2>(key2);
110  if (re1 < 0 && re2 > 0)
111  return false;
112  if (re1 > 0 && re2 < 0)
113  return true;
114  Bool_t bRes = (re1 < 0); // == re2 < 0
115  Int_t sum1 = 256 * std::abs(re1) + 16 * st1 + 1 * la1;
116  Int_t sum2 = 256 * std::abs(re2) + 16 * st2 + 1 * la2;
117  if (sum1 <= sum2)
118  return bRes;
119  return !bRes;
120  });
121 
122  return 0;
123 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey

Member Data Documentation

std::vector<GEMChamber> GEMDQMBase::gemChambers_
protected
const GEMGeometry* GEMDQMBase::GEMGeometry_
protected
edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMDQMBase::geomToken_
protected

Definition at line 551 of file GEMDQMBase.h.

Referenced by initGeometry().

std::string GEMDQMBase::log_category_
std::map<ME3IdsKey, MEStationInfo> GEMDQMBase::mapStationInfo_
protected
std::map<ME3IdsKey, int> GEMDQMBase::mapStationToIdx_
protected
std::map<ME3IdsKey, bool> GEMDQMBase::MEMap2AbsReWithEtaCheck_
protected

Definition at line 557 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

std::map<ME2IdsKey, bool> GEMDQMBase::MEMap2Check_
protected

Definition at line 555 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

std::map<ME3IdsKey, bool> GEMDQMBase::MEMap2WithEtaCheck_
protected

Definition at line 556 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

std::map<ME3IdsKey, bool> GEMDQMBase::MEMap3Check_
protected

Definition at line 558 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

std::map<ME4IdsKey, bool> GEMDQMBase::MEMap3WithChCheck_
protected

Definition at line 559 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

std::map<ME4IdsKey, bool> GEMDQMBase::MEMap4Check_
protected

Definition at line 560 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

int GEMDQMBase::nMaxNumCh_
protected

Definition at line 562 of file GEMDQMBase.h.

Referenced by CreateSummaryHist(), and loadChambers().

Int_t GEMDQMBase::nNumEtaPartitionGE0_
protected

Definition at line 566 of file GEMDQMBase.h.

Referenced by GEMDQMBase(), and loadChambers().

Int_t GEMDQMBase::nNumEtaPartitionGE11_
protected

Definition at line 567 of file GEMDQMBase.h.

Referenced by GEMDQMBase(), getIEtaFromVFATGE11(), getVFATNumberGE11(), and loadChambers().

Int_t GEMDQMBase::nNumEtaPartitionGE21_
protected

Definition at line 568 of file GEMDQMBase.h.

Referenced by GEMDQMBase(), and loadChambers().