ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootCluster.h
Revision: 1.3
Committed: Tue Nov 18 13:57:10 2008 UTC (16 years, 5 months 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, pat_2_1_12_02, pat_2_1_12_01, Common-2008_11_24, Common-2008_11_19
Changes since 1.2: +1 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 mlethuil 1.1 #ifndef TRootCluster_h
2     #define TRootCluster_h
3    
4     /************************************************************************************************************************************
5     Cluster 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     BasicClusters
12     110 => Island Barrel BasicClusters
13     120 => Island Endcap BasicClusters
14     210 => hybrid Barrel BasicClusters
15 lethuill 1.2 320 => multi5x5 Endcap BasicClusters
16 mlethuil 1.1
17     SuperClusters
18     110 => Island Barrel SuperClusters
19     120 => Island Endcap SuperClusters
20     121 => Corrected Island Endcap SuperClusters (standard CMSSW corrections)
21     122 => Corrected Island Endcap SuperClusters with Preshower (standard CMSSW corrections)
22     210 => Hybrid Barrel SuperClusters
23     211 => Corrected Hybrid Barrel SuperClusters (standard CMSSW corrections)
24 lethuill 1.2 320 => Multi5x5 Endcap SuperClusters
25     322 => Corrected Multi5x5 Endcap SuperClusters with Preshower (standard CMSSW corrections)
26     323 => Multi5x5 Endcap SuperClusters with Preshower
27    
28 mlethuil 1.1 Shapes variables (e3x3, e5x5, eMax, e2nd) are not modified by CMSSW energy corrections
29     Shapes variables for SuperClusters correspond to shapes variables of the seed BasicCluster
30    
31     ************************************************************************************************************************************/
32    
33     #include <string>
34     #include <iostream>
35    
36     #include "Rtypes.h"
37     #include "TVector3.h"
38 lethuill 1.2 #include "TMath.h"
39 lethuill 1.3 #include "TRef.h"
40 mlethuil 1.1
41     using namespace std;
42    
43     class TRootCluster : public TVector3
44     {
45    
46     public:
47    
48     TRootCluster() : TVector3(), position_(), det_(-1), e3x3_(0.), e5x5_(0.), eMax_(0.), e2nd_(0.), nXtals_(0), uid_(0) {;}
49     TRootCluster(const TRootCluster& cluster) : TVector3(cluster), position_(cluster.position_), det_(cluster.det_),
50     e3x3_(cluster.e3x3_), e5x5_(cluster.e5x5_), eMax_(cluster.eMax_), e2nd_(cluster.e2nd_), nXtals_(cluster.nXtals_), uid_(cluster.uid_) {;}
51     TRootCluster(Double_t energy, Double_t eta, Double_t phi) : position_(), det_(-1), e3x3_(0.), e5x5_(0.), eMax_(0.), e2nd_(0.), nXtals_(0), uid_(0)
52     {
53     this->SetPtEtaPhi(energy*TMath::Sin(2.0*TMath::ATan(TMath::Exp(-eta))), eta, phi);
54     }
55    
56     TRootCluster(Double_t energy, Double_t eta, Double_t phi, Double_t x, Double_t y, Double_t z) :
57     position_(x,y,z), det_(-1), e3x3_(0.), e5x5_(0.), eMax_(0.), e2nd_(0.), nXtals_(0), uid_(0)
58     {
59     this->SetPtEtaPhi(energy*TMath::Sin(2.0*TMath::ATan(TMath::Exp(-eta))), eta, phi);
60     }
61    
62     TRootCluster(Double_t energy, Double_t eta, Double_t phi, Double_t x, Double_t y, Double_t z, Int_t det) :
63     position_(x,y,z), det_(det), e3x3_(0.), e5x5_(0.), eMax_(0.), e2nd_(0.), nXtals_(0), uid_(0)
64     {
65     this->SetPtEtaPhi(energy*TMath::Sin(2.0*TMath::ATan(TMath::Exp(-eta))), eta, phi);
66     }
67    
68     TRootCluster(const TVector3 &momentum) : TVector3(momentum), position_(), det_(-1), e3x3_(0.), e5x5_(0.), eMax_(0.), e2nd_(0.), nXtals_(0), uid_(0) {;}
69     TRootCluster(const TVector3 &momentum, const TVector3 &position, Int_t det) : TVector3(momentum), position_(position), det_(det), e3x3_(0.), e5x5_(0.), eMax_(0.), e2nd_(0.), nXtals_(0), uid_(0) {;}
70     ~TRootCluster() {;}
71    
72    
73     Double_t calX() const { return position_.x(); }
74     Double_t calY() const { return position_.y(); }
75     Double_t calZ() const { return position_.z(); }
76     Int_t det() const { return det_; }
77     Int_t type() const { return det_; }
78     Double_t e3x3() const { return e3x3_; }
79     Double_t e5x5() const { return e5x5_; }
80     Double_t eMax() const { return eMax_; }
81     Double_t e2nd() const { return e2nd_; }
82     Int_t nXtals() const { return nXtals_; }
83     Int_t uid() const { return uid_; }
84    
85    
86     void setCalX(Double_t x) { position_.SetX(x); }
87     void setCalY(Double_t y) { position_.SetY(y); }
88     void setCalZ(Double_t z) { position_.SetZ(z); }
89     void setDet(Int_t det) { det_ = det; }
90     void setType(Int_t det) { det_ = det; }
91     void setE3x3(Double_t e3x3) { e3x3_ = e3x3; }
92     void setE5x5(Double_t e5x5) { e5x5_ = e5x5; }
93     void setEmax(Double_t eMax) { eMax_ = eMax; }
94     void setE2nd(Double_t e2nd) { e2nd_ = e2nd; }
95     void setNxtals(Int_t nXtals) { nXtals_ = nXtals; }
96     void setUid(Int_t uid) { uid_ = uid; }
97    
98    
99     friend std::ostream& operator<< (std::ostream& stream, const TRootCluster& clus) {
100     stream << "TRootCluster - Type=" << clus.det() << " (E,Et,eta,phi)=(" << clus.Mag() <<"," << clus.Pt() <<"," << clus.Eta() <<"," << clus.Phi() << ")"
101     << " Calo position (x,y,z)=(" << clus.calX() << "," << clus.calY() << "," << clus.calZ() << ")"
102     << " e3x3=" << clus.e3x3() << " e5x5=" << clus.e5x5() << " eMax=" << clus.eMax()<< " e2nd=" << clus.e2nd() << " nXtals=" << clus.nXtals();
103     return stream;
104     };
105    
106    
107    
108     protected:
109    
110     TVector3 position_;
111     Int_t det_;
112     Double_t e3x3_;
113     Double_t e5x5_;
114     Double_t eMax_;
115     Double_t e2nd_;
116     Int_t nXtals_;
117     Int_t uid_;
118    
119    
120 lethuill 1.2 ClassDef (TRootCluster,2);
121 mlethuil 1.1 };
122    
123     #endif