CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
TrackerOfflineValidation::DirectoryWrapper Struct Reference

Public Member Functions

 DirectoryWrapper (const DirectoryWrapper &upDir, const std::string &newDir, const std::string &basedir, bool useDqmMode)
 
 DirectoryWrapper (const std::string &newDir, const std::string &basedir, bool useDqmMode)
 
template<typename T >
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX)
 
template<typename T >
TH1 * make (const char *name, const char *title, int nBinX, double *xBins)
 
template<typename T >
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX, int nBinY, double minBinY, double maxBinY)
 
template<typename T >
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX, double minBinY, double maxBinY)
 
template<>
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX)
 
template<>
TH1 * make (const char *name, const char *title, int nBinX, double *xBins)
 
template<>
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX)
 
template<>
TH1 * make (const char *name, const char *title, int nbinX, double minX, double maxX, double minY, double maxY)
 
template<>
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX, int nBinY, double minBinY, double maxBinY)
 

Public Attributes

std::string directoryString
 
const bool dqmMode
 
std::auto_ptr< TFileDirectorytfd
 
DQMStoretheDbe
 

Detailed Description

Definition at line 134 of file TrackerOfflineValidation.cc.

Constructor & Destructor Documentation

TrackerOfflineValidation::DirectoryWrapper::DirectoryWrapper ( const DirectoryWrapper upDir,
const std::string &  newDir,
const std::string &  basedir,
bool  useDqmMode 
)
inline

Definition at line 135 of file TrackerOfflineValidation.cc.

References directoryString, dqmMode, cppFunctionSkipper::operator, tfd, and theDbe.

137  : tfd(0),
138  dqmMode(useDqmMode),
139  theDbe(0) {
140  if (newDir.length()!=0){
141  if(upDir.directoryString.length()!=0)directoryString=upDir.directoryString+"/"+newDir;
142  else directoryString = newDir;
143  }
144  else
145  directoryString=upDir.directoryString;
146 
147  if (!dqmMode){
148  if (newDir.length()==0) tfd.reset(&(*upDir.tfd));
149  else
150  tfd.reset(new TFileDirectory(upDir.tfd->mkdir(newDir)));
151  }
152  else {
154  }
155  }
TrackerOfflineValidation::DirectoryWrapper::DirectoryWrapper ( const std::string &  newDir,
const std::string &  basedir,
bool  useDqmMode 
)
inline

Definition at line 157 of file TrackerOfflineValidation.cc.

References directoryString, dqmMode, TFileService::mkdir(), cppFunctionSkipper::operator, tfd, TFileService::tFileDirectory(), and theDbe.

158  : tfd(0),
159  dqmMode(useDqmMode),
160  theDbe(0) {
161  if (!dqmMode){
163  if (newDir.length()==0){
164  tfd.reset(new TFileDirectory(fs->tFileDirectory()));
165  }
166  else {
167  tfd.reset(new TFileDirectory(fs->mkdir(newDir)));
168  directoryString=newDir;
169  }
170  }
171  else {
172  if (newDir.length()!=0){
173  if(basedir.length()!=0)directoryString=basedir+"/"+newDir;
174  else directoryString = newDir;
175  }
176  else directoryString=basedir;
178  }
179  }
TFileDirectory & tFileDirectory()
Definition: TFileService.h:42
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69

Member Function Documentation

template<typename T >
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX 
)
template<typename T >
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double *  xBins 
)
template<typename T >
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX,
int  nBinY,
double  minBinY,
double  maxBinY 
)
template<typename T >
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX,
double  minBinY,
double  maxBinY 
)
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX 
)

Definition at line 308 of file TrackerOfflineValidation.cc.

References mergeVDriftHistosByStation::name, and indexGen::title.

308  {
309  if(dqmMode){theDbe->setCurrentFolder(directoryString); return theDbe->book1D(name,title,nBinX,minBinX,maxBinX)->getTH1();}
310  else{return tfd->make<TH1F>(name,title,nBinX,minBinX,maxBinX);}
311 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:1006
TH1 * getTH1(void) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:719
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double *  xBins 
)

Definition at line 313 of file TrackerOfflineValidation.cc.

References mergeVDriftHistosByStation::name, and indexGen::title.

313  {
314  if(dqmMode){
316  //DQM profile requires y-bins for construction... using TProfile creator by hand...
317  TProfile *tmpProfile=new TProfile(name,title,nBinX,xBins);
318  tmpProfile->SetDirectory(0);
319  return theDbe->bookProfile(name,tmpProfile)->getTH1();
320  }
321  else{return tfd->make<TProfile>(name,title,nBinX,xBins);}
322 }
TH1 * getTH1(void) const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1320
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:719
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX 
)

Definition at line 324 of file TrackerOfflineValidation.cc.

References mergeVDriftHistosByStation::name, and indexGen::title.

324  {
325  if(dqmMode){
327  //DQM profile requires y-bins for construction... using TProfile creator by hand...
328  TProfile *tmpProfile=new TProfile(name,title,nBinX,minBinX,maxBinX);
329  tmpProfile->SetDirectory(0);
330  return theDbe->bookProfile(name,tmpProfile)->getTH1();
331  }
332  else{return tfd->make<TProfile>(name,title,nBinX,minBinX,maxBinX);}
333 }
TH1 * getTH1(void) const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1320
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:719
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nbinX,
double  minX,
double  maxX,
double  minY,
double  maxY 
)

Definition at line 335 of file TrackerOfflineValidation.cc.

References mergeVDriftHistosByStation::name, and indexGen::title.

335  {
336  if(dqmMode){
338  int dummy(0); // DQMProfile wants Y channels... does not use them!
339  return (theDbe->bookProfile(name,title,nbinX,minX,maxX,dummy,minY,maxY)->getTH1());
340  }
341  else{
342  return tfd->make<TProfile>(name,title,nbinX,minX,maxX,minY,maxY);
343  }
344 }
TH1 * getTH1(void) const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1320
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:719
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX,
int  nBinY,
double  minBinY,
double  maxBinY 
)

Definition at line 346 of file TrackerOfflineValidation.cc.

References mergeVDriftHistosByStation::name, and indexGen::title.

346  {
347  if(dqmMode){theDbe->setCurrentFolder(directoryString); return theDbe->book2D(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY)->getTH1();}
348  else{return tfd->make<TH2F>(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY);}
349 }
TH1 * getTH1(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1134
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:719

Member Data Documentation

std::string TrackerOfflineValidation::DirectoryWrapper::directoryString

Definition at line 187 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

const bool TrackerOfflineValidation::DirectoryWrapper::dqmMode

Definition at line 188 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

std::auto_ptr<TFileDirectory> TrackerOfflineValidation::DirectoryWrapper::tfd

Definition at line 186 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

DQMStore* TrackerOfflineValidation::DirectoryWrapper::theDbe

Definition at line 189 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().