NueDisplayModule Class Reference

#include <NueDisplayModule.h>

Inheritance diagram for NueDisplayModule:
JobCModule

List of all members.

Public Types

typedef std::deque< Float_t > DeqFloat_t
typedef std::deque< std::deque
< Int_t > > 
DeqDeqInt_t

Public Member Functions

 NueDisplayModule ()
virtual ~NueDisplayModule ()
virtual void BeginRun ()
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)
void AdjustOverlayRange (int range)
void MRShowMRStrips (int val)
void MRShowEvent (int val)

Private Member Functions

void DeleteOldCrap ()
void BuildDisplay ()
void UpdateDisplay (bool, bool)
void GetBasicInfo ()
Int_t GetEvent (Int_t evt)
void Analyze (Int_t evt)
void FillClusterGraphs ()
void DrawInteractionDiagram (Int_t)
void SetUpStripButtons ()
void IntRecoCalc ()
void NextEvent ()
void PrevEvent ()
void GotoEvent ()
void showmctruth ()
void plotmc ()
void delmc ()
void fixmcinfo ()
void PrintPads ()
void GenerateOverlayMultiGraphs ()
void UpdateOverlayGraphs (int evt)
void UpdateEventOverlayColors (int evt, TMultiGraph *mgr)
void UpdateSliceOverlayColors (int evt, TMultiGraph *mgr)
void GenerateMRMultiGraphs (int evtNum, vector< int > &MREvent, vector< int > &OldEvent)
void CreateMRMap (vector< int > &MRnewEvent, vector< int > &MRoldEvent)
int UpdateMRGraphs (int evt)
void FillEventGraph (NtpSREvent *Event, NtpStRecord *str, TMultiGraph *uzGraph, TMultiGraph *vzGraph, TString name="NULL")
void ResetMRGraphs ()
void FillMREventGraph (NtpMREvent *mrevt, NtpStRecord *str, TMultiGraph *uzGraph, TMultiGraph *vzGraph, int type)
void UpdateMREventOverlayColors (TMultiGraph *mgr)
void UpdateMREventStripColors (TMultiGraph *mgr)
void SetFrame (TMultiGraph *mg)
void DrawLowerMRCanvas ()
void DrawUpperMRCanvas ()
void GhostGraph (TGraph *gr)
void ColorGraph (TGraph *gr, int color, int style=8, Float_t size=0.8)
void UpdateMRInformation (int evt, vector< int > &MREvent, vector< int > &OldEvent)
void vote10 ()
void vote20 ()
void vote30 ()
void vote40 ()
void vote50 ()
void vote60 ()
void vote01 ()
void vote02 ()
void vote03 ()
void vote04 ()
void logvote ()
void makecomment ()
void updateEncoded ()
void OpenFileWrite ()
bool PassCuts ()
void SetCuts ()
void SetMode ()
void selec10 ()
void selec20 ()
void selec30 ()
void selec40 ()
void selec50 ()
void selec60 ()
void selec70 ()
void selec01 ()
void selec02 ()
void selec03 ()
void selec04 ()
void selec05 ()
void updateselec ()
void OpenFileRead ()
void NextSelEvt ()
void PrevSelEvt ()

Private Attributes

TCanvas * fCanvas0
TPad * fUVview
TPad * fButtonPad
TPad * fHistPad
TPad * fInfo0
TPad * fStdHepCan
TH2D * fUZview
TH2D * fVZview
TH2D * fTrkUZ
TH2D * fTrkVZ
TH2D * fShwUZ
TH2D * fShwVZ
TH2D * fSlcUZ
TH2D * fSlcVZ
TNtuple * ftrkshw
SteelOutlinefSteelOutline
TList * VS
TPolyLine * pu1_outline
TPolyLine * fu1_outline
TPolyLine * pv1_outline
TPolyLine * fv1_outline
TPolyLine * pu2_outline
TPolyLine * fu2_outline
TPolyLine * pv2_outline
TPolyLine * fv2_outline
TPolyLine * coil
StdHepInfo stdhepinfo
StdHepInfoAna shia
TButton * fZoom
TCanvas * fCanvas1
TPad * fBC
TPad * fHistcolz
TPad * fBL
TPad * fHistlego
TPad * fStdLeg
TH2D * fUZcolz
TH2D * fVZcolz
TH2D * fUZlego
TH2D * fVZlego
TButton * cbut [5]
TButton * lbut [5]
Int_t ifixc
Int_t ifixl
float evthighest_z
float evtlowest_z
float evthighest_t0
float evtlowest_t0
float evthighest_t1
float evtlowest_t1
TCanvas * fCanvas2
TPad * fFracVar_plots
TPad * fFracVar_info
TPad * fReco_plots
float highest_z
float lowest_z
float highest_t0
float lowest_t0
float highest_t1
float lowest_t1
FracVar fracvars
FracVarAna fva
TCanvas * fCanvas3
TPad * fShwfit_plots
TPad * fShwfit_plots_sub
TPad * fShwfit_info
Shwfit shwfit
ShwfitAna sfa
HitCalc hitcalc
HitCalcAna hca
TCanvas * fCanvas4
TPad * fAngClusterFitAna_plots
AngCluster angcluster
AngClusterAna aca
AngClusterFit angclusterfit
AngClusterFitAna acfa
TCanvas * fCanvas5
TMultiGraph * ssGraphU
TMultiGraph * ssGraphV
TLegend * cluLegU
TLegend * cluLegV
TCanvas * fCanvas6
TCanvas * fCanvas7
SelectPadfSelectPad1
SelectPadfSelectPad2
vector< TButton * > fStripButtonU
vector< TButton * > fStripButtonV
map< Int_t, Int_t > fStpIndexMapU
map< Int_t, Int_t > fStpIndexMapV
TArrow * fIntRecoLineU
TArrow * fIntRecoLineV
TH1F * fIntRecoHistU
TH1F * fIntRecoHistV
TH1F * fIntRecoHistZ
TH1F * fPredictedHistU
TH1F * fPredictedHistV
TH1F * fPredictedHistZ
TH2F * fUZPred
TH2F * fVZPred
TButton * fIntRecoDoSim
TCanvas * fCanvas8
THStack * TimeHst
TH1F * TimeHstTrk
TH1F * TimeHstShw
THStack * TimeHstUV
TH1F * TimeHstTrkU
TH1F * TimeHstTrkV
TH1F * TimeHstShwU
TH1F * TimeHstShwV
THStack * TimeHst2
TH1F * TimeHstTrk2
TH1F * TimeHstShw2
THStack * TimeHst2UV
TH1F * TimeHstTrk2U
TH1F * TimeHstTrk2V
TH1F * TimeHstShw2U
TH1F * TimeHstShw2V
TGraph * gr_dtds
TF1 * tfit_dt_ds_pos
TF1 * tfit_dt_ds_neg
TCanvas * fCanvas9
TMultiGraph * uzOverlayView
TMultiGraph * vzOverlayView
TMultiGraph * vzEventOverlay
TMultiGraph * uzEventOverlay
TMultiGraph * uzSliceOverlay
TMultiGraph * vzSliceOverlay
TLegend * leg
TBox * place [6]
TButton * fPlusMinusOne
TButton * fPlusMinusTwo
TButton * fFullSnarl
int kShowRange
TCanvas * fMRCanvas1
TPad * mrInfoPanel
TPad * mrGraphPad
TMultiGraph * uzMREventOverlay
TMultiGraph * vzMREventOverlay
TMultiGraph * uzMREventOld
TMultiGraph * vzMREventOld
TButton * fMRuShowAll
TButton * fMRuShowMR
TButton * fMRuShowOld
TLegend * fMRUpperLeg
TLegend * fMRLowerLeg
TButton * fMRdShowAll
TButton * fMRdShowTrueMu
TButton * fMRdShowTrueShw
TButton * fMRdShowScaled
TButton * fMRdShowReco
GuiTextButtonfNextEventbut
GuiTextButtonfPrevEventbut
Int_t clickbutton
GuiLabelfEventNo
GuiTextEntryfEventEntry
GuiTextButtonfCuts
GuiTextButtonfIO
GuiTextButtonfNextSelEvt
GuiTextButtonfPrevSelEvt
GuiTextButtonfMCTruth
GuiTextButtonfFixMCInfo
GuiTextButtonfIntRecoCalc1
GuiTextButtonfIntRecoCalc2
GuiTextButtonfPrint
Int_t RunNo
Int_t SubRunNo
Int_t fSlice
Int_t fNumSlices
Int_t fEvent
Int_t fEvent_old
Int_t fNumEvents
Int_t fSnarl
Int_t RunNo_old
Int_t SubRunNo_old
Detector::Detector_t fDetectorType
SimFlag::SimFlag_t fSimFlag
NueAnalysisCuts fCut
NtpSRRecordsr
NtpMCRecordmc
NtpTHRecordth
NueRecordnr
NtpStRecordst
NtpMRRecordmr
NtpStRecordstOld
NtpSREventeventOld
NtpMCTruthmctruthOld
NtpSREventevent
NtpMCTruthmctruth
NtpTHEventthevent
bool foundvrmatch
bool foundpidmatch
bool foundSR
bool foundMC
bool foundTH
bool foundST
bool foundMR
bool foundSTOld
TLatex * info1
TLatex * info2
TLatex * info3
TLatex * info4
TLatex * info41
TLatex * info5
TLatex * info6
TLatex * info7
TLatex * info8
TLatex * info9
TLatex * info10
TLatex * info11
TLatex * info12
TLatex * info13
TLatex * mrInfo1
TLatex * mrInfo2
TLatex * mrInfo3
TLatex * mrInfo4
TLatex * mrInfo5
TLatex * mrInfo6
TLatex * mrInfo7
TLatex * mrInfo8
TLatex * mrInfo9
TMarker * mcvtx_u
TMarker * mcvtx_v
TMarker * srvtx_u
TMarker * srvtx_v
TMarker * srvtx_xy
int imctruth
vector< TLine * > paru
vector< TLine * > parv
int ifixmcinfo
bool showStpTrueMu
bool showStpTrueShw
bool showStpScaled
bool showStpRecoTrk
bool showStpAll
bool showNewEvent
bool showMREvent
bool showOrigEvent
Int_t kDPlaneCut
Int_t kLoPhNStripCut
Int_t kLoPhNPlaneCut
Float_t kPhStripCut
Float_t kPhPlaneCut
Float_t kCPhPlaneCut
Float_t kPIDCut
Int_t kScanMode
Int_t kTestMode
Int_t kHideRunSnarl
Int_t kDrawClu
Int_t kIntReco
bool foundmeu
float SIGMAPMEU
GuiBoxfHBox
GuiBoxfVBox1
GuiBoxfVBox2
GuiBoxfVBox3
GuiBoxfHBox1
GuiBoxfHBox2
GuiBoxfHBox3
GuiBoxfHBox4
GuiBoxfHBox5
GuiBoxfHBox6
GuiBoxfHBox7
GuiBoxfHBox8
GuiBoxfHBox9
GuiTextButtonevtp1
GuiTextButtonevtp2
GuiTextButtonevtp3
GuiTextButtonevtp4
GuiTextButtonevtp5
GuiTextButtonevtp6
GuiTextButtontopo1
GuiTextButtontopo2
GuiTextButtontopo3
GuiTextButtontopo4
GuiTextButtonvote
GuiLabelfEncoded
GuiTextEntryfComment
GuiLabelfComLab
GuiTextViewfRecoInfo
Int_t ievtp
Int_t itopo
ofstream outfile
string filename
int iFileW
int hitlog
int icomm
int passfid
int passtrk
int passtrklike
int passshw
int passeng
int preselec
Int_t iIO
GuiLabelfFileLab
GuiTextEntryfFileEnt
GuiLabelfTypeLab
GuiLabelfTopoLab
GuiCheckButtonEvtp1
GuiCheckButtonEvtp2
GuiCheckButtonEvtp3
GuiCheckButtonEvtp4
GuiCheckButtonEvtp5
GuiCheckButtonEvtp6
GuiCheckButtonEvtp7
GuiCheckButtonTopo1
GuiCheckButtonTopo2
GuiCheckButtonTopo3
GuiCheckButtonTopo4
GuiCheckButtonTopo5
Int_t iEvtp [7]
Int_t iTopo [5]
Int_t selecevtp
Int_t selectopo
vector< Int_t > runno
vector< Int_t >::iterator runnoitr
vector< Int_t > subrunno
vector< Int_t >::iterator subrunnoitr
vector< Int_t > snarlno
vector< Int_t >::iterator snarlnoitr
vector< Int_t > eventno
vector< Int_t >::iterator eventnoitr
vector< Int_t > eventtype
vector< Int_t >::iterator typeitr
vector< Int_t > eventtopo
vector< Int_t >::iterator topoitr
vector< string > eventcomm
vector< string >::iterator commitr
GuiLabelfFileR
GuiLabelfTYPETOPO
GuiLabelfFileW
GuiTextButtonfNextEventbut1
GuiTextButtonfPrevEventbut1
ReleaseType::Release_t fRel
float ph0 [PHSIZE]
float ph1 [PHSIZE]

Detailed Description

Id
NueDisplayModule.h,v 1.61 2009/06/30 23:53:42 pawloski Exp

Definition at line 79 of file NueDisplayModule.h.


Member Typedef Documentation

typedef std::deque< std::deque <Int_t> > NueDisplayModule::DeqDeqInt_t

Definition at line 88 of file NueDisplayModule.h.

typedef std::deque<Float_t> NueDisplayModule::DeqFloat_t

Definition at line 87 of file NueDisplayModule.h.


Constructor & Destructor Documentation

NueDisplayModule::NueDisplayModule (  ) 

Definition at line 110 of file NueDisplayModule.cxx.

References ftrkshw, fva, iEvtp, info1, info10, info11, info12, info13, info2, info3, info4, info41, info5, info6, info7, info8, info9, iTopo, mcvtx_u, mcvtx_v, mrInfo1, mrInfo2, mrInfo3, mrInfo4, mrInfo5, mrInfo6, mrInfo7, mrInfo8, mrInfo9, FracVarAna::SetDisplay(), showMREvent, showNewEvent, showOrigEvent, showStpAll, showStpRecoTrk, showStpScaled, showStpTrueMu, showStpTrueShw, srvtx_u, srvtx_v, srvtx_xy, tfit_dt_ds_neg, and tfit_dt_ds_pos.

00111   : fCanvas0(0)
00112   , fUVview(0)
00113   , fButtonPad(0)
00114   , fHistPad(0)
00115   , fInfo0(0)
00116   , fStdHepCan(0)
00117   , fUZview(0)
00118   , fVZview(0)
00119   , fTrkUZ(0)
00120   , fTrkVZ(0)
00121   , fShwUZ(0)
00122   , fShwVZ(0)
00123   , fSlcUZ(0)
00124   , fSlcVZ(0)
00125   , fSteelOutline(0)
00126   , pu1_outline(0)
00127   , fu1_outline(0)
00128   , pv1_outline(0)
00129   , fv1_outline(0)
00130   , pu2_outline(0)
00131   , fu2_outline(0)
00132   , pv2_outline(0)
00133   , fv2_outline(0)
00134   , stdhepinfo()
00135   , shia(stdhepinfo)
00136   , fCanvas1(0)
00137   , fHistcolz(0)
00138   , fHistlego(0)
00139   , fUZcolz(0)
00140   , fVZcolz(0)
00141   , fUZlego(0)
00142   , fVZlego(0)
00143   , ifixc(0)
00144   , ifixl(0)
00145   , evthighest_z(30)
00146   , evtlowest_z(0)
00147   , evthighest_t0(4.05)
00148   , evtlowest_t0(-4.05)
00149   , evthighest_t1(4.05)
00150   , evtlowest_t1(-4.05)
00151   , fFracVar_plots(0)
00152   , fFracVar_info(0)
00153   , highest_z(30)
00154   , lowest_z(0)
00155   , highest_t0(4.05)
00156   , lowest_t0(-4.05)
00157   , highest_t1(4.05)
00158   , lowest_t1(-4.05)
00159   , fracvars()
00160   , fva(fracvars)
00161   , fShwfit_plots(0)
00162   , fShwfit_plots_sub(0)
00163   , fShwfit_info(0)
00164   , shwfit()
00165   , sfa(shwfit)
00166   , hitcalc()
00167   , hca(hitcalc)
00168   , fAngClusterFitAna_plots(0)
00169   , angcluster()
00170   , aca(angcluster)
00171   , angclusterfit()
00172   , acfa(angclusterfit)
00173   , fCanvas5(0)
00174   , ssGraphU(0)
00175   , ssGraphV(0)
00176   , cluLegU(0)
00177   , cluLegV(0)
00178   , fCanvas6(0)
00179   , fCanvas7(0)
00180   , fSelectPad1(0)
00181   , fSelectPad2(0)
00182   , fCanvas8(0)
00183   , TimeHst(0)
00184   , TimeHstTrk(0)
00185   , TimeHstShw(0)
00186   , TimeHstUV(0)
00187   , TimeHstTrkU(0)
00188   , TimeHstTrkV(0)
00189   , TimeHstShwU(0)
00190   , TimeHstShwV(0)
00191   , TimeHst2(0)
00192   , TimeHstTrk2(0)
00193   , TimeHstShw2(0)
00194   , TimeHst2UV(0)
00195   , TimeHstTrk2U(0)
00196   , TimeHstTrk2V(0)
00197   , TimeHstShw2U(0)
00198   , TimeHstShw2V(0)
00199   , gr_dtds(0)
00200   , fCanvas9(0)
00201   , vzEventOverlay(0)
00202   , uzEventOverlay(0)
00203   , uzSliceOverlay(0)
00204   , vzSliceOverlay(0)
00205   , leg(0)
00206   , fPlusMinusOne(0)
00207   , fPlusMinusTwo(0)
00208   , fFullSnarl(0)
00209   , kShowRange(-1)
00210   , fMRuShowAll(0)
00211   , fMRuShowMR(0)
00212   , fMRuShowOld(0)                                                       
00213   , fMRdShowAll(0)
00214   , fMRdShowTrueMu(0)
00215   , fMRdShowTrueShw(0)
00216   , fMRdShowScaled(0)
00217   , fMRdShowReco(0)
00218   , clickbutton(0)
00219   , fSlice(-1)
00220   , fNumSlices(-1)
00221   , fEvent(-1)
00222   , fEvent_old(-1)
00223   , fNumEvents(-1)
00224   , fSnarl(-1)
00225   , RunNo_old(-1)
00226   , SubRunNo_old(-1)
00227   , imctruth(0)
00228   , ifixmcinfo(0)
00229   , kDPlaneCut(-1)
00230   , kLoPhNStripCut(-1)
00231   , kLoPhNPlaneCut(-1)
00232   , kPhStripCut(-1)
00233   , kPhPlaneCut(-1)
00234   , kCPhPlaneCut(-1.)
00235   , kPIDCut(-1)
00236   , kScanMode(0)
00237   , kTestMode(0)
00238   , kHideRunSnarl(0)
00239   , kDrawClu(0)
00240   , kIntReco(0)
00241   , foundmeu(false)
00242   , SIGMAPMEU(1.)
00243   , fHBox(0)
00244   , fVBox1(0)
00245   , fVBox2(0)
00246   , fVBox3(0)
00247   , fHBox1(0)
00248   , fHBox2(0)
00249   , fHBox3(0)
00250   , fHBox4(0)
00251   , fHBox5(0)
00252   , ievtp(0)
00253   , itopo(0)
00254   , iFileW(0)
00255   , hitlog(0)
00256   , icomm(0)
00257   , passfid(0)
00258   , passtrk(0)
00259   , passtrklike(0)
00260   , passshw(0)
00261   , preselec(0)
00262   , iIO(0)
00263   , selecevtp(0)
00264   , selectopo(0)
00265   , fRel(ReleaseType::kUnknown)
00266 {        
00267   ftrkshw = new TNtuple("trkshw","trkshw","x:y:type");
00268   info1 = new TLatex();
00269   info2 = new TLatex();
00270   info3 = new TLatex();
00271   info4 = new TLatex();
00272   info41 = new TLatex();
00273   info5 = new TLatex();
00274   info6 = new TLatex();
00275   info7 = new TLatex();
00276   info8 = new TLatex();
00277   info9 = new TLatex();
00278   info10 = new TLatex();
00279   info11 = new TLatex();
00280   info12 = new TLatex();
00281   info13 = new TLatex();
00282   mrInfo1 = new TLatex();
00283   mrInfo2 = new TLatex();
00284   mrInfo3 = new TLatex();
00285   mrInfo4 = new TLatex();
00286   mrInfo5 = new TLatex();
00287   mrInfo6 = new TLatex();
00288   mrInfo7 = new TLatex();
00289   mrInfo8 = new TLatex();
00290   mrInfo9 = new TLatex();
00291 
00292 
00293   mcvtx_u = new TMarker();
00294   mcvtx_u->SetMarkerStyle(2);
00295   mcvtx_v = new TMarker();
00296   mcvtx_v->SetMarkerStyle(2);
00297   srvtx_u = new TMarker();
00298   srvtx_u->SetMarkerStyle(5);
00299   srvtx_v = new TMarker();
00300   srvtx_v->SetMarkerStyle(5);
00301   srvtx_xy = new TMarker();
00302   srvtx_xy->SetMarkerStyle(5);
00303   fva.SetDisplay(1);
00304 
00305   for (int i = 0; i<7; i++){ iEvtp[i] = 0;}
00306   for (int i = 0; i<5; i++){ iTopo[i] = 0;}
00307 
00308   tfit_dt_ds_pos = new TF1("tfit_dt_ds_pos","(1./299792458.0)*x+[0]",0,30) ;
00309   tfit_dt_ds_neg = new TF1("tfit_dt_ds_neg","(-1./299792458.0)*x+[0]",0,30) ;
00310 
00311                                                                     
00312   showStpTrueMu = false;
00313   showStpTrueShw = false;
00314   showStpScaled = false;
00315   showStpRecoTrk = false;
00316   showStpAll = true;
00317 
00318   showMREvent = true;
00319   showOrigEvent = true;
00320   showNewEvent = true;
00321   
00322   //gStyle->SetTitleH(0.04);
00323   gStyle->SetPadTopMargin(0.1);
00324 }

NueDisplayModule::~NueDisplayModule (  )  [virtual]

Definition at line 326 of file NueDisplayModule.cxx.

References fComment, fEvent_old, fSnarl, hitlog, icomm, ievtp, iFileW, iIO, itopo, kScanMode, outfile, RunNo_old, and SubRunNo_old.

00327 {
00328   if (!iIO){ //record decisions
00329     if (iFileW){
00330       if (!kScanMode){//nornal mode
00331         if (!icomm && hitlog) outfile<<endl;
00332         outfile<<endl;
00333         outfile.close();
00334       }
00335       else {//'fast scan' mode
00336         if (fSnarl>0&&!hitlog){
00337           outfile<<RunNo_old<<" "<<SubRunNo_old<<" "<<fSnarl<<" "<<fEvent_old<<" "<<ievtp<<" "<<itopo<<"  "<<fComment->GetText()<<endl;
00338           outfile<<endl;
00339           outfile.close();
00340         }
00341         else if (fSnarl>0&&hitlog){
00342           if(!icomm) outfile<<endl;
00343           outfile<<endl;
00344           outfile.close();
00345         }
00346       }
00347     }
00348   }
00349 }


Member Function Documentation

void NueDisplayModule::AdjustOverlayRange ( int  range  ) 

Definition at line 5575 of file NueDisplayModule.cxx.

References fCanvas9, fEvent, kShowRange, UpdateEventOverlayColors(), UpdateSliceOverlayColors(), uzEventOverlay, uzSliceOverlay, vzEventOverlay, and vzSliceOverlay.

05576 {
05577 
05578   kShowRange = range;
05579 
05580   if(uzEventOverlay == 0) return;
05581 
05582   UpdateEventOverlayColors(fEvent, uzEventOverlay);
05583   UpdateEventOverlayColors(fEvent, vzEventOverlay);
05584 
05585   UpdateSliceOverlayColors(fEvent, uzSliceOverlay);
05586   UpdateSliceOverlayColors(fEvent, vzSliceOverlay);
05587 
05588   uzSliceOverlay->Draw("AP");
05589   vzSliceOverlay->Draw("AP");
05590   uzEventOverlay->Draw("AP");
05591   vzEventOverlay->Draw("AP");
05592 
05593   fCanvas9->cd(1); gPad->Modified();
05594   fCanvas9->cd(2); gPad->Modified();
05595   fCanvas9->cd(3); gPad->Modified();
05596   fCanvas9->cd(4); gPad->Modified();
05597 
05598   fCanvas9->Update();
05599   fCanvas9->Modified();
05600 
05601   return;
05602 }

JobCResult NueDisplayModule::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 357 of file NueDisplayModule.cxx.

References NtpMCGenInfo::codename, fCanvas0, fCanvas1, fEvent, foundMC, foundmeu, foundMR, foundpidmatch, foundSR, foundST, foundSTOld, foundTH, foundvrmatch, MomNavigator::FragmentIter(), fRel, fva, NtpMCSummary::geninfo, NueHeader::GetEventNo(), MomNavigator::GetFragment(), RecRecordImp< T >::GetHeader(), Mint::GetJobC(), RecRecordImp< T >::GetJobHistory(), DbiResultPtr< T >::GetNumRows(), RecJobHistory::GetProdReleaseType(), DbiResultPtr< T >::GetRow(), CalMIPCalibration::GetScale(), VldContext::GetSimFlag(), NueHeader::GetSnarl(), RecHeader::GetVldContext(), gMint, hca, iIO, ReleaseType::IsBirch(), ReleaseType::IsCedar(), ReleaseType::IsDogwood(), JobCResult::kAOK, ReleaseType::kBirch, ReleaseType::kCarrot, ReleaseType::kCedar, kCPhPlaneCut, ReleaseType::kDaikon, ReleaseType::kData, Msg::kDebug, ReleaseType::kDogwood, kDPlaneCut, Msg::kError, JobCResult::kFailed, SimFlag::kMC, kPhPlaneCut, kPhStripCut, ReleaseType::kUnknown, Msg::kWarning, mc, NtpStRecord::mchdr, JobC::Mom, mr, MSG, DbiResultPtr< T >::NewQuery(), nr, ShwfitAna::SetCutParams(), NueAnaBase::SetParams(), sfa, SIGMAPMEU, sr, st, stOld, th, and UpdateDisplay().

00358 {
00359   if (gMint) {                // paranoia
00360     if (&gMint->GetJobC().Mom != mom) {
00361       MSG("NueDisplayModule",Msg::kError) << "Module's mom and JobC's mom differ: "
00362                                      << (void*)&gMint->GetJobC().Mom << " != "
00363                                      << (void*) mom << endl;
00364     }
00365   }
00366   
00367   if (!fCanvas0||!fCanvas1) {
00368     // No canvas - we can't do anything, but otherwise nothing
00369     // to say that there is a problem, so just return "ok".
00370     MSG("NueDisplayModule",Msg::kWarning) << "I have no canvas!\n";
00371     return JobCResult::kAOK;
00372   }
00373   
00374   //get data from mom
00375   foundST=false;
00376   foundSR=false;
00377   foundMC=false;
00378   foundTH=false;
00379   foundMR=false;
00380   foundSTOld=false;
00381   st = 0;
00382   sr = 0;
00383   mc = 0;
00384   th = 0;
00385   mr = 0;
00386   stOld = 0;
00387 
00388   VldContext vc;  
00389   st=dynamic_cast<NtpStRecord *>(mom->GetFragment("NtpStRecord", "Primary"));
00390   if(!st)
00391   {
00392     MSG("NueDisplayModule",Msg::kError) << "Can't find primary NtpStRecord.... looking for any!\n";
00393     st=dynamic_cast<NtpStRecord *>(mom->GetFragment("NtpStRecord"));
00394   }
00395 
00396 
00397   if(st){
00398     foundST=true;
00399     vc=st->GetHeader().GetVldContext();
00400 
00401     //MHO - This doesn't work.
00402     /*    string relName = st->GetTitle();
00403     string reco = relName.substr(0,relName.find_first_of("("));
00404     if(reco == "CEDAR") fRel = ReleaseType::kCedar;
00405     else if(reco == "DOGWOOD") fRel = ReleaseType::kDogwood;
00406     else fRel = ReleaseType::kBirch;*/
00407     ReleaseType::Release_t relName = st->GetJobHistory().GetProdReleaseType();
00408     if (ReleaseType::IsBirch(relName)) fRel = ReleaseType::kBirch;
00409     if (ReleaseType::IsCedar(relName)) fRel = ReleaseType::kCedar;
00410     if (ReleaseType::IsDogwood(relName)) fRel = ReleaseType::kDogwood;
00411 
00412     if(vc.GetSimFlag() == SimFlag::kMC){
00413       NtpMCGenInfo* genInfo = &(st->mchdr.geninfo);
00414       if(strstr(genInfo->codename.c_str(), "daikon") == 0) {
00415         fRel += ReleaseType::kCarrot;
00416       }
00417       if(strstr(genInfo->codename.c_str(), "daikon") != 0) {
00418         fRel += ReleaseType::kDaikon;
00419       }
00420     }
00421     if(vc.GetSimFlag() != SimFlag::kMC) fRel += ReleaseType::kData;
00422 
00423     //check for MR:
00424     mr=dynamic_cast<NtpMRRecord *>(mom->GetFragment("NtpMRRecord"));
00425     if(mr){
00426       if(ReleaseType::IsBirch(fRel)) {
00427         stOld=dynamic_cast<NtpStRecord *>(mom->GetFragment("NtpStRecord",
00428                                                            "NtpStRecordOld"));
00429       }
00430       else if(ReleaseType::IsCedar(fRel)||ReleaseType::IsDogwood(fRel)){
00431         stOld=st;
00432         st=dynamic_cast<NtpStRecord *>(mom->GetFragment("NtpStRecord",
00433                                                         "MuonRemoved"));
00434       }
00435       if(stOld) foundMR = true;
00436     }
00437   }
00438   else {
00439     fRel = ReleaseType::kUnknown;
00440     sr = dynamic_cast<NtpSRRecord *>(mom->GetFragment("NtpSRRecord"));
00441     if (sr) {
00442       foundSR = true;
00443       vc=sr->GetHeader().GetVldContext();        
00444     }
00445     mc = static_cast<NtpMCRecord *>(mom->GetFragment("NtpMCRecord"));
00446     if (mc) {
00447       foundMC = true;
00448       th = static_cast<NtpTHRecord *>(mom->GetFragment("NtpTHRecord"));
00449       if (th) foundTH = true;
00450     }
00451   }
00452 
00453   if(!foundSR&&!foundST) {
00454     MSG("NueDisplayModule",Msg::kError)<<"Got Nothing to display"<<endl;
00455       return JobCResult::kFailed;
00456    }
00457     
00458 
00459   // Load DB CalMIPCalibration and set it for packages that need it
00460 
00461 
00462    if(!foundmeu) 
00463    {
00464     //Setup and give context
00465     DbiResultPtr<CalMIPCalibration> fResPtr;
00466     fResPtr.NewQuery(vc,10);
00467     
00468     //Get Scale
00469     if(fResPtr.GetNumRows()>0)
00470     {
00471      const CalMIPCalibration* mipcal = fResPtr.GetRow(0);
00472      SIGMAPMEU = mipcal->GetScale();
00473      foundmeu=true;
00474     }
00475    }
00476 
00477    sfa.SetParams(SIGMAPMEU);
00478    sfa.SetCutParams(kDPlaneCut,kPhStripCut,kPhPlaneCut, kCPhPlaneCut);
00479    fva.SetParams(SIGMAPMEU);
00480    hca.SetParams(SIGMAPMEU);
00481    //aneia.SetParams(SIGMAPMEU);
00482 
00483    TObject *obj=0;
00484    TIter objiter = mom->FragmentIter();
00485    vector<NueRecord *> vr;
00486    //vector<NuePID *> vpid;
00487    while((obj=objiter.Next())){
00488     const char *cn=obj->ClassName();
00489     if(strcmp(cn,"NueRecord")==0){
00490       NueRecord *nr = dynamic_cast<NueRecord *>(obj);
00491       MSG("NueDisplayModule",Msg::kDebug)<<"Found a NueRecord in MOM"
00492                                          <<" Snarl "<<nr->GetHeader().GetSnarl()
00493                                          <<" Event "<<nr->GetHeader().GetEventNo()<<endl;
00494       vr.push_back(nr);
00495     }
00496     else if(strcmp(cn,"NuePID")==0){
00497       //NuePID *npid  = dynamic_cast<NuePID *>(obj);
00498       MSG("NueDisplayModule",Msg::kDebug)<<"Found a NuePID in MOM"
00499         //     <<" Snarl "<<npid->GetHeader().GetSnarl()
00500         //     <<" Event "<<npid->GetHeader().GetEventNo()<< "PID: " << npid->IsNue i
00501                                          << endl;
00502       //vpid.push_back(npid);
00503     }
00504     else{
00505       continue;
00506     }
00507   }
00508   
00509   
00510   //so, mom will match up snarls for us,
00511   //but, we have to match up events for ourselves.
00512   MSG("NueDisplayModule",Msg::kDebug)<<"Starting to match records"<<endl;
00513   MSG("NueDisplayModule",Msg::kDebug)<<"found "<<vr.size()<<" NueR's"<<endl;
00514   foundvrmatch=false;
00515   for(unsigned int i=0;i<vr.size();i++){
00516     int event = vr[i]->GetHeader().GetEventNo();
00517     if(event==fEvent){
00518       nr=vr[i];
00519       foundvrmatch=true;
00520       break;
00521     }
00522   }     
00523   if(foundvrmatch) MSG("NueDisplayModule",Msg::kDebug)<<"Found vr"<<endl;
00524   foundpidmatch=false;
00525 /*  for(unsigned int i=0;i<vpid.size();i++){
00526     int event = vpid[i]->GetHeader().GetEventNo();
00527     if(event==fEvent){
00528       pid=vpid[i];
00529       foundpidmatch=true;
00530       break;
00531     }
00532   }     
00533 */
00534   if(foundvrmatch) MSG("NueDisplayModule",Msg::kDebug)<<"Found pid"<<endl; 
00535   
00536   MSG("NueDisplayModule",Msg::kDebug)<<"Matches?"<<endl;
00537   if(foundpidmatch){
00538     MSG("NueDisplayModule",Msg::kDebug)<<"found pid"<<endl;
00539   }
00540   if(foundvrmatch){
00541     MSG("NueDisplayModule",Msg::kDebug)<<"found record"<<endl;
00542   }
00543   
00544   if (!iIO) fEvent = 0; //in the Write mode
00545   this->UpdateDisplay(foundvrmatch, foundpidmatch);
00546   
00547   return JobCResult::kAOK;
00548 }

void NueDisplayModule::Analyze ( Int_t  evt  )  [private]

Definition at line 3690 of file NueDisplayModule.cxx.

References aca, acfa, ShwfitAna::Analyze(), AngClusterFitAna::Analyze(), HitCalcAna::Analyze(), StdHepInfoAna::Analyze(), FracVarAna::Analyze(), AngClusterAna::Analyze(), DeleteOldCrap(), AngClusterFitAna::Draw(), Shwfit::Draw(), FracVarAna::Draw(), MuELoss::e, fAngClusterFitAna_plots, fCanvas2, fCanvas3, fCanvas4, fFracVar_plots, foundMC, foundSR, foundST, foundTH, FracVar::fract_road, fracvars, fRel, fShwfit_plots, fSimFlag, fva, HitCalcAna::Get3DHit(), AngClusterAna::GetAngCluster(), hca, Msg::kDebug, SimFlag::kMC, MSG, AngClusterAna::Set3DHit(), AngClusterFitAna::Set3DHit(), AngClusterFitAna::SetAngCluster(), NueAnaBase::SetRelease(), sfa, shia, shwfit, sr, and st.

Referenced by UpdateDisplay().

03690                                        {
03691     DeleteOldCrap();
03692 
03693     shia.SetRelease(fRel);
03694     fva.SetRelease(fRel);
03695     sfa.SetRelease(fRel);
03696     hca.SetRelease(fRel);
03697     aca.SetRelease(fRel);
03698     acfa.SetRelease(fRel);
03699 
03700     if (foundST){
03701         fva.Analyze(evt,st);
03702     }
03703     else if (foundSR){
03704         fva.Analyze(evt,sr);
03705     }    
03706 
03707     fva.Draw(fFracVar_plots);
03708     fCanvas2->Update();
03709     
03710     MSG("NueDisplayModule",Msg::kDebug) <<"FracVar fract_road = " << fracvars.fract_road<<endl;
03711 
03712     
03713     if (foundST){
03714       sfa.Analyze(evt,st);
03715     }
03716     else if (foundSR){
03717       sfa.Analyze(evt,sr);
03718     }    
03719 
03720     shwfit.Draw(fShwfit_plots);
03721     fCanvas3->Update();
03722 
03723 
03724     DeqFloat_t x,y,z,e;
03725     Int_t primShow;
03726     DeqDeqInt_t clusterMap;
03727     TVector3 primDir;
03728     
03729     if (foundST){
03730         hca.Analyze(evt,st);
03731         hca.Get3DHit(x,y,z,e);    
03732         aca.Set3DHit(x,y,z,e);
03733         aca.Analyze(evt,st);    // Must be preceded by hca.Get3DHit
03734         //                     aca.Set3DHit
03735         aca.GetAngCluster(primShow,clusterMap,primDir);
03736         acfa.Set3DHit(x,y,z,e);
03737         acfa.SetAngCluster(primShow,clusterMap,primDir);
03738         acfa.Analyze(evt,st);    // Must be preceded by:
03739                                     // aca.GetAngCluster
03740                                     // acf.Set3DHit
03741                                     // acf.SetAngCluster
03742              
03743     }
03744     else if (foundSR){
03745         
03746         hca.Analyze(evt,sr);
03747         hca.Get3DHit(x,y,z,e);    
03748         aca.Set3DHit(x,y,z,e);
03749         aca.Analyze(evt,sr);    // Must be preceded by hca.Get3DHit
03750         //                     aca.Set3DHit
03751         aca.GetAngCluster(primShow,clusterMap,primDir);
03752         acfa.Set3DHit(x,y,z,e);
03753         acfa.SetAngCluster(primShow,clusterMap,primDir);
03754         acfa.Analyze(evt,sr);    // Must be preceded by:
03755                                  // aca.GetAngCluster
03756                                  // acf.Set3DHit
03757                                  // acf.SetAngCluster 
03758 
03759     }    
03760 
03761     acfa.Draw(fAngClusterFitAna_plots);
03762     fCanvas4->Update();
03763 
03764   if (fSimFlag == SimFlag::kMC){
03765     if (foundST){
03766       shia.Analyze(evt,st);
03767     }
03768     else if (foundMC&&foundTH){
03769       //not implemented yet
03770     }
03771   }
03772 
03773 
03774 }

void NueDisplayModule::BeginRun (  )  [virtual]

Implement for notification of begin of run (meaningful for Daq data only). See GetCurrentRun().

Reimplemented from JobCModule.

Definition at line 351 of file NueDisplayModule.cxx.

References BuildDisplay(), fCanvas0, fCanvas1, and gMint.

00352 {
00353   cout<<"In NueDisplayModule beginrun()"<<endl;
00354   if (gMint && !fCanvas0 && !fCanvas1) this->BuildDisplay();
00355 }

void NueDisplayModule::BuildDisplay (  )  [private]

Definition at line 550 of file NueDisplayModule.cxx.

References GuiTextEntry::activated, GuiCompositeFrameBase::Add(), PageDisplay::AddButton(), PageDisplay::AddEntry(), PageDisplay::AddPage(), cbut, GuiButtonBase::clicked, coil, Evtp1, evtp1, Evtp2, evtp2, Evtp3, evtp3, Evtp4, evtp4, Evtp5, evtp5, Evtp6, evtp6, Evtp7, fAngClusterFitAna_plots, fBC, fBL, fButtonPad, fCanvas0, fCanvas1, fCanvas2, fCanvas3, fCanvas4, fCanvas5, fCanvas6, fCanvas7, fCanvas8, fCanvas9, fComLab, fComment, fCuts, fDetectorType, fEncoded, fEvent, fEventEntry, fEventNo, fFileEnt, fFileLab, fFileR, fFileW, fFixMCInfo, fFracVar_plots, fFullSnarl, fHBox, fHBox2, fHBox3, fHBox4, fHBox5, fHBox6, fHBox7, fHBox8, fHBox9, fHistcolz, fHistlego, fHistPad, fInfo0, fIntRecoCalc1, fIntRecoCalc2, fIntRecoDoSim, fIntRecoHistU, fIntRecoHistV, fIntRecoHistZ, fIO, fixmcinfo(), fMCTruth, fMRCanvas1, fMRdShowAll, fMRdShowReco, fMRdShowScaled, fMRdShowTrueMu, fMRdShowTrueShw, fMRLowerLeg, fMRUpperLeg, fMRuShowAll, fMRuShowMR, fMRuShowOld, fNextEventbut, fNextEventbut1, fNextSelEvt, fPlusMinusOne, fPlusMinusTwo, fPredictedHistU, fPredictedHistV, fPredictedHistZ, fPrevEventbut1, fPrevSelEvt, fPrint, fReco_plots, fRecoInfo, fSelectPad1, fSelectPad2, fShwfit_plots, fShwUZ, fShwVZ, fSimFlag, fSlcUZ, fSlcVZ, fSnarl, fStdHepCan, fStdLeg, fSteelOutline, fTopoLab, fTrkUZ, fTrkVZ, fTypeLab, fTYPETOPO, fu1_outline, fu2_outline, fUVview, fUZcolz, fUZlego, fUZPred, fUZview, fv1_outline, fv2_outline, fVBox1, fVBox2, fVBox3, fVZcolz, fVZlego, fVZPred, fVZview, fZoom, PageDisplay::GetButtonBox(), CanvasSignals::GetCanvas(), DataUtil::GetDetector(), VldContext::GetDetector(), Mint::GetDisplay(), RecRecordImp< T >::GetHeader(), Mint::GetJobC(), PlaneOutline::GetOutline(), DataUtil::GetRunSnarlEvent(), UgliGeomHandle::GetScintPlnHandleVector(), VldContext::GetSimFlag(), UgliGeomHandle::GetStripHandle(), RecDataHeader::GetSubRun(), UgliGeomHandle::GetTransverseExtent(), Mint::GetUgliGeomHandle(), RecHeader::GetVldContext(), gMint, GotoEvent(), id, IntRecoCalc(), UgliGeomHandle::IsValid(), Msg::kDebug, kDrawClu, StripEnd::kEast, Detector::kFar, kIntReco, Detector::kNear, PlaneCoverage::kNearFull, PlaneCoverage::kNearPartial, kTestMode, PlaneView::kU, PlaneView::kV, PlaneView::kVSTopEastSlant, PlaneView::kVSTopWestSlant, PlaneView::kVSWallOnEdge, Msg::kWarning, StripEnd::kWest, lbut, leg, logvote(), makecomment(), JobC::Mom, mrGraphPad, mrInfoPanel, MSG, NextEvent(), NextSelEvt(), OpenFileRead(), PrevEvent(), PrevSelEvt(), PrintPads(), pu1_outline, pu2_outline, pv1_outline, pv2_outline, run(), RunNo, RunNo_old, selec01(), selec02(), selec03(), selec04(), selec05(), selec10(), selec20(), selec30(), selec40(), selec50(), selec60(), selec70(), SetCuts(), GuiBase::SetLayoutHints(), SetMode(), SetUpStripButtons(), showmctruth(), Mint::SpawnDisplay(), srvtx_u, srvtx_v, SubRunNo, SubRunNo_old, TimeHst, TimeHst2, TimeHst2UV, TimeHstShw, TimeHstShw2, TimeHstShw2U, TimeHstShw2V, TimeHstShwU, TimeHstShwV, TimeHstTrk, TimeHstTrk2, TimeHstTrk2U, TimeHstTrk2V, TimeHstTrkU, TimeHstTrkV, TimeHstUV, Topo1, topo1, topo2, Topo2, topo3, Topo3, topo4, Topo4, Topo5, vote, vote01(), vote02(), vote03(), vote04(), vote10(), vote20(), vote30(), vote40(), vote50(), and vote60().

Referenced by BeginRun().

00551 {
00552   MSG("NueDisplayModule",Msg::kDebug)<<"In BuildDisplay"<<endl;
00553 
00554   //get detector/simflag/run information
00555 
00556   // Get Ugli for later.  Bail immediately if fail
00557   UgliGeomHandle ugh = gMint->GetUgliGeomHandle();
00558   if (! ugh.IsValid()) {
00559     MSG("NueDisplayModule",Msg::kWarning) << "Got invalid Ugli\n";
00560     //return;
00561   }
00562 
00563   int run=0, subrun = 0, snarl = 0, evt = 0;
00564   DataUtil::GetRunSnarlEvent(&(gMint->GetJobC().Mom),run,snarl,evt);
00565   RecRecordImp<RecCandHeader> *rr = 
00566     dynamic_cast<RecRecordImp<RecCandHeader>*>
00567     ((gMint->GetJobC().Mom).GetFragment("RecRecordImp<RecCandHeader>"));
00568   if ( rr ) {
00569     subrun   = rr->GetHeader().GetSubRun();
00570     fDetectorType = rr->GetHeader().GetVldContext().GetDetector();
00571     fSimFlag = rr->GetHeader().GetVldContext().GetSimFlag();
00572   }
00573   RunNo = run;
00574   SubRunNo = subrun;
00575 
00576   fSnarl = -1; //reset snarl no at the beginning of each run
00577   if (RunNo_old==-1&&SubRunNo_old==-1){
00578     RunNo_old = RunNo;
00579     SubRunNo_old = SubRunNo;
00580   }
00582 
00583   //generate main display
00584 
00585   const int width = 1000, height = 680;
00586   
00587   //CanvasSignals* cs_reco = 0;
00588   CanvasSignals* cs0 = 0;
00589   CanvasSignals* cs1 = 0;
00590   CanvasSignals* cs2 = 0;
00591   CanvasSignals* cs3 = 0;
00592   CanvasSignals* cs4 = 0;
00593   CanvasSignals* cs5 = 0;
00594   CanvasSignals* cs6 = 0;
00595   CanvasSignals* cs7 = 0;
00596   CanvasSignals* cs8 = 0;
00597   CanvasSignals* cs9 = 0;
00598   CanvasSignals* mrC1 = 0;
00599 
00600   PageDisplay* pd = gMint->GetDisplay();
00601   //get Button Box on the left
00602   GuiBox *fBBox = pd->GetButtonBox();
00603   // No pre-existing display, so make one to our size
00604   if (!pd) {
00605     MSG("NueDisplayModule",Msg::kDebug)<<"No display, making one"<<endl;
00606     pd = gMint->SpawnDisplay(width,height);
00607   }
00608 
00610 
00611   //add buttons in the Button Box
00612   //"Next Event" "Prev Event"
00613   fNextEventbut = pd->AddButton("Next Event ");
00614   fNextEventbut->clicked.connect(slot_class(*this,&NueDisplayModule::NextEvent));
00615   fNextEventbut = pd->AddButton("Prev Event ");
00616   fNextEventbut->clicked.connect(slot_class(*this,&NueDisplayModule::PrevEvent));
00617 
00618   //Event No
00619   fEventNo = manage(new GuiLabel(*fBBox," "));
00620   fEventNo->SetLayoutHints(kLHintsExpandX);
00621   fBBox->Add(*fEventNo);
00622   fEventEntry = pd->AddEntry(" ");
00623   fEventEntry->activated.connect(slot_class(*this,&NueDisplayModule::GotoEvent));
00624   
00625   //preselection
00626   fCuts = pd->AddButton("Cuts: OFF");
00627   fCuts->clicked.connect(slot_class(*this,&NueDisplayModule::SetCuts));
00628 
00629   //I/O
00630   fIO = pd->AddButton("Write");
00631   fIO->clicked.connect(slot_class(*this,&NueDisplayModule::SetMode));
00632 
00633   //"NextSelEvt" "PreSelEvt"
00634   fNextSelEvt = pd->AddButton("NextSelEvt");
00635   fNextSelEvt->clicked.connect(slot_class(*this,&NueDisplayModule::NextSelEvt));
00636   fPrevSelEvt = pd->AddButton("PrevSelEvt");
00637   fPrevSelEvt->clicked.connect(slot_class(*this,&NueDisplayModule::PrevSelEvt));
00638 
00639   if(!kTestMode){
00640     fMCTruth = pd->AddButton("MC Truth");
00641     fMCTruth->clicked.connect(slot_class(*this,&NueDisplayModule::showmctruth));
00642 
00643     fFixMCInfo = pd->AddButton("Fix MC Info");
00644     fFixMCInfo->clicked.connect(slot_class(*this,&NueDisplayModule::fixmcinfo));
00645   }
00646 
00647   if(kIntReco){
00648     fIntRecoCalc2 = pd->AddButton("IR: Re-Draw ");
00649     fIntRecoCalc2->clicked.connect(slot_class(*this,
00650                                              &NueDisplayModule::SetUpStripButtons));
00651     fIntRecoCalc1 = pd->AddButton("IR: Calculate");
00652     fIntRecoCalc1->clicked.connect(slot_class(*this,
00653                                              &NueDisplayModule::IntRecoCalc));
00654   }
00655 
00656   fPrint = pd->AddButton("Print");
00657   fPrint->clicked.connect(slot_class(*this,&NueDisplayModule::PrintPads));
00658 
00660 
00661   //construct frame for voting and I/O facilities
00662 
00663   //main box fHBox
00664   if(!fHBox){
00665     fHBox = manage(new GuiBox(*pd,kHorizontalFrame));
00666     fHBox->SetHeight(140);
00667     pd->SetWidth(pd->GetWidth());
00668     fHBox->SetWidth(pd->GetWidth());
00669     fHBox->SetLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX);
00670     pd->Add(*fHBox);
00671   } 
00672   
00673   //voting stuff
00674   fVBox1 = manage(new GuiBox(*fHBox,kVerticalFrame));
00675   fVBox1->SetLayoutHints(kLHintsExpandY);
00676   fHBox->Add(*fVBox1);
00677 
00678   //event type
00679   evtp1 =  manage(new GuiTextButton(*fVBox1,"mu"));
00680   evtp1->SetLayoutHints(kLHintsExpandX);
00681   fVBox1->Add(*evtp1);
00682   evtp1->clicked.connect(slot_class(*this,&NueDisplayModule::vote10));
00683 
00684   evtp2 =  manage(new GuiTextButton(*fVBox1,"e"));
00685   evtp2->SetLayoutHints(kLHintsExpandX);
00686   fVBox1->Add(*evtp2);
00687   evtp2->clicked.connect(slot_class(*this,&NueDisplayModule::vote20));
00688 
00689   evtp3 =  manage(new GuiTextButton(*fVBox1,"NC"));
00690   evtp3->SetLayoutHints(kLHintsExpandX);
00691   fVBox1->Add(*evtp3);
00692   evtp3->clicked.connect(slot_class(*this,&NueDisplayModule::vote30));
00693 
00694   evtp4 =  manage(new GuiTextButton(*fVBox1,"mu/NC?"));
00695   evtp4->SetLayoutHints(kLHintsExpandX);
00696   fVBox1->Add(*evtp4);
00697   evtp4->clicked.connect(slot_class(*this,&NueDisplayModule::vote40));
00698 
00699   evtp5 =  manage(new GuiTextButton(*fVBox1,"e/NC?"));
00700   evtp5->SetLayoutHints(kLHintsExpandX);
00701   fVBox1->Add(*evtp5);
00702   evtp5->clicked.connect(slot_class(*this,&NueDisplayModule::vote50));
00703 
00704   evtp6 =  manage(new GuiTextButton(*fVBox1,"???"));
00705   evtp6->SetLayoutHints(kLHintsExpandX);
00706   fVBox1->Add(*evtp6);
00707   evtp6->clicked.connect(slot_class(*this,&NueDisplayModule::vote60));
00708 
00709   fVBox2 = manage(new GuiBox(*fHBox,kVerticalFrame,2));
00710   fVBox2->SetLayoutHints(kLHintsExpandY);
00711   fHBox->Add(*fVBox2);
00712 
00713   //topology
00714   topo1 =  manage(new GuiTextButton(*fVBox2,"QE"));
00715   topo1->SetLayoutHints(kLHintsExpandX);
00716   fVBox2->Add(*topo1);
00717   topo1->clicked.connect(slot_class(*this,&NueDisplayModule::vote01));
00718 
00719   topo2 =  manage(new GuiTextButton(*fVBox2,"RES"));
00720   topo2->SetLayoutHints(kLHintsExpandX);
00721   fVBox2->Add(*topo2);
00722   topo2->clicked.connect(slot_class(*this,&NueDisplayModule::vote02));
00723 
00724   topo3 =  manage(new GuiTextButton(*fVBox2,"DIS"));
00725   topo3->SetLayoutHints(kLHintsExpandX);
00726   fVBox2->Add(*topo3);
00727   topo3->clicked.connect(slot_class(*this,&NueDisplayModule::vote03));
00728 
00729   topo4 =  manage(new GuiTextButton(*fVBox2,"???"));
00730   topo4->SetLayoutHints(kLHintsExpandX);
00731   fVBox2->Add(*topo4);
00732   topo4->clicked.connect(slot_class(*this,&NueDisplayModule::vote04));
00733 
00734   fEncoded = manage(new GuiLabel(*fVBox2," "));
00735   fEncoded->SetLayoutHints(kLHintsExpandX);
00736   fVBox2->Add(*fEncoded);
00737   //updateEncoded();
00738 
00739   vote = manage(new GuiTextButton(*fVBox2,"Log Details"));
00740   vote->SetLayoutHints(kLHintsExpandX);
00741   fVBox2->Add(*vote);
00742   vote->clicked.connect(slot_class(*this,&NueDisplayModule::logvote));
00743 
00744   fVBox3 = manage(new GuiBox(*fHBox,kVerticalFrame));
00745   fHBox->Add(*fVBox3);
00746 
00747   //make comments?
00748   fHBox3 = manage(new GuiBox(*fVBox3,kHorizontalFrame));
00749   fHBox3->SetLayoutHints(kLHintsExpandX);
00750   fVBox3->Add(*fHBox3);
00751   fComLab = manage(new GuiLabel(*fHBox3," Comments? "));
00752   fComLab->SetLayoutHints(kLHintsLeft);
00753   fHBox3->Add(*fComLab);
00754   fComment = manage(new GuiTextEntry(*fHBox3,""));
00755   fComment->SetLayoutHints(kLHintsExpandX);
00756   fHBox3->Add(*fComment);
00757   fComment->activated.connect(slot_class(*this,&NueDisplayModule::makecomment));
00758 
00759   //open file to read
00760   fHBox4 = manage(new GuiBox(*fVBox3,kHorizontalFrame));
00761   fHBox4->SetLayoutHints(kLHintsExpandX);
00762   fVBox3->Add(*fHBox4);
00763   fFileLab = manage(new GuiLabel(*fHBox4," File to Open? "));
00764   fFileLab->SetLayoutHints(kLHintsLeft);
00765   fHBox4->Add(*fFileLab);
00766   fFileEnt = manage(new GuiTextEntry(*fHBox4,""));
00767   fFileEnt->SetLayoutHints(kLHintsExpandX);
00768   fHBox4->Add(*fFileEnt);
00769   fFileEnt->activated.connect(slot_class(*this,&NueDisplayModule::OpenFileRead));
00770 
00771   //event type
00772   fHBox5 = manage(new GuiBox(*fVBox3,kHorizontalFrame));
00773   fHBox5->SetLayoutHints(kLHintsExpandX);
00774   fVBox3->Add(*fHBox5);
00775   fTypeLab = manage(new GuiLabel(*fHBox5," TYPE         "));
00776   fTypeLab->SetLayoutHints(kLHintsLeft);
00777   fHBox5->Add(*fTypeLab);
00778   Evtp1 = manage(new GuiCheckButton(*fHBox5,"mu"));
00779   Evtp1->SetLayoutHints(kLHintsLeft);
00780   fHBox5->Add(*Evtp1);
00781   Evtp1->clicked.connect(slot_class(*this,&NueDisplayModule::selec10));
00782   Evtp2 = manage(new GuiCheckButton(*fHBox5,"e"));
00783   Evtp2->SetLayoutHints(kLHintsLeft);
00784   fHBox5->Add(*Evtp2);
00785   Evtp2->clicked.connect(slot_class(*this,&NueDisplayModule::selec20));
00786   Evtp3 = manage(new GuiCheckButton(*fHBox5,"NC"));
00787   Evtp3->SetLayoutHints(kLHintsLeft);
00788   fHBox5->Add(*Evtp3);
00789   Evtp3->clicked.connect(slot_class(*this,&NueDisplayModule::selec30));
00790   Evtp4 = manage(new GuiCheckButton(*fHBox5,"mu/NC?"));
00791   Evtp4->SetLayoutHints(kLHintsLeft);
00792   fHBox5->Add(*Evtp4);
00793   Evtp4->clicked.connect(slot_class(*this,&NueDisplayModule::selec40));
00794   Evtp5 = manage(new GuiCheckButton(*fHBox5,"e/NC?"));
00795   Evtp5->SetLayoutHints(kLHintsLeft);
00796   fHBox5->Add(*Evtp5);
00797   Evtp5->clicked.connect(slot_class(*this,&NueDisplayModule::selec50));
00798   Evtp6 = manage(new GuiCheckButton(*fHBox5,"???"));
00799   Evtp6->SetLayoutHints(kLHintsLeft);
00800   fHBox5->Add(*Evtp6);
00801   Evtp6->clicked.connect(slot_class(*this,&NueDisplayModule::selec60));
00802   Evtp7 = manage(new GuiCheckButton(*fHBox5,"N/A"));
00803   Evtp7->SetLayoutHints(kLHintsLeft);
00804   fHBox5->Add(*Evtp7);
00805   Evtp7->clicked.connect(slot_class(*this,&NueDisplayModule::selec70));
00806 
00807   //topology
00808   fHBox6 = manage(new GuiBox(*fVBox3,kHorizontalFrame));
00809   fHBox6->SetLayoutHints(kLHintsExpandX);
00810   fVBox3->Add(*fHBox6);
00811   fTopoLab = manage(new GuiLabel(*fHBox6," TOPOLOGY "));
00812   fTopoLab->SetLayoutHints(kLHintsLeft);
00813   fHBox6->Add(*fTopoLab);
00814   Topo1 = manage(new GuiCheckButton(*fHBox6,"QE"));
00815   Topo1->SetLayoutHints(kLHintsLeft);
00816   fHBox6->Add(*Topo1);
00817   Topo1->clicked.connect(slot_class(*this,&NueDisplayModule::selec01));
00818   Topo2 = manage(new GuiCheckButton(*fHBox6,"RES"));
00819   Topo2->SetLayoutHints(kLHintsLeft);
00820   fHBox6->Add(*Topo2);
00821   Topo2->clicked.connect(slot_class(*this,&NueDisplayModule::selec02));
00822   Topo3 = manage(new GuiCheckButton(*fHBox6,"DIS"));
00823   Topo3->SetLayoutHints(kLHintsLeft);
00824   fHBox6->Add(*Topo3);
00825   Topo3->clicked.connect(slot_class(*this,&NueDisplayModule::selec03));
00826   Topo4 = manage(new GuiCheckButton(*fHBox6,"???"));
00827   Topo4->SetLayoutHints(kLHintsLeft);
00828   fHBox6->Add(*Topo4);
00829   Topo4->clicked.connect(slot_class(*this,&NueDisplayModule::selec04));
00830   Topo5 = manage(new GuiCheckButton(*fHBox6,"N/A"));
00831   Topo5->SetLayoutHints(kLHintsLeft);
00832   fHBox6->Add(*Topo5);
00833   Topo5->clicked.connect(slot_class(*this,&NueDisplayModule::selec05));
00834 
00835   fHBox7 = manage(new GuiBox(*fVBox3,kHorizontalFrame));
00836   fHBox7->SetLayoutHints(kLHintsExpandX);
00837   fVBox3->Add(*fHBox7);
00838   fFileR = manage(new GuiLabel(*fHBox7,""));
00839   fHBox7->Add(*fFileR);
00840   fTYPETOPO = manage(new GuiLabel(*fHBox7,""));
00841   fHBox7->Add(*fTYPETOPO);
00842   
00843   fHBox8 = manage(new GuiBox(*fVBox3,kHorizontalFrame));
00844   fHBox8->SetLayoutHints(kLHintsExpandX);
00845   fVBox3->Add(*fHBox8);
00846   fFileW = manage(new GuiLabel(*fHBox8,""));
00847   fHBox8->Add(*fFileW);
00848 
00849   fHBox9 = manage(new GuiBox(*fVBox3,kHorizontalFrame));
00850   fHBox9->SetLayoutHints(kLHintsExpandX);
00851   fVBox3->Add(*fHBox9);
00852 
00853   fNextEventbut1 = manage(new GuiTextButton(*fHBox9,"Next Event"));
00854   //fNextEventbut1->SetLayoutHints(kLHintsExpandX);
00855   fHBox9->Add(*fNextEventbut1);
00856   fNextEventbut1->clicked.connect(slot_class(*this,&NueDisplayModule::NextEvent));
00857 
00858   fPrevEventbut1 = manage(new GuiTextButton(*fHBox9,"Prev Event"));
00859   //fPrevEventbut1->SetLayoutHints(kLHintsExpandX);
00860   fHBox9->Add(*fPrevEventbut1);
00861   fPrevEventbut1->clicked.connect(slot_class(*this,&NueDisplayModule::PrevEvent));
00862 
00863 
00864   //reco info
00865   fHBox2 = manage(new GuiBox(*fHBox,kHorizontalFrame));
00866   fHBox->Add(*fHBox2);
00867 
00868   fRecoInfo = manage(new GuiTextView(*fHBox2,1,1));
00869   fHBox2->Add(*fRecoInfo);
00870   fRecoInfo->AddLine("Reco Information");
00871 
00872 
00873 
00875 
00876   //add user-defined canvas
00877 
00878   cs0 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00879   cs1 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00880   cs2 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00881   cs3 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00882   cs4 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00883   if(kDrawClu) cs5 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00884   if(kIntReco) {
00885     cs7 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00886     cs6 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00887   }
00888   cs8 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00889   cs9 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00890   mrC1 = dynamic_cast<CanvasSignals*>(pd->AddPage("UserCanvas"));
00891 
00892   if (!cs0||!cs1||!cs2||!cs3||!cs4||!cs8|!cs9|!mrC1) {
00893     MSG("NueDisplayModule",Msg::kWarning) << "Failed to get NueCanvas's CanvasSignals\n";
00894     return;
00895   }
00896 
00897     //fCanvas_reco = &cs_reco->GetCanvas();
00898     fCanvas0 = &cs0->GetCanvas();
00899     fCanvas1 = &cs1->GetCanvas();
00900     fCanvas2 = &cs2->GetCanvas();
00901     fCanvas3 = &cs3->GetCanvas();
00902     fCanvas4 = &cs4->GetCanvas();
00903     if(kDrawClu) {
00904       fCanvas5 = &cs5->GetCanvas();    
00905       fCanvas5->SetHighLightColor(0);
00906     }
00907     if(kIntReco) {
00908       fCanvas6 = &cs6->GetCanvas();
00909       fCanvas6->SetHighLightColor(0);
00910       fCanvas7 = &cs7->GetCanvas();
00911       fCanvas7->SetHighLightColor(0);
00912     }
00913     fCanvas8 = &cs8->GetCanvas();
00914     fCanvas9 = &cs9->GetCanvas();
00915     fMRCanvas1 = &mrC1->GetCanvas();
00916     
00917     //please set highlightcolor of all the canvases to be 0
00918     //otherwise buttons on the second page will be screwed
00919     fCanvas0->SetHighLightColor(0);
00920     fCanvas1->SetHighLightColor(0);
00921     fCanvas2->SetHighLightColor(0);
00922     fCanvas3->SetHighLightColor(0);
00923     fCanvas4->SetHighLightColor(0);
00924     fCanvas8->SetHighLightColor(0);
00925     fCanvas9->SetHighLightColor(0);
00926     fMRCanvas1->SetHighLightColor(0);
00927 
00928     //main canvas
00929     //fCanvas0->Divide(2,1);
00930     //fCanvas0->SetName("fCanvas0");
00931     //fCanvas1->Divide(2,1);
00932     fCanvas2->Divide(2,1);
00933     fCanvas3->Divide(2,2);
00934     fCanvas4->Divide(2,2);    
00935     fCanvas8->Divide(2,2);
00936     fCanvas8->SetName("fCanvas8");
00937     fCanvas9->Divide(2,2);
00938 //    fMRCanvas1->Divide(2,2);
00939 
00940     if(kDrawClu) {
00941       fCanvas5->cd();
00942       fCanvas5->SetName("fCanvas5");
00943       TPad *temp_pad = new TPad("c5_1","c5_1",0.0,0.5,0.42,1);
00944       temp_pad->SetNumber(1); temp_pad->Draw();
00945       temp_pad = new TPad("c5_2","c5_2",0.42,0.5,0.84,1);
00946       temp_pad->SetNumber(2); temp_pad->Draw();
00947       temp_pad = new TPad("c5_3","c5_3",0.84,0.5,1.0,1);
00948       temp_pad->SetNumber(3); temp_pad->Draw();
00949       temp_pad = new TPad("c5_4","c5_4",0.0,0.0,0.42,0.5);
00950       temp_pad->SetNumber(4); temp_pad->Draw();
00951       temp_pad = new TPad("c5_5","c5_5",0.42,0.0,0.84,0.5);
00952       temp_pad->SetNumber(5); temp_pad->Draw();
00953       temp_pad = new TPad("c5_6","c5_6",0.84,0.0,1.0,0.5);
00954       temp_pad->SetNumber(6); temp_pad->Draw();
00955     }
00956 
00957     if(!kTestMode){
00958       fCanvas0->cd();
00959       fStdHepCan = new TPad("fStdHepCan","fStdHepCan",0.5,0.,1.,0.5);
00960       fStdHepCan->Draw();
00961       fStdHepCan->Range(0,0,1,1.1);
00962       fStdHepCan->cd();
00963       TPaveText *infoTex1 = new TPaveText(0.05,1.,0.2,1.07);
00964       infoTex1->AddText("Initial State");
00965       infoTex1->SetBorderSize(1);
00966       TPaveText *infoTex2 = new TPaveText(0.3,1.,0.45,1.07);
00967       infoTex2->AddText("Intermediate");
00968       infoTex2->SetBorderSize(1);
00969       TPaveText *infoTex3 = new TPaveText(0.55,1.,0.7,1.07);
00970       infoTex3->AddText("Final State");
00971       infoTex3->SetBorderSize(1);
00972       TPaveText *infoTex4 = new TPaveText(0.8,1.,0.95,1.07);
00973       infoTex4->AddText("Later Decays");
00974       infoTex4->SetBorderSize(1);
00975       infoTex1->SetTextSize(0.05);
00976       infoTex1->SetTextFont(12);
00977       infoTex1->SetTextColor(1);
00978       infoTex2->SetTextSize(0.05);
00979       infoTex2->SetTextFont(12);
00980       infoTex2->SetTextColor(1);
00981       infoTex3->SetTextSize(0.05);
00982       infoTex3->SetTextFont(12);
00983       infoTex3->SetTextColor(1);
00984       infoTex4->SetTextSize(0.05);
00985       infoTex4->SetTextFont(12);
00986       infoTex4->SetTextColor(1);
00987       infoTex1->SetName("infoTex1");
00988       infoTex2->SetName("infoTex2");
00989       infoTex3->SetName("infoTex3");
00990       infoTex4->SetName("infoTex4");
00991       infoTex1->Draw();
00992       infoTex2->Draw();
00993       infoTex3->Draw();
00994       infoTex4->Draw();
00995     }
00996 
00997     fCanvas0->cd();
00998     fButtonPad = new TPad("fButtonPad","Buttons",0,0,0.5,0.05);
00999     fButtonPad->Draw();
01000     fButtonPad->cd();
01001     //the following button can zoom in/out the histograms on the first Canvas. TButton has no access to the class members so I have to pass the parameters through the histogram option. 
01002     fZoom = new TButton("Zoom","float a1,a2,a3,a4,a5,a6;int i;sscanf(UZview->GetOption(),\"%f,%f,%f,%f,%f,%f,%d\",&a1,&a2,&a3,&a4,&a5,&a6,&i);if(i==0){UZview->GetXaxis()->SetRangeUser(a2,a1);UZview->GetYaxis()->SetRangeUser(a4,a3);VZview->GetXaxis()->SetRangeUser(a2,a1);VZview->GetYaxis()->SetRangeUser(a6,a5);char setoptions[100];sprintf(setoptions,\"%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%d\",a1,a2,a3,a4,a5,a6,1);UZview->SetOption(setoptions);} else if(i==1){double max=UZview->GetMaximum();UZview->GetXaxis()->UnZoom();UZview->GetYaxis()->UnZoom();VZview->GetXaxis()->UnZoom();VZview->GetYaxis()->UnZoom();UZview->SetMaximum(max);VZview->SetMaximum(max);char setoptions[100];sprintf(setoptions,\"%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%d\",a1,a2,a3,a4,a5,a6,0);UZview->SetOption(setoptions);}fHistPad->cd(1);gPad->Modified();fHistPad->cd(2);gPad->Modified();",0,0,0.1,1);
01003     fZoom->SetTextSize(0.5);
01004     fZoom->Draw();
01005 
01006     fCanvas0->cd();
01007     fHistPad = new TPad("fHistPad","UZ and VZ views",0,0.05,0.5,1);
01008     //fHistPad->SetTopMargin(1);
01009     fHistPad->Draw();
01010     
01011     fHistPad->cd();
01012     fHistPad->Divide(1,2);
01013     
01014     int trkcolor = 1;
01015     int shwcolor = 6;
01016     // U vs. Z view
01017     fHistPad->cd(1);
01018     fUZview = new TH2D("UZview","Strip vs. Plane, U view",
01019                        500,0,30,210,-4.05,4.05);
01020     fUZview->SetStats(false);
01021     fUZview->SetXTitle("z(m)");
01022     fUZview->SetYTitle("u(m)");
01023     fUZview->GetYaxis()->SetTitleOffset(0.6);
01024     fUZview->Draw("COLZ");
01025     srvtx_u->Draw();
01026     fTrkUZ = new TH2D("TrkUZ","track strips, U view",
01027                        500,0,30,210,-4.05,4.05);
01028     fTrkUZ->SetStats(false);
01029     fTrkUZ->SetLineColor(trkcolor);
01030     fShwUZ = new TH2D("ShwUZ","shower strips, U view",
01031                        500,0,30,210,-4.05,4.05);
01032     fShwUZ->SetStats(false);
01033     fShwUZ->SetLineColor(shwcolor);
01034     fShwUZ->SetLineWidth(2);
01035     fSlcUZ = new TH2D("SlcUZ","Strip vs. Plane, U view",
01036                        500,0,30,210,-4.05,4.05);
01037     fSlcUZ->SetStats(false);
01038 
01039     // V vs. Z view
01040     fHistPad->cd(2);
01041     fVZview = new TH2D("VZview","Strip vs. Plane, V view",
01042                        500,0,30,210,-4.05,4.05);
01043     fVZview->SetStats(false);
01044     fVZview->SetXTitle("z(m)");
01045     fVZview->SetYTitle("v(m)");
01046     fVZview->GetYaxis()->SetTitleOffset(0.6);
01047     fVZview->Draw("COLZ");
01048     srvtx_v->Draw();
01049     fTrkVZ = new TH2D("TrkVZ","track strips, V view",
01050                        500,0,30,210,-4.05,4.05);
01051     fTrkVZ->SetStats(false);
01052     fTrkVZ->SetLineColor(trkcolor);
01053     fShwVZ = new TH2D("ShwVZ","shower strips, V view",
01054                        500,0,30,210,-4.05,4.05);
01055     fShwVZ->SetLineColor(shwcolor);
01056     fShwVZ->SetStats(false);
01057     fShwVZ->SetLineWidth(2);
01058     fSlcVZ = new TH2D("SlcVZ","Strip vs. Plane, V view",
01059                        500,0,30,210,-4.05,4.05);
01060     fSlcVZ->SetStats(false);
01061 
01062     // U vs. V view
01063     fCanvas0->cd();
01064     fUVview = new TPad("UVview","U vs V view",0.5,0.5,0.725,1);
01065     fUVview->SetFillStyle(4000);
01066     
01067     float t[4];
01068     ugh.GetTransverseExtent(PlaneView::kU,t[0],t[1]);
01069     ugh.GetTransverseExtent(PlaneView::kV,t[2],t[3]);
01070     for (int ind=0; ind<4;++ind) t[ind] = TMath::Abs(t[ind]);
01071     int maxind = TMath::LocMax(4,t);
01072     float tsize = TMath::Sqrt(2.0) * t[maxind];
01073     
01074     fUVview->Range(-tsize,-tsize,tsize,tsize);
01075     
01076     fUVview->Draw();
01077     
01078     fInfo0 = new TPad("Info0","Basic information",0.725,0.5,1,1);
01079     fInfo0->Draw();
01080     //fInfo0->cd();
01081     //fInfo0->Divide(1,2);
01082     fUVview->cd();
01083     fSteelOutline = new SteelOutline(DataUtil::GetDetector(gMint->GetJobC().Mom));
01084     if (!fSteelOutline) MSG("NueDisplayModule",Msg::kWarning)<<"Can't get the stell outline."<<endl;
01085     if (fDetectorType == Detector::kFar){//draw veto shield,copied Jim's EVD code
01086       //UgliGeomHandle ugh = gMint->GetUgliGeomHandle();
01087       if (ugh.IsValid()){
01088         vector<UgliScintPlnHandle> usphv = ugh.GetScintPlnHandleVector();
01089         vector<UgliScintPlnHandle>::reverse_iterator rit, rdone = usphv.rend();
01090         VS = new TList;
01091         VS->SetOwner();
01092         float cx,cy; 
01093         StripEnd::StripEnd_t two_sided[] = { StripEnd::kEast,
01094                                              StripEnd::kWest };
01095         StripEnd::StripEnd_t *side_list = two_sided;
01096    
01097         for (rit = usphv.rbegin(); rit != rdone; ++rit) {
01098           if (! rit->GetPlexPlaneId().IsVetoShield()) break;
01099           int nstrips = rit->NumberOfStrips();
01100           for (int istrip=0; istrip < nstrips; istrip++) {
01101             PlexStripEndId oneend(rit->GetPlexPlaneId(),istrip,side_list[0]);
01102             UgliStripHandle ush = ugh.GetStripHandle(oneend);
01103             TVector3 stripxyz0(ush.GlobalPos(-ush.GetHalfLength()));
01104             TVector3 stripxyz1(ush.GlobalPos(ush.GetHalfLength()));
01105             cx = 0.5*(stripxyz0[0]+stripxyz1[0]);
01106             cy = 0.5*(stripxyz0[1]+stripxyz1[1]);     
01107             Double_t dy[5] = {-ush.GetHalfThickness(),
01108                               -ush.GetHalfThickness(),
01109                               +ush.GetHalfThickness(),
01110                               +ush.GetHalfThickness(),
01111                               -ush.GetHalfThickness()};
01112             Double_t dx[5] = {-ush.GetHalfWidth(),
01113                               +ush.GetHalfWidth(),
01114                               +ush.GetHalfWidth(),
01115                               -ush.GetHalfWidth(),
01116                               -ush.GetHalfWidth()};
01117             if(rit->GetPlaneView()==PlaneView::kVSWallOnEdge){
01118               for (int id=0;id<6;id++){
01119                 double tmp=dy[id];
01120                 dy[id]=dx[id];
01121                 dx[id]=tmp;
01122               }
01123             }
01124             Double_t rot=0.9;
01125             if(rit->GetPlaneView()==PlaneView::kVSTopEastSlant){
01126               double newdx;
01127               double newdy;
01128               for (int id=0;id<6;id++){
01129                 newdx=dx[id]*cos(-rot)+dy[id]*sin(-rot);
01130                 newdy=-dx[id]*sin(-rot)+dy[id]*cos(-rot);
01131                 dx[id]=newdx;
01132                 dy[id]=newdy;
01133               }
01134             }
01135             if(rit->GetPlaneView()==PlaneView::kVSTopWestSlant){
01136               double newdx;
01137               double newdy;
01138               for (int id=0;id<6;id++){
01139                 newdx=dx[id]*cos(rot)+dy[id]*sin(rot);
01140                 newdy=-dx[id]*sin(rot)+dy[id]*cos(rot);
01141                 dx[id]=newdx;
01142                 dy[id]=newdy;
01143               }
01144               
01145             }
01146             Double_t xbox[5]={cx+dx[0],cx+dx[1],cx+dx[2],cx+dx[3],cx+dx[4]};
01147             Double_t ybox[5]={cy+dy[0],cy+dy[1],cy+dy[2],cy+dy[3],cy+dy[4]};
01148             TPolyLine * VSstrip = new TPolyLine(5,xbox,ybox);
01149             VSstrip->SetLineColor(13);
01150             VSstrip->SetLineWidth(1);
01151             VS->Add(VSstrip);
01152           }
01153         }
01154       }
01155     }
01156     Double_t l_coil = 0.2;
01157     Double_t x_coil[5] = {0,l_coil,0,-1*l_coil,0};
01158     Double_t y_coil[5] = {l_coil,0,-1*l_coil,0,l_coil};
01159     coil = new TPolyLine(5,x_coil,y_coil);
01160     coil->SetLineWidth(2);
01161 
01162     if (fDetectorType == Detector::kNear && !pu1_outline){
01163       //from Mad....
01164       PlaneOutline po;
01165       Color_t colu=38;
01166       Color_t colv=46;
01167       po.GetOutline(PlaneView::kV, PlaneCoverage::kNearPartial,
01168                     pv1_outline, pv2_outline);
01169       po.GetOutline(PlaneView::kV, PlaneCoverage::kNearFull,
01170                     fv1_outline, fv2_outline);
01171       po.GetOutline(PlaneView::kU, PlaneCoverage::kNearPartial,
01172                     pu1_outline, pu2_outline);
01173       po.GetOutline(PlaneView::kU, PlaneCoverage::kNearFull,
01174                     fu1_outline, fu2_outline);
01175       pv1_outline->SetLineColor(colv);
01176       pu1_outline->SetLineColor(colu);
01177 
01178       fv1_outline->SetLineColor(colv);
01179       fu1_outline->SetLineColor(colu);
01180       fv2_outline->SetFillColor(16);
01181       fu2_outline->SetFillColor(16);
01182       fv2_outline->SetFillStyle(4020);
01183       fu2_outline->SetFillStyle(4020);
01184       
01185       pv1_outline->SetLineWidth(1);
01186       pu1_outline->SetLineWidth(1);
01187       fv1_outline->SetLineWidth(1);
01188       fu1_outline->SetLineWidth(1);
01189       fv2_outline->SetLineWidth(1);
01190       fu2_outline->SetLineWidth(1);
01191 
01192     }
01193 
01194     //magnified images canvas
01195     fCanvas1->cd();
01196     fBC = new TPad("fBC","Button Panel for colz display",0,0.05,0.05,1);
01197     fBC->Draw();
01198     fBC->cd();
01199 
01200     //add buttons to get rid of low ph hitss 
01201     //originally 0,1,3,5 pe = 0,60,180,300 sigcor (far) = 0,0.1062,0.3186,0.5410 MEU (far)
01202     //originally 0,1,3,5 pe = 0,100,300,500 sigcor (near) = 
01203     cbut[0] = new TButton("PH>0","UZcolz->SetMinimum(0);VZcolz->SetMinimum(0);fHistcolz->cd(1);gPad->Modified();fHistcolz->cd(2);gPad->Modified();for(int i=0;i<4;i++){TButton *cbut=(TButton*)fBC->FindObject(Form(\"cbut%d\",i));if(i==0) cbut->SetFillColor(4); else cbut->SetFillColor(5);cbut->Paint();}",0,0.31,1,.36);
01204     cbut[0]->SetName("cbut0");
01205     cbut[1] = new TButton("PH>0.1","UZcolz->SetMinimum(0.10);VZcolz->SetMinimum(0.1);fHistcolz->cd(1);gPad->Modified();fHistcolz->cd(2);gPad->Modified();for(int i=0;i<4;i++){TButton *cbut=(TButton*)fBC->FindObject(Form(\"cbut%d\",i));if(i==1) cbut->SetFillColor(4); else cbut->SetFillColor(5);cbut->Paint();}",0,0.24,1,0.29);
01206     cbut[1]->SetName("cbut1");
01207     cbut[2] = new TButton("PH>0.3","UZcolz->SetMinimum(0.30);VZcolz->SetMinimum(0.3);fHistcolz->cd(1);gPad->Modified();fHistcolz->cd(2);gPad->Modified();for(int i=0;i<4;i++){TButton *cbut=(TButton*)fBC->FindObject(Form(\"cbut%d\",i));if(i==2) cbut->SetFillColor(4); else cbut->SetFillColor(5);cbut->Paint();}",0,0.17,1,0.22);
01208     cbut[2]->SetName("cbut2");
01209     cbut[3] = new TButton("PH>0.5","UZcolz->SetMinimum(0.50);VZcolz->SetMinimum(0.5);fHistcolz->cd(1);gPad->Modified();fHistcolz->cd(2);gPad->Modified();for(int i=0;i<4;i++){TButton *cbut=(TButton*)fBC->FindObject(Form(\"cbut%d\",i));if(i==3) cbut->SetFillColor(4); else cbut->SetFillColor(5);cbut->Paint();}",0,0.10,1,0.15);
01210     cbut[3]->SetName("cbut3");
01211     //cbut[4] = new TButton("Fix","fixc();",0,0.6,1,0.65);
01212     //cbut[4]->SetName("cbut4");
01213     for (int icbut = 0; icbut<4; icbut++){
01214       if (icbut == 0){
01215         cbut[icbut]->SetFillColor(4);
01216       }
01217       else cbut[icbut]->SetFillColor(5);
01218       cbut[icbut]->SetTextSize(0.5);
01219       cbut[icbut]->Draw();
01220     }
01221 
01222     fCanvas1->cd();
01223     fHistcolz = new TPad("fHistcolz","UZ and VZ views",0.05,0.05,0.525,1);
01224     fHistcolz->Draw();
01225     fHistcolz->cd();
01226     fHistcolz->Divide(1,2);
01227     fHistcolz->cd(1);
01228     fUZcolz = new TH2D("UZcolz","Strip vs. Plane, U view",1,0,1,1,0,1);
01229     //fUZcolz->SetTitle("Strip vs. Plane, U view");
01230     //fUZcolz->SetBins(1,0,1,1,0,1);
01231     fUZcolz->SetStats(false);
01232     fUZcolz->SetXTitle("z(m)");
01233     fUZcolz->SetYTitle("u(m)");
01234     fUZcolz->GetYaxis()->SetTitleOffset(0.6);
01235     fUZcolz->Draw("colz");
01236     srvtx_u->Draw();
01237     //mcvtx_u->Draw();
01238 
01239     fHistcolz->cd(2);
01240     fVZcolz = new TH2D("VZcolz","Strip vs. Plane, V view",1,0,1,1,0,1);
01241     fVZcolz->SetStats(false);
01242     fVZcolz->SetXTitle("z(m)");
01243     fVZcolz->SetYTitle("v(m)");
01244     fVZcolz->GetYaxis()->SetTitleOffset(0.6);
01245     //fVZcolz->SetTitle("Strip vs. Plane, V view");
01246     //fVZcolz->SetBins(1,0,1,1,0,1);
01247     fVZcolz->Draw("colz");
01248     srvtx_v->Draw();
01249     //mcvtx_v->Draw();
01250     
01251     fCanvas1->cd();
01252     fHistlego = new TPad("fHistlego","UZ and VZ views",0.525,0.05,1,1);
01253     fHistlego->Draw();
01254     fHistlego->cd();
01255     fHistlego->Divide(1,2);
01256     fHistlego->cd(1);
01257     fUZlego = new TH2D("UZlego","Strip vs. Plane, U view",1,0,1,1,0,1);
01258     fUZlego->SetStats(false);
01259     //fUZlego->SetName("fUZlego");
01260     //fUZlego->SetTitle("Strip vs. Plane, U view");
01261     //fUZlego->SetBins(1,0,1,1,0,1);
01262     fUZlego->Draw("lego2");
01263     fHistlego->cd(2);
01264     fVZlego = new TH2D("VZlego","Strip vs. Plane, V view",1,0,1,1,0,1);
01265     fVZlego->SetStats(false);
01266     //fVZlego->SetName("fVZlego");
01267     //fVZlego->SetTitle("Strip vs. Plane, V view");
01268     //fVZlego->SetBins(1,0,1,1,0,1);
01269     fVZlego->Draw("lego2");
01270 
01271     fCanvas1->cd();
01272     fBL = new TPad("fBL","Button Panel for lego display",0.525,0,1,0.05);
01273     fBL->Draw();
01274     fBL->cd();
01275 
01276     //add buttons to rotate lego plots
01277     lbut[0] = new TButton("Pan view","fHistlego->cd(1);gPad->SetPhi(30);gPad->SetTheta(30);gPad->Modified();fHistlego->cd(2);gPad->SetPhi(30);gPad->SetTheta(30);gPad->Modified();for(int i=0;i<4;i++){TButton *lbut=(TButton*)fBL->FindObject(Form(\"lbut%d\",i));if(i==0) lbut->SetFillColor(4); else lbut->SetFillColor(5);lbut->Paint();}",0.1,0,0.22,1);
01278     lbut[0]->SetName("lbut0");
01279     lbut[1] = new TButton("Side view","fHistlego->cd(1);gPad->SetPhi(15);gPad->SetTheta(30);gPad->Modified();fHistlego->cd(2);gPad->SetPhi(15);gPad->SetTheta(30);gPad->Modified();for(int i=0;i<4;i++){TButton *lbut=(TButton*)fBL->FindObject(Form(\"lbut%d\",i));if(i==1) lbut->SetFillColor(4); else lbut->SetFillColor(5);lbut->Paint();}",0.23,0,0.35,1);
01280     lbut[1]->SetName("lbut1");
01281     lbut[2] = new TButton("Front view","fHistlego->cd(1);gPad->SetPhi(75);gPad->SetTheta(60);gPad->Modified();fHistlego->cd(2);gPad->SetPhi(75);gPad->SetTheta(60);gPad->Modified();for(int i=0;i<4;i++){TButton *lbut=(TButton*)fBL->FindObject(Form(\"lbut%d\",i));if(i==2) lbut->SetFillColor(4); else lbut->SetFillColor(5);lbut->Paint();}",0.36,0,0.48,1);
01282     lbut[2]->SetName("lbut2");
01283     lbut[3] = new TButton("Top view","fHistlego->cd(1);gPad->SetPhi(30);gPad->SetTheta(75);gPad->Modified();fHistlego->cd(2);gPad->SetPhi(30);gPad->SetTheta(75);gPad->Modified();for(int i=0;i<4;i++){TButton *lbut=(TButton*)fBL->FindObject(Form(\"lbut%d\",i));if(i==3) lbut->SetFillColor(4); else lbut->SetFillColor(5);lbut->Paint();}",0.49,0,0.61,1);
01284     lbut[3]->SetName("lbut3");
01285     //lbut[4] = new TButton("Fix","",0.64,0,0.76,1);
01286     for (int ilbut = 0; ilbut<4; ilbut++){
01287       if (ilbut == 0){
01288         lbut[ilbut]->SetFillColor(4);
01289       }
01290       else lbut[ilbut]->SetFillColor(5);
01291       lbut[ilbut]->SetTextSize(0.5);
01292       lbut[ilbut]->Draw();
01293     }
01294 
01295     fCanvas1->cd();
01296     fStdLeg = new TPad("fStdLeg","legend",0,0,0.525,0.05);
01297     fStdLeg->Draw();
01298     fStdLeg->cd();
01299     
01300     //copied Chris' code
01301     TLine *line;
01302     line = new TLine(0.01,0.5,0.04,0.5);
01303     line->SetLineColor(3);
01304     line->SetLineWidth(2);
01305     line->Draw();
01306     line = new TLine(0.11,0.5,0.14,0.5);
01307     line->SetLineColor(4);
01308     line->SetLineWidth(2);
01309     line->Draw();
01310     line = new TLine(0.21,0.5,0.24,0.5);
01311     line->SetLineColor(2);
01312     line->SetLineWidth(2);
01313     line->Draw();
01314     line = new TLine(0.31,0.5,0.34,0.5);
01315     line->SetLineColor(28);
01316     line->SetLineWidth(2);
01317     line->Draw();
01318     line = new TLine(0.41,0.5,0.44,0.5);
01319     line->SetLineColor(6);
01320     line->SetLineWidth(2);
01321     line->Draw();
01322     line = new TLine(0.51,0.5,0.54,0.5);
01323     line->SetLineColor(7);
01324     line->SetLineWidth(2);
01325     line->Draw();
01326     line = new TLine(0.61,0.5,0.64,0.5);
01327     line->SetLineColor(31);
01328     line->SetLineWidth(2);
01329     line->Draw();
01330     line = new TLine(0.71,0.5,0.74,0.5);
01331     line->SetLineColor(9);
01332     line->SetLineWidth(2);
01333     line->Draw();
01334     line = new TLine(0.81,0.5,0.84,0.5);
01335     line->SetLineColor(5);
01336     line->SetLineWidth(2);
01337     line->Draw();
01338     line = new TLine(0.91,0.5,0.94,0.5);
01339     line->SetLineColor(1);
01340     line->SetLineWidth(2);
01341     line->SetLineStyle(2);
01342     line->Draw();
01343 
01344 
01345     TLatex *tex;
01346     tex = new TLatex(0.06,0.3,"e");
01347     tex->SetTextFont(132);
01348     tex->SetTextSize(0.7);
01349     tex->Draw();
01350     tex = new TLatex(0.16,0.3,"#mu");
01351     tex->SetTextFont(132);
01352     tex->SetTextSize(0.7);
01353     tex->Draw();
01354     tex = new TLatex(0.26,0.3,"p");
01355     tex->SetTextFont(132);
01356     tex->SetTextSize(0.7);
01357     tex->Draw();
01358     tex = new TLatex(0.36,0.3,"n");
01359     tex->SetTextFont(132);
01360     tex->SetTextSize(0.7);
01361     tex->Draw();
01362     tex = new TLatex(0.46,0.3,"#pi^{+/-}");
01363     tex->SetTextFont(132);
01364     tex->SetTextSize(0.7);
01365     tex->Draw();
01366     tex = new TLatex(0.56,0.3,"#pi^{0}");
01367     tex->SetTextFont(132);
01368     tex->SetTextSize(0.7);
01369     tex->Draw();
01370     tex = new TLatex(0.66,0.3,"K^{+/-/0}");
01371     tex->SetTextFont(132);
01372     tex->SetTextSize(0.7);
01373     tex->Draw();
01374     tex = new TLatex(0.76,0.3,"#gamma");
01375     tex->SetTextFont(132);
01376     tex->SetTextSize(0.7);
01377     tex->Draw();
01378     tex = new TLatex(0.86,0.3,"tau");
01379     tex->SetTextFont(132);
01380     tex->SetTextSize(0.7);
01381     tex->Draw();
01382     tex = new TLatex(0.96,0.3,"#nu");
01383     tex->SetTextFont(132);
01384     tex->SetTextSize(0.7);
01385     tex->Draw();
01386 
01387     gPad->Modified();
01388     fCanvas1->Update();
01389 
01390     fCanvas2->cd(1);
01391     fFracVar_plots = new TPad("fFracVar_plots","FracVar",0,0,1,1);
01392     fFracVar_plots->Draw();
01393     fFracVar_plots->Divide(1,2);
01394     fCanvas2->cd(2);
01395     fReco_plots = new TPad("fReco_plots","Reco",0,0,1,1);
01396     fReco_plots->Draw();
01397     fReco_plots->Divide(1,2);
01398     fReco_plots->cd(1);
01399     fSlcUZ->SetXTitle("z(m)");
01400     fSlcUZ->SetYTitle("u(m)");
01401     fSlcUZ->GetYaxis()->SetTitleOffset(0.6);
01402     fSlcUZ->Draw("colz");
01403     fShwUZ->SetMaximum(1);
01404     fShwUZ->SetMinimum(0);
01405     fShwUZ->Draw("box same");
01406     fTrkUZ->SetMaximum(1);
01407     fTrkUZ->SetMinimum(0);
01408     fTrkUZ->Draw("box same");
01409 
01410     fReco_plots->cd(2);
01411     fSlcVZ->SetXTitle("z(m)");
01412     fSlcVZ->SetYTitle("v(m)");
01413     fSlcVZ->GetYaxis()->SetTitleOffset(0.6);
01414     fSlcVZ->Draw("colz");
01415     fShwVZ->SetMaximum(1);
01416     fShwVZ->SetMinimum(0);
01417     fShwVZ->Draw("box same");
01418     fTrkVZ->SetMaximum(1);
01419     fTrkVZ->SetMinimum(0);
01420     fTrkVZ->Draw("box same");
01421 
01422     fShwfit_plots = fCanvas3;
01423 
01424     fAngClusterFitAna_plots = fCanvas4;
01425 
01426     if(kIntReco) {
01427       fCanvas6->cd();      
01428       fCanvas6->SetName("fCanvas6");
01429       fCanvas6->Divide(2,2);
01430       fCanvas6->SetFillColor(42);
01431       fCanvas6->cd(1);
01432       gPad->Range(0,0,1,1);
01433       fCanvas6->cd(2);
01434       gPad->Range(0,0,1,1);
01435       fCanvas6->cd(3);
01436       gPad->Range(0,0,1,1);
01437       fCanvas6->cd(4);
01438       gPad->Range(0,0,1,1);
01439 
01440       fCanvas6->cd(2);
01441       fIntRecoHistU = new TH1F("IntRecoHistU","Interactively Reconstructed Shower - Transverse View",1,0,1);
01442       fIntRecoHistU->SetXTitle("Transverse distance from event vertex (m)");
01443       fIntRecoHistU->SetYTitle("Summed PH (PE)");
01444       fIntRecoHistU->SetLineColor(4);
01445       fIntRecoHistU->SetStats(0);
01446       fIntRecoHistV = new TH1F("IntRecoHistV","Interactively Reconstructed Shower - Transverse View",1,0,1);
01447       fIntRecoHistV->SetXTitle("Transverse distance from event vertex (m)");
01448       fIntRecoHistV->SetYTitle("Summed PH (PE)");
01449       fIntRecoHistV->SetLineColor(6);
01450       fIntRecoHistV->SetStats(0);
01451 
01452       fPredictedHistU = new TH1F("PredictedHistU","Interactively Reconstructed Shower - Transverse View",1,0,1);
01453       fPredictedHistU->SetXTitle("Transverse distance from event vertex (m)");
01454       fPredictedHistU->SetYTitle("Summed PH (PE)");
01455       fPredictedHistU->SetLineColor(4);
01456       fPredictedHistU->SetStats(0); 
01457       fPredictedHistV = new TH1F("PredictedHistV","Interactively Reconstructed Shower - Transverse View",1,0,1);
01458       fPredictedHistV->SetXTitle("Transverse distance from event vertex (m)");
01459       fPredictedHistV->SetYTitle("Summed PH (PE)");
01460       fPredictedHistV->SetLineColor(6);
01461       fPredictedHistV->SetStats(0);
01462 
01463       fPredictedHistU->Draw();
01464       fPredictedHistV->Draw("sames");
01465       fIntRecoHistU->Draw("e1sames");
01466       fIntRecoHistV->Draw("e1sames");
01467 
01468       fCanvas6->cd(4);
01469       fIntRecoHistZ = new TH1F("IntRecoHistZ","Interactively Reconstructed Shower - Longitudinal View",1,0,1);
01470       fIntRecoHistZ->SetXTitle("Longitudinal distance from event vertex (m)");
01471       fIntRecoHistZ->SetYTitle("Summed PH (PE)");
01472       fIntRecoHistZ->SetStats(0);
01473 
01474       fPredictedHistZ = new TH1F("PredictedHistZ","Interactively Reconstructed Shower - Longitudinal View",1,0,1);
01475       fPredictedHistZ->SetXTitle("Longitudinal distance from event vertex (m)");
01476       fPredictedHistZ->SetYTitle("Summed PH (PE)");
01477       fPredictedHistZ->SetLineColor(2);
01478       fPredictedHistZ->SetStats(0);
01479       fPredictedHistZ->Draw();
01480       fIntRecoHistZ->Draw("e1sames");
01481 
01482       fUZPred = new TH2F("PredictedHistUZ","EM Prediction Based on Interactive Reconstruction - UZ View",1,0,1,1,0,1);
01483       fUZPred->SetXTitle("Plane");
01484       fUZPred->SetYTitle("U Strip");
01485       fUZPred->SetZTitle("Normalised PH");
01486       fUZPred->SetStats(0);
01487       fVZPred = new TH2F("PredictedHistVZ","EM Prediction Based on Interactive Reconstruction - VZ View",1,0,1,1,0,1);
01488       fVZPred->SetXTitle("Plane");
01489       fVZPred->SetYTitle("V Strip");
01490       fVZPred->SetZTitle("Normalised PH");      
01491       fVZPred->SetStats(0);
01492 
01493       fCanvas6->cd(1);
01494       fUZPred->Draw("COLZ");
01495       fCanvas6->cd(3);
01496       fVZPred->Draw("COLZ");
01497 
01498       fCanvas7->SetName("fCanvas7");
01499       fCanvas7->cd();
01500       fCanvas7->SetFillColor(42);
01501       fSelectPad1 = new SelectPad("fSelPad1","fSelPad1",
01502                                   0.01,0.505,0.99,0.99);
01503       fSelectPad1->Draw();      
01504       fSelectPad2 = new SelectPad("fSelPad2","fSelPad2",
01505                                   0.01,0.01,0.99,0.495);
01506       fSelectPad2->Draw();
01507       fSelectPad2->cd();
01508       fIntRecoDoSim = new TButton("Do Sim","TButton *but = (TButton*) fSelPad2->FindObject(\"IntRecoDoSimButton\");if(but->GetFillColor()==2) but->SetFillColor(3); else but->SetFillColor(2);but->Paint();",0.01,0.04,0.075,0.15);
01509       fIntRecoDoSim->SetName("IntRecoDoSimButton");
01510       fIntRecoDoSim->SetFillColor(2);
01511       fIntRecoDoSim->Draw();
01512     }
01513 
01514     fCanvas8->cd(1);
01515     TimeHst = new THStack("TimeHist",
01516                           "Digit Times (ns) Red - Trk, Blue - Shw");
01517     TimeHstTrk = new TH1F();
01518     TimeHstTrk->SetName("TimeHstTrk");
01519     TimeHstShw = new TH1F();
01520     TimeHstShw->SetName("TimeHstShw");
01521 
01522     TimeHst->Add(TimeHstTrk);
01523     TimeHst->Add(TimeHstShw);
01524     TimeHst->Draw("nostack");
01525 
01526     fCanvas8->cd(2);
01527     TimeHstUV = new THStack("TimeHistUV",
01528                             "UV Digit Times (ns) Red - Trk, Blue - Shw");
01529     TimeHstTrkU = new TH1F();
01530     TimeHstTrkU->SetName("TimeHstTrkU");
01531     TimeHstTrkV = new TH1F();
01532     TimeHstTrkV->SetName("TimeHstTrkV");
01533     TimeHstShwU = new TH1F();
01534     TimeHstShwU->SetName("TimeHstShwU");
01535     TimeHstShwV = new TH1F();
01536     TimeHstShwV->SetName("TimeHstShwV");
01537 
01538     TimeHstUV->Add(TimeHstTrkU);
01539     TimeHstUV->Add(TimeHstTrkV);
01540     TimeHstUV->Add(TimeHstShwU);
01541     TimeHstUV->Add(TimeHstShwV);
01542     TimeHstUV->Draw("nostack");
01543     
01544     fCanvas8->cd(3);
01545     TimeHst2 = new THStack("TimeHist2",
01546                            "Digit Times (ns) after prop. cor. Red - Trk, Blue - Shw");
01547     TimeHstTrk2 = new TH1F();
01548     TimeHstTrk2->SetName("TimeHstTrk2");
01549     TimeHstShw2 = new TH1F();
01550     TimeHstShw2->SetName("TimeHstShw2");
01551     
01552     TimeHst2->Add(TimeHstTrk2);
01553     TimeHst2->Add(TimeHstShw2);
01554     TimeHst2->Draw("nostack");
01555 
01556     TLatex *tmptextrk = new TLatex(0.6,0.85,"tmp");
01557     tmptextrk->SetName("tmptextrk");
01558     tmptextrk->SetTextColor(4);
01559     tmptextrk->Draw();
01560 
01561     fCanvas8->cd(4);
01562     TimeHst2UV = new THStack("TimeHist2UV",
01563                              "UV Digit Times (ns) after prop. cor. Red - Trk, Blue - Shw");
01564     TimeHstTrk2U = new TH1F();
01565     TimeHstTrk2U->SetName("TimeHstTrk2U");
01566     TimeHstTrk2V = new TH1F();
01567     TimeHstTrk2V->SetName("TimeHstTrk2V");
01568     TimeHstShw2U = new TH1F();
01569     TimeHstShw2U->SetName("TimeHstShw2U");
01570     TimeHstShw2V = new TH1F();
01571     TimeHstShw2V->SetName("TimeHstShw2V");
01572 
01573     TimeHst2UV->Add(TimeHstTrk2U);
01574     TimeHst2UV->Add(TimeHstTrk2V);
01575     TimeHst2UV->Add(TimeHstShw2U);
01576     TimeHst2UV->Add(TimeHstShw2V);
01577     TimeHst2UV->Draw("nostack");
01578 
01580 
01581     fCanvas9->cd(2);
01582 
01583     for(int i =0; i < 6; i++) place[i] = new TBox(0,0,0,0);
01584     place[0]->SetFillColor(kMagenta);
01585     place[1]->SetFillColor(kRed);
01586     place[2]->SetFillColor(kBlack);
01587     place[3]->SetFillColor(kBlue);
01588     place[4]->SetFillColor(kCyan);
01589     place[5]->SetFillColor(kGreen);
01590 
01591     leg = new TLegend(0.8,0.49,0.99,0.99);
01592     leg->SetFillColor(0);
01593     leg->AddEntry(place[0], "Earlier", "f");
01594     leg->AddEntry(place[1], "Previous", "f");
01595     leg->AddEntry(place[2], "Current", "f");
01596     leg->AddEntry(place[3], "Next", "f");
01597     leg->AddEntry(place[4], "Later", "f");
01598     leg->Draw();
01599 
01600     fCanvas9->cd(3);
01601 
01602     char cmd1[100];  char cmd2[100];  char cmd3[100];
01603     sprintf(cmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->AdjustOverlayRange(1);\");", (void*)this);
01604     sprintf(cmd2, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->AdjustOverlayRange(2);\");", (void*)this); 
01605     sprintf(cmd3, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->AdjustOverlayRange(-1);\");", (void*)this);
01606     
01607     fCanvas9->cd();
01608     fPlusMinusOne = new TButton("+-One",cmd1,0,0.01,0.04,0.05);
01609     fPlusMinusTwo = new TButton("+-Two",cmd2,0.,0.06,0.04,0.10);
01610     fFullSnarl = new TButton("All",cmd3,0,0.11,0.04,0.15);
01611 
01612     fPlusMinusOne->Draw();
01613     fPlusMinusTwo->Draw();
01614     fFullSnarl->Draw();
01616 
01617     //set up the buttons in MR pad1
01618     fMRCanvas1->cd();
01619     
01620     mrInfoPanel = new TPad("Info0","Basic information",0.0,0.0,0.149,1);
01621     mrInfoPanel->Draw();
01622     mrInfoPanel->cd();
01623    
01624     char mrcmd1[100];
01625     sprintf(mrcmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->MRShowEvent(0);\");", (void*)this);
01626     fMRuShowAll = new TButton("New",mrcmd1,0,0.85,0.33,0.89);
01627 
01628     sprintf(mrcmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->MRShowEvent(1);\");", (void*)this);
01629     fMRuShowMR  = new TButton("MR",mrcmd1,0.,0.90,0.33,0.94);
01630 
01631     sprintf(mrcmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->MRShowEvent(2);\");", (void*)this);
01632     fMRuShowOld = new TButton("Orig",mrcmd1,0,0.95,0.33,0.99);
01633 
01634     fMRuShowAll->Draw();
01635     fMRuShowMR->Draw();
01636     fMRuShowOld->Draw();
01637 
01638     sprintf(mrcmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->MRShowMRStrips(0);\");", (void*)this);
01639     fMRdShowAll = new TButton("All",mrcmd1, 0 ,0.21,0.33,0.25);
01640       
01641     sprintf(mrcmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->MRShowMRStrips(1);\");", (void*)this);
01642     fMRdShowTrueMu = new TButton("TruMu",mrcmd1,0,0.16,0.33,0.20);
01643 
01644     sprintf(mrcmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->MRShowMRStrips(2);\");", (void*)this);
01645     fMRdShowTrueShw = new TButton("TruShw",mrcmd1,0.0,0.11,0.33,0.15);
01646 
01647     sprintf(mrcmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->MRShowMRStrips(3);\");", (void*)this);
01648     fMRdShowScaled = new TButton("Scaled",mrcmd1,0,0.06,0.33,0.10);
01649 
01650     sprintf(mrcmd1, "gROOT->ProcessLineSync(\"((NueDisplayModule*)%p)->MRShowMRStrips(4);\");", (void*)this);
01651     fMRdShowReco = new TButton("Reco",mrcmd1,0.0,0.01,0.33,0.05);
01652 
01653     fMRdShowAll->Draw();
01654     fMRdShowTrueMu->Draw();
01655     fMRdShowTrueShw->Draw();
01656     fMRdShowScaled->Draw();
01657     fMRdShowReco->Draw();
01658 
01659     mrInfoPanel->Draw();
01660     
01661     /* reusing the boxes from above
01662     place[0]->SetFillColor(kMagenta);
01663     place[1]->SetFillColor(kRed);
01664     place[2]->SetFillColor(kBlack);
01665     place[3]->SetFillColor(kBlue);
01666     place[4]->SetFillColor(kCyan);
01667     */
01668 
01669 //    fMRCanvas1->cd(2);
01670     fMRUpperLeg = new TLegend(0.35,0.85,0.99,0.99);
01671     fMRUpperLeg->SetFillColor(0);
01672     fMRUpperLeg->AddEntry(place[3], "Original", "f");
01673     fMRUpperLeg->AddEntry(place[1], "MR Strips", "f");
01674     fMRUpperLeg->AddEntry(place[5], "New Event", "f");
01675     fMRUpperLeg->SetTextSize(0.1);
01676     fMRUpperLeg->SetBorderSize(1);
01677     fMRUpperLeg->Draw();
01678 
01679 //    fMRCanvas1->cd(4);
01680     fMRLowerLeg = new TLegend(0.35,0.01,0.99,0.2);
01681     fMRLowerLeg->SetFillColor(0);
01682     fMRLowerLeg->AddEntry(place[1], "True Mu", "f");
01683     fMRLowerLeg->AddEntry(place[5], "True Shw", "f");
01684     fMRLowerLeg->AddEntry(place[3], "Scaled", "f");
01685     fMRLowerLeg->AddEntry(place[4], "Reco", "f");
01686     fMRLowerLeg->SetTextSize(0.1);
01687     fMRLowerLeg->SetBorderSize(1);
01688     fMRLowerLeg->Draw();
01689    
01691 
01692     fMRCanvas1->cd();
01693     mrGraphPad = new TPad("Info0","mrgraphs",0.15,0.0,1,1);
01694     mrGraphPad->Draw();
01695     mrGraphPad->Divide(2,2);
01696                                                                                 
01697     mrGraphPad->Draw();
01698 
01699 
01700     fEvent = 0;    
01701 }

void NueDisplayModule::ColorGraph ( TGraph *  gr,
int  color,
int  style = 8,
Float_t  size = 0.8 
) [private]

Definition at line 5968 of file NueDisplayModule.cxx.

Referenced by UpdateMREventOverlayColors(), and UpdateMREventStripColors().

05970 {
05971   if(gr == 0) return;
05972 
05973   gr->SetMarkerSize(size);
05974   gr->SetMarkerStyle(style);
05975   gr->SetMarkerColor(color);
05976 }

void NueDisplayModule::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 4544 of file NueDisplayModule.cxx.

References NueAnalysisCuts::Config(), fCut, Registry::Get(), kCPhPlaneCut, Msg::kDebug, kDPlaneCut, kDrawClu, kHideRunSnarl, kIntReco, kLoPhNPlaneCut, kLoPhNStripCut, kPhPlaneCut, kPhStripCut, kPIDCut, kScanMode, kTestMode, and MSG.

04545 {
04546 //======================================================================
04547 // Configure the module given the Registry r
04548 //======================================================================
04549   MSG("NueDisplayModule",Msg::kDebug)<<"In NueDisplayModule::Config"<<endl;
04550 
04551   fCut.Config(r);
04552 
04553   int imps;
04554   if(r.Get("DPlaneCut",imps)) { kDPlaneCut=imps;}
04555   if(r.Get("LoPhNStripCut",imps)) { kLoPhNStripCut=imps;}
04556   if(r.Get("LoPhNPlaneCut",imps)) { kLoPhNPlaneCut=imps;}
04557 
04558   if(r.Get("ScanMode",imps)) {kScanMode=imps;}
04559   if(r.Get("TestMode",imps)) {kTestMode=imps;}
04560   if(r.Get("HideRunSnarl",imps)) {kHideRunSnarl=imps;}
04561   if(r.Get("DrawClu",imps)) {kDrawClu=imps;}
04562   if(r.Get("IntReco",imps)) {kIntReco=imps;}
04563   double fmps;
04564   if(r.Get("PhStripCut",fmps)) { kPhStripCut=fmps;}
04565   if(r.Get("PhPlaneCut",fmps)) { kPhPlaneCut=fmps;}
04566   if(r.Get("ContPhPlaneCut",fmps)) { kCPhPlaneCut=fmps;}
04567 
04568   if(r.Get("PIDCut",fmps)) { kPIDCut=fmps;}
04569 }

void NueDisplayModule::CreateMRMap ( vector< int > &  MRnewEvent,
vector< int > &  MRoldEvent 
) [private]

Definition at line 5639 of file NueDisplayModule.cxx.

References NtpMREvent::best_event, SntpHelpers::GetMREvent(), mr, NtpMRRecord::mrhdr, NtpMRSummary::nmrevt, and NtpMREvent::orig_event.

Referenced by UpdateMRGraphs().

05640 {
05641 
05642    MRnewEvent.clear();
05643    MRoldEvent.clear();
05644 
05645    for(int mrevt = 0; mrevt < mr->mrhdr.nmrevt; mrevt++)
05646    {
05647       NtpMREvent* mrevent = SntpHelpers::GetMREvent(mrevt, mr);    
05648       MRoldEvent.push_back(mrevent->orig_event);
05649       MRnewEvent.push_back(mrevent->best_event);
05650 //      cout<<"PushingBack "<<mrevent->orig_event<<"  "
05651 //          <<(mrevent->best_event)<<endl;
05652 
05653    }
05654 }

const Registry & NueDisplayModule::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 4508 of file NueDisplayModule.cxx.

References NueAnalysisCuts::DefaultConfig(), fCut, JobCModule::GetName(), Msg::kDebug, Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

04509 {
04510 //======================================================================
04511 // Supply the default configuration for the module
04512 //======================================================================
04513    MSG("NueDisplayModule",Msg::kDebug)<<"In NueDisplayModule::DefaultConfig"<<endl;
04514 
04515   static Registry r = fCut.DefaultConfig();
04516 
04517   // Set name of config
04518   std::string name = this->GetName();
04519   name += ".config.default";
04520   r.SetName(name.c_str());
04521 
04522   // Set values in configuration
04523   r.UnLockValues();
04524   r.Set("DPlaneCut",-1);
04525   r.Set("LoPhNStripCut",-1);
04526   r.Set("LoPhNPlaneCut",-1);
04527   r.Set("PhStripCut",-1);
04528   r.Set("PhPlaneCut",-1);
04529   r.Set("ContPhPlaneCut",-1);
04530 
04531   r.Set("PIDCut",-1);
04532   r.Set("ScanMode",0);
04533   r.Set("TestMode",0);
04534   r.Set("HideRunSnarl",0);
04535   r.Set("DrawClu",0);
04536   r.Set("IntReco",0);
04537   r.LockValues();
04538 
04539   return r;
04540 }

void NueDisplayModule::DeleteOldCrap (  )  [private]

Definition at line 4571 of file NueDisplayModule.cxx.

References it.

Referenced by Analyze().

04572 {
04573   //  cout<<"In delete old crap"<<endl;
04574   //  gDirectory->ls();
04575   TList *l = gDirectory->GetList();
04576   TIterator *it(l->MakeIterator());
04577   //  int NOBJ=l->GetSize();
04578   //  cout<<"Size of list "<<NOBJ<<endl;
04579   TObject *obj;
04580   while((obj=it->Next())){
04581     //    TObject *obj=l->At(i);
04582     const char* kn=obj->GetName();
04583     //    cout<<" Found a "<<kn<<endl;
04584     if(strstr(kn,"lenepl")!=NULL){
04585       obj->Delete();
04586       //      cout<<"deletint "<<kn<<endl;
04587     }
04588     if(strstr(kn,"tenestu")!=NULL){
04589       obj->Delete();
04590       //      cout<<"deletint "<<kn<<endl;
04591     }
04592     if(strstr(kn,"tenestv")!=NULL){
04593       obj->Delete();
04594       //      cout<<"deletint "<<kn<<endl;
04595     }
04596     if(strstr(kn,"LongHitHisto")!=NULL){
04597       obj->Delete();
04598       //      cout<<"deletint "<<kn<<endl;
04599     }
04600     if(strstr(kn,"TransHitHisto")!=NULL){
04601       obj->Delete();
04602       //      cout<<"deletint "<<kn<<endl;
04603     }
04604   }
04605 }

void NueDisplayModule::delmc (  )  [private]

Definition at line 4407 of file NueDisplayModule.cxx.

References fCanvas0, fCanvas1, fCanvas5, fHistcolz, fInfo0, fStdHepCan, info1, info2, info3, info4, info41, info5, kDrawClu, kTestMode, Munits::m, mcvtx_u, mcvtx_v, paru, and parv.

Referenced by fixmcinfo(), showmctruth(), and UpdateDisplay().

04408 {
04409   if (paru.size()) {
04410     for (int i = 0; i<int(paru.size()); i++){
04411       delete paru[i];
04412       delete parv[i];
04413     }
04414   }
04415   paru.clear();
04416   parv.clear();
04417   
04418   mcvtx_u->SetX(-100);
04419   mcvtx_v->SetY(-100);
04420   fInfo0->Clear();
04421   fInfo0->cd();
04422   info1->Draw();
04423   info2->Draw();
04424   info3->Draw();
04425   info4->Draw();
04426   info41->Draw();
04427   info5->Draw();
04428   //info6->Draw();
04429   gPad->Modified();
04430   fCanvas0->Update();
04431   
04432   fHistcolz->cd(1);
04433   gPad->Modified();
04434   fHistcolz->cd(2);
04435   gPad->Modified();
04436   fCanvas1->Update();
04437 
04438   if(kDrawClu){
04439     fCanvas5->cd(1);
04440     gPad->Modified();
04441     fCanvas5->cd(2);  
04442     gPad->Modified();
04443     fCanvas5->cd(4);  
04444     gPad->Modified();
04445     fCanvas5->cd(5);  
04446     gPad->Modified();
04447     fCanvas5->Update();
04448   }
04449 
04450   if(!kTestMode){
04451     fStdHepCan->cd();    
04452     TList *theList = fStdHepCan->GetListOfPrimitives();
04453     TIterator *iter = theList->MakeIterator();
04454     TObject *ob;
04455     while((ob = iter->Next())){
04456       if(ob->InheritsFrom("TLatex")) {
04457         TLatex *tex = (TLatex*) ob;
04458         delete tex;
04459       }
04460       else if(ob->InheritsFrom("TArrow")) {
04461         TArrow *ar = (TArrow*) ob;
04462         delete ar;
04463       }
04464       else if(ob->InheritsFrom("TMarker")) {
04465         TMarker *m = (TMarker*) ob;
04466         delete m;
04467       }
04468     }
04469     gPad->Modified();
04470     fStdHepCan->Update();
04471   }
04472 
04473 }

void NueDisplayModule::DrawInteractionDiagram ( Int_t  index  )  [private]

Definition at line 3376 of file NueDisplayModule.cxx.

References foundST, fStdHepCan, SntpHelpers::GetStdHepArray(), mc, and st.

Referenced by plotmc().

03376                                                         {
03377   //modified by steve cavanaugh aug 9, 2006 to take into account double particles in mc with IstHEP=2 
03378   //with modifications for readability
03379   
03380   fStdHepCan->cd();
03381   fStdHepCan->Range(0,0,1,1.1);
03382   
03383   vector<NtpMCStdHep *> hep;
03384   if (foundST) hep = SntpHelpers::GetStdHepArray(index, st);
03385   else hep = SntpHelpers::GetStdHepArray(index, mc);
03386 
03387 
03388 
03389   Int_t nStdHep = int(hep.size());
03390   Int_t *indicesToUse = new Int_t[nStdHep];
03391   Int_t *parent = new Int_t[nStdHep];
03392   Int_t *parent1 = new Int_t[nStdHep];
03393   Int_t incomingNeutrino = -1;
03394   Int_t cnt = 0;
03395 
03396 
03397 
03398   for(int i=0;i<nStdHep;i++){    
03399     if(hep[i]->mc==index) {
03400       indicesToUse[cnt] = i;
03401 
03402 
03403 
03404       //parent[i] = hep[i]->parent[0];
03405 
03406       //in the case where we have more than 1 event per snarl we might 
03407       //have indices which refer to the actual index, not the one for the particular event.... 
03408       //so make sure we match this up properly
03409       for(int j=0;j<nStdHep;j++){
03410         if ((Int_t)hep[j]->index==hep[i]->parent[0]){
03411           parent[i]=j;
03412           break;
03413         }
03414       }
03415 
03416       
03417       for(int j=0;j<nStdHep;j++){
03418         if ((Int_t)hep[j]->index==hep[i]->parent[1]){
03419           parent1[i]=j;
03420           break;
03421         }
03422       }
03423         
03424 
03425 
03426 
03427       if(hep[i]->IstHEP==0){
03428         if(abs(hep[i]->IdHEP)==12||abs(hep[i]->IdHEP)==14
03429            ||abs(hep[i]->IdHEP)==16) {
03430           incomingNeutrino=i;
03431 
03432 
03433         }
03434         parent[i] = -1; //don't draw arrows to initial state particles
03435         parent1[i] = -1;
03436       }
03437       cnt++;
03438     }
03439     else{
03440       parent[i] = -1;
03441       parent1[i] = -1;
03442     }
03443   }
03444 
03445 
03446   
03447 
03448 
03449 
03450 
03451   //make arrows and markers
03452   TArrow *arrow[1000];
03453   TMarker *marker[1000];
03454   for(int i=0;i<nStdHep;i++) {
03455     arrow[i] = new TArrow(0,0,0,0,.01,"|>"); 
03456     arrow[i]->SetLineWidth(1);
03457     arrow[i]->SetLineStyle(3);
03458     arrow[i]->SetFillColor(39);
03459     arrow[i]->SetLineColor(39);
03460     marker[i] = new TMarker(0,0,24);
03461     marker[i]->SetMarkerSize(.2);
03462     marker[i]->SetMarkerColor(38);
03463   }
03464 
03465   //now loop through valid stdhep entries and fill variables  
03466   Float_t Available[5] = {0.9,0.7,0.7,0.7};  
03467   
03468   //cout<<"nStdHep: "<<nStdHep<<"\n";
03469 
03470   for(int i=0;i<cnt;i++){
03471     
03472     int toUse = indicesToUse[i];
03473     if(hep[toUse]->IstHEP==999){
03474       parent[i]=-1;
03475       continue;
03476     }
03477 
03478 
03479 
03480     //    cout<<toUse<<"  "<<hep[toUse]->IstHEP<<"   "<<nStdHep<<endl;
03481     //cout<<parent[toUse]<<"   "<<parent1[toUse]<<endl;
03482 
03483 
03484 
03485     
03486     
03487     //sc - avoid any double taus' charms' etc, but set the proper parent/child 
03488     //(remove the particle between true parent and child)
03489 
03490     if((hep[toUse]->child[0]==hep[toUse]->child[1]) &&
03491        (hep[toUse]->IstHEP==2 || hep[toUse]->IstHEP==3 || hep[toUse]->IstHEP==14) && 
03492        hep[toUse]->child[0]!=-1){
03493       int j;
03494       int child = hep[toUse]->child[0];
03495       for(j=0;j<cnt;j++){
03496         if ((Int_t)hep[j]->index==child)break;
03497       }
03498 
03499       //we've lost arrow tail info, so fix it
03500       if (j<nStdHep){
03501         arrow[j]->SetX1(arrow[i]->GetX1());
03502         arrow[j]->SetY1(arrow[i]->GetY1());
03503       
03504         parent[i]=-1;
03505       
03506         continue;
03507       }else{
03508         cout<<"Error! - linking failed, index out of range! \n";
03509       }
03510     }
03511 
03512     //sc - avoid any "later decays" not comming from IstHEP=1 decays .. .these are children of double taus, etc
03513 
03514     if((hep[toUse]->IstHEP==205||hep[toUse]->IstHEP==1205)&&
03515        (hep[parent[toUse]]->IstHEP!=1 || hep[parent1[toUse]]->IstHEP!=1)){
03516       parent[i]=-1;
03517       //cout <<"breaking out of loop for particle "<<i<<"\n";
03518       continue;  
03519     }
03520 
03521     
03522     Float_t mom = sqrt(hep[toUse]->p4[0]*hep[toUse]->p4[0] + 
03523                        hep[toUse]->p4[1]*hep[toUse]->p4[1] + 
03524                        hep[toUse]->p4[2]*hep[toUse]->p4[2]);
03525     float x=0.,y=0.;
03526     int col=0;
03527     char text[256];
03528 
03529     //set x,y    
03530     if(hep[toUse]->IstHEP==0) {
03531       x = 0.05;
03532       y=Available[0]; Available[0] -= 0.1;
03533     }
03534     else if(hep[toUse]->IstHEP==2) {
03535       x = 0.15;
03536       y=Available[1]; Available[1] -= 0.1;   
03537     }
03538     else if(hep[toUse]->IstHEP==11) {
03539       x = 0.05;
03540       y=Available[0]; Available[0] -= 0.1; 
03541     }
03542     else if(hep[toUse]->IstHEP==3||hep[toUse]->IstHEP==14) {   //sc - allow for both IstHEP=3 and 14 intermediate decays
03543       x = 0.3;
03544       y=Available[1]; Available[1] -= 0.1;
03545     }
03546     else if(hep[toUse]->IstHEP==1){
03547       x = 0.55;
03548       y=Available[2]; Available[2] -= 0.1;
03549     }
03550     else if((hep[toUse]->IstHEP==205||hep[toUse]->IstHEP==1205)){
03551       x = 0.8;
03552       y=Available[3]; Available[3] -= 0.1;
03553     }
03554  
03555     //set colour and label (and override y in special cases)
03556     if(abs(hep[toUse]->IdHEP)==12) { //nue
03557       if(parent[toUse]==incomingNeutrino)  y = 0.9; 
03558       sprintf(text,"#nu_{e}"); col = 3;
03559       if(hep[toUse]->IdHEP<0) sprintf(text,"#bar{#nu}_{e}");
03560     }
03561     else if(abs(hep[toUse]->IdHEP)==14) { //numu
03562      if(parent[toUse]==incomingNeutrino)  y = 0.9;  
03563      sprintf(text,"#nu_{#mu}"); col = 4;
03564       if(hep[toUse]->IdHEP<0) sprintf(text,"#bar{#nu}_{#mu}");
03565     }
03566     else if(abs(hep[toUse]->IdHEP)==16) { //nutau
03567      if(parent[toUse]==incomingNeutrino)  y = 0.9;  
03568      sprintf(text,"#nu_{#tau}"); col = 105;
03569       if(hep[toUse]->IdHEP<0) sprintf(text,"#bar{#nu}_{#tau}"); 
03570     }    
03571     else if(abs(hep[toUse]->IdHEP)==11) { //e
03572       if(parent[toUse]==incomingNeutrino) y = 0.9;          
03573       sprintf(text,"e^{-}"); col = 3;
03574       if(hep[toUse]->IdHEP<0) sprintf(text,"e^{+}");
03575     }
03576     else if(abs(hep[toUse]->IdHEP)==13) { //mu
03577       if(parent[toUse]==incomingNeutrino) y = 0.9;               
03578       sprintf(text,"#mu^{-}"); col = 4;
03579       if(hep[toUse]->IdHEP<0) sprintf(text,"#mu^{+}");
03580     }
03581     else if(abs(hep[toUse]->IdHEP)==15) { //tau
03582       //tau will decay so it is easier to read if it is not on the top line...
03583       // if(parent[toUse]==incomingNeutrino) y = 0.9;                  
03584       sprintf(text,"#tau^{-}"); col = 105;
03585       if(hep[toUse]->IdHEP<0) sprintf(text,"#tau^{+}"); 
03586     }
03587     else if(hep[toUse]->IdHEP==22) { //photon
03588       sprintf(text,"#gamma"); col = 9;      
03589     }
03590     else if(hep[toUse]->IdHEP>1000000000) { //nucleus
03591       y = 0.8;
03592       sprintf(text,"nucleus(%i,%i)",int((hep[toUse]->IdHEP-1e9)/1e6),
03593               int((hep[toUse]->IdHEP-1e9 - 1e6*int((hep[toUse]->IdHEP-1e9)
03594                                                   /1e6))/1e3)); 
03595       col = 15;
03596     }
03597     else if(hep[toUse]->IdHEP==2112){ 
03598       sprintf(text,"neutron"); col = 28;
03599     }
03600     else if(hep[toUse]->IdHEP==2212){
03601       sprintf(text,"proton"); col = 2;
03602     }
03603     else if(abs(hep[toUse]->IdHEP)==211) {
03604       sprintf(text,"#pi^{+}"); col = 6;
03605       if(hep[toUse]->IdHEP<0) sprintf(text,"#pi^{-}");
03606     }
03607     else if(hep[toUse]->IdHEP==111) {
03608       sprintf(text,"#pi^{0}"); col = 7;
03609     }
03610     else if(hep[toUse]->IdHEP==130) {
03611       sprintf(text,"K^{0}_{L}"); col = 31;
03612     }
03613     else if(hep[toUse]->IdHEP==310) {
03614       sprintf(text,"K^{0}_{S}"); col = 31;
03615     }
03616     else if(hep[toUse]->IdHEP==311) {
03617       sprintf(text,"K^{0}"); col = 31;
03618     }
03619     else if(abs(hep[toUse]->IdHEP)==321) {
03620       sprintf(text,"K^{+}"); col = 31;
03621       if(hep[toUse]->IdHEP<0) sprintf(text,"K^{-}"); col = 31;
03622     }
03623     else if(hep[toUse]->IdHEP==28) {
03624       sprintf(text,"Geantino"); col = 46;
03625       if(hep[toUse]->IdHEP<0) sprintf(text,"K^{-}"); col = 31;
03626     }
03627     else {
03628       sprintf(text,"ID: %i",hep[toUse]->IdHEP); col=43;
03629     }
03630 
03631     sprintf(text,"%s [%.1f GeV/c]",text,mom);
03632     
03633     arrow[toUse]->SetX2(x-0.02);   
03634     arrow[toUse]->SetY2(y-0.02);   
03635     marker[toUse]->SetX(x-0.02);
03636     marker[toUse]->SetY(y-0.02);
03637 
03638     for(int j=0;j<nStdHep;j++){
03639    
03640       if(parent[j]==toUse){
03641         arrow[j]->SetX1(x-0.02);
03642         arrow[j]->SetY1(y-0.02);
03643         //cout<<"writing arrows from "<<j << " to "<<parent[j]<<"\n";
03644       }
03645     }
03646  
03647     TLatex *tex = new TLatex(x,y,text);
03648     char texname[256];
03649     sprintf(texname,"tex%i",i);
03650     tex->SetName(texname);
03651     tex->SetTextSize(0.05);
03652     tex->SetTextColor(col);
03653     tex->Draw();
03654   }
03655 
03656   for(int i=0;i<nStdHep;i++){
03657     if(parent[i]==-1){
03658       delete arrow[i];
03659       delete marker[i];
03660     }
03661     else {
03662       arrow[i]->Draw();
03663       marker[i]->Draw();
03664       
03665     }
03666   }
03667   
03668 
03669 
03670 
03671 
03672   Float_t minAvail = 0;
03673   for(int i=0;i<4;i++){
03674     if(Available[i]<minAvail) minAvail = Available[i];
03675   }
03676   if(minAvail<0) fStdHepCan->Range(0,minAvail,1,1.1);
03677 
03678  
03679 
03680   delete [] indicesToUse;
03681   delete [] parent;
03682 
03683   fStdHepCan->Modified();
03684   fStdHepCan->Update();
03685 
03686 
03687 
03688 }

void NueDisplayModule::DrawLowerMRCanvas (  )  [private]

Definition at line 6079 of file NueDisplayModule.cxx.

References fMRdShowAll, fMRdShowReco, fMRdShowScaled, fMRdShowTrueMu, fMRdShowTrueShw, fMRLowerLeg, mrGraphPad, mrInfoPanel, uzMREventOld, and vzMREventOld.

Referenced by MRShowMRStrips(), and UpdateDisplay().

06080 {
06081   mrGraphPad->cd(3);
06082   if(uzMREventOld && uzMREventOld->GetListOfGraphs()){
06083      uzMREventOld->Draw("AP");  
06084      uzMREventOld->GetXaxis()->SetTitle("z position (m)");
06085      uzMREventOld->GetYaxis()->SetTitle("u Position (m)");
06086   }
06087   gPad->Modified(); mrGraphPad->cd(4);
06088   if(vzMREventOld && vzMREventOld->GetListOfGraphs()){
06089       vzMREventOld->Draw("AP");
06090       vzMREventOld->GetXaxis()->SetTitle("z position (m)");
06091       vzMREventOld->GetYaxis()->SetTitle("v Position (m)");
06092 //      fMRLowerLeg->Draw();
06093     }
06094     gPad->Modified(); 
06095 
06096     mrGraphPad->Modified();
06097     mrGraphPad->Update();
06098 
06099 
06100     mrInfoPanel->cd();
06101     fMRdShowAll->Draw();
06102     fMRdShowTrueMu->Draw();
06103     fMRdShowTrueShw->Draw();
06104     fMRdShowScaled->Draw();
06105     fMRdShowReco->Draw();
06106     
06107     fMRLowerLeg->Draw();
06108 }

void NueDisplayModule::DrawUpperMRCanvas (  )  [private]

Definition at line 6111 of file NueDisplayModule.cxx.

References fMRUpperLeg, fMRuShowAll, fMRuShowMR, fMRuShowOld, mrGraphPad, mrInfoPanel, uzMREventOverlay, and vzMREventOverlay.

Referenced by MRShowEvent(), and UpdateDisplay().

06112 {
06113 
06114    mrInfoPanel->cd();
06115    fMRuShowAll->Draw();
06116    fMRuShowMR->Draw();
06117    fMRuShowOld->Draw();
06118    fMRUpperLeg->Draw();
06119   
06120    mrGraphPad->cd();                                                                                                                  
06121   mrGraphPad->cd(1);
06122   if(uzMREventOverlay){
06123     uzMREventOverlay->Draw("AP");
06124     uzMREventOverlay->GetXaxis()->SetTitle("z position (m)");
06125     uzMREventOverlay->GetYaxis()->SetTitle("u Position (m)");
06126   }
06127 
06128   gPad->Modified();
06129   mrGraphPad->cd(2);
06130   if(vzMREventOverlay){
06131     vzMREventOverlay->Draw("AP");
06132     vzMREventOverlay->GetXaxis()->SetTitle("z position (m)");
06133     vzMREventOverlay->GetYaxis()->SetTitle("v Position (m)");
06134   }
06135 //  fMRUpperLeg->Draw();
06136 
06137   gPad->Modified();  
06138 
06139 }

void NueDisplayModule::FillClusterGraphs (  )  [private]

Definition at line 3224 of file NueDisplayModule.cxx.

References ClusterType::AsString(), cluLegU, cluLegV, count, SntpHelpers::GetCluster(), SntpHelpers::GetClusterIndex(), SntpHelpers::GetShower(), SntpHelpers::GetShowerIndex(), VHS::GetStrip(), SntpHelpers::GetStripIndex(), NtpSRCluster::id, NtpSRShower::ncluster, NtpSRCluster::nstrip, NtpSRStrip::planeview, NtpSRCluster::planeview, NtpSRCluster::probem, ssGraphU, ssGraphV, st, NtpSRStrip::tpos, and NtpSRStrip::z.

Referenced by GetEvent().

03225   {
03226     /*
03227       RecRecordImp<RecCandHeader> *rr = 
03228       dynamic_cast<RecRecordImp<RecCandHeader>*>
03229       ((gMint->GetJobC().Mom).GetFragment("RecRecordImp<RecCandHeader>"));
03230     */
03231 
03232   ssGraphU = new TMultiGraph();
03233   ssGraphU->SetName("usubshowers");
03234   ssGraphU->SetTitle("Transverse Position vs Z - U View");
03235   cluLegU = new TLegend(0.05,0.05,0.95,0.95,"  Key: ID (P_{EM})");
03236   cluLegU->SetBorderSize(0);
03237   cluLegU->SetTextSize(0.08);
03238   
03239   ssGraphV = new TMultiGraph();
03240   ssGraphV->SetName("vsubshowers");
03241   ssGraphV->SetTitle("Transverse Position vs Z - V View");
03242   cluLegV = new TLegend(0.05,0.05,0.95,0.95,"  Key: ID (P_{EM})");
03243   cluLegV->SetBorderSize(0);
03244   cluLegV->SetTextSize(0.08);
03245 
03246   int nUclus = 0;
03247   int col0 = 1;
03248   int nVclus = 0;
03249   int col1 = 1;
03250   
03251   for(int i=0;i<event->nshower;i++){  //loop over showers
03252     int shower_index = SntpHelpers::GetShowerIndex(i,event);
03253     NtpSRShower *shower = SntpHelpers::GetShower(shower_index,st);  
03254     if(shower==0) continue;
03255 
03256     int numclustp=0;
03257     int numclustp0=0;
03258     int numclustp1=0;
03259     
03260     for(int j=0;j<shower->ncluster;j++){ //loop over clusters
03261       int cluster_index = SntpHelpers::GetClusterIndex(j,shower);
03262       NtpSRCluster *cluster = SntpHelpers::GetCluster(cluster_index,st);
03263       numclustp+=cluster->nstrip;
03264       if(cluster->planeview==2) nUclus+=1;
03265       else if(cluster->planeview==3) nVclus+=1;
03266     }
03267 
03268     float *clu_tpos = new float[numclustp];
03269     float *clu_tpos0 = new float[numclustp];
03270     float *clu_z0 = new float[numclustp];
03271     float *clu_tpos1 = new float[numclustp];
03272     float *clu_z1 = new float[numclustp];
03273     double *clu_z = new double[numclustp];
03274     int count = 0;
03275 
03276     for(int j=0;j<shower->ncluster;j++){ //loop over clusters
03277       int cluster_index = SntpHelpers::GetClusterIndex(j,shower);
03278       NtpSRCluster *cluster = SntpHelpers::GetCluster(cluster_index,st);
03279       
03280       count=0;
03281       numclustp0=0;
03282       numclustp1=0;
03283       
03284       for(int k=0;k<cluster->nstrip;k++){
03285         int strip_index = SntpHelpers::GetStripIndex(k,cluster);
03286         NtpSRStrip *strip = SntpHelpers::GetStrip(strip_index,st);
03287         clu_tpos[count] = strip->tpos;
03288         clu_z[count]    = strip->z;
03289         if(strip->planeview==2){
03290           clu_tpos0[numclustp0] = clu_tpos[count];
03291           clu_z0[numclustp0] = clu_z[count];
03292           numclustp0+=1;
03293         }
03294         else {
03295           clu_tpos1[numclustp1] = clu_tpos[count];
03296           clu_z1[numclustp1] = clu_z[count];
03297           numclustp1+=1;
03298         }
03299         count++;
03300       }
03301     
03302       if(numclustp0>0){
03303         TGraph *temp = new TGraph(numclustp0,clu_z0,clu_tpos0);
03304         if(col0==10) col0+=1;
03305         temp->SetMarkerColor(col0);
03306         temp->SetMarkerSize(0.6);
03307         temp->SetMarkerStyle(21);
03308         if(cluster->id==2 ||
03309            cluster->id==4) temp->SetMarkerStyle(25);
03310         ssGraphU->Add(temp);
03311         col0+=1;
03312         char ssnom[256];
03313         if(cluster->id==0) {
03314           sprintf(ssnom,"EM (%.2f)",cluster->probem);
03315         }
03316         else if(cluster->id==1){
03317           sprintf(ssnom,"HAD (%.2f)",cluster->probem);
03318         }
03319         else {
03320           sprintf(ssnom,"%s",
03321                   ClusterType::AsString(ClusterType::
03322                                         EClusterType(cluster->id)));
03323         }
03324         cluLegU->AddEntry(temp,ssnom,"p");
03325       }
03326       if(numclustp1>0){
03327         if(col1==10) col1+=1;
03328         TGraph *temp = new TGraph(numclustp1,clu_z1,clu_tpos1);
03329         temp->SetMarkerColor(col1);
03330         temp->SetMarkerSize(0.6);
03331         temp->SetMarkerStyle(21);
03332         if(cluster->id==2 ||
03333            cluster->id==4) temp->SetMarkerStyle(25);
03334         ssGraphV->Add(temp);
03335         col1+=1;
03336         char ssnom[256];
03337         if(cluster->id==0){
03338           sprintf(ssnom,"EM (%.2f)",cluster->probem);
03339         }
03340         else if(cluster->id==1){
03341           sprintf(ssnom,"HAD (%.2f)",cluster->probem);
03342         }
03343         else {
03344           sprintf(ssnom,"%s",
03345                   ClusterType::AsString(ClusterType::
03346                                       EClusterType(cluster->id)));
03347         }
03348         cluLegV->AddEntry(temp,ssnom,"p");
03349       }
03350     }
03351                                                                                 
03352     delete [] clu_tpos;
03353     delete [] clu_z;
03354     delete [] clu_tpos0;
03355     delete [] clu_z0;
03356     delete [] clu_tpos1;
03357     delete [] clu_z1;
03358   }
03359   if(nUclus==0) {
03360     delete ssGraphU;
03361     ssGraphU=NULL;
03362     delete cluLegU;
03363     cluLegU = NULL;
03364   }
03365   if(nVclus==0) {
03366     delete ssGraphV;
03367     ssGraphV=NULL;
03368     delete cluLegV;
03369     cluLegV = NULL;
03370   }
03371 
03372 }

void NueDisplayModule::FillEventGraph ( NtpSREvent Event,
NtpStRecord str,
TMultiGraph *  uzGraph,
TMultiGraph *  vzGraph,
TString  name = "NULL" 
) [private]

Definition at line 5744 of file NueDisplayModule.cxx.

References VHS::GetStrip(), SntpHelpers::GetStripIndex(), Msg::kDebug, PlaneView::kU, PlaneView::kV, MSG, NtpSREvent::nstrip, NtpSRStrip::planeview, NtpSRStrip::tpos, and NtpSRStrip::z.

Referenced by GenerateMRMultiGraphs().

05746 {
05747   Int_t TotalStrip = Event->nstrip;
05748   Int_t NumUStrip = 0;
05749   Int_t NumVStrip = 0;
05750                                                                                
05751   Float_t* stripUPos = new Float_t[TotalStrip];
05752   Float_t* stripVPos = new Float_t[TotalStrip];
05753   Float_t* stripUPosZ = new Float_t[TotalStrip];
05754   Float_t* stripVPosZ = new Float_t[TotalStrip];
05755 
05756 //  cout<<"nstrip - "<<Event->nstrip<<endl;                                                                                
05757   for(int stpn=0;stpn < Event->nstrip;stpn++){
05758       Int_t index = SntpHelpers::GetStripIndex(stpn,Event);
05759       NtpSRStrip *strip = SntpHelpers::GetStrip(index,str);
05760 //      cout<<"For "<<name<<" "<<index<<"  "<<strip->tpos<<"   "<<strip->z<<endl;
05761      
05762       if(strip->planeview==PlaneView::kU){
05763         MSG("NueDisplayModule",Msg::kDebug)<<"filling u"<<endl;
05764         stripUPos[NumUStrip] = strip->tpos;
05765         stripUPosZ[NumUStrip] = strip->z;
05766         NumUStrip++;
05767       }
05768       if(strip->planeview==PlaneView::kV){
05769         MSG("NueDisplayModule",Msg::kDebug)<<"filling v"<<endl;
05770         stripVPos[NumVStrip] = strip->tpos;
05771         stripVPosZ[NumVStrip] = strip->z;
05772         NumVStrip++;
05773       }
05774   }
05775 
05776   TGraph *temp;
05777 
05778   if(NumUStrip > 0){
05779      temp = new TGraph(NumUStrip,stripUPosZ,stripUPos);
05780      if(name != "NULL")
05781         temp->SetName("u"+name);
05782      uzGraph->Add(temp);
05783   }
05784   if(NumVStrip > 0){
05785      temp = new TGraph(NumVStrip,stripVPosZ,stripVPos);
05786      if(name != "NULL")
05787         temp->SetName("v"+name);
05788      vzGraph->Add(temp);
05789   }
05790                                                                                 
05791   delete [] stripUPos;
05792   delete [] stripVPos;
05793   delete [] stripUPosZ;
05794   delete [] stripVPosZ;
05795 }

void NueDisplayModule::FillMREventGraph ( NtpMREvent mrevt,
NtpStRecord str,
TMultiGraph *  uzGraph,
TMultiGraph *  vzGraph,
int  type 
) [private]

Definition at line 5822 of file NueDisplayModule.cxx.

References foundMR, VHS::GetStrip(), Msg::kDebug, Msg::kError, PlaneView::kU, PlaneView::kV, MSG, NtpMREvent::nstrip, NtpSRStrip::planeview, NtpMREvent::stp, NtpMREvent::StpIsInRecoTrk(), NtpMREvent::StpIsMCElec(), NtpMREvent::StpIsRetained(), NtpMREvent::StpIsScaled(), NtpMREvent::StpIsTrueMu(), NtpMREvent::StpIsTrueShw(), NtpSRStrip::tpos, and NtpSRStrip::z.

Referenced by GenerateMRMultiGraphs().

05824 {
05825   if(!foundMR)
05826   {
05827       MSG("NueDisplayModule",Msg::kError) << "Call to FillMREvent with no MR records"<<endl;
05828       return;
05829   }
05830 
05831   Int_t TotalStrip = mrevt->nstrip;
05832   Int_t NumUStrip = 0;
05833   Int_t NumVStrip = 0;
05834                                                                                 
05835   Float_t* stripUPos = new Float_t[TotalStrip];
05836   Float_t* stripVPos = new Float_t[TotalStrip];
05837   Float_t* stripUPosZ = new Float_t[TotalStrip];
05838   Float_t* stripVPosZ = new Float_t[TotalStrip];
05839 
05840   Bool_t StripType[7];
05841   StripType[0] = true;  // Just that its a strip
05842 
05843   //cout<<mrevt->nstrip<<endl;                                                                                
05844   for(int stpn=0;stpn < mrevt->nstrip;stpn++){
05845       Int_t index = mrevt->stp[stpn];
05846       StripType[1] = mrevt->StpIsTrueMu(stpn);
05847       StripType[2] = mrevt->StpIsTrueShw(stpn);
05848       StripType[3] = mrevt->StpIsScaled(stpn);
05849       StripType[4] = mrevt->StpIsInRecoTrk(stpn);
05850       StripType[5] = mrevt->StpIsRetained(stpn);
05851       StripType[6] = mrevt->StpIsMCElec(stpn);
05852       
05853 //      cout<<type<<"  "<<StripType[type]<<endl;
05854       if(!StripType[type]) continue;
05855 
05856       NtpSRStrip *strip = SntpHelpers::GetStrip(index,str);
05857 //      cout<<"strip->tpos"<<strip->tpos<<"   "<<strip->z<<endl;
05858       if(strip->planeview==PlaneView::kU){
05859         MSG("NueDisplayModule",Msg::kDebug)<<"filling u"<<endl;
05860         stripUPos[NumUStrip] = strip->tpos;
05861         stripUPosZ[NumUStrip] = strip->z;
05862         NumUStrip++;
05863       }
05864       if(strip->planeview==PlaneView::kV){
05865         MSG("NueDisplayModule",Msg::kDebug)<<"filling v"<<endl;
05866         stripVPos[NumVStrip] = strip->tpos;
05867         stripVPosZ[NumVStrip] = strip->z;
05868         NumVStrip++;
05869       }
05870   }
05871      
05872                                                                            
05873   TGraph *temp;
05874                                                                                 
05875   if(NumUStrip > 0){
05876      temp = new TGraph(NumUStrip,stripUPosZ,stripUPos);
05877      if(type == 0) temp->SetName("uAll");
05878      if(type == 1) temp->SetName("uTruMu");
05879      if(type == 2) temp->SetName("uTruShw");
05880      if(type == 3) temp->SetName("uScaled");
05881      if(type == 4) temp->SetName("uReco");
05882      if(type == 5) temp->SetName("uRet");
05883      if(type == 6) temp->SetName("uEM");
05884      uzGraph->Add(temp);
05885   }
05886   if(NumVStrip > 0){
05887      temp = new TGraph(NumVStrip,stripVPosZ,stripVPos);
05888      if(type == 0) temp->SetName("vAll");
05889      if(type == 1) temp->SetName("vTruMu");
05890      if(type == 2) temp->SetName("vTruShw");
05891      if(type == 3) temp->SetName("vScaled");
05892      if(type == 4) temp->SetName("vReco");
05893      if(type == 5) temp->SetName("vRet");
05894      if(type == 6) temp->SetName("vEM");
05895      vzGraph->Add(temp);
05896   }
05897   
05898   delete [] stripUPos;
05899   delete [] stripVPos;
05900   delete [] stripUPosZ;
05901   delete [] stripVPosZ;
05902 }

void NueDisplayModule::fixmcinfo (  )  [private]

Definition at line 4475 of file NueDisplayModule.cxx.

References delmc(), fFixMCInfo, fMCTruth, fSimFlag, ifixmcinfo, imctruth, SimFlag::kMC, and plotmc().

Referenced by BuildDisplay().

04476 {
04477   if (fSimFlag!=SimFlag::kMC) return;
04478   if (!ifixmcinfo){
04479     fFixMCInfo->SetDown(true);
04480     ifixmcinfo = 1;
04481     if (!imctruth){
04482       plotmc();
04483     }
04484     else {
04485       fMCTruth->SetDown(false);
04486       imctruth = 0;
04487     }
04488   }
04489   else {
04490     fFixMCInfo->SetDown(false);
04491     ifixmcinfo = 0;
04492     this->delmc();
04493   }
04494 }

void NueDisplayModule::GenerateMRMultiGraphs ( int  evtNum,
vector< int > &  MREvent,
vector< int > &  OldEvent 
) [private]

Definition at line 5657 of file NueDisplayModule.cxx.

References FillEventGraph(), FillMREventGraph(), GetEvent(), SntpHelpers::GetMREvent(), mr, ResetMRGraphs(), st, stOld, UpdateMREventOverlayColors(), UpdateMREventStripColors(), uzMREventOld, uzMREventOverlay, vzMREventOld, and vzMREventOverlay.

Referenced by UpdateMRGraphs().

05659 {
05660    //If there is no MRevent then there should be an info which pops
05661    // up to say so.
05662 
05663    ResetMRGraphs();
05664 
05665 //   SetFrame(vzMREventOld);
05666 //   SetFrame(uzMREventOld);
05667 //   SetFrame(vzMREventOverlay);
05668 //   SetFrame(uzMREventOverlay);
05669  
05670    //Draw the New Event
05671 
05672    NtpSREvent* Event = 0;
05673     
05674 //   FillEventGraph(Event, st, uzMREventOverlay, vzMREventOverlay, "New");
05675 
05676    for(unsigned int oEvent = 0; oEvent < OldEvent.size(); oEvent++)
05677    {
05678      Event = SntpHelpers::GetEvent(OldEvent[oEvent],stOld);      
05679      FillEventGraph(Event, stOld, uzMREventOverlay, vzMREventOverlay, "Old");
05680    }
05681 
05682    for(unsigned int mrEvt = 0; mrEvt < MREvent.size(); mrEvt++)
05683    {
05684        NtpMREvent* mrevt = SntpHelpers::GetMREvent(MREvent[mrEvt], mr);
05685 //       cout<<"Contributing from Event: "<<MREvent[mrEvt]<<endl;
05686 
05687        FillMREventGraph(mrevt, st, uzMREventOverlay, vzMREventOverlay, 0);
05688        for(int striptype = 0; striptype < 7; striptype++)
05689         FillMREventGraph(mrevt, st, uzMREventOld, vzMREventOld, striptype);
05690    }
05691 
05692    Event = SntpHelpers::GetEvent(evtNum,st);
05693                                                                                 
05694    FillEventGraph(Event, st, uzMREventOverlay, vzMREventOverlay, "New");
05695 
05696 
05697    UpdateMREventOverlayColors(uzMREventOverlay);
05698    UpdateMREventOverlayColors(vzMREventOverlay);
05699 
05700    UpdateMREventStripColors(uzMREventOld);
05701    UpdateMREventStripColors(vzMREventOld);
05702                                                                                                                    
05703 
05704 /*
05705        //Now overlay it with the original event strips
05706        NtpMREvent* mrevt = SntpHelpers::GetMREvent(evtNum, mr);
05707        cout<<"This was original event "<<mrevt->orig_event<<endl;
05708        Int_t oEvent = mrevt->best_event;
05709   
05710      //          temp->SetMarkerSize(0.6);
05711      //          temp->SetMarkerStyle(8);
05712 */
05713 
05714 }

void NueDisplayModule::GenerateOverlayMultiGraphs (  )  [private]

Definition at line 5362 of file NueDisplayModule.cxx.

References NtpStRecord::evthdr, GetEvent(), SntpHelpers::GetSlice(), VHS::GetStrip(), SntpHelpers::GetStripIndex(), Msg::kDebug, PlaneView::kU, PlaneView::kV, MSG, NtpSREventSummary::nevent, NtpSREventSummary::nslice, NtpSREvent::nstrip, NtpSRSlice::nstrip, NtpSRStrip::planeview, st, NtpSRStrip::tpos, uzEventOverlay, uzSliceOverlay, vzEventOverlay, vzSliceOverlay, and NtpSRStrip::z.

Referenced by UpdateOverlayGraphs().

05363 {
05364       TGraph* temp;
05365 
05366       if(uzEventOverlay) delete uzEventOverlay;
05367       if(vzEventOverlay) delete vzEventOverlay;
05368       if(uzSliceOverlay) delete uzSliceOverlay;
05369       if(vzSliceOverlay) delete vzSliceOverlay;
05370 
05371       uzEventOverlay = new TMultiGraph();
05372       uzEventOverlay->SetName("uzEventOverlay");
05373       uzEventOverlay->SetTitle("U vs Z Event View");
05374 
05375       vzEventOverlay = new TMultiGraph();
05376       vzEventOverlay->SetName("vzEventOverlay");
05377       vzEventOverlay->SetTitle("V vs Z Event view");
05378 
05379       uzSliceOverlay = new TMultiGraph();
05380       uzSliceOverlay->SetName("uzSliceOverlay");
05381       uzSliceOverlay->SetTitle("U vs Z Slice view");
05382 
05383       vzSliceOverlay = new TMultiGraph();
05384       vzSliceOverlay->SetName("vzSliceOverlay");
05385       vzSliceOverlay->SetTitle("V vs Z Slice view");
05386 
05387       //Drawing of Events
05388       for(int evtNum = 0; evtNum < st->evthdr.nevent; evtNum++)
05389       {
05390         NtpSREvent* Event = SntpHelpers::GetEvent(evtNum,st);
05391 
05392         Int_t TotalStrip = Event->nstrip;
05393         Int_t NumUStrip = 0;
05394         Int_t NumVStrip = 0;
05395 
05396         Float_t* stripUPos = new Float_t[TotalStrip];
05397         Float_t* stripVPos = new Float_t[TotalStrip];
05398         Float_t* stripUPosZ = new Float_t[TotalStrip];
05399         Float_t* stripVPosZ = new Float_t[TotalStrip];
05400 
05401         for(int stpn=0;stpn < Event->nstrip;stpn++){
05402           Int_t index = SntpHelpers::GetStripIndex(stpn,Event);
05403           NtpSRStrip *strip = SntpHelpers::GetStrip(index,st);
05404           if(strip->planeview==PlaneView::kU){
05405             MSG("NueDisplayModule",Msg::kDebug)<<"filling u"<<endl;
05406             stripUPos[NumUStrip] = strip->tpos;
05407             stripUPosZ[NumUStrip] = strip->z;
05408             NumUStrip++;
05409           }
05410           if(strip->planeview==PlaneView::kV){
05411             MSG("NueDisplayModule",Msg::kDebug)<<"filling v"<<endl;
05412             stripVPos[NumVStrip] = strip->tpos;
05413             stripVPosZ[NumVStrip] = strip->z;
05414             NumVStrip++;
05415           }
05416         }
05417 
05418         if(NumUStrip > 0){
05419           temp = new TGraph(NumUStrip,stripUPosZ,stripUPos);
05420           uzEventOverlay->Add(temp);
05421         }
05422         if(NumVStrip > 0){
05423           temp = new TGraph(NumVStrip,stripVPosZ,stripVPos);
05424           vzEventOverlay->Add(temp);
05425         }
05426 
05427         delete [] stripUPos;
05428         delete [] stripVPos;
05429         delete [] stripUPosZ;
05430         delete [] stripVPosZ;
05431      }
05432  
05433      for(int slcNum = 0; slcNum < st->evthdr.nslice; slcNum++)
05434      {
05435         NtpSRSlice* slice = SntpHelpers::GetSlice(slcNum,st);
05436 
05437         Int_t TotalStrip = slice->nstrip;
05438         Int_t NumUStrip = 0;
05439         Int_t NumVStrip = 0;
05440 
05441         Float_t* stripUPos = new Float_t[TotalStrip];
05442         Float_t* stripVPos = new Float_t[TotalStrip];
05443         Float_t* stripUPosZ = new Float_t[TotalStrip];
05444         Float_t* stripVPosZ = new Float_t[TotalStrip];
05445 
05446         for(int stpn=0;stpn < slice->nstrip;stpn++){
05447           Int_t index = SntpHelpers::GetStripIndex(stpn,slice);
05448           NtpSRStrip *strip = SntpHelpers::GetStrip(index,st);
05449           if(strip->planeview==PlaneView::kU){
05450             MSG("NueDisplayModule",Msg::kDebug)<<"filling u"<<endl;
05451             stripUPos[NumUStrip] = strip->tpos;
05452             stripUPosZ[NumUStrip] = strip->z;
05453             NumUStrip++;
05454           }
05455           if(strip->planeview==PlaneView::kV){
05456             MSG("NueDisplayModule",Msg::kDebug)<<"filling v"<<endl;
05457             stripVPos[NumVStrip] = strip->tpos;
05458             stripVPosZ[NumVStrip] = strip->z;
05459             NumVStrip++;
05460           }
05461         }
05462 
05463         if(NumUStrip > 0){
05464           temp = new TGraph(NumUStrip,stripUPosZ,stripUPos);
05465           uzSliceOverlay->Add(temp);
05466         }
05467         if(NumVStrip > 0){
05468           temp = new TGraph(NumVStrip,stripVPosZ,stripVPos);
05469           vzSliceOverlay->Add(temp);
05470         }
05471 
05472         delete [] stripUPos;
05473         delete [] stripVPos;
05474         delete [] stripUPosZ;
05475         delete [] stripVPosZ;
05476      }
05477 
05478   return ;
05479 }

void NueDisplayModule::GetBasicInfo (  )  [private]

Definition at line 3776 of file NueDisplayModule.cxx.

References NtpSRCosmicRay::azimuth, NtpTHEvent::completeall, NtpTHEvent::completeslc, NtpSRTrack::cr, NtpSRTrack::ds, NtpMCTruth::emfrac, StdHepInfo::epi0_abs, StdHepInfo::epi0_intranuke, StdHepInfo::epi0_neugen, StdHepInfo::epi0_total, NtpSRMomentum::eqp, NtpStRecord::evthdr, fEvent, fNumEvents, foundMC, foundSR, foundST, foundTH, fRecoInfo, fSimFlag, fSnarl, SntpHelpers::GetEvent2MCIndex(), Mint::GetJobC(), SntpHelpers::GetMCTruth(), DataUtil::GetRunSnarlEvent(), SntpHelpers::GetShower(), SntpHelpers::GetShowerIndex(), SntpHelpers::GetTrack(), SntpHelpers::GetTrackIndex(), NtpSRStripPulseHeight::gev, gMint, NtpMCTruth::iaction, info1, info10, info11, info12, info13, info2, info3, info4, info41, info5, info6, info7, info8, info9, NtpMCTruth::inu, NtpMCTruth::inunoosc, NtpMCTruth::iresonance, kHideRunSnarl, SimFlag::kMC, kTestMode, NtpSRShowerPulseHeight::linCCgev, mc, mctruth, JobC::Mom, NtpSRTrack::momentum, mrInfo1, NtpSRPlane::n, NtpSREventSummary::nslice, NtpSRTrackPlane::ntrklike, NtpMCTruth::p4el1, NtpMCTruth::p4mu1, NtpMCTruth::p4neu, NtpMCTruth::p4shw, passeng, passfid, passshw, passtrk, passtrklike, NtpSRShower::ph, NtpSRShower::plane, NtpSRTrack::plane, NtpTHEvent::purity, NtpSRMomentum::qp, NtpSRMomentum::range, run(), NtpSRShower::shwph, sr, st, stdhepinfo, SubRunNo, th, thevent, NtpStRecord::thevt, NtpTHRecord::thevt, NtpMCTruth::y, and NtpSRCosmicRay::zenith.

Referenced by UpdateDisplay().

03776                                    {
03777   info1->Clear();
03778   info2->Clear();
03779   info3->Clear();
03780   info4->Clear();
03781   info41->Clear();
03782   info5->Clear();
03783   info6->Clear();
03784   info7->Clear();
03785   info8->Clear();
03786   info9->Clear();
03787   info10->Clear();
03788   info11->Clear();
03789   info12->Clear();
03790   info13->Clear();
03791   mrInfo1->Clear();
03792   char text1[100];
03793   char text2[100];
03794   char text3[100];
03795   char text31[100];
03796   char text4[100];
03797   char text5[100];
03798   char text6[100];
03799   char text7[100];
03800   char text8[100];
03801   char text9[100];
03802   char text10[100];
03803   char text11[100];
03804   char text12[100];
03805   int run=0, snarl=0, evt=0;
03806   DataUtil::GetRunSnarlEvent(&(gMint->GetJobC().Mom),run,snarl,evt);
03807   evt = fEvent;
03808   fSnarl = snarl;
03809  
03810   if(!kTestMode&&!kHideRunSnarl) sprintf(text1,"Run: %d/%d, Snarl: %d, Event: %d(%d), Slice: %d (%d)",
03811                  run,SubRunNo,snarl,evt,fNumEvents,event->slc,st->evthdr.nslice);
03812   else sprintf(text1,"Run: xxxx, Snarl: xxxx, Event: %d(%d)",evt,fNumEvents);
03813   
03814   int ntrks = event->ntrack;
03815   int nshws = event->nshower;
03816 
03817 //  Float_t trk_mom = 0;
03818 //  Float_t shw_eng = 0;
03819 //  Int_t trk_leg = 0;
03820 //  Int_t trk_like = 0;
03821 //  Int_t shw_leg = 0;
03822   Float_t zenith = -1;
03823   Float_t azimuth = -1;
03824 
03825   Float_t trk_mom_range = 0;
03826   Float_t trk_mom_fit = 0;
03827   Float_t trk_length = 0;
03828   Float_t trk_qp = 0;
03829   Float_t trk_eqp = 0;
03830   Int_t trk_planes = 0;
03831   Int_t trk_like = 0;
03832   Float_t shw_ph = 0;
03833   Float_t shw_shwph = 0;
03834   Int_t shw_planes = 0;
03835 
03836   if (foundST){
03837     if (ntrks){
03838       for (int i = 0; i<ntrks; i++){
03839         int index = SntpHelpers::GetTrackIndex(i,event);
03840         NtpSRTrack *track = SntpHelpers::GetTrack(index,st);
03841         if (track->plane.n>trk_planes) {
03842           zenith = track->cr.zenith;
03843           azimuth = track->cr.azimuth;
03844           trk_mom_range = track->momentum.range;
03845           if (track->momentum.qp) trk_mom_fit = 1./track->momentum.qp;
03846           trk_length = track->ds;
03847           trk_qp = track->momentum.qp;
03848           trk_eqp = track->momentum.eqp;
03849           trk_planes = track->plane.n;
03850           trk_like= track->plane.ntrklike;
03851         }
03852       }
03853     }
03854   
03855     if (nshws){
03856       for (int i = 0; i<nshws; i++){
03857         int index = SntpHelpers::GetShowerIndex(i,event);
03858         NtpSRShower *shower = SntpHelpers::GetShower(index,st);
03859         if (shower->shwph.linCCgev>shw_shwph) {
03860           shw_shwph = shower->shwph.linCCgev;
03861           shw_ph = shower->ph.gev;
03862           shw_planes = shower->plane.n;
03863         }
03864       }
03865     }
03866   }
03867   else if(foundSR){
03868     if (ntrks){
03869       for (int i = 0; i<ntrks; i++){
03870         int index = SntpHelpers::GetTrackIndex(i,event);
03871         NtpSRTrack *track = SntpHelpers::GetTrack(index,sr);
03872         if (track->plane.n>trk_planes) {
03873           zenith = track->cr.zenith;
03874           azimuth = track->cr.azimuth;
03875           trk_mom_range = track->momentum.range;
03876           if (track->momentum.qp) trk_mom_fit = 1./track->momentum.qp;
03877           trk_length = track->ds;
03878           trk_qp = track->momentum.qp;
03879           trk_eqp = track->momentum.eqp;
03880           trk_planes = track->plane.n;
03881           trk_like= track->plane.ntrklike;
03882         }
03883       }
03884     }
03885     
03886     if (nshws){
03887       for (int i = 0; i<nshws; i++){
03888         int index = SntpHelpers::GetShowerIndex(i,event);
03889         NtpSRShower *shower = SntpHelpers::GetShower(index,sr);
03890         if (shower->shwph.linCCgev>shw_shwph) {
03891           shw_shwph = shower->shwph.linCCgev;
03892           shw_ph = shower->ph.gev;
03893           shw_planes = shower->plane.n;
03894         }
03895       }
03896     }
03897   }
03898     
03899   sprintf(text2,"ntrks: %d nshws: %d zenith: %.1f azimuth: %.1f",ntrks,nshws,zenith,azimuth);
03900   sprintf(text3,"trk.range:%.2fGeV, fit:%.2fGeV, qp:%.3f",trk_mom_range,trk_mom_fit,trk_qp);
03901   sprintf(text31,"trk.pls:%d, length:%.1fm, like:%d, eqp:%.2f",trk_planes,trk_length,trk_like,trk_eqp);
03902   sprintf(text4,"shw.gev:%.2fGeV, linCC:%.2fGeV, pls:%d",shw_ph,shw_shwph,shw_planes);
03903   
03904   sprintf(text5,"MC");
03905   
03906   mctruth = 0;
03907   if (fSimFlag == SimFlag::kMC){
03908     if (foundST){
03909       Int_t index = SntpHelpers::GetEvent2MCIndex(fEvent,st);
03910       mctruth = SntpHelpers::GetMCTruth(index,st);
03911       thevent = dynamic_cast<NtpTHEvent*>((*st->thevt)[fEvent]);
03912     }
03913     else if (foundMC&&foundTH){
03914       Int_t index = SntpHelpers::GetEvent2MCIndex(fEvent,th);
03915       mctruth = SntpHelpers::GetMCTruth(index,mc);
03916       thevent = dynamic_cast<NtpTHEvent*>((*th->thevt)[fEvent]);
03917     }
03918   }
03919     
03920   //MC
03921   if (mctruth){
03922     char tmptxt[100];
03923     sprintf(tmptxt,"(p%.2f/c%.2f/c%.2f)",thevent->purity,thevent->completeall,thevent->completeslc);
03924     if (mctruth->iaction==0){
03925       sprintf(text6,"NC event %s",tmptxt);
03926     }
03927     else{
03928       if (abs(mctruth->inunoosc)==12&&abs(mctruth->inu)==12){
03929         sprintf(text6,"beam #nu_{e} CC %s",tmptxt);
03930       }
03931       if (abs(mctruth->inunoosc)==14&&abs(mctruth->inu)==14){
03932         sprintf(text6,"#nu_{#mu}#rightarrow#nu_{#mu} CC %s",tmptxt);
03933       }
03934       if (abs(mctruth->inunoosc)==14&&abs(mctruth->inu)==12){
03935         sprintf(text6,"#nu_{#mu}#rightarrow#nu_{e} CC %s",tmptxt);
03936       }
03937       if (abs(mctruth->inunoosc)==14&&abs(mctruth->inu)==16){
03938         sprintf(text6,"#nu_{#mu}#rightarrow#nu_{#tau} CC %s",tmptxt);
03939       }
03940     }
03941     if (mctruth->iresonance==1001 && mctruth->iaction==1){
03942       sprintf(text7,"quasi-elastic");
03943     } 
03944     if (mctruth->iresonance==1001 && mctruth->iaction==0){
03945       sprintf(text7,"elastic");
03946     } 
03947     if (mctruth->iresonance==1002){
03948       sprintf(text7,"resonance production");
03949     }
03950     if (mctruth->iresonance==1003){
03951       sprintf(text7,"DIS");
03952     }
03953     if (mctruth->iresonance==1004){
03954       sprintf(text7,"coherent production");
03955     }
03956     sprintf(text8,"E_{#nu}: %.1fGeV, E_{shw}: %.1fGeV",fabs(mctruth->p4neu[3]),fabs(mctruth->p4shw[3]));
03957     sprintf(text9,"Y: %.2f, emfrac: %.2f",mctruth->y,mctruth->emfrac);
03958     sprintf(text10,"E_{#mu}: %.1fGeV,  E_{el}: %.1fGeV",fabs(mctruth->p4mu1[3]),fabs(mctruth->p4el1[3]));
03959     if (foundST) {
03960       sprintf(text11,"E_{#pi^{0}}_tot: %.2fGeV, E_{#pi^{0}}_neugen: %.2fGeV",stdhepinfo.epi0_total,stdhepinfo.epi0_neugen);
03961       sprintf(text12,"E_{#pi^{0}}_abs: %.2fGeV, E_{#pi^{0}}_intranuke: %.2fGeV",stdhepinfo.epi0_abs,stdhepinfo.epi0_intranuke);
03962     }
03963   }
03964    
03965   //summary
03966   info1->SetText(0.01,0.95,text1);
03967   info1->SetTextSize(0.06);
03968   info1->SetTextColor(2);
03969   
03970   //Reco
03971   info2->SetText(0.01,0.88,"Reco:");
03972   info2->SetTextSize(0.06);
03973   info2->SetTextColor(4);
03974   
03975   info3->SetText(0.01,0.82,text2);
03976   info3->SetTextSize(0.06);
03977   info3->SetTextColor(9);
03978   
03979   info4->SetText(0.01,0.76,text3);
03980   info4->SetTextSize(0.06);
03981   info4->SetTextColor(9);
03982 
03983   info41->SetText(0.01,0.7,text31);
03984   info41->SetTextSize(0.06);
03985   info41->SetTextColor(9);
03986 
03987   info5->SetText(0.01,0.64,text4);
03988   info5->SetTextSize(0.06);
03989   info5->SetTextColor(9);
03990 
03991   int mcinfoc = 6;
03992   info6->SetText(0.01,0.5,"MC:");
03993   info6->SetTextSize(0.06);
03994   info6->SetTextColor(mcinfoc);
03995   
03996   if (mctruth){
03997     info7->SetText(0.05,0.44,text6);
03998     info7->SetTextSize(0.06);
03999     info7->SetTextColor(mcinfoc);
04000     
04001     info8->SetText(0.05,0.38,text7);
04002     info8->SetTextSize(0.06);
04003     info8->SetTextColor(mcinfoc);
04004 
04005     info9->SetText(0.05,0.32,text8);
04006     info9->SetTextSize(0.06);
04007     info9->SetTextColor(mcinfoc);
04008     
04009     info10->SetText(0.05,0.26,text9);
04010     info10->SetTextSize(0.06);
04011     info10->SetTextColor(mcinfoc);
04012 
04013     info11->SetText(0.05,0.2,text10);
04014     info11->SetTextSize(0.06);
04015     info11->SetTextColor(mcinfoc);
04016 
04017     info12->SetText(0.05,0.14,text11);
04018     info12->SetTextSize(0.06);
04019     info12->SetTextColor(mcinfoc);
04020 
04021     info13->SetText(0.05,0.08,text12);
04022     info13->SetTextSize(0.06);
04023     info13->SetTextColor(mcinfoc);
04024     
04025   }
04026   else {
04027     info7->SetText(0.05,0.44,"N/A");
04028     info7->SetTextSize(0.06);
04029     info7->SetTextColor(mcinfoc);
04030   }
04031   
04032   fRecoInfo->Clear();
04033   fRecoInfo->AddLine(text1);
04034   fRecoInfo->AddLine("Reco Info");
04035   fRecoInfo->AddLine(text2);
04036   fRecoInfo->AddLine(text3);
04037   fRecoInfo->AddLine(text31);
04038   fRecoInfo->AddLine(text4);
04039   //  fRecoInfo->AddLine(" ");
04040   string passcuts[2] = {"Fail","Pass"};
04041 //  string ipass = "Pre-selections: "+passcuts[passfid*passtrk*passshw]+"  Fid: "+passcuts[passfid]+"  Track: "+passcuts[passtrk]+"  Shower: "+passcuts[passshw];
04042   string ipass = "Pre-selection: "+passcuts[passfid*passtrk*passshw*passeng*passtrklike];
04043   string epass = "Fid: "+passcuts[passfid]+"  Trk: "+passcuts[passtrk]+"  Trklike: "+passcuts[passtrklike]+"  Shw: "+passcuts[passshw]+"  E: "+passcuts[passeng];
04044   fRecoInfo->AddLine(ipass.c_str());
04045   fRecoInfo->AddLine(epass.c_str());
04046 
04047 }

Int_t NueDisplayModule::GetEvent ( Int_t  evt  )  [private]

Definition at line 2195 of file NueDisplayModule.cxx.

References aca, acfa, UgliStripHandle::ClearFiber(), NtpSRTrack::ds, MuELoss::e, evthighest_t0, evthighest_t1, evthighest_z, evtlowest_t0, evtlowest_t1, evtlowest_z, fDetectorType, FillClusterGraphs(), SntpHelpers::FillEventEnergy(), foundSR, foundST, fRel, fShwUZ, fShwVZ, fSlcUZ, fSlcVZ, fStpIndexMapU, fStpIndexMapV, ftrkshw, fTrkUZ, fTrkVZ, fUZcolz, fUZlego, fUZview, fva, fVZcolz, fVZlego, fVZview, UgliStripHandle::GetHalfLength(), RecRecordImp< T >::GetHeader(), SntpHelpers::GetShower(), SntpHelpers::GetShowerIndex(), SntpHelpers::GetSlice(), RecPhysicsHeader::GetSnarl(), VHS::GetStrip(), UgliGeomHandle::GetStripHandle(), SntpHelpers::GetStripIndex(), SntpHelpers::GetTrack(), SntpHelpers::GetTrackIndex(), Mint::GetUgliGeomHandle(), UgliStripHandle::GlobalToLocal(), gMint, gr_dtds, hca, highest_t0, highest_t1, highest_z, NtpSRStrip::index, ReleaseType::IsCedar(), ReleaseType::IsDogwood(), NtpSRShieldSummary::ishit, UgliGeomHandle::IsValid(), Msg::kDebug, kDrawClu, Msg::kError, Detector::kFar, kIntReco, Detector::kNear, PlaneView::kU, PlaneView::kV, Msg::kWarning, StripEnd::kWest, lowest_t0, lowest_t1, lowest_z, MSG, NtpSRPlane::n, NtpSRTrack::nstrip, NtpSRShower::nstrip, NtpSRSlice::nstrip, NtpSRPulseHeight::pe, ph0, NtpSRStrip::ph0, ph1, NtpSRStrip::ph1, PHSIZE, NtpSRStrip::plane, NtpSRTrack::plane, NtpSRStrip::planeview, NueAnaBase::SetEventEnergyArray(), SetUpStripButtons(), sfa, shia, NtpSRPulseHeight::sigcor, SIGMAPMEU, sr, srvtx_u, srvtx_v, srvtx_xy, st, NtpSRShower::stp, NtpSRSlice::stp, NtpSRTrack::stp, NtpSRTrack::stpds, NtpSRShower::stpt0, NtpSRTrack::stpt0, NtpSRShower::stpt1, NtpSRTrack::stpt1, NtpSRTrack::stpx, NtpSRTrack::stpy, NtpSRTrack::stpz, NtpSRStrip::strip, tfit_dt_ds_neg, tfit_dt_ds_pos, NtpSRStrip::time0, NtpSRStrip::time1, TimeHst, TimeHst2, TimeHst2UV, TimeHstShw, TimeHstShw2, TimeHstShw2U, TimeHstShw2V, TimeHstShwU, TimeHstShwV, TimeHstTrk, TimeHstTrk2, TimeHstTrk2U, TimeHstTrk2V, TimeHstTrkU, TimeHstTrkV, TimeHstUV, NtpSRStrip::tpos, PropagationVelocity::Velocity(), NtpStRecord::vetohdr, NtpSRRecord::vetohdr, NtpSRRecord::vetostp, NtpStRecord::vetostp, UgliStripHandle::WlsPigtail(), NtpSRShieldStrip::x, NtpSRShieldStrip::y, and NtpSRStrip::z.

Referenced by GenerateMRMultiGraphs(), GenerateOverlayMultiGraphs(), UpdateDisplay(), and UpdateSliceOverlayColors().

02195                                          {
02196 
02197   // Get Ugli for later.  Bail immediately if fail
02198   UgliGeomHandle ugh = gMint->GetUgliGeomHandle();
02199   if (! ugh.IsValid()) {
02200     MSG("NueDisplayModule",Msg::kWarning) << "Got invalid Ugli\n";
02201   }
02202 
02203   if (foundST) {
02204     event = SntpHelpers::GetEvent(evt,st);
02205   }
02206   else if(foundSR){
02207     event = SntpHelpers::GetEvent(evt,sr);
02208   }
02209 
02210   if(!event) return 0;
02211  
02212   
02213   for(int k=0; k < PHSIZE; k++) { ph0[k] = ph1[k] = -1;}
02214   SntpHelpers::FillEventEnergy(ph0, ph1, evt, st, PHSIZE);
02215 
02216   shia.SetEventEnergyArray(ph0, ph1);
02217   fva.SetEventEnergyArray(ph0, ph1);
02218   sfa.SetEventEnergyArray(ph0, ph1);
02219   hca.SetEventEnergyArray(ph0, ph1);
02220   aca.SetEventEnergyArray(ph0, ph1);
02221   acfa.SetEventEnergyArray(ph0, ph1);
02222   
02223 
02224   fUZcolz->SetBins(60,event->vtx.z-0.3,event->vtx.z+1.,
02225                      30,event->vtx.u-0.618,event->vtx.u+0.618);
02226   fVZcolz->SetBins(60,event->vtx.z-0.3,event->vtx.z+1.,
02227                    30,event->vtx.v-0.618,event->vtx.v+0.618);
02228   
02229   fUZlego->SetBins(100,event->vtx.z-0.3,event->vtx.z+1.,
02230                    30,event->vtx.u-0.618,event->vtx.u+0.618);
02231   fVZlego->SetBins(100,event->vtx.z-0.3,event->vtx.z+1.,
02232                    30,event->vtx.v-0.618,event->vtx.v+0.618);
02233   
02234   
02235   if (foundST){//ST
02236     float evthighest_plane = 0;
02237     float evtlowest_plane = 500;
02238     float evthighest_strip0 = 0;
02239     float evtlowest_strip0 = 192;
02240     float evthighest_strip1 = 0;
02241     float evtlowest_strip1 = 192;
02242     
02243     evthighest_z = 0;
02244     evtlowest_z = 30.;
02245     evthighest_t0 = -4.0;
02246     evtlowest_t0 = 4.0;
02247     evthighest_t1 = -4.0;
02248     evtlowest_t1 = 4.0;    
02249 
02250     //loop over strips to fill histograms
02251     MSG("NueDisplayModule",Msg::kDebug)<<"Looping over strips "<<event->nstrip<<endl;
02252     for(int i=0;i<event->nstrip;i++){
02253       Int_t index = SntpHelpers::GetStripIndex(i,event);
02254       NtpSRStrip *strip = SntpHelpers::GetStrip(index,st);
02255       if(!strip){
02256         MSG("NueDisplayModule",Msg::kError)<<"Couldn't get strip "<<index<<" from event 0"
02257                                            <<" in snarl "<<st->GetHeader().GetSnarl()
02258                                            <<" something has gone horribly wrong, I'll just go"
02259                                            <<" on to the next event"<<endl;
02260         return 0;
02261       }
02262       else{
02263 //      MSG("NueDisplayModule",Msg::kDebug)<<"got strip"<<endl;
02264       }
02265 
02266 
02267         if(strip->ph0.pe+strip->ph1.pe<1e-5)continue;//empty strip
02268 
02269       int tempo_pln = strip->plane;
02270       int tempo_stp = strip->strip;
02271       float tempo_tpos = strip->tpos;
02272       if(tempo_pln<evtlowest_plane) {
02273         evtlowest_plane=tempo_pln;
02274         evtlowest_z=strip->z;
02275       }
02276       if(tempo_pln>evthighest_plane) {
02277         evthighest_plane=tempo_pln;
02278         evthighest_z=strip->z;
02279       }
02280       
02281       if(strip->planeview==PlaneView::kU){
02282 //      MSG("NueDisplayModule",Msg::kDebug)<<"filling u"<<endl;
02283         fUZview->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02284                                             strip->ph1.sigcor)/SIGMAPMEU);
02285         if (strip->z>=event->vtx.z-0.3&&strip->z<=event->vtx.z+1.&&
02286             strip->tpos>=event->vtx.u-0.618&&strip->tpos<=event->vtx.u+0.618){
02287           fUZcolz->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02288                                               strip->ph1.sigcor)/SIGMAPMEU);
02289           fUZlego->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02290                                               strip->ph1.sigcor)/SIGMAPMEU);
02291           fStpIndexMapU[fUZcolz->FindBin(strip->z,strip->tpos)] = strip->index;
02292         }
02293         if(tempo_tpos<evtlowest_t0) {
02294           evtlowest_strip0=tempo_stp;
02295           evtlowest_t0=tempo_tpos;
02296         }
02297         if(tempo_tpos>evthighest_t0) {
02298           evthighest_strip0=tempo_stp;
02299           evthighest_t0=tempo_tpos;
02300         }
02301       }
02302       else if(strip->planeview==PlaneView::kV){
02303 //      MSG("NueDisplayModule",Msg::kDebug)<<"filling v"<<endl;
02304         fVZview->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02305                                             strip->ph1.sigcor)/SIGMAPMEU);
02306         if (strip->z>=event->vtx.z-0.3&&strip->z<=event->vtx.z+1.&&
02307             strip->tpos>=event->vtx.v-0.618&&strip->tpos<=event->vtx.v+0.618){
02308           fVZcolz->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02309                                               strip->ph1.sigcor)/SIGMAPMEU);
02310           fVZlego->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02311                                               strip->ph1.sigcor)/SIGMAPMEU);
02312           fStpIndexMapV[fVZcolz->FindBin(strip->z,strip->tpos)] = strip->index;
02313         }
02314         if(tempo_tpos<evtlowest_t1) {
02315           evtlowest_strip1=tempo_stp;
02316           evtlowest_t1=tempo_tpos;
02317         }
02318         if(tempo_tpos>evthighest_t1) {
02319           evthighest_strip1=tempo_stp;
02320           evthighest_t1=tempo_tpos;
02321         }
02322       }
02323     }
02324      
02325     if(evtlowest_plane-5>=0) {
02326       evtlowest_plane-=5;
02327       evtlowest_z-=5.*0.06;
02328     }
02329     else {
02330       evtlowest_plane=0;
02331       evtlowest_z=0.;
02332     }
02333 
02334     if (fDetectorType == Detector::kNear){
02335       if (evtlowest_t0 - 3.*0.041>=-4.0){
02336         evtlowest_strip0-=3;
02337         evtlowest_t0-=3.*0.041;
02338       }
02339       else {
02340         evtlowest_strip0=0;
02341         evtlowest_t0=-4.0;
02342       }
02343     }
02344     else {
02345       if (evtlowest_strip0-3>=0){
02346         evtlowest_strip0-=3;
02347         evtlowest_t0-=3.*0.041;
02348       }
02349       else {
02350         evtlowest_strip0=0;
02351         evtlowest_t0=-4.0;
02352       }
02353     }
02354 
02355     if (fDetectorType == Detector::kNear){
02356       if (evtlowest_t1 - 3.*0.041>=-4.0){
02357         evtlowest_strip1-=3;
02358         evtlowest_t1-=3.*0.041;
02359       }
02360       else {
02361         evtlowest_strip1=0;
02362         evtlowest_t1=-4.0;
02363       }
02364     }
02365     else {
02366       if (evtlowest_strip1-3>=0){
02367         evtlowest_strip1-=3;
02368         evtlowest_t1-=3.*0.041;
02369       }
02370       else {
02371         evtlowest_strip1=0;
02372         evtlowest_t1=-4.0;
02373       }
02374     }
02375 
02376     
02377     if(evthighest_plane+5<=485) {
02378       evthighest_plane+=5;
02379       evthighest_z+=5.*0.06;
02380     }
02381     else {
02382       evthighest_plane=485;
02383       evthighest_z=30.;
02384     }
02385     
02386     if(evthighest_strip0+3<=191) {
02387       evthighest_strip0+=3;
02388       evthighest_t0+=3.*0.041;
02389     }
02390     else {
02391       evthighest_strip0=191;
02392       evthighest_t0=4.0;
02393     }
02394       
02395     if(evthighest_strip1+3<=191) {
02396       evthighest_strip1+=3;
02397       evthighest_t1+=3.*0.041;
02398     }
02399     else {
02400       evthighest_strip1=191;
02401       evthighest_t1=4.0;
02402     }   
02403 
02404     //I implant the 6 parameters in the option string so they can be retrived interactively later. This is a risky trick. I hope no one will actually make use of that "options".TY
02405     char setoptions[100];
02406     sprintf(setoptions,"%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%d",evthighest_z,evtlowest_z,evthighest_t0,evtlowest_t0,evthighest_t1,evtlowest_t1,0);
02407     fUZview->SetOption(setoptions);
02408 
02409     Double_t histmax = TMath::Max(fUZview->GetMaximum(),fVZview->GetMaximum());
02410     cout<<"histmax "<<fUZview->GetMaximum()<<" "<<fVZview->GetMaximum()<<" "<<histmax<<endl;
02411     fUZview->SetMaximum(1.05*histmax);
02412     fVZview->SetMaximum(1.05*histmax);
02413     Double_t colzmax = fUZcolz->GetMaximum()>fVZcolz->GetMaximum()?fUZcolz->GetMaximum():fVZcolz->GetMaximum();
02414     fUZcolz->SetMaximum(1.05*colzmax);
02415     fVZcolz->SetMaximum(1.05*colzmax);
02416     Double_t legomax = fUZlego->GetMaximum()>fVZlego->GetMaximum()?fUZlego->GetMaximum():fVZlego->GetMaximum();
02417     fUZlego->SetMaximum(1.05*legomax);
02418     fVZlego->SetMaximum(1.05*legomax);
02419     
02420     //record track hits
02421     int ntrks = event->ntrack;
02422     if (ntrks){
02423       for (int i = 0; i<ntrks; i++){
02424         int index = SntpHelpers::GetTrackIndex(i,event);
02425         NtpSRTrack *track = SntpHelpers::GetTrack(index,st);
02426         for (int istp = 0; istp<track->nstrip; istp++){
02427           float x = track->stpx[istp];
02428           float y = track->stpy[istp];
02429           ftrkshw->Fill(x,y,1);
02430         }
02431       }
02432     }
02433 
02434     //record veto shield hits
02435     if (st->vetohdr.ishit){//projection is within boundaries of shield plane
02436       TClonesArray* shieldstparray = st->vetostp; 
02437       for (int i = 0; i<shieldstparray->GetEntries(); i++){
02438         NtpSRShieldStrip* shieldstp = dynamic_cast<NtpSRShieldStrip *>(shieldstparray->At(i));
02439         ftrkshw->Fill(shieldstp->x,shieldstp->y,-1);
02440       }
02441     }
02442 
02443     //timing histogram
02444     //find range
02445     double tmin=0, tmax=0;
02446     bool first = true;
02447     NtpSRSlice *slice = SntpHelpers::GetSlice(event->slc,st);
02448 
02449     //shamelessly stolen from Mad
02450     if (slice){//slice
02451       float highest_plane = 0;
02452       float lowest_plane = 500;
02453       float highest_strip0 = 0;
02454       float lowest_strip0 = 192;
02455       float highest_strip1 = 0;
02456       float lowest_strip1 = 192;
02457     
02458       highest_z = 0;
02459       lowest_z = 30.;
02460       highest_t0 = -4.0;
02461       lowest_t0 = 4.0;
02462       highest_t1 = -4.0;
02463       lowest_t1 = 4.0;    
02464 
02465       for (int i = 0; i<slice->nstrip; i++){//loop over strips
02466         NtpSRStrip *strip = SntpHelpers::GetStrip(slice->stp[i],st);    
02467         double t = strip->time0;
02468         if (t>-100){
02469           if (first){
02470             tmin = tmax = t;
02471             first = false;
02472           }
02473           if (t < tmin) tmin = t;
02474           if (t > tmax) tmax = t;
02475         }
02476         t = strip->time1;
02477         if (t>-100){
02478           if (first){
02479             tmin = tmax = t;
02480             first = false;
02481           }
02482           if (t < tmin) tmin = t;
02483           if (t > tmax) tmax = t;
02484         }
02485         int tempo_pln = strip->plane;
02486         int tempo_stp = strip->strip;
02487         float tempo_tpos = strip->tpos;
02488         if(tempo_pln<lowest_plane) {
02489           lowest_plane=tempo_pln;
02490           lowest_z=strip->z;
02491         }
02492         if(tempo_pln>highest_plane) {
02493           highest_plane=tempo_pln;
02494           highest_z=strip->z;
02495         }
02496 
02497         if (strip->planeview==PlaneView::kU){
02498           fSlcUZ->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02499                                              strip->ph1.sigcor)/SIGMAPMEU);
02500           if(tempo_tpos<lowest_t0) {
02501             lowest_strip0=tempo_stp;
02502             lowest_t0=tempo_tpos;
02503           }
02504           if(tempo_tpos>highest_t0) {
02505             highest_strip0=tempo_stp;
02506             highest_t0=tempo_tpos;
02507           }
02508         }
02509         else if (strip->planeview==PlaneView::kV){
02510           fSlcVZ->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02511                                              strip->ph1.sigcor)/SIGMAPMEU);
02512           if(tempo_tpos<lowest_t1) {
02513             lowest_strip1=tempo_stp;
02514             lowest_t1=tempo_tpos;
02515           }
02516           if(tempo_tpos>highest_t1) {
02517             highest_strip1=tempo_stp;
02518             highest_t1=tempo_tpos;
02519           }
02520         }
02521       }
02522       if(lowest_plane-10>=0) {
02523         lowest_plane-=10;
02524         lowest_z-=10.*0.06;
02525       }
02526       else {
02527         lowest_plane=0;
02528         lowest_z=0.;
02529       }
02530   
02531       if(lowest_strip0-5>=0) {
02532         lowest_strip0-=5;
02533         lowest_t0-=5.*0.041;
02534       }
02535       else {
02536         lowest_strip0=0;
02537         lowest_t0=-4.0;
02538       }
02539       
02540       if(lowest_strip1-5>=0) {
02541         lowest_strip1-=5;
02542         lowest_t1-=5.*0.041;
02543       }
02544       else {
02545         lowest_strip1=0;
02546         lowest_t1=-4.0;
02547       }
02548       
02549       if(highest_plane+10<=485) {
02550         highest_plane+=10;
02551         highest_z+=10.*0.06;
02552       }
02553       else {
02554         highest_plane=485;
02555         highest_z=30.;
02556       }
02557       
02558       if(highest_strip0+5<=191) {
02559         highest_strip0+=5;
02560         highest_t0+=5.*0.041;
02561       }
02562       else {
02563         highest_strip0=191;
02564         highest_t0=4.0;
02565       }
02566       
02567       if(highest_strip1+5<=191) {
02568         highest_strip1+=5;
02569         highest_t1+=5.*0.041;
02570       }
02571       else {
02572         highest_strip1=191;
02573         highest_t1=4.0;
02574       }      
02575     }
02576     // give some buffer at either end...
02577     tmin -= 50e-9;
02578     tmax += 20e-9;
02579 
02580     double eps = 1.0e-8;
02581     if (tmin == tmax) { tmin -= eps; tmax += eps; }
02582     
02583     // for far detector, suppress display of pre-trigger time interval
02584     if (fDetectorType == Detector::kFar){
02585       if ((tmax - tmin)*1e9>1500) tmin = tmax - 1500e-9;
02586     }
02587 
02588     TimeHstTrk->SetBins(100,tmin/1e-9,tmax/1e-9);
02589     TimeHstTrkU->SetBins(100,tmin/1e-9,tmax/1e-9);
02590     TimeHstTrkV->SetBins(100,tmin/1e-9,tmax/1e-9);
02591     TimeHstShw->SetBins(100,tmin/1e-9,tmax/1e-9);
02592     TimeHstShwU->SetBins(100,tmin/1e-9,tmax/1e-9);
02593     TimeHstShwV->SetBins(100,tmin/1e-9,tmax/1e-9);
02594 
02595     TimeHstTrk2->SetBins(50,0,100);
02596     TimeHstTrk2U->SetBins(50,0,100);
02597     TimeHstTrk2V->SetBins(50,0,100);
02598     TimeHstShw2->SetBins(50,0,100);
02599     TimeHstShw2U->SetBins(50,0,100);
02600     TimeHstShw2V->SetBins(50,0,100);
02601 
02602     //record track hits
02603     //int ntrks = event->ntrack;
02604     if (ntrks){//if(ntrks)
02605       int trkidx = -1;
02606       int trkplanes = -1;
02607       for (int i = 0; i<ntrks; i++){
02608         int index = SntpHelpers::GetTrackIndex(i,event);
02609         NtpSRTrack *track = SntpHelpers::GetTrack(index,st);
02610         if (track->plane.n>trkplanes){
02611           trkplanes = track->plane.n;
02612           trkidx = index;
02613         }
02614         for (int istp = 0; istp<track->nstrip; istp++){
02615           //ftrkshw->Fill(track->stpx[istp],track->stpy[istp],1);
02616           NtpSRStrip *strip = SntpHelpers::GetStrip(track->stp[istp],st);
02617           TimeHstTrk->Fill(track->stpt0[istp]/1e-9,strip->ph0.pe);
02618           TimeHstTrk->Fill(track->stpt1[istp]/1e-9,strip->ph1.pe);
02619           TimeHstTrk2->Fill((track->stpt0[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph0.pe);
02620           TimeHstTrk2->Fill((track->stpt1[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph1.pe);
02621           //record track strip information
02622           if(strip->planeview==PlaneView::kU){
02623             fTrkUZ->Fill(strip->z,strip->tpos,100000);//paranoia
02624 
02625             TimeHstTrkU->Fill(track->stpt0[istp]/1e-9,strip->ph0.pe);
02626             TimeHstTrkU->Fill(track->stpt1[istp]/1e-9,strip->ph1.pe);
02627             TimeHstTrk2U->Fill((track->stpt0[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph0.pe);
02628             TimeHstTrk2U->Fill((track->stpt1[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph1.pe);
02629           }
02630           else if(strip->planeview==PlaneView::kV){
02631             fTrkVZ->Fill(strip->z,strip->tpos,100000);
02632 
02633             TimeHstTrkV->Fill(track->stpt0[istp]/1e-9,strip->ph0.pe);
02634             TimeHstTrkV->Fill(track->stpt1[istp]/1e-9,strip->ph1.pe);
02635             TimeHstTrk2V->Fill((track->stpt0[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph0.pe);
02636             TimeHstTrk2V->Fill((track->stpt1[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph1.pe);
02637           }
02638         }
02639       }
02640       vector<double> spathLength;
02641       vector<double> st0;
02642       if (trkidx != -1 && fDetectorType == Detector::kNear){
02643         NtpSRTrack *track = SntpHelpers::GetTrack(trkidx,st);
02644         for (int istp = 0; istp<track->nstrip; istp++){
02645           NtpSRStrip *strip = SntpHelpers::GetStrip(track->stp[istp],st);
02646           spathLength.push_back(track->ds-track->stpds[istp]);
02647           PlexStripEndId seid(Detector::kNear,strip->plane,strip->strip,StripEnd::kWest);
02648           UgliStripHandle stripHandle = ugh.GetStripHandle(seid);
02649           float halfLength = stripHandle.GetHalfLength();
02650           const TVector3 ghitxyz(track->stpx[istp],track->stpy[istp],track->stpz[istp]);
02651           TVector3 lhitxyz = stripHandle.GlobalToLocal(ghitxyz);
02652           float fiberDist = (halfLength - lhitxyz.x() + stripHandle.ClearFiber(StripEnd::kWest) + stripHandle.WlsPigtail(StripEnd::kWest));
02653           //using strip time, I don't understand track time TJ
02654           //st0.push_back(track->stpt1[istp]-fiberDist/PropagationVelocity::Velocity());
02655           st0.push_back(strip->time1-fiberDist/PropagationVelocity::Velocity());
02656           //cout<<strip->plane<<" "<<strip->strip<<" "<<track->ds-track->stpds[istp]<<Form(" %.9f %.9f %.9f",track->stpt1[istp],strip->time1,strip->time1-fiberDist/PropagationVelocity::Velocity())<<endl;
02657         }
02658         gr_dtds = new TGraph(st0.size(),&spathLength[0],&st0[0]);
02659         tfit_dt_ds_pos -> SetParameter(0,0.0) ;
02660         gr_dtds->Fit("tfit_dt_ds_pos","QR") ;
02661         tfit_dt_ds_neg -> SetParameter(0,0.0) ;
02662         gr_dtds->Fit("tfit_dt_ds_neg","QR") ;
02663 
02664         float trms1 = 0;
02665         float trms2 = 0;
02666 
02667         for (unsigned i = 0; i<st0.size(); i++){
02668           double x,y;
02669           gr_dtds->GetPoint(i,x,y);
02670           trms1 += pow(y-tfit_dt_ds_pos->Eval(x),2);
02671           trms2 += pow(y-tfit_dt_ds_neg->Eval(x),2);
02672         }
02673         trms1/=st0.size();
02674         trms2/=st0.size();
02675         trms1=sqrt(trms1)*1e9;
02676         trms2=sqrt(trms2)*1e9;
02677         char grtitle[100];
02678         sprintf(grtitle,"dt vs ds, rms+:%.1fns rms-:%.1fns (rms+)-(rms-):%.1fns",trms1,trms2,trms1-trms2);
02679         gr_dtds->SetTitle(grtitle);
02680         gr_dtds->SetName("gr_dtds");
02681       }
02682     }
02683     
02684     //record shower hits
02685     int nshws = event->nshower;
02686     if (nshws){
02687       for (int i = 0; i<nshws; i++){
02688         int index = SntpHelpers::GetShowerIndex(i,event);
02689         NtpSRShower *shower = SntpHelpers::GetShower(index,st);
02690         for (int istp = 0; istp<shower->nstrip; istp++){
02691           NtpSRStrip *strip = SntpHelpers::GetStrip(shower->stp[istp],st);
02692           if(ReleaseType::IsCedar(fRel)||ReleaseType::IsDogwood(fRel)){
02693             TimeHstShw->Fill(shower->stpt0[istp]/1e-9,strip->ph0.pe);
02694             TimeHstShw->Fill(shower->stpt1[istp]/1e-9,strip->ph1.pe);
02695             TimeHstShw2->Fill((shower->stpt0[istp]-tmin)/1e-9,strip->ph0.pe);
02696             TimeHstShw2->Fill((shower->stpt1[istp]-tmin)/1e-9,strip->ph1.pe);
02697           }
02698           else {
02699             TimeHstShw->Fill(strip->time0/1e-9,strip->ph0.pe);
02700             TimeHstShw->Fill(strip->time1/1e-9,strip->ph1.pe);
02701             TimeHstShw2->Fill((strip->time0-tmin)/1e-9,strip->ph0.pe);
02702             TimeHstShw2->Fill((strip->time1-tmin)/1e-9,strip->ph1.pe);
02703           }
02704           //record shower strip information
02705           if(strip->planeview==PlaneView::kU){
02706             fShwUZ->Fill(strip->z,strip->tpos,100000);//paranoia
02707             if(ReleaseType::IsCedar(fRel)||ReleaseType::IsDogwood(fRel)){
02708               TimeHstShwU->Fill(shower->stpt0[istp]/1e-9,strip->ph0.pe);
02709               TimeHstShwU->Fill(shower->stpt1[istp]/1e-9,strip->ph1.pe);
02710               TimeHstShw2U->Fill((shower->stpt0[istp]-tmin)/1e-9,strip->ph0.pe);
02711               TimeHstShw2U->Fill((shower->stpt1[istp]-tmin)/1e-9,strip->ph1.pe);
02712             }
02713             else {
02714               TimeHstShwU->Fill(strip->time0/1e-9,strip->ph0.pe);
02715               TimeHstShwU->Fill(strip->time1/1e-9,strip->ph1.pe);
02716               TimeHstShw2U->Fill((strip->time0-tmin)/1e-9,strip->ph0.pe);
02717               TimeHstShw2U->Fill((strip->time1-tmin)/1e-9,strip->ph1.pe);
02718             }
02719           }
02720           else if(strip->planeview==PlaneView::kV){
02721             fShwVZ->Fill(strip->z,strip->tpos,100000);
02722             if(ReleaseType::IsCedar(fRel)||ReleaseType::IsDogwood(fRel)){
02723               TimeHstShwV->Fill(shower->stpt0[istp]/1e-9,strip->ph0.pe);
02724               TimeHstShwV->Fill(shower->stpt1[istp]/1e-9,strip->ph1.pe);
02725               TimeHstShw2V->Fill((shower->stpt0[istp]-tmin)/1e-9,strip->ph0.pe);
02726               TimeHstShw2V->Fill((shower->stpt1[istp]-tmin)/1e-9,strip->ph1.pe);
02727             }
02728             else {
02729               TimeHstShwV->Fill(strip->time0/1e-9,strip->ph0.pe);
02730               TimeHstShwV->Fill(strip->time1/1e-9,strip->ph1.pe);
02731               TimeHstShw2V->Fill((strip->time0-tmin)/1e-9,strip->ph0.pe);
02732               TimeHstShw2V->Fill((strip->time1-tmin)/1e-9,strip->ph1.pe);
02733             }
02734           }
02735         }
02736       }
02737     }
02738     TimeHst = new THStack("TimeHist",
02739                           "Digit Times (ns) Red - Trk, Blue - Shw");
02740     TimeHst->Add(TimeHstTrk);
02741     TimeHst->Add(TimeHstShw);
02742 
02743     TimeHstUV = new THStack("TimeHistUV",
02744                             "UV Digit Times (ns) Red - Trk, Blue - Shw");
02745     TimeHstUV->Add(TimeHstTrkU);
02746     TimeHstUV->Add(TimeHstTrkV);
02747     TimeHstUV->Add(TimeHstShwU);
02748     TimeHstUV->Add(TimeHstShwV);
02749 
02750     TimeHst2 = new THStack("TimeHist2",
02751                            "Digit Times (ns) after prop. cor. Red - Trk, Blue - Shw");
02752     TimeHst2->Add(TimeHstTrk2);
02753     TimeHst2->Add(TimeHstShw2);
02754 
02755     TimeHst2UV = new THStack("TimeHist2UV",
02756                            "UV Digit Times (ns) after prop. cor. Red - Trk, Blue - Shw");
02757     TimeHst2UV->Add(TimeHstTrk2U);
02758     TimeHst2UV->Add(TimeHstTrk2V);
02759     TimeHst2UV->Add(TimeHstShw2U);
02760     TimeHst2UV->Add(TimeHstShw2V);
02761   }
02762   else if (foundSR){//SR
02763     float evthighest_plane = 0;
02764     float evtlowest_plane = 500;
02765     float evthighest_strip0 = 0;
02766     float evtlowest_strip0 = 192;
02767     float evthighest_strip1 = 0;
02768     float evtlowest_strip1 = 192;
02769     
02770     evthighest_z = 0;
02771     evtlowest_z = 30.;
02772     evthighest_t0 = -4.0;
02773     evtlowest_t0 = 4.0;
02774     evthighest_t1 = -4.0;
02775     evtlowest_t1 = 4.0;    
02776     
02777     //loop over strips to fill histograms
02778     MSG("NueDisplayModule",Msg::kDebug)<<"Looping over strips "<<event->nstrip<<endl;
02779     for(int i=0;i<event->nstrip;i++){
02780       Int_t index = SntpHelpers::GetStripIndex(i,event);
02781       NtpSRStrip *strip = SntpHelpers::GetStrip(index,sr);
02782       if(!strip){
02783         MSG("NueDisplayModule",Msg::kError)<<"Couldn't get strip "<<index<<" from event 0"
02784                                            <<" in snarl "<<sr->GetHeader().GetSnarl()
02785                                            <<" something has gone horribly wrong, I'll just go"
02786                                            <<" on to the next event"<<endl;
02787         return 0;
02788       }
02789       else{
02790         MSG("NueDisplayModule",Msg::kDebug)<<"got strip"<<endl;
02791       }
02792       int tempo_pln = strip->plane;
02793       int tempo_stp = strip->strip;
02794       float tempo_tpos = strip->tpos;
02795       if(tempo_pln<evtlowest_plane) {
02796         evtlowest_plane=tempo_pln;
02797         evtlowest_z=strip->z;
02798       }
02799       if(tempo_pln>evthighest_plane) {
02800         evthighest_plane=tempo_pln;
02801         evthighest_z=strip->z;
02802       }
02803       
02804       if(strip->planeview==PlaneView::kU){
02805         MSG("NueDisplayModule",Msg::kDebug)<<"filling u"<<endl;
02806         fUZview->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02807                                             strip->ph1.sigcor)/SIGMAPMEU);
02808         if (strip->z>=event->vtx.z-0.3&&strip->z<=event->vtx.z+1.&&
02809             strip->tpos>=event->vtx.u-0.618&&strip->tpos<=event->vtx.u+0.618){
02810           fUZcolz->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02811                                               strip->ph1.sigcor)/SIGMAPMEU);
02812           fUZlego->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02813                                               strip->ph1.sigcor)/SIGMAPMEU);
02814           fStpIndexMapU[fUZcolz->FindBin(strip->z,strip->tpos)] = strip->index;
02815         }
02816         if(tempo_tpos<evtlowest_t0) {
02817           evtlowest_strip0=tempo_stp;
02818           evtlowest_t0=tempo_tpos;
02819         }
02820         if(tempo_tpos>evthighest_t0) {
02821           evthighest_strip0=tempo_stp;
02822           evthighest_t0=tempo_tpos;
02823         }
02824       }
02825       else if(strip->planeview==PlaneView::kV){
02826         MSG("NueDisplayModule",Msg::kDebug)<<"filling v"<<endl;
02827         fVZview->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02828                                             strip->ph1.sigcor)/SIGMAPMEU);
02829         if (strip->z>=event->vtx.z-0.3&&strip->z<=event->vtx.z+1.&&
02830             strip->tpos>=event->vtx.v-0.618&&strip->tpos<=event->vtx.v+0.618){
02831           fVZcolz->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02832                                               strip->ph1.sigcor)/SIGMAPMEU);
02833           fVZlego->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
02834                                               strip->ph1.sigcor)/SIGMAPMEU);
02835           fStpIndexMapV[fVZcolz->FindBin(strip->z,strip->tpos)] = strip->index;
02836         }
02837         if(tempo_tpos<evtlowest_t1) {
02838           evtlowest_strip1=tempo_stp;
02839           evtlowest_t1=tempo_tpos;
02840         }
02841         if(tempo_tpos>evthighest_t1) {
02842           evthighest_strip1=tempo_stp;
02843           evthighest_t1=tempo_tpos;
02844         }
02845       }
02846     }
02847     if(evtlowest_plane-5>=0) {
02848       evtlowest_plane-=5;
02849       evtlowest_z-=5.*0.06;
02850     }
02851     else {
02852       evtlowest_plane=0;
02853       evtlowest_z=0.;
02854     }
02855 
02856     if (fDetectorType == Detector::kNear){
02857       if (evtlowest_t0 - 3.*0.041>=-4.0){
02858         evtlowest_strip0-=3;
02859         evtlowest_t0-=3.*0.041;
02860       }
02861       else {
02862         evtlowest_strip0=0;
02863         evtlowest_t0=-4.0;
02864       }
02865     }
02866     else {
02867       if (evtlowest_strip0-3>=0){
02868         evtlowest_strip0-=3;
02869         evtlowest_t0-=3.*0.041;
02870       }
02871       else {
02872         evtlowest_strip0=0;
02873         evtlowest_t0=-4.0;
02874       }
02875     }
02876 
02877     if (fDetectorType == Detector::kNear){
02878       if (evtlowest_t1 - 3.*0.041>=-4.0){
02879         evtlowest_strip1-=3;
02880         evtlowest_t1-=3.*0.041;
02881       }
02882       else {
02883         evtlowest_strip1=0;
02884         evtlowest_t1=-4.0;
02885       }
02886     }
02887     else {
02888       if (evtlowest_strip1-3>=0){
02889         evtlowest_strip1-=3;
02890         evtlowest_t1-=3.*0.041;
02891       }
02892       else {
02893         evtlowest_strip1=0;
02894         evtlowest_t1=-4.0;
02895       }
02896     }    
02897     
02898     if(evthighest_plane+5<=485) {
02899       evthighest_plane+=5;
02900       evthighest_z+=5.*0.06;
02901     }
02902     else {
02903       evthighest_plane=485;
02904       evthighest_z=30.;
02905     }
02906     
02907     if(evthighest_strip0+3<=191) {
02908       evthighest_strip0+=3;
02909       evthighest_t0+=3.*0.041;
02910     }
02911     else {
02912       evthighest_strip0=191;
02913       evthighest_t0=4.0;
02914     }
02915       
02916     if(evthighest_strip1+3<=191) {
02917       evthighest_strip1+=3;
02918       evthighest_t1+=3.*0.041;
02919     }
02920     else {
02921       evthighest_strip1=191;
02922       evthighest_t1=4.0;
02923     }       
02924 
02925     //I implant the 6 parameters in the option string so they can be retrived interactively later. This is a risky trick. I hope no one will actually make use of that "options".
02926     char setoptions[100];
02927     sprintf(setoptions,"%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%d",evthighest_z,evtlowest_z,evthighest_t0,evtlowest_t0,evthighest_t1,evtlowest_t1,0);
02928     fUZview->SetOption(setoptions);
02929 
02930     //set histogram ranges
02931     Double_t histmax = TMath::Max(fUZview->GetMaximum(),fVZview->GetMaximum());
02932     fUZview->SetMaximum(1.05*histmax);
02933     fVZview->SetMaximum(1.05*histmax);
02934     Double_t colzmax = fUZcolz->GetMaximum()>fVZcolz->GetMaximum()?fUZcolz->GetMaximum():fVZcolz->GetMaximum();
02935     fUZcolz->SetMaximum(1.05*colzmax);
02936     fVZcolz->SetMaximum(1.05*colzmax);
02937     Double_t legomax = fUZlego->GetMaximum()>fVZlego->GetMaximum()?fUZlego->GetMaximum():fVZlego->GetMaximum();
02938     fUZlego->SetMaximum(1.05*legomax);
02939     fVZlego->SetMaximum(1.05*legomax);
02940     
02941     int ntrks = event->ntrack;
02942     if (ntrks){
02943       for (int i = 0; i<ntrks; i++){
02944         int index = SntpHelpers::GetTrackIndex(i,event);
02945         NtpSRTrack *track = SntpHelpers::GetTrack(index,sr);
02946         for (int istp = 0; istp<track->nstrip; istp++){
02947           float x = track->stpx[istp];
02948           float y = track->stpy[istp];
02949           ftrkshw->Fill(x,y,1);
02950         }
02951       }
02952     }
02953 
02954     //record veto shield hits
02955     if (sr->vetohdr.ishit){//projection is within boundaries of shield plane 
02956       TClonesArray* shieldstparray = sr->vetostp; 
02957       for (int i = 0; i<shieldstparray->GetEntries(); i++){
02958         NtpSRShieldStrip* shieldstp = dynamic_cast<NtpSRShieldStrip *>(shieldstparray->At(i));
02959         ftrkshw->Fill(shieldstp->x,shieldstp->y,-1);
02960       }
02961     }
02962     //timing histogram
02963     //find range
02964     double tmin=0, tmax=0;
02965     bool first = true;
02966     NtpSRSlice *slice = SntpHelpers::GetSlice(event->slc,sr);
02967     if (slice){
02968       float highest_plane = 0;
02969       float lowest_plane = 500;
02970       float highest_strip0 = 0;
02971       float lowest_strip0 = 192;
02972       float highest_strip1 = 0;
02973       float lowest_strip1 = 192;
02974     
02975       highest_z = 0;
02976       lowest_z = 30.;
02977       highest_t0 = -4.0;
02978       lowest_t0 = 4.0;
02979       highest_t1 = -4.0;
02980       lowest_t1 = 4.0;    
02981 
02982       for (int i = 0; i<slice->nstrip; i++){
02983         NtpSRStrip *strip = SntpHelpers::GetStrip(slice->stp[i],sr);    
02984         double t = strip->time0;
02985         if (t>-100){
02986           if (first){
02987             tmin = tmax = t;
02988             first = false;
02989           }
02990           if (t < tmin) tmin = t;
02991           if (t > tmax) tmax = t;
02992         }
02993         t = strip->time1;
02994         if (t>-100){
02995           if (first){
02996             tmin = tmax = t;
02997             first = false;
02998           }
02999           if (t < tmin) tmin = t;
03000           if (t > tmax) tmax = t;
03001         }
03002         int tempo_pln = strip->plane;
03003         int tempo_stp = strip->strip;
03004         float tempo_tpos = strip->tpos;
03005         if(tempo_pln<lowest_plane) {
03006           lowest_plane=tempo_pln;
03007           lowest_z=strip->z;
03008         }
03009         if(tempo_pln>highest_plane) {
03010           highest_plane=tempo_pln;
03011           highest_z=strip->z;
03012         }
03013 
03014         if (strip->planeview==PlaneView::kU){
03015           fSlcUZ->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
03016                                              strip->ph1.sigcor)/SIGMAPMEU);
03017           if(tempo_tpos<lowest_t0) {
03018             lowest_strip0=tempo_stp;
03019             lowest_t0=tempo_tpos;
03020           }
03021           if(tempo_tpos>highest_t0) {
03022             highest_strip0=tempo_stp;
03023             highest_t0=tempo_tpos;
03024           }
03025         }
03026         else if (strip->planeview==PlaneView::kV){
03027           fSlcVZ->Fill(strip->z,strip->tpos,(strip->ph0.sigcor + 
03028                                              strip->ph1.sigcor)/SIGMAPMEU);
03029           if(tempo_tpos<lowest_t1) {
03030             lowest_strip1=tempo_stp;
03031             lowest_t1=tempo_tpos;
03032           }
03033           if(tempo_tpos>highest_t1) {
03034             highest_strip1=tempo_stp;
03035             highest_t1=tempo_tpos;
03036           }
03037         }
03038       }
03039       if(lowest_plane-10>=0) {
03040         lowest_plane-=10;
03041         lowest_z-=10.*0.06;
03042       }
03043       else {
03044         lowest_plane=0;
03045         lowest_z=0.;
03046       }
03047   
03048       if(lowest_strip0-5>=0) {
03049         lowest_strip0-=5;
03050         lowest_t0-=5.*0.041;
03051       }
03052       else {
03053         lowest_strip0=0;
03054         lowest_t0=-4.0;
03055       }
03056       
03057       if(lowest_strip1-5>=0) {
03058         lowest_strip1-=5;
03059         lowest_t1-=5.*0.041;
03060       }
03061       else {
03062         lowest_strip1=0;
03063         lowest_t1=-4.0;
03064       }
03065       
03066       if(highest_plane+10<=485) {
03067         highest_plane+=10;
03068         highest_z+=10.*0.06;
03069       }
03070       else {
03071         highest_plane=485;
03072         highest_z=30.;
03073       }
03074       
03075       if(highest_strip0+5<=191) {
03076         highest_strip0+=5;
03077         highest_t0+=5.*0.041;
03078       }
03079       else {
03080         highest_strip0=191;
03081         highest_t0=4.0;
03082       }
03083       
03084       if(highest_strip1+5<=191) {
03085         highest_strip1+=5;
03086         highest_t1+=5.*0.041;
03087       }
03088       else {
03089         highest_strip1=191;
03090         highest_t1=4.0;
03091       }      
03092     }
03093     // give some buffer at either end...
03094     tmin -= 50e-9;
03095     tmax += 20e-9;
03096 
03097     double eps = 1.0e-8;
03098     if (tmin == tmax) { tmin -= eps; tmax += eps; }
03099     
03100     // for far detector, suppress display of pre-trigger time interval
03101     if (fDetectorType == Detector::kFar){
03102       if ((tmax - tmin)*1e9>1500) tmin = tmax - 1500e-9;
03103     }
03104 
03105     TimeHstTrk->SetBins(100,tmin/1e-9,tmax/1e-9);
03106     TimeHstTrkU->SetBins(100,tmin/1e-9,tmax/1e-9);
03107     TimeHstTrkV->SetBins(100,tmin/1e-9,tmax/1e-9);
03108     TimeHstShw->SetBins(100,tmin/1e-9,tmax/1e-9);
03109     TimeHstShwU->SetBins(100,tmin/1e-9,tmax/1e-9);
03110     TimeHstShwV->SetBins(100,tmin/1e-9,tmax/1e-9);
03111 
03112     TimeHstTrk2->SetBins(50,0,100);
03113     TimeHstTrk2U->SetBins(50,0,100);
03114     TimeHstTrk2V->SetBins(50,0,100);
03115     TimeHstShw2->SetBins(50,0,100);
03116     TimeHstShw2U->SetBins(50,0,100);
03117     TimeHstShw2V->SetBins(50,0,100);
03118 
03119 //    TH1F *h1 = (TH1F*)TimeHst->GetHists()->FindObject("TimeHstTrk");
03120 //    TH1F *h2 = (TH1F*)TimeHst->GetHists()->FindObject("TimeHstShw");
03121 //    h1->SetBins(100,tmin/1e-9,tmax/1e-9);
03122 //    h2->SetBins(100,tmin/1e-9,tmax/1e-9);
03123 
03124     //record track hits
03125     //int ntrks = event->ntrack;
03126     if (ntrks){
03127       for (int i = 0; i<ntrks; i++){
03128         int index = SntpHelpers::GetTrackIndex(i,event);
03129         NtpSRTrack *track = SntpHelpers::GetTrack(index,sr);
03130         for (int istp = 0; istp<track->nstrip; istp++){
03131           //ftrkshw->Fill(track->stpx[istp],track->stpy[istp],1);
03132           NtpSRStrip *strip = SntpHelpers::GetStrip(track->stp[istp],sr);
03133           TimeHstTrk->Fill(track->stpt0[istp]/1e-9,strip->ph0.pe);
03134           TimeHstTrk->Fill(track->stpt1[istp]/1e-9,strip->ph1.pe);
03135           TimeHstTrk2->Fill((track->stpt0[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph0.pe);
03136           TimeHstTrk2->Fill((track->stpt1[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph1.pe);
03137           //record track strip information
03138           if(strip->planeview==PlaneView::kU){
03139             fTrkUZ->Fill(strip->z,strip->tpos,100000);//paranoia
03140 
03141             TimeHstTrkU->Fill(track->stpt0[istp]/1e-9,strip->ph0.pe);
03142             TimeHstTrkU->Fill(track->stpt1[istp]/1e-9,strip->ph1.pe);
03143             TimeHstTrk2U->Fill((track->stpt0[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph0.pe);
03144             TimeHstTrk2U->Fill((track->stpt1[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph1.pe);
03145           }
03146           else if(strip->planeview==PlaneView::kV){
03147             fTrkVZ->Fill(strip->z,strip->tpos,100000);
03148 
03149             TimeHstTrkV->Fill(track->stpt0[istp]/1e-9,strip->ph0.pe);
03150             TimeHstTrkV->Fill(track->stpt1[istp]/1e-9,strip->ph1.pe);
03151             TimeHstTrk2V->Fill((track->stpt0[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph0.pe);
03152             TimeHstTrk2V->Fill((track->stpt1[istp]-tmin-(track->ds-track->stpds[istp])/3e8)/1e-9,strip->ph1.pe);            
03153           } 
03154         }
03155       }
03156     }
03157 
03158     //record shower hits
03159     int nshws = event->nshower;
03160     if (nshws){
03161       for (int i = 0; i<nshws; i++){
03162         int index = SntpHelpers::GetShowerIndex(i,event);
03163         NtpSRShower *shower = SntpHelpers::GetShower(index,sr);
03164         for (int istp = 0; istp<shower->nstrip; istp++){
03165           NtpSRStrip *strip = SntpHelpers::GetStrip(shower->stp[istp],sr);
03166           TimeHstShw->Fill(strip->time0/1e-9,strip->ph0.pe);
03167           TimeHstShw->Fill(strip->time1/1e-9,strip->ph1.pe);
03168           TimeHstShw2->Fill((strip->time0-tmin)/1e-9,strip->ph0.pe);
03169           TimeHstShw2->Fill((strip->time1-tmin)/1e-9,strip->ph1.pe);
03170           //record shower strip information
03171           if(strip->planeview==PlaneView::kU){
03172             fShwUZ->Fill(strip->z,strip->tpos,100000);//paranoia
03173 
03174             TimeHstShwU->Fill(strip->time0/1e-9,strip->ph0.pe);
03175             TimeHstShwU->Fill(strip->time1/1e-9,strip->ph1.pe);
03176             TimeHstShw2U->Fill((strip->time0-tmin)/1e-9,strip->ph0.pe);
03177             TimeHstShw2U->Fill((strip->time1-tmin)/1e-9,strip->ph1.pe);
03178           }
03179           else if(strip->planeview==PlaneView::kV){
03180             fShwVZ->Fill(strip->z,strip->tpos,100000);
03181 
03182             TimeHstShwV->Fill(strip->time0/1e-9,strip->ph0.pe);
03183             TimeHstShwV->Fill(strip->time1/1e-9,strip->ph1.pe);
03184             TimeHstShw2V->Fill((strip->time0-tmin)/1e-9,strip->ph0.pe);
03185             TimeHstShw2V->Fill((strip->time1-tmin)/1e-9,strip->ph1.pe);
03186           } 
03187         }
03188       }
03189     }
03190     TimeHst = new THStack("TimeHist","Digit Times (ns)");
03191     TimeHst->Add(TimeHstTrk);
03192     TimeHst->Add(TimeHstShw);
03193 
03194     TimeHstUV = new THStack("TimeHistUV","UV Digit Times (ns)");
03195     TimeHstUV->Add(TimeHstTrkU);
03196     TimeHstUV->Add(TimeHstTrkV);
03197     TimeHstUV->Add(TimeHstShwU);
03198     TimeHstUV->Add(TimeHstShwV);
03199 
03200     TimeHst2 = new THStack("TimeHist2","Digit Times (ns)");
03201     TimeHst2->Add(TimeHstTrk2);
03202     TimeHst2->Add(TimeHstShw2);
03203 
03204     TimeHst2UV = new THStack("TimeHist2UV","UV Digit Times (ns)");
03205     TimeHst2UV->Add(TimeHstTrk2U);
03206     TimeHst2UV->Add(TimeHstTrk2V);
03207     TimeHst2UV->Add(TimeHstShw2U);
03208     TimeHst2UV->Add(TimeHstShw2V);
03209   }  
03210   
03211   srvtx_u->SetX(event->vtx.z);
03212   srvtx_u->SetY(event->vtx.u);
03213   srvtx_v->SetX(event->vtx.z);
03214   srvtx_v->SetY(event->vtx.v);
03215   srvtx_xy->SetX(event->vtx.x);
03216   srvtx_xy->SetY(event->vtx.y);
03217   
03218   if(kDrawClu) FillClusterGraphs();  
03219   if(kIntReco) SetUpStripButtons();
03220   
03221   return 1;
03222   }

void NueDisplayModule::GhostGraph ( TGraph *  gr  )  [private]

Definition at line 5959 of file NueDisplayModule.cxx.

Referenced by UpdateMREventOverlayColors(), and UpdateMREventStripColors().

05960 {
05961   if(gr == 0) return;
05962 
05963   gr->SetMarkerSize(0);
05964   gr->SetMarkerStyle(8);
05965   gr->SetMarkerColor(kWhite);
05966 }

void NueDisplayModule::GotoEvent (  )  [private]

Definition at line 4149 of file NueDisplayModule.cxx.

References eventno, fEvent, fEventEntry, fNumEvents, foundpidmatch, foundvrmatch, gMint, and UpdateDisplay().

Referenced by BuildDisplay().

04150 {
04151   if (!gMint) return;
04152 
04153   string eventno = fEventEntry->GetText();
04154   if (atoi(eventno.c_str())<fNumEvents && atoi(eventno.c_str())>=0){
04155     fEvent = atoi(eventno.c_str());
04156     this->UpdateDisplay(foundvrmatch, foundpidmatch);
04157   }
04158   else {
04159     return;
04160   }
04161 }

void NueDisplayModule::IntRecoCalc (  )  [private]

Definition at line 4899 of file NueDisplayModule.cxx.

References fCanvas6, fIntRecoDoSim, fIntRecoHistU, fIntRecoHistV, fIntRecoHistZ, fIntRecoLineU, fIntRecoLineV, fPredictedHistU, fPredictedHistV, fPredictedHistZ, fStripButtonU, fStripButtonV, fUZcolz, fUZPred, fVZcolz, fVZPred, Mint::GetJobC(), VHS::GetStrip(), gMint, JobC::Mom, NtpSRStrip::ph0, NtpSRStrip::ph1, NtpSRStrip::plane, NtpSRStrip::planeview, FitterEM::PredictEMLoss(), FitterEM::QuickInput(), NtpSRPulseHeight::sigcor, SIGMAPMEU, NtpSRStrip::strip, NtpSRStrip::tpos, and NtpSRStrip::z.

Referenced by BuildDisplay().

04899                                   {
04900 
04901   fIntRecoHistZ->Reset();
04902   fIntRecoHistU->Reset();
04903   fIntRecoHistV->Reset();
04904   fPredictedHistZ->Reset();
04905   fPredictedHistU->Reset();
04906   fPredictedHistV->Reset();
04907   fUZPred->Reset();
04908   fVZPred->Reset();
04909 
04910   Bool_t doSim = true;
04911   if(fIntRecoDoSim->GetFillColor()==2) doSim = false;
04912   
04913   RecRecordImp<RecCandHeader> *rr = 
04914     dynamic_cast<RecRecordImp<RecCandHeader>*>
04915     ((gMint->GetJobC().Mom).GetFragment("RecRecordImp<RecCandHeader>"));
04916 
04917   vector<Int_t> striplist;
04918   for(UInt_t i=0;i<fStripButtonU.size();i++){
04919     if(fStripButtonU[i]->GetFillColor()==11){
04920       const char *name = fStripButtonU[i]->GetName();
04921       TString nom(name);
04922       nom.Chop();
04923       nom.Remove(0,nom.First("_")+1);
04924       striplist.push_back(atoi(nom.Data()));
04925     }
04926   }
04927   for(UInt_t i=0;i<fStripButtonV.size();i++){
04928     if(fStripButtonV[i]->GetFillColor()==11){
04929       const char *name = fStripButtonV[i]->GetName();
04930       TString nom(name);
04931       nom.Chop();
04932       nom.Remove(0,nom.First("_")+1);
04933       striplist.push_back(atoi(nom.Data()));
04934     }
04935   }
04936   if(striplist.size()==0) return;
04937 
04938   //translate arrow positions back to u,v,z in metres:
04939   Float_t evtZ1 = fUZcolz->GetXaxis()->GetBinCenter(1) + 
04940     (fUZcolz->GetXaxis()->GetBinLowEdge(fUZcolz->GetNbinsX()+1) - 
04941      fUZcolz->GetXaxis()->GetBinLowEdge(1)) * 
04942     (fIntRecoLineU->GetX1()-0.025)/0.95;
04943   Float_t evtU =  fUZcolz->GetYaxis()->GetBinCenter(1) + 
04944     (fUZcolz->GetYaxis()->GetBinLowEdge(fUZcolz->GetNbinsY()+1) - 
04945      fUZcolz->GetYaxis()->GetBinLowEdge(1)) * 
04946     (fIntRecoLineU->GetY1()-0.025)/0.95;
04947   Float_t evtZ = fVZcolz->GetXaxis()->GetBinCenter(1) + 
04948     (fVZcolz->GetXaxis()->GetBinLowEdge(fVZcolz->GetNbinsX()+1) - 
04949      fVZcolz->GetXaxis()->GetBinLowEdge(1)) * 
04950     (fIntRecoLineV->GetX1()-0.025)/0.95;
04951   Float_t evtV =  fVZcolz->GetYaxis()->GetBinCenter(0) + 
04952     (fVZcolz->GetYaxis()->GetBinLowEdge(fVZcolz->GetNbinsY()+1) - 
04953      fVZcolz->GetYaxis()->GetBinLowEdge(1)) * 
04954     (fIntRecoLineV->GetY1()-0.025)/0.95;
04955 
04956   Float_t endZ1 = fUZcolz->GetXaxis()->GetBinCenter(1) + 
04957     (fUZcolz->GetXaxis()->GetBinLowEdge(fUZcolz->GetNbinsX()+1) - 
04958      fUZcolz->GetXaxis()->GetBinLowEdge(1)) * 
04959     (fIntRecoLineU->GetX2()-0.025)/0.95;
04960   Float_t endU =  fUZcolz->GetYaxis()->GetBinCenter(1) + 
04961     (fUZcolz->GetYaxis()->GetBinLowEdge(fUZcolz->GetNbinsY()+1) - 
04962      fUZcolz->GetYaxis()->GetBinLowEdge(1)) * 
04963     (fIntRecoLineU->GetY2()-0.025)/0.95;
04964   Float_t endZ = fVZcolz->GetXaxis()->GetBinCenter(1) + 
04965     (fVZcolz->GetXaxis()->GetBinLowEdge(fVZcolz->GetNbinsX()+1) - 
04966      fVZcolz->GetXaxis()->GetBinLowEdge(1)) * 
04967     (fIntRecoLineV->GetX2()-0.025)/0.95;
04968   Float_t endV =  fVZcolz->GetYaxis()->GetBinCenter(0) + 
04969     (fVZcolz->GetYaxis()->GetBinLowEdge(fVZcolz->GetNbinsY()+1) - 
04970      fVZcolz->GetYaxis()->GetBinLowEdge(1)) * 
04971     (fIntRecoLineV->GetY2()-0.025)/0.95; 
04972 
04973   Float_t dudz = (endU-evtU)/(endZ1-evtZ1);
04974   Float_t dvdz = (endV-evtV)/(endZ-evtZ);
04975 
04976   //choose minimum Z value and adjust U/V vertex position
04977   if(evtZ1<evtZ) {
04978     evtV += dvdz*(evtZ1-evtZ);
04979     evtZ = evtZ1;
04980   }
04981   else evtU += dudz*(evtZ-evtZ1);
04982 
04983   Float_t minZ = 30;
04984   Float_t maxZ = -30;
04985   Float_t minTP = +8;
04986   Float_t maxTP = -8;
04987 
04988   Int_t minPl = 500;
04989   Int_t maxPl = 0;
04990   Int_t minStpU = 200;
04991   Int_t maxStpU = 0;
04992   Int_t minStpV = 200;
04993   Int_t maxStpV = 0;
04994 
04995   Int_t vtxView = 0;
04996   Int_t vtxPln = 0;
04997   Int_t vtxStpU = 0;
04998   Int_t vtxStpV = 0;
04999   Float_t vtxZDiff = 1000;
05000   Float_t vtxUDiff = 1000;
05001   Float_t vtxVDiff = 1000;
05002 
05003   vector<Int_t>::iterator stripitr = striplist.begin();
05004   vector<Int_t>::iterator stripend = striplist.end();
05005   while(stripitr!=stripend){
05006     NtpSRStrip *strip = SntpHelpers::GetStrip(*stripitr,rr);  
05007     if(strip->z-evtZ<minZ) {
05008       minZ = strip->z-evtZ;
05009       minPl = strip->plane;
05010     }
05011     if(strip->z-evtZ>maxZ) {
05012       maxZ = strip->z-evtZ;
05013       maxPl = strip->plane;
05014     }
05015     if(TMath::Abs(strip->z-evtZ)<TMath::Abs(vtxZDiff)) {
05016       vtxZDiff = strip->z-evtZ;
05017       vtxPln = strip->plane;
05018       vtxView = strip->planeview;
05019     }
05020     if(strip->planeview==2){
05021       if(strip->tpos-evtU<minTP) minTP=strip->tpos-evtU;
05022       if(strip->strip<minStpU) minStpU = strip->strip;
05023       if(strip->tpos-evtU>maxTP) maxTP=strip->tpos-evtU;
05024       if(strip->strip>maxStpU) maxStpU = strip->strip;
05025       if(TMath::Abs(strip->tpos-evtU)<TMath::Abs(vtxUDiff)) {
05026         vtxUDiff = strip->tpos-evtU;
05027         vtxStpU = strip->strip;
05028       }
05029     }
05030     if(strip->planeview==3){
05031       if(strip->tpos-evtV<minTP) minTP=strip->tpos-evtV;
05032       if(strip->strip<minStpV) minStpV = strip->strip;
05033       if(strip->tpos-evtV>maxTP) maxTP=strip->tpos-evtV;
05034       if(strip->strip>maxStpV) maxStpV = strip->strip;
05035       if(TMath::Abs(strip->tpos-evtV)<TMath::Abs(vtxVDiff)) {
05036         vtxVDiff = strip->tpos-evtV;
05037         vtxStpV = strip->strip;
05038       }
05039     }
05040     stripitr++;
05041   }
05042   stripitr = striplist.begin();
05043   
05044   // make sure vtx plane and strip are not more 
05045   // than 1plane or 1strip away from the true vertex
05046   while(TMath::Abs(vtxZDiff)>0.06) {
05047     if(vtxZDiff>0) {
05048       vtxZDiff -= 0.06;
05049       vtxPln -= 1;
05050       if(vtxView == 2) vtxView = 3;
05051       else vtxView = 2;
05052     }
05053     else if(vtxUDiff<0) {
05054       vtxZDiff += 0.06;
05055       vtxPln += 1;
05056       if(vtxView == 2) vtxView = 3;
05057       else vtxView = 2;
05058     }
05059   }
05060   while(TMath::Abs(vtxUDiff)>0.041) {
05061     if(vtxUDiff>0) {
05062       vtxUDiff -= 0.041;
05063       vtxStpU -= 1;
05064     }
05065     else if(vtxUDiff<0) {
05066       vtxUDiff += 0.041;
05067       vtxStpU += 1;
05068     }
05069   }
05070   while(TMath::Abs(vtxVDiff)>0.041) {
05071     if(vtxVDiff>0) {
05072       vtxVDiff -= 0.041;
05073       vtxStpV -= 1;
05074     }
05075     else if(vtxVDiff<0) {
05076       vtxVDiff += 0.041;
05077       vtxStpV += 1;
05078     }
05079   }
05080 
05081   fIntRecoHistZ->SetBins(5+int((maxZ-minZ)/0.0585),
05082                          minZ-0.1475,maxZ+0.1475);
05083   fIntRecoHistU->SetBins(5+int((maxTP-minTP)/0.0405),
05084                          minTP-0.1025,maxTP+0.1025);
05085   fIntRecoHistV->SetBins(5+int((maxTP-minTP)/0.0405),
05086                          minTP-0.1025,maxTP+0.1025);
05087 
05088   while(stripitr!=stripend){
05089     NtpSRStrip *strip = SntpHelpers::GetStrip(*stripitr,rr);    
05090     fIntRecoHistZ->Fill(strip->z-evtZ,(strip->ph0.sigcor + 
05091                                        strip->ph1.sigcor)/SIGMAPMEU);
05092     if(strip->planeview==2) fIntRecoHistU->Fill(strip->tpos-evtU,
05093                                                 (strip->ph0.sigcor + 
05094                                                  strip->ph1.sigcor) / 
05095                                                 SIGMAPMEU);
05096     if(strip->planeview==3) fIntRecoHistV->Fill(strip->tpos-evtV,
05097                                                 (strip->ph0.sigcor + 
05098                                                  strip->ph1.sigcor) / 
05099                                                 SIGMAPMEU);
05100     stripitr++;
05101   }
05102 
05103   for(int i=1;i<=fIntRecoHistZ->GetNbinsX();i++){
05104     Float_t error = fIntRecoHistZ->GetBinContent(i);
05105     if(error>0) error = TMath::Sqrt(error);
05106     fIntRecoHistZ->SetBinError(i,error);
05107   }
05108   for(int i=1;i<=fIntRecoHistU->GetNbinsX();i++){
05109     Float_t error = fIntRecoHistU->GetBinContent(i);
05110     if(error>0) error = TMath::Sqrt(error);
05111     fIntRecoHistU->SetBinError(i,error);
05112     error = fIntRecoHistV->GetBinContent(i);
05113     if(error>0) error = TMath::Sqrt(error);
05114     fIntRecoHistV->SetBinError(i,error);
05115   }
05116 
05117   //Get prediction:
05118   fPredictedHistZ->SetBins(5+int((maxZ-minZ)/0.0585),
05119                            minZ-0.1475,maxZ+0.1475);
05120   fPredictedHistU->SetBins(5+int((maxTP-minTP)/0.0405),
05121                            minTP-0.1025,maxTP+0.1025);
05122   fPredictedHistV->SetBins(5+int((maxTP-minTP)/0.0405),
05123                            minTP-0.1025,maxTP+0.1025);
05124   
05125   fUZPred->SetBins(5+maxPl-minPl,minPl-2.5,maxPl+2.5,
05126                    5+maxStpU-minStpU,minStpU-2.5,maxStpU+2.5);
05127   fVZPred->SetBins(5+maxPl-minPl,minPl-2.5,maxPl+2.5,
05128                    5+maxStpV-minStpV,minStpV-2.5,maxStpV+2.5);
05129 
05130   Float_t totalPE = fIntRecoHistZ->Integral();
05131   Float_t energy = totalPE*0.0268;
05132   if(doSim && energy>0.1){
05133     FitterEM *fit = new FitterEM();
05134     fit->QuickInput(energy,vtxUDiff,vtxVDiff,vtxZDiff,
05135                     dudz,dvdz,vtxView);
05136     double binFluc = 1;
05137     for(int i=minPl-2;i<=maxPl+2;i++) {
05138       
05139       Int_t view = 0;
05140       if(i%2==vtxPln%2) view = vtxView;
05141       else if(vtxView==2) view=3;
05142       else if(vtxView==3) view=2;
05143       
05144       if(view==2){
05145         for(int j=minStpU-2;j<=maxStpU+2;j++) {   
05146           fUZPred->Fill(i,j,fit->PredictEMLoss(i-vtxPln,j-vtxStpU,binFluc));
05147           fPredictedHistU->Fill(fPredictedHistU->GetBinCenter(fPredictedHistU->FindBin((j-vtxStpU)*0.041+vtxUDiff)),fit->PredictEMLoss(i-vtxPln,j-vtxStpU,binFluc));
05148           fPredictedHistZ->Fill(fPredictedHistZ->GetBinCenter(fPredictedHistZ->FindBin((i-vtxPln)*0.059+vtxZDiff)),fit->PredictEMLoss(i-vtxPln,j-vtxStpU,binFluc));
05149         }
05150       }
05151       else if(view==3){
05152         for(int j=minStpV-2;j<=maxStpV+2;j++) {   
05153           fVZPred->Fill(i,j,fit->PredictEMLoss(i-vtxPln,j-vtxStpV,binFluc));
05154           fPredictedHistV->Fill(fPredictedHistV->GetBinCenter(fPredictedHistV->FindBin((j-vtxStpV)*0.041+vtxVDiff)),fit->PredictEMLoss(i-vtxPln,j-vtxStpV,binFluc));
05155           fPredictedHistZ->Fill(fPredictedHistZ->GetBinCenter(fPredictedHistZ->FindBin((i-vtxPln)*0.059+vtxZDiff)),fit->PredictEMLoss(i-vtxPln,j-vtxStpV,binFluc));
05156         }
05157       }
05158     }
05159     delete fit;
05160   }
05161   
05162   Float_t maxValue = 0;
05163   if(fUZPred->Integral()>0) {
05164     fUZPred->Scale(fUZcolz->Integral()/fUZPred->Integral());
05165     maxValue = fUZPred->GetBinContent(fUZPred->GetMaximumBin());
05166   }
05167   if(fVZPred->Integral()>0) {
05168     fVZPred->Scale(fVZcolz->Integral()/fVZPred->Integral());
05169     if(fVZPred->GetBinContent(fVZPred->GetMaximumBin())>maxValue) 
05170       maxValue = fVZPred->GetBinContent(fVZPred->GetMaximumBin());
05171   }
05172   if(maxValue>0) {
05173     fUZPred->SetMaximum(maxValue*1.1);
05174     fVZPred->SetMaximum(maxValue*1.1);
05175     fUZPred->SetMinimum(maxValue*0.01);
05176     fVZPred->SetMinimum(maxValue*0.01);
05177   }
05178 
05179   maxValue = 0;
05180   if(fPredictedHistU->Integral()>0) {
05181     fPredictedHistU->Scale(fIntRecoHistU->Integral() /
05182                            fPredictedHistU->Integral());
05183     maxValue = fPredictedHistU->GetBinContent(fPredictedHistU->GetMaximumBin());
05184   }
05185   if(fIntRecoHistU->Integral()>0 &&
05186      fIntRecoHistU->GetBinContent(fIntRecoHistU->GetMaximumBin())>maxValue) 
05187     maxValue = fIntRecoHistU->GetBinContent(fIntRecoHistU->GetMaximumBin());
05188   
05189   if(fPredictedHistV->Integral()>0) {
05190     fPredictedHistV->Scale(fIntRecoHistV->Integral() / 
05191                            fPredictedHistV->Integral());
05192     if(fPredictedHistV->GetBinContent(fPredictedHistV->GetMaximumBin())>maxValue)
05193       maxValue = fPredictedHistV->GetBinContent(fPredictedHistV->GetMaximumBin());
05194   }
05195   if(fIntRecoHistV->GetBinContent(fIntRecoHistV->GetMaximumBin())>maxValue) 
05196     maxValue = fIntRecoHistV->GetBinContent(fIntRecoHistV->GetMaximumBin());
05197 
05198   if(maxValue>0) {
05199     fPredictedHistU->SetMaximum(maxValue*1.1);
05200     fIntRecoHistU->SetMaximum(maxValue*1.1);
05201     fPredictedHistV->SetMaximum(maxValue*1.1);
05202     fIntRecoHistV->SetMaximum(maxValue*1.1);
05203   }
05204 
05205   maxValue = 0;
05206   if(fPredictedHistZ->Integral()>0) {
05207     fPredictedHistZ->Scale(fIntRecoHistZ->Integral() / 
05208                            fPredictedHistZ->Integral());
05209     maxValue = fPredictedHistZ->GetBinContent(fPredictedHistZ->GetMaximumBin());
05210   }
05211   if(fIntRecoHistZ->Integral()>0 && 
05212      fIntRecoHistZ->GetBinContent(fIntRecoHistZ->GetMaximumBin())>maxValue) 
05213     maxValue = fIntRecoHistZ->GetBinContent(fIntRecoHistZ->GetMaximumBin());
05214   if(maxValue>0) {
05215     fPredictedHistZ->SetMaximum(maxValue*1.1);
05216     fIntRecoHistZ->SetMaximum(maxValue*1.1);
05217   }
05218   
05219   fCanvas6->cd(1); gPad->Modified();
05220   fCanvas6->cd(2); gPad->Modified();
05221   fCanvas6->cd(3); gPad->Modified();
05222   fCanvas6->cd(4); gPad->Modified();
05223   fCanvas6->Update();
05224   
05225   cout << "=================================" << endl;
05226   cout << "Interative Display Calculations:" << endl;
05227   cout << "Energy of selected hits: " << energy << " GeV" << endl;
05228   cout << "Vertex from arrow positions (u,v,z) (metres): " 
05229        << evtU << " " << evtV << " " << evtZ << endl;
05230   cout << "Approximate Vertex in strip/plane (u,v,z): " 
05231        << vtxStpU << " " << vtxStpV << " " << vtxPln << endl;
05232   cout << "Offsets from approx vertex to arrow vertex: "
05233        << vtxUDiff << " " << vtxVDiff << " " << vtxZDiff << endl;
05234   cout << "Angles from arrow directions; dudz: " << dudz 
05235        << " dvdz: " << dvdz << endl;
05236   cout << "---------------------------------" << endl;
05237   cout << endl;
05238 }

void NueDisplayModule::logvote (  )  [private]

Definition at line 4644 of file NueDisplayModule.cxx.

References fEncoded, fEvent, Form(), foundST, fSnarl, SntpHelpers::GetShower(), SntpHelpers::GetShowerIndex(), SntpHelpers::GetTrack(), SntpHelpers::GetTrackIndex(), NtpSRStripPulseHeight::gev, hitlog, ievtp, iFileW, itopo, NtpSRShowerPulseHeight::linCCgev, NtpSRTrack::momentum, NtpSRPlane::n, OpenFileWrite(), outfile, NtpSRShower::ph, NtpSRTrack::plane, NtpSRMomentum::range, RunNo, NtpSRShower::shwph, st, and SubRunNo.

Referenced by BuildDisplay().

04644                               {
04645   if (!iFileW){
04646     this->OpenFileWrite();
04647   }
04648   if (!hitlog){
04649   
04650     //Copied from fcanvas0 to fill in energy values in the output file  
04651     int ntrks = event->ntrack;
04652     int nshws = event->nshower;
04653     Float_t trk_mom_range = 0;
04654     Float_t trk_planes = 0;
04655     Float_t shw_ph = 0;
04656     Float_t shw_shwph = 0;
04657     if (foundST){
04658     if (ntrks){
04659       for (int i = 0; i<ntrks; i++){
04660         int index = SntpHelpers::GetTrackIndex(i,event);
04661         NtpSRTrack *track = SntpHelpers::GetTrack(index,st);
04662         if (track->plane.n>trk_planes) {
04663           trk_mom_range = track->momentum.range;
04664           trk_planes = track->plane.n;
04665         }
04666         }
04667       }
04668     }
04669   
04670     if (nshws){
04671       for (int i = 0; i<nshws; i++){
04672         int index = SntpHelpers::GetShowerIndex(i,event);
04673         NtpSRShower *shower = SntpHelpers::GetShower(index,st);
04674         if (shower->shwph.linCCgev>shw_shwph) {
04675           shw_ph = shower->ph.gev;
04676           shw_shwph = shower->shwph.linCCgev;
04677         }
04678       }
04679     }
04680   
04681     
04682     outfile<<RunNo<<" "<<SubRunNo<<" "<<fSnarl<<" "<<fEvent<<" "<<ievtp<<" "<<itopo<<" "<<shw_ph+trk_mom_range<<" "<<shw_ph<<" "<<trk_mom_range;
04683     hitlog = 1;
04684     if (ievtp>=0&&ievtp<7&&itopo>=0&&itopo<5){
04685       //string tmp = evtpcode[ievtp] + " | " + topocode[itopo];
04686       string tmp = Form("%d | %d",ievtp, itopo);
04687       fEncoded->SetText(tmp.c_str());
04688     }
04689   }
04690 }

void NueDisplayModule::makecomment (  )  [private]

Definition at line 4692 of file NueDisplayModule.cxx.

References fComment, hitlog, icomm, and outfile.

Referenced by BuildDisplay().

04692                                   {
04693   if (hitlog ==1 && !icomm) {
04694     outfile<<"  "<<fComment->GetText()<<endl;
04695     fComment->Clear();
04696     icomm = 1;
04697   }
04698 }

void NueDisplayModule::MRShowEvent ( int  val  ) 

Definition at line 6063 of file NueDisplayModule.cxx.

References DrawUpperMRCanvas(), foundMR, showMREvent, showNewEvent, showOrigEvent, UpdateMREventOverlayColors(), uzMREventOverlay, and vzMREventOverlay.

06064 {
06065    if(!foundMR) return;
06066 
06067   if(val == 0) showNewEvent = !showNewEvent;
06068   if(val == 1) showMREvent = !showMREvent;
06069   if(val == 2) showOrigEvent = !showOrigEvent;
06070                                                                                                                      
06071   UpdateMREventOverlayColors(uzMREventOverlay);
06072   UpdateMREventOverlayColors(vzMREventOverlay);
06073                                                                                                                      
06074   DrawUpperMRCanvas();
06075                                                                                                                      
06076 }

void NueDisplayModule::MRShowMRStrips ( int  val  ) 

Definition at line 6046 of file NueDisplayModule.cxx.

References DrawLowerMRCanvas(), foundMR, showStpAll, showStpRecoTrk, showStpScaled, showStpTrueMu, showStpTrueShw, UpdateMREventStripColors(), uzMREventOld, and vzMREventOld.

06047 {
06048   if(!foundMR) return;
06049 
06050   if(val == 0) showStpAll = !showStpAll;
06051   if(val == 1) showStpTrueMu = !showStpTrueMu;
06052   if(val == 2) showStpTrueShw = !showStpTrueShw;
06053   if(val == 3) showStpScaled = !showStpScaled;
06054   if(val == 4) showStpRecoTrk = !showStpRecoTrk;
06055 
06056   UpdateMREventStripColors(uzMREventOld);
06057   UpdateMREventStripColors(vzMREventOld);
06058 
06059   DrawLowerMRCanvas();
06060 
06061 }

void NueDisplayModule::NextEvent (  )  [private]

Definition at line 4106 of file NueDisplayModule.cxx.

References clickbutton, fEvent, fNumEvents, foundpidmatch, foundvrmatch, gMint, ievtp, iIO, itopo, Mint::Next(), and UpdateDisplay().

Referenced by BuildDisplay(), and UpdateDisplay().

04106                                 {
04107   clickbutton = 1;
04108   if (iIO){
04109     ievtp = 0;
04110     itopo = 0;
04111   }
04112   if(fNumEvents>0){
04113     fEvent++;
04114     if(fEvent>=fNumEvents){
04115       fEvent = 0;
04116       gMint->Next();
04117       return;
04118     }
04119     this->UpdateDisplay(foundvrmatch, foundpidmatch);
04120   }
04121   else {
04122     gMint->Next();
04123     return;
04124   }
04125 }

void NueDisplayModule::NextSelEvt (  )  [private]

Definition at line 4802 of file NueDisplayModule.cxx.

References commitr, eventnoitr, evtpcode, fComment, fEvent, fTYPETOPO, gMint, Mint::GoTo(), iEvtp, ievtp, iIO, itopo, iTopo, runnoitr, selecevtp, selectopo, snarlno, snarlnoitr, subrunnoitr, topocode, topoitr, and typeitr.

Referenced by BuildDisplay().

04802                                  {
04803   if (iIO&&snarlno.size()){
04804     /*
04805       cout<<*runnoitr<<" "<<*subrunnoitr<<" "
04806       <<fSnarl<<" "<<fEvent
04807       <<" "<<*snarlnoitr<<" "<<*eventnoitr<<endl;
04808 
04809     if(runnoitr<runno.end()&&runnoitr>=runno.begin()&&
04810        subrunnoitr<subrunno.end()&&subrunnoitr>=subrunno.begin()&&
04811        snarlnoitr<snarlno.end()&&snarlnoitr>=snarlno.begin()
04812        &&(fSnarl < *snarlnoitr || fSnarl == *snarlnoitr && 
04813        fEvent < *eventnoitr)){
04814     if(fSnarl == *snarlnoitr && fEvent < *eventnoitr){
04815       if ((!selecevtp||iEvtp[*typeitr])&&(!selectopo||iTopo[*topoitr])){
04816         fEvent = *eventnoitr;
04817         ievtp = *typeitr;
04818         itopo = *topoitr;
04819         //gMint->GoTo(*runnoitr,*snarlnoitr);
04820         if (*typeitr>=0&&*typeitr<7&&*topoitr>=0&&*topoitr<5){
04821           string tmp = evtpcode[*typeitr] + " | " + topocode[*topoitr];
04822           fTYPETOPO->SetText(tmp.c_str());
04823         }
04824         fComment->SetText((*commitr).c_str());
04825       }
04826     }
04827     else 
04828     */
04829     if (snarlnoitr != snarlno.end() && snarlnoitr != snarlno.end() - 1){    
04830       runnoitr++;
04831       subrunnoitr++;
04832       snarlnoitr++;
04833       eventnoitr++;
04834       typeitr++;
04835       topoitr++;
04836       commitr++;
04837       if ((!selecevtp||iEvtp[*typeitr])&&(!selectopo||iTopo[*topoitr])){
04838         fEvent = *eventnoitr;
04839         ievtp = *typeitr;
04840         itopo = *topoitr;
04841         gMint->GoTo(*runnoitr,*snarlnoitr);
04842         if (*typeitr>=0&&*typeitr<7&&*topoitr>=0&&*topoitr<5){
04843           string tmp = evtpcode[*typeitr] + " | " + topocode[*topoitr];
04844           fTYPETOPO->SetText(tmp.c_str());
04845         }
04846         fComment->SetText((*commitr).c_str());
04847       }
04848       else {this->NextSelEvt();}
04849     }
04850   }
04851 }

void NueDisplayModule::OpenFileRead (  )  [private]

Definition at line 4762 of file NueDisplayModule.cxx.

References clickbutton, commitr, eventcomm, eventno, eventnoitr, eventtopo, eventtype, fFileEnt, fFileR, Form(), iIO, runno, runnoitr, snarlno, snarlnoitr, subrunno, subrunnoitr, topoitr, and typeitr.

Referenced by BuildDisplay().

04762                                    {
04763   if (iIO == 1){
04764     ifstream ins(fFileEnt->GetText());
04765     if (ins){
04766       fFileR->SetText(Form("Read Records from File: %s",fFileEnt->GetText()));
04767       fFileEnt->Clear();
04768       clickbutton = 0;
04769       Int_t n1,n2,n3,n4,n5,n6;
04770       while(!ins.eof()){
04771         //ins.getline(buf,100);
04772         //sscanf(buf,"%d%d%d%d%d%d",&n1,&n2,&n3,&n4,&n5,&n6);
04773         ins>>n1>>n2>>n3>>n4>>n5>>n6;
04774         char buf[1000];
04775         ins.getline(buf,1000);
04776         if (!ins.eof()){
04777           //cout<<n1<<" "<<n2<<" "<<n3<<" "<<n4<<" "<<n5<<" "<<n6<<endl;
04778           //if (n1 == RunNo && n2 == SubRunNo){
04779           runno.push_back(n1);
04780           subrunno.push_back(n2);
04781           snarlno.push_back(n3);
04782           eventno.push_back(n4);
04783           eventtype.push_back(n5);
04784           eventtopo.push_back(n6);
04785           if (strlen(buf)>2)
04786             eventcomm.push_back(buf+2);
04787           else eventcomm.push_back(buf);
04788           //}
04789         }
04790       }//while
04791       runnoitr = runno.begin()-1;
04792       subrunnoitr = subrunno.begin()-1;
04793       snarlnoitr = snarlno.begin()-1;
04794       eventnoitr = eventno.begin()-1;
04795       typeitr = eventtype.begin()-1;
04796       topoitr = eventtopo.begin()-1;
04797       commitr = eventcomm.begin()-1;      
04798     }
04799   }
04800 }

void NueDisplayModule::OpenFileWrite (  )  [private]

Definition at line 4612 of file NueDisplayModule.cxx.

References fFileW, Form(), iFileW, Msg::kInfo, MSG, outfile, RunNo, and SubRunNo.

Referenced by logvote(), and UpdateDisplay().

04612                                     {
04613 
04614   if (!iFileW){
04615     string setfilename;
04616     string sRunNumber=Form("%d",RunNo);
04617     string sRunNumberSub=Form("%d",SubRunNo);
04618     setfilename = "PID-"+sRunNumber+"_"+sRunNumberSub;
04619     
04620     ifstream Test(setfilename.c_str());
04621     if(Test){
04622       //Need new filename
04623       Int_t fred=1;
04624       while(Test) {
04625         Test.close();
04626         string ifred = Form("%d",fred);
04627         setfilename = "PID-"+sRunNumber+"_"+sRunNumberSub+"_"+ifred;
04628         
04629         Test.open(setfilename.c_str());
04630         fred++;
04631       }
04632     }
04633     outfile.open(setfilename.c_str());
04634     string fn = "Write Records to File: "+setfilename;
04635     fFileW->SetText(fn.c_str());
04636     iFileW = 1; //file opened
04637   }
04638   else {
04639     //if (iIO) MSG("NueDisplayModule",Msg::kError)<<"In Read Mode"<<endl;
04640     MSG("NueDisplayModule",Msg::kInfo)<<"File already opened!"<<endl;
04641   }
04642 }  

bool NueDisplayModule::PassCuts (  )  [private]

Definition at line 4049 of file NueDisplayModule.cxx.

References fCut, fDetectorType, fEvent, foundSR, foundST, NueConvention::IsInsideFarFiducial_Nue_Extended(), NueConvention::IsInsideNearFiducial_Nue_Extended(), Msg::kDebug, Detector::kFar, Detector::kNear, Msg::kWarning, MSG, passeng, NueAnalysisCuts::PassesEventPlaneCut(), NueAnalysisCuts::PassesHighEnergyCut(), NueAnalysisCuts::PassesHighShowerEnergyCut(), NueAnalysisCuts::PassesLowEnergyCut(), NueAnalysisCuts::PassesLowShowerEnergyCut(), NueAnalysisCuts::PassesTrackLikePlaneCut(), NueAnalysisCuts::PassesTrackPlaneCut(), passfid, passshw, passtrk, passtrklike, NueAnalysisCuts::SetInfoObject(), and st.

Referenced by UpdateDisplay().

04049                                {
04050 
04051   //  int nshws = event->nshower;  //no. of showers
04052 
04053   passfid = 1;
04054   passtrk = 1;
04055   passshw = 1;
04056   passeng = 1;
04057   passtrklike = 1;
04058                                                                                 
04059    Int_t test = 0;
04060    if(fDetectorType == Detector::kNear)
04061       test = NueConvention::IsInsideNearFiducial_Nue_Extended(
04062                   event->vtx.x, event->vtx.y, event->vtx.z);
04063    if(fDetectorType == Detector::kFar)
04064       test = NueConvention::IsInsideFarFiducial_Nue_Extended(
04065                   event->vtx.x, event->vtx.y, event->vtx.z);
04066    if(test <= 0) passfid = 0;
04067    MSG("NueDisplayModule",Msg::kDebug) << "IsFidVtxEvt? " << test
04068        << " Detector type: " << fDetectorType << endl;
04069 
04070   if(foundST)
04071   {
04072      fCut.SetInfoObject(fEvent,st);
04073      if(!fCut.PassesHighEnergyCut()) passeng=0;
04074      if(!fCut.PassesLowEnergyCut()) passeng=0;
04075      if(!fCut.PassesEventPlaneCut()) passeng=0;
04076      if(!fCut.PassesTrackPlaneCut()) passtrk = 0;
04077      if(!fCut.PassesTrackLikePlaneCut()) passtrklike = 0;
04078      if(!fCut.PassesHighShowerEnergyCut()) passshw = 0;
04079      if(!fCut.PassesLowShowerEnergyCut()) passshw = 0;
04080      
04081   }
04082                                                                                 
04083   if(foundSR){
04084       MSG("NueDisplayModule",Msg::kWarning)
04085          << "Unable to Perform Pass Cuts for pre Birch files"<< endl;
04086   }
04087 
04088   if (passfid&&passtrk&&passshw&&passeng&&passtrklike) return true;
04089   else return false;
04090 
04091 }

void NueDisplayModule::plotmc (  )  [private]

Definition at line 4184 of file NueDisplayModule.cxx.

References DrawInteractionDiagram(), fCanvas0, fCanvas1, fCanvas5, fEvent, fHistcolz, fHistPad, fInfo0, foundMC, foundST, foundTH, SntpHelpers::GetEvent2MCIndex(), SntpHelpers::GetStdHepArray(), NtpMCStdHep::IdHEP, info10, info11, info12, info13, info6, info7, info8, info9, kDrawClu, kTestMode, mc, mctruth, mcvtx_u, mcvtx_v, paru, parv, st, NtpStRecord::stdhep, NtpMCRecord::stdhep, th, NtpMCTruth::vtxx, NtpMCTruth::vtxy, and NtpMCTruth::vtxz.

Referenced by fixmcinfo(), showmctruth(), and UpdateDisplay().

04185 {
04186   vector<NtpMCStdHep *> hep;
04187   Int_t index = 0;
04188   if (foundST){
04189     index = SntpHelpers::GetEvent2MCIndex(fEvent,st);
04190     hep = SntpHelpers::GetStdHepArray(index, st);
04191   }
04192   else if (foundMC&&foundTH){
04193     index = SntpHelpers::GetEvent2MCIndex(fEvent,th);
04194     hep = SntpHelpers::GetStdHepArray(index, mc);
04195   }
04196   
04197   vector<double> vtx_u(hep.size());
04198   vector<double> vtx_v(hep.size());
04199   vector<double> vtx_z(hep.size());
04200   vector<double> p_u(hep.size());
04201   vector<double> p_v(hep.size());
04202   vector<double> p_z(hep.size());
04203   vector<double> p_tot(hep.size());
04204   vector<double> k_u(hep.size());
04205   vector<double> k_v(hep.size());
04206   vector<double> epar(hep.size());
04207   vector<int> idhep(hep.size());
04208   vector<int> drawline(hep.size());
04209   
04210   for (int istd = 0; istd < int(hep.size()); istd++){
04211     drawline[istd] = 0;
04212     vtx_u[istd] = (hep[istd]->vtx[0]+hep[istd]->vtx[1])*sqrt(2.)/2;
04213     vtx_v[istd] = (hep[istd]->vtx[1]-hep[istd]->vtx[0])*sqrt(2.)/2;
04214     vtx_z[istd] = hep[istd]->vtx[2];
04215     
04216     p_u[istd] = (hep[istd]->p4[0]+hep[istd]->p4[1])*sqrt(2.)/2;
04217     p_v[istd] = (hep[istd]->p4[1]-hep[istd]->p4[0])*sqrt(2.)/2;
04218     p_z[istd] = hep[istd]->p4[2];
04219     p_tot[istd] = sqrt(p_u[istd]*p_u[istd] + p_v[istd]*p_v[istd] + 
04220                        p_z[istd]*p_z[istd]);
04221     
04222     epar[istd] = hep[istd]->p4[3];
04223     idhep[istd] = abs(hep[istd]->IdHEP);
04224     if (fabs(p_z[istd])>0.) {
04225       k_u[istd] = p_u[istd]/p_z[istd];
04226       k_v[istd] = p_v[istd]/p_z[istd];
04227     }
04228     
04229     bool drawphoton = false;
04230     if (abs(hep[istd]->IdHEP)==22){//photon
04231       NtpMCStdHep* hep_parent = 0;
04232       if (foundST){
04233         hep_parent = 
04234           dynamic_cast<NtpMCStdHep*>((*st->stdhep)[hep[istd]->parent[0]]);
04235       }
04236       else if (foundMC&&foundTH){
04237         hep_parent = 
04238           dynamic_cast<NtpMCStdHep*>((*mc->stdhep)[hep[istd]->parent[0]]);
04239       }
04240       if (abs(hep_parent->IdHEP)!=111) drawphoton = true;
04241     }
04242     //cout<<istd<<" "<<hep[istd]->index<<" "<<hep[istd]->mc<<" "<<hep[istd]->IdHEP<<" "<<hep[istd]->parent[0]<<" "<<hep[istd]->child[0]<<endl;
04243     
04244     //decide what to draw
04245     if((hep[istd]->child[0]==-1 && hep[istd]->child[1]==-1 &&
04246         (hep[istd]->IdHEP) && //IdHEP == 0 means incoming particle???
04247         abs(hep[istd]->IdHEP)<10000 && //only draw particles
04248         (abs(hep[istd]->IdHEP)==22 && drawphoton || abs(hep[istd]->IdHEP)!=22)) || (abs(hep[istd]->IdHEP)==111&&hep[istd]->IstHEP!=14) //draw pi0s and photons that didn't orginate from pi0s
04249        ||abs(hep[istd]->IdHEP)==13)
04250       drawline[istd]=1;
04251   }
04252   
04253   int ipar = 0;
04254   
04255   for (int istd = 0; istd < int(hep.size()); istd++){
04256     if (drawline[istd] == 1){
04257       if (p_tot[istd]){
04258         paru.push_back(new TLine(vtx_z[istd],vtx_u[istd],
04259                                  vtx_z[istd] + (p_z[istd]/p_tot[istd])*epar[istd]/3,
04260                                  vtx_u[istd] + p_u[istd]/p_tot[istd]*epar[istd]/3));
04261         parv.push_back(new TLine(vtx_z[istd],vtx_v[istd],
04262                                  vtx_z[istd] + (p_z[istd]/p_tot[istd])*epar[istd]/3,
04263                                  vtx_v[istd] + p_v[istd]/p_tot[istd]*epar[istd]/3));
04264       }
04265       else {
04266         paru.push_back(new TLine(vtx_z[istd],vtx_u[istd],
04267                                  vtx_z[istd],vtx_u[istd]));
04268         parv.push_back(new TLine(vtx_z[istd],vtx_v[istd],
04269                                  vtx_z[istd],vtx_v[istd]));
04270       }
04271       //cout<<"ipar "<<ipar<<" "<<idhep[istd]<<endl;
04272       if(idhep[istd] == 11) {     //electron
04273         paru[ipar]->SetLineColor(3);
04274         parv[ipar]->SetLineColor(3);
04275       }
04276       else if(idhep[istd] == 13) {//muon
04277         paru[ipar]->SetLineColor(4);
04278         parv[ipar]->SetLineColor(4);
04279       }
04280       else if(idhep[istd] == 15) {//tau
04281         paru[ipar]->SetLineColor(5);
04282         parv[ipar]->SetLineColor(5);
04283       }
04284       else if(idhep[istd] == 211){//pion
04285         paru[ipar]->SetLineColor(6);
04286         parv[ipar]->SetLineColor(6);
04287       }
04288       else if(idhep[istd] == 2212){//proton
04289         paru[ipar]->SetLineColor(2);
04290         parv[ipar]->SetLineColor(2);
04291       }
04292       else if(idhep[istd] == 111) { //pi0
04293         paru[ipar]->SetLineColor(7);
04294         parv[ipar]->SetLineColor(7);
04295       }
04296       else if(idhep[istd] == 22){  //photon
04297         paru[ipar]->SetLineColor(9);
04298         parv[ipar]->SetLineColor(9);
04299       }
04300       else if(idhep[istd] == 2112){//neutron
04301         paru[ipar]->SetLineColor(28);
04302         parv[ipar]->SetLineColor(28);
04303       }
04304       else if(idhep[istd] == 321 || idhep[istd] == 311 || 
04305               idhep[istd] == 310 || idhep[istd] == 130){//kaon
04306         paru[ipar]->SetLineColor(31);
04307         parv[ipar]->SetLineColor(31);
04308       }//anything else will be black
04309       else if(idhep[istd] == 12 || idhep[istd] == 14 ||
04310               idhep[istd] == 16){  //outgoing neutrino
04311         paru[ipar]->SetLineStyle(2); //black, dashed line
04312         parv[ipar]->SetLineStyle(2);
04313       }
04314       ipar++;
04315     }
04316   }
04317 
04318   if(mctruth) {
04319     mcvtx_u->SetY((mctruth->vtxy+mctruth->vtxx)/sqrt(2.));
04320     mcvtx_u->SetX(mctruth->vtxz);
04321   
04322     mcvtx_v->SetY((mctruth->vtxy-mctruth->vtxx)/sqrt(2.));
04323     mcvtx_v->SetX(mctruth->vtxz);
04324   }
04325 
04326   fHistPad->cd(1);
04327   for (int ipar = 0; ipar<int(paru.size()); ipar++){
04328     paru[ipar]->Draw();
04329   }
04330   mcvtx_u->Draw();
04331   gPad->Modified();
04332   
04333   fHistPad->cd(2);
04334   for (int ipar = 0; ipar<int(parv.size()); ipar++){
04335     parv[ipar]->Draw();
04336   }
04337   mcvtx_v->Draw();
04338   gPad->Modified();
04339   
04340   fCanvas0->Update();
04341   
04342   fHistcolz->cd(1);
04343   for (int ipar = 0; ipar<int(paru.size()); ipar++){
04344       paru[ipar]->Draw();
04345   }
04346   mcvtx_u->Draw();
04347   gPad->Modified();
04348   
04349   fHistcolz->cd(2);
04350   for (int ipar = 0; ipar<int(parv.size()); ipar++){
04351     parv[ipar]->Draw();
04352   }
04353   mcvtx_v->Draw();
04354   gPad->Modified();
04355     
04356   fCanvas1->Update();
04357 
04358   if(kDrawClu){
04359     fCanvas5->cd(1);
04360     for (int ipar = 0; ipar<int(paru.size()); ipar++){
04361       paru[ipar]->Draw();
04362     }
04363     mcvtx_u->Draw();
04364     gPad->Modified();
04365     
04366     fCanvas5->cd(4);
04367     for (int ipar = 0; ipar<int(parv.size()); ipar++){
04368       parv[ipar]->Draw();
04369     }
04370     mcvtx_v->Draw();
04371     gPad->Modified();
04372 
04373     fCanvas5->cd(2);
04374     for (int ipar = 0; ipar<int(paru.size()); ipar++){
04375       paru[ipar]->Draw();
04376     }
04377     mcvtx_u->Draw();
04378     gPad->Modified();
04379     
04380     fCanvas5->cd(5);
04381     for (int ipar = 0; ipar<int(parv.size()); ipar++){
04382       parv[ipar]->Draw();
04383     }
04384     mcvtx_v->Draw();
04385     gPad->Modified();
04386     
04387     fCanvas5->Update();
04388   }
04389 
04390   fInfo0->cd();
04391   info6->Draw();
04392   info7->Draw();
04393   info8->Draw();
04394   info9->Draw();
04395   info10->Draw();
04396   info11->Draw();
04397   info12->Draw();
04398   info13->Draw();
04399   gPad->Modified();
04400   fCanvas0->Update();
04401 
04402   if(!kTestMode) DrawInteractionDiagram(index);
04403   
04404   return;
04405 }

void NueDisplayModule::PrevEvent (  )  [private]

Definition at line 4128 of file NueDisplayModule.cxx.

References clickbutton, fEvent, fNumEvents, foundpidmatch, foundvrmatch, gMint, ievtp, iIO, itopo, Mint::Prev(), and UpdateDisplay().

Referenced by BuildDisplay(), and UpdateDisplay().

04128                                 {
04129   clickbutton = -1;
04130   if (iIO){
04131     ievtp = 0;
04132     itopo = 0;
04133   }
04134   if(fNumEvents>0){
04135     fEvent--;
04136     if(fEvent<0){
04137       clickbutton = -2;
04138       gMint->Prev();
04139       return;
04140     }
04141     this->UpdateDisplay(foundvrmatch, foundpidmatch);
04142   }
04143   else {
04144     gMint->Prev();
04145     return;
04146   }
04147 }

void NueDisplayModule::PrevSelEvt (  )  [private]

Definition at line 4853 of file NueDisplayModule.cxx.

References commitr, eventnoitr, evtpcode, fComment, fEvent, fTYPETOPO, gMint, Mint::GoTo(), iEvtp, iIO, iTopo, runnoitr, selecevtp, selectopo, snarlno, snarlnoitr, subrunnoitr, topocode, topoitr, and typeitr.

Referenced by BuildDisplay().

04853                                  {
04854   if (iIO&&snarlno.size()){
04855     /*
04856     cout<<*runnoitr<<" "<<*subrunnoitr<<" "
04857         <<fSnarl<<" "<<fEvent<<" "
04858         <<*snarlnoitr<<" "<<*eventnoitr<<endl;
04859     if(runnoitr<runno.end()&&runnoitr>=runno.begin()&&
04860        subrunnoitr<subrunno.end()&&subrunnoitr>=subrunno.begin()&&
04861        snarlnoitr<snarlno.end()&&snarlnoitr>=snarlno.begin()&&
04862        (fSnarl > *snarlnoitr || fSnarl == *snarlnoitr && 
04863         fEvent > *eventnoitr)){
04864       if ((!selecevtp||iEvtp[*typeitr])&&(!selectopo||iTopo[*topoitr])){
04865         fEvent = *eventnoitr;
04866         ievtp = *typeitr;
04867         itopo = *topoitr;
04868         gMint->GoTo(*runnoitr,*snarlnoitr);
04869         if (*typeitr>=0&&*typeitr<7&&*topoitr>=0&&*topoitr<5){
04870           string tmp = evtpcode[*typeitr] + " | " + topocode[*topoitr];
04871           fTYPETOPO->SetText(tmp.c_str());
04872         }
04873         fComment->SetText((*commitr).c_str());
04874       }
04875     }
04876     else */
04877     if (snarlnoitr != snarlno.begin() && snarlnoitr != snarlno.begin() -1){
04878       runnoitr--;
04879       subrunnoitr--;
04880       snarlnoitr--;
04881       eventnoitr--;
04882       typeitr--;
04883       topoitr--;
04884       commitr--;
04885       if ((!selecevtp||iEvtp[*typeitr])&&(!selectopo||iTopo[*topoitr])){
04886         fEvent = *eventnoitr;
04887         gMint->GoTo(*runnoitr,*snarlnoitr);
04888         if (*typeitr>=0&&*typeitr<7&&*topoitr>=0&&*topoitr<5){
04889           string tmp = evtpcode[*typeitr] + " | " + topocode[*topoitr];
04890           fTYPETOPO->SetText(tmp.c_str());
04891         }
04892         fComment->SetText((*commitr).c_str());
04893       }
04894       else {this->PrevSelEvt();}
04895     }
04896   }
04897 }

void NueDisplayModule::PrintPads (  )  [private]

Definition at line 4496 of file NueDisplayModule.cxx.

References fCanvas0, fCanvas1, fCanvas2, fEvent, fHistcolz, fHistPad, Form(), fReco_plots, fSnarl, RunNo, and SubRunNo.

Referenced by BuildDisplay().

04497 {
04498   fCanvas0->cd();
04499   //fHistPad->Print(Form("Evt_%d_%d_%d_%d.png",RunNo,SubRunNo,fSnarl,fEvent));
04500   fHistPad->Print(Form("Evt_%d_%d_%d_%d.eps",RunNo,SubRunNo,fSnarl,fEvent));
04501   fCanvas1->cd();
04502   fHistcolz->Print(Form("Evt_%d_%d_%d_%d_zoom.eps",RunNo,SubRunNo,fSnarl,fEvent));
04503   //fHistcolz->Print(Form("Evt_%d_%d_%d_%d_zoom.png",RunNo,SubRunNo,fSnarl,fEvent));
04504   fCanvas2->cd();
04505   fReco_plots->Print(Form("Evt_%d_%d_%d_%d_reco.eps",RunNo,SubRunNo,fSnarl,fEvent));
04506 }

void NueDisplayModule::ResetMRGraphs (  )  [private]

Definition at line 5717 of file NueDisplayModule.cxx.

References uzMREventOld, uzMREventOverlay, vzMREventOld, and vzMREventOverlay.

Referenced by GenerateMRMultiGraphs().

05718 {
05719       if(uzMREventOverlay) delete uzMREventOverlay;
05720       if(vzMREventOverlay) delete vzMREventOverlay;
05721                                                                                 
05722       if(uzMREventOld) delete uzMREventOld;
05723       if(vzMREventOld) delete vzMREventOld;
05724                                                                                 
05725       uzMREventOverlay = new TMultiGraph();
05726       uzMREventOverlay->SetName("uzMREventOverlay");
05727       uzMREventOverlay->SetTitle("U vs Z Event View");
05728                                                                                 
05729       vzMREventOverlay = new TMultiGraph();
05730       vzMREventOverlay->SetName("vzMREventOverlay");
05731       vzMREventOverlay->SetTitle("V vs Z Event view");
05732                                                                                 
05733       uzMREventOld = new TMultiGraph();
05734       uzMREventOld->SetName("uzMREventOld");
05735       uzMREventOld->SetTitle("U vs Z MR Strips View");
05736                                                                                 
05737       vzMREventOld = new TMultiGraph();
05738       vzMREventOld->SetName("vzMREventOld");
05739       vzMREventOld->SetTitle("V vs Z MR Strips view");
05740 }

void NueDisplayModule::selec01 (  )  [inline, private]

Definition at line 607 of file NueDisplayModule.h.

References iTopo, and updateselec().

Referenced by BuildDisplay().

00607 { if (!iTopo[1]){iTopo[1]=1;}else{iTopo[1]=0;} updateselec();};

void NueDisplayModule::selec02 (  )  [inline, private]

Definition at line 608 of file NueDisplayModule.h.

References iTopo, and updateselec().

Referenced by BuildDisplay().

00608 { if (!iTopo[2]){iTopo[2]=1;}else{iTopo[2]=0;} updateselec();};

void NueDisplayModule::selec03 (  )  [inline, private]

Definition at line 609 of file NueDisplayModule.h.

References iTopo, and updateselec().

Referenced by BuildDisplay().

00609 { if (!iTopo[3]){iTopo[3]=1;}else{iTopo[3]=0;} updateselec();};

void NueDisplayModule::selec04 (  )  [inline, private]

Definition at line 610 of file NueDisplayModule.h.

References iTopo, and updateselec().

Referenced by BuildDisplay().

00610 { if (!iTopo[4]){iTopo[4]=1;}else{iTopo[4]=0;} updateselec();};

void NueDisplayModule::selec05 (  )  [inline, private]

Definition at line 611 of file NueDisplayModule.h.

References iTopo, and updateselec().

Referenced by BuildDisplay().

00611 { if (!iTopo[0]){iTopo[0]=1;}else{iTopo[0]=0;} updateselec();};

void NueDisplayModule::selec10 (  )  [inline, private]

Definition at line 599 of file NueDisplayModule.h.

References iEvtp, and updateselec().

Referenced by BuildDisplay().

00599 { if (!iEvtp[1]){iEvtp[1]=1;}else{iEvtp[1]=0;} updateselec();};

void NueDisplayModule::selec20 (  )  [inline, private]

Definition at line 600 of file NueDisplayModule.h.

References iEvtp, and updateselec().

Referenced by BuildDisplay().

00600 { if (!iEvtp[2]){iEvtp[2]=1;}else{iEvtp[2]=0;} updateselec();};

void NueDisplayModule::selec30 (  )  [inline, private]

Definition at line 601 of file NueDisplayModule.h.

References iEvtp, and updateselec().

Referenced by BuildDisplay().

00601 { if (!iEvtp[3]){iEvtp[3]=1;}else{iEvtp[3]=0;} updateselec();};

void NueDisplayModule::selec40 (  )  [inline, private]

Definition at line 602 of file NueDisplayModule.h.

References iEvtp, and updateselec().

Referenced by BuildDisplay().

00602 { if (!iEvtp[4]){iEvtp[4]=1;}else{iEvtp[4]=0;} updateselec();};

void NueDisplayModule::selec50 (  )  [inline, private]

Definition at line 603 of file NueDisplayModule.h.

References iEvtp, and updateselec().

Referenced by BuildDisplay().

00603 { if (!iEvtp[5]){iEvtp[5]=1;}else{iEvtp[5]=0;} updateselec();};

void NueDisplayModule::selec60 (  )  [inline, private]

Definition at line 604 of file NueDisplayModule.h.

References iEvtp, and updateselec().

Referenced by BuildDisplay().

00604 { if (!iEvtp[6]){iEvtp[6]=1;}else{iEvtp[6]=0;} updateselec();};

void NueDisplayModule::selec70 (  )  [inline, private]

Definition at line 605 of file NueDisplayModule.h.

References iEvtp, and updateselec().

Referenced by BuildDisplay().

00605 { if (!iEvtp[0]){iEvtp[0]=1;}else{iEvtp[0]=0;} updateselec();};

void NueDisplayModule::SetCuts (  )  [private]

Definition at line 4093 of file NueDisplayModule.cxx.

References fCuts, and preselec.

Referenced by BuildDisplay().

04093                               { 
04094   if (preselec==1){ 
04095     fCuts->SetText("Cuts: OFF"); 
04096     preselec=0;
04097     fCuts->SetDown(false);
04098   }
04099   else if (preselec==0){ 
04100     fCuts->SetText("Cuts:  ON"); 
04101     preselec=1;
04102     fCuts->SetDown(true);
04103   }
04104 }

void NueDisplayModule::SetFrame ( TMultiGraph *  mg  )  [private]

Definition at line 5798 of file NueDisplayModule.cxx.

References fDetectorType, Detector::kFar, and Detector::kNear.

05799 {
05800       if(mg == 0) return;
05801 
05802       TGraph* temp = 0;
05803                                                                                 
05804       Float_t FarShell[2] = {-4.0, 4.0};
05805       Float_t FarShellZ[2] = {0.0, 30.0};
05806                                                                                 
05807       Float_t NearShell[2] = {-3.0, 3.0};
05808       Float_t NearShellZ[2] = {0.0, 16.0};
05809 
05810       if(fDetectorType == Detector::kNear)
05811           temp = new TGraph(2,NearShellZ,NearShell);
05812 
05813       if(fDetectorType == Detector::kFar)
05814           temp = new TGraph(2,FarShellZ,FarShell);
05815 
05816       temp->SetName("frame");
05817       temp->SetMarkerSize(0);
05818       temp->SetMarkerStyle(1);
05819       mg->Add(temp);
05820 }

void NueDisplayModule::SetMode (  )  [private]

Definition at line 4700 of file NueDisplayModule.cxx.

References eventcomm, eventno, eventtopo, eventtype, fFileEnt, fFileR, fFileW, fIO, Form(), fTYPETOPO, hitlog, icomm, ievtp, iFileW, iIO, itopo, outfile, runno, RunNo, snarlno, subrunno, SubRunNo, and updateEncoded().

Referenced by BuildDisplay().

04700                               {
04701   if (!iIO){ 
04702     fIO->SetText("Read"); 
04703     iIO = 1;
04704     fIO->SetDown(true);
04705     if (iFileW){
04706       if (!icomm && hitlog) outfile<<endl;
04707       outfile<<endl;
04708       outfile.close();
04709       hitlog = 0;
04710       icomm = 0;
04711       ievtp = 0;
04712       itopo = 0;
04713       this->updateEncoded();
04714       iFileW = 0;
04715       fFileW->SetText("");
04716     }
04717     string setfilename;
04718     string sRunNumber=Form("%d",RunNo);
04719     string sRunNumberSub=Form("%d",SubRunNo);
04720     setfilename = "PID-"+sRunNumber+"_"+sRunNumberSub;
04721     
04722     ifstream Test(setfilename.c_str());
04723     if(Test){
04724       fFileEnt->SetText(setfilename.c_str());
04725     }
04726   }
04727   else { 
04728     fIO->SetText("Write"); 
04729     iIO = 0;
04730     fIO->SetDown(false);
04731     fFileEnt->Clear();
04732     fFileR->SetText("");
04733     fFileW->SetText("");
04734     if (iFileW){
04735       if (!icomm && hitlog) outfile<<endl;
04736       outfile<<endl;
04737       outfile.close();
04738       hitlog = 0;
04739       iFileW = 0;
04740     }
04741     fTYPETOPO->SetText("");
04742 
04743     runno.clear();
04744     subrunno.clear();
04745     snarlno.clear();
04746     eventno.clear();
04747     eventtype.clear();
04748     eventtopo.clear();
04749     eventcomm.clear();
04750     
04751   }
04752 }

void NueDisplayModule::SetUpStripButtons (  )  [private]

Definition at line 5240 of file NueDisplayModule.cxx.

References fCanvas7, fIntRecoLineU, fIntRecoLineV, fSelectPad1, fSelectPad2, fStpIndexMapU, fStpIndexMapV, fStripButtonU, fStripButtonV, fUZcolz, fVZcolz, and max.

Referenced by BuildDisplay(), and GetEvent().

05240                                         {
05241 
05242   for(UInt_t i=0;i<fStripButtonU.size();i++){
05243     delete fStripButtonU[i];
05244   }
05245   fStripButtonU.clear();
05246   for(UInt_t i=0;i<fStripButtonV.size();i++){
05247     delete fStripButtonV[i];
05248   }
05249   fStripButtonV.clear();
05250 
05251   Int_t nbinsx = fUZcolz->GetNbinsX();
05252   Float_t binwidthx = 1./Float_t(nbinsx);
05253   Int_t nbinsy = fUZcolz->GetNbinsY();
05254   Float_t binwidthy = 1./Float_t(nbinsy);
05255   Float_t max = fUZcolz->GetMaximum();
05256   Float_t minChargeUZ = 0;
05257   if(fUZcolz->GetMinimum()>minChargeUZ) minChargeUZ = fUZcolz->GetMinimum();
05258   Float_t minChargeVZ = 0;
05259   if(fVZcolz->GetMinimum()>minChargeVZ) minChargeVZ = fVZcolz->GetMinimum();
05260 
05261   Int_t ncol = gStyle->GetNumberOfColors();
05262 
05263   fSelectPad1->cd();
05264   for(int i=1;i<=nbinsx;i++){
05265     for(int j=1;j<=nbinsy;j++){
05266       if(fUZcolz->GetBinContent(i,j)>minChargeUZ){
05267         char name[256];
05268         sprintf(name,"stpbut_%i_",fStpIndexMapU[fUZcolz->GetBin(i,j)]);
05269         char command[256];
05270         sprintf(command,"fSelPad1->cd(); TButton *but = (TButton*) gPad->FindObject(\"%s\"); if(but->GetFillColor()==11) but->SetFillColor(but->GetLineColor()); else but->SetFillColor(11);",name);
05271         TButton *temp_but = new TButton("",command,
05272                                         0.025 + 0.95*float(i-1)*binwidthx,
05273                                         0.025 + 0.95*float(j-1)*binwidthy,
05274                                         0.025 + 0.95*float(i)*binwidthx,
05275                                         0.025 + 0.95*float(j)*binwidthy);
05276         temp_but->SetName(name);
05277         Float_t col_val = 0;
05278         if(max!=0) col_val = fUZcolz->GetBinContent(i,j)*float(ncol)/max;
05279         temp_but->SetFillColor(gStyle->GetColorPalette(Int_t(col_val)));
05280         temp_but->SetLineColor(gStyle->GetColorPalette(Int_t(col_val)));
05281         fStripButtonU.push_back(temp_but);
05282       }
05283     }
05284   }
05285   if(!fIntRecoLineU){
05286     fIntRecoLineU = new TArrow(0,0,1,1,0.015,"|>");
05287   }
05288   Int_t zVtxBin = fUZcolz->GetXaxis()->FindBin(event->vtx.z);
05289   Int_t tVtxBin = fUZcolz->GetYaxis()->FindBin(event->vtx.u);
05290   fIntRecoLineU->SetX1(0.025+0.95*float(zVtxBin-0.5)*binwidthx+0.95*binwidthx*
05291                        (event->vtx.z - 
05292                         fUZcolz->GetXaxis()->GetBinCenter(zVtxBin)) / 
05293                        fUZcolz->GetXaxis()->GetBinWidth(zVtxBin) );  
05294   fIntRecoLineU->SetY1(0.025+0.95*float(tVtxBin-0.5)*binwidthy+0.95*binwidthy*
05295                        (event->vtx.u - 
05296                         fUZcolz->GetYaxis()->GetBinCenter(tVtxBin)) / 
05297                        fUZcolz->GetYaxis()->GetBinWidth(tVtxBin) );
05298   fIntRecoLineU->SetX2(0.95);
05299   fIntRecoLineU->SetY2(fIntRecoLineU->GetY1());
05300 
05301   nbinsx = fVZcolz->GetNbinsX();
05302   binwidthx = 1./Float_t(nbinsx);
05303   nbinsy = fVZcolz->GetNbinsY();
05304   binwidthy = 1./Float_t(nbinsy);
05305   max = fVZcolz->GetMaximum();
05306 
05307   fSelectPad2->cd();
05308   for(int i=1;i<=nbinsx;i++){
05309     for(