NtpCandEvent Class Reference

#include <NtpCandEvent.h>

List of all members.

Public Member Functions

 NtpCandEvent ()
 NtpCandEvent (const CandEventHandle &event)
virtual ~NtpCandEvent ()
virtual std::ostream & Print (std::ostream &os) const
virtual void Print (Option_t *option="") const
virtual Int_t GetNTrack () const
virtual Int_t GetNShower () const
virtual void AddTrackAt (Int_t trackindex, Int_t ind)
virtual void AddShowerAt (Int_t showerindex, Int_t ind)
virtual void Clear (Option_t *="")

Protected Attributes

Int_t fNTrack
Int_t * fTrackInd
Int_t fNShower
Int_t * fShowerInd

Detailed Description

Definition at line 21 of file NtpCandEvent.h.


Constructor & Destructor Documentation

NtpCandEvent::NtpCandEvent (  )  [inline]

Definition at line 25 of file NtpCandEvent.h.

00025 : fNTrack(0),fTrackInd(0),fNShower(0),fShowerInd(0) {}//def

NtpCandEvent::NtpCandEvent ( const CandEventHandle event  ) 

Definition at line 25 of file NtpCandEvent.cxx.

References fNShower, fNTrack, fShowerInd, and fTrackInd.

00025                                                        :
00026     fNTrack(0), fTrackInd(0), fNShower(0), fShowerInd(0) {
00027   //
00028   //  Purpose:  Constructor creates an ntuple from an existing CandEvent.
00029   //
00030   //  Arguments: reference to CandEvent (or derived class) object.
00031   //
00032   //  Return:  n/a.
00033   //
00034   //  Contact:   S. Kasahara
00035   // 
00036 
00037   fNTrack  = event.GetLastTrack()+1;
00038   if ( fNTrack ) {
00039     fTrackInd = new Int_t[fNTrack];
00040     // Initialize all indices to -1
00041     for (Int_t i = 0; i < fNTrack; i++ ) fTrackInd[i] = -1;
00042   }
00043 
00044   fNShower = event.GetLastShower()+1;
00045   if ( fNShower ) {
00046     fShowerInd = new Int_t[fNShower];
00047     // Initialize all indices to -1
00048     for (Int_t i = 0; i < fNShower; i++ ) fShowerInd[i] = -1;
00049   }
00050 
00051 }

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

Definition at line 27 of file NtpCandEvent.h.

References fShowerInd, and fTrackInd.

00027                            { if (fTrackInd) delete [] fTrackInd;
00028                               if (fShowerInd) delete [] fShowerInd; }


Member Function Documentation

void NtpCandEvent::AddShowerAt ( Int_t  showerindex,
Int_t  ind 
) [virtual]

Definition at line 73 of file NtpCandEvent.cxx.

References fNShower, and fShowerInd.

Referenced by DemoCandNtpModule::Reco().

00073                                                            {
00074   //
00075   //  Purpose:  Add showerindex to fShowerInd array at position ind.
00076   //
00077   //  Arguments: showerindex: index of shower in assoc fShowers TClonesArray. 
00078   //             ind: index in fShowerInd array, cannot exceed bounds
00079   //                  0->fNStrip-1.
00080   //
00081   //  Return:  n/a.
00082   //
00083   //  Contact:   S. Kasahara
00084   // 
00085 
00086   if ( ind < 0 || ind >= fNShower ) return;  // should print warning
00087     
00088   fShowerInd[ind] = showerindex;
00089   return;
00090     
00091 }

void NtpCandEvent::AddTrackAt ( Int_t  trackindex,
Int_t  ind 
) [virtual]

Definition at line 53 of file NtpCandEvent.cxx.

References fNTrack, and fTrackInd.

Referenced by DemoCandNtpModule::Reco().

00053                                                          {
00054   //
00055   //  Purpose:  Add trackindex to fTrackInd array at position ind.
00056   //
00057   //  Arguments: trackindex: index of track in assoc fTracks TClonesArray. 
00058   //             ind: index in fTrackInd array, cannot exceed bounds
00059   //                  0->fNTrack-1.
00060   //
00061   //  Return:  n/a.
00062   //
00063   //  Contact:   S. Kasahara
00064   // 
00065 
00066   if ( ind < 0 || ind >= fNTrack ) return;  // should print warning
00067     
00068   fTrackInd[ind] = trackindex;
00069   return;
00070     
00071 }

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

Definition at line 39 of file NtpCandEvent.h.

References fShowerInd, and fTrackInd.

00039                                                   { if ( fTrackInd ) 
00040          delete [] fTrackInd; fTrackInd = 0; if ( fShowerInd ) 
00041          delete [] fShowerInd; fShowerInd = 0; }

virtual Int_t NtpCandEvent::GetNShower (  )  const [inline, virtual]

Definition at line 34 of file NtpCandEvent.h.

References fNShower.

00034 { return fNShower; }

virtual Int_t NtpCandEvent::GetNTrack (  )  const [inline, virtual]

Definition at line 33 of file NtpCandEvent.h.

References fNTrack.

00033 { return fNTrack; }

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

Definition at line 112 of file NtpCandEvent.cxx.

References Print().

00112                                                      {
00113   //
00114   //  Purpose:  Print event in form supported by TObject::Print.
00115   //
00116   //  Arguments: option (not used).
00117   //
00118   //  Return:  none.
00119   //
00120   //  Contact:   S. Kasahara
00121   // 
00122 
00123   Print(std::cout);
00124   return;
00125 
00126 }

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

Definition at line 94 of file NtpCandEvent.cxx.

References fNShower, and fNTrack.

Referenced by Print().

00094                                                     {
00095   //
00096   //  Purpose:  Print status of ntuple record on ostream.
00097   //
00098   //  Arguments: os ostream to display on.
00099   //
00100   //  Return:  ostream reference.
00101   //
00102   //  Contact:   S. Kasahara
00103   // 
00104 
00105   os << "Event has " << fNTrack << " tracks and "  
00106      << fNShower << " showers." << endl;
00107   
00108   return os;
00109 
00110 }


Member Data Documentation

Int_t NtpCandEvent::fNShower [protected]

Definition at line 47 of file NtpCandEvent.h.

Referenced by AddShowerAt(), GetNShower(), NtpCandEvent(), and Print().

Int_t NtpCandEvent::fNTrack [protected]

Definition at line 45 of file NtpCandEvent.h.

Referenced by AddTrackAt(), GetNTrack(), NtpCandEvent(), and Print().

Int_t* NtpCandEvent::fShowerInd [protected]

Definition at line 48 of file NtpCandEvent.h.

Referenced by AddShowerAt(), Clear(), NtpCandEvent(), and ~NtpCandEvent().

Int_t* NtpCandEvent::fTrackInd [protected]

Definition at line 46 of file NtpCandEvent.h.

Referenced by AddTrackAt(), Clear(), NtpCandEvent(), and ~NtpCandEvent().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1