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);
87 const int num_vfat = num_etas * max_vfat;
92 Int_t nMinIdxChamber = 1048576;
93 Int_t nMaxIdxChamber = -1048576;
94 for (
auto sch : superchambers) {
95 auto nIdxChamber = sch->chambers().front()->id().chamber();
96 if (nMinIdxChamber > nIdxChamber)
97 nMinIdxChamber = nIdxChamber;
98 if (nMaxIdxChamber < nIdxChamber)
99 nMaxIdxChamber = nIdxChamber;
102 const auto&
chambers = superchambers.front()->chambers();
105 int layer_number = pchamber->id().layer();
106 ME3IdsKey key3(region_number, station_number, layer_number);
127 Int_t re1 = std::get<0>(key1), st1 = std::get<1>(key1), la1 = std::get<2>(key1);
128 Int_t re2 = std::get<0>(key2), st2 = std::get<1>(key2), la2 = std::get<2>(key2);
129 if (re1 < 0 && re2 > 0)
131 if (re1 > 0 && re2 < 0)
133 Bool_t bRes = (re1 < 0);
134 Int_t sum1 = 256 *
std::abs(re1) + 16 * st1 + 1 * la1;
135 Int_t sum2 = 256 *
std::abs(re2) + 16 * st2 + 1 * la2;
145 std::vector<ME3IdsKey> listLayers;
147 listLayers.push_back(
key);
149 for (Int_t
i = 0;
i < (Int_t)listLayers.size();
i++)
155 h2Res->setYTitle(
"Layer");
157 if (h2Res ==
nullptr)
161 h2Res->setBinLabel(
i, Form(
"%i",
i), 1);
162 for (Int_t
i = 1;
i <= (Int_t)listLayers.size();
i++) {
163 auto key = listLayers[
i - 1];
168 h2Res->setBinLabel(
i,
label, 2);
170 h2Res->setBinContent(0,
i, nNumCh);
184 ME2IdsKey key2{gid.region(), gid.station()};
185 ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
186 ME4IdsKey key3WithChamber{gid.region(), gid.station(), gid.layer(), gid.chamber()};
202 Int_t nCh = gid.chamber();
203 Int_t nLa = gid.layer();
204 char cLS = (nCh % 2 == 0 ?
'L' :
'S');
213 ME4IdsKey key4{gid.region(), gid.station(), gid.layer(), eId.
ieta()};
214 ME3IdsKey key2WithEta{gid.region(), gid.station(), eId.
ieta()};
231 auto strSuffixName = Form(
"_GE%d1-E%02i", gid.station(), eId.
ieta());
232 auto strSuffixTitle = Form(
" GE%d1-E%02i", gid.station(), eId.
ieta());
243 auto listSuperChambers =
station->superChambers();
245 Bool_t bDoneEven =
false, bDoneOdd =
false;
248 for (
auto superchamber : listSuperChambers) {
249 Int_t chamberNo = superchamber->id().chamber();
250 if (chamberNo % 2 == 0 && bDoneEven)
252 if (chamberNo % 2 != 0 && bDoneOdd)
255 auto& etaPartitions = superchamber->chambers().front()->etaPartitions();
263 std::vector<Float_t> listRadiusLower, listRadiusUpper;
264 for (
auto iEta : etaPartitions) {
267 LocalPoint lp1(0.0, -0.5 * fHeight), lp2(0.0, 0.5 * fHeight);
268 auto& surface =
iEta->surface();
269 GlobalPoint gp1 = surface.toGlobal(lp1), gp2 = surface.toGlobal(lp2);
270 Float_t fR1 = gp1.
perp(), fR2 = gp2.perp();
272 listRadiusLower.push_back(fRL);
273 listRadiusUpper.push_back(fRH);
279 std::sort(listRadiusLower.begin(), listRadiusLower.end());
280 std::sort(listRadiusUpper.begin(), listRadiusUpper.end());
282 std::vector<Float_t>& listR =
285 listR.push_back(listRadiusLower.front());
286 for (
int i = 1;
i < (
int)listRadiusLower.size();
i++) {
287 listR.push_back(0.5 * (listRadiusLower[
i] + listRadiusUpper[
i - 1]));
289 listR.push_back(listRadiusUpper.back());
291 if (chamberNo % 2 == 0)
293 if (chamberNo % 2 != 0)
296 if (bDoneEven && bDoneOdd)
304 auto listSuperChambers =
station->superChambers();
307 std::vector<std::pair<Int_t, std::pair<std::pair<Float_t, Float_t>, Bool_t>>> listDivPhi;
310 for (
auto superchamber : listSuperChambers) {
311 auto iEta = superchamber->chambers().front()->etaPartitions().front();
314 Float_t fWidthStrip =
std::abs(
iEta->centreOfStrip((Int_t)1).x() -
iEta->centreOfStrip((Int_t)0).x());
316 Int_t nStripMid = (Int_t)
iEta->strip(lpRef);
317 Int_t nFirstStrip = 1 - ((nNumStripEta / 2) - nStripMid);
318 Int_t nLastStrip = nFirstStrip + nNumStripEta - 1;
320 auto& surface =
iEta->surface();
321 LocalPoint lpF =
iEta->centreOfStrip((Float_t)(nFirstStrip - 0.5));
322 LocalPoint lpL =
iEta->centreOfStrip((Float_t)(nLastStrip + 0.5));
326 Float_t fPhiF = gpF.
phi();
327 Float_t fPhiL = gpL.
phi();
328 if (fPhiF * fPhiL < 0 &&
std::abs(fPhiF) > 0.5 * 3.14159265359) {
330 fPhiF += 2 * 3.14159265359;
332 fPhiL += 2 * 3.14159265359;
334 Bool_t bFlipped = fPhiF > fPhiL;
335 Float_t fPhiMin =
std::min(fPhiF, fPhiL);
336 Float_t fPhiMax =
std::max(fPhiF, fPhiL);
338 listDivPhi.emplace_back();
339 listDivPhi.back().first =
iEta->id().chamber();
340 listDivPhi.back().second.first.first = fPhiMin;
341 listDivPhi.back().second.first.second = fPhiMax;
342 listDivPhi.back().second.second = bFlipped;
346 for (
auto p : listDivPhi) {
348 stationInfo.
fMinPhi_ =
p.second.first.first;
float stripLength() const override
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::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)
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
int keyToRegion(ME2IdsKey key)
int readGeometryPhiInfoChamber(const GEMStation *station, MEStationInfo &stationInfo)
std::map< ME3IdsKey, int > mapStationToIdx_
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_
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 ProcessWithMEMap3WithChamber(BookingHelper &bh, ME4IdsKey key)
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
Abs< T >::type abs(const T &t)
int getMaxVFAT(const int)
int keyToStation(ME2IdsKey key)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
std::map< ME4IdsKey, bool > MEMap4Check_
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())
virtual int ProcessWithMEMap2WithEta(BookingHelper &bh, ME3IdsKey key)
int SortingLayers(std::vector< ME3IdsKey > &listLayers)
GEMDQMBase(const edm::ParameterSet &cfg)
std::map< ME3IdsKey, bool > MEMap2WithEtaCheck_
std::map< GEMDetId, std::vector< const GEMEtaPartition * > > mapEtaPartition_
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
std::tuple< Int_t, Int_t > ME2IdsKey
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
static char chambers[264][20]
std::map< ME4IdsKey, bool > MEMap3WithChCheck_
virtual int ProcessWithMEMap2(BookingHelper &bh, ME2IdsKey key)