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);
9 geomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
10 geomTokenBeginRun_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
12 gem_bx_min_ = copad_pset.getParameter<
int>(
"minBX");
13 gem_bx_max_ = copad_pset.getParameter<
int>(
"maxBX");
24 for (
const auto&
region :
gem->regions()) {
25 Int_t region_id =
region->region();
30 Int_t station_id =
station->station();
31 const auto& superChamberVec =
station->superChambers();
32 if (superChamberVec.empty() || superChamberVec[0] ==
nullptr) {
34 <<
" and station = " << station_id;
37 const auto& chamberVec = superChamberVec[0]->chambers();
38 if (chamberVec.empty() || chamberVec[0] ==
nullptr) {
40 <<
", " << station_id <<
", " << superChamberVec[0]->id() <<
")";
43 const auto& etaPartitionVec = chamberVec[0]->etaPartitions();
44 if (etaPartitionVec.empty() || etaPartitionVec[0] ==
nullptr) {
46 << region_id <<
", " << station_id <<
", " << superChamberVec[0]->id() <<
", "
47 << chamberVec[0]->id() <<
")";
50 Int_t num_pads = etaPartitionVec[0]->npads();
72 booker, key2,
"copad_occ_pad",
"CoPad Ocupancy per pad number", num_pads, 0.5, num_pads + 0.5,
"Pad number");
81 for (
const auto&
region :
gem->regions()) {
82 Int_t region_id =
region->region();
84 Int_t station_id =
station->station();
88 bookHist1D(booker, key2,
"copad_bx",
"CoPad Bunch Crossing", 5, -2.5, 2.5,
"Bunch crossing");
101 if (not copad_collection.
isValid()) {
107 for (
auto range_iter = copad_collection->begin(); range_iter != copad_collection->end(); range_iter++) {
108 GEMDetId gemid = (*range_iter).first;
111 Int_t region_id = gemid.
region();
112 Int_t station_id = gemid.
station();
114 Int_t layer_id = gemid.
layer();
115 Int_t chamber_id = gemid.
chamber();
119 for (
auto digi =
range.first; digi !=
range.second; ++digi) {
122 GEMDetId super_chamber_id{region_id,
ring_id, station_id, 0, chamber_id, 0};
123 Int_t roll_id = (*digi).roll();
125 const GeomDet* geom_det =
gem->idToDet(super_chamber_id);
126 if (geom_det ==
nullptr) {
128 <<
"loaded from GEMGeometry // Original" << gemid <<
" station : " << station_id
130 <<
"Getting DetId failed. Discard this gem copad hit." << std::endl;
136 if (super_chamber ==
nullptr) {
140 Int_t pad1 = digi->pad(1);
141 Int_t pad2 = digi->pad(2);
142 Int_t bx1 = digi->bx(1);
143 Int_t bx2 = digi->bx(2);
151 const Int_t padArray[] = {pad1, pad2};
154 for (; ptCounter < 2; ++ptCounter) {
158 <<
" is null for super chamber = " << super_chamber_id;
162 if (etaPartition ==
nullptr) {
164 << (ptCounter + 1) <<
", " << super_chamber_id <<
")";
167 lpArray[ptCounter] = etaPartition->
centreOfPad(padArray[ptCounter]);
173 const GlobalPoint& gp1 = surface.toGlobal(lpArray[0]);
174 const GlobalPoint& gp2 = surface.toGlobal(lpArray[1]);
176 Float_t g_r1 = gp1.
perp();
177 Float_t g_r2 = gp2.
perp();
179 Float_t g_z1 = gp1.
z();
180 Float_t g_z2 = gp2.
z();
182 Float_t g_phi = gp1.
phi();
183 Float_t g_x = gp1.
x();
184 Float_t g_y = gp1.
y();
187 me_occ_zr_[region_id]->Fill(std::fabs(g_z1), g_r1);
188 me_occ_zr_[region_id]->Fill(std::fabs(g_z2), g_r2);