8 log_category_ =
cfg.getUntrackedParameter<
std::string>(
"logCategory");
10 nNumEtaPartitionGE0_ = 0;
11 nNumEtaPartitionGE11_ = 0;
12 nNumEtaPartitionGE21_ = 0;
16 GEMGeometry_ =
nullptr;
20 GEMGeometry_ = &*hGeom;
22 edm::LogError(log_category_) <<
"+++ Error : GEM geometry is unavailable on event loop. +++\n";
31 const auto&& superchambers =
station->superChambers();
32 if (not checkRefs(superchambers)) {
33 edm::LogError(log_category_) <<
"failed to get a valid vector of GEMSuperChamber ptrs" << std::endl;
37 const auto&
chambers = superchambers.front()->chambers();
39 edm::LogError(log_category_) <<
"failed to get a valid vector of GEMChamber ptrs" << std::endl;
43 return chambers.front()->nEtaPartitions();
47 if (GEMGeometry_ ==
nullptr)
50 const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
51 for (
auto sch : superChambers_) {
52 int n_lay = sch->nChambers();
53 for (
int l = 0;
l < n_lay;
l++) {
54 Bool_t bExist =
false;
55 for (
const auto& ch : gemChambers_) {
56 if (ch.id() == sch->chamber(
l + 1)->id()) {
63 gemChambers_.push_back(*sch->chamber(
l + 1));
70 const int region_number =
region->region();
73 const auto&& superchambers =
station->superChambers();
75 const int station_number =
station->station();
76 const int num_superchambers = superchambers.size();
77 const int num_layers = superchambers.front()->nChambers();
78 const int max_vfat = getMaxVFAT(
station->station());
79 const int num_etas = getNumEtaPartitions(
station);
80 const int num_vfat = num_etas * max_vfat;
83 nMaxNumCh_ =
std::max(nMaxNumCh_, num_superchambers);
85 for (
int layer_number = 1; layer_number <= num_layers; layer_number++) {
86 ME3IdsKey key3(region_number, station_number, layer_number);
88 region_number, station_number, layer_number, num_superchambers, num_etas, num_vfat, num_strip);
93 if (mapStationInfo_.find(
ME3IdsKey(-1, 0, 1)) != mapStationInfo_.end())
94 nNumEtaPartitionGE0_ = mapStationInfo_[
ME3IdsKey(-1, 0, 1)].nNumEtaPartitions_;
95 if (mapStationInfo_.find(
ME3IdsKey(-1, 1, 1)) != mapStationInfo_.end())
96 nNumEtaPartitionGE11_ = mapStationInfo_[
ME3IdsKey(-1, 1, 1)].nNumEtaPartitions_;
97 if (mapStationInfo_.find(
ME3IdsKey(-1, 2, 1)) != mapStationInfo_.end())
98 nNumEtaPartitionGE21_ = mapStationInfo_[
ME3IdsKey(-1, 2, 1)].nNumEtaPartitions_;
105 Int_t re1 = std::get<0>(key1), st1 = std::get<1>(key1), la1 = std::get<2>(key1);
106 Int_t re2 = std::get<0>(key2), st2 = std::get<1>(key2), la2 = std::get<2>(key2);
107 if (re1 < 0 && re2 > 0)
109 if (re1 > 0 && re2 < 0)
111 Bool_t bRes = (re1 < 0);
112 Int_t sum1 = 256 *
std::abs(re1) + 16 * st1 + 1 * la1;
123 std::vector<ME3IdsKey> listLayers;
124 for (
auto const& [
key, stationInfo] : mapStationInfo_)
125 listLayers.push_back(
key);
126 SortingLayers(listLayers);
127 for (Int_t
i = 0;
i < (Int_t)listLayers.size();
i++)
128 mapStationToIdx_[listLayers[
i]] =
i + 1;
131 ibooker.
book2D(strName,
"", nMaxNumCh_, 0.5, nMaxNumCh_ + 0.5, listLayers.size(), 0.5, listLayers.size() + 0.5);
133 if (h2Res ==
nullptr)
136 for (Int_t
i = 1;
i <= nMaxNumCh_;
i++)
138 for (Int_t
i = 1;
i <= (Int_t)listLayers.size();
i++) {
139 auto key = listLayers[
i - 1];
141 auto label = Form(
"GE%+i/%iL%i;%s", keyToRegion(
key), keyToStation(
key), keyToLayer(
key), strInfo.Data());
142 h2Res->setBinLabel(
i,
label, 2);
143 Int_t nNumCh = mapStationInfo_[
key].nNumChambers_;
144 h2Res->setBinContent(0,
i, nNumCh);
151 MEMap2Check_.clear();
152 MEMap3Check_.clear();
153 MEMap3WithChCheck_.clear();
154 MEMap4Check_.clear();
155 for (
const auto& ch : gemChambers_) {
160 if (!MEMap2Check_[key2]) {
164 ProcessWithMEMap2(bh2, key2);
165 MEMap2Check_[key2] =
true;
167 if (!MEMap3Check_[key3]) {
171 ProcessWithMEMap3(bh3, key3);
172 MEMap3Check_[key3] =
true;
174 if (!MEMap3WithChCheck_[key3WithChamber]) {
178 ProcessWithMEMap3WithChamber(bh3Ch, key3WithChamber);
179 MEMap3WithChCheck_[key3WithChamber] =
true;
181 for (
auto iEta : ch.etaPartitions()) {
184 if (!MEMap4Check_[key4]) {
188 ProcessWithMEMap4(bh4, key4);
189 MEMap4Check_[key4] =
true;