ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/SuperCluster.h
Revision: 1.7
Committed: Tue Dec 9 17:47:00 2008 UTC (16 years, 4 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_006b, Mit_006a
Changes since 1.6: +24 -24 lines
Log Message:
Added ObjType to retrieve type of object.

File Contents

# User Rev Content
1 sixie 1.1 //--------------------------------------------------------------------------------------------------
2 loizides 1.7 // $Id: SuperCluster.h,v 1.6 2008/11/14 14:46:35 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     #include "MitAna/DataTree/interface/DataObject.h"
16     #include "MitAna/DataTree/interface/BasicCluster.h"
17     #include "MitAna/DataCont/interface/RefArray.h"
18    
19     namespace mithep
20     {
21     class SuperCluster : public DataObject
22     {
23     public:
24 loizides 1.7 SuperCluster() : fEnergy(0), fEtaWidth(0), fPreshowerEnergy(0),
25     fPhiWidth(0), fRawEnergy(0) {}
26 sixie 1.1 ~SuperCluster() {}
27    
28 sixie 1.2 const BasicCluster *Cluster(UInt_t i) const { return fClusters.At(i); }
29     UInt_t ClusterSize() const { return fClusters.GetEntries(); }
30     Double_t Energy() const { return fEnergy; }
31     Double_t Eta() const { return fPoint.Eta(); }
32     Double_t EtaWidth() const { return fEtaWidth; }
33 loizides 1.7 EObjType ObjType() const { return kSuperCluster; }
34 sixie 1.2 Double_t Phi() const { return fPoint.Phi(); }
35     Double_t PhiWidth() const { return fPhiWidth; }
36 loizides 1.7 void Print(Option_t *opt="") const;
37 sixie 1.2 Double_t PreshowerEnergy() const { return fPreshowerEnergy; }
38     Double_t RawEnergy() const { return fRawEnergy; }
39     const BasicCluster *Seed() const;
40     Double_t X() const { return fPoint.X(); }
41     Double_t Y() const { return fPoint.Y(); }
42 loizides 1.3 Double_t Z() const { return fPoint.Z(); }
43 loizides 1.7 void AddCluster(const BasicCluster *c) { fClusters.Add(c); }
44     void SetEnergy(Double_t energy) { fEnergy = energy; }
45     void SetEtaWidth(Double_t etaWidth) { fEtaWidth = etaWidth; }
46     void SetPhiWidth(Double_t phiWidth) { fPhiWidth = phiWidth; }
47     void SetPreshowerEnergy(Double_t e) { fPreshowerEnergy = e; }
48     void SetRawEnergy(Double_t rawEnergy) { fRawEnergy = rawEnergy; }
49     void SetSeed(const BasicCluster *s)
50     { fSeedRef = const_cast<BasicCluster*>(s); }
51 sixie 1.1 void SetXYZ(Double_t x, Double_t y, Double_t z) { fPoint.SetXYZ(x,y,z); }
52    
53     protected:
54 loizides 1.7 Double32_t fEnergy; //super cluster energy
55     Double32_t fEtaWidth; //width in Phi
56     ThreeVector32 fPoint; //centroid Position
57     Double32_t fPreshowerEnergy; //energy in the preshower
58     Double32_t fPhiWidth; //width in Phi
59     Double32_t fRawEnergy; //super cluster raw energy
60     RefArray<BasicCluster,1024> fClusters; //assigned basic clusters
61     TRef fSeedRef; //seed cluster
62 sixie 1.1
63 loizides 1.7 ClassDef(SuperCluster, 1) // Super cluster class
64 sixie 1.1 };
65     }
66    
67     //--------------------------------------------------------------------------------------------------
68     inline const mithep::BasicCluster *mithep::SuperCluster::Seed() const
69     {
70 loizides 1.7 // Return basic cluster seed.
71 sixie 1.1
72     return static_cast<const BasicCluster*>(fSeedRef.GetObject());
73     }
74     #endif