CMS 3D CMS Logo

Public Member Functions | Private Attributes

HLTHiggsTruth Class Reference

#include <HLTHiggsTruth.h>

List of all members.

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.

                             {

  //set parameter defaults 
  _Monte=false;  
  _Debug=false;
  isvisible=false;
 // isMuonDecay=false;
 // isElecDecay=false;
  //isEMuDecay=false;
 // isPhotonDecay=false;
//  isMuonDecay_acc=false;
 // isElecDecay_acc=false;
 // isEMuDecay_acc=false;
  isPhotonDecay_acc=false;
  isTauDecay_acc =false;
  isMuonDecay_recoacc=false;
  isElecDecay_recoacc=false;
  isEMuDecay_recoacc=false;
  isPhotonDecay_recoacc=false;
  isTauDecay_recoacc =false;
  isvisible_reco= false;
  
  
  
}

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(), ntuplemaker::status, and reco::Candidate::status().

                                                                               {
  if (_Monte) {
    int nmuons=0;
    if (&mctruth){
      for (size_t i = 0; i < mctruth.size(); ++ i) {
        const reco::Candidate & p = (mctruth)[i];
        int status = p.status();
        if (status==1) {
          int pid=p.pdgId();
          bool ismuon = std::abs(pid)==13;
          bool inacceptance = (std::abs(p.eta()) < 2.4);
          bool aboveptcut = (p.pt() > 3.0);
          if (inacceptance && aboveptcut && ismuon) {
            if (nmuons==0) {
              nmuons=int(pid/std::abs(pid));
            } else if (pid<0 && nmuons==1) {
              nmuons=2;
            } else if (pid>0 && nmuons==-1) {
              nmuons=2;
            }
          }
        }
      }
      // request 2  opposite charge muons
      isvisible = nmuons==2; 
    }
    else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
//    std::cout << "nmuons = " << nmuons << " " << isvisible_2mu << std::endl;
  }
}
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(), ntuplemaker::status, and reco::Candidate::status().

Referenced by HLTHiggsBits::analyze().

                                                                                {
  if (_Monte) {
  //  int ntaus=0;
    int ngentau=0;
    int itauel=0;
    int itauelaccept=0;
    int itaumu=0;
    int itaumuaccept=0;
    //int itauq=0;
    
    std::vector<double> ptMuFromTau_,ptElFromTau_;
    std::vector<double> etaMuFromTau_,etaElFromTau_;
    
      
    if (&mctruth){
    
    
      for (size_t i = 0; i < mctruth.size(); ++ i) {
        const reco::Candidate & p = (mctruth)[i];
        int status = p.status();
        int pid=p.pdgId();
        
        //==========
        
         if (status==3 && fabs(pid)==15) {
           ngentau++;
           bool elecdec = false, muondec = false;
           LeptonicTauDecay(p, elecdec, muondec);
      
          if (elecdec) {
            itauel++;
             if (PtElFromTau > 15 && fabs(EtaElFromTau)<2.4) {
             itauelaccept++;      // keep electrons from tau decay with pt>15
             ptElFromTau_.push_back(PtElFromTau);
             etaElFromTau_.push_back(EtaElFromTau);
             }
          }
         if (muondec) {
            itaumu++;
            if (PtMuFromTau>15 && fabs(EtaMuFromTau)<2.4) {
            itaumuaccept++;   // keep muons from tau decay with pt>15
             ptMuFromTau_.push_back(PtMuFromTau);
             etaMuFromTau_.push_back(EtaMuFromTau);
            }
         } 
    }
    
}       
/*      
        
        //===============
        if (status==1 || status==2) {
         
          bool istau = std::abs(pid)==15;
          bool inacceptance = (fabs(p.eta()) < 2.4);
          bool aboveptcut = (p.pt() > 20.0);
          if (inacceptance && aboveptcut && istau) {
            if (ntaus==0) {
              ntaus=int(pid/std::abs(pid));
            } else if (pid<0 && ntaus==1) {
              ntaus=2;
            } else if (pid>0 && ntaus==-1) {
              ntaus=2;
            }
          }
        }
      }
      // request 2  opposite charge taus
      isvisible = ntaus==2; */
      
      
       int iTauQ = ngentau - itauel - itaumu;
       if (ngentau==2 && itaumu==1 && iTauQ==1 && itaumuaccept==1){  //H->tautau->muq
    
             isMuonDecay_recoacc=true;
              ptMuMax = ptMuFromTau_[0];
             //  ptMuMin = 0.;     
             etaMuMax = etaMuFromTau_[0];
             // etaMuMin = 0.;   
        }
        else {isMuonDecay_recoacc=false;}
      
       if (ngentau==2 && itauel==1 && iTauQ==1 && itauelaccept==1){  //H->tautau->eq
     //  if (ngentau==2 && itauel==2 && itauelaccept==2){    // dileptonic case
             isElecDecay_recoacc=true;
             ptElMax=ptElFromTau_[0];
          //   ptElMin=0.;
             etaElMax=etaElFromTau_[0];
          //   etaElMin=0.;
        }
         else { isElecDecay_recoacc=false;}
         
    }
    else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
//    std::cout << "ntaus = " << ntaus << " " << isvisible << std::endl;
  }
}
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, Photon2, and ExpressReco_HICollisions_FallBack::pt.

Referenced by HLTHiggsBits::analyze().

                                                                                                                         {
  if (_Monte) {
  //  int nphotons=0;  
    std::map<double,reco::Photon> photonMap;
  
     
  //  if (&mctruth){
    
  
        //keep reco photons with pt>20, eta<2.4
         for (size_t i = 0; i < photonHandle.size(); ++ i) {
           if ( (photonHandle)[i].pt()>20 && fabs((photonHandle)[i].eta())<2.4 ){ 
                photonMap[(photonHandle)[i].pt()]= (photonHandle)[i];
            }
          }
                
      
       std::vector<reco::Photon> selected_photons;

        for( std::map<double,reco::Photon>::reverse_iterator rit=photonMap.rbegin(); rit!=photonMap.rend(); ++rit){
         selected_photons.push_back( (*rit).second );
        }

      
      // request 2 photons (or more)
    //  isvisible = nphotons > 1; 
      
     if (selected_photons.size()>1){    // at least 2 selected photons in the event
       
        isPhotonDecay_acc=true;  
        isvisible_reco= true;
   
         Photon1  = selected_photons[0];
         Photon2  = selected_photons[1];      
      }
        else{
          isPhotonDecay_acc=false;
          isvisible_reco=false;   
      }
      
    //}
    //else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
//    std::cout << "nphotons = " << nphotons << " " << isvisible_gg << std::endl;
  }
}
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().

                                                                               {
  if (_Monte) {
    if (&mctruth){
      isvisible = true; 
    } else {
      std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;
    }
//    std::cout << "Invisible: MC exists, accept " << std::endl;
  }
}
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(), ntuplemaker::status, and reco::Candidate::status().

Referenced by HLTHiggsBits::analyze().

                                                                                 {
  if (_Monte) {
    
    int ntaus=0;
  
     std::map<double,reco::Particle> tauMap;
    if (&mctruth){
      for (size_t i = 0; i < mctruth.size(); ++ i) {
           const reco::Candidate & p = (mctruth)[i];
           int status = p.status();
           int pid=p.pdgId();
         
        // const reco::Candidate *m=p.mother();
        
           if (status==1 || status==2) {
     
              bool istau = std::abs(pid)==15;     
              bool inacceptance = (fabs(p.eta()) < 2.4);
              bool aboveptcut = (p.pt() > 100);
              if (inacceptance && aboveptcut && istau) {
                
                  ntaus++;
              }
           }
      }
      
      
    
  
    isvisible= (ntaus>0);   
    isTauDecay_acc = isvisible;
  
      
    }
    else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
//    std::cout << "ntaus = " << ntaus << " " << isvisible_taunu << std::endl;
  }
}
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, ExpressReco_HICollisions_FallBack::pt, and reco::LeafCandidate::pt().

Referenced by HLTHiggsBits::analyze().

                                                                 {
  if (_Monte) {
  
   // if (&mctruth){
  
  
           
 
  
     std::map<double, reco::Muon> muonMap;
     std::map<double,reco::GsfElectron> electronMap;
    
      // keep globalmuons with pt>10 in eta<2.4
        for (size_t i = 0; i < muonHandle.size(); ++ i) {
           if ( (muonHandle)[i].isGlobalMuon() && (muonHandle)[i].pt()>10 &&
            fabs((muonHandle)[i].eta())<2.4 ){ //&& (muonHandle)[i].isolationR03().sumPt<2 &&
          // ((muonHandle)[i].isolationR03().emEt + (muonHandle)[i].isolationR03().hadEt)<5  ){
                muonMap[(muonHandle)[i].pt()]= (muonHandle)[i];
           }  
        }
        
        // keep electrons with pt>10, eta<2.4, H/E<0.05, 0.6<E/p<2.5
           for (size_t ii = 0; ii < electronHandle.size(); ++ ii) {
           if (  (electronHandle)[ii].pt()>10 && fabs((electronHandle)[ii].eta())<2.4 &&
           (electronHandle)[ii].hadronicOverEm()<0.05 &&
        (electronHandle)[ii].eSuperClusterOverP()>0.6 && (electronHandle)[ii].eSuperClusterOverP()<2.5 ){
                electronMap[(electronHandle)[ii].pt()]= (electronHandle)[ii];
           }  
        }
    
   
          std::vector<reco::Muon> selected_muons;  
    for( std::map<double,reco::Muon>::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){   
    selected_muons.push_back( (*rit).second );  // sort muons by pt
    }
    
   
           std::vector<reco::GsfElectron> selected_electrons;
     for( std::map<double,reco::GsfElectron>::reverse_iterator rit=electronMap.rbegin(); rit!=electronMap.rend(); ++rit){
    selected_electrons.push_back( (*rit).second );  // sort electrons by pt
    }
 
  //------------------------------------
 
    
   reco::Muon muon1, muon2;
   reco::GsfElectron electron1, electron2;
   
  if (selected_electrons.size() ==1 ) electron1 = selected_electrons[0];
  if (selected_electrons.size() > 1){
    electron1 = selected_electrons[0];
    electron2 = selected_electrons[1];
  }
  
  if (selected_muons.size() ==1 ) muon1 = selected_muons[0];
   if (selected_muons.size() > 1){
    muon1 = selected_muons[0];
    muon2 = selected_muons[1];
  }
   
       
     //  bool dimuEvent = false;
      // bool emuEvent  = false;
      // bool dielEvent = false;
       
       
        double ptel1=0.;
        double ptel2=0.;
        double ptmu1=0.;
        double ptmu2=0.;
        
       if (selected_electrons.size()==0) { ptel1 = 0;               ptel2 = 0;              }
       if (selected_electrons.size()==1) { ptel1 = electron1.pt();  ptel2 = 0;              }
       if (selected_electrons.size()>1)  { ptel1 = electron1.pt() ; ptel2 = electron2.pt();} 
       
       if (selected_muons.size()==0)     { ptmu1 = 0;               ptmu2 = 0;         }
       if (selected_muons.size()==1)     { ptmu1 = muon1.pt();      ptmu2 = 0;         }
       if (selected_muons.size()>1)      { ptmu1 = muon1.pt();      ptmu2 =muon2.pt();}
      
     
       
       if (selected_muons.size() + selected_electrons.size() > 1){
       
       if (ptel2 > ptmu1){ 
         if (electron1.charge()*electron2.charge()<0 && electron1.pt()>20 /*&& electron2.pt()>20*/ ) {
                 //   dielEvent=true; 
                    isElecDecay_recoacc=true;
                    isMuonDecay_recoacc=false;
                    isEMuDecay_recoacc=false;
               
                  Electron1 = selected_electrons[0];
                  Electron2 = selected_electrons[1];
                  
                  met_hwwdiel_ = caloMet[0].pt();
               }
       }
       
       else if (ptmu2 > ptel1){
      //   if (muon1.charge()*muon2.charge()<0 && muon1.pt()>20 /*&& muon2.pt()>20*/ ) dimuEvent =true;
      if (muon1.charge()*muon2.charge()<0 && muon1.pt()>20 /*&& fabs(muon1.eta())<2.1*/ ){
                 // dimuEvent =true;
                  isElecDecay_recoacc=false;
                  isMuonDecay_recoacc=true;
                  isEMuDecay_recoacc=false;
                  
                   Muon1 = selected_muons[0];
                   Muon2 = selected_muons[1];
                   
                   met_hwwdimu_ =   caloMet[0].pt();
             
               }
       }
       
       else {
       
         // if (muon1.charge()*electron1.charge()<0 &&  (muon1.pt()>20 || electron1.pt()>20) ) emuEvent = true;
      if (muon1.charge()*electron1.charge()<0 &&  (muon1.pt()>20 || electron1.pt()>20) /*&&
      fabs(muon1.eta())<2.1 */) {
             //  emuEvent = true;
                   isElecDecay_recoacc=false;
                   isMuonDecay_recoacc=false;
                   isEMuDecay_recoacc=true;
               
           
                    Muon1     = selected_muons[0];
                    Electron1 = selected_electrons[0];
                    
                    met_hwwemu_ =  caloMet[0].pt();
             }
       }
       
       }
       else{
       
       
               isElecDecay_recoacc=false;
               isMuonDecay_recoacc=false;
               isEMuDecay_recoacc=false;
       
       }
     
   
        
 //   }
  //  else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
//    std::cout << "nleptons = " << nleptons << " " << isvisible_WW << std::endl;
  }
  
}
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, Muon2, and ExpressReco_HICollisions_FallBack::pt.

Referenced by HLTHiggsBits::analyze().

                                                                 {
  if (_Monte) {
 
    
  //  if (&mctruth){
        
        //----selection based on reco---
  
   
        std::map<double,reco::Muon> muonMap;
   
      // keep globalmuons with pt>10, eta<2.4
        for (size_t i = 0; i < muonHandle.size(); ++ i) {
           if ( (muonHandle)[i].isGlobalMuon() && (muonHandle)[i].pt()>10 &&
            fabs((muonHandle)[i].eta())<2.4 ){ 
                muonMap[(muonHandle)[i].pt()]= (muonHandle)[i];         
           }  
        }
        // keep electrons with pt>10, eta<2.4, H/E<0.05, 0.6<E/p<2.5
           std::map<double,reco::GsfElectron> electronMap;
           for (size_t ii = 0; ii < electronHandle.size(); ++ ii) {
           if (  (electronHandle)[ii].pt()>10 && fabs((electronHandle)[ii].eta())<2.4 &&
           (electronHandle)[ii].hadronicOverEm()<0.05 &&
        (electronHandle)[ii].eSuperClusterOverP()>0.6 && (electronHandle)[ii].eSuperClusterOverP()<2.5){
                electronMap[(electronHandle)[ii].pt()]= (electronHandle)[ii];
        
           }  
        }
      
        std::vector<reco::Muon> selected_muons;  

     for( std::map<double,reco::Muon>::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){
    selected_muons.push_back( (*rit).second );  // sort muons by pt
    }
      
   
         std::vector<reco::GsfElectron> selected_electrons;

     for( std::map<double,reco::GsfElectron>::reverse_iterator rit=electronMap.rbegin(); rit!=electronMap.rend(); ++rit){
    selected_electrons.push_back( (*rit).second );  // sort electrons by pt
    }
      
 
       
       int posEle=0;
       int negEle=0;
       int posMu=0;
       int negMu=0;
       
                       
       for (size_t k=0; k<selected_muons.size();k++){    
         if (selected_muons[k].charge()>0) posMu++; //n muons pos charge
         else if (selected_muons[k].charge()<0) negMu++;  // n muons neg charge         
       }
       
        for (size_t k=0; k<selected_electrons.size();k++){   
         if (selected_electrons[k].charge()>0) posEle++;  // n electrons pos charge
         else if (selected_electrons[k].charge()<0) negEle++; // n electrons neg charge            
       }
      
     //----------
    
    int nElectron=0;
    int nMuon=0;
   
    bool hzz2e2mu_decay = false;   // at least 4 reco muons in the event
    bool hzz4e_decay =false;       // at least 4 electrons in the event
    bool hzz4mu_decay=false;       // at least 2 muons and 2 electrons
    
 
    if (selected_muons.size()>=4)  hzz4mu_decay=true;
    else if (selected_electrons.size()>=4) hzz4e_decay=true;
    else if (selected_muons.size()>=2 && selected_electrons.size()>=2) hzz2e2mu_decay=true;
    
 
     if (hzz2e2mu_decay) {
        if ( posEle>=1 && negEle>=1 ) {
           nElectron=posEle+negEle;
          }
        if ( posMu>=1 && negMu>=1 ) {
            nMuon=posMu+negMu;
        }
    }
     else if (hzz4e_decay) {
         if ( posEle>=2 && negEle>=2 ) {
          nElectron=posEle+negEle;
        }
     }
     else if (hzz4mu_decay) {
        if ( posMu>=2 && negMu>=2 ) {
          nMuon=posMu+negMu;
    }  
  }
  
  
  if (hzz2e2mu_decay && nElectron>=2 && nMuon>=2 ){  // at least 2 electrons and 2 muons
                                                       // with opp charge
                isEMuDecay_recoacc =true;
                 Muon1     = selected_muons[0];   
                 Electron1 = selected_electrons[0];  
   
   }
  else if (hzz4e_decay && nElectron>=4){
   isElecDecay_recoacc=true;
       Electron1 = selected_electrons[0];
       Electron2 = selected_electrons[1];
   
   }
  else if (hzz4mu_decay && nMuon>=4){
   isMuonDecay_recoacc =true;
       Muon1 = selected_muons[0];
       Muon2 = selected_muons[1];
   
   }
  else {
 
               isElecDecay_recoacc=false;
               isMuonDecay_recoacc=false;
               isEMuDecay_recoacc=false;
               }
               
 
      
   // }
    //else {std::cout << "%HLTHiggsTruth -- No MC truth information" << std::endl;}
//    std::cout << "nepair, nmupair = " << nepair << ", " << nmupair << " " << isvisible << std::endl;
  }
}
bool HLTHiggsTruth::decision ( ) const [inline]

Definition at line 86 of file HLTHiggsTruth.h.

References isvisible.

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

Definition at line 105 of file HLTHiggsTruth.h.

References isvisible_reco.

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

Definition at line 101 of file HLTHiggsTruth.h.

References isElecDecay_recoacc.

Referenced by HLTHiggsBits::analyze().

bool HLTHiggsTruth::ElecMuChannel_recoacc ( ) const [inline]

Definition at line 102 of file HLTHiggsTruth.h.

References isEMuDecay_recoacc.

Referenced by HLTHiggsBits::analyze().

{return isEMuDecay_recoacc;}; 
reco::GsfElectron HLTHiggsTruth::electron1_ ( ) const [inline]

Definition at line 143 of file HLTHiggsTruth.h.

References Electron1.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 144 of file HLTHiggsTruth.h.

References Electron2.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 145 of file HLTHiggsTruth.h.

References Electron3.

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

Definition at line 146 of file HLTHiggsTruth.h.

References Electron4.

{return Electron4;};
double HLTHiggsTruth::etaElectron1 ( ) const [inline]

Definition at line 114 of file HLTHiggsTruth.h.

References etaElMax.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 115 of file HLTHiggsTruth.h.

References etaElMin.

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

Definition at line 110 of file HLTHiggsTruth.h.

References etaMuMax.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 111 of file HLTHiggsTruth.h.

References etaMuMin.

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

Definition at line 121 of file HLTHiggsTruth.h.

References etaTauMax.

{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().

{
  
  //if (tau.begin() == tau.end()) std::cout << "No_llega_a_entrar_en_el_bucle" << std::endl;
  // loop on tau decays, check for an electron or muon
  for(reco::Candidate::const_iterator daughter=tau.begin();daughter!=tau.end(); ++daughter){
    //cout << "daughter_x" << std::endl;
    // if the tau daughter is a tau, it means the particle has still to be propagated.
    // In that case, return the result of the same method on that daughter.
    if(daughter->pdgId()==tau.pdgId()) return LeptonicTauDecay(*daughter, elecdec, muondec);
    // check for leptons
    elecdec |= std::abs(daughter->pdgId())==11;
    muondec |= std::abs(daughter->pdgId())==13;
    
    if (std::abs(daughter->pdgId())==11) {
      PtElFromTau = daughter->pt();
      EtaElFromTau = daughter->eta();
    }
    
    if (std::abs(daughter->pdgId())==13){
    PtMuFromTau = daughter->pt();
    EtaMuFromTau = daughter->eta();
    }
  }
    
}
double HLTHiggsTruth::met_hwwdiel ( ) const [inline]

Definition at line 149 of file HLTHiggsTruth.h.

References met_hwwdiel_.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 148 of file HLTHiggsTruth.h.

References met_hwwdimu_.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 150 of file HLTHiggsTruth.h.

References met_hwwemu_.

Referenced by HLTHiggsBits::analyze().

{return met_hwwemu_ ;};
reco::Muon HLTHiggsTruth::muon1_ ( ) const [inline]

Definition at line 135 of file HLTHiggsTruth.h.

References Muon1.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 136 of file HLTHiggsTruth.h.

References Muon2.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 137 of file HLTHiggsTruth.h.

References Muon3.

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

Definition at line 138 of file HLTHiggsTruth.h.

References Muon4.

{return Muon4;};
bool HLTHiggsTruth::MuonChannel_recoacc ( ) const [inline]

Definition at line 100 of file HLTHiggsTruth.h.

References isMuonDecay_recoacc.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 132 of file HLTHiggsTruth.h.

References Photon1.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 133 of file HLTHiggsTruth.h.

References Photon2.

Referenced by HLTHiggsBits::analyze().

{return Photon2;};
bool HLTHiggsTruth::PhotonChannel_acc ( ) const [inline]

Definition at line 96 of file HLTHiggsTruth.h.

References isPhotonDecay_acc.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 103 of file HLTHiggsTruth.h.

References isPhotonDecay_recoacc.

double HLTHiggsTruth::ptElectron1 ( ) const [inline]

Definition at line 112 of file HLTHiggsTruth.h.

References ptElMax.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 113 of file HLTHiggsTruth.h.

References ptElMin.

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

Definition at line 108 of file HLTHiggsTruth.h.

References ptMuMax.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 109 of file HLTHiggsTruth.h.

References ptMuMin.

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

Definition at line 120 of file HLTHiggsTruth.h.

References ptTauMax.

{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().

                                                                     {

  edm::ParameterSet myMCParams = pSet.getParameter<edm::ParameterSet>("RunParameters") ;
  std::vector<std::string> parameterNames = myMCParams.getParameterNames() ;
  
  for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
        iParam != parameterNames.end(); iParam++ ){
    if  ( (*iParam) == "Monte" ) _Monte =  myMCParams.getParameter<bool>( *iParam );
    else if ( (*iParam) == "Debug" ) _Debug =  myMCParams.getParameter<bool>( *iParam );
  }




//  const int kMaxMcTruth = 50000;
//  mcpid = new float[kMaxMcTruth];
//  mcvx = new float[kMaxMcTruth];
//  mcvy = new float[kMaxMcTruth];
//  mcvz = new float[kMaxMcTruth];
//  mcpt = new float[kMaxMcTruth];

   

  // MCtruth-specific branches of the tree 
//  HltTree->Branch("NobjMCPart",&nmcpart,"NobjMCPart/I");
//  HltTree->Branch("MCPid",mcpid,"MCPid[NobjMCPart]/I");
//  HltTree->Branch("MCVtxX",mcvx,"MCVtxX[NobjMCPart]/F");
//  HltTree->Branch("MCVtxY",mcvy,"MCVtxY[NobjMCPart]/F");
//  HltTree->Branch("MCVtxZ",mcvz,"MCVtxZ[NobjMCPart]/F");
//  HltTree->Branch("MCPt",mcpt,"MCPt[NobjMCPart]/F");

 }
bool HLTHiggsTruth::TauChannel_acc ( ) const [inline]

Definition at line 97 of file HLTHiggsTruth.h.

References isTauDecay_acc.

Referenced by HLTHiggsBits::analyze().

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

Definition at line 104 of file HLTHiggsTruth.h.

References isTauDecay_recoacc.

{return 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]

Definition at line 211 of file HLTHiggsTruth.h.

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

Definition at line 212 of file HLTHiggsTruth.h.

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

Definition at line 213 of file HLTHiggsTruth.h.

Referenced by electron3_().

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().

Definition at line 174 of file HLTHiggsTruth.h.

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

Definition at line 167 of file HLTHiggsTruth.h.

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

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.

Definition at line 169 of file HLTHiggsTruth.h.

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

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().

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().

Definition at line 206 of file HLTHiggsTruth.h.

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

Definition at line 207 of file HLTHiggsTruth.h.

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

Definition at line 208 of file HLTHiggsTruth.h.

Referenced by muon3_().

Definition at line 209 of file HLTHiggsTruth.h.

Referenced by muon4_().

Definition at line 203 of file HLTHiggsTruth.h.

Referenced by analyzeHgg(), and photon1_().

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().