NtpTrackAD Class Reference

#include <NtpTrackAD.h>

List of all members.

Public Member Functions

void LoadEvent (NtpStRecord *ntpRecord, Int_t ievent)
Bool_t FoundIntersection ()
Double_t GetX ()
Double_t GetY ()
Double_t GetZ ()

Static Public Member Functions

static NtpTrackADInstance ()

Private Member Functions

 NtpTrackAD ()
 ~NtpTrackAD ()
void Reset ()

Private Attributes

Bool_t fFoundIntersection
Double_t fX
Double_t fY
Double_t fZ

Detailed Description

Definition at line 8 of file NtpTrackAD.h.


Constructor & Destructor Documentation

NtpTrackAD::NtpTrackAD (  )  [private]

Definition at line 26 of file NtpTrackAD.cxx.

References Reset().

00027 {
00028   Reset();
00029 }

NtpTrackAD::~NtpTrackAD (  )  [private]

Definition at line 31 of file NtpTrackAD.cxx.

00032 {
00033 
00034 }


Member Function Documentation

Bool_t NtpTrackAD::FoundIntersection (  )  [inline]

Definition at line 17 of file NtpTrackAD.h.

References fFoundIntersection.

Referenced by NtpTimingNtuple::Fill().

00017 { return fFoundIntersection; }

Double_t NtpTrackAD::GetX ( void   )  [inline]

Definition at line 19 of file NtpTrackAD.h.

References fX.

Referenced by NtpTimingNtuple::Fill().

00019 { return fX; }

Double_t NtpTrackAD::GetY ( void   )  [inline]

Definition at line 20 of file NtpTrackAD.h.

References fY.

Referenced by NtpTimingNtuple::Fill().

00020 { return fY; }

Double_t NtpTrackAD::GetZ (  )  [inline]

Definition at line 21 of file NtpTrackAD.h.

References fZ.

Referenced by NtpTimingNtuple::Fill().

00021 { return fZ; }

NtpTrackAD * NtpTrackAD::Instance ( void   )  [static]

Definition at line 17 of file NtpTrackAD.cxx.

Referenced by NtpTimingNtuple::Fill().

00018 {
00019   if( !fgNtpTrackAD ){
00020     fgNtpTrackAD = new NtpTrackAD();
00021   }
00022 
00023   return fgNtpTrackAD;
00024 }

void NtpTrackAD::LoadEvent ( NtpStRecord ntpRecord,
Int_t  ievent 
)

Definition at line 45 of file NtpTrackAD.cxx.

References NtpStRecord::evt, NtpStRecord::evthdr, fFoundIntersection, fX, fY, fZ, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), RecHeader::GetVldContext(), Detector::kFar, NtpSREventSummary::nevent, NtpSRTrack::nstrip, NtpSelection::PassFail(), NtpSRStrip::plane, NtpSelection::PrimaryTrack(), Reset(), NtpStRecord::stp, NtpSRTrack::stp, NtpSRTrack::stpx, NtpSRTrack::stpy, NtpSRTrack::stpz, and NtpStRecord::trk.

Referenced by NtpTimingNtuple::Fill().

00046 {
00047   Reset();
00048 
00049   if( NtpSelection::PassFail( ntpRecord, ievent )==0 ){
00050     return;
00051   }
00052 
00053   // get event
00054   Int_t nevent = ntpRecord->evthdr.nevent;
00055   if( nevent<=0 ){
00056     return;
00057   }
00058 
00059   TClonesArray* eventArray  = (TClonesArray*)(ntpRecord->evt);
00060 
00061   if( ievent<0 || ievent>eventArray->GetLast() ){
00062     return;
00063   }
00064 
00065   // primary track
00066   TClonesArray* trackArray  = (TClonesArray*)(ntpRecord->trk);
00067 
00068   Int_t primtrkid = NtpSelection::PrimaryTrack( ntpRecord, ievent );
00069 
00070   if( primtrkid<0 ){
00071     return;
00072   }
00073 
00074   NtpSRTrack* track = (NtpSRTrack*)(trackArray->At(primtrkid));
00075 
00076 
00077   // Far Detector
00078   if( ntpRecord->GetHeader().GetVldContext().GetDetector() == Detector::kFar ){
00079 
00080     // Transverse Position of AD in Far Detector
00081     Float_t CenterX   = -1.4;
00082     Float_t CenterY   = -1.5;
00083     Float_t HalfWidth = 0.58/2.0;
00084 
00085     // Code from Jeff de J. for finding tracks that
00086     // cross the supermodule gap in the far detector
00087     Bool_t HitGap[2]={false,false};
00088     Float_t xgap[2]={2*0},ygap[2]={2*0},zgap[2]={2*0};
00089 
00090     // Loop over track strips
00091     for( Int_t istp=0; istp<track->nstrip; istp++ ) {
00092       Int_t element = track->stp[istp];
00093                
00094       // what is the plane and strip of this hit?
00095       const NtpSRStrip* ntpstrip = dynamic_cast<NtpSRStrip*>(ntpRecord->stp->At(element));
00096       Int_t ThisPlane = ntpstrip->plane;
00097       // Int_t ThisStrip = ntpstrip->strip;
00098 
00099       // What is the reconstructed hit position
00100       Float_t stpx = track->stpx[istp];
00101       Float_t stpy = track->stpy[istp];
00102       Float_t stpz = track->stpz[istp];
00103       
00104       // Note that plane 249 corresponse to the supermodule gap
00105       // so plane 248 is in SM1 and plane 250 is in SM2
00106       if( ThisPlane==248 && !HitGap[0] ) {
00107         HitGap[0] = true;
00108         xgap[0]   = stpx;
00109         ygap[0]   = stpy;
00110         zgap[0]   = stpz;
00111       }
00112       if( ThisPlane==250 && !HitGap[1] ){
00113         HitGap[1] = true;
00114         xgap[1]   = stpx;
00115         ygap[1]   = stpy;
00116         zgap[1]   = stpz;
00117       }
00118     }
00119              
00120     // Have found intersection
00121     if( HitGap[0] && HitGap[1] ) {
00122                      
00123       fX = 0.5*(xgap[0]+xgap[1]);
00124       fY = 0.5*(ygap[0]+ygap[1]);
00125       fZ = 0.5*(zgap[0]+zgap[1]);
00126               
00127       if( fabs(fX-CenterX)<1.5*HalfWidth 
00128        && fabs(fY-CenterY)<1.5*HalfWidth ) {
00129         fFoundIntersection = 1;
00130       }
00131     }
00132 
00133   }
00134 
00135   return;
00136 }

void NtpTrackAD::Reset (  )  [private]

Definition at line 36 of file NtpTrackAD.cxx.

References fFoundIntersection, fX, fY, and fZ.

Referenced by LoadEvent(), and NtpTrackAD().

00037 {
00038   fFoundIntersection = 0;
00039 
00040   fX = -999.9;
00041   fY = -999.9;
00042   fZ = -999.9;
00043 }


Member Data Documentation

Definition at line 30 of file NtpTrackAD.h.

Referenced by FoundIntersection(), LoadEvent(), and Reset().

Double_t NtpTrackAD::fX [private]

Definition at line 32 of file NtpTrackAD.h.

Referenced by GetX(), LoadEvent(), and Reset().

Double_t NtpTrackAD::fY [private]

Definition at line 33 of file NtpTrackAD.h.

Referenced by GetY(), LoadEvent(), and Reset().

Double_t NtpTrackAD::fZ [private]

Definition at line 34 of file NtpTrackAD.h.

Referenced by GetZ(), LoadEvent(), and Reset().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1