CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:
GEMOfflineDQMBase 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 GEMOfflineDQMBase
template<typename T >
bool checkRefs (const std::vector< T * > &)
 
void fillME (MEMap &me_map, const GEMDetId &key, const float x)
 
void fillME (MEMap &me_map, const GEMDetId &key, const float x, const float y)
 
 GEMOfflineDQMBase (const edm::ParameterSet &)
 
int getDetOccXBin (const int, const int, const int)
 
int getDetOccXBin (const GEMDetId &, const edm::ESHandle< GEMGeometry > &)
 
GEMDetId getKey (const GEMDetId &)
 
int getMaxVFAT (const int)
 
int getNumEtaPartitions (const GEMStation *)
 
GEMDetId getReStEtKey (const GEMDetId &)
 
GEMDetId getReStKey (const int, const int)
 
GEMDetId getReStKey (const GEMDetId &)
 
GEMDetId getReStLaChKey (const GEMDetId &)
 
GEMDetId getReStLaKey (const GEMDetId &)
 
int getVFATNumber (const int, const int, const int)
 
int getVFATNumberByStrip (const int, const int, const int)
 
void setDetLabelsEta (MonitorElement *, const GEMStation *)
 
void setDetLabelsVFAT (MonitorElement *, const GEMStation *)
 
- 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
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup) override
 
void analyzeME11GE11Segment (const GEMCSCSegment &)
 
void bookEfficiencyChamber (DQMStore::IBooker &, const edm::ESHandle< GEMGeometry > &)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void bookMisc (DQMStore::IBooker &, const edm::ESHandle< GEMGeometry > &)
 
MonitorElementbookNumerator1D (DQMStore::IBooker &, MonitorElement *)
 
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
< GEMCSCSegmentCollection
kGEMCSCSegmentToken_
 
const edm::ESGetToken
< GEMGeometry,
MuonGeometryRecord
kGEMTokenBeginRun_
 
const std::string kLogCategory_
 
const uint32_t kMinCSCRecHits_
 
const edm::EDGetTokenT
< reco::MuonCollection
kMuonToken_
 
const bool kUseMuon_
 
std::vector< const CSCSegment * > matched_me11_segment_vector_
 
MEMap me_chamber_
 
MEMap me_chamber_matched_
 
MEMap me_csc_chamber_type_
 
MEMap me_csc_chamber_type_matched_
 
MEMap me_muon_chamber_
 
MEMap me_muon_chamber_matched_
 
MEMap me_num_csc_hits_
 
MEMap me_num_csc_hits_matched_
 
MEMap me_reduced_chi2_
 
MEMap me_reduced_chi2_matched_
 

Additional Inherited Members

- Public Types inherited from GEMOfflineDQMBase
using MEMap = std::map< GEMDetId, dqm::impl::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 GEMOfflineDQMBase
std::string log_category_
 
- 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 ( const edm::ParameterSet parameter_set)
explicit

Definition at line 5 of file GEMEffByGEMCSCSegmentSource.cc.

6  : GEMOfflineDQMBase(parameter_set),
7  kGEMTokenBeginRun_(esConsumes<edm::Transition::BeginRun>()),
9  consumes<GEMCSCSegmentCollection>(parameter_set.getParameter<edm::InputTag>("gemcscSegmentTag"))),
10  kMuonToken_(consumes<reco::MuonCollection>(parameter_set.getParameter<edm::InputTag>("muonTag"))),
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")) {}
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< reco::MuonCollection > kMuonToken_
GEMOfflineDQMBase(const edm::ParameterSet &)
const edm::EDGetTokenT< GEMCSCSegmentCollection > kGEMCSCSegmentToken_
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMTokenBeginRun_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GEMEffByGEMCSCSegmentSource::~GEMEffByGEMCSCSegmentSource ( )
override

Definition at line 16 of file GEMEffByGEMCSCSegmentSource.cc.

16 {}

Member Function Documentation

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

Reimplemented from DQMEDAnalyzer.

Definition at line 152 of file GEMEffByGEMCSCSegmentSource.cc.

References analyzeME11GE11Segment(), GEMCSCSegment::cscDetId(), findMatchedME11Segments(), edm::Event::getHandle(), patZpeak::handle, CSCDetId::isME11(), kGEMCSCSegmentToken_, kLogCategory_, kMuonToken_, kUseMuon_, and LogDebug.

152  {
154  // get data from Event & EventSetup
155  const GEMCSCSegmentCollection* gemcsc_segment_collection = nullptr;
157  gemcsc_segment_collection = handle.product();
158 
159  } else {
160  edm::LogError(kLogCategory_) << "invalid GEMCSCSegmentCollection";
161  return;
162  }
163 
164  const reco::MuonCollection* muon_collection = nullptr;
165  if (kUseMuon_) {
167  muon_collection = handle.product();
168 
169  } else {
170  edm::LogError(kLogCategory_) << "invalid reco::MuonCollection";
171  return;
172  }
173  }
174 
176  // quick check
177  if (gemcsc_segment_collection->size() < 1) {
178  LogDebug(kLogCategory_) << "empty GEMCSCSegment";
179  return;
180  }
181 
183  //
184  if (kUseMuon_) {
185  findMatchedME11Segments(muon_collection);
186  }
187 
189  // main loop
190  for (edm::OwnVector<GEMCSCSegment>::const_iterator iter = gemcsc_segment_collection->begin();
191  iter != gemcsc_segment_collection->end();
192  iter++) {
193  const GEMCSCSegment& gemcsc_segment = *iter;
194 
195  const CSCDetId csc_id = gemcsc_segment.cscDetId();
196  if (csc_id.isME11()) {
197  analyzeME11GE11Segment(gemcsc_segment);
198 
199  } else {
200  LogDebug(kLogCategory_) << "skip " << csc_id;
201  continue;
202  }
203  } // GEMCSCSegment
204 }
const edm::EDGetTokenT< reco::MuonCollection > kMuonToken_
const edm::EDGetTokenT< GEMCSCSegmentCollection > kGEMCSCSegmentToken_
CSCDetId cscDetId() const
Definition: GEMCSCSegment.h:73
Log< level::Error, false > LogError
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
void findMatchedME11Segments(const reco::MuonCollection *)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
bool isME11() const
Definition: CSCDetId.cc:64
void analyzeME11GE11Segment(const GEMCSCSegment &)
tuple handle
Definition: patZpeak.py:25
#define LogDebug(id)
void GEMEffByGEMCSCSegmentSource::analyzeME11GE11Segment ( const GEMCSCSegment gemcsc_segment)
private

Definition at line 206 of file GEMEffByGEMCSCSegmentSource.cc.

References checkCoincidenceGE11(), GEMCSCSegment::cscDetId(), GEMCSCSegment::gemRecHits(), GEMDetId::isGE11(), kLogCategory_, phase1PixelTopology::layer, and GEMDetId::layer().

Referenced by analyze().

206  {
207  const GEMRecHit* ge11_hit_layer1 = nullptr;
208  const GEMRecHit* ge11_hit_layer2 = nullptr;
209 
210  const CSCDetId csc_id = gemcsc_segment.cscDetId();
211  for (const GEMRecHit& gem_hit : gemcsc_segment.gemRecHits()) {
212  const GEMDetId gem_id = gem_hit.gemId();
213 
214  if (not gem_id.isGE11()) {
215  edm::LogWarning(kLogCategory_) << "CSCSegment is in " << csc_id << " but GEMRecHit is in " << gem_id
216  << ". skip this GEMCSCSegment."
217  << "check if RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegAlgoRR.cc has changed.";
218  return;
219  }
220 
221  const int layer = gem_id.layer();
222  if (layer == 1) {
223  ge11_hit_layer1 = &gem_hit;
224 
225  } else if (layer == 2) {
226  ge11_hit_layer2 = &gem_hit;
227 
228  } else {
229  edm::LogError(kLogCategory_) << "isGE11 but got unexpected layer " << gem_id << ". skip this GEMCSCSegment.";
230  return;
231  }
232  } // GEMRecHit
233 
234  checkCoincidenceGE11(ge11_hit_layer1, ge11_hit_layer2, gemcsc_segment);
235  checkCoincidenceGE11(ge11_hit_layer2, ge11_hit_layer1, gemcsc_segment);
236 }
void checkCoincidenceGE11(const GEMRecHit *, const GEMRecHit *, const GEMCSCSegment &)
CSCDetId cscDetId() const
Definition: GEMCSCSegment.h:73
Log< level::Error, false > LogError
const std::vector< GEMRecHit > & gemRecHits() const
Definition: GEMCSCSegment.h:68
constexpr std::array< uint8_t, layerIndexSize > layer
bool isGE11() const
Definition: GEMDetId.cc:9
constexpr int layer() const
Definition: GEMDetId.h:190
Log< level::Warning, false > LogWarning
void GEMEffByGEMCSCSegmentSource::bookEfficiencyChamber ( DQMStore::IBooker ibooker,
const edm::ESHandle< GEMGeometry > &  gem 
)
private

Definition at line 42 of file GEMEffByGEMCSCSegmentSource.cc.

References dqm::implementation::IBooker::book1D(), bookNumerator1D(), GEMOfflineDQMBase::checkRefs(), GEMOfflineDQMBase::getReStLaKey(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), submitPVResolutionJobs::key, kFolder_, kLogCategory_, kUseMuon_, LogDebug, me_chamber_, me_chamber_matched_, me_muon_chamber_, me_muon_chamber_matched_, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), relativeConstraints::station, and cond::impl::to_string().

Referenced by bookHistograms().

43  {
44  ibooker.setCurrentFolder(kFolder_ + "/Efficiency");
45 
46  for (const GEMStation* station : gem->stations()) {
47  const int region_id = station->region();
48  const int station_id = station->station();
49 
50  if (station_id == 1) {
51  // GE11
52  const std::vector<const GEMSuperChamber*> superchambers = station->superChambers();
53  if (not checkRefs(superchambers)) {
54  edm::LogError(kLogCategory_) << "failed to get a valid vector of GEMSuperChamber ptrs";
55  return;
56  }
57 
58  const int num_chambers = superchambers.size();
59  for (const GEMChamber* chamber : superchambers.at(0)->chambers()) {
60  const int layer_id = chamber->id().layer();
61 
62  const TString name_suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id);
63  const TString title_suffix = GEMUtils::getSuffixTitle(region_id, station_id, layer_id);
64  const GEMDetId key = getReStLaKey(chamber->id());
65 
66  me_chamber_[key] = ibooker.book1D("chamber" + name_suffix, title_suffix, num_chambers, 0.5, num_chambers + 0.5);
67  me_chamber_[key]->setAxisTitle("Chamber", 1);
68  for (int binx = 1; binx <= num_chambers; binx++) {
69  me_chamber_[key]->setBinLabel(binx, std::to_string(binx), 1);
70  }
71  me_chamber_matched_[key] = bookNumerator1D(ibooker, me_chamber_[key]);
72 
73  if (kUseMuon_) {
75  ibooker.book1D("muon_chamber" + name_suffix, title_suffix, num_chambers, 0.5, num_chambers + 0.5);
76  me_muon_chamber_[key]->setAxisTitle("Chamber", 1);
77  for (int binx = 1; binx <= num_chambers; binx++) {
78  me_muon_chamber_[key]->setBinLabel(binx, std::to_string(binx), 1);
79  }
81  }
82  } // layer
83 
84  } else {
85  LogDebug(kLogCategory_) << "skip " << station->getName();
86  continue;
87  }
88  } // station
89 }
GEMDetId getReStLaKey(const GEMDetId &)
TString getSuffixName(Int_t region_id)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * bookNumerator1D(DQMStore::IBooker &, MonitorElement *)
std::string to_string(const V &value)
Definition: OMSAccess.h:71
Log< level::Error, false > LogError
TString getSuffixTitle(Int_t region_id)
bool checkRefs(const std::vector< T * > &)
tuple key
prepare the HTCondor submission files and eventually submit them
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
#define LogDebug(id)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void GEMEffByGEMCSCSegmentSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 29 of file GEMEffByGEMCSCSegmentSource.cc.

References bookEfficiencyChamber(), bookMisc(), edm::EventSetup::getHandle(), edm::ESHandleBase::isValid(), kGEMTokenBeginRun_, and kLogCategory_.

31  {
32  const edm::ESHandle<GEMGeometry>& gem = setup.getHandle(kGEMTokenBeginRun_);
33  if (not gem.isValid()) {
34  edm::LogError(kLogCategory_) << "invalid GEMGeometry";
35  return;
36  }
37 
38  bookEfficiencyChamber(ibooker, gem);
39  bookMisc(ibooker, gem);
40 }
Log< level::Error, false > LogError
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMTokenBeginRun_
void bookMisc(DQMStore::IBooker &, const edm::ESHandle< GEMGeometry > &)
void bookEfficiencyChamber(DQMStore::IBooker &, const edm::ESHandle< GEMGeometry > &)
bool isValid() const
Definition: ESHandle.h:44
void GEMEffByGEMCSCSegmentSource::bookMisc ( DQMStore::IBooker ibooker,
const edm::ESHandle< GEMGeometry > &  gem 
)
private

Definition at line 91 of file GEMEffByGEMCSCSegmentSource.cc.

References dqm::implementation::IBooker::book1D(), bookNumerator1D(), CSCDetId::chamberName(), GEMOfflineDQMBase::checkRefs(), GEMOfflineDQMBase::getReStLaKey(), GEMUtils::getSuffixName(), GEMUtils::getSuffixTitle(), submitPVResolutionJobs::key, kFolder_, kLogCategory_, label, LogDebug, me_csc_chamber_type_, me_csc_chamber_type_matched_, me_num_csc_hits_, me_num_csc_hits_matched_, me_reduced_chi2_, me_reduced_chi2_matched_, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), relativeConstraints::station, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

91  {
92  ibooker.setCurrentFolder(kFolder_ + "/Misc");
93 
94  for (const GEMStation* station : gem->stations()) {
95  const int region_id = station->region();
96  const int station_id = station->station();
97 
98  if (station_id == 1) {
99  // GE11
100  const std::vector<const GEMSuperChamber*> superchambers = station->superChambers();
101  if (not checkRefs(superchambers)) {
102  edm::LogError(kLogCategory_) << "failed to get a valid vector of GEMSuperChamber ptrs";
103  return;
104  }
105 
106  for (const GEMChamber* chamber : superchambers.at(0)->chambers()) {
107  const int layer_id = chamber->id().layer();
108 
109  const TString name_suffix = GEMUtils::getSuffixName(region_id, station_id, layer_id);
110  const TString title_suffix = GEMUtils::getSuffixTitle(region_id, station_id, layer_id);
111  const GEMDetId key = getReStLaKey(chamber->id());
112 
113  // num_csc_hits
114  me_num_csc_hits_[key] = ibooker.book1D("num_csc_hits" + name_suffix, title_suffix, 4, 2.5, 6.5);
115  me_num_csc_hits_[key]->setAxisTitle("Number of CSCRecHits", 1);
116 
117  me_num_csc_hits_matched_[key] = bookNumerator1D(ibooker, me_num_csc_hits_[key]);
118 
119  // reduced_chi2
120  me_reduced_chi2_[key] = ibooker.book1D("reduced_chi2" + name_suffix, title_suffix, 30, 0, 3);
121  me_reduced_chi2_[key]->setAxisTitle("#chi^{2} / dof", 1);
122 
124 
125  // CSC chamber type
126  // https://github.com/cms-sw/cmssw/blob/CMSSW_12_3_0_pre5/DataFormats/MuonDetId/interface/CSCDetId.h#L187-L193
127  me_csc_chamber_type_[key] = ibooker.book1D("csc_chamber_type" + name_suffix, title_suffix, 10, 0.5, 10.5);
128  me_csc_chamber_type_[key]->setAxisTitle("CSC chamber type", 1);
129  for (int chamber_type = 1; chamber_type <= 10; chamber_type++) {
130  const std::string label = CSCDetId::chamberName(chamber_type);
131  me_csc_chamber_type_[key]->setBinLabel(chamber_type, label, 1);
132  }
133 
135 
136  } // layer
137 
138  } else {
139  LogDebug(kLogCategory_) << "skip " << station->getName();
140  continue;
141  }
142  } // region-station
143 }
GEMDetId getReStLaKey(const GEMDetId &)
TString getSuffixName(Int_t region_id)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * bookNumerator1D(DQMStore::IBooker &, MonitorElement *)
Log< level::Error, false > LogError
TString getSuffixTitle(Int_t region_id)
char const * label
bool checkRefs(const std::vector< T * > &)
tuple key
prepare the HTCondor submission files and eventually submit them
std::string chamberName() const
Definition: CSCDetId.cc:92
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
#define LogDebug(id)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
dqm::impl::MonitorElement * GEMEffByGEMCSCSegmentSource::bookNumerator1D ( DQMStore::IBooker ibooker,
MonitorElement me 
)
private

Definition at line 145 of file GEMEffByGEMCSCSegmentSource.cc.

References dqm::implementation::IBooker::book1D(), dqm::impl::MonitorElement::getName(), dqm::impl::MonitorElement::getTH1F(), gpuVertexFinder::hist, mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookEfficiencyChamber(), and bookMisc().

146  {
147  const std::string name = me->getName() + "_matched";
148  TH1F* hist = dynamic_cast<TH1F*>(me->getTH1F()->Clone(name.c_str()));
149  return ibooker.book1D(name, hist);
150 }
virtual TH1F * getTH1F() const
const std::string & getName() const
get name of ME
__shared__ Hist hist
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void GEMEffByGEMCSCSegmentSource::checkCoincidenceGE11 ( const GEMRecHit trigger_layer_hit,
const GEMRecHit detection_layer_hit,
const GEMCSCSegment gemcsc_segment 
)
private

Definition at line 238 of file GEMEffByGEMCSCSegmentSource.cc.

References GEMDetId::chamber(), GEMCSCSegment::chi2(), GEMCSCSegment::cscDetId(), GEMCSCSegment::cscRecHits(), GEMCSCSegment::cscSegment(), GEMCSCSegment::degreesOfFreedom(), GEMOfflineDQMBase::fillME(), GEMRecHit::gemId(), CSCDetId::iChamberType(), isME11SegmentMatched(), submitPVResolutionJobs::key, kLogCategory_, kMinCSCRecHits_, kUseMuon_, GEMDetId::layer(), LogDebug, me_chamber_, me_chamber_matched_, me_csc_chamber_type_, me_csc_chamber_type_matched_, me_muon_chamber_, me_muon_chamber_matched_, me_num_csc_hits_, me_num_csc_hits_matched_, me_reduced_chi2_, me_reduced_chi2_matched_, SiStripPI::min, GEMDetId::region(), and GEMDetId::station().

Referenced by analyzeME11GE11Segment().

240  {
241  if (trigger_layer_hit == nullptr) {
242  LogDebug(kLogCategory_) << "trigger_layer_hit is nullptr";
243  return;
244  }
245 
246  const GEMDetId trigger_layer_id = trigger_layer_hit->gemId();
247  const int detection_layer = trigger_layer_id.layer() == 1 ? 2 : 1;
248  // detection layer key
249  // GEMDetId(int region, int ring, int station, int layer, int chamber, int ieta)
250  const GEMDetId key{trigger_layer_id.region(), 1, trigger_layer_id.station(), detection_layer, 0, 0};
251 
252  const int chamber = trigger_layer_id.chamber();
253  const bool is_matched = kUseMuon_ ? isME11SegmentMatched(gemcsc_segment.cscSegment()) : false;
254 
255  const int num_csc_hits = gemcsc_segment.cscRecHits().size();
256  // TODO fillMEWithinLimits
257  const double reduced_chi2 = std::min(gemcsc_segment.chi2() / gemcsc_segment.degreesOfFreedom(), 2.9999);
258  const int csc_chamber_type = gemcsc_segment.cscDetId().iChamberType();
259 
260  // TODO add a method
261  const bool is_good = gemcsc_segment.cscRecHits().size() >= kMinCSCRecHits_;
262 
263  fillME(me_num_csc_hits_, key, num_csc_hits);
264  fillME(me_reduced_chi2_, key, reduced_chi2);
265  fillME(me_csc_chamber_type_, key, csc_chamber_type);
266  if (detection_layer_hit) {
267  fillME(me_num_csc_hits_matched_, key, num_csc_hits);
268  fillME(me_reduced_chi2_matched_, key, reduced_chi2);
269  fillME(me_csc_chamber_type_matched_, key, csc_chamber_type);
270  }
271 
272  if (is_good) {
273  // twofold coincidence rate
274  fillME(me_chamber_, key, chamber);
275  if (is_matched) {
276  fillME(me_muon_chamber_, key, chamber);
277  }
278 
279  // threefold coincidence rate
280  if (detection_layer_hit) {
281  fillME(me_chamber_matched_, key, chamber);
282  if (is_matched) {
284  }
285  }
286  }
287 }
CSCDetId cscDetId() const
Definition: GEMCSCSegment.h:73
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
Definition: GEMCSCSegment.h:62
double chi2() const override
Chi2 of the segment fit.
Definition: GEMCSCSegment.h:58
constexpr int region() const
Definition: GEMDetId.h:171
tuple key
prepare the HTCondor submission files and eventually submit them
unsigned short iChamberType() const
Definition: CSCDetId.h:96
const std::vector< CSCRecHit2D > & cscRecHits() const
Definition: GEMCSCSegment.h:69
void fillME(MEMap &me_map, const GEMDetId &key, const float x)
constexpr int chamber() const
Definition: GEMDetId.h:183
constexpr int layer() const
Definition: GEMDetId.h:190
constexpr int station() const
Definition: GEMDetId.h:179
bool isME11SegmentMatched(const CSCSegment &)
GEMDetId gemId() const
Return the gemId.
Definition: GEMRecHit.h:65
const CSCSegment cscSegment() const
Definition: GEMCSCSegment.h:67
#define LogDebug(id)
void GEMEffByGEMCSCSegmentSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 18 of file GEMEffByGEMCSCSegmentSource.cc.

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

18  {
20  desc.add<edm::InputTag>("gemcscSegmentTag", edm::InputTag("gemcscSegments"));
21  desc.add<edm::InputTag>("muonTag", edm::InputTag("muons"));
22  desc.addUntracked<bool>("useMuon", false);
23  desc.addUntracked<uint32_t>("minCSCRecHits", 6u);
24  desc.addUntracked<std::string>("folder", "GEM/Efficiency/GEMCSCSegment");
25  desc.addUntracked<std::string>("logCategory", "GEMEffByGEMCSCSegmentSource");
26  descriptions.addWithDefaultLabel(desc);
27 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void GEMEffByGEMCSCSegmentSource::findMatchedME11Segments ( const reco::MuonCollection muon_collection)
private

Definition at line 289 of file GEMEffByGEMCSCSegmentSource.cc.

References reco::MuonSegmentMatch::BestInStationByDR, MuonSubdetId::CSC, reco::MuonSegmentMatch::cscSegmentRef, edm::Ref< C, T, F >::get(), reco::MuonSegmentMatch::isMask(), matched_me11_segment_vector_, reco::Muon::matches(), and HLT_FULL_cff::muon.

Referenced by analyze().

289  {
291  for (unsigned int idx = 0; idx < muon_collection->size(); idx++) {
292  const reco::Muon& muon = muon_collection->at(idx);
293 
294  for (const reco::MuonChamberMatch& chamber_match : muon.matches()) {
295  if (chamber_match.detector() != MuonSubdetId::CSC) {
296  continue;
297  }
298 
299  const CSCDetId csc_id{chamber_match.id};
300  if (not csc_id.isME11()) {
301  continue;
302  }
303 
304  for (const reco::MuonSegmentMatch& segment_match : chamber_match.segmentMatches) {
305  if (not segment_match.isMask(reco::MuonSegmentMatch::BestInStationByDR)) {
306  continue;
307  }
308  matched_me11_segment_vector_.push_back(segment_match.cscSegmentRef.get());
309  } // MuonSegmentMatch
310  } // MuonChamberMatch
311  } // MuonCollection
312 }
CSCSegmentRef cscSegmentRef
static const unsigned int BestInStationByDR
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
bool isMask(unsigned int flag=Arbitrated) const
std::vector< MuonChamberMatch > & matches()
get muon matching information
Definition: Muon.h:145
std::vector< const CSCSegment * > matched_me11_segment_vector_
static constexpr int CSC
Definition: MuonSubdetId.h:12
bool GEMEffByGEMCSCSegmentSource::isME11SegmentMatched ( const CSCSegment csc_segment)
private

Definition at line 315 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().

315  {
316  bool found = false;
317 
318  const CSCDetId csc_id = csc_segment.cscDetId();
319  if (not csc_id.isME11()) {
320  return false;
321  }
322 
323  for (const CSCSegment* matched_segment : matched_me11_segment_vector_) {
324  if (csc_id != matched_segment->cscDetId())
325  continue;
326  if (csc_segment.localPosition().x() != matched_segment->localPosition().x())
327  continue;
328  if (csc_segment.localPosition().y() != matched_segment->localPosition().y())
329  continue;
330  if (csc_segment.localPosition().z() != matched_segment->localPosition().z())
331  continue;
332  if (csc_segment.time() != matched_segment->time())
333  continue;
334 
335  found = true;
336  }
337 
338  return found;
339 }
LocalPoint localPosition() const override
Definition: CSCSegment.h:39
CSCDetId cscDetId() const
Definition: CSCSegment.h:70
T y() const
Definition: PV3DBase.h:60
bool isME11() const
Definition: CSCDetId.cc:64
T z() const
Definition: PV3DBase.h:61
std::vector< const CSCSegment * > matched_me11_segment_vector_
T x() const
Definition: PV3DBase.h:59
float time() const
Definition: CSCSegment.cc:144

Member Data Documentation

const std::string GEMEffByGEMCSCSegmentSource::kFolder_
private

Definition at line 49 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookEfficiencyChamber(), and bookMisc().

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

Definition at line 45 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by analyze().

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

Definition at line 44 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookHistograms().

const std::string GEMEffByGEMCSCSegmentSource::kLogCategory_
private
const uint32_t GEMEffByGEMCSCSegmentSource::kMinCSCRecHits_
private

Definition at line 48 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by checkCoincidenceGE11().

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

Definition at line 46 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by analyze().

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

Definition at line 53 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by findMatchedME11Segments(), and isME11SegmentMatched().

MEMap GEMEffByGEMCSCSegmentSource::me_chamber_
private

Definition at line 56 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookEfficiencyChamber(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_chamber_matched_
private

Definition at line 57 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookEfficiencyChamber(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_csc_chamber_type_
private

Definition at line 65 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookMisc(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_csc_chamber_type_matched_
private

Definition at line 66 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookMisc(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_muon_chamber_
private

Definition at line 58 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookEfficiencyChamber(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_muon_chamber_matched_
private

Definition at line 59 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookEfficiencyChamber(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_num_csc_hits_
private

Definition at line 61 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookMisc(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_num_csc_hits_matched_
private

Definition at line 62 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookMisc(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_reduced_chi2_
private

Definition at line 63 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookMisc(), and checkCoincidenceGE11().

MEMap GEMEffByGEMCSCSegmentSource::me_reduced_chi2_matched_
private

Definition at line 64 of file GEMEffByGEMCSCSegmentSource.h.

Referenced by bookMisc(), and checkCoincidenceGE11().