EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDbSqlContext.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairDbSqlContext.cxx
1 
2 #include "FairDbSqlContext.h"
3 
4 
6 
7 FairDbSqlContext::FairDbSqlContext(const std::string& ctxt)
8  : FairDbString(ctxt),
9  fIntervalType(kUndefined),
10  fTimeStart(),
11  fTimeEnd(),
12  fDetType(Detector::kUnknown),
13  fSimType(SimFlag::kUnknown)
14 {
15 
16 }
17 
20  ValTimeStamp end,
23  : FairDbString(),
24  fIntervalType(interval),
25  fTimeStart(start),
26  fTimeEnd(end),
27  fDetType(det),
28  fSimType(sim)
29 {
30 
31  switch (interval) {
32 
33  case kBefore:
34  (*this) << "TIMEEND <= \'" << start.AsString("s") << '\'';
35  break;
36 
37  case kAfter:
38  (*this) << "TIMESTART >= \'" << end.AsString("s") << '\'';
39  break;
40 
41  case kMisses:
42  (*this) << "TIMESTART >= \'" << end.AsString("s") << '\''
43  << " or TIMEEND <= \'" << start.AsString("s") << '\'';
44  break;
45 
46  case kThroughout:
47  (*this) << "TIMESTART <= \'" << start.AsString("s") << '\''
48  << " and TIMEEND >= \'" << end.AsString("s") << '\'';
49  break;
50 
51  case kWithin:
52  (*this) << "TIMESTART >= \'" << start.AsString("s") << '\''
53  << " and TIMEEND <= \'" << end.AsString("s") << '\'';
54  break;
55 
56  case kOverlaps:
57  (*this) << "TIMESTART < \'" << end.AsString("s") << '\''
58  << " and TIMEEND > \'" << start.AsString("s") << '\'';
59  break;
60 
61  case kStarts:
62  (*this) << "TIMESTART >= \'" << start.AsString("s") << '\''
63  << " and TIMESTART < \'" << end.AsString("s") << '\'';
64  break;
65 
66  case kEnds:
67  (*this) << "TIMEEND > \'" << start.AsString("s") << '\''
68  << " and TIMEEND <= \'" << end.AsString("s") << '\'';
69  break;
70 
71  default:
72  (*this) << " 1 = 0 "; //An impossible condition (hopefully)
73  }
74 
75  (*this) << " and DetectorMask & " << static_cast<unsigned int>(fDetType)
76  << " and SimMask & " << static_cast<unsigned int>(fSimType);
77 }
78 
79 
80 
82 {
83 
84 }