ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootSuperCluster.h
Revision: 1.2
Committed: Thu Oct 30 16:22:26 2008 UTC (16 years, 6 months ago) by lethuill
Content type: text/plain
Branch: MAIN
Changes since 1.1: +63 -11 lines
Log Message:
Updated for 2.1.X
Add PreshowerEnergy and RawEnergy

File Contents

# Content
1 #ifndef TRootSuperCluster_h
2 #define TRootSuperCluster_h
3
4 /************************************************************************************************************************************
5 SuperCluster Type: ijk
6 i = algo => 1=Island , 2=Hybrid, 3=multi5x5
7 j = detector => 1=ECAL Barrel , 2=ECAL Endcap
8 k = corrections => 0=nopreshower / uncorrected , 1=no preshower / standard CMSSW corections
9 2=preshower / standard CMSSW corections , 3= preshower / uncorrected
10
11 110 => Island Barrel SuperClusters
12 120 => Island Endcap SuperClusters
13 121 => Corrected Island Endcap SuperClusters (standard CMSSW corrections)
14 122 => Corrected Island Endcap SuperClusters with Preshower (standard CMSSW corrections)
15 210 => Hybrid Barrel SuperClusters
16 211 => Corrected Hybrid Barrel SuperClusters (standard CMSSW corrections)
17 320 => Multi5x5 Endcap SuperClusters
18 322 => Corrected Multi5x5 Endcap SuperClusters with Preshower (standard CMSSW corrections)
19 323 => Multi5x5 Endcap SuperClusters with Preshower
20
21 ************************************************************************************************************************************/
22
23 #include <string>
24 #include <iostream>
25 #include <vector>
26
27 #include "Rtypes.h"
28
29 #include "../interface/TRootCluster.h"
30
31 using namespace std;
32
33 class TRootSuperCluster : public TRootCluster
34 {
35
36 public:
37
38 TRootSuperCluster() :
39 TRootCluster()
40 ,nBasicClusters_(0)
41 ,subClusterUID_()
42 ,subClusterIndex_()
43 ,preshowerEnergy_(0.)
44 ,rawEnergy_(0.)
45 {;}
46
47 TRootSuperCluster(const TRootSuperCluster& cluster) :
48 TRootCluster(cluster)
49 ,nBasicClusters_(cluster.nBasicClusters_)
50 ,subClusterUID_(cluster.subClusterUID_)
51 ,subClusterIndex_(cluster.subClusterIndex_)
52 ,preshowerEnergy_(cluster.preshowerEnergy_)
53 ,rawEnergy_(cluster.rawEnergy_)
54 {;}
55
56 TRootSuperCluster(Double_t energy, Double_t eta, Double_t phi) :
57 TRootCluster(energy, eta, phi)
58 ,nBasicClusters_(0)
59 ,subClusterUID_()
60 ,subClusterIndex_()
61 ,preshowerEnergy_(0.)
62 ,rawEnergy_(0.)
63 {;}
64
65 TRootSuperCluster(Double_t energy, Double_t eta, Double_t phi, Double_t x, Double_t y, Double_t z) :
66 TRootCluster(energy, eta, phi, x, y, z)
67 ,nBasicClusters_(0)
68 ,subClusterUID_()
69 ,subClusterIndex_()
70 ,preshowerEnergy_(0.)
71 ,rawEnergy_(0.)
72 {;}
73
74 TRootSuperCluster(Double_t energy, Double_t eta, Double_t phi, Double_t x, Double_t y, Double_t z, Int_t det) :
75 TRootCluster(energy, eta, phi, x, y, z, det)
76 ,nBasicClusters_(0)
77 ,subClusterUID_()
78 ,subClusterIndex_()
79 ,preshowerEnergy_(0.)
80 ,rawEnergy_(0.)
81 {;}
82
83 ~TRootSuperCluster() {;}
84
85
86 Int_t nBasicClusters() const { return nBasicClusters_; }
87 std::vector<Int_t> subClusterUID() const { return subClusterUID_; }
88 std::vector<Int_t> subClusterIndex() const { return subClusterIndex_; }
89 Int_t seedIndex() const
90 {
91 if(subClusterIndex_.size()>0)
92 {
93 return subClusterIndex_.at(0);
94 }
95 else
96 {
97 cout << "No seed BasicCluster in this SuperCluster...." << endl;
98 return 0;
99 }
100 }
101
102 Float_t preshowerEnergy() const { return preshowerEnergy_; }
103 Float_t rawEnergy() const { return rawEnergy_; }
104
105 void setNBasicClusters(Int_t nBasicClusters) { nBasicClusters_ = nBasicClusters; }
106 void addSubClusterUID(Int_t uid) { subClusterUID_.push_back(uid); }
107 void clearSubClusterUID() { subClusterUID_.clear(); }
108 void addSubClusterIndex(Int_t idx) { subClusterIndex_.push_back(idx); }
109 void clearSubClusterIndex() { subClusterIndex_.clear(); }
110 void setPreshowerEnergy(Float_t preshowerEnergy) { preshowerEnergy_ = preshowerEnergy; }
111 void setRawEnergy(Float_t rawEnergy) { rawEnergy_ = rawEnergy; }
112
113
114 friend std::ostream& operator<< (std::ostream& stream, const TRootSuperCluster& clus) {
115 stream << "TRootSuperCluster - Type=" << clus.det_ << " (E,Et,eta,phi)=(" << clus.Mag() <<"," << clus.Pt() <<"," << clus.Eta() <<"," << clus.Phi() << ")"
116 << " Calo position (x,y,z)=(" << clus.calX() << "," << clus.calY() << "," << clus.calZ() << ")"
117 << " nBasicClusters=" << clus.nBasicClusters() << " e3x3=" << clus.e3x3() << " e5x5=" << clus.e5x5() << " eMax=" << clus.eMax()<< " e2nd=" << clus.e2nd()
118 << " nXtals=" << clus.nXtals() << " preshowerEnergy=" << clus.preshowerEnergy() << " rawEnergy=" << clus.rawEnergy();
119 return stream;
120 };
121
122
123
124 protected:
125
126 Int_t nBasicClusters_;
127 std::vector<Int_t> subClusterUID_;
128 std::vector<Int_t> subClusterIndex_;
129 Float_t preshowerEnergy_;
130 Float_t rawEnergy_;
131
132 ClassDef (TRootSuperCluster,3);
133 };
134
135 #endif