ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/CaloTower.h
Revision: 1.4
Committed: Thu Nov 13 14:08:06 2008 UTC (16 years, 5 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006
Changes since 1.3: +31 -31 lines
Log Message:
Optimized size of CaloTower

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $ Id $
3 //
4 // Calo Tower
5 //
6 // Details to be worked out...
7 //
8 // Authors: Si Xie
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef DATATREE_CALOTOWER_H
12 #define DATATREE_CALOTOWER_H
13
14 #include <TMath.h>
15 #include "MitAna/DataTree/interface/DataObject.h"
16
17 namespace mithep
18 {
19 class CaloTower : public DataObject
20 {
21 public:
22 CaloTower() {}
23 ~CaloTower() {}
24
25 void SetEmEnergy(Double_t EmEnergy) { fEmEnergy = EmEnergy; }
26 void SetPosition(Double_t x, Double_t y, Double_t z)
27 { fPosition.SetXYZ(x,y,z); }
28 void SetHadEnergy(Double_t HadEnergy) { fHadEnergy = HadEnergy; }
29 void SetOuterEnergy(Double_t OuterEnergy) { fOuterEnergy = OuterEnergy; }
30
31 const FourVectorM Mom() const;
32 Double_t Eta() const { return fPosition.Eta(); }
33 Double_t Phi() const { return fPosition.Phi(); }
34 Double_t Theta() const { return fPosition.Theta(); }
35 Double_t E() const { return (fEmEnergy + fHadEnergy); }
36 Double_t Et() const { return E()*TMath::Sin(Theta()); }
37 Double_t EtWithHO() const { return EWithHO()*TMath::Sin(Theta()); }
38 Double_t EWithHO() const { return (fEmEnergy + fHadEnergy + fOuterEnergy); }
39 Double_t EmEnergy() const { return fEmEnergy; }
40 const ThreeVectorC Position() const { return fPosition; }
41 Double_t HadEnergy() const { return fHadEnergy; }
42 Double_t OuterEnergy() const { return fOuterEnergy; }
43 Double_t EmEt() const { return fEmEnergy*TMath::Sin(Theta()); }
44 Double_t HadEt() const { return fHadEnergy*TMath::Sin(Theta()); }
45 Double_t OuterEt() const { return fOuterEnergy*TMath::Sin(Theta()); }
46
47 protected:
48 ThreeVectorC32 fPosition; //Position of Tower
49 Double32_t fEmEnergy; //tower energy in Ecal
50 Double32_t fHadEnergy; //tower energy in Hcal
51 Double32_t fOuterEnergy;
52
53 ClassDef(CaloTower, 1) // Generic particle class
54 };
55 }
56
57 //--------------------------------------------------------------------------------------------------
58 inline const mithep::FourVectorM mithep::CaloTower::Mom() const
59 {
60 // Compute and return four momentum
61
62 if ( E() > 0 )
63 return mithep::FourVectorM(Et(),Eta(),Phi(),0.0);
64 else
65 return mithep::FourVectorM();
66 }
67 #endif