13#ifndef EMC_REC_CRYSTAL_H
14#define EMC_REC_CRYSTAL_H
18#include "CLHEP/Units/PhysicalConstants.h"
19#include "CLHEP/Geometry/Point3D.h"
20#ifndef ENABLE_BACKWARDS_COMPATIBILITY
32 fType=INVALID_CRYSTAL;
34 for(
int i=0;i<10;i++){
44 for(
int i=0;i<10;i++){
53 for(
int i=0;i<10;i++){
63 {
return INVALID_CRYSTAL; }
69 {
return SEVEN_PLANE; }
77 if( (fType!=SIX_PLANE) && (fType!=SEVEN_PLANE) )
78 { fType=INVALID_CRYSTAL; }
89 if(fType==SIX_PLANE) {
90 return (fV[0]+fV[1]+fV[2]+fV[3]+fV[4]+fV[5]+fV[6]+fV[7])/8;
92 if(fType==SEVEN_PLANE) {
93 return (fV[0]+fV[1]+fV[2]+fV[3]+fV[4]+fV[5]+fV[6]+fV[7]+fV[8]+fV[9])/10;
101 if(fType==SIX_PLANE) {
102 return (fV[0]+fV[1]+fV[2]+fV[3])/4;
104 if(fType==SEVEN_PLANE) {
105 return (fV[0]+fV[1]+fV[2]+fV[3]+fV[4])/5;
116 void SetX(
int index,
double value) {
117 fV[index].setX(value);
120 void SetY(
int index,
double value) {
121 fV[index].setY(value);
124 void SetZ(
int index,
double value) {
125 fV[index].setZ(value);
131 cout<<
"H="<<fV[4].distance(fV[7])<<endl;
132 cout<<
"h="<<fV[0].distance(fV[3])<<endl;
135 cout<<
"t="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
136 cout<<
"B="<<fV[4].distance(fV[5])<<endl;
137 cout<<
"b="<<fV[0].distance(fV[1])<<endl;
138 cout<<
"A="<<fV[7].distance(fV[6])<<endl;
139 cout<<
"a="<<fV[3].distance(fV[2])<<endl;
140 cout<<
"L="<<fV[4].distance(fV[0])<<endl;
144 if(fType==SIX_PLANE) {
145 cout<<
"A="<<fV[5].distance(fV[6])<<endl;
146 cout<<
"a="<<fV[1].distance(fV[2])<<endl;
147 cout<<
"B="<<fV[7].distance(fV[4])<<endl;
148 cout<<
"b="<<fV[0].distance(fV[3])<<endl;
149 cout<<
"C="<<fV[7].distance(fV[6])<<endl;
150 cout<<
"c="<<fV[3].distance(fV[2])<<endl;
151 cout<<
"D="<<fV[4].distance(fV[5])<<endl;
152 cout<<
"d="<<fV[1].distance(fV[0])<<endl;
157 cout<<
"alpha1="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
160 cout<<
"alpha2="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
163 cout<<
"alpha3="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
166 cout<<
"alpha4="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
169 t=t1*t2/(t1.mag()*t2.mag());
171 cout<<
"L="<<t1.mag()*
t<<endl;
173 cout<<
"A="<<fV[5].distance(fV[9])<<endl;
174 cout<<
"a="<<fV[0].distance(fV[4])<<endl;
175 cout<<
"B="<<fV[9].distance(fV[8])<<endl;
176 cout<<
"b="<<fV[4].distance(fV[3])<<endl;
177 cout<<
"C="<<fV[8].distance(fV[7])<<endl;
178 cout<<
"c="<<fV[3].distance(fV[2])<<endl;
179 cout<<
"D="<<fV[7].distance(fV[6])<<endl;
180 cout<<
"d="<<fV[2].distance(fV[1])<<endl;
181 cout<<
"E="<<fV[6].distance(fV[5])<<endl;
182 cout<<
"e="<<fV[1].distance(fV[0])<<endl;
187 cout<<
"alpha1="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
190 cout<<
"alpha2="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
193 cout<<
"alpha3="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
196 cout<<
"alpha4="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
199 cout<<
"alpha5="<<acos(t1*t2/(t1.mag()*t2.mag()))*180/
pi<<endl;
202 t=t1*t2/(t1.mag()*t2.mag());
204 cout<<
"L="<<t1.mag()*
t<<endl;
217 static const int INVALID_CRYSTAL = -1;
218 static const int SIX_PLANE = 0;
219 static const int SEVEN_PLANE = 1;
HepGeom::Point3D< double > HepPoint3D
ostream & operator<<(ostream &os, const EmcRecCrystal &aCrystal)
void EndCapCheckout() const
HepPoint3D Center() const
void SetY(int index, double value)
HepPoint3D Get(int index) const
void BarrelCheckout() const
void SetX(int index, double value)
static int InvalidCrystal()
HepPoint3D FrontCenter() const
void SetZ(int index, double value)
EmcRecCrystal(const EmcRecCrystal &aCry)
EmcRecCrystal & operator=(const EmcRecCrystal &aCry)
void Set(int index, const HepPoint3D &aPoint)