MCText Class Reference

#include <MCText.h>

List of all members.

Public Member Functions

 MCText (GuiTextView *gtv)
 ~MCText ()
void Update (Mint *mint)

Private Member Functions

void AddSimSnarl (SimSnarlRecord *ssr)

Private Attributes

GuiTextViewfText

Detailed Description

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

Definition at line 26 of file MCText.h.


Constructor & Destructor Documentation

MCText::MCText ( GuiTextView gtv  ) 

Definition at line 26 of file MCText.cxx.

References fText, and pdg_kludge().

00027     : fText(gtv)
00028 {
00029     const_cast<TGWindow*>(fText->GetParent())->Resize(750,250);
00030 
00031     pdg_kludge();
00032 }

MCText::~MCText (  ) 

Definition at line 33 of file MCText.cxx.

00034 {
00035     cerr << "MCText::~MCText()\n";
00036 }


Member Function Documentation

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

Definition at line 65 of file MCText.cxx.

References REROOT_NeuKin::A(), VldContext::AsString(), REROOT_NeuKin::EMFrac(), RecDataRecord< T >::FindComponent(), Form(), fText, GuiBase::GetName(), RecDataHeader::GetRun(), SimSnarlRecord::GetSimSnarlHeader(), RecPhysicsHeader::GetSnarl(), RecDataHeader::GetSubRun(), RecHeader::GetVldContext(), REROOT_NeuKin::IAction(), REROOT_NeuKin::IBoson(), REROOT_NeuKin::ID(), REROOT_NeuKin::INu(), REROOT_NeuKin::IResonance(), REROOT_NeuKin::ITg(), REROOT_NeuKin::P4El1(), REROOT_NeuKin::P4Mu1(), REROOT_NeuKin::P4Neu(), REROOT_NeuKin::P4Shw(), REROOT_NeuKin::Q2(), REROOT_NeuKin::Sigma(), REROOT_NeuKin::W2(), REROOT_NeuKin::X(), REROOT_NeuKin::Y(), and REROOT_NeuKin::Z().

Referenced by Update().

00066 {
00067     const SimSnarlHeader* ssh = ssr->GetSimSnarlHeader();
00068     if (!ssh) return;
00069 
00070     const REROOT_NeuKin* kin = 
00071         dynamic_cast<const REROOT_NeuKin*>
00072         (ssr->FindComponent("REROOT_NeuKin"));
00073     if (!kin) return;
00074 
00075     const TClonesArray* ctca = 
00076         dynamic_cast<const TClonesArray*>
00077         (ssr->FindComponent("TClonesArray","StdHep"));
00078     if (!ctca) return;
00079 
00080     fText->AddLine(ssh->GetVldContext().AsString());
00081     fText->AddLine(Form("Run=%d Sub=%d Snarl=%d",
00082                         ssh->GetRun(), ssh->GetSubRun(), ssh->GetSnarl()));
00083     string reaction;
00084     int ind, siz = ctca->GetEntriesFast();
00085     for (ind=0; ind < siz; ++ind) {
00086         TParticle* part = dynamic_cast<TParticle*>((*ctca)[ind]);
00087         if (!part) {
00088             cerr << "Non particle: " << (*ctca)[ind]->GetName() << endl;
00089             continue;
00090         }
00091         if (part->GetFirstMother() != -1) continue;
00092 
00093         if (ind == 1 || ind > 2) reaction += " + ";
00094         if (ind == 2) reaction += " --> ";
00095         reaction += part->GetName();
00096     }
00097     fText->AddLine(reaction.c_str());
00098 
00099     fText->AddLine(Form("kin: id=%d nu=%d targ=%d(A=%.1f,Z=%.1f)",
00100                         kin->ID(), kin->INu(), kin->ITg(), kin->A(), kin->Z()));
00101     fText->AddLine(Form("     boson=%d res=%d act=%d",
00102                         kin->IBoson(), kin->IResonance(), kin->IAction()));
00103     fText->AddLine(Form("     X=%8.6f Y=%8.6f EMFrac=%8.6f Q2=%8.6f W2=%8.6f",
00104                         kin->X(), kin->Y(), kin->EMFrac(), kin->Q2(), kin->W2()));
00105     fText->AddLine(Form("     Pnu=(%8.6f %8.6f %8.6f %8.6f), xsec=%8.6f",
00106                         kin->P4Neu()[0],kin->P4Neu()[1],kin->P4Neu()[2],kin->P4Neu()[3],
00107                         kin->Sigma()));
00108     fText->AddLine(Form("     Pshw=(%8.6f %8.6f %8.6f %8.6f)",
00109                         kin->P4Shw()[0],kin->P4Shw()[1],kin->P4Shw()[2],kin->P4Shw()[3]));
00110     fText->AddLine(Form("     Pmu1=(%8.6f %8.6f %8.6f %8.6f)",
00111                         kin->P4Mu1()[0],kin->P4Mu1()[1],kin->P4Mu1()[2],kin->P4Mu1()[3]));
00112     fText->AddLine(Form("     Pel1=(%8.6f %8.6f %8.6f %8.6f)",
00113                         kin->P4El1()[0],kin->P4El1()[1],kin->P4El1()[2],kin->P4El1()[3]));
00114 
00115 }

void MCText::Update ( Mint mint  ) 

Definition at line 38 of file MCText.cxx.

References AddSimSnarl(), fText, MomNavigator::GetFragment(), Mint::GetJint(), and Jint::GetMom().

Referenced by EVD::MCtext(), and EVD::Update().

00039 {
00040     if (!fText) return;
00041     fText->Clear();
00042 
00043     if (!mint) {
00044         fText->AddLine("No Mint Object!");
00045         return;
00046     }
00047     const MomNavigator* mom = mint->GetJint().GetMom();
00048     if (!mom) {
00049         fText->AddLine("No MomNavigator Object!");
00050         return;
00051     }
00052 
00053     SimSnarlRecord* ssr = 
00054         dynamic_cast<SimSnarlRecord*>(mom->GetFragment("SimSnarlRecord"));
00055     if (!ssr) {
00056         fText->AddLine("No SimSnarlRecord!");
00057         fText->AddLine("Make sure either ReRootToTruthModule::Get is in your path");
00058         fText->AddLine("or the file has SimSnarls and SimSnarl streams are on");
00059         return;
00060     }
00061 
00062     this->AddSimSnarl(ssr);
00063 }


Member Data Documentation

Definition at line 40 of file MCText.h.

Referenced by AddSimSnarl(), MCText(), and Update().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1