1 |
/**********************************************************************************
|
2 |
* @Project: SFrame - ROOT-based analysis framework
|
3 |
* @Package: SFrame
|
4 |
* @Class : LuminosityUtils
|
5 |
*
|
6 |
* @brief : This is a collection of classes which are used
|
7 |
* by the LuminosityHandler.
|
8 |
*
|
9 |
* @author : Martin Goebel (martin.goebel@desy.de)
|
10 |
*
|
11 |
**********************************************************************************/
|
12 |
|
13 |
#ifndef SFRAME_LuminosityUtils_H
|
14 |
#define SFRAME_LuminosityUtils_H
|
15 |
|
16 |
// STL include(s):
|
17 |
#include <iostream>
|
18 |
|
19 |
namespace LuminosityUtils {
|
20 |
|
21 |
// class merged run Nr and LB Nr
|
22 |
class RunNr_LbNr{
|
23 |
public:
|
24 |
RunNr_LbNr() {
|
25 |
runNr = 0;
|
26 |
lbNr = 0;
|
27 |
}
|
28 |
RunNr_LbNr( const RunNr_LbNr& obj ) {
|
29 |
runNr = obj.runNr;
|
30 |
lbNr = obj.lbNr;
|
31 |
}
|
32 |
RunNr_LbNr(long rNr, long lNr) {
|
33 |
runNr = rNr;
|
34 |
lbNr = lNr;
|
35 |
}
|
36 |
~RunNr_LbNr(){}
|
37 |
|
38 |
long runNr;
|
39 |
long lbNr;
|
40 |
|
41 |
// overloading operators (inline implementation)
|
42 |
RunNr_LbNr& operator = ( const RunNr_LbNr& obj ) {
|
43 |
runNr = obj.runNr;
|
44 |
lbNr = obj.lbNr;
|
45 |
return *this;
|
46 |
}
|
47 |
friend bool operator== ( const RunNr_LbNr lhs, const RunNr_LbNr rhs ) {
|
48 |
return ( lhs.runNr == rhs.runNr && lhs.lbNr == rhs.lbNr );
|
49 |
}
|
50 |
friend bool operator< ( const RunNr_LbNr lhs, const RunNr_LbNr rhs ) {
|
51 |
return ( lhs.runNr < rhs.runNr ) || ( lhs.runNr == rhs.runNr&& lhs.lbNr < rhs.lbNr );
|
52 |
}
|
53 |
friend bool operator<= ( const RunNr_LbNr lhs, const RunNr_LbNr rhs ) {
|
54 |
return ( lhs.runNr < rhs.runNr ) || ( lhs.runNr == rhs.runNr&& lhs.lbNr <= rhs.lbNr );
|
55 |
}
|
56 |
friend bool operator> ( const RunNr_LbNr lhs, const RunNr_LbNr rhs ) {
|
57 |
return ( lhs.runNr > rhs.runNr ) || ( lhs.runNr == rhs.runNr&& lhs.lbNr > rhs.lbNr );
|
58 |
}
|
59 |
friend bool operator>= ( const RunNr_LbNr lhs, const RunNr_LbNr rhs ) {
|
60 |
return ( lhs.runNr > rhs.runNr ) || ( lhs.runNr == rhs.runNr&& lhs.lbNr >= rhs.lbNr );
|
61 |
}
|
62 |
friend bool operator!= ( const RunNr_LbNr lhs, const RunNr_LbNr rhs ) {
|
63 |
return !(lhs == rhs);
|
64 |
}
|
65 |
friend ostream& operator<< (ostream& os, RunNr_LbNr& obj){
|
66 |
os << "(Run Nr, LB Nr) = (" << obj.runNr << ", " << obj.lbNr << ")";
|
67 |
return os;
|
68 |
}
|
69 |
}; // end RunNr_LbNr class
|
70 |
|
71 |
|
72 |
// class containing LumiBin infos
|
73 |
class LumiBinInfo{
|
74 |
public:
|
75 |
LumiBinInfo(){}
|
76 |
~LumiBinInfo(){}
|
77 |
|
78 |
RunNr_LbNr start_runNrLbNr;
|
79 |
RunNr_LbNr end_runNrLbNr;
|
80 |
Double_t lumiInBin;
|
81 |
}; // end LumiBinInfo class
|
82 |
|
83 |
};
|
84 |
|
85 |
|
86 |
#endif // SFRAME_LuminosityUtils_H
|
87 |
|