ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootSuperCluster.h
Revision: 1.5
Committed: Wed Mar 11 12:44:56 2009 UTC (16 years, 1 month ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: JeSuisBeaucoupPlusGrosQunReco_2_2_7_01, RecoPhoton_2_2_7_02, pat_2_2_7_01, RecoPhoton_2_2_7_01, pat_2_2_5_03, pat_2_2_5_02, pat_2_2_5_01
Changes since 1.4: +63 -55 lines
Log Message:
Transition to 2.2.X

File Contents

# User Rev Content
1 mlethuil 1.1 #ifndef TRootSuperCluster_h
2     #define TRootSuperCluster_h
3    
4     /************************************************************************************************************************************
5     SuperCluster Type: ijk
6 lethuill 1.2 i = algo => 1=Island , 2=Hybrid, 3=multi5x5
7 mlethuil 1.1 j = detector => 1=ECAL Barrel , 2=ECAL Endcap
8 lethuill 1.2 k = corrections => 0=nopreshower / uncorrected , 1=no preshower / standard CMSSW corections
9     2=preshower / standard CMSSW corections , 3= preshower / uncorrected
10 mlethuil 1.1
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 lethuill 1.2 320 => Multi5x5 Endcap SuperClusters
18     322 => Corrected Multi5x5 Endcap SuperClusters with Preshower (standard CMSSW corrections)
19     323 => Multi5x5 Endcap SuperClusters with Preshower
20    
21 mlethuil 1.1 ************************************************************************************************************************************/
22    
23     #include <string>
24     #include <iostream>
25 lethuill 1.2 #include <vector>
26 mlethuil 1.1
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 lethuill 1.2 TRootSuperCluster() :
39 lethuill 1.5 TRootCluster()
40     ,nBasicClusters_(0)
41     ,subClusterUID_()
42     ,subClusterIndex_()
43     ,seedClusterVectorIndex_(-1)
44     ,preshowerEnergy_(0.)
45     ,rawEnergy_(0.)
46     ,seedCluster_(0)
47     ,photon_(0)
48     ,electron_(0)
49     {;}
50    
51 lethuill 1.2 TRootSuperCluster(const TRootSuperCluster& cluster) :
52 lethuill 1.5 TRootCluster(cluster)
53     ,nBasicClusters_(cluster.nBasicClusters_)
54     ,subClusterUID_(cluster.subClusterUID_)
55     ,subClusterIndex_(cluster.subClusterIndex_)
56     ,seedClusterVectorIndex_(cluster.seedClusterVectorIndex_)
57     ,preshowerEnergy_(cluster.preshowerEnergy_)
58     ,rawEnergy_(cluster.rawEnergy_)
59     ,seedCluster_(cluster.seedCluster_)
60     ,photon_(cluster.photon_)
61     ,electron_(cluster.photon_)
62     {;}
63    
64 lethuill 1.2 TRootSuperCluster(Double_t energy, Double_t eta, Double_t phi) :
65 lethuill 1.5 TRootCluster(energy, eta, phi)
66     ,nBasicClusters_(0)
67     ,subClusterUID_()
68     ,subClusterIndex_()
69     ,seedClusterVectorIndex_(-1)
70     ,preshowerEnergy_(0.)
71     ,rawEnergy_(0.)
72     ,seedCluster_(0)
73     ,photon_(0)
74     ,electron_(0)
75     {;}
76    
77 lethuill 1.2 TRootSuperCluster(Double_t energy, Double_t eta, Double_t phi, Double_t x, Double_t y, Double_t z) :
78 lethuill 1.5 TRootCluster(energy, eta, phi, x, y, z)
79     ,nBasicClusters_(0)
80     ,subClusterUID_()
81     ,subClusterIndex_()
82     ,seedClusterVectorIndex_(-1)
83     ,preshowerEnergy_(0.)
84     ,rawEnergy_(0.)
85     ,seedCluster_(0)
86     ,photon_(0)
87     ,electron_(0)
88     {;}
89    
90 lethuill 1.2 TRootSuperCluster(Double_t energy, Double_t eta, Double_t phi, Double_t x, Double_t y, Double_t z, Int_t det) :
91 lethuill 1.5 TRootCluster(energy, eta, phi, x, y, z, det)
92     ,nBasicClusters_(0)
93     ,subClusterUID_()
94     ,subClusterIndex_()
95     ,seedClusterVectorIndex_(-1)
96     ,preshowerEnergy_(0.)
97     ,rawEnergy_(0.)
98     ,seedCluster_(0)
99     ,photon_(0)
100     ,electron_(0)
101     {;}
102    
103 mlethuil 1.1 ~TRootSuperCluster() {;}
104    
105    
106     Int_t nBasicClusters() const { return nBasicClusters_; }
107     std::vector<Int_t> subClusterUID() const { return subClusterUID_; }
108     std::vector<Int_t> subClusterIndex() const { return subClusterIndex_; }
109 lethuill 1.4 Int_t seedIndex() const
110 mlethuil 1.1 {
111 lethuill 1.4 if( Int_t(subClusterIndex_.size())>seedClusterVectorIndex_)
112     {
113     return subClusterIndex_.at(seedClusterVectorIndex_);
114 mlethuil 1.1 }
115     else
116     {
117     cout << "No seed BasicCluster in this SuperCluster...." << endl;
118 lethuill 1.4 return -1;
119     }
120 mlethuil 1.1 }
121    
122 lethuill 1.2 Float_t preshowerEnergy() const { return preshowerEnergy_; }
123     Float_t rawEnergy() const { return rawEnergy_; }
124 lethuill 1.5 TObject* seedCluster() const { return seedCluster_.GetObject();}
125 lethuill 1.3 TObject* photon() const { return photon_.GetObject();}
126     TObject* electron() const { return electron_.GetObject();}
127     Bool_t isPhoton() const { return ( photon_.GetObject() == 0 ? false : true); }
128     Bool_t isElectron() const { return ( electron_.GetObject() == 0 ? false : true); }
129 lethuill 1.2
130 mlethuil 1.1 void setNBasicClusters(Int_t nBasicClusters) { nBasicClusters_ = nBasicClusters; }
131     void addSubClusterUID(Int_t uid) { subClusterUID_.push_back(uid); }
132     void clearSubClusterUID() { subClusterUID_.clear(); }
133     void addSubClusterIndex(Int_t idx) { subClusterIndex_.push_back(idx); }
134     void clearSubClusterIndex() { subClusterIndex_.clear(); }
135 lethuill 1.4 void setSeedClusterVectorIndex(Int_t seedClusterVectorIndex) { seedClusterVectorIndex_ = seedClusterVectorIndex; }
136 lethuill 1.2 void setPreshowerEnergy(Float_t preshowerEnergy) { preshowerEnergy_ = preshowerEnergy; }
137     void setRawEnergy(Float_t rawEnergy) { rawEnergy_ = rawEnergy; }
138 lethuill 1.5 void setSeedCluster(TObject* seedCluster) { seedCluster_ = seedCluster; }
139 lethuill 1.3 void setPhoton(TObject* photon) { photon_ = photon; }
140     void setElectron(TObject* electron) { electron_ = electron; }
141 mlethuil 1.1
142    
143     friend std::ostream& operator<< (std::ostream& stream, const TRootSuperCluster& clus) {
144     stream << "TRootSuperCluster - Type=" << clus.det_ << " (E,Et,eta,phi)=(" << clus.Mag() <<"," << clus.Pt() <<"," << clus.Eta() <<"," << clus.Phi() << ")"
145     << " Calo position (x,y,z)=(" << clus.calX() << "," << clus.calY() << "," << clus.calZ() << ")"
146 lethuill 1.2 << " nBasicClusters=" << clus.nBasicClusters() << " e3x3=" << clus.e3x3() << " e5x5=" << clus.e5x5() << " eMax=" << clus.eMax()<< " e2nd=" << clus.e2nd()
147     << " nXtals=" << clus.nXtals() << " preshowerEnergy=" << clus.preshowerEnergy() << " rawEnergy=" << clus.rawEnergy();
148 mlethuil 1.1 return stream;
149     };
150    
151    
152    
153     protected:
154    
155     Int_t nBasicClusters_;
156     std::vector<Int_t> subClusterUID_;
157     std::vector<Int_t> subClusterIndex_;
158 lethuill 1.4 Int_t seedClusterVectorIndex_; // position in subClusterIndex_ vector containing the index of the seed basic cluster in the TRootBasicCluster array
159 lethuill 1.2 Float_t preshowerEnergy_;
160     Float_t rawEnergy_;
161 lethuill 1.5 TRef seedCluster_;
162 lethuill 1.3 TRef photon_;
163     TRef electron_;
164 mlethuil 1.1
165 lethuill 1.4
166     ClassDef (TRootSuperCluster,5);
167 mlethuil 1.1 };
168    
169     #endif