FairRoot/PandaRoot
Public Member Functions | Public Attributes | List of all members
Vec< T > Class Template Reference

#include <PndTrkVectors.h>

Public Member Functions

 Vec (T *p, int dim, TString nam)
 
 ~Vec ()
 
Tat (int index)
 
Toperator[] (int index)
 

Public Attributes

int dimension
 
TString name
 
Tarray
 

Detailed Description

template<class T>
class Vec< T >

Definition at line 31 of file PndTrkVectors.h.

Constructor & Destructor Documentation

template<class T>
Vec< T >::Vec ( T p,
int  dim,
TString  nam 
)
inline

Definition at line 40 of file PndTrkVectors.h.

References exit(), nam, name, and p.

40  {
41  if(dim < 0 || dim > 1000000){
42  cout<<"PndTrkVectors::Vec the dimension of the array "<<nam<<" is "
43  <<dim<<" and not acceptable; exit(-2) the program.\n";
44  exit(-2);
45  }
46  dimension = dim;
47  array = p;
48  name = nam;
49  };
Double_t p
Definition: anasim.C:58
exit(0)
TString name
Definition: PndTrkVectors.h:36
T * array
Definition: PndTrkVectors.h:37
int dimension
Definition: PndTrkVectors.h:35
TString nam
Definition: sim_hypGe.C:48
template<class T>
Vec< T >::~Vec ( )
inline

Definition at line 51 of file PndTrkVectors.h.

51 {;};

Member Function Documentation

template<class T>
T& Vec< T >::at ( int  index)
inline

Definition at line 54 of file PndTrkVectors.h.

References exit(), name, and T.

Referenced by PndTrkComparisonMCtruth::AssociateFoundTrackstoMCquater(), PndTrkComparisonMCtruth::MvdMatchedSpurioustoTrackCand(), PndTrkComparisonMCtruth::MvdMatchtoMC(), PndTrkComparisonMCtruth::SciTilMatchedSpurioustoTrackCand(), PndTrkComparisonMCtruth::SciTilMatchtoMC(), PndTrkPlotMacros::SttInfoXYZParal(), PndTrkPlotMacros2::SttInfoXYZParal(), PndTrkComparisonMCtruth::SttMatchedSpurious(), PndTrkPlotMacros::WriteAllMacros(), PndTrkPlotMacros2::WriteAllMacros(), PndTrkPlotMacros::WriteMacroAllHitsRestanti(), PndTrkPlotMacros2::WriteMacroAllHitsRestanti(), PndTrkPlotMacros::WriteMacroParallel_MvdHitsGeneralConformalwithMC(), PndTrkPlotMacros2::WriteMacroParallel_MvdHitsGeneralConformalwithMC(), PndTrkPlotMacros::WriteMacroParallelHitsGeneral(), PndTrkPlotMacros2::WriteMacroParallelHitsGeneral(), PndTrkPlotMacros::WriteMacroParallelHitsGeneralConformalwithMC(), PndTrkPlotMacros2::WriteMacroParallelHitsGeneralConformalwithMC(), PndTrkPlotMacros::WriteMacroSttParallelAssociatedHitsandMvdwithMC(), and PndTrkPlotMacros2::WriteMacroSttParallelAssociatedHitsandMvdwithMC().

54  {
55 
56  if(index>=0 && index<dimension){
57  T& alias = array[index];
58  return alias ;
59  }
60  cout<< "PndTrkVectors:: array "<<name<<": index = "<<index<<" and it is out of bounds [from 0 to "<<
61  dimension-1<<" included]; exiting the process.\n";
62  exit(-1);
63  };
exit(0)
TString name
Definition: PndTrkVectors.h:36
TTree * T
Definition: anaLmdReco.C:32
T * array
Definition: PndTrkVectors.h:37
int dimension
Definition: PndTrkVectors.h:35
template<class T>
T& Vec< T >::operator[] ( int  index)
inline

Definition at line 66 of file PndTrkVectors.h.

References T.

66  {
67 
68  T& alias = at(index);
69  return alias ;
70  };
TTree * T
Definition: anaLmdReco.C:32
T & at(int index)
Definition: PndTrkVectors.h:54

Member Data Documentation

template<class T>
T* Vec< T >::array

Definition at line 37 of file PndTrkVectors.h.

template<class T>
int Vec< T >::dimension

Definition at line 35 of file PndTrkVectors.h.

template<class T>
TString Vec< T >::name

Definition at line 36 of file PndTrkVectors.h.


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