Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:23:59

0001 #ifndef MACRO_GET_RUNSTR_H
0002 #define MACRO_GET_RUNSTR_H
0003 
0004 #include <TString.h>
0005 
0006 #include <iostream>
0007 
0008 TString get_runstr(const char *fname)
0009 {
0010   TString name = fname;
0011   name.ReplaceAll(".prdf","");
0012   name.ReplaceAll(".root","");
0013   int index = name.Last('/');
0014   if ( index > 0 )
0015   {
0016     name.Remove(0,index+1);
0017   }
0018   index = name.First('-');
0019   if ( index > 0 )
0020   {
0021     name.Remove(0,index+1);
0022   }
0023   //std::cout << "aaa " << name << std::endl;
0024 
0025   /*
0026   index = name.Last('-');
0027   if ( index > 0 )
0028   {
0029     name.Remove(index,name.Length());
0030   }
0031   //std::cout << "bbb " << name << std::endl;
0032   */
0033 
0034   return name;
0035 
0036 }
0037 
0038 int get_runnumber(const char *fname)
0039 {
0040   TString str = get_runstr(fname);
0041   std::cout << str << std::endl;
0042   int index = str.Last('-');
0043   if ( index > 0 )
0044   {
0045     str.Remove(index,str.Length());
0046   }
0047   std::cout << " get_runnumber " << str << "\t" << str.Atoi() << std::endl;
0048   return str.Atoi();
0049 }
0050 
0051 namespace MBDRUNS {
0052   enum type {
0053     AUAU200 = 0,
0054     PP200,
0055     SIMAUAU200,
0056     SIMPP200
0057   };
0058 }
0059 
0060 #endif  // __get_runstr__