1 |
sixie |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
sixie |
1.14 |
// $Id: SuperCluster.h,v 1.13 2009/10/26 09:48:09 loizides 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 |
|
|
#include "MitAna/DataCont/interface/RefArray.h"
|
19 |
bendavid |
1.8 |
#include "MitAna/DataCont/interface/Ref.h"
|
20 |
sixie |
1.1 |
|
21 |
|
|
namespace mithep
|
22 |
|
|
{
|
23 |
|
|
class SuperCluster : public DataObject
|
24 |
|
|
{
|
25 |
|
|
public:
|
26 |
loizides |
1.7 |
SuperCluster() : fEnergy(0), fEtaWidth(0), fPreshowerEnergy(0),
|
27 |
|
|
fPhiWidth(0), fRawEnergy(0) {}
|
28 |
sixie |
1.1 |
|
29 |
loizides |
1.13 |
void AddCluster(const BasicCluster *c) { fClusters.Add(c); }
|
30 |
loizides |
1.12 |
const BasicCluster *Cluster(UInt_t i) const { return fClusters.At(i); }
|
31 |
|
|
UInt_t ClusterSize() const { return fClusters.Entries(); }
|
32 |
loizides |
1.13 |
Int_t Compare(const TObject *o) const;
|
33 |
loizides |
1.12 |
Double_t Energy() const { return fEnergy; }
|
34 |
sixie |
1.14 |
Double_t Et() const;
|
35 |
loizides |
1.12 |
Double_t Eta() const { return fPoint.Eta(); }
|
36 |
|
|
Double_t EtaWidth() const { return fEtaWidth; }
|
37 |
loizides |
1.13 |
Bool_t IsSortable() const { return kTRUE; }
|
38 |
loizides |
1.12 |
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 |
sixie |
1.1 |
|
55 |
|
|
protected:
|
56 |
loizides |
1.12 |
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 |
sixie |
1.1 |
|
65 |
loizides |
1.7 |
ClassDef(SuperCluster, 1) // Super cluster class
|
66 |
sixie |
1.1 |
};
|
67 |
|
|
}
|
68 |
loizides |
1.13 |
|
69 |
|
|
//--------------------------------------------------------------------------------------------------
|
70 |
sixie |
1.14 |
inline Double_t mithep::SuperCluster::Et() const
|
71 |
|
|
{
|
72 |
|
|
// Return Transverse Energy
|
73 |
|
|
return fEnergy*fPoint.Rho()/fPoint.V().R();
|
74 |
|
|
|
75 |
|
|
}
|
76 |
|
|
|
77 |
|
|
//--------------------------------------------------------------------------------------------------
|
78 |
loizides |
1.13 |
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 |
sixie |
1.1 |
#endif
|