60 QFont font = item->font(0);
62 if (item->text(0)==
name) {
64 for (
int i=0;i<item->columnCount();++i) {
65 item->setFont(i,font);
69 QTreeWidgetItem *expandItem = item;
71 expandItem->setExpanded(
true);
72 expandItem=expandItem->parent();
73 if (!expandItem || expandItem->isExpanded())
break;
76 for (
int i=0;i<item->childCount();++i) {
94 std::ostringstream partStream, pidStream, massStream, ptStream, etaStream, phiStream;
99 partStream <<
name.toStdString();
102 partStream <<
"PDG ID = " << theParticle.pdg_id();
106 item->setText(0,partStream.str().c_str());
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) {
113 eta =-log(tan(mom.theta()/2));
115 double phi = mom.phi();
118 double pt = mom.perp()/CLHEP::GeV;
120 pidStream << theParticle.pdg_id();
121 item->setText(1,pidStream.str().c_str());
123 massStream << theParticle.generated_mass()/CLHEP::GeV;
124 item->setText(2,massStream.str().c_str());
127 item->setText(3,ptStream.str().c_str());
130 item->setText(4,etaStream.str().c_str());
133 item->setText(5,phiStream.str().c_str());
138 QBrush brush=item->foreground(0);
139 brush.setColor(Qt::gray);
142 int nParents=prodVertex->particles_in_size();
144 brush.setColor(Qt::black);
146 else if (nParents==1){
147 brush.setColor(Qt::blue);
149 else if (nParents>1) {
150 brush.setColor(Qt::red);
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);
165 QTreeWidgetItem *newItem =
new QTreeWidgetItem();
166 item->addChild(newItem);
195 QWidget * controller =
new QWidget;
196 m_d->ui.setupUi(controller);
197 connect(
m_d->ui.addButton,SIGNAL(clicked()),
this, SLOT(
addParticle()));
200 connect (
m_d->ui.listWidget, SIGNAL (itemDoubleClicked (QListWidgetItem *)),
this, SLOT (
editItem (QListWidgetItem *)));
211 for (;iter!=endColl;++iter) {
213 for (e=iter->begin();e!=iter->end(); ++e) {
215 if (!particle->production_vertex() || ! particle->production_vertex()->particles_in_size()) {
216 QTreeWidgetItem *item =
new QTreeWidgetItem();
217 m_d->tw->insertTopLevelItem(
m_d->tw->topLevelItemCount(), item);
218 m_d->handle(item,*particle);
291 m_d->tw->collapseAll();
292 for (
int j=0;j<
m_d->ui.listWidget->count();++j) {
293 m_d->ui.listWidget->setCurrentRow(j);
294 QString text =
m_d->ui.listWidget->currentItem()->text();
295 for (
int i=0;i<
m_d->tw->topLevelItemCount();++i) {
296 m_d->zeroFormat(
m_d->tw->topLevelItem(i));
300 for (
int j=0;j<
m_d->ui.listWidget->count();++j) {
301 m_d->ui.listWidget->setCurrentRow(j);
302 QString text =
m_d->ui.listWidget->currentItem()->text();
303 for (
int i=0;i<
m_d->tw->topLevelItemCount();++i) {
304 m_d->expand(text,
m_d->tw->topLevelItem(i));
static QString particleName(const int &pdgcode, bool &ok)