StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Common.h
1 #ifndef FWD_TRACK_MAKER_COMMON_H
2 #define FWD_TRACK_MAKER_COMMON_H
3 
4 #include "TAxis.h"
5 #include <vector>
6 #include <string>
7 #include <chrono>
8 
10  public:
11  static void labelAxis( TAxis *axis, std::vector<std::string> labels )
12  {
13  if ( !axis ) return;
14 
15  for ( unsigned int i = 0; i <= (unsigned int)axis->GetNbins(); i++ ) {
16  if ( i < labels.size() )
17  axis->SetBinLabel( i + 1, labels[i].c_str() );
18  }
19  }
20 
21  static long long nowNanoSecond(){
22  return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
23  }
24 };
25 
26 #endif