70 return StatusCode::FAILURE;
83 return StatusCode::SUCCESS;
101 return StatusCode::SUCCESS;
108 out.open(filename.c_str());
111 out <<
"tg = new TCanvas(\"tg\",\"Geometry Shapes\",200,10,700,500);" <<
'\n';
112 out <<
" world = new TBRIK(\"BRIK\",\"BRIK\",\"void\",2,2,2);" <<
'\n';
113 out <<
" worldnode = new TNode(\"NODE1\",\"NODE1\",\"BRIK\");" <<
'\n';
114 out <<
" worldnode->cd();" <<
'\n';
120 out <<
"worldnode->cd();" <<
'\n';
121 out <<
"worldnode->Draw(\"ogl\");" <<
'\n';
122 out <<
"tg->Update();" <<
'\n';
149 const std::string& volumeName = tvol.
volumeName();
151 m_fileVolumeOutput <<
"// Processing TrackingVolume '" << volumeName <<
"'. " <<
'\n';
153 m_fileVolumeOutput << int(rMin)+1 <<
"," << int(rMax)-1 <<
"," << int(halfZ)-1 <<
");" <<
'\n';
155 double zPos = tvol.
center().z();
157 m_fileVolumeOutput << volumeName <<
"\"," << 0 <<
"," << 0 <<
"," << int(zPos) <<
");" <<
'\n';
162 return StatusCode::SUCCESS;
172 int layerIndexStr = (layerIndex < 0) ? (-layerIndex)+1 : layerIndex;
175 double layerPositionZ = layerPosition.z();
178 std::stringstream
ss;
191 for (
const auto & laySurfIter : layerSurfaces) {
192 if ( laySurfIter &&
processNode(*laySurfIter).isFailure()){
193 ATH_MSG_FATAL(
"Failed to call processNode(const Surface& sf) on sub surface. Abort.");
194 return StatusCode::FAILURE;
211 return StatusCode::FAILURE;
215 double radius = cylBo->
r();
217 m_fileLayerOutput <<
"Cylinder" << layerIndexStr <<
" = new TTUBE(\"CylinderLayer";
218 m_fileLayerOutput << layerIndexStr <<
"\",\"CylinderLayer" << layerIndex <<
"\",\"void\",";
219 m_fileLayerOutput << int(radius-5) <<
"," << int(radius+5) <<
"," << int(halfZ) <<
");" <<
'\n';
221 m_fileLayerOutput <<
"Cylinder" << layerIndexStr <<
"->SetLineColor(" << layerColor <<
");" <<
'\n';
223 m_fileLayerOutput <<
"Node" << layerIndexStr <<
" = new TNode(\"CylinderNode" << layerIndex;
224 m_fileLayerOutput <<
"\",\"CylinderNode" << layerIndexStr <<
"\",\"CylinderLayer";
225 m_fileLayerOutput << layerIndexStr <<
"\"," << 0 <<
"," << 0 <<
"," << int(layerPositionZ) <<
");" <<
'\n';
228 return StatusCode::SUCCESS;
235 return StatusCode::FAILURE;
240 double rMin = discBo->
rMin();
241 double rMax = discBo->
rMax();
243 m_fileLayerOutput <<
"Disc" << layerIndexStr <<
" = new TTUBE(\"DiscLayer" << layerIndexStr <<
"\",\"DiscLayer" << layerIndex <<
"\",\"void\",";
246 m_fileLayerOutput <<
"Disc" << layerIndexStr <<
"->SetLineColor(" << layerColor <<
");" <<
'\n';
248 m_fileLayerOutput <<
"DiscNode" << layerIndexStr <<
" = new TNode(\"DiscNode" << layerIndex;
250 m_fileLayerOutput << layerIndexStr <<
"\"," << 0 <<
"," << 0 <<
"," << int(layerPositionZ) <<
");" <<
'\n';
252 return StatusCode::SUCCESS;
255 return StatusCode::SUCCESS;
267 m_fileSurfaceOutput <<
"// ---------------------- Surface -------------------------------// " << std::endl;
270 double surfX = sf.center().x();
271 double surfY = sf.center().y();
272 double surfZ = sf.center().z();
277 const double convFac = 180./
M_PI;
278 double xPhi = sfRot.col(0).phi()*convFac;
279 double xTheta = sfRot.col(0).theta()*convFac;
280 double yPhi = sfRot.col(1).phi()*convFac;
281 double yTheta = sfRot.col(1).theta()*convFac;
282 double zPhi = sfRot.col(2).phi()*convFac;
283 double zTheta = sfRot.col(2).theta()*convFac;
286 TString surfaceString =
"Surface_";
288 TString rotationString =
"Rotation_";
290 TString nodeString =
"Node";
301 m_fileSurfaceOutput << surfaceString <<
" = new TBRIK(\""<< surfaceString <<
"\",\"" << surfaceString<<
"\",\"void\",";
307 m_fileSurfaceOutput << rotationString <<
"= new TRotMatrix(\" "<< rotationString <<
" \",\" " << rotationString <<
" \", ";
308 m_fileSurfaceOutput << xTheta <<
"," << xPhi <<
"," << yTheta <<
"," << yPhi <<
", " << zTheta <<
"," << zPhi <<
");" << std::endl;
314 m_fileSurfaceOutput << surfaceString <<
" = new TTRD1(\""<< surfaceString <<
"\",\"" << surfaceString<<
"\",\"void\",";
320 m_fileSurfaceOutput << rotationString <<
"= new TRotMatrix(\" "<< rotationString <<
" \",\" " << rotationString <<
" \", ";
321 m_fileSurfaceOutput << xTheta <<
"," << xPhi <<
", " << zTheta <<
"," << zPhi <<
"," << yTheta <<
"," << yPhi <<
");" << std::endl;
322 }
else if (disctraBo) {
329 double stereo = disctraBo->
stereo();
330 double rMedium = disctraBo->
rCenter();
331 double avePhi = disctraBo->
averagePhi()+stereo;
333 surfX = rMedium*cos(avePhi);
334 surfY = rMedium*sin(avePhi);
335 surfZ = (sf.center()).z();
343 xPhi = rotation.col(0).phi()*convFac;
344 xTheta = rotation.col(0).theta()*convFac;
345 yPhi = rotation.col(1).phi()*convFac;
346 yTheta = rotation.col(1).theta()*convFac;
347 zPhi = rotation.col(2).phi()*convFac;
348 zTheta = rotation.col(2).theta()*convFac;
353 m_fileSurfaceOutput << surfaceString <<
" = new TTRD1(\""<< surfaceString <<
"\",\"" << surfaceString<<
"\",\"void\",";
359 m_fileSurfaceOutput << rotationString <<
"= new TRotMatrix(\" "<< rotationString <<
" \",\" " << rotationString <<
" \", ";
360 m_fileSurfaceOutput << xTheta <<
"," << xPhi <<
", " << zTheta <<
"," << zPhi <<
"," << yTheta <<
"," << yPhi <<
");" << std::endl;
364 m_fileSurfaceOutput << nodeString <<
" = new TNode(\"" << nodeString <<
"\",\"" << nodeString <<
"\"," << surfaceString;
365 m_fileSurfaceOutput <<
"," << surfX <<
", " << surfY <<
"," << surfZ <<
", " << rotationString <<
");" << std::endl;
367 return StatusCode::SUCCESS;
379 output <<
"// MaterialProperties : t/X0 = " << tInX0 << std::endl;
380 output <<
"// zOverAtimesRho : Z/A*rho = " << prop->
zOverAtimesRho() << std::endl;
383 color -= int(tInX0 * 1200);
#define ATH_MSG_VERBOSE(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual std::span< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
Bounds for a cylindrical Surface.
virtual double r() const override final
This method returns the radius.
double halflengthZ() const
This method returns the halflengthZ.
Bounds for a cylindrical Volume, the decomposeToSurfaces method creates a vector of up to 6 surfaces:
double innerRadius() const
This method returns the inner radius.
double halflengthZ() const
This method returns the halflengthZ.
double outerRadius() const
This method returns the outer radius.
Class to describe the bounds for a planar DiscSurface.
double rMax() const
This method returns outer radius.
double rMin() const
This method returns inner radius.
Class to describe the bounds for a planar DiscSurface.
double halflengthY() const
This method returns the halflength in Y (this is Rmax -Rmin)
double averagePhi() const
This method returns the average phi.
double maxHalflengthX() const
This method returns the maximal halflength in X.
double minHalflengthX() const
This method returns the minimal halflength in X.
double stereo() const
This method returns the stereo angle.
double rCenter() const
This method returns the center radius.
int value() const
layerIndex expressed in an integer
Base Class for a Detector Layer in the Tracking realm.
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
const SurfaceArray * surfaceArray() const
Return the entire SurfaceArray, returns nullptr if no SurfaceArray.
const LayerIndex & layerIndex() const
get the layerIndex
const TrackingVolume * enclosingTrackingVolume() const
get the confining TrackingVolume
Material with information about thickness of material.
float thicknessInX0() const
Return the radiationlength fraction.
float zOverAtimesRho() const
Return the .
Bounds for a rectangular, planar surface.
double halflengthX() const
for consistant naming
double halflengthY() const
for consitant naming
RecursiveGeometryProcessor(const std::string &, const std::string &, const IInterface *)
Constructor.
StatusCode initialize()
AlgTool initialize method.
Abstract Base Class for tracking surfaces.
virtual constexpr SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
StatusCode processNode(const TrackingVolume &tvol, size_t level=0) const
Current implementation: write root visualization to file stream.
std::ofstream m_fileVolumeOutput
file output for visualization action
static int s_displaySurfaces
static surface counter
static void openFile(std::ofstream &output, const std::string &filename)
File handling: open + write header.
std::ofstream m_fileSurfaceOutput
file output for visualization action
virtual ~TrackingVolumeDisplayer()
Destructor.
StatusCode finalize()
AlgTool finalize method.
std::ofstream m_fileLayerOutput
file output for visualization action
TrackingVolumeDisplayer(const std::string &, const std::string &, const IInterface *)
Constructor.
bool m_fileSurfaceOutputSplit
use one file for each layer
static int colorCodeFromMaterial(const Trk::MaterialProperties *prop, std::ofstream &output)
calculate the color code from the Material
bool m_fileLayerOutputMode
steer writing
std::string m_fileSurfaceOutputName
file name for visualization action
bool m_fileVolumeOutputMode
steer writing
std::string m_fileLayerOutputName
file name for visualization action
int m_volumeCounter
volume counter
static void closeFile(std::ofstream &output)
File handling: write footer + close.
StatusCode initialize()
AlgTool initialize method.
std::string m_fileVolumeOutputName
file name for visualization action
bool m_fileSurfaceOutputMode
steer writing
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
unsigned int colorCode() const
Get the color code.
Bounds for a trapezoidal, planar Surface.
double halflengthY() const
This method returns the halflength in Y (second coordinate of local surface frame)
double minHalflengthX() const
This method returns the minimal halflength in X (first coordinate of local surface frame)
double maxHalflengthX() const
This method returns the maximal halflength in X (first coordinate of local surface frame)
const Amg::Vector3D & center() const
returns the center of the volume
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Eigen::AngleAxisd AngleAxis3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
BinnedArray< Surface > SurfaceArray