/
ValRange.h
79 lines (60 loc) · 2.34 KB
/
ValRange.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef VALRANGE_H
#define VALRANGE_H
#include "TObject.h"
#include "TString.h"
#include "Detector.h"
#include "ValTimeStamp.h"
#include <iostream>
using namespace std;
class ValContext;
class ValRange;
std::ostream& operator<<(std::ostream& os, const ValRange& vldr);
class ValRange : public TObject
{
public:
ValRange();
ValRange(const Int_t detMask, const Int_t simMask,
const ValTimeStamp& tstart, const ValTimeStamp& tend,
const TString& source);
virtual ~ValRange();
/** Return the ValRange as a string
*
* Result is a pointer to a statically allocated string.
* User should copy this into their own buffer before calling
* this method again.
*
* option "a": give detector/simflag masks as alpha chars
* option "c": compact (single line)
* option "s": drop nsec part of times
* option "1": include only "start time"
* option "-": don't include "source" info
*/
const char* AsString(Option_t* option = "") const;
/** Compare ValContext with this ValRange to see if the
* the tagged set is compatible.*/
Bool_t IsCompatible(const ValContext& vldc) const;
/** Compare ValContext with this ValRange to see if the
* the tagged set is compatible.*/
Bool_t IsCompatible(const ValContext* vldc) const;
Int_t GetDetectorMask() const { return fDetectorMask; }
Int_t GetSimMask() const { return fSimMask; }
ValTimeStamp GetTimeStart() const { return fTimeStart; }
ValTimeStamp GetTimeEnd() const { return fTimeEnd; }
TString GetDataSource() const { return fDataSource; }
/// Print to stdout. See AsString() for options.
void Print(Option_t* option = "") const;
/// Trim this range to the intersection (ie. more restricted)
/// limits of it's initial value and that of the argument
void TrimTo(const ValRange& vldr);
void SetTimeStart(const ValTimeStamp& tstart) { fTimeStart = tstart; }
void SetTimeEnd(const ValTimeStamp& tend) { fTimeEnd = tend; }
protected:
Int_t fDetectorMask; /// or's Detector::Detector_t
Int_t fSimMask; /// or's of data/mc conditions
ValTimeStamp fTimeStart;
ValTimeStamp fTimeEnd;
TString fDataSource;
private:
ClassDef(ValRange,1) // ValRange version 1
};
#endif // VALRANGE_H