Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DFCALShower.h
Go to the documentation of this file.
1 // $Id: DFCALShower.h 1899 2006-07-13 16:29:56Z davidl $
2 //
3 // File: DFCALShower.h
4 // Created: Tue Jan 22 11:57:50 EST 2005
5 // Creator: remitche (on Linux mantrid00 2.4.20-18.8smp i686)
6 //
7 
8 #ifndef _DFCALShower_
9 #define _DFCALShower_
10 
11 #include <math.h>
12 #include <DVector3.h>
13 #include <DLorentzVector.h>
14 #include <DMatrix.h>
15 #include <TMatrixFSym.h>
16 #include "DFCALCluster.h"
17 using namespace std;
18 
19 #include <JANA/JObject.h>
20 #include <JANA/JFactory.h>
21 using namespace jana;
22 
23 class DFCALShower:public JObject{
24  public:
25  JOBJECT_PUBLIC(DFCALShower);
26 
27  DFCALShower();
28  ~DFCALShower();
29 
30  // shower position in calorimeter in global coordinates, after depth correction
31  // for the depth correction, the default vertex is in the target center
32  DVector3 getPosition() const;
33  DVector3 getPositionError() const;
34  double getEnergy() const;
35  double getTime() const;
36  double getDocaTrack() const;
37  double getTimeTrack() const;
38  double getSumU() const;
39  double getSumV() const;
40  double getE9E25() const;
41  double getE1E9() const;
42  int getNumBlocks() const;
43 
44  // set shower information
45  void setPosition( const DVector3& aPosition );
46  void setEnergy( const double energy );
47  void setTime( const double time );
48  void setDocaTrack( const double docaTrack );
49  void setTimeTrack( const double tTrack );
50  void setSumU( const double sumU );
51  void setSumV( const double sumV );
52  void setE9E25( const double e9e25 );
53  void setE1E9( const double e1e9 );
54  void setNumBlocks( const int numBlocks );
55 
56  TMatrixFSym ExyztCovariance;
57 
58  float EErr() const { return sqrt(ExyztCovariance(0,0)); }
59  float xErr() const { return sqrt(ExyztCovariance(1,1)); }
60  float yErr() const { return sqrt(ExyztCovariance(2,2)); }
61  float zErr() const { return sqrt(ExyztCovariance(3,3)); }
62  float tErr() const { return sqrt(ExyztCovariance(4,4)); }
63  float XYcorr() const {
64  if (xErr()>0 && yErr()>0) return ExyztCovariance(1,2)/xErr()/yErr();
65  else return 0;
66  }
67  float XZcorr() const {
68  if (xErr()>0 && zErr()>0) return ExyztCovariance(1,3)/xErr()/zErr();
69  else return 0;
70  }
71  float YZcorr() const {
72  if (yErr()>0 && zErr()>0) return ExyztCovariance(2,3)/yErr()/zErr();
73  else return 0;
74  }
75  float EXcorr() const {
76  if (EErr()>0 && xErr()>0) return ExyztCovariance(0,1)/EErr()/xErr();
77  else return 0;
78  }
79  float EYcorr() const {
80  if (EErr()>0 && yErr()>0) return ExyztCovariance(0,2)/EErr()/yErr();
81  else return 0;
82  }
83  float EZcorr() const {
84  if (EErr()>0 && zErr()>0) return ExyztCovariance(0,3)/EErr()/zErr();
85  else return 0;
86  }
87  float XTcorr() const {
88  if (xErr()>0 && tErr()>0) return ExyztCovariance(1,4)/xErr()/tErr();
89  else return 0;
90  }
91  float YTcorr() const {
92  if (yErr()>0 && tErr()>0) return ExyztCovariance(2,4)/yErr()/tErr();
93  else return 0;
94  }
95  float ZTcorr() const {
96  if (zErr()>0 && tErr()>0) return ExyztCovariance(3,4)/zErr()/tErr();
97  else return 0;
98  }
99  float ETcorr() const {
100  if (EErr()>0 && tErr()>0) return ExyztCovariance(0,4)/EErr()/tErr();
101  else return 0;
102  }
103 
104 
105 
106  void toStrings(vector<pair<string,string> > &items)const{
107  AddString(items, "E(GeV)", "%6.2f", getEnergy());
108  AddString(items, "X(cm)", "%7.2f", getPosition().X());
109  AddString(items, "Y(cm)", "%7.2f", getPosition().Y());
110  AddString(items, "Z(cm)", "%7.2f", getPosition().Z());
111  AddString(items, "t(ns)", "%7.2f", getTime());
112  AddString(items, "dE", "%5.3f", EErr());
113  AddString(items, "dx", "%5.3f", xErr());
114  AddString(items, "dy", "%5.3f", yErr());
115  AddString(items, "dz", "%5.3f", zErr());
116  AddString(items, "dt", "%5.3f", tErr());
117  AddString(items, "docaTr","%7.2f", getDocaTrack());
118  AddString(items, "timeTr","%7.2f", getTimeTrack());
119  AddString(items, "sumU", "%7.2f", getSumU());
120  AddString(items, "sumV", "%7.2f", getSumV());
121  AddString(items, "E9E25", "%7.2f", getE9E25());
122  AddString(items, "E1E9", "%7.2f", getE1E9());
123  AddString(items, "numBlocks", "%3.0i",getNumBlocks());
124  AddString(items, "EXcorr", "%5.3f", EXcorr());
125  AddString(items, "EYcorr", "%5.3f", EYcorr());
126  AddString(items, "EZcorr", "%5.3f", EZcorr());
127  AddString(items, "ETcorr", "%5.3f", ETcorr());
128  AddString(items, "XYcorr", "%5.3f", XYcorr());
129  AddString(items, "XZcorr", "%5.3f", XZcorr());
130  AddString(items, "XTcorr", "%5.3f", XTcorr());
131  AddString(items, "YZcorr", "%5.3f", YZcorr());
132  AddString(items, "YTcorr", "%5.3f", YTcorr());
133  AddString(items, "ZTcorr", "%5.3f", ZTcorr());
134  }
135 
136  private:
137 
138  double fEnergy;
139  double fTime;
140  DVector3 fPosition; // Shower position in the FCAL
141  double fTimeTr;
142  double fDocaTr;
143  double fSumU;
144  double fSumV;
145  double fE9E25;
146  double fE1E9;
148 };
149 
150 
152 {
153  return fPosition;
154 }
155 
156 inline double DFCALShower::getEnergy() const
157 {
158  return fEnergy;
159 }
160 
161 inline double DFCALShower::getTime() const
162 {
163  return fTime;
164 }
165 
166 inline double DFCALShower::getDocaTrack() const { return fDocaTr; }
167 inline double DFCALShower::getTimeTrack() const { return fTimeTr; }
168 inline double DFCALShower::getSumU() const { return fSumU; }
169 inline double DFCALShower::getSumV() const { return fSumV; }
170 inline double DFCALShower::getE9E25() const { return fE9E25; }
171 inline double DFCALShower::getE1E9() const { return fE1E9; }
172 inline int DFCALShower::getNumBlocks() const { return iNumBlocks; }
173 
174 #endif // _DFCALShower_
175 
double getEnergy() const
Definition: DFCALShower.h:156
float yErr() const
Definition: DFCALShower.h:60
double fE1E9
Definition: DFCALShower.h:146
float YZcorr() const
Definition: DFCALShower.h:71
DVector3 fPosition
Definition: DFCALShower.h:140
TVector3 DVector3
Definition: DVector3.h:14
void toStrings(vector< pair< string, string > > &items) const
Definition: DFCALShower.h:106
float xErr() const
Definition: DFCALShower.h:59
float EErr() const
Definition: DFCALShower.h:58
double fSumV
Definition: DFCALShower.h:144
double getTime() const
Definition: DFCALShower.h:161
float XTcorr() const
Definition: DFCALShower.h:87
double getDocaTrack() const
Definition: DFCALShower.h:166
float XYcorr() const
Definition: DFCALShower.h:63
float YTcorr() const
Definition: DFCALShower.h:91
double fEnergy
Definition: DFCALShower.h:138
#define X(str)
Definition: hddm-c.cpp:83
double fSumU
Definition: DFCALShower.h:143
double fDocaTr
Definition: DFCALShower.h:142
float EZcorr() const
Definition: DFCALShower.h:83
float EYcorr() const
Definition: DFCALShower.h:79
TMatrixFSym ExyztCovariance
Definition: DFCALShower.h:56
double getE9E25() const
Definition: DFCALShower.h:170
double getSumU() const
Definition: DFCALShower.h:168
double fTimeTr
Definition: DFCALShower.h:141
float tErr() const
Definition: DFCALShower.h:62
float ETcorr() const
Definition: DFCALShower.h:99
double getSumV() const
Definition: DFCALShower.h:169
double fTime
Definition: DFCALShower.h:139
double sqrt(double)
double getTimeTrack() const
Definition: DFCALShower.h:167
int getNumBlocks() const
Definition: DFCALShower.h:172
float ZTcorr() const
Definition: DFCALShower.h:95
float EXcorr() const
Definition: DFCALShower.h:75
double fE9E25
Definition: DFCALShower.h:145
double getE1E9() const
Definition: DFCALShower.h:171
DVector3 getPosition() const
Definition: DFCALShower.h:151
float zErr() const
Definition: DFCALShower.h:61
float XZcorr() const
Definition: DFCALShower.h:67