GeoScintMdlVolume Class Reference

#include <GeoScintMdlVolume.h>

Inheritance diagram for GeoScintMdlVolume:
GeoVolume

List of all members.

Public Member Functions

 GeoScintMdlVolume ()
virtual ~GeoScintMdlVolume ()
const TGeoNode * GetAirNode () const
GeoStripNodeGetStripNode (const PlexStripEndId &seid) const
std::vector< GeoStripNode * > GetStripNodePtrVector () const
virtual Int_t NumberOfStrips () const
virtual void Print (Option_t *option="") const

Protected Member Functions

 GeoScintMdlVolume (GeoGeometry *geo, const PlexScintMdlId &mdlid, const UgliDbiTables &ugliTables)

Private Member Functions

virtual void AddAirNode (const UgliDbiTables &ugliTables)
TGeoShape * BuildModuleShape (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildCalDet (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildFar (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildNear (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildSimpleTrap (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildBBox (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildFardfXtru (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildFarDFXtru (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildNearXtru (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildNeariXtru (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildNearIXtru (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildNearLmXtru (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
TGeoShape * BuildNearlMXtru (const UgliDbiTables &ugliTables, std::string shpName, bool isInner=false)
void Build4Corners (const UgliDbiTables &ugliTables, Float_t &m01, Float_t &m23)
void BuildHalfY (const UgliDbiTables &ugliTables)

Private Attributes

PlexScintMdlId fScintMdlId
Float_t fThick
Float_t fSkinThick
Float_t fXY [4][2]
TGeoShape * fBaseShp
TGeoShape * fBaseShpAir
 ptr to base module shape, not owned

Friends

class GeoGeometry

Detailed Description

Definition at line 21 of file GeoScintMdlVolume.h.


Constructor & Destructor Documentation

GeoScintMdlVolume::GeoScintMdlVolume (  ) 

Definition at line 39 of file GeoScintMdlVolume.cxx.

References Msg::kFatal, and MSG.

00039                                      : GeoVolume(),fScintMdlId(),fThick(0),
00040                                          fSkinThick(0),
00041                                          fBaseShp(0),fBaseShpAir(0) {
00042 
00043   if ( gROOT -> GetVersionInt() < 50600 ) {
00044     MSG("Geo",Msg::kFatal) << "GeoGeometry requires ROOT version >= 5.06/00."
00045                            << "\n Please switch to a newer version of root." 
00046                            << endl;
00047     abort();
00048   }  
00049     
00050   // Default constructor, for i/o
00051   for ( int ip = 0; ip < 4; ip++ ) {
00052     for ( int ic = 0; ic < 2; ic++ ) fXY[ip][ic] = 0;
00053   }
00054 
00055 }

virtual GeoScintMdlVolume::~GeoScintMdlVolume (  )  [inline, virtual]

Definition at line 28 of file GeoScintMdlVolume.h.

00028 {}

GeoScintMdlVolume::GeoScintMdlVolume ( GeoGeometry geo,
const PlexScintMdlId mdlid,
const UgliDbiTables ugliTables 
) [protected]

Definition at line 58 of file GeoScintMdlVolume.cxx.

References AddAirNode(), PlexScintMdlId::AsString(), BuildModuleShape(), fBaseShp, fBaseShpAir, GeoVolume::fGeoGeometry, fScintMdlId, GeoVolume::fShpName, fSkinThick, fThick, GeoGeometry::GetGeoCompatibleName(), GeoMediumMap::GetMedium(), GeoGeometry::GetMediumMap(), Nav::GetName(), GeoVolume::GetScale(), gGeoManager, PlexPlaneId::IsVetoShield(), Msg::kDebug, Msg::kFatal, Geo::kMdlAlSkin, Geo::kModuleSkinThick, Geo::kStripThick, Geo::kVSMdlAlSkin, MSG, and GeoVolume::UpdateGlobalManager().

00060                                                                       :
00061     GeoVolume(geo,
00062         (GeoGeometry::GetGeoCompatibleName(mdlId.AsString())).c_str(),0),
00063     fScintMdlId(mdlId),fThick(0),fSkinThick(0),fBaseShp(0),fBaseShpAir(0) {
00064   // Normal constructor - Protected.
00065 
00066   if ( gROOT -> GetVersionInt() < 50600 ) {
00067     MSG("Geo",Msg::kFatal) << "GeoGeometry requires ROOT version >= 5.06/00."
00068                            << "\n Please switch to a newer version of root." 
00069                            << endl;
00070     abort();
00071   }  
00072 
00073   UpdateGlobalManager();
00074 
00075   const GeoMediumMap& medMap = fGeoGeometry -> GetMediumMap();
00076   if ( fScintMdlId.IsVetoShield() ) 
00077                  SetMedium(medMap.GetMedium(Geo::kVSMdlAlSkin));
00078   else SetMedium(medMap.GetMedium(Geo::kMdlAlSkin));
00079 
00080   MSG("Geo",Msg::kDebug) << "GeoScintMdlVolume ctor, mdl name " 
00081                          << GetName() << endl;
00082  
00083   fShpName = GeoGeometry::GetGeoCompatibleName(mdlId.AsString());
00084    
00085   Float_t scale = GetScale();
00086   fSkinThick = scale*Geo::kModuleSkinThick;  // thickness of module skin
00087   fThick = scale*Geo::kStripThick + 2.*fSkinThick; // thickness of module
00088   
00089   // "s" requests shp name
00090   std::string baseshpname 
00091               = GeoGeometry::GetGeoCompatibleName(mdlId.AsString("s"));
00092   std::string baseshpairname = baseshpname + "_air";
00093   fBaseShp = dynamic_cast<TGeoShape*>(gGeoManager->GetListOfShapes()
00094                             -> FindObject(baseshpname.c_str()));
00095   fBaseShpAir = dynamic_cast<TGeoShape*>(gGeoManager->GetListOfShapes()
00096                             -> FindObject(baseshpairname.c_str()));
00097 
00098   if ( !fBaseShp ) {
00099     // create base shape if first call
00100     fBaseShp = BuildModuleShape(ugliTables,baseshpname);
00101     fBaseShpAir = BuildModuleShape(ugliTables,baseshpairname,true);
00102   }
00103   
00104   TGeoShape* shape = BuildModuleShape(ugliTables,fShpName);
00105 
00106   SetShape(shape);
00107 
00108   // Because shape was unknown at time of TGeoVolume construction, volume
00109   // was added to run-time list of volumes. Remove and add to normal list
00110   gGeoManager -> GetListOfGVolumes() -> Remove(this);
00111   Int_t index = gGeoManager->GetListOfVolumes() -> GetEntriesFast();
00112   gGeoManager -> GetListOfVolumes() -> AddAtAndExpand(this,index);
00113   
00114   this -> SetLineColor(17); // Grey
00115   //this -> SetLineWidth(GetLineWidth()*2);
00116   this -> SetVisibility(kTRUE);
00117 
00118   this -> AddAirNode(ugliTables);
00119   
00120 }


Member Function Documentation

void GeoScintMdlVolume::AddAirNode ( const UgliDbiTables ugliTables  )  [private, virtual]

Definition at line 123 of file GeoScintMdlVolume.cxx.

References BuildModuleShape(), GeoVolume::fGeoGeometry, fScintMdlId, GeoVolume::fShpName, GeoMediumMap::GetMedium(), GeoGeometry::GetMediumMap(), Nav::GetName(), PlexPlaneId::IsVetoShield(), Geo::kMdlAir, Geo::kVSMdlAir, and GeoVolume::UpdateGlobalManager().

Referenced by GeoScintMdlVolume().

00123                                                                   {  
00124   // Build shape of module interior and associated air volume. Place
00125   // air volume as node of aluminum module.
00126 
00127   UpdateGlobalManager();
00128 
00129   Geo::EDetComponent detcomp = Geo::kMdlAir;
00130   if ( fScintMdlId.IsVetoShield() ) detcomp = Geo::kVSMdlAir;
00131 
00132   std::string airShpName = fShpName+"_air";
00133   TGeoShape* airShape = BuildModuleShape(ugliTables,airShpName,true);
00134   
00135   std::string airVolName = std::string(GetName()) + "_air"; 
00136   TGeoVolume* airVol = new TGeoVolume(airVolName.c_str(),airShape,
00137                        fGeoGeometry->GetMediumMap().GetMedium(detcomp));
00138   airVol -> SetLineColor(17); // 17 for Grey
00139   airVol -> SetVisibility(kTRUE);
00140   
00141   this -> AddNode(airVol,1,gGeoIdentity);
00142 
00143   return;
00144                                     
00145 }

void GeoScintMdlVolume::Build4Corners ( const UgliDbiTables ugliTables,
Float_t &  m01,
Float_t &  m23 
) [private]

Definition at line 884 of file GeoScintMdlVolume.cxx.

References PlexStripEndId::AsString(), fScintMdlId, UgliDbiTables::fScintMdlStructTbl, fSkinThick, fXY, UgliDbiTables::GetDbiStripById(), GeoGeometry::GetGeoCompatibleName(), UgliDbiStrip::GetLPosRelMdl(), PlexScintMdlId::GetModuleType(), DbiResultPtr< T >::GetRowByIndex(), GeoVolume::GetScale(), UgliDbiStrip::GetTPosRelMdl(), gGeoManager, UgliDbiStructHash::HashAsScintMdl(), Msg::kFatal, MSG, and GeoVolume::UpdateGlobalManager().

Referenced by BuildBBox(), BuildFarDFXtru(), BuildFardfXtru(), BuildNearIXtru(), BuildNeariXtru(), BuildNearLmXtru(), BuildNearlMXtru(), BuildNearXtru(), and BuildSimpleTrap().

00885                                                                   {
00886  // Private routine to help with build of module shape
00887  // Fills array fXY[4][2] with xy positions defining the 4 corners of 
00888  // the trapezoid, and returns (through reference arguments) the slope of the
00889  // lo lpos (m01) and hi lpos (m23) sides.  The ordering of the 4 corners
00890  // is clockwise from the lo lpos, lo tpos position, e.g. 0)(lolpos,lotpos),
00891  // 1)(lolpos,hitpos), 2)(hilpos,hitpos), 3)(hilpos,lotpos)  
00892  // Assumes that strip volumes have already been built.
00893 
00894   UpdateGlobalManager();
00895 
00896   m01 = 0; m23 = 0;  // null slope implies vertical
00897   Float_t scale = GetScale();
00898   
00899   UgliDbiStructHash modulestructhash(fScintMdlId);
00900   const UgliDbiScintMdlStruct* scModuleStruct 
00901        = ugliTables.fScintMdlStructTbl
00902         .GetRowByIndex(modulestructhash.HashAsScintMdl());
00903 
00904   // Lo and hi strips associated with this module
00905   Int_t lostrip = scModuleStruct -> GetFirstStrip();
00906   Int_t histrip = scModuleStruct -> GetLastStrip(); 
00907   
00908   // The assumption made to determine the boundaries of a given module
00909   // is that zrot of strips relative to module is always null, and that
00910   // lpos of strips relative to module follow the boundaries of the trapezoid
00911   // defined by the 4 lo/hi strip corners. Alignment variations in tpos
00912   // are allowed.
00913 
00914   // Need lo strip position to set lower corner boundaries
00915   PlexStripEndId loseid(fScintMdlId,lostrip);
00916   const UgliDbiStrip* scStrip = ugliTables.GetDbiStripById(loseid);
00917   std::string stpName=GeoGeometry::GetGeoCompatibleName(loseid.AsString("s"));
00918   const GeoStripVolume* stpVol = dynamic_cast<const GeoStripVolume*>
00919               (gGeoManager -> GetVolume(stpName.c_str()));
00920   if ( !stpVol ) {
00921     MSG("Geo",Msg::kFatal) 
00922        << "Unable to find pre-built stripvol for volume "
00923        << stpName.c_str() << endl;
00924     abort();
00925   }
00926   
00927   Float_t lostriphalfwidth = stpVol->GetHalfWidth() + fSkinThick;
00928   
00929   // lo lpos, hi tpos corner of lo strip
00930   fXY[0][0] = scale*(scStrip->GetLPosRelMdl())-stpVol->GetHalfLength()
00931              -fSkinThick;
00932   fXY[0][1] = scale*(scStrip->GetTPosRelMdl())+stpVol->GetHalfWidth()
00933              +fSkinThick;
00934     
00935   // hi lpos, hi tpos corner of lo strip
00936   fXY[3][0] = scale*(scStrip->GetLPosRelMdl())+stpVol->GetHalfLength()
00937              +fSkinThick;
00938   fXY[3][1] = scale*(scStrip->GetTPosRelMdl())+stpVol->GetHalfWidth()
00939              +fSkinThick;
00940 
00941   // Need hi strip tpos first to set upper corner boundaries
00942   PlexStripEndId hiseid(fScintMdlId,histrip);
00943   scStrip = ugliTables.GetDbiStripById(hiseid);
00944   stpName=GeoGeometry::GetGeoCompatibleName(hiseid.AsString("s"));
00945 
00946   stpVol = dynamic_cast<GeoStripVolume*>
00947            (gGeoManager -> GetVolume(stpName.c_str()));
00948   if ( !stpVol ) {
00949     MSG("Geo",Msg::kFatal) 
00950        << "Unable to find pre-built stripvol for volume "
00951        << stpName.c_str() << endl;
00952     abort();
00953   }
00954 
00955   Double_t histriphalfwidth = stpVol->GetHalfWidth() + fSkinThick;
00956 
00957   // lo lpos, hi tpos of histrip 
00958   fXY[1][0] = scale*(scStrip->GetLPosRelMdl())-stpVol->GetHalfLength()
00959              -fSkinThick;
00960   fXY[1][1] = scale*(scStrip->GetTPosRelMdl())+stpVol->GetHalfWidth()
00961              +fSkinThick;
00962 
00963   // hi lpos, hi tpos of hi strip
00964   fXY[2][0] = scale*(scStrip->GetLPosRelMdl())+stpVol->GetHalfLength()
00965              +fSkinThick;
00966   fXY[2][1] = scale*(scStrip->GetTPosRelMdl())+stpVol->GetHalfWidth()
00967              +fSkinThick;
00968 
00969   // Calculate slope on p0/p1 side
00970   UChar_t mdlType = fScintMdlId.GetModuleType();
00971   if ( mdlType != 'i' && mdlType != 'I' ) {
00972     // Not for near detector modules with corner cut-outs. Fix me.
00973     if ( TMath::Abs(fXY[1][0] - fXY[0][0]) >= 0.0001*scale ) {
00974       m01 = (fXY[1][1] - fXY[0][1])/
00975             (fXY[1][0] - fXY[0][0]);
00976       if ( m01 > 0 ) {
00977         fXY[0][0] -= 2.*lostriphalfwidth/m01; // pos slope
00978       }
00979       else {
00980         fXY[1][0] += 2.*histriphalfwidth/m01; // neg slope
00981       }
00982     }
00983   }
00984   
00985   // Calculate slope on p3/p2 side
00986   if ( TMath::Abs(fXY[2][0] - fXY[3][0]) >= 0.0001*scale ) {
00987     m23 = (fXY[2][1] - fXY[3][1])/
00988           (fXY[2][0] - fXY[3][0]);
00989     if ( m23 < 0 ) {
00990       fXY[3][0] -= 2.*lostriphalfwidth/m23; // neg slope
00991     }
00992     else {
00993       fXY[2][0] += 2.*histriphalfwidth/m23; // pos slope
00994     }
00995   }
00996 
00997   fXY[0][1] -= 2.*lostriphalfwidth;
00998   fXY[3][1] -= 2.*lostriphalfwidth;
00999 
01000   //for (int ic = 0; ic < 4; ic++ ) {
01001   //  cout << ic << ")" << fXY[ic][0] << "," << fXY[ic][1] << endl;
01002   //}
01003   
01004 }

TGeoShape * GeoScintMdlVolume::BuildBBox ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 447 of file GeoScintMdlVolume.cxx.

References Build4Corners(), fSkinThick, fThick, fXY, and GeoVolume::UpdateGlobalManager().

Referenced by BuildCalDet(), and BuildFar().

00448                                                                          {
00449  // Simple Box shape
00450 
00451   UpdateGlobalManager();
00452 
00453   Float_t m01 =0; // slope on lo lpos side
00454   Float_t m23 = 0; // slope on hi lpos side
00455   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00456 
00457   Double_t halfx = 0.5*(fXY[3][0] - fXY[0][0]);
00458   Double_t halfy = 0.5*(fXY[1][1] - fXY[0][1]);
00459   Double_t halfz = 0.5*fThick;
00460 
00461   if ( isInner )  {
00462     // Interior shape
00463     halfx -= fSkinThick;
00464     halfy -= fSkinThick;
00465     halfz -= fSkinThick;
00466   }
00467 
00468   TGeoBBox* mdlShape = new TGeoBBox(shpName.c_str(), halfx, halfy, halfz);
00469   
00470   return mdlShape;
00471 
00472 } 

TGeoShape * GeoScintMdlVolume::BuildCalDet ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 270 of file GeoScintMdlVolume.cxx.

References BuildBBox(), fScintMdlId, PlexScintMdlId::GetModuleType(), Msg::kVerbose, MSG, and GeoVolume::UpdateGlobalManager().

Referenced by BuildModuleShape().

00271                                                                            {
00272   // Private method used to build shape for calibration detector modules. 
00273 
00274   UpdateGlobalManager();
00275 
00276   UChar_t mdlType = fScintMdlId.GetModuleType();
00277   std::string regionName = ( isInner ) ? "interior" : "shell";
00278   
00279   MSG("Geo",Msg::kVerbose)
00280     << "Build cal detector module shape for module type " 
00281     << mdlType << " " << regionName.c_str() << "." << endl;
00282 
00283   TGeoShape* shape = 0;
00284 
00285   switch ( mdlType ) {
00286   default:
00287     // All caldet module types are simple boxes
00288     shape = BuildBBox(ugliTables,shpName,isInner);
00289     break;
00290   } // end of switch
00291 
00292   return shape;
00293 
00294 } 

TGeoShape * GeoScintMdlVolume::BuildFar ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 297 of file GeoScintMdlVolume.cxx.

References BuildBBox(), BuildFarDFXtru(), BuildFardfXtru(), BuildSimpleTrap(), fScintMdlId, PlexScintMdlId::GetModuleType(), Msg::kError, Msg::kVerbose, MSG, and GeoVolume::UpdateGlobalManager().

Referenced by BuildModuleShape().

00298                                                                         {
00299   // Private method used to build shape for far detector modules. 
00300 
00301   UpdateGlobalManager();
00302 
00303   UChar_t mdlType = fScintMdlId.GetModuleType();
00304   std::string regionName = ( isInner ) ? "interior" : "shell";
00305   
00306   MSG("Geo",Msg::kVerbose)
00307     << "Build far detector module shape for module type " 
00308     << mdlType << " " << regionName.c_str() << "." << endl;
00309 
00310   TGeoShape* shape = 0;
00311 
00312   switch ( mdlType ) {
00313     case 'A':
00314     case 'a':
00315     case 'B':
00316     case 'b':
00317       // Simple trapezoid
00318       shape = BuildSimpleTrap(ugliTables,shpName,isInner);
00319       break;
00320     case 'C':
00321     case 'c':
00322     case 'E':
00323     case 'e':
00324       // Box 
00325       shape = BuildBBox(ugliTables,shpName,isInner);
00326       break;
00327     case 'd':
00328     case 'f':
00329       // Box with coil hole cut out on high tpos side
00330       shape = BuildFardfXtru(ugliTables,shpName,isInner);
00331       break;
00332     case 'D':
00333     case 'F':
00334       // Box with coil hole cut out on lo tpos side
00335       shape = BuildFarDFXtru(ugliTables,shpName,isInner);
00336       break;
00337     default:
00338       MSG("Geo",Msg::kError)
00339       << "Scint module shape construction for far detector module type\n"
00340       << mdlType << " not yet supported." << endl;
00341   } // end of switch
00342 
00343   return shape;
00344 
00345 } 

TGeoShape * GeoScintMdlVolume::BuildFarDFXtru ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 831 of file GeoScintMdlVolume.cxx.

References Build4Corners(), fSkinThick, fThick, fXY, GeoVolume::GetScale(), Geo::kFarModuleHoleRad, and GeoVolume::UpdateGlobalManager().

Referenced by BuildFar().

00833                                                            {
00834  // Box with coil hole cut out from bottom
00835 
00836   UpdateGlobalManager();
00837 
00838   Float_t m01 =0; // slope on lo lpos side
00839   Float_t m23 = 0; // slope on hi lpos side
00840   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00841 
00842   const int np = 15; // greater than 5
00843   Double_t xp[np] = {0}, yp[np] = {0};
00844 
00845   Double_t halfthick = 0.5*fThick;
00846   Double_t skinthick = 0;
00847   Double_t radhole = Geo::kFarModuleHoleRad*GetScale();
00848   Double_t delta = 0;
00849   Double_t dang = TMath::Pi()/(np-5);
00850   radhole /= cos(0.5*dang);
00851   
00852   if ( isInner ) {
00853     halfthick -= fSkinThick;
00854     skinthick = fSkinThick;
00855     radhole += fSkinThick;
00856     delta = TMath::ASin(skinthick/radhole); // small angle approx
00857     dang = (TMath::Pi()-2.*delta)/(np-5);
00858   }
00859     
00860   xp[0] = fXY[0][0] + skinthick; yp[0] = fXY[0][1] + skinthick;
00861   xp[1] = fXY[1][0] + skinthick; yp[1] = fXY[1][1] - skinthick;
00862   xp[2] = fXY[2][0] - skinthick; yp[2] = fXY[2][1] - skinthick;
00863   xp[3] = fXY[3][0] - skinthick; yp[3] = fXY[3][1] + skinthick;
00864   Double_t holevtx = fXY[3][1];
00865   for ( int ip = 4; ip < np; ip++ ) {
00866     Double_t ang = dang*(ip-4)+delta;
00867     xp[ip] = radhole*cos(ang);    ;
00868     yp[ip] = holevtx + radhole*sin(ang);
00869   }
00870   
00871   TGeoXtru* mdlShape = new TGeoXtru(2);
00872   mdlShape -> SetName(shpName.c_str());
00873   
00874   mdlShape-> DefinePolygon(np,xp,yp);
00875   
00876   mdlShape -> DefineSection(0,-halfthick);
00877   mdlShape -> DefineSection(1,+halfthick);
00878   
00879   return mdlShape;
00880 
00881 } 

TGeoShape * GeoScintMdlVolume::BuildFardfXtru ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 475 of file GeoScintMdlVolume.cxx.

References Build4Corners(), fSkinThick, fThick, fXY, GeoVolume::GetScale(), Geo::kFarModuleHoleRad, and GeoVolume::UpdateGlobalManager().

Referenced by BuildFar().

00477                                                            {
00478  // Box with coil hole cut out from top
00479 
00480   UpdateGlobalManager();
00481 
00482   Float_t m01 =0; // slope on lo lpos side
00483   Float_t m23 = 0; // slope on hi lpos side
00484   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00485 
00486   const int np = 15; // greater than 5
00487   Double_t xp[np] = {0}, yp[np] = {0};
00488 
00489   Double_t halfthick = 0.5*fThick;
00490   Double_t skinthick = 0;
00491   Double_t radhole = Geo::kFarModuleHoleRad*GetScale();
00492   Double_t delta = 0;
00493   Double_t dang = TMath::Pi()/(np-5);
00494   radhole /= cos(0.5*dang);
00495   
00496   if ( isInner ) {
00497     halfthick -= fSkinThick;
00498     skinthick = fSkinThick;
00499     radhole += fSkinThick;
00500     delta = TMath::ASin(skinthick/radhole); // small angle approx
00501     dang = (TMath::Pi()-2.*delta)/(np-5);
00502   }
00503     
00504   xp[0] = fXY[0][0] + skinthick; yp[0] = fXY[0][1] + skinthick;
00505   xp[1] = fXY[1][0] + skinthick; yp[1] = fXY[1][1] - skinthick;
00506   xp[np-2] = fXY[2][0] - skinthick; yp[np-2] = fXY[2][1] - skinthick;
00507   xp[np-1] = fXY[3][0] - skinthick; yp[np-1] = fXY[3][1] + skinthick;
00508   Double_t holevtx = fXY[2][1];
00509   for ( int ip = 2; ip < np-2; ip++ ) {
00510     Double_t ang = dang*(ip-2)+delta;
00511     xp[ip] = -radhole*cos(ang);    ;
00512     yp[ip] = holevtx - radhole*sin(ang);
00513   }
00514   
00515   TGeoXtru* mdlShape = new TGeoXtru(2);
00516   mdlShape -> SetName(shpName.c_str());
00517   
00518   mdlShape-> DefinePolygon(np,xp,yp);
00519   
00520   mdlShape -> DefineSection(0,-halfthick);
00521   mdlShape -> DefineSection(1,+halfthick);
00522   
00523   return mdlShape;
00524   
00525 } 

void GeoScintMdlVolume::BuildHalfY ( const UgliDbiTables ugliTables  )  [private]

Definition at line 1007 of file GeoScintMdlVolume.cxx.

References fScintMdlId, UgliDbiTables::fScintMdlStructTbl, fSkinThick, fXY, UgliDbiTables::GetDbiStripById(), DbiResultPtr< T >::GetRowByIndex(), GeoVolume::GetScale(), UgliDbiStrip::GetTPosRelMdl(), UgliDbiStructHash::HashAsScintMdl(), Geo::kStripWidth, and GeoVolume::UpdateGlobalManager().

Referenced by BuildModuleShape().

01007                                                                   {
01008  // Private routine to help with build of module shape
01009  // Fills fXY[0][1] and fXY[1][1] matrix elements only to be used
01010  // in building of scaled shapes.
01011 
01012   UpdateGlobalManager();
01013 
01014   Float_t scale = GetScale();
01015 
01016   UgliDbiStructHash modulestructhash(fScintMdlId);
01017   const UgliDbiScintMdlStruct* scModuleStruct
01018        = ugliTables.fScintMdlStructTbl
01019         .GetRowByIndex(modulestructhash.HashAsScintMdl());
01020 
01021   // Lo and hi strips associated with this module
01022   Int_t lostrip = scModuleStruct -> GetFirstStrip();
01023   Int_t histrip = scModuleStruct -> GetLastStrip();
01024 
01025   // Need lo strip position to set lower corner boundaries
01026   PlexStripEndId loseid(fScintMdlId,lostrip);
01027   const UgliDbiStrip* scStrip = ugliTables.GetDbiStripById(loseid);
01028 
01029   Float_t striphalfwidth = 0.5*(Geo::kStripWidth)*scale + fSkinThick;
01030 
01031   fXY[0][1] = scale*(scStrip->GetTPosRelMdl())-striphalfwidth;
01032 
01033   // Need hi strip tpos to set upper corner boundaries
01034   PlexStripEndId hiseid(fScintMdlId,histrip);
01035   scStrip = ugliTables.GetDbiStripById(hiseid);
01036 
01037   // lo lpos, hi tpos of histrip
01038   fXY[1][1] = scale*(scStrip->GetTPosRelMdl())+striphalfwidth;
01039 
01040 }

TGeoShape * GeoScintMdlVolume::BuildModuleShape ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 203 of file GeoScintMdlVolume.cxx.

References bfld::AsString(), BuildCalDet(), BuildFar(), BuildHalfY(), BuildNear(), fBaseShp, fBaseShpAir, fScintMdlId, fSkinThick, fXY, PlexPlaneId::GetDetector(), Detector::kCalDet, Msg::kDebug, Msg::kError, Detector::kFar, Detector::kNear, MSG, and GeoVolume::UpdateGlobalManager().

Referenced by AddAirNode(), and GeoScintMdlVolume().

00205                                                              {
00206   // Private method used to build shape for this plane. 
00207 
00208   UpdateGlobalManager();
00209   
00210   MSG("Geo",Msg::kDebug) << "BuildModuleShape for shape " << shpName.c_str() 
00211                          << endl;
00212   
00213   
00214   TGeoShape* mdlBaseShp = fBaseShp;
00215   if ( isInner ) {
00216     mdlBaseShp = fBaseShpAir;
00217   }
00218 
00219   if ( mdlBaseShp ) {
00220     BuildHalfY(ugliTables); // simpler than Build4Corners
00221     Double_t halfybasic = dynamic_cast<TGeoBBox*>(mdlBaseShp) -> GetDY();
00222     Double_t halfy = 0.5*(fXY[1][1] - fXY[0][1]);
00223     if ( isInner ) halfy -= fSkinThick;
00224     Double_t scaley = halfy/halfybasic;
00225     if ( TMath::Abs(scaley - 1.) > 1.e-6 ) {
00226 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,6,0)
00227       return (new TGeoScaledShape(shpName.c_str(),mdlBaseShp,
00228                                   new TGeoScale(1.,scaley,1.)));
00229 #endif
00230     }
00231     else {
00232       return mdlBaseShp;
00233     }
00234   }
00235 
00236   TGeoShape* shape = 0;
00237   
00238   Detector::Detector_t dettype = fScintMdlId.GetDetector();
00239 
00240   switch ( dettype ) {
00241 
00242   case Detector::kFar:
00243 
00244     shape = BuildFar(ugliTables,shpName,isInner);
00245     break;
00246     
00247   case Detector::kNear:
00248 
00249     shape = BuildNear(ugliTables,shpName,isInner);
00250     break;
00251 
00252   case Detector::kCalDet:
00253 
00254     shape = BuildCalDet(ugliTables,shpName,isInner);
00255     break;
00256 
00257   default:
00258 
00259     MSG("Geo",Msg::kError)<< "Scint mdl shape construction for detector type\n"
00260     << Detector::AsString(dettype)
00261     << " not yet supported." << endl;
00262 
00263   } // end of switch
00264 
00265   return shape;
00266 
00267 } 

TGeoShape * GeoScintMdlVolume::BuildNear ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 348 of file GeoScintMdlVolume.cxx.

References BuildNearIXtru(), BuildNeariXtru(), BuildNearLmXtru(), BuildNearlMXtru(), BuildNearXtru(), fScintMdlId, PlexScintMdlId::GetModuleType(), Msg::kError, Msg::kVerbose, MSG, and GeoVolume::UpdateGlobalManager().

Referenced by BuildModuleShape().

00349                                                                          {
00350   // Private method used to build shape for near detector modules. 
00351 
00352   UpdateGlobalManager();
00353 
00354   UChar_t mdlType = fScintMdlId.GetModuleType();
00355   std::string regionName = ( isInner ) ? "interior" : "shell";
00356   
00357   MSG("Geo",Msg::kVerbose)
00358     << "Build near detector module shape for module type " 
00359     << mdlType << " " << regionName.c_str() << "." << endl;
00360 
00361   TGeoShape* shape = 0;
00362 
00363   switch ( mdlType ) {
00364     case 'g':
00365     case 'G':
00366     case 'h':
00367     case 'H':
00368     case 'j':
00369     case 'J':
00370     case 'k':
00371     case 'K':
00372     case 'n':
00373     case 'N':
00374        // Trapezoids or box
00375       shape = BuildNearXtru(ugliTables,shpName,isInner);
00376       break;
00377     case 'i':
00378      // Box with coil hole in lower tpos, lower lpos corner
00379       shape = BuildNeariXtru(ugliTables,shpName,isInner);
00380       break;
00381     case 'I':
00382       // Box with coil hole in upper tpos, lower lpos corner
00383       shape = BuildNearIXtru(ugliTables,shpName,isInner);
00384       break;
00385     case 'l':
00386     case 'M':
00387       // Box or trapezoid with coil hole on lo tpos side, centered on lpos=0
00388       shape = BuildNearlMXtru(ugliTables,shpName,isInner);
00389       break;
00390     case 'L':
00391     case 'm':
00392       // Box or trapezoid with coil hole on hi tpos side, centered on lpos=0
00393      shape = BuildNearLmXtru(ugliTables,shpName,isInner);
00394      break;
00395     default:
00396       MSG("Geo",Msg::kError)
00397       << "Scint module shape construction for near detector module type\n"
00398       << mdlType << " not yet supported." << endl;
00399   } // end of switch
00400 
00401   return shape;
00402 
00403 } 

TGeoShape * GeoScintMdlVolume::BuildNearIXtru ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 658 of file GeoScintMdlVolume.cxx.

References PlexStripEndId::AsString(), Build4Corners(), fScintMdlId, fSkinThick, fThick, fXY, UgliDbiTables::GetDbiStripById(), GeoGeometry::GetGeoCompatibleName(), GeoVolume::GetScale(), UgliDbiStrip::GetTPosRelMdl(), gGeoManager, Msg::kFatal, MSG, and GeoVolume::UpdateGlobalManager().

Referenced by BuildNear().

00660                                                            {
00661  // Box with coil hole cut out from lo lpos, hi tpos corner
00662 
00663   UpdateGlobalManager();
00664   
00665   Float_t m01 =0; // slope on lo lpos side
00666   Float_t m23 = 0; // slope on hi lpos side
00667   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00668 
00669   // For module type 'I', strips 48-56 are long, strips 57-67 are short
00670   // To define corner cutout, need tpos of hi tpos side of last long strip(56)
00671   PlexStripEndId seid(fScintMdlId,56);
00672   const UgliDbiStrip* scStrip = ugliTables.GetDbiStripById(seid);
00673   std::string stpName = GeoGeometry::GetGeoCompatibleName(seid.AsString("s"));
00674   const GeoStripVolume* stpVol = dynamic_cast<const GeoStripVolume*>
00675                             (gGeoManager->GetVolume(stpName.c_str()));
00676   if ( !stpVol ) {
00677     MSG("Geo",Msg::kFatal) 
00678        << "Unable to find pre-built stripvol for volume "
00679        << stpName.c_str() << endl;
00680     abort();
00681   }
00682   Float_t ypositype = GetScale()*(scStrip->GetTPosRelMdl())
00683                      + stpVol->GetHalfWidth() + fSkinThick;
00684   
00685   const int np = 6; 
00686   Double_t xp[np] = {0}, yp[np] = {0};
00687 
00688   Double_t halfthick = 0.5*fThick;
00689   Double_t skinthick = 0;
00690   
00691   if ( isInner ) {
00692     halfthick -= fSkinThick;
00693     skinthick = fSkinThick;
00694   }
00695     
00696   xp[0] = fXY[0][0] + skinthick; yp[0] = fXY[0][1] + skinthick;
00697   xp[1] = fXY[0][0] + skinthick; yp[1] = ypositype - skinthick;
00698   xp[2] = fXY[1][0] + skinthick; yp[2] = ypositype - skinthick;
00699   xp[3] = fXY[1][0] + skinthick; yp[3] = fXY[1][1] - skinthick;
00700   xp[4] = fXY[2][0] - skinthick; yp[4] = fXY[2][1] - skinthick;
00701   xp[5] = fXY[3][0] - skinthick; yp[5] = fXY[3][1] + skinthick;
00702    
00703   TGeoXtru* mdlShape = new TGeoXtru(2);
00704   mdlShape -> SetName(shpName.c_str());
00705   
00706   mdlShape-> DefinePolygon(np,xp,yp);
00707   
00708   mdlShape -> DefineSection(0,-halfthick);
00709   mdlShape -> DefineSection(1,+halfthick);
00710   
00711   return mdlShape;
00712 
00713 } 

TGeoShape * GeoScintMdlVolume::BuildNeariXtru ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 716 of file GeoScintMdlVolume.cxx.

References PlexStripEndId::AsString(), Build4Corners(), fScintMdlId, fSkinThick, fThick, fXY, UgliDbiTables::GetDbiStripById(), GeoGeometry::GetGeoCompatibleName(), GeoVolume::GetScale(), UgliDbiStrip::GetTPosRelMdl(), gGeoManager, Msg::kFatal, MSG, and GeoVolume::UpdateGlobalManager().

Referenced by BuildNear().

00718                                                            {
00719  // Box with coil hole cut out from lo lpos, lo tpos corner
00720 
00721   UpdateGlobalManager();
00722 
00723   Float_t m01 =0; // slope on lo lpos side
00724   Float_t m23 = 0; // slope on hi lpos side
00725   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00726 
00727   // For module type 'i', strips 0-10 are short, strips 11-19 are long
00728   // To define corner cutout, need tpos of lo tpos side of first long strip(11)
00729   PlexStripEndId seid(fScintMdlId,11);
00730   const UgliDbiStrip* scStrip = ugliTables.GetDbiStripById(seid);
00731   std::string stpName = GeoGeometry::GetGeoCompatibleName(seid.AsString("s"));
00732   const GeoStripVolume* stpVol = dynamic_cast<const GeoStripVolume*>
00733                             (gGeoManager->GetVolume(stpName.c_str()));
00734 
00735   if ( !stpVol ) {
00736     MSG("Geo",Msg::kFatal) 
00737        << "Unable to find pre-built stripvol for volume "
00738        << stpName.c_str() << endl;
00739     abort();
00740   }
00741   Float_t ypositype = GetScale()*(scStrip->GetTPosRelMdl())
00742                     - stpVol->GetHalfWidth() - fSkinThick;
00743 
00744   const int np = 6; 
00745   Double_t xp[np] = {0}, yp[np] = {0};
00746 
00747   Double_t halfthick = 0.5*fThick;
00748   Double_t skinthick = 0;
00749   
00750   if ( isInner ) {
00751     halfthick -= fSkinThick;
00752     skinthick = fSkinThick;
00753   }
00754     
00755   xp[0] = fXY[0][0] + skinthick; yp[0] = fXY[0][1] + skinthick;
00756   xp[1] = fXY[0][0] + skinthick; yp[1] = ypositype + skinthick;
00757   xp[2] = fXY[1][0] + skinthick; yp[2] = ypositype + skinthick;
00758   xp[3] = fXY[1][0] + skinthick; yp[3] = fXY[1][1] - skinthick;
00759   xp[4] = fXY[2][0] - skinthick; yp[4] = fXY[2][1] - skinthick;
00760   xp[5] = fXY[3][0] - skinthick; yp[5] = fXY[3][1] + skinthick;
00761    
00762   TGeoXtru* mdlShape = new TGeoXtru(2);
00763   mdlShape -> SetName(shpName.c_str());
00764   
00765   mdlShape-> DefinePolygon(np,xp,yp);
00766   
00767   mdlShape -> DefineSection(0,-halfthick);
00768   mdlShape -> DefineSection(1,+halfthick);
00769   
00770   return mdlShape;
00771 
00772 } 

TGeoShape * GeoScintMdlVolume::BuildNearlMXtru ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 593 of file GeoScintMdlVolume.cxx.

References Build4Corners(), GeoVolume::fGeoGeometry, fSkinThick, fThick, fXY, GeoGeometry::GetAppType(), GeoVolume::GetScale(), Geo::kNearModuleHoleRad, and GeoVolume::UpdateGlobalManager().

Referenced by BuildNear().

00595                                                             {
00596  // Box with coil hole cut out from bottom (lo tpos) side, with hole
00597  // centered on lpos = 0
00598 
00599   UpdateGlobalManager();
00600 
00601   Float_t m01 =0; // slope on lo lpos side
00602   Float_t m23 = 0; // slope on hi lpos side
00603   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00604 
00605   const int np = 15; // must be greater than 5
00606   Double_t xp[np] = {0}, yp[np] = {0};
00607 
00608   Double_t scale = Geo::GetScale(fGeoGeometry->GetAppType());
00609   // 26 cm radius to circle square coil hole
00610   Double_t halfthick = 0.5*fThick;
00611   Double_t skinthick = 0;
00612   Double_t radhole = Geo::kNearModuleHoleRad*scale;
00613   Double_t delta = 0;
00614   Double_t dang = TMath::Pi()/(np-5);
00615   radhole /= cos(0.5*dang); // so that polygon circumscribes hole
00616   
00617   if ( isInner ) {
00618     halfthick -= fSkinThick;
00619     skinthick = fSkinThick;
00620     radhole += fSkinThick;
00621     delta = TMath::ASin(skinthick/radhole); // small angle approx
00622     dang = (TMath::Pi()-2.*delta)/(np-5);
00623   }
00624     
00625   xp[0] = fXY[0][0] + skinthick; yp[0] = fXY[0][1] + skinthick;
00626   xp[1] = fXY[1][0] + skinthick; yp[1] = fXY[1][1] - skinthick;
00627   xp[2] = fXY[2][0] - skinthick; yp[2] = fXY[2][1] - skinthick;
00628   xp[3] = fXY[3][0] - skinthick; yp[3] = fXY[3][1] + skinthick;
00629   if ( isInner && TMath::Abs(fXY[2][0] - fXY[3][0]) > 0.0001*scale) {
00630     Double_t m23 = (fXY[2][1]-fXY[3][1])/(fXY[2][0]-fXY[3][0]);
00631     Double_t b23 = fXY[2][1] - m23*fXY[2][0];
00632     Double_t arctanm = atan(TMath::Abs(m23));
00633     Double_t delta = fSkinThick/sin(arctanm);
00634     xp[2] = (yp[2] - b23)/m23 - delta;
00635     xp[3] = (yp[3] - b23)/m23 - delta;
00636   }
00637 
00638   Double_t holevtx = fXY[3][1];
00639   for ( int ip = 4; ip < np; ip++ ) {
00640     Double_t ang = dang*(ip-4)+delta;
00641     xp[ip] = radhole*cos(ang);    ;
00642     yp[ip] = holevtx + radhole*sin(ang);
00643   }
00644   
00645   TGeoXtru* mdlShape = new TGeoXtru(2);
00646   mdlShape -> SetName(shpName.c_str());
00647   
00648   mdlShape-> DefinePolygon(np,xp,yp);
00649   
00650   mdlShape -> DefineSection(0,-halfthick);
00651   mdlShape -> DefineSection(1,+halfthick);
00652   
00653   return mdlShape;
00654 
00655 } 

TGeoShape * GeoScintMdlVolume::BuildNearLmXtru ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 528 of file GeoScintMdlVolume.cxx.

References Build4Corners(), GeoVolume::fGeoGeometry, fSkinThick, fThick, fXY, GeoGeometry::GetAppType(), GeoVolume::GetScale(), Geo::kNearModuleHoleRad, and GeoVolume::UpdateGlobalManager().

Referenced by BuildNear().

00530                                                             {
00531  // Box with coil hole cut out from top (high tpos) side, with hole
00532  // centered on lpos = 0
00533 
00534   UpdateGlobalManager();
00535 
00536   Float_t m01 =0; // slope on lo lpos side
00537   Float_t m23 = 0; // slope on hi lpos side
00538   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00539 
00540   const int np = 15; // must be greater than 5
00541   Double_t xp[np] = {0}, yp[np] = {0};
00542 
00543   Double_t scale = Geo::GetScale(fGeoGeometry->GetAppType());
00544   // 26 cm radius to circle square coil hole
00545   Double_t halfthick = 0.5*fThick;
00546   Double_t skinthick = 0;
00547   Double_t radhole = Geo::kNearModuleHoleRad*scale;
00548   Double_t delta = 0;
00549   Double_t dang = TMath::Pi()/(np-5);
00550   radhole /= cos(0.5*dang); // so that polygon circumscribes hole
00551   
00552   if ( isInner ) {
00553     halfthick -= fSkinThick;
00554     skinthick = fSkinThick;
00555     radhole += fSkinThick;
00556     delta = TMath::ASin(skinthick/radhole); // small angle approx
00557     dang = (TMath::Pi()-2.*delta)/(np-5);
00558   }
00559     
00560   xp[0] = fXY[0][0] + skinthick; yp[0] = fXY[0][1] + skinthick;
00561   xp[1] = fXY[1][0] + skinthick; yp[1] = fXY[1][1] - skinthick;
00562   xp[np-2] = fXY[2][0] - skinthick; yp[np-2] = fXY[2][1] - skinthick;
00563   xp[np-1] = fXY[3][0] - skinthick; yp[np-1] = fXY[3][1] + skinthick;
00564   if ( isInner && TMath::Abs(fXY[2][0] - fXY[3][0]) > 0.0001*scale) {
00565     Double_t m23 = (fXY[2][1]-fXY[3][1])/(fXY[2][0]-fXY[3][0]);
00566     Double_t b23 = fXY[2][1] - m23*fXY[2][0];
00567     Double_t arctanm = atan(TMath::Abs(m23));
00568     Double_t delta = fSkinThick/sin(arctanm);
00569     xp[np-2] = (yp[np-2] - b23)/m23 - delta;
00570     xp[np-1] = (yp[np-1] - b23)/m23 - delta;
00571   }
00572 
00573   Double_t holevtx = fXY[2][1];
00574   for ( int ip = 2; ip < np-2; ip++ ) {
00575     Double_t ang = dang*(ip-2)+delta;
00576     xp[ip] = -radhole*cos(ang);    ;
00577     yp[ip] = holevtx - radhole*sin(ang);
00578   }
00579   
00580   TGeoXtru* mdlShape = new TGeoXtru(2);
00581   mdlShape -> SetName(shpName.c_str());
00582   
00583   mdlShape-> DefinePolygon(np,xp,yp);
00584   
00585   mdlShape -> DefineSection(0,-halfthick);
00586   mdlShape -> DefineSection(1,+halfthick);
00587   
00588   return mdlShape;
00589 
00590 } 

TGeoShape * GeoScintMdlVolume::BuildNearXtru ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 775 of file GeoScintMdlVolume.cxx.

References Build4Corners(), fSkinThick, fThick, fXY, and GeoVolume::UpdateGlobalManager().

Referenced by BuildNear().

00776                                                                             {
00777  // Box with coil hole cut out from bottom (lo tpos) side, with hole
00778  // centered on lpos = 0
00779 
00780   UpdateGlobalManager();
00781 
00782   Float_t m01 =0; // slope on lo lpos side
00783   Float_t m23 = 0; // slope on hi lpos side
00784   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00785 
00786   const int np = 4; 
00787   Double_t xp[np] = {0}, yp[np] = {0};
00788 
00789   Double_t halfthick = 0.5*fThick;
00790   Double_t skinthick = 0;
00791   
00792   if ( isInner ) {
00793     halfthick -= fSkinThick;
00794     skinthick = fSkinThick;
00795   }
00796     
00797   xp[0] = fXY[0][0] + skinthick; yp[0] = fXY[0][1] + skinthick;
00798   xp[1] = fXY[1][0] + skinthick; yp[1] = fXY[1][1] - skinthick;
00799   xp[2] = fXY[2][0] - skinthick; yp[2] = fXY[2][1] - skinthick;
00800   xp[3] = fXY[3][0] - skinthick; yp[3] = fXY[3][1] + skinthick;
00801 
00802   if ( isInner && m23 > 0.0001) {
00803     Double_t b23 = fXY[2][1] - m23*fXY[2][0];
00804     Double_t arctanm = atan(TMath::Abs(m23));
00805     Double_t delta = fSkinThick/sin(arctanm);
00806     xp[2] = (yp[2] - b23)/m23 - delta;
00807     xp[3] = (yp[3] - b23)/m23 - delta;
00808   }
00809 
00810   if ( isInner && m01 > 0.0001) {
00811     Double_t b01 = fXY[1][1] - m01*fXY[1][0];
00812     Double_t arctanm = atan(TMath::Abs(m01));
00813     Double_t delta = fSkinThick/sin(arctanm);
00814     xp[1] = (yp[1] - b01)/m01 + delta;
00815     xp[0] = (yp[0] - b01)/m01 + delta;
00816   }
00817   
00818   TGeoXtru* mdlShape = new TGeoXtru(2);
00819   mdlShape -> SetName(shpName.c_str());
00820   
00821   mdlShape-> DefinePolygon(np,xp,yp);
00822   
00823   mdlShape -> DefineSection(0,-halfthick);
00824   mdlShape -> DefineSection(1,+halfthick);
00825   
00826   return mdlShape;
00827 
00828 } 

TGeoShape * GeoScintMdlVolume::BuildSimpleTrap ( const UgliDbiTables ugliTables,
std::string  shpName,
bool  isInner = false 
) [private]

Definition at line 406 of file GeoScintMdlVolume.cxx.

References Build4Corners(), fSkinThick, fThick, fXY, and GeoVolume::UpdateGlobalManager().

Referenced by BuildFar().

00408                                                             {
00409  // Simple Trapezoid shape
00410 
00411   UpdateGlobalManager();
00412 
00413   Float_t m01 =0; // slope on lo lpos side
00414   Float_t m23 = 0; // slope on hi lpos side
00415   Build4Corners(ugliTables,m01,m23); // stores 4 corners of trap in fXY
00416 
00417   Double_t halfxloy = 0.5*(fXY[3][0] - fXY[0][0]);
00418   Double_t halfxhiy = 0.5*(fXY[2][0] - fXY[1][0]);
00419   Double_t halfy = 0.5*(fXY[1][1] - fXY[0][1]);
00420   Double_t halfz = 0.5*fThick;
00421 
00422   if ( isInner )  {
00423     // Interior shape
00424     Double_t b01 = fXY[1][1] - m01*fXY[1][0];
00425     Double_t arctanm = atan(TMath::Abs(m01));
00426     Double_t delta = fSkinThick/sin(arctanm);
00427     Double_t y0p = fXY[0][1] + fSkinThick;
00428     Double_t x0p = (y0p - b01)/m01 + delta;
00429     Double_t y1p = fXY[1][1] - fSkinThick;
00430     Double_t x1p = (y1p - b01)/m01 + delta;
00431     
00432     halfxloy = -x0p;
00433     halfxhiy = -x1p;
00434     halfy -= fSkinThick;
00435     halfz -= fSkinThick;
00436   }
00437 
00438   TGeoTrap* mdlShape = new TGeoTrap(shpName.c_str(), halfz, 0., 0.,
00439                                     halfy,halfxloy,halfxhiy,0.,halfy,
00440                           halfxloy,halfxhiy,0.);
00441   
00442   return mdlShape;
00443 
00444 } 

const TGeoNode* GeoScintMdlVolume::GetAirNode (  )  const [inline]

Definition at line 31 of file GeoScintMdlVolume.h.

Referenced by GetStripNode(), GetStripNodePtrVector(), and NumberOfStrips().

00031 { return GetNode(0); }

GeoStripNode * GeoScintMdlVolume::GetStripNode ( const PlexStripEndId seid  )  const

Definition at line 159 of file GeoScintMdlVolume.cxx.

References GetAirNode(), GeoStripNode::GetSEId(), StripEnd::kUnknown, StripEnd::kWhole, PlexStripEndId::SetEnd(), PlexStripEndId::SetSubPart(), and GeoVolume::UpdateGlobalManager().

Referenced by GeoScintMdlNode::GetStripNode().

00160                                                                              {
00161    // Retrieve strip node corresponding to this strip end id
00162 
00163   UpdateGlobalManager();
00164 
00165   // Strip sub-part and/or end info off seid for comparison
00166   PlexStripEndId seid_clean(seid);
00167   seid_clean.SetEnd(StripEnd::kUnknown);
00168   seid_clean.SetSubPart(StripEnd::kWhole);
00169 
00170   TGeoVolume* airVol = GetAirNode()->GetVolume();
00171   Int_t nstrip = airVol->GetNdaughters();
00172   for ( int istp = 0; istp < nstrip; istp++ ) {
00173     GeoStripNode* stpnode = dynamic_cast<GeoStripNode*>(airVol->GetNode(istp));
00174     if ( seid_clean == stpnode->GetSEId() ) {
00175       return stpnode;
00176     }
00177   }
00178 
00179   return 0;
00180   
00181 }

std::vector< GeoStripNode * > GeoScintMdlVolume::GetStripNodePtrVector (  )  const

Definition at line 184 of file GeoScintMdlVolume.cxx.

References GetAirNode(), and GeoVolume::UpdateGlobalManager().

00184                                                                         {
00185    // Retrieve vector of strip nodes in this module
00186 
00187   UpdateGlobalManager();
00188 
00189   std::vector<GeoStripNode*> stpnodes;
00190   TGeoVolume* airVol = GetAirNode()->GetVolume();
00191   Int_t nstrip = airVol->GetNdaughters();
00192   for ( int istp = 0; istp < nstrip; istp++ ) {
00193     GeoStripNode* stpnode = dynamic_cast<GeoStripNode*>(airVol->GetNode(istp));
00194     stpnodes.push_back(stpnode);
00195   }
00196 
00197   return stpnodes;
00198   
00199 }

Int_t GeoScintMdlVolume::NumberOfStrips (  )  const [virtual]

Definition at line 1043 of file GeoScintMdlVolume.cxx.

References GetAirNode(), and GeoVolume::UpdateGlobalManager().

01043                                               {
01044  // Return number of strips in volume
01045   
01046   UpdateGlobalManager();
01047 
01048   return (this -> GetAirNode() -> GetVolume() -> GetNdaughters());
01049   
01050 }

void GeoScintMdlVolume::Print ( Option_t *  option = ""  )  const [virtual]

Definition at line 148 of file GeoScintMdlVolume.cxx.

References Nav::GetName(), and GeoVolume::UpdateGlobalManager().

00148                                                           {
00149    // print to cout
00150 
00151   UpdateGlobalManager();
00152 
00153   cout << "GeoScintMdlVolume::Print\n"
00154        << GetName() << endl;
00155   
00156 }


Friends And Related Function Documentation

friend class GeoGeometry [friend]

Definition at line 23 of file GeoScintMdlVolume.h.


Member Data Documentation

TGeoShape* GeoScintMdlVolume::fBaseShp [private]

Definition at line 80 of file GeoScintMdlVolume.h.

Referenced by BuildModuleShape(), and GeoScintMdlVolume().

TGeoShape* GeoScintMdlVolume::fBaseShpAir [private]

ptr to base module shape, not owned

Definition at line 81 of file GeoScintMdlVolume.h.

Referenced by BuildModuleShape(), and GeoScintMdlVolume().

Float_t GeoScintMdlVolume::fSkinThick [private]
Float_t GeoScintMdlVolume::fThick [private]
Float_t GeoScintMdlVolume::fXY[4][2] [private]

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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1