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

References directoryString, dqmMode, cmsCodeRules::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 155 of file TrackerOfflineValidation.cc.

References directoryString, dqmMode, cmsCodeRules::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 346 of file TrackerOfflineValidation.cc.

References AlCaRecoCosmics_cfg::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 335 of file TrackerOfflineValidation.cc.

References displayMF_cfg::maxX, displayMF_cfg::maxY, displayMF_cfg::minX, displayMF_cfg::minY, AlCaRecoCosmics_cfg::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 313 of file TrackerOfflineValidation.cc.

References AlCaRecoCosmics_cfg::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 185 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

Definition at line 186 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

Definition at line 184 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().

Definition at line 187 of file TrackerOfflineValidation.cc.

Referenced by DirectoryWrapper().