26 #include <Inventor/nodes/SoLineSet.h>
27 #include <Inventor/nodes/SoVertexProperty.h>
28 #include <Inventor/SoPath.h>
29 #include <Inventor/nodes/SoSeparator.h>
31 #include <QStringList>
38 #include "GaudiKernel/SystemOfUnits.h"
45 QList<VP1StdCollection*>
l;
58 double mag(
const HepMC::FourVector&
v)
const {
59 return std::sqrt(
v.x()*
v.x() +
v.y()*
v.y() +
v.z()*
v.z() );
88 SoVertexProperty *
vertices =
static_cast<SoVertexProperty *
>(
m_line->vertexProperty.getValue());
91 m_line->numVertices.set1Value(0,2);
92 m_line->numVertices.set1Value(1,2);
93 m_line->numVertices.set1Value(2,2);
117 double px(0),
py(0),
pz(0),
e(0);
119 for (
const auto& PartIn:
m_vertex->particles_in()){
121 HepMC::GenVertex::particles_in_const_iterator itPartIn,itPartInE(
m_vertex->particles_in_const_end());
122 for ( itPartIn =
m_vertex->particles_in_const_begin();itPartIn!=itPartInE;++itPartIn) {
123 auto PartIn=*itPartIn;
125 px +=PartIn->momentum().px();
126 py +=PartIn->momentum().py();
127 pz +=PartIn->momentum().pz();
128 e += PartIn->momentum().e();
149 collsep->addChild(
m_line);
155 collsep->removeChild(
m_line);
166 if (!
p.second.isAllR()) {
197 connect(controller,SIGNAL(truthCutAllowedPhiChanged(
const QList<VP1Interval>&)),
this,SLOT(
recheckAllCuts()));
199 connect(controller,SIGNAL(truthCutQuantityChanged(
const QPair<VertexCommonFlags::QUANTITY,VP1Interval>&)),
this,SLOT(
recheckAllCuts()));
200 connect(controller,SIGNAL(truthCrossLengthChanged(QPair<VertexCommonFlags::QUANTITY,double>)),
this,SLOT(
updateAllShapes()));
226 SoVertexProperty *
vertices =
new SoVertexProperty();
233 SoLineSet *
line =
new SoLineSet();
234 line->numVertices.set1Value(0,2);
235 line->numVertices.set1Value(1,2);
236 line->numVertices.set1Value(2,2);
249 if (mcEventColl->
size()<1)
253 for (itEvent = mcEventColl->
begin(); itEvent != itEventEnd; ++itEvent) {
254 const HepMC::GenEvent* genEvent(*itEvent);
259 for (
const auto& vtx: genEvent->vertices()) {
261 HepMC::GenEvent::vertex_const_iterator itVertex, itVertexEnd(genEvent->vertices_end());
262 for (itVertex = genEvent->vertices_begin(); itVertex != itVertexEnd; ++itVertex ) {
280 SoNode * pickedNode = (pickedPath ? (pickedPath->getLength()>0?pickedPath->getNodeFromTail(0):0): 0);
284 if (vh->
line()==pickedNode) {
290 return QStringList() <<
"ERROR: Could not get truth vertex information for picked Node";
297 l <<
"Truth vertex from collection "+
text()+
":" ;
299 for (
const auto& PartIn: vtx->particles_in()) {
301 HepMC::GenVertex::particles_in_const_iterator itPartIn,itPartInE(vtx->particles_in_const_end());
302 for ( itPartIn = vtx->particles_in_const_begin();itPartIn!=itPartInE;++itPartIn) {
303 auto PartIn=*itPartIn;
305 const int pdg = PartIn->pdg_id();
313 for (
const auto& PartOut: vtx->particles_out()) {
315 HepMC::GenVertex::particles_out_const_iterator itPartOut,itPartOutE(vtx->particles_out_const_end());
316 for ( itPartOut = vtx->particles_out_const_begin();itPartOut!=itPartOutE;++itPartOut) {
317 auto PartOut=*itPartOut;
319 const int pdg = PartOut->pdg_id();
328 l <<
"======== Dump ========";
329 std::ostringstream
s;
331 l << QString(
s.str().c_str()).split(
'\n');
332 l <<
"======================";