ATLAS Offline Software
Loading...
Searching...
No Matches
PRDHandle_SCT.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#include <Inventor/nodes/SoSeparator.h>
11#include <Inventor/nodes/SoTranslation.h>
12#include <Inventor/nodes/SoMaterial.h>
13
15
17
18
19//____________________________________________________________________
25
26//____________________________________________________________________
27void PRDHandle_SCT::buildShapes(SoNode*&shape_simple, SoNode*&shape_detailed)
28{
29 double striplength = m_cluster->detectorElement()->etaPitch();
30
31 //SoSeparator * errSimple = new SoSeparator;
32 SoSeparator * errDetailed = new SoSeparator;
33
34 //errSimple->addChild(common()->nodeManager()->getShapeNode_Strip(striplength));
35 shape_simple=common()->nodeManager()->getShapeNode_Strip(striplength);
36
37 const Amg::Vector2D& localpos = m_cluster->localPosition();
38 const Amg::Vector2D& localposHIT = m_cluster->detectorElement()->rawLocalPositionOfCell( m_cluster->identify() ); // Lorentz shift is not corrected because this class cannot use SiLorentzAngleTool
39 SoTranslation * localtrans0 = new SoTranslation;
40 localtrans0->translation.setValue(localposHIT[Trk::locX]-localpos[Trk::locX],localposHIT[Trk::locY]-localpos[Trk::locY],0);
41
42 const std::vector<Identifier> rdolist = m_cluster->rdoList();
43 if (rdolist.size() == 1 || !collHandle()->drawRDOs())
44 {
45 errDetailed->addChild(localtrans0);
46 errDetailed->addChild(common()->nodeManager()->getShapeNode_Strip(striplength,
47 m_cluster->detectorElement()->phiPitch( m_cluster->localPosition() ),//strip width
48 m_cluster->detectorElement()->thickness()*3.0));
49 //strip thickness - scaled up by factor of 3 (looks better)
50 //Fixme: Should we drop this upscaling of thickness?
51
52 //Translate back so errDetailed is left sane (eg. when drawing errors later)
53 SoTranslation * localtransBack = new SoTranslation;
54 localtransBack->translation.setValue(-(localtrans0->translation.getValue()));
55 errDetailed->addChild(localtransBack);
56 } else
57 {
58 SoSeparator * rdos = new SoSeparator;
59 rdos->addChild(localtrans0);
60
61 rdos->addChild(common()->nodeManager()->getShapeNode_Strip(striplength,
62 m_cluster->detectorElement()->phiPitch( m_cluster->localPosition() ),//strip width
63 m_cluster->detectorElement()->thickness()*3.0));
64 //strip thickness - scaled up by factor of 3 (looks better)
65 //Fixme: Should we drop this upscaling of thickness?
66
67 SoTransparency * transparent = new SoTransparency;
68 transparent->transparency.setValue(0.5);
69 rdos->addChild( transparent );
70 Amg::Vector2D localposOLD = localposHIT;
71 for (const Identifier& rdo_id : rdolist)
72 {
73 if (rdo_id == m_cluster->identify() )
74 continue;
75
76 const Amg::Vector2D& localposRDO = m_cluster->detectorElement()->rawLocalPositionOfCell(rdo_id); // Lorentz shift is not corrected because this class cannot use SiLorentzAngleTool
77
78 SoTranslation * localtrans = new SoTranslation;
79 localtrans->translation.setValue(localposRDO[Trk::locX]-localposOLD[Trk::locX],localposRDO[Trk::locY]-localposOLD[Trk::locY],0);
80 rdos->addChild(localtrans);
81
82 rdos->addChild(common()->nodeManager()->getShapeNode_Strip(striplength,
83 m_cluster->detectorElement()->phiPitch( m_cluster->localPosition() ),//strip width
84 m_cluster->detectorElement()->thickness()*3.0));
85
86 localposOLD = localposRDO;
87 }
88 errDetailed->addChild(rdos);
89 }
90
91// shape_simple = errSimple;
92 shape_detailed = errDetailed;
93}
94
95//____________________________________________________________________
97{
98 //instead of identifier juggling, we simply discretize by center coordinate.
99 static const double l=100.0;//CLHEP::mm
100 return static_cast<int>(m_cluster->detectorElement()->center().z()/l)
101 +1000*static_cast<int>(m_cluster->detectorElement()->center().y()/l)
102 +1000000*static_cast<int>(m_cluster->detectorElement()->center().x()/l);
103 //Fixme: Use identifiers instead for more intuitive regions.
104}
#define y
#define x
#define z
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
PRDHandleBase(PRDCollHandleBase *)
PRDSysCommonData * common() const
PRDCollHandleBase * collHandle() const
virtual Amg::Vector3D center() const
const InDet::SCT_Cluster * m_cluster
PRDHandle_SCT(PRDCollHandle_SCT *, const InDet::SCT_Cluster *)
void buildShapes(SoNode *&shape_simple, SoNode *&shape_detailed)
HitsSoNodeManager * nodeManager() const
static void initClass()
SoSFFloat transparency
Eigen::Matrix< double, 2, 1 > Vector2D
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37