CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Fireworks/Core/src/fwPaths.cc

Go to the documentation of this file.
00001 #include "Fireworks/Core/interface/fwPaths.h"
00002 #include "Fireworks/Core/interface/fwLog.h"      
00003 #include "TString.h"
00004 #include "TSystem.h"
00005 
00006 #include <iostream>
00007 
00008 namespace fireworks  {
00009 
00010 const TString datadir("/src/Fireworks/Core/") ;          
00011 const TString p1 = gSystem->Getenv("CMSSW_BASE") + datadir;      
00012 const TString p2 = gSystem->Getenv("CMSSW_RELEASE_BASE") + datadir;
00013 
00014 void setPath( TString& v)
00015 {
00016    if (gSystem->AccessPathName(p1 + v) == kFALSE)
00017    {
00018       v.Prepend(p1);
00019       return;
00020    }
00021 
00022    v.Prepend(p2);
00023    if (gSystem->AccessPathName(v))
00024    fwLog(fwlog::kError) << "Can't access path " << v << std::endl;
00025 }
00026 }
00027 
00028 
00029