CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
L1TMuonDQMOffline Class Reference

#include <L1TMuonDQMOffline.h>

Inheritance diagram for L1TMuonDQMOffline:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1TMuonDQMOffline (const edm::ParameterSet &ps)
 
 ~L1TMuonDQMOffline () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
 
virtual void bookControlHistos (DQMStore::IBooker &)
 
virtual void bookEfficiencyHistos (DQMStore::IBooker &ibooker, int ptCut)
 
void bookHistograms (DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &iSetup) override
 
virtual void bookResolutionHistos (DQMStore::IBooker &ibooker)
 
void dqmBeginRun (const edm::Run &run, const edm::EventSetup &iSetup) override
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Types

enum  Control { CONTROL_MuonGmtDeltaR, CONTROL_NTightVsAll, CONTROL_NProbesVsTight }
 
enum  Resol {
  RESOL_Pt, RESOL_1overPt, RESOL_Eta, RESOL_Phi,
  RESOL_Charge, RESOL_Pt_OPEN, RESOL_1overPt_OPEN, RESOL_Eta_OPEN,
  RESOL_Phi_OPEN, RESOL_Charge_OPEN, RESOL_Pt_DOUBLE, RESOL_1overPt_DOUBLE,
  RESOL_Eta_DOUBLE, RESOL_Phi_DOUBLE, RESOL_Charge_DOUBLE, RESOL_Pt_SINGLE,
  RESOL_1overPt_SINGLE, RESOL_Eta_SINGLE, RESOL_Phi_SINGLE, RESOL_Charge_SINGLE
}
 

Private Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void getMuonGmtPairs (edm::Handle< l1t::MuonBxCollection > &gmtCands)
 
const reco::Vertex getPrimaryVertex (edm::Handle< reco::VertexCollection > &vertex, edm::Handle< reco::BeamSpot > &beamSpot)
 
void getProbeMuons (edm::Handle< edm::TriggerResults > &trigResults, edm::Handle< trigger::TriggerEvent > &trigEvent)
 
void getTightMuons (edm::Handle< reco::MuonCollection > &muons, const reco::Vertex &vertex)
 
bool matchHlt (edm::Handle< trigger::TriggerEvent > &triggerEvent, const reco::Muon *mu)
 

Private Attributes

edm::ESHandle< MagneticFieldm_BField
 
edm::EDGetTokenT< reco::BeamSpotm_BsInputTag
 
std::map< Control, MonitorElement * > m_ControlHistos
 
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
 
std::vector< double > m_effVsEtaBins
 
std::vector< double > m_effVsPhiBins
 
std::vector< double > m_effVsPtBins
 
edm::EDGetTokenT< l1t::MuonBxCollectionm_GmtInputTag
 
std::vector< int > m_GmtPtCuts
 
std::string m_HistFolder
 
HLTConfigProvider m_hltConfig
 
BXVector< l1t::Muonm_L1tL1tMuons
 
std::vector< l1t::MuonBxCollectionm_L1tMuons
 
float m_MaxGmtMuonDR
 
float m_MaxHltMuonDR
 
float m_MaxMuonEta
 
std::vector< MuonGmtPairm_MuonGmtPairs
 
edm::EDGetTokenT< reco::MuonCollectionm_MuonInputTag
 
std::vector< const reco::Muon * > m_ProbeMuons
 
edm::ESHandle< Propagatorm_propagatorAlong
 
edm::ESHandle< Propagatorm_propagatorOpposite
 
std::vector< reco::MuonCollectionm_RecoMuons
 
std::vector< reco::Muonm_RecoRecoMuons
 
std::map< Resol, MonitorElement * > m_ResolutionHistos
 
double m_TagPtCut
 
std::vector< const reco::Muon * > m_TightMuons
 
std::vector< int > m_trigIndices
 
edm::EDGetTokenT< trigger::TriggerEventm_trigInputTag
 
std::vector< std::string > m_trigNames
 
std::string m_trigProcess
 
edm::EDGetTokenT< edm::TriggerResultsm_trigProcess_token
 
bool m_verbose
 
edm::EDGetTokenT< reco::VertexCollectionm_VtxInputTag
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 115 of file L1TMuonDQMOffline.h.

Member Enumeration Documentation

Enumerator
CONTROL_MuonGmtDeltaR 
CONTROL_NTightVsAll 
CONTROL_NProbesVsTight 

Definition at line 177 of file L1TMuonDQMOffline.h.

Enumerator
RESOL_Pt 
RESOL_1overPt 
RESOL_Eta 
RESOL_Phi 
RESOL_Charge 
RESOL_Pt_OPEN 
RESOL_1overPt_OPEN 
RESOL_Eta_OPEN 
RESOL_Phi_OPEN 
RESOL_Charge_OPEN 
RESOL_Pt_DOUBLE 
RESOL_1overPt_DOUBLE 
RESOL_Eta_DOUBLE 
RESOL_Phi_DOUBLE 
RESOL_Charge_DOUBLE 
RESOL_Pt_SINGLE 
RESOL_1overPt_SINGLE 
RESOL_Eta_SINGLE 
RESOL_Phi_SINGLE 
RESOL_Charge_SINGLE 

Definition at line 150 of file L1TMuonDQMOffline.h.

151  {
152  RESOL_Pt,
154  RESOL_Eta,
155  RESOL_Phi,
156  RESOL_Charge,
157 
163 
169 
175  };

Constructor & Destructor Documentation

L1TMuonDQMOffline::L1TMuonDQMOffline ( const edm::ParameterSet ps)

Definition at line 106 of file L1TMuonDQMOffline.cc.

References gather_cfg::cout, m_MaxGmtMuonDR, m_MaxHltMuonDR, m_MaxMuonEta, and m_verbose.

106  :
107  m_verbose(ps.getUntrackedParameter<bool>("verbose")),
108  m_HistFolder(ps.getUntrackedParameter<string>("histFolder")),
109  m_GmtPtCuts(ps.getUntrackedParameter< vector<int> >("gmtPtCuts")),
110  m_TagPtCut(ps.getUntrackedParameter<double>("tagPtCut")),
111  m_MuonInputTag(consumes<reco::MuonCollection>(ps.getUntrackedParameter<InputTag>("muonInputTag"))),
112  m_GmtInputTag(consumes<l1t::MuonBxCollection>(ps.getUntrackedParameter<InputTag>("gmtInputTag"))),
113  m_VtxInputTag(consumes<VertexCollection>(ps.getUntrackedParameter<InputTag>("vtxInputTag"))),
114  m_BsInputTag(consumes<BeamSpot>(ps.getUntrackedParameter<InputTag>("bsInputTag"))),
115  m_trigInputTag(consumes<trigger::TriggerEvent>(ps.getUntrackedParameter<InputTag>("trigInputTag"))),
116  m_trigProcess(ps.getUntrackedParameter<string>("trigProcess")),
117  m_trigProcess_token(consumes<edm::TriggerResults>(ps.getUntrackedParameter<InputTag>("trigProcess_token"))),
118  m_trigNames(ps.getUntrackedParameter<vector<string> >("triggerNames")),
119  m_effVsPtBins(ps.getUntrackedParameter<std::vector<double>>("efficiencyVsPtBins")),
120  m_effVsPhiBins(ps.getUntrackedParameter<std::vector<double>>("efficiencyVsPhiBins")),
121  m_effVsEtaBins(ps.getUntrackedParameter<std::vector<double>>("efficiencyVsEtaBins"))
122 {
123  if (m_verbose) cout << "[L1TMuonDQMOffline:] ____________ Storage initialization ____________ " << endl;
124  // CB do we need them from cfi?
125  m_MaxMuonEta = 2.4;
126  m_MaxGmtMuonDR = 0.7;
127  m_MaxHltMuonDR = 0.1;
128  // CB ignored at present
129  //m_MinMuonDR = 1.2;
130 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::BeamSpot > m_BsInputTag
edm::EDGetTokenT< reco::MuonCollection > m_MuonInputTag
edm::EDGetTokenT< edm::TriggerResults > m_trigProcess_token
std::vector< double > m_effVsPhiBins
std::string m_HistFolder
std::vector< std::string > m_trigNames
std::string m_trigProcess
edm::EDGetTokenT< l1t::MuonBxCollection > m_GmtInputTag
std::vector< double > m_effVsPtBins
std::vector< int > m_GmtPtCuts
std::vector< double > m_effVsEtaBins
edm::EDGetTokenT< reco::VertexCollection > m_VtxInputTag
edm::EDGetTokenT< trigger::TriggerEvent > m_trigInputTag
L1TMuonDQMOffline::~L1TMuonDQMOffline ( )
override

Definition at line 133 of file L1TMuonDQMOffline.cc.

133 { }

Member Function Documentation

void L1TMuonDQMOffline::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprivate

Definition at line 183 of file L1TMuonDQMOffline.cc.

References ecalDrivenElectronSeedsParameters_cff::beamSpot, ALCARECOTkAlJpsiMuMu_cff::charge, gather_cfg::cout, PVValHelper::eta, edm::EventSetup::get(), edm::Event::getByToken(), getMuonGmtPairs(), getPrimaryVertex(), getProbeMuons(), getTightMuons(), m_BField, m_BsInputTag, m_EfficiencyHistos, m_GmtInputTag, m_GmtPtCuts, m_MaxMuonEta, m_MuonGmtPairs, m_MuonInputTag, m_propagatorAlong, m_propagatorOpposite, m_ResolutionHistos, m_trigInputTag, m_trigProcess_token, m_verbose, m_VtxInputTag, nano_cff::muons, phi, impactParameterTagInfos_cfi::primaryVertex, EnergyCorrector::pt, RESOL_1overPt, RESOL_1overPt_DOUBLE, RESOL_1overPt_OPEN, RESOL_1overPt_SINGLE, RESOL_Charge, RESOL_Charge_DOUBLE, RESOL_Charge_OPEN, RESOL_Charge_SINGLE, RESOL_Eta, RESOL_Eta_DOUBLE, RESOL_Eta_OPEN, RESOL_Eta_SINGLE, RESOL_Phi, RESOL_Phi_DOUBLE, RESOL_Phi_OPEN, RESOL_Phi_SINGLE, RESOL_Pt, RESOL_Pt_DOUBLE, RESOL_Pt_OPEN, and RESOL_Pt_SINGLE.

183  {
184 
186  iEvent.getByToken(m_MuonInputTag, muons);
187 
189  iEvent.getByToken(m_BsInputTag, beamSpot);
190 
192  iEvent.getByToken(m_VtxInputTag, vertex);
193 
195  iEvent.getByToken(m_GmtInputTag,gmtCands);
196 
197  Handle<edm::TriggerResults> trigResults;
198  iEvent.getByToken(m_trigProcess_token,trigResults);
199 
201  iEvent.getByToken(m_trigInputTag,trigEvent);
202 
203  eventSetup.get<IdealMagneticFieldRecord>().get(m_BField);
204  eventSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",m_propagatorAlong);
205  eventSetup.get<TrackingComponentsRecord>().get("PropagatorWithMaterialOpposite",m_propagatorOpposite);
206 
207  const Vertex primaryVertex = getPrimaryVertex(vertex,beamSpot);
208 
209  getTightMuons(muons,primaryVertex);
210  getProbeMuons(trigResults,trigEvent); // CB add flag to run on orthogonal datasets (no T&P)
211 
212  getMuonGmtPairs(gmtCands);
213 
214  if (m_verbose) cout << "[L1TMuonDQMOffline:] Computing efficiencies" << endl;
215 
216  vector<MuonGmtPair>::const_iterator muonGmtPairsIt = m_MuonGmtPairs.begin();
217  vector<MuonGmtPair>::const_iterator muonGmtPairsEnd = m_MuonGmtPairs.end();
218 
219  for(; muonGmtPairsIt!=muonGmtPairsEnd; ++muonGmtPairsIt) {
220  float pt = muonGmtPairsIt->pt();
221  float eta = muonGmtPairsIt->eta();
222  float phi = muonGmtPairsIt->phi();
223  int charge = muonGmtPairsIt->charge();
224 
225  float gmtPt = muonGmtPairsIt->gmtPt();
226  float gmtEta = muonGmtPairsIt->gmtEta();
227  float gmtPhi = muonGmtPairsIt->gmtPhi();
228  int gmtCharge = muonGmtPairsIt->gmtCharge();
229  int qual = muonGmtPairsIt->gmtQual();
230 
231  vector<int>::const_iterator gmtPtCutsIt = m_GmtPtCuts.begin();
232  vector<int>::const_iterator gmtPtCutsEnd = m_GmtPtCuts.end();
233 
234  if ( (fabs(eta) < m_MaxMuonEta) && (gmtPt > 0) ) {
235  m_ResolutionHistos[RESOL_Pt]->Fill(pt - gmtPt);
236  m_ResolutionHistos[RESOL_1overPt]->Fill(1/pt - 1/gmtPt);
237  m_ResolutionHistos[RESOL_Eta]->Fill(eta - gmtEta);
238  m_ResolutionHistos[RESOL_Phi]->Fill(phi - gmtPhi);
239  m_ResolutionHistos[RESOL_Charge]->Fill(charge - gmtCharge);
240  if (qual >= 4) {
241  m_ResolutionHistos[RESOL_Pt_OPEN]->Fill(pt - gmtPt);
242  m_ResolutionHistos[RESOL_1overPt_OPEN]->Fill(1/pt - 1/gmtPt);
243  m_ResolutionHistos[RESOL_Eta_OPEN]->Fill(eta - gmtEta);
244  m_ResolutionHistos[ RESOL_Phi_OPEN]->Fill(phi - gmtPhi);
245  m_ResolutionHistos[RESOL_Charge_OPEN]->Fill(charge - gmtCharge);
246  if (qual >= 8) {
247  m_ResolutionHistos[RESOL_Pt_DOUBLE]->Fill(pt - gmtPt);
248  m_ResolutionHistos[RESOL_1overPt_DOUBLE]->Fill(1/pt - 1/gmtPt);
249  m_ResolutionHistos[RESOL_Eta_DOUBLE]->Fill(eta - gmtEta);
250  m_ResolutionHistos[RESOL_Phi_DOUBLE]->Fill(phi - gmtPhi);
251  m_ResolutionHistos[RESOL_Charge_DOUBLE]->Fill(charge - gmtCharge);
252  if (qual >= 12) {
253  m_ResolutionHistos[RESOL_Pt_SINGLE]->Fill(pt - gmtPt);
254  m_ResolutionHistos[RESOL_1overPt_SINGLE]->Fill(1/pt - 1/gmtPt);
255  m_ResolutionHistos[RESOL_Eta_SINGLE]->Fill(eta - gmtEta);
256  m_ResolutionHistos[RESOL_Phi_SINGLE]->Fill(phi - gmtPhi);
257  m_ResolutionHistos[RESOL_Charge_SINGLE]->Fill(charge - gmtCharge);
258  }
259  }
260  }
261  }
262 
263  for (; gmtPtCutsIt!=gmtPtCutsEnd; ++ gmtPtCutsIt) {
264  int gmtPtCut = (*gmtPtCutsIt);
265  bool gmtAboveCut = (gmtPt > gmtPtCut);
266 
267  stringstream ptCutToTag; ptCutToTag << gmtPtCut;
268  string ptTag = ptCutToTag.str();
269 
270  if (fabs(eta) < m_MaxMuonEta) {
271  m_EfficiencyHistos[gmtPtCut]["EffvsPt_" + ptTag + "_Den"]->Fill(pt);
272  m_EfficiencyHistos[gmtPtCut]["EffvsPt_OPEN_" + ptTag + "_Den"]->Fill(pt);
273  m_EfficiencyHistos[gmtPtCut]["EffvsPt_DOUBLE_" + ptTag + "_Den"]->Fill(pt);
274  m_EfficiencyHistos[gmtPtCut]["EffvsPt_SINGLE_" + ptTag + "_Den"]->Fill(pt);
275 
276  if (gmtAboveCut) {
277  m_EfficiencyHistos[gmtPtCut]["EffvsPt_" + ptTag + "_Num"]->Fill(pt);
278 
279  if (qual >= 4) m_EfficiencyHistos[gmtPtCut]["EffvsPt_OPEN_" + ptTag + "_Num"]->Fill(pt);
280  if (qual >= 8) m_EfficiencyHistos[gmtPtCut]["EffvsPt_DOUBLE_" + ptTag + "_Num"]->Fill(pt);
281  if (qual >= 12) m_EfficiencyHistos[gmtPtCut]["EffvsPt_SINGLE_" + ptTag + "_Num"]->Fill(pt);
282  }
283 
284  // efficiency in eta/phi at plateau
285  if (pt > 1.25*gmtPtCut) { // efficiency in eta/phi at plateau
286 
287  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_" + ptTag + "_Den"]->Fill(phi);
288  m_EfficiencyHistos[gmtPtCut]["EffvsEta_" + ptTag + "_Den"]->Fill(eta);
289 
290  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_OPEN_" + ptTag + "_Den"]->Fill(phi);
291  m_EfficiencyHistos[gmtPtCut]["EffvsEta_OPEN_" + ptTag + "_Den"]->Fill(eta);
292 
293  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_DOUBLE_" + ptTag + "_Den"]->Fill(phi);
294  m_EfficiencyHistos[gmtPtCut]["EffvsEta_DOUBLE_" + ptTag + "_Den"]->Fill(eta);
295 
296  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_SINGLE_" + ptTag + "_Den"]->Fill(phi);
297  m_EfficiencyHistos[gmtPtCut]["EffvsEta_SINGLE_" + ptTag + "_Den"]->Fill(eta);
298 
299  if (gmtAboveCut) {
300  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_" + ptTag + "_Num"]->Fill(phi);
301  m_EfficiencyHistos[gmtPtCut]["EffvsEta_" + ptTag + "_Num"]->Fill(eta);
302 
303  if (qual >= 4) {
304  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_OPEN_" + ptTag + "_Num"]->Fill(phi);
305  m_EfficiencyHistos[gmtPtCut]["EffvsEta_OPEN_" + ptTag + "_Num"]->Fill(eta);
306  }
307  if (qual >= 8) {
308  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_DOUBLE_" + ptTag + "_Num"]->Fill(phi);
309  m_EfficiencyHistos[gmtPtCut]["EffvsEta_DOUBLE_" + ptTag + "_Num"]->Fill(eta);
310  }
311  if (qual >= 12) {
312  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_SINGLE_" + ptTag + "_Num"]->Fill(phi);
313  m_EfficiencyHistos[gmtPtCut]["EffvsEta_SINGLE_" + ptTag + "_Num"]->Fill(eta);
314  }
315  }
316  }
317  }
318  }
319  }
320  if (m_verbose) cout << "[L1TMuonDQMOffline:] Computation finished" << endl;
321 }
edm::ESHandle< Propagator > m_propagatorOpposite
edm::EDGetTokenT< reco::BeamSpot > m_BsInputTag
edm::EDGetTokenT< reco::MuonCollection > m_MuonInputTag
edm::EDGetTokenT< edm::TriggerResults > m_trigProcess_token
void getProbeMuons(edm::Handle< edm::TriggerResults > &trigResults, edm::Handle< trigger::TriggerEvent > &trigEvent)
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< l1t::MuonBxCollection > m_GmtInputTag
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
std::vector< MuonGmtPair > m_MuonGmtPairs
std::map< Resol, MonitorElement * > m_ResolutionHistos
edm::ESHandle< MagneticField > m_BField
edm::ESHandle< Propagator > m_propagatorAlong
void getMuonGmtPairs(edm::Handle< l1t::MuonBxCollection > &gmtCands)
std::vector< int > m_GmtPtCuts
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > &vertex, edm::Handle< reco::BeamSpot > &beamSpot)
edm::EDGetTokenT< reco::VertexCollection > m_VtxInputTag
edm::EDGetTokenT< trigger::TriggerEvent > m_trigInputTag
void getTightMuons(edm::Handle< reco::MuonCollection > &muons, const reco::Vertex &vertex)
void L1TMuonDQMOffline::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 173 of file L1TMuonDQMOffline.cc.

References gather_cfg::cout, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), and m_verbose.

173  {
174  if(m_verbose) cout << "[L1TMuonDQMOffline:] Called beginLuminosityBlock at LS=" << lumiBlock.id().luminosityBlock() << endl;
175 }
void L1TMuonDQMOffline::bookControlHistos ( DQMStore::IBooker ibooker)
protectedvirtual

Definition at line 324 of file L1TMuonDQMOffline.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), CONTROL_MuonGmtDeltaR, CONTROL_NProbesVsTight, CONTROL_NTightVsAll, gather_cfg::cout, m_ControlHistos, m_EfficiencyHistos, m_HistFolder, m_verbose, dataset::name, Pi, and DQMStore::IBooker::setCurrentFolder().

Referenced by bookHistograms().

324  {
325  if(m_verbose) cout << "[L1TMuonDQMOffline:] Booking Control Plot Histos" << endl;
326 
327  ibooker.setCurrentFolder(m_HistFolder+"/control_variables");
328 
329  string name = "MuonGmtDeltaR";
330  m_ControlHistos[CONTROL_MuonGmtDeltaR] = ibooker.book1D(name.c_str(),name.c_str(),25.,0.,2.5);
331 
332  name = "NTightVsAll";
333  m_ControlHistos[CONTROL_NTightVsAll] = ibooker.book2D(name.c_str(),name.c_str(),16,-0.5,15.5,16,-0.5,15.5);
334 
335  name = "NProbesVsTight";
336  m_ControlHistos[CONTROL_NProbesVsTight] = ibooker.book2D(name.c_str(),name.c_str(),8,-0.5,7.5,8,-0.5,7.5);
337 
339  string name1 = "TagMuonEta_Histo";
340  m_EfficiencyHistos[0][name1] = ibooker.book1D(name1.c_str(),name1.c_str(),50,-2.5,2.5);
341  string name2 = "TagMuonPhi_Histo";
342  m_EfficiencyHistos[0][name2] = ibooker.book1D(name2.c_str(),name2.c_str(),24,-TMath::Pi(),TMath::Pi());
343  string name3 = "TagMuonPt_Histo";
344  m_EfficiencyHistos[0][name3] = ibooker.book1D(name3.c_str(),name3.c_str(),50,0.,100.);
345 //*****
346  name1 = "ProbeMuonEta_Histo";
347  m_EfficiencyHistos[0][name1] = ibooker.book1D(name1.c_str(),name1.c_str(),50,-2.5,2.5);
348  name2 = "ProbeMuonPhi_Histo";
349  m_EfficiencyHistos[0][name2] = ibooker.book1D(name2.c_str(),name2.c_str(),24,-TMath::Pi(),TMath::Pi());
350  name3 = "ProbeMuonPt_Histo";
351  m_EfficiencyHistos[0][name3] = ibooker.book1D(name3.c_str(),name3.c_str(),50,0.,100.);
352 }
const double Pi
std::string m_HistFolder
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
std::map< Control, MonitorElement * > m_ControlHistos
void L1TMuonDQMOffline::bookEfficiencyHistos ( DQMStore::IBooker ibooker,
int  ptCut 
)
protectedvirtual

Definition at line 355 of file L1TMuonDQMOffline.cc.

References DQMStore::IBooker::book1D(), gather_cfg::cout, m_EfficiencyHistos, m_effVsEtaBins, m_effVsPhiBins, m_effVsPtBins, m_HistFolder, m_verbose, HiGenCleaner_cff::ptCut, and DQMStore::IBooker::setCurrentFolder().

Referenced by bookHistograms().

355  {
356  if(m_verbose) cout << "[L1TMuonDQMOffline:] Booking Efficiency Plot Histos for pt cut = " << ptCut << endl;
357 
358  stringstream ptCutToTag; ptCutToTag << ptCut;
359  string ptTag = ptCutToTag.str();
360 
361  ibooker.setCurrentFolder(m_HistFolder+"/numerators_and_denominators");
362 
363  std::vector<float> effVsPtBins(m_effVsPtBins.begin(), m_effVsPtBins.end());
364  int nEffVsPtBins = effVsPtBins.size() - 1;
365  float* ptBinsArray = &(effVsPtBins[0]);
366 
367  string name1 = "EffvsPt_" + ptTag + "_Den";
368  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPtBins, ptBinsArray);
369  string name2 = "EffvsPt_" + ptTag + "_Num";
370  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPtBins, ptBinsArray);
371 
372  name1 = "EffvsPt_OPEN_" + ptTag + "_Den";
373  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPtBins, ptBinsArray);
374  name2 = "EffvsPt_OPEN_" + ptTag + "_Num";
375  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPtBins, ptBinsArray);
376 
377  name1 = "EffvsPt_DOUBLE_" + ptTag + "_Den";
378  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPtBins, ptBinsArray);
379  name2 = "EffvsPt_DOUBLE_" + ptTag + "_Num";
380  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPtBins, ptBinsArray);
381 
382  name1 = "EffvsPt_SINGLE_" + ptTag + "_Den";
383  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPtBins, ptBinsArray);
384  name2 = "EffvsPt_SINGLE_" + ptTag + "_Num";
385  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPtBins, ptBinsArray);
386 
388 
389  std::vector<float> effVsPhiBins(m_effVsPhiBins.begin(), m_effVsPhiBins.end());
390  int nEffVsPhiBins = effVsPhiBins.size() - 1;
391  float* phiBinsArray = &(effVsPhiBins[0]);
392 
393  std::vector<float> effVsEtaBins(m_effVsEtaBins.begin(), m_effVsEtaBins.end());
394  int nEffVsEtaBins = effVsEtaBins.size() - 1;
395  float* etaBinsArray = &(effVsEtaBins[0]);
396 
397  name1 = "EffvsPhi_" + ptTag + "_Den";
398  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPhiBins, phiBinsArray);
399  name2 = "EffvsPhi_" + ptTag + "_Num";
400  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPhiBins, phiBinsArray);
401 
402  name1 = "EffvsEta_" + ptTag + "_Den";
403  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsEtaBins, etaBinsArray);
404  name2 = "EffvsEta_" + ptTag + "_Num";
405  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsEtaBins, etaBinsArray);
406 
408 
409  name1 = "EffvsPhi_OPEN_" + ptTag + "_Den";
410  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPhiBins, phiBinsArray);
411  name2 = "EffvsPhi_OPEN_" + ptTag + "_Num";
412  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPhiBins, phiBinsArray);
413 
414  name1 = "EffvsEta_OPEN_" + ptTag + "_Den";
415  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsEtaBins, etaBinsArray);
416  name2 = "EffvsEta_OPEN_" + ptTag + "_Num";
417  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsEtaBins, etaBinsArray);
418 
420 
421  name1 = "EffvsPhi_DOUBLE_" + ptTag + "_Den";
422  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPhiBins, phiBinsArray);
423  name2 = "EffvsPhi_DOUBLE_" + ptTag + "_Num";
424  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPhiBins, phiBinsArray);
425 
426  name1 = "EffvsEta_DOUBLE_" + ptTag + "_Den";
427  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsEtaBins, etaBinsArray);
428  name2 = "EffvsEta_DOUBLE_" + ptTag + "_Num";
429  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsEtaBins, etaBinsArray);
430 
432 
433  name1 = "EffvsPhi_SINGLE_" + ptTag + "_Den";
434  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPhiBins, phiBinsArray);
435  name2 = "EffvsPhi_SINGLE_" + ptTag + "_Num";
436  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPhiBins, phiBinsArray);
437 
438  name1 = "EffvsEta_SINGLE_" + ptTag + "_Den";
439  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsEtaBins, etaBinsArray);
440  name2 = "EffvsEta_SINGLE_" + ptTag + "_Num";
441  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsEtaBins, etaBinsArray);
442 }
std::vector< double > m_effVsPhiBins
std::string m_HistFolder
std::vector< double > m_effVsPtBins
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
std::vector< double > m_effVsEtaBins
void L1TMuonDQMOffline::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 142 of file L1TMuonDQMOffline.cc.

References bookControlHistos(), bookEfficiencyHistos(), bookResolutionHistos(), gather_cfg::cout, createfilelist::int, m_GmtPtCuts, m_hltConfig, m_trigIndices, m_trigNames, m_verbose, HLTConfigProvider::size(), and HLTConfigProvider::triggerName().

142  {
143  //book histos
144  bookControlHistos(ibooker);
145  vector<int>::const_iterator gmtPtCutsIt = m_GmtPtCuts.begin();
146  vector<int>::const_iterator gmtPtCutsEnd = m_GmtPtCuts.end();
147 
148  for (; gmtPtCutsIt!=gmtPtCutsEnd; ++ gmtPtCutsIt) {
149  bookEfficiencyHistos(ibooker, (*gmtPtCutsIt));
150  }
151  bookResolutionHistos(ibooker);
152 
153  vector<string>::const_iterator trigNamesIt = m_trigNames.begin();
154  vector<string>::const_iterator trigNamesEnd = m_trigNames.end();
155 
156  for (; trigNamesIt!=trigNamesEnd; ++trigNamesIt) {
157  TString tNameTmp = TString(*trigNamesIt); // use TString as it handles regex
158  TRegexp tNamePattern = TRegexp(tNameTmp,true);
159  int tIndex = -1;
160 
161  for (unsigned ipath = 0; ipath < m_hltConfig.size(); ++ipath) {
162  TString tmpName = TString(m_hltConfig.triggerName(ipath));
163  if (tmpName.Contains(tNamePattern)) {
164  tIndex = int(ipath);
165  m_trigIndices.push_back(tIndex);
166  }
167  }
168  if (tIndex < 0 && m_verbose) cout << "[L1TMuonDQMOffline:] Warning: Could not find trigger " << (*trigNamesIt) << endl;
169  }
170 }
unsigned int size() const
number of trigger paths in trigger table
const std::string & triggerName(unsigned int triggerIndex) const
virtual void bookEfficiencyHistos(DQMStore::IBooker &ibooker, int ptCut)
std::vector< std::string > m_trigNames
virtual void bookControlHistos(DQMStore::IBooker &)
std::vector< int > m_GmtPtCuts
virtual void bookResolutionHistos(DQMStore::IBooker &ibooker)
HLTConfigProvider m_hltConfig
std::vector< int > m_trigIndices
void L1TMuonDQMOffline::bookResolutionHistos ( DQMStore::IBooker ibooker)
protectedvirtual

Definition at line 444 of file L1TMuonDQMOffline.cc.

References DQMStore::IBooker::book1D(), gather_cfg::cout, m_HistFolder, m_ResolutionHistos, m_verbose, dataset::name, RESOL_1overPt, RESOL_1overPt_DOUBLE, RESOL_1overPt_OPEN, RESOL_1overPt_SINGLE, RESOL_Charge, RESOL_Charge_DOUBLE, RESOL_Charge_OPEN, RESOL_Charge_SINGLE, RESOL_Eta, RESOL_Eta_DOUBLE, RESOL_Eta_OPEN, RESOL_Eta_SINGLE, RESOL_Phi, RESOL_Phi_DOUBLE, RESOL_Phi_OPEN, RESOL_Phi_SINGLE, RESOL_Pt, RESOL_Pt_DOUBLE, RESOL_Pt_OPEN, RESOL_Pt_SINGLE, and DQMStore::IBooker::setCurrentFolder().

Referenced by bookHistograms().

444  {
445  if(m_verbose) cout << "[L1TMuonOffline:] Booking Resolution Plot Histos" << endl;
446 
447  ibooker.setCurrentFolder(m_HistFolder+"/resolution");
448 
450  string name = "Pt_Res";
451  m_ResolutionHistos[RESOL_Pt] = ibooker.book1D(name.c_str(),name.c_str(),100,-50.,50.);
452  name = "Pt_Res_OPEN";
453  m_ResolutionHistos[RESOL_Pt_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),100,-50.,50.);
454  name = "Pt_Res_DOUBLE";
455  m_ResolutionHistos[RESOL_Pt_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),100,-50.,50.);
456  name = "Pt_Res_SINGLE";
457  m_ResolutionHistos[RESOL_Pt_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),100,-50.,50.);
459  name = "1overPt_Res";
460  m_ResolutionHistos[RESOL_1overPt] = ibooker.book1D(name.c_str(),name.c_str(),50,-0.05,0.05);
461  name = "1overPt_Res_OPEN";
462  m_ResolutionHistos[RESOL_1overPt_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),50,-0.05,0.05);
463  name = "1overPt_Res_DOUBLE";
464  m_ResolutionHistos[RESOL_1overPt_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),50,-0.05,0.05);
465  name = "1overPt_Res_SINGLE";
466  m_ResolutionHistos[RESOL_1overPt_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),50,-0.05,0.05);
468  name = "Eta_Res";
469  m_ResolutionHistos[RESOL_Eta] = ibooker.book1D(name.c_str(),name.c_str(),100,-0.1,0.1);
470  name = "Eta_Res_OPEN";
471  m_ResolutionHistos[RESOL_Eta_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),100,-0.1,0.1);
472  name = "Eta_Res_DOUBLE";
473  m_ResolutionHistos[RESOL_Eta_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),100,-0.1,0.1);
474  name = "Eta_Res_SINGLE";
475  m_ResolutionHistos[RESOL_Eta_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),100,-0.1,0.1);
477  name = "Phi_Res";
478  m_ResolutionHistos[RESOL_Phi] = ibooker.book1D(name.c_str(),name.c_str(),96,-0.2,0.2);
479  name = "Phi_Res_OPEN";
480  m_ResolutionHistos[RESOL_Phi_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),96,-0.2,0.2);
481  name = "Phi_Res_DOUBLE";
482  m_ResolutionHistos[RESOL_Phi_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),96,-0.2,0.2);
483  name = "Phi_Res_SINGLE";
484  m_ResolutionHistos[RESOL_Phi_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),96,-0.2,0.2);
486  name = "Charge_Res";
487  m_ResolutionHistos[RESOL_Charge] = ibooker.book1D(name.c_str(),name.c_str(),5,-2,3);
488  name = "Charge_Res_OPEN";
489  m_ResolutionHistos[RESOL_Charge_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),5,-2,3);
490  name = "Charge_Res_DOUBLE";
491  m_ResolutionHistos[RESOL_Charge_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),5,-2,3);
492  name = "Charge_Res_SINGLE";
493  m_ResolutionHistos[RESOL_Charge_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),5,-2,3);
494 }
std::string m_HistFolder
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::map< Resol, MonitorElement * > m_ResolutionHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
void L1TMuonDQMOffline::dqmBeginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 135 of file L1TMuonDQMOffline.cc.

References gather_cfg::cout, HLTConfigProvider::init(), m_hltConfig, m_trigProcess, and m_verbose.

135  {
136  if (m_verbose) cout << "[L1TMuonDQMOffline:] Called beginRun." << endl;
137  bool changed = true;
138  m_hltConfig.init(run,iSetup,m_trigProcess,changed);
139 }
std::string m_trigProcess
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
HLTConfigProvider m_hltConfig
void L1TMuonDQMOffline::dqmEndLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  c 
)
protectedvirtual

Definition at line 178 of file L1TMuonDQMOffline.cc.

References gather_cfg::cout, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), and m_verbose.

178  {
179  if(m_verbose) cout << "[L1TMuonDQMOffline:] Called endLuminosityBlock at LS=" << lumiBlock.id().luminosityBlock() << endl;
180 }
void L1TMuonDQMOffline::getMuonGmtPairs ( edm::Handle< l1t::MuonBxCollection > &  gmtCands)
private

Definition at line 599 of file L1TMuonDQMOffline.cc.

References BXVector< T >::begin(), CONTROL_MuonGmtDeltaR, gather_cfg::cout, MuonGmtPair::dR(), BXVector< T >::end(), PVValHelper::eta, m_ControlHistos, m_EfficiencyHistos, m_MaxGmtMuonDR, m_MuonGmtPairs, m_ProbeMuons, m_verbose, phi, and EnergyCorrector::pt.

Referenced by analyze().

599  {
600 
601  m_MuonGmtPairs.clear();
602  if (m_verbose) cout << "[L1TMuonDQMOffline:] Getting muon GMT pairs" << endl;
603 
604  vector<const reco::Muon*>::const_iterator probeMuIt = m_ProbeMuons.begin();
605  vector<const reco::Muon*>::const_iterator probeMuEnd = m_ProbeMuons.end();
606 
608  l1t::MuonBxCollection::const_iterator gmtEnd = gmtCands->end();
609 
610  for (; probeMuIt!=probeMuEnd; ++probeMuIt) {
611  float eta = (*probeMuIt)->eta();
612  float phi = (*probeMuIt)->phi();
613  float pt = (*probeMuIt)->pt();
614 
615  m_EfficiencyHistos[0]["ProbeMuonEta_Histo"]->Fill(eta);
616  m_EfficiencyHistos[0]["ProbeMuonPhi_Histo"]->Fill(phi);
617  m_EfficiencyHistos[0]["ProbeMuonPt_Histo"]->Fill(pt);
618 
619  MuonGmtPair pairBestCand((*probeMuIt),nullptr);
620 // pairBestCand.propagate(m_BField,m_propagatorAlong,m_propagatorOpposite);
621  gmtIt = gmtCands->begin();
622 
623  for(; gmtIt!=gmtEnd; ++gmtIt) {
624  MuonGmtPair pairTmpCand((*probeMuIt),&(*gmtIt));
625 // pairTmpCand.propagate(m_BField,m_propagatorAlong,m_propagatorOpposite);
626 
627  if ( (pairTmpCand.dR() < m_MaxGmtMuonDR) && (pairTmpCand.dR() < pairBestCand.dR() ) ) {
628  pairBestCand = pairTmpCand;
629  }
630 
631  }
632  m_MuonGmtPairs.push_back(pairBestCand);
633  m_ControlHistos[CONTROL_MuonGmtDeltaR]->Fill(pairBestCand.dR());
634  }
635 }
const_iterator end(int bx) const
std::vector< const reco::Muon * > m_ProbeMuons
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
std::vector< MuonGmtPair > m_MuonGmtPairs
const_iterator begin(int bx) const
std::map< Control, MonitorElement * > m_ControlHistos
std::vector< Muon >::const_iterator const_iterator
Definition: BXVector.h:20
const reco::Vertex L1TMuonDQMOffline::getPrimaryVertex ( edm::Handle< reco::VertexCollection > &  vertex,
edm::Handle< reco::BeamSpot > &  beamSpot 
)
private

Definition at line 496 of file L1TMuonDQMOffline.cc.

References reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), edm::HandleBase::isValid(), reco::BeamSpot::position(), impactParameterTagInfos_cfi::primaryVertex, and reco::BeamSpot::sigmaZ().

Referenced by analyze().

497  {
498  Vertex::Point posVtx;
499  Vertex::Error errVtx;
500 
501  bool hasPrimaryVertex = false;
502 
503  if (vertex.isValid()) {
504  vector<Vertex>::const_iterator vertexIt = vertex->begin();
505  vector<Vertex>::const_iterator vertexEnd = vertex->end();
506 
507  for (;vertexIt!=vertexEnd;++vertexIt) {
508  if (vertexIt->isValid() && !vertexIt->isFake()) {
509  posVtx = vertexIt->position();
510  errVtx = vertexIt->error();
511  hasPrimaryVertex = true;
512  break;
513  }
514  }
515  }
516 
517  if ( !hasPrimaryVertex ) {
518  posVtx = beamSpot->position();
519  errVtx(0,0) = beamSpot->BeamWidthX();
520  errVtx(1,1) = beamSpot->BeamWidthY();
521  errVtx(2,2) = beamSpot->sigmaZ();
522  }
523  const Vertex primaryVertex(posVtx,errVtx);
524  return primaryVertex;
525 }
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
bool isValid() const
Definition: HandleBase.h:74
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
const Point & position() const
position
Definition: BeamSpot.h:62
void L1TMuonDQMOffline::getProbeMuons ( edm::Handle< edm::TriggerResults > &  trigResults,
edm::Handle< trigger::TriggerEvent > &  trigEvent 
)
private

Definition at line 544 of file L1TMuonDQMOffline.cc.

References CONTROL_NProbesVsTight, gather_cfg::cout, SoftLeptonByDistance_cfi::distance, PVValHelper::eta, m_ControlHistos, m_EfficiencyHistos, m_ProbeMuons, m_TagPtCut, m_TightMuons, m_verbose, matchHlt(), phi, EnergyCorrector::pt, and mathSSE::sqrt().

Referenced by analyze().

545  {
546 
547  if (m_verbose) cout << "[L1TMuonDQMOffline:] getting probe muons" << endl;
548  m_ProbeMuons.clear();
549  std::vector<const reco::Muon*> tagMuonsInHist;
550 
551  tagMuonsInHist.clear();
552 
553  vector<const reco::Muon*>::const_iterator probeCandIt = m_TightMuons.begin();
554 // vector<const reco::Muon*>::const_iterator probeMuIt = m_ProbeMuons.begin();
555  vector<const reco::Muon*>::const_iterator tightMuonsEnd = m_TightMuons.end();
556 
557  for (; probeCandIt!=tightMuonsEnd; ++probeCandIt) {
558  bool isProbe = false;
559  vector<const reco::Muon*>::const_iterator tagCandIt = m_TightMuons.begin();
560  float deltar = 0.;
561 
562  for (; tagCandIt!=tightMuonsEnd; ++tagCandIt) {
563  bool tagMuonAlreadyInHist = false;
564  bool tagHasTrig = false;
565  float eta = (*tagCandIt)->eta();
566  float phi = (*tagCandIt)->phi();
567  float pt = (*tagCandIt)->pt();
568  float dEta = eta - (*probeCandIt)->eta();
569  float dPhi = phi - (*probeCandIt)->phi();
570  deltar = sqrt(dEta*dEta + dPhi*dPhi);
571 
572  if ( (*tagCandIt) == (*probeCandIt) || (deltar<0.7) ) continue; // CB has a little bias for closed-by muons
573  tagHasTrig = matchHlt(trigEvent,(*tagCandIt)) && (pt > m_TagPtCut);
574  isProbe |= tagHasTrig;
575  if (tagHasTrig) {
576  if (std::distance(m_TightMuons.begin(), m_TightMuons.end()) > 2 ) {
577  for (vector<const reco::Muon*>::const_iterator tagMuonsInHistIt = tagMuonsInHist.begin(); tagMuonsInHistIt!=tagMuonsInHist.end(); ++tagMuonsInHistIt) {
578  if ( (*tagCandIt) == (*tagMuonsInHistIt) ) {
579  tagMuonAlreadyInHist = true;
580  break;
581  }
582  }
583  if (tagMuonAlreadyInHist == false) tagMuonsInHist.push_back((*tagCandIt));
584  }
585  if (tagMuonAlreadyInHist == false) {
586  m_EfficiencyHistos[0]["TagMuonEta_Histo"]->Fill(eta);
587  m_EfficiencyHistos[0]["TagMuonPhi_Histo"]->Fill(phi);
588  m_EfficiencyHistos[0]["TagMuonPt_Histo"]->Fill(pt);
589  }
590  }
591  }
592  if (isProbe) m_ProbeMuons.push_back((*probeCandIt));
593  }
595 }
bool matchHlt(edm::Handle< trigger::TriggerEvent > &triggerEvent, const reco::Muon *mu)
std::vector< const reco::Muon * > m_ProbeMuons
T sqrt(T t)
Definition: SSEVec.h:18
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
Definition: deltar.py:1
std::vector< const reco::Muon * > m_TightMuons
std::map< Control, MonitorElement * > m_ControlHistos
void L1TMuonDQMOffline::getTightMuons ( edm::Handle< reco::MuonCollection > &  muons,
const reco::Vertex vertex 
)
private

Definition at line 528 of file L1TMuonDQMOffline.cc.

References CONTROL_NTightVsAll, gather_cfg::cout, muon::isTightMuon(), m_ControlHistos, m_TightMuons, and m_verbose.

Referenced by analyze().

528  {
529 
530  if (m_verbose) cout << "[L1TMuonDQMOffline:] Getting tight muons" << endl;
531  m_TightMuons.clear();
532  MuonCollection::const_iterator muonIt = muons->begin();
533  MuonCollection::const_iterator muonEnd = muons->end();
534 
535  for(; muonIt!=muonEnd; ++muonIt) {
536  if (muon::isTightMuon((*muonIt), vertex)) {
537  m_TightMuons.push_back(&(*muonIt));
538  }
539  }
540  m_ControlHistos[CONTROL_NTightVsAll]->Fill(muons->size(),m_TightMuons.size());
541 }
std::vector< const reco::Muon * > m_TightMuons
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
std::map< Control, MonitorElement * > m_ControlHistos
bool L1TMuonDQMOffline::matchHlt ( edm::Handle< trigger::TriggerEvent > &  triggerEvent,
const reco::Muon mu 
)
private

Definition at line 638 of file L1TMuonDQMOffline.cc.

References DEFINE_FWK_MODULE, deltaR(), trigger::TriggerEvent::filterIds(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::getObjects(), m_hltConfig, m_MaxHltMuonDR, m_trigIndices, m_trigProcess, HLTConfigProvider::moduleLabels(), HLTConfigProvider::size(), and TriggerAnalyzer::trigObjs.

Referenced by getProbeMuons().

638  {
639 
640  double matchDeltaR = 9999;
641 
642  TriggerObjectCollection trigObjs = triggerEvent->getObjects();
643 
644  vector<int>::const_iterator trigIndexIt = m_trigIndices.begin();
645  vector<int>::const_iterator trigIndexEnd = m_trigIndices.end();
646 
647  for(; trigIndexIt!=trigIndexEnd; ++trigIndexIt) {
648  const vector<string> moduleLabels(m_hltConfig.moduleLabels(*trigIndexIt));
649  const unsigned moduleIndex = m_hltConfig.size((*trigIndexIt))-2;
650  const unsigned hltFilterIndex = triggerEvent->filterIndex(InputTag(moduleLabels[moduleIndex],"",m_trigProcess));
651 
652  if (hltFilterIndex < triggerEvent->sizeFilters()) {
653  const Keys triggerKeys(triggerEvent->filterKeys(hltFilterIndex));
654  const Vids triggerVids(triggerEvent->filterIds(hltFilterIndex));
655  const unsigned nTriggers = triggerVids.size();
656  for (size_t iTrig = 0; iTrig < nTriggers; ++iTrig) {
657  const TriggerObject trigObject = trigObjs[triggerKeys[iTrig]];
658  double dRtmp = deltaR((*mu),trigObject);
659  if (dRtmp < matchDeltaR) matchDeltaR = dRtmp;
660  }
661  }
662  }
663  return (matchDeltaR < m_MaxHltMuonDR);
664 }
unsigned int size() const
number of trigger paths in trigger table
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
std::string m_trigProcess
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:110
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::vector< size_type > Keys
HLTConfigProvider m_hltConfig
std::vector< int > Vids
std::vector< int > m_trigIndices

Member Data Documentation

edm::ESHandle<MagneticField> L1TMuonDQMOffline::m_BField
private

Definition at line 146 of file L1TMuonDQMOffline.h.

Referenced by analyze().

edm::EDGetTokenT<reco::BeamSpot> L1TMuonDQMOffline::m_BsInputTag
private

Definition at line 207 of file L1TMuonDQMOffline.h.

Referenced by analyze().

std::map<Control, MonitorElement*> L1TMuonDQMOffline::m_ControlHistos
private
std::map<int, std::map<std::string, MonitorElement*> > L1TMuonDQMOffline::m_EfficiencyHistos
private
std::vector<double> L1TMuonDQMOffline::m_effVsEtaBins
private

Definition at line 214 of file L1TMuonDQMOffline.h.

Referenced by bookEfficiencyHistos().

std::vector<double> L1TMuonDQMOffline::m_effVsPhiBins
private

Definition at line 213 of file L1TMuonDQMOffline.h.

Referenced by bookEfficiencyHistos().

std::vector<double> L1TMuonDQMOffline::m_effVsPtBins
private

Definition at line 212 of file L1TMuonDQMOffline.h.

Referenced by bookEfficiencyHistos().

edm::EDGetTokenT<l1t::MuonBxCollection> L1TMuonDQMOffline::m_GmtInputTag
private

Definition at line 205 of file L1TMuonDQMOffline.h.

Referenced by analyze().

std::vector<int> L1TMuonDQMOffline::m_GmtPtCuts
private

Definition at line 202 of file L1TMuonDQMOffline.h.

Referenced by analyze(), and bookHistograms().

std::string L1TMuonDQMOffline::m_HistFolder
private
HLTConfigProvider L1TMuonDQMOffline::m_hltConfig
private

Definition at line 144 of file L1TMuonDQMOffline.h.

Referenced by bookHistograms(), dqmBeginRun(), and matchHlt().

BXVector<l1t::Muon> L1TMuonDQMOffline::m_L1tL1tMuons
private

Definition at line 197 of file L1TMuonDQMOffline.h.

std::vector<l1t::MuonBxCollection> L1TMuonDQMOffline::m_L1tMuons
private

Definition at line 195 of file L1TMuonDQMOffline.h.

float L1TMuonDQMOffline::m_MaxGmtMuonDR
private

Definition at line 219 of file L1TMuonDQMOffline.h.

Referenced by getMuonGmtPairs(), and L1TMuonDQMOffline().

float L1TMuonDQMOffline::m_MaxHltMuonDR
private

Definition at line 220 of file L1TMuonDQMOffline.h.

Referenced by L1TMuonDQMOffline(), and matchHlt().

float L1TMuonDQMOffline::m_MaxMuonEta
private

Definition at line 218 of file L1TMuonDQMOffline.h.

Referenced by analyze(), and L1TMuonDQMOffline().

std::vector<MuonGmtPair> L1TMuonDQMOffline::m_MuonGmtPairs
private

Definition at line 192 of file L1TMuonDQMOffline.h.

Referenced by analyze(), and getMuonGmtPairs().

edm::EDGetTokenT<reco::MuonCollection> L1TMuonDQMOffline::m_MuonInputTag
private

Definition at line 204 of file L1TMuonDQMOffline.h.

Referenced by analyze().

std::vector<const reco::Muon*> L1TMuonDQMOffline::m_ProbeMuons
private

Definition at line 191 of file L1TMuonDQMOffline.h.

Referenced by getMuonGmtPairs(), and getProbeMuons().

edm::ESHandle<Propagator> L1TMuonDQMOffline::m_propagatorAlong
private

Definition at line 147 of file L1TMuonDQMOffline.h.

Referenced by analyze().

edm::ESHandle<Propagator> L1TMuonDQMOffline::m_propagatorOpposite
private

Definition at line 148 of file L1TMuonDQMOffline.h.

Referenced by analyze().

std::vector<reco::MuonCollection> L1TMuonDQMOffline::m_RecoMuons
private

Definition at line 194 of file L1TMuonDQMOffline.h.

std::vector<reco::Muon> L1TMuonDQMOffline::m_RecoRecoMuons
private

Definition at line 196 of file L1TMuonDQMOffline.h.

std::map<Resol, MonitorElement*> L1TMuonDQMOffline::m_ResolutionHistos
private

Definition at line 186 of file L1TMuonDQMOffline.h.

Referenced by analyze(), and bookResolutionHistos().

double L1TMuonDQMOffline::m_TagPtCut
private

Definition at line 203 of file L1TMuonDQMOffline.h.

Referenced by getProbeMuons().

std::vector<const reco::Muon*> L1TMuonDQMOffline::m_TightMuons
private

Definition at line 190 of file L1TMuonDQMOffline.h.

Referenced by getProbeMuons(), and getTightMuons().

std::vector<int> L1TMuonDQMOffline::m_trigIndices
private

Definition at line 216 of file L1TMuonDQMOffline.h.

Referenced by bookHistograms(), and matchHlt().

edm::EDGetTokenT<trigger::TriggerEvent> L1TMuonDQMOffline::m_trigInputTag
private

Definition at line 208 of file L1TMuonDQMOffline.h.

Referenced by analyze().

std::vector<std::string> L1TMuonDQMOffline::m_trigNames
private

Definition at line 211 of file L1TMuonDQMOffline.h.

Referenced by bookHistograms().

std::string L1TMuonDQMOffline::m_trigProcess
private

Definition at line 209 of file L1TMuonDQMOffline.h.

Referenced by dqmBeginRun(), and matchHlt().

edm::EDGetTokenT<edm::TriggerResults> L1TMuonDQMOffline::m_trigProcess_token
private

Definition at line 210 of file L1TMuonDQMOffline.h.

Referenced by analyze().

bool L1TMuonDQMOffline::m_verbose
private
edm::EDGetTokenT<reco::VertexCollection> L1TMuonDQMOffline::m_VtxInputTag
private

Definition at line 206 of file L1TMuonDQMOffline.h.

Referenced by analyze().