CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EwkMuLumiMonitorDQM Class Reference

#include <EwkMuLumiMonitorDQM.h>

Inheritance diagram for EwkMuLumiMonitorDQM:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
 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 edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

double acopCut_
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
edm::EDGetTokenT
< CaloTowerCollection
caloTowerToken_
 
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_
 
DQMStoretheDbe
 
MonitorElementTMass_
 
edm::EDGetTokenT
< reco::TrackCollection
trackToken_
 
edm::EDGetTokenT
< trigger::TriggerEvent
trigEvToken_
 
edm::InputTag trigTag_
 
edm::EDGetTokenT
< edm::TriggerResults
trigToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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)
 

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 33 of file EwkMuLumiMonitorDQM.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file EwkMuLumiMonitorDQM.cc.

References init_histograms(), isValidHltConfig_, cppFunctionSkipper::operator, DQMStore::setCurrentFolder(), and theDbe.

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

Member Function Documentation

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

number of prescale sets available

Implements edm::EDAnalyzer.

Definition at line 227 of file EwkMuLumiMonitorDQM.cc.

References acopCut_, beamSpotToken_, caloTowerToken_, reco::TrackBase::charge(), reco::LeafCandidate::charge(), reco::TrackBase::dxy(), dxyCut_, reco::TrackBase::eta(), eta(), reco::LeafCandidate::eta(), etaMuCut_, f, MonitorElement::Fill(), edm::Event::getByToken(), highMass1HLT_, highMass2HLT_, highMassGlbSta_, highMassGlbTrk_, highMassIsBothGlbTrkThanW_, highMassNotIso_, hltConfigProvider_, i, reco::Muon::innerTrack(), reco::Muon::isGlobalMuon(), IsMuMatchedToHLTMu(), isoCut03_, reco::Muon::isStandAloneMuon(), isW_, isZGlbSta_, isZGlbTrk_, isZGolden1HLT_, isZGolden2HLT_, isZGoldenNoIso_, j, gen::k, LogTrace, M_PI, mass1HLT_, mass2HLT_, massGlbSta_, massGlbTrk_, massIsBothGlbTrkThanW_, massNotIso_, maxDeltaR_, maxDPtRel_, CaloMET_cfi::met, metIncludesMuons_, metToken_, HLTConfigProvider::moduleLabels(), mtMax_, RPCpg::mu, muIso(), patZpeak::muons, muonToken_, n, n1hlt, n2hlt, nall, mergeVDriftHistosByStation::name, nEvWithHighPtMu, nGlbSta, nGlbTrk, nhlt, niso, nNotIso, nsel, nTMass, nW, dbtoconf::out, reco::TrackBase::p(), AlCaHLTBitMon_ParallelJobs::p, reco::LeafCandidate::p4(), reco::LeafCandidate::phi(), HLTConfigProvider::prescaleSize(), HLTConfigProvider::prescaleValue(), RecoTauCleanerPlugins::pt, reco::TrackBase::pt(), reco::LeafCandidate::pt(), ptMuCut_, reco::TrackBase::px(), reco::LeafCandidate::px(), reco::TrackBase::py(), reco::LeafCandidate::py(), reco::TrackBase::pz(), alignCSCRings::s, findQualityFiles::size, mathSSE::sqrt(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, tkIso(), TMass_, testEve_cfg::tracks, trackToken_, trigEvToken_, HLTConfigProvider::triggerIndex(), HLTConfigProvider::triggerNames(), triggerResults, trigToken_, funct::true, and findQualityFiles::v.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 110 of file EwkMuLumiMonitorDQM.cc.

110  {
111 
112 }
void EwkMuLumiMonitorDQM::beginRun ( const edm::Run r,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

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

85  {
86  nall = 0;
88  nInKinRange= 0;
89  nsel = 0;
90  niso = 0;
91  nhlt =0;
92  n1hlt =0;
93  n2hlt =0;
94  nNotIso =0;
95  nGlbSta =0;
96  nGlbTrk =0;
97  nTMass =0;
98  nW=0;
99 
100  // passed as parameter to HLTConfigProvider::init(), not yet used
101  bool isConfigChanged = false;
102 
103  // isValidHltConfig_ used to short-circuit analyze() in case of problems
104  isValidHltConfig_ = hltConfigProvider_.init( r, iSetup, trigTag_.process(), isConfigChanged );
105  //std::cout << "hlt config trigger is valid??" << isValidHltConfig_ << std::endl;
106 
107  }
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:46
HLTConfigProvider hltConfigProvider_
void EwkMuLumiMonitorDQM::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 209 of file EwkMuLumiMonitorDQM.cc.

209  {
210 }
void EwkMuLumiMonitorDQM::endRun ( const edm::Run r,
const edm::EventSetup  
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 212 of file EwkMuLumiMonitorDQM.cc.

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

212  {
213 
214  LogVerbatim("") << "\n>>>>>> Z/W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
215  LogVerbatim("") << "Total numer of events analyzed: " << nall << " [events]";
216  LogVerbatim("") << "Total numer of events selected: " << nsel << " [events]";
217 
218  LogVerbatim("") << "Passing HLT criteria: " << nhlt << " [events] " ;
219  LogVerbatim("") << "Passing 2 HLT match criteria: " << n2hlt << " [events] " ;
220  LogVerbatim("") << "Passing 1 HLT match criteria: " << n1hlt << " [events] " ;
221  LogVerbatim("") << "Passing Not Iso criteria: " << nNotIso << " [events] " ;
222  LogVerbatim("") << "Passing GlbSta criteria: " << nGlbSta << " [events] " ;
223  LogVerbatim("") << "Passing W criteria: " << nTMass << " [events] " ;
224  LogVerbatim("") << ">>>>>> Z/W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
225 }
void EwkMuLumiMonitorDQM::init_histograms ( )

Definition at line 114 of file EwkMuLumiMonitorDQM.cc.

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

Referenced by EwkMuLumiMonitorDQM().

114  {
115 
116  mass2HLT_ = theDbe->book1D("Z_2HLT_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
117  mass1HLT_ = theDbe->book1D("Z_1HLT_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
118  massNotIso_ = theDbe->book1D("Z_NOTISO_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
119  massGlbSta_ = theDbe->book1D("Z_GLBSTA_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
120  massGlbTrk_ = theDbe->book1D("Z_GLBTRK_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
121  massIsBothGlbTrkThanW_ = theDbe->book1D("Z_ISBOTHGLBTRKTHANW_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
122 
123  highMass2HLT_ = theDbe->book1D("Z_2HLT_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
124  highMass1HLT_ = theDbe->book1D("Z_1HLT_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
125  highMassNotIso_ = theDbe->book1D("Z_NOTISO_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
126  highMassGlbSta_ = theDbe->book1D("Z_GLBSTA_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
127  highMassGlbTrk_ = theDbe->book1D("Z_GLBTRK_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
128  highMassIsBothGlbTrkThanW_ = theDbe->book1D("Z_ISBOTHGLBTRKTHANW_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
129 
130  /*
131  highest_mupt2HLT_ = theDbe->book1D("HIGHEST_MU_PT_2HLT","Highest muon p_{t}[GeV/c]",200,0.,200.);
132  highest_mupt1HLT_ = theDbe->book1D("HIGHEST_MU_PT_1HLT","Highest muon p_{t}[GeV/c]",200,0.,200.);
133  highest_muptNotIso_ = theDbe->book1D("HIGHEST_MU_PT_NOTISO","Highest muon p_{t}[GeV/c]",200,0.,200.);
134  highest_muptGlbSta_ = theDbe->book1D("HIGHEST_MU_PT_GLBSTA","Highest muon p_{t}[GeV/c]",200,0.,200.);
135  highest_muptGlbTrk_ = theDbe->book1D("HIGHEST_MU_PT_GLBTRK","Highest muon p_{t}[GeV/c]",200,0.,200.);
136 
137  lowest_mupt2HLT_ = theDbe->book1D("LOWEST_MU_PT_2HLT","Lowest muon p_{t} [GeV/c]",200,0.,200.);
138  lowest_mupt1HLT_ = theDbe->book1D("LOWEST_MU_PT_1HLT","Lowest muon p_{t} [GeV/c]",200,0.,200.);
139  lowest_muptNotIso_ = theDbe->book1D("LOWEST_MU_PT_NOTISO","Lowest muon p_{t} [GeV/c]",200,0.,200.);
140  lowest_muptGlbSta_ = theDbe->book1D("LOWEST_MU_PT_GLBSTA","Lowest muon p_{t} [GeV/c]",200,0.,200.);
141  lowest_muptGlbTrk_ = theDbe->book1D("LOWEST_MU_PT_GLBTRK","Lowest muon p_{t} [GeV/c]",200,0.,200.);
142  */
143 
144  TMass_ = theDbe->book1D("TMASS","Transverse mass [GeV]",300,0.,300.);
145 
146 }
MonitorElement * highMass1HLT_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
MonitorElement * highMassIsBothGlbTrkThanW_
MonitorElement * highMassGlbTrk_
MonitorElement * massNotIso_
MonitorElement * highMassGlbSta_
MonitorElement * mass1HLT_
MonitorElement * massIsBothGlbTrkThanW_
MonitorElement * massGlbTrk_
MonitorElement * highMassNotIso_
MonitorElement * massGlbSta_
MonitorElement * TMass_
MonitorElement * mass2HLT_
MonitorElement * highMass2HLT_
bool EwkMuLumiMonitorDQM::IsMuMatchedToHLTMu ( const reco::Muon mu,
const std::vector< reco::Particle > &  HLTMu,
double  DR,
double  DPtRel 
)

Definition at line 195 of file EwkMuLumiMonitorDQM.cc.

References deltaR(), gen::k, RecoTauCleanerPlugins::pt, and reco::LeafCandidate::pt().

Referenced by analyze().

195  {
196  size_t dim = HLTMu.size();
197  size_t nPass=0;
198  if (dim==0) return false;
199  for (size_t k =0; k< dim; k++ ) {
200  if ( (deltaR(HLTMu[k], mu) < DR) && (fabs(HLTMu[k].pt() - mu.pt())/ HLTMu[k].pt()<DPtRel)){
201  nPass++ ;
202  }
203  }
204  return (nPass>0);
205 }
virtual float pt() const
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 150 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().

150  {
151  double isovar = mu.isolationR03().sumPt;
152  if (isCombinedIso_) {
153  isovar += mu.isolationR03().emEt;
154  isovar += mu.isolationR03().hadEt;
155  }
156  if (isRelativeIso_) isovar /= mu.pt();
157  return isovar;
158 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:9
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:7
virtual float pt() const
transverse momentum
float emEt
ecal sum-Et
Definition: MuonIsolation.h:8
const MuonIsolation & isolationR03() const
Definition: Muon.h:158
double EwkMuLumiMonitorDQM::tkIso ( const reco::Track tk,
edm::Handle< reco::TrackCollection tracks,
edm::Handle< CaloTowerCollection calotower 
)

Definition at line 160 of file EwkMuLumiMonitorDQM.cc.

References deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, HTMLExport::elem(), reco::TrackBase::eta(), 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().

160  {
161  double ptSum = 0;
162  for (size_t i=0; i< tracks->size(); ++i){
163  const reco::Track & elem = tracks->at(i);
164  double elemPt = elem.pt();
165  // same parameter used for muIsolation: dR [0.01, IsoCut03_], |dZ|<0.2, |d_r(xy)|<0.1
166  double elemVx = elem.vx();
167  double elemVy = elem.vy();
168  double elemD0 = sqrt( elemVx * elemVx + elemVy * elemVy );
169  if ( elemD0 > 0.2 ) continue;
170  double dz = fabs( elem.vz() - tk.vz());
171  if ( dz > 0.1) continue;
172  // evaluate only for tracks with pt>ptTreshold
173  if ( elemPt < ptThreshold_ ) continue;
174  double dR = deltaR( elem.eta(), elem.phi(), tk.eta(), tk.phi() );
175  // isolation in a cone with dR=0.3, and vetoing the track itself
176  if ( (dR < 0.01) || (dR > 0.3) ) continue;
177  ptSum += elemPt;
178  }
179  if (isCombinedIso_) {
180  // loop on clusters....
181  for (CaloTowerCollection::const_iterator it=calotower->begin(); it!=calotower->end();++it ){
182  double dR = deltaR( it->eta(), it->phi(),tk.outerEta(), tk.outerPhi() );
183  // veto value is 0.1 for towers....
184  if ( (dR < 0.1) || (dR > 0.3) ) continue;
185  ptSum += it->emEnergy();
186  ptSum += it->hadEnergy();
187  }
188  }
189  if (isRelativeIso_) ptSum /= tk.pt();
190  return ptSum;
191 }
int i
Definition: DBlmapReader.cc:9
std::vector< CaloTower >::const_iterator const_iterator
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:137
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:139
T sqrt(T t)
Definition: SSEVec.h:48
double pt() const
track transverse momentum
Definition: TrackBase.h:129
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:145
double outerEta() const
pseudorapidity of the momentum vector at the outermost hit position
Definition: Track.h:89
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:143
double outerPhi() const
azimuthal angle of the momentum vector at the outermost hit position
Definition: Track.h:87
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:141

Member Data Documentation

double EwkMuLumiMonitorDQM::acopCut_
private

Definition at line 76 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

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

Definition at line 52 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

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

Definition at line 55 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::deltaRTrk_
private

Definition at line 69 of file EwkMuLumiMonitorDQM.h.

double EwkMuLumiMonitorDQM::deltaRVetoTrk_
private

Definition at line 71 of file EwkMuLumiMonitorDQM.h.

double EwkMuLumiMonitorDQM::dxyCut_
private

Definition at line 77 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::etaMuCut_
private

Definition at line 63 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

MonitorElement* EwkMuLumiMonitorDQM::highMass1HLT_
private

Definition at line 91 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::highMass2HLT_
private

Definition at line 86 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassGlbSta_
private

Definition at line 101 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassGlbTrk_
private

Definition at line 106 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassIsBothGlbTrkThanW_
private

Definition at line 113 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::highMassNotIso_
private

Definition at line 96 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

HLTConfigProvider EwkMuLumiMonitorDQM::hltConfigProvider_
private

Definition at line 138 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and beginRun().

bool EwkMuLumiMonitorDQM::isCombinedIso_
private

Definition at line 66 of file EwkMuLumiMonitorDQM.h.

Referenced by muIso(), and tkIso().

double EwkMuLumiMonitorDQM::isoCut03_
private

Definition at line 67 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isRelativeIso_
private

Definition at line 65 of file EwkMuLumiMonitorDQM.h.

Referenced by muIso(), and tkIso().

bool EwkMuLumiMonitorDQM::isValidHltConfig_
private

Definition at line 137 of file EwkMuLumiMonitorDQM.h.

Referenced by beginRun(), and EwkMuLumiMonitorDQM().

bool EwkMuLumiMonitorDQM::isW_
private

Definition at line 135 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGlbSta_
private

Definition at line 133 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGlbTrk_
private

Definition at line 134 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGolden1HLT_
private

Definition at line 130 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGolden2HLT_
private

Definition at line 131 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::isZGoldenNoIso_
private

Definition at line 132 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

MonitorElement* EwkMuLumiMonitorDQM::mass1HLT_
private

Definition at line 90 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::mass2HLT_
private

Definition at line 85 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::massGlbSta_
private

Definition at line 100 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::massGlbTrk_
private

Definition at line 105 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::massIsBothGlbTrkThanW_
private

Definition at line 112 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::massNotIso_
private

Definition at line 95 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

double EwkMuLumiMonitorDQM::maxDeltaR_
private

Definition at line 73 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::maxDPtRel_
private

Definition at line 72 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

bool EwkMuLumiMonitorDQM::metIncludesMuons_
private

Definition at line 57 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

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

Definition at line 56 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::mtMax_
private

Definition at line 75 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::mtMin_
private

Definition at line 74 of file EwkMuLumiMonitorDQM.h.

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

Definition at line 53 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

unsigned int EwkMuLumiMonitorDQM::n1hlt
private

Definition at line 122 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::n2hlt
private

Definition at line 123 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nall
private

Definition at line 116 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nEvWithHighPtMu
private

Definition at line 117 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and beginRun().

unsigned int EwkMuLumiMonitorDQM::nGlbSta
private

Definition at line 125 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nGlbTrk
private

Definition at line 126 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and beginRun().

unsigned int EwkMuLumiMonitorDQM::nhlt
private

Definition at line 121 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nInKinRange
private

Definition at line 118 of file EwkMuLumiMonitorDQM.h.

Referenced by beginRun().

unsigned int EwkMuLumiMonitorDQM::niso
private

Definition at line 120 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and beginRun().

unsigned int EwkMuLumiMonitorDQM::nNotIso
private

Definition at line 124 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nsel
private

Definition at line 119 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nTMass
private

Definition at line 127 of file EwkMuLumiMonitorDQM.h.

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

unsigned int EwkMuLumiMonitorDQM::nW
private

Definition at line 128 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and beginRun().

double EwkMuLumiMonitorDQM::ptMuCut_
private

Definition at line 62 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

double EwkMuLumiMonitorDQM::ptThreshold_
private

Definition at line 70 of file EwkMuLumiMonitorDQM.h.

Referenced by tkIso().

DQMStore* EwkMuLumiMonitorDQM::theDbe
private

Definition at line 82 of file EwkMuLumiMonitorDQM.h.

Referenced by EwkMuLumiMonitorDQM(), and init_histograms().

MonitorElement* EwkMuLumiMonitorDQM::TMass_
private

Definition at line 110 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze(), and init_histograms().

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

Definition at line 54 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

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

Definition at line 51 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().

edm::InputTag EwkMuLumiMonitorDQM::trigTag_
private

Definition at line 49 of file EwkMuLumiMonitorDQM.h.

Referenced by beginRun().

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

Definition at line 50 of file EwkMuLumiMonitorDQM.h.

Referenced by analyze().