FairRoot/PandaRoot
Public Member Functions | Protected Attributes | Private Attributes | List of all members
RhoIntDynArrColumn Class Reference

#include <RhoColumn.h>

Inheritance diagram for RhoIntDynArrColumn:
RhoColumn

Public Member Functions

 RhoIntDynArrColumn (const char *, const RhoHTAbsValVector< Int_t > &, const Int_t &, RhoColumn *, TTree *)
 
virtual ~RhoIntDynArrColumn ()
 
virtual void SetDefValue ()
 
virtual void SetValue (const void *, RhoColumn *cp=0)
 
const TStringGetLabel () const
 
TBranch * GetBrPointer ()
 
void * GetPointer ()
 
void SetPointer (void *p)
 
void SetUseDefValue (Int_t b)
 
const Int_t & GetUseDefValue () const
 

Protected Attributes

TString fLabel
 
Int_t fUseDefValue
 
void * fPointer
 
TBranch * fBranch
 

Private Attributes

Int_t fDefValue
 
RhoColumnfIndexPtr
 

Detailed Description

Definition at line 240 of file RhoColumn.h.

Constructor & Destructor Documentation

RhoIntDynArrColumn::RhoIntDynArrColumn ( const char *  l,
const RhoHTAbsValVector< Int_t > &  v,
const Int_t &  d,
RhoColumn inp,
TTree *  tp 
)

Definition at line 155 of file RhoColumn.cxx.

References RhoColumn::fBranch, fIndexPtr, RhoColumn::fLabel, RhoColumn::fPointer, RhoColumn::GetLabel(), RhoColumn::GetPointer(), i, TString, and v.

158  :
159  RhoColumn ( l ),fDefValue ( d ),fIndexPtr ( inp )
160 {
161  // Make a new branch:
162  Int_t* np = ( Int_t* ) fIndexPtr->GetPointer();
163  Int_t* ip = new Int_t[*np];
164  fPointer = ip;
165  for ( Int_t i = 0; i < *np; ++i ) { ip[i] = v ( i ); }
166  TString leafs ( fLabel );
167  leafs += "[";
168  leafs += fIndexPtr->GetLabel();
169  leafs += "]/I";
170  fBranch = tp->Branch ( fLabel,&ip[0],&*leafs,8000 );
171 }
TObjArray * d
RhoColumn(const char *l)
Definition: RhoColumn.h:125
Int_t i
Definition: run_full.C:25
TBranch * fBranch
Definition: RhoColumn.h:152
__m128 v
Definition: P4_F32vec4.h:4
const TString & GetLabel() const
Definition: RhoColumn.h:128
RhoColumn * fIndexPtr
Definition: RhoColumn.h:252
void * GetPointer()
Definition: RhoColumn.h:134
TString fLabel
Definition: RhoColumn.h:149
void * fPointer
Definition: RhoColumn.h:151
virtual RhoIntDynArrColumn::~RhoIntDynArrColumn ( )
inlinevirtual

Definition at line 245 of file RhoColumn.h.

References RhoColumn::fPointer.

245  {
246  delete[] ( Int_t* ) fPointer;
247  }
void * fPointer
Definition: RhoColumn.h:151

Member Function Documentation

TBranch* RhoColumn::GetBrPointer ( )
inlineinherited

Definition at line 131 of file RhoColumn.h.

References RhoColumn::fBranch.

131  {
132  return fBranch;
133  }
TBranch * fBranch
Definition: RhoColumn.h:152
const TString& RhoColumn::GetLabel ( ) const
inlineinherited
void* RhoColumn::GetPointer ( )
inlineinherited
const Int_t& RhoColumn::GetUseDefValue ( ) const
inlineinherited

Definition at line 143 of file RhoColumn.h.

References RhoColumn::fUseDefValue.

Referenced by RhoTuple::DumpData().

143  {
144  return fUseDefValue;
145  }
Int_t fUseDefValue
Definition: RhoColumn.h:150
void RhoIntDynArrColumn::SetDefValue ( )
virtual

Implements RhoColumn.

Definition at line 173 of file RhoColumn.cxx.

References RhoColumn::fBranch, fDefValue, fIndexPtr, RhoColumn::fPointer, RhoColumn::GetPointer(), and i.

Referenced by SetValue().

174 {
175  if ( fPointer ) { delete [] ( Int_t* ) fPointer; }
176  Int_t fMax = * ( ( Int_t* ) ( fIndexPtr->GetPointer() ) );
177  Int_t* ip = new Int_t[fMax];
178  fPointer = ip;
179  for ( Int_t i = 0; i < fMax; ++i ) { ip[i] = fDefValue; }
180  fBranch->SetAddress ( &ip[0] );
181 }
Int_t i
Definition: run_full.C:25
TBranch * fBranch
Definition: RhoColumn.h:152
RhoColumn * fIndexPtr
Definition: RhoColumn.h:252
void * GetPointer()
Definition: RhoColumn.h:134
void * fPointer
Definition: RhoColumn.h:151
void RhoColumn::SetPointer ( void *  p)
inlineinherited

Definition at line 137 of file RhoColumn.h.

References RhoColumn::fPointer, and p.

137  {
138  fPointer = p;
139  }
Double_t p
Definition: anasim.C:58
void * fPointer
Definition: RhoColumn.h:151
void RhoColumn::SetUseDefValue ( Int_t  b)
inlineinherited

Definition at line 140 of file RhoColumn.h.

References b, and RhoColumn::fUseDefValue.

Referenced by RhoTuple::ClearData(), RhoTuple::Column(), and RhoTuple::DumpData().

140  {
141  fUseDefValue = b;
142  }
TTree * b
Int_t fUseDefValue
Definition: RhoColumn.h:150
void RhoIntDynArrColumn::SetValue ( const void *  p,
RhoColumn cp = 0 
)
virtual

Implements RhoColumn.

Definition at line 183 of file RhoColumn.cxx.

References RhoColumn::fBranch, RhoColumn::fPointer, RhoColumn::GetPointer(), i, RhoHTAbsValVector< T >::length(), and SetDefValue().

184 {
185  const RhoHTAbsValVector<Int_t>* vp = ( const RhoHTAbsValVector<Int_t>* ) p;
186  Int_t* np = ( Int_t* ) cp->GetPointer();
187  if ( *np > (int)vp->length() ) {
188  cerr << "IntDynArrColumn::SetValue: input vector too short,"
189  << "use default values" << endl;
190  SetDefValue();
191  } else {
192  Int_t* ip = new Int_t[*np];
193  if ( fPointer ) { delete[] ( Int_t* ) fPointer; }
194  fPointer = ip;
195  for ( Int_t i = 0; i < *np; ++i ) { ip[i] = ( *vp ) ( i ); }
196  fBranch->SetAddress ( &ip[0] );
197  }
198 }
Double_t p
Definition: anasim.C:58
Int_t i
Definition: run_full.C:25
virtual size_t length() const =0
TBranch * fBranch
Definition: RhoColumn.h:152
void * GetPointer()
Definition: RhoColumn.h:134
void * fPointer
Definition: RhoColumn.h:151
virtual void SetDefValue()
Definition: RhoColumn.cxx:173

Member Data Documentation

TBranch* RhoColumn::fBranch
protectedinherited
Int_t RhoIntDynArrColumn::fDefValue
private

Definition at line 251 of file RhoColumn.h.

Referenced by SetDefValue().

RhoColumn* RhoIntDynArrColumn::fIndexPtr
private

Definition at line 252 of file RhoColumn.h.

Referenced by RhoIntDynArrColumn(), and SetDefValue().

TString RhoColumn::fLabel
protectedinherited
void* RhoColumn::fPointer
protectedinherited

Definition at line 151 of file RhoColumn.h.

Referenced by RhoColumn::GetPointer(), RhoBoolArrColumn::RhoBoolArrColumn(), RhoBoolColumn::RhoBoolColumn(), RhoBoolDynArrColumn::RhoBoolDynArrColumn(), RhoDoubleArrColumn::RhoDoubleArrColumn(), RhoDoubleColumn::RhoDoubleColumn(), RhoDoubleDynArrColumn::RhoDoubleDynArrColumn(), RhoFloatArrColumn::RhoFloatArrColumn(), RhoFloatColumn::RhoFloatColumn(), RhoFloatDynArrColumn::RhoFloatDynArrColumn(), RhoIntArrColumn::RhoIntArrColumn(), RhoIntColumn::RhoIntColumn(), RhoIntDynArrColumn(), RhoStringColumn::RhoStringColumn(), RhoBoolColumn::SetDefValue(), RhoBoolArrColumn::SetDefValue(), RhoBoolDynArrColumn::SetDefValue(), RhoIntColumn::SetDefValue(), RhoIntArrColumn::SetDefValue(), SetDefValue(), RhoFloatColumn::SetDefValue(), RhoFloatArrColumn::SetDefValue(), RhoFloatDynArrColumn::SetDefValue(), RhoDoubleColumn::SetDefValue(), RhoDoubleArrColumn::SetDefValue(), RhoDoubleDynArrColumn::SetDefValue(), RhoStringColumn::SetDefValue(), RhoColumn::SetPointer(), RhoBoolColumn::SetValue(), RhoBoolArrColumn::SetValue(), RhoBoolDynArrColumn::SetValue(), RhoIntColumn::SetValue(), RhoIntArrColumn::SetValue(), SetValue(), RhoFloatColumn::SetValue(), RhoFloatArrColumn::SetValue(), RhoFloatDynArrColumn::SetValue(), RhoDoubleColumn::SetValue(), RhoDoubleArrColumn::SetValue(), RhoDoubleDynArrColumn::SetValue(), RhoStringColumn::SetValue(), RhoBoolArrColumn::~RhoBoolArrColumn(), RhoBoolColumn::~RhoBoolColumn(), RhoBoolDynArrColumn::~RhoBoolDynArrColumn(), RhoDoubleArrColumn::~RhoDoubleArrColumn(), RhoDoubleColumn::~RhoDoubleColumn(), RhoDoubleDynArrColumn::~RhoDoubleDynArrColumn(), RhoFloatArrColumn::~RhoFloatArrColumn(), RhoFloatColumn::~RhoFloatColumn(), RhoFloatDynArrColumn::~RhoFloatDynArrColumn(), RhoIntArrColumn::~RhoIntArrColumn(), RhoIntColumn::~RhoIntColumn(), ~RhoIntDynArrColumn(), and RhoStringColumn::~RhoStringColumn().

Int_t RhoColumn::fUseDefValue
protectedinherited

Definition at line 150 of file RhoColumn.h.

Referenced by RhoColumn::GetUseDefValue(), and RhoColumn::SetUseDefValue().


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