ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Met.h
Revision: 1.18
Committed: Wed Sep 9 03:38:26 2009 UTC (15 years, 7 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, HEAD
Branch point for: Mit_025c_branch
Changes since 1.17: +4 -1 lines
Log Message:
Add MakeCopy functions and cleaned up some jetmet getters and setters

File Contents

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