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

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

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

Definition at line 155 of file TrackerOfflineValidation.cc.

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

156  : tfd(0),
157  dqmMode(useDqmMode),
158  theDbe(0) {
159  if (!dqmMode){
161  if (newDir.length()==0){
162  tfd.reset(new TFileDirectory(static_cast<TFileDirectory&>(*fs)));
163  }
164  else {
165  tfd.reset(new TFileDirectory(fs->mkdir(newDir)));
166  directoryString=newDir;
167  }
168  }
169  else {
170  if (newDir.length()!=0){
171  if(basedir.length()!=0)directoryString=basedir+"/"+newDir;
172  else directoryString = newDir;
173  }
174  else directoryString=basedir;
176  }
177  }
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 305 of file TrackerOfflineValidation.cc.

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

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

Definition at line 310 of file TrackerOfflineValidation.cc.

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

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

Definition at line 321 of file TrackerOfflineValidation.cc.

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

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

Definition at line 332 of file TrackerOfflineValidation.cc.

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

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

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

343  {
344  if(dqmMode){theDbe->setCurrentFolder(directoryString); return theDbe->book2D(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY)->getTH1();}
345  else{return tfd->make<TH2F>(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY);}
346 }
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:642
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232

Member Data Documentation

std::string TrackerOfflineValidation::DirectoryWrapper::directoryString

Definition at line 185 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

const bool TrackerOfflineValidation::DirectoryWrapper::dqmMode

Definition at line 186 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

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

Definition at line 184 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

DQMStore* TrackerOfflineValidation::DirectoryWrapper::theDbe

Definition at line 187 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().