12 if (strRunType ==
"online") {
14 }
else if (strRunType ==
"offline") {
16 }
else if (strRunType ==
"relval") {
18 }
else if (strRunType ==
"allplots") {
41 const auto&& superchambers =
station->superChambers();
47 const auto&
chambers = superchambers.front()->chambers();
53 return chambers.front()->nEtaPartitions();
63 for (
auto sch :
station->superChambers()) {
64 for (
auto pchamber : sch->chambers()) {
67 for (
auto iEta : pchamber->etaPartitions()) {
78 const int region_number =
region->region();
81 const auto&& superchambers =
station->superChambers();
83 const int station_number =
station->station();
84 const int num_superchambers = (station_number == 1 ? 36 : 18);
88 const int num_vfat = num_etas * max_vfat;
89 const int strip1st = (station_number == 2 ? 1 : 0);
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;
104 const auto&
chambers = superchambers.front()->chambers();
107 int layer_number = pchamber->id().layer();
108 ME3IdsKey key3(region_number, station_number, layer_number);
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)
137 if (re1 > 0 && re2 < 0)
139 Bool_t bRes = (re1 < 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;
151 std::vector<ME4IdsKey> listLayers;
153 for (
int module_number = 1; module_number <= stationInfo.nNumModules_; module_number++) {
155 listLayers.push_back(key4);
159 for (Int_t
i = 0;
i < (Int_t)listLayers.size();
i++)
165 h2Res->setYTitle(
"Layer");
167 if (h2Res ==
nullptr)
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];
181 auto label = Form(
"GE%+i1-%cL%i-M%i;%s",
187 h2Res->setBinLabel(
i,
label, 2);
189 h2Res->setBinContent(0,
i, nNumCh);
210 ME2IdsKey key2{gid.region(), gid.station()};
211 ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
213 ME3IdsKey key2WithChamber{gid.region(), gid.station(), gid.chamber()};
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()};
228 Int_t
nCh = gid.chamber();
230 char cLS = (
nCh % 2 == 0 ?
'L' :
'S');
245 Int_t nLa = gid.layer();
246 TString strSuffixCh = Form(
"-L%i", nLa);
248 strSuffixCh = Form(
"-L%i-M%i", nLa, module_number);
256 Int_t
nCh = gid.chamber();
257 Int_t nLa = gid.layer();
258 char cLS = (
nCh % 2 == 0 ?
'L' :
'S');
259 TString strSuffixCh = Form(
"-%02iL%i-%c",
nCh, nLa, cLS);
267 Int_t
nCh = gid.chamber();
268 Int_t nLa = gid.layer();
269 char cLS = (
nCh % 2 == 0 ?
'L' :
'S');
270 TString strSuffixCh = Form(
"-%02iL%i-%c",
nCh, nLa, cLS);
272 strSuffixCh = Form(
"-%02iL%i-M%i-%c",
nCh, nLa, module_number, cLS);
281 ME5IdsKey key5{gid.region(), gid.station(), gid.layer(), module_number, eId.
ieta()};
283 ME4IdsKey key2WithEtaCh{gid.region(), gid.station(), eId.
ieta(), gid.chamber()};
285 ME3IdsKey key2WithEta{gid.region(), gid.station(), eId.
ieta()};
295 Int_t
nCh = gid.chamber();
297 char cLS = (
nCh % 2 == 0 ?
'L' :
'S');
312 auto strSuffixName = Form(
"_GE%d1-E%02i", gid.station(), eId.
ieta());
313 auto strSuffixTitle = Form(
" GE%d1-E%02i", gid.station(), eId.
ieta());
325 auto listSuperChambers =
station->superChambers();
327 Bool_t bDoneEven =
false, bDoneOdd =
false;
330 for (
auto superchamber : listSuperChambers) {
331 Int_t chamberNo = superchamber->id().chamber();
332 if (chamberNo % 2 == 0 && bDoneEven)
334 if (chamberNo % 2 != 0 && bDoneOdd)
337 auto& etaPartitions = superchamber->chambers().front()->etaPartitions();
345 std::vector<Float_t> listRadiusLower, listRadiusUpper;
346 for (
auto iEta : etaPartitions) {
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();
354 listRadiusLower.push_back(fRL);
355 listRadiusUpper.push_back(fRH);
361 std::sort(listRadiusLower.begin(), listRadiusLower.end());
362 std::sort(listRadiusUpper.begin(), listRadiusUpper.end());
364 std::vector<Float_t>& listR =
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]));
371 listR.push_back(listRadiusUpper.back());
373 if (chamberNo % 2 == 0)
375 if (chamberNo % 2 != 0)
378 if (bDoneEven && bDoneOdd)
386 auto listSuperChambers =
station->superChambers();
389 std::vector<std::pair<Int_t, std::pair<std::pair<Float_t, Float_t>, Bool_t>>> listDivPhi;
392 for (
auto superchamber : listSuperChambers) {
393 auto iEta = superchamber->chambers().front()->etaPartitions().front();
396 Float_t fWidthStrip =
std::abs(
iEta->centreOfStrip((Int_t)1).x() -
iEta->centreOfStrip((Int_t)0).x());
398 Int_t nStripMid = (Int_t)
iEta->strip(lpRef);
399 Int_t nFirstStrip = 1 - ((nNumStripEta / 2) - nStripMid);
400 Int_t nLastStrip = nFirstStrip + nNumStripEta - 1;
402 auto& surface =
iEta->surface();
403 LocalPoint lpF =
iEta->centreOfStrip((Float_t)(nFirstStrip - 0.5));
404 LocalPoint lpL =
iEta->centreOfStrip((Float_t)(nLastStrip + 0.5));
408 Float_t fPhiF = gpF.
phi();
409 Float_t fPhiL = gpL.
phi();
410 if (fPhiF * fPhiL < 0 &&
std::abs(fPhiF) > 0.5 * 3.14159265359) {
412 fPhiF += 2 * 3.14159265359;
414 fPhiL += 2 * 3.14159265359;
416 Bool_t bFlipped = fPhiF > fPhiL;
417 Float_t fPhiMin =
std::min(fPhiF, fPhiL);
418 Float_t fPhiMax =
std::max(fPhiF, fPhiL);
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;
428 for (
auto p : listDivPhi) {
430 stationInfo.
fMinPhi_ =
p.second.first.first;
std::map< ME5IdsKey, bool > MEMap5WithChCheck_
virtual int ProcessWithMEMap2WithEtaCh(BookingHelper &bh, ME4IdsKey key)
float stripLength() const override
int keyToModule(ME4IdsKey key)
std::map< ME3IdsKey, bool > MEMap2WithChCheck_
bool checkRefs(const std::vector< T *> &)
dqm::impl::MonitorElement * CreateSummaryHist(DQMStore::IBooker &ibooker, TString strName)
virtual int ProcessWithMEMap4(BookingHelper &bh, ME4IdsKey key)
TString getSuffixName(Int_t region_id)
std::tuple< Int_t, Int_t, Int_t, Int_t, Int_t > ME5IdsKey
std::vector< GEMDetId > listChamberId_
virtual int ProcessWithMEMap2AbsReWithEta(BookingHelper &bh, ME3IdsKey key)
Geom::Phi< T > phi() const
int initGeometry(edm::EventSetup const &iSetup)
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
int readGeometryRadiusInfoChamber(const GEMStation *station, MEStationInfo &stationInfo)
virtual int ProcessWithMEMap5WithChamber(BookingHelper &bh, ME5IdsKey key)
int getNumModule(const int)
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
int keyToRegion(ME2IdsKey key)
int readGeometryPhiInfoChamber(const GEMStation *station, MEStationInfo &stationInfo)
static const int maxChan_
int keyToLayer(ME3IdsKey key)
Log< level::Error, false > LogError
TString getSuffixTitle(Int_t region_id)
std::vector< Float_t > listRadiusOddChamber_
std::string log_category_
int SortingLayers(std::vector< ME4IdsKey > &listLayers)
std::map< ME3IdsKey, bool > MEMap2AbsReWithEtaCheck_
std::map< ME2IdsKey, bool > MEMap2Check_
virtual int ProcessWithMEMap3(BookingHelper &bh, ME3IdsKey key)
virtual void setXTitle(std::string const &title)
int GenerateMEPerChamber(DQMStore::IBooker &ibooker)
std::vector< Float_t > listRadiusEvenChamber_
std::map< ME3IdsKey, bool > MEMap3Check_
int getNumEtaPartitions(const GEMStation *)
virtual int ProcessWithMEMap2WithChamber(BookingHelper &bh, ME3IdsKey key)
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
virtual int ProcessWithMEMap5(BookingHelper &bh, ME5IdsKey key)
Abs< T >::type abs(const T &t)
std::map< ME5IdsKey, bool > MEMap5Check_
key
prepare the HTCondor submission files and eventually submit them
int getMaxVFAT(const int)
std::map< ME4IdsKey, int > mapStationToIdx_
int keyToStation(ME2IdsKey key)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
std::map< ME4IdsKey, bool > MEMap4Check_
virtual int ProcessWithMEMap4WithChamber(BookingHelper &bh, ME4IdsKey key)
constexpr int ieta() const
const GEMGeometry * GEMGeometry_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
std::map< ME4IdsKey, bool > MEMap4WithChCheck_
virtual int ProcessWithMEMap2WithEta(BookingHelper &bh, ME3IdsKey key)
GEMDQMBase(const edm::ParameterSet &cfg)
std::map< ME3IdsKey, bool > MEMap2WithEtaCheck_
ME3IdsKey key4Tokey3(ME4IdsKey key)
std::map< GEMDetId, std::vector< const GEMEtaPartition * > > mapEtaPartition_
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
std::map< ME4IdsKey, bool > MEMap2WithEtaChCheck_
std::tuple< Int_t, Int_t > ME2IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
static char chambers[264][20]
virtual int ProcessWithMEMap2(BookingHelper &bh, ME2IdsKey key)