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

GeoScintMdlNode.cxx

Go to the documentation of this file.
00001 
00002 // $Id: GeoScintMdlNode.cxx,v 1.7 2007/12/11 06:04:16 rhatcher Exp $
00003 //
00004 // GeoScintMdlNode
00005 //
00006 // GeoScintMdlNode is a module node
00007 //
00008 // Author:  S. Kasahara 03/05
00010 
00011 #include "MessageService/MsgService.h"
00012 #include "GeoGeometry/GeoGeometry.h"
00013 #include "GeoGeometry/GeoScintMdlNode.h"
00014 #include "GeoGeometry/GeoScintPlnNode.h"
00015 #include "Plex/PlexStripEndId.h"
00016 #include <TMath.h>
00017 #include <TGeoMatrix.h>
00018 
00019 ClassImp(GeoScintMdlNode)
00020 CVSID("$Id: GeoScintMdlNode.cxx,v 1.7 2007/12/11 06:04:16 rhatcher Exp $");
00021 
00022 //_____________________________________________________________________________
00023 GeoScintMdlNode::GeoScintMdlNode(GeoGeometry* geom, TGeoVolume* mdlvol,
00024                           TGeoMatrix* mdlmatrix, GeoScintPlnNode* plnNode,
00025                           std::string nodename, const PlexScintMdlId& mdlId,
00026                           Float_t clearleneast, Float_t clearlenwest,
00027                           Float_t wlsleneast, Float_t wlslenwest) 
00028   : GeoNode(geom,mdlvol,mdlmatrix,plnNode->GetVolume(),
00029             plnNode->GetGlobalPath()+"/"+nodename,nodename),
00030     fScintMdlId(mdlId),fScintPlnNode(plnNode),fClearLenEast(clearleneast),
00031     fClearLenWest(clearlenwest),fWlsLenEast(wlsleneast),
00032     fWlsLenWest(wlslenwest) {
00033     // Normal  constructor
00034     // Protected
00035     
00036   UpdateGlobalManager();
00037   
00038 }
00039   
00040 //_____________________________________________________________________________
00041 GeoScintMdlNode::~GeoScintMdlNode() {
00042   // Destructor should delete any owned objects
00043 
00044   UpdateGlobalManager();
00045   
00046   if ( CountRef() ) {
00047     MSG("Geo",Msg::kWarning)
00048       << "GeoScintMdlNode destructor " 
00049       << " still had " << CountRef()
00050       << " outstanding references " << endl;
00051   }
00052 
00053 }
00054 
00055 //_____________________________________________________________________________
00056 Float_t GeoScintMdlNode::GetClearFiber(StripEnd::StripEnd_t stripend) const {
00057   // Return clear fiber length for specified module end
00058 
00059    Float_t clearfiber = 0;
00060    if      (stripend == StripEnd::kEast) clearfiber = fClearLenEast;
00061    else if (stripend == StripEnd::kWest) clearfiber = fClearLenWest;
00062 
00063    MSG("Geo",Msg::kDebug) << "GetClearFiber " << fScintMdlId.AsString()
00064                           << " end " << StripEnd::AsString(stripend)
00065                           << " clearfiber " << clearfiber << endl;
00066 
00067    return clearfiber;
00068 }
00069 
00070 //_____________________________________________________________________________
00071 Float_t GeoScintMdlNode::GetExtraWlsFiber(StripEnd::StripEnd_t stripend)
00072                                                                    const {
00073   // Return extra wls fiber length (beyond strip specific wls fiber length)
00074   // for specified module end
00075 
00076   Float_t extrawlsfiber = 0;
00077   if       (stripend == StripEnd::kEast) extrawlsfiber = fWlsLenEast;
00078   else if  (stripend == StripEnd::kWest) extrawlsfiber = fWlsLenWest;
00079   
00080   MSG("Geo",Msg::kDebug) << "GetExtraWlsFiber " << fScintMdlId.AsString()
00081                          << " end " << StripEnd::AsString(stripend)
00082                          << " extrawlsfiber " << extrawlsfiber << endl;
00083 
00084   return extrawlsfiber;
00085   
00086 }
00087 
00088 //_____________________________________________________________________________
00089 Float_t GeoScintMdlNode::GetLPosRelPln() const {
00090   // Return the lpos relative to plane (x-coord from translation matrix)
00091 
00092   UpdateGlobalManager();
00093 
00094   const Double_t* trans = GetMatrix() -> GetTranslation();
00095   
00096   MSG("Geo",Msg::kDebug) << "GetLPosRelPln " << fScintMdlId.AsString()
00097                          << " lposrelpln " << trans[0] << endl;
00098   return trans[0]; 
00099   
00100 }
00101 
00102 //_____________________________________________________________________________
00103 Float_t GeoScintMdlNode::GetTPosRelPln() const {
00104   // Return the tpos relative to plane (y-coord from translation matrix)
00105 
00106   UpdateGlobalManager();
00107 
00108   const Double_t* trans = GetMatrix() -> GetTranslation();
00109 
00110   MSG("Geo",Msg::kDebug) << "GetTPosRelPln " << fScintMdlId.AsString()
00111                          << " tposrelpln " << trans[1] << endl;
00112 
00113   return trans[1];
00114   
00115 }
00116 
00117 
00118 //_____________________________________________________________________________
00119 Float_t GeoScintMdlNode::GetZRotRelPlnRad() const {
00120   // Return the zrot relative to plane in radians
00121 
00122   UpdateGlobalManager();
00123 
00124   const Double_t* rotmatrix = GetMatrix() -> GetRotationMatrix();
00125   Float_t zrotrelplnrad = TMath::ATan2(rotmatrix[3],rotmatrix[0]);
00126 
00127   MSG("Geo",Msg::kDebug) << "GetZRotRelPlnRad " << fScintMdlId.AsString()
00128                          << " zrotrelplnrad " << zrotrelplnrad << endl;
00129 
00130   return zrotrelplnrad;
00131    
00132 }
00133 
00134 //_____________________________________________________________________________
00135 GeoStripNode* GeoScintMdlNode::GetStripNode(const PlexStripEndId& seid) const {
00136   // Returns strip corresponding to the specified seid
00137 
00138   UpdateGlobalManager();
00139 
00140   GeoStripNode* stripnode = GetScintMdlVolume()->GetStripNode(seid);
00141 
00142   MSG("Geo",Msg::kDebug) << "Module node " << fScintMdlId.AsString() 
00143                          << " GetStripNode "  << seid.AsString() 
00144                          << " node ptr " << stripnode << endl;
00145  
00146   return stripnode;
00147    
00148 }
00149 
00150 //_____________________________________________________________________________
00151 std::vector<GeoStripNode*> GeoScintMdlNode::GetStripNodePtrVector() const {
00152   // Returns strip corresponding to the specified seid
00153 
00154   UpdateGlobalManager();
00155 
00156   return (GetScintMdlVolume()->GetStripNodePtrVector());
00157    
00158 }
00159 
00160 //_____________________________________________________________________________
00161 void GeoScintMdlNode::SetZRotRelPlnRad(Float_t /*radians*/) {
00162   // Dummy
00163 
00164   UpdateGlobalManager();
00165 
00166   MSG("Geo",Msg::kWarning)
00167     << "GeoScintMdlNode::SetZRotRelPlnRad not implemented yet." << endl;
00168   return;
00169 
00170 }
00171 
00172 //_____________________________________________________________________________
00173 void GeoScintMdlNode::SetLTPosRelPln(Float_t /*lpos*/, Float_t /*tpos*/) {
00174   // Dummy
00175 
00176   UpdateGlobalManager();
00177 
00178   MSG("Geo",Msg::kWarning)
00179     << "GeoScintMdlNode::SetLTPosRelPln not implemented yet." << endl;
00180   return;
00181 
00182 }
00183 
00184 
00185 
00186 
00187 
00188 
00189 

Generated on Mon Feb 15 11:06:45 2010 for loon by  doxygen 1.3.9.1