Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:46

0001 void directoryCheck(){
0002   //check that the top directory is accurate. simple book-keeping. 
0003   TString this_dir = gSystem->pwd(); //returns linux directory where macro was executed 
0004   //change to be appropriate to the current directory
0005   if ( this_dir != "/afs/cern.ch/user/a/aroe/scratch0/CMSSW_1_1_1/src/OnlineDB/CSCCondDB/test" ){
0006     std::cout << "you aint in images! you in:" << std::endl;
0007     std::cout << this_dir << std::endl;
0008   }
0009 }//directoryCheck()
0010 
0011 void makeDirectory(TString directory_name){
0012   Int_t bool_dir = gSystem->mkdir(directory_name);//0 if there is no directory of this name, -1 if there is 
0013  if (bool_dir == 0){
0014   gSystem->mkdir(directory_name); 
0015   std::cout << "creating directory called " << directory_name << std::endl; 
0016  }
0017  if (bool_dir != 0){
0018    std::cout << "directory called " << directory_name << " already exists" << std::endl;
0019  }   
0020 }
0021 
0022 
0023 void PrintAsGif(TCanvas *CanvasPointer, TString canvName){  
0024   if( (gROOT->IsBatch() ) == 1 ){
0025 
0026     /*
0027     TString CanvName = canvName + ".gif"; 
0028     CanvasPointer->Print(CanvName);     
0029     */
0030         
0031     TString CanvName = canvName + ".eps"; 
0032     CanvasPointer->Print(CanvName);       
0033     
0034     TString pstoString = "pstopnm -ppm -xborder 0 -yborder 0 -xsize 1050 -ysize 625 -portrait "+ CanvName; 
0035     TString togifString = "ppmtogif " + CanvName+ "001.ppm > " + canvName + ".gif"; 
0036     TString rmString1 = "rm " + CanvName+ "001.ppm"; 
0037     TString rmString2 = "rm " + CanvName; 
0038     
0039     gSystem->Exec(pstoString); 
0040     gSystem->Exec(togifString); 
0041     gSystem->Exec(rmString1); 
0042     gSystem->Exec(rmString2);     
0043     
0044   } 
0045 }
0046 
0047