94 {
95
96#ifdef PD
97 const HepPDT::ParticleDataTable * dataTable =
pps->PDT();
98 const HepPDT::ParticleData * particleData = dataTable->particle(
iabs(theParticle.pdg_id()));
99
100 if (particleData) {
101 }
102 else {
103 }
104#endif
105
106 std::ostringstream partStream, pidStream, massStream, ptStream, etaStream, phiStream;
107
108 bool ok;
110 if (ok) {
111 partStream <<
name.toStdString();
112 }
113 else {
114 partStream << "PDG ID = " << theParticle.pdg_id();
115 }
116
117
118 item->setText(0,partStream.str().c_str());
119
121 CLHEP::Hep3Vector
mom=CLHEP::Hep3Vector(theParticle.momentum().x(),
122 theParticle.momentum().y(),
123 theParticle.momentum().z());
124 if (
mom.x()!=0 ||
mom.y()!=0) {
126 }
130 double pt =
mom.perp()/CLHEP::GeV;
131
132 pidStream << theParticle.pdg_id();
133 item->setText(1,pidStream.str().c_str());
134
135 massStream << theParticle.generated_mass()/CLHEP::GeV;
136 item->setText(2,massStream.str().c_str());
137
139 item->setText(3,ptStream.str().c_str());
140
142 item->setText(4,etaStream.str().c_str());
143
145 item->setText(5,phiStream.str().c_str());
146
147 if (1) {
149
150 QBrush brush=
item->foreground(0);
151 brush.setColor(Qt::gray);
152
153 if (prodVertex) {
154 int nParents=prodVertex->particles_in_size();
155 if (nParents==0) {
156 brush.setColor(Qt::black);
157 }
158 else if (nParents==1){
159 brush.setColor(Qt::blue);
160 }
161 else if (nParents>1) {
162 brush.setColor(Qt::red);
163 }
164 }
165
166 item->setForeground(0,brush);
167 item->setForeground(1,brush);
168 item->setForeground(2,brush);
169 item->setForeground(3,brush);
170 item->setForeground(4,brush);
171 }
172 if (1) {
174 if (decayVertex) {
175
177 QTreeWidgetItem *newItem = new QTreeWidgetItem();
178 item->addChild(newItem);
180 }
181 }
182 }
183}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
void handle(QTreeWidgetItem *item, const HepMC::GenParticle &particle)
static QString particleName(const int &pdgcode, bool &ok)
const GenParticle * ConstGenParticlePtr
const HepMC::GenVertex * ConstGenVertexPtr