17 geomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
18 geomTokenBeginRun_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
41 Int_t region_id =
region->region();
47 Int_t station_id =
station->station();
49 const auto& superChamberVec =
station->superChambers();
50 if (superChamberVec.empty()) {
52 <<
" and station = " << station_id;
56 if (super_chamber ==
nullptr) {
58 <<
" and station = " << station_id;
61 for (
const auto& chamber : super_chamber->
chambers()) {
62 Int_t layer_id = chamber->id().layer();
63 ME3IdsKey key3(region_id, station_id, layer_id);
66 bookHist1D(booker, key3,
"bx",
"Strip Digi Bunch Crossing", 5, -2.5, 2.5,
"Bunch crossing");
75 booker.
book1D(
"total_strips_per_event",
"Number of strip digi per event", 50, -0.5, 395.5);
78 Int_t region_id =
region->region();
84 Int_t station_id =
station->station();
91 bookHist1D(booker, key2,
"total_strips_per_event",
"Number of strip digs per event", 50, -0.5, 99.5);
99 const auto& superChamberVec =
station->superChambers();
100 if (superChamberVec.empty() || superChamberVec[0] ==
nullptr) {
102 <<
" and station = " << station_id;
104 for (
const auto& etaPart : superChamberVec[0]->
chambers()[0]->etaPartitions()) {
105 Int_t ieta = etaPart->id().ieta();
109 for (
const auto& chamber : superChamberVec[0]->
chambers()) {
110 if (chamber ==
nullptr) {
112 << station_id <<
", " << superChamberVec[0]->id() <<
")";
115 Int_t layer_id = chamber->id().layer();
116 ME3IdsKey key3{region_id, station_id, layer_id};
118 const auto& etaPartitionsVec = chamber->etaPartitions();
119 if (etaPartitionsVec.empty() || etaPartitionsVec.front() ==
nullptr) {
121 <<
"Eta partition missing or null for region, station, super chamber, chamber = (" << region_id <<
", "
122 << station_id <<
", " << superChamberVec[0]->id() <<
", " << chamber->id() <<
")";
127 Int_t num_strips = etaPartitionsVec.front()->nstrips();
131 "sim_matched_occ_eta",
132 "Matched Strip Eta Occupancy",
139 booker, key3,
"sim_matched_occ_phi",
"Matched Strip Phi Occupancy", 36, -5, 355,
"#phi [degrees]");
146 "Strip Digi Occupancy per strip number",
162 if (gem ==
nullptr) {
169 if (not digiSimLink.
isValid()) {
176 if (not simhit_container.
isValid()) {
183 if (not digi_collection.
isValid()) {
189 Int_t total_strip = 0;
190 std::map<ME2IdsKey, Int_t> total_strip_2IdsMap;
191 for (
const auto digi_pair : *digi_collection) {
193 if (gem->
idToDet(
id) ==
nullptr) {
195 <<
"from unmatched geometry." << std::endl;
199 Int_t region_id =
id.region();
200 Int_t layer_id =
id.layer();
201 Int_t station_id =
id.station();
202 Int_t chamber_id =
id.chamber();
203 Int_t ieta =
id.ieta();
204 Int_t num_layers =
id.nlayers();
207 ME3IdsKey key3{region_id, station_id, layer_id};
208 Int_t bin_x =
getDetOccBinX(num_layers, chamber_id, layer_id);
214 auto links = digiSimLink->find(
id);
215 if (
links == digiSimLink->end())
218 for (
auto digi = range.first; digi != range.second; ++digi) {
220 total_strip_2IdsMap[key2]++;
221 Int_t
strip = digi->strip();
222 Int_t
bx = digi->bx();
223 bx = bx < -10 ? -10 :
bx;
224 bx = bx > 10 ? 10 :
bx;
228 Float_t digi_g_x = strip_global_pos.
x();
229 Float_t digi_g_y = strip_global_pos.
y();
230 Float_t digi_g_r = strip_global_pos.
perp();
231 Float_t digi_g_abs_z =
std::abs(strip_global_pos.
z());
247 Int_t region_id =
region->region();
249 Int_t station_id =
station->station();
257 for (
const auto& simhit : *simhit_container.
product()) {
258 if (gem->
idToDet(simhit.detUnitId()) ==
nullptr) {
263 GEMDetId simhit_gemid(simhit.detUnitId());
265 Int_t region_id = simhit_gemid.
region();
266 Int_t station_id = simhit_gemid.station();
267 Int_t layer_id = simhit_gemid.layer();
268 Int_t chamber_id = simhit_gemid.chamber();
269 Int_t ieta = simhit_gemid.ieta();
270 Int_t num_layers = simhit_gemid.nlayers();
274 ME3IdsKey key3{region_id, station_id, layer_id};
278 const auto& simhit_local_pos = simhit.localPosition();
279 const auto& simhit_global_pos = roll->
surface().
toGlobal(simhit_local_pos);
281 Float_t simhit_g_eta =
std::abs(simhit_global_pos.eta());
282 Float_t simhit_g_phi =
toDegree(simhit_global_pos.phi());
284 auto simhit_trackId = simhit.trackId();
286 Int_t bin_x =
getDetOccBinX(num_layers, chamber_id, layer_id);
288 auto links = digiSimLink->find(simhit_gemid);
289 if (
links == digiSimLink->end())
293 if (simhit_trackId ==
link.getTrackId()) {
294 Int_t pid = simhit.particleType();
dqm::impl::MonitorElement * bookHist1D(DQMStore::IBooker &booker, const T &key, const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, const char *x_title="", const char *y_title="Entries")
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * me_detail_bx_
Bool_t isMuonSimHit(const PSimHit &)
const GeomDet * idToDet(DetId) const override
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomTokenBeginRun_
MonitorElement * me_detail_total_strip_all_
GEMStripDigiValidation(const edm::ParameterSet &)
Log< level::Error, false > LogError
dqm::impl::MonitorElement * bookZROccupancy(DQMStore::IBooker &booker, Int_t region_id, const char *name_prfix, const char *title_prefix)
MEMap3Ids me_detail_strip_occ_phi_
const Plane & surface() const
The nominal surface of the GeomDet.
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
MEMap1Ids me_detail_occ_zr_
const uint16_t range(const Frame &aFrame)
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
MEMap3Ids me_detail_occ_strip_
bool getData(T &iHolder) const
dqm::impl::MonitorElement * bookXYOccupancy(DQMStore::IBooker &booker, const T &key, const char *name_prefix, const char *title_prefix)
MEMap3Ids me_detail_occ_xy_
MEMap2Ids me_detail_occ_det_
edm::EDGetTokenT< edm::DetSetVector< GEMDigiSimLink > > digisimlink_token_
void analyze(const edm::Event &, const edm::EventSetup &) override
constexpr int region() const
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
Int_t getPidIdx(Int_t pid)
MEMap3Ids me_occ_pid_eta_
tuple key
prepare the HTCondor submission files and eventually submit them
Abs< T >::type abs(const T &t)
std::vector< Double_t > eta_range_
MEMap3Ids me_detail_strip_occ_eta_
edm::EDGetTokenT< GEMDigiCollection > strip_token_
T const * product() const
ParameterSet const & getParameterSet(std::string const &) const
std::pair< const_iterator, const_iterator > Range
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::PSimHitContainer > simhit_token_
MEMap3Ids me_detail_bx_layer_
~GEMStripDigiValidation() override
const std::vector< const GEMChamber * > & chambers() const
Return the chambers in the super chamber.
std::tuple< Int_t, Int_t > ME2IdsKey
Float_t toDegree(Float_t radian)
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
MEMap2Ids me_detail_strip_occ_det_
MEMap2Ids me_detail_total_strip_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
static char chambers[264][20]
Int_t getDetOccBinX(Int_t num_layers, Int_t chamber_id, Int_t layer_id)
dqm::impl::MonitorElement * bookPIDHist(DQMStore::IBooker &booker, const T &key, const char *name, const char *title)
const std::string kLogCategory_
dqm::impl::MonitorElement * bookDetectorOccupancy(DQMStore::IBooker &booker, const T &key, const GEMStation *station, const char *name_prfix, const char *title_prefix)