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.1 by mlethuil, Mon May 19 16:12:12 2008 UTC vs.
Revision 1.6 by lethuill, Fri Sep 18 14:14:20 2009 UTC

# Line 2 | Line 2
2   #define TRootCluster_h
3  
4   /************************************************************************************************************************************
5 <        Cluster Type: ijk
6 <        i = algo =>  1=Island , 2=Hybrid
7 <        j = detector => 1=ECAL Barrel , 2=ECAL Endcap
8 <        k = corrections => 0=uncorrected , 1=standard CMSSW corections , 2=standard CMSSW corections + Preshower
9 <        
10 <        BasicClusters
11 <        110 => Island Barrel BasicClusters
12 <        120 => Island Endcap BasicClusters
13 <        210 => hybrid Barrel BasicClusters
14 <
15 <        SuperClusters
16 <        110 => Island Barrel SuperClusters
17 <        120 => Island Endcap SuperClusters
18 <        121 => Corrected Island Endcap SuperClusters (standard CMSSW corrections)
19 <        122 => Corrected Island Endcap SuperClusters with Preshower (standard CMSSW corrections)
20 <        210 => Hybrid Barrel SuperClusters
21 <        211 => Corrected Hybrid Barrel SuperClusters (standard CMSSW corrections)
22 <        
23 <        Shapes variables (e3x3, e5x5, eMax, e2nd) are not modified by CMSSW energy corrections
24 <        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 > 310 => multi5x5 Barrel BasicClusters
16 > 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  
32   ************************************************************************************************************************************/
33  
# Line 30 | Line 36
36  
37   #include "Rtypes.h"
38   #include "TVector3.h"
39 + #include "TMath.h"
40 + #include "TRef.h"
41  
42   using namespace std;
43  
44   class TRootCluster : public TVector3
45   {
38        
39 public:
40        
41        TRootCluster() : TVector3(), position_(), det_(-1), e3x3_(0.), e5x5_(0.), eMax_(0.), e2nd_(0.), nXtals_(0), uid_(0) {;}
42        TRootCluster(const TRootCluster& cluster) : TVector3(cluster), position_(cluster.position_), det_(cluster.det_),
43        e3x3_(cluster.e3x3_), e5x5_(cluster.e5x5_), eMax_(cluster.eMax_), e2nd_(cluster.e2nd_), nXtals_(cluster.nXtals_), uid_(cluster.uid_) {;}
44        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)
45        {
46                this->SetPtEtaPhi(energy*TMath::Sin(2.0*TMath::ATan(TMath::Exp(-eta))), eta, phi);
47        }
48                
49        TRootCluster(Double_t energy, Double_t eta, Double_t phi, Double_t x, Double_t y, Double_t z) :
50                        position_(x,y,z), 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, Int_t det) :
56                        position_(x,y,z), det_(det), 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(const TVector3 &momentum) : TVector3(momentum), position_(), det_(-1), e3x3_(0.), e5x5_(0.), eMax_(0.), e2nd_(0.), nXtals_(0), uid_(0) {;}
62        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) {;}
63        ~TRootCluster() {;}
64
65        
66        Double_t calX() const  { return position_.x(); }
67        Double_t calY() const  { return position_.y(); }
68        Double_t calZ() const  { return position_.z(); }
69        Int_t det() const  { return det_; }
70        Int_t type() const  { return det_; }
71        Double_t e3x3() const   { return e3x3_; }
72        Double_t e5x5() const   { return e5x5_; }
73        Double_t eMax() const   { return eMax_; }
74        Double_t e2nd() const   { return e2nd_; }
75        Int_t nXtals() const   { return nXtals_; }
76        Int_t uid() const   { return uid_; }
77
78
79        void setCalX(Double_t x) { position_.SetX(x); }
80        void setCalY(Double_t y) { position_.SetY(y); }
81        void setCalZ(Double_t z) { position_.SetZ(z); }
82        void setDet(Int_t det) { det_ = det; }  
83        void setType(Int_t det) { det_ = det; }
84        void setE3x3(Double_t e3x3) { e3x3_ = e3x3; }
85        void setE5x5(Double_t e5x5) { e5x5_ = e5x5; }
86        void setEmax(Double_t eMax) { eMax_ = eMax; }
87        void setE2nd(Double_t e2nd) { e2nd_ = e2nd; }
88        void setNxtals(Int_t nXtals) { nXtals_ = nXtals; }
89        void setUid(Int_t uid) { uid_ = uid; }
90
91
92        friend std::ostream& operator<< (std::ostream& stream, const TRootCluster& clus) {
93                stream << "TRootCluster - Type=" << clus.det() << "  (E,Et,eta,phi)=(" << clus.Mag() <<"," << clus.Pt() <<"," << clus.Eta() <<"," << clus.Phi() << ")"
94                                << " Calo position (x,y,z)=(" << clus.calX() << "," << clus.calY() << "," << clus.calZ() << ")"
95                                << " e3x3=" << clus.e3x3() << " e5x5=" << clus.e5x5() << " eMax=" << clus.eMax()<< " e2nd=" << clus.e2nd() << " nXtals=" << clus.nXtals();
96                return stream;
97        };
98        
99        
100                
101 protected:
102        
103        TVector3 position_;
104        Int_t det_;
105        Double_t e3x3_;
106        Double_t e5x5_;
107        Double_t eMax_;
108        Double_t e2nd_;
109        Int_t nXtals_;
110        Int_t uid_;
46  
47 +   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 +      UInt_t uid() const   { return uid_; }
85 +      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 +      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 +      void setUid(UInt_t uid) { uid_ = uid; }
104 +
105 +
106 +      friend std::ostream& operator<< (std::ostream& stream, const TRootCluster& clus)
107 +      {
108 +         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 +      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 +
121 +      
122 +   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 +      UInt_t uid_;
132 +
133 +      ClassDef (TRootCluster,2);
134  
113        ClassDef (TRootCluster,1);
135   };
136  
137   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines