CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
GEMEffByGEMCSCSegmentSource Class Reference

#include <GEMEffByGEMCSCSegmentSource.h>

Inheritance diagram for GEMEffByGEMCSCSegmentSource:
GEMDQMEfficiencySourceBase DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 GEMEffByGEMCSCSegmentSource (const edm::ParameterSet &)
 
 ~GEMEffByGEMCSCSegmentSource () override
 
- Public Member Functions inherited from GEMDQMEfficiencySourceBase
MonitorElementbookChamber (DQMStore::IBooker &, const TString &, const TString &, const GEMStation *)
 
MonitorElementbookChamberEtaPartition (DQMStore::IBooker &, const TString &, const TString &, const GEMStation *)
 
MonitorElementbookNumerator1D (DQMStore::IBooker &, MonitorElement *)
 
MonitorElementbookNumerator2D (DQMStore::IBooker &, MonitorElement *)
 
template<typename T >
bool checkRefs (const std::vector< T *> &)
 
double clampWithAxis (const double, const TAxis *axis)
 
void fillME (MEMap &, const GEMDetId &, const double)
 
void fillME (MEMap &, const GEMDetId &, const double, const double)
 
void fillMEWithinLimits (MonitorElement *, const double)
 
void fillMEWithinLimits (MonitorElement *, const double, const double)
 
void fillMEWithinLimits (MEMap &, const GEMDetId &, const double)
 
void fillMEWithinLimits (MEMap &, const GEMDetId &, const double, const double)
 
 GEMDQMEfficiencySourceBase (const edm::ParameterSet &)
 
std::tuple< bool, int, int > getChamberRange (const GEMStation *)
 
std::tuple< bool, int, int > getEtaPartitionRange (const GEMStation *)
 
GEMDetId getKey (const GEMDetId &)
 
GEMDetId getReStEtKey (const GEMDetId &)
 
GEMDetId getReStKey (const int, const int)
 
GEMDetId getReStKey (const GEMDetId &)
 
GEMDetId getReStLaChKey (const GEMDetId &)
 
GEMDetId getReStLaKey (const GEMDetId &)
 
bool hasMEKey (const MEMap &, const GEMDetId &)
 
bool maskChamberWithError (const GEMDetId &chamber_id, const GEMOHStatusCollection *, const GEMVFATStatusCollection *)
 
std::string nameNumerator (const std::string &)
 
bool skipGEMStation (const int)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup) override
 
void analyzeGE11ME11Segment (const GEMCSCSegment &, const GEMOHStatusCollection *, const GEMVFATStatusCollection *)
 
MonitorElementbookCSCChamberType (DQMStore::IBooker &, const TString &, const TString &)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void checkCoincidenceGE11 (const GEMRecHit *, const GEMRecHit *, const GEMCSCSegment &)
 
void findMatchedME11Segments (const reco::MuonCollection *)
 
bool isME11SegmentMatched (const CSCSegment &)
 

Private Attributes

const std::string kFolder_
 
const edm::EDGetTokenT< GEMCSCSegmentCollectionkGEMCSCSegmentCollectionToken_
 
const edm::ESGetToken< GEMGeometry, MuonGeometryRecordkGEMGeometryTokenBeginRun_
 
const int kMinCSCRecHits_
 
const bool kModeDev_
 
const edm::EDGetTokenT< reco::MuonCollectionkMuonCollectionToken_
 
const bool kUseMuonSegment_
 
std::vector< const CSCSegment * > matched_me11_segment_vector_
 
MEMap me_chamber_
 
MEMap me_chamber_matched_
 
MEMap me_chamber_muon_segment_
 
MEMap me_chamber_muon_segment_matched_
 
MEMap me_csc_chamber_type_
 
MEMap me_csc_chamber_type_matched_
 
MEMap me_csc_reduced_chi2_
 
MEMap me_csc_reduced_chi2_matched_
 
MEMap me_num_csc_hits_
 
MEMap me_num_csc_hits_matched_
 

Additional Inherited Members

- Public Types inherited from GEMDQMEfficiencySourceBase
using MEMap = std::map< GEMDetId, MonitorElement * >
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Public Attributes inherited from GEMDQMEfficiencySourceBase
const edm::EDGetTokenT< GEMOHStatusCollectionkGEMOHStatusCollectionToken_
 
const edm::EDGetTokenT< GEMVFATStatusCollectionkGEMVFATStatusCollectionToken_
 
const std::string kLogCategory_
 
const bool kMaskChamberWithError_
 
const bool kMonitorGE0_
 
const bool kMonitorGE11_
 
const bool kMonitorGE21_
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

GEMEffByGEMCSCSegmentSource measures the efficiency of GE11-L1(2) using GE11-L2(1) and ME11 as trigger detectors. See https://github.com/cms-sw/cmssw/blob/CMSSW_12_3_0_pre5/RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegAlgoRR.cc

Author
Seungjin Yang seung.nosp@m.jin..nosp@m.yang@.nosp@m.cern.nosp@m..ch

Definition at line 23 of file GEMEffByGEMCSCSegmentSource.h.

Constructor & Destructor Documentation

◆ GEMEffByGEMCSCSegmentSource()

GEMEffByGEMCSCSegmentSource::GEMEffByGEMCSCSegmentSource ( const edm::ParameterSet ps)
explicit

Definition at line 5 of file GEMEffByGEMCSCSegmentSource.cc.

7  kGEMGeometryTokenBeginRun_(esConsumes<edm::Transition::BeginRun>()),
9  consumes<GEMCSCSegmentCollection>(ps.getUntrackedParameter<edm::InputTag>("gemcscSegmentTag"))),
10  kMuonCollectionToken_(consumes<reco::MuonCollection>(ps.getUntrackedParameter<edm::InputTag>("muonTag"))),
11  kMinCSCRecHits_(ps.getUntrackedParameter<int>("minCSCRecHits")),
12  kModeDev_(ps.getUntrackedParameter<bool>("modeDev")),
13  kUseMuonSegment_(ps.getUntrackedParameter<bool>("useMuonSegment")),
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMGeometryTokenBeginRun_
const edm::EDGetTokenT< reco::MuonCollection > kMuonCollectionToken_
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< GEMCSCSegmentCollection > kGEMCSCSegmentCollectionToken_
GEMDQMEfficiencySourceBase(const edm::ParameterSet &)

◆ ~GEMEffByGEMCSCSegmentSource()

GEMEffByGEMCSCSegmentSource::~GEMEffByGEMCSCSegmentSource ( )
override

Definition at line 16 of file GEMEffByGEMCSCSegmentSource.cc.

16 {}

Member Function Documentation

◆ analyze()

void GEMEffByGEMCSCSegmentSource::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 128 of file GEMEffByGEMCSCSegmentSource.cc.

References analyzeGE11ME11Segment(), GEMCSCSegment::cscDetId(), findMatchedME11Segments(), patZpeak::handle, CSCDetId::isME11(), kGEMCSCSegmentCollectionToken_, GEMDQMEfficiencySourceBase::kGEMOHStatusCollectionToken_, GEMDQMEfficiencySourceBase::kGEMVFATStatusCollectionToken_, GEMDQMEfficiencySourceBase::kLogCategory_, GEMDQMEfficiencySourceBase::kMaskChamberWithError_, kMuonCollectionToken_, kUseMuonSegment_, and LogDebug.

128  {
130  // get data from event
132  const GEMCSCSegmentCollection* gemcsc_segment_collection = nullptr;
134  gemcsc_segment_collection = handle.product();
135 
136  } else {
137  edm::LogError(kLogCategory_) << "invalid GEMCSCSegmentCollection";
138  return;
139  }
140 
141  const reco::MuonCollection* muon_collection = nullptr;
142  if (kUseMuonSegment_) {
144  muon_collection = handle.product();
145 
146  } else {
147  edm::LogError(kLogCategory_) << "invalid reco::MuonCollection";
148  return;
149  }
150  }
151 
152  const GEMOHStatusCollection* oh_status_collection = nullptr;
153  const GEMVFATStatusCollection* vfat_status_collection = nullptr;
155  if (auto handle = event.getHandle(kGEMOHStatusCollectionToken_)) {
156  oh_status_collection = handle.product();
157  } else {
158  edm::LogError(kLogCategory_) << "failed to get OHVFATStatusCollection";
159  return;
160  }
161 
162  if (auto handle = event.getHandle(kGEMVFATStatusCollectionToken_)) {
163  vfat_status_collection = handle.product();
164  } else {
165  edm::LogError(kLogCategory_) << "failed to get GEMVFATStatusCollection";
166  return;
167  }
168  }
169 
171  // NOTE
173  if (gemcsc_segment_collection->size() < 1) {
174  LogDebug(kLogCategory_) << "empty GEMCSCSegment";
175  return;
176  }
177 
178  if (kUseMuonSegment_) {
179  findMatchedME11Segments(muon_collection);
180  }
181 
182  for (edm::OwnVector<GEMCSCSegment>::const_iterator iter = gemcsc_segment_collection->begin();
183  iter != gemcsc_segment_collection->end();
184  iter++) {
185  const GEMCSCSegment& gemcsc_segment = *iter;
186 
187  const CSCDetId csc_id = gemcsc_segment.cscDetId();
188  if (csc_id.isME11()) {
189  analyzeGE11ME11Segment(gemcsc_segment, oh_status_collection, vfat_status_collection);
190 
191  } else {
192  LogDebug(kLogCategory_) << "skip " << csc_id;
193  continue;
194  }
195  } // GEMCSCSegment
196 }
const edm::EDGetTokenT< reco::MuonCollection > kMuonCollectionToken_
Log< level::Error, false > LogError
const edm::EDGetTokenT< GEMVFATStatusCollection > kGEMVFATStatusCollectionToken_
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
void findMatchedME11Segments(const reco::MuonCollection *)
CSCDetId cscDetId() const
Definition: GEMCSCSegment.h:73
void analyzeGE11ME11Segment(const GEMCSCSegment &, const GEMOHStatusCollection *, const GEMVFATStatusCollection *)
const edm::EDGetTokenT< GEMOHStatusCollection > kGEMOHStatusCollectionToken_
bool isME11() const
Definition: CSCDetId.cc:64
const edm::EDGetTokenT< GEMCSCSegmentCollection > kGEMCSCSegmentCollectionToken_
Definition: event.py:1
#define LogDebug(id)
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...

◆ analyzeGE11ME11Segment()

void GEMEffByGEMCSCSegmentSource::analyzeGE11ME11Segment ( const GEMCSCSegment gemcsc_segment,
const GEMOHStatusCollection oh_status_collection,
const GEMVFATStatusCollection vfat_status_collection 
)
private

Definition at line 199 of file GEMEffByGEMCSCSegmentSource.cc.

References GEMDetId::chamberId(), checkCoincidenceGE11(), GEMCSCSegment::cscDetId(), GEMCSCSegment::gemRecHits(), GEMDetId::isGE11(), GEMDQMEfficiencySourceBase::kLogCategory_, GEMDQMEfficiencySourceBase::kMaskChamberWithError_, nano_mu_digi_cff::layer, GEMDetId::layer(), and GEMDQMEfficiencySourceBase::maskChamberWithError().

Referenced by analyze().

201  {
202  const GEMRecHit* ge11_hit_layer1 = nullptr;
203  const GEMRecHit* ge11_hit_layer2 = nullptr;
204 
205  const CSCDetId csc_id = gemcsc_segment.cscDetId();
206  for (const GEMRecHit& gem_hit : gemcsc_segment.gemRecHits()) {
207  const GEMDetId gem_id = gem_hit.gemId();
208 
209  if (not gem_id.isGE11()) {
210  edm::LogWarning(kLogCategory_) << "CSCSegment is in " << csc_id << " but GEMRecHit is in " << gem_id
211  << ". skip this GEMCSCSegment."
212  << "check if RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegAlgoRR.cc has changed.";
213  return;
214  }
215 
217  const bool has_error = maskChamberWithError(gem_id.chamberId(), oh_status_collection, vfat_status_collection);
218  if (has_error) {
219  return;
220  }
221  }
222 
223  const int layer = gem_id.layer();
224  if (layer == 1) {
225  ge11_hit_layer1 = &gem_hit;
226 
227  } else if (layer == 2) {
228  ge11_hit_layer2 = &gem_hit;
229 
230  } else {
231  edm::LogError(kLogCategory_) << "isGE11 but got unexpected layer " << gem_id << ". skip this GEMCSCSegment.";
232  return;
233  }
234  } // GEMRecHit
235 
236  checkCoincidenceGE11(ge11_hit_layer1, ge11_hit_layer2, gemcsc_segment);
237  checkCoincidenceGE11(ge11_hit_layer2, ge11_hit_layer1, gemcsc_segment);
238 }
bool isGE11() const
Definition: GEMDetId.cc:9
void checkCoincidenceGE11(const GEMRecHit *, const GEMRecHit *, const GEMCSCSegment &)
const std::vector< GEMRecHit > & gemRecHits() const
Definition: GEMCSCSegment.h:68
bool maskChamberWithError(const GEMDetId &chamber_id, const GEMOHStatusCollection *, const GEMVFATStatusCollection *)
Log< level::Error, false > LogError
constexpr int layer() const
Definition: GEMDetId.h:190
CSCDetId cscDetId() const
Definition: GEMCSCSegment.h:73
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:204
Log< level::Warning, false > LogWarning

◆ bookCSCChamberType()

dqm::impl::MonitorElement * GEMEffByGEMCSCSegmentSource::bookCSCChamberType ( DQMStore::IBooker ibooker,
const TString &  name,
const TString &  title 
)
private

Definition at line 116 of file GEMEffByGEMCSCSegmentSource.cc.

References dqm::implementation::IBooker::book1D(), CSCDetId::chamberName(), label, Skims_PA_cff::name, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

Referenced by bookHistograms().

118  {
119  MonitorElement* monitor_element = ibooker.book1D(name, title, 10, 0.5, 10.5);
120  monitor_element->setAxisTitle("CSC chamber type", 1);
121  for (int chamber_type = 1; chamber_type <= 10; chamber_type++) {
122  const std::string label = CSCDetId::chamberName(chamber_type);
123  monitor_element->setBinLabel(chamber_type, label, 1);
124  }
125  return monitor_element;
126 }
char const * label
std::string chamberName() const
Definition: CSCDetId.cc:92
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ bookHistograms()

void GEMEffByGEMCSCSegmentSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 41 of file GEMEffByGEMCSCSegmentSource.cc.

References dqm::implementation::IBooker::book1D(), GEMDQMEfficiencySourceBase::bookChamber(), bookCSCChamberType(), GEMDQMEfficiencySourceBase::bookNumerator1D(), relativeConstraints::chamber, GEMDQMEfficiencySourceBase::checkRefs(), mixOne_premix_on_sim_cfi::gem, GEMDQMEfficiencySourceBase::getReStLaKey(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), patZpeak::handle, crabWrapper::key, kFolder_, kGEMGeometryTokenBeginRun_, GEMDQMEfficiencySourceBase::kLogCategory_, kModeDev_, kUseMuonSegment_, me_chamber_, me_chamber_matched_, me_chamber_muon_segment_, me_chamber_muon_segment_matched_, me_csc_chamber_type_, me_csc_chamber_type_matched_, me_csc_reduced_chi2_, me_csc_reduced_chi2_matched_, me_num_csc_hits_, me_num_csc_hits_matched_, dqm::implementation::NavigatorBase::setCurrentFolder(), singleTopDQM_cfi::setup, GEMDQMEfficiencySourceBase::skipGEMStation(), relativeConstraints::station, makePlotsFromDump::suffix, and runGCPTkAlMap::title.

43  {
44  const GEMGeometry* gem = nullptr;
45  if (auto handle = setup.getHandle(kGEMGeometryTokenBeginRun_)) {
46  gem = handle.product();
47  } else {
48  edm::LogError(kLogCategory_ + "|bookHistograms") << "failed to get GEMGeometry";
49  return;
50  }
51 
52  ibooker.setCurrentFolder(kFolder_);
53 
54  for (const GEMStation* station : gem->stations()) {
55  const int region_id = station->region();
56  const int station_id = station->station();
57 
58  if (skipGEMStation(station_id))
59  continue;
60 
61  if (station_id == 1) {
63  // Region - Station - Layer
65  const std::vector<const GEMSuperChamber*> superchamber_vec = station->superChambers();
66  if (not checkRefs(superchamber_vec)) {
67  edm::LogError(kLogCategory_) << "got an invalid ptr from GEMStation::superChambers";
68  return;
69  }
70 
71  const std::vector<const GEMChamber*> chamber_vec = superchamber_vec.front()->chambers();
72  if (not checkRefs(chamber_vec)) {
73  edm::LogError(kLogCategory_) << "got an invalid ptr from GEMSuperChamber::chambers";
74  return;
75  }
76 
77  // we actually loop over layers
78  for (const GEMChamber* chamber : chamber_vec) {
79  const int layer_id = chamber->id().layer();
80  const GEMDetId key = getReStLaKey(chamber->id());
81  const TString suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id);
82  const TString title = GEMUtils::getSuffixTitle(region_id, station_id, layer_id);
83 
84  // book MEs for the efficiency vs the GEM chambver id
85  me_chamber_[key] = bookChamber(ibooker, "chamber" + suffix, title, station);
87 
88  if (kUseMuonSegment_) {
89  me_chamber_muon_segment_[key] = bookChamber(ibooker, "muon_chamber" + suffix, title, station);
91  }
92 
93  if (kModeDev_) {
94  // book MEs for the efficiency vs the number of CSC hits in a CSC segment
95  // CSCSegAlgoRU: min hits = 4, max hits = CSC layers = 6
96  me_num_csc_hits_[key] = ibooker.book1D("num_csc_hits" + suffix, title, 4, 2.5, 6.5);
97  me_num_csc_hits_[key]->setAxisTitle("Number of CSC Hits", 1);
99 
100  me_csc_reduced_chi2_[key] = ibooker.book1D("reduced_chi2" + suffix, title, 100, 0.0, 10.0);
101  me_csc_reduced_chi2_[key]->setAxisTitle("#chi^{2} / N_{dof} of CSC Segment", 1);
103 
104  me_csc_chamber_type_[key] = bookCSCChamberType(ibooker, "csc_chamber_type" + suffix, title);
106  }
107  } // GEMChamber
108  } else {
109  edm::LogWarning(kLogCategory_) << "The monitoring for "; // TODO
110  continue;
111  }
112  } // GEMStataion
113 }
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMGeometryTokenBeginRun_
TString getSuffixName(Int_t region_id)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
Log< level::Error, false > LogError
TString getSuffixTitle(Int_t region_id)
MonitorElement * bookCSCChamberType(DQMStore::IBooker &, const TString &, const TString &)
MonitorElement * bookNumerator1D(DQMStore::IBooker &, MonitorElement *)
MonitorElement * bookChamber(DQMStore::IBooker &, const TString &, const TString &, const GEMStation *)
bool checkRefs(const std::vector< T *> &)
GEMDetId getReStLaKey(const GEMDetId &)
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())
Definition: DQMStore.h:98

◆ checkCoincidenceGE11()

void GEMEffByGEMCSCSegmentSource::checkCoincidenceGE11 ( const GEMRecHit trigger_layer_hit,
const GEMRecHit detection_layer_hit,
const GEMCSCSegment gemcsc_segment 
)
private

Definition at line 241 of file GEMEffByGEMCSCSegmentSource.cc.

References relativeConstraints::chamber, GEMDetId::chamber(), GEMCSCSegment::chi2(), GEMCSCSegment::cscDetId(), GEMCSCSegment::cscRecHits(), GEMCSCSegment::cscSegment(), GEMCSCSegment::degreesOfFreedom(), GEMDQMEfficiencySourceBase::fillME(), GEMDQMEfficiencySourceBase::fillMEWithinLimits(), GEMRecHit::gemId(), CSCDetId::iChamberType(), isME11SegmentMatched(), crabWrapper::key, GEMDQMEfficiencySourceBase::kLogCategory_, kMinCSCRecHits_, kModeDev_, kUseMuonSegment_, GEMDetId::layer(), LogDebug, me_chamber_, me_chamber_matched_, me_chamber_muon_segment_, me_chamber_muon_segment_matched_, me_csc_chamber_type_, me_csc_chamber_type_matched_, me_csc_reduced_chi2_, me_csc_reduced_chi2_matched_, me_num_csc_hits_, me_num_csc_hits_matched_, GEMDetId::region(), and GEMDetId::station().

Referenced by analyzeGE11ME11Segment().

243  {
244  if (trigger_layer_hit == nullptr) {
245  LogDebug(kLogCategory_) << "trigger_layer_hit is nullptr";
246  return;
247  }
248 
249  const GEMDetId trigger_layer_id = trigger_layer_hit->gemId();
250  const int detection_layer = trigger_layer_id.layer() == 1 ? 2 : 1;
251  // detection layer key
252  // GEMDetId(int region, int ring, int station, int layer, int chamber, int ieta)
253  const GEMDetId key{trigger_layer_id.region(), 1, trigger_layer_id.station(), detection_layer, 0, 0};
254 
255  const int chamber = trigger_layer_id.chamber();
256  const bool is_matched = kUseMuonSegment_ ? isME11SegmentMatched(gemcsc_segment.cscSegment()) : false;
257 
258  const int num_csc_hits = static_cast<int>(gemcsc_segment.cscRecHits().size());
259  const double reduced_chi2 = gemcsc_segment.chi2() / gemcsc_segment.degreesOfFreedom();
260  const int csc_chamber_type = gemcsc_segment.cscDetId().iChamberType();
261 
262  if (kModeDev_) {
263  fillME(me_num_csc_hits_, key, num_csc_hits);
265  fillME(me_csc_chamber_type_, key, csc_chamber_type);
266 
267  if (detection_layer_hit) {
268  fillME(me_num_csc_hits_matched_, key, num_csc_hits);
270  fillME(me_csc_chamber_type_matched_, key, csc_chamber_type);
271  }
272  }
273 
274  // TODO add a method
275  const bool is_good = num_csc_hits >= kMinCSCRecHits_;
276  if (not is_good) {
277  return;
278  }
279 
280  // twofold coincidence rate
282  if (is_matched) {
284  }
285 
286  // threefold coincidence rate
287  if (detection_layer_hit) {
289  if (is_matched) {
291  }
292  }
293 }
constexpr int station() const
Definition: GEMDetId.h:179
constexpr int region() const
Definition: GEMDetId.h:171
void fillMEWithinLimits(MonitorElement *, const double)
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
Definition: GEMCSCSegment.h:62
constexpr int layer() const
Definition: GEMDetId.h:190
unsigned short iChamberType() const
Definition: CSCDetId.h:96
constexpr int chamber() const
Definition: GEMDetId.h:183
void fillME(MEMap &, const GEMDetId &, const double)
double chi2() const override
Chi2 of the segment fit.
Definition: GEMCSCSegment.h:58
CSCDetId cscDetId() const
Definition: GEMCSCSegment.h:73
const std::vector< CSCRecHit2D > & cscRecHits() const
Definition: GEMCSCSegment.h:69
GEMDetId gemId() const
Return the gemId.
Definition: GEMRecHit.h:65
bool isME11SegmentMatched(const CSCSegment &)
const CSCSegment cscSegment() const
Definition: GEMCSCSegment.h:67
#define LogDebug(id)

◆ fillDescriptions()

void GEMEffByGEMCSCSegmentSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 18 of file GEMEffByGEMCSCSegmentSource.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

18  {
20 
21  // GEMDQMEfficiencySourceBase
22  desc.addUntracked<edm::InputTag>("ohStatusTag", edm::InputTag("muonGEMDigis", "OHStatus"));
23  desc.addUntracked<edm::InputTag>("vfatStatusTag", edm::InputTag("muonGEMDigis", "VFATStatus"));
24  desc.addUntracked<bool>("monitorGE11", true);
25  desc.addUntracked<bool>("monitorGE21", false);
26  desc.addUntracked<bool>("monitorGE0", false);
27  desc.addUntracked<bool>("maskChamberWithError", false);
28  desc.addUntracked<std::string>("logCategory", "GEMEffByGEMCSCSegmentSource");
29 
30  // GEMEffByGEMCSCSegmentSource
31  desc.addUntracked<edm::InputTag>("gemcscSegmentTag", edm::InputTag("gemcscSegments"));
32  desc.addUntracked<edm::InputTag>("muonTag", edm::InputTag("muons"));
33  desc.addUntracked<int>("minCSCRecHits", 6);
34  desc.addUntracked<bool>("useMuonSegment", false);
35  desc.addUntracked<bool>("modeDev", false);
36  desc.addUntracked<std::string>("folder", "GEM/Efficiency/GEMCSCSegment");
37 
38  descriptions.addWithDefaultLabel(desc);
39 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ findMatchedME11Segments()

void GEMEffByGEMCSCSegmentSource::findMatchedME11Segments ( const reco::MuonCollection muon_collection)
private

Definition at line 296 of file GEMEffByGEMCSCSegmentSource.cc.

References reco::MuonSegmentMatch::BestInStationByDR, MuonSubdetId::CSC, reco::MuonSegmentMatch::cscSegmentRef, edm::Ref< C, T, F >::get(), heavyIonCSV_trainingSettings::idx, reco::MuonSegmentMatch::isMask(), and matched_me11_segment_vector_.

Referenced by analyze().

296  {
298 
299  if (muon_collection == nullptr) {
300  // TODO log
301  return;
302  }
303 
304  for (unsigned int idx = 0; idx < muon_collection->size(); idx++) {
305  const reco::Muon& muon = muon_collection->at(idx);
306 
307  for (const reco::MuonChamberMatch& chamber_match : muon.matches()) {
308  if (chamber_match.detector() != MuonSubdetId::CSC) {
309  continue;
310  }
311 
312  const CSCDetId csc_id{chamber_match.id};
313  if (not csc_id.isME11()) {
314  continue;
315  }
316 
317  for (const reco::MuonSegmentMatch& segment_match : chamber_match.segmentMatches) {
318  if (not segment_match.isMask(reco::MuonSegmentMatch::BestInStationByDR)) {
319  continue;
320  }
321  matched_me11_segment_vector_.push_back(segment_match.cscSegmentRef.get());
322  } // MuonSegmentMatch
323  } // MuonChamberMatch
324  } // MuonCollection
325 }
CSCSegmentRef cscSegmentRef
static const unsigned int BestInStationByDR
bool isMask(unsigned int flag=Arbitrated) const
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
std::vector< const CSCSegment * > matched_me11_segment_vector_
static constexpr int CSC
Definition: MuonSubdetId.h:12

◆ isME11SegmentMatched()

bool GEMEffByGEMCSCSegmentSource::isME11SegmentMatched ( const CSCSegment csc_segment)
private

Definition at line 328 of file GEMEffByGEMCSCSegmentSource.cc.

References CSCSegment::cscDetId(), newFWLiteAna::found, CSCDetId::isME11(), CSCSegment::localPosition(), matched_me11_segment_vector_, CSCSegment::time(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by checkCoincidenceGE11().

328  {
329  bool found = false;
330 
331  const CSCDetId csc_id = csc_segment.cscDetId();
332  if (not csc_id.isME11()) {
333  return false;
334  }
335 
336  for (const CSCSegment* matched_segment : matched_me11_segment_vector_) {
337  if (csc_id != matched_segment->cscDetId())
338  continue;
339  if (csc_segment.localPosition().x() != matched_segment->localPosition().x())
340  continue;
341  if (csc_segment.localPosition().y() != matched_segment->localPosition().y())
342  continue;
343  if (csc_segment.localPosition().z() != matched_segment->localPosition().z())
344  continue;
345  if (csc_segment.time() != matched_segment->time())
346  continue;
347 
348  found = true;
349  }
350 
351  return found;
352 }
float time() const
Definition: CSCSegment.cc:144
LocalPoint localPosition() const override
Definition: CSCSegment.h:39
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
bool isME11() const
Definition: CSCDetId.cc:64
CSCDetId cscDetId() const
Definition: CSCSegment.h:70
std::vector< const CSCSegment * > matched_me11_segment_vector_

Member Data Documentation

◆ kFolder_

const std::string GEMEffByGEMCSCSegmentSource::kFolder_
private

Definition at line 51 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms().

◆ kGEMCSCSegmentCollectionToken_

const edm::EDGetTokenT<GEMCSCSegmentCollection> GEMEffByGEMCSCSegmentSource::kGEMCSCSegmentCollectionToken_
private

Definition at line 46 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by analyze().

◆ kGEMGeometryTokenBeginRun_

const edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMEffByGEMCSCSegmentSource::kGEMGeometryTokenBeginRun_
private

Definition at line 45 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms().

◆ kMinCSCRecHits_

const int GEMEffByGEMCSCSegmentSource::kMinCSCRecHits_
private

Definition at line 48 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by checkCoincidenceGE11().

◆ kModeDev_

const bool GEMEffByGEMCSCSegmentSource::kModeDev_
private

Definition at line 49 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ kMuonCollectionToken_

const edm::EDGetTokenT<reco::MuonCollection> GEMEffByGEMCSCSegmentSource::kMuonCollectionToken_
private

Definition at line 47 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by analyze().

◆ kUseMuonSegment_

const bool GEMEffByGEMCSCSegmentSource::kUseMuonSegment_
private

Definition at line 50 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by analyze(), bookHistograms(), and checkCoincidenceGE11().

◆ matched_me11_segment_vector_

std::vector<const CSCSegment *> GEMEffByGEMCSCSegmentSource::matched_me11_segment_vector_
private

Definition at line 56 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by findMatchedME11Segments(), and isME11SegmentMatched().

◆ me_chamber_

MEMap GEMEffByGEMCSCSegmentSource::me_chamber_
private

Definition at line 59 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_chamber_matched_

MEMap GEMEffByGEMCSCSegmentSource::me_chamber_matched_
private

Definition at line 60 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_chamber_muon_segment_

MEMap GEMEffByGEMCSCSegmentSource::me_chamber_muon_segment_
private

Definition at line 69 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_chamber_muon_segment_matched_

MEMap GEMEffByGEMCSCSegmentSource::me_chamber_muon_segment_matched_
private

Definition at line 70 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_csc_chamber_type_

MEMap GEMEffByGEMCSCSegmentSource::me_csc_chamber_type_
private

Definition at line 66 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_csc_chamber_type_matched_

MEMap GEMEffByGEMCSCSegmentSource::me_csc_chamber_type_matched_
private

Definition at line 67 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_csc_reduced_chi2_

MEMap GEMEffByGEMCSCSegmentSource::me_csc_reduced_chi2_
private

Definition at line 64 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_csc_reduced_chi2_matched_

MEMap GEMEffByGEMCSCSegmentSource::me_csc_reduced_chi2_matched_
private

Definition at line 65 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_num_csc_hits_

MEMap GEMEffByGEMCSCSegmentSource::me_num_csc_hits_
private

Definition at line 62 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().

◆ me_num_csc_hits_matched_

MEMap GEMEffByGEMCSCSegmentSource::me_num_csc_hits_matched_
private

Definition at line 63 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms(), and checkCoincidenceGE11().