ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/SuperCluster.h
Revision: 1.15
Committed: Tue Nov 24 15:57:45 2009 UTC (15 years, 5 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c
Changes since 1.14: +3 -3 lines
Log Message:
Et

File Contents

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