MCTree Class Reference

#include <MCTree.h>

List of all members.

Public Member Functions

 MCTree (GuiTree *tree)
 ~MCTree ()
void Update (Mint *mint)

Private Member Functions

void AddSimSnarl (SimSnarlRecord *ssr)

Private Attributes

GuiTreefTree

Detailed Description

Id
MCTree.h,v 1.2 2005/07/21 20:26:36 bv Exp

Definition at line 26 of file MCTree.h.


Constructor & Destructor Documentation

MCTree::MCTree ( GuiTree tree  ) 

Definition at line 22 of file MCTree.cxx.

References pdg_kludge().

00023     : fTree(gtv)
00024 {
00025     pdg_kludge();
00026 }

MCTree::~MCTree (  ) 

Definition at line 27 of file MCTree.cxx.

00028 {
00029     cerr << "MCTree::~MCTree()\n";
00030 }


Member Function Documentation

void MCTree::AddSimSnarl ( SimSnarlRecord ssr  )  [private]

Definition at line 62 of file MCTree.cxx.

References GuiTree::AddEntry(), bark(), MuELoss::e, RecDataRecord< T >::FindComponent(), Form(), fTree, GuiTreeEntry::on_mouse_over, and tool_tip().

Referenced by Update().

00063 {
00064     const TClonesArray* ctca = 
00065         dynamic_cast<const TClonesArray*>
00066         (ssr->FindComponent("TClonesArray","StdHep"));
00067     if (!ctca) return;
00068 
00069     vector<GuiTreeEntry*> entries;
00070 
00071     int ind, siz = ctca->GetEntriesFast();
00072     for (ind=0; ind < siz; ++ind) {
00073         TParticle* part = dynamic_cast<TParticle*>((*ctca)[ind]);
00074         if (!part) {
00075             cerr << "Non particle: " << (*ctca)[ind]->GetName() << endl;
00076             continue;
00077         }
00078 
00079         GuiTreeEntry *entry = 0;
00080         int mother = part->GetFirstMother();
00081         if (mother != -1) entry = entries[mother];
00082 
00083         cerr << "Mother=" << mother << " ind=" << ind
00084              << " " << part->GetName() 
00085              << endl;
00086         GuiTreeEntry* e=0;
00087         if (part->GetStatusCode() >= 200) 
00088             e = fTree->AddEntry(entry,Form("(%s)",part->GetName()));
00089         else
00090             e = fTree->AddEntry(entry,part->GetName());
00091         e->on_mouse_over.connect(bind(slot(bark),part));
00092         fTree->SetToolTipItem(e,tool_tip(part));
00093 
00094         entries.push_back(e);
00095         fTree->OpenItem(e);
00096     }
00097 
00098     
00099 }

void MCTree::Update ( Mint mint  ) 

Definition at line 33 of file MCTree.cxx.

References AddSimSnarl(), GuiTree::DeleteAllItems(), fTree, MomNavigator::GetFragment(), Mint::GetJint(), and Jint::GetMom().

Referenced by EVD::MCTreetext(), TestMCTree::SpawnMCTree(), and EVD::Update().

00034 {
00035     if (!fTree) return;
00036     fTree->DeleteAllItems();
00037 
00038     if (!mint) return;
00039     const MomNavigator* mom = mint->GetJint().GetMom();
00040     if (!mom) return;
00041 
00042     SimSnarlRecord* ssr = 
00043         dynamic_cast<SimSnarlRecord*>(mom->GetFragment("SimSnarlRecord"));
00044     if (!ssr) return;
00045 
00046     this->AddSimSnarl(ssr);
00047 }


Member Data Documentation

GuiTree* MCTree::fTree [private]

Definition at line 40 of file MCTree.h.

Referenced by AddSimSnarl(), and Update().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1