StupidStripHandle Class Reference

#include <StupidStripHandle.h>

List of all members.

Classes

class  stripData

Public Member Functions

 StupidStripHandle (void)
 StupidStripHandle (Detector::Detector_t det, Int_t plane, Int_t strip)
 StupidStripHandle (PlexStripEndId end)
virtual ~StupidStripHandle (void)
virtual Bool_t IsValid () const
virtual Bool_t IsFrozen () const
virtual PlexStripEndId GetSEId () const
virtual Float_t GetHalfLength () const
virtual Float_t GetHalfThickness () const
virtual Float_t GetHalfWidth () const
virtual Float_t GetTPos () const
virtual TVector3 GlobalPos (const Float_t alongLength, const Bool_t onWLS=kFALSE) const
virtual Float_t DistanceAlong (const PlexStripEndId &orthogonalStrip) const
virtual TVector3 Intersection (const PlexStripEndId &orthogonalStrip) const

Static Private Member Functions

static void BuildVetoData (void)

Private Attributes

PlexStripEndId fSEId

Static Private Attributes

static std::map< int, stripDatafVeto
static Bool_t fVetoBuilt = false

Friends

class StupidGeomHandle

Detailed Description

Definition at line 24 of file StupidStripHandle.h.


Constructor & Destructor Documentation

StupidStripHandle::StupidStripHandle ( void   )  [inline]

Definition at line 28 of file StupidStripHandle.h.

References fSEId, and Detector::kFar.

StupidStripHandle::StupidStripHandle ( Detector::Detector_t  det,
Int_t  plane,
Int_t  strip 
) [inline]

Definition at line 31 of file StupidStripHandle.h.

References fSEId.

00032     { fSEId = PlexStripEndId(det,plane,strip); };

StupidStripHandle::StupidStripHandle ( PlexStripEndId  end  )  [inline]

Definition at line 34 of file StupidStripHandle.h.

References fSEId.

00035     { fSEId = end;}

virtual StupidStripHandle::~StupidStripHandle ( void   )  [inline, virtual]

Definition at line 37 of file StupidStripHandle.h.

00037 {};


Member Function Documentation

void StupidStripHandle::BuildVetoData ( void   )  [static, private]

Definition at line 246 of file StupidStripHandle.cxx.

References fVetoBuilt.

Referenced by StupidGeomHandle::operator=(), and StupidGeomHandle::StupidGeomHandle().

00247 {
00248   if(fVetoBuilt) return;
00249 #include "StupidVetoCode.cinc"
00250   fVetoBuilt = true;
00251 }

Float_t StupidStripHandle::DistanceAlong ( const PlexStripEndId orthogonalStrip  )  const [virtual]

Definition at line 228 of file StupidStripHandle.cxx.

References Msg::kFatal, and MSG.

00229 { 
00230    // get the distance along a strip represented by orthogonal strip
00231    MSG("Stupid",Msg::kFatal)
00232       << "StupidStripNode::DistanceAlong not yet implemented" << endl;
00233    return 0;
00234 }

Float_t StupidStripHandle::GetHalfLength (  )  const [virtual]

Definition at line 14 of file StupidStripHandle.cxx.

References fSEId, PlexPlaneId::GetDetector(), PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), PlexStripEndId::GetStrip(), Detector::kCalDet, Detector::kFar, Detector::kNear, PlaneCoverage::kNearPartial, and PlaneView::kU.

00015 {
00016   if(fSEId.GetDetector()==Detector::kCalDet)  return 0.5;
00017   else if(fSEId.GetDetector()==Detector::kFar) {
00018     if(fSEId.GetPlane()>528) { 
00019       return fVeto[fSEId.GetPlane()*100+fSEId.GetStrip()].length;
00020     }
00021     int strip = fSEId.GetStrip();
00022     if(strip<56) return 1.750 + (float)(strip)*(0.0406586);
00023     else if(strip>136)  return  9.55934 - (float)(strip)*(0.0406727);
00024     else return 4.0;
00025   } else if(fSEId.GetDetector()==Detector::kNear) {
00026     
00027     // Near detector.
00028     // Not very good measurements for strips at very start and very end.
00029     float strip = (float)fSEId.GetStrip();
00030     if(fSEId.GetPlaneCoverage()==PlaneCoverage::kNearPartial) {
00031       if(fSEId.GetPlaneView()==PlaneView::kU) {
00032         // Near Up
00033         if(strip<21)      return 0.99878 + 0.0205*strip;
00034         else if(strip<38) return 1.416;
00035         else              return 2.19381 - 0.0206525*strip;
00036       } else {
00037         // Near Vp
00038         if (strip<32)     return 0.769 + 0.020667*strip;
00039         else if(strip<49) return 1.416;
00040         else              return 2.413 - 0.0205*strip;
00041       }
00042     } else {
00043       if(fSEId.GetPlaneView()==PlaneView::kU) {
00044         // Near Uf
00045         if(strip<32)      return 1.33961 + 0.02058*strip;
00046         else if(strip<66) return 2.002;
00047         else              return 4.73129 - 0.0412069*strip;
00048       } else {
00049         // Near Vf
00050         if (strip<32)     return 0.69301 + 0.0412069*strip;
00051         else if(strip<66) return 2.002;
00052         else              return 3.3569  - 0.0205762*strip;
00053       }
00054     }
00055   }
00056   return 0; // Default.
00057 }

virtual Float_t StupidStripHandle::GetHalfThickness (  )  const [inline, virtual]

Definition at line 45 of file StupidStripHandle.h.

00045 { return 0.005; };

virtual Float_t StupidStripHandle::GetHalfWidth (  )  const [inline, virtual]

Definition at line 46 of file StupidStripHandle.h.

00046 { return 0.0205; };

virtual PlexStripEndId StupidStripHandle::GetSEId (  )  const [inline, virtual]

Definition at line 42 of file StupidStripHandle.h.

References fSEId.

00042 { return fSEId; };

Float_t StupidStripHandle::GetTPos (  )  const [virtual]

Definition at line 180 of file StupidStripHandle.cxx.

References bfld::AsString(), fSEId, PlexPlaneId::GetDetector(), PlexPlaneId::GetPlaneView(), GlobalPos(), PlaneView::kA, PlaneView::kB, Detector::kCalib, PlaneView::kU, PlaneView::kV, Msg::kWarning, PlaneView::kX, PlaneView::kY, and MSG.

00181 {
00182    // get the strip's tpos offset
00183    Float_t tpos = -999999;
00184 
00185    TVector3 center = GlobalPos(0.0,kFALSE);
00186 
00187    const Double_t rsqrt2 = 1.0/TMath::Sqrt(2.);
00188 
00189    switch (fSEId.GetPlaneView()) {
00190    case PlaneView::kX:
00191       tpos = center.Dot(TVector3(1.,0.,0.));
00192       break;
00193    case PlaneView::kY:
00194       tpos = center.Dot(TVector3(0.,1.,0.));
00195       break;
00196    case PlaneView::kU:
00197       if (fSEId.GetDetector() != Detector::kCalib) {
00198          tpos = center.Dot(TVector3(rsqrt2,rsqrt2,0.));
00199       } else {
00200          // CalDet funkiness
00201          tpos = center.Dot(TVector3(1.,0.,0.));
00202       }
00203       break;
00204    case PlaneView::kV:
00205       if (fSEId.GetDetector() != Detector::kCalib) {
00206          tpos = center.Dot(TVector3(-rsqrt2,rsqrt2,0.));
00207       } else {
00208          // CalDet funkiness
00209          tpos = center.Dot(TVector3(0.,1.,0.));
00210       }
00211       break;
00212    case PlaneView::kA:
00213       tpos = center.Dot(TVector3(0.,0.,1.));
00214       break;
00215    case PlaneView::kB:
00216       tpos = center.Dot(TVector3(1.,0.,0.));
00217       break;
00218    default:
00219      MSG("Stupid",Msg::kWarning)
00220        << "StupidStripNode::GetTPos unknown view "
00221        << PlaneView::AsString(fSEId.GetPlaneView()) << endl;
00222    }
00223 
00224    return tpos;
00225 }

TVector3 StupidStripHandle::GlobalPos ( const Float_t  alongLength,
const Bool_t  onWLS = kFALSE 
) const [virtual]

Definition at line 61 of file StupidStripHandle.cxx.

References PlexStripEndId::AsString(), MuELoss::e, fSEId, fVeto, PlexPlaneId::GetDetector(), PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), PlexStripEndId::GetStrip(), PlaneView::kB, Detector::kCalDet, Detector::kFar, Detector::kNear, PlaneCoverage::kNearPartial, PlaneView::kU, PlaneView::kV, Msg::kWarning, and MSG.

Referenced by GetTPos().

00063 {
00064   if(onWLS) MSG("Stupid",Msg::kWarning) 
00065     << "Warning: StupidStripHandle::GlobalPos doesn't know anything about WLS."
00066     << endl;
00067   TVector3 retval; 
00068   if(fSEId.GetDetector()==Detector::kCalDet)  {
00069 
00070     retval.SetZ(0.05227 + 0.0594041*(float)(fSEId.GetPlane()));
00071     float l = -0.471625 + (float)(fSEId.GetStrip())*(0.041);
00072 
00073     if(fSEId.GetPlaneView()==PlaneView::kU) {
00074       retval.SetX(l);
00075       retval.SetY(0);
00076       return retval;
00077     };
00078     if(fSEId.GetPlaneView()==PlaneView::kV) {
00079       retval.SetX(0);
00080       retval.SetY(l);
00081       return retval;
00082     };  
00083     
00084     // Cosmic counters
00085     if(fSEId.GetPlaneView()==PlaneView::kB) {
00086       retval.SetY(-1.6);
00087       retval.SetX(-0.476625 + (float)(fSEId.GetStrip())*0.0410);
00088       switch(fSEId.GetPlane()) {
00089       case 61:
00090         retval.SetZ(0.5);
00091         return retval;
00092         break;
00093       case 62:
00094         retval.SetZ(1.5);
00095         return retval;
00096         break;
00097       case 63:
00098         retval.SetZ(2.0);
00099         return retval;
00100         break;
00101       case 64:
00102         retval.SetZ(3.0);
00103         return retval;
00104         break;
00105       };
00106     }
00107   }
00108   else if(fSEId.GetDetector()==Detector::kFar) {
00109 
00110     // Far Detector.
00111 
00112     if(fSEId.GetPlane()>528) { 
00113       // Veto planes.
00114       retval.SetXYZ(
00115                     fVeto[fSEId.GetPlane()*100+fSEId.GetStrip()].x,
00116                     fVeto[fSEId.GetPlane()*100+fSEId.GetStrip()].y,
00117                     fVeto[fSEId.GetPlane()*100+fSEId.GetStrip()].z );
00118 
00119       return retval;
00120     }
00121     
00122     // SM1:
00123     retval.SetZ(-0.0351982 + 0.0594*(float)(fSEId.GetPlane()));
00124 
00125     // SM2:
00126     if(fSEId.GetPlane()>249) retval.SetZ(1.4945 + 0.0594*(float)(fSEId.GetPlane()));
00127     
00128     // Coords.
00129     retval.SetY(- 2.7965 + 0.029130*(float)(fSEId.GetStrip()));
00130     if(fSEId.GetPlaneView()==PlaneView::kU) {
00131       retval.SetX( -2.7965 + 2.9130e-02*(float)(fSEId.GetStrip()));
00132       return retval;
00133     };
00134     if(fSEId.GetPlaneView()==PlaneView::kV) {
00135       retval.SetX(  2.7965 - 2.9130e-02*(float)(fSEId.GetStrip()));
00136       return retval;
00137     };                                    
00138 
00139   } else if(fSEId.GetDetector()==Detector::kNear) {
00140 
00141     // Near Detector.
00142     
00143     retval.SetZ(-0.0240 + 0.0592036*(float)(fSEId.GetPlane()) );
00144     
00145     float s = fSEId.GetStrip();
00146     
00147     if(fSEId.GetPlaneCoverage()==PlaneCoverage::kNearPartial) {
00148       if(fSEId.GetPlaneView()==PlaneView::kU) {
00149         // Near Up
00150         if(s<21)      { retval.SetX(1.162+0.01550*s); retval.SetY(-1.277+0.04265*s);}
00151         else if(s<38) { retval.SetX(0.876+0.02925*s); retval.SetY(-0.999+0.02925*s);}
00152         else          { retval.SetX(1.399+0.01514*s); retval.SetY(-1.518+0.04314*s);}
00153       } else {
00154         // Near Vp  
00155         if (s<32)    { retval.SetX(2.4445-0.01514*s); retval.SetY(-1.4583+0.04316*s);}     
00156         else if(s<49){ retval.SetX(2.8943-0.02924*s); retval.SetY(-1.0187+0.02925*s);}
00157         else         { retval.SetX(2.2321-0.01550*s); retval.SetY(-1.6654+0.04265*s);}
00158       }
00159     } else {
00160       if(fSEId.GetPlaneView()==PlaneView::kU) {
00161         // Near Uf
00162         if(s<32)      { retval.SetX(-0.847+0.04365*s); retval.SetY(-0.957+0.01455*s); }
00163         else if(s<66) { retval.SetX(-0.379+0.02911*s); retval.SetY(-1.425+0.02911*s); }
00164         else          { retval.SetX(-0.369+0.02915*s); retval.SetY(-1.438+0.02912*s); }
00165       } else {
00166         // Near Vf
00167         if (s<32)     { retval.SetX(2.487-0.02914*s); retval.SetY(-1.416+0.02914*s); }
00168         else if(s<66) { retval.SetX(2.475-0.02912*s); retval.SetY(-1.428+0.02912*s); }
00169         else          { retval.SetX(4.432-0.04367*s); retval.SetY(-4.682+0.01456*s); }
00170       }
00171     }
00172 
00173     return retval;
00174   }
00175 
00176   MSG("Stupid",Msg::kWarning) << "Warning: StupidGeometryHandle::GlobalPos doesn't know about plane " << fSEId.AsString() << endl;
00177   return TVector3(0,0,0);
00178 }

TVector3 StupidStripHandle::Intersection ( const PlexStripEndId orthogonalStrip  )  const [virtual]

Definition at line 237 of file StupidStripHandle.cxx.

References Msg::kFatal, and MSG.

00238 { 
00239    // get the 3-space "intersection" of two strips
00240    MSG("Stupid",Msg::kFatal)
00241       << "StupidStripNode::Intersection not yet implemented" << endl;
00242    return TVector3();
00243 }

virtual Bool_t StupidStripHandle::IsFrozen (  )  const [inline, virtual]

Definition at line 40 of file StupidStripHandle.h.

00040 { return true; };

virtual Bool_t StupidStripHandle::IsValid (  )  const [inline, virtual]

Definition at line 39 of file StupidStripHandle.h.

References fSEId, and PlexPlaneId::GetPlane().

00039 { return (fSEId.GetPlane()!=0); };


Friends And Related Function Documentation

friend class StupidGeomHandle [friend]

Definition at line 26 of file StupidStripHandle.h.


Member Data Documentation

std::map< int, StupidStripHandle::stripData > StupidStripHandle::fVeto [static, private]

Definition at line 72 of file StupidStripHandle.h.

Referenced by GlobalPos().

Bool_t StupidStripHandle::fVetoBuilt = false [static, private]

Definition at line 73 of file StupidStripHandle.h.

Referenced by BuildVetoData().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1