ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/LeptonSelection/src/FSR.cc
(Generate patch)

Comparing UserCode/MitHzz4l/LeptonSelection/src/FSR.cc (file contents):
Revision 1.1 by khahn, Mon May 28 16:40:45 2012 UTC vs.
Revision 1.2 by khahn, Mon May 28 19:04:28 2012 UTC

# Line 9 | Line 9 | using namespace std;
9   extern vector<bool> PFnoPUflag;
10  
11   //--------------------------------------------------------------------------------------------------
12 + double  betaCorrectedIso(ControlFlags & ctrl,
13 +                         const mithep::PFCandidate * photon,
14 +                         const mithep::Array<mithep::PFCandidate> * fPFCandidates )
15 + //--------------------------------------------------------------------------------------------------
16 + {
17 +
18 +  //
19 +  // final iso
20 +  //
21 +  Double_t fChargedIso  = 0.0;
22 +  Double_t fGammaIso  = 0.0;
23 +  Double_t fNeutralHadronIso  = 0.0;
24 +
25 +  //
26 +  // Loop over PF Candidates
27 +  //
28 +  for(int k=0; k<fPFCandidates->GetEntries(); ++k) {
29 +
30 +    if( !(PFnoPUflag[k]) ) continue; // my PF no PU hack
31 +    const mithep::PFCandidate *pf = (mithep::PFCandidate*)((*fPFCandidates)[k]);
32 +    
33 +    Double_t deta = (photon->Eta() - pf->Eta());
34 +    Double_t dphi = mithep::MathUtils::DeltaPhi(Double_t(photon->Phi()),Double_t(pf->Phi()));
35 +    Double_t dr = mithep::MathUtils::DeltaR(photon->Phi(),photon->Eta(), pf->Phi(), pf->Eta());
36 +    if (dr > 0.4) continue;
37 +    
38 +    // skip this photon
39 +    if( abs(pf->PFType()) == mithep::PFCandidate::eGamma &&
40 +        pf->Et() == photon->Et() ) continue;
41 +
42 +    if (dr < 1.0) {
43 +      
44 +      //
45 +      // Charged Iso
46 +      //
47 +      if (pf->Charge() != 0 && (pf->HasTrackerTrk()||pf->HasGsfTrk()) ) {
48 +        if( dr < 0.01 ) continue;
49 +        //      if (abs(pf->PFType()) == mithep::PFCandidate::eElectron ||
50 +        //          abs(pf->PFType()) == mithep::PFCandidate::eMuon) continue;
51 +        fChargedIso += pf->Pt();
52 +      }
53 +      
54 +      //
55 +      // Gamma Iso
56 +      //
57 +      else if (abs(pf->PFType()) == mithep::PFCandidate::eGamma) {
58 +        if( pf->Pt() > 0.5 && dr > 0.08) // need the inner veto?
59 +          fGammaIso += pf->Pt();
60 +      }
61 +      
62 +      //
63 +      // Other Neutrals
64 +      //
65 +      else {
66 +        // KH, add to sync
67 +        if( pf->Pt() > 0.5 )
68 +          fNeutralHadronIso += pf->Pt();
69 +      }
70 +      
71 +    }
72 +    
73 +  }
74 +
75 +  double pfIso = fChargedIso + fGammaIso + fNeutralHadronIso;
76 +  return pfIso;
77 + }
78 +
79 +
80 +
81 + //--------------------------------------------------------------------------------------------------
82   // typeI = PF IDed photons.  NB : repurpose PFnoPUflag, flip for recovered photons  
83   // so that they are skipped in the isolation calculation
84   //--------------------------------------------------------------------------------------------------
85 < bool recover_typeI_Photon( mithep::Muon * mu,
85 > bool recover_typeI_Photon( ControlFlags & ctrl,
86 >                           mithep::Muon * mu,
87                             const mithep::Array<mithep::PFCandidate> * pfArr )
88   //--------------------------------------------------------------------------------------------------
89   {
# Line 29 | Line 100 | bool recover_typeI_Photon( mithep::Muon
100        if( dR < 0.07 ) photonIndices.push_back(i);
101        
102        // "need tighter cuts for other photons ..."
103 <      if( dR < 0.5 && pf->Pt() > 4. )  photonIndices.push_back(i);
103 >      if( dR < 0.5 && pf->Pt() > 4. && betaCorrectedIso(ctrl, pf, pfArr)/pf->Pt() < 1.0)  
104 >        photonIndices.push_back(i);
105      }
106      
107      int index=-1;
# Line 64 | Line 136 | bool recover_typeI_Photon( mithep::Muon
136   //--------------------------------------------------------------------------------------------------
137   // typeII = "PFClusters linked to muons"
138   //--------------------------------------------------------------------------------------------------
139 < bool recover_typeII_Photon( mithep::Muon * mu,
139 > bool recover_typeII_Photon( ControlFlags & ctrl,
140 >                            mithep::Muon * mu,
141                              const mithep::Array<mithep::PFCandidate> * pfArr )
142   //--------------------------------------------------------------------------------------------------
143   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines