#include <SwimObjSR.h>
Public Member Functions | |
| SwimObjSR (Double_t, Double_t, Double_t, Double_t, Double_t, Double_t, Int_t, const VldContext *) | |
| ~SwimObjSR () | |
| Int_t | SwimTo (Double_t, Bool_t docheck=0) |
Public Attributes | |
| Double_t | fu |
| Double_t | fv |
| Double_t | fz |
| Double_t | fdudz |
| Double_t | fdvdz |
| Double_t | fqp |
| Int_t | fizfor |
Private Member Functions | |
| Int_t | SwimToIron (Double_t, Bool_t docheck) |
| Int_t | SwimToVacuum (Double_t) |
| Bool_t | DoCheck () |
Private Attributes | |
| UgliGeomHandle * | fugh |
| VldContext * | fvldc |
| TObjArray | fInterface |
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 24 of file SwimObjSR.cxx. References Detector::AsString(), fdudz, fdvdz, fizfor, fqp, fu, fugh, fv, fvldc, fz, VldContext::GetDetector(), and MSG. 00025 {
00026 MSG("CandFitTrackSR",Msg::kError)
00027 << "SwimObjSR is obsolete!" << endl;
00028 assert(0);
00029
00030 fu = u;
00031 fv = v;
00032 fz = z;
00033 fdudz = dudz;
00034 fdvdz = dvdz;
00035 fqp = qp;
00036 fizfor = izfor;
00037
00038 fvldc = const_cast<VldContext*>(vldc);
00039 fugh = new UgliGeomHandle(*fvldc);
00040
00041 Int_t iplnmax = 0;
00042 Int_t iplngap0 = 9999;
00043 Int_t iplngap1 = -1;
00044 switch(fvldc->GetDetector()) {
00045 case Detector::kFar:
00046 iplnmax = 482;
00047 iplngap0 = 240;
00048 iplngap1 = 243;
00049 break;
00050 case Detector::kNear:
00051 iplnmax = 281;
00052 break;
00053 case Detector::kCalib:
00054 iplnmax = 60;
00055 break;
00056 default:
00057 MSG("CandFitTrackSR",Msg::kError)
00058 << "BFieldSR does not support the "
00059 << Detector::AsString(vldc->GetDetector())
00060 << " detector " << endl;
00061 assert(0);
00062
00063 }
00064
00065 }
|
|
|
Definition at line 67 of file SwimObjSR.cxx. References fugh. 00068 {
00069 assert(fugh);
00070 delete fugh;
00071 }
|
|
|
Definition at line 283 of file SwimObjSR.cxx. References fdudz, fdvdz, fqp, fu, and fv. Referenced by SwimTo(). 00283 {
00284 if (TMath::Abs(fu)>4. || TMath::Abs(fv)>4. || TMath::Abs(fdudz)>50. || TMath::Abs(fdvdz)>50. || TMath::Abs(fqp)>20.) return 1;
00285 Double_t thisx = .707*(fu-fv);
00286 Double_t thisy = .707*(fu+fv);
00287 Double_t thisdxdz = .707*(fdudz-fdvdz);
00288 Double_t thisdydz = .707*(fdudz+fdvdz);
00289 if (TMath::Abs(thisx)>4. || TMath::Abs(thisy)>4. || TMath::Abs(thisdxdz)>50. || TMath::Abs(thisdydz)>50.) return 1;
00290 return 0;
00291 }
|
|
||||||||||||
|
Definition at line 73 of file SwimObjSR.cxx. References DoCheck(), fdudz, fdvdz, fu, fv, fvldc, fz, SwimGeo::GetInterfaces(), SwimPlaneInterface::GetMaterialAfter(), SwimPlaneInterface::GetMaterialBefore(), SwimPlaneInterface::GetZ(), SwimGeo::Instance(), MSG, and SwimToIron(). 00074 {
00075
00076
00077 if (fz==zfin) return 0;
00078
00079 if (docheck && DoCheck()) return 1;
00080
00081 Int_t idir = 1;
00082 if (zfin<fz) {
00083 idir = -1;
00084 }
00085
00086
00087 SwimGeo* sgeo = SwimGeo::Instance(*fvldc);
00088
00089 Int_t found=0;
00090 SwimGeo::SwimMaterial_t begmat = SwimGeo::kAir;
00091 SwimGeo::SwimMaterial_t endmat = SwimGeo::kAir;
00092 Int_t ibeg=0;
00093 Int_t iend=0;
00094 const TObjArray& interfaces = sgeo->GetInterfaces();
00095
00096 if (idir>0) {
00097 for (Int_t i=0; i <= interfaces.GetLast() && found<2; i++) {
00098 SwimPlaneInterface *spi =
00099 dynamic_cast<SwimPlaneInterface*>(interfaces.At(i));
00100 if (!found && fz<spi->GetZ()) {
00101 begmat = spi->GetMaterialBefore();
00102 found++;
00103 ibeg = i;
00104 }
00105 if (found==1 && zfin<spi->GetZ()) {
00106 endmat = spi->GetMaterialAfter();
00107 found++;
00108 iend = i+1;
00109 }
00110 }
00111 }
00112 else {
00113 for (Int_t i = interfaces.GetLast(); i>=0 && found<2; i--) {
00114 SwimPlaneInterface *spi =
00115 dynamic_cast<SwimPlaneInterface*>(interfaces.At(i));
00116 if (!found && fz>spi->GetZ()) {
00117 begmat = spi->GetMaterialAfter();
00118 found++;
00119 ibeg = i;
00120 }
00121 if (found==1 && zfin>spi->GetZ()) {
00122 endmat = spi->GetMaterialBefore();
00123 found++;
00124 iend = i-1;
00125 }
00126 }
00127 }
00128
00129 if (found<2) return 1;
00130
00131 for (Int_t i=ibeg; i!=iend; i+=idir) {
00132 SwimPlaneInterface *spi =
00133 dynamic_cast<SwimPlaneInterface*>(interfaces.At(i));
00134 Double_t zend = spi->GetZ();
00135 if (i==iend-idir) {
00136 zend = zfin;
00137 }
00138
00139 SwimGeo::SwimMaterial_t imat =
00140 (idir>0) ? spi->GetMaterialBefore() : spi->GetMaterialAfter();
00141
00142 Int_t flag = 0;
00143 switch (imat) {
00144 case 0: // air
00145 fu += fdudz*(zend-fz);
00146 fv += fdvdz*(zend-fz);
00147 fz = zend;
00148 break;
00149 case 1: // scintillator
00150 fu += fdudz*(zend-fz);
00151 fv += fdvdz*(zend-fz);
00152 fz = zend;
00153 // should do energy loss here
00154 break;
00155 case 2: // iron
00156 flag = SwimToIron(zend,docheck);
00157 break;
00158 default:
00159 MSG("FitTrackSR",Msg::kError) << "undefined type " << imat << "\n";
00160 break;
00161 }
00162 if (flag!=0) return flag;
00163 if (docheck && DoCheck()) return 1;
00164 }
00165
00166
00167 return 0;
00168 }
|
|
||||||||||||
|
Definition at line 170 of file SwimObjSR.cxx. References fdudz, fdvdz, fizfor, fqp, fu, fv, fvldc, and BFieldSR::GetBField(). Referenced by SwimTo(). 00171 {
00172 //unused: Int_t idir=1;
00173
00174 Double_t swimdz = .00508*Munits::m;
00175
00176 Double_t v0[5];
00177 Double_t uu[5];
00178 Double_t vv[5];
00179
00180 Double_t psum[5];
00181 Double_t fvarr[5];
00182 Double_t pfac[4] = {1.,2.,2.,1.};
00183 Double_t vfac[4] = {0.5,0.5,1.,1.};
00184
00185 Double_t dz = zfin-fz;
00186
00187 vv[0] = fdudz;
00188 vv[1] = fdvdz;
00189 vv[2] = fu;
00190 vv[3] = fv;
00191 vv[4] = fz;
00192
00193 for (Int_t i=0; i<5; i++) {
00194 v0[i] = vv[i];
00195 }
00196
00197 Int_t nstep;
00198 BFieldSR bf(fvldc);
00199
00200 if (dz>0.) {
00201 nstep = (Int_t)(dz/swimdz);
00202 } else {
00203 nstep = -(Int_t)(dz/swimdz);
00204 }
00205 Double_t del = swimdz;
00206 if (dz<0.) del *= -1.;
00207 for (Int_t istep=0; istep<=nstep; istep++) {
00208 if (istep==nstep) {
00209 if (dz>0.) {
00210 del = dz-swimdz*istep;
00211 } else {
00212 del = dz+swimdz*istep;
00213 }
00214 }
00215 for (Int_t i=0; i<5; i++) {
00216 uu[i] = vv[i];
00217 psum[i] = 0.;
00218 }
00219 for (Int_t ik=0; ik<4; ik++) {
00220 // not sure if this is the correct rotation
00221 // the old bfield maps expect cm
00222 //unused: Double_t x;
00223 //unused:Double_t y;
00224 // fugh->uv2xy(vv[2],vv[3],x,y);
00225 // TVector3 xyz(x*Munits::cm,y*Munits::cm,vv[4]*Munits::cm);
00226 TVector3 xyz(0.7071068*(vv[2]-vv[3])*Munits::m,
00227 0.7071068*(vv[2]+vv[3])*Munits::m,vv[4]*Munits::m);
00228 TVector3 bxyz = bf.GetBField(xyz);
00229 // rotate bxyz into buvz
00230 // bxyz in Tesla, convert into GeV/c/m
00231 // warning: numbers are hard coded here
00232 // TVector3 buvz = fugh->xyz2uvz(bxyz);
00233 TVector3 buvz(0.7071068*(bxyz[1]+bxyz[0]),
00234 0.7071068*(bxyz[1]-bxyz[0]),bxyz[2]);
00235 for (Int_t ibf=0; ibf<3; ibf++) {
00236 buvz[ibf] *= 0.3;
00237 }
00238 fvarr[0] = fizfor*fqp*sqrt(1+vv[0]*vv[0]+vv[1]*vv[1])*
00239 (buvz[2]*vv[1]+buvz[0]*vv[0]*vv[1]-buvz[1]*(1+vv[0]*vv[0]));
00240 fvarr[1] = fizfor*fqp*sqrt(1+vv[0]*vv[0]+vv[1]*vv[1])*
00241 (-buvz[2]*vv[0]-buvz[1]*vv[0]*vv[1]+buvz[0]*(1+vv[1]*vv[1]));
00242 fvarr[2] = vv[0];
00243 fvarr[3] = vv[1];
00244 fvarr[4] = 1.;
00245 for (Int_t il=0; il<5; il++) {
00246 psum[il] += pfac[ik]*fvarr[il];
00247 vv[il] = uu[il]+vfac[ik]*del*fvarr[il];
00248 }
00249 }
00250 for (Int_t ik=0; ik<5; ik++) {
00251 vv[ik] = uu[ik]+del*psum[ik]/6.;
00252 }
00253 // energy loss, for now consider constant energy loss (working in GeV/m)
00254 Double_t eloss = 1.57*Munits::GeV/Munits::m*del*(Double_t)(fizfor)*
00255 sqrt(1.+vv[0]*vv[0]+vv[1]*vv[1]);
00256 if (fqp!=0.) {
00257 Double_t pnow = 1./TMath::Abs(fqp);
00258 if (eloss<0. || (pnow>eloss &&
00259 1./TMath::Abs(fqp*pnow/(pnow-eloss))>0.20*Munits::GeV)) {
00260 fqp = fqp*pnow/(pnow-eloss);
00261 }
00262 }
00263 if (docheck) {
00264 if (TMath::Abs(vv[2])>4. || TMath::Abs(vv[3])>4. || TMath::Abs(vv[0])>50. || TMath::Abs(vv[1])>50. || TMath::Abs(fqp)>20.) return 1;
00265 Double_t thisx = .707*(vv[2]-vv[3]);
00266 Double_t thisy = .707*(vv[2]+vv[3]);
00267 Double_t thisdxdz = .707*(vv[0]-vv[1]);
00268 Double_t thisdydz = .707*(vv[0]+vv[1]);
00269 if (TMath::Abs(thisx)>4. || TMath::Abs(thisy)>4. || TMath::Abs(thisdxdz)>50. || TMath::Abs(thisdydz)>50.) return 1;
00270 }
00271 // cout << "swim " << vv[2] << " " << vv[3] << " " << vv[0] << " " << vv[1] << " " << vv[4] << " " << fqp << "\n";
00272 }
00273 fdudz = vv[0];
00274 fdvdz = vv[1];
00275 fu = vv[2];
00276 fv = vv[3];
00277 fz = vv[4];
00278
00279 return 0;
00280
00281 }
|
|
|
|
|
|
Definition at line 23 of file SwimObjSR.h. Referenced by DoCheck(), SwimObjSR(), SwimTo(), and SwimToIron(). |
|
|
Definition at line 24 of file SwimObjSR.h. Referenced by DoCheck(), SwimObjSR(), SwimTo(), and SwimToIron(). |
|
|
Definition at line 38 of file SwimObjSR.h. |
|
|
Definition at line 27 of file SwimObjSR.h. Referenced by SwimObjSR(), and SwimToIron(). |
|
|
Definition at line 25 of file SwimObjSR.h. Referenced by DoCheck(), SwimObjSR(), and SwimToIron(). |
|
|
Definition at line 20 of file SwimObjSR.h. Referenced by DoCheck(), SwimObjSR(), SwimTo(), and SwimToIron(). |
|
|
Definition at line 35 of file SwimObjSR.h. Referenced by SwimObjSR(), and ~SwimObjSR(). |
|
|
Definition at line 21 of file SwimObjSR.h. Referenced by DoCheck(), SwimObjSR(), SwimTo(), and SwimToIron(). |
|
|
Definition at line 36 of file SwimObjSR.h. Referenced by SwimObjSR(), SwimTo(), and SwimToIron(). |
|
|
Definition at line 22 of file SwimObjSR.h. Referenced by SwimObjSR(), and SwimTo(). |
1.3.9.1