Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:38

0001 /****************************************************************************
0002 *
0003 * This is a part of TOTEM offline software.
0004 * Author:
0005 *   Laurent Forthomme
0006 *
0007 ****************************************************************************/
0008 
0009 #include "Geometry/ForwardGeometry/interface/TotemT2Tile.h"
0010 #include "DataFormats/Math/interface/AlgebraicROOTObjects.h"
0011 #include <TGeoManager.h>
0012 
0013 TotemT2Tile::TotemT2Tile() {}
0014 
0015 TotemT2Tile::TotemT2Tile(const DetGeomDesc* dgd) {
0016   centre_ = GlobalPoint{(float)dgd->translation().x(),
0017                         (float)dgd->translation().y(),
0018                         (float)dgd->parentZPosition()};  // retrieve the plane position for z coordinate
0019   double angle = 0.;
0020   {  // get azimutal component of tile rotation
0021     AlgebraicMatrix33 mat;
0022     dgd->rotation().GetRotationMatrix(mat);
0023     angle = acos(mat[0][0]);
0024   }
0025   TGeoCombiTrans place(centre_.x(), centre_.y(), centre_.z(), new TGeoRotation("tile_rot", angle, 0., 0.));
0026   TGeoManager mgr;
0027   auto* box = mgr.MakeBox("top", nullptr, 0., 0., 0.);
0028   mgr.SetTopVolume(box);
0029   auto* vol = mgr.MakeTrd1("tile", nullptr, dgd->params()[4], dgd->params()[8], dgd->params()[3], dgd->params()[0]);
0030   box->AddNode(vol, 1, &place);
0031 }
0032 
0033 TotemT2Tile::~TotemT2Tile() {}