ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/CaloTower.h
Revision: 1.6
Committed: Tue Dec 9 17:46:59 2008 UTC (16 years, 5 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.5: +29 -27 lines
Log Message:
Added ObjType to retrieve type of object.

File Contents

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