11 kUseMuon_(parameter_set.getUntrackedParameter<bool>(
"useMuon")),
12 kMinCSCRecHits_(parameter_set.getUntrackedParameter<uint32_t>(
"minCSCRecHits")),
13 kFolder_(parameter_set.getUntrackedParameter<std::
string>(
"folder")),
14 kLogCategory_(parameter_set.getUntrackedParameter<std::
string>(
"logCategory")) {}
47 const int region_id =
station->region();
48 const int station_id =
station->station();
50 if (station_id == 1) {
52 const std::vector<const GEMSuperChamber*> superchambers =
station->superChambers();
58 const int num_chambers = superchambers.size();
59 for (
const GEMChamber* chamber : superchambers.at(0)->chambers()) {
60 const int layer_id = chamber->id().layer();
66 me_chamber_[
key] = ibooker.
book1D(
"chamber" + name_suffix, title_suffix, num_chambers, 0.5, num_chambers + 0.5);
68 for (
int binx = 1; binx <= num_chambers; binx++) {
69 me_chamber_[
key]->setBinLabel(binx, std::to_string(binx), 1);
75 ibooker.
book1D(
"muon_chamber" + name_suffix, title_suffix, num_chambers, 0.5, num_chambers + 0.5);
77 for (
int binx = 1; binx <= num_chambers; binx++) {
95 const int region_id =
station->region();
96 const int station_id =
station->station();
98 if (station_id == 1) {
100 const std::vector<const GEMSuperChamber*> superchambers =
station->superChambers();
106 for (
const GEMChamber* chamber : superchambers.at(0)->chambers()) {
107 const int layer_id = chamber->id().layer();
129 for (
int chamber_type = 1; chamber_type <= 10; chamber_type++) {
148 TH1F*
hist =
dynamic_cast<TH1F*
>(me->
getTH1F()->Clone(name.c_str()));
149 return ibooker.
book1D(name, hist);
157 gemcsc_segment_collection =
handle.product();
167 muon_collection =
handle.product();
177 if (gemcsc_segment_collection->size() < 1) {
191 iter != gemcsc_segment_collection->end();
207 const GEMRecHit* ge11_hit_layer1 =
nullptr;
208 const GEMRecHit* ge11_hit_layer2 =
nullptr;
212 const GEMDetId gem_id = gem_hit.gemId();
214 if (not gem_id.
isGE11()) {
216 <<
". skip this GEMCSCSegment."
217 <<
"check if RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegAlgoRR.cc has changed.";
223 ge11_hit_layer1 = &gem_hit;
225 }
else if (layer == 2) {
226 ge11_hit_layer2 = &gem_hit;
241 if (trigger_layer_hit ==
nullptr) {
246 const GEMDetId trigger_layer_id = trigger_layer_hit->
gemId();
247 const int detection_layer = trigger_layer_id.
layer() == 1 ? 2 : 1;
252 const int chamber = trigger_layer_id.
chamber();
255 const int num_csc_hits = gemcsc_segment.
cscRecHits().size();
265 if (detection_layer_hit) {
279 if (detection_layer_hit) {
290 for (
unsigned int idx = 0; idx < muon_collection->size(); idx++) {
298 const CSCDetId csc_id{chamber_match.id};
299 if (not csc_id.isME11()) {
318 if (not csc_id.
isME11()) {
323 if (csc_id != matched_segment->cscDetId())
325 if (csc_segment.
localPosition().
x() != matched_segment->localPosition().x())
327 if (csc_segment.
localPosition().
y() != matched_segment->localPosition().y())
329 if (csc_segment.
localPosition().
z() != matched_segment->localPosition().z())
331 if (csc_segment.
time() != matched_segment->time())
343 if UNLIKELY (me_map.find(key) == me_map.end()) {
344 const std::string hint = me_map.empty() ?
"empty" : me_map.begin()->second->getName();
365 me_map[
key]->Fill(x);
374 me->
Fill(std::clamp(x, xlow, xup));
GEMEffByGEMCSCSegmentSource(const edm::ParameterSet &)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void fillME(dqm::impl::MonitorElement *, const double)
const edm::EDGetTokenT< reco::MuonCollection > kMuonToken_
GEMDetId getReStLaKey(const GEMDetId &)
bool hasMEKey(const MEMap &, const GEMDetId &)
LocalPoint localPosition() const override
CSCDetId cscDetId() const
const edm::EDGetTokenT< GEMCSCSegmentCollection > kGEMCSCSegmentToken_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
TString getSuffixName(Int_t region_id)
CSCSegmentRef cscSegmentRef
MEMap me_csc_chamber_type_matched_
virtual void setCurrentFolder(std::string const &fullpath)
void checkCoincidenceGE11(const GEMRecHit *, const GEMRecHit *, const GEMCSCSegment &)
virtual double getAxisMin(int axis=1) const
MEMap me_muon_chamber_matched_
MEMap me_chamber_matched_
const std::string kLogCategory_
MonitorElement * bookNumerator1D(DQMStore::IBooker &, MonitorElement *)
CSCDetId cscDetId() const
const std::string & getName() const
get name of ME
MEMap me_num_csc_hits_matched_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static void fillDescriptions(edm::ConfigurationDescriptions &)
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
Log< level::Error, false > LogError
TString getSuffixTitle(Int_t region_id)
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMTokenBeginRun_
static const unsigned int BestInStationByDR
std::vector< Muon > MuonCollection
collection of Muon objects
const std::vector< GEMRecHit > & gemRecHits() const
constexpr std::array< uint8_t, layerIndexSize > layer
void findMatchedME11Segments(const reco::MuonCollection *)
double chi2() const override
Chi2 of the segment fit.
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
MEMap me_reduced_chi2_matched_
MEMap me_csc_chamber_type_
void analyzeME11GE11Segment(const GEMCSCSegment &)
constexpr int region() const
tuple key
prepare the HTCondor submission files and eventually submit them
uint16_t const *__restrict__ x
void bookMisc(DQMStore::IBooker &, const edm::ESHandle< GEMGeometry > &)
const uint32_t kMinCSCRecHits_
T const * get() const
Returns C++ pointer to the item.
unsigned short iChamberType() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool checkRefs(const std::vector< T * > &)
std::map< GEMDetId, dqm::impl::MonitorElement * > MEMap
const std::vector< CSCRecHit2D > & cscRecHits() const
std::string chamberName() const
constexpr int chamber() const
constexpr int layer() const
bool isMask(unsigned int flag=Arbitrated) const
constexpr int station() const
std::vector< MuonChamberMatch > & matches()
get muon matching information
void bookEfficiencyChamber(DQMStore::IBooker &, const edm::ESHandle< GEMGeometry > &)
bool isME11SegmentMatched(const CSCSegment &)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
std::vector< const CSCSegment * > matched_me11_segment_vector_
~GEMEffByGEMCSCSegmentSource() override
GEMDetId gemId() const
Return the gemId.
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
const std::string kFolder_
virtual double getAxisMax(int axis=1) const
const CSCSegment cscSegment() const
void fillMEWithinLimits(dqm::impl::MonitorElement *, const double)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)