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();
31 Int_t station_id =
station->station();
32 const auto& superChamberVec =
station->superChambers();
33 if (superChamberVec.empty() || superChamberVec[0] ==
nullptr) {
35 <<
" and station = " << station_id;
38 const auto& chamberVec = superChamberVec[0]->chambers();
39 if (chamberVec.empty() || chamberVec[0] ==
nullptr) {
41 <<
", " << station_id <<
", " << superChamberVec[0]->id() <<
")";
44 const auto& etaPartitionVec = chamberVec[0]->etaPartitions();
45 if (etaPartitionVec.empty() || etaPartitionVec[0] ==
nullptr) {
47 << region_id <<
", " << station_id <<
", " << superChamberVec[0]->id() <<
", "
48 << chamberVec[0]->id() <<
")";
51 Int_t num_pads = etaPartitionVec[0]->npads();
71 booker, key2,
"copad_occ_pad",
"CoPad Ocupancy per pad number", num_pads, 0.5, num_pads + 0.5,
"Pad number");
82 for (
const auto&
region :
gem->regions()) {
83 Int_t region_id =
region->region();
85 Int_t station_id =
station->station();
89 bookHist1D(booker, key2,
"copad_bx",
"CoPad Bunch Crossing", 5, -2.5, 2.5,
"Bunch crossing");
102 if (not copad_collection.
isValid()) {
108 for (
const auto& copad_pair : *copad_collection) {
110 const auto&
range = copad_pair.second;
112 Int_t region_id = gemid.
region();
113 Int_t station_id = gemid.
station();
115 Int_t layer_id = gemid.
layer();
116 Int_t chamber_id = gemid.
chamber();
117 Int_t num_layers = gemid.
nlayers();
121 for (
auto digi =
range.first; digi !=
range.second; ++digi) {
124 GEMDetId super_chamber_id{region_id,
ring_id, station_id, 0, chamber_id, 0};
125 Int_t roll_id = (*digi).roll();
127 const GeomDet* geom_det =
gem->idToDet(super_chamber_id);
128 if (geom_det ==
nullptr) {
130 <<
"loaded from GEMGeometry // Original" << gemid <<
" station : " << station_id
132 <<
"Getting DetId failed. Discard this gem copad hit." << std::endl;
138 if (super_chamber ==
nullptr) {
142 Int_t pad1 = digi->pad(1);
143 Int_t pad2 = digi->pad(2);
144 Int_t bx1 = digi->bx(1);
145 Int_t bx2 = digi->bx(2);
153 const Int_t padArray[] = {pad1, pad2};
156 for (; ptCounter < 2; ++ptCounter) {
160 <<
" is null for super chamber = " << super_chamber_id;
164 if (etaPartition ==
nullptr) {
166 << (ptCounter + 1) <<
", " << super_chamber_id <<
")";
169 lpArray[ptCounter] = etaPartition->
centreOfPad(padArray[ptCounter]);
175 const GlobalPoint& gp1 = surface.toGlobal(lpArray[0]);
176 const GlobalPoint& gp2 = surface.toGlobal(lpArray[1]);
178 Float_t g_r1 = gp1.
perp();
179 Float_t g_r2 = gp2.
perp();
181 Float_t g_z1 = gp1.
z();
182 Float_t g_z2 = gp2.
z();
184 Float_t g_phi = gp1.
phi();
185 Float_t g_x = gp1.
x();
186 Float_t g_y = gp1.
y();
190 Int_t bin_x =
getDetOccBinX(num_layers, chamber_id, layer_id);