ATLAS Offline Software
PRDSysCommonData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Implementation of class PRDSysCommonData //
9 // //
10 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11 // Initial version: July 2008 //
12 // //
14 
16 #include "VP1Base/IVP13DSystem.h"
17 
23 
26 
27 #include <Inventor/C/errors/debugerror.h>
28 #include <Inventor/nodes/SoSeparator.h>
29 #include <Inventor/nodes/SoTransform.h>
30 #include <Inventor/SoPath.h>
31 
32 
33 //____________________________________________________________________
35 public:
36  //The following map is used to figure out which handle a clicked node corresponds to.
37  //We use the SoTransform node to uniquely identify this association.
38  std::map<SoNode*,PRDHandleBase*> sotransform2prdhandle;
39  PRDHandleBase * pickedPathToHandle( SoPath*pickedPath );
40 
41  //The following map is used to find handles for a given prd pointer:
42  std::map< const Trk::PrepRawData *, QList<PRDHandleBase *> > prd2handles;
43 };
44 
45 
46 //____________________________________________________________________
48  : VP1HelperClassBase(sys,"PRDSysCommonData"), m_d(new Imp),
49  m_controller(controller)
50 {
51  m_3dsystem = sys;
59 
60  QObject::connect(m_touchedMuonChamberHelper,SIGNAL(touchedMuonChambersChanged(const std::set<GeoPVConstLink>&)),
61  sys,SLOT(emitTouchedMuonChambersChanged(const std::set<GeoPVConstLink>&)));//Fixme: need track sys!!
62 
64 }
65 
66 //____________________________________________________________________
68 {
69  delete m_nodeManager;
70  delete m_materialMixer;
73  delete m_indetProjHelper_SCT;
74  delete m_indetProjHelper_TRT;
77  delete m_d;
78 }
79 
80 //____________________________________________________________________
82 {
84  m_d->sotransform2prdhandle.clear();
85  m_d->prd2handles.clear();
86 }
87 
88 
89 //_____________________________________________________________________________________
91 {
94 }
95 
96 //_____________________________________________________________________________________
98 {
99  if (m_d->prd2handles.find(prd)==m_d->prd2handles.end()) {
100  QList<PRDHandleBase*> l;
101  l<<handle;
102  m_d->prd2handles[prd] = l;
103  } else {
104  m_d->prd2handles[prd] << handle;
105  }
106 }
107 
108 //_____________________________________________________________________________________
110 {
111  while (pickedPath->getLength()>4) {//4 is a bit arbitrary...
112  if (pickedPath->getNodeFromTail(0)->getTypeId()==SoSeparator::getClassTypeId()) {
113  //If at least two children and the first is an SoTransform, then it might be what we are looking for.
114  SoSeparator * sep = static_cast<SoSeparator*>(pickedPath->getNodeFromTail(0));
115  if (sep->getNumChildren()>1&&sep->getChild(0)->getTypeId()==SoTransform::getClassTypeId()) {
117  if ( it!=m_d->sotransform2prdhandle.end())
118  return it->second;
119  }
120  }
121  pickedPath->pop();//FIXME: NO NEED TO DO ANYTHING ELSE THAN FIND THE HANDLE!!
122  }
123  return 0;
124 }
125 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
HitsSoNodeManager.h
MuonChamberProjectionHelper
Definition: MuonChamberProjectionHelper.h:32
InDetProjHelper.h
PRDSysCommonData::registerTransform2Handle
void registerTransform2Handle(SoTransform *transform, PRDHandleBase *handle)
Definition: PRDSysCommonData.cxx:90
InDetProjHelper::createPixelHelper
static InDetProjHelper * createPixelHelper(IVP1System *sys=0)
Definition: InDetProjHelper.cxx:32
PRDSysCommonData::PRDSysCommonData
PRDSysCommonData(IVP13DSystem *, PRDSystemController *)
Definition: PRDSysCommonData.cxx:47
PRDTrackSegmentHelper.h
PRDSysCommonData::m_nodeManager
HitsSoNodeManager * m_nodeManager
Definition: PRDSysCommonData.h:65
PRDTrackSegmentHelper
Definition: PRDTrackSegmentHelper.h:36
PRDSysCommonData::m_materialMixer
VP1SoMaterialMixer * m_materialMixer
Definition: PRDSysCommonData.h:67
PRDSystemController
Definition: PRDSystemController.h:34
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
skel.it
it
Definition: skel.GENtoEVGEN.py:396
InDetProjHelper::createSCTHelper
static InDetProjHelper * createSCTHelper(IVP1System *sys=0)
Definition: InDetProjHelper.cxx:50
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
PRDSysCommonData::Imp::prd2handles
std::map< const Trk::PrepRawData *, QList< PRDHandleBase * > > prd2handles
Definition: PRDSysCommonData.cxx:42
PRDSysCommonData::m_d
Imp * m_d
Definition: PRDSysCommonData.h:61
PRDSysCommonData.h
TouchedMuonChamberHelper
Definition: TouchedMuonChamberHelper.h:30
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
PRDSysCommonData::~PRDSysCommonData
virtual ~PRDSysCommonData()
Definition: PRDSysCommonData.cxx:67
PRDSysCommonData::m_trackAndSegmentHelper
PRDTrackSegmentHelper * m_trackAndSegmentHelper
Definition: PRDSysCommonData.h:74
PRDSysCommonData::m_muonChamberProjectionHelper
MuonChamberProjectionHelper * m_muonChamberProjectionHelper
Definition: PRDSysCommonData.h:68
PRDSysCommonData::registerPRD2Handle
void registerPRD2Handle(const Trk::PrepRawData *prd, PRDHandleBase *handle)
Definition: PRDSysCommonData.cxx:97
PRDSysCommonData::m_indetProjHelper_TRT
InDetProjHelper * m_indetProjHelper_TRT
Definition: PRDSysCommonData.h:71
PRDSysCommonData::clearEventData
void clearEventData()
Definition: PRDSysCommonData.cxx:81
VP1SoMaterialMixer.h
IVP13DSystem.h
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
VP1HelperClassBase
Definition: VP1HelperClassBase.h:28
PRDSysCommonData::m_touchedMuonChamberHelper
TouchedMuonChamberHelper * m_touchedMuonChamberHelper
Definition: PRDSysCommonData.h:72
Trk::PrepRawData
Definition: PrepRawData.h:62
grepfile.sep
sep
Definition: grepfile.py:38
PRDSystemController.h
MuonChamberProjectionHelper.h
PRDSysCommonData::m_indetProjHelper_SCT
InDetProjHelper * m_indetProjHelper_SCT
Definition: PRDSysCommonData.h:70
PRDSysCommonData::Imp
Definition: PRDSysCommonData.cxx:34
PRDSysCommonData::pickedPathToHandle
PRDHandleBase * pickedPathToHandle(SoPath *pickedPath)
Definition: PRDSysCommonData.cxx:109
PRDSysCommonData::m_indetProjHelper_Pixel
InDetProjHelper * m_indetProjHelper_Pixel
Definition: PRDSysCommonData.h:69
IVP13DSystem
Definition: IVP13DSystem.h:31
TouchedMuonChamberHelper::eraseEventData
void eraseEventData()
Definition: TouchedMuonChamberHelper.cxx:116
HitsSoNodeManager
Definition: HitsSoNodeManager.h:17
InDetProjHelper::createTRTHelper
static InDetProjHelper * createTRTHelper(IVP1System *sys=0)
Definition: InDetProjHelper.cxx:68
PRDSysCommonData::m_3dsystem
IVP13DSystem * m_3dsystem
Definition: PRDSysCommonData.h:64
PRDHandleBase
Definition: PRDHandleBase.h:35
TouchedMuonChamberHelper.h
PRDSysCommonData::Imp::sotransform2prdhandle
std::map< SoNode *, PRDHandleBase * > sotransform2prdhandle
Definition: PRDSysCommonData.cxx:38
PRDSysCommonData::Imp::pickedPathToHandle
PRDHandleBase * pickedPathToHandle(SoPath *pickedPath)
VP1SoMaterialMixer
Definition: VP1SoMaterialMixer.h:19