GfxShowerList Class Reference

#include <GfxShowerList.h>

Inheritance diagram for GfxShowerList:
GfxBase

List of all members.

Public Member Functions

 GfxShowerList ()
 ~GfxShowerList ()
void Init (PageDisplay &pd, EVD &mp)
void Configure (Mint &mint)
GfxShowerListCfgGetCfg ()
void Draw (Option_t *option="")
void ExecuteEvent (int event, int, int, GfxShower *shower)
void ExecuteEvent (int, int, int)
EVDGetEVD ()
void HideShowers (bool hide=true)
bool ShowersHidden ()

Private Types

typedef std::list< GfxShower * > ShowerList_t

Private Member Functions

 GfxShowerList (const GfxShowerList &rhs)
GfxShowerListoperator= (const GfxShowerList &rhs)
void ReConfigure ()
void ClearShowerList ()

Private Attributes

GfxShowerListCfgfCfg
SigC::Connection fCon
bool fHideShowers
EVDfEVD
PageDisplayfPageDisplay
TClonesArray * fShowerCA
ShowerList_t fShowers

Detailed Description

Id
GfxShowerList.h,v 1.4 2003/10/23 19:50:21 musser Exp

Definition at line 29 of file GfxShowerList.h.


Member Typedef Documentation

typedef std::list<GfxShower*> GfxShowerList::ShowerList_t [private]

Definition at line 66 of file GfxShowerList.h.


Constructor & Destructor Documentation

GfxShowerList::GfxShowerList (  ) 

Definition at line 28 of file GfxShowerList.cxx.

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

00029     :fCfg(0)
00030      ,fHideShowers(false)
00031 {
00032     fCfg = new GfxShowerListCfg();
00033     fCfg->modified_signal.connect
00034         (SigC::slot_class(*this,&GfxShowerList::ReConfigure));
00035     RecArrayAllocator& a = RecArrayAllocator::Instance();
00036     fShowerCA = a.GetArray("GfxShower");
00037 } 

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

Member Function Documentation

void GfxShowerList::ClearShowerList (  )  [private]

Definition at line 112 of file GfxShowerList.cxx.

References fShowerCA, and fShowers.

Referenced by Configure().

00113 {
00114 
00115     fShowers.clear();
00116     fShowerCA->Clear("C");
00117 }

void GfxShowerList::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 GfxShowerList.cxx.

References ClearShowerList(), fPageDisplay, fShowerCA, fShowers, EVD::GetCandEvent(), EVD::GetCandSlice(), CandRecoHandle::GetCandSlice(), GetEVD(), CandEventHandle::GetLastShower(), EVD::GetNumSlices(), RangeControl< TYPE >::GetRange(), GuiSlider::GetRangeCtrl(), CandEventHandle::GetShower(), Mint::GetShowers(), PageDisplay::GetTimeSlider(), Range< TYPE >::InRange(), CandHandle::IsCloneOf(), ReConfigure(), and time_range().

00056 {
00057 
00058   
00059   this->ClearShowerList();
00060   const CandShowerListHandle* ctlh = mint.GetShowers();
00061   if (!ctlh) return;  
00062 
00063   Mint::ShowerVector_t tv = CDL2STLvector<CandShowerHandle>(*ctlh);
00064   RangeDouble& time_range = 
00065         fPageDisplay->GetTimeSlider().GetRangeCtrl().GetRange();
00066 
00067   if (fShowers.size()) this->ClearShowerList();
00068 
00069   int siz = tv.size();
00070   for (int ind = 0; ind < siz; ++ind) {
00071 
00072     const CandShowerHandle & csh=*tv[ind];
00073     bool addshower=true;
00074     if(GetEVD()->GetCandSlice()){
00075       CandSliceHandle slc1 =  *(GetEVD()->GetCandSlice());
00076       CandSliceHandle slc2;
00077       if(csh.GetCandSlice()) slc2=*(csh.GetCandSlice());
00078       if(slc1!=slc2 && !slc1.IsCloneOf(slc2)){
00079         addshower=false;
00080       }
00081     }
00082     else  if(GetEVD()->GetCandEvent()){
00083       addshower=false;
00084       for( Int_t ishower=0;ishower<=GetEVD()->GetCandEvent()->GetLastShower();ishower++){
00085         const CandShowerHandle *evshower = dynamic_cast<const CandShowerHandle *>(GetEVD()->GetCandEvent()->GetShower(ishower));
00086         if (*evshower==csh){
00087                 addshower=true;
00088                 break;
00089         }
00090       }
00091     }
00092 
00093     int last = fShowerCA->GetLast()+1;
00094     if(addshower && time_range.InRange(tv[ind]->GetVtxT())|| GetEVD()->GetNumSlices()<2){
00095       new ((*fShowerCA)[last]) GfxShower(*tv[ind],*this);
00096       GfxShower* gs = dynamic_cast<GfxShower*>(fShowerCA->UncheckedAt(last));
00097       fShowers.push_back( gs);
00098     }
00099   }
00100 
00101   this->ReConfigure();
00102 
00103 }

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

Definition at line 119 of file GfxShowerList.cxx.

References fShowers, and it.

00120 {
00121 //    cerr << "GfxShowerList::Draw("<<option<<")\n";
00122   Int_t nshower =0;
00123     for (ShowerList_t::iterator it=fShowers.begin(); it != fShowers.end(); ++it) {
00124         (*it)->Draw(option);
00125         nshower ++;
00126     }
00127 }

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

Definition at line 43 of file GfxShowerList.h.

00043 {;}

void GfxShowerList::ExecuteEvent ( int  event,
int  ,
int  ,
GfxShower shower 
)

Definition at line 129 of file GfxShowerList.cxx.

References Form(), CandRecoHandle::GetCharge(), CandShowerHandle::GetEnergy(), CandHandle::GetNDaughters(), GfxShower::GetShower(), CalStripType::kPE, and GfxBase::text_info.

Referenced by GfxShower::ExecuteEvent().

00130 {
00131     switch (event) {
00132     case kMouseEnter: {
00133 
00134 
00135       const CandShowerHandle & csh = shower->GetShower();
00136 
00137       text_info.emit(Form("%s: %d strips, PE sum=%.1f   Energy=%.1f",
00138                           "shower", csh.GetNDaughters(),
00139                           csh.GetCharge(CalStripType::kPE),
00140                           csh.GetEnergy()));
00141       break;
00142     }
00143     default: // nothing
00144         break;
00145     }
00146     
00147 }

GfxShowerListCfg& GfxShowerList::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 GfxShowerList.h.

References fCfg.

00039 { return *fCfg; }

EVD* GfxShowerList::GetEVD (  )  [inline]

Definition at line 44 of file GfxShowerList.h.

References fEVD.

Referenced by GfxShower::BuildDiscreteImp(), GfxShower::BuildRealImp(), and Configure().

00044 {return fEVD;}

void GfxShowerList::HideShowers ( bool  hide = true  ) 

Definition at line 149 of file GfxShowerList.cxx.

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

00150 {
00151     fHideShowers = hide;
00152     this->ReConfigure();
00153     if(GetGraphicsView()==GraphicsView::kXY)fEVD->UpdateCanvas();
00154 }

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

Reimplemented from GfxBase.

Definition at line 46 of file GfxShowerList.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,&GfxShowerList::ReConfigure));
00053 }

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

Definition at line 104 of file GfxShowerList.cxx.

References fHideShowers, fShowers, and it.

Referenced by Configure(), GfxShowerList(), HideShowers(), and Init().

00105 {
00106     for (ShowerList_t::iterator it=fShowers.begin(); it != fShowers.end(); ++it) {
00107       if (fHideShowers) return;
00108         (*it)->Configure();
00109     }
00110 }

bool GfxShowerList::ShowersHidden (  )  [inline]

Definition at line 47 of file GfxShowerList.h.

References fHideShowers.

00047 { return fHideShowers; }


Member Data Documentation

Definition at line 58 of file GfxShowerList.h.

Referenced by GetCfg(), and GfxShowerList().

SigC::Connection GfxShowerList::fCon [private]

Definition at line 59 of file GfxShowerList.h.

Definition at line 62 of file GfxShowerList.h.

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

Definition at line 60 of file GfxShowerList.h.

Referenced by HideShowers(), ReConfigure(), and ShowersHidden().

Definition at line 63 of file GfxShowerList.h.

Referenced by Configure(), and Init().

TClonesArray* GfxShowerList::fShowerCA [private]

Definition at line 65 of file GfxShowerList.h.

Referenced by ClearShowerList(), Configure(), GfxShowerList(), and ~GfxShowerList().

Definition at line 67 of file GfxShowerList.h.

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


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1