7 log_category_ =
cfg.getUntrackedParameter<
std::string>(
"logCategory");
9 nNumEtaPartitionGE0_ = 0;
10 nNumEtaPartitionGE11_ = 0;
11 nNumEtaPartitionGE21_ = 0;
15 GEMGeometry_ =
nullptr;
19 GEMGeometry_ = &*hGeom;
21 edm::LogError(log_category_) <<
"+++ Error : GEM geometry is unavailable on event loop. +++\n";
30 const auto&& superchambers =
station->superChambers();
31 if (not checkRefs(superchambers)) {
32 edm::LogError(log_category_) <<
"failed to get a valid vector of GEMSuperChamber ptrs" << std::endl;
36 const auto&
chambers = superchambers.front()->chambers();
38 edm::LogError(log_category_) <<
"failed to get a valid vector of GEMChamber ptrs" << std::endl;
42 return chambers.front()->nEtaPartitions();
46 if (GEMGeometry_ ==
nullptr)
49 const std::vector<const GEMSuperChamber*>& superChambers_ = GEMGeometry_->superChambers();
50 for (
auto sch : superChambers_) {
51 int n_lay = sch->nChambers();
52 for (
int l = 0;
l < n_lay;
l++) {
53 Bool_t bExist =
false;
54 for (
const auto& ch : gemChambers_) {
55 if (ch.id() == sch->chamber(
l + 1)->id()) {
62 gemChambers_.push_back(*sch->chamber(
l + 1));
69 const int region_number =
region->region();
72 const auto&& superchambers =
station->superChambers();
74 const int station_number =
station->station();
75 const int num_superchambers = superchambers.size();
76 const int num_layers = superchambers.front()->nChambers();
77 const int max_vfat = getMaxVFAT(
station->station());
78 const int num_etas = getNumEtaPartitions(
station);
79 const int num_vfat = num_etas * max_vfat;
82 nMaxNumCh_ =
std::max(nMaxNumCh_, num_superchambers);
84 for (
int layer_number = 1; layer_number <= num_layers; layer_number++) {
85 ME3IdsKey key3(region_number, station_number, layer_number);
87 region_number, station_number, layer_number, num_superchambers, num_etas, num_vfat, num_strip);
92 if (mapStationInfo_.find(
ME3IdsKey(-1, 0, 1)) != mapStationInfo_.end())
93 nNumEtaPartitionGE0_ = mapStationInfo_[
ME3IdsKey(-1, 0, 1)].nNumEtaPartitions_;
94 if (mapStationInfo_.find(
ME3IdsKey(-1, 1, 1)) != mapStationInfo_.end())
95 nNumEtaPartitionGE11_ = mapStationInfo_[
ME3IdsKey(-1, 1, 1)].nNumEtaPartitions_;
96 if (mapStationInfo_.find(
ME3IdsKey(-1, 2, 1)) != mapStationInfo_.end())
97 nNumEtaPartitionGE21_ = mapStationInfo_[
ME3IdsKey(-1, 2, 1)].nNumEtaPartitions_;
104 Int_t re1 = std::get<0>(key1), st1 = std::get<1>(key1), la1 = std::get<2>(key1);
105 Int_t re2 = std::get<0>(key2), st2 = std::get<1>(key2), la2 = std::get<2>(key2);
106 if (re1 < 0 && re2 > 0)
108 if (re1 > 0 && re2 < 0)
110 Bool_t bRes = (re1 < 0);
111 Int_t sum1 = 256 *
std::abs(re1) + 16 * st1 + 1 * la1;
122 std::vector<ME3IdsKey> listLayers;
123 for (
auto const& [
key, stationInfo] : mapStationInfo_)
124 listLayers.push_back(
key);
125 SortingLayers(listLayers);
126 for (Int_t
i = 0;
i < (Int_t)listLayers.size();
i++)
127 mapStationToIdx_[listLayers[
i]] =
i + 1;
130 ibooker.
book2D(strName,
"", nMaxNumCh_, 0.5, nMaxNumCh_ + 0.5, listLayers.size(), 0.5, listLayers.size() + 0.5);
132 if (h2Res ==
nullptr)
135 for (Int_t
i = 1;
i <= nMaxNumCh_;
i++)
137 for (Int_t
i = 1;
i <= (Int_t)listLayers.size();
i++) {
138 auto key = listLayers[
i - 1];
139 h2Res->setBinLabel(
i, Form(
"GE%+i/%iL%i", keyToRegion(
key), keyToStation(
key), keyToLayer(
key)), 2);
140 Int_t nNumCh = mapStationInfo_[
key].nNumChambers_;
141 h2Res->setBinContent(0,
i, nNumCh);
148 MEMap2Check_.clear();
149 MEMap3Check_.clear();
150 MEMap3WithChCheck_.clear();
151 MEMap4Check_.clear();
152 for (
const auto& ch : gemChambers_) {
157 if (!MEMap2Check_[key2]) {
161 ProcessWithMEMap2(bh2, key2);
162 MEMap2Check_[key2] =
true;
164 if (!MEMap3Check_[key3]) {
168 ProcessWithMEMap3(bh3, key3);
169 MEMap3Check_[key3] =
true;
171 if (!MEMap3WithChCheck_[key3WithChamber]) {
175 ProcessWithMEMap3WithChamber(bh3Ch, key3WithChamber);
176 MEMap3WithChCheck_[key3WithChamber] =
true;
178 for (
auto iEta : ch.etaPartitions()) {
181 if (!MEMap4Check_[key4]) {
185 ProcessWithMEMap4(bh4, key4);
186 MEMap4Check_[key4] =
true;