ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Utils/interface/MetTools.h
(Generate patch)

Comparing UserCode/MitPhysics/Utils/interface/MetTools.h (file contents):
Revision 1.6 by sixie, Thu Jul 7 20:22:19 2011 UTC vs.
Revision 1.10 by ceballos, Sat Jul 7 11:33:58 2012 UTC

# Line 16 | Line 16
16   #include "MitAna/DataTree/interface/ElectronCol.h"
17   #include "MitAna/DataTree/interface/PFCandidateCol.h"
18   #include "MitAna/DataTree/interface/PFJetCol.h"
19 + #include "MitAna/DataTree/interface/GenericParticleCol.h"
20   #include "MitCommon/MathTools/interface/MathUtils.h"
21  
22   namespace mithep {
# Line 25 | Line 26 | namespace mithep {
26    public:
27  
28      MetTools(const MuonCol *fMuons, const PFCandidateCol *fPFCandidates,
29 <             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut=4.0, float etaCut = 3.0);
29 >             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut = 8.0, float etaCut = 5.0);
30      MetTools(const ElectronCol *fElectrons, const PFCandidateCol *fPFCandidates,
31 <             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut=4.0, float etaCut = 3.0);
31 >             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut = 8.0, float etaCut = 5.0);
32  
33      MetTools(const MuonCol *fMuons, const PFCandidateCol *fPFCandidates, const PFJetCol *fPFJets,
34 <             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut=4.0, float etaCut = 3.0);
34 >             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut = 8.0, float etaCut = 5.0);
35      MetTools(const ElectronCol *fElectrons, const PFCandidateCol *fPFCandidates, const PFJetCol *fPFJets,
36 <             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut=4.0, float etaCut = 3.0);
36 >             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut = 8.0, float etaCut = 5.0);
37  
38      MetTools(const MuonCol *fMuons, const ElectronCol *fElectrons, const PFCandidateCol *fPFCandidates,
39 <             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut=4.0, float etaCut = 3.0);
39 >             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut = 8.0, float etaCut = 5.0, float intRadius = 0.0,
40 >             const GenericParticle *genP = NULL);
41  
42      MetTools(const MuonCol *fMuons, const ElectronCol *fElectrons, const PFCandidateCol *fPFCandidates, const PFJetCol *fPFJets,
43 <             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut=4.0, float etaCut = 3.0);
43 >             const Vertex *fVertex, float deltaZCut = 0.1, float ptCut = 8.0, float etaCut = 5.0, float intRadius = 0.0,
44 >             const GenericParticle *genP = NULL);
45  
46  
47      ~MetTools() {}
# Line 64 | Line 67 | namespace mithep {
67      Met  GetMinimumTrackMet                       (const Met *UncorrectedMet);
68      Met  GetCorrectedMet()         { return fCorrectedMet; }
69      Met  GetCorrectedTrackMet()    { return fCorrectedTrackMet; }
70 +    Met  GetCHSMet()               { return fCHSMet; }
71 +    Met  GetNHSMet()               { return fNHSMet; }
72      FourVectorM  Recoil()          { return fRecoil; }
73      FourVectorM  ChargedRecoil()   { return fChargedRecoil; }
74  
# Line 77 | Line 82 | namespace mithep {
82    private:
83      Met fCorrectedMet;
84      Met fCorrectedTrackMet;
85 +    Met fCHSMet;
86 +    Met fNHSMet;
87      FourVectorM fRecoil;
88      FourVectorM fChargedRecoil;
89      
# Line 87 | Line 94 | namespace mithep {
94    double MetTools::GetProjectedMet(const V *fV, const Met *UncorrectedMet) {
95      double projectedMet = UncorrectedMet->Pt();
96      double minDPhi = 999;
90    int index = -1;
97      for (UInt_t m = 0; m < fV->GetEntries(); ++m) {
98 <      if (MathUtils::DeltaPhi(UncorrectedMet->Phi(), fV->At(m)->Phi()) < minDPhi) {
99 <        minDPhi = MathUtils::DeltaPhi(UncorrectedMet->Phi(), fV->At(m)->Phi());
94 <        index = m;
98 >      if (fabs(MathUtils::DeltaPhi(UncorrectedMet->Phi(), fV->At(m)->Phi())) < minDPhi) {
99 >        minDPhi = fabs(MathUtils::DeltaPhi(UncorrectedMet->Phi(), fV->At(m)->Phi()));
100        }
101      }
102      if (minDPhi < TMath::Pi()/2.) return projectedMet = projectedMet * sin(minDPhi);
# Line 102 | Line 107 | namespace mithep {
107    double MetTools::GetProjectedMet(const V *fV) {
108      double projectedMet = fCorrectedMet.Pt();
109      double minDPhi = 999;
105    int index = -1;
110      for (UInt_t m = 0; m < fV->GetEntries(); ++m) {
111 <      if (MathUtils::DeltaPhi(fCorrectedMet.Phi(), fV->At(m)->Phi()) < minDPhi) {
112 <        minDPhi = MathUtils::DeltaPhi(fCorrectedMet.Phi(), fV->At(m)->Phi());
109 <        index = m;
111 >      if (fabs(MathUtils::DeltaPhi(fCorrectedMet.Phi(), fV->At(m)->Phi())) < minDPhi) {
112 >        minDPhi = fabs(MathUtils::DeltaPhi(fCorrectedMet.Phi(), fV->At(m)->Phi()));
113        }
114      }
115      if (minDPhi < TMath::Pi()/2.) return projectedMet = projectedMet * sin(minDPhi);
# Line 117 | Line 120 | namespace mithep {
120    double MetTools::GetProjectedTrackMet(const V *fV) {
121      double projectedMet = fCorrectedTrackMet.Pt();
122      double minDPhi = 999;
120    int index = -1;
123      for (UInt_t m = 0; m < fV->GetEntries(); ++m) {
124 <      if (MathUtils::DeltaPhi(fCorrectedTrackMet.Phi(), fV->At(m)->Phi()) < minDPhi) {
125 <        minDPhi = MathUtils::DeltaPhi(fCorrectedTrackMet.Phi(), fV->At(m)->Phi());
124 <        index = m;
124 >      if (fabs(MathUtils::DeltaPhi(fCorrectedTrackMet.Phi(), fV->At(m)->Phi())) < minDPhi) {
125 >        minDPhi = fabs(MathUtils::DeltaPhi(fCorrectedTrackMet.Phi(), fV->At(m)->Phi()));
126        }
127      }
128      if (minDPhi < TMath::Pi()/2.) return projectedMet = projectedMet * sin(minDPhi);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines