Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ShieldProj Class Reference

#include <ShieldProj.h>

List of all members.

Public Member Functions

 ShieldProj (Double_t vtx0_in, Double_t vtx1_in, Double_t vtx2_in, Double_t vtxCos0_in, Double_t vtxCos1_in, Double_t vtxCos2_in, Int_t plane_in, Int_t strip0_in, ShieldGeom *sg)
 ~ShieldProj ()
Int_t GetProjPlane () const
Int_t GetProjStrip0 () const
Double_t GetProjInter_X () const
Double_t GetProjInter_Y () const
Double_t GetProjInter_Z () const
Double_t GetProjDis () const
Bool_t ProjHitPlank () const

Private Member Functions

Bool_t specialPlank (Int_t pl, Int_t pk)
void planeLineDisFinder (Double_t p10, Double_t p11, Double_t p12, Double_t p30, Double_t p31, Double_t p32, Double_t p40, Double_t p41, Double_t p42, Double_t p50, Double_t p51, Double_t p52, Double_t &inter0, Double_t &inter1, Double_t &inter2)
Double_t distanceFinder (Double_t n0, Double_t n1, Double_t n2, Double_t p0, Double_t p1, Double_t p2)

Private Attributes

Double_t vtx0
Double_t vtx1
Double_t vtx2
Double_t vtxCos0
Double_t vtxCos1
Double_t vtxCos2
Int_t plane
Int_t strip0
Double_t dpv
Double_t inter0
Double_t inter1
Double_t inter2
Bool_t HitInPlank


Constructor & Destructor Documentation

ShieldProj::ShieldProj Double_t  vtx0_in,
Double_t  vtx1_in,
Double_t  vtx2_in,
Double_t  vtxCos0_in,
Double_t  vtxCos1_in,
Double_t  vtxCos2_in,
Int_t  plane_in,
Int_t  strip0_in,
ShieldGeom sg
 

Definition at line 31 of file ShieldProj.cxx.

References distanceFinder(), dpv, ShieldGeom::GetPlank_X(), ShieldGeom::GetPlank_Y(), ShieldGeom::GetPlank_Z(), ShieldGeom::GetPlankStrip0_X(), ShieldGeom::GetPlankStrip0_Y(), ShieldGeom::GetPlankStrip0_Z(), ShieldGeom::GetStripsInPlank(), HitInPlank, inter0, inter1, inter2, plane, planeLineDisFinder(), ShieldGeom::PlankExists(), specialPlank(), strip0, vtx0, vtx1, vtx2, vtxCos0, vtxCos1, and vtxCos2.

00031                                                                                                                                                                                           {
00032   vtx0 = vtx0_in;
00033   vtx1 = vtx1_in;
00034   vtx2 = vtx2_in;
00035   vtxCos0 = vtxCos0_in;
00036   vtxCos1 = vtxCos1_in;
00037   vtxCos2 = vtxCos2_in;
00038   plane = plane_in;
00039   strip0 = strip0_in;
00040   
00041   //Finding intersection and distance
00042   
00043   if(sg->PlankExists(plane,strip0)==true){
00044     planeLineDisFinder(sg->GetPlank_X(plane,strip0),sg->GetPlank_Y(plane,strip0),sg->GetPlank_Z(plane,strip0),sg->GetPlankStrip0_X(plane,strip0),sg->GetPlankStrip0_Y(plane,strip0),sg->GetPlankStrip0_Z(plane,strip0),vtx0,vtx1,vtx2,vtx0+vtxCos0,vtx1+vtxCos1,vtx2+vtxCos2,inter0,inter1,inter2);
00045     
00046     if(specialPlank(plane,strip0)==true && inter1<sg->GetPlank_Y(plane,strip0)){ //<--- for special case of "curved" planks (for instance plane 566, plank 3)  
00047       planeLineDisFinder(sg->GetPlank_X(plane,strip0),sg->GetPlank_Y(plane,strip0),sg->GetPlank_Z(plane,strip0),sg->GetPlank_X(plane-1,15),sg->GetPlank_Y(plane-1,15),sg->GetPlank_Z(plane-1,15),vtx0,vtx1,vtx2,vtx0+vtxCos0,vtx1+vtxCos1,vtx2+vtxCos2,inter0,inter1,inter2);
00048     }
00049     
00050     dpv=distanceFinder(sg->GetPlank_X(plane,strip0),sg->GetPlank_Y(plane,strip0),sg->GetPlank_Z(plane,strip0),inter0,inter1,inter2);
00051   }
00052   
00053   else{
00054     dpv=-1000;
00055     inter0=-1000;
00056     inter1=-1000;
00057     inter2=-1000;
00058   }
00059 
00060   //Projection in plank?
00061   HitInPlank=false;
00062   if(dpv<(sg->GetStripsInPlank(plane,strip0))*0.0205 && fabs(inter2-(sg->GetPlank_Z(plane,strip0)))<4.00){
00063     HitInPlank=true;
00064   } 
00065   
00066 }//end of constructor

ShieldProj::~ShieldProj  ) 
 

Definition at line 68 of file ShieldProj.cxx.

00068                         {
00069   
00070 }


Member Function Documentation

Double_t ShieldProj::distanceFinder Double_t  n0,
Double_t  n1,
Double_t  n2,
Double_t  p0,
Double_t  p1,
Double_t  p2
[private]
 

Definition at line 134 of file ShieldProj.cxx.

Referenced by ShieldProj().

00134                                                                                                           {
00135   
00136   Double_t x1[3];
00137   Double_t x2[3];
00138   Double_t xp[3];
00139   Double_t v1[3];
00140   Double_t v2[3];
00141   Double_t v3[3];
00142   Double_t magu;
00143   Double_t magd;
00144 
00145   x1[0]=n0;
00146   x1[1]=n1;
00147   x1[2]=n2;
00148   
00149   x2[0]=n0;
00150   x2[1]=n1;
00151   x2[2]=n2+4;
00152 
00153   xp[0]=p0;
00154   xp[1]=p1;
00155   xp[2]=p2;
00156 
00157   for(int ii=0;ii<3;ii++){
00158     v1[ii]=x2[ii]-x1[ii];
00159     v2[ii]=x1[ii]-xp[ii];   
00160   }
00161 
00162   v3[0]=v1[1]*v2[2]-v1[2]*v2[1];
00163   v3[1]=v1[2]*v2[0]-v1[0]*v2[2];
00164   v3[2]=v1[0]*v2[1]-v1[1]*v2[0];
00165   
00166   magu=sqrt(pow(v3[0],2)+pow(v3[1],2)+pow(v3[2],2));
00167   magd=sqrt(pow(v1[0],2)+pow(v1[1],2)+pow(v1[2],2));
00168   if(magd!=0){  
00169     return magu/magd;
00170   }
00171   else{
00172     return 100;
00173   }
00174 }

Double_t ShieldProj::GetProjDis  )  const
 

Definition at line 214 of file ShieldProj.cxx.

Referenced by CandShieldSR::CandShieldSR().

00214                                      {
00215 
00216   return dpv;
00217 
00218 }

Double_t ShieldProj::GetProjInter_X  )  const
 

Definition at line 193 of file ShieldProj.cxx.

Referenced by CandShieldSR::CandShieldSR().

00193                                          {
00194 
00195   return inter0;
00196 
00197 }

Double_t ShieldProj::GetProjInter_Y  )  const
 

Definition at line 200 of file ShieldProj.cxx.

Referenced by CandShieldSR::CandShieldSR().

00200                                          {
00201 
00202   return inter1;
00203 
00204 }

Double_t ShieldProj::GetProjInter_Z  )  const
 

Definition at line 207 of file ShieldProj.cxx.

Referenced by CandShieldSR::CandShieldSR().

00207                                          {
00208 
00209   return inter2;
00210 
00211 }

Int_t ShieldProj::GetProjPlane  )  const
 

Definition at line 179 of file ShieldProj.cxx.

00179                                      {
00180 
00181     return plane;
00182 
00183 }

Int_t ShieldProj::GetProjStrip0  )  const
 

Definition at line 186 of file ShieldProj.cxx.

00186                                       {
00187 
00188   return strip0;
00189 
00190 }

void ShieldProj::planeLineDisFinder Double_t  p10,
Double_t  p11,
Double_t  p12,
Double_t  p30,
Double_t  p31,
Double_t  p32,
Double_t  p40,
Double_t  p41,
Double_t  p42,
Double_t  p50,
Double_t  p51,
Double_t  p52,
Double_t &  inter0,
Double_t &  inter1,
Double_t &  inter2
[private]
 

Definition at line 105 of file ShieldProj.cxx.

Referenced by ShieldProj().

00105                                                                                                                                                                                                                                                    { 
00106   
00107   Double_t p20=p10;
00108   Double_t p21=p11;
00109   Double_t p22=p12+4;
00110   Double_t det_up;
00111   Double_t det_do;  
00112   Double_t t;
00113   
00114   det_up=p20*p31*p42-p20*p41*p32-p21*p30*p42+p21*p40*p32+p22*p30*p41-p22*p40*p31-p10*p31*p42+p10*p41*p32+p10*p21*p42-p10*p21*p32-p10*p22*p41+p10*p22*p31+p11*p30*p42-p11*p40*p32-p11*p20*p42+p11*p20*p32+p11*p22*p40-p11*p22*p30-p12*p30*p41+p12*p40*p31+p12*p20*p41-p12*p20*p31-p12*p21*p40+p12*p21*p30;
00115   
00116   det_do=-p22*p30*p41-p12*p40*p31+p20*p41*p32-p22*p31*p50+p10*p22*p41+p22*p30*p51+p21*p32*p50+p22*p40*p31+p10*p31*p42+p20*p31*p52+p10*p32*p51-p21*p30*p52-p10*p31*p52+p21*p30*p42+p12*p30*p41-p12*p20*p41-p11*p30*p42+p11*p20*p42-p11*p22*p40+p12*p21*p40-p10*p41*p32-p20*p31*p42-p20*p32*p51-p10*p21*p42-p21*p40*p32+p11*p40*p32+p10*p21*p52-p10*p22*p51+p11*p30*p52-p11*p32*p50-p11*p20*p52+p11*p22*p50-p12*p30*p51+p12*p31*p50+p12*p20*p51-p12*p21*p50;
00117   
00118   if(det_do!=0){
00119     t=-det_up/det_do;
00120     inter0=p40+(p50-p40)*t;
00121     inter1=p41+(p51-p41)*t;
00122     inter2=p42+(p52-p42)*t;
00123   }
00124   else{
00125   inter0=-100;
00126   inter1=-100;
00127   inter2=-100;
00128   }
00129 }

Bool_t ShieldProj::ProjHitPlank  )  const
 

Definition at line 221 of file ShieldProj.cxx.

Referenced by CandShieldSR::CandShieldSR().

00221                                      {
00222 
00223   return HitInPlank;
00224 
00225 }

Bool_t ShieldProj::specialPlank Int_t  pl,
Int_t  pk
[private]
 

Definition at line 78 of file ShieldProj.cxx.

Referenced by ShieldProj().

00078                                                 {
00079   
00080   Bool_t verdict;
00081   
00082   Int_t specialList[8];
00083   specialList[0]=566;
00084   specialList[1]=575;
00085   specialList[2]=630;
00086   specialList[3]=639;
00087   specialList[4]=694;
00088   specialList[5]=703;
00089   specialList[6]=758;
00090   specialList[7]=767;
00091 
00092   verdict=false;
00093   for(int pi=0;pi<8;pi++){
00094     if(pl==specialList[pi] && pk == 3){
00095       verdict = true;
00096     }
00097   }
00098   return verdict;
00099   
00100 }


Member Data Documentation

Double_t ShieldProj::dpv [private]
 

Definition at line 29 of file ShieldProj.h.

Referenced by ShieldProj().

Bool_t ShieldProj::HitInPlank [private]
 

Definition at line 33 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::inter0 [private]
 

Definition at line 30 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::inter1 [private]
 

Definition at line 31 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::inter2 [private]
 

Definition at line 32 of file ShieldProj.h.

Referenced by ShieldProj().

Int_t ShieldProj::plane [private]
 

Definition at line 27 of file ShieldProj.h.

Referenced by ShieldProj().

Int_t ShieldProj::strip0 [private]
 

Definition at line 28 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::vtx0 [private]
 

Definition at line 21 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::vtx1 [private]
 

Definition at line 22 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::vtx2 [private]
 

Definition at line 23 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::vtxCos0 [private]
 

Definition at line 24 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::vtxCos1 [private]
 

Definition at line 25 of file ShieldProj.h.

Referenced by ShieldProj().

Double_t ShieldProj::vtxCos2 [private]
 

Definition at line 26 of file ShieldProj.h.

Referenced by ShieldProj().


The documentation for this class was generated from the following files:
Generated on Thu Nov 1 15:58:17 2007 for loon by  doxygen 1.3.9.1