CMS 3D CMS Logo

TotemT2Tile.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of TOTEM offline software.
4 * Author:
5 * Laurent Forthomme
6 *
7 ****************************************************************************/
8 
11 #include <TGeoManager.h>
12 
14 
16  centre_ = GlobalPoint{(float)dgd->translation().x(),
17  (float)dgd->translation().y(),
18  (float)dgd->parentZPosition()}; // retrieve the plane position for z coordinate
19  double angle = 0.;
20  { // get azimutal component of tile rotation
22  dgd->rotation().GetRotationMatrix(mat);
23  angle = acos(mat[0][0]);
24  }
25  TGeoCombiTrans place(centre_.x(), centre_.y(), centre_.z(), new TGeoRotation("tile_rot", angle, 0., 0.));
26  TGeoManager mgr;
27  auto* box = mgr.MakeBox("top", nullptr, 0., 0., 0.);
28  mgr.SetTopVolume(box);
29  auto* vol = mgr.MakeTrd1("tile", nullptr, dgd->params()[4], dgd->params()[8], dgd->params()[3], dgd->params()[0]);
30  box->AddNode(vol, 1, &place);
31 }
32 
const Translation & translation() const
Definition: DetGeomDesc.h:80
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
float parentZPosition() const
Definition: DetGeomDesc.h:106
GlobalPoint centre_
Definition: TotemT2Tile.h:24
const RotationMatrix & rotation() const
Definition: DetGeomDesc.h:81
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
const std::vector< double > & params() const
Definition: DetGeomDesc.h:88