ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/CaloTower.h
Revision: 1.8
Committed: Wed Feb 18 15:38:54 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
Changes since 1.7: +3 -6 lines
Log Message:
Reworked particle interface to cache FourVectorM

File Contents

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