7 const auto& simhit_pset =
pset.getParameterSet(
"gemSimHit");
8 const auto& simhit_tag = simhit_pset.getParameter<
edm::InputTag>(
"inputTag");
11 tof_range_ =
pset.getUntrackedParameter<std::vector<Double_t> >(
"TOFRange");
22 TString tof_xtitle =
"Time of flight [ns]";
23 TString tof_ytitle =
"Entries";
25 const auto& regionsVec =
gem->regions();
26 if (regionsVec.empty() || regionsVec[0] ==
nullptr) {
30 for (
const auto&
station : regionsVec[0]->stations()) {
31 Int_t station_id =
station->station();
32 const auto [tof_min, tof_max] =
getTOFRange(station_id);
33 auto tof_name = TString::Format(
"tof_muon_st%d", station_id);
34 auto tof_title = TString::Format(
"SimHit Time Of Flight (Muon only) : Station %d", station_id);
36 me_tof_mu_[station_id] = booker.
book1D(tof_name, tof_title, 40, tof_min, tof_max);
41 for (
const auto&
region :
gem->regions()) {
42 Int_t region_id =
region->region();
45 Int_t station_id =
station->station();
47 const auto [tof_min, tof_max] =
getTOFRange(station_id);
48 const auto& superChamberVec =
station->superChambers();
49 if (superChamberVec.empty() || superChamberVec.front() ==
nullptr) {
51 <<
" and station = " << station_id;
56 Int_t layer_id =
chamber->id().layer();
57 ME3IdsKey key3{region_id, station_id, layer_id};
60 booker, key3,
"tof",
"Time of Flight of Muon SimHits", 40, tof_min, tof_max, tof_xtitle, tof_ytitle);
63 booker, key3,
"tof_muon",
"SimHit TOF (Muon only)", 40, tof_min, tof_max, tof_xtitle, tof_ytitle);
73 TString eloss_xtitle =
"Energy loss [eV]";
74 TString eloss_ytitle =
"Entries / 100 eV";
76 for (
const auto&
station :
gem->regions()[0]->stations()) {
77 Int_t station_id =
station->station();
79 auto eloss_name = TString::Format(
"eloss_muon_st%d", station_id);
80 auto eloss_title = TString::Format(
"SimHit Energy Loss (Muon only) : Station %d", station_id);
83 booker.
book1D(eloss_name, eloss_title +
";" + eloss_xtitle +
";" + eloss_ytitle, 60, 0.0, 6000.0);
87 for (
const auto&
region :
gem->regions()) {
88 Int_t region_id =
region->region();
90 Int_t station_id =
station->station();
91 const auto& superChamberVec =
station->superChambers();
92 if (superChamberVec.empty() || superChamberVec.front() ==
nullptr) {
94 <<
" and station = " << station_id;
96 for (
const auto&
chamber : superChamberVec.front()->chambers()) {
97 Int_t layer_id =
chamber->id().layer();
98 ME3IdsKey key3{region_id, station_id, layer_id};
101 bookHist1D(booker, key3,
"eloss",
"SimHit Energy Loss", 60, 0.0, 6000.0, eloss_xtitle, eloss_ytitle);
106 "SimHit Energy Loss (Muon Only)",
122 for (
const auto&
region :
gem->regions()) {
123 Int_t region_id =
region->region();
128 Int_t station_id =
station->station();
133 const auto& superChamberVec =
station->superChambers();
134 if (superChamberVec.empty() || superChamberVec.front() ==
nullptr) {
136 <<
" and station = " << station_id;
140 Int_t layer_id =
chamber->id().layer();
141 ME3IdsKey key3{region_id, station_id, layer_id};
151 UInt_t start_index = station_id == 1 ? 0 : 2;
153 Double_t tof_max =
tof_range_[start_index + 1];
154 return std::make_tuple(tof_min, tof_max);
162 if (not simhit_container.
isValid()) {
167 for (
const auto& simhit : *simhit_container.
product()) {
168 const GEMDetId gemid(simhit.detUnitId());
170 if (
gem->idToDet(gemid) ==
nullptr) {
175 Int_t region_id = gemid.region();
176 Int_t station_id = gemid.station();
177 Int_t layer_id = gemid.layer();
178 Int_t chamber_id = gemid.chamber();
179 Int_t roll_id = gemid.roll();
182 ME3IdsKey key3{region_id, station_id, layer_id};
184 GlobalPoint&& simhit_global_pos =
gem->idToDet(gemid)->surface().toGlobal(simhit.localPosition());
186 Float_t simhit_g_r = simhit_global_pos.
perp();
187 Float_t simhit_g_x = simhit_global_pos.
x();
188 Float_t simhit_g_y = simhit_global_pos.
y();
189 Float_t simhit_g_abs_z = std::fabs(simhit_global_pos.
z());
191 Float_t energy_loss =
kEnergyCF_ * simhit.energyLoss();
192 Float_t tof = simhit.timeOfFlight();
197 me_occ_zr_[region_id]->Fill(simhit_g_abs_z, simhit_g_r);
199 me_occ_xy_[key3]->Fill(simhit_g_x, simhit_g_y);
202 if (is_muon_simhit) {
211 if (is_muon_simhit) {