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 *xBins)
 
template<>
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)
 
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 minBinX, double maxBinX)
 
template<typename T >
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX, double minBinY, double maxBinY)
 
template<typename T >
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX, int nBinY, double minBinY, double maxBinY)
 
template<>
TH1 * make (const char *name, const char *title, int nBinX, double minBinX, double maxBinX, int nBinY, double minBinY, double maxBinY)
 
template<>
TH1 * make (const char *name, const char *title, int nbinX, double minX, double maxX, double minY, double maxY)
 

Public Attributes

std::string directoryString
 
const bool dqmMode
 
std::unique_ptr< TFileDirectorytfd
 
DQMStoretheDbe
 

Detailed Description

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

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

References directoryString, dqmMode, tfd, and theDbe.

◆ DirectoryWrapper() [2/2]

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

Definition at line 185 of file TrackerOfflineValidation.cc.

186  : tfd(nullptr), dqmMode(useDqmMode), theDbe(nullptr) {
187  if (!dqmMode) {
189  if (newDir.length() == 0) {
190  tfd.reset(new TFileDirectory(fs->tFileDirectory()));
191  } else {
192  tfd.reset(new TFileDirectory(fs->mkdir(newDir)));
193  directoryString = newDir;
194  }
195  } else {
196  if (newDir.length() != 0) {
197  if (basedir.length() != 0)
198  directoryString = basedir + "/" + newDir;
199  else
200  directoryString = newDir;
201  } else
203  theDbe = edm::Service<DQMStore>().operator->();
204  }
205  }

References makeHippyCampaign::basedir, directoryString, dqmMode, TFileService::mkdir(), tfd, TFileService::tFileDirectory(), and theDbe.

Member Function Documentation

◆ make() [1/9]

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

◆ make() [2/9]

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

Definition at line 409 of file TrackerOfflineValidation.cc.

412  {
413  if (dqmMode) {
415  //DQM profile requires y-bins for construction... using TProfile creator by hand...
416  TProfile* tmpProfile = new TProfile(name, title, nBinX, xBins);
417  tmpProfile->SetDirectory(nullptr);
418  return theDbe->bookProfile(name, tmpProfile)->getTH1();
419  } else {
420  return tfd->make<TProfile>(name, title, nBinX, xBins);
421  }
422 }

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

◆ make() [3/9]

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

◆ make() [4/9]

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

◆ make() [5/9]

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

Definition at line 425 of file TrackerOfflineValidation.cc.

426  {
427  if (dqmMode) {
429  //DQM profile requires y-bins for construction... using TProfile creator by hand...
430  TProfile* tmpProfile = new TProfile(name, title, nBinX, minBinX, maxBinX);
431  tmpProfile->SetDirectory(nullptr);
432  return theDbe->bookProfile(name, tmpProfile)->getTH1();
433  } else {
434  return tfd->make<TProfile>(name, title, nBinX, minBinX, maxBinX);
435  }
436 }

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

◆ make() [6/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() [7/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() [8/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 451 of file TrackerOfflineValidation.cc.

458  {
459  if (dqmMode) {
461  return theDbe->book2D(name, title, nBinX, minBinX, maxBinX, nBinY, minBinY, maxBinY)->getTH1();
462  } else {
463  return tfd->make<TH2F>(name, title, nBinX, minBinX, maxBinX, nBinY, minBinY, maxBinY);
464  }
465 }

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

◆ make() [9/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 439 of file TrackerOfflineValidation.cc.

440  {
441  if (dqmMode) {
443  int dummy(0); // DQMProfile wants Y channels... does not use them!
444  return (theDbe->bookProfile(name, title, nbinX, minX, maxX, dummy, minY, maxY)->getTH1());
445  } else {
446  return tfd->make<TProfile>(name, title, nbinX, minX, maxX, minY, maxY);
447  }
448 }

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

Member Data Documentation

◆ directoryString

std::string TrackerOfflineValidation::DirectoryWrapper::directoryString

Definition at line 230 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper(), and make().

◆ dqmMode

const bool TrackerOfflineValidation::DirectoryWrapper::dqmMode

Definition at line 231 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper(), and make().

◆ tfd

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

Definition at line 229 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper(), and make().

◆ theDbe

DQMStore* TrackerOfflineValidation::DirectoryWrapper::theDbe

Definition at line 232 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper(), and make().

TFileService::tFileDirectory
TFileDirectory & tFileDirectory()
Definition: TFileService.h:42
TrackerOfflineValidation::DirectoryWrapper::theDbe
DQMStore * theDbe
Definition: TrackerOfflineValidation.cc:232
TFileDirectory
Definition: TFileDirectory.h:24
HGVHistoProducerAlgoBlock_cfi.minX
minX
Definition: HGVHistoProducerAlgoBlock_cfi.py:153
dqm::implementation::IBooker::bookProfile
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:322
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
multiplicitycorr_cfi.xBins
xBins
Definition: multiplicitycorr_cfi.py:5
makeHippyCampaign.basedir
basedir
Definition: makeHippyCampaign.py:14
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:474
TFileService::mkdir
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
anotherprimaryvertexanalyzer_cfi.nBinY
nBinY
Definition: anotherprimaryvertexanalyzer_cfi.py:13
HGVHistoProducerAlgoBlock_cfi.minY
minY
Definition: HGVHistoProducerAlgoBlock_cfi.py:158
TrackerOfflineValidation::DirectoryWrapper::directoryString
std::string directoryString
Definition: TrackerOfflineValidation.cc:230
edm::Service
Definition: Service.h:30
TrackerOfflineValidation::DirectoryWrapper::tfd
std::unique_ptr< TFileDirectory > tfd
Definition: TrackerOfflineValidation.cc:229
TrackerOfflineValidation::DirectoryWrapper::dqmMode
const bool dqmMode
Definition: TrackerOfflineValidation.cc:231
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
HGVHistoProducerAlgoBlock_cfi.maxY
maxY
Definition: HGVHistoProducerAlgoBlock_cfi.py:159
dqm::implementation::IBooker::book2D
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:177
anotherprimaryvertexanalyzer_cfi.nBinX
nBinX
Definition: anotherprimaryvertexanalyzer_cfi.py:12
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dummy
Definition: DummySelector.h:38
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
HGVHistoProducerAlgoBlock_cfi.maxX
maxX
Definition: HGVHistoProducerAlgoBlock_cfi.py:154