ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Morgan/interface/TRootCluster.h
(Generate patch)

Comparing UserCode/Morgan/interface/TRootCluster.h (file contents):
Revision 1.2 by lethuill, Thu Oct 30 16:24:18 2008 UTC vs.
Revision 1.4 by lethuill, Wed Jun 10 11:17:05 2009 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines