ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Met.h
Revision: 1.15
Committed: Tue Apr 7 14:59:08 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_009c, Mit_009b, Mit_009a, Mit_009
Changes since 1.14: +2 -1 lines
Log Message:
Add HaveCorrections so that at analysis time one can figure out if corrections are stored or not. This method will go away when we move to 010.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Met.h,v 1.14 2009/04/07 12:16:56 loizides Exp $
3 //
4 // Met
5 //
6 // Class to store missing transverse energy information.
7 // This is the base class for various specific kinds of met (CaloMet, PFMet, etc.),
8 // but can also be used directly.
9 //
10 // Authors: C.Loizides
11 //--------------------------------------------------------------------------------------------------
12
13 #ifndef MITANA_DATATREE_MET_H
14 #define MITANA_DATATREE_MET_H
15
16 #include "MitAna/DataTree/interface/Types.h"
17 #include "MitAna/DataTree/interface/Track.h"
18
19 namespace mithep
20 {
21 class Met : public Particle
22 {
23 public:
24 Met() :
25 fMex(0), fMey(0), fSumEt(0), fElongit(0) { }
26 Met(Double_t mex, Double_t mey) :
27 fMex(mex), fMey(mey), fSumEt(0), fElongit(0) { }
28
29 const FArrDouble32 &Dmex() const { return fDmex; }
30 const FArrDouble32 &Dmey() const { return fDmey; }
31 const FArrDouble32 &DSumEt() const { return fDSumEt; }
32 Double_t Elongitudinal() const { return fElongit; }
33 Bool_t HasCorrections() const;
34 Double_t MetSig() const;
35 Double_t Mex() const { return fMex; }
36 Double_t Mey() const { return fMey; }
37 EObjType ObjType() const { return kMet; }
38 Double_t SumEt() const { return fSumEt; }
39 void PushCorrectionX(Double_t x) { fDmex.Add(x); }
40 void PushCorrectionY(Double_t x) { fDmey.Add(x); }
41 void PushCorrectionSumEt(Double_t x) { fDSumEt.Add(x); }
42 void SetElongitudinal(Double_t x) { fElongit = x; }
43 void SetSumEt(Double_t x) { fSumEt = x; }
44
45 protected:
46 void Clear(Option_t * /*option*/ ="");
47 void GetMom() const;
48
49 Double32_t fMex; //[0,0,14]x-component
50 Double32_t fMey; //[0,0,14]y-component
51 Double32_t fSumEt; //[0,0,14]scalar sum of ET over all objects
52 Double32_t fElongit; //[0,0,14]z-comp. of vector E sum
53 FArrDouble32 fDmex; //||array of all corr. applied to MEx
54 FArrDouble32 fDmey; //||array of all corr. applied to MEy
55 FArrDouble32 fDSumEt; //||array of all corr. applied to SumET
56
57 ClassDef(Met, 2) // Missing transverse energy class
58 };
59 }
60
61 //--------------------------------------------------------------------------------------------------
62 inline void mithep::Met::Clear(Option_t *)
63 {
64 // Clear by deleting the std::vectors.
65
66 fDmex.Clear();
67 fDmey.Clear();
68 fDSumEt.Clear();
69 }
70
71 //--------------------------------------------------------------------------------------------------
72 inline void mithep::Met::GetMom() const
73 {
74 // Get momentum values from stored values.
75
76 Double_t pt = TMath::Sqrt(fMex*fMex+fMey*fMey);
77 Double_t phi = TMath::ATan2(fMey,fMex);
78 fCachedMom.SetCoordinates(pt,0,phi,0);
79 }
80
81 //--------------------------------------------------------------------------------------------------
82 inline Double_t mithep::Met::MetSig() const
83 {
84 // Calculate Met Significance
85
86 if (fSumEt>0.0)
87 return (Et()/TMath::Sqrt(fSumEt));
88 else
89 return -1.0;
90 }
91 #endif