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
HLTHiggsTruth Class Reference

#include <HLTHiggsTruth.h>

Public Member Functions

void analyzeA2mu (const reco::CandidateView &mctruth, TTree *tree)
 
void analyzeH2tau (const reco::CandidateView &mctruth, TTree *tree)
 
void analyzeHgg (const reco::CandidateView &mctruth, const reco::PhotonCollection &photonHandle, TTree *tree)
 
void analyzeHinv (const reco::CandidateView &mctruth, TTree *tree)
 
void analyzeHtaunu (const reco::CandidateView &mctruth, TTree *tree)
 
void analyzeHWW2l (const reco::CandidateView &mctruth, const reco::CaloMETCollection &caloMet, const reco::TrackCollection &Tracks, const reco::MuonCollection &muonHandle, const reco::GsfElectronCollection &electronHandle, TTree *tree)
 
void analyzeHZZ4l (const reco::CandidateView &mctruth, const reco::MuonCollection &muonHandle, const reco::GsfElectronCollection &electronHandle, TTree *tree)
 
bool decision () const
 
bool decision_reco () const
 
bool ElecChannel_recoacc () const
 
bool ElecMuChannel_recoacc () const
 
reco::GsfElectron electron1_ () const
 
reco::GsfElectron electron2_ () const
 
reco::GsfElectron electron3_ () const
 
reco::GsfElectron electron4_ () const
 
double etaElectron1 () const
 
double etaElectron2 () const
 
double etaMuon1 () const
 
double etaMuon2 () const
 
double etaTau1 () const
 
 HLTHiggsTruth ()
 
void LeptonicTauDecay (const reco::Candidate &tau, bool &elecdec, bool &muondec)
 
double met_hwwdiel () const
 
double met_hwwdimu () const
 
double met_hwwemu () const
 
reco::Muon muon1_ () const
 
reco::Muon muon2_ () const
 
reco::Muon muon3_ () const
 
reco::Muon muon4_ () const
 
bool MuonChannel_recoacc () const
 
reco::Photon photon1_ () const
 
reco::Photon photon2_ () const
 
bool PhotonChannel_acc () const
 
bool PhotonChannel_recoacc () const
 
double ptElectron1 () const
 
double ptElectron2 () const
 
double ptMuon1 () const
 
double ptMuon2 () const
 
double ptTau1 () const
 
void setup (const edm::ParameterSet &pSet, TTree *tree)
 
bool TauChannel_acc () const
 
bool TauChannel_recoacc () const
 

Private Attributes

bool _Debug
 
bool _Monte
 
reco::GsfElectron Electron1
 
reco::GsfElectron Electron2
 
reco::GsfElectron Electron3
 
reco::GsfElectron Electron4
 
double EtaElFromTau
 
double etaElMax
 
double etaElMin
 
double EtaMuFromTau
 
double etaMuMax
 
double etaMuMin
 
double etaPhMax
 
double etaPhMin
 
double etaTauMax
 
bool isElecDecay_recoacc
 
bool isEMuDecay_recoacc
 
bool isMuonDecay_recoacc
 
bool isPhotonDecay_acc
 
bool isPhotonDecay_recoacc
 
bool isTauDecay
 
bool isTauDecay_acc
 
bool isTauDecay_recoacc
 
bool isvisible
 
bool isvisible_reco
 
double met_hwwdiel_
 
double met_hwwdimu_
 
double met_hwwemu_
 
reco::Muon Muon1
 
reco::Muon Muon2
 
reco::Muon Muon3
 
reco::Muon Muon4
 
reco::Photon Photon1
 
reco::Photon Photon2
 
double PtElFromTau
 
double ptElMax
 
double ptElMin
 
double PtMuFromTau
 
double ptMuMax
 
double ptMuMin
 
double ptTauMax
 

Detailed Description

$Date: November 2006 $Revision:

Author
P. Bargassa - Rice U.

Definition at line 56 of file HLTHiggsTruth.h.

Constructor & Destructor Documentation

HLTHiggsTruth::HLTHiggsTruth ( )

Definition at line 14 of file HLTHiggsTruth.cc.

References _Debug, _Monte, isElecDecay_recoacc, isEMuDecay_recoacc, isMuonDecay_recoacc, isPhotonDecay_acc, isPhotonDecay_recoacc, isTauDecay_acc, isTauDecay_recoacc, isvisible, and isvisible_reco.

14  {
15 
16  //set parameter defaults
17  _Monte=false;
18  _Debug=false;
19  isvisible=false;
20  // isMuonDecay=false;
21  // isElecDecay=false;
22  //isEMuDecay=false;
23  // isPhotonDecay=false;
24 // isMuonDecay_acc=false;
25  // isElecDecay_acc=false;
26  // isEMuDecay_acc=false;
27  isPhotonDecay_acc=false;
28  isTauDecay_acc =false;
29  isMuonDecay_recoacc=false;
30  isElecDecay_recoacc=false;
31  isEMuDecay_recoacc=false;
33  isTauDecay_recoacc =false;
34  isvisible_reco= false;
35 
36 
37 
38 }
bool isPhotonDecay_acc
bool isTauDecay_recoacc
bool isEMuDecay_recoacc
bool isPhotonDecay_recoacc
bool isMuonDecay_recoacc
bool isElecDecay_recoacc

Member Function Documentation

void HLTHiggsTruth::analyzeA2mu ( const reco::CandidateView mctruth,
TTree *  tree 
)

Definition at line 418 of file HLTHiggsTruth.cc.

References _Monte, abs, gather_cfg::cout, reco::Candidate::eta(), i, isvisible, L1TEmulatorMonitor_cff::p, reco::Candidate::pdgId(), evf::utils::pid, reco::Candidate::pt(), edm::View< T >::size(), reco::Candidate::status(), and ntuplemaker::status.

418  {
419  if (_Monte) {
420  int nmuons=0;
421  if (&mctruth){
422  for (size_t i = 0; i < mctruth.size(); ++ i) {
423  const reco::Candidate & p = (mctruth)[i];
424  int status = p.status();
425  if (status==1) {
426  int pid=p.pdgId();
427  bool ismuon = std::abs(pid)==13;
428  bool inacceptance = (std::abs(p.eta()) < 2.4);
429  bool aboveptcut = (p.pt() > 3.0);
430  if (inacceptance && aboveptcut && ismuon) {
431  if (nmuons==0) {
432  nmuons=int(pid/std::abs(pid));
433  } else if (pid<0 && nmuons==1) {
434  nmuons=2;
435  } else if (pid>0 && nmuons==-1) {
436  nmuons=2;
437  }
438  }
439  }
440  }
441  // request 2 opposite charge muons
442  isvisible = nmuons==2;
443  }
444  else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
445 // std::cout << "nmuons = " << nmuons << " " << isvisible_2mu << std::endl;
446  }
447 }
int i
Definition: DBlmapReader.cc:9
virtual double pt() const =0
transverse momentum
virtual int status() const =0
status word
#define abs(x)
Definition: mlp_lapack.h:159
virtual int pdgId() const =0
PDG identifier.
size_type size() const
tuple cout
Definition: gather_cfg.py:41
tuple status
Definition: ntuplemaker.py:245
virtual double eta() const =0
momentum pseudorapidity
void HLTHiggsTruth::analyzeH2tau ( const reco::CandidateView mctruth,
TTree *  tree 
)

semileptonic decay study H->2tau, tau->mu & tau->had

H->2tau, tau->el & tau->had

Definition at line 450 of file HLTHiggsTruth.cc.

References _Monte, gather_cfg::cout, EtaElFromTau, etaElMax, EtaMuFromTau, etaMuMax, i, isElecDecay_recoacc, isMuonDecay_recoacc, LeptonicTauDecay(), L1TEmulatorMonitor_cff::p, reco::Candidate::pdgId(), evf::utils::pid, PtElFromTau, ptElMax, PtMuFromTau, ptMuMax, edm::View< T >::size(), reco::Candidate::status(), and ntuplemaker::status.

Referenced by HLTHiggsBits::analyze().

450  {
451  if (_Monte) {
452  // int ntaus=0;
453  int ngentau=0;
454  int itauel=0;
455  int itauelaccept=0;
456  int itaumu=0;
457  int itaumuaccept=0;
458  //int itauq=0;
459 
460  std::vector<double> ptMuFromTau_,ptElFromTau_;
461  std::vector<double> etaMuFromTau_,etaElFromTau_;
462 
463 
464  if (&mctruth){
465 
466 
467  for (size_t i = 0; i < mctruth.size(); ++ i) {
468  const reco::Candidate & p = (mctruth)[i];
469  int status = p.status();
470  int pid=p.pdgId();
471 
472  //==========
473 
474  if (status==3 && fabs(pid)==15) {
475  ngentau++;
476  bool elecdec = false, muondec = false;
477  LeptonicTauDecay(p, elecdec, muondec);
478 
479  if (elecdec) {
480  itauel++;
481  if (PtElFromTau > 15 && fabs(EtaElFromTau)<2.4) {
482  itauelaccept++; // keep electrons from tau decay with pt>15
483  ptElFromTau_.push_back(PtElFromTau);
484  etaElFromTau_.push_back(EtaElFromTau);
485  }
486  }
487  if (muondec) {
488  itaumu++;
489  if (PtMuFromTau>15 && fabs(EtaMuFromTau)<2.4) {
490  itaumuaccept++; // keep muons from tau decay with pt>15
491  ptMuFromTau_.push_back(PtMuFromTau);
492  etaMuFromTau_.push_back(EtaMuFromTau);
493  }
494  }
495  }
496 
497 }
498 /*
499 
500  //===============
501  if (status==1 || status==2) {
502 
503  bool istau = std::abs(pid)==15;
504  bool inacceptance = (fabs(p.eta()) < 2.4);
505  bool aboveptcut = (p.pt() > 20.0);
506  if (inacceptance && aboveptcut && istau) {
507  if (ntaus==0) {
508  ntaus=int(pid/std::abs(pid));
509  } else if (pid<0 && ntaus==1) {
510  ntaus=2;
511  } else if (pid>0 && ntaus==-1) {
512  ntaus=2;
513  }
514  }
515  }
516  }
517  // request 2 opposite charge taus
518  isvisible = ntaus==2; */
519 
521 
522  int iTauQ = ngentau - itauel - itaumu;
523  if (ngentau==2 && itaumu==1 && iTauQ==1 && itaumuaccept==1){ //H->tautau->muq
524 
525  isMuonDecay_recoacc=true;
526  ptMuMax = ptMuFromTau_[0];
527  // ptMuMin = 0.;
528  etaMuMax = etaMuFromTau_[0];
529  // etaMuMin = 0.;
530  }
531  else {isMuonDecay_recoacc=false;}
532 
534  if (ngentau==2 && itauel==1 && iTauQ==1 && itauelaccept==1){ //H->tautau->eq
535  // if (ngentau==2 && itauel==2 && itauelaccept==2){ // dileptonic case
536  isElecDecay_recoacc=true;
537  ptElMax=ptElFromTau_[0];
538  // ptElMin=0.;
539  etaElMax=etaElFromTau_[0];
540  // etaElMin=0.;
541  }
542  else { isElecDecay_recoacc=false;}
543 
544  }
545  else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
546 // std::cout << "ntaus = " << ntaus << " " << isvisible << std::endl;
547  }
548 }
int i
Definition: DBlmapReader.cc:9
double PtMuFromTau
virtual int status() const =0
status word
void LeptonicTauDecay(const reco::Candidate &tau, bool &elecdec, bool &muondec)
double EtaMuFromTau
double PtElFromTau
double EtaElFromTau
bool isMuonDecay_recoacc
bool isElecDecay_recoacc
virtual int pdgId() const =0
PDG identifier.
size_type size() const
tuple cout
Definition: gather_cfg.py:41
tuple status
Definition: ntuplemaker.py:245
void HLTHiggsTruth::analyzeHgg ( const reco::CandidateView mctruth,
const reco::PhotonCollection photonHandle,
TTree *  tree 
)

Definition at line 372 of file HLTHiggsTruth.cc.

References _Monte, eta(), i, isPhotonDecay_acc, isvisible_reco, Photon1, and Photon2.

Referenced by HLTHiggsBits::analyze().

372  {
373  if (_Monte) {
374  // int nphotons=0;
375  std::map<double,reco::Photon> photonMap;
376 
377 
378  // if (&mctruth){
379 
380 
381  //keep reco photons with pt>20, eta<2.4
382  for (size_t i = 0; i < photonHandle.size(); ++ i) {
383  if ( (photonHandle)[i].pt()>20 && fabs((photonHandle)[i].eta())<2.4 ){
384  photonMap[(photonHandle)[i].pt()]= (photonHandle)[i];
385  }
386  }
387 
388 
389  std::vector<reco::Photon> selected_photons;
390 
391  for( std::map<double,reco::Photon>::reverse_iterator rit=photonMap.rbegin(); rit!=photonMap.rend(); ++rit){
392  selected_photons.push_back( (*rit).second );
393  }
394 
395 
396  // request 2 photons (or more)
397  // isvisible = nphotons > 1;
398 
399  if (selected_photons.size()>1){ // at least 2 selected photons in the event
400 
401  isPhotonDecay_acc=true;
402  isvisible_reco= true;
403 
404  Photon1 = selected_photons[0];
405  Photon2 = selected_photons[1];
406  }
407  else{
408  isPhotonDecay_acc=false;
409  isvisible_reco=false;
410  }
411 
412  //}
413  //else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
414 // std::cout << "nphotons = " << nphotons << " " << isvisible_gg << std::endl;
415  }
416 }
int i
Definition: DBlmapReader.cc:9
bool isPhotonDecay_acc
T eta() const
reco::Photon Photon1
reco::Photon Photon2
void HLTHiggsTruth::analyzeHinv ( const reco::CandidateView mctruth,
TTree *  tree 
)

Definition at line 590 of file HLTHiggsTruth.cc.

References _Monte, gather_cfg::cout, and isvisible.

Referenced by HLTHiggsBits::analyze().

590  {
591  if (_Monte) {
592  if (&mctruth){
593  isvisible = true;
594  } else {
595  std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;
596  }
597 // std::cout << "Invisible: MC exists, accept " << std::endl;
598  }
599 }
tuple cout
Definition: gather_cfg.py:41
void HLTHiggsTruth::analyzeHtaunu ( const reco::CandidateView mctruth,
TTree *  tree 
)

Definition at line 550 of file HLTHiggsTruth.cc.

References _Monte, abs, gather_cfg::cout, reco::Candidate::eta(), i, isTauDecay_acc, isvisible, L1TEmulatorMonitor_cff::p, reco::Candidate::pdgId(), evf::utils::pid, reco::Candidate::pt(), edm::View< T >::size(), reco::Candidate::status(), and ntuplemaker::status.

Referenced by HLTHiggsBits::analyze().

550  {
551  if (_Monte) {
552 
553  int ntaus=0;
554 
555  std::map<double,reco::Particle> tauMap;
556  if (&mctruth){
557  for (size_t i = 0; i < mctruth.size(); ++ i) {
558  const reco::Candidate & p = (mctruth)[i];
559  int status = p.status();
560  int pid=p.pdgId();
561 
562  // const reco::Candidate *m=p.mother();
563 
564  if (status==1 || status==2) {
565 
566  bool istau = std::abs(pid)==15;
567  bool inacceptance = (fabs(p.eta()) < 2.4);
568  bool aboveptcut = (p.pt() > 100);
569  if (inacceptance && aboveptcut && istau) {
570 
571  ntaus++;
572  }
573  }
574  }
575 
577 
578 
579 
580  isvisible= (ntaus>0);
582 
583 
584  }
585  else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
586 // std::cout << "ntaus = " << ntaus << " " << isvisible_taunu << std::endl;
587  }
588 }
int i
Definition: DBlmapReader.cc:9
virtual double pt() const =0
transverse momentum
virtual int status() const =0
status word
#define abs(x)
Definition: mlp_lapack.h:159
virtual int pdgId() const =0
PDG identifier.
size_type size() const
tuple cout
Definition: gather_cfg.py:41
tuple status
Definition: ntuplemaker.py:245
virtual double eta() const =0
momentum pseudorapidity
void HLTHiggsTruth::analyzeHWW2l ( const reco::CandidateView mctruth,
const reco::CaloMETCollection caloMet,
const reco::TrackCollection Tracks,
const reco::MuonCollection muonHandle,
const reco::GsfElectronCollection electronHandle,
TTree *  tree 
)

Analyze the Data

Event classification ,take lepton pair with highest pt

Definition at line 78 of file HLTHiggsTruth.cc.

References _Monte, reco::LeafCandidate::charge(), Electron1, Electron2, eta(), i, isElecDecay_recoacc, isEMuDecay_recoacc, isMuonDecay_recoacc, met_hwwdiel_, met_hwwdimu_, met_hwwemu_, Muon1, Muon2, and reco::LeafCandidate::pt().

Referenced by HLTHiggsBits::analyze().

80  {
81  if (_Monte) {
82 
83  // if (&mctruth){
84 
85 
86 
87 
92 
93  std::map<double, reco::Muon> muonMap;
94  std::map<double,reco::GsfElectron> electronMap;
95 
96  // keep globalmuons with pt>10 in eta<2.4
97  for (size_t i = 0; i < muonHandle.size(); ++ i) {
98  if ( (muonHandle)[i].isGlobalMuon() && (muonHandle)[i].pt()>10 &&
99  fabs((muonHandle)[i].eta())<2.4 ){ //&& (muonHandle)[i].isolationR03().sumPt<2 &&
100  // ((muonHandle)[i].isolationR03().emEt + (muonHandle)[i].isolationR03().hadEt)<5 ){
101  muonMap[(muonHandle)[i].pt()]= (muonHandle)[i];
102  }
103  }
104 
105  // keep electrons with pt>10, eta<2.4, H/E<0.05, 0.6<E/p<2.5
106  for (size_t ii = 0; ii < electronHandle.size(); ++ ii) {
107  if ( (electronHandle)[ii].pt()>10 && fabs((electronHandle)[ii].eta())<2.4 &&
108  (electronHandle)[ii].hadronicOverEm()<0.05 &&
109  (electronHandle)[ii].eSuperClusterOverP()>0.6 && (electronHandle)[ii].eSuperClusterOverP()<2.5 ){
110  electronMap[(electronHandle)[ii].pt()]= (electronHandle)[ii];
111  }
112  }
113 
115 
116  std::vector<reco::Muon> selected_muons;
117  for( std::map<double,reco::Muon>::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){
118  selected_muons.push_back( (*rit).second ); // sort muons by pt
119  }
120 
121 
122  std::vector<reco::GsfElectron> selected_electrons;
123  for( std::map<double,reco::GsfElectron>::reverse_iterator rit=electronMap.rbegin(); rit!=electronMap.rend(); ++rit){
124  selected_electrons.push_back( (*rit).second ); // sort electrons by pt
125  }
126 
127  //------------------------------------
128 
130 
131  reco::Muon muon1, muon2;
132  reco::GsfElectron electron1, electron2;
133 
134  if (selected_electrons.size() ==1 ) electron1 = selected_electrons[0];
135  if (selected_electrons.size() > 1){
136  electron1 = selected_electrons[0];
137  electron2 = selected_electrons[1];
138  }
139 
140  if (selected_muons.size() ==1 ) muon1 = selected_muons[0];
141  if (selected_muons.size() > 1){
142  muon1 = selected_muons[0];
143  muon2 = selected_muons[1];
144  }
145 
146 
147  // bool dimuEvent = false;
148  // bool emuEvent = false;
149  // bool dielEvent = false;
150 
151 
152  double ptel1=0.;
153  double ptel2=0.;
154  double ptmu1=0.;
155  double ptmu2=0.;
156 
157  if (selected_electrons.size()==0) { ptel1 = 0; ptel2 = 0; }
158  if (selected_electrons.size()==1) { ptel1 = electron1.pt(); ptel2 = 0; }
159  if (selected_electrons.size()>1) { ptel1 = electron1.pt() ; ptel2 = electron2.pt();}
160 
161  if (selected_muons.size()==0) { ptmu1 = 0; ptmu2 = 0; }
162  if (selected_muons.size()==1) { ptmu1 = muon1.pt(); ptmu2 = 0; }
163  if (selected_muons.size()>1) { ptmu1 = muon1.pt(); ptmu2 =muon2.pt();}
164 
165 
166 
167  if (selected_muons.size() + selected_electrons.size() > 1){
168 
169  if (ptel2 > ptmu1){
170  if (electron1.charge()*electron2.charge()<0 && electron1.pt()>20 /*&& electron2.pt()>20*/ ) {
171  // dielEvent=true;
172  isElecDecay_recoacc=true;
173  isMuonDecay_recoacc=false;
174  isEMuDecay_recoacc=false;
175 
176  Electron1 = selected_electrons[0];
177  Electron2 = selected_electrons[1];
178 
179  met_hwwdiel_ = caloMet[0].pt();
180  }
181  }
182 
183  else if (ptmu2 > ptel1){
184  // if (muon1.charge()*muon2.charge()<0 && muon1.pt()>20 /*&& muon2.pt()>20*/ ) dimuEvent =true;
185  if (muon1.charge()*muon2.charge()<0 && muon1.pt()>20 /*&& fabs(muon1.eta())<2.1*/ ){
186  // dimuEvent =true;
187  isElecDecay_recoacc=false;
188  isMuonDecay_recoacc=true;
189  isEMuDecay_recoacc=false;
190 
191  Muon1 = selected_muons[0];
192  Muon2 = selected_muons[1];
193 
194  met_hwwdimu_ = caloMet[0].pt();
195 
196  }
197  }
198 
199  else {
200 
201  // if (muon1.charge()*electron1.charge()<0 && (muon1.pt()>20 || electron1.pt()>20) ) emuEvent = true;
202  if (muon1.charge()*electron1.charge()<0 && (muon1.pt()>20 || electron1.pt()>20) /*&&
203  fabs(muon1.eta())<2.1 */) {
204  // emuEvent = true;
205  isElecDecay_recoacc=false;
206  isMuonDecay_recoacc=false;
207  isEMuDecay_recoacc=true;
208 
209 
210  Muon1 = selected_muons[0];
211  Electron1 = selected_electrons[0];
212 
213  met_hwwemu_ = caloMet[0].pt();
214  }
215  }
216 
217  }
218  else{
219 
220 
221  isElecDecay_recoacc=false;
222  isMuonDecay_recoacc=false;
223  isEMuDecay_recoacc=false;
224 
225  }
226 
227 
228 
229  // }
230  // else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
231 // std::cout << "nleptons = " << nleptons << " " << isvisible_WW << std::endl;
232  }
233 
234 }
int i
Definition: DBlmapReader.cc:9
double met_hwwdimu_
reco::GsfElectron Electron1
bool isEMuDecay_recoacc
double met_hwwemu_
T eta() const
reco::Muon Muon1
bool isMuonDecay_recoacc
reco::Muon Muon2
virtual int charge() const
electric charge
bool isElecDecay_recoacc
virtual double pt() const
transverse momentum
reco::GsfElectron Electron2
double met_hwwdiel_
void HLTHiggsTruth::analyzeHZZ4l ( const reco::CandidateView mctruth,
const reco::MuonCollection muonHandle,
const reco::GsfElectronCollection electronHandle,
TTree *  tree 
)

Event selection : 2 pairs of opp charge leptons (4mu, 4e or 2e2mu)

Definition at line 238 of file HLTHiggsTruth.cc.

References _Monte, DeDxDiscriminatorTools::charge(), Electron1, Electron2, eta(), i, isElecDecay_recoacc, isEMuDecay_recoacc, isMuonDecay_recoacc, gen::k, Muon1, and Muon2.

Referenced by HLTHiggsBits::analyze().

239  {
240  if (_Monte) {
241 
242 
243  // if (&mctruth){
244 
245  //----selection based on reco---
246 
247 
248  std::map<double,reco::Muon> muonMap;
249 
250  // keep globalmuons with pt>10, eta<2.4
251  for (size_t i = 0; i < muonHandle.size(); ++ i) {
252  if ( (muonHandle)[i].isGlobalMuon() && (muonHandle)[i].pt()>10 &&
253  fabs((muonHandle)[i].eta())<2.4 ){
254  muonMap[(muonHandle)[i].pt()]= (muonHandle)[i];
255  }
256  }
257  // keep electrons with pt>10, eta<2.4, H/E<0.05, 0.6<E/p<2.5
258  std::map<double,reco::GsfElectron> electronMap;
259  for (size_t ii = 0; ii < electronHandle.size(); ++ ii) {
260  if ( (electronHandle)[ii].pt()>10 && fabs((electronHandle)[ii].eta())<2.4 &&
261  (electronHandle)[ii].hadronicOverEm()<0.05 &&
262  (electronHandle)[ii].eSuperClusterOverP()>0.6 && (electronHandle)[ii].eSuperClusterOverP()<2.5){
263  electronMap[(electronHandle)[ii].pt()]= (electronHandle)[ii];
264 
265  }
266  }
267 
269  std::vector<reco::Muon> selected_muons;
270 
271  for( std::map<double,reco::Muon>::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){
272  selected_muons.push_back( (*rit).second ); // sort muons by pt
273  }
274 
275 
276  std::vector<reco::GsfElectron> selected_electrons;
277 
278  for( std::map<double,reco::GsfElectron>::reverse_iterator rit=electronMap.rbegin(); rit!=electronMap.rend(); ++rit){
279  selected_electrons.push_back( (*rit).second ); // sort electrons by pt
280  }
281 
282 
284 
285  int posEle=0;
286  int negEle=0;
287  int posMu=0;
288  int negMu=0;
289 
290 
291  for (size_t k=0; k<selected_muons.size();k++){
292  if (selected_muons[k].charge()>0) posMu++; //n muons pos charge
293  else if (selected_muons[k].charge()<0) negMu++; // n muons neg charge
294  }
295 
296  for (size_t k=0; k<selected_electrons.size();k++){
297  if (selected_electrons[k].charge()>0) posEle++; // n electrons pos charge
298  else if (selected_electrons[k].charge()<0) negEle++; // n electrons neg charge
299  }
300 
301  //----------
303 
304  int nElectron=0;
305  int nMuon=0;
306 
307  bool hzz2e2mu_decay = false; // at least 4 reco muons in the event
308  bool hzz4e_decay =false; // at least 4 electrons in the event
309  bool hzz4mu_decay=false; // at least 2 muons and 2 electrons
310 
311 
312  if (selected_muons.size()>=4) hzz4mu_decay=true;
313  else if (selected_electrons.size()>=4) hzz4e_decay=true;
314  else if (selected_muons.size()>=2 && selected_electrons.size()>=2) hzz2e2mu_decay=true;
315 
316 
317  if (hzz2e2mu_decay) {
318  if ( posEle>=1 && negEle>=1 ) {
319  nElectron=posEle+negEle;
320  }
321  if ( posMu>=1 && negMu>=1 ) {
322  nMuon=posMu+negMu;
323  }
324  }
325  else if (hzz4e_decay) {
326  if ( posEle>=2 && negEle>=2 ) {
327  nElectron=posEle+negEle;
328  }
329  }
330  else if (hzz4mu_decay) {
331  if ( posMu>=2 && negMu>=2 ) {
332  nMuon=posMu+negMu;
333  }
334  }
335 
337 
338  if (hzz2e2mu_decay && nElectron>=2 && nMuon>=2 ){ // at least 2 electrons and 2 muons
339  // with opp charge
340  isEMuDecay_recoacc =true;
341  Muon1 = selected_muons[0];
342  Electron1 = selected_electrons[0];
343 
344  }
345  else if (hzz4e_decay && nElectron>=4){
346  isElecDecay_recoacc=true;
347  Electron1 = selected_electrons[0];
348  Electron2 = selected_electrons[1];
349 
350  }
351  else if (hzz4mu_decay && nMuon>=4){
352  isMuonDecay_recoacc =true;
353  Muon1 = selected_muons[0];
354  Muon2 = selected_muons[1];
355 
356  }
357  else {
358 
359  isElecDecay_recoacc=false;
360  isMuonDecay_recoacc=false;
361  isEMuDecay_recoacc=false;
362  }
363 
364 
365 
366  // }
367  //else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
368 // std::cout << "nepair, nmupair = " << nepair << ", " << nmupair << " " << isvisible << std::endl;
369  }
370 }
int i
Definition: DBlmapReader.cc:9
reco::GsfElectron Electron1
bool isEMuDecay_recoacc
T eta() const
double charge(const std::vector< uint8_t > &Ampls)
reco::Muon Muon1
bool isMuonDecay_recoacc
reco::Muon Muon2
int k[5][pyjets_maxn]
bool isElecDecay_recoacc
reco::GsfElectron Electron2
bool HLTHiggsTruth::decision ( ) const
inline

Definition at line 86 of file HLTHiggsTruth.h.

References isvisible.

86 {return isvisible;};
bool HLTHiggsTruth::decision_reco ( ) const
inline

Definition at line 105 of file HLTHiggsTruth.h.

References isvisible_reco.

105 {return isvisible_reco;};
bool HLTHiggsTruth::ElecChannel_recoacc ( ) const
inline

Definition at line 101 of file HLTHiggsTruth.h.

References isElecDecay_recoacc.

Referenced by HLTHiggsBits::analyze().

101 {return isElecDecay_recoacc;};
bool isElecDecay_recoacc
bool HLTHiggsTruth::ElecMuChannel_recoacc ( ) const
inline

Definition at line 102 of file HLTHiggsTruth.h.

References isEMuDecay_recoacc.

Referenced by HLTHiggsBits::analyze().

102 {return isEMuDecay_recoacc;};
bool isEMuDecay_recoacc
reco::GsfElectron HLTHiggsTruth::electron1_ ( ) const
inline

Definition at line 143 of file HLTHiggsTruth.h.

References Electron1.

Referenced by HLTHiggsBits::analyze().

143 {return Electron1;};
reco::GsfElectron Electron1
reco::GsfElectron HLTHiggsTruth::electron2_ ( ) const
inline

Definition at line 144 of file HLTHiggsTruth.h.

References Electron2.

Referenced by HLTHiggsBits::analyze().

144 {return Electron2;};
reco::GsfElectron Electron2
reco::GsfElectron HLTHiggsTruth::electron3_ ( ) const
inline

Definition at line 145 of file HLTHiggsTruth.h.

References Electron3.

145 {return Electron3;};
reco::GsfElectron Electron3
reco::GsfElectron HLTHiggsTruth::electron4_ ( ) const
inline

Definition at line 146 of file HLTHiggsTruth.h.

References Electron4.

146 {return Electron4;};
reco::GsfElectron Electron4
double HLTHiggsTruth::etaElectron1 ( ) const
inline

Definition at line 114 of file HLTHiggsTruth.h.

References etaElMax.

Referenced by HLTHiggsBits::analyze().

114 {return etaElMax;};
double HLTHiggsTruth::etaElectron2 ( ) const
inline

Definition at line 115 of file HLTHiggsTruth.h.

References etaElMin.

115 {return etaElMin;};
double HLTHiggsTruth::etaMuon1 ( ) const
inline

Definition at line 110 of file HLTHiggsTruth.h.

References etaMuMax.

Referenced by HLTHiggsBits::analyze().

110 {return etaMuMax;};
double HLTHiggsTruth::etaMuon2 ( ) const
inline

Definition at line 111 of file HLTHiggsTruth.h.

References etaMuMin.

111 {return etaMuMin;};
double HLTHiggsTruth::etaTau1 ( ) const
inline

Definition at line 121 of file HLTHiggsTruth.h.

References etaTauMax.

121 {return etaTauMax;};
void HLTHiggsTruth::LeptonicTauDecay ( const reco::Candidate tau,
bool &  elecdec,
bool &  muondec 
)

Definition at line 601 of file HLTHiggsTruth.cc.

References abs, reco::Candidate::begin(), reco::Candidate::end(), EtaElFromTau, EtaMuFromTau, reco::Candidate::pdgId(), PtElFromTau, and PtMuFromTau.

Referenced by analyzeH2tau().

603 {
604 
605  //if (tau.begin() == tau.end()) std::cout << "No_llega_a_entrar_en_el_bucle" << std::endl;
606  // loop on tau decays, check for an electron or muon
607  for(reco::Candidate::const_iterator daughter=tau.begin();daughter!=tau.end(); ++daughter){
608  //cout << "daughter_x" << std::endl;
609  // if the tau daughter is a tau, it means the particle has still to be propagated.
610  // In that case, return the result of the same method on that daughter.
611  if(daughter->pdgId()==tau.pdgId()) return LeptonicTauDecay(*daughter, elecdec, muondec);
612  // check for leptons
613  elecdec |= std::abs(daughter->pdgId())==11;
614  muondec |= std::abs(daughter->pdgId())==13;
615 
616  if (std::abs(daughter->pdgId())==11) {
617  PtElFromTau = daughter->pt();
618  EtaElFromTau = daughter->eta();
619  }
620 
621  if (std::abs(daughter->pdgId())==13){
622  PtMuFromTau = daughter->pt();
623  EtaMuFromTau = daughter->eta();
624  }
625  }
626 
627 }
double PtMuFromTau
void LeptonicTauDecay(const reco::Candidate &tau, bool &elecdec, bool &muondec)
#define abs(x)
Definition: mlp_lapack.h:159
double EtaMuFromTau
double PtElFromTau
double EtaElFromTau
virtual const_iterator end() const =0
last daughter const_iterator
virtual int pdgId() const =0
PDG identifier.
virtual const_iterator begin() const =0
first daughter const_iterator
double HLTHiggsTruth::met_hwwdiel ( ) const
inline

Definition at line 149 of file HLTHiggsTruth.h.

References met_hwwdiel_.

Referenced by HLTHiggsBits::analyze().

149 {return met_hwwdiel_ ;};
double met_hwwdiel_
double HLTHiggsTruth::met_hwwdimu ( ) const
inline

Definition at line 148 of file HLTHiggsTruth.h.

References met_hwwdimu_.

Referenced by HLTHiggsBits::analyze().

148 {return met_hwwdimu_ ;};
double met_hwwdimu_
double HLTHiggsTruth::met_hwwemu ( ) const
inline

Definition at line 150 of file HLTHiggsTruth.h.

References met_hwwemu_.

Referenced by HLTHiggsBits::analyze().

150 {return met_hwwemu_ ;};
double met_hwwemu_
reco::Muon HLTHiggsTruth::muon1_ ( ) const
inline

Definition at line 135 of file HLTHiggsTruth.h.

References Muon1.

Referenced by HLTHiggsBits::analyze().

135 {return Muon1;};
reco::Muon Muon1
reco::Muon HLTHiggsTruth::muon2_ ( ) const
inline

Definition at line 136 of file HLTHiggsTruth.h.

References Muon2.

Referenced by HLTHiggsBits::analyze().

136 {return Muon2;};
reco::Muon Muon2
reco::Muon HLTHiggsTruth::muon3_ ( ) const
inline

Definition at line 137 of file HLTHiggsTruth.h.

References Muon3.

137 {return Muon3;};
reco::Muon Muon3
reco::Muon HLTHiggsTruth::muon4_ ( ) const
inline

Definition at line 138 of file HLTHiggsTruth.h.

References Muon4.

138 {return Muon4;};
reco::Muon Muon4
bool HLTHiggsTruth::MuonChannel_recoacc ( ) const
inline

Definition at line 100 of file HLTHiggsTruth.h.

References isMuonDecay_recoacc.

Referenced by HLTHiggsBits::analyze().

100 {return isMuonDecay_recoacc;}; //within acceptance +reco cuts
bool isMuonDecay_recoacc
reco::Photon HLTHiggsTruth::photon1_ ( ) const
inline

Definition at line 132 of file HLTHiggsTruth.h.

References Photon1.

Referenced by HLTHiggsBits::analyze().

132 {return Photon1;};
reco::Photon Photon1
reco::Photon HLTHiggsTruth::photon2_ ( ) const
inline

Definition at line 133 of file HLTHiggsTruth.h.

References Photon2.

Referenced by HLTHiggsBits::analyze().

133 {return Photon2;};
reco::Photon Photon2
bool HLTHiggsTruth::PhotonChannel_acc ( ) const
inline

Definition at line 96 of file HLTHiggsTruth.h.

References isPhotonDecay_acc.

Referenced by HLTHiggsBits::analyze().

96 {return isPhotonDecay_acc;};
bool isPhotonDecay_acc
bool HLTHiggsTruth::PhotonChannel_recoacc ( ) const
inline

Definition at line 103 of file HLTHiggsTruth.h.

References isPhotonDecay_recoacc.

103 {return isPhotonDecay_recoacc;};
bool isPhotonDecay_recoacc
double HLTHiggsTruth::ptElectron1 ( ) const
inline

Definition at line 112 of file HLTHiggsTruth.h.

References ptElMax.

Referenced by HLTHiggsBits::analyze().

112 {return ptElMax;};
double HLTHiggsTruth::ptElectron2 ( ) const
inline

Definition at line 113 of file HLTHiggsTruth.h.

References ptElMin.

113 {return ptElMin;};
double HLTHiggsTruth::ptMuon1 ( ) const
inline

Definition at line 108 of file HLTHiggsTruth.h.

References ptMuMax.

Referenced by HLTHiggsBits::analyze().

108 {return ptMuMax;};
double HLTHiggsTruth::ptMuon2 ( ) const
inline

Definition at line 109 of file HLTHiggsTruth.h.

References ptMuMin.

109 {return ptMuMin;};
double HLTHiggsTruth::ptTau1 ( ) const
inline

Definition at line 120 of file HLTHiggsTruth.h.

References ptTauMax.

120 {return ptTauMax;};
void HLTHiggsTruth::setup ( const edm::ParameterSet pSet,
TTree *  tree 
)

Definition at line 41 of file HLTHiggsTruth.cc.

References _Debug, _Monte, edm::ParameterSet::getParameter(), and edm::ParameterSet::getParameterNames().

Referenced by HLTHiggsBits::HLTHiggsBits().

41  {
42 
43  edm::ParameterSet myMCParams = pSet.getParameter<edm::ParameterSet>("RunParameters") ;
44  std::vector<std::string> parameterNames = myMCParams.getParameterNames() ;
45 
46  for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
47  iParam != parameterNames.end(); iParam++ ){
48  if ( (*iParam) == "Monte" ) _Monte = myMCParams.getParameter<bool>( *iParam );
49  else if ( (*iParam) == "Debug" ) _Debug = myMCParams.getParameter<bool>( *iParam );
50  }
51 
52 
53 
54 
55 // const int kMaxMcTruth = 50000;
56 // mcpid = new float[kMaxMcTruth];
57 // mcvx = new float[kMaxMcTruth];
58 // mcvy = new float[kMaxMcTruth];
59 // mcvz = new float[kMaxMcTruth];
60 // mcpt = new float[kMaxMcTruth];
61 
62 
63 
64  // MCtruth-specific branches of the tree
65 // HltTree->Branch("NobjMCPart",&nmcpart,"NobjMCPart/I");
66 // HltTree->Branch("MCPid",mcpid,"MCPid[NobjMCPart]/I");
67 // HltTree->Branch("MCVtxX",mcvx,"MCVtxX[NobjMCPart]/F");
68 // HltTree->Branch("MCVtxY",mcvy,"MCVtxY[NobjMCPart]/F");
69 // HltTree->Branch("MCVtxZ",mcvz,"MCVtxZ[NobjMCPart]/F");
70 // HltTree->Branch("MCPt",mcpt,"MCPt[NobjMCPart]/F");
71 
72  }
T getParameter(std::string const &) const
std::vector< std::string > getParameterNames() const
bool HLTHiggsTruth::TauChannel_acc ( ) const
inline

Definition at line 97 of file HLTHiggsTruth.h.

References isTauDecay_acc.

Referenced by HLTHiggsBits::analyze().

97 {return isTauDecay_acc;};
bool HLTHiggsTruth::TauChannel_recoacc ( ) const
inline

Definition at line 104 of file HLTHiggsTruth.h.

References isTauDecay_recoacc.

104 {return isTauDecay_recoacc;};
bool isTauDecay_recoacc

Member Data Documentation

bool HLTHiggsTruth::_Debug
private

Definition at line 225 of file HLTHiggsTruth.h.

Referenced by HLTHiggsTruth(), and setup().

bool HLTHiggsTruth::_Monte
private
reco::GsfElectron HLTHiggsTruth::Electron1
private

Definition at line 211 of file HLTHiggsTruth.h.

Referenced by analyzeHWW2l(), analyzeHZZ4l(), and electron1_().

reco::GsfElectron HLTHiggsTruth::Electron2
private

Definition at line 212 of file HLTHiggsTruth.h.

Referenced by analyzeHWW2l(), analyzeHZZ4l(), and electron2_().

reco::GsfElectron HLTHiggsTruth::Electron3
private

Definition at line 213 of file HLTHiggsTruth.h.

Referenced by electron3_().

reco::GsfElectron HLTHiggsTruth::Electron4
private

Definition at line 214 of file HLTHiggsTruth.h.

Referenced by electron4_().

double HLTHiggsTruth::EtaElFromTau
private

Definition at line 194 of file HLTHiggsTruth.h.

Referenced by analyzeH2tau(), and LeptonicTauDecay().

double HLTHiggsTruth::etaElMax
private

Definition at line 188 of file HLTHiggsTruth.h.

Referenced by analyzeH2tau(), and etaElectron1().

double HLTHiggsTruth::etaElMin
private

Definition at line 188 of file HLTHiggsTruth.h.

Referenced by etaElectron2().

double HLTHiggsTruth::EtaMuFromTau
private

Definition at line 194 of file HLTHiggsTruth.h.

Referenced by analyzeH2tau(), and LeptonicTauDecay().

double HLTHiggsTruth::etaMuMax
private

Definition at line 187 of file HLTHiggsTruth.h.

Referenced by analyzeH2tau(), and etaMuon1().

double HLTHiggsTruth::etaMuMin
private

Definition at line 187 of file HLTHiggsTruth.h.

Referenced by etaMuon2().

double HLTHiggsTruth::etaPhMax
private

Definition at line 189 of file HLTHiggsTruth.h.

double HLTHiggsTruth::etaPhMin
private

Definition at line 189 of file HLTHiggsTruth.h.

double HLTHiggsTruth::etaTauMax
private

Definition at line 190 of file HLTHiggsTruth.h.

Referenced by etaTau1().

bool HLTHiggsTruth::isElecDecay_recoacc
private
bool HLTHiggsTruth::isEMuDecay_recoacc
private

Definition at line 174 of file HLTHiggsTruth.h.

Referenced by analyzeHWW2l(), analyzeHZZ4l(), ElecMuChannel_recoacc(), and HLTHiggsTruth().

bool HLTHiggsTruth::isMuonDecay_recoacc
private
bool HLTHiggsTruth::isPhotonDecay_acc
private

Definition at line 167 of file HLTHiggsTruth.h.

Referenced by analyzeHgg(), HLTHiggsTruth(), and PhotonChannel_acc().

bool HLTHiggsTruth::isPhotonDecay_recoacc
private

Definition at line 175 of file HLTHiggsTruth.h.

Referenced by HLTHiggsTruth(), and PhotonChannel_recoacc().

bool HLTHiggsTruth::isTauDecay
private

Definition at line 168 of file HLTHiggsTruth.h.

bool HLTHiggsTruth::isTauDecay_acc
private

Definition at line 169 of file HLTHiggsTruth.h.

Referenced by analyzeHtaunu(), HLTHiggsTruth(), and TauChannel_acc().

bool HLTHiggsTruth::isTauDecay_recoacc
private

Definition at line 176 of file HLTHiggsTruth.h.

Referenced by HLTHiggsTruth(), and TauChannel_recoacc().

bool HLTHiggsTruth::isvisible
private

Definition at line 150 of file HLTHiggsTruth.h.

Referenced by analyzeA2mu(), analyzeHinv(), analyzeHtaunu(), decision(), and HLTHiggsTruth().

bool HLTHiggsTruth::isvisible_reco
private

Definition at line 178 of file HLTHiggsTruth.h.

Referenced by analyzeHgg(), decision_reco(), and HLTHiggsTruth().

double HLTHiggsTruth::met_hwwdiel_
private

Definition at line 197 of file HLTHiggsTruth.h.

Referenced by analyzeHWW2l(), and met_hwwdiel().

double HLTHiggsTruth::met_hwwdimu_
private

Definition at line 196 of file HLTHiggsTruth.h.

Referenced by analyzeHWW2l(), and met_hwwdimu().

double HLTHiggsTruth::met_hwwemu_
private

Definition at line 198 of file HLTHiggsTruth.h.

Referenced by analyzeHWW2l(), and met_hwwemu().

reco::Muon HLTHiggsTruth::Muon1
private

Definition at line 206 of file HLTHiggsTruth.h.

Referenced by analyzeHWW2l(), analyzeHZZ4l(), and muon1_().

reco::Muon HLTHiggsTruth::Muon2
private

Definition at line 207 of file HLTHiggsTruth.h.

Referenced by analyzeHWW2l(), analyzeHZZ4l(), and muon2_().

reco::Muon HLTHiggsTruth::Muon3
private

Definition at line 208 of file HLTHiggsTruth.h.

Referenced by muon3_().

reco::Muon HLTHiggsTruth::Muon4
private

Definition at line 209 of file HLTHiggsTruth.h.

Referenced by muon4_().

reco::Photon HLTHiggsTruth::Photon1
private

Definition at line 203 of file HLTHiggsTruth.h.

Referenced by analyzeHgg(), and photon1_().

reco::Photon HLTHiggsTruth::Photon2
private

Definition at line 204 of file HLTHiggsTruth.h.

Referenced by analyzeHgg(), and photon2_().

double HLTHiggsTruth::PtElFromTau
private

Definition at line 193 of file HLTHiggsTruth.h.

Referenced by analyzeH2tau(), and LeptonicTauDecay().

double HLTHiggsTruth::ptElMax
private

Definition at line 184 of file HLTHiggsTruth.h.

Referenced by analyzeH2tau(), and ptElectron1().

double HLTHiggsTruth::ptElMin
private

Definition at line 184 of file HLTHiggsTruth.h.

Referenced by ptElectron2().

double HLTHiggsTruth::PtMuFromTau
private

Definition at line 193 of file HLTHiggsTruth.h.

Referenced by analyzeH2tau(), and LeptonicTauDecay().

double HLTHiggsTruth::ptMuMax
private

Definition at line 183 of file HLTHiggsTruth.h.

Referenced by analyzeH2tau(), and ptMuon1().

double HLTHiggsTruth::ptMuMin
private

Definition at line 183 of file HLTHiggsTruth.h.

Referenced by ptMuon2().

double HLTHiggsTruth::ptTauMax
private

Definition at line 186 of file HLTHiggsTruth.h.

Referenced by ptTau1().