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 GEMPadDigiClusterSource 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
 
typedef MEMapInfT< MEMap5Ids, ME5IdsKeyMEMap5Inf
 
- 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 getIdxModule (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 getNameDirChamber (ME4IdsKey key4)
 
std::string getNameDirLayer (ME3IdsKey key3)
 
std::string getNameDirLayer (ME4IdsKey key4)
 
int getNumEtaPartitions (const GEMStation *)
 
int getNumModule (const int)
 
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)
 
ME4IdsKey key5Tokey4 (ME5IdsKey key)
 
int keyToChamber (ME4IdsKey key)
 
int keyToChamber (ME5IdsKey key)
 
int keyToChamber (ME3IdsKey key)
 
int keyToIEta (ME4IdsKey key)
 
int keyToIEta (ME5IdsKey key)
 
int keyToLayer (ME3IdsKey key)
 
int keyToLayer (ME4IdsKey key)
 
int keyToLayer (ME5IdsKey key)
 
int keyToModule (ME4IdsKey key)
 
int keyToModule (ME5IdsKey key)
 
int keyToRegion (ME2IdsKey key)
 
int keyToRegion (ME3IdsKey key)
 
int keyToRegion (ME4IdsKey key)
 
int keyToRegion (ME5IdsKey key)
 
int keyToStation (ME2IdsKey key)
 
int keyToStation (ME3IdsKey key)
 
int keyToStation (ME4IdsKey key)
 
int keyToStation (ME5IdsKey key)
 
int loadChambers ()
 
virtual int ProcessWithMEMap2 (BookingHelper &bh, ME2IdsKey key)
 
virtual int ProcessWithMEMap2AbsReWithEta (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap2WithChamber (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap2WithEta (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap2WithEtaCh (BookingHelper &bh, ME4IdsKey key)
 
virtual int ProcessWithMEMap3 (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap4 (BookingHelper &bh, ME4IdsKey key)
 
virtual int ProcessWithMEMap4WithChamber (BookingHelper &bh, ME4IdsKey key)
 
virtual int ProcessWithMEMap5 (BookingHelper &bh, ME5IdsKey key)
 
virtual int ProcessWithMEMap5WithChamber (BookingHelper &bh, ME5IdsKey key)
 
Float_t restrictAngle (const Float_t fTheta, const Float_t fStart)
 
int SortingLayers (std::vector< ME4IdsKey > &listLayers)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Protected Attributes

const GEMGeometryGEMGeometry_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomToken_
 
std::vector< GEMDetIdlistChamberId_
 
std::map< GEMDetId, std::vector< const GEMEtaPartition * > > mapEtaPartition_
 
std::map< ME3IdsKey, MEStationInfomapStationInfo_
 
std::map< ME4IdsKey, int > mapStationToIdx_
 
std::map< ME3IdsKey, bool > MEMap2AbsReWithEtaCheck_
 
std::map< ME2IdsKey, bool > MEMap2Check_
 
std::map< ME3IdsKey, bool > MEMap2WithChCheck_
 
std::map< ME4IdsKey, bool > MEMap2WithEtaChCheck_
 
std::map< ME3IdsKey, bool > MEMap2WithEtaCheck_
 
std::map< ME3IdsKey, bool > MEMap3Check_
 
std::map< ME4IdsKey, bool > MEMap4Check_
 
std::map< ME4IdsKey, bool > MEMap4WithChCheck_
 
std::map< ME5IdsKey, bool > MEMap5Check_
 
std::map< ME5IdsKey, bool > MEMap5WithChCheck_
 
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 473 of file GEMDQMBase.h.

◆ MEMap3Inf

Definition at line 474 of file GEMDQMBase.h.

◆ MEMap4Inf

Definition at line 475 of file GEMDQMBase.h.

◆ MEMap5Inf

Definition at line 476 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 537 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:545
Log< level::Error, false > LogError
std::string log_category_
Definition: GEMDQMBase.h:547
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMDQMBase.h:630

◆ ~GEMDQMBase()

GEMDQMBase::~GEMDQMBase ( )
inlineoverride

Definition at line 535 of file GEMDQMBase.h.

535 {};

Member Function Documentation

◆ checkRefs()

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

Definition at line 657 of file GEMDQMBase.h.

Referenced by getNumEtaPartitions().

657  {
658  if (refs.empty())
659  return false;
660  if (refs.front() == nullptr)
661  return false;
662  return true;
663 }

◆ CreateSummaryHist()

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

Definition at line 150 of file GEMDQMBase.cc.

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

Referenced by GEMDAQStatusSource::bookHistograms().

150  {
151  std::vector<ME4IdsKey> listLayers;
152  for (auto const& [key3, stationInfo] : mapStationInfo_) {
153  for (int module_number = 1; module_number <= stationInfo.nNumModules_; module_number++) {
154  ME4IdsKey key4{keyToRegion(key3), keyToStation(key3), keyToLayer(key3), module_number};
155  listLayers.push_back(key4); // Note: Not only count layers but also modules
156  }
157  }
158  SortingLayers(listLayers);
159  for (Int_t i = 0; i < (Int_t)listLayers.size(); i++)
160  mapStationToIdx_[listLayers[i]] = i + 1;
161 
162  auto h2Res =
163  ibooker.book2D(strName, "", nMaxNumCh_, 0.5, nMaxNumCh_ + 0.5, listLayers.size(), 0.5, listLayers.size() + 0.5);
164  h2Res->setXTitle("Chamber");
165  h2Res->setYTitle("Layer");
166 
167  if (h2Res == nullptr)
168  return nullptr;
169 
170  for (Int_t i = 1; i <= nMaxNumCh_; i++)
171  h2Res->setBinLabel(i, Form("%i", i), 1);
172  for (Int_t i = 1; i <= (Int_t)listLayers.size(); i++) {
173  auto key = listLayers[i - 1];
174  ME3IdsKey key3 = key4Tokey3(key);
175 
176  auto region = keyToRegion(key);
177  auto strInfo = GEMUtils::getSuffixName(key3); // NOTE: It starts with '_'
178  if (mapStationInfo_[key3].nNumModules_ > 1) {
179  strInfo += Form("-M%i", keyToModule(key));
180  }
181  auto label = Form("GE%+i1-%cL%i-M%i;%s",
183  (region > 0 ? 'P' : 'M'),
184  keyToLayer(key),
185  keyToModule(key),
186  strInfo.Data());
187  h2Res->setBinLabel(i, label, 2);
188  Int_t nNumCh = mapStationInfo_[key3].nNumChambers_;
189  h2Res->setBinContent(0, i, nNumCh);
190  }
191 
192  return h2Res;
193 }
int keyToModule(ME4IdsKey key)
Definition: GEMDQMBase.h:581
TString getSuffixName(Int_t region_id)
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:651
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:570
int keyToLayer(ME3IdsKey key)
Definition: GEMDQMBase.h:578
int SortingLayers(std::vector< ME4IdsKey > &listLayers)
Definition: GEMDQMBase.cc:129
char const * label
virtual void setXTitle(std::string const &title)
key
prepare the HTCondor submission files and eventually submit them
std::map< ME4IdsKey, int > mapStationToIdx_
Definition: GEMDQMBase.h:652
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:574
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:221
ME3IdsKey key4Tokey3(ME4IdsKey key)
Definition: GEMDQMBase.h:596
int nMaxNumCh_
Definition: GEMDQMBase.h:650
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey

◆ GenerateMEPerChamber()

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

Definition at line 195 of file GEMDQMBase.cc.

References funct::abs(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), l1tPhase2CaloJetEmulator_cfi::iEta, GEMDetId::ieta(), listChamberId_, mapEtaPartition_, mapStationInfo_, MEMap2AbsReWithEtaCheck_, MEMap2Check_, MEMap2WithChCheck_, MEMap2WithEtaChCheck_, MEMap2WithEtaCheck_, MEMap3Check_, MEMap4Check_, MEMap4WithChCheck_, MEMap5Check_, MEMap5WithChCheck_, run3scouting_cff::nCh, ProcessWithMEMap2(), ProcessWithMEMap2AbsReWithEta(), ProcessWithMEMap2WithChamber(), ProcessWithMEMap2WithEta(), ProcessWithMEMap2WithEtaCh(), ProcessWithMEMap3(), ProcessWithMEMap4(), ProcessWithMEMap4WithChamber(), ProcessWithMEMap5(), and ProcessWithMEMap5WithChamber().

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

195  {
196  MEMap2Check_.clear();
197  MEMap3Check_.clear();
198  MEMap4Check_.clear();
199  MEMap5Check_.clear();
200  MEMap2WithEtaCheck_.clear();
201  MEMap2AbsReWithEtaCheck_.clear();
202 
203  MEMap2WithChCheck_.clear();
204 
205  MEMap4WithChCheck_.clear();
206  MEMap5WithChCheck_.clear();
207 
208  MEMap2WithEtaChCheck_.clear();
209  for (auto gid : listChamberId_) {
210  ME2IdsKey key2{gid.region(), gid.station()};
211  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
212  /*******************/
213  ME3IdsKey key2WithChamber{gid.region(), gid.station(), gid.chamber()};
214  /******************/
215  const auto num_mod = mapStationInfo_[key3].nNumModules_;
216  for (int module_number = 1; module_number <= num_mod; module_number++) {
217  ME4IdsKey key4{gid.region(), gid.station(), gid.layer(), module_number};
218  ME4IdsKey key4WithChamber{gid.region(), gid.station(), gid.layer(), gid.chamber()};
219  ME5IdsKey key5WithChamber{gid.region(), gid.station(), gid.layer(), module_number, gid.chamber()};
220  if (!MEMap2Check_[key2]) {
221  auto strSuffixName = GEMUtils::getSuffixName(key2);
222  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2);
223  BookingHelper bh2(ibooker, strSuffixName, strSuffixTitle);
224  ProcessWithMEMap2(bh2, key2);
225  MEMap2Check_[key2] = true;
226  }
227  if (!MEMap2WithChCheck_[key2WithChamber]) {
228  Int_t nCh = gid.chamber();
229  //Int_t nLa = gid.layer();
230  char cLS = (nCh % 2 == 0 ? 'L' : 'S'); // FIXME: Is it general enough?
231  auto strSuffixName = GEMUtils::getSuffixName(key2) + Form("-%02i-%c", nCh, cLS);
232  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + Form("-%02i-%c", nCh, cLS);
233  BookingHelper bh2Ch(ibooker, strSuffixName, strSuffixTitle);
234  ProcessWithMEMap2WithChamber(bh2Ch, key2WithChamber);
235  MEMap2WithChCheck_[key2WithChamber] = true;
236  }
237  if (!MEMap3Check_[key3]) {
238  auto strSuffixName = GEMUtils::getSuffixName(key3);
239  auto strSuffixTitle = GEMUtils::getSuffixTitle(key3);
240  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
241  ProcessWithMEMap3(bh3, key3);
242  MEMap3Check_[key3] = true;
243  }
244  if (!MEMap4Check_[key4]) {
245  Int_t nLa = gid.layer();
246  TString strSuffixCh = Form("-L%i", nLa);
247  if (mapStationInfo_[key3].nNumModules_ > 1)
248  strSuffixCh = Form("-L%i-M%i", nLa, module_number);
249  auto strSuffixName = GEMUtils::getSuffixName(key2) + strSuffixCh;
250  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + strSuffixCh;
251  BookingHelper bh4(ibooker, strSuffixName, strSuffixTitle);
252  ProcessWithMEMap4(bh4, key4);
253  MEMap4Check_[key4] = true;
254  }
255  if (!MEMap4WithChCheck_[key4WithChamber]) {
256  Int_t nCh = gid.chamber();
257  Int_t nLa = gid.layer();
258  char cLS = (nCh % 2 == 0 ? 'L' : 'S'); // FIXME: Is it general enough?
259  TString strSuffixCh = Form("-%02iL%i-%c", nCh, nLa, cLS);
260  auto strSuffixName = GEMUtils::getSuffixName(key2) + strSuffixCh;
261  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + strSuffixCh;
262  BookingHelper bh4Ch(ibooker, strSuffixName, strSuffixTitle);
263  ProcessWithMEMap4WithChamber(bh4Ch, key4WithChamber);
264  MEMap4WithChCheck_[key4WithChamber] = true;
265  }
266  if (!MEMap5WithChCheck_[key5WithChamber]) {
267  Int_t nCh = gid.chamber();
268  Int_t nLa = gid.layer();
269  char cLS = (nCh % 2 == 0 ? 'L' : 'S'); // FIXME: Is it general enough?
270  TString strSuffixCh = Form("-%02iL%i-%c", nCh, nLa, cLS);
271  if (mapStationInfo_[key3].nNumModules_ > 1)
272  strSuffixCh = Form("-%02iL%i-M%i-%c", nCh, nLa, module_number, cLS);
273  auto strSuffixName = GEMUtils::getSuffixName(key2) + strSuffixCh;
274  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + strSuffixCh;
275  BookingHelper bh5Ch(ibooker, strSuffixName, strSuffixTitle);
276  ProcessWithMEMap5WithChamber(bh5Ch, key5WithChamber);
277  MEMap5WithChCheck_[key5WithChamber] = true;
278  }
279  for (auto iEta : mapEtaPartition_[gid]) {
280  GEMDetId eId = iEta->id();
281  ME5IdsKey key5{gid.region(), gid.station(), gid.layer(), module_number, eId.ieta()};
282  /*******************/
283  ME4IdsKey key2WithEtaCh{gid.region(), gid.station(), eId.ieta(), gid.chamber()};
284  /******************/
285  ME3IdsKey key2WithEta{gid.region(), gid.station(), eId.ieta()};
286  ME3IdsKey key2AbsReWithEta{std::abs(gid.region()), gid.station(), eId.ieta()};
287  if (!MEMap5Check_[key5]) {
288  auto strSuffixName = GEMUtils::getSuffixName(key3) + Form("-E%02i", eId.ieta());
289  auto strSuffixTitle = GEMUtils::getSuffixTitle(key3) + Form("-E%02i", eId.ieta());
290  BookingHelper bh5(ibooker, strSuffixName, strSuffixTitle);
291  ProcessWithMEMap5(bh5, key5);
292  MEMap5Check_[key5] = true;
293  }
294  if (!MEMap2WithEtaChCheck_[key2WithEtaCh]) {
295  Int_t nCh = gid.chamber();
296  //Int_t nLa = gid.layer();
297  char cLS = (nCh % 2 == 0 ? 'L' : 'S');
298  auto strSuffixName = GEMUtils::getSuffixName(key2) + Form("-%02i-%c-E%02i", nCh, cLS, eId.ieta());
299  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + Form("-%02i-%c-E%02i", nCh, cLS, eId.ieta());
300  BookingHelper bh4(ibooker, strSuffixName, strSuffixTitle);
301  ProcessWithMEMap2WithEtaCh(bh4, key2WithEtaCh);
302  MEMap2WithEtaChCheck_[key2WithEtaCh] = true;
303  }
304  if (!MEMap2WithEtaCheck_[key2WithEta]) {
305  auto strSuffixName = GEMUtils::getSuffixName(key2) + Form("-E%02i", eId.ieta());
306  auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + Form("-E%02i", eId.ieta());
307  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
308  ProcessWithMEMap2WithEta(bh3, key2WithEta);
309  MEMap2WithEtaCheck_[key2WithEta] = true;
310  }
311  if (!MEMap2AbsReWithEtaCheck_[key2AbsReWithEta]) {
312  auto strSuffixName = Form("_GE%d1-E%02i", gid.station(), eId.ieta());
313  auto strSuffixTitle = Form(" GE%d1-E%02i", gid.station(), eId.ieta());
314  BookingHelper bh3(ibooker, strSuffixName, strSuffixTitle);
315  ProcessWithMEMap2AbsReWithEta(bh3, key2AbsReWithEta);
316  MEMap2AbsReWithEtaCheck_[key2AbsReWithEta] = true;
317  }
318  }
319  }
320  }
321  return 0;
322 }
std::map< ME5IdsKey, bool > MEMap5WithChCheck_
Definition: GEMDQMBase.h:647
virtual int ProcessWithMEMap2WithEtaCh(BookingHelper &bh, ME4IdsKey key)
Definition: GEMDQMBase.h:564
std::map< ME3IdsKey, bool > MEMap2WithChCheck_
Definition: GEMDQMBase.h:639
virtual int ProcessWithMEMap4(BookingHelper &bh, ME4IdsKey key)
Definition: GEMDQMBase.h:558
TString getSuffixName(Int_t region_id)
std::tuple< Int_t, Int_t, Int_t, Int_t, Int_t > ME5IdsKey
std::vector< GEMDetId > listChamberId_
Definition: GEMDQMBase.h:632
virtual int ProcessWithMEMap2AbsReWithEta(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:556
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
virtual int ProcessWithMEMap5WithChamber(BookingHelper &bh, ME5IdsKey key)
Definition: GEMDQMBase.h:568
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:651
TString getSuffixTitle(Int_t region_id)
std::map< ME3IdsKey, bool > MEMap2AbsReWithEtaCheck_
Definition: GEMDQMBase.h:637
std::map< ME2IdsKey, bool > MEMap2Check_
Definition: GEMDQMBase.h:635
virtual int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:557
std::map< ME3IdsKey, bool > MEMap3Check_
Definition: GEMDQMBase.h:644
virtual int ProcessWithMEMap2WithChamber(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:561
virtual int ProcessWithMEMap5(BookingHelper &bh, ME5IdsKey key)
Definition: GEMDQMBase.h:559
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::map< ME5IdsKey, bool > MEMap5Check_
Definition: GEMDQMBase.h:648
std::map< ME4IdsKey, bool > MEMap4Check_
Definition: GEMDQMBase.h:645
virtual int ProcessWithMEMap4WithChamber(BookingHelper &bh, ME4IdsKey key)
Definition: GEMDQMBase.h:567
constexpr int ieta() const
Definition: GEMDetId.h:199
std::map< ME4IdsKey, bool > MEMap4WithChCheck_
Definition: GEMDQMBase.h:646
virtual int ProcessWithMEMap2WithEta(BookingHelper &bh, ME3IdsKey key)
Definition: GEMDQMBase.h:555
std::map< ME3IdsKey, bool > MEMap2WithEtaCheck_
Definition: GEMDQMBase.h:636
std::map< GEMDetId, std::vector< const GEMEtaPartition * > > mapEtaPartition_
Definition: GEMDQMBase.h:633
std::map< ME4IdsKey, bool > MEMap2WithEtaChCheck_
Definition: GEMDQMBase.h:642
std::tuple< Int_t, Int_t > ME2IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
virtual int ProcessWithMEMap2(BookingHelper &bh, ME2IdsKey key)
Definition: GEMDQMBase.h:554

◆ getDetOccXBin()

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

Definition at line 736 of file GEMDQMBase.h.

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

736  {
737  return n_chambers * (chamber - 1) + layer;
738 }

◆ getIdxModule()

int GEMDQMBase::getIdxModule ( const int  station,
const int  chamberType 
)
inlineprotected

Definition at line 688 of file GEMDQMBase.h.

References nano_mu_digi_cff::chamberType, and relativeConstraints::station.

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

688  {
689  if (station == 0)
690  return 1;
691  if (station == 1)
692  return 1;
693  else if (station == 2)
694  return chamberType - 20;
695  else
696  return -1;
697 }

◆ getIEtaFromVFAT()

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

Definition at line 714 of file GEMDQMBase.h.

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

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

714  {
715  if (station == 0)
716  return getIEtaFromVFATGE0(vfat);
717  if (station == 1)
718  return getIEtaFromVFATGE11(vfat);
719  if (station == 2)
720  return getIEtaFromVFATGE21(vfat);
721  return getIEtaFromVFATGE11(vfat); // FIXME: What about GE21 and GE0?
722 }
int getIEtaFromVFATGE0(const int vfat)
Definition: GEMDQMBase.h:724
int getIEtaFromVFATGE21(const int vfat)
Definition: GEMDQMBase.h:732
int getIEtaFromVFATGE11(const int vfat)
Definition: GEMDQMBase.h:728

◆ getIEtaFromVFATGE0()

int GEMDQMBase::getIEtaFromVFATGE0 ( const int  vfat)
inlineprotected

Definition at line 724 of file GEMDQMBase.h.

References GEMeMap::maxiEtaIdGE0_.

Referenced by getIEtaFromVFAT().

724  {
726 }
static const int maxiEtaIdGE0_
Definition: GEMeMap.h:69

◆ getIEtaFromVFATGE11()

int GEMDQMBase::getIEtaFromVFATGE11 ( const int  vfat)
inlineprotected

Definition at line 728 of file GEMDQMBase.h.

References GEMeMap::maxiEtaIdGE11_.

Referenced by getIEtaFromVFAT().

728  {
730 }
static const int maxiEtaIdGE11_
Definition: GEMeMap.h:70

◆ getIEtaFromVFATGE21()

int GEMDQMBase::getIEtaFromVFATGE21 ( const int  vfat)
inlineprotected

Definition at line 732 of file GEMDQMBase.h.

References GEMeMap::maxiEtaIdGE21_.

Referenced by getIEtaFromVFAT().

732  {
734 }
static const int maxiEtaIdGE21_
Definition: GEMeMap.h:71

◆ getMaxVFAT()

int GEMDQMBase::getMaxVFAT ( const int  station)
inlineprotected

Definition at line 666 of file GEMDQMBase.h.

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

Referenced by loadChambers().

666  {
667  if (station == 0)
668  return GEMeMap::maxVFatGE0_;
669  if (station == 1)
670  return GEMeMap::maxVFatGE11_;
671  else if (station == 2)
672  return GEMeMap::maxVFatGE21_ / 2;
673  else
674  return -1;
675 }
static const int maxVFatGE0_
Definition: GEMeMap.h:66
static const int maxVFatGE21_
Definition: GEMeMap.h:68
static const int maxVFatGE11_
Definition: GEMeMap.h:67

◆ getNameDirChamber()

std::string GEMDQMBase::getNameDirChamber ( ME4IdsKey  key4)
inlineprotected

Definition at line 764 of file GEMDQMBase.h.

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

764  {
765  auto nStation = keyToStation(key4);
766  char cRegion = (keyToRegion(key4) > 0 ? 'P' : 'M');
767  auto nChamber = keyToChamber(key4);
768  return std::string(Form("GE%i1-%c-Ch%i", nStation, cRegion, nChamber));
769 }
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:570
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:574
int keyToChamber(ME4IdsKey key)
Definition: GEMDQMBase.h:583

◆ getNameDirLayer() [1/2]

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

Definition at line 746 of file GEMDQMBase.h.

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

Referenced by GEMRecHitSource::ProcessWithMEMap4WithChamber(), GEMPadDigiClusterSource::ProcessWithMEMap4WithChamber(), GEMDigiSource::ProcessWithMEMap5WithChamber(), and GEMDAQStatusSource::ProcessWithMEMap5WithChamber().

746  {
747  auto nStation = keyToStation(key3);
748  char cRegion = (keyToRegion(key3) > 0 ? 'P' : 'M');
749  auto nLayer = keyToLayer(key3);
750  return std::string(Form("GE%i1-%c-L%i", nStation, cRegion, nLayer));
751 }
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:570
int keyToLayer(ME3IdsKey key)
Definition: GEMDQMBase.h:578
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:574

◆ getNameDirLayer() [2/2]

std::string GEMDQMBase::getNameDirLayer ( ME4IdsKey  key4)
inlineprotected

Definition at line 753 of file GEMDQMBase.h.

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

753  {
754  auto nStation = keyToStation(key4);
755  char cRegion = (keyToRegion(key4) > 0 ? 'P' : 'M');
756  auto nLayer = keyToLayer(key4);
757  if (nStation == 2) {
758  auto nModule = keyToModule(key4);
759  return std::string(Form("GE%i1-%c-L%i-M%i", nStation, cRegion, nLayer, nModule));
760  }
761  return std::string(Form("GE%i1-%c-L%i", nStation, cRegion, nLayer));
762 }
int keyToModule(ME4IdsKey key)
Definition: GEMDQMBase.h:581
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:570
int keyToLayer(ME3IdsKey key)
Definition: GEMDQMBase.h:578
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:574

◆ getNumEtaPartitions()

int GEMDQMBase::getNumEtaPartitions ( const GEMStation station)
protected

Definition at line 40 of file GEMDQMBase.cc.

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

Referenced by loadChambers().

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

◆ getNumModule()

int GEMDQMBase::getNumModule ( const int  station)
inlineprotected

Definition at line 677 of file GEMDQMBase.h.

References relativeConstraints::station.

Referenced by loadChambers().

677  {
678  if (station == 0)
679  return 1;
680  if (station == 1)
681  return 1;
682  else if (station == 2)
683  return 4;
684  else
685  return -1;
686 }

◆ getVFATNumber()

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

Definition at line 699 of file GEMDQMBase.h.

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

Referenced by getVFATNumberByDigi().

699  {
700  if (station == 1)
701  return getVFATNumberGE11(station, ieta, vfat_phi);
702  return getVFATNumberGE11(station, ieta, vfat_phi); // FIXME: What about GE21 and GE0?
703 }
int getVFATNumberGE11(const int, const int, const int)
Definition: GEMDQMBase.h:705

◆ getVFATNumberByDigi()

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

Definition at line 709 of file GEMDQMBase.h.

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

709  {
710  const int vfat_phi = digi / GEMeMap::maxChan_;
711  return getVFATNumber(station, ieta, vfat_phi);
712 }
int getVFATNumber(const int, const int, const int)
Definition: GEMDQMBase.h:699
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 705 of file GEMDQMBase.h.

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

Referenced by getVFATNumber().

705  {
706  return vfat_phi * GEMeMap::maxiEtaIdGE11_ + (GEMeMap::maxiEtaIdGE11_ - ieta);
707 }
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 GEMGeometry_, geomToken_, edm::EventSetup::getHandle(), patZpeak::handle, and log_category_.

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

27  {
28  GEMGeometry_ = nullptr;
29  if (auto handle = iSetup.getHandle(geomToken_)) {
30  GEMGeometry_ = handle.product();
31  } else {
32  edm::LogError(log_category_) << "+++ Error : GEM geometry is unavailable on event loop. +++\n";
33  return -1;
34  }
35 
36  return 0;
37 }
Log< level::Error, false > LogError
std::string log_category_
Definition: GEMDQMBase.h:547
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Definition: GEMDQMBase.h:630
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:629

◆ key3Tokey2()

ME2IdsKey GEMDQMBase::key3Tokey2 ( ME3IdsKey  key)
inlineprotected

Definition at line 591 of file GEMDQMBase.h.

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

591  {
592  auto keyNew = ME2IdsKey{keyToRegion(key), keyToStation(key)};
593  return keyNew;
594  };
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:570
key
prepare the HTCondor submission files and eventually submit them
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:574
std::tuple< Int_t, Int_t > ME2IdsKey

◆ key4Tokey3()

ME3IdsKey GEMDQMBase::key4Tokey3 ( ME4IdsKey  key)
inlineprotected

◆ key5Tokey4()

ME4IdsKey GEMDQMBase::key5Tokey4 ( ME5IdsKey  key)
inlineprotected

Definition at line 601 of file GEMDQMBase.h.

References submitPVResolutionJobs::key, keyToLayer(), keyToModule(), keyToRegion(), and keyToStation().

Referenced by GEMDAQStatusSource::FillStatusSummaryPlot(), GEMDigiSource::ProcessWithMEMap5WithChamber(), and GEMDAQStatusSource::ProcessWithMEMap5WithChamber().

601  {
603  return keyNew;
604  };
int keyToModule(ME4IdsKey key)
Definition: GEMDQMBase.h:581
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
int keyToRegion(ME2IdsKey key)
Definition: GEMDQMBase.h:570
int keyToLayer(ME3IdsKey key)
Definition: GEMDQMBase.h:578
key
prepare the HTCondor submission files and eventually submit them
int keyToStation(ME2IdsKey key)
Definition: GEMDQMBase.h:574

◆ keyToChamber() [1/3]

int GEMDQMBase::keyToChamber ( ME4IdsKey  key)
inlineprotected

Definition at line 583 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

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

583 { return std::get<3>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToChamber() [2/3]

int GEMDQMBase::keyToChamber ( ME5IdsKey  key)
inlineprotected

Definition at line 584 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

584 { return std::get<4>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToChamber() [3/3]

int GEMDQMBase::keyToChamber ( ME3IdsKey  key)
inlineprotected

Definition at line 586 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

586 { return std::get<2>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToIEta() [1/2]

int GEMDQMBase::keyToIEta ( ME4IdsKey  key)
inlineprotected

Definition at line 588 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

Referenced by GEMRecHitSource::analyze().

588 { return std::get<3>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToIEta() [2/2]

int GEMDQMBase::keyToIEta ( ME5IdsKey  key)
inlineprotected

Definition at line 589 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

589 { return std::get<4>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToLayer() [1/3]

int GEMDQMBase::keyToLayer ( ME3IdsKey  key)
inlineprotected

Definition at line 578 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

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

578 { return std::get<2>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToLayer() [2/3]

int GEMDQMBase::keyToLayer ( ME4IdsKey  key)
inlineprotected

Definition at line 579 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

579 { return std::get<2>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToLayer() [3/3]

int GEMDQMBase::keyToLayer ( ME5IdsKey  key)
inlineprotected

Definition at line 580 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

580 { return std::get<2>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToModule() [1/2]

int GEMDQMBase::keyToModule ( ME4IdsKey  key)
inlineprotected

Definition at line 581 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

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

581 { return std::get<3>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToModule() [2/2]

int GEMDQMBase::keyToModule ( ME5IdsKey  key)
inlineprotected

Definition at line 582 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

582 { return std::get<3>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToRegion() [1/4]

int GEMDQMBase::keyToRegion ( ME2IdsKey  key)
inlineprotected

Definition at line 570 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

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

570 { return std::get<0>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToRegion() [2/4]

int GEMDQMBase::keyToRegion ( ME3IdsKey  key)
inlineprotected

Definition at line 571 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

571 { return std::get<0>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToRegion() [3/4]

int GEMDQMBase::keyToRegion ( ME4IdsKey  key)
inlineprotected

Definition at line 572 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

572 { return std::get<0>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToRegion() [4/4]

int GEMDQMBase::keyToRegion ( ME5IdsKey  key)
inlineprotected

Definition at line 573 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

573 { return std::get<0>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToStation() [1/4]

int GEMDQMBase::keyToStation ( ME2IdsKey  key)
inlineprotected

Definition at line 574 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

Referenced by CreateSummaryHist(), getNameDirChamber(), getNameDirLayer(), key3Tokey2(), key4Tokey3(), key5Tokey4(), GEMRecHitSource::ProcessWithMEMap3(), and GEMRecHitSource::ProcessWithMEMap4WithChamber().

574 { return std::get<1>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToStation() [2/4]

int GEMDQMBase::keyToStation ( ME3IdsKey  key)
inlineprotected

Definition at line 575 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

575 { return std::get<1>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToStation() [3/4]

int GEMDQMBase::keyToStation ( ME4IdsKey  key)
inlineprotected

Definition at line 576 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

576 { return std::get<1>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ keyToStation() [4/4]

int GEMDQMBase::keyToStation ( ME5IdsKey  key)
inlineprotected

Definition at line 577 of file GEMDQMBase.h.

References submitPVResolutionJobs::key.

577 { return std::get<1>(key); };
key
prepare the HTCondor submission files and eventually submit them

◆ loadChambers()

int GEMDQMBase::loadChambers ( )
protected

Definition at line 56 of file GEMDQMBase.cc.

References chambers, GEMGeometry_, getMaxVFAT(), getNumEtaPartitions(), getNumModule(), l1tPhase2CaloJetEmulator_cfi::iEta, listChamberId_, mapEtaPartition_, mapStationInfo_, SiStripPI::max, GEMeMap::maxChan_, nMaxNumCh_, readGeometryPhiInfoChamber(), readGeometryRadiusInfoChamber(), nano_mu_digi_cff::region, GEMGeometry::regions(), and relativeConstraints::station.

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

56  {
57  if (GEMGeometry_ == nullptr)
58  return -1;
59  listChamberId_.clear();
60  mapEtaPartition_.clear();
61  for (const GEMRegion* region : GEMGeometry_->regions()) {
62  for (const GEMStation* station : region->stations()) {
63  for (auto sch : station->superChambers()) {
64  for (auto pchamber : sch->chambers()) {
65  GEMDetId gid = pchamber->id();
66  listChamberId_.push_back(pchamber->id());
67  for (auto iEta : pchamber->etaPartitions()) {
68  mapEtaPartition_[gid].push_back(iEta);
69  }
70  }
71  }
72  }
73  }
74 
75  // Borrwed from DQM/GEM/src/GEMOfflineMonitor.cc
76  nMaxNumCh_ = 0;
77  for (const GEMRegion* region : GEMGeometry_->regions()) {
78  const int region_number = region->region();
79 
80  for (const GEMStation* station : region->stations()) {
81  const auto&& superchambers = station->superChambers();
82 
83  const int station_number = station->station();
84  const int num_superchambers = (station_number == 1 ? 36 : 18);
85  const int num_mod = getNumModule(station->station());
86  const int max_vfat = getMaxVFAT(station->station()); // the number of VFATs per GEMEtaPartition
87  const int num_etas = getNumEtaPartitions(station); // the number of eta partitions per GEMChamber
88  const int num_vfat = num_etas * max_vfat; // the number of VFATs per GEMChamber
89  const int strip1st = (station_number == 2 ? 1 : 0); // the index of the first strip
90  const int num_digi = GEMeMap::maxChan_; // the number of digis (channels) per VFAT
91 
92  nMaxNumCh_ = std::max(nMaxNumCh_, num_superchambers);
93 
94  Int_t nMinIdxChamber = 1048576;
95  Int_t nMaxIdxChamber = -1048576;
96  for (auto sch : superchambers) {
97  auto nIdxChamber = sch->chambers().front()->id().chamber();
98  if (nMinIdxChamber > nIdxChamber)
99  nMinIdxChamber = nIdxChamber;
100  if (nMaxIdxChamber < nIdxChamber)
101  nMaxIdxChamber = nIdxChamber;
102  }
103 
104  const auto& chambers = superchambers.front()->chambers();
105 
106  for (auto pchamber : chambers) {
107  int layer_number = pchamber->id().layer();
108  ME3IdsKey key3(region_number, station_number, layer_number);
109  mapStationInfo_[key3] = MEStationInfo(region_number,
110  station_number,
111  layer_number,
112  num_superchambers,
113  num_mod,
114  num_etas,
115  num_vfat,
116  strip1st,
117  num_digi,
118  nMinIdxChamber,
119  nMaxIdxChamber);
122  }
123  }
124  }
125 
126  return 0;
127 }
std::vector< GEMDetId > listChamberId_
Definition: GEMDQMBase.h:632
int readGeometryRadiusInfoChamber(const GEMStation *station, MEStationInfo &stationInfo)
Definition: GEMDQMBase.cc:324
int getNumModule(const int)
Definition: GEMDQMBase.h:677
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:651
int readGeometryPhiInfoChamber(const GEMStation *station, MEStationInfo &stationInfo)
Definition: GEMDQMBase.cc:385
static const int maxChan_
Definition: GEMeMap.h:72
int getNumEtaPartitions(const GEMStation *)
Definition: GEMDQMBase.cc:40
int getMaxVFAT(const int)
Definition: GEMDQMBase.h:666
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:629
std::map< GEMDetId, std::vector< const GEMEtaPartition * > > mapEtaPartition_
Definition: GEMDQMBase.h:633
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Definition: GEMGeometry.cc:30
int nMaxNumCh_
Definition: GEMDQMBase.h:650
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
static char chambers[264][20]
Definition: ReadPGInfo.cc:243

◆ ProcessWithMEMap2()

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

Reimplemented in GEMDigiSource, and GEMPadDigiClusterSource.

Definition at line 554 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

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

◆ ProcessWithMEMap2AbsReWithEta()

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

Reimplemented in GEMRecHitSource.

Definition at line 556 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

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

◆ ProcessWithMEMap2WithChamber()

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

Reimplemented in GEMPadDigiClusterSource.

Definition at line 561 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

561 { return 0; };

◆ ProcessWithMEMap2WithEta()

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

Reimplemented in GEMDigiSource, GEMPadDigiClusterSource, and GEMRecHitSource.

Definition at line 555 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

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

◆ ProcessWithMEMap2WithEtaCh()

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

Definition at line 564 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

564 { return 0; };

◆ ProcessWithMEMap3()

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

Reimplemented in GEMDigiSource, GEMPadDigiClusterSource, and GEMRecHitSource.

Definition at line 557 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

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

◆ ProcessWithMEMap4()

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

Reimplemented in GEMDAQStatusSource, and GEMDigiSource.

Definition at line 558 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

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

◆ ProcessWithMEMap4WithChamber()

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

Reimplemented in GEMPadDigiClusterSource, and GEMRecHitSource.

Definition at line 567 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

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

◆ ProcessWithMEMap5()

virtual int GEMDQMBase::ProcessWithMEMap5 ( BookingHelper bh,
ME5IdsKey  key 
)
inlineprotectedvirtual

Definition at line 559 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

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

◆ ProcessWithMEMap5WithChamber()

virtual int GEMDQMBase::ProcessWithMEMap5WithChamber ( BookingHelper bh,
ME5IdsKey  key 
)
inlineprotectedvirtual

Reimplemented in GEMDAQStatusSource, and GEMDigiSource.

Definition at line 568 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

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

◆ readGeometryPhiInfoChamber()

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

Definition at line 385 of file GEMDQMBase.cc.

References funct::abs(), GEMDQMBase::MEStationInfo::fMinPhi_, l1tPhase2CaloJetEmulator_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().

385  {
386  auto listSuperChambers = station->superChambers();
387  Int_t nNumStripEta = stationInfo.nNumDigi_ * (stationInfo.nMaxVFAT_ / stationInfo.nNumEtaPartitions_);
388 
389  std::vector<std::pair<Int_t, std::pair<std::pair<Float_t, Float_t>, Bool_t>>> listDivPhi;
390 
391  // Obtaining phi intervals of chambers
392  for (auto superchamber : listSuperChambers) {
393  auto iEta = superchamber->chambers().front()->etaPartitions().front();
394 
395  // What is the index of the first strip? Rather than to ask to someone, let's calculate it!
396  Float_t fWidthStrip = std::abs(iEta->centreOfStrip((Int_t)1).x() - iEta->centreOfStrip((Int_t)0).x());
397  LocalPoint lpRef(-fWidthStrip / 3.0, 0.0);
398  Int_t nStripMid = (Int_t)iEta->strip(lpRef);
399  Int_t nFirstStrip = 1 - ((nNumStripEta / 2) - nStripMid);
400  Int_t nLastStrip = nFirstStrip + nNumStripEta - 1;
401 
402  auto& surface = iEta->surface();
403  LocalPoint lpF = iEta->centreOfStrip((Float_t)(nFirstStrip - 0.5)); // To avoid the round error(?)
404  LocalPoint lpL = iEta->centreOfStrip((Float_t)(nLastStrip + 0.5)); // To avoid the round error(?)
405  GlobalPoint gpF = surface.toGlobal(lpF);
406  GlobalPoint gpL = surface.toGlobal(lpL);
407 
408  Float_t fPhiF = gpF.phi();
409  Float_t fPhiL = gpL.phi();
410  if (fPhiF * fPhiL < 0 && std::abs(fPhiF) > 0.5 * 3.14159265359) {
411  if (fPhiF < 0)
412  fPhiF += 2 * 3.14159265359;
413  if (fPhiL < 0)
414  fPhiL += 2 * 3.14159265359;
415  }
416  Bool_t bFlipped = fPhiF > fPhiL;
417  Float_t fPhiMin = std::min(fPhiF, fPhiL);
418  Float_t fPhiMax = std::max(fPhiF, fPhiL);
419 
420  listDivPhi.emplace_back();
421  listDivPhi.back().first = iEta->id().chamber();
422  listDivPhi.back().second.first.first = fPhiMin;
423  listDivPhi.back().second.first.second = fPhiMax;
424  listDivPhi.back().second.second = bFlipped;
425  }
426 
427  stationInfo.fMinPhi_ = 0.0;
428  for (auto p : listDivPhi) {
429  if (p.first == 1) {
430  stationInfo.fMinPhi_ = p.second.first.first;
431  break;
432  }
433  }
434 
435  // For a future usage
436  //for ( auto p : listDivPhi ) {
437  // std::cout << "GEO_PHI: " << p.first << " "
438  // << p.second.first.first << " " << p.second.first.second << " " << p.second.second << std::endl;
439  //}
440 
441  return 0;
442 }
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 324 of file GEMDQMBase.cc.

References mps_fire::i, l1tPhase2CaloJetEmulator_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().

324  {
325  auto listSuperChambers = station->superChambers();
326 
327  Bool_t bDoneEven = false, bDoneOdd = false;
328 
329  // Obtaining radius intervals of even/odd chambers
330  for (auto superchamber : listSuperChambers) {
331  Int_t chamberNo = superchamber->id().chamber();
332  if (chamberNo % 2 == 0 && bDoneEven)
333  continue;
334  if (chamberNo % 2 != 0 && bDoneOdd)
335  continue;
336 
337  auto& etaPartitions = superchamber->chambers().front()->etaPartitions();
338 
339  // A little of additional procedures to list up the radius intervals
340  // It would be independent to local direction of chambers and the order of eta partitions
341  // 1. Obtain the radius of the middle top/bottom points of the trapezoid
342  // 2. Sort these two values and determine which one is the lower/upper one
343  // 3. Keep them all and then sort them
344  // 4. The intermediate radii are set as the mean of the corresponding values of upper/lowers.
345  std::vector<Float_t> listRadiusLower, listRadiusUpper;
346  for (auto iEta : etaPartitions) {
347  const GEMStripTopology& stripTopology = dynamic_cast<const GEMStripTopology&>(iEta->specificTopology());
348  Float_t fHeight = stripTopology.stripLength();
349  LocalPoint lp1(0.0, -0.5 * fHeight), lp2(0.0, 0.5 * fHeight);
350  auto& surface = iEta->surface();
351  GlobalPoint gp1 = surface.toGlobal(lp1), gp2 = surface.toGlobal(lp2);
352  Float_t fR1 = gp1.perp(), fR2 = gp2.perp();
353  Float_t fRL = std::min(fR1, fR2), fRH = std::max(fR1, fR2);
354  listRadiusLower.push_back(fRL);
355  listRadiusUpper.push_back(fRH);
356  // For a future usage
357  //std::cout << "GEO_RADIUS: " << iEta->id().chamber() << " " << iEta->id().ieta() << " "
358  // << fRL << " " << fRH << std::endl;
359  }
360 
361  std::sort(listRadiusLower.begin(), listRadiusLower.end());
362  std::sort(listRadiusUpper.begin(), listRadiusUpper.end());
363 
364  std::vector<Float_t>& listR =
365  (chamberNo % 2 == 0 ? stationInfo.listRadiusEvenChamber_ : stationInfo.listRadiusOddChamber_);
366  listR.clear();
367  listR.push_back(listRadiusLower.front());
368  for (int i = 1; i < (int)listRadiusLower.size(); i++) {
369  listR.push_back(0.5 * (listRadiusLower[i] + listRadiusUpper[i - 1]));
370  }
371  listR.push_back(listRadiusUpper.back());
372 
373  if (chamberNo % 2 == 0)
374  bDoneEven = true;
375  if (chamberNo % 2 != 0)
376  bDoneOdd = true;
377 
378  if (bDoneEven && bDoneOdd)
379  break;
380  }
381 
382  return 0;
383 }
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 740 of file GEMDQMBase.h.

References createfilelist::int, and M_PI.

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

740  {
741  Float_t fLoop = (fTheta - fStart) / (2 * M_PI);
742  int nLoop = (fLoop >= 0 ? (int)fLoop : (int)fLoop - 1);
743  return fTheta - nLoop * 2 * M_PI;
744 }
#define M_PI

◆ SortingLayers()

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

Definition at line 129 of file GEMDQMBase.cc.

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

Referenced by CreateSummaryHist().

129  {
130  std::sort(listLayers.begin(), listLayers.end(), [](ME4IdsKey key1, ME4IdsKey key2) {
131  Int_t re1 = std::get<0>(key1), re2 = std::get<0>(key2);
132  Int_t st1 = std::get<1>(key1), st2 = std::get<1>(key2);
133  Int_t la1 = std::get<2>(key1), la2 = std::get<2>(key2);
134  Int_t mo1 = std::get<3>(key1), mo2 = std::get<3>(key2);
135  if (re1 < 0 && re2 > 0)
136  return false;
137  if (re1 > 0 && re2 < 0)
138  return true;
139  Bool_t bRes = (re1 < 0); // == re2 < 0
140  Int_t sum1 = 4096 * std::abs(re1) + 256 * st1 + 16 * la1 + mo1;
141  Int_t sum2 = 4096 * std::abs(re2) + 256 * st2 + 16 * la2 + mo2;
142  if (sum1 <= sum2)
143  return bRes;
144  return !bRes;
145  });
146 
147  return 0;
148 }
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

◆ GEMGeometry_

const GEMGeometry* GEMDQMBase::GEMGeometry_
protected

◆ geomToken_

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

Definition at line 630 of file GEMDQMBase.h.

Referenced by initGeometry().

◆ listChamberId_

std::vector<GEMDetId> GEMDQMBase::listChamberId_
protected

◆ log_category_

std::string GEMDQMBase::log_category_

◆ mapEtaPartition_

std::map<GEMDetId, std::vector<const GEMEtaPartition *> > GEMDQMBase::mapEtaPartition_
protected

◆ mapStationInfo_

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

◆ mapStationToIdx_

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

Definition at line 652 of file GEMDQMBase.h.

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

◆ MEMap2AbsReWithEtaCheck_

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

Definition at line 637 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap2Check_

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

Definition at line 635 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap2WithChCheck_

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

Definition at line 639 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap2WithEtaChCheck_

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

Definition at line 642 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap2WithEtaCheck_

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

Definition at line 636 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap3Check_

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

Definition at line 644 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap4Check_

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

Definition at line 645 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap4WithChCheck_

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

Definition at line 646 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap5Check_

std::map<ME5IdsKey, bool> GEMDQMBase::MEMap5Check_
protected

Definition at line 648 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ MEMap5WithChCheck_

std::map<ME5IdsKey, bool> GEMDQMBase::MEMap5WithChCheck_
protected

Definition at line 647 of file GEMDQMBase.h.

Referenced by GenerateMEPerChamber().

◆ nMaxNumCh_

int GEMDQMBase::nMaxNumCh_
protected

Definition at line 650 of file GEMDQMBase.h.

Referenced by CreateSummaryHist(), and loadChambers().

◆ nRunType_

Int_t GEMDQMBase::nRunType_