GfxMCVecList Class Reference

#include <GfxMCVecList.h>

Inheritance diagram for GfxMCVecList:
GfxBase

List of all members.

Public Member Functions

 GfxMCVecList ()
 ~GfxMCVecList ()
void Init (PageDisplay &pd, EVD &mp)
void Configure (Mint &mint)
GfxMCVecListCfgGetCfg ()
void Draw (Option_t *option="")
void ExecuteEvent (int event, int, int, GfxMCVec *MCVec)
void ExecuteEvent (int, int, int)
void HideVecs (bool hide=true)
bool VecsHidden ()

Private Types

typedef std::list< GfxMCVec * > MCVecList_t

Private Member Functions

 GfxMCVecList (const GfxMCVecList &rhs)
GfxMCVecListoperator= (const GfxMCVecList &rhs)
void ReConfigure ()
void ClearVecList ()

Private Attributes

GfxMCVecListCfgfCfg
SigC::Connection fCon
bool fHideVecs
EVDfEVD
PageDisplayfPageDisplay
TClonesArray * fVecsCA
MCVecList_t fVecs

Detailed Description

Id
GfxMCVecList.h,v 1.3 2003/08/22 16:47:10 musser Exp

Definition at line 27 of file GfxMCVecList.h.


Member Typedef Documentation

typedef std::list<GfxMCVec*> GfxMCVecList::MCVecList_t [private]

Definition at line 65 of file GfxMCVecList.h.


Constructor & Destructor Documentation

GfxMCVecList::GfxMCVecList (  ) 

Definition at line 31 of file GfxMCVecList.cxx.

References MuELoss::a, fCfg, fVecsCA, RecArrayAllocator::GetArray(), RecArrayAllocator::Instance(), GfxCfg::modified_signal, and ReConfigure().

00032     :fCfg(0)
00033       ,fHideVecs(false)
00034 {
00035     fCfg = new GfxMCVecListCfg();
00036     fCfg->modified_signal.connect
00037         (SigC::slot_class(*this,&GfxMCVecList::ReConfigure));
00038     //   pdg_kludge();
00039     RecArrayAllocator& a = RecArrayAllocator::Instance();
00040     fVecsCA = a.GetArray("GfxMCVec");
00041 } 

GfxMCVecList::~GfxMCVecList (  ) 
GfxMCVecList::GfxMCVecList ( const GfxMCVecList rhs  )  [private]

Member Function Documentation

void GfxMCVecList::ClearVecList (  )  [private]

Definition at line 134 of file GfxMCVecList.cxx.

References fVecs, and fVecsCA.

Referenced by Configure().

00135 {
00136     fVecs.clear();
00137     fVecsCA->Clear("C");
00138 }

void GfxMCVecList::Configure ( Mint  )  [virtual]

This is called every time the Mint object changes. The Gfx object should pull data from Mint to configure itself. Mint will exist for the lifetime of the Gfx object.

Reimplemented from GfxBase.

Definition at line 60 of file GfxMCVecList.cxx.

References ClearVecList(), fEVD, fHideVecs, RecDataRecord< T >::FindComponent(), fVecs, fVecsCA, TruthHelper::GetBestEventNeuMatch(), TruthHelper::GetBestSliceNeuMatch(), EVD::GetCandEvent(), EVD::GetCandSlice(), MomNavigator::GetFragment(), Mint::GetJint(), Jint::GetMom(), TruthHelper::GetNextNeuId(), and ReConfigure().

00061 {
00062 
00063     if (fVecs.size()) this->ClearVecList();
00064     if (fHideVecs) return;
00065     const MomNavigator* mom = mint.GetJint().GetMom();
00066     if (!mom) return;
00067     
00068     SimSnarlRecord* ssr = 
00069       dynamic_cast<SimSnarlRecord*>(mom->GetFragment("SimSnarlRecord"));
00070     if (!ssr) return;
00071       const TClonesArray* ctca = 
00072         dynamic_cast<const TClonesArray*>
00073         (ssr->FindComponent("TClonesArray","StdHep"));
00074     if (!ctca) return;
00075 
00076     float evntP=0;
00077     int ind, siz = ctca->GetEntriesFast();
00078     for (ind=0; ind < siz; ++ind) {
00079       TParticle* part = dynamic_cast<TParticle*>((*ctca)[ind]);
00080       if (!part) {
00081         cerr << "Non particle: " << (*ctca)[ind]->GetName() << endl;
00082         continue;
00083       }
00084      
00085       if(part->P()>evntP && part->P()<100.0 )evntP=part->P(); 
00086     }
00087     const CandSliceHandle * slc = fEVD->GetCandSlice();
00088     Int_t neuId= -1;
00089     Int_t nextneuId = -1;
00090     if(slc){
00091       CandSliceHandle slch = *slc;
00092       TruthHelper truthHelp(mom);
00093       neuId=truthHelp.GetBestSliceNeuMatch(slch);
00094       nextneuId=truthHelp.GetNextNeuId(neuId);
00095     }
00096     CandEventHandle * ev = fEVD->GetCandEvent();
00097     if(ev){
00098       TruthHelper truthHelp(mom);
00099       neuId=truthHelp.GetBestEventNeuMatch(*ev);
00100       nextneuId=truthHelp.GetNextNeuId(neuId);
00101     }
00102     for (ind=0; ind < siz; ++ind) {      
00103       TParticle* part = dynamic_cast<TParticle*>((*ctca)[ind]);
00104       if (!part) {
00105         cerr << "Non particle: " << (*ctca)[ind]->GetName() << endl;
00106         continue;
00107       }
00108       if(neuId<0 || (ind >=neuId && ind < nextneuId)){
00109         if(abs(part->GetPdgCode())<19 ||       // elementary particles
00110            abs(part->GetPdgCode())==211 ||    // charged pions
00111            abs(part->GetPdgCode())==2212      // proton
00112            ){
00113           int last = fVecsCA->GetLast()+1;
00114           new ((*fVecsCA)[last]) GfxMCVec(*part,evntP,*this);
00115           GfxMCVec* gs = dynamic_cast<GfxMCVec*>(fVecsCA->UncheckedAt(last));
00116           fVecs.push_back(gs);
00117         }
00118       }
00119     }
00120     this->ReConfigure();
00121 
00122 }

void GfxMCVecList::Draw ( Option_t *  option = ""  ) 

Definition at line 140 of file GfxMCVecList.cxx.

References fVecs, and it.

00141 {
00142 //    cerr << "GfxMCVecList::Draw("<<option<<")\n";
00143     for (MCVecList_t::iterator it=fVecs.begin(); it != fVecs.end(); ++it) {
00144         (*it)->Draw(option);
00145         
00146     }
00147 }

void GfxMCVecList::ExecuteEvent ( int  ,
int  ,
int   
) [inline]

Definition at line 41 of file GfxMCVecList.h.

00041 {;}

void GfxMCVecList::ExecuteEvent ( int  event,
int  ,
int  ,
GfxMCVec MCVec 
)

Definition at line 149 of file GfxMCVecList.cxx.

References Form(), GfxMCVec::GetParticle(), and GfxBase::text_info.

Referenced by GfxMCVec::ExecuteEvent().

00150 {
00151     switch (event) {
00152     case kMouseEnter: {
00153         text_info.emit(Form("%s: %s  P=%8.6f",
00154                             "MCVec", MCVec->GetParticle().GetName(),
00155                             MCVec->GetParticle().P()));
00156         break;
00157     }
00158     default: // nothing
00159         break;
00160     }
00161 
00162 }

GfxMCVecListCfg& GfxMCVecList::GetCfg (  )  [inline, virtual]

Return the configurable associated with this Gfx. Some things may be set which are meaningless for a particular Gfx. The sub class MUST implement this because there is no way to create the base class CfgConfigurable.

Implements GfxBase.

Definition at line 37 of file GfxMCVecList.h.

References fCfg.

00037 { return *fCfg; }

void GfxMCVecList::HideVecs ( bool  hide = true  ) 

Definition at line 166 of file GfxMCVecList.cxx.

References fEVD, fHideVecs, GfxBase::GetGraphicsView(), GraphicsView::kXY, ReConfigure(), and EVD::UpdateCanvas().

00167 {
00168     fHideVecs = hide;
00169     this->ReConfigure();
00170     if(GetGraphicsView()==GraphicsView::kXY)fEVD->UpdateCanvas();
00171 
00172 }

void GfxMCVecList::Init ( PageDisplay pd,
EVD mp 
) [virtual]

Reimplemented from GfxBase.

Definition at line 50 of file GfxMCVecList.cxx.

References fEVD, fPageDisplay, GfxBase::GetViewState(), ReConfigure(), and ViewState::spatial_metric.

00051 {
00052 
00053   fEVD= &mp;
00054   fPageDisplay= &pd;
00055   ViewState* vs = this->GetViewState();
00056   vs->spatial_metric.connect(slot_class(*this,&GfxMCVecList::ReConfigure));
00057 }

GfxMCVecList& GfxMCVecList::operator= ( const GfxMCVecList rhs  )  [private]
void GfxMCVecList::ReConfigure ( void   )  [private]

Definition at line 124 of file GfxMCVecList.cxx.

References fHideVecs, fVecs, and it.

Referenced by Configure(), GfxMCVecList(), HideVecs(), and Init().

00125 {
00126   if (fHideVecs) return;
00127   int ind=0;
00128     for (MCVecList_t::iterator it=fVecs.begin(); it != fVecs.end(); ++it) {
00129         (*it)->Configure(ind);
00130         ind++;
00131     }
00132 }

bool GfxMCVecList::VecsHidden (  )  [inline]

Definition at line 44 of file GfxMCVecList.h.

References fHideVecs.

00044 { return fHideVecs; }


Member Data Documentation

Definition at line 56 of file GfxMCVecList.h.

Referenced by GetCfg(), and GfxMCVecList().

SigC::Connection GfxMCVecList::fCon [private]

Definition at line 57 of file GfxMCVecList.h.

EVD* GfxMCVecList::fEVD [private]

Definition at line 61 of file GfxMCVecList.h.

Referenced by Configure(), HideVecs(), and Init().

bool GfxMCVecList::fHideVecs [private]

Definition at line 59 of file GfxMCVecList.h.

Referenced by Configure(), HideVecs(), ReConfigure(), and VecsHidden().

Definition at line 62 of file GfxMCVecList.h.

Referenced by Init().

Definition at line 66 of file GfxMCVecList.h.

Referenced by ClearVecList(), Configure(), Draw(), and ReConfigure().

TClonesArray* GfxMCVecList::fVecsCA [private]

Definition at line 64 of file GfxMCVecList.h.

Referenced by ClearVecList(), Configure(), GfxMCVecList(), and ~GfxMCVecList().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1