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)
 
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
 
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, BXVector< T >::begin(), ALCARECOTkAlJpsiMuMu_cff::charge, gather_cfg::cout, BXVector< T >::end(), 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, RPCpg::mu, 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  getMuonGmtPairs(gmtCands);
212 
213 // MuonCollection::const_iterator muonIt = muons->begin();
214 // MuonCollection::const_iterator muonEnd = muons->end();
215 
216  vector<l1t::Muon> gmtContainer;// = gmtCands->getRecord(0).getGMTCands();
217 
218  for (auto mu = gmtCands->begin(0); mu != gmtCands->end(0); ++mu) {
219  gmtContainer.push_back(*mu);
220  }
221 
222 // vector<l1t::Muon>::const_iterator gmtIt = gmtContainer.begin();
223 // vector<l1t::Muon>::const_iterator gmtEnd = gmtContainer.end();
224 
225  if (m_verbose) cout << "[L1TMuonDQMOffline:] Computing efficiencies" << endl;
226 
227  vector<MuonGmtPair>::const_iterator muonGmtPairsIt = m_MuonGmtPairs.begin();
228  vector<MuonGmtPair>::const_iterator muonGmtPairsEnd = m_MuonGmtPairs.end();
229 
230  for(; muonGmtPairsIt!=muonGmtPairsEnd; ++muonGmtPairsIt) {
231  float pt = muonGmtPairsIt->pt();
232  float eta = muonGmtPairsIt->eta();
233  float phi = muonGmtPairsIt->phi();
234  int charge = muonGmtPairsIt->charge();
235 
236  float gmtPt = muonGmtPairsIt->gmtPt();
237  float gmtEta = muonGmtPairsIt->gmtEta();
238  float gmtPhi = muonGmtPairsIt->gmtPhi();
239  int gmtCharge = muonGmtPairsIt->gmtCharge();
240  int qual = muonGmtPairsIt->gmtQual();
241 
242  vector<int>::const_iterator gmtPtCutsIt = m_GmtPtCuts.begin();
243  vector<int>::const_iterator gmtPtCutsEnd = m_GmtPtCuts.end();
244 
245  if ( (fabs(eta) < m_MaxMuonEta) && (gmtPt > 0) ) {
246  m_ResolutionHistos[RESOL_Pt]->Fill(pt - gmtPt);
247  m_ResolutionHistos[RESOL_1overPt]->Fill(1/pt - 1/gmtPt);
248  m_ResolutionHistos[RESOL_Eta]->Fill(eta - gmtEta);
249  m_ResolutionHistos[RESOL_Phi]->Fill(phi - gmtPhi);
250  m_ResolutionHistos[RESOL_Charge]->Fill(charge - gmtCharge);
251  if (qual >= 4) {
252  m_ResolutionHistos[RESOL_Pt_OPEN]->Fill(pt - gmtPt);
253  m_ResolutionHistos[RESOL_1overPt_OPEN]->Fill(1/pt - 1/gmtPt);
254  m_ResolutionHistos[RESOL_Eta_OPEN]->Fill(eta - gmtEta);
255  m_ResolutionHistos[ RESOL_Phi_OPEN]->Fill(phi - gmtPhi);
256  m_ResolutionHistos[RESOL_Charge_OPEN]->Fill(charge - gmtCharge);
257  if (qual >= 8) {
258  m_ResolutionHistos[RESOL_Pt_DOUBLE]->Fill(pt - gmtPt);
259  m_ResolutionHistos[RESOL_1overPt_DOUBLE]->Fill(1/pt - 1/gmtPt);
260  m_ResolutionHistos[RESOL_Eta_DOUBLE]->Fill(eta - gmtEta);
261  m_ResolutionHistos[RESOL_Phi_DOUBLE]->Fill(phi - gmtPhi);
262  m_ResolutionHistos[RESOL_Charge_DOUBLE]->Fill(charge - gmtCharge);
263  if (qual >= 12) {
264  m_ResolutionHistos[RESOL_Pt_SINGLE]->Fill(pt - gmtPt);
265  m_ResolutionHistos[RESOL_1overPt_SINGLE]->Fill(1/pt - 1/gmtPt);
266  m_ResolutionHistos[RESOL_Eta_SINGLE]->Fill(eta - gmtEta);
267  m_ResolutionHistos[RESOL_Phi_SINGLE]->Fill(phi - gmtPhi);
268  m_ResolutionHistos[RESOL_Charge_SINGLE]->Fill(charge - gmtCharge);
269  }
270  }
271  }
272  }
273 
274  for (; gmtPtCutsIt!=gmtPtCutsEnd; ++ gmtPtCutsIt) {
275  int gmtPtCut = (*gmtPtCutsIt);
276  bool gmtAboveCut = (gmtPt > gmtPtCut);
277 
278  stringstream ptCutToTag; ptCutToTag << gmtPtCut;
279  string ptTag = ptCutToTag.str();
280 
281  if (fabs(eta) < m_MaxMuonEta) {
282  m_EfficiencyHistos[gmtPtCut]["EffvsPt_" + ptTag + "_Den"]->Fill(pt);
283  m_EfficiencyHistos[gmtPtCut]["EffvsPt_OPEN_" + ptTag + "_Den"]->Fill(pt);
284  m_EfficiencyHistos[gmtPtCut]["EffvsPt_DOUBLE_" + ptTag + "_Den"]->Fill(pt);
285  m_EfficiencyHistos[gmtPtCut]["EffvsPt_SINGLE_" + ptTag + "_Den"]->Fill(pt);
286 
287  if (gmtAboveCut) {
288  m_EfficiencyHistos[gmtPtCut]["EffvsPt_" + ptTag + "_Num"]->Fill(pt);
289 
290  if (qual >= 4) m_EfficiencyHistos[gmtPtCut]["EffvsPt_OPEN_" + ptTag + "_Num"]->Fill(pt);
291  if (qual >= 8) m_EfficiencyHistos[gmtPtCut]["EffvsPt_DOUBLE_" + ptTag + "_Num"]->Fill(pt);
292  if (qual >= 12) m_EfficiencyHistos[gmtPtCut]["EffvsPt_SINGLE_" + ptTag + "_Num"]->Fill(pt);
293  }
294 
295  // efficiency in eta/phi at plateau
296  if (pt > 1.25*gmtPtCut) { // efficiency in eta/phi at plateau
297 
298  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_" + ptTag + "_Den"]->Fill(phi);
299  m_EfficiencyHistos[gmtPtCut]["EffvsEta_" + ptTag + "_Den"]->Fill(eta);
300 
301  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_OPEN_" + ptTag + "_Den"]->Fill(phi);
302  m_EfficiencyHistos[gmtPtCut]["EffvsEta_OPEN_" + ptTag + "_Den"]->Fill(eta);
303 
304  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_DOUBLE_" + ptTag + "_Den"]->Fill(phi);
305  m_EfficiencyHistos[gmtPtCut]["EffvsEta_DOUBLE_" + ptTag + "_Den"]->Fill(eta);
306 
307  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_SINGLE_" + ptTag + "_Den"]->Fill(phi);
308  m_EfficiencyHistos[gmtPtCut]["EffvsEta_SINGLE_" + ptTag + "_Den"]->Fill(eta);
309 
310  if (gmtAboveCut) {
311  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_" + ptTag + "_Num"]->Fill(phi);
312  m_EfficiencyHistos[gmtPtCut]["EffvsEta_" + ptTag + "_Num"]->Fill(eta);
313 
314  if (qual >= 4) {
315  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_OPEN_" + ptTag + "_Num"]->Fill(phi);
316  m_EfficiencyHistos[gmtPtCut]["EffvsEta_OPEN_" + ptTag + "_Num"]->Fill(eta);
317  }
318  if (qual >= 8) {
319  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_DOUBLE_" + ptTag + "_Num"]->Fill(phi);
320  m_EfficiencyHistos[gmtPtCut]["EffvsEta_DOUBLE_" + ptTag + "_Num"]->Fill(eta);
321  }
322  if (qual >= 12) {
323  m_EfficiencyHistos[gmtPtCut]["EffvsPhi_SINGLE_" + ptTag + "_Num"]->Fill(phi);
324  m_EfficiencyHistos[gmtPtCut]["EffvsEta_SINGLE_" + ptTag + "_Num"]->Fill(eta);
325  }
326  }
327  }
328  }
329  }
330  }
331  if (m_verbose) cout << "[L1TMuonDQMOffline:] Computation finished" << endl;
332 }
const_iterator end(int bx) const
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
const int mu
Definition: Constants.h:22
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
const_iterator begin(int bx) const
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 335 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().

335  {
336  if(m_verbose) cout << "[L1TMuonDQMOffline:] Booking Control Plot Histos" << endl;
337 
338  ibooker.setCurrentFolder(m_HistFolder+"/control_variables");
339 
340  string name = "MuonGmtDeltaR";
341  m_ControlHistos[CONTROL_MuonGmtDeltaR] = ibooker.book1D(name.c_str(),name.c_str(),25.,0.,2.5);
342 
343  name = "NTightVsAll";
344  m_ControlHistos[CONTROL_NTightVsAll] = ibooker.book2D(name.c_str(),name.c_str(),16,-0.5,15.5,16,-0.5,15.5);
345 
346  name = "NProbesVsTight";
347  m_ControlHistos[CONTROL_NProbesVsTight] = ibooker.book2D(name.c_str(),name.c_str(),8,-0.5,7.5,8,-0.5,7.5);
348 
350  string name1 = "TagMuonEta_Histo";
351  m_EfficiencyHistos[0][name1] = ibooker.book1D(name1.c_str(),name1.c_str(),50,-2.5,2.5);
352  string name2 = "TagMuonPhi_Histo";
353  m_EfficiencyHistos[0][name2] = ibooker.book1D(name2.c_str(),name2.c_str(),24,-TMath::Pi(),TMath::Pi());
354  string name3 = "TagMuonPt_Histo";
355  m_EfficiencyHistos[0][name3] = ibooker.book1D(name3.c_str(),name3.c_str(),50,0.,100.);
356 //*****
357  name1 = "ProbeMuonEta_Histo";
358  m_EfficiencyHistos[0][name1] = ibooker.book1D(name1.c_str(),name1.c_str(),50,-2.5,2.5);
359  name2 = "ProbeMuonPhi_Histo";
360  m_EfficiencyHistos[0][name2] = ibooker.book1D(name2.c_str(),name2.c_str(),24,-TMath::Pi(),TMath::Pi());
361  name3 = "ProbeMuonPt_Histo";
362  m_EfficiencyHistos[0][name3] = ibooker.book1D(name3.c_str(),name3.c_str(),50,0.,100.);
363 }
const double Pi
std::string m_HistFolder
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::map< Control, MonitorElement * > m_ControlHistos
void L1TMuonDQMOffline::bookEfficiencyHistos ( DQMStore::IBooker ibooker,
int  ptCut 
)
protectedvirtual

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

366  {
367  if(m_verbose) cout << "[L1TMuonDQMOffline:] Booking Efficiency Plot Histos for pt cut = " << ptCut << endl;
368 
369  stringstream ptCutToTag; ptCutToTag << ptCut;
370  string ptTag = ptCutToTag.str();
371 
372  ibooker.setCurrentFolder(m_HistFolder+"/numerators_and_denominators");
373 
374  std::vector<float> effVsPtBins(m_effVsPtBins.begin(), m_effVsPtBins.end());
375  int nEffVsPtBins = effVsPtBins.size() - 1;
376  float* ptBinsArray = &(effVsPtBins[0]);
377 
378  string name1 = "EffvsPt_" + ptTag + "_Den";
379  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPtBins, ptBinsArray);
380  string name2 = "EffvsPt_" + ptTag + "_Num";
381  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPtBins, ptBinsArray);
382 
383  name1 = "EffvsPt_OPEN_" + ptTag + "_Den";
384  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPtBins, ptBinsArray);
385  name2 = "EffvsPt_OPEN_" + ptTag + "_Num";
386  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPtBins, ptBinsArray);
387 
388  name1 = "EffvsPt_DOUBLE_" + ptTag + "_Den";
389  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPtBins, ptBinsArray);
390  name2 = "EffvsPt_DOUBLE_" + ptTag + "_Num";
391  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPtBins, ptBinsArray);
392 
393  name1 = "EffvsPt_SINGLE_" + ptTag + "_Den";
394  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPtBins, ptBinsArray);
395  name2 = "EffvsPt_SINGLE_" + ptTag + "_Num";
396  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPtBins, ptBinsArray);
397 
399 
400  std::vector<float> effVsPhiBins(m_effVsPhiBins.begin(), m_effVsPhiBins.end());
401  int nEffVsPhiBins = effVsPhiBins.size() - 1;
402  float* phiBinsArray = &(effVsPhiBins[0]);
403 
404  std::vector<float> effVsEtaBins(m_effVsEtaBins.begin(), m_effVsEtaBins.end());
405  int nEffVsEtaBins = effVsEtaBins.size() - 1;
406  float* etaBinsArray = &(effVsEtaBins[0]);
407 
408  name1 = "EffvsPhi_" + ptTag + "_Den";
409  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPhiBins, phiBinsArray);
410  name2 = "EffvsPhi_" + ptTag + "_Num";
411  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPhiBins, phiBinsArray);
412 
413  name1 = "EffvsEta_" + ptTag + "_Den";
414  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsEtaBins, etaBinsArray);
415  name2 = "EffvsEta_" + ptTag + "_Num";
416  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsEtaBins, etaBinsArray);
417 
419 
420  name1 = "EffvsPhi_OPEN_" + ptTag + "_Den";
421  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPhiBins, phiBinsArray);
422  name2 = "EffvsPhi_OPEN_" + ptTag + "_Num";
423  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPhiBins, phiBinsArray);
424 
425  name1 = "EffvsEta_OPEN_" + ptTag + "_Den";
426  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsEtaBins, etaBinsArray);
427  name2 = "EffvsEta_OPEN_" + ptTag + "_Num";
428  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsEtaBins, etaBinsArray);
429 
431 
432  name1 = "EffvsPhi_DOUBLE_" + ptTag + "_Den";
433  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPhiBins, phiBinsArray);
434  name2 = "EffvsPhi_DOUBLE_" + ptTag + "_Num";
435  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPhiBins, phiBinsArray);
436 
437  name1 = "EffvsEta_DOUBLE_" + ptTag + "_Den";
438  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsEtaBins, etaBinsArray);
439  name2 = "EffvsEta_DOUBLE_" + ptTag + "_Num";
440  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsEtaBins, etaBinsArray);
441 
443 
444  name1 = "EffvsPhi_SINGLE_" + ptTag + "_Den";
445  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsPhiBins, phiBinsArray);
446  name2 = "EffvsPhi_SINGLE_" + ptTag + "_Num";
447  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsPhiBins, phiBinsArray);
448 
449  name1 = "EffvsEta_SINGLE_" + ptTag + "_Den";
450  m_EfficiencyHistos[ptCut][name1] = ibooker.book1D(name1.c_str(), name1.c_str(), nEffVsEtaBins, etaBinsArray);
451  name2 = "EffvsEta_SINGLE_" + ptTag + "_Num";
452  m_EfficiencyHistos[ptCut][name2] = ibooker.book1D(name2.c_str(), name2.c_str(), nEffVsEtaBins, etaBinsArray);
453 }
std::vector< double > m_effVsPhiBins
std::string m_HistFolder
std::vector< double > m_effVsPtBins
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
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 455 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().

455  {
456  if(m_verbose) cout << "[L1TMuonOffline:] Booking Resolution Plot Histos" << endl;
457 
458  ibooker.setCurrentFolder(m_HistFolder+"/resolution");
459 
461  string name = "Pt_Res";
462  m_ResolutionHistos[RESOL_Pt] = ibooker.book1D(name.c_str(),name.c_str(),100,-50.,50.);
463  name = "Pt_Res_OPEN";
464  m_ResolutionHistos[RESOL_Pt_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),100,-50.,50.);
465  name = "Pt_Res_DOUBLE";
466  m_ResolutionHistos[RESOL_Pt_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),100,-50.,50.);
467  name = "Pt_Res_SINGLE";
468  m_ResolutionHistos[RESOL_Pt_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),100,-50.,50.);
470  name = "1overPt_Res";
471  m_ResolutionHistos[RESOL_1overPt] = ibooker.book1D(name.c_str(),name.c_str(),50,-0.05,0.05);
472  name = "1overPt_Res_OPEN";
473  m_ResolutionHistos[RESOL_1overPt_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),50,-0.05,0.05);
474  name = "1overPt_Res_DOUBLE";
475  m_ResolutionHistos[RESOL_1overPt_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),50,-0.05,0.05);
476  name = "1overPt_Res_SINGLE";
477  m_ResolutionHistos[RESOL_1overPt_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),50,-0.05,0.05);
479  name = "Eta_Res";
480  m_ResolutionHistos[RESOL_Eta] = ibooker.book1D(name.c_str(),name.c_str(),100,-0.1,0.1);
481  name = "Eta_Res_OPEN";
482  m_ResolutionHistos[RESOL_Eta_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),100,-0.1,0.1);
483  name = "Eta_Res_DOUBLE";
484  m_ResolutionHistos[RESOL_Eta_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),100,-0.1,0.1);
485  name = "Eta_Res_SINGLE";
486  m_ResolutionHistos[RESOL_Eta_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),100,-0.1,0.1);
488  name = "Phi_Res";
489  m_ResolutionHistos[RESOL_Phi] = ibooker.book1D(name.c_str(),name.c_str(),96,-0.2,0.2);
490  name = "Phi_Res_OPEN";
491  m_ResolutionHistos[RESOL_Phi_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),96,-0.2,0.2);
492  name = "Phi_Res_DOUBLE";
493  m_ResolutionHistos[RESOL_Phi_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),96,-0.2,0.2);
494  name = "Phi_Res_SINGLE";
495  m_ResolutionHistos[RESOL_Phi_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),96,-0.2,0.2);
497  name = "Charge_Res";
498  m_ResolutionHistos[RESOL_Charge] = ibooker.book1D(name.c_str(),name.c_str(),5,-2,3);
499  name = "Charge_Res_OPEN";
500  m_ResolutionHistos[RESOL_Charge_OPEN] = ibooker.book1D(name.c_str(),name.c_str(),5,-2,3);
501  name = "Charge_Res_DOUBLE";
502  m_ResolutionHistos[RESOL_Charge_DOUBLE] = ibooker.book1D(name.c_str(),name.c_str(),5,-2,3);
503  name = "Charge_Res_SINGLE";
504  m_ResolutionHistos[RESOL_Charge_SINGLE] = ibooker.book1D(name.c_str(),name.c_str(),5,-2,3);
505 }
std::string m_HistFolder
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::map< Resol, MonitorElement * > m_ResolutionHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
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 610 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, RPCpg::mu, phi, and EnergyCorrector::pt.

Referenced by analyze().

610  {
611 
612  m_MuonGmtPairs.clear();
613  if (m_verbose) cout << "[L1TMuonDQMOffline:] Getting muon GMT pairs" << endl;
614 
615  vector<const reco::Muon*>::const_iterator probeMuIt = m_ProbeMuons.begin();
616  vector<const reco::Muon*>::const_iterator probeMuEnd = m_ProbeMuons.end();
617  vector<l1t::Muon> gmtContainer;
618 
619  for (auto mu = gmtCands->begin(0); mu != gmtCands->end(0); ++mu) {
620  gmtContainer.push_back(*mu);
621  }
622 
623  vector<l1t::Muon>::const_iterator gmtIt;
624  vector<l1t::Muon>::const_iterator gmtEnd = gmtContainer.end();
625 
626  for (; probeMuIt!=probeMuEnd; ++probeMuIt) {
627  float eta = (*probeMuIt)->eta();
628  float phi = (*probeMuIt)->phi();
629  float pt = (*probeMuIt)->pt();
630 
631  m_EfficiencyHistos[0]["ProbeMuonEta_Histo"]->Fill(eta);
632  m_EfficiencyHistos[0]["ProbeMuonPhi_Histo"]->Fill(phi);
633  m_EfficiencyHistos[0]["ProbeMuonPt_Histo"]->Fill(pt);
634 
635  MuonGmtPair pairBestCand((*probeMuIt),nullptr);
636 // pairBestCand.propagate(m_BField,m_propagatorAlong,m_propagatorOpposite);
637  gmtIt = gmtContainer.begin();
638 
639  for(; gmtIt!=gmtEnd; ++gmtIt) {
640  MuonGmtPair pairTmpCand((*probeMuIt),&(*gmtIt));
641 // pairTmpCand.propagate(m_BField,m_propagatorAlong,m_propagatorOpposite);
642 
643  if ( (pairTmpCand.dR() < m_MaxGmtMuonDR) && (pairTmpCand.dR() < pairBestCand.dR() ) ) {
644  pairBestCand = pairTmpCand;
645  }
646 
647  }
648  m_MuonGmtPairs.push_back(pairBestCand);
649  m_ControlHistos[CONTROL_MuonGmtDeltaR]->Fill(pairBestCand.dR());
650  }
651 }
const_iterator end(int bx) const
std::vector< const reco::Muon * > m_ProbeMuons
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
const int mu
Definition: Constants.h:22
std::vector< MuonGmtPair > m_MuonGmtPairs
const_iterator begin(int bx) const
std::map< Control, MonitorElement * > m_ControlHistos
const reco::Vertex L1TMuonDQMOffline::getPrimaryVertex ( edm::Handle< reco::VertexCollection > &  vertex,
edm::Handle< reco::BeamSpot > &  beamSpot 
)
private

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

508  {
509  Vertex::Point posVtx;
510  Vertex::Error errVtx;
511 
512  bool hasPrimaryVertex = false;
513 
514  if (vertex.isValid()) {
515  vector<Vertex>::const_iterator vertexIt = vertex->begin();
516  vector<Vertex>::const_iterator vertexEnd = vertex->end();
517 
518  for (;vertexIt!=vertexEnd;++vertexIt) {
519  if (vertexIt->isValid() && !vertexIt->isFake()) {
520  posVtx = vertexIt->position();
521  errVtx = vertexIt->error();
522  hasPrimaryVertex = true;
523  break;
524  }
525  }
526  }
527 
528  if ( !hasPrimaryVertex ) {
529  posVtx = beamSpot->position();
530  errVtx(0,0) = beamSpot->BeamWidthX();
531  errVtx(1,1) = beamSpot->BeamWidthY();
532  errVtx(2,2) = beamSpot->sigmaZ();
533  }
534  const Vertex primaryVertex(posVtx,errVtx);
535  return primaryVertex;
536 }
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 555 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().

556  {
557 
558  if (m_verbose) cout << "[L1TMuonDQMOffline:] getting probe muons" << endl;
559  m_ProbeMuons.clear();
560  std::vector<const reco::Muon*> tagMuonsInHist;
561 
562  tagMuonsInHist.clear();
563 
564  vector<const reco::Muon*>::const_iterator probeCandIt = m_TightMuons.begin();
565 // vector<const reco::Muon*>::const_iterator probeMuIt = m_ProbeMuons.begin();
566  vector<const reco::Muon*>::const_iterator tightMuonsEnd = m_TightMuons.end();
567 
568  for (; probeCandIt!=tightMuonsEnd; ++probeCandIt) {
569  bool isProbe = false;
570  vector<const reco::Muon*>::const_iterator tagCandIt = m_TightMuons.begin();
571  float deltar = 0.;
572 
573  for (; tagCandIt!=tightMuonsEnd; ++tagCandIt) {
574  bool tagMuonAlreadyInHist = false;
575  bool tagHasTrig = false;
576  float eta = (*tagCandIt)->eta();
577  float phi = (*tagCandIt)->phi();
578  float pt = (*tagCandIt)->pt();
579  float dEta = eta - (*probeCandIt)->eta();
580  float dPhi = phi - (*probeCandIt)->phi();
581  deltar = sqrt(dEta*dEta + dPhi*dPhi);
582 
583  if ( (*tagCandIt) == (*probeCandIt) || (deltar<0.7) ) continue; // CB has a little bias for closed-by muons
584  tagHasTrig = matchHlt(trigEvent,(*tagCandIt)) && (pt > m_TagPtCut);
585  isProbe |= tagHasTrig;
586  if (tagHasTrig) {
587  if (std::distance(m_TightMuons.begin(), m_TightMuons.end()) > 2 ) {
588  for (vector<const reco::Muon*>::const_iterator tagMuonsInHistIt = tagMuonsInHist.begin(); tagMuonsInHistIt!=tagMuonsInHist.end(); ++tagMuonsInHistIt) {
589  if ( (*tagCandIt) == (*tagMuonsInHistIt) ) {
590  tagMuonAlreadyInHist = true;
591  break;
592  }
593  }
594  if (tagMuonAlreadyInHist == false) tagMuonsInHist.push_back((*tagCandIt));
595  }
596  if (tagMuonAlreadyInHist == false) {
597  m_EfficiencyHistos[0]["TagMuonEta_Histo"]->Fill(eta);
598  m_EfficiencyHistos[0]["TagMuonPhi_Histo"]->Fill(phi);
599  m_EfficiencyHistos[0]["TagMuonPt_Histo"]->Fill(pt);
600  }
601  }
602  }
603  if (isProbe) m_ProbeMuons.push_back((*probeCandIt));
604  }
606 }
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 539 of file L1TMuonDQMOffline.cc.

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

Referenced by analyze().

539  {
540 
541  if (m_verbose) cout << "[L1TMuonDQMOffline:] Getting tight muons" << endl;
542  m_TightMuons.clear();
543  MuonCollection::const_iterator muonIt = muons->begin();
544  MuonCollection::const_iterator muonEnd = muons->end();
545 
546  for(; muonIt!=muonEnd; ++muonIt) {
547  if (muon::isTightMuon((*muonIt), vertex)) {
548  m_TightMuons.push_back(&(*muonIt));
549  }
550  }
551  m_ControlHistos[CONTROL_NTightVsAll]->Fill(muons->size(),m_TightMuons.size());
552 }
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 654 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().

654  {
655 
656  double matchDeltaR = 9999;
657 
658  TriggerObjectCollection trigObjs = triggerEvent->getObjects();
659 
660  vector<int>::const_iterator trigIndexIt = m_trigIndices.begin();
661  vector<int>::const_iterator trigIndexEnd = m_trigIndices.end();
662 
663  for(; trigIndexIt!=trigIndexEnd; ++trigIndexIt) {
664  const vector<string> moduleLabels(m_hltConfig.moduleLabels(*trigIndexIt));
665  const unsigned moduleIndex = m_hltConfig.size((*trigIndexIt))-2;
666  const unsigned hltFilterIndex = triggerEvent->filterIndex(InputTag(moduleLabels[moduleIndex],"",m_trigProcess));
667 
668  if (hltFilterIndex < triggerEvent->sizeFilters()) {
669  const Keys triggerKeys(triggerEvent->filterKeys(hltFilterIndex));
670  const Vids triggerVids(triggerEvent->filterIds(hltFilterIndex));
671  const unsigned nTriggers = triggerVids.size();
672  for (size_t iTrig = 0; iTrig < nTriggers; ++iTrig) {
673  const TriggerObject trigObject = trigObjs[triggerKeys[iTrig]];
674  double dRtmp = deltaR((*mu),trigObject);
675  if (dRtmp < matchDeltaR) matchDeltaR = dRtmp;
676  }
677  }
678  }
679  return (matchDeltaR < m_MaxHltMuonDR);
680 }
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().