ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/SuperCluster.h
Revision: 1.20
Committed: Sun Sep 19 18:26:41 2010 UTC (14 years, 7 months ago) by bendavid
Content type: text/plain
Branch: MAIN
Changes since 1.19: +2 -1 lines
Log Message:
Add AbsEta accessor

File Contents

# User Rev Content
1 sixie 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.20 // $Id: SuperCluster.h,v 1.19 2010/08/18 01:36:48 bendavid Exp $
3 sixie 1.1 //
4     // SuperCluster
5     //
6 loizides 1.7 // This class holds the super cluster information.
7 sixie 1.1 //
8     // Authors: S.Xie
9     //--------------------------------------------------------------------------------------------------
10    
11 loizides 1.3 #ifndef MITANA_DATATREE_SUPERCLUSTER_H
12     #define MITANA_DATATREE_SUPERCLUSTER_H
13 sixie 1.1
14     #include <TMath.h>
15 loizides 1.11 #include "MitCommon/DataFormats/interface/Vect3C.h"
16 sixie 1.1 #include "MitAna/DataTree/interface/DataObject.h"
17     #include "MitAna/DataTree/interface/BasicCluster.h"
18 bendavid 1.18 #include "MitAna/DataTree/interface/CaloTower.h"
19 sixie 1.1 #include "MitAna/DataCont/interface/RefArray.h"
20 bendavid 1.8 #include "MitAna/DataCont/interface/Ref.h"
21 sixie 1.1
22     namespace mithep
23     {
24     class SuperCluster : public DataObject
25     {
26     public:
27 loizides 1.7 SuperCluster() : fEnergy(0), fEtaWidth(0), fPreshowerEnergy(0),
28     fPhiWidth(0), fRawEnergy(0) {}
29 sixie 1.1
30 sixie 1.16 void AddCluster(const BasicCluster *c) { fClusters.Add(c); }
31 bendavid 1.18 void AddTower(const CaloTower *t) { fCaloTowers.Add(t); }
32 sixie 1.16 const BasicCluster *Cluster(UInt_t i) const { return fClusters.At(i); }
33     UInt_t ClusterSize() const { return fClusters.Entries(); }
34     Int_t Compare(const TObject *o) const;
35     Double_t Energy() const { return fEnergy; }
36     Double_t Et() const;
37     Double_t Eta() const { return fPoint.Eta(); }
38 bendavid 1.20 Double_t AbsEta() const { return TMath::Abs(Eta()); }
39 sixie 1.16 Double_t EtaWidth() const { return fEtaWidth; }
40 bendavid 1.19 Bool_t HasTower(const CaloTower *t) const { return fCaloTowers.HasObject(t); }
41 sixie 1.16 Double_t HcalDepth1Energy() const { return fHcalDepth1Energy; }
42     Double_t HcalDepth2Energy() const { return fHcalDepth2Energy; }
43     Double_t HadDepth1OverEm() const { return fHcalDepth1Energy/fEnergy; }
44     Double_t HadDepth2OverEm() const { return fHcalDepth2Energy/fEnergy; }
45     Double_t HadOverEm() const { return (fHcalDepth1Energy+
46     fHcalDepth2Energy)/fEnergy; }
47     Bool_t IsSortable() const { return kTRUE; }
48     EObjType ObjType() const { return kSuperCluster; }
49 bendavid 1.18 UInt_t NTowers() const { return fCaloTowers.Entries(); }
50 sixie 1.16 Double_t Phi() const { return fPoint.Phi(); }
51     Double_t PhiWidth() const { return fPhiWidth; }
52     ThreeVectorC Point() const { return fPoint.V(); }
53     void Print(Option_t *opt="") const;
54     Double_t PreshowerEnergy() const { return fPreshowerEnergy; }
55     Double_t RawEnergy() const { return fRawEnergy; }
56     Double_t Rho() const { return fPoint.Rho(); }
57     const BasicCluster *Seed() const { return fSeedRef.Obj(); }
58 bendavid 1.18 const CaloTower *Tower(UInt_t i) const { return fCaloTowers.At(i); }
59 sixie 1.16 void SetEnergy(Double_t energy) { fEnergy = energy; }
60     void SetEtaWidth(Double_t etaWidth) { fEtaWidth = etaWidth; }
61     void SetPhiWidth(Double_t phiWidth) { fPhiWidth = phiWidth; }
62     void SetPreshowerEnergy(Double_t e) { fPreshowerEnergy = e; }
63     void SetRawEnergy(Double_t rawEnergy) { fRawEnergy = rawEnergy; }
64     void SetHcalDepth1Energy(Double_t x) { fHcalDepth1Energy = x; }
65     void SetHcalDepth2Energy(Double_t x) { fHcalDepth2Energy = x; }
66     void SetSeed(const BasicCluster *s) { fSeedRef = s; }
67     void SetXYZ(Double_t x, Double_t y, Double_t z) { fPoint.SetXYZ(x,y,z); }
68 sixie 1.1
69     protected:
70 sixie 1.16 Vect3C fPoint; //centroid Position
71     Double32_t fEnergy; //[0,0,14]super cluster energy
72     Double32_t fEtaWidth; //[0,0,14]width in Phi
73     Double32_t fPreshowerEnergy; //[0,0,14]energy in the preshower
74     Double32_t fPhiWidth; //[0,0,14]width in Phi
75     Double32_t fRawEnergy; //[0,0,14]super cluster raw energy
76     Double32_t fHcalDepth1Energy; //[0,0,14] hcal depth1 over ECAL energy
77     Double32_t fHcalDepth2Energy; //[0,0,14] hcal depth2 over ECAL energy
78     RefArray<BasicCluster> fClusters; //assigned basic clusters
79     Ref<BasicCluster> fSeedRef; //seed cluster
80 bendavid 1.18 RefArray<CaloTower> fCaloTowers; //calo towers (matched by detid)
81 sixie 1.1
82 bendavid 1.18 ClassDef(SuperCluster, 3) // Super cluster class
83 sixie 1.1 };
84     }
85 loizides 1.13
86     //--------------------------------------------------------------------------------------------------
87 sixie 1.14 inline Double_t mithep::SuperCluster::Et() const
88     {
89 loizides 1.15 // Return transverse energy.
90    
91 sixie 1.14 return fEnergy*fPoint.Rho()/fPoint.V().R();
92     }
93    
94     //--------------------------------------------------------------------------------------------------
95 loizides 1.13 inline Int_t mithep::SuperCluster::Compare(const TObject *o) const
96     {
97     // Default compare function for sorting according to transverse momentum.
98     // Returns -1 if this object is smaller than given object, 0 if objects are
99     // equal and 1 if this is larger than given object.
100    
101     const mithep::SuperCluster *s = dynamic_cast<const mithep::SuperCluster *>(o);
102     if (!s)
103     return 1;
104    
105     Double_t mye = Energy();
106     Double_t e = s->Energy();
107     if (mye>e)
108     return -1;
109     else if (e>mye)
110     return +1;
111     return 0;
112     }
113 sixie 1.1 #endif