EVD Class Reference

#include <EVD.h>

Inheritance diagram for EVD:
CanvasPage PageABC

List of all members.

Classes

struct  GfxInfo

Public Member Functions

 EVD ()
 ~EVD ()
void AddGfx (const char *gfx_name)
TObject * Init (Mint *mint, PageDisplay *pd, GuiBox &box)
void BlockRanges (bool tf=true)
void Clear (void)
void Update ()
 Implement to respond to a change in the data.
void Unzoom (void)
void Rezoom (void)
void FullZoom (void)
void redo (void)
RangeControl< double > GetColorRangeControl (PlaneView::PlaneView_t view)
ViewStateGetViewState (PlaneView::PlaneView_t view)
void InitChargeHists (TCanvas &canvas)
void UpdateCanvas ()
void UpdateChargeHists (GraphicsView::GraphicsView_t view)
void UpdateTime ()
void NextSlice ()
void PrevSlice ()
void NextEvent ()
void PrevEvent ()
void ZoomTimetoSlice ()
Int_t GetNumSlices ()
Int_t GetNumEvents ()
Int_t GetGhostColor ()
Bool_t GetDrawAll ()
Bool_t GetDrawGhosts ()
CandSliceHandleReadCandSlice ()
CandSliceHandleGetCandSlice ()
CandEventHandleReadCandEvent ()
CandEventHandleGetCandEvent ()
void MCtext ()
void Recotext ()
void Digittext ()
void MCTreetext ()
void UpdateSummary ()
int ViewIndex (GraphicsView::GraphicsView_t view)
void UpdateGfxObjects (GraphicsView::GraphicsView_t view)
DisplayOptionsGetDisplayOptions ()
PageDisplayGetPageDisplay ()
DigitTextGetDigitText ()

Private Types

typedef std::map< GfxBase
*, GfxInfo
GfxList

Private Member Functions

void SelectionZoom (ZoomPad *zp)
void UpdateView (GraphicsView::GraphicsView_t view)
void InitView (GraphicsView::GraphicsView_t view)
void BuildMenus (void)
void BuildButtons ()
void BuildGfxMenu ()
void ToggleRealCoords (GuiMenu *menu, GuiMenu::GuiMenuList::iterator mit)
void ToggleTimeZoom (GuiMenu *menu, GuiMenu::GuiMenuList::iterator mit)
void ColorSemanticHandler (int which)
void SetChargeRange ()
void DrawVS ()
void UpdateColorButtonTitle ()
void PrintCanvas ()
void RefreshUserHist ()
void FillTimevsY ()

Private Attributes

PageDisplayfPageDisplay
MintfMint
RecoTextfRecoText
MCTextfMCText
MCTreefMCTree
DigitTextfDigitText
GuiTextViewfMCtextbox
GuiTextViewfRecotextbox
GuiTextViewfMCTreetextbox
GuiTextViewfDigittextbox
GuiScrolledfMCTreescroll
GuiBoxfTextBox
GuiTextButtonfMCbut
GuiTextButtonfRecobut
GuiTextButtonfMCTreebut
GuiTextButtonfDigitbut
GuiTextButtonfNextSlicebut
GuiTextButtonfPrevSlicebut
GuiTextButtonfNextEventbut
GuiTextButtonfPrevEventbut
TText * tline [100]
UserHistfUserHist
RangeDoublefChargeRange
SigC::Ptr< ViewStatefViewState [3]
SigC::Ptr< GfxButtonfColorButton [2]
GfxList fGfxList
ZoomPadfPad [3]
TPad * TimePad
TPad * TimevsYPad
TPad * TextPad
TimeHistTimeHst
AltTimeHistAltTImeHst
TGraph * TimevsY
TPad * chargepad [3]
TH1F * fChargeHist [3]
THStack * fRecoChargeHist [3]
TH1F * fShwRecoChargeHist [3]
TH1F * fTrkRecoChargeHist [3]
ColorAxisfColorAxis [2]
RangeAxisfRangeAxis [5]
RangeControl< double > * fColorControl [2]
RangeControl< double > * fSpatialControl [5]
SigC::Ptr< UndoHistoryfZoomHistory
SigC::Ptr< CompositeRange
< double > > 
fCompositeRange
std::vector< SigC::Connection > fRClist
TPolyLine * SM1 [2]
TPolyLine * SM2 [2]
TPolyLine * Det [2]
SteelOutlineOutline
TList * VS
DisplayOptionsfDisplayOptions
Int_t fSlice
Int_t fNumSlices
Int_t fEvent
Int_t fNumEvents
Int_t fSnarl
Int_t fGhostColor
CandEventHandlefCandEvent
CandSliceHandlefCandSlice
Bool_t fClear
Bool_t fDrawAll
Bool_t fDrawGhosts
Int_t fLastButtonType
Bool_t fTimeZoom

Detailed Description

Id
EVD.h,v 1.10 2004/07/10 19:50:52 musser Exp

Definition at line 85 of file EVD.h.


Member Typedef Documentation

typedef std::map<GfxBase*,GfxInfo> EVD::GfxList [private]

Definition at line 138 of file EVD.h.


Constructor & Destructor Documentation

EVD::EVD (  ) 

Definition at line 91 of file EVD.cxx.

00092   : fPageDisplay(0)
00093     , fMint(0)
00094     , fRecoText(0)
00095     , fMCText(0)
00096     , fMCTree(0)
00097     , fDigitText(0)
00098     , fMCtextbox(0)
00099     , fRecotextbox(0) 
00100     , fMCTreetextbox(0) 
00101     , fDigittextbox(0)
00102     , fMCTreescroll(0)
00103     , fTextBox(0)  
00104     , fMCbut(0)
00105     , fRecobut(0)
00106     , fMCTreebut(0)
00107     , fDigitbut(0)
00108     , fZoomHistory(0)
00109     , fCompositeRange(0)
00110     , fSlice(-1)
00111     , fNumSlices(-1)
00112     , fEvent(-1)
00113     , fNumEvents(-1)
00114     , fSnarl(-1)
00115     , fGhostColor(kGhostColor)
00116     , fClear(false)
00117     , fDrawAll(true)
00118     , fDrawGhosts(false)
00119     , fLastButtonType(0)
00120     , fTimeZoom(false)
00121 {
00122     fZoomHistory = manage(new UndoHistory);
00123     fCompositeRange = manage(new CompositeRange<double>);
00124 }

EVD::~EVD (  ) 

Definition at line 126 of file EVD.cxx.

00127 {
00128 }


Member Function Documentation

void EVD::AddGfx ( const char *  gfx_name  ) 

Definition at line 600 of file EVD.cxx.

References GfxProxyBase::Create(), fGfxList, fPad, fPageDisplay, fViewState, NamedFactory::GetProxy(), GfxBase::Init(), NamedFactory::Instance(), PlaneView::kU, GraphicsView::kUZ, PlaneView::kV, GraphicsView::kVZ, GraphicsView::kXY, GfxBase::SetGraphicsView(), GfxBase::SetPad(), GfxBase::SetPlaneView(), GfxBase::SetViewState(), PageDisplay::StatusBar(), GfxBase::text_info, and Update().

Referenced by EVDObject::AddGfx(), Init(), and InitView().

00601 {
00602 
00603   /* 
00604      Adds a graphics object  to each of the the three views.  Currently,
00605      the XY view does not support the display of CandDigits or CandStrips,
00606      only tracks, showers, and MC vectors.
00607   */
00608 
00609     GfxProxyBase* gpb = dynamic_cast<GfxProxyBase*>
00610         (NamedFactory::Instance("Gfx").GetProxy(gfx_name));
00611     if (!gpb) {
00612         cerr << "Failed to get " << gfx_name << " proxy\n";
00613         return;
00614     }
00615 
00616     GraphicsView::GraphicsView_t view[3];
00617     PlaneView::PlaneView_t pview[3];
00618   
00619     view[0]=GraphicsView::kUZ;
00620     view[1]=GraphicsView::kVZ;
00621     view[2]=GraphicsView::kXY;
00622     pview[0]=PlaneView::kU;
00623     pview[1]=PlaneView::kV;
00624     pview[2]=PlaneView::kV;
00625   
00626     TVirtualPad* old_pad = gPad;
00627     for (int ind = 0; ind < 3; ++ind) 
00628       {
00629         std::string gfx_name_string(gfx_name);
00630         if(view[ind]==GraphicsView::kUZ    || 
00631            view[ind]==GraphicsView::kVZ    ||
00632            gfx_name_string == "DigitList"  || 
00633            gfx_name_string == "TrackList"  || 
00634            gfx_name_string == "ShowerList" || 
00635            gfx_name_string == "MCVecList" )
00636           {
00637             fPad[ind]->cd();
00638             GfxBase* gfx_base = gpb->Create();
00639             if (!gfx_base) {
00640               cerr << "Failed to create " << gfx_name << endl;
00641               break;
00642             }    
00643             gfx_base->text_info.connect(slot_class(*fPageDisplay,
00644                                                    &PageDisplay::StatusBar));
00645             gfx_base->SetGraphicsView(view[ind]);
00646             gfx_base->SetPlaneView(pview[ind]);
00647             gfx_base->SetViewState(fViewState[ind]);
00648             gfx_base->SetPad(fPad[ind]);
00649             //      gfx_base->GetCfg().modified_signal.connect(slot_class(*this,&EVD::UpdateCanvas));
00650             gfx_base->Init(*fPageDisplay,*this);
00651             
00652             fGfxList[gfx_base] = GfxInfo(view[ind]);
00653           }
00654       }
00655     gPad = old_pad;
00656     this->Update();
00657 }

void EVD::BlockRanges ( bool  tf = true  ) 

Definition at line 811 of file EVD.cxx.

References fRClist.

Referenced by Clear(), ColorSemanticHandler(), FullZoom(), Rezoom(), SelectionZoom(), and Unzoom().

00812 {
00813   for (unsigned int ind = 0; ind < fRClist.size(); ++ind) 
00814     fRClist[ind].block(tf);
00815 }

void EVD::BuildButtons (  )  [private]

Definition at line 499 of file EVD.cxx.

References PageDisplay::AddButton(), GuiButtonBase::clicked, Digittext(), fDigitbut, fMCbut, fMCTreebut, fNextEventbut, fNextSlicebut, fPageDisplay, fRecobut, PageDisplay::FullZoom(), PageDisplay::GetButtonBox(), MCtext(), MCTreetext(), NextEvent(), NextSlice(), PrevEvent(), PrevSlice(), PrintCanvas(), Recotext(), PageDisplay::Rezoom(), and PageDisplay::Unzoom().

Referenced by Init().

00500 {
00501 
00502   GuiBox * gb = fPageDisplay->GetButtonBox();
00503  
00504   TGHorizontal3DLine * BigSep = new  TGHorizontal3DLine(gb,1,100); 
00505   TGHorizontal3DLine * Sep = new  TGHorizontal3DLine(gb,1,20);
00506 
00507   // add next/prev slice buttons
00508 
00509   fNextSlicebut = fPageDisplay->AddButton("Next Slice ");
00510   fNextSlicebut->clicked.connect(slot_class(*this,&EVD::NextSlice));
00511 
00512   fNextSlicebut = fPageDisplay->AddButton("Prev Slice ");
00513   fNextSlicebut->clicked.connect(slot_class(*this,&EVD::PrevSlice));
00514 
00515 
00516   // lots of work to add a space at the top of the button box
00517 
00518   TGFrameElement *nw = new TGFrameElement;
00519   nw->fFrame  = BigSep;
00520   TGLayoutHints * hint = new TGLayoutHints(kLHintsTop);  
00521   nw->fLayout = hint;
00522   nw->fState  = 1;
00523   gb->GetList()->AddFirst(nw);
00524 
00525   // this adds a space after the next/prev buttons
00526 
00527   gb->AddFrame(Sep);
00528  // add next/prev event buttons
00529 
00530   fNextEventbut = fPageDisplay->AddButton("Next Event ");
00531   fNextEventbut->clicked.connect(slot_class(*this,&EVD::NextEvent));
00532 
00533   fNextEventbut = fPageDisplay->AddButton("Prev Event ");
00534   fNextEventbut->clicked.connect(slot_class(*this,&EVD::PrevEvent));
00535  gb->AddFrame(Sep);
00536 
00537   // these are the user defined buttons
00538 
00539  
00540   fRecobut = fPageDisplay->AddButton("Reco Data");
00541   fRecobut->clicked.connect(slot_class(*this,&EVD::Recotext));
00542   
00543   fMCbut = fPageDisplay->AddButton("NeuKin");
00544   fMCbut->clicked.connect(slot_class(*this,&EVD::MCtext));
00545   
00546   fMCTreebut = fPageDisplay->AddButton("StdHep Tree");
00547   fMCTreebut->clicked.connect(slot_class(*this,&EVD::MCTreetext));
00548   
00549   fDigitbut = fPageDisplay->AddButton("Digit Data");
00550   fDigitbut->clicked.connect(slot_class(*this,&EVD::Digittext));
00551  
00552   gb->AddFrame(Sep);
00553 
00554   GuiTextButton * zoombut = fPageDisplay->AddButton("Zoom All");
00555   zoombut->clicked.connect(slot_class(*fPageDisplay,&PageDisplay::FullZoom));
00556   
00557   GuiTextButton * zoomredobut = fPageDisplay->AddButton("Zoom Redo");
00558   zoomredobut->clicked.connect(slot_class(*fPageDisplay,&PageDisplay::Rezoom));
00559 
00560   GuiTextButton * zoomundobut=  fPageDisplay->AddButton("Zoom Undo");
00561   zoomundobut->clicked.connect(slot_class(*fPageDisplay,&PageDisplay::Unzoom)); 
00562   gb->AddFrame(Sep); 
00563   GuiTextButton * printbut=  fPageDisplay->AddButton("Print");
00564   printbut->clicked.connect(slot_class(*this,&EVD::PrintCanvas));
00565 }

void EVD::BuildGfxMenu (  )  [private]

Definition at line 472 of file EVD.cxx.

References GuiMenu::Add(), GuiMenuBar::AddMenu(), done(), fPageDisplay, PageDisplay::GetMenuBar(), NamedFactory::GetProxy(), GfxProxyBase::GetRegisteredNames(), NamedFactory::Instance(), it, and GfxProxyBase::MakeMenu().

Referenced by Init().

00473 {
00474 
00475   GuiMenuBar& mb = fPageDisplay->GetMenuBar();
00476 
00477   list<const char*> gfx_names = GfxProxyBase::GetRegisteredNames();
00478   list<const char*>::iterator it, done = gfx_names.end();
00479   
00480   GuiMenu* pm = manage(new GuiMenu);
00481   mb.AddMenu(*pm,"Objects");
00482   
00483   NamedFactory& nf = NamedFactory::Instance("Gfx");
00484   for (it = gfx_names.begin(); it != done; ++it) {
00485     const char* name = *it;
00486     GfxProxyBase* gpb = dynamic_cast<GfxProxyBase*>(nf.GetProxy(name));
00487     if (!gpb) {
00488       cerr << "Failed to get GfxProxy for " << name << endl;
00489       continue;
00490     }
00491     GuiMenu * gfx_menu = gpb->MakeMenu(this);
00492     if (! gfx_menu) continue;
00493     gfx_menu = manage(gfx_menu);
00494     pm->Add(name, *gfx_menu);
00495     
00496   }  
00497 }

void EVD::BuildMenus ( void   )  [private]

Definition at line 430 of file EVD.cxx.

References GuiMenu::Add(), GuiMenuBar::AddMenu(), GuiMenu::CheckEntry(), fDisplayOptions, fPageDisplay, fTimeZoom, fViewState, PageDisplay::GetMenuBar(), ViewState::metric_is_continuous, DisplayOptions::OpenDialog(), GuiMenuBar::RemoveMenu(), ViewState::show_multiplex, ViewState::ShowMultiplex(), toggle_mux(), ViewState::ToggleMultiplex(), ToggleRealCoords(), and ToggleTimeZoom().

Referenced by Init().

00431 {
00432     GuiMenuBar& mb = fPageDisplay->GetMenuBar();
00433 
00434     mb.RemoveMenu("Zoom");
00435     mb.RemoveMenu("Pages");
00436     
00437     GuiMenu* options_menu = manage(new GuiMenu);
00438     mb.AddMenu(*options_menu,"Options");
00439 
00440     GuiMenu::GuiMenuList::iterator mit;
00441 
00442     // Whether to show multiplexing or not
00443     const char* mux_labels =      "Show AllMultiplex Digits";
00444     mit = options_menu->Add(mux_labels);
00445     for (int ind = 0; ind < 3; ++ind) {
00446         ViewState* vs = fViewState[ind];
00447         options_menu->CheckEntry(mit,vs->ShowMultiplex());
00448        (*mit)->Connect(slot(*vs,&ViewState::ToggleMultiplex));
00449         vs->show_multiplex.connect(bind(bind(bind(slot(toggle_mux),vs),mit),options_menu));
00450     }
00451 
00452     // Real or discrete coords.
00453     mit = options_menu->Add("Use Strip/Plane Coord.s");
00454     (*mit)->Connect(bind(slot_class(*this,&EVD::ToggleRealCoords),options_menu,mit));
00455     fViewState[2]->SetSpatialMetric(ViewState::metric_is_continuous);
00456 
00457   // Zoom to time window in slice or event view.
00458     mit = options_menu->Add("Zoom to Slice/Event Time Window");
00459     (*mit)->Connect(bind(slot_class(*this,&EVD::ToggleTimeZoom),options_menu,mit));
00460     fTimeZoom=false;
00461 
00462     mit = options_menu->Add("Display Settings");
00463     fDisplayOptions = new DisplayOptions(*fPageDisplay, *this);
00464     (*mit)->Connect(bind(slot_class(*fDisplayOptions,&DisplayOptions::OpenDialog),options_menu,mit));
00465 
00466 
00467     options_menu->Add(0);
00468  
00469 }

void EVD::Clear ( void   )  [virtual]

Implement to respond to a new record read in, the actual record is accessible in the subsequent Update() call.

Reimplemented from PageABC.

Definition at line 686 of file EVD.cxx.

References BlockRanges(), fClear, FullZoom(), and fZoomHistory.

Referenced by Init().

00687 {
00688     fZoomHistory->Clear();
00689     BlockRanges(true);
00690     fClear=true;
00691     FullZoom();
00692     BlockRanges(false);
00693 }

void EVD::ColorSemanticHandler ( int  which  )  [private]

Definition at line 1385 of file EVD.cxx.

References BlockRanges(), ViewState::color_is_charge, ViewState::color_is_time, fChargeRange, fColorAxis, fColorButton, fMint, fPad, fViewState, CanvasPage::GetCanvas(), GetDisplayOptions(), RangeAxis::GetRange(), Mint::GetTimeRange(), CalDigitType::kNone, CalDigitType::kPE, CalDigitType::kSigCorr, CalDigitType::kSigLin, Munits::ns, Range< TYPE >::SetFrom(), Range< TYPE >::SetMax(), Range< TYPE >::SetMin(), and ColorAxis::SetScale().

Referenced by Init(), Update(), and UpdateTime().

01386 {
01387 
01388   if (which < 0 || which > 2) return;
01389   
01390   GfxButton* but = fColorButton[which];
01391   
01392   RangeDouble& cr = fColorAxis[which]->GetRange();
01393   
01394   switch (fViewState[which]->GetColorSemantic()) {
01395   case ViewState::color_is_charge:
01396     if(GetDisplayOptions()->ChargeType()==CalDigitType::kNone){
01397       if(which==0){
01398         but->SetTitle("UZ ADC"); 
01399       }
01400       else{     
01401         but->SetTitle("VZ ADC");
01402       }
01403     }
01404     if(GetDisplayOptions()->ChargeType()==CalDigitType::kPE){
01405       if(which==0){
01406         but->SetTitle("UZ PE"); 
01407       }
01408       else{     
01409         but->SetTitle("VZ PE");
01410       }
01411     }
01412     if(GetDisplayOptions()->ChargeType()==CalDigitType::kSigLin){
01413       if(which==0){
01414         but->SetTitle("UZ SigLin"); 
01415       }
01416       else{     
01417         but->SetTitle("VZ SigLin");
01418       }
01419     }
01420     else if(GetDisplayOptions()->ChargeType()==CalDigitType::kSigCorr){
01421       if(which==0){
01422         but->SetTitle("UZ SigCor"); 
01423       }
01424       else{     
01425         but->SetTitle("VZ SigCor");
01426       }
01427     }
01428 
01429     fColorAxis[which]->SetScale(1.0);
01430     if(!GetDisplayOptions()->AutoScaleCharge()){
01431       BlockRanges(true);
01432       cr.SetMax(GetDisplayOptions()->ChargeMax());
01433       cr.SetMin(GetDisplayOptions()->ChargeMin());
01434       BlockRanges(false);
01435       }
01436       else{
01437         if(fChargeRange)cr.SetFrom(*fChargeRange);
01438       } 
01439     break;
01440   case ViewState::color_is_time:
01441     but->SetTitle("time");
01442     fColorAxis[which]->SetScale(Munits::ns);
01443     cr.SetFrom(fMint->GetTimeRange());   
01444     break;
01445   default:
01446     break;
01447   }
01448   fPad[which]->Modified();
01449   this->GetCanvas().Modified();
01450   but->Modified();
01451 }

void EVD::Digittext (  ) 

Definition at line 2078 of file EVD.cxx.

References GuiCompositeFrameBase::Add(), GuiMainWindow::ConnectClose(), fDigitbut, fDigitText, fDigittextbox, fMCtextbox, fMCTreescroll, fPageDisplay, fRecotextbox, fTextBox, GuiBase::GetMainWindow(), PageDisplay::GetTab(), GuiCompositeFrameBase::Remove(), GuiBase::SetLayoutHints(), and GuiMainWindow::ShowAll().

Referenced by BuildButtons().

02080 {
02081   if(!fTextBox)
02082     {
02083     fTextBox = manage(new GuiBox(*fPageDisplay,kHorizontalFrame));
02084     fTextBox->SetHeight(200);
02085     fTextBox->SetWidth(fPageDisplay->GetWidth());
02086     fTextBox->SetLayoutHints(kLHintsTop || kLHintsLeft || kLHintsExpandX);
02087     fPageDisplay->Add(*fTextBox);
02088     } 
02089   if(fDigittextbox)
02090     {
02091       fDigittextbox->Resize(1,1);
02092       fTextBox->Remove(*fDigittextbox);
02093       fDigittextbox=0;
02094       fDigitbut->SetDown(false);
02095       fDigitText=0;
02096     }
02097   else
02098     { 
02099       fDigittextbox = manage(new GuiTextView(*fTextBox,1,1)); 
02100       fTextBox->Add(*fDigittextbox);
02101       fDigitbut->SetDown(true);
02102       fDigitText = new DigitText(fDigittextbox); 
02103       fTextBox->SetHeight(200);
02104       fTextBox->SetWidth(fPageDisplay->GetWidth());
02105       fDigittextbox ->AddLine("Digitization Detail ");
02106     }
02107   if(!fMCtextbox && !fRecotextbox && !fMCTreescroll && !fDigittextbox)
02108     {
02109       fTextBox->Resize(1,1);
02110       fPageDisplay->Remove(*fTextBox);
02111       fTextBox=0;
02112     }
02113 
02114   GuiMainWindow* mw = fPageDisplay->GetTab()->GetMainWindow();
02115   assert(mw);
02116   mw->ShowAll();
02117   mw->ConnectClose();
02118 }

void EVD::DrawVS (  )  [private]

Definition at line 2682 of file EVD.cxx.

References fMint, Mint::GetDetector(), UgliGeomHandle::GetScintPlnHandleVector(), UgliGeomHandle::GetStripHandle(), Mint::GetUgliGeomHandle(), id, UgliGeomHandle::IsValid(), StripEnd::kEast, Detector::kFar, PlaneView::kVSTopEastSlant, PlaneView::kVSTopWestSlant, PlaneView::kVSWallOnEdge, and StripEnd::kWest.

Referenced by UpdateView().

02682                 {
02683 
02684   if (!fMint) return;
02685   if (fMint->GetDetector() != Detector::kFar) return;
02686   UgliGeomHandle ugh = fMint->GetUgliGeomHandle();
02687   if (! ugh.IsValid()) return;
02688   
02689   vector<UgliScintPlnHandle> usphv = ugh.GetScintPlnHandleVector();
02690   vector<UgliScintPlnHandle>::reverse_iterator rit, rdone = usphv.rend();
02691   VS = new TList;
02692   VS->SetOwner();
02693   float cx,cy; 
02694   StripEnd::StripEnd_t two_sided[] = { StripEnd::kEast,
02695                                        StripEnd::kWest };
02696   StripEnd::StripEnd_t *side_list = two_sided;
02697    
02698   for (rit = usphv.rbegin(); rit != rdone; ++rit) {
02699     if (! rit->GetPlexPlaneId().IsVetoShield()) break;
02700     int nstrips = rit->NumberOfStrips();
02701     for (int istrip=0; istrip < nstrips; istrip++) {
02702       PlexStripEndId oneend(rit->GetPlexPlaneId(),istrip,side_list[0]);
02703       UgliStripHandle ush = ugh.GetStripHandle(oneend);
02704       TVector3 stripxyz0(ush.GlobalPos(-ush.GetHalfLength()));
02705       TVector3 stripxyz1(ush.GlobalPos(ush.GetHalfLength()));
02706       cx = 0.5*(stripxyz0[0]+stripxyz1[0]);
02707       cy = 0.5*(stripxyz0[1]+stripxyz1[1]);     
02708       Double_t dy[5] = {-ush.GetHalfThickness(),
02709                         -ush.GetHalfThickness(),
02710                         +ush.GetHalfThickness(),
02711                         +ush.GetHalfThickness(),
02712                         -ush.GetHalfThickness()};
02713       Double_t dx[5] = {-ush.GetHalfWidth(),
02714                         +ush.GetHalfWidth(),
02715                         +ush.GetHalfWidth(),
02716                         -ush.GetHalfWidth(),
02717                         -ush.GetHalfWidth()};
02718       if(rit->GetPlaneView()==PlaneView::kVSWallOnEdge){
02719         for (int id=0;id<6;id++){
02720           double tmp=dy[id];
02721           dy[id]=dx[id];
02722           dx[id]=tmp;
02723         }
02724       }
02725       Double_t rot=0.9;
02726       if(rit->GetPlaneView()==PlaneView::kVSTopEastSlant){
02727         double newdx;
02728         double newdy;
02729         for (int id=0;id<6;id++){
02730           newdx=dx[id]*cos(-rot)+dy[id]*sin(-rot);
02731           newdy=-dx[id]*sin(-rot)+dy[id]*cos(-rot);
02732           dx[id]=newdx;
02733           dy[id]=newdy;
02734         }
02735       }
02736       if(rit->GetPlaneView()==PlaneView::kVSTopWestSlant){
02737         double newdx;
02738         double newdy;
02739         for (int id=0;id<6;id++){
02740           newdx=dx[id]*cos(rot)+dy[id]*sin(rot);
02741           newdy=-dx[id]*sin(rot)+dy[id]*cos(rot);
02742           dx[id]=newdx;
02743           dy[id]=newdy;
02744         }
02745 
02746       }
02747       Double_t xbox[5]={cx+dx[0],cx+dx[1],cx+dx[2],cx+dx[3],cx+dx[4]};
02748       Double_t ybox[5]={cy+dy[0],cy+dy[1],cy+dy[2],cy+dy[3],cy+dy[4]};
02749       TPolyLine * VSstrip = new TPolyLine(5,xbox,ybox);
02750       VS->Add(VSstrip);
02751     }
02752   }
02753   VS->Draw();
02754 }

void EVD::FillTimevsY (  )  [private]
void EVD::FullZoom ( void   )  [virtual]

Reimplemented from PageABC.

Definition at line 695 of file EVD.cxx.

References DisplayOptions::AutoScaleExtents(), BlockRanges(), fClear, fMint, fPad, fViewState, Mint::GetDetector(), GetDisplayOptions(), UgliGeomHandle::GetScintPlnHandleVector(), UgliGeomHandle::GetTransverseExtent(), Mint::GetUgliGeomHandle(), UgliGeomHandle::GetZExtent(), UgliGeomHandle::IsValid(), Detector::kFar, Detector::kNear, PlaneView::kU, Detector::kUnknown, PlaneView::kV, ViewState::metric_is_discreet, Update(), DisplayOptions::ZMax(), and DisplayOptions::ZMin().

Referenced by Clear(), DisplayOptions::OK(), and ToggleRealCoords().

00696 {
00697   if (!fMint) return;
00698   if (fMint->GetDetector() == Detector::kUnknown) return;
00699   BlockRanges(true);
00700   UgliGeomHandle ugh = fMint->GetUgliGeomHandle();
00701   if (! ugh.IsValid()) 
00702     {
00703       cerr << "EVD::FullZoom: no valid geometry\n";
00704       return;
00705     }
00706   
00707   if (fViewState[0]->GetSpatialMetric() == ViewState::metric_is_discreet) 
00708     {
00709       vector<UgliScintPlnHandle> usphv = ugh.GetScintPlnHandleVector();
00710       vector<UgliScintPlnHandle>::reverse_iterator rit, rdone = usphv.rend();
00711       
00712       for (rit = usphv.rbegin(); rit != rdone; ++rit) 
00713         {
00714           if (! rit->GetPlexPlaneId().IsVetoShield()) break;
00715         }
00716       if (rit == rdone)
00717         {
00718           cerr << "EVD::FullZoom: WTF, can't get last plane!\n";
00719           return;
00720         }
00721       
00722       double first_plane,last_plane;
00723       if(GetDisplayOptions()->AutoScaleExtents()){
00724         first_plane = usphv[0].GetPlaneNumber()-10; 
00725         last_plane = rit->GetPlaneNumber()+10;
00726       }
00727       else{
00728         first_plane=GetDisplayOptions()->ZMin()/0.06;
00729         last_plane=GetDisplayOptions()->ZMax()/0.06;  
00730       }
00731       int n_strips = usphv[0].NumberOfStrips();
00732       
00733       fPad[0]->Range(first_plane,-10,last_plane,n_strips+10);
00734       fPad[1]->Range(first_plane,-10,last_plane,n_strips+10);
00735       
00736       float xmin, xmax, ymin,ymax;      
00737       ugh.GetTransverseExtent(PlaneView::kU,xmin,xmax);
00738       ugh.GetTransverseExtent(PlaneView::kV,ymin,ymax);
00739      
00740       if(fMint->GetDetector() == Detector::kFar){      
00741         fPad[2]->Range(xmin-2,ymin-2,xmax+2,ymax+2);
00742       }
00743       else if (fMint->GetDetector() == Detector::kNear){
00744         fPad[2]->Range(xmin-.442,ymin-1.0,xmax+1.5578,ymax+1.0);
00745       }
00746       else{
00747         fPad[2]->Range(xmin-1.0,ymin-1,xmax+1.0,ymax+1);
00748       }
00749     }
00750   else 
00751     {
00752       float umin, umax, zmin, zmax, vmin,vmax;
00753       float xmin, xmax, ymin, ymax;
00754       
00755       
00756       ugh.GetTransverseExtent(PlaneView::kU,umin,umax);
00757       ugh.GetTransverseExtent(PlaneView::kV,vmin,vmax);
00758       if(GetDisplayOptions()->AutoScaleExtents()){
00759         ugh.GetZExtent(zmin,zmax);
00760       }
00761       else{
00762         zmin=GetDisplayOptions()->ZMin();
00763         zmax=GetDisplayOptions()->ZMax();
00764         if((zmax-zmin)<0.25) zmax=zmin+0.25;
00765       }
00766       if(fMint->GetDetector() == Detector::kFar){
00767          zmax+=1;
00768          zmin-=1;
00769          umin-=0.5;
00770          vmin-=0.5;
00771          umax+=0.5;
00772          vmax+=0.5;
00773          xmin=umin;
00774          xmax=umax;
00775          ymin=umin;
00776          ymax=umax;
00777        }
00778        else if (fMint->GetDetector() == Detector::kNear){
00779          zmax+=0.2;
00780          zmin-=0.2;
00781          umin-=0.2;
00782          vmin-=0.2;
00783          umax+=0.2;
00784          vmax+=0.2;
00785          Float_t xoffset=0.5578;
00786          xmin=umin+xoffset;
00787          xmax=umax+xoffset;
00788          ymin=umin;
00789          ymax=umax;
00790        }
00791        else{
00792          zmin-=0.2;
00793          umin-=0.2;
00794          vmin-=0.2;
00795          umax+=0.2;
00796          vmax+=0.2;
00797          xmin=umin;
00798          xmax=umax;
00799          ymin=umin;
00800          ymax=umax;
00801        }   
00802        fPad[0]->Range(zmin,umin,zmax,umax);     
00803        fPad[1]->Range(zmin,vmin,zmax,vmax);
00804        fPad[2]->Range(xmin,ymin,xmax,ymax);
00805 
00806     }
00807   if(!fClear)Update();
00808   BlockRanges(false);
00809 }

CandEventHandle* EVD::GetCandEvent (  )  [inline]
CandSliceHandle* EVD::GetCandSlice (  )  [inline]
RangeControl< double > EVD::GetColorRangeControl ( PlaneView::PlaneView_t  view  ) 

Definition at line 1379 of file EVD.cxx.

References fColorControl, and PlaneView::kV.

Referenced by GfxStripList::Init(), and GfxDigitList::Init().

01380 {
01381   int iview = 0;
01382   if (view == PlaneView::kV) iview = 1;
01383   return *fColorControl[iview];
01384 }

DigitText* EVD::GetDigitText (  )  [inline]

Definition at line 232 of file EVD.h.

References fDigitText.

Referenced by GfxDigitList::ExecuteEvent(), and GfxStripList::ExecuteEvent().

00232 {return fDigitText;}

DisplayOptions* EVD::GetDisplayOptions (  )  [inline]
Bool_t EVD::GetDrawAll (  )  [inline]

Definition at line 216 of file EVD.h.

References fDrawAll.

Referenced by GfxDigitList::Draw(), GfxTrackList::Draw(), GfxStripList::Draw(), and GfxTrack::Paint().

00216 {return fDrawAll;}

Bool_t EVD::GetDrawGhosts (  )  [inline]

Definition at line 217 of file EVD.h.

References fDrawGhosts.

Referenced by GfxDigitList::Draw(), GfxTrackList::Draw(), GfxStripList::Draw(), and GfxTrack::Paint().

00217 {return fDrawGhosts;}

Int_t EVD::GetGhostColor (  )  [inline]
Int_t EVD::GetNumEvents (  ) 

Definition at line 938 of file EVD.cxx.

References CandRecord::FindCandHandle(), fMint, MomNavigator::GetFragment(), Mint::GetJint(), Jint::GetMom(), and CandHandle::GetNDaughters().

Referenced by NextEvent(), PrevEvent(), and Update().

00938                        {
00939   const MomNavigator * mom = fMint->GetJint().GetMom();
00940   if (!mom) return -1;
00941   CandRecord* crec = dynamic_cast<CandRecord*>
00942     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00943   if (!crec) return -1;
00944   CandEventListHandle * eventlist = dynamic_cast<CandEventListHandle*>(crec->FindCandHandle("CandEventListHandle"));
00945   if(!eventlist)return -1;
00946   return eventlist->GetNDaughters();
00947 }

Int_t EVD::GetNumSlices (  ) 

Definition at line 921 of file EVD.cxx.

References CandRecord::FindCandHandle(), fMint, MomNavigator::GetFragment(), Mint::GetJint(), Jint::GetMom(), and CandHandle::GetNDaughters().

Referenced by GfxTrackList::Configure(), GfxShowerList::Configure(), NextSlice(), PrevSlice(), and Update().

00921                        {
00922 
00923   const MomNavigator * mom = fMint->GetJint().GetMom();
00924   if (!mom) {
00925     return -1;
00926   }
00927   CandRecord* crec = dynamic_cast<CandRecord*>
00928     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00929   if (!crec) {
00930     return -1;
00931   }
00932   CandSliceListHandle * slicelist = dynamic_cast<CandSliceListHandle*>(crec->FindCandHandle("CandSliceListHandle"));
00933 
00934   if(!slicelist)return -1;
00935   return slicelist->GetNDaughters();
00936 }

PageDisplay* EVD::GetPageDisplay (  )  [inline]

Definition at line 231 of file EVD.h.

References fPageDisplay.

00231 {return fPageDisplay;}

ViewState * EVD::GetViewState ( PlaneView::PlaneView_t  view  ) 

Definition at line 1453 of file EVD.cxx.

References fViewState, and PlaneView::kV.

01454 {
01455   int iview = 0;
01456   if (view == PlaneView::kV) iview = 1;
01457   return fViewState[iview];
01458 }

TObject * EVD::Init ( Mint mint,
PageDisplay pd,
GuiBox box 
) [virtual]

Implement to fill box with whatever your page displays. If the page wishes to return a class to the initializer, then return an object which inherits from TObject, o.w. just return 0.

Reimplemented from CanvasPage.

Definition at line 130 of file EVD.cxx.

References AddGfx(), BuildButtons(), BuildGfxMenu(), BuildMenus(), Clear(), ColorSemanticHandler(), fChargeRange, fColorAxis, fColorButton, fColorControl, fMint, fPad, fPageDisplay, fRangeAxis, fRClist, fSpatialControl, fUserHist, fViewState, fZoomHistory, CanvasPage::GetCanvas(), RangeAxis::GetSelectionRange(), GuiSlider::GetSignals(), PageDisplay::GetTimeSlider(), InitChargeHists(), DisplaySetup::kUZviewYmin, DisplaySetup::kVZviewYmax, DisplaySetup::kXYviewXmax, DisplaySetup::kXYviewXmin, DisplaySetup::kXYviewXR, DisplaySetup::kXYviewYmax, DisplaySetup::kXYviewYmin, DisplaySetup::kXYviewYR, DisplaySetup::kZviewColorFrameXmax, DisplaySetup::kZviewColorFrameYmax, DisplaySetup::kZviewColorFrameYmin, DisplaySetup::kZviewXmax, DisplaySetup::kZviewXmin, DisplaySetup::kZviewXRUV, DisplaySetup::kZviewYmax, DisplaySetup::kZviewYmin, DisplaySetup::kZviewYRZ, Range< TYPE >::modified, Munits::ns, ColorAxis::PaintPalette(), GuiSliderSignals::released, ZoomPad::selection, SelectionZoom(), ColorAxis::SetScale(), TextPad, ViewState::ToggleColorSemantic(), Update(), UpdateCanvas(), UpdateSummary(), UpdateTime(), ZoomPad::UseCurRangeX(), ZoomPad::UseCurRangeY(), and RangeAxis::UseRange().

00131 {
00132 
00133  
00134 
00135   this->CanvasPage::Init(mint,pd,box);
00136   fMint = mint;
00137   fPageDisplay = pd;
00138 
00139   fChargeRange= new RangeDouble(0.0,1.0);
00140   
00141   /* 
00142      The 3 views displayed are UZ [0], VZ [1], and XY [2].  The ViewState
00143      holds the state variables that determine whether non-demuxed digits are
00144      displayed, whether color represents time or charge, etc.  Refer to
00145      ViewState.h for the complete state list.
00146   */
00147   fViewState[0] = manage(new ViewState);
00148   fViewState[1] = manage(new ViewState);
00149   fViewState[2] = manage(new ViewState); 
00150 
00151   BuildMenus();
00152   BuildButtons();
00153   
00154   /* 
00155      Build ranges.  There are 5 spatial controls, for the one for the z axis 
00156      in the U and V vs Z views, and one each for U, V, X, and Y.  There is
00157      also a time range, which controls the range of times displayed, 
00158      and which is controled by the slider control at the bottom of the window  
00159   */
00160 
00161   RangeDouble*  spatial_range[5];
00162   for (int i=0; i<6; ++i) 
00163     {
00164       spatial_range[i] = manage(new RangeDouble(0,1));
00165       fSpatialControl[i] = new RangeControl<double>(fZoomHistory,
00166                                                     spatial_range[i]);
00167     }
00168   fRClist.push_back(fPageDisplay->GetTimeSlider().GetSignals().released.connect
00169                       (slot_class(*this,&EVD::UpdateTime)));
00170  
00171   TCanvas& canvas = this->GetCanvas();
00172   canvas.SetFillColor(38);
00173 
00174   Int_t colNum=9;
00175   Int_t palette[9]={10,6,9,4,7,8,3,5,2};
00176   gStyle->SetPalette(colNum,palette);
00177   
00178   /* 
00179      Build U/V vs Z views.  We must define a pad for each, and set the 
00180      location of the rangeaxis and color_range controls.  The color ranges
00181      have an associated button, which determines whether color represents
00182      pulse height or time.  The color ranges are active, meaning that the 
00183      display will response to selection of  a range on the color palette.
00184   */
00185   
00186   fPad[0] = new ZoomPad("U View", "U View", kZviewXmin,kUZviewYmin, 
00187                         kZviewXmax,kZviewYmax);
00188   fPad[1] = new ZoomPad("V View", "V View", kZviewXmin,kZviewYmin,
00189                         kZviewXmax,kVZviewYmax);
00190   
00191   fRangeAxis[0] = new RangeAxis(kZviewXRUV,kUZviewYmin, 
00192                                 kZviewXRUV,kZviewYmax);
00193   fRangeAxis[1] = new RangeAxis(kZviewXRUV,kZviewYmin, 
00194                                 kZviewXRUV,kVZviewYmax);
00195   fRangeAxis[2] = new RangeAxis(kZviewXmin,kZviewYRZ,
00196                                 kZviewXmax,kZviewYRZ);
00197   
00198   for (int i = 0; i < 3; ++i) 
00199     {
00200       fRangeAxis[i]->UseRange(spatial_range[i]);
00201       fRangeAxis[i]->SetLabelSize(0.4*fRangeAxis[i]->GetLabelSize());
00202     }
00203   
00204   fRangeAxis[0]->SetTitle("U");
00205   fRangeAxis[1]->SetTitle("V");
00206   fRangeAxis[0]->SetTitleSize(0.02);
00207   fRangeAxis[1]->SetTitleSize(0.02);
00208   fRangeAxis[0]->SetTitleOffset(0.5);
00209   fRangeAxis[1]->SetTitleOffset(0.5);
00210   
00211   RangeDouble* color_range[2];
00212   for (int i = 0; i<2; ++i) 
00213     {
00214       color_range[i] = manage(new RangeDouble(0,1));
00215       fColorControl[i] = new RangeControl<double>(fZoomHistory,
00216                                                   color_range[i]);//leak
00217       
00218       fPad[i]->UseCurRangeX(spatial_range[2]);
00219       
00220       /*
00221         Connects selection event to SelectionZoom method.  Selecting
00222         a region  in either the UZ or VZ views will result in zooming
00223         in on that region.  The zoom all button is used to zoom back
00224         out.
00225       */
00226 
00227       fPad[i]->selection.connect(bind(slot_class(*this,&EVD::SelectionZoom),fPad[i]));
00228     }
00229   
00230   
00231   fPad[0]->UseCurRangeY(spatial_range[0]);
00232   fPad[1]->UseCurRangeY(spatial_range[1]);
00233   
00234   fColorAxis[0] = new ColorAxis(50,0.05, color_range[0], 
00235                                 kZviewColorFrameXmax-0.1,kZviewColorFrameYmin, 
00236                                 kZviewColorFrameXmax-0.1,kZviewColorFrameYmax,
00237                                 505,"+L");
00238   fColorAxis[1] = new ColorAxis(50,0.05, color_range[1], 
00239                                 kZviewColorFrameXmax,kZviewColorFrameYmin, 
00240                                 kZviewColorFrameXmax,kZviewColorFrameYmax,
00241                                 505,"+L");
00242   
00243   fColorButton[0] = manage(new GfxButton("UZ Time",
00244                                          kZviewColorFrameXmax-0.15,
00245                                          kZviewColorFrameYmax+0.01,
00246                                          kZviewColorFrameXmax-0.1,
00247                                          kZviewColorFrameYmax+0.04));
00248   fColorButton[1] = manage(new GfxButton("VZ Time",
00249                                          kZviewColorFrameXmax-0.05,
00250                                          kZviewColorFrameYmax+0.01,
00251                                          kZviewColorFrameXmax,
00252                                          kZviewColorFrameYmax+0.04));
00253   
00254     for(int i = 0; i<2; ++i) 
00255       {
00256       fColorAxis[i]->SetLabelSize(0.25*fColorAxis[i]->GetLabelSize());
00257       fColorButton[i]->SetTextSize(0.5);
00258       fColorAxis[i]->SetScale(Munits::ns);
00259       RangeDouble& sel = fColorAxis[i]->GetSelectionRange();
00260 
00261       /* connect selecton of range on color axis to the RangeControl::Apply
00262          method.  This method determines whether a charge or time sub-range
00263          is being requested, and triggers a screen redraw with the appropriate
00264          subrange.
00265       */
00266       
00267       sel.modified.connect(bind(slot(*(fColorControl[i]),
00268                                      &RangeControl<double>::Apply),&sel));
00269       sel.modified.connect(slot_class(*this,&EVD::UpdateCanvas));
00270 
00271       /*
00272         Clicking on a color button toggles between charge and time color
00273         semantics
00274       */
00275       
00276       fColorButton[i]->clicked.connect(slot(*fViewState[i],
00277                                             &ViewState::ToggleColorSemantic));       }
00278 
00279 
00280     fViewState[0]->color_semantic.connect(bind(slot_class(*this,&EVD::ColorSemanticHandler),0));    
00281     //    fViewState[0]->show_multiplex.connect(slot_class(*this,&EVD::Update));
00282     //     fViewState[0]->spatial_metric.connect(slot_class(*this,&EVD::Update));
00283 
00284     fViewState[1]->color_semantic.connect(bind(slot_class(*this,&EVD::ColorSemanticHandler),1));
00285     fViewState[1]->show_multiplex.connect(slot_class(*this,&EVD::Update));
00286     //    fViewState[1]->spatial_metric.connect(slot_class(*this,&EVD::Update));
00287 
00288 
00289     for (int i=0; i<3; ++i) 
00290       {
00291         RangeDouble& s = fRangeAxis[i]->GetSelectionRange();
00292         s.modified.connect(bind(slot(*(fSpatialControl[i]),
00293                                      &RangeControl<double>::Apply),&s));       
00294         fRClist.push_back(spatial_range[i]->modified.connect(slot_class(*this,&EVD::UpdateCanvas)));
00295       }
00296     
00297 
00298     /* now build XY view, in fashion similar to above */    
00299 
00300     fPad[2] = new ZoomPad("XY View", "XY View", 
00301                           kXYviewXmin,kXYviewYmin,
00302                           kXYviewXmax,kXYviewYmax);
00303     
00304     fRangeAxis[3] = new RangeAxis(kXYviewXR,kXYviewYmin,
00305                                   kXYviewXR,kXYviewYmax);
00306     fRangeAxis[4] = new RangeAxis(kXYviewXmin,kXYviewYR, 
00307                                   kXYviewXmax,kXYviewYR);
00308 
00309     for (int i = 3; i < 5; ++i) 
00310       {
00311         fRangeAxis[i]->UseRange(spatial_range[i]);
00312         fRangeAxis[i]->SetLabelSize(0.3*fRangeAxis[i]->GetLabelSize());
00313         
00314       }
00315 
00316     fRangeAxis[3]->SetTitle("Y");
00317     fRangeAxis[4]->SetTitle("X");
00318     fRangeAxis[3]->SetTitleSize(0.02);
00319     fRangeAxis[4]->SetTitleSize(0.02);
00320     fRangeAxis[3]->SetTitleOffset(0.5);
00321     fRangeAxis[4]->SetTitleOffset(0.5);
00322     
00323     fPad[2]->UseCurRangeX(spatial_range[3]);
00324     fPad[2]->selection.connect(bind(slot_class(*this,&EVD::SelectionZoom),fPad[2]));
00325     fPad[2]->UseCurRangeY(spatial_range[4]);
00326     fViewState[2]->color_semantic.connect(bind(slot_class(*this,&EVD::ColorSemanticHandler),1));
00327  
00328     
00329     for (int i=3; i<5; ++i) 
00330       {
00331         RangeDouble& s = fRangeAxis[i]->GetSelectionRange();
00332         s.modified.connect(bind(slot(*(fSpatialControl[i]),
00333                                      &RangeControl<double>::Apply), &s));
00334         
00335         fRClist.push_back(spatial_range[i]->modified.connect
00336                           (slot_class(*this,&EVD::UpdateCanvas)));
00337       }
00338 
00339     
00340     /* the text pad shows a summary of reconstruction,  and MC if appropriate */
00341     TextPad = new TPad("Summary","Summary",0.42,0.01,0.97,0.24);
00342     TextPad->SetFillColor(17);
00343     
00344     /* draw pads on the canvas, tweaking the drawing options for visual
00345        impact
00346     */
00347 
00348     canvas.cd();
00349     fPad[0]->SetBorderSize(1);
00350     fPad[1]->SetBorderSize(1);
00351     fPad[2]->SetBorderSize(1);
00352 
00353     fPad[0]->SetBorderMode(1);
00354     fPad[1]->SetBorderMode(1);
00355     fPad[2]->SetBorderMode(1);
00356 
00357     fColorButton[0]->SetFillColor(2);
00358     fColorButton[1]->SetFillColor(2);
00359 
00360     fPad[0]->SetFillColor(1);
00361     fPad[1]->SetFillColor(1);
00362     fPad[2]->SetFillColor(1);
00363   
00364     fPad[0]->Draw();
00365     fPad[1]->Draw();
00366     fPad[2]->Draw();
00367     TextPad->Draw();
00368 
00369     //create the user histograms
00370 
00371     fUserHist = new UserHist(fMint);
00372 
00373     // update the reconstruction/MC summary pad.
00374     
00375     TextPad->cd();
00376     UpdateSummary();
00377     
00378     canvas.cd();
00379     InitChargeHists(canvas);
00380     fRangeAxis[0]->Draw();
00381     fRangeAxis[1]->Draw();
00382     fRangeAxis[2]->Draw();
00383     fRangeAxis[3]->Draw();
00384     fRangeAxis[4]->Draw();
00385 
00386     fColorAxis[0]->Draw();
00387     fColorAxis[1]->Draw();
00388     fColorAxis[0]->PaintPalette();
00389     fColorButton[0]->Draw();
00390     fColorButton[1]->Draw();
00391 
00392     /* 
00393        Activate all Gfx objects. By default, the digitlist, tracklist, and
00394        showerlist are displayed. One can select or deselect object 
00395        visibility in the 'Objects' menu
00396     */
00397 
00398     const char* default_gfx[] = {
00399       "DigitList",
00400       "StripList",
00401       "TrackList",
00402       "ShowerList",
00403       "MCVecList",
00404       0
00405     };
00406     
00407     for (int ind=0; default_gfx[ind]; ++ind) this->AddGfx(default_gfx[ind]);
00408     
00409     BuildGfxMenu();
00410     Clear();
00411     Update();
00412 
00413     return new EVDObject(this); // small leak   
00414 }

void EVD::InitChargeHists ( TCanvas &  canvas  ) 

Definition at line 1465 of file EVD.cxx.

References chargepad, fChargeHist, fRecoChargeHist, fShwRecoChargeHist, fTrkRecoChargeHist, DisplaySetup::kUZviewYmin, DisplaySetup::kVZviewYmax, DisplaySetup::kZviewXmax, DisplaySetup::kZviewXmin, DisplaySetup::kZviewYmax, and DisplaySetup::kZviewYmin.

Referenced by Init().

01466 {
01467 
01468   /* build histograms display PE vs position along sides of views.
01469      all PEs are placed in the ChargeHists, while only charge associated
01470      with reconstructed showers and tracks will be place in the
01471      RecoChargeHists. Charge vs Z or plane is held in chargehist[0], vs U
01472      is in [1], and vs V is in [2]
01473   */
01474 
01475   chargepad[0] = new TPad( "Charge v Z", "Charge v Z", 
01476                            kZviewXmin,kZviewYmax, 
01477                            kZviewXmax,kZviewYmax+0.04); 
01478   chargepad[0]->SetFillColor(23);  
01479 
01480   chargepad[2] = new TPad( "Charge v strip", "Charge v strip", 
01481                            kZviewXmax,kZviewYmin,
01482                            kZviewXmax+0.04,kVZviewYmax);
01483   chargepad[2]->SetFillColor(23);  
01484 
01485   chargepad[1] = new TPad( "Charge u strip", "Charge u strip", 
01486                            kZviewXmax,kUZviewYmin,
01487                            kZviewXmax+0.04,kZviewYmax);
01488   chargepad[1]->SetFillColor(23);  
01489 
01490   fChargeHist[0]= new TH1F("chargevZ","",100,0.,1.); 
01491   fChargeHist[1]= new TH1F("chargevU","",100,0.,1.); 
01492   fChargeHist[2]= new TH1F("chargevV","",100,0.,1.);
01493   
01494   fRecoChargeHist[0] = new THStack("RecochargevZ","RecochargevZ");
01495   fRecoChargeHist[1] = new THStack("RecochargevU","RecochargevU");
01496   fRecoChargeHist[2] = new THStack("RecochargevV","RecochargevV");
01497 
01498   fShwRecoChargeHist[0]= new TH1F("ShwRecochargevZ","",100,0.,1.); 
01499   fShwRecoChargeHist[1]= new TH1F("ShwRecochargevU","",100,0.,1.); 
01500   fShwRecoChargeHist[2]= new TH1F("ShwRecochargevV","",100,0.,1.);
01501 
01502   fTrkRecoChargeHist[0]= new TH1F("TrkRecochargevZ","",100,0.,1.); 
01503   fTrkRecoChargeHist[1]= new TH1F("TrkRecochargevU","",100,0.,1.); 
01504   fTrkRecoChargeHist[2]= new TH1F("TrkRecochargevV","",100,0.,1.);
01505 
01506   int i;
01507   for(i=0;i<3;i++)
01508     {  
01509       chargepad[i]->SetGridx(0);
01510       chargepad[i]->SetGridy(0);
01511       chargepad[i]->SetLeftMargin(0);
01512       chargepad[i]->SetRightMargin(0);
01513       chargepad[i]->SetTopMargin(0);
01514       chargepad[i]->SetBottomMargin(0);
01515       chargepad[i]->SetBorderSize(0);
01516       chargepad[i]->SetBorderMode(1);
01517       chargepad[i]->SetTicks(0,0);
01518       chargepad[i]->SetFillStyle(1001);
01519       chargepad[i]->SetLineWidth(1);
01520       chargepad[i]->SetFrameFillColor(0);
01521       canvas.cd();
01522       chargepad[i]->Draw();  
01523       chargepad[i]->cd();
01524       fChargeHist[i]->SetTickLength(0,"Y"); 
01525       fChargeHist[i]->SetStats(kFALSE);   
01526       fChargeHist[i]->SetLineColor(1);
01527       fChargeHist[i]->SetLineWidth(1);
01528      
01529       fShwRecoChargeHist[i]->SetTickLength(0,"Y");
01530       fShwRecoChargeHist[i]->SetStats(kFALSE);      
01531       fShwRecoChargeHist[i]->SetFillColor(2);
01532       fShwRecoChargeHist[i]->SetLineColor(1);
01533       fShwRecoChargeHist[i]->SetLineWidth(1);
01534       fTrkRecoChargeHist[i]->SetTickLength(0,"Y");
01535       fTrkRecoChargeHist[i]->SetStats(kFALSE);      
01536       fTrkRecoChargeHist[i]->SetFillColor(9);
01537       fTrkRecoChargeHist[i]->SetLineColor(1);
01538       fTrkRecoChargeHist[i]->SetLineWidth(1);
01539       fRecoChargeHist[i]->Add(fTrkRecoChargeHist[i]);
01540       fRecoChargeHist[i]->Add(fShwRecoChargeHist[i]);
01541 
01542       if(i==0) 
01543         {
01544           fChargeHist[i]->Draw("bar hist");
01545           fRecoChargeHist[i]->Draw("bar hist same");
01546 
01547         }
01548       else
01549         {
01550           fChargeHist[i]->Draw("hbar hist");
01551           fRecoChargeHist[i]->Draw("hbar hist same");
01552         }
01553 
01554  }
01555   canvas.cd();
01556 }

void EVD::InitView ( GraphicsView::GraphicsView_t  view  )  [private]

Definition at line 659 of file EVD.cxx.

References AddGfx(), fPad, GraphicsView::kUV, GraphicsView::kUZ, GraphicsView::kVZ, and GraphicsView::kXY.

00660 {
00661  
00662   Int_t ind=2;
00663   if(view==GraphicsView::kUZ )ind=0;
00664   if(view==GraphicsView::kVZ )ind=1;
00665   if(view==GraphicsView::kUV )ind=2;
00666   if(view==GraphicsView::kXY )ind=2;
00667   fPad[ind]->cd();
00668 
00669   const char* hard_coded_default_gfx[] = {
00670     "DigitList",
00671     "StripList",
00672     "TrackList",
00673     "ShowerList",
00674     "MCVecList",
00675     0
00676   };
00677 
00678   for (int ind=0; hard_coded_default_gfx[ind]; ++ind) 
00679     {
00680       const char* gfx_name = hard_coded_default_gfx[ind];
00681       this->AddGfx(gfx_name);
00682     }
00683 }

void EVD::MCtext (  ) 

Definition at line 1968 of file EVD.cxx.

References GuiCompositeFrameBase::Add(), GuiMainWindow::ConnectClose(), fDigittextbox, fMCbut, fMCText, fMCtextbox, fMCTreescroll, fMint, fPageDisplay, fRecotextbox, fTextBox, GuiBase::GetMainWindow(), PageDisplay::GetTab(), GuiCompositeFrameBase::Remove(), GuiBase::SetLayoutHints(), GuiMainWindow::ShowAll(), and MCText::Update().

Referenced by BuildButtons().

01970 {
01971   // write out NeuKine to a text box.
01972   // if the textbox is not currently visible, build it, and set to full width   
01973   if(!fTextBox){
01974     fTextBox = manage(new GuiBox(*fPageDisplay,kHorizontalFrame));
01975     fTextBox->SetHeight(200);
01976     fPageDisplay->SetWidth(fPageDisplay->GetWidth());
01977     fTextBox->SetWidth(fPageDisplay->GetWidth());
01978     fTextBox->SetLayoutHints(kLHintsTop || kLHintsLeft || kLHintsExpandX);
01979     fPageDisplay->Add(*fTextBox);
01980   } 
01981 
01982   // If the NeuKine data is already being viewed, we want to kill it.
01983   // Otherwise, create a new text view for this.
01984 
01985   if(fMCtextbox){
01986     fMCtextbox->Resize(1,1);
01987     fTextBox->Remove(*fMCtextbox);
01988     fMCtextbox=0;
01989     fMCbut->SetDown(false);
01990     fMCText=0;
01991   }
01992   else{ 
01993     fMCtextbox = manage(new GuiTextView(*fTextBox,1,1)); 
01994     fTextBox->Add(*fMCtextbox);
01995     fMCbut->SetDown(true);
01996     fMCText = manage(new MCText(fMCtextbox));
01997     fTextBox->SetHeight(200);
01998     fTextBox->SetWidth(fPageDisplay->GetWidth());
01999     fMCtextbox ->AddLine(" MC Kinematics ");
02000     fMCText->Update(fMint);
02001   }
02002 
02003   // If none of the text views are open at this point (we've just killed
02004   // the last), then remove the text box from the bottom of the display. 
02005 
02006   if(!fMCtextbox && !fRecotextbox && !fMCTreescroll && !fDigittextbox){
02007    fTextBox->Resize(1,1);
02008    fPageDisplay->Remove(*fTextBox);
02009    fPageDisplay->SetWidth(fPageDisplay->GetWidth());
02010    fTextBox=0;
02011   }
02012 
02013   //  refresh the main window.
02014   
02015   GuiMainWindow* mw = fPageDisplay->GetTab()->GetMainWindow();
02016   assert(mw);
02017   mw->ShowAll();
02018   mw->ConnectClose();
02019 }

void EVD::MCTreetext (  ) 

Definition at line 2021 of file EVD.cxx.

References GuiScrolled::Add(), GuiCompositeFrameBase::Add(), GuiMainWindow::ConnectClose(), fDigittextbox, fMCtextbox, fMCTree, fMCTreebut, fMCTreescroll, fMint, fPageDisplay, fRecotextbox, fTextBox, GuiBase::GetMainWindow(), PageDisplay::GetTab(), GuiCompositeFrameBase::Remove(), GuiBase::SetLayoutHints(), GuiMainWindow::ShowAll(), and MCTree::Update().

Referenced by BuildButtons().

02023 {
02024 
02025   // write out StdHep tree to a text box.
02026 
02027   // if the textbox is not currently visible, build it, and set to full width   
02028 
02029   if(!fTextBox)
02030     {
02031       fTextBox = manage(new GuiBox(*fPageDisplay,kHorizontalFrame));
02032       fTextBox->SetHeight(200);
02033       fTextBox->SetWidth(fPageDisplay->GetWidth());
02034       fTextBox->SetLayoutHints(kLHintsTop || kLHintsLeft || kLHintsExpandX);
02035       fPageDisplay->Add(*fTextBox);
02036     } 
02037 
02038   // If the StdHep is already being viewed, we want to kill it.
02039   // Otherwise, create a new text view and scroll tree for this.
02040 
02041   if(fMCTreescroll)
02042     {
02043       fMCTreescroll->Resize(1,1);
02044       fTextBox->Remove(*fMCTreescroll);
02045       fMCTreescroll=0;
02046       fMCTreebut->SetDown(false);
02047       fMCTree=0;
02048     }
02049   else
02050     { 
02051       fMCTreescroll = manage(new GuiScrolled(*fTextBox)); 
02052       fTextBox->Add(*fMCTreescroll);  
02053       GuiTree* gt = manage(new GuiTree(*fMCTreescroll->GetViewPort()));
02054       fMCTreescroll->Add(*gt);
02055       gt->SetCanvas(fMCTreescroll);
02056       fMCTree = manage(new MCTree(gt));
02057       fMCTreebut->SetDown(true);
02058       fTextBox->SetHeight(200);
02059       fTextBox->SetWidth(fPageDisplay->GetWidth());
02060       fMCTree->Update(fMint);
02061     }
02062 
02063   // If none of the text views are open at this point (we've just killed
02064   // the last), then remove the text box from the bottom of the display. 
02065 
02066   if(!fMCTreescroll && !fRecotextbox && !fMCtextbox && !fDigittextbox)
02067     {
02068       fTextBox->Resize(1,1);
02069       fPageDisplay->Remove(*fTextBox);
02070       fTextBox=0;
02071     }
02072   GuiMainWindow* mw = fPageDisplay->GetTab()->GetMainWindow();
02073   assert(mw);
02074   mw->ShowAll();
02075   mw->ConnectClose();
02076 }

void EVD::NextEvent (  ) 

Definition at line 870 of file EVD.cxx.

References fCandEvent, fEvent, fLastButtonType, fMint, fNumEvents, fSlice, Mint::GetJint(), Jint::GetMom(), GetNumEvents(), Mint::Next(), ReadCandEvent(), and Update().

Referenced by BuildButtons().

00870                    {
00871   fLastButtonType=2;
00872   if(!fMint)return;
00873   const MomNavigator * mom = fMint->GetJint().GetMom();
00874   if (!mom) {
00875     return;
00876   }
00877   fNumEvents=GetNumEvents();
00878  
00879   if(fNumEvents>0){
00880     fEvent++;
00881     if(fEvent>=fNumEvents){
00882       fMint->Next();
00883       fSlice=0;
00884       fCandEvent=ReadCandEvent();
00885       return;
00886     }
00887     fCandEvent=ReadCandEvent();  
00888     Update();
00889   }
00890   else{
00891     fMint->Next(); 
00892     return;
00893   }
00894 }

void EVD::NextSlice (  ) 

Definition at line 817 of file EVD.cxx.

References fCandSlice, fEvent, fLastButtonType, fMint, fNumSlices, fSlice, Mint::GetJint(), Jint::GetMom(), GetNumSlices(), Mint::Next(), ReadCandSlice(), and Update().

Referenced by BuildButtons().

00817                    {
00818   fLastButtonType=1;
00819   if(!fMint)return;
00820   fEvent=-1;
00821   const MomNavigator * mom = fMint->GetJint().GetMom();
00822   if (!mom) {
00823     return;
00824   }
00825   fNumSlices=GetNumSlices();
00826   if(fNumSlices>=0){
00827     fSlice++;
00828     if(fSlice>=fNumSlices){
00829       fMint->Next(); 
00830       fSlice=0;
00831       fCandSlice=ReadCandSlice();
00832       return;
00833     }
00834     fCandSlice=ReadCandSlice();
00835     Update();
00836   }
00837   else{
00838     fMint->Next(); 
00839     return;
00840   }
00841 }

void EVD::PrevEvent (  ) 

Definition at line 896 of file EVD.cxx.

References fCandEvent, fEvent, fLastButtonType, fMint, fNumEvents, Mint::GetJint(), Jint::GetMom(), GetNumEvents(), Mint::Prev(), ReadCandEvent(), and Update().

Referenced by BuildButtons().

00896                    {
00897   fLastButtonType=2;
00898   if(!fMint)return;
00899   const MomNavigator * mom = fMint->GetJint().GetMom();
00900   if (!mom) {
00901     return ;
00902   }
00903   fNumEvents=GetNumEvents();
00904   if(fNumEvents>=0){
00905     fEvent--;
00906     if(fEvent<=0){
00907       fMint->Prev();
00908       fEvent=0;
00909       fCandEvent=ReadCandEvent();
00910       return;
00911     }
00912     fCandEvent=ReadCandEvent();
00913     Update();
00914   }
00915   else{
00916     fMint->Prev(); 
00917     return;
00918   }
00919 }

void EVD::PrevSlice (  ) 

Definition at line 843 of file EVD.cxx.

References fCandSlice, fEvent, fLastButtonType, fMint, fNumSlices, fSlice, Mint::GetJint(), Jint::GetMom(), GetNumSlices(), Mint::Prev(), ReadCandSlice(), and Update().

Referenced by BuildButtons().

00843                    {
00844   fLastButtonType=1;
00845   if(!fMint)return;
00846   const MomNavigator * mom = fMint->GetJint().GetMom();
00847   if (!mom) {
00848     return ;
00849   }
00850   fEvent=-1;
00851   fNumSlices= GetNumSlices();
00852   if(fNumSlices>=0){
00853     fSlice--;
00854     if(fSlice<0){
00855       fMint->Prev(); 
00856       fSlice=0;
00857       fCandSlice=ReadCandSlice();
00858       return;
00859     }
00860     fCandSlice=ReadCandSlice();
00861     Update();
00862   }
00863   else{
00864     fMint->Prev(); 
00865     return;
00866   }
00867 
00868 }

void EVD::PrintCanvas (  )  [private]

Definition at line 2606 of file EVD.cxx.

References fMint, CanvasPage::GetCanvas(), Mint::GetJobC(), DataUtil::GetRunSnarlEvent(), JobC::Mom, and run().

Referenced by BuildButtons().

02606                      {
02607 
02608   if(!fMint) return;
02609   int run=0, snarl=0, event=0;
02610   DataUtil::GetRunSnarlEvent(&(fMint->GetJobC().Mom), run, snarl, event);
02611   char * cline = new char[80];
02612   sprintf(cline,"Run%dSnarl%d.ps",run,snarl);
02613   TCanvas& canvas = this->GetCanvas();
02614   canvas.Print(cline);
02615 
02616 }

CandEventHandle * EVD::ReadCandEvent (  ) 

Definition at line 949 of file EVD.cxx.

References fEvent, CandRecord::FindCandHandle(), fMint, CandHandle::GetDaughterIterator(), MomNavigator::GetFragment(), Mint::GetJint(), and Jint::GetMom().

Referenced by NextEvent(), PrevEvent(), Update(), and UpdateTime().

00949                                      {
00950   const MomNavigator * mom = fMint->GetJint().GetMom();
00951   if (!mom) return 0;
00952   CandRecord* crec = dynamic_cast<CandRecord*>
00953     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00954   if (!crec)  return 0;
00955   CandEventListHandle * eventlist = dynamic_cast<CandEventListHandle*>(crec->FindCandHandle("CandEventListHandle"));
00956   if( !eventlist)return 0;
00957   CandEventHandleItr eventItr(eventlist->GetDaughterIterator());
00958   Int_t nEvent=0;  
00959   while (CandEventHandle *event = eventItr() ) {
00960     if(nEvent==fEvent){
00961       return event;
00962     }
00963     nEvent++;
00964   }
00965   return 0;
00966 }

CandSliceHandle * EVD::ReadCandSlice (  ) 

Definition at line 968 of file EVD.cxx.

References CandRecord::FindCandHandle(), fMint, fSlice, CandHandle::GetDaughterIterator(), MomNavigator::GetFragment(), Mint::GetJint(), and Jint::GetMom().

Referenced by NextSlice(), PrevSlice(), Update(), and UpdateTime().

00968                                      {
00969   const MomNavigator * mom = fMint->GetJint().GetMom();
00970   if (!mom)  return 0;
00971   CandRecord* crec = dynamic_cast<CandRecord*>
00972     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00973   if (!crec) return 0;
00974   CandSliceListHandle * slicelist = dynamic_cast<CandSliceListHandle*>(crec->FindCandHandle("CandSliceListHandle"));
00975   if( !slicelist)return 0;
00976   CandSliceHandleItr sliceItr(slicelist->GetDaughterIterator());
00977   Int_t nSlice=0;  
00978   while (CandSliceHandle *slice = sliceItr() ) {
00979     if(nSlice==fSlice)return slice;
00980     nSlice++;
00981   }
00982   return 0;
00983 }

void EVD::Recotext (  ) 

Definition at line 2120 of file EVD.cxx.

References GuiCompositeFrameBase::Add(), GuiMainWindow::ConnectClose(), fDigittextbox, fMCtextbox, fMCTreescroll, fMint, fPageDisplay, fRecobut, fRecoText, fRecotextbox, fTextBox, GuiBase::GetMainWindow(), PageDisplay::GetTab(), GuiCompositeFrameBase::Remove(), GuiBase::SetLayoutHints(), GuiMainWindow::ShowAll(), and RecoText::Update().

Referenced by BuildButtons().

02121 {    
02122  // write out Reco dump to a text box.
02123 
02124   // if the textbox is not currently visible, build it, and set to full width 
02125 
02126   if(!fTextBox)
02127     {
02128       fTextBox = manage(new GuiBox(*fPageDisplay,kHorizontalFrame));
02129       fTextBox->SetHeight(200);
02130       fTextBox->SetWidth(fPageDisplay->GetWidth());
02131       fTextBox->SetLayoutHints(kLHintsTop || kLHintsLeft || kLHintsExpandX);
02132       fPageDisplay->Add(*fTextBox);
02133     } 
02134 
02135   // If the Reco dump is already being viewed, we want to kill it.
02136   // Otherwise, create a new text view for it.
02137 
02138   if(fRecotextbox)
02139     {
02140       fRecotextbox->Resize(1,1);
02141       fTextBox->Remove(*fRecotextbox);
02142       fRecotextbox=0;
02143       fRecobut->SetDown(false);
02144       fRecoText=0;                  
02145     }
02146   else
02147     { 
02148       fRecotextbox = manage(new GuiTextView(*fTextBox,1,1)); 
02149       FontStruct_t myfont = gClient->GetFontByName("-adobe-helvetica-medium-r-*-*-14-*-*-*-*-*-iso8859-1");
02150       fRecotextbox->SetFont(myfont);
02151       
02152       fTextBox->Add(*fRecotextbox);
02153       fRecobut->SetDown(true);
02154       fRecoText = new RecoText(fRecotextbox);
02155       fRecoText->Update(fMint);
02156     }
02157 
02158   // If none of the text views are open at this point (we've just killed
02159   // the last), then remove the text box from the bottom of the display. 
02160 
02161 
02162   if(!fMCtextbox && !fRecotextbox && ! fMCTreescroll && !fDigittextbox)
02163     {
02164       fTextBox->Resize(1,1);
02165       fPageDisplay->Remove(*fTextBox);
02166       fTextBox=0;
02167     }
02168   GuiMainWindow* mw = fPageDisplay->GetTab()->GetMainWindow();
02169   assert(mw);
02170   mw->ShowAll();
02171   mw->ConnectClose();
02172 }

void EVD::redo ( void   ) 

Definition at line 1460 of file EVD.cxx.

References UpdateCanvas().

01460                {
01461   this->UpdateCanvas();
01462 }

void EVD::RefreshUserHist (  )  [private]
void EVD::Rezoom ( void   )  [virtual]

Reimplemented from PageABC.

Definition at line 1371 of file EVD.cxx.

References BlockRanges(), fZoomHistory, and UpdateCanvas().

01372 {
01373   BlockRanges(true);
01374   fZoomHistory->Redo();
01375   this->UpdateCanvas();
01376   BlockRanges(false);
01377 
01378 }

void EVD::SelectionZoom ( ZoomPad zp  )  [private]

Definition at line 1350 of file EVD.cxx.

References ZoomPad::ApplySelectionToZoom(), BlockRanges(), fCompositeRange, fPad, fZoomHistory, and UpdateCanvas().

Referenced by Init().

01351 {
01352   fCompositeRange->push_back(fPad[0]->GetCurRange().x);
01353   fCompositeRange->push_back(fPad[0]->GetCurRange().y);
01354   fCompositeRange->push_back(fPad[1]->GetCurRange().x);
01355   fCompositeRange->push_back(fPad[1]->GetCurRange().y);
01356   fZoomHistory->Store(*fCompositeRange);
01357 
01358   BlockRanges(true);
01359   zp->ApplySelectionToZoom();
01360   UpdateCanvas();
01361   BlockRanges(false);
01362 }

void EVD::SetChargeRange (  )  [private]

Definition at line 2618 of file EVD.cxx.

References det, fChargeRange, fMint, CandDigitHandle::GetCharge(), PlexSEIdAltL::GetCurrentItem(), Mint::GetDetector(), Mint::GetDigits(), GetDisplayOptions(), PlexSEIdAltLItem::GetPE(), PlexSEIdAltL::GetPlaneView(), CandDigitHandle::GetPlexSEIdAltL(), PlexSEIdAltLItem::GetSigCorr(), PlexSEIdAltLItem::GetSigLin(), PlexSEIdAltL::IsValid(), Detector::kCalib, CalDigitType::kPE, CalDigitType::kSigCorr, CalDigitType::kSigLin, PlaneView::kU, Detector::kUnknown, PlaneView::kV, PlexSEIdAltL::Next(), Range< TYPE >::Set(), and PlexSEIdAltL::SetFirst().

Referenced by Update().

02618                         {
02619   
02620   if(!fMint) return;
02621   if(GetDisplayOptions()->AutoScaleCharge()){
02622     
02623     Detector::Detector_t det = fMint->GetDetector();
02624     if (det == Detector::kUnknown) return;
02625     
02626     const CandDigitListHandle* cslh = fMint->GetDigits();
02627     if (!cslh) return;
02628     
02629     vector<const CandDigitHandle*> dv = 
02630       DataUtil::CDL2STLvector<CandDigitHandle>(*cslh);
02631     int siz = dv.size();
02632     if (! siz) return;
02633     
02634     double tmin=0, tmax=0, qmin=0,qmax=0;
02635     bool first = true;
02636     
02637     for (int ind = 0; ind < siz; ++ind) {
02638       const CandDigitHandle* csh = dv[ind];
02639       const PlexSEIdAltL& altl = csh->GetPlexSEIdAltL();
02640       PlaneView::PlaneView_t pv = altl.GetPlaneView();
02641       if (det != Detector::kCalib && 
02642           pv != PlaneView::kU && pv != PlaneView::kV) continue;
02643       
02644       altl.SetFirst();
02645       while (altl.IsValid()) {
02646         double q =csh->GetCharge();
02647         if(GetDisplayOptions()->ChargeType()==CalDigitType::kPE)
02648           q=altl.GetCurrentItem().GetPE();
02649         else if(GetDisplayOptions()->ChargeType()==CalDigitType::kSigLin)
02650           q=altl.GetCurrentItem().GetSigLin();
02651         else if(GetDisplayOptions()->ChargeType()==CalDigitType::kSigCorr)
02652           q=altl.GetCurrentItem().GetSigCorr();
02653         
02654         if (first) {
02655           qmin = qmax = q;
02656           first=false;
02657           continue;
02658         }
02659         if (q < qmin) qmin = q;
02660         if (q > qmax) qmax = q;
02661         altl.Next();
02662       }
02663     }
02664     // give some buffer at either end...
02665     qmax +=  0.02*(qmax - qmin);
02666     qmin += -0.02*(qmax - qmin);
02667     
02668     
02669     if (!first) {
02670       
02671       double eps = 1.0e-10;
02672       if (tmin == tmax) { tmin -= eps; tmax += eps; }
02673       if (qmin == qmax) { qmin -= eps; qmax += eps; }
02674       
02675       fChargeRange->Set(qmin,qmax);
02676     }
02677   }
02678 }

void EVD::ToggleRealCoords ( GuiMenu menu,
GuiMenu::GuiMenuList::iterator  mit 
) [private]

Definition at line 567 of file EVD.cxx.

References GuiMenu::CheckEntry(), fClear, fPad, FullZoom(), fViewState, GuiMenu::IsEntryChecked(), ViewState::metric_is_continuous, ViewState::metric_is_discreet, and Update().

Referenced by BuildMenus().

00568 {
00569   // toggles between real XYZ coords and strip/plane.
00570 
00571     bool is_strip = ! menu->IsEntryChecked(mit);
00572     menu->CheckEntry(mit,is_strip);
00573 
00574     for (int ind = 0; ind < 2; ++ind) {
00575         fViewState[ind]->SetSpatialMetric(is_strip ? 
00576                                           ViewState::metric_is_discreet : 
00577                                           ViewState::metric_is_continuous);
00578     }    
00579     fViewState[2]->SetSpatialMetric( ViewState::metric_is_continuous);
00580 
00581     fPad[0]->Clear();
00582     fPad[1]->Clear();
00583     fPad[2]->Clear();
00584     fClear=true;
00585     this->FullZoom();
00586     this->Update();
00587 
00588 }

void EVD::ToggleTimeZoom ( GuiMenu menu,
GuiMenu::GuiMenuList::iterator  mit 
) [private]

Definition at line 590 of file EVD.cxx.

References GuiMenu::CheckEntry(), fTimeZoom, GuiMenu::IsEntryChecked(), and Update().

Referenced by BuildMenus().

00591 {
00592   // toggles whether you zoom to time window in slice/event view.
00593 
00594     fTimeZoom = ! menu->IsEntryChecked(mit);
00595     menu->CheckEntry(mit,fTimeZoom);
00596     this->Update();
00597 
00598 }

void EVD::Unzoom ( void   )  [virtual]

Reimplemented from PageABC.

Definition at line 1364 of file EVD.cxx.

References BlockRanges(), fZoomHistory, and UpdateCanvas().

01365 {
01366   BlockRanges(true);
01367   fZoomHistory->Undo();
01368   this->UpdateCanvas();
01369   BlockRanges(false);
01370 }

void EVD::Update (  )  [virtual]

Implement to respond to a change in the data.

Reimplemented from PageABC.

Definition at line 986 of file EVD.cxx.

References ColorSemanticHandler(), MuELoss::e, fCandEvent, fCandSlice, fEvent, fLastButtonType, fMCText, fMCTree, fMint, fNumEvents, fNumSlices, fPad, fRecoText, fSlice, fSnarl, fTimeZoom, fUserHist, UserHist::GetAltTimeHist(), Mint::GetDetector(), GetDisplayOptions(), Mint::GetJobC(), GetNumEvents(), GetNumSlices(), DataUtil::GetRunSnarlEvent(), Mint::GetTimeRange(), Detector::kFar, GraphicsView::kUZ, GraphicsView::kVZ, GraphicsView::kXY, Range< TYPE >::Max(), Range< TYPE >::Min(), JobC::Mom, ReadCandEvent(), ReadCandSlice(), UserHist::Refresh(), run(), Range< TYPE >::Set(), SetChargeRange(), AltTimeHist::SetTotTimeRange(), MCText::Update(), RecoText::Update(), MCTree::Update(), UpdateCanvas(), UpdateSummary(), UpdateView(), and ZoomTimetoSlice().

Referenced by AddGfx(), FullZoom(), Init(), NextEvent(), NextSlice(), DisplayOptions::OK(), PrevEvent(), PrevSlice(), ToggleRealCoords(), and ToggleTimeZoom().

00987 {
00988   if (!fMint) return;
00989 
00990   fPad[0]->SetEditable(true);
00991   fPad[0]->Clear();
00992   fPad[1]->SetEditable(true);
00993   fPad[1]->Clear();
00994   fPad[2]->SetEditable(true);
00995   fPad[2]->Clear();
00996   
00997   int run=0, snarl=0, event=0;
00998   DataUtil::GetRunSnarlEvent(&(fMint->GetJobC().Mom), run, snarl, event);
00999   if(fLastButtonType==1){
01000     fCandSlice=ReadCandSlice();
01001     fCandEvent=0;
01002   }
01003   else if (fLastButtonType==2){
01004     fCandEvent=ReadCandEvent();
01005     fCandSlice=0;
01006   }
01007   else{
01008     fCandEvent=0;
01009     fCandSlice=0;
01010   }
01011   fNumSlices=GetNumSlices();
01012   fNumEvents=GetNumEvents();
01013 
01014   // on new snarl, reset slice counter and CandSlice - this will cause 
01015   // full color display of entire snarl.
01016 
01017   if(snarl!=fSnarl){
01018     if(fNumSlices>1){
01019       fSlice=-1;
01020       fCandSlice=0;
01021       fEvent=-1;
01022       fCandEvent=0;     
01023     }
01024     else{
01025       fSlice=0;
01026       fEvent=0;
01027       fCandSlice=ReadCandSlice();
01028       fCandEvent=ReadCandEvent();
01029     }
01030     fSnarl=snarl;
01031     RangeDouble& r = fMint->GetTimeRange();
01032     fUserHist->GetAltTimeHist()->SetTotTimeRange(r); 
01033   }
01034 
01035   // for far detector, suppress display of pre-trigger time interval
01036   if(fTimeZoom  && (fCandSlice || fCandEvent)){
01037     ZoomTimetoSlice();
01038   }
01039   else if(fMint->GetDetector() == Detector::kFar){
01040     if((fMint->GetTimeRange().Max()-fMint->GetTimeRange().Min())*1e9>1500){
01041       fMint->GetTimeRange().Set(fMint->GetTimeRange().Max()-1500e-9,fMint->GetTimeRange().Max());
01042     }
01043   }
01044   
01045   SetChargeRange();
01046   ColorSemanticHandler(0);
01047   ColorSemanticHandler(1);
01048   
01049   UpdateView(GraphicsView::kUZ);
01050   UpdateView(GraphicsView::kVZ);
01051   UpdateView(GraphicsView::kXY);
01052 
01053   fUserHist->Refresh(GetDisplayOptions()->UserHist());
01054 
01055   UpdateSummary();
01056   
01057   if(fRecoText) fRecoText->Update(fMint);
01058   if(fMCText) fMCText->Update(fMint);   
01059   if(fMCTree) fMCTree->Update(fMint); 
01060    
01061   UpdateCanvas(); 
01062 }

void EVD::UpdateCanvas (  ) 

Definition at line 1134 of file EVD.cxx.

References chargepad, fClear, fPad, CanvasPage::GetCanvas(), GraphicsView::kUZ, GraphicsView::kVZ, GraphicsView::kXY, UpdateChargeHists(), and UpdateGfxObjects().

Referenced by GfxDigitList::HideDigits(), GfxShowerList::HideShowers(), GfxStripList::HideStrips(), GfxTrackList::HideTracks(), GfxMCVecList::HideVecs(), Init(), redo(), Rezoom(), SelectionZoom(), Unzoom(), Update(), and UpdateTime().

01135 {
01136 
01137   /* 
01138      Sets all pads as modified, and redraws the charge histograms and Gfx
01139      objects. Called as a result of hiding or unhiding 
01140      a Gfx object, from UpdateTime when the time window is modified, and 
01141      from Update on a new event. 
01142   */
01143   fClear=false;
01144   fPad[0]->SetEditable(true);
01145   fPad[1]->SetEditable(true);
01146   fPad[2]->SetEditable(true);  
01147 
01148   fPad[0]->Modified();
01149   fPad[1]->Modified();
01150   fPad[2]->Modified();
01151 
01152   chargepad[0]->Modified();
01153   chargepad[1]->Modified();
01154   chargepad[2]->Modified();
01155  
01156   UpdateChargeHists(GraphicsView::kUZ);
01157   UpdateChargeHists(GraphicsView::kVZ);
01158   
01159   UpdateGfxObjects(GraphicsView::kUZ);
01160   UpdateGfxObjects(GraphicsView::kVZ);
01161   UpdateGfxObjects(GraphicsView::kXY);
01162  
01163   GetCanvas().Modified();
01164   GetCanvas().Update();
01165 
01166   fPad[0]->SetEditable(false);
01167   fPad[1]->SetEditable(false);
01168   fPad[2]->SetEditable(false);
01169 
01170 }

void EVD::UpdateChargeHists ( GraphicsView::GraphicsView_t  view  ) 

Definition at line 1559 of file EVD.cxx.

References chargepad, det, fCandEvent, fCandSlice, fChargeHist, fMint, fPad, fRangeAxis, fRecoChargeHist, fShwRecoChargeHist, fTrkRecoChargeHist, fViewState, PlexSEIdAltL::GetBestItem(), CandRecoHandle::GetCharge(), CandHandle::GetDaughterIterator(), Mint::GetDetector(), Mint::GetDigits(), CandFitTrackHandle::GetFinderTrack(), MomNavigator::GetFragment(), Mint::GetJobC(), CandEventHandle::GetLastShower(), CandEventHandle::GetLastTrack(), PlexSEIdAltLItem::GetPE(), PlexPlaneId::GetPlane(), PlexSEIdAltL::GetPlaneView(), CandDigitHandle::GetPlexSEIdAltL(), RangeAxis::GetRange(), PlexSEIdAltLItem::GetSEId(), CandEventHandle::GetShower(), Mint::GetShowers(), PlexSEIdAltL::GetSize(), PlexStripEndId::GetStrip(), CandEventHandle::GetTrack(), Mint::GetTracks(), CandHandle::GetVldContext(), CandHandle::IsCloneOf(), Detector::kCalib, CalDigitType::kPE, PlaneView::kU, GraphicsView::kUV, GraphicsView::kUZ, PlaneView::kV, GraphicsView::kVZ, PlaneView::kX, GraphicsView::kXY, PlaneView::kY, Range< TYPE >::Max(), ViewState::metric_is_continuous, Range< TYPE >::Min(), and JobC::Mom.

Referenced by UpdateCanvas().

01560 {
01561   /* Fill histograms displaying PE vs position along sides of views.
01562      all PEs are placed in the ChargeHists, while only charge associated
01563      with reconstructed showers and tracks will be place in the
01564      RecoChargeHists. Charge vs Z or plane is held in chargehist[0], vs U
01565      is in [1], and vs V is in [2]
01566   */
01567   
01568  // set index based on graphics view
01569 
01570   Int_t ind=2;
01571   if(view==GraphicsView::kUZ)ind=0;
01572   if(view==GraphicsView::kVZ)ind=1;
01573   if(view==GraphicsView::kUV)ind=2;
01574   if(view==GraphicsView::kXY)ind=2;
01575   fPad[ind]->cd();    
01576   if (!fMint)return;
01577 
01578   // set bins in charge histograms based on view scales
01579 
01580   Detector::Detector_t det = fMint->GetDetector();
01581   float zmin = fRangeAxis[2]->GetRange().Min();
01582   float zmax = fRangeAxis[2]->GetRange().Max();
01583   float umin = fRangeAxis[0]->GetRange().Min();
01584   float umax = fRangeAxis[0]->GetRange().Max();
01585   float vmin = fRangeAxis[1]->GetRange().Min();
01586   float vmax = fRangeAxis[1]->GetRange().Max();
01587   int nbinsz = (int)(zmax-zmin+1);
01588   int nbinsu = (int)(umax-umin+1);
01589   int nbinsv = (int)(vmax-vmin+1);
01590   
01591   if(fViewState[ind]->GetSpatialMetric() == ViewState::metric_is_continuous)
01592     {
01593       nbinsz=(int)((zmax-zmin)/0.06);
01594       nbinsu=(int)((umax-umin)/0.06);
01595       nbinsv=(int)((vmax-vmin)/0.06);
01596     }
01597   
01598   if(view==GraphicsView::kUZ)
01599     {
01600       fChargeHist[0]->Reset("ICE");
01601       fChargeHist[1]->Reset("ICE");
01602       fShwRecoChargeHist[0]->Reset("ICE");
01603       fShwRecoChargeHist[1]->Reset("ICE");
01604       fTrkRecoChargeHist[0]->Reset("ICE");
01605       fTrkRecoChargeHist[1]->Reset("ICE");
01606 
01607       fChargeHist[0]->SetBins(nbinsz,zmin,zmax);
01608       fChargeHist[1]->SetBins(nbinsu,umin,umax);
01609       fShwRecoChargeHist[0]->SetBins(nbinsz,zmin,zmax);
01610       fShwRecoChargeHist[1]->SetBins(nbinsu,umin,umax);
01611       fTrkRecoChargeHist[0]->SetBins(nbinsz,zmin,zmax);
01612       fTrkRecoChargeHist[1]->SetBins(nbinsu,umin,umax);
01613 
01614     }
01615   else if(view==GraphicsView::kVZ)
01616     {
01617       fChargeHist[2]->Reset("ICE");
01618       fChargeHist[2]->SetBins(nbinsv,vmin,vmax);        
01619       fShwRecoChargeHist[2]->Reset("ICE");
01620       fShwRecoChargeHist[2]->SetBins(nbinsv,vmin,vmax); 
01621       fTrkRecoChargeHist[2]->Reset("ICE");
01622       fTrkRecoChargeHist[2]->SetBins(nbinsv,vmin,vmax); 
01623     }
01624 
01625 
01626   CandRecord* candrec = dynamic_cast<CandRecord*>
01627     (fMint->GetJobC().Mom.GetFragment("CandRecord", "PrimaryCandidateRecord"));    if (!candrec) return ;
01628   
01629   if(fCandSlice){
01630     TIter stripItr(fCandSlice->GetDaughterIterator());  
01631     while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>
01632            (stripItr())) {
01633       PlaneView::PlaneView_t pv = strip->GetPlaneView();
01634       double q = strip->GetCharge(CalDigitType::kPE);
01635       if(fViewState[ind]->GetSpatialMetric() == ViewState::metric_is_continuous){
01636         if (view==GraphicsView::kUZ && 
01637             (pv == PlaneView::kU || 
01638              (det == Detector::kCalib && pv == PlaneView::kX))) 
01639           {
01640             fChargeHist[0]->Fill( strip->GetZPos(),q);
01641             fChargeHist[1]->Fill( strip->GetTPos(),q);
01642           }
01643         else if (view==GraphicsView::kVZ && 
01644                  (pv == PlaneView::kV || 
01645                   (det == Detector::kCalib && pv ==PlaneView::kY)))
01646           {
01647             fChargeHist[0]->Fill( strip->GetZPos(),q);
01648             fChargeHist[2]->Fill( strip->GetTPos(),q);
01649           } 
01650       }
01651       else{
01652         if (view==GraphicsView::kUZ && 
01653             (pv == PlaneView::kU || 
01654              (det == Detector::kCalib && pv == PlaneView::kX))) 
01655           {
01656             fChargeHist[0]->Fill( strip->GetPlane(),q);
01657             fChargeHist[1]->Fill( strip->GetStrip(),q);
01658           }
01659         else if (view==GraphicsView::kVZ && 
01660                  (pv == PlaneView::kV || 
01661                   (det == Detector::kCalib && pv ==PlaneView::kY)))
01662           {
01663             fChargeHist[0]->Fill( strip->GetPlane(),q);
01664             fChargeHist[2]->Fill( strip->GetStrip(),q);
01665           } 
01666       }
01667     }
01668   }
01669   else if( fCandEvent){
01670     TIter stripItr(fCandEvent->GetDaughterIterator());
01671    while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>
01672            (stripItr())) {
01673       PlaneView::PlaneView_t pv = strip->GetPlaneView();
01674       double q = strip->GetCharge(CalDigitType::kPE);
01675       if(fViewState[ind]->GetSpatialMetric() == ViewState::metric_is_continuous){
01676         if (view==GraphicsView::kUZ && 
01677             (pv == PlaneView::kU || 
01678              (det == Detector::kCalib && pv == PlaneView::kX))) 
01679           {
01680             fChargeHist[0]->Fill( strip->GetZPos(),q);
01681             fChargeHist[1]->Fill( strip->GetTPos(),q);
01682           }
01683         else if (view==GraphicsView::kVZ && 
01684                  (pv == PlaneView::kV || 
01685                   (det == Detector::kCalib && pv ==PlaneView::kY)))
01686           {
01687             fChargeHist[0]->Fill( strip->GetZPos(),q);
01688             fChargeHist[2]->Fill( strip->GetTPos(),q);
01689           } 
01690       }
01691       else{
01692         if (view==GraphicsView::kUZ && 
01693             (pv == PlaneView::kU || 
01694              (det == Detector::kCalib && pv == PlaneView::kX))) 
01695           {
01696             fChargeHist[0]->Fill( strip->GetPlane(),q);
01697             fChargeHist[1]->Fill( strip->GetStrip(),q);
01698           }
01699         else if (view==GraphicsView::kVZ && 
01700                  (pv == PlaneView::kV || 
01701                   (det == Detector::kCalib && pv ==PlaneView::kY)))
01702           {
01703             fChargeHist[0]->Fill( strip->GetPlane(),q);
01704             fChargeHist[2]->Fill( strip->GetStrip(),q);
01705           } 
01706       }
01707     }  
01708   }    
01709   else{
01710     const CandDigitListHandle* cslh = fMint->GetDigits();
01711     if (!cslh) return;
01712     vector<const CandDigitHandle*> dv = 
01713       DataUtil::CDL2STLvector<CandDigitHandle>(*cslh);
01714     int siz = dv.size();
01715     //  if (! siz) return; 
01716     for (int ncd = 0; ncd < siz; ++ncd) {
01717       const CandDigitHandle* cdh = dv[ncd];
01718       const PlexSEIdAltL& altl = cdh->GetPlexSEIdAltL();
01719       double q = altl.GetBestItem().GetPE(); 
01720       PlaneView::PlaneView_t pv = altl.GetPlaneView();
01721       
01722       if(fViewState[ind]->GetSpatialMetric() == ViewState::metric_is_continuous)
01723         {
01724           UgliGeomHandle ugh(*cdh->GetVldContext());
01725           UgliStripHandle ush;
01726           if(altl.GetSize()>0){
01727             ush = ugh.GetStripHandle(altl.GetBestItem().GetSEId());
01728             if (ush.IsValid()){
01729               if (view==GraphicsView::kUZ && 
01730                   (pv == PlaneView::kU || 
01731                    (det == Detector::kCalib && pv == PlaneView::kX))) 
01732                 {
01733                   
01734                   fChargeHist[0]->Fill( ush.GlobalPos(0).Z(),q);
01735                   fChargeHist[1]->Fill( ush.GetTPos(),q);
01736                 }
01737               else if (view==GraphicsView::kVZ && 
01738                        (pv == PlaneView::kV || 
01739                         (det == Detector::kCalib && pv ==PlaneView::kY)))
01740                 {
01741                   
01742                   fChargeHist[0]->Fill( ush.GlobalPos(0).Z(),q);
01743                   fChargeHist[2]->Fill( ush.GetTPos(),q);
01744                 } 
01745             }
01746           }
01747         }
01748       else
01749         {
01750           if(altl.GetSize()>0){
01751             PlexStripEndId seid;
01752             seid = altl.GetBestItem().GetSEId();
01753             if (view==GraphicsView::kUZ && 
01754                 (pv == PlaneView::kU || 
01755                  (det == Detector::kCalib && pv ==PlaneView::kX))) 
01756               {
01757                 fChargeHist[0]->Fill( seid.GetPlane(),q);
01758                 fChargeHist[1]->Fill( seid.GetStrip(),q);
01759               }
01760             else if (view==GraphicsView::kVZ && 
01761                      (pv == PlaneView::kV || 
01762                       (det == Detector::kCalib && pv ==PlaneView::kY)))
01763               {
01764                 
01765                 fChargeHist[0]->Fill( seid.GetPlane(),q);
01766                 fChargeHist[2]->Fill( seid.GetStrip(),q);
01767               }
01768           }
01769         }    
01770     }
01771   }
01772 
01773   // loop over candtracks, filling histograms with strip PEs
01774 
01775     const CandTrackListHandle* tracklisthandle=fMint->GetTracks(); 
01776   //  const CandTrackListHandle* tracklisthandle = dynamic_cast<CandTrackListHandle*>(candrec->FindCandHandle("CandTrackCamListHandle","CandTrackSRList"));
01777   if (tracklisthandle) 
01778     {
01779       TIter trackItr(tracklisthandle->GetDaughterIterator());
01780       while (CandTrackHandle *track = dynamic_cast<CandTrackHandle*>
01781              (trackItr())) 
01782         {
01783         
01784           CandTrackHandle * usetrack =track;
01785           Bool_t usethis=false;
01786           if(!fCandSlice && !fCandEvent){
01787             usethis=true;
01788           }
01789           else if(fCandSlice){
01790             CandSliceHandle slc1 =  *(track->GetCandSlice());
01791             CandSliceHandle slc2= *(fCandSlice);
01792             if(slc1==slc2 || slc1.IsCloneOf(slc2))usethis=true;
01793           }
01794           else if (fCandEvent){
01795             for( Int_t itrack=0;itrack<=fCandEvent->GetLastTrack();itrack++){
01796               const CandFitTrackHandle * evtrack = dynamic_cast<const CandFitTrackHandle*>(fCandEvent->GetTrack(itrack));
01797               CandTrackHandle * findtrack=evtrack->GetFinderTrack();
01798               if(findtrack){
01799                 if (*findtrack==*track){
01800                   usethis=true;
01801                   break;
01802                 }
01803               }
01804               if(track->InheritsFrom("CandFitTrackHandle") && dynamic_cast<CandFitTrackHandle*>(track)->GetFinderTrack()){
01805                 if(*evtrack == *(dynamic_cast<CandFitTrackHandle*>(track)->GetFinderTrack())){
01806                   usetrack = dynamic_cast<CandFitTrackHandle*>(track)->GetFinderTrack();           
01807                   usethis=true;
01808                   break;
01809                 }
01810               }
01811             }
01812           }
01813           if(usethis){ 
01814             TIter titr(usetrack->GetDaughterIterator());
01815             while (CandStripHandle* csh = dynamic_cast<CandStripHandle*>(titr())) 
01816               {
01817                 double q = csh->GetCharge(CalDigitType::kPE); 
01818                 PlaneView::PlaneView_t pv = csh->GetPlaneView();    
01819                 if(fViewState[ind]->GetSpatialMetric() == ViewState::metric_is_continuous)
01820                   {
01821                     
01822                     if (view==GraphicsView::kUZ && 
01823                         (pv == PlaneView::kU || 
01824                          (det == Detector::kCalib && pv == PlaneView::kX))) 
01825                       { 
01826                         fTrkRecoChargeHist[0]->Fill( csh->GetZPos(),q);
01827                         fTrkRecoChargeHist[1]->Fill( csh->GetTPos(),q);
01828                       }
01829                     else if (view==GraphicsView::kVZ && 
01830                              (pv == PlaneView::kV || 
01831                               (det == Detector::kCalib && pv ==PlaneView::kY)))
01832                       {               
01833                         fTrkRecoChargeHist[0]->Fill( csh->GetZPos(),q);
01834                         fTrkRecoChargeHist[2]->Fill( csh->GetTPos(),q);
01835                       } 
01836                   }
01837                 else
01838                   {
01839                     if (view==GraphicsView::kUZ && 
01840                         (pv == PlaneView::kU || 
01841                          (det == Detector::kCalib && pv ==PlaneView::kX))) 
01842                       {
01843                         fTrkRecoChargeHist[0]->Fill( csh->GetPlane(),q);
01844                         fTrkRecoChargeHist[1]->Fill( csh->GetStrip(),q);
01845                       }
01846                     else if (view==GraphicsView::kVZ && 
01847                              (pv == PlaneView::kV || 
01848                               (det == Detector::kCalib && pv ==PlaneView::kY)))
01849                       {
01850                         fTrkRecoChargeHist[0]->Fill( csh->GetPlane(),q);
01851                         fTrkRecoChargeHist[2]->Fill( csh->GetStrip(),q);
01852                       }
01853                   }        
01854               }
01855           }
01856         }
01857     }
01858 
01859   // loop over candshowers, filling histograms with strip PEs
01860   
01861 
01862   const CandShowerListHandle* showerlisthandle = fMint->GetShowers();
01863   if (showerlisthandle) 
01864     {
01865       TIter showerItr(showerlisthandle->GetDaughterIterator());
01866       while (CandShowerHandle *shower = dynamic_cast<CandShowerHandle*>
01867              (showerItr())) 
01868         {
01869           Bool_t usethis=false;
01870           if(!fCandSlice && !fCandEvent){
01871             usethis=true;
01872           }
01873           else if(fCandSlice){     
01874             CandSliceHandle slc1 =  *(shower->GetCandSlice());
01875             CandSliceHandle slc2 = *(fCandSlice);
01876             //      cout << fCandSlice << " " << shower->GetCandSlice() << " " << fCandSlice->GetUidInt() << " " << shower->GetCandSlice()->GetUidInt() << endl;
01877             if(slc1==slc2 || slc1.IsCloneOf(slc2))usethis=true;
01878           }
01879           else if (fCandEvent){
01880             for( Int_t ishower=0;ishower<=fCandEvent->GetLastShower();ishower++){
01881               const CandShowerHandle *evshower = dynamic_cast<const CandShowerHandle *>(fCandEvent->GetShower(ishower));
01882               if (*evshower==*shower){
01883                 usethis=true;
01884                 break;
01885               }
01886             }
01887           }
01888           if(usethis){
01889             TIter titr(shower->GetDaughterIterator());
01890             while (CandStripHandle* csh = dynamic_cast<CandStripHandle*>(titr())) 
01891               {
01892                 double q = csh->GetCharge(CalDigitType::kPE);
01893                 PlaneView::PlaneView_t pv = csh->GetPlaneView();    
01894                 if(fViewState[ind]->GetSpatialMetric() == ViewState::metric_is_continuous)
01895                   {
01896                     
01897                     if (view==GraphicsView::kUZ && 
01898                         (pv == PlaneView::kU || 
01899                          (det == Detector::kCalib && pv == PlaneView::kX))) 
01900                       {
01901                         fShwRecoChargeHist[0]->Fill( csh->GetZPos(),q);
01902                         fShwRecoChargeHist[1]->Fill( csh->GetTPos(),q);
01903                       }
01904                     else if (view==GraphicsView::kVZ && 
01905                              (pv == PlaneView::kV || 
01906                               (det == Detector::kCalib && pv ==PlaneView::kY)))
01907                       {
01908                         fShwRecoChargeHist[0]->Fill( csh->GetZPos(),q);
01909                         fShwRecoChargeHist[2]->Fill( csh->GetTPos(),q);
01910                       } 
01911                   }
01912                 else
01913                   {
01914                     if (view==GraphicsView::kUZ && 
01915                         (pv == PlaneView::kU || 
01916                          (det == Detector::kCalib && pv ==PlaneView::kX))) 
01917                       { 
01918                         fShwRecoChargeHist[0]->Fill( csh->GetPlane(),q);
01919                         fShwRecoChargeHist[1]->Fill( csh->GetStrip(),q);
01920                       }
01921                     else if (view==GraphicsView::kVZ && 
01922                              (pv == PlaneView::kV || 
01923                               (det == Detector::kCalib && pv ==PlaneView::kY)))
01924                       {
01925                         fShwRecoChargeHist[0]->Fill( csh->GetPlane(),q);
01926                         fShwRecoChargeHist[2]->Fill( csh->GetStrip(),q);
01927                       }
01928                   }        
01929               } 
01930           }
01931         }
01932     }
01933   // redraw histograms 
01934   if(view==GraphicsView::kUZ)
01935     {      
01936       chargepad[1]->cd();
01937       fChargeHist[1]->Draw("hbar hist");
01938       fRecoChargeHist[1]->RecursiveRemove(fTrkRecoChargeHist[1]);
01939       fRecoChargeHist[1]->RecursiveRemove(fShwRecoChargeHist[1]); 
01940       fRecoChargeHist[1]->Add(fTrkRecoChargeHist[1]);
01941       fRecoChargeHist[1]->Add(fShwRecoChargeHist[1]); 
01942       fRecoChargeHist[1]->Draw("hbar hist same");  
01943  
01944      }
01945   else if(view==GraphicsView::kVZ)
01946     {
01947       chargepad[0]->cd();
01948       fChargeHist[0]->Draw("bar hist");
01949       fRecoChargeHist[0]->RecursiveRemove(fTrkRecoChargeHist[0]);
01950       fRecoChargeHist[0]->RecursiveRemove(fShwRecoChargeHist[0]); 
01951       fRecoChargeHist[0]->Add(fTrkRecoChargeHist[0]);
01952       fRecoChargeHist[0]->Add(fShwRecoChargeHist[0]); 
01953       fRecoChargeHist[0]->Draw("bar hist same");
01954 
01955       chargepad[2]->cd();
01956       fChargeHist[2]->Draw("hbar hist");
01957       fRecoChargeHist[2]->RecursiveRemove(fTrkRecoChargeHist[2]);
01958       fRecoChargeHist[2]->RecursiveRemove(fShwRecoChargeHist[2]); 
01959 
01960       fRecoChargeHist[2]->Add(fTrkRecoChargeHist[2]);
01961       fRecoChargeHist[2]->Add(fShwRecoChargeHist[2]); 
01962       fRecoChargeHist[2]->Draw("hbar hist same");     
01963     }
01964 }

void EVD::UpdateColorButtonTitle (  )  [private]
void EVD::UpdateGfxObjects ( GraphicsView::GraphicsView_t  view  ) 

Definition at line 1181 of file EVD.cxx.

References done(), fDrawAll, fDrawGhosts, fGfxList, fMint, fNumSlices, fPad, fSlice, it, and ViewIndex().

Referenced by UpdateCanvas().

01182 {
01183   Int_t ind=ViewIndex(view);
01184   fPad[ind]->cd(); 
01185   GfxList::iterator it, done = fGfxList.end();
01186   if(fSlice>=0 && fNumSlices>1){
01187     fDrawAll=false;
01188     fDrawGhosts=true;
01189     for (it = fGfxList.begin(); it != done; ++it) {
01190       if (it->second.graphicsview_type == view) {
01191         it->first->Configure(*fMint);
01192         it->first->Draw();
01193       }
01194     }
01195     fDrawGhosts=false;
01196     for (it = fGfxList.begin(); it != done; ++it) {
01197       if (it->second.graphicsview_type == view) {
01198         //      it->first->Configure(*fMint);
01199         it->first->Draw();
01200       }
01201     }
01202   }
01203   else{
01204     fDrawAll=true;
01205     for (it = fGfxList.begin(); it != done; ++it) {
01206       if (it->second.graphicsview_type == view) {
01207         it->first->Configure(*fMint);
01208         it->first->Draw();
01209       }
01210     }
01211   }
01212 }

void EVD::UpdateSummary (  ) 

Definition at line 2175 of file EVD.cxx.

References CandCalDetPIDHandle::AsString(), fCandEvent, fCandSlice, fEvent, CandRecord::FindCandHandle(), RecDataRecord< T >::FindComponent(), fMint, fNumEvents, fNumSlices, fSlice, TruthHelper::GetBestEventNeuMatch(), TruthHelper::GetBestShowerNeuMatch(), TruthHelper::GetBestTrackIdMatch(), CandEventHandle::GetCandSlice(), CandRecoHandle::GetCandSlice(), CandSliceHandle::GetCharge(), CandRecoHandle::GetCharge(), CandFitTrackHandle::GetChi2(), CandHandle::GetDaughterIterator(), Mint::GetDetector(), CandRecoHandle::GetDirCosU(), CandRecoHandle::GetDirCosV(), CandTrackHandle::GetdS(), CandFitTrackHandle::GetEMCharge(), CandShowerHandle::GetEnergy(), MomNavigator::GetFragment(), Mint::GetJint(), Mint::GetJobC(), Jint::GetMom(), CandTrackHandle::GetMomentum(), CandFitTrackHandle::GetMomentumCurve(), CandFitTrackHandle::GetMomentumRange(), CandHandle::GetNDaughters(), TruthHelper::GetNeuId(), TruthHelper::GetP4El1(), TruthHelper::GetP4Mu1(), TruthHelper::GetP4Mu2(), TruthHelper::GetP4Neu(), TruthHelper::GetP4Shw(), CandFitTrackHandle::GetPass(), DataUtil::GetRunSnarlEvent(), Mint::GetShowers(), Mint::GetTracks(), RawDaqSnarlHeader::GetTrigSrc(), CandRecoHandle::GetVtxU(), CandRecoHandle::GetVtxV(), CandRecoHandle::GetVtxZ(), CandHandle::IsCloneOf(), Detector::kFar, Detector::kNear, CalStripType::kPE, JobC::Mom, nTracks, REROOT_NeuKin::P4El1(), REROOT_NeuKin::P4Mu1(), REROOT_NeuKin::P4Neu(), REROOT_NeuKin::P4Shw(), run(), TruthHelper::ShowerCompleteness(), TruthHelper::ShowerPurity(), TextPad, tline, TruthHelper::TrackCompleteness(), and TruthHelper::TrackPurity().

Referenced by Init(), and Update().

02176 {
02177 
02178   /* Here we write to the summary pad a short summary of the reconstruction
02179      results.  If there is a SimSnarlRecord available, we assume that this
02180      is MC data, and write out some NeuKine summary stuff. 
02181   */
02182 
02183 
02184   if(!fMint) return;
02185   
02186  float textsize=0.08;
02187   TextPad->cd();
02188   TextPad->Clear();
02189 
02190   CandRecord* candrec = dynamic_cast<CandRecord*>
02191     (fMint->GetJobC().Mom.GetFragment("CandRecord", "PrimaryCandidateRecord")); 
02192 
02193   if (candrec==0) {
02194     return ;
02195   }
02196 
02197   
02198   Int_t bestNeu=-1;
02199   Bool_t simulation = false;
02200   SimSnarlRecord *ssr = 
02201     dynamic_cast<SimSnarlRecord*>(fMint->GetJobC().Mom.GetFragment("SimSnarlRecord"));
02202   if (ssr) simulation=true; 
02203 
02204   // highlight text box color if in spill
02205   RawDaqSnarlHeader *rdsh=   
02206     dynamic_cast<RawDaqSnarlHeader*>(fMint->GetJobC().Mom.GetFragment("RawDaqSnarlHeader"));
02207   if (rdsh){
02208     // check header for spill flag
02209     if((rdsh->GetTrigSrc()==0x20000 && fMint->GetDetector() == Detector::kFar) ||(rdsh->GetTrigSrc()==0x10000 && fMint->GetDetector() == Detector::kNear)){
02210       TextPad->SetFillColor(2);
02211     }     
02212     else{
02213       TextPad->SetFillColor(17);
02214     }
02215   }
02216   
02217   TruthHelper truthHelp(&(fMint->GetJobC().Mom));
02218   int nLine=1;
02219   int run=0, snarl=0, event=0;
02220   DataUtil::GetRunSnarlEvent(&(fMint->GetJobC().Mom), run, snarl, event);
02221   
02222   int nTracks=0;
02223   int nShowers=0;
02224   int nEvents=0;
02225 
02226   CandTrackHandle * primtrack=0; 
02227   CandShowerHandle * primshw=0;
02228   CandShowerListHandle* showerlisthandle=0;
02229   CandTrackListHandle* tracklisthandle=0;
02230   /*
02231   if(fLastButtonType==2){
02232     fEvent++;
02233     fCandEvent=ReadCandEvent();
02234     fEvent--;
02235   }
02236   */
02237   Bool_t usefinder=false;
02238   if(fCandEvent){
02239     CandEventListHandle* eventlisthandle =
02240       dynamic_cast<CandEventListHandle*>
02241       (candrec->FindCandHandle("CandEventListHandle"));
02242     if (eventlisthandle) {
02243       TIter eventItr(eventlisthandle->GetDaughterIterator());
02244       while (CandEventHandle *event = dynamic_cast<CandEventHandle*>
02245              (eventItr())) {
02246         nEvents++;
02247         if(fCandEvent==event){ 
02248           primtrack=event->GetPrimaryTrack();
02249           if(primtrack){
02250             if(primtrack->GetNDaughters()==0 && 
02251                primtrack->InheritsFrom("CandFitTrackHandle") &&  
02252                dynamic_cast<CandFitTrackHandle*>(primtrack)->GetFinderTrack()){
02253               primtrack = dynamic_cast<CandFitTrackHandle*>(primtrack)->GetFinderTrack();
02254               usefinder=true;
02255             }
02256           }
02257           primshw=event->GetPrimaryShower();
02258           nTracks=event->GetLastTrack()+1;
02259           nShowers=event->GetLastShower()+1;
02260         }
02261       }
02262     } 
02263   }
02264   else{
02265     tracklisthandle = fMint->GetTracks();
02266     if (tracklisthandle){   
02267       Float_t maxscore=-1e6;
02268       TIter trackItr(tracklisthandle->GetDaughterIterator());
02269       while (CandTrackHandle *track = dynamic_cast<CandTrackHandle*>
02270              (trackItr())){
02271         if(track){
02272           CandSliceHandle slc1 =  *(track->GetCandSlice());
02273           CandSliceHandle slc2;
02274           if(fCandSlice)slc2=*(fCandSlice);
02275           if(slc1==slc2 || !fCandSlice || slc1.IsCloneOf(slc2)){
02276             if(track->GetNDaughters()==0 && 
02277                track->InheritsFrom("CandFitTrackHandle") &&  
02278                dynamic_cast<CandFitTrackHandle*>(track)->GetFinderTrack()){
02279               track = dynamic_cast<CandFitTrackHandle*>(track)->GetFinderTrack();
02280               usefinder=true;
02281             }       
02282             nTracks++;
02283             if(TMath::Abs(track->GetScore())>=maxscore){
02284               maxscore=track->GetScore();
02285               primtrack=track;
02286             }
02287           }
02288         }
02289       }
02290     }
02291     showerlisthandle = fMint->GetShowers();
02292     if (showerlisthandle) {
02293       TIter showerItr(showerlisthandle->GetDaughterIterator());
02294       while (CandShowerHandle *shower = dynamic_cast<CandShowerHandle*>
02295              (showerItr())){
02296         if(shower){
02297           CandSliceHandle slc1 =  *(shower->GetCandSlice());
02298           CandSliceHandle slc2;
02299           if(fCandSlice)slc2=*(fCandSlice);
02300           if(slc1==slc2 || !fCandSlice || slc1.IsCloneOf(slc2)){
02301             nShowers++;
02302           }
02303         }
02304       }
02305     }
02306   }
02307  
02308 
02309  
02310 
02311   char * cline = new char[80];
02312 
02313   if(fNumSlices>0){
02314     if(fSlice>=0 || fEvent>=0){
02315       if(fCandEvent){
02316         sprintf(cline,"Run: %d    Snarl:  %d    Slice:  %d of %d   Event: %d of %d",run,snarl,fSlice+1,fNumSlices,fEvent+1,fNumEvents);
02317       }
02318       else{
02319         sprintf(cline,"Run: %d    Snarl:  %d    Slice:  %d of %d   All %d Events",run,snarl,fSlice+1,fNumSlices,fNumEvents);
02320       }
02321     }
02322     else{
02323       sprintf(cline,"Run: %d        Snarl:  %d        All  %d Slices",run,snarl,fNumSlices);
02324     }
02325   }
02326   else{
02327     sprintf(cline,"Run: %d        Snarl:  %d        No Slice Found",run,snarl);
02328   }
02329   Int_t ntline=0;
02330   cline[79]=0;
02331   tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02332   nLine+=2;
02333   tline[ntline]->SetTextFont(62);
02334   tline[ntline]->SetTextSize(textsize);
02335   tline[ntline]->Draw();
02336   ntline++;
02337 
02338   sprintf(cline,"Reconstruction Summary");
02339   cline[79]=0;
02340   tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02341   nLine++;
02342   tline[ntline]->SetTextFont(52);
02343   tline[ntline]->SetTextSize(textsize);
02344   tline[ntline]->Draw();
02345   ntline++;
02346 
02347   sprintf(cline,"# Tracks:  %d        # Showers: %d",nTracks,nShowers);
02348   cline[79]=0;
02349   tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02350   nLine+=2;
02351   tline[ntline]->SetTextFont(42);
02352   tline[ntline]->SetTextSize(textsize);
02353   tline[ntline]->Draw();
02354   ntline++;
02355   if(fNumSlices>0 && fSlice<0 && fEvent<0) return;   // looking at all slices in overlay
02356 
02357   if(primtrack){
02358     CandFitTrackHandle *fittrack = 0;
02359     CandFitTrackSRHandle *fittracksr = 0;
02360     float P = primtrack->GetMomentum();
02361     if (primtrack->InheritsFrom("CandFitTrackHandle")) {
02362       fittrack = dynamic_cast<CandFitTrackHandle*>(primtrack);
02363     }
02364     if (primtrack->InheritsFrom("CandFitTrackSRHandle")) {
02365       fittracksr = dynamic_cast<CandFitTrackSRHandle*>(primtrack);
02366     }
02367     float length=primtrack->GetdS();
02368     float vtxX = (primtrack->GetVtxU()-primtrack->GetVtxV())/TMath::Sqrt(2.);
02369     float vtxY = (primtrack->GetVtxU()+primtrack->GetVtxV())/TMath::Sqrt(2.);
02370     float vtxZ = primtrack->GetVtxZ();
02371     float cosTheta = -(primtrack->GetDirCosU()+primtrack->GetDirCosV())/TMath::Sqrt(2.);
02372     
02373     float Pfit=0;
02374     float chi2=0;
02375     Int_t pass=0;
02376     if(fittrack){
02377       Pfit= fittrack->GetMomentumCurve()*fittrack->GetEMCharge();
02378       chi2= fittrack->GetChi2();
02379       P = fittrack->GetMomentumRange();
02380       pass=fittrack->GetPass();
02381     }
02382     Float_t purity = 0.0;
02383     Float_t completeSlice=0.0;
02384     Float_t completeAll=0.0;
02385    
02386     if(simulation){
02387       CandTrackHandle trk = *primtrack;
02388       Int_t bestTrack = truthHelp.GetBestTrackIdMatch(trk);
02389       bestNeu = truthHelp.GetNeuId(bestTrack);
02390       purity = truthHelp.TrackPurity(trk,bestTrack);
02391       completeAll = truthHelp.TrackCompleteness(trk);   
02392       CandSliceHandle slc;
02393       if(fCandEvent){
02394         slc = * fCandEvent->GetCandSlice();
02395       }
02396       else if(fCandSlice){
02397         slc = * fCandSlice;
02398       }
02399       else if(fNumSlices==1){
02400         slc = * trk.GetCandSlice();
02401       }
02402       if(fCandSlice || fCandEvent || fNumSlices==1){  
02403         completeSlice = truthHelp.TrackCompleteness(trk,slc);
02404         
02405       }
02406     }
02407     if(!usefinder){
02408       sprintf(cline,
02409               "Primary Track>  Len:%5.1f Range E:%5.1f GeV Fit P:%5.1f GeV",
02410               length,
02411               P,
02412               Pfit
02413               );
02414     }
02415     else{
02416       sprintf(cline,
02417               "(Finder) Primary Track>  Len:%5.1f Range E:%5.1f GeV",
02418               length,
02419               P
02420               );
02421     }
02422  
02423     cline[79]=0;
02424     tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02425     nLine++;
02426     tline[ntline]->SetTextFont(42);
02427     tline[ntline]->SetTextSize(textsize);
02428     tline[ntline]->Draw();
02429     ntline++;
02430     if(simulation){
02431       sprintf(cline,
02432               " Purity:%5.2f Compl.(Slice):%5.2f Compl.(All):%5.2f Pass:%1d",
02433             purity,completeSlice,completeAll,pass);
02434     }
02435     else{
02436       sprintf(cline,
02437             "   Vertex: (%3.1f,%3.1f,%3.1f) cos#theta: %3.2f Pass: %1d",
02438             vtxX, vtxY, vtxZ, cosTheta, pass);
02439     }
02440     cline[79] = 0;
02441     tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02442     nLine++;
02443     tline[ntline]->SetTextFont(42);
02444     tline[ntline]->SetTextSize(textsize);
02445     tline[ntline]->Draw();
02446     ntline++;
02447   }
02448   float PEs=0;
02449   float Gev=0;
02450   Float_t purity=0;
02451   Float_t completeSlice=0.0;
02452   Float_t completeAll=0.0;
02453   if(primshw){
02454     PEs = primshw->GetCharge(CalStripType::kPE);
02455     Gev = primshw->GetEnergy();
02456     if(simulation){
02457       CandShowerHandle shw= *primshw;
02458       Int_t neuId=  truthHelp.GetBestShowerNeuMatch(shw);
02459       if(bestNeu==-1) bestNeu=neuId;
02460       purity =  truthHelp.ShowerPurity(shw, neuId);
02461       completeAll = truthHelp.ShowerCompleteness(shw); 
02462       CandSliceHandle slc;
02463       if(fCandEvent){
02464         slc = * fCandEvent->GetCandSlice();
02465       }
02466       else if(fCandSlice){
02467         slc = * fCandSlice;
02468       }
02469       if(fCandSlice || fCandEvent){
02470         completeSlice = truthHelp.ShowerCompleteness(shw,slc);
02471 
02472       }
02473     }
02474   }
02475   else if( showerlisthandle){
02476     
02477     TIter showerItr(showerlisthandle->GetDaughterIterator());
02478     nShowers=showerlisthandle->GetNDaughters();
02479     while (CandShowerHandle *shower = dynamic_cast<CandShowerHandle*>
02480            (showerItr())){
02481       if(shower){
02482         CandSliceHandle slc1 =  *(shower->GetCandSlice());
02483         CandSliceHandle slc2;
02484         if(fCandSlice)slc2= *(fCandSlice);
02485         if(slc1==slc2 || !fCandSlice || slc1.IsCloneOf(slc2)){
02486           if(shower->GetEnergy()>Gev){
02487             PEs = shower->GetCharge(CalStripType::kPE);
02488             Gev = shower->GetEnergy();
02489             if(simulation){
02490               CandShowerHandle shw= *shower;
02491               Int_t neuId=  truthHelp.GetBestShowerNeuMatch(shw);
02492               if(bestNeu==-1) bestNeu=neuId;
02493               purity =  truthHelp.ShowerPurity(shw, neuId);
02494               completeAll = truthHelp.ShowerCompleteness(shw);
02495               CandSliceHandle slc;
02496               if(fCandEvent){
02497                 slc = * fCandEvent->GetCandSlice();
02498               }
02499               else if(fCandSlice){
02500                 slc = * fCandSlice;
02501               }
02502               else if (fNumSlices==1){
02503                 slc = * shw.GetCandSlice();
02504               }
02505               if(fCandSlice || fCandEvent || fNumSlices==1){          
02506                 completeSlice = truthHelp.ShowerCompleteness(shw,slc);
02507               }
02508             }
02509           }  
02510         }
02511       }
02512     }
02513   }  
02514   sprintf(cline,"Primary Shower> PEs:%6.1f  Energy:%6.2f GeV",
02515           PEs,
02516           Gev
02517           );   
02518   cline[79]=0;
02519   tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02520   nLine++;
02521   tline[ntline]->SetTextFont(42);
02522   tline[ntline]->SetTextSize(textsize);
02523   tline[ntline]->Draw();
02524   ntline++;
02525   if(simulation){
02526     sprintf(cline,
02527             "   Purity:%5.2f   Complete(Slice):%5.2f   Complete(All):%5.2f",
02528             purity,completeSlice,completeAll);
02529     cline[79]=0;
02530     tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02531     nLine++;
02532     tline[ntline]->SetTextFont(42);
02533     tline[ntline]->SetTextSize(textsize);
02534     tline[ntline]->Draw();
02535     ntline++;
02536   }
02537   
02538   nLine++;
02539   const MomNavigator* mom = fMint->GetJint().GetMom();
02540   if(mom)
02541     {
02542       if (simulation) 
02543         {
02544           sprintf(cline,"Monte Carlo Event. Generator Summary");
02545           tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02546           nLine++;
02547           tline[ntline]->SetTextFont(52);
02548           tline[ntline]->SetTextSize(textsize);
02549           tline[ntline]->Draw();
02550           ntline++;
02551          
02552           const REROOT_NeuKin* kin = 
02553             dynamic_cast<const REROOT_NeuKin*>
02554             (ssr->FindComponent("REROOT_NeuKin"));
02555           (ssr->FindComponent("TClonesArray","StdHep"));
02556        
02557           if(fCandEvent) bestNeu=truthHelp.GetBestEventNeuMatch(*fCandEvent);
02558           if(bestNeu!=-1){
02559             sprintf(cline,"Pnu=%6.2f  Eshwr=%6.2f  Pmu=%6.2f Pmu2=%6.2f  Pmu2Eele=%6.2f",   
02560                     truthHelp.GetP4Neu(bestNeu)[3],
02561                     truthHelp.GetP4Shw(bestNeu)[3],
02562                     truthHelp.GetP4Mu1(bestNeu)[3],
02563                     truthHelp.GetP4Mu2(bestNeu)[3],
02564                     truthHelp.GetP4El1(bestNeu)[3]);
02565           }
02566           else if(kin){
02567             sprintf(cline,"Pnu=%6.2f  Eshwr=%6.2f  Pmu=%6.2f  Eele=%6.2f",   
02568                     kin->P4Neu()[3],
02569                     kin->P4Shw()[3],
02570                     kin->P4Mu1()[3],
02571                     kin->P4El1()[3]);
02572           }
02573           cline[79]=0;      
02574           tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02575           nLine+=2;
02576           tline[ntline]->SetTextFont(42);
02577           tline[ntline]->SetTextSize(textsize);
02578           tline[ntline]->Draw();
02579           ntline++;
02580         }
02581     }
02582   
02583   CandCalDetPIDHandle * PIDh = DataUtil::GetCandidate<CandCalDetPIDHandle>
02584     (&(fMint->GetJobC().Mom),"CandCalDetPIDHandle");
02585   if(PIDh){
02586     sprintf(cline,"CalDet Particle ID Summary");
02587     tline[ntline] = new TText(textsize,1-nLine*textsize,cline);
02588     nLine++;
02589     tline[ntline]->SetTextFont(52);
02590     tline[ntline]->SetTextSize(textsize);
02591     tline[ntline]->Draw();
02592     ntline++;
02593     const char * c1 = PIDh->AsString().c_str();
02594     tline[ntline] = new TText(textsize,1-nLine*textsize,c1);
02595     nLine++;
02596     tline[ntline]->SetTextFont(42);
02597     tline[ntline]->SetTextSize(textsize);
02598     tline[ntline]->Draw();
02599     ntline++;
02600   }
02601   
02602     
02603 }

void EVD::UpdateTime (  ) 

Definition at line 1102 of file EVD.cxx.

References ViewState::color_is_time, ColorSemanticHandler(), fCandEvent, fCandSlice, fLastButtonType, fMint, fPad, fSnarl, fViewState, Mint::GetJobC(), DataUtil::GetRunSnarlEvent(), GraphicsView::kUZ, GraphicsView::kVZ, GraphicsView::kXY, JobC::Mom, ReadCandEvent(), ReadCandSlice(), run(), UpdateCanvas(), and UpdateView().

Referenced by Init().

01103 {
01104   if (!fMint) return;
01105   fPad[0]->SetEditable(true);
01106   fPad[1]->SetEditable(true);
01107   fPad[2]->SetEditable(true);
01108 
01109   int run=0, snarl=0, event=0;
01110   DataUtil::GetRunSnarlEvent(&(fMint->GetJobC().Mom), run, snarl, event);
01111   if(snarl!=fSnarl){
01112     return;
01113    }
01114 
01115   if(fViewState[0]->GetColorSemantic()==ViewState::color_is_time){
01116     ColorSemanticHandler(0);
01117   }
01118   if(fViewState[1]->GetColorSemantic()==ViewState::color_is_time){
01119     ColorSemanticHandler(1);
01120   }
01121 
01122   if(fLastButtonType!=2)fCandEvent=0;
01123   
01124   UpdateView(GraphicsView::kUZ);
01125   UpdateView(GraphicsView::kVZ);
01126   UpdateView(GraphicsView::kXY);
01127    
01128   UpdateCanvas(); 
01129 
01130   fCandSlice=ReadCandSlice();
01131   fCandEvent=ReadCandEvent();
01132 }

void EVD::UpdateView ( GraphicsView::GraphicsView_t  view  )  [private]

Definition at line 1217 of file EVD.cxx.

References Munits::cm, ViewState::color_is_charge, Det, SteelOutline::Draw(), DisplayOptions::DrawVS(), DrawVS(), fColorButton, fMint, fPad, fViewState, Mint::GetDetector(), GetDisplayOptions(), UgliGeomHandle::GetScintPlnHandleVector(), UgliGeomHandle::GetTransverseExtent(), Mint::GetUgliGeomHandle(), UgliGeomHandle::GetZExtent(), UgliGeomHandle::IsValid(), Detector::kCalDet, Detector::kFar, Detector::kNear, CalDigitType::kNone, CalDigitType::kPE, CalDigitType::kSigCorr, CalDigitType::kSigLin, PlaneView::kU, Detector::kUnknown, GraphicsView::kUZ, PlaneView::kV, GraphicsView::kVZ, ViewState::metric_is_discreet, Outline, SM1, SM2, and ViewIndex().

Referenced by Update(), and UpdateTime().

01218 {
01219 
01220   Int_t ind=ViewIndex(view);
01221 
01222   fPad[ind]->cd();
01223 
01224   if (!fMint) return;
01225   if(fViewState[ind]->GetColorSemantic()==ViewState::color_is_charge){
01226     if(GetDisplayOptions()->ChargeType()==CalDigitType::kNone){
01227       fColorButton[0]->SetTitle("UZ ADC");      
01228       fColorButton[1]->SetTitle("VZ ADC");
01229     }
01230     if(GetDisplayOptions()->ChargeType()==CalDigitType::kPE){
01231       fColorButton[0]->SetTitle("UZ PE");      
01232       fColorButton[1]->SetTitle("VZ PE");
01233     }
01234     if(GetDisplayOptions()->ChargeType()==CalDigitType::kSigLin){
01235       fColorButton[0]->SetTitle("UZ SigLin");      
01236       fColorButton[1]->SetTitle("VZ SigLin");
01237     }
01238     else if(GetDisplayOptions()->ChargeType()==CalDigitType::kSigCorr){
01239       fColorButton[0]->SetTitle("UZ SigCor");      
01240       fColorButton[1]->SetTitle("VZ SigCor");
01241     }
01242   } 
01243  
01244   if (fMint->GetDetector() == Detector::kUnknown) return;
01245   UgliGeomHandle ugh = fMint->GetUgliGeomHandle();
01246   if (! ugh.IsValid()) {
01247     cerr << "EVD::UpdateView: no valid geometry\n";
01248     return;
01249   }
01250     
01251   if (fViewState[ind]->GetSpatialMetric() == ViewState::metric_is_discreet) 
01252     {
01253       vector<UgliScintPlnHandle> usphv = ugh.GetScintPlnHandleVector();
01254       vector<UgliScintPlnHandle>::reverse_iterator rit, rdone = usphv.rend();
01255       
01256       for (rit = usphv.rbegin(); rit != rdone; ++rit) {
01257 
01258         if (! rit->GetPlexPlaneId().IsVetoShield()) break;
01259       }
01260       if (rit == rdone) 
01261         {
01262           cerr << "EVD::FullZoom: WTF, can't get last plane!\n";
01263           return;
01264         }
01265       
01266       int first_plane = usphv[0].GetPlaneNumber();
01267       int last_plane = rit->GetPlaneNumber();
01268       int mid_plane=248;
01269       if(fMint->GetDetector() == Detector::kNear)mid_plane=121;
01270       else if(fMint->GetDetector() == Detector::kCalDet)mid_plane=0;
01271 
01272       
01273       if(view==GraphicsView::kUZ || view==GraphicsView::kVZ)
01274         {
01275           int n_strips = usphv[0].NumberOfStrips();
01276           
01277           Double_t xDet[7]={first_plane,last_plane,last_plane,
01278                             first_plane,first_plane,mid_plane,mid_plane};
01279           Double_t yDet[7]={0,0,n_strips,n_strips,0,0,n_strips};
01280           
01281           Det[ind] = new TPolyLine(7,xDet,yDet);        
01282           Det[ind]->SetLineColor(10);
01283           Det[ind]->SetLineWidth(2);
01284           Det[ind]->SetFillStyle(0);
01285           Det[ind]->Draw(); 
01286         }
01287     }
01288   else 
01289     {
01290       float tmin, tmax, zmin, zmax;
01291       ugh.GetZExtent(zmin,zmax);
01292       
01293       if(ind==0){
01294         ugh.GetTransverseExtent(PlaneView::kU,tmin,tmax);
01295       }
01296       else{
01297         ugh.GetTransverseExtent(PlaneView::kV,tmin,tmax);
01298       }
01299       
01300       
01301       if(view==GraphicsView::kUZ || view==GraphicsView::kVZ){     
01302         if(fMint->GetDetector() == Detector::kFar)
01303           {
01304             
01305             Float_t spacing=5.94*Munits::cm;
01306             Float_t SM1zEnd=spacing*248;
01307             Float_t SM2zStart=SM1zEnd+125.*Munits::cm;
01308             
01309             Double_t xSM1[5]={zmin,SM1zEnd,SM1zEnd,zmin,zmin};
01310             Double_t ySM1[5]={tmin,tmin,tmax,tmax,tmin};
01311             
01312             SM1[ind] = new TPolyLine(5,xSM1,ySM1);
01313             SM1[ind]->SetLineColor(10);
01314             SM1[ind]->SetLineWidth(2);
01315             SM1[ind]->SetFillStyle(0);
01316             SM1[ind]->Draw();
01317             
01318             Double_t xSM2[5]={SM2zStart,zmax,zmax,SM2zStart,SM2zStart};
01319             Double_t ySM2[5]={tmin,tmin,tmax,tmax,tmin};
01320             
01321             SM2[ind] = new TPolyLine(5,xSM2,ySM2);      
01322             
01323             SM2[ind]->SetLineColor(10);
01324             SM2[ind]->SetLineWidth(2);
01325             SM2[ind]->SetFillStyle(0);
01326             SM2[ind]->Draw();
01327           }
01328         else
01329           {
01330             Double_t xDet[5]={zmin,zmax,zmax,zmin,zmin};
01331             Double_t yDet[5]={tmin,tmin,tmax,tmax,tmin};
01332             
01333             Det[ind] = new TPolyLine(5,xDet,yDet);
01334             Det[ind]->SetLineColor(10);
01335             Det[ind]->SetLineWidth(2);
01336             Det[ind]->SetFillStyle(0);
01337             Det[ind]->Draw();
01338           }
01339       }
01340       else{
01341         Outline = new SteelOutline((fMint->GetDetector()));
01342         Outline->Draw();
01343         
01344         if(fMint->GetDetector()==Detector::kFar  && GetDisplayOptions()->DrawVS())DrawVS();
01345       }
01346     }
01347 }

int EVD::ViewIndex ( GraphicsView::GraphicsView_t  view  ) 

Definition at line 1172 of file EVD.cxx.

References GraphicsView::kUV, GraphicsView::kUZ, GraphicsView::kVZ, and GraphicsView::kXY.

Referenced by UpdateGfxObjects(), and UpdateView().

01173 {
01174   if(view==GraphicsView::kUZ)return 0;
01175   if(view==GraphicsView::kVZ)return 1;
01176   if(view==GraphicsView::kUV)return 2;
01177   if(view==GraphicsView::kXY)return 2;
01178   return 2;
01179 }

void EVD::ZoomTimetoSlice (  ) 

Definition at line 1064 of file EVD.cxx.

References MuELoss::e, fCandEvent, fCandSlice, fMint, CandHandle::GetDaughterIterator(), Mint::GetTimeRange(), Range< TYPE >::Max(), Range< TYPE >::Min(), and Range< TYPE >::Set().

Referenced by Update().

01064                          {
01065   Double_t minTime= fMint->GetTimeRange().Min();
01066   Double_t maxTime= fMint->GetTimeRange().Max();
01067 
01068   Double_t newminTime=1e9;
01069   Double_t newmaxTime=-1e9;
01070   if(fCandSlice){
01071     TIter stripItr(fCandSlice->GetDaughterIterator());  
01072     while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>
01073            (stripItr())) {
01074       if(strip->GetTime()<newminTime) newminTime=strip->GetTime();
01075 
01076       if(strip->GetTime()>newmaxTime) newmaxTime=strip->GetTime();
01077     }
01078     newminTime -=50e-9;
01079     newmaxTime +=20e-9;
01080     
01081     if(newminTime<newmaxTime && (newminTime!=minTime || newmaxTime!=maxTime)){
01082       fMint->GetTimeRange().Set(newminTime,newmaxTime);
01083     }
01084   }
01085   else if(fCandEvent){
01086     TIter stripItr(fCandEvent->GetDaughterIterator());  
01087     while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>
01088            (stripItr())) {
01089       if(strip->GetTime()<newminTime) newminTime=strip->GetTime();
01090       if(strip->GetTime()>newmaxTime) newmaxTime=strip->GetTime();
01091     }
01092     newminTime -=50e-9;
01093     newmaxTime +=20e-9;
01094     
01095     if(newminTime<newmaxTime&& (newminTime!=minTime || newmaxTime!=maxTime)){
01096       fMint->GetTimeRange().Set(newminTime,newmaxTime);
01097     }
01098   }  
01099 }


Member Data Documentation

Definition at line 147 of file EVD.h.

TPad* EVD::chargepad[3] [private]

Definition at line 149 of file EVD.h.

Referenced by InitChargeHists(), UpdateCanvas(), and UpdateChargeHists().

TPolyLine* EVD::Det[2] [private]

Definition at line 166 of file EVD.h.

Referenced by UpdateView().

TH1F* EVD::fChargeHist[3] [private]

Definition at line 150 of file EVD.h.

Referenced by InitChargeHists(), and UpdateChargeHists().

Definition at line 127 of file EVD.h.

Referenced by ColorSemanticHandler(), Init(), and SetChargeRange().

Bool_t EVD::fClear [private]

Definition at line 180 of file EVD.h.

Referenced by Clear(), FullZoom(), ToggleRealCoords(), and UpdateCanvas().

ColorAxis* EVD::fColorAxis[2] [private]

Definition at line 155 of file EVD.h.

Referenced by ColorSemanticHandler(), and Init().

SigC::Ptr<GfxButton> EVD::fColorButton[2] [private]

Definition at line 130 of file EVD.h.

Referenced by ColorSemanticHandler(), Init(), and UpdateView().

RangeControl<double>* EVD::fColorControl[2] [private]

Definition at line 158 of file EVD.h.

Referenced by GetColorRangeControl(), and Init().

SigC::Ptr<CompositeRange<double> > EVD::fCompositeRange [private]

Definition at line 161 of file EVD.h.

Referenced by SelectionZoom().

Definition at line 119 of file EVD.h.

Referenced by BuildButtons(), and Digittext().

Definition at line 109 of file EVD.h.

Referenced by Digittext(), and GetDigitText().

Definition at line 113 of file EVD.h.

Referenced by Digittext(), MCtext(), MCTreetext(), and Recotext().

Definition at line 170 of file EVD.h.

Referenced by BuildMenus(), and GetDisplayOptions().

Bool_t EVD::fDrawAll [private]

Definition at line 181 of file EVD.h.

Referenced by GetDrawAll(), and UpdateGfxObjects().

Bool_t EVD::fDrawGhosts [private]

Definition at line 182 of file EVD.h.

Referenced by GetDrawGhosts(), and UpdateGfxObjects().

Int_t EVD::fEvent [private]

Definition at line 174 of file EVD.h.

Referenced by NextEvent(), NextSlice(), PrevEvent(), PrevSlice(), ReadCandEvent(), Update(), and UpdateSummary().

Definition at line 139 of file EVD.h.

Referenced by AddGfx(), and UpdateGfxObjects().

Int_t EVD::fGhostColor [private]

Definition at line 177 of file EVD.h.

Referenced by GetGhostColor().

Int_t EVD::fLastButtonType [private]

Definition at line 183 of file EVD.h.

Referenced by NextEvent(), NextSlice(), PrevEvent(), PrevSlice(), Update(), and UpdateTime().

Definition at line 116 of file EVD.h.

Referenced by BuildButtons(), and MCtext().

MCText* EVD::fMCText [private]

Definition at line 107 of file EVD.h.

Referenced by MCtext(), and Update().

Definition at line 110 of file EVD.h.

Referenced by Digittext(), MCtext(), MCTreetext(), and Recotext().

MCTree* EVD::fMCTree [private]

Definition at line 108 of file EVD.h.

Referenced by MCTreetext(), and Update().

Definition at line 118 of file EVD.h.

Referenced by BuildButtons(), and MCTreetext().

Definition at line 114 of file EVD.h.

Referenced by Digittext(), MCtext(), MCTreetext(), and Recotext().

Definition at line 112 of file EVD.h.

Mint* EVD::fMint [private]

Definition at line 122 of file EVD.h.

Referenced by BuildButtons().

Definition at line 120 of file EVD.h.

Referenced by BuildButtons().

Int_t EVD::fNumEvents [private]

Definition at line 175 of file EVD.h.

Referenced by NextEvent(), PrevEvent(), Update(), and UpdateSummary().

Int_t EVD::fNumSlices [private]

Definition at line 173 of file EVD.h.

Referenced by NextSlice(), PrevSlice(), Update(), UpdateGfxObjects(), and UpdateSummary().

ZoomPad* EVD::fPad[3] [private]

Definition at line 123 of file EVD.h.

Definition at line 121 of file EVD.h.

RangeAxis* EVD::fRangeAxis[5] [private]

Definition at line 156 of file EVD.h.

Referenced by Init(), and UpdateChargeHists().

std::vector<SigC::Connection> EVD::fRClist [private]

Definition at line 162 of file EVD.h.

Referenced by BlockRanges(), and Init().

Definition at line 117 of file EVD.h.

Referenced by BuildButtons(), and Recotext().

THStack* EVD::fRecoChargeHist[3] [private]

Definition at line 152 of file EVD.h.

Referenced by InitChargeHists(), and UpdateChargeHists().

Definition at line 106 of file EVD.h.

Referenced by Recotext(), and Update().

Definition at line 111 of file EVD.h.

Referenced by Digittext(), MCtext(), MCTreetext(), and Recotext().

TH1F* EVD::fShwRecoChargeHist[3] [private]

Definition at line 153 of file EVD.h.

Referenced by InitChargeHists(), and UpdateChargeHists().

Int_t EVD::fSlice [private]
Int_t EVD::fSnarl [private]

Definition at line 176 of file EVD.h.

Referenced by Update(), and UpdateTime().

RangeControl<double> * EVD::fSpatialControl[5] [private]

Definition at line 158 of file EVD.h.

Referenced by Init().

GuiBox* EVD::fTextBox [private]

Definition at line 115 of file EVD.h.

Referenced by Digittext(), MCtext(), MCTreetext(), and Recotext().

Bool_t EVD::fTimeZoom [private]

Definition at line 184 of file EVD.h.

Referenced by BuildMenus(), ToggleTimeZoom(), and Update().

TH1F* EVD::fTrkRecoChargeHist[3] [private]

Definition at line 154 of file EVD.h.

Referenced by InitChargeHists(), and UpdateChargeHists().

Definition at line 126 of file EVD.h.

Referenced by Init(), and Update().

SigC::Ptr<ViewState> EVD::fViewState[3] [private]
SigC::Ptr<UndoHistory> EVD::fZoomHistory [private]

Definition at line 160 of file EVD.h.

Referenced by Clear(), Init(), Rezoom(), SelectionZoom(), and Unzoom().

Definition at line 167 of file EVD.h.

Referenced by UpdateView().

TPolyLine* EVD::SM1[2] [private]

Definition at line 164 of file EVD.h.

Referenced by UpdateView().

TPolyLine* EVD::SM2[2] [private]

Definition at line 165 of file EVD.h.

Referenced by UpdateView().

TPad* EVD::TextPad [private]

Definition at line 145 of file EVD.h.

Referenced by Init(), and UpdateSummary().

TimeHist* EVD::TimeHst [private]

Definition at line 146 of file EVD.h.

TPad* EVD::TimePad [private]

Definition at line 142 of file EVD.h.

TGraph* EVD::TimevsY [private]

Definition at line 148 of file EVD.h.

TPad* EVD::TimevsYPad [private]

Definition at line 143 of file EVD.h.

TText* EVD::tline[100] [private]

Definition at line 125 of file EVD.h.

Referenced by UpdateSummary().

TList* EVD::VS [private]

Definition at line 168 of file EVD.h.


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1