| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RootHistCnv Namespace Reference


Classes

class  DirectoryCnv
class  PersSvc
class  RConverter
class  RCWNTupleCnv
class  RDirectoryCnv
class  RFileCnv
class  RHistogramCnv
 Generic converter to save/read AIDA_ROOT histograms using ROOT. More...
class  RNTupleCnv
class  RootObjAddress
class  RRWNTupleCnv

Typedefs

typedef RHistogramCnv< TProfile,
TProfile, Gaudi::HistogramBase > 
RootHistCnvP1DCnv
typedef RHistogramCnv< TProfile2D,
TProfile2D, Gaudi::HistogramBase > 
RootHistCnvP2DCnv
typedef RHistogramCnv< TH1D,
TH1, Gaudi::HistogramBase > 
RootHistCnvH1DCnv
typedef RHistogramCnv< TH2D,
TH2, Gaudi::HistogramBase > 
RootHistCnvH2DCnv
typedef RootHistCnv::RHistogramCnv<
TH3D, TH3, Gaudi::HistogramBase > 
RootHistCnvH3DCnv

Functions

 DECLARE_CONVERTER_FACTORY (RootHistCnvP1DCnv)
bool parseName (std::string full, std::string &blk, std::string &var)
template<class TYP>
INTupleItemcreateNTupleItem (std::string itemName, std::string blockName, std::string indexName, int indexRange, int arraySize, TYP min, TYP max, INTuple *ntup)
template<class TYP>
INTupleItemcreateNTupleItem (NTUPLEINFO &tags, long i, INTuple *tuple, TYP minimum, TYP maximum, long &size)
 Add an item of a given type to the N tuple.
bool RootCd (const std::string &full)
bool RootMkdir (const std::string &full)
std::string RootPwd ()
bool RootTrimLeadingDir (std::string &full, std::string dir)

Variables

static std::string stat_dir = "/stat"
static std::string undefFileName = "UndefinedROOTOutputFileName"

Typedef Documentation

typedef RHistogramCnv<TProfile,TProfile,Gaudi::HistogramBase> RootHistCnv::RootHistCnvP1DCnv

Definition at line 8 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TProfile2D,TProfile2D,Gaudi::HistogramBase> RootHistCnv::RootHistCnvP2DCnv

Definition at line 16 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TH1D,TH1,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH1DCnv

Definition at line 24 of file RHistogramCnv.cpp.

typedef RHistogramCnv<TH2D,TH2,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH2DCnv

Definition at line 32 of file RHistogramCnv.cpp.

typedef RootHistCnv::RHistogramCnv<TH3D,TH3,Gaudi::HistogramBase> RootHistCnv::RootHistCnvH3DCnv

Definition at line 40 of file RHistogramCnv.cpp.


Function Documentation

RootHistCnv::DECLARE_CONVERTER_FACTORY ( RootHistCnvP1DCnv   ) 

bool RootHistCnv::parseName ( std::string  full,
std::string &  blk,
std::string &  var 
)

Definition at line 245 of file RNTupleCnv.cpp.

00245                                                                           {
00246 //-----------------------------------------------------------------------------
00247   int sp;
00248   if ( (sp=full.find("/")) != -1 ) {
00249     blk = full.substr(0,sp);
00250     var = full.substr(sp+1,full.length());
00251     return true;
00252   } else {
00253     blk = "AUTO_BLK";
00254     var = full;
00255     return false;
00256   }
00257 
00258 }

template<class TYP>
INTupleItem * RootHistCnv::createNTupleItem ( std::string  itemName,
std::string  blockName,
std::string  indexName,
int  indexRange,
int  arraySize,
TYP  min,
TYP  max,
INTuple ntup 
)

Definition at line 269 of file RNTupleCnv.cpp.

00273                                                 {
00274 
00275     std::string varName;
00276     if (blockName != "") {
00277       varName = blockName + "/" + itemName;
00278     } else {
00279       varName = itemName;
00280     }
00281 
00282     TYP null = 0;
00283     INTupleItem* col = 0;
00284 
00285     if (min == 0 && max == 0) {
00286       min = NTuple::Range<TYP>::min();
00287       max = NTuple::Range<TYP>::max();
00288     }
00289 
00290     
00291     if (indexName == "") {      
00292 
00293       if (arraySize == 1) {
00294         // simple items
00295         col = NTuple::_Item<TYP>::create(ntup, varName, 
00296                                          typeid(TYP), 
00297                                          min, max, null);
00298 
00299       } else {
00300         // Arrays of fixed size
00301         col = NTuple::_Array<TYP>::create(ntup, varName,
00302                                            typeid(TYP), 
00303                                           "", arraySize,
00304                                           min, max, null);
00305       }
00306 
00307     } else {
00308 
00309       if (arraySize == 1) {
00310         // Arrays of variable size
00311         col = NTuple::_Array<TYP>::create(ntup, varName, 
00312                                            typeid(TYP), 
00313                                           indexName, indexRange, 
00314                                           min, max, null);
00315       } else {
00316         // Matrices
00317         col = NTuple::_Matrix<TYP>::create(ntup, varName, 
00318                                            typeid(TYP), 
00319                                            indexName,
00320                                            indexRange, arraySize, 
00321                                            min, max, null);
00322       }
00323 
00324     }
00325 
00326     return col;
00327 
00328   }

template<class TYP>
INTupleItem* RootHistCnv::createNTupleItem ( NTUPLEINFO &  tags,
long  i,
INTuple tuple,
TYP  minimum,
TYP  maximum,
long &  size 
)

Add an item of a given type to the N tuple.

bool RootHistCnv::RootCd ( const std::string &  full  ) 

Definition at line 17 of file RootDirFcn.cpp.

00019 {
00020   int p,i=1;
00021   std::string cur,sdir;
00022   
00023   gDirectory->cd("/");
00024   while ( (p = full.find("/",i)) != -1) {
00025     sdir = full.substr(i,p-i);
00026     if (! gDirectory->GetKey(sdir.c_str()) ) { 
00027       return false;
00028     }
00029     gDirectory->cd(sdir.c_str());
00030     
00031     i = p+1;
00032   }
00033   gDirectory->cd( full.substr(i,full.length()-i).c_str() );
00034   
00035   return true;
00036   
00037 }

bool RootHistCnv::RootMkdir ( const std::string &  full  ) 

Definition at line 41 of file RootDirFcn.cpp.

00043 {
00044 
00045   int p,i;
00046   std::string fil,cur,s;
00047   TDirectory *gDir;
00048   
00049   gDir = gDirectory;
00050   
00051   std::list<std::string> lpath;
00052   i = 1;
00053   
00054   if ( (p=full.find(":",0)) != -1 ) {
00055     fil = full.substr(0,p);
00056     i = p+1;
00057     fil += ":/";
00058     gDirectory->cd(fil.c_str());
00059   }
00060   
00061   while ( (p = full.find("/",i)) != -1) {
00062     s = full.substr(i,p-i);
00063     lpath.push_back(s);
00064     i = p+1;
00065   }
00066   lpath.push_back( full.substr(i,full.length()-i) );
00067   
00068   if ( full.substr(0,1) == "/") {
00069     gDirectory->cd("/");
00070   }
00071   
00072   std::list<std::string>::const_iterator litr;
00073   for(litr=lpath.begin(); litr!=lpath.end(); ++litr) {
00074     cur = *litr;
00075     if (! gDirectory->GetKey(litr->c_str()) ) { 
00076       gDirectory->mkdir(litr->c_str()); 
00077     }
00078     gDirectory->cd(litr->c_str());
00079   }
00080   
00081   gDirectory = gDir;
00082   
00083   return true;
00084 }

std::string RootHistCnv::RootPwd (  ) 

Definition at line 87 of file RootDirFcn.cpp.

00089 {
00090   std::string dir = gDirectory->GetPath();
00091 
00092   return (dir);
00093 }

bool RootHistCnv::RootTrimLeadingDir ( std::string &  full,
std::string  dir 
)

Definition at line 96 of file RootDirFcn.cpp.

00098 {
00099   
00100   if (dir.substr(0,1) != "/") {
00101     dir.insert(0,"/");
00102   }
00103 
00104   if (dir.substr(dir.length()-1,1) != "/") {
00105     dir += "/";
00106   }
00107 
00108   long ll = full.find(dir);
00109   if (ll != 0) {
00110     return false;
00111   }
00112 
00113   full.erase(0,dir.length()-1);
00114 
00115   return true;
00116 
00117 }


Variable Documentation

std::string RootHistCnv::stat_dir = "/stat" [static]

Definition at line 28 of file PersSvc.cpp.

std::string RootHistCnv::undefFileName = "UndefinedROOTOutputFileName" [static]

Definition at line 29 of file PersSvc.cpp.

| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:45 2011 for RootHistCnv by doxygen 1.4.7