#include <GfxMCVecList.h>
Inheritance diagram for GfxMCVecList:

Public Member Functions | |
| GfxMCVecList () | |
| ~GfxMCVecList () | |
| void | Init (PageDisplay &pd, EVD &mp) |
| void | Configure (Mint &mint) |
| GfxMCVecListCfg & | GetCfg () |
| 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) | |
| GfxMCVecList & | operator= (const GfxMCVecList &rhs) |
| void | ReConfigure () |
| void | ClearVecList () |
Private Attributes | |
| GfxMCVecListCfg * | fCfg |
| SigC::Connection | fCon |
| bool | fHideVecs |
| EVD * | fEVD |
| PageDisplay * | fPageDisplay |
| TClonesArray * | fVecsCA |
| MCVecList_t | fVecs |
Contact: bv@bnl.gov
Created on: Wed Oct 2 15:40:07 2002
Definition at line 27 of file GfxMCVecList.h.
|
|
Definition at line 65 of file GfxMCVecList.h. |
|
|
Definition at line 31 of file GfxMCVecList.cxx. References 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 }
|
|
|
Definition at line 43 of file GfxMCVecList.cxx. References fVecsCA, RecArrayAllocator::Instance(), and RecArrayAllocator::ReleaseArray(). 00044 {
00045 RecArrayAllocator& a = RecArrayAllocator::Instance();
00046 if (fVecsCA) { a.ReleaseArray(fVecsCA); fVecsCA = 0; }
00047 }
|
|
|
|
|
|
Definition at line 134 of file GfxMCVecList.cxx. References fVecs, and fVecsCA. Referenced by Configure().
|
|
|
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 abs(), ClearVecList(), fEVD, 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 }
|
|
|
Definition at line 140 of file GfxMCVecList.cxx. 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 }
|
|
||||||||||||||||
|
Definition at line 41 of file GfxMCVecList.h. 00041 {;}
|
|
||||||||||||||||||||
|
Definition at line 149 of file GfxMCVecList.cxx. References Form(), and GfxMCVec::GetParticle(). 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 }
|
|
|
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. 00037 { return *fCfg; }
|
|
|
Definition at line 166 of file GfxMCVecList.cxx. References fEVD, fHideVecs, GfxBase::GetGraphicsView(), ReConfigure(), and EVD::UpdateCanvas(). 00167 {
00168 fHideVecs = hide;
00169 this->ReConfigure();
00170 if(GetGraphicsView()==GraphicsView::kXY)fEVD->UpdateCanvas();
00171
00172 }
|
|
||||||||||||
|
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= ∓
00054 fPageDisplay= &pd;
00055 ViewState* vs = this->GetViewState();
00056 vs->spatial_metric.connect(slot_class(*this,&GfxMCVecList::ReConfigure));
00057 }
|
|
|
|
|
|
Definition at line 124 of file GfxMCVecList.cxx. References fVecs. 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 }
|
|
|
Definition at line 44 of file GfxMCVecList.h. 00044 { return fHideVecs; }
|
|
|
Definition at line 56 of file GfxMCVecList.h. Referenced by GfxMCVecList(). |
|
|
Definition at line 57 of file GfxMCVecList.h. |
|
|
Definition at line 61 of file GfxMCVecList.h. Referenced by Configure(), HideVecs(), and Init(). |
|
|
Definition at line 59 of file GfxMCVecList.h. Referenced by HideVecs(). |
|
|
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(). |
|
|
Definition at line 64 of file GfxMCVecList.h. Referenced by ClearVecList(), Configure(), GfxMCVecList(), and ~GfxMCVecList(). |
1.3.9.1