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

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

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

◆ DirectoryWrapper() [2/2]

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

Definition at line 187 of file TrackerOfflineValidation.cc.

References makeHippyCampaign::basedir, directoryString, dqmMode, compareTotals::fs, Utilities::operator, tfd, and theDbe.

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

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

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

402  {
403  if (dqmMode) {
405  return theDbe->book1D(name, title, nBinX, minBinX, maxBinX)->getTH1();
406  } else {
407  return tfd->make<TH1F>(name, title, nBinX, minBinX, maxBinX);
408  }
409 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
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 412 of file TrackerOfflineValidation.cc.

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

415  {
416  if (dqmMode) {
418  //DQM profile requires y-bins for construction... using TProfile creator by hand...
419  TProfile* tmpProfile = new TProfile(name, title, nBinX, xBins);
420  tmpProfile->SetDirectory(nullptr);
421  return theDbe->bookProfile(name, tmpProfile)->getTH1();
422  } else {
423  return tfd->make<TProfile>(name, title, nBinX, xBins);
424  }
425 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
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:399
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 428 of file TrackerOfflineValidation.cc.

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

429  {
430  if (dqmMode) {
432  //DQM profile requires y-bins for construction... using TProfile creator by hand...
433  TProfile* tmpProfile = new TProfile(name, title, nBinX, minBinX, maxBinX);
434  tmpProfile->SetDirectory(nullptr);
435  return theDbe->bookProfile(name, tmpProfile)->getTH1();
436  } else {
437  return tfd->make<TProfile>(name, title, nBinX, minBinX, maxBinX);
438  }
439 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
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:399
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 442 of file TrackerOfflineValidation.cc.

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

443  {
444  if (dqmMode) {
446  int dummy(0); // DQMProfile wants Y channels... does not use them!
447  return (theDbe->bookProfile(name, title, nbinX, minX, maxX, dummy, minY, maxY)->getTH1());
448  } else {
449  return tfd->make<TProfile>(name, title, nbinX, minX, maxX, minY, maxY);
450  }
451 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
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:399
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 454 of file TrackerOfflineValidation.cc.

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

461  {
462  if (dqmMode) {
464  return theDbe->book2D(name, title, nBinX, minBinX, maxBinX, nBinY, minBinY, maxBinY)->getTH1();
465  } else {
466  return tfd->make<TH2F>(name, title, nBinX, minBinX, maxBinX, nBinY, minBinY, maxBinY);
467  }
468 }
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
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:212
virtual TH1 * getTH1() const

Member Data Documentation

◆ directoryString

std::string TrackerOfflineValidation::DirectoryWrapper::directoryString

Definition at line 232 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

◆ dqmMode

const bool TrackerOfflineValidation::DirectoryWrapper::dqmMode

Definition at line 233 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

◆ tfd

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

Definition at line 231 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

◆ theDbe

DQMStore* TrackerOfflineValidation::DirectoryWrapper::theDbe

Definition at line 234 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().