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 136 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 137 of file TrackerOfflineValidation.cc.

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

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

Definition at line 159 of file TrackerOfflineValidation.cc.

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

160  : tfd(0),
161  dqmMode(useDqmMode),
162  theDbe(0) {
163  if (!dqmMode){
165  if (newDir.length()==0){
166  tfd.reset(new TFileDirectory(static_cast<TFileDirectory&>(*fs)));
167  }
168  else {
169  tfd.reset(new TFileDirectory(fs->mkdir(newDir)));
170  directoryString=newDir;
171  }
172  }
173  else {
174  if (newDir.length()!=0){
175  if(basedir.length()!=0)directoryString=basedir+"/"+newDir;
176  else directoryString = newDir;
177  }
178  else directoryString=basedir;
180  }
181  }
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory

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 309 of file TrackerOfflineValidation.cc.

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

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

Definition at line 314 of file TrackerOfflineValidation.cc.

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

314  {
315  if(dqmMode){
317  //DQM profile requires y-bins for construction... using TProfile creator by hand...
318  TProfile *tmpProfile=new TProfile(name,title,nBinX,xBins);
319  tmpProfile->SetDirectory(0);
320  return theDbe->bookProfile(name,tmpProfile)->getTH1();
321  }
322  else{return tfd->make<TProfile>(name,title,nBinX,xBins);}
323 }
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:1031
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX 
)

Definition at line 325 of file TrackerOfflineValidation.cc.

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

325  {
326  if(dqmMode){
328  //DQM profile requires y-bins for construction... using TProfile creator by hand...
329  TProfile *tmpProfile=new TProfile(name,title,nBinX,minBinX,maxBinX);
330  tmpProfile->SetDirectory(0);
331  return theDbe->bookProfile(name,tmpProfile)->getTH1();
332  }
333  else{return tfd->make<TProfile>(name,title,nBinX,minBinX,maxBinX);}
334 }
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:1031
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nbinX,
double  minX,
double  maxX,
double  minY,
double  maxY 
)

Definition at line 336 of file TrackerOfflineValidation.cc.

References cmsRun_displayProdMFGeom_cfg::maxX, cmsRun_displayProdMFGeom_cfg::maxY, cmsRun_displayProdMFGeom_cfg::minX, cmsRun_displayProdMFGeom_cfg::minY, mergeVDriftHistosByStation::name, and indexGen::title.

336  {
337  if(dqmMode){
339  int dummy(0); // DQMProfile wants Y channels... does not use them!
340  return (theDbe->bookProfile(name,title,nbinX,minX,maxX,dummy,minY,maxY)->getTH1());
341  }
342  else{
343  return tfd->make<TProfile>(name,title,nbinX,minX,maxX,minY,maxY);
344  }
345 }
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:1031
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
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 347 of file TrackerOfflineValidation.cc.

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

347  {
348  if(dqmMode){theDbe->setCurrentFolder(directoryString); return theDbe->book2D(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY)->getTH1();}
349  else{return tfd->make<TH2F>(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY);}
350 }
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:845
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429

Member Data Documentation

std::string TrackerOfflineValidation::DirectoryWrapper::directoryString

Definition at line 189 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

const bool TrackerOfflineValidation::DirectoryWrapper::dqmMode

Definition at line 190 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

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

Definition at line 188 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

DQMStore* TrackerOfflineValidation::DirectoryWrapper::theDbe

Definition at line 191 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().