CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
WMuNuSelector Class Reference
Inheritance diagram for WMuNuSelector:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
void endJob () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 
void init_histograms ()
 
 WMuNuSelector (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

double acopCut_
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
double dxyCut_
 
double eJetMin_
 
double etaCut_
 
std::map< std::string, TH1D * > h1_
 
std::map< std::string, TH2D * > h2_
 
bool isAlsoTrackerMuon_
 
bool isCombinedIso_
 
double isoCut03_
 
bool isRelativeIso_
 
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
 
double metMax_
 
double metMin_
 
double mtMax_
 
double mtMin_
 
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
 
const std::string muonTrig_
 
double nacop
 
double nall
 
double ncharge
 
double nid
 
double niso
 
int nJetMax_
 
double nkin
 
double nmass
 
double normalizedChi2Cut_
 
double npresel
 
double nsel
 
double ntrig
 
bool plotHistograms_
 
double ptCut_
 
double ptThrForZ1_
 
double ptThrForZ2_
 
int selectByCharge_
 
int trackerHitsCut_
 
edm::EDGetTokenT< edm::TriggerResultstrigToken_
 
edm::EDGetTokenT< reco::WMuNuCandidateCollectionWMuNuCollectionToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter 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::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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

Definition at line 35 of file WMuNuSelector.cc.

Constructor & Destructor Documentation

WMuNuSelector::WMuNuSelector ( const edm::ParameterSet cfg)

Definition at line 105 of file WMuNuSelector.cc.

105  :
106  // Fast selection (no histograms)
107  plotHistograms_(cfg.getUntrackedParameter<bool> ("plotHistograms", true)),
108 
109  // Input collections
110  trigToken_(consumes<TriggerResults>(cfg.getUntrackedParameter<edm::InputTag> ("TrigTag", edm::InputTag("TriggerResults::HLT")))),
112  jetToken_(consumes<View<Jet> >(cfg.getUntrackedParameter<edm::InputTag> ("JetTag", edm::InputTag("sisCone5CaloJets")))),
113  beamSpotToken_(consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"))),
114  WMuNuCollectionToken_(consumes<reco::WMuNuCandidateCollection>(cfg.getUntrackedParameter<edm::InputTag> ("WMuNuCollectionTag", edm::InputTag("WMuNus")))),
115 
116 
117  // Preselection cuts
118  muonTrig_(cfg.getUntrackedParameter<std::string>("MuonTrig", "HLT_Mu9")),
119  ptThrForZ1_(cfg.getUntrackedParameter<double>("PtThrForZ1", 20.)),
120  ptThrForZ2_(cfg.getUntrackedParameter<double>("PtThrForZ2", 10.)),
121  eJetMin_(cfg.getUntrackedParameter<double>("EJetMin", 999999.)),
122  nJetMax_(cfg.getUntrackedParameter<int>("NJetMax", 999999)),
123 
124 
125  // Main cuts
126  ptCut_(cfg.getUntrackedParameter<double>("PtCut", 25.)),
127  etaCut_(cfg.getUntrackedParameter<double>("EtaCut", 2.1)),
128  isRelativeIso_(cfg.getUntrackedParameter<bool>("IsRelativeIso", true)),
129  isCombinedIso_(cfg.getUntrackedParameter<bool>("IsCombinedIso", false)),
130  isoCut03_(cfg.getUntrackedParameter<double>("IsoCut03", 0.1)),
131  mtMin_(cfg.getUntrackedParameter<double>("MtMin", 50.)),
132  mtMax_(cfg.getUntrackedParameter<double>("MtMax", 200.)),
133  metMin_(cfg.getUntrackedParameter<double>("MetMin", -999999.)),
134  metMax_(cfg.getUntrackedParameter<double>("MetMax", 999999.)),
135  acopCut_(cfg.getUntrackedParameter<double>("AcopCut", 2.)),
136 
137  // Muon quality cuts
138  dxyCut_(cfg.getUntrackedParameter<double>("DxyCut", 0.2)),
139  normalizedChi2Cut_(cfg.getUntrackedParameter<double>("NormalizedChi2Cut", 10.)),
140  trackerHitsCut_(cfg.getUntrackedParameter<int>("TrackerHitsCut", 11)),
141  isAlsoTrackerMuon_(cfg.getUntrackedParameter<bool>("IsAlsoTrackerMuon", true)),
142 
143  // W+/W- Selection
144  selectByCharge_(cfg.getUntrackedParameter<int>("SelectByCharge", 0))
145 {
146 }
T getUntrackedParameter(std::string const &, T const &) const
const std::string muonTrig_
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
edm::EDGetTokenT< edm::TriggerResults > trigToken_
bool isAlsoTrackerMuon_
double ptThrForZ1_
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::EDGetTokenT< reco::WMuNuCandidateCollection > WMuNuCollectionToken_
double ptThrForZ2_
double normalizedChi2Cut_

Member Function Documentation

void WMuNuSelector::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDFilter.

Definition at line 148 of file WMuNuSelector.cc.

References h1_, h2_, M_PI, TFileService::make(), nacop, nall, ncharge, nid, niso, nkin, npresel, nsel, ntrig, and plotHistograms_.

148  {
149  nall = 0;
150  ntrig=0;
151  npresel=0;
152  ncharge = 0;
153  nkin=0;
154  nid=0;
155  nacop=0;
156  niso=0;
157  nsel = 0;
158 
159  if(plotHistograms_){
161  h1_["hNWCand_sel"] =fs->make<TH1D>("NWCand_sel","Nb. of WCandidates passing pre-selection (ordered by pt)",10,0.,10.);
162  h1_["hPtMu_sel"] =fs->make<TH1D>("ptMu_sel","Pt mu",100,0.,100.);
163  h1_["hEtaMu_sel"] =fs->make<TH1D>("etaMu_sel","Eta mu",50,-2.5,2.5);
164  h1_["hd0_sel"] =fs->make<TH1D>("d0_sel","Impact parameter",1000,-1.,1.);
165  h1_["hNHits_sel"] =fs->make<TH1D>("NumberOfValidHits_sel","Number of Hits in Silicon",100,0.,100.);
166  h1_["hNormChi2_sel"] =fs->make<TH1D>("NormChi2_sel","Chi2/ndof of global track",1000,0.,50.);
167  h1_["hTracker_sel"] =fs->make<TH1D>("isTrackerMuon_sel","is Tracker Muon?",2,0.,2.);
168  h1_["hMET_sel"] =fs->make<TH1D>("MET_sel","Missing Transverse Energy (GeV)", 300,0.,300.);
169  h1_["hTMass_sel"] =fs->make<TH1D>("TMass_sel","Rec. Transverse Mass (GeV)",300,0.,300.);
170  h1_["hAcop_sel"] =fs->make<TH1D>("Acop_sel","Mu-MET acoplanarity",50,0.,M_PI);
171  h1_["hPtSum_sel"] =fs->make<TH1D>("ptSum_sel","Track Isolation, Sum pT (GeV)",200,0.,100.);
172  h1_["hPtSumN_sel"] =fs->make<TH1D>("ptSumN_sel","Track Isolation, Sum pT/pT",1000,0.,10.);
173  h1_["hCal_sel"] =fs->make<TH1D>("Cal_sel","Calorimetric isolation, HCAL+ECAL (GeV)",200,0.,100.);
174  h1_["hIsoTotN_sel"] =fs->make<TH1D>("isoTotN_sel","(Sum pT + Cal)/pT",1000,0.,10.);
175  h1_["hIsoTot_sel"] =fs->make<TH1D>("isoTot_sel","(Sum pT + Cal)",200,0.,100.);
176  h2_["hTMass_PtSum_inclusive"] =fs->make<TH2D>("TMass_PtSum_inclusive","Rec. Transverse Mass (GeV) vs Sum pT (GeV)",200,0.,100.,300,0.,300.);
177  h2_["hTMass_PtSumNorm_inclusive"] =fs->make<TH2D>("TMass_PtSumNorm_inclusive","Rec. Transverse Mass (GeV) vs Sum Pt / Pt", 1000,0,10,300,0,300);
178  h2_["hTMass_TotIsoNorm_inclusive"]=fs->make<TH2D>("TMass_TotIsoNorm_inclusive","Rec. Transverse Mass (GeV) vs (Sum Pt + Cal)/Pt", 10000,0,10,200,0,200);
179  h2_["hMET_PtSum_inclusive"] =fs->make<TH2D>("MET_PtSum_inclusive","Missing Transverse Energy (GeV) vs Sum Pt (GeV)",200,0.,100.,300,0.,300.);
180  h2_["hMET_PtSumNorm_inclusive"] =fs->make<TH2D>("MET_PtSumNorm_inclusive","Missing Transverse Energy (GeV) vs Sum Pt/Pt",1000,0,10,300,0,300);
181  h2_["hMET_TotIsoNorm_inclusive"]=fs->make<TH2D>("MET_TotIsoNorm_inclusive","Missing Transverse Energy (GeV) vs (SumPt + Cal)/Pt",10000,0,10,200,0,200);
182  }
183 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::map< std::string, TH1D * > h1_
#define M_PI
std::map< std::string, TH2D * > h2_
void WMuNuSelector::endJob ( void  )
overridevirtual

Reimplemented from edm::EDFilter.

Definition at line 186 of file WMuNuSelector.cc.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor::all(), runTauDisplay::eid, nacop, nall, ncharge, nid, niso, nkin, npresel, nsel, ntrig, selectByCharge_, and mathSSE::sqrt().

186  {
187  double all = nall;
188  double epresel = npresel/all;
189  double etrig = ntrig/all;
190  double ekin = nkin/all;
191  double eid = nid/all;
192  double eacop = nacop/all;
193  double eiso = niso/all;
194  double esel = nsel/all;
195 
196  LogVerbatim("") << "\n>>>>>> W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
197  LogVerbatim("") << "Total number of events analyzed: " << nall << " [events]";
198  LogVerbatim("") << "Total number of events triggered: " << ntrig << " [events]";
199  LogVerbatim("") << "Total number of events pre-selected: " << npresel << " [events]";
200  LogVerbatim("") << "Total number of events after kinematic cuts: " << nkin << " [events]";
201  LogVerbatim("") << "Total number of events after Muon ID cuts: " << nid << " [events]";
202  LogVerbatim("") << "Total number of events after Acop cut: " << nacop << " [events]";
203  LogVerbatim("") << "Total number of events after iso cut: " << niso << " [events]";
204  LogVerbatim("") << "Total number of events selected: " << nsel << " [events]";
205  LogVerbatim("") << "Efficiencies:";
206  LogVerbatim("") << "Trigger Efficiency: " << "(" << setprecision(4) << etrig*100. <<" +/- "<< setprecision(2) << sqrt(etrig*(1-etrig)/all)*100. << ")%";
207  LogVerbatim("") << "Pre-Selection Efficiency: " << "(" << setprecision(4) << epresel*100. <<" +/- "<< setprecision(2) << sqrt(epresel*(1-epresel)/all)*100. << ")%";
208  LogVerbatim("") << "Pt, Eta Selection Efficiency: " << "(" << setprecision(4) << ekin*100. <<" +/- "<< setprecision(2) << sqrt(ekin*(1-ekin)/all)*100. << ")%";
209  LogVerbatim("") << "MuonID Efficiency: " << "(" << setprecision(4) << eid*100. <<" +/- "<< setprecision(2) << sqrt(eid*(1-eid)/all)*100. << ")%";
210  LogVerbatim("") << "Acop Efficiency: " << "(" << setprecision(4) << eacop*100. <<" +/- "<< setprecision(2) << sqrt(eacop*(1-eacop)/all)*100. << ")%";
211  LogVerbatim("") << "Iso Efficiency: " << "(" << setprecision(4) << eiso*100. <<" +/- "<< setprecision(2) << sqrt(eiso*(1-eiso)/all)*100. << ")%";
212  LogVerbatim("") << "Selection Efficiency: " << "(" << setprecision(4) << esel*100. <<" +/- "<< setprecision(2) << sqrt(esel*(1-esel)/nall)*100. << ")%";
213 
214  if ( fabs(selectByCharge_)==1 ){
215  esel = nsel/ncharge;
216  LogVerbatim("") << "\n>>>>>> W+(-) SELECTION >>>>>>>>>>>>>>>";
217  LogVerbatim("") << "Total number of W+(-) events pre-selected: " << ncharge << " [events]";
218  LogVerbatim("") << "Total number of events selected: " << nsel << " [events]";
219  LogVerbatim("") << "Selection Efficiency only W+(-): " << "(" << setprecision(4) << esel*100. <<" +/- "<< setprecision(2) << sqrt(esel*(1-esel)/ncharge)*100. << ")%";
220  }
221  LogVerbatim("") << ">>>>>> W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
222 }
T sqrt(T t)
Definition: SSEVec.h:18
bool WMuNuSelector::filter ( edm::Event ev,
const edm::EventSetup  
)
override

Definition at line 224 of file WMuNuSelector.cc.

References edm::HLTGlobalStatus::accept(), reco::WMuNuCandidate::acop(), acopCut_, beamSpotToken_, reco::LeafCandidate::charge(), DEFINE_FWK_MODULE, PVValHelper::dxy, eJetMin_, reco::MuonIsolation::emEt, reco::WMuNuCandidate::eT(), reco::LeafCandidate::et(), PVValHelper::eta, reco::LeafCandidate::eta(), etaCut_, edm::Event::getByToken(), reco::WMuNuCandidate::getMuon(), reco::WMuNuCandidate::getNeutrino(), muon::GlobalMuonPromptTight, reco::Muon::globalTrack(), h1_, h2_, reco::MuonIsolation::hadEt, mps_fire::i, isCombinedIso_, reco::Muon::isGlobalMuon(), muon::isGoodMuon(), isoCut03_, reco::Muon::isolationR03(), isRelativeIso_, reco::Muon::isTrackerMuon(), metsig::jet, jetToken_, LogTrace, reco::WMuNuCandidate::massT(), RazorAnalyzer::met, metMax_, mtMax_, RPCpg::mu, HiRecoMuon_cff::muonCollection, muonToken_, muonTrig_, nacop, nall, ncharge, nid, niso, nJetMax_, nkin, normalizedChi2Cut_, npresel, nsel, ntrig, plotHistograms_, reco::BeamSpot::position(), EnergyCorrector::pt, reco::LeafCandidate::pt(), ptCut_, ptThrForZ1_, ptThrForZ2_, reco::LeafCandidate::px(), reco::LeafCandidate::py(), selectByCharge_, reco::MuonIsolation::sumPt, trackerHitsCut_, edm::TriggerNames::triggerIndex(), edm::Event::triggerNames(), triggerResults, trigToken_, and WMuNuCollectionToken_.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

224  {
225  nall++;
226 
227  // Repeat Pre-Selection Cuts just in case...
228  // Muon collection
230  if (!ev.getByToken(muonToken_, muonCollection)) {
231  LogError("") << ">>> Muon collection does not exist !!!";
232  return false;
233  }
234  unsigned int muonCollectionSize = muonCollection->size();
235 
236  // Trigger
238  if (!ev.getByToken(trigToken_, triggerResults)) {
239  LogError("") << ">>> TRIGGER collection does not exist !!!";
240  return false;
241  }
242  const edm::TriggerNames & triggerNames = ev.triggerNames(*triggerResults);
243  bool trigger_fired = false;
244  int itrig1 = triggerNames.triggerIndex(muonTrig_);
245  if (triggerResults->accept(itrig1)) trigger_fired = true;
246  LogTrace("") << ">>> Trigger bit: " << trigger_fired << " (" << muonTrig_ << ")";
247 
248  // Loop to reject/control Z->mumu is done separately
249  unsigned int nmuonsForZ1 = 0;
250  unsigned int nmuonsForZ2 = 0;
251  for (unsigned int i=0; i<muonCollectionSize; i++) {
252  const Muon& mu = muonCollection->at(i);
253  if (!mu.isGlobalMuon()) continue;
254  double pt = mu.pt();
255  if (pt>ptThrForZ1_) nmuonsForZ1++;
256  if (pt>ptThrForZ2_) nmuonsForZ2++;
257  }
258  LogTrace("") << "> Z rejection: muons above " << ptThrForZ1_ << " [GeV]: " << nmuonsForZ1;
259  LogTrace("") << "> Z rejection: muons above " << ptThrForZ2_ << " [GeV]: " << nmuonsForZ2;
260 
261  // Jet collection
262  Handle<View<Jet> > jetCollection;
263  if (!ev.getByToken(jetToken_, jetCollection)) {
264  LogError("") << ">>> JET collection does not exist !!!";
265  return false;
266  }
267  unsigned int jetCollectionSize = jetCollection->size();
268  int njets = 0;
269  for (unsigned int i=0; i<jetCollectionSize; i++) {
270  const Jet& jet = jetCollection->at(i);
271  if (jet.et()>eJetMin_) njets++;
272  }
273  LogTrace("") << ">>> Total number of jets: " << jetCollectionSize;
274  LogTrace("") << ">>> Number of jets above " << eJetMin_ << " [GeV]: " << njets;
275 
276 
277  // Beam spot
278  Handle<reco::BeamSpot> beamSpotHandle;
279  if (!ev.getByToken(beamSpotToken_, beamSpotHandle)) {
280  LogTrace("") << ">>> No beam spot found !!!";
281  return false;
282  }
283 
284 
285 
286  // Get WMuNu candidates from file:
287 
289  if (!ev.getByToken(WMuNuCollectionToken_,WMuNuCollection) ) {
290  LogTrace("") << ">>> WMuNu not found !!!";
291  return false;
292  }
293 
294  if(WMuNuCollection->empty()) {LogTrace("")<<"No WMuNu Candidates in the Event!"; return false;}
295  if(WMuNuCollection->size() > 1) {LogTrace("")<<"This event contains more than one W Candidate";}
296 
297  // W->mu nu selection criteria
298 
299  LogTrace("") << "> WMuNu Candidate with: ";
300  const WMuNuCandidate& WMuNu = WMuNuCollection->at(0);
301  // WMuNuCandidates are ordered by Pt!
302  // The Inclusive Selection WMuNu Candidate is the first one
303 
304  const reco::Muon & mu = WMuNu.getMuon();
305  const reco::MET & met =WMuNu.getNeutrino();
306  if(plotHistograms_){
307  h1_["hNWCand_sel"]->Fill(WMuNuCollection->size());
308  }
309 
310 
311  // Preselection cuts:
312 
313  if (!trigger_fired) {LogTrace("")<<"Event did not fire the Trigger"; return false;}
314  ntrig++;
315 
316  if (nmuonsForZ1>=1 && nmuonsForZ2>=2) {LogTrace("")<<"Z Candidate!!"; return false;}
317  if (njets>nJetMax_) {LogTrace("")<<"NJets > threshold"; return false;}
318 
319  npresel++;
320 
321  // Select Ws by charge:
322 
323  if (selectByCharge_*WMuNu.charge()==-1){ ncharge++;}
324 
325 
326  // W->mu nu selection criteria
327 
328  if (!mu.isGlobalMuon()) return false;
329 
330  reco::TrackRef gm = mu.globalTrack();
331  //reco::TrackRef tk = mu.innerTrack();
332 
333  // Pt,eta cuts
334  double pt = mu.pt();
335  double eta = mu.eta();
336  LogTrace("") << "\t... Muon pt, eta: " << pt << " [GeV], " << eta;
337  if(plotHistograms_){ h1_["hPtMu_sel"]->Fill(pt);}
338  if (pt<ptCut_) return false;
339  if(plotHistograms_){ h1_["hEtaMu_sel"]->Fill(eta);}
340  if (fabs(eta)>etaCut_) return false;
341 
342  nkin++;
343 
344 
345  // d0, chi2, nhits quality cuts
346  double dxy = gm->dxy(beamSpotHandle->position());
347  double normalizedChi2 = gm->normalizedChi2(); LogTrace("")<<"Im here"<<endl;
348  double trackerHits = gm->hitPattern().numberOfValidTrackerHits();
349  LogTrace("") << "\t... Muon dxy, normalizedChi2, trackerHits, isTrackerMuon?: " << dxy << " [cm], "<<normalizedChi2 << ", "<<trackerHits << ", " << mu.isTrackerMuon();
350 
351  if(plotHistograms_){ h1_["hd0_sel"]->Fill(dxy);}
352  if (!muon::isGoodMuon(mu,muon::GlobalMuonPromptTight) ) return false;
353  if(plotHistograms_){ h1_["hNormChi2_sel"]->Fill(normalizedChi2);}
354  if (normalizedChi2>normalizedChi2Cut_) return false;
355  if(plotHistograms_){ h1_["hNHits_sel"]->Fill(trackerHits);}
356  if (trackerHits<trackerHitsCut_) return false;
357  if(plotHistograms_){ h1_["hTracker_sel"]->Fill(mu.isTrackerMuon());}
358  if (!mu.isTrackerMuon()) return false;
359 
360  nid++;
361 
362  // Acoplanarity cuts
363  double acop = WMuNu.acop();
364  LogTrace("") << "\t... acoplanarity: " << acop;
365 
366  // Isolation cuts
367  double SumPt = mu.isolationR03().sumPt; double isovar=SumPt;
368  double Cal = mu.isolationR03().emEt + mu.isolationR03().hadEt; if(isCombinedIso_)isovar+=Cal;
369  if(plotHistograms_){
370  h1_["hPtSum_sel"]->Fill(SumPt);
371  h1_["hPtSumN_sel"]->Fill(SumPt/pt);
372  h1_["hCal_sel"]->Fill(Cal);
373  h1_["hIsoTot_sel"]->Fill( (SumPt+Cal));
374  h1_["hIsoTotN_sel"]->Fill( (SumPt+Cal) / pt );
375  }
376 
377  if (isRelativeIso_) isovar /= pt;
378  bool iso = (isovar<=isoCut03_);
379  LogTrace("") << "\t... isolation value" << isovar <<", isolated? " <<iso ;
380 
381  double met_et = met.pt();
382  LogTrace("") << "\t... Met pt: "<<WMuNu.getNeutrino().pt()<<"[GeV]";
383 
384 
385  double massT = WMuNu.massT();
386  double w_et = WMuNu.eT();
387 
388  LogTrace("") << "\t... W mass, W_et, W_px, W_py: " << massT << ", " << w_et << ", " << WMuNu.px() << ", " << WMuNu.py() << " [GeV]";
389 
390 
391  // Plot 2D Histograms before final cuts
392  if(plotHistograms_ && acop<acopCut_){
393  h2_["hTMass_PtSum_inclusive"]->Fill(SumPt,massT);
394  h2_["hTMass_PtSumNorm_inclusive"]->Fill(SumPt/pt,massT);
395  h2_["hTMass_TotIsoNorm_inclusive"]->Fill((SumPt+Cal)/pt,massT);
396  h2_["hMET_PtSum_inclusive"]->Fill(SumPt,met_et);
397  h2_["hMET_PtSumNorm_inclusive"]->Fill(SumPt/pt,met_et);
398  h2_["hMET_TotIsoNorm_inclusive"]->Fill((SumPt+Cal)/pt,met_et);
399  }
400 
401  if (!iso) return false;
402 
403  niso++;
404 
405  if(plotHistograms_){ h1_["hAcop_sel"]->Fill(acop);}
406  if (acop>=acopCut_) return false;
407 
408  nacop++;
409 
410  if(plotHistograms_){
411  h1_["hMET_sel"]->Fill(met_et);
412  h1_["hTMass_sel"]->Fill(massT);
413  }
414 
415 
416  if (massT<=mtMin_ || massT>=mtMax_) return false;
417  if (met_et<=metMin_ || met_et>=metMax_) return false;
418 
419  LogTrace("") << ">>>> Event ACCEPTED";
420  nsel++;
421 
422 
423  // (To be continued ;-) )
424 
425  return true;
426 }
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:9
const std::string muonTrig_
double eta() const final
momentum pseudorapidity
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:7
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< edm::TriggerResults > trigToken_
double px() const final
x coordinate of momentum vector
bool accept() const
Has at least one path accepted the event?
double pt() const final
transverse momentum
int charge() const final
electric charge
Definition: LeafCandidate.h:91
double ptThrForZ1_
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
bool isTrackerMuon() const override
Definition: Muon.h:277
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
Definition: Muon.py:1
Definition: Jet.py:1
double et() const final
transverse energy
bool isGlobalMuon() const override
Definition: Muon.h:276
Definition: MET.h:42
double eT() const
float emEt
ecal sum-Et
Definition: MuonIsolation.h:8
double acop() const
const int mu
Definition: Constants.h:22
static std::string const triggerResults
Definition: EdmProvDump.cc:41
std::map< std::string, TH1D * > h1_
#define LogTrace(id)
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
met
===> hadronic RAZOR
double py() const final
y coordinate of momentum vector
double massT() const
edm::EDGetTokenT< reco::WMuNuCandidateCollection > WMuNuCollectionToken_
std::map< std::string, TH2D * > h2_
double ptThrForZ2_
const Point & position() const
position
Definition: BeamSpot.h:62
double normalizedChi2Cut_
const reco::Muon & getMuon() const
const reco::MET & getNeutrino() const
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
const MuonIsolation & isolationR03() const
Definition: Muon.h:162
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:54
void WMuNuSelector::init_histograms ( )

Member Data Documentation

double WMuNuSelector::acopCut_
private

Definition at line 63 of file WMuNuSelector.cc.

Referenced by filter().

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

Definition at line 47 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::dxyCut_
private

Definition at line 65 of file WMuNuSelector.cc.

double WMuNuSelector::eJetMin_
private

Definition at line 52 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::etaCut_
private

Definition at line 55 of file WMuNuSelector.cc.

Referenced by filter().

std::map<std::string,TH1D*> WMuNuSelector::h1_
private

Definition at line 80 of file WMuNuSelector.cc.

Referenced by beginJob(), and filter().

std::map<std::string,TH2D*> WMuNuSelector::h2_
private

Definition at line 81 of file WMuNuSelector.cc.

Referenced by beginJob(), and filter().

bool WMuNuSelector::isAlsoTrackerMuon_
private

Definition at line 68 of file WMuNuSelector.cc.

bool WMuNuSelector::isCombinedIso_
private

Definition at line 57 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::isoCut03_
private

Definition at line 58 of file WMuNuSelector.cc.

Referenced by filter().

bool WMuNuSelector::isRelativeIso_
private

Definition at line 56 of file WMuNuSelector.cc.

Referenced by filter().

edm::EDGetTokenT<edm::View<reco::Jet> > WMuNuSelector::jetToken_
private

Definition at line 46 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::metMax_
private

Definition at line 62 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::metMin_
private

Definition at line 61 of file WMuNuSelector.cc.

double WMuNuSelector::mtMax_
private

Definition at line 60 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::mtMin_
private

Definition at line 59 of file WMuNuSelector.cc.

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

Definition at line 45 of file WMuNuSelector.cc.

Referenced by filter().

const std::string WMuNuSelector::muonTrig_
private

Definition at line 49 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::nacop
private

Definition at line 76 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

double WMuNuSelector::nall
private

Definition at line 72 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

double WMuNuSelector::ncharge
private

Definition at line 75 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

double WMuNuSelector::nid
private

Definition at line 76 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

double WMuNuSelector::niso
private

Definition at line 76 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

int WMuNuSelector::nJetMax_
private

Definition at line 53 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::nkin
private

Definition at line 76 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

double WMuNuSelector::nmass
private

Definition at line 76 of file WMuNuSelector.cc.

double WMuNuSelector::normalizedChi2Cut_
private

Definition at line 66 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::npresel
private

Definition at line 73 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

double WMuNuSelector::nsel
private

Definition at line 74 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

double WMuNuSelector::ntrig
private

Definition at line 73 of file WMuNuSelector.cc.

Referenced by beginJob(), endJob(), and filter().

bool WMuNuSelector::plotHistograms_
private

Definition at line 43 of file WMuNuSelector.cc.

Referenced by beginJob(), and filter().

double WMuNuSelector::ptCut_
private
double WMuNuSelector::ptThrForZ1_
private

Definition at line 50 of file WMuNuSelector.cc.

Referenced by filter().

double WMuNuSelector::ptThrForZ2_
private

Definition at line 51 of file WMuNuSelector.cc.

Referenced by filter().

int WMuNuSelector::selectByCharge_
private

Definition at line 70 of file WMuNuSelector.cc.

Referenced by endJob(), and filter().

int WMuNuSelector::trackerHitsCut_
private

Definition at line 67 of file WMuNuSelector.cc.

Referenced by filter().

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

Definition at line 44 of file WMuNuSelector.cc.

Referenced by filter().

edm::EDGetTokenT<reco::WMuNuCandidateCollection> WMuNuSelector::WMuNuCollectionToken_
private

Definition at line 48 of file WMuNuSelector.cc.

Referenced by filter().