92 {
93
94 std::ostringstream partStream, pidStream, massStream, ptStream, etaStream, phiStream;
95
96 bool ok;
98 if (ok) {
99 partStream <<
name.toStdString();
100 }
101 else {
102 partStream << "PDG ID = " << theParticle.pdg_id();
103 }
104
105
106 item->setText(0,partStream.str().c_str());
107
109 CLHEP::Hep3Vector
mom=CLHEP::Hep3Vector(theParticle.momentum().x(),
110 theParticle.momentum().y(),
111 theParticle.momentum().z());
112 if (
mom.x()!=0 ||
mom.y()!=0) {
114 }
118 double pt =
mom.perp()/CLHEP::GeV;
119
120 pidStream << theParticle.pdg_id();
121 item->setText(1,pidStream.str().c_str());
122
123 massStream << theParticle.generated_mass()/CLHEP::GeV;
124 item->setText(2,massStream.str().c_str());
125
127 item->setText(3,ptStream.str().c_str());
128
130 item->setText(4,etaStream.str().c_str());
131
133 item->setText(5,phiStream.str().c_str());
134
135 if (1) {
137
138 QBrush brush=item->foreground(0);
139 brush.setColor(Qt::gray);
140
141 if (prodVertex) {
142 int nParents=prodVertex->particles_in_size();
143 if (nParents==0) {
144 brush.setColor(Qt::black);
145 }
146 else if (nParents==1){
147 brush.setColor(Qt::blue);
148 }
149 else if (nParents>1) {
150 brush.setColor(Qt::red);
151 }
152 }
153
154 item->setForeground(0,brush);
155 item->setForeground(1,brush);
156 item->setForeground(2,brush);
157 item->setForeground(3,brush);
158 item->setForeground(4,brush);
159 }
160 if (1) {
162 if (decayVertex) {
163
165 QTreeWidgetItem *newItem = new QTreeWidgetItem();
166 item->addChild(newItem);
168 }
169 }
170 }
171}
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)
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
HepMC3::ConstGenVertexPtr ConstGenVertexPtr