34 #include "EEmcL3Tracks.h"
39 Float_t px, Float_t py, Float_t pz,
41 Int_t np, Float_t l , Int_t flag)
44 mPx=px; mPy=py; mPz=pz;
55 h.getOrigin (mOx,mOy,mOz);
56 h.getMomentum(mPx,mPy,mPz);
66 EEmcHelix :: print(FILE *fd)
const
68 fprintf(fd,
"\torigin : %+f %+f %+f\n",mOx,mOy,mOz);
69 fprintf(fd,
"\tmomentum: %+f %+f %+f\n",mPx,mPy,mPz);
70 fprintf(fd,
"\tcharge : %+1d\tfield : %+f\n",mQ,mB);
71 fprintf(fd,
"\tpoints : %2d \tlength: %+f\n",mPoints,mLength);
72 fprintf(fd,
"\tflag : %2d (0x%04x)\n",mFlag,mFlag);
86 mHelix =
new TClonesArray(
"EEmcHelix",1000);
87 mDedx =
new Float_t[mAllocTracks];
88 mTrackSize = mAllocTracks;
95 EEmcL3Tracks::~EEmcL3Tracks()
97 if(mHelix)
delete mHelix;
98 if(mDedx)
delete [] mDedx;
104 EEmcL3Tracks::add(
EEmcHelix &h, Float_t de)
107 if(mNTracks >= mTrackSize ) {
108 Int_t newSize = mTrackSize + mAllocTracks;
109 Float_t *newDedx =
new Float_t[newSize];
110 memcpy(newDedx,mDedx,mTrackSize*
sizeof(Float_t));
113 mTrackSize = newSize;
117 TClonesArray &helices = *mHelix;
118 mDedx[mNTracks] = de;
122 return ( (helix==NULL) ? 1 : 0 );
130 EEmcL3Tracks::clear()
134 mVertX = mVertY = mVertZ = MAXFLOAT;
140 EEmcL3Tracks::getHelix (
int i)
142 return (0<=i && i<mNTracks) ? ((
EEmcHelix *)(mHelix->At(i))) : NULL;
152 void EEmcL3Tracks :: print(FILE *fd)
const
154 fprintf(fd,
"L3 tracks %d:\n",mNTracks);
155 if(mNTracks<=0)
return;
156 fprintf(fd,
"\tvertex: (%+8.3f %+8.3f %+8.3f)\n",mVertX,mVertY,mVertZ);
157 for(Int_t i=0;i<mHelix->GetEntries();i++) {
158 fprintf(fd,
"\ttrack#%d dE/dx=%g\n",i,mDedx[i]);
159 ((
EEmcHelix *)(mHelix->At(i)))->print(fd);