GfxStripList Class Reference

#include <GfxStripList.h>

Inheritance diagram for GfxStripList:
GfxBase GfxBase

List of all members.

Public Member Functions

 GfxStripList ()
 ~GfxStripList ()
void Init (PageDisplay &pd, EVD &mp)
void Configure (Mint &mint)
void Draw (Option_t *option="")
void ExecuteEvent (int event, int, int, GfxStrip *hit)
void ExecuteEvent (int, int, int)
GfxStripListCfgGetCfg ()
RangeDoubleGetColorRange ()
bool StripMasked (const CandStripHandle &csh) const
int GetStripColor (const CandStripHandle &csh) const
MintGetMint ()
EVDGetEVD ()
void HideStrips (bool hide=true)
bool StripsHidden ()
 GfxStripList ()
 ~GfxStripList ()
void Init (PageDisplay &pd, MultiPage &mp)
void Configure (Mint &mint)
void Draw (Option_t *option="")
void ExecuteEventStrip (int event, int px, int py, GfxStrip *hit)
GfxStripListCfgGetCfg ()
RangeDoubleGetColorRange ()
bool StripMasked (const CandStripHandle &csh) const
int GetStripColor (const CandStripHandle &csh) const
MintGetMint ()
void HideStrips (bool hide=true)
bool StripsHidden ()

Private Types

typedef std::vector< GfxStrip * > GfxStripVector_t
typedef std::vector< GfxStrip * > GfxStripVector_t

Private Member Functions

void ReConfigure (void)
void ClearStripList ()
void SetTQfromButton ()
void ReConfigure (void)
void ClearStripList ()
void SetTQfromButton ()

Private Attributes

GfxStripListCfgfCfg
SigC::Ptr< RangeDoublefColorRange
PageDisplayfPageDisplay
EVDfEVD
MintfMint
TClonesArray * fStripsCA
GfxStripVector_t fStrips
bool fHideStrips
MultiPagefMultiPage
TClonesArray * fStripCA

Detailed Description

Id
GfxStripList.h,v 1.4 2003/10/23 19:50:21 musser Exp
Id
GfxStripList.h,v 1.10 2005/07/21 20:26:36 bv Exp

Definition at line 36 of file EventDisplay/HEAD/GfxStripList.h.


Member Typedef Documentation

typedef std::vector<GfxStrip*> GfxStripList::GfxStripVector_t [private]

Definition at line 73 of file Midad/HEAD/MultiPage/GfxStripList.h.

typedef std::vector<GfxStrip*> GfxStripList::GfxStripVector_t [private]

Definition at line 75 of file EventDisplay/HEAD/GfxStripList.h.


Constructor & Destructor Documentation

GfxStripList::GfxStripList (  ) 

GfxStripList

Definition at line 51 of file EventDisplay/HEAD/GfxStripList.cxx.

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

00052     : fCfg(0)
00053     , fColorRange(0)
00054     , fEVD(0)
00055     , fMint(0)
00056     , fHideStrips(false)
00057 {
00058     fCfg = new GfxStripListCfg();
00059     fCfg->modified_signal.connect
00060         (slot_class(*this,&GfxStripList::ReConfigure));
00061         RecArrayAllocator& a = RecArrayAllocator::Instance();
00062       fStripsCA = a.GetArray("GfxStrip");
00063 }

GfxStripList::~GfxStripList (  ) 
GfxStripList::GfxStripList (  ) 
GfxStripList::~GfxStripList (  ) 

Member Function Documentation

void GfxStripList::ClearStripList (  )  [private]
void GfxStripList::ClearStripList (  )  [private]

Definition at line 155 of file EventDisplay/HEAD/GfxStripList.cxx.

References fStrips, and fStripsCA.

Referenced by Configure().

00156 {
00157     fStrips.clear();
00158     fStripsCA->Clear("C");
00159 }

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

References ClearStripList(), fHideStrips, fMint, fPageDisplay, fStrips, fStripsCA, GfxBase::GetPlaneView(), RangeControl< TYPE >::GetRange(), GuiSlider::GetRangeCtrl(), Mint::GetStrips(), PageDisplay::GetTimeSlider(), it, Msg::kVerbose, MSG, ReConfigure(), select_strip(), and time_range().

00098 {
00099     fMint = &mint;
00100     this->ClearStripList();
00101     if (fHideStrips) return;
00102     const CandStripListHandle* cslh = mint.GetStrips();
00103     if (!cslh) { 
00104       MSG("EVD",Msg::kVerbose) << "No CandStripList\n";
00105         return;
00106     }
00107 
00108     RangeDouble& time_range = 
00109         fPageDisplay->GetTimeSlider().GetRangeCtrl().GetRange();
00110  
00111     Mint::StripVector_t sv = CDL2STLvector<CandStripHandle>(*cslh);
00112 
00113     Mint::StripVector_t::iterator it, first = sv.begin(), middle, last = sv.end();
00114     Slot1<bool,const CandStripHandle*> s =
00115         bind(slot(select_strip),this->GetPlaneView(), &time_range);
00116     middle = std::partition(first,last,s);   
00117 
00118     for (it = first; it != middle; ++it) {
00119     
00120       bool addstrip=true;
00121       if(addstrip){
00122         int last = fStripsCA->GetLast()+1;
00123         new ((*fStripsCA)[last]) GfxStrip(**it,*this);     
00124         GfxStrip* gs = dynamic_cast<GfxStrip*>(fStripsCA->UncheckedAt(last));
00125         fStrips.push_back( gs);
00126       }
00127     }
00128     this->ReConfigure();
00129 }

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

Loop over our list and Draw them

Definition at line 142 of file EventDisplay/HEAD/GfxStripList.cxx.

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

00143 {
00145     GfxStripVector_t::iterator it, done = fStrips.end();
00146     for (it = fStrips.begin(); it != done; ++it) {
00147       if(GetEVD()->GetDrawAll() || GetEVD()->GetDrawGhosts()  || (*it)->GetColor()!=GetEVD()->GetGhostColor() ){
00148         (*it)->Draw(option);
00149       }
00150     }
00151 }

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

Definition at line 50 of file EventDisplay/HEAD/GfxStripList.h.

00050 {;}

void GfxStripList::ExecuteEvent ( int  event,
int  ,
int  ,
GfxStrip hit 
)

Definition at line 161 of file EventDisplay/HEAD/GfxStripList.cxx.

References DigitText::AddCandDigitText(), PlexStripEndId::AsString(), DigitText::Clear(), fEVD, fMint, Form(), fPageDisplay, CandStripHandle::GetBegTime(), TruthHelper::GetBestNeuMatch(), CandStripHandle::GetCharge(), EVD::GetDigitText(), PageDisplay::GetDigitText(), MomNavigator::GetFragment(), Mint::GetJobC(), CandStripHandle::GetNDigit(), CandStripHandle::GetPlane(), GfxStrip::GetStrip(), CandStripHandle::GetStripEndId(), CandStripHandle::GetTime(), JobC::Mom, Munits::ns, Mint::SetPickedStrip(), Mint::SetSelectedDigits(), and GfxBase::text_info.

Referenced by GfxStrip::ExecuteEvent().

00162 {
00163     switch (event) {
00164     case kMouseEnter: {
00165         const CandStripHandle& csh = gfx_strip->GetStrip();
00166         PlexStripEndId seid = csh.GetStripEndId();
00167         const char* s;
00168         SimSnarlRecord *ssr = 
00169           dynamic_cast<SimSnarlRecord*>(fMint->GetJobC().Mom.GetFragment("SimSnarlRecord"));
00170         if (ssr){
00171           TruthHelper truthHelp(&(fMint->GetJobC().Mom));
00172           s = Form("Strip:   (%s)  %d digit%s, plane=%d, demux charge=%.1f, t0=%.1f ns, <t>=%.1f ns,  Best NeuKin index match:%d", 
00173                                seid.AsString(),
00174                                csh.GetNDigit(), 
00175                                csh.GetNDigit() == 1 ? "" : "s",
00176                                csh.GetPlane(),
00177                                csh.GetCharge(), 
00178                                csh.GetBegTime()/Munits::ns, 
00179                                csh.GetTime()/Munits::ns,
00180                                truthHelp.GetBestNeuMatch(csh));
00181 
00182         }
00183         else{
00184           s = Form("Strip: %d digit%s, plane=%d, demux charge=%.1f, t0=%.1f ns, <t>=%.1f ns (%s)",
00185                                csh.GetNDigit(), csh.GetNDigit() == 1 ? "" : "s",
00186                                csh.GetPlane(),
00187                                csh.GetCharge(), csh.GetBegTime()/Munits::ns, 
00188                                csh.GetTime()/Munits::ns, seid.AsString());
00189         }
00190         text_info.emit(s);
00191 
00192         vector<const CandDigitHandle*> dv = CDL2STLvector<CandDigitHandle>(csh);
00193         int siz = dv.size();
00194         if (!siz) break;
00195 
00196         DigitText* dt = fPageDisplay->GetDigitText();
00197         if (dt) {
00198             dt->Clear();
00199             for (int ind=0; ind < siz; ++ind)
00200                 dt->AddCandDigitText(*dv[ind]);
00201         }
00202          DigitText* JAMdt = fEVD->GetDigitText();
00203         if (JAMdt) {
00204             JAMdt->Clear();
00205             for (int ind=0; ind < siz; ++ind)
00206                 JAMdt->AddCandDigitText(*dv[ind]);
00207         }
00208       if (fMint) {
00209             fMint->SetPickedStrip(csh);
00210             fMint->SetSelectedDigits(dv);
00211         }
00212         
00213         break;
00214     }
00215     default: // nothing
00216         break;
00217     }
00218 }

void GfxStripList::ExecuteEventStrip ( int  event,
int  px,
int  py,
GfxStrip hit 
)

Definition at line 143 of file Midad/HEAD/MultiPage/GfxStripList.cxx.

References DigitText::AddCandDigitText(), PlexStripEndId::AsString(), DigitText::Clear(), fMint, Form(), fPageDisplay, CandStripHandle::GetBegTime(), CandStripHandle::GetCharge(), PageDisplay::GetDigitText(), CandStripHandle::GetNDigit(), CandStripHandle::GetPlane(), GfxStrip::GetStrip(), CandStripHandle::GetStripEndId(), CandStripHandle::GetTime(), Munits::ns, Mint::SetPickedStrip(), Mint::SetSelectedDigits(), and GfxBase::text_info.

00145 {
00146     switch (event) {
00147     case kMouseEnter: {
00148         const CandStripHandle& csh = gfx_strip->GetStrip();
00149         PlexStripEndId seid = csh.GetStripEndId();
00150         const char* s = Form("Strip: %d digit%s, plane=%d, demux charge=%.1f, t0=%.1f ns, <t>=%.1f ns (%s)",
00151                              csh.GetNDigit(), csh.GetNDigit() == 1 ? "" : "s",
00152                              csh.GetPlane(),
00153                              csh.GetCharge(), csh.GetBegTime()/Munits::ns, 
00154                              csh.GetTime()/Munits::ns, seid.AsString());
00155         text_info.emit(s);
00156 
00157         vector<const CandDigitHandle*> dv = CDL2STLvector<CandDigitHandle>(csh);
00158         int siz = dv.size();
00159         if (!siz) break;
00160 
00161         DigitText* dt = fPageDisplay->GetDigitText();
00162         if (dt) {
00163             dt->Clear();
00164             for (int ind=0; ind < siz; ++ind)
00165                 dt->AddCandDigitText(*dv[ind]);
00166         }
00167         if (fMint) {
00168             fMint->SetPickedStrip(csh);
00169             fMint->SetSelectedDigits(dv);
00170         }
00171         
00172         break;
00173     }
00174     default: // nothing
00175         break;
00176     }
00177 }

GfxStripListCfg& GfxStripList::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 49 of file Midad/HEAD/MultiPage/GfxStripList.h.

References fCfg.

00049 { return *fCfg; }

GfxStripListCfg& GfxStripList::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 52 of file EventDisplay/HEAD/GfxStripList.h.

References fCfg.

Referenced by GfxStrip::ConfigGui(), GfxStrip::Configure(), GfxStrip::ModifyCoords(), and GfxStrip::Paint().

00052 { return *fCfg; }

RangeDouble& GfxStripList::GetColorRange (  )  [inline]

Definition at line 51 of file Midad/HEAD/MultiPage/GfxStripList.h.

References fColorRange.

00051 { return *fColorRange; }

RangeDouble& GfxStripList::GetColorRange (  )  [inline]

Definition at line 54 of file EventDisplay/HEAD/GfxStripList.h.

References fColorRange.

00054 { return *fColorRange; }

EVD* GfxStripList::GetEVD (  )  [inline]

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

References fEVD.

Referenced by Draw(), and GfxStrip::SetColor().

00058 {return fEVD;}

Mint& GfxStripList::GetMint (  )  [inline]

Definition at line 54 of file Midad/HEAD/MultiPage/GfxStripList.h.

References fMint.

00054 { return *fMint; }

Mint& GfxStripList::GetMint (  )  [inline]

Definition at line 57 of file EventDisplay/HEAD/GfxStripList.h.

References fMint.

Referenced by GfxStrip::GetRelativeValue().

00057 { return *fMint; }

int GfxStripList::GetStripColor ( const CandStripHandle csh  )  const
int GfxStripList::GetStripColor ( const CandStripHandle csh  )  const

Definition at line 241 of file EventDisplay/HEAD/GfxStripList.cxx.

References ViewState::color_is_charge, ViewState::color_is_time, fColorRange, CandStripHandle::GetCharge(), Rainbow::GetRelativeColor(), CandStripHandle::GetTime(), GfxBase::GetViewState(), and StripMasked().

Referenced by GfxStrip::SetColor().

00242 {
00243     if (!fColorRange) return false;
00244 
00245     static Rainbow rainbow;
00246 
00247     if (this->StripMasked(csh)) return 0;
00248 
00249     double val=0;
00250     switch (this->GetViewState()->GetColorSemantic()) {
00251     case ViewState::color_is_time:
00252         val = csh.GetTime();
00253         break;
00254     case ViewState::color_is_charge:
00255         val = csh.GetCharge();
00256         break;
00257     default:
00258         return 0;
00259         break;
00260     }
00261     return rainbow.GetRelativeColor(fColorRange->Relative(val));
00262 }

void GfxStripList::HideStrips ( bool  hide = true  ) 
void GfxStripList::HideStrips ( bool  hide = true  ) 
void GfxStripList::Init ( PageDisplay pd,
MultiPage mp 
) [virtual]
void GfxStripList::Init ( PageDisplay pd,
EVD mp 
) [virtual]
void GfxStripList::ReConfigure ( void   )  [private]
void GfxStripList::ReConfigure ( void   )  [private]

Definition at line 131 of file EventDisplay/HEAD/GfxStripList.cxx.

References done(), fHideStrips, fMint, fStrips, and it.

Referenced by Configure(), GfxStripList(), HideStrips(), and Init().

00132 {
00133     if (!fMint) return;
00134 
00135     if (fHideStrips) return;
00136 
00137     // configure all GfxStrips
00138     GfxStripVector_t::iterator it, done = fStrips.end();
00139     for (it = fStrips.begin(); it != done; ++it) (*it)->Configure();
00140 }

void GfxStripList::SetTQfromButton (  )  [private]
void GfxStripList::SetTQfromButton (  )  [private]
bool GfxStripList::StripMasked ( const CandStripHandle csh  )  const
bool GfxStripList::StripMasked ( const CandStripHandle csh  )  const

Definition at line 220 of file EventDisplay/HEAD/GfxStripList.cxx.

References ViewState::color_is_charge, ViewState::color_is_time, fColorRange, CandStripHandle::GetCharge(), CandStripHandle::GetTime(), and GfxBase::GetViewState().

Referenced by GetStripColor().

00221 {
00222     if (!fColorRange) return false;
00223 
00224     double val=0;
00225     switch (this->GetViewState()->GetColorSemantic()) {
00226     case ViewState::color_is_time:
00227         val = csh.GetTime();
00228         break;
00229     case ViewState::color_is_charge:
00230         val = csh.GetCharge();
00231         break;
00232     default:
00233         return false;
00234         break;
00235     }
00236 
00237     bool ret = fColorRange->InRange(val);
00238     return !ret;
00239 }

bool GfxStripList::StripsHidden (  )  [inline]

Definition at line 57 of file Midad/HEAD/MultiPage/GfxStripList.h.

References fHideStrips.

00057 { return fHideStrips; }

bool GfxStripList::StripsHidden (  )  [inline]

Definition at line 60 of file EventDisplay/HEAD/GfxStripList.h.

References fHideStrips.

00060 { return fHideStrips; }


Member Data Documentation

Definition at line 68 of file EventDisplay/HEAD/GfxStripList.h.

Referenced by GetCfg(), and GfxStripList().

SigC::Ptr< RangeDouble > GfxStripList::fColorRange [private]

Definition at line 70 of file EventDisplay/HEAD/GfxStripList.h.

Referenced by GetColorRange(), GetStripColor(), Init(), and StripMasked().

EVD* GfxStripList::fEVD [private]

Definition at line 72 of file EventDisplay/HEAD/GfxStripList.h.

Referenced by ExecuteEvent(), GetEVD(), HideStrips(), and Init().

bool GfxStripList::fHideStrips [private]

Definition at line 78 of file EventDisplay/HEAD/GfxStripList.h.

Referenced by Configure(), HideStrips(), ReConfigure(), and StripsHidden().

Definition at line 69 of file Midad/HEAD/MultiPage/GfxStripList.h.

Referenced by Init().

Definition at line 71 of file EventDisplay/HEAD/GfxStripList.h.

Referenced by Configure(), ExecuteEvent(), ExecuteEventStrip(), and Init().

TClonesArray* GfxStripList::fStripCA [private]

Definition at line 72 of file Midad/HEAD/MultiPage/GfxStripList.h.

Definition at line 76 of file EventDisplay/HEAD/GfxStripList.h.

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

TClonesArray* GfxStripList::fStripsCA [private]

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1