UserHist Class Reference

#include <UserHist.h>

List of all members.

Public Member Functions

 UserHist ()
 UserHist (Mint *mint)
 ~UserHist ()
AltTimeHistGetAltTimeHist ()
TPad * GetAltTimePad ()
void Refresh (UserHistType::UserHist_t type)

Private Attributes

TPad * fTimePad
TPad * fAltTimePad
TPad * fTimevsYPad
TPad * fTimevsZPad
TimeHistfTimeHst
AltTimeHistfAltTimeHst
TGraph * fTimevsY
TGraph * fTimevsZ
MintfMint


Detailed Description

Id
UserHist.h,v 1.3 2003/11/07 17:47:47 musser Exp

Definition at line 31 of file UserHist.h.


Constructor & Destructor Documentation

UserHist::UserHist (  ) 

Definition at line 55 of file UserHist.cxx.

00055                   {
00056 }

UserHist::UserHist ( Mint mint  ) 

Definition at line 58 of file UserHist.cxx.

References fAltTimeHst, fAltTimePad, fMint, fTimeHst, fTimePad, fTimevsY, fTimevsYPad, fTimevsZ, fTimevsZPad, AltTimeHist::GetAltTimePad(), TimeHist::SetMint(), and AltTimeHist::SetMint().

00058                             {
00059   // include a pad for each histogram type, at the same location
00060   fMint=mint;
00061 
00062   fTimePad = new TPad("Time Hist", "Time Hist", 0.42,0.25,0.75,0.44);
00063   fTimevsYPad = new TPad("TimevsY", "TimevsY", 0.42,0.25,0.75,0.44);
00064   fTimevsZPad = new TPad("TimevsZ", "TimevsZ", 0.42,0.25,0.75,0.44);
00065 
00066   fTimevsZPad->Draw();
00067   fTimevsYPad->Draw();
00068   fTimePad->Draw();
00069 
00070   fAltTimeHst = new AltTimeHist();
00071   fAltTimeHst->SetMint(fMint);
00072   fAltTimePad=fAltTimeHst->GetAltTimePad();
00073 
00074   fTimePad->cd();
00075   fTimeHst = new TimeHist();
00076   fTimeHst->SetMint(fMint);
00077  
00078   fTimevsYPad->cd();
00079   fTimevsY=new TGraph();
00080 
00081   fTimevsZPad->cd();
00082   fTimevsZ=new TGraph();
00083 
00084 }

UserHist::~UserHist (  ) 

Definition at line 86 of file UserHist.cxx.

00086 {}


Member Function Documentation

AltTimeHist* UserHist::GetAltTimeHist (  )  [inline]

Definition at line 49 of file UserHist.h.

References fAltTimeHst.

Referenced by EVD::Update().

00049 {return fAltTimeHst;}

TPad* UserHist::GetAltTimePad (  )  [inline]

Definition at line 50 of file UserHist.h.

References fAltTimePad.

00050 {return fAltTimePad;}

void UserHist::Refresh ( UserHistType::UserHist_t  type  ) 

Definition at line 89 of file UserHist.cxx.

References fAltTimeHst, fAltTimePad, fMint, fTimeHst, fTimePad, fTimevsY, fTimevsYPad, fTimevsZ, fTimevsZPad, CandHandle::GetDaughterIterator(), Mint::GetDigits(), Mint::GetJobC(), CandHandle::GetNDaughters(), DataUtil::GetRunSnarlEvent(), Mint::GetTracks(), UserHistType::kAltTimeHist, StripEnd::kNegative, StripEnd::kPositive, UserHistType::kTimeHist, UserHistType::kTimevsY, UserHistType::kTimevsZ, JobC::Mom, nTracks, AltTimeHist::Refresh(), TimeHist::Refresh(), and run().

Referenced by EVD::Update().

00089                                                      {
00090   switch (HistType){
00091   case UserHistType::kTimeHist:
00092     {
00093       if(!fMint)return;
00094       fTimePad->cd();  
00095       fTimePad->Pop();
00096       const CandDigitListHandle * digitlisthandle = fMint->GetDigits();
00097       if(digitlisthandle){
00098         if(digitlisthandle->GetNDaughters()>1){
00099           fTimeHst->Refresh();
00100           fTimePad->Modified();
00101         }
00102       }
00103     }
00104     break;
00105   case UserHistType::kAltTimeHist:
00106     {
00107       if(!fMint)return;
00108       fAltTimePad->cd();  
00109       fAltTimePad->Pop();
00110       const CandDigitListHandle * digitlisthandle = fMint->GetDigits();
00111       if(digitlisthandle){
00112         if(digitlisthandle->GetNDaughters()>1){
00113           fAltTimeHst->Refresh();
00114           fAltTimePad->Modified();
00115         }
00116       }
00117     }
00118     break;
00119   case UserHistType::kTimevsY:
00120     {
00121       fTimevsYPad->cd();
00122       fTimevsYPad->Pop();
00123       fTimevsYPad->Clear();
00124       if(!fMint) return;
00125       
00126       int run=0, snarl=0, event=0;
00127       DataUtil::GetRunSnarlEvent(&(fMint->GetJobC().Mom), run, snarl, event);
00128       
00129       int nTracks=0;
00130       
00131       const CandTrackListHandle* tracklisthandle = fMint->GetTracks();
00132       if (tracklisthandle) {
00133         nTracks=tracklisthandle->GetNDaughters(); 
00134       }
00135       
00136       Int_t arrayCtr = 0;
00137       Double_t minTime = 1.e20;
00138       Int_t MaxCnt=198;
00139       Double_t timeAv[200];
00140       Double_t yPos[200];
00141       
00142       if (tracklisthandle) 
00143         {
00144           TIter trackItr(tracklisthandle->GetDaughterIterator());
00145           CandTrackHandle *track = dynamic_cast<CandTrackHandle*>(trackItr());
00146           if(track){
00147             TIter titr(track->GetDaughterIterator());
00148             while (CandStripHandle* csh = dynamic_cast<CandStripHandle*>(titr())){ 
00149               
00150               Int_t plane = csh->GetPlane();
00151               Double_t time[2];
00152               
00153               if(csh->GetNDigit() == 2){
00154                 
00155                 time[0] = track->GetT(plane,StripEnd::kNegative)- track->GetVtxT();
00156                 time[1] = track->GetT(plane,StripEnd::kPositive)- track->GetVtxT();
00157                 
00158                 if(time[0] < minTime) minTime = time[0];
00159                 if(time[1] < minTime) minTime = time[1];
00160                 
00161                 //have a point for each end of the strip
00162                 timeAv[arrayCtr] = 1.e9*time[0];
00163                 //trk_stpds is the distance from the strip to the *END* of the track
00164                 yPos[arrayCtr] = 0.707*(track->GetU(plane)+track->GetV(plane));
00165                 
00166                 timeAv[arrayCtr+1] = 1.e9*time[1];
00167                 yPos[arrayCtr+1] =  0.707*(track->GetU(plane)+track->GetV(plane));
00168                 if(arrayCtr<MaxCnt) arrayCtr += 2;
00169                 
00170               } // end if the strip had double sided readout
00171             } // end loop over strips in the track
00172             
00173             for(Int_t ti = 0; ti< arrayCtr; ++ti){
00174               timeAv[ti] -= 1.e9*minTime;
00175             }
00176             if(arrayCtr>0){
00177               fTimevsY->Delete();
00178               fTimevsY = new TGraph(arrayCtr, yPos, timeAv);
00179               fTimevsY->SetTitle("Time vs Y"); 
00180               fTimevsY->SetMarkerSize(0.5);
00181               fTimevsY->SetMarkerColor(2);
00182               fTimevsY->SetMarkerStyle(8);
00183               fTimevsY->Draw("A*");
00184             }
00185           }
00186         }
00187       fTimevsYPad->Modified();
00188     }
00189     break;
00190   case UserHistType::kTimevsZ:
00191     {
00192       fTimevsZPad->cd();
00193       fTimevsZPad->Pop();
00194       fTimevsZPad->Clear();
00195       if(!fMint) return;
00196       
00197       int run=0, snarl=0, event=0;
00198       DataUtil::GetRunSnarlEvent(&(fMint->GetJobC().Mom), run, snarl, event);
00199       
00200       int nTracks=0;
00201       
00202       const CandTrackListHandle* tracklisthandle = fMint->GetTracks();
00203       if (tracklisthandle) {
00204         nTracks=tracklisthandle->GetNDaughters(); 
00205       }
00206       
00207       Int_t arrayCtr = 0;
00208       Double_t minTime = 1.e20;
00209       Int_t MaxCnt=198;
00210       Double_t timeAv[200];
00211       Double_t zPos[200];
00212       
00213       if (tracklisthandle) 
00214         {
00215           TIter trackItr(tracklisthandle->GetDaughterIterator());
00216           CandTrackHandle *track = dynamic_cast<CandTrackHandle*>(trackItr());
00217           if(track){
00218             TIter titr(track->GetDaughterIterator());
00219             while (CandStripHandle* csh = dynamic_cast<CandStripHandle*>(titr())){ 
00220               
00221               Int_t plane = csh->GetPlane();
00222               Double_t time[2];
00223               
00224               if(csh->GetNDigit() == 2){
00225                 
00226                 time[0] = track->GetT(plane,StripEnd::kNegative)- track->GetVtxT();
00227                 time[1] = track->GetT(plane,StripEnd::kPositive)- track->GetVtxT();
00228                 
00229                 if(time[0] < minTime) minTime = time[0];
00230                 if(time[1] < minTime) minTime = time[1];
00231                 
00232                 //have a point for each end of the strip
00233                 timeAv[arrayCtr] = 1.e9*time[0];
00234                 //trk_stpds is the distance from the strip to the *END* of the track
00235                 zPos[arrayCtr] = track->GetZ(plane);
00236                 
00237                 timeAv[arrayCtr+1] = 1.e9*time[1];
00238                 zPos[arrayCtr+1] =  track->GetZ(plane);
00239                 if(arrayCtr<MaxCnt) arrayCtr += 2;
00240                 
00241               } // end if the strip had double sided readout
00242             } // end loop over strips in the track
00243             
00244             for(Int_t ti = 0; ti< arrayCtr; ++ti){
00245               timeAv[ti] -= 1.e9*minTime;
00246             }
00247             if(arrayCtr>0){
00248               fTimevsZ->Delete();
00249               fTimevsZ = new TGraph(arrayCtr, zPos, timeAv);
00250               fTimevsZ->SetMarkerSize(0.5);
00251               fTimevsZ->SetMarkerColor(2);
00252               fTimevsZ->SetMarkerStyle(8);
00253 
00254               fTimevsZ->SetTitle("Time vs Z"); 
00255               fTimevsZ->Draw("A*");
00256             }
00257           }
00258         }
00259       fTimevsZPad->Modified();
00260       break;
00261     }
00262   }
00263 }


Member Data Documentation

AltTimeHist* UserHist::fAltTimeHst [private]

Definition at line 39 of file UserHist.h.

Referenced by GetAltTimeHist(), Refresh(), and UserHist().

TPad* UserHist::fAltTimePad [private]

Definition at line 35 of file UserHist.h.

Referenced by GetAltTimePad(), Refresh(), and UserHist().

Mint* UserHist::fMint [private]

Definition at line 43 of file UserHist.h.

Referenced by Refresh(), and UserHist().

TimeHist* UserHist::fTimeHst [private]

Definition at line 38 of file UserHist.h.

Referenced by Refresh(), and UserHist().

TPad* UserHist::fTimePad [private]

Definition at line 34 of file UserHist.h.

Referenced by Refresh(), and UserHist().

TGraph* UserHist::fTimevsY [private]

Definition at line 40 of file UserHist.h.

Referenced by Refresh(), and UserHist().

TPad* UserHist::fTimevsYPad [private]

Definition at line 36 of file UserHist.h.

Referenced by Refresh(), and UserHist().

TGraph* UserHist::fTimevsZ [private]

Definition at line 41 of file UserHist.h.

Referenced by Refresh(), and UserHist().

TPad* UserHist::fTimevsZPad [private]

Definition at line 37 of file UserHist.h.

Referenced by Refresh(), and UserHist().


The documentation for this class was generated from the following files:
Generated on Mon Aug 11 01:07:06 2014 for loon by  doxygen 1.4.7