DemoNtupleRecord Class Reference

#include <DemoNtupleRecord.h>

Inheritance diagram for DemoNtupleRecord:
RecRecordImp< RecHeader > RecRecord

List of all members.

Public Member Functions

 DemoNtupleRecord ()
 DemoNtupleRecord (const RecHeader &header)
virtual ~DemoNtupleRecord ()
void SetMyData (Int_t mydata)
TClonesArray & GetVectors ()
virtual std::ostream & Print (std::ostream &os) const
virtual void Print (const Option_t *option="") const

Protected Member Functions

virtual void Init ()

Private Attributes

Int_t fMyData
TClonesArray * fVectors

Detailed Description

Definition at line 30 of file DemoNtupleRecord.h.


Constructor & Destructor Documentation

DemoNtupleRecord::DemoNtupleRecord (  ) 

Definition at line 22 of file DemoNtupleRecord.cxx.

00022                                    : fMyData(-1),fVectors(0) {
00023   //
00024   //  Purpose:  Default constructor.
00025   //
00026   //  Arguments: none.
00027   //
00028   //  Contact:   S. Kasahara
00029   // 
00030 
00031   this -> Init();
00032 
00033 
00034 }

DemoNtupleRecord::DemoNtupleRecord ( const RecHeader header  ) 

Definition at line 36 of file DemoNtupleRecord.cxx.

References Init().

00036                                                        : 
00037           RecRecordImp<RecHeader>(hdr),fMyData(-1),fVectors(0) {
00038   //
00039   //  Purpose:  Normal constructor.
00040   //
00041   //  Arguments: header.
00042   //
00043   //  Contact:   S. Kasahara
00044   // 
00045 
00046   this -> Init();
00047 
00048 }

DemoNtupleRecord::~DemoNtupleRecord (  )  [virtual]

Definition at line 50 of file DemoNtupleRecord.cxx.

References fVectors, RecArrayAllocator::Instance(), and RecArrayAllocator::ReleaseArray().

00050                                     {
00051   //
00052   //  Purpose:  Destructor
00053   //
00054   //  Arguments: n/a
00055   //
00056   //  Return:  n/a
00057   //
00058   //  Contact:   S. Kasahara
00059   // 
00060 
00061   RecArrayAllocator& allocator = RecArrayAllocator::Instance();
00062   if ( fVectors ) { allocator.ReleaseArray( fVectors ); fVectors = 0; }
00063 
00064 }


Member Function Documentation

TClonesArray& DemoNtupleRecord::GetVectors (  )  [inline]

Definition at line 43 of file DemoNtupleRecord.h.

References fVectors.

00043 { return *fVectors; }

void DemoNtupleRecord::Init ( void   )  [protected, virtual]

Definition at line 66 of file DemoNtupleRecord.cxx.

References fVectors, RecArrayAllocator::GetArray(), and RecArrayAllocator::Instance().

Referenced by DemoNtupleRecord().

00066                             {
00067   //
00068   //  Purpose:  Perform customized initialization appropriate for SR records
00069   //
00070   //  Arguments: none.
00071   //
00072   //  Return:  none.
00073   //
00074   //  Contact:   S. Kasahara
00075   // 
00076 
00077   // See description in RecArrayAllocator for description & reason for use
00078   RecArrayAllocator& allocator = RecArrayAllocator::Instance();
00079   if ( !fVectors ) fVectors = allocator.GetArray("TVector3");
00080   
00081 }

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

Definition at line 107 of file DemoNtupleRecord.cxx.

References Print().

00107                                                                {
00108   //
00109   //  Purpose:  Print record in form supported by TObject::Print.
00110   //
00111   //  Arguments: option (not used).
00112   //
00113   //  Return:  none.
00114   //
00115   //  Contact:   S. Kasahara
00116   // 
00117 
00118   Print(std::cout);
00119   return;
00120 
00121 }

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

Reimplemented from RecRecordImp< RecHeader >.

Definition at line 83 of file DemoNtupleRecord.cxx.

References fMyData, and fVectors.

Referenced by Print().

00083                                                         {
00084   //
00085   //  Purpose:  Print status of ntuple record on ostream.
00086   //
00087   //  Arguments: os ostream to display on.
00088   //
00089   //  Return:  ostream reference.
00090   //
00091   //  Contact:   S. Kasahara
00092   // 
00093 
00094   os << "DemoNtupleRecord::Print" << endl;
00095   RecRecordImp<RecHeader>::Print(os);
00096   os << "MyData = " << fMyData << endl;
00097   os << "Vectors TClonesArray has " << fVectors->GetEntriesFast() 
00098      << " entries" << endl; 
00099   for ( int i = 0; i < fVectors->GetEntriesFast(); i++ ) {
00100     fVectors->At(i)->Print();
00101   }
00102 
00103   return os;
00104 
00105 }

void DemoNtupleRecord::SetMyData ( Int_t  mydata  )  [inline]

Definition at line 40 of file DemoNtupleRecord.h.

References fMyData.

00040 { fMyData = mydata; }


Member Data Documentation

Int_t DemoNtupleRecord::fMyData [private]

Definition at line 53 of file DemoNtupleRecord.h.

Referenced by Print(), and SetMyData().

TClonesArray* DemoNtupleRecord::fVectors [private]

Definition at line 65 of file DemoNtupleRecord.h.

Referenced by GetVectors(), Init(), Print(), and ~DemoNtupleRecord().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1