NtpCandTrack Class Reference

#include <NtpCandTrack.h>

Inheritance diagram for NtpCandTrack:
NtpCandReco CandTrackSRNtuple

List of all members.

Public Member Functions

 NtpCandTrack ()
 NtpCandTrack (const CandTrackHandle &track)
virtual ~NtpCandTrack ()
virtual std::ostream & Print (std::ostream &os) const
virtual void Print (Option_t *option="") const
virtual Double_t GetMomentum () const
virtual void Clear (Option_t *="")
virtual void AddStripAt (Int_t stripindex, Int_t ind)

Protected Attributes

Double_t fMomentum
Int_t fNStrip
Int_t * fStripInd

Detailed Description

Definition at line 20 of file NtpCandTrack.h.


Constructor & Destructor Documentation

NtpCandTrack::NtpCandTrack (  )  [inline]

Definition at line 24 of file NtpCandTrack.h.

00024 : fMomentum(-1),fNStrip(0),fStripInd(0) {}  // def const'r

NtpCandTrack::NtpCandTrack ( const CandTrackHandle track  ) 

Definition at line 22 of file NtpCandTrack.cxx.

00022                                                        : 
00023               NtpCandReco(track),fMomentum(-1),fNStrip(0),fStripInd(0) {
00024   //
00025   //  Purpose:  Constructor creates an ntuple from an existing CandTrack.
00026   //
00027   //  Arguments: reference to CandTrack (or derived class) object.
00028   //
00029   //  Return:  n/a.
00030   //
00031   //  Contact:   S. Kasahara
00032   // 
00033 
00034   fMomentum = track.GetMomentum();
00035   fNStrip   = track.GetNStrip();
00036   if ( fNStrip ) {
00037     fStripInd = new Int_t[fNStrip];
00038     // Initialize all indices to -1
00039     for (Int_t i = 0; i < fNStrip; i++ ) fStripInd[i] = -1;
00040   }
00041 }

virtual NtpCandTrack::~NtpCandTrack (  )  [inline, virtual]

Definition at line 27 of file NtpCandTrack.h.

References fStripInd.

00027 { if (fStripInd) delete [] fStripInd; }


Member Function Documentation

void NtpCandTrack::AddStripAt ( Int_t  stripindex,
Int_t  ind 
) [virtual]

Definition at line 43 of file NtpCandTrack.cxx.

References fNStrip, and fStripInd.

Referenced by DemoCandNtpModule::Reco().

00043                                                          {
00044   //
00045   //  Purpose:  Add stripindex to fStripInd array at position ind.
00046   //
00047   //  Arguments: stripindex: index of strip in assoc fStrips TClonesArray. 
00048   //             ind: index in fStripInd array, cannot exceed bounds
00049   //                  0->fNStrip-1.
00050   //
00051   //  Return:  n/a.
00052   //
00053   //  Contact:   S. Kasahara
00054   // 
00055 
00056   if ( ind < 0 || ind >= fNStrip ) return;  // should print warning
00057     
00058   fStripInd[ind] = stripindex;
00059   return;
00060     
00061 }

virtual void NtpCandTrack::Clear ( Option_t *  = ""  )  [inline, virtual]

Reimplemented in CandTrackSRNtuple.

Definition at line 35 of file NtpCandTrack.h.

References fStripInd.

00035                                                   { if ( fStripInd ) 
00036                             delete [] fStripInd; fStripInd = 0; }

virtual Double_t NtpCandTrack::GetMomentum (  )  const [inline, virtual]

Definition at line 32 of file NtpCandTrack.h.

References fMomentum.

00032 { return fMomentum; }

void NtpCandTrack::Print ( Option_t *  option = ""  )  const [virtual]

Reimplemented from NtpCandReco.

Definition at line 83 of file NtpCandTrack.cxx.

References Print().

00083                                                      {
00084   //
00085   //  Purpose:  Print track in form supported by TObject::Print.
00086   //
00087   //  Arguments: option (not used)
00088   //
00089   //  Return:  none.
00090   //
00091   //  Contact:   S. Kasahara
00092   // 
00093   //  Notes:This version is required because overridden Print(std::ostream& os)
00094   //        hides base class version of this method.
00095   // 
00096 
00097   Print(std::cout);
00098   return;
00099 
00100 }

std::ostream & NtpCandTrack::Print ( std::ostream &  os  )  const [virtual]

Reimplemented from NtpCandReco.

Reimplemented in CandTrackSRNtuple.

Definition at line 64 of file NtpCandTrack.cxx.

References fMomentum, and fNStrip.

Referenced by Print().

00064                                                     {
00065   //
00066   //  Purpose:  Print status of ntuple record on ostream.
00067   //
00068   //  Arguments: os ostream to display on.
00069   //
00070   //  Return:  ostream reference.
00071   //
00072   //  Contact:   S. Kasahara
00073   // 
00074 
00075   os << "Momentum " << fMomentum << ", " 
00076      << "NStrip " << fNStrip << " associated strips." << endl;
00077   
00078 
00079   return os;
00080 
00081 }


Member Data Documentation

Double_t NtpCandTrack::fMomentum [protected]

Definition at line 41 of file NtpCandTrack.h.

Referenced by GetMomentum(), and Print().

Int_t NtpCandTrack::fNStrip [protected]

Definition at line 42 of file NtpCandTrack.h.

Referenced by AddStripAt(), and Print().

Int_t* NtpCandTrack::fStripInd [protected]

Definition at line 43 of file NtpCandTrack.h.

Referenced by AddStripAt(), Clear(), and ~NtpCandTrack().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1