5 const auto& copad_pset =
pset.getParameterSet(
"gemCoPadDigi");
7 const auto& copad_tag = copad_pset.getParameter<
edm::InputTag>(
"inputTag");
8 copad_token_ = consumes<GEMCoPadDigiCollection>(copad_tag);
10 gem_bx_min_ = copad_pset.getParameter<
int>(
"minBX");
11 gem_bx_max_ = copad_pset.getParameter<
int>(
"maxBX");
22 for (
const auto&
region :
gem->regions()) {
23 Int_t region_id =
region->region();
28 Int_t station_id =
station->station();
29 const auto& superChamberVec =
station->superChambers();
30 if (superChamberVec.empty() || superChamberVec[0] ==
nullptr) {
32 <<
" and station = " << station_id;
35 const auto& chamberVec = superChamberVec[0]->chambers();
36 if (chamberVec.empty() || chamberVec[0] ==
nullptr) {
38 <<
", " << station_id <<
", " << superChamberVec[0]->id() <<
")";
41 const auto& etaPartitionVec = chamberVec[0]->etaPartitions();
42 if (etaPartitionVec.empty() || etaPartitionVec[0] ==
nullptr) {
44 << region_id <<
", " << station_id <<
", " << superChamberVec[0]->id() <<
", "
45 << chamberVec[0]->id() <<
")";
48 Int_t num_pads = etaPartitionVec[0]->npads();
70 booker, key2,
"copad_occ_pad",
"CoPad Ocupancy per pad number", num_pads, 0.5, num_pads + 0.5,
"Pad number");
79 for (
const auto&
region :
gem->regions()) {
80 Int_t region_id =
region->region();
82 Int_t station_id =
station->station();
86 bookHist1D(booker, key2,
"copad_bx",
"CoPad Bunch Crossing", 5, -2.5, 2.5,
"Bunch crossing");
99 if (not copad_collection.
isValid()) {
105 for (
auto range_iter = copad_collection->begin(); range_iter != copad_collection->end(); range_iter++) {
106 GEMDetId gemid = (*range_iter).first;
109 Int_t region_id = gemid.
region();
110 Int_t station_id = gemid.
station();
112 Int_t layer_id = gemid.
layer();
113 Int_t chamber_id = gemid.
chamber();
117 for (
auto digi =
range.first; digi !=
range.second; ++digi) {
120 GEMDetId super_chamber_id{region_id,
ring_id, station_id, 0, chamber_id, 0};
121 Int_t roll_id = (*digi).roll();
123 const GeomDet* geom_det =
gem->idToDet(super_chamber_id);
124 if (geom_det ==
nullptr) {
126 <<
"loaded from GEMGeometry // Original" << gemid <<
" station : " << station_id
128 <<
"Getting DetId failed. Discard this gem copad hit." << std::endl;
134 if (super_chamber ==
nullptr) {
138 Int_t pad1 = digi->pad(1);
139 Int_t pad2 = digi->pad(2);
140 Int_t bx1 = digi->bx(1);
141 Int_t bx2 = digi->bx(2);
149 const Int_t padArray[] = {pad1, pad2};
152 for (; ptCounter < 2; ++ptCounter) {
156 <<
" is null for super chamber = " << super_chamber_id;
160 if (etaPartition ==
nullptr) {
162 << (ptCounter + 1) <<
", " << super_chamber_id <<
")";
165 lpArray[ptCounter] = etaPartition->
centreOfPad(padArray[ptCounter]);
171 const GlobalPoint& gp1 = surface.toGlobal(lpArray[0]);
172 const GlobalPoint& gp2 = surface.toGlobal(lpArray[1]);
174 Float_t g_r1 = gp1.
perp();
175 Float_t g_r2 = gp2.
perp();
177 Float_t g_z1 = gp1.
z();
178 Float_t g_z2 = gp2.
z();
180 Float_t g_phi = gp1.
phi();
181 Float_t g_x = gp1.
x();
182 Float_t g_y = gp1.
y();
185 me_occ_zr_[region_id]->Fill(std::fabs(g_z1), g_r1);
186 me_occ_zr_[region_id]->Fill(std::fabs(g_z2), g_r2);