ATLAS Offline Software
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 //____________________________________________________________________
21  : PRDHandleBase(static_cast<PRDCollHandleBase*>(collhandle)), m_cluster(clus)
22 {
24 }
25 
26 //____________________________________________________________________
27 void 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,
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,
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,
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 }
HitsSoNodeManager.h
PRDCollHandle_SCT
Definition: PRDCollHandle_SCT.h:11
PRDHandle_SCT::PRDHandle_SCT
PRDHandle_SCT(PRDCollHandle_SCT *, const InDet::SCT_Cluster *)
Definition: PRDHandle_SCT.cxx:20
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
SoTransparency
Definition: SoTransparency.h:20
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDetDD::SolidStateDetectorElementBase::center
virtual const Amg::Vector3D & center() const override final
Center in global coordinates.
PRDHandleBase::collHandle
PRDCollHandleBase * collHandle() const
Definition: PRDHandleBase.cxx:228
PRDHandle_SCT::buildShapes
void buildShapes(SoNode *&shape_simple, SoNode *&shape_detailed)
Definition: PRDHandle_SCT.cxx:27
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
SoTransparency.h
PRDHandleBase::common
PRDSysCommonData * common() const
Definition: PRDHandleBase.h:53
InDetDD::SolidStateDetectorElementBase::etaPitch
double etaPitch() const
Pitch (inline methods)
SoTransparency::transparency
SoSFFloat transparency
Definition: SoTransparency.h:27
PRDSysCommonData::nodeManager
HitsSoNodeManager * nodeManager() const
Definition: PRDSysCommonData.h:79
GeoPrimitives.h
PRDCollHandleBase
Definition: PRDCollHandleBase.h:25
InDetDD::SiDetectorElement::phiPitch
double phiPitch() const
Pitch (inline methods)
SoTransparency::initClass
static void initClass()
Definition: SoTransparency.cxx:29
InDetDD::SolidStateDetectorElementBase::thickness
double thickness() const
HitsSoNodeManager::getShapeNode_Strip
SoNode * getShapeNode_Strip(double length, double width=0, double depth=0)
Definition: HitsSoNodeManager.cxx:269
PRDHandle_SCT::regionIndex
int regionIndex()
Definition: PRDHandle_SCT.cxx:96
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
InDet::SiCluster::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
PRDHandle_SCT.h
PRDHandle_SCT::m_cluster
const InDet::SCT_Cluster * m_cluster
Definition: PRDHandle_SCT.h:28
SiDetectorElement.h
InDetDD::SolidStateDetectorElementBase::rawLocalPositionOfCell
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Definition: SolidStateDetectorElementBase.cxx:230
PRDHandleBase
Definition: PRDHandleBase.h:35
PRDCollHandle_SCT.h
Identifier
Definition: IdentifierFieldParser.cxx:14