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


Detailed Description

Definition at line 7 of file ShieldProj.h.


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 37 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, Msg::kWarning, MSG, plane, planeLineDisFinder(), ShieldGeom::PlankExists(), specialPlank(), strip0, vtx0, vtx1, vtx2, vtxCos0, vtxCos1, and vtxCos2.

00037                                                                                                                                                                                           {
00038   vtx0 = vtx0_in;
00039   vtx1 = vtx1_in;
00040   vtx2 = vtx2_in;
00041   vtxCos0 = vtxCos0_in;
00042   vtxCos1 = vtxCos1_in;
00043   vtxCos2 = vtxCos2_in;
00044   plane = plane_in;
00045   strip0 = strip0_in;
00046   
00047   //Finding intersection and distance
00048   
00049   if(sg->PlankExists(plane,strip0)==true){
00050     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);
00051     
00052     if(specialPlank(plane,strip0)==true && inter1<sg->GetPlank_Y(plane,strip0)){ //<--- for special case of "curved" planks (for instance plane 566, plank 3)  
00053       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);
00054     }
00055     
00056     dpv=distanceFinder(sg->GetPlank_X(plane,strip0),sg->GetPlank_Y(plane,strip0),sg->GetPlank_Z(plane,strip0),inter0,inter1,inter2);
00057   }
00058   
00059   else{
00060     dpv=-1000;
00061     inter0=-1000;
00062     inter1=-1000;
00063     inter2=-1000;
00064     MSG("CandShield",Msg::kWarning) << "Plank given to ShieldProj does not exist in shield!" << endl;
00065   }
00066 
00067   //Projection in plank?
00068   HitInPlank=false;
00069   if(dpv<(sg->GetStripsInPlank(plane,strip0))*0.0205 && fabs(inter2-(sg->GetPlank_Z(plane,strip0)))<4.00){
00070     HitInPlank=true;
00071   } 
00072   
00073 }//end of constructor

ShieldProj::~ShieldProj (  ) 

Definition at line 75 of file ShieldProj.cxx.

00075                         {
00076   
00077 }


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 142 of file ShieldProj.cxx.

Referenced by ShieldProj().

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

Double_t ShieldProj::GetProjDis (  )  const

Definition at line 222 of file ShieldProj.cxx.

References dpv.

Referenced by CandShieldSR::CandShieldSR(), and NtpSRModule::FillNtpShieldStrip().

00222                                      {
00223 
00224   return dpv;
00225 
00226 }

Double_t ShieldProj::GetProjInter_X (  )  const

Definition at line 201 of file ShieldProj.cxx.

References inter0.

Referenced by CandShieldSR::CandShieldSR(), and NtpSRModule::FillNtpShieldStrip().

00201                                          {
00202 
00203   return inter0;
00204 
00205 }

Double_t ShieldProj::GetProjInter_Y (  )  const

Definition at line 208 of file ShieldProj.cxx.

References inter1.

Referenced by CandShieldSR::CandShieldSR(), and NtpSRModule::FillNtpShieldStrip().

00208                                          {
00209 
00210   return inter1;
00211 
00212 }

Double_t ShieldProj::GetProjInter_Z (  )  const

Definition at line 215 of file ShieldProj.cxx.

References inter2.

Referenced by CandShieldSR::CandShieldSR(), and NtpSRModule::FillNtpShieldStrip().

00215                                          {
00216 
00217   return inter2;
00218 
00219 }

Int_t ShieldProj::GetProjPlane (  )  const

Definition at line 187 of file ShieldProj.cxx.

References plane.

00187                                      {
00188 
00189     return plane;
00190 
00191 }

Int_t ShieldProj::GetProjStrip0 (  )  const

Definition at line 194 of file ShieldProj.cxx.

References strip0.

00194                                       {
00195 
00196   return strip0;
00197 
00198 }

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 112 of file ShieldProj.cxx.

References Msg::kWarning, and MSG.

Referenced by ShieldProj().

00112                                                                                                                                                                                                                                                    { 
00113   
00114   Double_t p20=p10;
00115   Double_t p21=p11;
00116   Double_t p22=p12+4;
00117   Double_t det_up;
00118   Double_t det_do;  
00119   Double_t t;
00120   
00121   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;
00122   
00123   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;
00124   
00125   if(det_do!=0){
00126     t=-det_up/det_do;
00127     inter0=p40+(p50-p40)*t;
00128     inter1=p41+(p51-p41)*t;
00129     inter2=p42+(p52-p42)*t;
00130   }
00131   else{
00132   inter0=-100;
00133   inter1=-100;
00134   inter2=-100;
00135   MSG("CandShield",Msg::kWarning) << "Determinant in PlaneLineDisFinder was 0. Either bad luck (a lot of) or something fishy!" << endl;
00136   }
00137 }

Bool_t ShieldProj::ProjHitPlank (  )  const

Definition at line 229 of file ShieldProj.cxx.

References HitInPlank.

Referenced by CandShieldSR::CandShieldSR().

00229                                      {
00230 
00231   return HitInPlank;
00232 
00233 }

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

Definition at line 85 of file ShieldProj.cxx.

References Mphysical::pi.

Referenced by ShieldProj().

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


Member Data Documentation

Double_t ShieldProj::dpv [private]

Definition at line 29 of file ShieldProj.h.

Referenced by GetProjDis(), and ShieldProj().

Bool_t ShieldProj::HitInPlank [private]

Definition at line 33 of file ShieldProj.h.

Referenced by ProjHitPlank(), and ShieldProj().

Double_t ShieldProj::inter0 [private]

Definition at line 30 of file ShieldProj.h.

Referenced by GetProjInter_X(), and ShieldProj().

Double_t ShieldProj::inter1 [private]

Definition at line 31 of file ShieldProj.h.

Referenced by GetProjInter_Y(), and ShieldProj().

Double_t ShieldProj::inter2 [private]

Definition at line 32 of file ShieldProj.h.

Referenced by GetProjInter_Z(), and ShieldProj().

Int_t ShieldProj::plane [private]

Definition at line 27 of file ShieldProj.h.

Referenced by GetProjPlane(), and ShieldProj().

Int_t ShieldProj::strip0 [private]

Definition at line 28 of file ShieldProj.h.

Referenced by GetProjStrip0(), and 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 Mon Nov 10 00:56:28 2014 for loon by  doxygen 1.4.7