CMS 3D CMS Logo

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

enum  {
  GEMDQM_RUNTYPE_ONLINE, GEMDQM_RUNTYPE_OFFLINE, GEMDQM_RUNTYPE_RELVAL, GEMDQM_RUNTYPE_ALLPLOTS,
  GEMDQM_RUNTYPE_NONE = -1
}
 
typedef MEMapInfT< MEMap2Ids, ME2IdsKeyMEMap2Inf
 
typedef MEMapInfT< MEMap3Ids, ME3IdsKeyMEMap3Inf
 
typedef MEMapInfT< MEMap4Ids, ME4IdsKeyMEMap4Inf
 
- 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)
 
int readGeometryPhiInfoChamber (const GEMStation *station, MEStationInfo &stationInfo)
 
int readGeometryRadiusInfoChamber (const GEMStation *station, MEStationInfo &stationInfo)
 
 ~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_
 
Int_t nRunType_
 

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 getIEtaFromVFATGE0 (const int vfat)
 
int getIEtaFromVFATGE11 (const int vfat)
 
int getIEtaFromVFATGE21 (const int vfat)
 
int getMaxVFAT (const int)
 
std::string getNameDirLayer (ME3IdsKey key3)
 
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, MuonGeometryRecordgeomToken_
 
std::map< ME3IdsKey, MEStationInfomapStationInfo_
 
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_
 
- 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< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Detailed Description

Definition at line 29 of file GEMDQMBase.h.

Member Typedef Documentation

◆ MEMap2Inf

Definition at line 458 of file GEMDQMBase.h.

◆ MEMap3Inf

Definition at line 459 of file GEMDQMBase.h.

◆ MEMap4Inf

Definition at line 460 of file GEMDQMBase.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
GEMDQM_RUNTYPE_ONLINE 
GEMDQM_RUNTYPE_OFFLINE 
GEMDQM_RUNTYPE_RELVAL 
GEMDQM_RUNTYPE_ALLPLOTS 
GEMDQM_RUNTYPE_NONE 

Definition at line 510 of file GEMDQMBase.h.

Constructor & Destructor Documentation

◆ GEMDQMBase()

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

Definition at line 7 of file GEMDQMBase.cc.

References edm::BeginRun, looper::cfg, GEMDQM_RUNTYPE_ALLPLOTS, GEMDQM_RUNTYPE_OFFLINE, GEMDQM_RUNTYPE_ONLINE, GEMDQM_RUNTYPE_RELVAL, log_category_, nRunType_, and AlCaHLTBitMon_QueryRunRegistry::string.

7  : geomToken_(esConsumes<edm::Transition::BeginRun>()) {
8  std::string strRunType = cfg.getUntrackedParameter<std::string>("runType");
9 
11 
12  if (strRunType == "online") {
14  } else if (strRunType == "offline") {
16  } else if (strRunType == "relval") {
18  } else if (strRunType == "allplots") {
20  } else {
21  edm::LogError(log_category_) << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
22  }
23 
24  log_category_ = cfg.getUntrackedParameter<std::string>("logCategory");
25 }
Int_t nRunType_
Definition: GEMDQMBase.h:518
Log< level::Error, false > LogError
std::string log_category_
Definition: GEMDQMBase.h:520
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMDQMBase.h:576

◆ ~GEMDQMBase()

GEMDQMBase::~GEMDQMBase ( )
inlineoverride

Definition at line 508 of file GEMDQMBase.h.

508 {};

Member Function Documentation

◆ checkRefs()

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

Definition at line 594 of file GEMDQMBase.h.

Referenced by getNumEtaPartitions().

594  {
595  if (refs.empty())
596  return false;
597  if (refs.front() == nullptr)
598  return false;
599  return true;
600 }

◆ CreateSummaryHist()

dqm::impl::MonitorElement * GEMDQMBase::CreateSummaryHist ( DQMStore::IBooker ibooker,
TString  strName 
)
protected

Definition at line 142 of file GEMDQMBase.cc.

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

Referenced by GEMDAQStatusSource::bookHistograms().

142  {
143  std::vector<ME3IdsKey> listLayers;
144  for (auto const& [key, stationInfo] : mapStationInfo_)
145  listLayers.push_back(key);
146  SortingLayers(listLayers);
147  for (Int_t i = 0; i < (Int_t)listLayers.size(); i++)
148  mapStationToIdx_[listLayers[i]] = i + 1;
149 
150  auto h2Res =
151  ibooker.book2D(strName, "", nMaxNumCh_, 0.5, nMaxNumCh_ + 0.5, listLayers.size(), 0.5, listLayers.size() + 0.5);
152  h2Res->setXTitle("Chamber");
153  h2Res->setYTitle("Layer");
154 
155  if (h2Res == nullptr)
156  return nullptr;
157 
158  for (Int_t i = 1; i <= nMaxNumCh_; i++)
159  h2Res->setBinLabel(i, Form("%i", i), 1);
160  for (Int_t i = 1; i <= (Int_t)listLayers.size(); i++) {
161  auto key = listLayers[i - 1];
162  auto strInfo = GEMUtils::getSuffixName(key); // NOTE: It starts with '_'
163  auto region = keyToRegion(key);
164  auto label =
165  Form("GE%+i1-%cL%i;%s", region * keyToStation(key), (region > 0 ? 'P' : 'M'), keyToLayer(key), strInfo.Data());
166  h2Res->setBinLabel(i, label, 2);
167  Int_t nNumCh = mapStationInfo_[key].nNumChambers_;
168  h2Res->setBinContent(0, i, nNumCh);
169  }
170 
171  return h2Res;
172 }
TString getSuffixName(Int_t region_id)
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:589
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:534
std::map< ME3IdsKey, int > mapStationToIdx_
Definition: GEMDQMBase.h:588
int keyToLayer(ME3IdsKey key)
Definition: GEMDQMBase.h:540
char const * label
virtual void setXTitle(std::string const &title)
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:537
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:212
int SortingLayers(std::vector< ME3IdsKey > &listLayers)
Definition: GEMDQMBase.cc:123
int nMaxNumCh_
Definition: GEMDQMBase.h:587

◆ GenerateMEPerChamber()

int GEMDQMBase::GenerateMEPerChamber ( DQMStore::IBooker ibooker)
protected

Definition at line 174 of file GEMDQMBase.cc.

References funct::abs(), GEMDetId::chamber(), gemChambers_, GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), L1TowerCalibrationProducer_cfi::iEta, 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().

174  {
175  MEMap2Check_.clear();
176  MEMap2WithEtaCheck_.clear();
177  MEMap2AbsReWithEtaCheck_.clear();
178  MEMap3Check_.clear();
179  MEMap3WithChCheck_.clear();
180  MEMap4Check_.clear();
181  for (const auto& ch : gemChambers_) {
182  GEMDetId gid = ch.id();
183  ME2IdsKey key2{gid.region(), gid.station()};
184  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
185  ME4IdsKey key3WithChamber{gid.region(), gid.station(), gid.layer(), gid.chamber()};
186  if (!MEMap2Check_[key2]) {
187  auto strSuffixName = GEMUtils::getSuffixName(key2);
188  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2);
189  BookingHelper bh2(ibooker, strSuffixName, strSuffixTitle);
190  ProcessWithMEMap2(bh2, key2);
191  MEMap2Check_[key2] = true;
192  }
193  if (!MEMap3Check_[key3]) {
194  auto strSuffixName = GEMUtils::getSuffixName(key3);
195  auto strSuffixTitle = GEMUtils::getSuffixTitle(key3);
196  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
197  ProcessWithMEMap3(bh3, key3);
198  MEMap3Check_[key3] = true;
199  }
200  if (!MEMap3WithChCheck_[key3WithChamber]) {
201  Int_t nCh = gid.chamber();
202  Int_t nLa = gid.layer();
203  char cLS = (nCh % 2 == 0 ? 'L' : 'S'); // FIXME: Is it general enough?
204  auto strSuffixName = GEMUtils::getSuffixName(key2) + Form("-%02iL%i-%c", nCh, nLa, cLS);
205  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + Form("-%02iL%i-%c", nCh, nLa, cLS);
206  BookingHelper bh3Ch(ibooker, strSuffixName, strSuffixTitle);
207  ProcessWithMEMap3WithChamber(bh3Ch, key3WithChamber);
208  MEMap3WithChCheck_[key3WithChamber] = true;
209  }
210  for (auto iEta : ch.etaPartitions()) {
211  GEMDetId eId = iEta->id();
212  ME4IdsKey key4{gid.region(), gid.station(), gid.layer(), eId.ieta()};
213  ME3IdsKey key2WithEta{gid.region(), gid.station(), eId.ieta()};
214  ME3IdsKey key2AbsReWithEta{std::abs(gid.region()), gid.station(), eId.ieta()};
215  if (!MEMap4Check_[key4]) {
216  auto strSuffixName = GEMUtils::getSuffixName(key3) + Form("-E%02i", eId.ieta());
217  auto strSuffixTitle = GEMUtils::getSuffixTitle(key3) + Form("-E%02i", eId.ieta());
218  BookingHelper bh4(ibooker, strSuffixName, strSuffixTitle);
219  ProcessWithMEMap4(bh4, key4);
220  MEMap4Check_[key4] = true;
221  }
222  if (!MEMap2WithEtaCheck_[key2WithEta]) {
223  auto strSuffixName = GEMUtils::getSuffixName(key2) + Form("-E%02i", eId.ieta());
224  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + Form("-E%02i", eId.ieta());
225  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
226  ProcessWithMEMap2WithEta(bh3, key2WithEta);
227  MEMap2WithEtaCheck_[key2WithEta] = true;
228  }
229  if (!MEMap2AbsReWithEtaCheck_[key2AbsReWithEta]) {
230  auto strSuffixName = Form("_GE%d1-E%02i", gid.station(), eId.ieta());
231  auto strSuffixTitle = Form(" GE%d1-E%02i", gid.station(), eId.ieta());
232  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
233  ProcessWithMEMap2AbsReWithEta(bh3, key2AbsReWithEta);
234  MEMap2AbsReWithEtaCheck_[key2AbsReWithEta] = true;
235  }
236  }
237  }
238  return 0;
239 }
constexpr int station() const
Definition: GEMDetId.h:179
constexpr int region() const
Definition: GEMDetId.h:171
virtual int ProcessWithMEMap4(BookingHelper &bh, ME4IdsKey key)
Definition: GEMDQMBase.h:531
TString getSuffixName(Int_t region_id)
virtual int ProcessWithMEMap2AbsReWithEta(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:529
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
TString getSuffixTitle(Int_t region_id)
constexpr int layer() const
Definition: GEMDetId.h:190
constexpr int chamber() const
Definition: GEMDetId.h:183
std::map< ME3IdsKey, bool > MEMap2AbsReWithEtaCheck_
Definition: GEMDQMBase.h:582
std::map< ME2IdsKey, bool > MEMap2Check_
Definition: GEMDQMBase.h:580
virtual int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:530
std::map< ME3IdsKey, bool > MEMap3Check_
Definition: GEMDQMBase.h:583
virtual int ProcessWithMEMap3WithChamber(BookingHelper &bh, ME4IdsKey key)
Definition: GEMDQMBase.h:532
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMBase.h:578
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< ME4IdsKey, bool > MEMap4Check_
Definition: GEMDQMBase.h:585
constexpr int ieta() const
Definition: GEMDetId.h:199
virtual int ProcessWithMEMap2WithEta(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:528
std::map< ME3IdsKey, bool > MEMap2WithEtaCheck_
Definition: GEMDQMBase.h:581
std::tuple< Int_t, Int_t > ME2IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
std::map< ME4IdsKey, bool > MEMap3WithChCheck_
Definition: GEMDQMBase.h:584
virtual int ProcessWithMEMap2(BookingHelper &bh, ME2IdsKey key)
Definition: GEMDQMBase.h:527

◆ getDetOccXBin()

int GEMDQMBase::getDetOccXBin ( const int  chamber,
const int  layer,
const int  n_chambers 
)
inlineprotected

Definition at line 651 of file GEMDQMBase.h.

References relativeConstraints::chamber, and phase1PixelTopology::layer.

651  {
652  return n_chambers * (chamber - 1) + layer;
653 }
constexpr std::array< uint8_t, layerIndexSize > layer

◆ getIEtaFromVFAT()

int GEMDQMBase::getIEtaFromVFAT ( const int  station,
const int  vfat 
)
inlineprotected

Definition at line 629 of file GEMDQMBase.h.

References getIEtaFromVFATGE0(), getIEtaFromVFATGE11(), getIEtaFromVFATGE21(), and relativeConstraints::station.

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

629  {
630  if (station == 0)
631  return getIEtaFromVFATGE0(vfat);
632  if (station == 1)
633  return getIEtaFromVFATGE11(vfat);
634  if (station == 2)
635  return getIEtaFromVFATGE21(vfat);
636  return getIEtaFromVFATGE11(vfat); // FIXME: What about GE21 and GE0?
637 }
int getIEtaFromVFATGE0(const int vfat)
Definition: GEMDQMBase.h:639
int getIEtaFromVFATGE21(const int vfat)
Definition: GEMDQMBase.h:647
int getIEtaFromVFATGE11(const int vfat)
Definition: GEMDQMBase.h:643

◆ getIEtaFromVFATGE0()

int GEMDQMBase::getIEtaFromVFATGE0 ( const int  vfat)
inlineprotected

Definition at line 639 of file GEMDQMBase.h.

References GEMeMap::maxiEtaIdGE0_.

Referenced by getIEtaFromVFAT().

639  {
641 }
static const int maxiEtaIdGE0_
Definition: GEMeMap.h:69

◆ getIEtaFromVFATGE11()

int GEMDQMBase::getIEtaFromVFATGE11 ( const int  vfat)
inlineprotected

Definition at line 643 of file GEMDQMBase.h.

References GEMeMap::maxiEtaIdGE11_.

Referenced by getIEtaFromVFAT().

643  {
645 }
static const int maxiEtaIdGE11_
Definition: GEMeMap.h:70

◆ getIEtaFromVFATGE21()

int GEMDQMBase::getIEtaFromVFATGE21 ( const int  vfat)
inlineprotected

Definition at line 647 of file GEMDQMBase.h.

References GEMeMap::maxiEtaIdGE21_.

Referenced by getIEtaFromVFAT().

647  {
649 }
static const int maxiEtaIdGE21_
Definition: GEMeMap.h:71

◆ getMaxVFAT()

int GEMDQMBase::getMaxVFAT ( const int  station)
inlineprotected

Definition at line 603 of file GEMDQMBase.h.

References GEMeMap::maxVFatGE0_, GEMeMap::maxVFatGE11_, GEMeMap::maxVFatGE21_, and relativeConstraints::station.

Referenced by loadChambers().

603  {
604  if (station == 0)
605  return GEMeMap::maxVFatGE0_;
606  if (station == 1)
607  return GEMeMap::maxVFatGE11_;
608  else if (station == 2)
609  return GEMeMap::maxVFatGE21_;
610  else
611  return -1;
612 }
static const int maxVFatGE0_
Definition: GEMeMap.h:66
static const int maxVFatGE21_
Definition: GEMeMap.h:68
static const int maxVFatGE11_
Definition: GEMeMap.h:67

◆ getNameDirLayer()

std::string GEMDQMBase::getNameDirLayer ( ME3IdsKey  key3)
inlineprotected

Definition at line 661 of file GEMDQMBase.h.

References keyToLayer(), keyToRegion(), keyToStation(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

661  {
662  auto nStation = keyToStation(key3);
663  char cRegion = (keyToRegion(key3) > 0 ? 'P' : 'M');
664  auto nLayer = keyToLayer(key3);
665  return std::string(Form("GE%i1-%c-L%i", nStation, cRegion, nLayer));
666 }
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:534
int keyToLayer(ME3IdsKey key)
Definition: GEMDQMBase.h:540
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:537

◆ getNumEtaPartitions()

int GEMDQMBase::getNumEtaPartitions ( const GEMStation station)
protected

Definition at line 42 of file GEMDQMBase.cc.

References chambers, checkRefs(), log_category_, and relativeConstraints::station.

Referenced by loadChambers().

42  {
43  const auto&& superchambers = station->superChambers();
44  if (not checkRefs(superchambers)) {
45  edm::LogError(log_category_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl;
46  return 0;
47  }
48 
49  const auto& chambers = superchambers.front()->chambers();
50  if (not checkRefs(chambers)) {
51  edm::LogError(log_category_) << "failed to get a valid vector of GEMChamber ptrs" << std::endl;
52  return 0;
53  }
54 
55  return chambers.front()->nEtaPartitions();
56 }
bool checkRefs(const std::vector< T *> &)
Definition: GEMDQMBase.h:594
Log< level::Error, false > LogError
std::string log_category_
Definition: GEMDQMBase.h:520
static char chambers[264][20]
Definition: ReadPGInfo.cc:243

◆ getVFATNumber()

int GEMDQMBase::getVFATNumber ( const int  station,
const int  ieta,
const int  vfat_phi 
)
inlineprotected

Definition at line 614 of file GEMDQMBase.h.

References getVFATNumberGE11(), LEDCalibrationChannels::ieta, and relativeConstraints::station.

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

614  {
615  if (station == 1)
616  return getVFATNumberGE11(station, ieta, vfat_phi);
617  return getVFATNumberGE11(station, ieta, vfat_phi); // FIXME: What about GE21 and GE0?
618 }
int getVFATNumberGE11(const int, const int, const int)
Definition: GEMDQMBase.h:620

◆ getVFATNumberByDigi()

int GEMDQMBase::getVFATNumberByDigi ( const int  station,
const int  ieta,
const int  digi 
)
inlineprotected

Definition at line 624 of file GEMDQMBase.h.

References getVFATNumber(), LEDCalibrationChannels::ieta, GEMeMap::maxChan_, and relativeConstraints::station.

Referenced by GEMDigiSource::analyze().

624  {
625  const int vfat_phi = digi / GEMeMap::maxChan_;
626  return getVFATNumber(station, ieta, vfat_phi);
627 }
int getVFATNumber(const int, const int, const int)
Definition: GEMDQMBase.h:614
static const int maxChan_
Definition: GEMeMap.h:72

◆ getVFATNumberGE11()

int GEMDQMBase::getVFATNumberGE11 ( const int  station,
const int  ieta,
const int  vfat_phi 
)
inlineprotected

Definition at line 620 of file GEMDQMBase.h.

References LEDCalibrationChannels::ieta, and GEMeMap::maxiEtaIdGE11_.

Referenced by getVFATNumber().

620  {
621  return vfat_phi * GEMeMap::maxiEtaIdGE11_ + (GEMeMap::maxiEtaIdGE11_ - ieta);
622 }
static const int maxiEtaIdGE11_
Definition: GEMeMap.h:70

◆ initGeometry()

int GEMDQMBase::initGeometry ( edm::EventSetup const &  iSetup)
protected

Definition at line 27 of file GEMDQMBase.cc.

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

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

27  {
28  GEMGeometry_ = nullptr;
29  try {
30  //edm::ESHandle<GEMGeometry> hGeom;
31  //iSetup.get<MuonGeometryRecord>().get(hGeom);
32  GEMGeometry_ = &iSetup.getData(geomToken_);
34  edm::LogError(log_category_) << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
35  return -1;
36  }
37 
38  return 0;
39 }
Log< level::Error, false > LogError
std::string log_category_
Definition: GEMDQMBase.h:520
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMDQMBase.h:576
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:575

◆ key3Tokey2()

ME2IdsKey GEMDQMBase::key3Tokey2 ( ME3IdsKey  key)
inlineprotected

Definition at line 546 of file GEMDQMBase.h.

References crabWrapper::key, keyToRegion(), and keyToStation().

546  {
547  auto keyNew = ME2IdsKey{keyToRegion(key), keyToStation(key)};
548  return keyNew;
549  };
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:534
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:537
std::tuple< Int_t, Int_t > ME2IdsKey

◆ key4Tokey3()

ME3IdsKey GEMDQMBase::key4Tokey3 ( ME4IdsKey  key)
inlineprotected

◆ keyToChamber()

int GEMDQMBase::keyToChamber ( ME4IdsKey  key)
inlineprotected

Definition at line 542 of file GEMDQMBase.h.

References crabWrapper::key.

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

542 { return std::get<3>(key); };

◆ keyToIEta() [1/2]

int GEMDQMBase::keyToIEta ( ME3IdsKey  key)
inlineprotected

Definition at line 543 of file GEMDQMBase.h.

References crabWrapper::key.

Referenced by GEMRecHitSource::analyze().

543 { return std::get<2>(key); };

◆ keyToIEta() [2/2]

int GEMDQMBase::keyToIEta ( ME4IdsKey  key)
inlineprotected

Definition at line 544 of file GEMDQMBase.h.

References crabWrapper::key.

544 { return std::get<3>(key); };

◆ keyToLayer() [1/2]

int GEMDQMBase::keyToLayer ( ME3IdsKey  key)
inlineprotected

Definition at line 540 of file GEMDQMBase.h.

References crabWrapper::key.

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

540 { return std::get<2>(key); };

◆ keyToLayer() [2/2]

int GEMDQMBase::keyToLayer ( ME4IdsKey  key)
inlineprotected

Definition at line 541 of file GEMDQMBase.h.

References crabWrapper::key.

541 { return std::get<2>(key); };

◆ keyToRegion() [1/3]

int GEMDQMBase::keyToRegion ( ME2IdsKey  key)
inlineprotected

Definition at line 534 of file GEMDQMBase.h.

References crabWrapper::key.

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

534 { return std::get<0>(key); };

◆ keyToRegion() [2/3]

int GEMDQMBase::keyToRegion ( ME3IdsKey  key)
inlineprotected

Definition at line 535 of file GEMDQMBase.h.

References crabWrapper::key.

535 { return std::get<0>(key); };

◆ keyToRegion() [3/3]

int GEMDQMBase::keyToRegion ( ME4IdsKey  key)
inlineprotected

Definition at line 536 of file GEMDQMBase.h.

References crabWrapper::key.

536 { return std::get<0>(key); };

◆ keyToStation() [1/3]

int GEMDQMBase::keyToStation ( ME2IdsKey  key)
inlineprotected

Definition at line 537 of file GEMDQMBase.h.

References crabWrapper::key.

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

537 { return std::get<1>(key); };

◆ keyToStation() [2/3]

int GEMDQMBase::keyToStation ( ME3IdsKey  key)
inlineprotected

Definition at line 538 of file GEMDQMBase.h.

References crabWrapper::key.

538 { return std::get<1>(key); };

◆ keyToStation() [3/3]

int GEMDQMBase::keyToStation ( ME4IdsKey  key)
inlineprotected

Definition at line 539 of file GEMDQMBase.h.

References crabWrapper::key.

539 { return std::get<1>(key); };

◆ loadChambers()

int GEMDQMBase::loadChambers ( )
protected

Definition at line 58 of file GEMDQMBase.cc.

References chambers, gemChambers_, GEMGeometry_, getMaxVFAT(), getNumEtaPartitions(), mapStationInfo_, SiStripPI::max, GEMeMap::maxChan_, nMaxNumCh_, readGeometryPhiInfoChamber(), readGeometryRadiusInfoChamber(), HLT_2022v12_cff::region, GEMGeometry::regions(), relativeConstraints::station, and GEMGeometry::superChambers().

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

58  {
59  if (GEMGeometry_ == nullptr)
60  return -1;
61  gemChambers_.clear();
62  const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
63  for (auto sch : superChambers_) { // FIXME: This loop can be merged into the below loop
64  for (auto pch : sch->chambers()) {
65  Bool_t bExist = false;
66  for (const auto& ch : gemChambers_) {
67  if (pch->id() == ch.id()) {
68  bExist = true;
69  break;
70  }
71  }
72  if (bExist)
73  continue;
74  gemChambers_.push_back(*pch);
75  }
76  }
77 
78  // Borrwed from DQM/GEM/src/GEMOfflineMonitor.cc
79  nMaxNumCh_ = 0;
80  for (const GEMRegion* region : GEMGeometry_->regions()) {
81  const int region_number = region->region();
82 
83  for (const GEMStation* station : region->stations()) {
84  const auto&& superchambers = station->superChambers();
85 
86  const int station_number = station->station();
87  const int num_superchambers = (station_number == 1 ? 36 : 18);
88  const int max_vfat = getMaxVFAT(station->station()); // the number of VFATs per GEMEtaPartition
89  const int num_etas = getNumEtaPartitions(station); // the number of eta partitions per GEMChamber
90  const int num_vfat = num_etas * max_vfat; // the number of VFATs per GEMChamber
91  const int num_digi = GEMeMap::maxChan_; // the number of digis (channels) per VFAT
92 
93  nMaxNumCh_ = std::max(nMaxNumCh_, num_superchambers);
94 
95  Int_t nMinIdxChamber = 1048576;
96  Int_t nMaxIdxChamber = -1048576;
97  for (auto sch : superchambers) {
98  auto nIdxChamber = sch->chambers().front()->id().chamber();
99  if (nMinIdxChamber > nIdxChamber)
100  nMinIdxChamber = nIdxChamber;
101  if (nMaxIdxChamber < nIdxChamber)
102  nMaxIdxChamber = nIdxChamber;
103  }
104 
105  const auto& chambers = superchambers.front()->chambers();
106 
107  for (auto pchamber : chambers) {
108  int layer_number = pchamber->id().layer();
109  ME3IdsKey key3(region_number, station_number, layer_number);
110  mapStationInfo_[key3] =
111  MEStationInfo(region_number, station_number, layer_number, num_superchambers, num_etas, num_vfat, num_digi);
112  mapStationInfo_[key3].nMinIdxChamber_ = nMinIdxChamber;
113  mapStationInfo_[key3].nMaxIdxChamber_ = nMaxIdxChamber;
116  }
117  }
118  }
119 
120  return 0;
121 }
int readGeometryRadiusInfoChamber(const GEMStation *station, MEStationInfo &stationInfo)
Definition: GEMDQMBase.cc:241
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:589
int readGeometryPhiInfoChamber(const GEMStation *station, MEStationInfo &stationInfo)
Definition: GEMDQMBase.cc:302
static const int maxChan_
Definition: GEMeMap.h:72
int getNumEtaPartitions(const GEMStation *)
Definition: GEMDQMBase.cc:42
std::vector< GEMChamber > gemChambers_
Definition: GEMDQMBase.h:578
int getMaxVFAT(const int)
Definition: GEMDQMBase.h:603
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:575
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:30
int nMaxNumCh_
Definition: GEMDQMBase.h:587
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
Definition: GEMGeometry.cc:36

◆ ProcessWithMEMap2()

virtual int GEMDQMBase::ProcessWithMEMap2 ( BookingHelper bh,
ME2IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDigiSource.

Definition at line 527 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

527 { return 0; }; // must be overrided

◆ ProcessWithMEMap2AbsReWithEta()

virtual int GEMDQMBase::ProcessWithMEMap2AbsReWithEta ( BookingHelper bh,
ME3IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMRecHitSource.

Definition at line 529 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

529 { return 0; }; // must be overrided

◆ ProcessWithMEMap2WithEta()

virtual int GEMDQMBase::ProcessWithMEMap2WithEta ( BookingHelper bh,
ME3IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDigiSource, and GEMRecHitSource.

Definition at line 528 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

528 { return 0; }; // must be overrided

◆ ProcessWithMEMap3()

virtual int GEMDQMBase::ProcessWithMEMap3 ( BookingHelper bh,
ME3IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDAQStatusSource, GEMDigiSource, and GEMRecHitSource.

Definition at line 530 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

530 { return 0; }; // must be overrided

◆ ProcessWithMEMap3WithChamber()

virtual int GEMDQMBase::ProcessWithMEMap3WithChamber ( BookingHelper bh,
ME4IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDAQStatusSource, GEMDigiSource, and GEMRecHitSource.

Definition at line 532 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

532 { return 0; }; // must be overrided

◆ ProcessWithMEMap4()

virtual int GEMDQMBase::ProcessWithMEMap4 ( BookingHelper bh,
ME4IdsKey  key 
)
inlineprotectedvirtual

Definition at line 531 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

531 { return 0; }; // must be overrided

◆ readGeometryPhiInfoChamber()

int GEMDQMBase::readGeometryPhiInfoChamber ( const GEMStation station,
MEStationInfo stationInfo 
)

Definition at line 302 of file GEMDQMBase.cc.

References funct::abs(), GEMDQMBase::MEStationInfo::fMinPhi_, L1TowerCalibrationProducer_cfi::iEta, SiStripPI::max, SiStripPI::min, GEMDQMBase::MEStationInfo::nMaxVFAT_, GEMDQMBase::MEStationInfo::nNumDigi_, GEMDQMBase::MEStationInfo::nNumEtaPartitions_, AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::phi(), and relativeConstraints::station.

Referenced by loadChambers().

302  {
303  auto listSuperChambers = station->superChambers();
304  Int_t nNumStripEta = stationInfo.nNumDigi_ * (stationInfo.nMaxVFAT_ / stationInfo.nNumEtaPartitions_);
305 
306  std::vector<std::pair<Int_t, std::pair<std::pair<Float_t, Float_t>, Bool_t>>> listDivPhi;
307 
308  // Obtaining phi intervals of chambers
309  for (auto superchamber : listSuperChambers) {
310  auto iEta = superchamber->chambers().front()->etaPartitions().front();
311 
312  // What is the index of the first strip? Rather than to ask to someone, let's calculate it!
313  Float_t fWidthStrip = std::abs(iEta->centreOfStrip((Int_t)1).x() - iEta->centreOfStrip((Int_t)0).x());
314  LocalPoint lpRef(-fWidthStrip / 3.0, 0.0);
315  Int_t nStripMid = (Int_t)iEta->strip(lpRef);
316  Int_t nFirstStrip = 1 - ((nNumStripEta / 2) - nStripMid);
317  Int_t nLastStrip = nFirstStrip + nNumStripEta - 1;
318 
319  auto& surface = iEta->surface();
320  LocalPoint lpF = iEta->centreOfStrip((Float_t)(nFirstStrip - 0.5)); // To avoid the round error(?)
321  LocalPoint lpL = iEta->centreOfStrip((Float_t)(nLastStrip + 0.5)); // To avoid the round error(?)
322  GlobalPoint gpF = surface.toGlobal(lpF);
323  GlobalPoint gpL = surface.toGlobal(lpL);
324 
325  Float_t fPhiF = gpF.phi();
326  Float_t fPhiL = gpL.phi();
327  if (fPhiF * fPhiL < 0 && std::abs(fPhiF) > 0.5 * 3.14159265359) {
328  if (fPhiF < 0)
329  fPhiF += 2 * 3.14159265359;
330  if (fPhiL < 0)
331  fPhiL += 2 * 3.14159265359;
332  }
333  Bool_t bFlipped = fPhiF > fPhiL;
334  Float_t fPhiMin = std::min(fPhiF, fPhiL);
335  Float_t fPhiMax = std::max(fPhiF, fPhiL);
336 
337  listDivPhi.emplace_back();
338  listDivPhi.back().first = iEta->id().chamber();
339  listDivPhi.back().second.first.first = fPhiMin;
340  listDivPhi.back().second.first.second = fPhiMax;
341  listDivPhi.back().second.second = bFlipped;
342  }
343 
344  stationInfo.fMinPhi_ = 0.0;
345  for (auto p : listDivPhi) {
346  if (p.first == 1) {
347  stationInfo.fMinPhi_ = p.second.first.first;
348  break;
349  }
350  }
351 
352  // For a future usage
353  //for ( auto p : listDivPhi ) {
354  // std::cout << "GEO_PHI: " << p.first << " "
355  // << p.second.first.first << " " << p.second.first.second << " " << p.second.second << std::endl;
356  //}
357 
358  return 0;
359 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ readGeometryRadiusInfoChamber()

int GEMDQMBase::readGeometryRadiusInfoChamber ( const GEMStation station,
MEStationInfo stationInfo 
)

Definition at line 241 of file GEMDQMBase.cc.

References mps_fire::i, L1TowerCalibrationProducer_cfi::iEta, createfilelist::int, GEMDQMBase::MEStationInfo::listRadiusEvenChamber_, GEMDQMBase::MEStationInfo::listRadiusOddChamber_, SiStripPI::max, SiStripPI::min, PV3DBase< T, PVType, FrameType >::perp(), jetUpdater_cfi::sort, relativeConstraints::station, and GEMStripTopology::stripLength().

Referenced by loadChambers().

241  {
242  auto listSuperChambers = station->superChambers();
243 
244  Bool_t bDoneEven = false, bDoneOdd = false;
245 
246  // Obtaining radius intervals of even/odd chambers
247  for (auto superchamber : listSuperChambers) {
248  Int_t chamberNo = superchamber->id().chamber();
249  if (chamberNo % 2 == 0 && bDoneEven)
250  continue;
251  if (chamberNo % 2 != 0 && bDoneOdd)
252  continue;
253 
254  auto& etaPartitions = superchamber->chambers().front()->etaPartitions();
255 
256  // A little of additional procedures to list up the radius intervals
257  // It would be independent to local direction of chambers and the order of eta partitions
258  // 1. Obtain the radius of the middle top/bottom points of the trapezoid
259  // 2. Sort these two values and determine which one is the lower/upper one
260  // 3. Keep them all and then sort them
261  // 4. The intermediate radii are set as the mean of the corresponding values of upper/lowers.
262  std::vector<Float_t> listRadiusLower, listRadiusUpper;
263  for (auto iEta : etaPartitions) {
264  const GEMStripTopology& stripTopology = dynamic_cast<const GEMStripTopology&>(iEta->specificTopology());
265  Float_t fHeight = stripTopology.stripLength();
266  LocalPoint lp1(0.0, -0.5 * fHeight), lp2(0.0, 0.5 * fHeight);
267  auto& surface = iEta->surface();
268  GlobalPoint gp1 = surface.toGlobal(lp1), gp2 = surface.toGlobal(lp2);
269  Float_t fR1 = gp1.perp(), fR2 = gp2.perp();
270  Float_t fRL = std::min(fR1, fR2), fRH = std::max(fR1, fR2);
271  listRadiusLower.push_back(fRL);
272  listRadiusUpper.push_back(fRH);
273  // For a future usage
274  //std::cout << "GEO_RADIUS: " << iEta->id().chamber() << " " << iEta->id().ieta() << " "
275  // << fRL << " " << fRH << std::endl;
276  }
277 
278  std::sort(listRadiusLower.begin(), listRadiusLower.end());
279  std::sort(listRadiusUpper.begin(), listRadiusUpper.end());
280 
281  std::vector<Float_t>& listR =
282  (chamberNo % 2 == 0 ? stationInfo.listRadiusEvenChamber_ : stationInfo.listRadiusOddChamber_);
283  listR.clear();
284  listR.push_back(listRadiusLower.front());
285  for (int i = 1; i < (int)listRadiusLower.size(); i++) {
286  listR.push_back(0.5 * (listRadiusLower[i] + listRadiusUpper[i - 1]));
287  }
288  listR.push_back(listRadiusUpper.back());
289 
290  if (chamberNo % 2 == 0)
291  bDoneEven = true;
292  if (chamberNo % 2 != 0)
293  bDoneOdd = true;
294 
295  if (bDoneEven && bDoneOdd)
296  break;
297  }
298 
299  return 0;
300 }
float stripLength() const override
T perp() const
Definition: PV3DBase.h:69

◆ restrictAngle()

Float_t GEMDQMBase::restrictAngle ( const Float_t  fTheta,
const Float_t  fStart 
)
inlineprotected

Definition at line 655 of file GEMDQMBase.h.

References createfilelist::int, and M_PI.

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

655  {
656  Float_t fLoop = (fTheta - fStart) / (2 * M_PI);
657  int nLoop = (fLoop >= 0 ? (int)fLoop : (int)fLoop - 1);
658  return fTheta - nLoop * 2 * M_PI;
659 }
#define M_PI

◆ SortingLayers()

int GEMDQMBase::SortingLayers ( std::vector< ME3IdsKey > &  listLayers)
protected

Definition at line 123 of file GEMDQMBase.cc.

References funct::abs(), and jetUpdater_cfi::sort.

Referenced by CreateSummaryHist().

123  {
124  std::sort(listLayers.begin(), listLayers.end(), [](ME3IdsKey key1, ME3IdsKey key2) {
125  Int_t re1 = std::get<0>(key1), st1 = std::get<1>(key1), la1 = std::get<2>(key1);
126  Int_t re2 = std::get<0>(key2), st2 = std::get<1>(key2), la2 = std::get<2>(key2);
127  if (re1 < 0 && re2 > 0)
128  return false;
129  if (re1 > 0 && re2 < 0)
130  return true;
131  Bool_t bRes = (re1 < 0); // == re2 < 0
132  Int_t sum1 = 256 * std::abs(re1) + 16 * st1 + 1 * la1;
133  Int_t sum2 = 256 * std::abs(re2) + 16 * st2 + 1 * la2;
134  if (sum1 <= sum2)
135  return bRes;
136  return !bRes;
137  });
138 
139  return 0;
140 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey

Member Data Documentation

◆ gemChambers_

std::vector<GEMChamber> GEMDQMBase::gemChambers_
protected

◆ GEMGeometry_

const GEMGeometry* GEMDQMBase::GEMGeometry_
protected

◆ geomToken_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMDQMBase::geomToken_
protected

Definition at line 576 of file GEMDQMBase.h.

Referenced by initGeometry().

◆ log_category_

std::string GEMDQMBase::log_category_

◆ mapStationInfo_

std::map<ME3IdsKey, MEStationInfo> GEMDQMBase::mapStationInfo_
protected

◆ mapStationToIdx_

std::map<ME3IdsKey, int> GEMDQMBase::mapStationToIdx_
protected

◆ MEMap2AbsReWithEtaCheck_

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

Definition at line 582 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap2Check_

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

Definition at line 580 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap2WithEtaCheck_

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

Definition at line 581 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap3Check_

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

Definition at line 583 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap3WithChCheck_

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

Definition at line 584 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap4Check_

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

Definition at line 585 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ nMaxNumCh_

int GEMDQMBase::nMaxNumCh_
protected

Definition at line 587 of file GEMDQMBase.h.

Referenced by CreateSummaryHist(), and loadChambers().

◆ nRunType_

Int_t GEMDQMBase::nRunType_