ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Met.h
Revision: 1.13
Committed: Mon Apr 6 13:44:52 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.12: +6 -4 lines
Log Message:
Bugfix to prevent correction array from splitting.

File Contents

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