ATLAS Offline Software
VP1RawDataHandle_SCT_RDO.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // Implementation of class VP1RawDataHandle_SCT_RDO //
8 // //
9 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
10 // Initial version: April 2008 (rewritten January 2009) //
11 // //
13 
17 #include "VP1Utils/VP1DetInfo.h"
19 
20 #include <Inventor/nodes/SoLineSet.h>
21 #include <Inventor/nodes/SoVertexProperty.h>
22 
25 
26 //#include "InDetReadoutGeometry/SCT_ReadoutGeometry/SCT_ModuleSideDesign.h" // old CMT
27 #include "SCT_ReadoutGeometry/SCT_ModuleSideDesign.h" // new CMake
28 
30 #include "InDetIdentifier/SCT_ID.h"
31 
33 
34 
35 //____________________________________________________________________
38 {
39 }
40 
41 //____________________________________________________________________
43 {
44 }
45 
46 //____________________________________________________________________
48 {
49  static const SCT_ID * idhelper = VP1DetInfo::sctIDHelper();
50  QStringList l;
51  l << " ===> SCT_RDORawData";
52  l << " Data word: "+unsignedToHex(m_data->getWord());
53  if (verbose) {
54  if (idhelper) {
56  bool barrel(false);
57  if (idhelper->barrel_ec(id)==-2) l << " Part: End Cap C";
58  else if (idhelper->barrel_ec(id)==2) l << " Part: End Cap A";
59  else { l << " Part: Barrel"; barrel = true; }
60  l << " "+QString(barrel?"Layer":"Disk")+": "+QString::number(idhelper->layer_disk(id));
61  l << " Phi module: "+QString::number(idhelper->phi_module(id));
62  l << " Eta module: "+QString::number(idhelper->eta_module(id));
63  l << " Side: "+QString(idhelper->side(id)==0 ? "Inner":"Outer");
64  l << " Group Size: "+QString::number(m_data->getGroupSize());
65  if (m_data->getGroupSize()>1)
66  l << " Strips: "+QString::number(idhelper->strip(id))+".."+QString::number(idhelper->strip(id)+m_data->getGroupSize()-1);
67  else
68  l << " Strip: "+QString::number(idhelper->strip(id));
69  }
70  //Fixme: Try dynamic cast to SCT3_RawData, and print more information if it succeeds.
71  }
72  return l;
73 }
74 
75 //____________________________________________________________________
77 {
78  static const SCT_ID * idhelper = VP1DetInfo::sctIDHelper();
79  const InDetDD::SiDetectorElement * elem = element();
80  const int ngroup = m_data->getGroupSize();
81  if (!elem||ngroup<1)
82  return common()->nodeManager()->getShapeNode_Point();//fixme: warn
83 
84  const InDetDD::SCT_ModuleSideDesign& design = dynamic_cast<const InDetDD::SCT_ModuleSideDesign&>(elem->design());
85 
86  SoLineSet * line = new SoLineSet;
87  SoVertexProperty * vertices = new SoVertexProperty;
88  line->vertexProperty = vertices;
89 
90  Amg::Transform3D invTransform(elem->transform().inverse());
91  const int ifirststrip(idhelper ? idhelper->strip(m_data->identify()) : 0);
92  int iver(0);
93  std::pair<InDetDD::SiLocalPosition,InDetDD::SiLocalPosition> localEnds;
94  for (int i=0;i<ngroup;++i) {
95  std::pair< Amg::Vector3D, Amg::Vector3D > globalEnds = elem->endsOfStrip(design.positionFromStrip(ifirststrip+i));
96  Amg::Vector3D localA(invTransform*globalEnds.first);
97  Amg::Vector3D localB(invTransform*globalEnds.second);
98  localEnds = design.endsOfStrip(design.positionFromStrip(ifirststrip+i));
99  vertices->vertex.set1Value(iver++,localA.x(),localA.y(),0);
100  vertices->vertex.set1Value(iver++,localB.x(),localB.y(),0);
101  line->numVertices.set1Value(i,2);
102  }
103  return line;
104 }
105 
106 //____________________________________________________________________
108 {
109  const InDetDD::SiDetectorElement * elem = element();
110  if (!elem)
111  return common()->nodeManager()->getUnitTransform();//fixme: warn
113 }
114 
115 //____________________________________________________________________
117 {
119  if (!detmgr)
120  return 0;
121  return detmgr->getDetectorElement(m_data->identify());
122 }
123 
124 // //____________________________________________________________________
125 // SoMaterial * VP1RawDataHandle_SCT_RDO::determineMaterial() const
126 // {
127 // return common()->sctMaterial();
128 // }
129 
130 //____________________________________________________________________
131 VP1RawDataFlags::InDetPartsFlags VP1RawDataHandle_SCT_RDO::inInDetParts() const
132 {
133  const InDetDD::SiDetectorElement * elem = element();
134  if (!elem)
135  return VP1RawDataFlags::All;
136  if (elem->center().z()>=0)
138  else
140 
141 }
HitsSoNodeManager.h
SCT_RDORawData::getGroupSize
virtual int getGroupSize() const =0
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
checkFileSG.line
line
Definition: checkFileSG.py:75
VP1RawDataHandleBase::unsignedToHex
static QString unsignedToHex(unsigned)
Definition: VP1RawDataHandleBase.cxx:158
VP1RawDataFlags::EndCapPositive
@ EndCapPositive
Definition: VP1RawDataFlags.h:27
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
VP1RawDataHandle_SCT_RDO::buildTransform
SoTransform * buildTransform()
Definition: VP1RawDataHandle_SCT_RDO.cxx:107
VP1RawDataHandleBase
Definition: VP1RawDataHandleBase.h:34
VP1RawDataHandle_SCT_RDO::~VP1RawDataHandle_SCT_RDO
virtual ~VP1RawDataHandle_SCT_RDO()
Definition: VP1RawDataHandle_SCT_RDO.cxx:42
SCT_ModuleSideDesign.h
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
InDetDD::SolidStateDetectorElementBase::center
virtual const Amg::Vector3D & center() const override final
Center in global coordinates.
VP1RawDataCommonData::nodeManager
HitsSoNodeManager * nodeManager() const
Definition: VP1RawDataCommonData.h:42
VP1RawDataHandle_SCT_RDO.h
VP1RawDataCollBase
Definition: VP1RawDataCollBase.h:29
VP1RawDataHandle_SCT_RDO::clicked
QStringList clicked(bool verbose) const
Definition: VP1RawDataHandle_SCT_RDO.cxx:47
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
SCT_RDORawData
Definition: SCT_RDORawData.h:24
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
SCT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: SCT_ID.h:740
InDetDD::SCT_DetectorManager::getDetectorElement
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
Definition: SCT_DetectorManager.cxx:64
VP1LinAlgUtils.h
VP1DetInfo.h
GeoPrimitives.h
VP1RawDataHandle_SCT_RDO::m_data
const SCT_RDORawData * m_data
Definition: VP1RawDataHandle_SCT_RDO.h:37
lumiFormat.i
int i
Definition: lumiFormat.py:85
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDetDD::SCT_ModuleSideDesign::positionFromStrip
virtual SiLocalPosition positionFromStrip(const int stripNumber) const
gives position of strip center ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId ...
Definition: SCT_ModuleSideDesign.cxx:95
SCT_RDORawData.h
VP1RawDataHandle_SCT_RDO::VP1RawDataHandle_SCT_RDO
VP1RawDataHandle_SCT_RDO(VP1RawDataCollBase *, const SCT_RDORawData *)
Definition: VP1RawDataHandle_SCT_RDO.cxx:36
InDetDD::SiDetectorElement::endsOfStrip
std::pair< Amg::Vector3D, Amg::Vector3D > endsOfStrip(const Amg::Vector2D &position) const
Special method for SCT to retrieve the two ends of a "strip" Returned coordinates are in global frame...
Definition: SiDetectorElement.cxx:339
VP1RawDataCommonData.h
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
python.selection.number
number
Definition: selection.py:20
SCT_ID::layer_disk
int layer_disk(const Identifier &id) const
Definition: SCT_ID.h:734
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
SiDetectorElement.h
VP1DetInfo::sctIDHelper
static const SCT_ID * sctIDHelper()
Definition: VP1DetInfo.cxx:165
InDetRawData::getWord
unsigned int getWord() const
Definition: InDetRawData.h:47
VP1RawDataFlags::BarrelNegative
@ BarrelNegative
Definition: VP1RawDataFlags.h:26
SCT_ID
Definition: SCT_ID.h:68
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
HitsSoNodeManager::getShapeNode_Point
SoNode * getShapeNode_Point()
Definition: HitsSoNodeManager.cxx:412
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
SCT_ID::eta_module
int eta_module(const Identifier &id) const
Definition: SCT_ID.h:746
VP1RawDataHandle_SCT_RDO::inInDetParts
VP1RawDataFlags::InDetPartsFlags inInDetParts() const
Definition: VP1RawDataHandle_SCT_RDO.cxx:131
DetectorZone::barrel
@ barrel
VP1RawDataFlags::All
@ All
Definition: VP1RawDataFlags.h:31
VP1RawDataFlags::BarrelPositive
@ BarrelPositive
Definition: VP1RawDataFlags.h:25
SCT_ID::side
int side(const Identifier &id) const
Definition: SCT_ID.h:752
InDetRawData::identify
virtual Identifier identify() const override final
Definition: InDetRawData.h:41
VP1RawDataFlags::EndCapNegative
@ EndCapNegative
Definition: VP1RawDataFlags.h:28
SCT_DetectorManager.h
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
InDetDD::SCT_ModuleSideDesign::endsOfStrip
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
VP1LinAlgUtils::toSoTransform
static SoTransform * toSoTransform(const HepGeom::Transform3D &, SoTransform *t=0)
Definition: VP1LinAlgUtils.cxx:40
VP1RawDataHandleBase::common
VP1RawDataCommonData * common() const
Definition: VP1RawDataHandleBase.h:41
InDetDD::SolidStateDetectorElementBase::transform
virtual const Amg::Transform3D & transform() const override final
Return local to global transform.
HitsSoNodeManager::getUnitTransform
SoTransform * getUnitTransform()
Definition: HitsSoNodeManager.cxx:456
VP1RawDataHandle_SCT_RDO::element
const InDetDD::SiDetectorElement * element() const
Definition: VP1RawDataHandle_SCT_RDO.cxx:116
VP1RawDataHandle_SCT_RDO::buildShape
SoNode * buildShape()
Definition: VP1RawDataHandle_SCT_RDO.cxx:76
VP1DetInfo::sctDetMgr
static const InDetDD::SCT_DetectorManager * sctDetMgr()
Definition: VP1DetInfo.cxx:146
Identifier
Definition: IdentifierFieldParser.cxx:14