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

Constructor & Destructor Documentation

◆ DirectoryWrapper() [1/2]

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

Definition at line 167 of file TrackerOfflineValidation.cc.

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

171  : tfd(nullptr), dqmMode(useDqmMode), theDbe(nullptr) {
172  if (newDir.length() != 0) {
173  if (upDir.directoryString.length() != 0)
174  directoryString = upDir.directoryString + "/" + newDir;
175  else
176  directoryString = newDir;
177  } else
178  directoryString = upDir.directoryString;
179 
180  if (!dqmMode) {
181  if (newDir.length() == 0)
182  tfd.reset(&(*upDir.tfd));
183  else
184  tfd = std::make_unique<TFileDirectory>(upDir.tfd->mkdir(newDir));
185  } else {
187  }
188  }

◆ DirectoryWrapper() [2/2]

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

Definition at line 190 of file TrackerOfflineValidation.cc.

References mkLumiAveragedPlots::basedir, directoryString, dqmMode, make_classfiles::fs, Utilities::operator, tfd, and theDbe.

191  : tfd(nullptr), dqmMode(useDqmMode), theDbe(nullptr) {
192  if (!dqmMode) {
194  if (newDir.length() == 0) {
195  tfd = std::make_unique<TFileDirectory>(fs->tFileDirectory());
196  } else {
197  tfd = std::make_unique<TFileDirectory>(fs->mkdir(newDir));
198  directoryString = newDir;
199  }
200  } else {
201  if (newDir.length() != 0) {
202  if (basedir.length() != 0)
203  directoryString = basedir + "/" + newDir;
204  else
205  directoryString = newDir;
206  } else
209  }
210  }

Member Function Documentation

◆ make() [1/9]

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

◆ make() [2/9]

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

◆ make() [3/9]

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 
)

◆ make() [4/9]

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

◆ make() [5/9]

template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX 
)

Definition at line 404 of file TrackerOfflineValidation.cc.

References mergeVDriftHistosByStation::name, anotherprimaryvertexanalyzer_cfi::nBinX, and runGCPTkAlMap::title.

405  {
406  if (dqmMode) {
408  return theDbe->book1D(name, title, nBinX, minBinX, maxBinX)->getTH1();
409  } else {
410  return tfd->make<TH1F>(name, title, nBinX, minBinX, maxBinX);
411  }
412 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
virtual TH1 * getTH1() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ make() [6/9]

template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double *  xBins 
)

Definition at line 415 of file TrackerOfflineValidation.cc.

References mergeVDriftHistosByStation::name, anotherprimaryvertexanalyzer_cfi::nBinX, runGCPTkAlMap::title, and multiplicitycorr_cfi::xBins.

418  {
419  if (dqmMode) {
421  //DQM profile requires y-bins for construction... using TProfile creator by hand...
422  TProfile* tmpProfile = new TProfile(name, title, nBinX, xBins);
423  tmpProfile->SetDirectory(nullptr);
424  return theDbe->bookProfile(name, tmpProfile)->getTH1();
425  } else {
426  return tfd->make<TProfile>(name, title, nBinX, xBins);
427  }
428 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:408
virtual TH1 * getTH1() const

◆ make() [7/9]

template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX 
)

Definition at line 431 of file TrackerOfflineValidation.cc.

References mergeVDriftHistosByStation::name, anotherprimaryvertexanalyzer_cfi::nBinX, and runGCPTkAlMap::title.

432  {
433  if (dqmMode) {
435  //DQM profile requires y-bins for construction... using TProfile creator by hand...
436  TProfile* tmpProfile = new TProfile(name, title, nBinX, minBinX, maxBinX);
437  tmpProfile->SetDirectory(nullptr);
438  return theDbe->bookProfile(name, tmpProfile)->getTH1();
439  } else {
440  return tfd->make<TProfile>(name, title, nBinX, minBinX, maxBinX);
441  }
442 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:408
virtual TH1 * getTH1() const

◆ make() [8/9]

template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nbinX,
double  minX,
double  maxX,
double  minY,
double  maxY 
)

Definition at line 445 of file TrackerOfflineValidation.cc.

References HGVHistoProducerAlgoBlock_cfi::maxX, HGVHistoProducerAlgoBlock_cfi::maxY, HGVHistoProducerAlgoBlock_cfi::minX, HGVHistoProducerAlgoBlock_cfi::minY, mergeVDriftHistosByStation::name, and runGCPTkAlMap::title.

446  {
447  if (dqmMode) {
449  int dummy(0); // DQMProfile wants Y channels... does not use them!
450  return (theDbe->bookProfile(name, title, nbinX, minX, maxX, dummy, minY, maxY)->getTH1());
451  } else {
452  return tfd->make<TProfile>(name, title, nbinX, minX, maxX, minY, maxY);
453  }
454 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:408
virtual TH1 * getTH1() const

◆ make() [9/9]

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

References mergeVDriftHistosByStation::name, anotherprimaryvertexanalyzer_cfi::nBinX, anotherprimaryvertexanalyzer_cfi::nBinY, and runGCPTkAlMap::title.

464  {
465  if (dqmMode) {
467  return theDbe->book2D(name, title, nBinX, minBinX, maxBinX, nBinY, minBinY, maxBinY)->getTH1();
468  } else {
469  return tfd->make<TH2F>(name, title, nBinX, minBinX, maxBinX, nBinY, minBinY, maxBinY);
470  }
471 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:656
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
virtual TH1 * getTH1() const

Member Data Documentation

◆ directoryString

std::string TrackerOfflineValidation::DirectoryWrapper::directoryString

Definition at line 235 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

◆ dqmMode

const bool TrackerOfflineValidation::DirectoryWrapper::dqmMode

Definition at line 236 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

◆ tfd

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

Definition at line 234 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

◆ theDbe

DQMStore* TrackerOfflineValidation::DirectoryWrapper::theDbe

Definition at line 237 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().