ATLAS Offline Software
Loading...
Searching...
No Matches
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//____________________________________________________________________
51public:
52 static double dist(const SbVec3f& p1,const SbVec3f& p2);
54 ~Imp() { }
56};
57
58//____________________________________________________________________
63
64//____________________________________________________________________
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//____________________________________________________________________
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(")=(")
95 +VP1Msg::str(mom.eta())+VP1Msg::str(",")+VP1Msg::str(VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() ))+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}
static Double_t tc
const AODCollHandleBase * collHandle() const
AODHandleBase(AODCollHandleBase *)
Base class for collections holding AOD objects of iParticle type Handles pt etc cuts Local data:
IParticleHandleBase * theclass
Imp(IParticleHandleBase *tc)
static double dist(const SbVec3f &p1, const SbVec3f &p2)
IParticleHandleBase(IParticleCollHandleBase *)
virtual double mass() const
Returns unknown() in case of trouble.
SoMaterial * determineMaterial()
Should be implemented by children, in order to change the material depending on the interface etc.
virtual Amg::Vector3D momentum() const
virtual QStringList baseInfo() const
static double phiFromXY(const double &x, const double &y)
SoMaterial * material() const
static QString str(const QString &s)
Definition VP1String.h:49
Eigen::Matrix< double, 3, 1 > Vector3D