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

#include <RhoColumn.h>

Inheritance diagram for RhoFloatArrColumn:
RhoColumn

Public Member Functions

 RhoFloatArrColumn (const char *, const RhoHTAbsValVector< Float_t > &, const Float_t &, TTree *)
 
 RhoFloatArrColumn (const char *, const TVector &, const Float_t &, TTree *)
 
virtual ~RhoFloatArrColumn ()
 
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

Float_t fDefValue
 
Int_t fMax
 

Detailed Description

Definition at line 273 of file RhoColumn.h.

Constructor & Destructor Documentation

RhoFloatArrColumn::RhoFloatArrColumn ( const char *  l,
const RhoHTAbsValVector< Float_t > &  v,
const Float_t &  d,
TTree *  tp 
)

Definition at line 212 of file RhoColumn.cxx.

References buf, RhoColumn::fBranch, RhoColumn::fLabel, fMax, RhoColumn::fPointer, i, RhoHTAbsValVector< T >::length(), TString, and v.

214  :
215  RhoColumn ( l ),fDefValue ( d )
216 {
217  // Create a new branch:
218  fMax = v.length();
219  Float_t* fp = new Float_t[fMax];
220  fPointer = fp;
221  for ( Int_t i = 0; i < fMax; ++i ) { fp[i] = v ( i ); }
222  TString leafs ( fLabel );
223  leafs += "[";
224  char buf[33];
225  sprintf ( buf,"%i",fMax );
226  leafs += buf;
227  leafs += "]/F";
228  fBranch = tp->Branch ( fLabel,&fp[0],&*leafs,8000 );
229 }
Float_t fDefValue
Definition: RhoColumn.h:288
TObjArray * d
RhoColumn(const char *l)
Definition: RhoColumn.h:125
Int_t i
Definition: run_full.C:25
virtual size_t length() const =0
TBranch * fBranch
Definition: RhoColumn.h:152
__m128 v
Definition: P4_F32vec4.h:4
TString fLabel
Definition: RhoColumn.h:149
void * fPointer
Definition: RhoColumn.h:151
return buf
RhoFloatArrColumn::RhoFloatArrColumn ( const char *  l,
const TVector &  v,
const Float_t &  d,
TTree *  tp 
)

Definition at line 315 of file RhoColumn.cxx.

References buf, RhoColumn::fBranch, RhoColumn::fLabel, fMax, RhoColumn::fPointer, i, TString, and v.

315  :
316  RhoColumn ( l ),fDefValue ( d )
317 {
318  // Create a new branch:
319  fMax = v.GetNoElements();
320  Real_t* fp = new Real_t[fMax];
321  fPointer = fp;
322  for ( Int_t i = 0; i < fMax; ++i ) { fp[i] = v ( i ); }
323  TString leafs ( fLabel );
324  leafs += "[";
325  char buf[33];
326  sprintf ( buf,"%i",fMax );
327  leafs += buf;
328  leafs += "]/F";
329  fBranch = tp->Branch ( fLabel,&fp[0],&*leafs,8000 );
330 }
Float_t fDefValue
Definition: RhoColumn.h:288
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
TString fLabel
Definition: RhoColumn.h:149
void * fPointer
Definition: RhoColumn.h:151
return buf
virtual RhoFloatArrColumn::~RhoFloatArrColumn ( )
inlinevirtual

Definition at line 280 of file RhoColumn.h.

References RhoColumn::fPointer.

280  {
281  delete[] ( Float_t* ) fPointer;
282  }
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
virtual void RhoFloatArrColumn::SetDefValue ( )
inlinevirtual

Implements RhoColumn.

Definition at line 283 of file RhoColumn.h.

References fDefValue, fMax, RhoColumn::fPointer, and i.

Referenced by SetValue().

283  {
284  for ( Int_t i = 0; i < fMax; ++i ) { ( ( Float_t* ) fPointer ) [i] = fDefValue; }
285  }
Float_t fDefValue
Definition: RhoColumn.h:288
Int_t i
Definition: run_full.C:25
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 RhoFloatArrColumn::SetValue ( const void *  p,
RhoColumn cp = 0 
)
virtual

Implements RhoColumn.

Definition at line 242 of file RhoColumn.cxx.

References fMax, RhoColumn::fPointer, i, and SetDefValue().

243 {
244  const TVector *vp = (const TVector*) p;
245  if ( vp->GetNoElements() < fMax ) {
246  cerr << "FloatArrColumn::SetValue: input vector too short,"
247  << "use default values" << endl;
248  SetDefValue();
249  } else {
250  for ( Int_t i = 0; i < fMax; ++i ) { ( ( Float_t* ) fPointer ) [i] = ( *vp ) ( i ); }
251  }
252 }
Int_t i
Definition: run_full.C:25
virtual void SetDefValue()
Definition: RhoColumn.h:283
Double_t p
Definition: anasim.C:58
void * fPointer
Definition: RhoColumn.h:151

Member Data Documentation

TBranch* RhoColumn::fBranch
protectedinherited
Float_t RhoFloatArrColumn::fDefValue
private

Definition at line 288 of file RhoColumn.h.

Referenced by SetDefValue().

TString RhoColumn::fLabel
protectedinherited
Int_t RhoFloatArrColumn::fMax
private

Definition at line 289 of file RhoColumn.h.

Referenced by RhoFloatArrColumn(), SetDefValue(), and SetValue().

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(), RhoFloatColumn::RhoFloatColumn(), RhoFloatDynArrColumn::RhoFloatDynArrColumn(), RhoIntArrColumn::RhoIntArrColumn(), RhoIntColumn::RhoIntColumn(), RhoIntDynArrColumn::RhoIntDynArrColumn(), RhoStringColumn::RhoStringColumn(), RhoBoolColumn::SetDefValue(), RhoBoolArrColumn::SetDefValue(), RhoBoolDynArrColumn::SetDefValue(), RhoIntColumn::SetDefValue(), RhoIntArrColumn::SetDefValue(), RhoIntDynArrColumn::SetDefValue(), RhoFloatColumn::SetDefValue(), SetDefValue(), RhoFloatDynArrColumn::SetDefValue(), RhoDoubleColumn::SetDefValue(), RhoDoubleArrColumn::SetDefValue(), RhoDoubleDynArrColumn::SetDefValue(), RhoStringColumn::SetDefValue(), RhoColumn::SetPointer(), RhoBoolColumn::SetValue(), RhoBoolArrColumn::SetValue(), RhoBoolDynArrColumn::SetValue(), RhoIntColumn::SetValue(), RhoIntArrColumn::SetValue(), RhoIntDynArrColumn::SetValue(), RhoFloatColumn::SetValue(), SetValue(), RhoFloatDynArrColumn::SetValue(), RhoDoubleColumn::SetValue(), RhoDoubleArrColumn::SetValue(), RhoDoubleDynArrColumn::SetValue(), RhoStringColumn::SetValue(), RhoBoolArrColumn::~RhoBoolArrColumn(), RhoBoolColumn::~RhoBoolColumn(), RhoBoolDynArrColumn::~RhoBoolDynArrColumn(), RhoDoubleArrColumn::~RhoDoubleArrColumn(), RhoDoubleColumn::~RhoDoubleColumn(), RhoDoubleDynArrColumn::~RhoDoubleDynArrColumn(), ~RhoFloatArrColumn(), RhoFloatColumn::~RhoFloatColumn(), RhoFloatDynArrColumn::~RhoFloatDynArrColumn(), RhoIntArrColumn::~RhoIntArrColumn(), RhoIntColumn::~RhoIntColumn(), RhoIntDynArrColumn::~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: