CMS 3D CMS Logo

Public Member Functions | Public Attributes

TrackerOfflineValidation::DirectoryWrapper Struct Reference

List of all members.

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<>
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 *xBins)
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<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)
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 136 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 137 of file TrackerOfflineValidation.cc.

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

      : tfd(0),
        dqmMode(useDqmMode),
        theDbe(0) {
      if (newDir.length()!=0){
        if(upDir.directoryString.length()!=0)directoryString=upDir.directoryString+"/"+newDir;
        else directoryString = newDir;
      }
      else
        directoryString=upDir.directoryString;

      if (!dqmMode){
        if (newDir.length()==0) tfd.reset(&(*upDir.tfd));
        else
          tfd.reset(new TFileDirectory(upDir.tfd->mkdir(newDir)));
      }
      else {
        theDbe=edm::Service<DQMStore>().operator->();
      }
    }
TrackerOfflineValidation::DirectoryWrapper::DirectoryWrapper ( const std::string &  newDir,
const std::string &  basedir,
bool  useDqmMode 
) [inline]

Definition at line 159 of file TrackerOfflineValidation.cc.

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

      : tfd(0),
        dqmMode(useDqmMode),
        theDbe(0) {
      if (!dqmMode){
        edm::Service<TFileService> fs;
        if (newDir.length()==0){
          tfd.reset(new TFileDirectory(static_cast<TFileDirectory&>(*fs)));
        }
        else {
          tfd.reset(new TFileDirectory(fs->mkdir(newDir)));
          directoryString=newDir;
        }
      }
      else {
        if (newDir.length()!=0){
          if(basedir.length()!=0)directoryString=basedir+"/"+newDir;
          else directoryString = newDir;
        }
        else directoryString=basedir;
        theDbe=edm::Service<DQMStore>().operator->();
      }
    }

Member Function Documentation

TH1 * TrackerOfflineValidation::DirectoryWrapper::make< TProfile > ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX 
)
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 347 of file TrackerOfflineValidation.cc.

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

                                                                                                                                                                                       {
  if(dqmMode){theDbe->setCurrentFolder(directoryString); return theDbe->book2D(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY)->getTH1();}
  else{return tfd->make<TH2F>(name,title,nBinX,minBinX,maxBinX,nBinY,minBinY,maxBinY);}
}
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nbinX,
double  minX,
double  maxX,
double  minY,
double  maxY 
)

Definition at line 336 of file TrackerOfflineValidation.cc.

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

                                                                                                                                                                       {
  if(dqmMode){
    theDbe->setCurrentFolder(directoryString);
    int dummy(0); // DQMProfile wants Y channels... does not use them!
    return (theDbe->bookProfile(name,title,nbinX,minX,maxX,dummy,minY,maxY)->getTH1());
  }
  else{
    return tfd->make<TProfile>(name,title,nbinX,minX,maxX,minY,maxY);
  }
}
template<>
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double *  xBins 
)

Definition at line 314 of file TrackerOfflineValidation.cc.

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

                                                                                                                                   {
  if(dqmMode){
    theDbe->setCurrentFolder(directoryString);
    //DQM profile requires y-bins for construction... using TProfile creator by hand...
    TProfile *tmpProfile=new TProfile(name,title,nBinX,xBins);
    tmpProfile->SetDirectory(0);
    return theDbe->bookProfile(name,tmpProfile)->getTH1();
  }
  else{return tfd->make<TProfile>(name,title,nBinX,xBins);}
}
template<typename T >
TH1* TrackerOfflineValidation::DirectoryWrapper::make ( const char *  name,
const char *  title,
int  nBinX,
double  minBinX,
double  maxBinX,
double  minBinY,
double  maxBinY 
)
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 *  xBins 
)

Member Data Documentation

Definition at line 189 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

Definition at line 190 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

Definition at line 188 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

Definition at line 191 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().