ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootCluster.h
Revision: 1.6
Committed: Fri Sep 18 14:14:20 2009 UTC (15 years, 7 months ago) by lethuill
Content type: text/plain
Branch: MAIN
CVS Tags: all_3_3_2_01, all_3_2_5_02, all_3_2_5_01, HEAD
Changes since 1.5: +4 -3 lines
Log Message:
Update for 3.2.X

File Contents

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