ATLAS Offline Software
IParticleHandleBase.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 IParticleHandleBase //
9 // //
10 // //
12 
13 #include "IParticleHandleBase.h"
19 
22 #include "VP1Base/VP1Msg.h"
24 #include "VP1Base/VP1QtUtils.h"
25 
27 
28 #include <Inventor/C/errors/debugerror.h>
29 #include <Inventor/nodes/SoLineSet.h>
30 #include <Inventor/nodes/SoVertexProperty.h>
31 #include <Inventor/nodes/SoSeparator.h>
32 #include <Inventor/nodes/SoMaterial.h>
33 #include <Inventor/nodes/SoPickStyle.h>
34 #include <Inventor/nodes/SoCylinder.h>
35 #include <Inventor/nodes/SoMatrixTransform.h>
36 #include <Inventor/SbRotation.h>
37 #include <Inventor/SbMatrix.h>
38 #include <Inventor/nodes/SoTranslation.h>
39 #include <Inventor/nodes/SoText2.h>
40 
43 
44 #include <cassert>
45 
46 #include "xAODBase/IParticle.h"
47 
48 
49 //____________________________________________________________________
51 public:
52  static double dist(const SbVec3f& p1,const SbVec3f& p2);
54  ~Imp() { }
56 };
57 
58 //____________________________________________________________________
60  : AODHandleBase(ch), m_d(new Imp(this))
61 {
62 }
63 
64 //____________________________________________________________________
66 {
67  delete m_d;
68 }
69 
70 //____________________________________________________________________
72  // By default we use the collection material.
73  // std::cout<<"AODHandleBase::determineMaterial() - collHandle()->material()"<<collHandle()->material()<<std::endl;
74  return collHandle()->material();
75 }
76 
77 //____________________________________________________________________
79 {
80  return 0.0;
81 }
82 
83 
84 //____________________________________________________________________
85 QStringList IParticleHandleBase::baseInfo() const
86 {
87  QStringList l;
88  Amg::Vector3D mom = momentum()/1000;
89  if (mom.mag2()==0.0) {
90  l << "Momentum : 0 (undefined)";
91  } else {
92  l << "Momentum [GeV]: "+VP1Msg::str(mom);
93  l << "|Pt|/|P| [GeV]: "+VP1Msg::str(mom.perp())+" / " + VP1Msg::str(mom.mag());
94  l << VP1Msg::str("(")+QChar(0x03B7)+","+QChar(0x03D5)+VP1Msg::str(")=(")
96 
97  l << "Eta: "+VP1Msg::str(mom.eta());
98  l << "Phi: "+VP1Msg::str(VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() ));
99  }
100  // l<<"Hit summary: Pix["+VP1Msg::str(getNPixelHits())+"], SCT["+VP1Msg::str(getNSCTHits())+"], TRT["+VP1Msg::str(getNTRTHits())
101  // +"], MDT["+QString::number(getNMDTHits())+"], RPC["+QString::number(getNRPCHits())+"], TGC["+QString::number(getNTGCHits())+"], CSC["+QString::number(getNCSCHits())+"].";
102  //
103  // return l;
104  // int pdg = pdgCode();
105  // if (pdg) {
106  // bool ok;
107  // QString name = VP1ParticleData::particleName(pdg,ok);
108  // if (ok)
109  // l << "pdg: "+QString::number(pdg)+" ["+name+"]";
110  // else
111  // l << "pdg: "+QString::number(pdg);
112  // }
113 
114  return l;
115 }
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
IParticle.h
AODHandleBase
Definition: AODHandleBase.h:43
IParticleHandleBase::Imp::theclass
IParticleHandleBase * theclass
Definition: IParticleHandleBase.cxx:55
VP1StdCollection::material
SoMaterial * material() const
Definition: VP1StdCollection.cxx:220
VP1MaterialButton.h
VP1ExtraSepLayerHelper.h
VP1Msg.h
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
AODSystemController.h
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
VP1QtUtils.h
VP1ParticleData.h
IParticleHandleBase::m_d
Imp * m_d
Definition: IParticleHandleBase.h:70
AODHandleBase::collHandle
const AODCollHandleBase * collHandle() const
Definition: AODHandleBase.h:55
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
VP1LinAlgUtils::phiFromXY
static double phiFromXY(const double &x, const double &y)
Definition: VP1LinAlgUtils.cxx:374
VP1LinAlgUtils.h
GeoPrimitives.h
IParticleHandleBase::~IParticleHandleBase
virtual ~IParticleHandleBase()
Definition: IParticleHandleBase.cxx:65
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
AmgStringHelpers.h
IParticleHandleBase
Definition: IParticleHandleBase.h:42
IParticleHandleBase::momentum
virtual Amg::Vector3D momentum() const
Definition: IParticleHandleBase.h:52
IParticleHandleBase.h
VP1AODSystem.h
IParticleHandleBase::baseInfo
virtual QStringList baseInfo() const
Definition: IParticleHandleBase.cxx:85
IParticleHandleBase::Imp::~Imp
~Imp()
Definition: IParticleHandleBase.cxx:54
IParticleHandleBase::IParticleHandleBase
IParticleHandleBase(IParticleCollHandleBase *)
Definition: IParticleHandleBase.cxx:59
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
IParticleHandleBase::Imp::Imp
Imp(IParticleHandleBase *tc)
Definition: IParticleHandleBase.cxx:53
IParticleHandleBase::mass
virtual double mass() const
Returns unknown() in case of trouble.
Definition: IParticleHandleBase.cxx:78
IParticleHandleBase::Imp::dist
static double dist(const SbVec3f &p1, const SbVec3f &p2)
IParticleHandleBase::determineMaterial
SoMaterial * determineMaterial()
Should be implemented by children, in order to change the material depending on the interface etc.
Definition: IParticleHandleBase.cxx:71
VP1JobConfigInfo.h
SurfaceToSoNode.h
IParticleCollHandleBase.h
IParticleCollHandleBase
Base class for collections holding AOD objects of iParticle type Handles pt etc cuts Local data:
Definition: IParticleCollHandleBase.h:50
IParticleHandleBase::Imp
Definition: IParticleHandleBase.cxx:50