59 const int aDefaultTag=1);
79 Segments(
const string aFilePattern,
const string aDirectory,
const string aTreeName);
89 Segments(
const vector<double> aGpsStarts,
const vector<double> aGpsEnds);
98 Segments(
const double aGpsStart,
const double aGpsEnd,
const int aTag=1);
164 inline double GetEnd(
const unsigned int aSegmentIndex=0){
return seg_end[aSegmentIndex]; };
190 inline int GetTag(
const unsigned int aSegmentIndex=0){
return seg_tag[aSegmentIndex]; };
203 double GetLiveTime(
const double aGpsStart,
const double aGpsEnd);
231 TH1I*
GetHistogram(
const double aGpsStart,
const double aGpsEnd,
const double aOffset=0.0);
255 TTree*
GetTree(
const double aGpsStart,
const double aGpsEnd);
289 inline void SetTag(
const unsigned int aSegmentIndex,
const int aTag){
308 bool Append(
const double aGpsStart,
const double aGpsEnd,
const int aTag=1);
319 bool Append(vector <double> aGpsStarts, vector <double> aGpsEnds, vector <double> aTags);
337 bool Append(TTree *aSegmentTree);
347 bool AddSegment(
const double aGpsStart,
const double aGpsEnd,
const int aTag=1);
365 bool ApplyPadding(
const double aPadStart,
const double aPadEnd);
419 bool Intersect(
const double aGpsStart,
const double aGpsEnd,
const int aTag=1);
434 void Dump(
unsigned int aNcols=2,
const string aTxtFileName=
"");
455 if(aTag1<0||aTag2<0)
return TMath::Min(aTag1,aTag2);
456 return TMath::Max(aTag1,aTag2);
492 int GetMark(
const unsigned int aGps);
Parser for text files with columns.
Monitor a GWOLLUM processing.
Definition Monitor.h:39
bool GetStatus(void)
Returns the object status.
Definition Monitor.h:109
Manage time segment lists.
Definition Segments.h:30
bool TruncateBefore(const double aGps)
Removes segments before a given time.
Definition Segments.cc:826
bool Intersect(Segments *aSeg)
Intersects with a segment list.
Definition Segments.cc:939
vector< double > GetEnds(void)
Returns the list of segment ends.
Definition Segments.h:145
bool IsInsideSegment(unsigned int &aSegmentIndex, const double aGps)
Checks whether a given GPS time is inside a segment of the list.
Definition Segments.cc:466
unsigned int GetN(void)
Returns the number of time segments in the list.
Definition Segments.h:129
bool CheckConsistency(const unsigned int aStartIndex)
Checks the sanity of the segment list.
Definition Segments.cc:1124
bool MakeSecond(void)
Rounds segment boundaries to integer seconds.
Definition Segments.cc:867
unsigned int GetNWithTag(const int aTag)
Returns the number of time segments in the list with a given tag.
Definition Segments.cc:303
vector< double > seg_start
List of segment starts.
Definition Segments.h:439
bool GetStatus(void)
Returns the class status.
Definition Segments.h:111
vector< int > seg_tag
List of segment tags.
Definition Segments.h:441
bool Reverse(void)
Reverses the segment list.
Definition Segments.cc:890
TH1I * GetHisto(const double aOffset=0.0)
Returns an histogram representing the segments.
Definition Segments.h:242
TTree * GetTree(void)
Returns a formatted TTree representing the segments.
Definition Segments.h:263
void ComputeLiveTime(void)
Computes the sgments livetime.
Definition Segments.cc:1244
double GetEnd(const unsigned int aSegmentIndex=0)
Returns the ending time of a given segment.
Definition Segments.h:164
void SetTag(const unsigned int aSegmentIndex, const int aTag)
Tags a given segment.
Definition Segments.h:289
TH1I * GetHistogram(const double aGpsStart, const double aGpsEnd, const double aOffset=0.0)
Returns an histogram representing the segments.
Definition Segments.cc:373
void MergeOverlaps(const unsigned int aStartIndex)
Merges segment overlaps.
Definition Segments.cc:1175
bool AddSegments(Segments *aSeg)
Adds a segment list to the list.
Definition Segments.cc:722
double GetLast()
Returns the ending time of the last segment.
Definition Segments.h:176
void SetMarks(void)
Sets time marks for internal lookup.
Definition Segments.cc:1200
bool AddSegment(const double aGpsStart, const double aGpsEnd, const int aTag=1)
Adds a segment to the list.
Definition Segments.cc:681
double GetLiveTimeWithTag(const int aTag)
Returns the livetime for segments with a given tag.
Definition Segments.cc:358
vector< double > seg_end
List of segment ends.
Definition Segments.h:440
bool TruncateAfter(const double aGps)
Removes segments after a given time.
Definition Segments.cc:786
bool Append(const double aGpsStart, const double aGpsEnd, const int aTag=1)
Appends a segment to the list.
Definition Segments.cc:511
bool ApplyPadding(const double aPadStart, const double aPadEnd)
Apply a padding to all segments.
Definition Segments.cc:746
int GetSegmentStartBefore(const double aGps)
Returns the segment starting just before a given GPS time.
Definition Segments.cc:280
int GetMark(const unsigned int aGps)
Returns the time mark for a given GPS time.
Definition Segments.cc:1226
double GetFirst()
Returns the starting time of the first segment.
Definition Segments.h:170
double GetStart(const unsigned int aSegmentIndex=0)
Returns the starting time of a given segment.
Definition Segments.h:157
vector< unsigned int > n_mark
Segment index marks.
Definition Segments.h:444
double GetDuration(const unsigned int aSegmentIndex=0)
Returns the duration of a given segment.
Definition Segments.h:183
vector< double > GetStarts(void)
Returns the list of segment starts.
Definition Segments.h:140
double GetLiveTime(const unsigned int aSegmentIndex)
Returns the livetime of one segment.
Definition Segments.h:211
Segments(void)
Default constructor of the Segments class.
Definition Segments.cc:21
int GetTag(const unsigned int aSegmentIndex=0)
Returns the tag of a given segment.
Definition Segments.h:190
void Reset(void)
Resets the segment list.
Definition Segments.cc:267
void Dump(unsigned int aNcols=2, const string aTxtFileName="")
Dumps the current segment list in the standard output or in a file.
Definition Segments.cc:1041
vector< int > GetTags(void)
Returns the list of segment tags.
Definition Segments.h:150
double GetLiveTime(void)
Returns the total livetime.
Definition Segments.h:196
Monitor * mon
Class monitor.
Definition Segments.h:438
double seg_livetime
Integrated livetime.
Definition Segments.h:442
vector< unsigned int > time_mark
Time marks.
Definition Segments.h:443
int GetTagProduct(const int aTag1, const int aTag2)
Computes the product of 2 tags.
Definition Segments.h:454
virtual ~Segments(void)
Destructor of the Segments class.
Definition Segments.cc:260
void SetTags(const int aTag)
Tags all segments.
Definition Segments.cc:503