CMS 3D CMS Logo

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

#include <EwkMuLumiMonitorDQM.h>

Inheritance diagram for EwkMuLumiMonitorDQM:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
 EwkMuLumiMonitorDQM (const edm::ParameterSet &)
 
void init_histograms ()
 
bool IsMuMatchedToHLTMu (const reco::Muon &, const std::vector< reco::Particle > &, double, double)
 
double muIso (const reco::Muon &)
 
double tkIso (const reco::Track &, edm::Handle< reco::TrackCollection >, edm::Handle< CaloTowerCollection >)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) 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)
 

Private Attributes

double acopCut_
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
edm::EDGetTokenT< CaloTowerCollectioncaloTowerToken_
 
double deltaRTrk_
 
double deltaRVetoTrk_
 
double dxyCut_
 
double etaMuCut_
 
MonitorElementhighMass1HLT_
 
MonitorElementhighMass2HLT_
 
MonitorElementhighMassGlbSta_
 
MonitorElementhighMassGlbTrk_
 
MonitorElementhighMassIsBothGlbTrkThanW_
 
MonitorElementhighMassNotIso_
 
HLTConfigProvider hltConfigProvider_
 
bool isCombinedIso_
 
double isoCut03_
 
bool isRelativeIso_
 
bool isValidHltConfig_
 
bool isW_
 
bool isZGlbSta_
 
bool isZGlbTrk_
 
bool isZGolden1HLT_
 
bool isZGolden2HLT_
 
bool isZGoldenNoIso_
 
MonitorElementmass1HLT_
 
MonitorElementmass2HLT_
 
MonitorElementmassGlbSta_
 
MonitorElementmassGlbTrk_
 
MonitorElementmassIsBothGlbTrkThanW_
 
MonitorElementmassNotIso_
 
double maxDeltaR_
 
double maxDPtRel_
 
bool metIncludesMuons_
 
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
 
double mtMax_
 
double mtMin_
 
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
 
unsigned int n1hlt
 
unsigned int n2hlt
 
unsigned int nall
 
unsigned int nEvWithHighPtMu
 
unsigned int nGlbSta
 
unsigned int nGlbTrk
 
unsigned int nhlt
 
unsigned int nInKinRange
 
unsigned int niso
 
unsigned int nNotIso
 
unsigned int nsel
 
unsigned int nTMass
 
unsigned int nW
 
double ptMuCut_
 
double ptThreshold_
 
MonitorElementTMass_
 
edm::EDGetTokenT< reco::TrackCollectiontrackToken_
 
edm::EDGetTokenT< trigger::TriggerEventtrigEvToken_
 
edm::InputTag trigTag_
 
edm::EDGetTokenT< edm::TriggerResultstrigToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

DQM offline for EWK MuLumiMonitor: intended for luminosity purposes using Z/W

Authors
: Michele de Gruttola, INFN Naples - Maria Cepeda, CIEMAT on behalf EWK-Muon group

Definition at line 37 of file EwkMuLumiMonitorDQM.h.

Constructor & Destructor Documentation

EwkMuLumiMonitorDQM::EwkMuLumiMonitorDQM ( const edm::ParameterSet cfg)

Definition at line 36 of file EwkMuLumiMonitorDQM.cc.

References isValidHltConfig_.

37  :
38  // Input collections
40  "TrigTag", edm::InputTag("TriggerResults::HLT"))),
41  trigToken_(consumes<edm::TriggerResults>(trigTag_)),
42  trigEvToken_(consumes<trigger::TriggerEvent>(
43  cfg.getUntrackedParameter<edm::InputTag>("triggerEvent"))),
45  consumes<reco::BeamSpot>(cfg.getUntrackedParameter<edm::InputTag>(
46  "offlineBeamSpot", edm::InputTag("offlineBeamSpot")))),
48  cfg.getUntrackedParameter<edm::InputTag>("muons"))),
49  trackToken_(consumes<reco::TrackCollection>(
50  cfg.getUntrackedParameter<edm::InputTag>("tracks"))),
51  caloTowerToken_(consumes<CaloTowerCollection>(
52  cfg.getUntrackedParameter<edm::InputTag>("calotower"))),
54  cfg.getUntrackedParameter<edm::InputTag>("metTag"))),
55  metIncludesMuons_(cfg.getUntrackedParameter<bool>("METIncludesMuons")),
56  // Main cuts
57  // massMin_(cfg.getUntrackedParameter<double>("MtMin", 20.)),
58  // massMax_(cfg.getUntrackedParameter<double>("MtMax", 2000.))
59  // hltPath_(cfg.getUntrackedParameter<std::string> ("hltPath")) ,
60  // L3FilterName_(cfg.getUntrackedParameter<std::string>
61  // ("L3FilterName")),
62  ptMuCut_(cfg.getUntrackedParameter<double>("ptMuCut")),
63  etaMuCut_(cfg.getUntrackedParameter<double>("etaMuCut")),
64  isRelativeIso_(cfg.getUntrackedParameter<bool>("IsRelativeIso")),
65  isCombinedIso_(cfg.getUntrackedParameter<bool>("IsCombinedIso")),
66  isoCut03_(cfg.getUntrackedParameter<double>("IsoCut03")),
67  // deltaRTrk_(cfg.getUntrackedParameter<double>("deltaRTrk")),
68  ptThreshold_(cfg.getUntrackedParameter<double>("ptThreshold")),
69  // deltaRVetoTrk_(cfg.getUntrackedParameter<double>("deltaRVetoTrk")),
70  maxDPtRel_(cfg.getUntrackedParameter<double>("maxDPtRel")),
71  maxDeltaR_(cfg.getUntrackedParameter<double>("maxDeltaR")),
72  mtMin_(cfg.getUntrackedParameter<double>("mtMin")),
73  mtMax_(cfg.getUntrackedParameter<double>("mtMax")),
74  acopCut_(cfg.getUntrackedParameter<double>("acopCut")),
75  dxyCut_(cfg.getUntrackedParameter<double>("DxyCut")) {
76  // just to initialize
77  isValidHltConfig_ = false;
78 
79 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
edm::EDGetTokenT< edm::TriggerResults > trigToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken_
edm::EDGetTokenT< reco::TrackCollection > trackToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::EDGetTokenT< trigger::TriggerEvent > trigEvToken_

Member Function Documentation

void EwkMuLumiMonitorDQM::analyze ( const edm::Event ev,
const edm::EventSetup  
)
override

number of prescale sets available

Definition at line 216 of file EwkMuLumiMonitorDQM.cc.

References edm::HLTGlobalStatus::accept(), acopCut_, beamSpotToken_, caloTowerToken_, reco::LeafCandidate::charge(), reco::TrackBase::charge(), PVValHelper::dxy, reco::TrackBase::dxy(), dxyCut_, edm::InputTag::encode(), PVValHelper::eta, reco::LeafCandidate::eta(), reco::TrackBase::eta(), etaMuCut_, f, MonitorElement::Fill(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::filterTag(), edm::Event::getByToken(), trigger::TriggerEvent::getObjects(), highMass1HLT_, highMass2HLT_, highMassGlbSta_, highMassGlbTrk_, highMassIsBothGlbTrkThanW_, highMassNotIso_, hltConfigProvider_, mps_fire::i, reco::Muon::innerTrack(), reco::Muon::isGlobalMuon(), IsMuMatchedToHLTMu(), isoCut03_, reco::Muon::isStandAloneMuon(), isW_, isZGlbSta_, isZGlbTrk_, isZGolden1HLT_, isZGolden2HLT_, isZGoldenNoIso_, gen::k, LogTrace, M_PI, ResonanceBuilder::mass, mass1HLT_, mass2HLT_, massGlbSta_, massGlbTrk_, massIsBothGlbTrkThanW_, massNotIso_, maxDeltaR_, maxDPtRel_, RazorAnalyzer::met, MT2Analyzer::metCollection, metIncludesMuons_, metToken_, HLTConfigProvider::moduleLabels(), mtMax_, RPCpg::mu, muIso(), extraflags_cff::muons, muonToken_, gen::n, n1hlt, n2hlt, nall, dataset::name, nEvWithHighPtMu, nGlbSta, nGlbTrk, nhlt, niso, nNotIso, nsel, nTMass, nW, MillePedeFileConverter_cfg::out, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), reco::LeafCandidate::p4(), reco::LeafCandidate::phi(), reco::BeamSpot::position(), HLTConfigProvider::prescaleSize(), HLTConfigProvider::prescaleValue(), EnergyCorrector::pt, reco::LeafCandidate::pt(), reco::TrackBase::pt(), hiDetachedQuadStep_cff::pt2, ptMuCut_, reco::LeafCandidate::px(), reco::TrackBase::px(), reco::LeafCandidate::py(), reco::TrackBase::py(), reco::TrackBase::pz(), alignCSCRings::s, findQualityFiles::size, trigger::TriggerEvent::sizeFilters(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, tkIso(), TMass_, l1t::tracks, trackToken_, trigEvToken_, HLTConfigProvider::triggerIndex(), HLTConfigProvider::triggerNames(), triggerResults, trigToken_, and findQualityFiles::v.

216  {
217  nall++;
218  bool hlt_sel = false;
219  double iso1 = -1;
220  double iso2 = -1;
221  bool isMu1Iso = false;
222  bool isMu2Iso = false;
223  bool singleTrigFlag1 = false;
224  bool singleTrigFlag2 = false;
225  isZGolden1HLT_ = false;
226  isZGolden2HLT_ = false;
227  isZGoldenNoIso_ = false;
228  isZGlbSta_ = false;
229  isZGlbTrk_ = false;
230  isW_ = false;
231  // Trigger
232  bool trigger_fired = false;
233 
235  if (!ev.getByToken(trigToken_, triggerResults)) {
236  // LogWarning("") << ">>> TRIGGER collection does not exist !!!";
237  return;
238  }
239 
240  ev.getByToken(trigToken_, triggerResults);
241  /*
242  const edm::TriggerNames & trigNames = ev.triggerNames(*triggerResults);
243 
244 
245  for (size_t i=0; i<triggerResults->size(); i++) {
246  std::string trigName = trigNames.triggerName(i);
247  //std::cout << " trigName == " << trigName << std::endl;
248  if ( trigName == hltPath_ && triggerResults->accept(i)) {
249  trigger_fired = true;
250  hlt_sel=true;
251  nhlt++;
252  }
253  }
254  */
255  // see the trigger single muon which are present
256  string lowestMuonUnprescaledTrig = "";
257  bool lowestMuonUnprescaledTrigFound = false;
258  const std::vector<std::string>& triggerNames =
260  for (size_t ts = 0; ts < triggerNames.size(); ts++) {
261  string trig = triggerNames[ts];
262  size_t f = trig.find("HLT_Mu");
263  if ((f != std::string::npos)) {
264  // std::cout << "single muon trigger present: " << trig << std::endl;
265  // See if the trigger is prescaled;
267  bool prescaled = false;
268  const unsigned int prescaleSize = hltConfigProvider_.prescaleSize();
269  for (unsigned int ps = 0; ps < prescaleSize; ps++) {
270  const unsigned int prescaleValue =
272  if (prescaleValue != 1) prescaled = true;
273  // std::cout<< " prescaleValue[" << ps << "] =" << prescaleValue
274  //<<std::endl;
275  }
276  if (!prescaled) {
277  // looking now for the lowest hlt path not prescaled, with name of the
278  // form HLT_MuX or HLTMuX_vY
279  for (unsigned int n = 9; n < 100; n++) {
280  string lowestTrig = "HLT_Mu";
281  string lowestTrigv0 = "copy";
282  std::stringstream out;
283  out << n;
284  std::string s = out.str();
285  lowestTrig.append(s);
286  lowestTrigv0 = lowestTrig;
287  for (unsigned int v = 1; v < 10; v++) {
288  lowestTrig.append("_v");
289  std::stringstream oout;
290  oout << v;
291  std::string ss = oout.str();
292  lowestTrig.append(ss);
293  if (trig == lowestTrig) lowestMuonUnprescaledTrig = trig;
294  if (trig == lowestTrig) lowestMuonUnprescaledTrigFound = true;
295  if (trig == lowestTrig) break;
296  }
297  if (lowestMuonUnprescaledTrigFound) break;
298 
299  lowestTrig = lowestTrigv0;
300  if (trig == lowestTrig) lowestMuonUnprescaledTrig = trig;
301  // if (trig==lowestTrig) {std::cout << " before break, lowestTrig
302  // lowest single muon trigger present unprescaled: " << lowestTrig <<
303  // std::endl; }
304  if (trig == lowestTrig) lowestMuonUnprescaledTrigFound = true;
305  if (trig == lowestTrig) break;
306  }
307  if (lowestMuonUnprescaledTrigFound) break;
308  }
309  }
310  }
311  // std::cout << "after break, lowest single muon trigger present unprescaled:
312  // " << lowestMuonUnprescaledTrig << std::endl;
313  unsigned int triggerIndex; // index of trigger path
314 
315  // See if event passed trigger paths
316  std::string hltPath_ = lowestMuonUnprescaledTrig;
317 
318  triggerIndex = hltConfigProvider_.triggerIndex(hltPath_);
319  if (triggerIndex < triggerResults->size())
320  trigger_fired = triggerResults->accept(triggerIndex);
321  std::string L3FilterName_ = "";
322  if (trigger_fired) {
323  const std::vector<std::string>& moduleLabs =
325  /*for (size_t k =0; k < moduleLabs.size()-1 ; k++){
326  std::cout << "moduleLabs[" << k << "] == " << moduleLabs[k] << std::endl;
327  }
328  */
329  // the l3 filter name is just the last module....
330  size_t moduleLabsSizeMinus2 = moduleLabs.size() - 2;
331  // std::cout<<"moduleLabs[" << moduleLabsSizeMinus2 << "]== "<<
332  // moduleLabs[moduleLabsSizeMinus2] << std::endl;
333 
334  L3FilterName_ = moduleLabs[moduleLabsSizeMinus2];
335  }
336 
337  edm::Handle<trigger::TriggerEvent> handleTriggerEvent;
338  LogTrace("") << ">>> Trigger bit: " << trigger_fired << " (" << hltPath_
339  << ")";
340  if (!ev.getByToken(trigEvToken_, handleTriggerEvent)) {
341  // LogWarning( "errorTriggerEventValid" ) << "trigger::TriggerEvent product
342  // with InputTag " << trigEv_.encode() << " not in event";
343  return;
344  }
345  ev.getByToken(trigEvToken_, handleTriggerEvent);
346  const trigger::TriggerObjectCollection& toc(handleTriggerEvent->getObjects());
347  size_t nMuHLT = 0;
348  std::vector<reco::Particle> HLTMuMatched;
349  for (size_t ia = 0; ia < handleTriggerEvent->sizeFilters(); ++ia) {
350  std::string fullname = handleTriggerEvent->filterTag(ia).encode();
351  // std::cout<< "fullname::== " << fullname<< std::endl;
353  size_t p = fullname.find_first_of(':');
354  if (p != std::string::npos) {
355  name = fullname.substr(0, p);
356  } else {
357  name = fullname;
358  }
359  if (!toc.empty()) {
360  const trigger::Keys& k = handleTriggerEvent->filterKeys(ia);
361  for (trigger::Keys::const_iterator ki = k.begin(); ki != k.end(); ++ki) {
362  // looking at all the single muon l3 trigger present, for example
363  // hltSingleMu15L3Filtered15.....
364  if (name == L3FilterName_) {
365  // trigger_fired = true;
366  hlt_sel = true;
367  nhlt++;
368  HLTMuMatched.push_back(toc[*ki].particle());
369  nMuHLT++;
370  }
371  }
372  }
373  }
374 
375  // Beam spot
376  Handle<reco::BeamSpot> beamSpotHandle;
377  if (!ev.getByToken(beamSpotToken_, beamSpotHandle)) {
378  // LogWarning("") << ">>> No beam spot found !!!";
379  return;
380  }
381 
382  // looping on muon....
384  if (!ev.getByToken(muonToken_, muons)) {
385  // LogError("") << ">>> muon collection does not exist !!!";
386  return;
387  }
388 
389  ev.getByToken(muonToken_, muons);
390  // saving only muons with pt> ptMuCut and eta<etaMuCut, and dxy<dxyCut
391  std::vector<reco::Muon> highPtGlbMuons;
392  std::vector<reco::Muon> highPtStaMuons;
393 
394  for (size_t i = 0; i < muons->size(); i++) {
395  const reco::Muon& mu = muons->at(i);
396  double pt = mu.pt();
397  double eta = mu.eta();
398  if (pt > ptMuCut_ && fabs(eta) < etaMuCut_) {
399  if (mu.isGlobalMuon()) {
400  // check the dxy....
401  double dxy = mu.innerTrack()->dxy(beamSpotHandle->position());
402  if (fabs(dxy) > dxyCut_) continue;
403  highPtGlbMuons.push_back(mu);
404  }
405  if (mu.isGlobalMuon()) continue;
406  // if is not, look if it is a standalone....
407  if (mu.isStandAloneMuon()) highPtStaMuons.push_back(mu);
408  nEvWithHighPtMu++;
409  }
410  }
411  size_t nHighPtGlbMu = highPtGlbMuons.size();
412  size_t nHighPtStaMu = highPtStaMuons.size();
413  if (hlt_sel && (nHighPtGlbMu > 0)) {
414  // loop on high pt muons if there's at least two with opposite charge build
415  // a Z, more then one z candidate is foreseen.........
416  // stop the loop after 10 cicles....
417  (nHighPtGlbMu > 10) ? nHighPtGlbMu = 10 : 1;
418  // Z selection
419  if (nHighPtGlbMu > 1) {
420  for (unsigned int i = 0; i < nHighPtGlbMu; i++) {
421  reco::Muon muon1 = highPtGlbMuons[i];
422  const math::XYZTLorentzVector& mu1(muon1.p4());
423  // double pt1= muon1.pt();
424  for (unsigned int j = i + 1; j < nHighPtGlbMu; ++j) {
425  reco::Muon muon2 = highPtGlbMuons[j];
426  const math::XYZTLorentzVector& mu2(muon2.p4());
427  // double pt2= muon2.pt();
428  if (muon1.charge() == muon2.charge()) continue;
429  math::XYZTLorentzVector pair = mu1 + mu2;
430  double mass = pair.M();
431  // checking isolation and hlt maching
432  iso1 = muIso(muon1);
433  iso2 = muIso(muon2);
434  isMu1Iso = (iso1 < isoCut03_);
435  isMu2Iso = (iso2 < isoCut03_);
436  singleTrigFlag1 =
437  IsMuMatchedToHLTMu(muon1, HLTMuMatched, maxDeltaR_, maxDPtRel_);
438  singleTrigFlag2 =
439  IsMuMatchedToHLTMu(muon2, HLTMuMatched, maxDeltaR_, maxDPtRel_);
440  if (singleTrigFlag1 && singleTrigFlag2) isZGolden2HLT_ = true;
441  if ((singleTrigFlag1 && !singleTrigFlag2) ||
442  (!singleTrigFlag1 && singleTrigFlag2))
443  isZGolden1HLT_ = true;
444  // Z Golden passing all criteria, with 2 or 1 muon matched to an HLT
445  // muon. Using the two cathegories as a control sample for the HLT
446  // matching efficiency
448  // a Z golden has been found, let's remove the two muons from the
449  // list, dome for avoiding resolution effect enter muons in the
450  // standalone and tracker collections.........
451  highPtGlbMuons.erase(highPtGlbMuons.begin() + i);
452  highPtGlbMuons.erase(highPtGlbMuons.begin() + j);
453  // and updating the number of high pt muons....
454  nHighPtGlbMu = highPtGlbMuons.size();
455 
456  if (isMu1Iso && isMu2Iso) {
457  niso++;
458  if (isZGolden2HLT_) {
459  n2hlt++;
460  mass2HLT_->Fill(mass);
461  highMass2HLT_->Fill(mass);
462  /*
463  if (pt1 > pt2) {
464  highest_mupt2HLT_ -> Fill (pt1);
465  lowest_mupt2HLT_ -> Fill (pt2);
466  } else {
467  highest_mupt2HLT_ -> Fill (pt2);
468  lowest_mupt2HLT_ -> Fill (pt1);
469  }
470  */
471  }
472  if (isZGolden1HLT_) {
473  n1hlt++;
474  mass1HLT_->Fill(mass);
475  highMass1HLT_->Fill(mass);
476  /*
477  if (pt1 >pt2) {
478  highest_mupt1HLT_ -> Fill (pt1);
479  lowest_mupt1HLT_ -> Fill (pt2);
480  } else {
481  highest_mupt1HLT_ -> Fill (pt2);
482  lowest_mupt1HLT_ -> Fill (pt1);
483  }
484  */
485  }
486  } else {
487  // ZGlbGlb when at least one of the two muon is not isolated and
488  // at least one HLT matched, used as control sample for the
489  // isolation efficiency
490  // filling events with one muon not isolated and both hlt mathced
491  if (((isMu1Iso && !isMu2Iso) || (!isMu1Iso && isMu2Iso)) &&
493  isZGoldenNoIso_ = true;
494  nNotIso++;
495  massNotIso_->Fill(mass);
496  highMassNotIso_->Fill(mass);
497  }
498  /*
499  if (pt1 > pt2) {
500  highest_muptNotIso_ -> Fill (pt1);
501  lowest_muptNotIso_ -> Fill (pt2);
502  } else {
503  highest_muptNotIso_ -> Fill (pt2);
504  lowest_muptNotIso_ -> Fill (pt1);
505  }
506  */
507  }
508  }
509  }
510  }
511  }
512  // W->MuNu selection (if at least one muon has been selected)
513  // looking for a W if a Z is not found.... let's think if we prefer to
514  // exclude zMuMuNotIso or zMuSta....
515  if (!(isZGolden2HLT_ || isZGolden1HLT_)) {
517  if (!ev.getByToken(metToken_, metCollection)) {
518  // LogError("") << ">>> MET collection does not exist !!!";
519  return;
520  }
521  const MET& met = metCollection->at(0);
522  nW = 0;
523  for (unsigned int i = 0; i < nHighPtGlbMu; i++) {
524  reco::Muon muon1 = highPtGlbMuons[i];
525  /*
526  quality cut not implemented
527  Quality Cuts double dxy =
528 gm->dxy(beamSpotHandle->position());
529  Cut in 0.2 double trackerHits =
530 gm->hitPattern().numberOfValidTrackerHits();
531  Cut in 11 bool quality = fabs(dxy)<dxyCut_ &&
532 muon::isGoodMuon(mu,muon::GlobalMuonPromptTight) && trackerHits>=trackerHitsCut_
533 && mu.isTrackerMuon() ;
534 if (!quality) continue;
535  */
536  // isolation cut and hlt maching
537  iso1 = muIso(muon1);
538  isMu1Iso = (iso1 < isoCut03_);
539  if (!isMu1Iso) continue;
540  // checking if muon is matched to any HLT muon....
541  singleTrigFlag1 =
542  IsMuMatchedToHLTMu(muon1, HLTMuMatched, maxDeltaR_, maxDPtRel_);
543  if (!singleTrigFlag1) continue;
544  // std::cout << " is GlobMu macthecd to HLT: " << singleTrigFlag1 <<
545  // std::endl;
546  // MT cuts
547  double met_px = met.px();
548  double met_py = met.py();
549 
550  if (!metIncludesMuons_) {
551  for (unsigned int i = 0; i < nHighPtGlbMu; i++) {
552  reco::Muon muon1 = highPtGlbMuons[i];
553  met_px -= muon1.px();
554  met_py -= muon1.py();
555  }
556  }
557  double met_et = met.pt(); // sqrt(met_px*met_px+met_py*met_py);
558  LogTrace("") << ">>> MET, MET_px, MET_py: " << met_et << ", " << met_px
559  << ", " << met_py << " [GeV]";
560  double w_et = met_et + muon1.pt();
561  double w_px = met_px + muon1.px();
562  double w_py = met_py + muon1.py();
563  double massT = w_et * w_et - w_px * w_px - w_py * w_py;
564  massT = (massT > 0) ? sqrt(massT) : 0;
565  // Acoplanarity cuts
566  Geom::Phi<double> deltaphi(muon1.phi() - atan2(met_py, met_px));
567  double acop = M_PI - fabs(deltaphi.value());
568  // std::cout << " is acp of W candidate less then cut: " << (acop<
569  // acopCut_) << std::endl;
570  if (acop > acopCut_) continue; // Cut in 2.0
571  TMass_->Fill(massT);
572  if (massT < mtMin_ || massT > mtMax_) continue; // Cut in (50,200) GeV
573  // we give the number of W only in the tMass selected but we have a look
574  // at mass tails to check the QCD background
575  isW_ = true;
576  nW++;
577  nTMass++;
578  }
579  }
580  // if a zGlobal is not selected, look at the dimuonGlobalOneStandAlone and
581  // dimuonGlobalOneTrack...., used as a control sample for the tracking
582  // efficiency and muon system efficiency
584  for (unsigned int i = 0; i < nHighPtGlbMu; ++i) {
585  reco::Muon glbMuon = highPtGlbMuons[i];
586  const math::XYZTLorentzVector& mu1(glbMuon.p4());
587  // double pt1= glbMuon.pt();
588  // checking that the global muon is hlt matched otherwise skip the event
589  singleTrigFlag1 =
590  IsMuMatchedToHLTMu(glbMuon, HLTMuMatched, maxDeltaR_, maxDPtRel_);
591  if (!singleTrigFlag1) continue;
592  // checking that the global muon is isolated matched otherwise skip the
593  // event
594  iso1 = muIso(glbMuon);
595  isMu1Iso = (iso1 < isoCut03_);
596  if (!isMu1Iso) continue;
597  // look at the standalone muon ....
598  // stop the loop after 10 cicles....
599  (nHighPtStaMu > 10) ? nHighPtStaMu = 10 : 1;
600  for (unsigned int j = 0; j < nHighPtStaMu; ++j) {
601  reco::Muon staMuon = highPtStaMuons[j];
602  const math::XYZTLorentzVector& mu2(staMuon.p4());
603  // double pt2= staMuon.pt();
604  if (glbMuon.charge() == staMuon.charge()) continue;
605  math::XYZTLorentzVector pair = mu1 + mu2;
606  double mass = pair.M();
607  iso2 = muIso(staMuon);
608  isMu2Iso = (iso2 < isoCut03_);
609  LogTrace("") << "\t... isolation value" << iso1 << ", isolated? "
610  << isMu1Iso;
611  LogTrace("") << "\t... isolation value" << iso2 << ", isolated? "
612  << isMu2Iso;
613  // requiring theat the global mu is mathed to the HLT and both are
614  // isolated
615  if (isMu2Iso) {
616  isZGlbSta_ = true;
617  nGlbSta++;
618  massGlbSta_->Fill(mass);
619  highMassGlbSta_->Fill(mass);
620  /*
621  if (pt1 > pt2) {
622  highest_muptGlbSta_ -> Fill (pt1);
623  lowest_muptGlbSta_ -> Fill (pt2);
624  } else {
625  highest_muptGlbSta_ -> Fill (pt2);
626  lowest_muptGlbSta_ -> Fill (pt1);
627  }
628  */
629  }
630  }
631  // look at the tracks....
633  if (!ev.getByToken(trackToken_, tracks)) {
634  // LogError("") << ">>> track collection does not exist !!!";
635  return;
636  }
637  ev.getByToken(trackToken_, tracks);
638  Handle<CaloTowerCollection> calotower;
639  if (!ev.getByToken(caloTowerToken_, calotower)) {
640  // LogError("") << ">>> calotower collection does not exist !!!";
641  return;
642  }
643  ev.getByToken(caloTowerToken_, calotower);
644  // avoid to loop on more than 5000 trks
645  size_t nTrk = tracks->size();
646  (nTrk > 5000) ? nTrk = 5000 : 1;
647  for (unsigned int j = 0; j < nTrk; j++) {
648  const reco::Track& tk = tracks->at(j);
649  if (glbMuon.charge() == tk.charge()) continue;
650  double pt2 = tk.pt();
651  double eta = tk.eta();
652  double dxy = tk.dxy(beamSpotHandle->position());
653  if (pt2 < ptMuCut_ || fabs(eta) > etaMuCut_ || fabs(dxy) > dxyCut_)
654  continue;
655  // assuming that the track is a mu....
657  tk.px(), tk.py(), tk.pz(),
658  sqrt((tk.p() * tk.p()) + (0.10566 * 0.10566)));
659  math::XYZTLorentzVector pair = mu1 + mu2;
660  double mass = pair.M();
661  // now requiring that the tracks is isolated.......
662  iso2 = tkIso(tk, tracks, calotower);
663  isMu2Iso = (iso2 < isoCut03_);
664  // std::cout << "found a track with rel/comb iso: " << iso2
665  //<< std::endl;
666  if (isMu2Iso) {
667  isZGlbTrk_ = true;
668  nGlbTrk++;
669  massGlbTrk_->Fill(mass);
670  highMassGlbTrk_->Fill(mass);
671  if (!isW_) continue;
674  /*
675  if (pt1 > pt2) {
676  highest_muptGlbTrk_ -> Fill (pt1);
677  lowest_muptGlbTrk_ -> Fill (pt2);
678  } else {
679  highest_muptGlbTrk_ -> Fill (pt2);
680  lowest_muptGlbTrk_ -> Fill (pt1);
681  }
682  */
683  }
684  }
685  }
686  }
687  }
688  if ((hlt_sel || isZGolden2HLT_ || isZGolden1HLT_ || isZGoldenNoIso_ ||
689  isZGlbSta_ || isZGlbTrk_ || isW_)) {
690  nsel++;
691  LogTrace("") << ">>>> Event ACCEPTED";
692  } else {
693  LogTrace("") << ">>>> Event REJECTED";
694  }
695  return;
696 }
size
Write out results.
MonitorElement * highMass1HLT_
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
double eta() const final
momentum pseudorapidity
bool isStandAloneMuon() const override
Definition: Muon.h:278
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
virtual TrackRef innerTrack() const
Definition: Muon.h:48
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
double px() const final
x coordinate of momentum vector
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
MonitorElement * highMassIsBothGlbTrkThanW_
double pt() const final
transverse momentum
MonitorElement * highMassGlbTrk_
int charge() const final
electric charge
Definition: LeafCandidate.h:91
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
MonitorElement * massNotIso_
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:627
MonitorElement * highMassGlbSta_
edm::EDGetTokenT< edm::TriggerResults > trigToken_
std::string encode() const
Definition: InputTag.cc:166
void Fill(long long x)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
MonitorElement * mass1HLT_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
MonitorElement * massIsBothGlbTrkThanW_
MonitorElement * massGlbTrk_
bool IsMuMatchedToHLTMu(const reco::Muon &, const std::vector< reco::Particle > &, double, double)
double tkIso(const reco::Track &, edm::Handle< reco::TrackCollection >, edm::Handle< CaloTowerCollection >)
bool isGlobalMuon() const override
Definition: Muon.h:276
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
Definition: MET.h:42
T sqrt(T t)
Definition: SSEVec.h:18
double pt() const
track transverse momentum
Definition: TrackBase.h:621
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken_
MonitorElement * highMassNotIso_
double f[11][100]
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
edm::EDGetTokenT< reco::TrackCollection > trackToken_
const int mu
Definition: Constants.h:22
static std::string const triggerResults
Definition: EdmProvDump.cc:41
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
#define LogTrace(id)
#define M_PI
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:639
int k[5][pyjets_maxn]
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
const edm::InputTag filterTag(trigger::size_type index) const
Definition: TriggerEvent.h:103
MonitorElement * massGlbSta_
met
===> hadronic RAZOR
double muIso(const reco::Muon &)
std::vector< size_type > Keys
double py() const final
y coordinate of momentum vector
MonitorElement * TMass_
HLTConfigProvider hltConfigProvider_
MonitorElement * mass2HLT_
edm::EDGetTokenT< trigger::TriggerEvent > trigEvToken_
unsigned int prescaleSize() const
MonitorElement * highMass2HLT_
int charge() const
track electric charge
Definition: TrackBase.h:567
const Point & position() const
position
Definition: BeamSpot.h:62
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:591
double phi() const final
momentum azimuthal angle
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:633
void EwkMuLumiMonitorDQM::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 106 of file EwkMuLumiMonitorDQM.cc.

References DQMStore::IBooker::book1D(), highMass1HLT_, highMass2HLT_, highMassGlbSta_, highMassGlbTrk_, highMassIsBothGlbTrkThanW_, highMassNotIso_, mass1HLT_, mass2HLT_, massGlbSta_, massGlbTrk_, massIsBothGlbTrkThanW_, massNotIso_, DQMStore::IBooker::setCurrentFolder(), and TMass_.

107  {
108 
109  ibooker.setCurrentFolder("Physics/EwkMuLumiMonitorDQM");
110 
111  mass2HLT_ = ibooker.book1D("Z_2HLT_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
112  mass1HLT_ = ibooker.book1D("Z_1HLT_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
113  massNotIso_ = ibooker.book1D("Z_NOTISO_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
114  massGlbSta_ = ibooker.book1D("Z_GLBSTA_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
115  massGlbTrk_ = ibooker.book1D("Z_GLBTRK_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
116  massIsBothGlbTrkThanW_ = ibooker.book1D("Z_ISBOTHGLBTRKTHANW_MASS",
117  "Z mass [GeV/c^{2}]", 200, 0., 200.);
118 
119  highMass2HLT_ = ibooker.book1D("Z_2HLT_HIGHMASS",
120  "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
121  highMass1HLT_ = ibooker.book1D("Z_1HLT_HIGHMASS",
122  "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
123  highMassNotIso_ = ibooker.book1D("Z_NOTISO_HIGHMASS",
124  "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
125  highMassGlbSta_ = ibooker.book1D("Z_GLBSTA_HIGHMASS",
126  "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
127  highMassGlbTrk_ = ibooker.book1D("Z_GLBTRK_HIGHMASS",
128  "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
129  highMassIsBothGlbTrkThanW_ = ibooker.book1D("Z_ISBOTHGLBTRKTHANW_HIGHMASS",
130  "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
131 
132  TMass_ = ibooker.book1D("TMASS", "Transverse mass [GeV]", 300, 0., 300.);
133 }
MonitorElement * highMass1HLT_
MonitorElement * highMassIsBothGlbTrkThanW_
MonitorElement * highMassGlbTrk_
MonitorElement * massNotIso_
MonitorElement * highMassGlbSta_
MonitorElement * mass1HLT_
MonitorElement * massIsBothGlbTrkThanW_
MonitorElement * massGlbTrk_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * highMassNotIso_
MonitorElement * massGlbSta_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * TMass_
MonitorElement * mass2HLT_
MonitorElement * highMass2HLT_
void EwkMuLumiMonitorDQM::dqmBeginRun ( const edm::Run r,
const edm::EventSetup iSetup 
)
override

Definition at line 81 of file EwkMuLumiMonitorDQM.cc.

References hltConfigProvider_, HLTConfigProvider::init(), isValidHltConfig_, n1hlt, n2hlt, nall, nEvWithHighPtMu, nGlbSta, nGlbTrk, nhlt, nInKinRange, niso, nNotIso, nsel, nTMass, nW, edm::InputTag::process(), and trigTag_.

81  {
82  nall = 0;
83  nEvWithHighPtMu = 0;
84  nInKinRange = 0;
85  nsel = 0;
86  niso = 0;
87  nhlt = 0;
88  n1hlt = 0;
89  n2hlt = 0;
90  nNotIso = 0;
91  nGlbSta = 0;
92  nGlbTrk = 0;
93  nTMass = 0;
94  nW = 0;
95 
96  // passed as parameter to HLTConfigProvider::init(), not yet used
97  bool isConfigChanged = false;
98 
99  // isValidHltConfig_ used to short-circuit analyze() in case of problems
101  hltConfigProvider_.init(r, iSetup, trigTag_.process(), isConfigChanged);
102  // std::cout << "hlt config trigger is valid??" << isValidHltConfig_ <<
103  // std::endl;
104 }
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::string const & process() const
Definition: InputTag.h:40
HLTConfigProvider hltConfigProvider_
void EwkMuLumiMonitorDQM::endRun ( const edm::Run r,
const edm::EventSetup  
)
override

Definition at line 197 of file EwkMuLumiMonitorDQM.cc.

References n1hlt, n2hlt, nall, nGlbSta, nhlt, nNotIso, nsel, and nTMass.

197  {
198 
199  LogVerbatim("") << "\n>>>>>> Z/W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
200  LogVerbatim("") << "Total numer of events analyzed: " << nall << " [events]";
201  LogVerbatim("") << "Total numer of events selected: " << nsel << " [events]";
202 
203  LogVerbatim("") << "Passing HLT criteria: " << nhlt << " [events] ";
204  LogVerbatim("") << "Passing 2 HLT match criteria: " << n2hlt
205  << " [events] ";
206  LogVerbatim("") << "Passing 1 HLT match criteria: " << n1hlt
207  << " [events] ";
208  LogVerbatim("") << "Passing Not Iso criteria: " << nNotIso
209  << " [events] ";
210  LogVerbatim("") << "Passing GlbSta criteria: " << nGlbSta
211  << " [events] ";
212  LogVerbatim("") << "Passing W criteria: " << nTMass << " [events] ";
213  LogVerbatim("") << ">>>>>> Z/W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
214 }
void EwkMuLumiMonitorDQM::init_histograms ( )
bool EwkMuLumiMonitorDQM::IsMuMatchedToHLTMu ( const reco::Muon mu,
const std::vector< reco::Particle > &  HLTMu,
double  DR,
double  DPtRel 
)

Definition at line 182 of file EwkMuLumiMonitorDQM.cc.

References deltaR(), gen::k, nJettinessAdder_cfi::nPass, EnergyCorrector::pt, and reco::LeafCandidate::pt().

Referenced by analyze().

184  {
185  size_t dim = HLTMu.size();
186  size_t nPass = 0;
187  if (dim == 0) return false;
188  for (size_t k = 0; k < dim; k++) {
189  if ((deltaR(HLTMu[k], mu) < DR) &&
190  (fabs(HLTMu[k].pt() - mu.pt()) / HLTMu[k].pt() < DPtRel)) {
191  nPass++;
192  }
193  }
194  return (nPass > 0);
195 }
double pt() const final
transverse momentum
int k[5][pyjets_maxn]
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
double EwkMuLumiMonitorDQM::muIso ( const reco::Muon mu)

Definition at line 135 of file EwkMuLumiMonitorDQM.cc.

References reco::MuonIsolation::emEt, reco::MuonIsolation::hadEt, isCombinedIso_, reco::Muon::isolationR03(), isRelativeIso_, reco::LeafCandidate::pt(), and reco::MuonIsolation::sumPt.

Referenced by analyze().

135  {
136  double isovar = mu.isolationR03().sumPt;
137  if (isCombinedIso_) {
138  isovar += mu.isolationR03().emEt;
139  isovar += mu.isolationR03().hadEt;
140  }
141  if (isRelativeIso_) isovar /= mu.pt();
142  return isovar;
143 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:9
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:7
double pt() const final
transverse momentum
float emEt
ecal sum-Et
Definition: MuonIsolation.h:8
const MuonIsolation & isolationR03() const
Definition: Muon.h:162
double EwkMuLumiMonitorDQM::tkIso ( const reco::Track tk,
edm::Handle< reco::TrackCollection tracks,
edm::Handle< CaloTowerCollection calotower 
)

Definition at line 145 of file EwkMuLumiMonitorDQM.cc.

References edm::SortedCollection< T, SORT >::begin(), deltaR(), PATTauDiscriminationAgainstElectronDeadECAL_cfi::dR, PVValHelper::dz, HTMLExport::elem(), edm::SortedCollection< T, SORT >::end(), reco::TrackBase::eta(), mps_fire::i, isCombinedIso_, isRelativeIso_, reco::Track::outerEta(), reco::Track::outerPhi(), reco::TrackBase::phi(), reco::TrackBase::pt(), ptThreshold_, mathSSE::sqrt(), reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

Referenced by analyze().

147  {
148  double ptSum = 0;
149  for (size_t i = 0; i < tracks->size(); ++i) {
150  const reco::Track& elem = tracks->at(i);
151  double elemPt = elem.pt();
152  // same parameter used for muIsolation: dR [0.01, IsoCut03_], |dZ|<0.2,
153  // |d_r(xy)|<0.1
154  double elemVx = elem.vx();
155  double elemVy = elem.vy();
156  double elemD0 = sqrt(elemVx * elemVx + elemVy * elemVy);
157  if (elemD0 > 0.2) continue;
158  double dz = fabs(elem.vz() - tk.vz());
159  if (dz > 0.1) continue;
160  // evaluate only for tracks with pt>ptTreshold
161  if (elemPt < ptThreshold_) continue;
162  double dR = deltaR(elem.eta(), elem.phi(), tk.eta(), tk.phi());
163  // isolation in a cone with dR=0.3, and vetoing the track itself
164  if ((dR < 0.01) || (dR > 0.3)) continue;
165  ptSum += elemPt;
166  }
167  if (isCombinedIso_) {
168  // loop on clusters....
169  for (CaloTowerCollection::const_iterator it = calotower->begin();
170  it != calotower->end(); ++it) {
171  double dR = deltaR(it->eta(), it->phi(), tk.outerEta(), tk.outerPhi());
172  // veto value is 0.1 for towers....
173  if ((dR < 0.1) || (dR > 0.3)) continue;
174  ptSum += it->emEnergy();
175  ptSum += it->hadEnergy();
176  }
177  }
178  if (isRelativeIso_) ptSum /= tk.pt();
179  return ptSum;
180 }
std::vector< CaloTower >::const_iterator const_iterator
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
T sqrt(T t)
Definition: SSEVec.h:18
double pt() const
track transverse momentum
Definition: TrackBase.h:621
def elem(elemtype, innerHTML='', html_class='', kwargs)
Definition: HTMLExport.py:18
const_iterator end() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
double outerEta() const
pseudorapidity of the momentum vector at the outermost hit position
Definition: Track.h:169
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
double outerPhi() const
azimuthal angle of the momentum vector at the outermost hit position
Definition: Track.h:164
const_iterator begin() const
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657

Member Data Documentation

double EwkMuLumiMonitorDQM::acopCut_
private

Definition at line 82 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

edm::EDGetTokenT<reco::BeamSpot> EwkMuLumiMonitorDQM::beamSpotToken_
private

Definition at line 58 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

edm::EDGetTokenT<CaloTowerCollection> EwkMuLumiMonitorDQM::caloTowerToken_
private

Definition at line 61 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::deltaRTrk_
private

Definition at line 75 of file EwkMuLumiMonitorDQM.h.

double EwkMuLumiMonitorDQM::deltaRVetoTrk_
private

Definition at line 77 of file EwkMuLumiMonitorDQM.h.

double EwkMuLumiMonitorDQM::dxyCut_
private

Definition at line 83 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::etaMuCut_
private

Definition at line 69 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

MonitorElement* EwkMuLumiMonitorDQM::highMass1HLT_
private

Definition at line 91 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMass2HLT_
private

Definition at line 86 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassGlbSta_
private

Definition at line 101 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassGlbTrk_
private

Definition at line 106 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassIsBothGlbTrkThanW_
private

Definition at line 113 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassNotIso_
private

Definition at line 96 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

HLTConfigProvider EwkMuLumiMonitorDQM::hltConfigProvider_
private

Definition at line 137 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

bool EwkMuLumiMonitorDQM::isCombinedIso_
private

Definition at line 72 of file EwkMuLumiMonitorDQM.h.

Referenced by muIso(), and tkIso().

double EwkMuLumiMonitorDQM::isoCut03_
private

Definition at line 73 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isRelativeIso_
private

Definition at line 71 of file EwkMuLumiMonitorDQM.h.

Referenced by muIso(), and tkIso().

bool EwkMuLumiMonitorDQM::isValidHltConfig_
private

Definition at line 136 of file EwkMuLumiMonitorDQM.h.

Referenced by dqmBeginRun(), and EwkMuLumiMonitorDQM().

bool EwkMuLumiMonitorDQM::isW_
private

Definition at line 134 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGlbSta_
private

Definition at line 132 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGlbTrk_
private

Definition at line 133 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGolden1HLT_
private

Definition at line 129 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGolden2HLT_
private

Definition at line 130 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGoldenNoIso_
private

Definition at line 131 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

MonitorElement* EwkMuLumiMonitorDQM::mass1HLT_
private

Definition at line 90 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::mass2HLT_
private

Definition at line 85 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::massGlbSta_
private

Definition at line 100 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::massGlbTrk_
private

Definition at line 105 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::massIsBothGlbTrkThanW_
private

Definition at line 112 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::massNotIso_
private

Definition at line 95 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkMuLumiMonitorDQM::maxDeltaR_
private

Definition at line 79 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::maxDPtRel_
private

Definition at line 78 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::metIncludesMuons_
private

Definition at line 63 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

edm::EDGetTokenT<edm::View<reco::MET> > EwkMuLumiMonitorDQM::metToken_
private

Definition at line 62 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::mtMax_
private

Definition at line 81 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::mtMin_
private

Definition at line 80 of file EwkMuLumiMonitorDQM.h.

edm::EDGetTokenT<edm::View<reco::Muon> > EwkMuLumiMonitorDQM::muonToken_
private

Definition at line 59 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

unsigned int EwkMuLumiMonitorDQM::n1hlt
private

Definition at line 121 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkMuLumiMonitorDQM::n2hlt
private

Definition at line 122 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkMuLumiMonitorDQM::nall
private

Definition at line 115 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkMuLumiMonitorDQM::nEvWithHighPtMu
private

Definition at line 116 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

unsigned int EwkMuLumiMonitorDQM::nGlbSta
private

Definition at line 124 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkMuLumiMonitorDQM::nGlbTrk
private

Definition at line 125 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

unsigned int EwkMuLumiMonitorDQM::nhlt
private

Definition at line 120 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkMuLumiMonitorDQM::nInKinRange
private

Definition at line 117 of file EwkMuLumiMonitorDQM.h.

Referenced by dqmBeginRun().

unsigned int EwkMuLumiMonitorDQM::niso
private

Definition at line 119 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

unsigned int EwkMuLumiMonitorDQM::nNotIso
private

Definition at line 123 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkMuLumiMonitorDQM::nsel
private

Definition at line 118 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkMuLumiMonitorDQM::nTMass
private

Definition at line 126 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), dqmBeginRun(), and endRun().

unsigned int EwkMuLumiMonitorDQM::nW
private

Definition at line 127 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

double EwkMuLumiMonitorDQM::ptMuCut_
private

Definition at line 68 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::ptThreshold_
private

Definition at line 76 of file EwkMuLumiMonitorDQM.h.

Referenced by tkIso().

MonitorElement* EwkMuLumiMonitorDQM::TMass_
private

Definition at line 110 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<reco::TrackCollection> EwkMuLumiMonitorDQM::trackToken_
private

Definition at line 60 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

edm::EDGetTokenT<trigger::TriggerEvent> EwkMuLumiMonitorDQM::trigEvToken_
private

Definition at line 57 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

edm::InputTag EwkMuLumiMonitorDQM::trigTag_
private

Definition at line 55 of file EwkMuLumiMonitorDQM.h.

Referenced by dqmBeginRun().

edm::EDGetTokenT<edm::TriggerResults> EwkMuLumiMonitorDQM::trigToken_
private

Definition at line 56 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().