GfxTrackList Class Reference

#include <GfxTrackList.h>

Inheritance diagram for GfxTrackList:
GfxBase GfxBase

List of all members.

Public Member Functions

 GfxTrackList ()
 ~GfxTrackList ()
void Init (PageDisplay &pd, EVD &mp)
void Configure (Mint &mint)
GfxTrackListCfgGetCfg ()
void Draw (Option_t *option="")
void ExecuteEvent (int event, int, int, GfxTrack *track)
void ExecuteEvent (int, int, int)
void HideTracks (bool hide=true)
bool TracksHidden ()
EVDGetEVD ()
 GfxTrackList ()
 ~GfxTrackList ()
void Init (PageDisplay &pd, MultiPage &mp)
void Configure (Mint &mint)
GfxTrackListCfgGetCfg ()
void Draw (Option_t *option="")
void ExecuteEventTrack (int event, int px, int py, GfxTrack *track)

Private Types

typedef std::list< GfxTrack * > TrackList_t
typedef std::list< GfxTrackTrackList_t

Private Member Functions

 GfxTrackList (const GfxTrackList &rhs)
GfxTrackListoperator= (const GfxTrackList &rhs)
void ReConfigure ()
void ClearTrackList ()
 GfxTrackList (const GfxTrackList &rhs)
GfxTrackListoperator= (const GfxTrackList &rhs)
void ReConfigure ()
void ClearTrackList ()

Private Attributes

GfxTrackListCfgfCfg
SigC::Connection fCon
bool fHideTracks
EVDfEVD
PageDisplayfPageDisplay
TClonesArray * fTracksCA
TrackList_t fTracks

Detailed Description

Id
GfxTrackList.h,v 1.4 2003/10/23 19:50:21 musser Exp
Id
GfxTrackList.h,v 1.4 2003/05/02 17:58:45 bv Exp

Definition at line 29 of file EventDisplay/HEAD/GfxTrackList.h.


Member Typedef Documentation

typedef std::list<GfxTrack> GfxTrackList::TrackList_t [private]

Definition at line 53 of file Midad/HEAD/MultiPage/GfxTrackList.h.

typedef std::list<GfxTrack*> GfxTrackList::TrackList_t [private]

Definition at line 66 of file EventDisplay/HEAD/GfxTrackList.h.


Constructor & Destructor Documentation

GfxTrackList::GfxTrackList (  ) 

Definition at line 28 of file EventDisplay/HEAD/GfxTrackList.cxx.

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

00029     :fCfg(0)
00030       ,fHideTracks(false)
00031 {
00032     fCfg = new GfxTrackListCfg();
00033     fCfg->modified_signal.connect
00034         (SigC::slot_class(*this,&GfxTrackList::ReConfigure));
00035     RecArrayAllocator& a = RecArrayAllocator::Instance();
00036     fTracksCA = a.GetArray("GfxTrack");
00037 } 

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

Member Function Documentation

void GfxTrackList::ClearTrackList (  )  [private]
void GfxTrackList::ClearTrackList (  )  [private]

Definition at line 121 of file EventDisplay/HEAD/GfxTrackList.cxx.

References fTracks, and fTracksCA.

Referenced by Configure().

00122 {
00123     fTracks.clear();
00124     fTracksCA->Clear("C");
00125 }

void GfxTrackList::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.

void GfxTrackList::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 55 of file EventDisplay/HEAD/GfxTrackList.cxx.

References ClearTrackList(), fPageDisplay, fTracks, fTracksCA, EVD::GetCandEvent(), EVD::GetCandSlice(), CandHandle::GetDaughterIterator(), GetEVD(), CandFitTrackHandle::GetFinderTrack(), MomNavigator::GetFragment(), Mint::GetJobC(), CandEventHandle::GetLastTrack(), EVD::GetNumSlices(), RangeControl< TYPE >::GetRange(), GuiSlider::GetRangeCtrl(), PageDisplay::GetTimeSlider(), CandEventHandle::GetTrack(), Mint::GetTracks(), Range< TYPE >::InRange(), CandHandle::IsCloneOf(), JobC::Mom, ReConfigure(), and time_range().

00056 {
00057   this->ClearTrackList();
00058   CandRecord* crec = dynamic_cast<CandRecord*>
00059     (mint.GetJobC().Mom.GetFragment("CandRecord", "PrimaryCandidateRecord"));    
00060   if (!crec) return;
00061 
00062 
00063   
00064   // const CandTrackListHandle* ctlh = dynamic_cast<CandTrackListHandle*>(crec->FindCandHandle("CandFitTrackCamListHandle","CandFitTrackCamList"));
00065   CandTrackListHandle * ctlh = mint.GetTracks();
00066   if (!ctlh) return;
00067   RangeDouble& time_range = 
00068     fPageDisplay->GetTimeSlider().GetRangeCtrl().GetRange();
00069   TIter trackItr(ctlh->GetDaughterIterator());
00070   while (CandTrackHandle *cth = dynamic_cast<CandTrackHandle*>
00071          (trackItr())) {
00072     
00073     CandTrackHandle * findtrack=0;
00074     bool addtrack=true;
00075     if(GetEVD()->GetCandSlice()){
00076       CandSliceHandle slc1 =  *(GetEVD()->GetCandSlice());
00077       CandSliceHandle slc2;
00078       if(cth->GetCandSlice()) slc2=*(cth->GetCandSlice());
00079       if(slc1!=slc2 && !slc1.IsCloneOf(slc2)){
00080         addtrack=false;
00081       }
00082     }
00083     else if(GetEVD()->GetCandEvent()){
00084       addtrack=false;
00085       for( Int_t itrack=0;itrack<=GetEVD()->GetCandEvent()->GetLastTrack();itrack++){
00086         const CandFitTrackHandle *evtrack = dynamic_cast<const CandFitTrackHandle *>(GetEVD()->GetCandEvent()->GetTrack(itrack));
00087         findtrack=evtrack->GetFinderTrack();
00088         if(findtrack){
00089           if (*findtrack==*cth){
00090             addtrack=true;
00091             break;
00092           }
00093         }
00094         const CandTrackHandle *evtrackbase = dynamic_cast<const CandTrackHandle *>(evtrack);
00095         if(*evtrackbase==*cth){
00096           addtrack=true;
00097           break;
00098         }
00099       }
00100     }
00101     
00102     int last = fTracksCA->GetLast()+1;
00103     if(addtrack && (time_range.InRange(cth->GetVtxT()) || GetEVD()->GetNumSlices()<2) ){
00104       new ((*fTracksCA)[last]) GfxTrack(*cth,*this);
00105       GfxTrack* gs = dynamic_cast<GfxTrack*>(fTracksCA->UncheckedAt(last));
00106       fTracks.push_back(gs);
00107     }
00108   }
00109   this->ReConfigure();
00110 
00111 }

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

Definition at line 127 of file EventDisplay/HEAD/GfxTrackList.cxx.

References fTracks, EVD::GetDrawAll(), EVD::GetDrawGhosts(), GetEVD(), EVD::GetGhostColor(), and it.

00128 {
00129 //    cerr << "GfxTrackList::Draw("<<option<<")\n";
00130     for (TrackList_t::iterator it=fTracks.begin(); it != fTracks.end(); ++it) {
00131 
00132       if(GetEVD()->GetDrawAll() || ((*it)->GetColor()==GetEVD()->GetGhostColor() && GetEVD()->GetDrawGhosts()) || ((*it)->GetColor()!=GetEVD()->GetGhostColor() && GetEVD()->GetDrawGhosts())){
00133         (*it)->Draw(option);
00134       }
00135         
00136     }
00137 }

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

Definition at line 43 of file EventDisplay/HEAD/GfxTrackList.h.

00043 {;}

void GfxTrackList::ExecuteEvent ( int  event,
int  ,
int  ,
GfxTrack track 
)

Definition at line 139 of file EventDisplay/HEAD/GfxTrackList.cxx.

References Form(), CandTrackHandle::GetMomentum(), CandHandle::GetNDaughters(), GfxTrack::GetTrack(), and GfxBase::text_info.

Referenced by GfxTrack::ExecuteEvent().

00140 {
00141     switch (event) {
00142     case kMouseEnter: {
00143         const CandTrackHandle& cth = track->GetTrack();
00144         text_info.emit(Form("%s: %d strips, P=%.1f",
00145                             "track", cth.GetNDaughters(),
00146                             cth.GetMomentum()));
00147         break;
00148     }
00149     default: // nothing
00150         break;
00151     }
00152     
00153 }

void GfxTrackList::ExecuteEventTrack ( int  event,
int  px,
int  py,
GfxTrack track 
)

Definition at line 79 of file Midad/HEAD/MultiPage/GfxTrackList.cxx.

References Form(), CandTrackHandle::GetMomentum(), CandHandle::GetNDaughters(), GfxTrack::GetTrack(), and GfxBase::text_info.

00081 {
00082     switch (event) {
00083     case kMouseEnter: {
00084         const CandTrackHandle& cth = track->GetTrack();
00085         text_info.emit(Form("%s: %d strips, P=%.1f",
00086                             "track", cth.GetNDaughters(),
00087                             cth.GetMomentum()));
00088         break;
00089     }
00090     default: // nothing
00091         break;
00092     }
00093     
00094 }

GfxTrackListCfg& GfxTrackList::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 36 of file Midad/HEAD/MultiPage/GfxTrackList.h.

References fCfg.

00036 { return *fCfg; }

GfxTrackListCfg& GfxTrackList::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 39 of file EventDisplay/HEAD/GfxTrackList.h.

References fCfg.

00039 { return *fCfg; }

EVD* GfxTrackList::GetEVD (  )  [inline]

Definition at line 47 of file EventDisplay/HEAD/GfxTrackList.h.

References fEVD.

Referenced by GfxTrack::BuildDiscreteImp(), GfxTrack::BuildRealImp(), Configure(), Draw(), and GfxTrack::Paint().

00047 {return fEVD;}

void GfxTrackList::HideTracks ( bool  hide = true  ) 
void GfxTrackList::Init ( PageDisplay pd,
MultiPage mp 
) [virtual]

Reimplemented from GfxBase.

Definition at line 37 of file Midad/HEAD/MultiPage/GfxTrackList.cxx.

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

00038 {
00039     ViewState* vs = this->GetViewState();
00040     vs->spatial_metric.connect(slot_class(*this,&GfxTrackList::ReConfigure));
00041 }

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

Reimplemented from GfxBase.

Definition at line 46 of file EventDisplay/HEAD/GfxTrackList.cxx.

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

00047 {
00048 
00049   fEVD= &mp;
00050   fPageDisplay= &pd;
00051   ViewState* vs = this->GetViewState();
00052   vs->spatial_metric.connect(slot_class(*this,&GfxTrackList::ReConfigure));
00053 }

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

Definition at line 112 of file EventDisplay/HEAD/GfxTrackList.cxx.

References fHideTracks, fTracks, and it.

Referenced by Configure(), GfxTrackList(), HideTracks(), and Init().

00113 {
00114   if (fHideTracks) return;
00115 
00116     for (TrackList_t::iterator it=fTracks.begin(); it != fTracks.end(); ++it) {
00117         (*it)->Configure();
00118     }
00119 }

bool GfxTrackList::TracksHidden (  )  [inline]

Definition at line 46 of file EventDisplay/HEAD/GfxTrackList.h.

References fHideTracks.

00046 { return fHideTracks; }


Member Data Documentation

Definition at line 58 of file EventDisplay/HEAD/GfxTrackList.h.

Referenced by GetCfg(), and GfxTrackList().

SigC::Connection GfxTrackList::fCon [private]

Definition at line 59 of file EventDisplay/HEAD/GfxTrackList.h.

EVD* GfxTrackList::fEVD [private]

Definition at line 63 of file EventDisplay/HEAD/GfxTrackList.h.

Referenced by GetEVD(), HideTracks(), and Init().

bool GfxTrackList::fHideTracks [private]

Definition at line 61 of file EventDisplay/HEAD/GfxTrackList.h.

Referenced by HideTracks(), ReConfigure(), and TracksHidden().

Definition at line 64 of file EventDisplay/HEAD/GfxTrackList.h.

Referenced by Configure(), and Init().

Definition at line 67 of file EventDisplay/HEAD/GfxTrackList.h.

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

TClonesArray* GfxTrackList::fTracksCA [private]

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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1