UgliScintMdlNode Class Reference

#include <UgliScintMdlNode.h>

Inheritance diagram for UgliScintMdlNode:
UgliScintMdlABC UgliRefCnt TNodeX

List of all members.

Public Member Functions

virtual ~UgliScintMdlNode ()
virtual PlexScintMdlId GetPlexScintMdlId () const
virtual PlexPlaneId GetPlexPlaneId () const
virtual Int_t GetModuleNum () const
virtual Int_t NumberOfStrips () const
virtual Float_t GetClearFiber (const StripEnd::StripEnd_t end) const
virtual Float_t GetExtraWlsFiber (const StripEnd::StripEnd_t end) const
virtual TVector3 GlobalToLocal (const TVector3 &global) const
virtual TVector3 LocalToGlobal (const TVector3 &local) const
virtual UgliGeometryGetUgliGeometry () const
UgliScintPlnNodeGetScintPlnNode (void) const
Float_t GetZRotRelPlnRad () const
Float_t GetLPosRelPln () const
Float_t GetTPosRelPln () const
void SetZRotRelPlnRad (Float_t radians)
void SetLTPosRelPln (Float_t lpos, Float_t tpos)
 UgliScintMdlNode ()

Protected Member Functions

virtual void IncrementRef ()
virtual void DecrementRef ()
 UgliScintMdlNode (const PlexScintMdlId scintmdlid, UgliScintPlnNode *plnNode, const UgliDbiTables &ugliTables)

Static Protected Member Functions

static void SetDefaultModuleOutline (TXTRU *mdlShape, const string &typeName, const Float_t width)

Protected Attributes

UgliGeometryfUgliGeometry
PlexScintMdlId fScintMdlId
Int_t fModuleNum
Float_t fClearLenEast
Float_t fClearLenWest
Float_t fWlsLenEast
Float_t fWlsLenWest

Private Member Functions

 UgliScintMdlNode (const UgliScintMdlNode &that)
UgliScintMdlNodeoperator= (const UgliScintMdlNode &ugh)

Friends

class UgliScintPlnNode
class UgliScintMdlHandle

Detailed Description

Definition at line 31 of file UgliScintMdlNode.h.


Constructor & Destructor Documentation

UgliScintMdlNode::~UgliScintMdlNode (  )  [virtual]

Definition at line 41 of file UgliScintMdlNode.cxx.

References UgliRefCnt::CountRef(), Msg::kWarning, and MSG.

00042 {
00043    // destructor should delete any owned objects
00044    if (CountRef()) {
00045       MSG("Ugli",Msg::kWarning)
00046          << "~UgliScintMdlNode still had " << CountRef()
00047          << " outstanding references " << endl;
00048    }
00049 }

UgliScintMdlNode::UgliScintMdlNode (  ) 

Definition at line 34 of file UgliScintMdlNode.cxx.

00035   : fUgliGeometry(0)
00036 {
00037    // Default constructor (for i/o)
00038 }

UgliScintMdlNode::UgliScintMdlNode ( const PlexScintMdlId  scintmdlid,
UgliScintPlnNode plnNode,
const UgliDbiTables ugliTables 
) [protected]

Definition at line 52 of file UgliScintMdlNode.cxx.

References fClearLenEast, fClearLenWest, fScintMdlId, UgliDbiTables::fScintMdlStructTbl, fWlsLenEast, fWlsLenWest, UgliDbiScintMdl::GetClearLenEast(), UgliDbiScintMdl::GetClearLenWest(), UgliDbiTables::GetDbiScintMdlById(), UgliDbiScintMdl::GetLPosRelPln(), Nav::GetName(), DbiResultPtr< T >::GetRowByIndex(), UgliDbiScintMdl::GetTPosRelPln(), UgliDbiScintMdlStruct::GetTypeName(), UgliDbiScintMdl::GetWidth(), UgliDbiScintMdl::GetWlsLenEast(), UgliDbiScintMdl::GetWlsLenWest(), UgliDbiScintMdl::GetZRotRelPlnDeg(), Msg::kError, Msg::kWarning, MSG, SetDefaultModuleOutline(), SetLTPosRelPln(), and TNodeX::SetParent().

00055    : TNodeX(scintmdlid.AsString(),scintmdlid.AsString(),"noshape"),
00056      fUgliGeometry(plnNode->GetUgliGeometry()),
00057      fScintMdlId(scintmdlid)
00058 {
00059    // ctor for DBI driven UgliGeometry
00060 
00061    unsigned int mdlstruct_indx =
00062      UgliDbiStructHash(fScintMdlId).HashAsScintMdl();
00063    const UgliDbiScintMdlStruct* mdlStructRow =
00064       ugliTables.fScintMdlStructTbl.GetRowByIndex(mdlstruct_indx);
00065 
00066    const UgliDbiScintMdl *mdlRow = ugliTables.GetDbiScintMdlById(fScintMdlId);
00067    if (!mdlRow) {
00068      MSG("Ugli",Msg::kError)
00069        << "no UgliDbiScintMdl for " << fScintMdlId << endl;
00070      return;
00071    }
00072    fClearLenEast = mdlRow->GetClearLenEast();
00073    fClearLenWest = mdlRow->GetClearLenWest();
00074    fWlsLenEast = mdlRow->GetWlsLenEast();
00075    fWlsLenWest = mdlRow->GetWlsLenWest();
00076 
00077    // build and attach the shape we should actually have
00078    // for now just a box ...
00079    TXTRU* mdlshape = 
00080       new TXTRU(GetName(),mdlStructRow->GetTypeName().c_str(),
00081                 "void",8,2);
00082    TXTRU* plnshape = dynamic_cast<TXTRU*>(plnNode->GetShape());
00083    if (!plnshape) {
00084      MSG("Ugli",Msg::kWarning) 
00085        << "UgliScintPlnNode isn't a TXTRU" << endl;
00086    }
00087    mdlshape->DefineSection(0,plnshape->GetSectionZ(0));
00088    mdlshape->DefineSection(1,plnshape->GetSectionZ(1));
00089    Float_t width = mdlRow->GetWidth();
00090    SetDefaultModuleOutline(mdlshape,mdlStructRow->GetTypeName(),width);
00091 
00092    SetParent(plnNode);
00093    fShape = mdlshape;
00094 
00095    // set the position relative to the steel
00096    Float_t tpos = mdlRow->GetTPosRelPln();
00097    Float_t lpos = mdlRow->GetLPosRelPln();
00098    SetLTPosRelPln(lpos,tpos);
00099 //   cout << " Module " << mdlStructRow->GetTypeName() << " at tpos= "
00100 //        << tpos << " lpos = " << lpos << endl;
00101 
00102    // needs to build and set the right rotation matrix
00103    // here we only have a single rotation around z
00104    const Double_t deg90 = 90;
00105    Double_t zrot = mdlRow->GetZRotRelPlnDeg();
00106    fMatrix = new TRotMatrix(GetName(),GetName(),
00107                             deg90,zrot,deg90,zrot+deg90,0,0);
00108 
00109    SetLineColor(41);   // beige
00110 //   SetLineWidth(5);
00111    SetVisibility(0);
00112 
00113    // strips are installed by plane
00114 
00115 }

UgliScintMdlNode::UgliScintMdlNode ( const UgliScintMdlNode that  )  [private]

Member Function Documentation

void UgliScintMdlNode::DecrementRef (  )  [protected, virtual]

Reimplemented from UgliRefCnt.

Definition at line 141 of file UgliScintMdlNode.cxx.

References UgliRefCnt::DecrementRef(), UgliRefCnt::fRef, and fUgliGeometry.

Referenced by UgliScintMdlHandle::operator=(), and UgliScintMdlHandle::~UgliScintMdlHandle().

00142 { 
00143    fRef--; 
00144    fUgliGeometry->DecrementRef();
00145    if (!fRef) SetVisibility(0);
00146 }

Float_t UgliScintMdlNode::GetClearFiber ( const StripEnd::StripEnd_t  end  )  const [virtual]

Implements UgliScintMdlABC.

Definition at line 118 of file UgliScintMdlNode.cxx.

References fClearLenEast, fClearLenWest, StripEnd::kEast, and StripEnd::kWest.

Referenced by UgliStripNode::ClearFiber(), and UgliScintMdlHandle::GetClearFiber().

00119 {
00120    if      (end == StripEnd::kEast) return fClearLenEast;
00121    else if (end == StripEnd::kWest) return fClearLenWest;
00122    else return 0;
00123 }

Float_t UgliScintMdlNode::GetExtraWlsFiber ( const StripEnd::StripEnd_t  end  )  const [virtual]

Implements UgliScintMdlABC.

Definition at line 125 of file UgliScintMdlNode.cxx.

References fWlsLenEast, fWlsLenWest, StripEnd::kEast, and StripEnd::kWest.

Referenced by UgliScintMdlHandle::GetExtraWlsFiber(), and UgliStripNode::WlsPigtail().

00126 {
00127    if      (end == StripEnd::kEast) return fWlsLenEast;
00128    else if (end == StripEnd::kWest) return fWlsLenWest;
00129    else return 0;
00130 }

Float_t UgliScintMdlNode::GetLPosRelPln (  )  const [inline]

Definition at line 120 of file UgliScintMdlNode.h.

Referenced by UgliScintMdlHandle::GetLPosRelPln().

00120 { return fX; }

Int_t UgliScintMdlNode::GetModuleNum (  )  const [inline, virtual]

Implements UgliScintMdlABC.

Definition at line 111 of file UgliScintMdlNode.h.

References fScintMdlId, and PlexScintMdlId::GetModule().

Referenced by UgliScintMdlHandle::GetModuleNum().

00112 { return fScintMdlId.GetModule(); }

PlexPlaneId UgliScintMdlNode::GetPlexPlaneId (  )  const [inline, virtual]

Implements UgliScintMdlABC.

Definition at line 108 of file UgliScintMdlNode.h.

References fScintMdlId.

Referenced by UgliScintMdlHandle::GetPlexPlaneId().

00109 { return PlexPlaneId(fScintMdlId); }

virtual PlexScintMdlId UgliScintMdlNode::GetPlexScintMdlId (  )  const [inline, virtual]

Implements UgliScintMdlABC.

Definition at line 41 of file UgliScintMdlNode.h.

References fScintMdlId.

Referenced by UgliScintMdlHandle::GetPlexScintMdlId().

00041 {return fScintMdlId;}

UgliScintPlnNode * UgliScintMdlNode::GetScintPlnNode ( void   )  const

Definition at line 378 of file UgliScintMdlNode.cxx.

Referenced by UgliScintMdlHandle::GetScintPlnHandle(), UgliStripHandle::GetScintPlnHandle(), and UgliStripNode::GetTPos().

00379 { return dynamic_cast<UgliScintPlnNode*>(fParent); }

Float_t UgliScintMdlNode::GetTPosRelPln (  )  const [inline]

Definition at line 121 of file UgliScintMdlNode.h.

Referenced by UgliScintMdlHandle::GetTPosRelPln().

00121 { return fY; }

virtual UgliGeometry* UgliScintMdlNode::GetUgliGeometry (  )  const [inline, virtual]

Definition at line 54 of file UgliScintMdlNode.h.

References fUgliGeometry.

Referenced by UgliScintMdlHandle::IsFrozen().

00054 { return fUgliGeometry; }

Float_t UgliScintMdlNode::GetZRotRelPlnRad (  )  const [inline]

Definition at line 117 of file UgliScintMdlNode.h.

References Ugli::deg2rad.

Referenced by UgliScintMdlHandle::GetZRotRelPlnRad().

00118 { return fMatrix->GetPhi()*Ugli::deg2rad; }

TVector3 UgliScintMdlNode::GlobalToLocal ( const TVector3 &  global  )  const [virtual]

Definition at line 157 of file UgliScintMdlNode.cxx.

Referenced by UgliScintMdlHandle::GlobalToLocal().

00158 { 
00159    // get the local position based on global position
00160 
00161    Double_t gxyz[3], lxyz[3];
00162 
00163    gxyz[0] = global.X();
00164    gxyz[1] = global.Y();
00165    gxyz[2] = global.Z();
00166 
00167    // deal with fact that TNode::Master2Local isn't declared const
00168    UgliScintMdlNode* self = const_cast<UgliScintMdlNode*>(this);
00169    self->cd();
00170    self->UpdateMatrix();
00171    self->Master2Local(gxyz,lxyz);
00172 
00173    return TVector3(lxyz[0],lxyz[1],lxyz[2]);
00174 }

void UgliScintMdlNode::IncrementRef (  )  [protected, virtual]

Reimplemented from UgliRefCnt.

Definition at line 134 of file UgliScintMdlNode.cxx.

References UgliRefCnt::fRef, fUgliGeometry, and UgliRefCnt::IncrementRef().

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

00135 {
00136    fRef++; 
00137    fUgliGeometry->IncrementRef();
00138    SetVisibility(1);
00139 }

TVector3 UgliScintMdlNode::LocalToGlobal ( const TVector3 &  local  )  const [virtual]

Definition at line 177 of file UgliScintMdlNode.cxx.

Referenced by UgliScintMdlHandle::LocalToGlobal().

00178 { 
00179    // get the global position based on local position
00180 
00181    Double_t gxyz[3], lxyz[3];
00182 
00183    lxyz[0] = local.X();
00184    lxyz[1] = local.Y();
00185    lxyz[2] = local.Z();
00186 
00187    // deal with fact that TNode::Local2Master isn't declared const
00188    UgliScintMdlNode* self = const_cast<UgliScintMdlNode*>(this);
00189    self->cd();
00190    self->UpdateMatrix();
00191    self->Local2Master(lxyz,gxyz);
00192 
00193    return TVector3(gxyz[0],gxyz[1],gxyz[2]);
00194 }

Int_t UgliScintMdlNode::NumberOfStrips (  )  const [virtual]

Implements UgliScintMdlABC.

Definition at line 149 of file UgliScintMdlNode.cxx.

Referenced by UgliScintMdlHandle::NumberOfStrips().

00150 {
00151    // return the number of strips in the module
00152    if (!fNodes) return 0;
00153    return fNodes->GetSize();
00154 }

UgliScintMdlNode& UgliScintMdlNode::operator= ( const UgliScintMdlNode ugh  )  [private]

Reimplemented from UgliScintMdlABC.

void UgliScintMdlNode::SetDefaultModuleOutline ( TXTRU *  mdlShape,
const string &  typeName,
const Float_t  width 
) [static, protected]

Definition at line 197 of file UgliScintMdlNode.cxx.

References Munits::cm, Munits::inch, and Munits::m.

Referenced by UgliScintMdlNode().

00200 {
00201 
00202    typedef struct basic_mdl_shape {
00203       string mdl_name;
00204       Int_t n_vtx;
00205       Float_t xvtx_abs[8];
00206       Float_t yvtx_rel[8];
00207    } MdlShape;
00208 
00209    const Float_t half = 0.5;
00210 
00211    const Float_t far = half * 8.000 * Munits::m;
00212    const Float_t as  = half * 3.464 * Munits::m;
00213    const Float_t al  = half * 5.738 * Munits::m;
00214    const Float_t bs  = half * 5.735 * Munits::m;
00215    const Float_t byfc = 25 * Munits::cm;
00216    const Float_t byft = 16 * Munits::cm;
00217    const Float_t byff = 6./20.;
00218 
00219    const Float_t swidth = 4.1 * Munits::cm;
00220    const Float_t glw = 109.764 * Munits::inch;
00221    const Float_t gsw = glw - 28*swidth;
00222    const Float_t g0  = swidth + half*10*swidth; // ??
00223    const Float_t hw  = 103.307 * Munits::inch;
00224    const Float_t notch = (103.307-85.551) * Munits::inch;
00225    const Float_t iff = 11./20.;
00226 
00227    const Float_t caldet = half * 1.0 * Munits::m;
00228 
00229    MdlShape shapelist[] = { 
00230       // A shapes are the same (except a->A is rotated)
00231       { "aU", 4, 
00232         {-as,as,al,-al,0,0,0,0},
00233         {-half,-half,half,half,0,0,0,0}
00234       },
00235       { "aV", 4, 
00236         {-as,as,al,-al,0,0,0,0},
00237         {-half,-half,half,half,0,0,0,0}
00238       },
00239       { "AU", 4, 
00240         {-al,al,as,-as,0,0,0,0},
00241         {-half,-half,half,half,0,0,0,0}
00242       },
00243       { "AV", 4, 
00244         {-al,al,as,-as,0,0,0,0},
00245         {-half,-half,half,half,0,0,0,0}
00246       },
00247       // B shapes are the same (except b->B is rotated)
00248       { "bU", 4, 
00249         {-bs,bs,far,-far,0,0,0,0},
00250         {-half,-half,half,half,0,0,0,0}
00251       },
00252       { "bV", 4, 
00253         {-bs,bs,far,-far,0,0,0,0},
00254         {-half,-half,half,half,0,0,0,0}
00255       },
00256       { "BU", 4, 
00257         {-far,far,bs,-bs,0,0,0,0},
00258         {-half,-half,half,half,0,0,0,0}
00259       },
00260       { "BV", 4, 
00261         {-far,far,bs,-bs,0,0,0,0},
00262         {-half,-half,half,half,0,0,0,0}
00263       },
00264       // e,E (U view) and c,C (V view) are all nice and regular
00265       { "eU", 4, 
00266         {-far,far,far,-far,0,0,0,0},
00267         {-half,-half,half,half,0,0,0,0}
00268       },
00269       { "EU", 4, 
00270         {-far,far,far,-far,0,0,0,0},
00271         {-half,-half,half,half,0,0,0,0}
00272       },
00273       { "cV", 4, 
00274         {-far,far,far,-far,0,0,0,0},
00275         {-half,-half,half,half,0,0,0,0}
00276       },
00277       { "CV", 4, 
00278         {-far,far,far,-far,0,0,0,0},
00279         {-half,-half,half,half,0,0,0,0}
00280       },
00281       // f,F (U view) has a bypass 
00282       { "fU", 8, 
00283         {-far,far,far,byfc,byft,-byft,-byfc,-far},
00284         {-half,-half,half,half,half-byff,half-byff,half,half}
00285       },
00286       { "FU", 8, 
00287         {-far,-byfc,-byft,byft,byfc,far,far,-far},
00288         {-half,-half,-half+byff,-half+byff,-half,-half,half,half}
00289       },
00290       // d,D (V view) has a bypass 
00291       { "dV", 8, 
00292         {-far,far,far,byfc,byft,-byft,-byfc,-far},
00293         {-half,-half,half,half,half-byff,half-byff,half,half}
00294       },
00295       { "DV", 8, 
00296         {-far,-byfc,-byft,byft,byfc,far,far,-far},
00297         {-half,-half,-half+byff,-half+byff,-half,-half,half,half}
00298       },
00299       // Near U partial (REAL Detector)
00300       { "GU", 4,
00301         {glw-g0,-g0,-g0,gsw-g0,0,0,0,0},
00302         {-half,-half,half,half,0,0,0,0}
00303       },
00304       { "HU", 4,
00305         {hw-g0,-g0,-g0,hw-g0,0,0,0,0},
00306         {-half,-half,half,half,0,0,0,0}
00307       },
00308       { "IU", 6,
00309         {hw-g0,-g0+notch,-g0+notch,-g0,hw-g0,0,0},
00310         {-half,-half,-half+iff,-half+iff,half,half,0,0}
00311       },
00312       // Near V partial (REAL Detector)
00313       { "GV", 4,
00314         {glw-g0,-g0,-g0,gsw-g0,0,0,0,0},
00315         {half,half,-half,-half,0,0,0,0}
00316       },
00317       { "HV", 4,
00318         {hw-g0,-g0,-g0,hw-g0,0,0,0,0},
00319         {half,half,-half,-half,0,0,0,0}
00320       },
00321       { "IV", 6,
00322         {hw-g0,-g0+notch,-g0+notch,-g0,hw-g0,0,0},
00323         {half,half,half-iff,half-iff,-half,-half,0,0}
00324       },
00325       // CalDet
00326       { "XU", 4,
00327         {-caldet,caldet,caldet,-caldet,0,0,0,0},
00328         {-half,-half,half,half,0,0,0,0}
00329       },
00330       { "XV", 4,
00331         {-caldet,caldet,caldet,-caldet,0,0,0,0},
00332         {-half,-half,half,half,0,0,0,0}
00333       },
00334       { "XA", 4,
00335         {-caldet,caldet,caldet,-caldet,0,0,0,0},
00336         {-half,-half,half,half,0,0,0,0}
00337       },
00338       { "XB", 4,
00339         {-caldet,caldet,caldet,-caldet,0,0,0,0},
00340         {-half,-half,half,half,0,0,0,0}
00341       },
00342 #ifdef NOPE
00343       { "default", 4, 
00344         {-4,4,4,-4,0,0,0,0}, 
00345         {-half,-half,half,half,0,0,0,0}
00346       },
00347 #endif
00348       // this makes the outline disappear
00349       { "default",4, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0} }
00350    };
00351  
00352    Int_t listsize = sizeof(shapelist)/sizeof(MdlShape);
00353 
00354    Bool_t hitdefault = false;
00355    for (int indx=0; indx<listsize; indx++) {
00356       MdlShape* shapeptr = shapelist + indx;
00357       hitdefault = (shapeptr->mdl_name == "default");
00358 //      if (hitdefault) {
00359 //         cout << " no shape default for modules of type " 
00360 //              << typeName << endl;
00361 //      }
00362       if (shapeptr->mdl_name == typeName || hitdefault ) {
00363          // use this one
00364          mdlShape->TruncateNxy(shapeptr->n_vtx);
00365          for (int i=0; i<shapeptr->n_vtx; i++) {
00366             mdlShape->DefineVertex(i,shapeptr->xvtx_abs[i],
00367                                      shapeptr->yvtx_rel[i]*width);
00368          }
00369          break; // out of loop
00370       }
00371    } // loop over list of potential shapes
00372 
00373 }

void UgliScintMdlNode::SetLTPosRelPln ( Float_t  lpos,
Float_t  tpos 
) [inline]

Definition at line 114 of file UgliScintMdlNode.h.

Referenced by UgliScintMdlHandle::SetLTPosRelPln(), and UgliScintMdlNode().

00115 { SetPosition(lpos,tpos,0.0); }

void UgliScintMdlNode::SetZRotRelPlnRad ( Float_t  radians  ) 

Definition at line 382 of file UgliScintMdlNode.cxx.

References Ugli::rad2deg.

Referenced by UgliScintMdlHandle::SetZRotRelPlnRad().

00383 {
00384   // set the rotation around z 
00385   // this matrix is specific to this module so we can modify it
00386   Float_t zrotdeg = radians * Ugli::rad2deg;
00387   fMatrix->SetAngles(90,zrotdeg,90,zrotdeg+90,0,0);
00388 }


Friends And Related Function Documentation

friend class UgliScintMdlHandle [friend]

Definition at line 34 of file UgliScintMdlNode.h.

friend class UgliScintPlnNode [friend]

Definition at line 33 of file UgliScintMdlNode.h.


Member Data Documentation

Float_t UgliScintMdlNode::fClearLenEast [protected]

Definition at line 87 of file UgliScintMdlNode.h.

Referenced by GetClearFiber(), and UgliScintMdlNode().

Float_t UgliScintMdlNode::fClearLenWest [protected]

Definition at line 87 of file UgliScintMdlNode.h.

Referenced by GetClearFiber(), and UgliScintMdlNode().

Int_t UgliScintMdlNode::fModuleNum [protected]

Definition at line 86 of file UgliScintMdlNode.h.

Definition at line 84 of file UgliScintMdlNode.h.

Referenced by DecrementRef(), GetUgliGeometry(), and IncrementRef().

Float_t UgliScintMdlNode::fWlsLenEast [protected]

Definition at line 88 of file UgliScintMdlNode.h.

Referenced by GetExtraWlsFiber(), and UgliScintMdlNode().

Float_t UgliScintMdlNode::fWlsLenWest [protected]

Definition at line 88 of file UgliScintMdlNode.h.

Referenced by GetExtraWlsFiber(), and UgliScintMdlNode().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1