62 QFont font = item->font(0);
64 if (item->text(0)==
name) {
66 for (
int i=0;i<item->columnCount();++i) {
67 item->setFont(i,font);
71 QTreeWidgetItem *expandItem = item;
73 expandItem->setExpanded(
true);
74 expandItem=expandItem->parent();
75 if (!expandItem || expandItem->isExpanded())
break;
78 for (
int i=0;i<item->childCount();++i) {
97 const HepPDT::ParticleDataTable * dataTable =
pps->PDT();
98 const HepPDT::ParticleData * particleData = dataTable->particle(
iabs(theParticle.pdg_id()));
106 std::ostringstream partStream, pidStream, massStream, ptStream, etaStream, phiStream;
111 partStream <<
name.toStdString();
114 partStream <<
"PDG ID = " << theParticle.pdg_id();
118 item->setText(0,partStream.str().c_str());
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) {
125 eta =-log(tan(mom.theta()/2));
127 double phi = mom.phi();
130 double pt = mom.perp()/CLHEP::GeV;
132 pidStream << theParticle.pdg_id();
133 item->setText(1,pidStream.str().c_str());
135 massStream << theParticle.generated_mass()/CLHEP::GeV;
136 item->setText(2,massStream.str().c_str());
139 item->setText(3,ptStream.str().c_str());
142 item->setText(4,etaStream.str().c_str());
145 item->setText(5,phiStream.str().c_str());
150 QBrush brush=item->foreground(0);
151 brush.setColor(Qt::gray);
154 int nParents=prodVertex->particles_in_size();
156 brush.setColor(Qt::black);
158 else if (nParents==1){
159 brush.setColor(Qt::blue);
161 else if (nParents>1) {
162 brush.setColor(Qt::red);
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);
177 QTreeWidgetItem *newItem =
new QTreeWidgetItem();
178 item->addChild(newItem);
207 QWidget * controller =
new QWidget;
208 m_d->ui.setupUi(controller);
209 connect(
m_d->ui.addButton,SIGNAL(clicked()),
this, SLOT(
addParticle()));
212 connect (
m_d->ui.listWidget, SIGNAL (itemDoubleClicked (QListWidgetItem *)),
this, SLOT (
editItem (QListWidgetItem *)));
223 for (;iter!=endColl;++iter) {
225 for (e=iter->begin();e!=iter->end(); ++e) {
227 if (!particle->production_vertex() || ! particle->production_vertex()->particles_in_size()) {
228 QTreeWidgetItem *item =
new QTreeWidgetItem();
229 m_d->tw->insertTopLevelItem(
m_d->tw->topLevelItemCount(), item);
230 m_d->handle(item,*particle);
303 m_d->tw->collapseAll();
304 for (
int j=0;j<
m_d->ui.listWidget->count();++j) {
305 m_d->ui.listWidget->setCurrentRow(j);
306 QString text =
m_d->ui.listWidget->currentItem()->text();
307 for (
int i=0;i<
m_d->tw->topLevelItemCount();++i) {
308 m_d->zeroFormat(
m_d->tw->topLevelItem(i));
312 for (
int j=0;j<
m_d->ui.listWidget->count();++j) {
313 m_d->ui.listWidget->setCurrentRow(j);
314 QString text =
m_d->ui.listWidget->currentItem()->text();
315 for (
int i=0;i<
m_d->tw->topLevelItemCount();++i) {
316 m_d->expand(text,
m_d->tw->topLevelItem(i));
static QString particleName(const int &pdgcode, bool &ok)