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::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > 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 dqmEndRun (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 &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 36 of file EwkMuLumiMonitorDQM.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file EwkMuLumiMonitorDQM.cc.

References isValidHltConfig_.

36  : // Input collections
37  trigTag_(cfg.getUntrackedParameter<edm::InputTag>("TrigTag", edm::InputTag("TriggerResults::HLT"))),
38  trigToken_(consumes<edm::TriggerResults>(trigTag_)),
39  trigEvToken_(consumes<trigger::TriggerEvent>(cfg.getUntrackedParameter<edm::InputTag>("triggerEvent"))),
40  beamSpotToken_(consumes<reco::BeamSpot>(
41  cfg.getUntrackedParameter<edm::InputTag>("offlineBeamSpot", edm::InputTag("offlineBeamSpot")))),
43  trackToken_(consumes<reco::TrackCollection>(cfg.getUntrackedParameter<edm::InputTag>("tracks"))),
44  caloTowerToken_(consumes<CaloTowerCollection>(cfg.getUntrackedParameter<edm::InputTag>("calotower"))),
46  metIncludesMuons_(cfg.getUntrackedParameter<bool>("METIncludesMuons")),
47  // Main cuts
48  // massMin_(cfg.getUntrackedParameter<double>("MtMin", 20.)),
49  // massMax_(cfg.getUntrackedParameter<double>("MtMax", 2000.))
50  // hltPath_(cfg.getUntrackedParameter<std::string> ("hltPath")) ,
51  // L3FilterName_(cfg.getUntrackedParameter<std::string>
52  // ("L3FilterName")),
53  ptMuCut_(cfg.getUntrackedParameter<double>("ptMuCut")),
54  etaMuCut_(cfg.getUntrackedParameter<double>("etaMuCut")),
55  isRelativeIso_(cfg.getUntrackedParameter<bool>("IsRelativeIso")),
56  isCombinedIso_(cfg.getUntrackedParameter<bool>("IsCombinedIso")),
57  isoCut03_(cfg.getUntrackedParameter<double>("IsoCut03")),
58  // deltaRTrk_(cfg.getUntrackedParameter<double>("deltaRTrk")),
59  ptThreshold_(cfg.getUntrackedParameter<double>("ptThreshold")),
60  // deltaRVetoTrk_(cfg.getUntrackedParameter<double>("deltaRVetoTrk")),
61  maxDPtRel_(cfg.getUntrackedParameter<double>("maxDPtRel")),
62  maxDeltaR_(cfg.getUntrackedParameter<double>("maxDeltaR")),
63  mtMin_(cfg.getUntrackedParameter<double>("mtMin")),
64  mtMax_(cfg.getUntrackedParameter<double>("mtMax")),
65  acopCut_(cfg.getUntrackedParameter<double>("acopCut")),
66  dxyCut_(cfg.getUntrackedParameter<double>("DxyCut")) {
67  // just to initialize
68  isValidHltConfig_ = false;
69 }
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 199 of file EwkMuLumiMonitorDQM.cc.

References edm::HLTGlobalStatus::accept(), acopCut_, beamSpotToken_, ewkMuLumiMonitorDQM_cfi::calotower, 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, dqm::impl::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_, dqmiolumiharvest::j, dqmdumpme::k, LogTrace, M_PI, EgHLTOffHistBins_cfi::mass, mass1HLT_, mass2HLT_, massGlbSta_, massGlbTrk_, massIsBothGlbTrkThanW_, massNotIso_, maxDeltaR_, maxDPtRel_, BTaggingMonitor_cfi::met, susyDQM_cfi::metCollection, metIncludesMuons_, metToken_, HLTConfigProvider::moduleLabels(), mtMax_, amptDefaultParameters_cff::mu, muIso(), PDWG_BPHSkim_cff::muons, muonToken_, dqmiodumpmetadata::n, n1hlt, n2hlt, nall, Skims_PA_cff::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(), DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), reco::TrackBase::pt(), HLT_2018_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(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, tkIso(), TMass_, PDWG_EXOHSCP_cff::tracks, trackToken_, ClusterTask_cfi::trig, trigEvToken_, HLTConfigProvider::triggerIndex(), L1TEGammaOffline_cfi::triggerNames, HLTConfigProvider::triggerNames(), triggerResults, trigToken_, and findQualityFiles::v.

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

Implements DQMEDAnalyzer.

Definition at line 95 of file EwkMuLumiMonitorDQM.cc.

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

95  {
96  ibooker.setCurrentFolder("Physics/EwkMuLumiMonitorDQM");
97 
98  mass2HLT_ = ibooker.book1D("Z_2HLT_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
99  mass1HLT_ = ibooker.book1D("Z_1HLT_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
100  massNotIso_ = ibooker.book1D("Z_NOTISO_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
101  massGlbSta_ = ibooker.book1D("Z_GLBSTA_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
102  massGlbTrk_ = ibooker.book1D("Z_GLBTRK_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
103  massIsBothGlbTrkThanW_ = ibooker.book1D("Z_ISBOTHGLBTRKTHANW_MASS", "Z mass [GeV/c^{2}]", 200, 0., 200.);
104 
105  highMass2HLT_ = ibooker.book1D("Z_2HLT_HIGHMASS", "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
106  highMass1HLT_ = ibooker.book1D("Z_1HLT_HIGHMASS", "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
107  highMassNotIso_ = ibooker.book1D("Z_NOTISO_HIGHMASS", "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
108  highMassGlbSta_ = ibooker.book1D("Z_GLBSTA_HIGHMASS", "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
109  highMassGlbTrk_ = ibooker.book1D("Z_GLBTRK_HIGHMASS", "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
111  ibooker.book1D("Z_ISBOTHGLBTRKTHANW_HIGHMASS", "Z high mass [GeV/c^{2}]", 2000, 0., 2000.);
112 
113  TMass_ = ibooker.book1D("TMASS", "Transverse mass [GeV]", 300, 0., 300.);
114 }
MonitorElement * highMass1HLT_
MonitorElement * highMassIsBothGlbTrkThanW_
MonitorElement * highMassGlbTrk_
MonitorElement * massNotIso_
MonitorElement * highMassGlbSta_
MonitorElement * mass1HLT_
MonitorElement * massIsBothGlbTrkThanW_
MonitorElement * massGlbTrk_
MonitorElement * highMassNotIso_
MonitorElement * massGlbSta_
MonitorElement * TMass_
MonitorElement * mass2HLT_
MonitorElement * highMass2HLT_
void EwkMuLumiMonitorDQM::dqmBeginRun ( const edm::Run r,
const edm::EventSetup iSetup 
)
override

Definition at line 71 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_.

71  {
72  nall = 0;
73  nEvWithHighPtMu = 0;
74  nInKinRange = 0;
75  nsel = 0;
76  niso = 0;
77  nhlt = 0;
78  n1hlt = 0;
79  n2hlt = 0;
80  nNotIso = 0;
81  nGlbSta = 0;
82  nGlbTrk = 0;
83  nTMass = 0;
84  nW = 0;
85 
86  // passed as parameter to HLTConfigProvider::init(), not yet used
87  bool isConfigChanged = false;
88 
89  // isValidHltConfig_ used to short-circuit analyze() in case of problems
90  isValidHltConfig_ = hltConfigProvider_.init(r, iSetup, trigTag_.process(), isConfigChanged);
91  // std::cout << "hlt config trigger is valid??" << isValidHltConfig_ <<
92  // std::endl;
93 }
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::dqmEndRun ( const edm::Run r,
const edm::EventSetup  
)
override

Definition at line 185 of file EwkMuLumiMonitorDQM.cc.

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

185  {
186  LogVerbatim("") << "\n>>>>>> Z/W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
187  LogVerbatim("") << "Total numer of events analyzed: " << nall << " [events]";
188  LogVerbatim("") << "Total numer of events selected: " << nsel << " [events]";
189 
190  LogVerbatim("") << "Passing HLT criteria: " << nhlt << " [events] ";
191  LogVerbatim("") << "Passing 2 HLT match criteria: " << n2hlt << " [events] ";
192  LogVerbatim("") << "Passing 1 HLT match criteria: " << n1hlt << " [events] ";
193  LogVerbatim("") << "Passing Not Iso criteria: " << nNotIso << " [events] ";
194  LogVerbatim("") << "Passing GlbSta criteria: " << nGlbSta << " [events] ";
195  LogVerbatim("") << "Passing W criteria: " << nTMass << " [events] ";
196  LogVerbatim("") << ">>>>>> Z/W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
197 }
void EwkMuLumiMonitorDQM::init_histograms ( )
bool EwkMuLumiMonitorDQM::IsMuMatchedToHLTMu ( const reco::Muon mu,
const std::vector< reco::Particle > &  HLTMu,
double  DR,
double  DPtRel 
)

Definition at line 169 of file EwkMuLumiMonitorDQM.cc.

References PbPb_ZMuSkimMuonDPG_cff::deltaR, dqmdumpme::k, nJettinessAdder_cfi::nPass, DiDispStaMuonMonitor_cfi::pt, and reco::LeafCandidate::pt().

Referenced by analyze().

172  {
173  size_t dim = HLTMu.size();
174  size_t nPass = 0;
175  if (dim == 0)
176  return false;
177  for (size_t k = 0; k < dim; k++) {
178  if ((deltaR(HLTMu[k], mu) < DR) && (fabs(HLTMu[k].pt() - mu.pt()) / HLTMu[k].pt() < DPtRel)) {
179  nPass++;
180  }
181  }
182  return (nPass > 0);
183 }
double pt() const final
transverse momentum
double EwkMuLumiMonitorDQM::muIso ( const reco::Muon mu)

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

116  {
117  double isovar = mu.isolationR03().sumPt;
118  if (isCombinedIso_) {
119  isovar += mu.isolationR03().emEt;
120  isovar += mu.isolationR03().hadEt;
121  }
122  if (isRelativeIso_)
123  isovar /= mu.pt();
124  return isovar;
125 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:8
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:6
double pt() const final
transverse momentum
float emEt
ecal sum-Et
Definition: MuonIsolation.h:7
const MuonIsolation & isolationR03() const
Definition: Muon.h:166
double EwkMuLumiMonitorDQM::tkIso ( const reco::Track tk,
edm::Handle< reco::TrackCollection tracks,
edm::Handle< CaloTowerCollection calotower 
)

Definition at line 127 of file EwkMuLumiMonitorDQM.cc.

References edm::SortedCollection< T, SORT >::begin(), PbPb_ZMuSkimMuonDPG_cff::deltaR, HGC3DClusterGenMatchSelector_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().

129  {
130  double ptSum = 0;
131  for (size_t i = 0; i < tracks->size(); ++i) {
132  const reco::Track& elem = tracks->at(i);
133  double elemPt = elem.pt();
134  // same parameter used for muIsolation: dR [0.01, IsoCut03_], |dZ|<0.2,
135  // |d_r(xy)|<0.1
136  double elemVx = elem.vx();
137  double elemVy = elem.vy();
138  double elemD0 = sqrt(elemVx * elemVx + elemVy * elemVy);
139  if (elemD0 > 0.2)
140  continue;
141  double dz = fabs(elem.vz() - tk.vz());
142  if (dz > 0.1)
143  continue;
144  // evaluate only for tracks with pt>ptTreshold
145  if (elemPt < ptThreshold_)
146  continue;
147  double dR = deltaR(elem.eta(), elem.phi(), tk.eta(), tk.phi());
148  // isolation in a cone with dR=0.3, and vetoing the track itself
149  if ((dR < 0.01) || (dR > 0.3))
150  continue;
151  ptSum += elemPt;
152  }
153  if (isCombinedIso_) {
154  // loop on clusters....
155  for (CaloTowerCollection::const_iterator it = calotower->begin(); it != calotower->end(); ++it) {
156  double dR = deltaR(it->eta(), it->phi(), tk.outerEta(), tk.outerPhi());
157  // veto value is 0.1 for towers....
158  if ((dR < 0.1) || (dR > 0.3))
159  continue;
160  ptSum += it->emEnergy();
161  ptSum += it->hadEnergy();
162  }
163  }
164  if (isRelativeIso_)
165  ptSum /= tk.pt();
166  return ptSum;
167 }
std::vector< CaloTower >::const_iterator const_iterator
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:614
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:617
T sqrt(T t)
Definition: SSEVec.h:19
double pt() const
track transverse momentum
Definition: TrackBase.h:602
def elem(elemtype, innerHTML='', html_class='', kwargs)
Definition: HTMLExport.py:19
const_iterator end() const
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:626
double outerEta() const
pseudorapidity of the momentum vector at the outermost hit position
Definition: Track.h:127
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:623
double outerPhi() const
azimuthal angle of the momentum vector at the outermost hit position
Definition: Track.h:124
const_iterator begin() const
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:620

Member Data Documentation

double EwkMuLumiMonitorDQM::acopCut_
private

Definition at line 78 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

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

Definition at line 54 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

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

Definition at line 57 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::deltaRTrk_
private

Definition at line 71 of file EwkMuLumiMonitorDQM.h.

double EwkMuLumiMonitorDQM::deltaRVetoTrk_
private

Definition at line 73 of file EwkMuLumiMonitorDQM.h.

double EwkMuLumiMonitorDQM::dxyCut_
private

Definition at line 79 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::etaMuCut_
private

Definition at line 65 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

MonitorElement* EwkMuLumiMonitorDQM::highMass1HLT_
private

Definition at line 87 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMass2HLT_
private

Definition at line 82 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassGlbSta_
private

Definition at line 97 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassGlbTrk_
private

Definition at line 102 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassIsBothGlbTrkThanW_
private

Definition at line 109 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassNotIso_
private

Definition at line 92 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

HLTConfigProvider EwkMuLumiMonitorDQM::hltConfigProvider_
private

Definition at line 133 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

bool EwkMuLumiMonitorDQM::isCombinedIso_
private

Definition at line 68 of file EwkMuLumiMonitorDQM.h.

Referenced by muIso(), and tkIso().

double EwkMuLumiMonitorDQM::isoCut03_
private

Definition at line 69 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isRelativeIso_
private

Definition at line 67 of file EwkMuLumiMonitorDQM.h.

Referenced by muIso(), and tkIso().

bool EwkMuLumiMonitorDQM::isValidHltConfig_
private

Definition at line 132 of file EwkMuLumiMonitorDQM.h.

Referenced by dqmBeginRun(), and EwkMuLumiMonitorDQM().

bool EwkMuLumiMonitorDQM::isW_
private

Definition at line 130 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGlbSta_
private

Definition at line 128 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGlbTrk_
private

Definition at line 129 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGolden1HLT_
private

Definition at line 125 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGolden2HLT_
private

Definition at line 126 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGoldenNoIso_
private

Definition at line 127 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

MonitorElement* EwkMuLumiMonitorDQM::mass1HLT_
private

Definition at line 86 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::mass2HLT_
private

Definition at line 81 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::massGlbSta_
private

Definition at line 96 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::massGlbTrk_
private

Definition at line 101 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::massIsBothGlbTrkThanW_
private

Definition at line 108 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* EwkMuLumiMonitorDQM::massNotIso_
private

Definition at line 91 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

double EwkMuLumiMonitorDQM::maxDeltaR_
private

Definition at line 75 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::maxDPtRel_
private

Definition at line 74 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::metIncludesMuons_
private

Definition at line 59 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

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

Definition at line 58 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::mtMax_
private

Definition at line 77 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::mtMin_
private

Definition at line 76 of file EwkMuLumiMonitorDQM.h.

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

Definition at line 55 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

unsigned int EwkMuLumiMonitorDQM::n1hlt
private

Definition at line 117 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::n2hlt
private

Definition at line 118 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nall
private

Definition at line 111 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nEvWithHighPtMu
private

Definition at line 112 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

unsigned int EwkMuLumiMonitorDQM::nGlbSta
private

Definition at line 120 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nGlbTrk
private

Definition at line 121 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

unsigned int EwkMuLumiMonitorDQM::nhlt
private

Definition at line 116 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nInKinRange
private

Definition at line 113 of file EwkMuLumiMonitorDQM.h.

Referenced by dqmBeginRun().

unsigned int EwkMuLumiMonitorDQM::niso
private

Definition at line 115 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

unsigned int EwkMuLumiMonitorDQM::nNotIso
private

Definition at line 119 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nsel
private

Definition at line 114 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nTMass
private

Definition at line 122 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nW
private

Definition at line 123 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and dqmBeginRun().

double EwkMuLumiMonitorDQM::ptMuCut_
private

Definition at line 64 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::ptThreshold_
private

Definition at line 72 of file EwkMuLumiMonitorDQM.h.

Referenced by tkIso().

MonitorElement* EwkMuLumiMonitorDQM::TMass_
private

Definition at line 106 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 56 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

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

Definition at line 53 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

edm::InputTag EwkMuLumiMonitorDQM::trigTag_
private

Definition at line 51 of file EwkMuLumiMonitorDQM.h.

Referenced by dqmBeginRun().

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

Definition at line 52 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().