00001
00002
00003
00004
00005
00006
00007
00008
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
00034
00035
00036 UpdateGlobalManager();
00037
00038 }
00039
00040
00041 GeoScintMdlNode::~GeoScintMdlNode() {
00042
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
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
00074
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
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
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
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
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
00153
00154 UpdateGlobalManager();
00155
00156 return (GetScintMdlVolume()->GetStripNodePtrVector());
00157
00158 }
00159
00160
00161 void GeoScintMdlNode::SetZRotRelPlnRad(Float_t ) {
00162
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 , Float_t ) {
00174
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