CMS 3D CMS Logo

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::unique_ptr< TFileDirectorytfd
 
DQMStoretheDbe
 

Detailed Description

Definition at line 142 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 143 of file TrackerOfflineValidation.cc.

References directoryString, Utilities::operator, and tfd.

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

Definition at line 165 of file TrackerOfflineValidation.cc.

References makeHippyCampaign::basedir, reco::modules::make(), TFileService::mkdir(), dataset::name, anotherprimaryvertexanalyzer_cfi::nBinX, anotherprimaryvertexanalyzer_cfi::nBinY, Utilities::operator, TFileService::tFileDirectory(), and fftjetcommon_cfi::title.

166  : tfd(nullptr),
167  dqmMode(useDqmMode),
168  theDbe(nullptr) {
169  if (!dqmMode){
171  if (newDir.length()==0){
172  tfd.reset(new TFileDirectory(fs->tFileDirectory()));
173  }
174  else {
175  tfd.reset(new TFileDirectory(fs->mkdir(newDir)));
176  directoryString=newDir;
177  }
178  }
179  else {
180  if (newDir.length()!=0){
181  if(basedir.length()!=0)directoryString=basedir+"/"+newDir;
182  else directoryString = newDir;
183  }
186  }
187  }
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 337 of file TrackerOfflineValidation.cc.

References dataset::name, anotherprimaryvertexanalyzer_cfi::nBinX, and fftjetcommon_cfi::title.

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

Definition at line 342 of file TrackerOfflineValidation.cc.

References dataset::name, anotherprimaryvertexanalyzer_cfi::nBinX, and fftjetcommon_cfi::title.

342  {
343  if(dqmMode){
345  //DQM profile requires y-bins for construction... using TProfile creator by hand...
346  TProfile *tmpProfile=new TProfile(name,title,nBinX,xBins);
347  tmpProfile->SetDirectory(nullptr);
348  return theDbe->bookProfile(name,tmpProfile)->getTH1();
349  }
350  else{return tfd->make<TProfile>(name,title,nBinX,xBins);}
351 }
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
MonitorElement * bookProfile(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
Definition: DQMStore.cc:1285
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX 
)

Definition at line 353 of file TrackerOfflineValidation.cc.

References dataset::name, anotherprimaryvertexanalyzer_cfi::nBinX, and fftjetcommon_cfi::title.

353  {
354  if(dqmMode){
356  //DQM profile requires y-bins for construction... using TProfile creator by hand...
357  TProfile *tmpProfile=new TProfile(name,title,nBinX,minBinX,maxBinX);
358  tmpProfile->SetDirectory(nullptr);
359  return theDbe->bookProfile(name,tmpProfile)->getTH1();
360  }
361  else{return tfd->make<TProfile>(name,title,nBinX,minBinX,maxBinX);}
362 }
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
MonitorElement * bookProfile(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
Definition: DQMStore.cc:1285
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nbinX,
double  minX,
double  maxX,
double  minY,
double  maxY 
)

Definition at line 364 of file TrackerOfflineValidation.cc.

References dataset::name, and fftjetcommon_cfi::title.

364  {
365  if(dqmMode){
367  int dummy(0); // DQMProfile wants Y channels... does not use them!
368  return (theDbe->bookProfile(name,title,nbinX,minX,maxX,dummy,minY,maxY)->getTH1());
369  }
370  else{
371  return tfd->make<TProfile>(name,title,nbinX,minX,maxX,minY,maxY);
372  }
373 }
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
MonitorElement * bookProfile(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
Definition: DQMStore.cc:1285
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 375 of file TrackerOfflineValidation.cc.

References dataset::name, anotherprimaryvertexanalyzer_cfi::nBinX, anotherprimaryvertexanalyzer_cfi::nBinY, and fftjetcommon_cfi::title.

375  {
376  if(dqmMode){theDbe->setCurrentFolder(directoryString); return theDbe->book2D(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY)->getTH1();}
377  else{return tfd->make<TH2F>(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY);}
378 }
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1173
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571

Member Data Documentation

std::string TrackerOfflineValidation::DirectoryWrapper::directoryString

Definition at line 195 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

const bool TrackerOfflineValidation::DirectoryWrapper::dqmMode

Definition at line 196 of file TrackerOfflineValidation.cc.

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

Definition at line 194 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

DQMStore* TrackerOfflineValidation::DirectoryWrapper::theDbe

Definition at line 197 of file TrackerOfflineValidation.cc.