NAIA  1.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
RTIInfo.h
Go to the documentation of this file.
1 
7 #ifndef NAIA_RTIINFO_H
8 #define NAIA_RTIINFO_H
9 
10 // gbatch headers
11 #ifdef ENABLE_PRODUCTION_CODE
12 #include "root_setup.h"
13 #endif
14 
15 #include "Rtypes.h"
16 #include "TGraph.h"
17 #include "TObject.h"
18 
19 #include <array>
20 #include <map>
21 #include <time.h>
22 
23 namespace NAIA {
24 
33 class RTIInfo : public TObject {
34 public:
39  void Clear();
40 
45  void Dump() const;
46 
47  unsigned int Year();
48  unsigned int Month();
49  unsigned int DayOfMonth();
50  unsigned int DayOfYear();
51  unsigned int Hour();
52  unsigned int Minute();
53  unsigned int Second();
54 
58  bool IsInSAA() const;
59 
60  static constexpr unsigned int nrigbins = 20;
61  static constexpr unsigned int nbetabins = 9;
62  static constexpr unsigned int nqbins = 9;
63 
64  unsigned int Run = 0;
65  unsigned int RunTag = 0;
66  unsigned int FirstEvNo = 0;
67  unsigned int LastEvNo = 0;
69 
70  // clang-format off
71  std::array<std::array<float, 2>, 4> MaxStoermerCutoff;
72  std::array<std::array<float, 2>, 4> MaxIGRFCutoff;
73  std::array<std::array<float, 2>, 2> MinIGRFCutoff;
75  float Theta;
76  float Phi;
77  float Altitude;
78  float Zenith;
79  float GalacticLat;
80  float GalacticLong;
81  float nEvent;
82  float nError;
83  float nTrigger;
84  float nHWError;
86  std::array<std::array<float, 2>, 2> nEventInnerL1L9;
87  std::array<std::array<float, 3>, 2> MeanAlignDiffExtLayer;
88  // clang-format on
89  float nTRDHitAvg;
90  float nTrClusterAvg;
91  int good;
92  unsigned int UTCTime;
93 
94  bool DSPError;
95  bool DSPErrorJINJ;
96  bool DSPErrorJINF;
97  bool DSPErrorJLV1;
98 
100  float MagPhiSphCoo;
101  float MagAltSphCoo;
102  float LShell;
103 
104  float nTRDTrack;
105  float nTRDHits;
106  std::array<float, 20> nTRDLayerHits;
107 
108  float nEcalShower;
109  float nEcalHits;
110 
111  float nTrClusterX;
112  float nTrClusterY;
115 
116  float nTofClusterH;
117 
118  float nParticle;
120  float nPartTrkInn;
121  float nPartTrk;
122  // clang-format off
123  std::array<std::array<float, nrigbins + 1>, nqbins + 1> nPartRate;
124  std::array<std::array<float, nbetabins + 1>, nqbins + 1> nPartBetaRate;
125  std::array<std::array<float, nrigbins + 1>, nqbins + 1> nPartInnRate;
126  // clang-format on
127  std::array<float, nqbins + 1> nPartAboveCutoff;
128  std::array<float, nqbins + 1> nPartBelowCutoff;
129 
130  float nTrk;
131  float nTrkInn;
132  // clang-format off
133  std::array<std::array<float, nrigbins + 1>, nqbins + 1> nTrkRate;
134  std::array<std::array<float, nrigbins + 1>, nqbins + 1> nTrkInnRate;
135  // clang-format on
136 
137  std::array<float, 8> TrigPhysBPatt;
138  std::array<float, 16> TrigJMembPatt;
139  std::array<float, 19> TrigRates;
140  float nACC;
141  std::array<float, 16> TofFlags;
142 
143  float TofRaw_nstdc;
144  float TofRaw_nftdc;
145  float TofRaw_nsumh;
147 
150 
151  float nRoomError;
152 
153 #ifdef ENABLE_PRODUCTION_CODE
154  void Fill(AMSSetupR::RTI *rtiPtr, unsigned int runTag);
155  void AccumulateEventVariables(AMSEventR *evPtr);
156  void FillEventVariables();
157 #endif
158 
159  static const std::array<float, nrigbins + 1> rigbins;
160  static const std::array<float, nbetabins + 1> betabins;
161 
162  // clang-format off
163  static const std::map<unsigned int, std::pair<float, float>> qbins;
164  // clang-format on
165 
166 private:
167  void UpdateTM();
168 
170  unsigned long long m_processedEvents = 0;
171 
172  static TGraph m_saaEdge;
173 
174  ClassDef(RTIInfo, 1);
175 };
176 
177 } // namespace NAIA
178 
179 #endif
unsigned int Month()
Get the current month [1-12].
Definition: RTIInfo.cpp:36
float nTrigger
Number of events with trigger in this second.
Definition: RTIInfo.h:83
float nPartTrkInn
Average number of ParticleR with InnerTracker track.
Definition: RTIInfo.h:120
float nTRDHitAvg
Average number of TRD raw hits for one event.
Definition: RTIInfo.h:89
void Clear()
Clear container content.
Definition: RTIInfo.cpp:135
bool DSPErrorJLV1
Has a DSP error occurred in JLV1 in this second?
Definition: RTIInfo.h:97
float nEventParticle
Number of events with tof+trd+tracker+ecal data.
Definition: RTIInfo.h:85
float Altitude
Altitude (gtod coordinate system) (cm)
Definition: RTIInfo.h:77
std::array< std::array< float, 2 >, 4 > MaxStoermerCutoff
Max Stoermer cutoff within a 25,30,35,40 degrees field of view (for both negative and positive partic...
Definition: RTIInfo.h:71
unsigned int LastEvNo
Last event no in this second.
Definition: RTIInfo.h:67
unsigned int FirstEvNo
First event nnumber in this second.
Definition: RTIInfo.h:66
unsigned int RunTag
Run tag.
Definition: RTIInfo.h:65
std::array< std::array< float, 2 >, 4 > MaxIGRFCutoff
Max IGRF cutoff within a 25,30,35,40 degrees field of view (for both negative and positive particles)...
Definition: RTIInfo.h:72
float nACC
Average number of ACC sectors.
Definition: RTIInfo.h:140
ClassDef(RTIInfo, 1)
std::array< std::array< float, nbetabins+1 >, nqbins+1 > nPartBetaRate
Average number of ParticleR object divided by charge and beta.
Definition: RTIInfo.h:124
static const std::array< float, nbetabins+1 > betabins
Bin edges for beta-binned variables.
Definition: RTIInfo.h:160
std::array< float, 16 > TofFlags
Average value of TofFlags.
Definition: RTIInfo.h:141
std::array< std::array< float, nrigbins+1 >, nqbins+1 > nTrkInnRate
Average number of TrTrackR object divided by charge and rigidity (inner tracker fit) ...
Definition: RTIInfo.h:134
std::array< float, nqbins+1 > nPartAboveCutoff
Average number of ParticleR objects above cutoff.
Definition: RTIInfo.h:127
float nTrClusterL1X
Average number of TrRawCluster on x side of L1.
Definition: RTIInfo.h:113
float nTrClusterY
Average number of TrRawCluster on y side.
Definition: RTIInfo.h:112
std::array< std::array< float, nrigbins+1 >, nqbins+1 > nTrkRate
Average number of TrTrackR object divided by charge and rigidity.
Definition: RTIInfo.h:133
std::array< float, 8 > TrigPhysBPatt
Average fraction of each trigger pattern.
Definition: RTIInfo.h:137
static constexpr unsigned int nqbins
Definition: RTIInfo.h:62
std::array< float, 16 > TrigJMembPatt
Average fraction of each trigger pattern.
Definition: RTIInfo.h:138
float nHWError
Number of events with HW error (from JINJStatus)
Definition: RTIInfo.h:84
float nParticle
Average number of ParticleR objects.
Definition: RTIInfo.h:118
float nTrkInn
Average number of TrTrackR objects with inner fit.
Definition: RTIInfo.h:131
std::array< float, nqbins+1 > nPartBelowCutoff
Average number of ParticleR objects below cutoff.
Definition: RTIInfo.h:128
unsigned int Minute()
Get the current minute [0-59].
Definition: RTIInfo.cpp:56
float MagAltSphCoo
Magnetic coordinates altitude.
Definition: RTIInfo.h:101
float nTrClusterAvg
Average number of Tracker raw clusters for one event.
Definition: RTIInfo.h:90
float MostProbableHeRig
Most probable He rigidity for this second;.
Definition: RTIInfo.h:74
float LivetimeFraction
Livetime fraction during this second.
Definition: RTIInfo.h:68
float nTRDHits
Average number of total TrdRawHit.
Definition: RTIInfo.h:105
float nEcalShower
Average number of EcalShower objects.
Definition: RTIInfo.h:108
float Phi
Phi (gtod coordinate system) (rad)
Definition: RTIInfo.h:76
float nTrk
Average number of TrTrackR objects with default fit.
Definition: RTIInfo.h:130
void UpdateTM()
Definition: RTIInfo.cpp:21
float TofRaw_nsumh
High Threshold history.
Definition: RTIInfo.h:145
unsigned int UTCTime
JMDC unix time (seconds since 1 Jan 1970)
Definition: RTIInfo.h:92
float Theta
Theta (gtod coordinate system) (rad)
Definition: RTIInfo.h:75
static constexpr unsigned int nbetabins
Definition: RTIInfo.h:61
bool DSPErrorJINF
Has a DSP error occurred in JINF in this second?
Definition: RTIInfo.h:96
float GalacticLong
Galactic longitude of AMS pointing direction (degrees)
Definition: RTIInfo.h:80
float Zenith
AMS zenith angle (degrees)
Definition: RTIInfo.h:78
std::array< std::array< float, 2 >, 2 > nEventInnerL1L9
Number of events with a track with layer 1 and layer 9 XY hit.
Definition: RTIInfo.h:86
static const std::map< unsigned int, std::pair< float, float > > qbins
Bin edges for charge-binned variables, depending on particle species.
Definition: RTIInfo.h:163
bool DSPError
Has a DSP error occurred in this second?
Definition: RTIInfo.h:94
float nEcalHits
Average number of EcalHit objects.
Definition: RTIInfo.h:109
float MagThetaSphCoo
Magnetic coordinates theta.
Definition: RTIInfo.h:99
float TofRaw_nftdc
Fast Trigger history.
Definition: RTIInfo.h:144
float nEvent
Total number of events in this second.
Definition: RTIInfo.h:81
unsigned int Second()
Get the current second [0-59].
Definition: RTIInfo.cpp:61
float MagPhiSphCoo
Magnetic coordinates phi.
Definition: RTIInfo.h:100
std::array< float, 19 > TrigRates
Average value of trigger rates.
Definition: RTIInfo.h:139
static TGraph m_saaEdge
Definition: RTIInfo.h:172
float nError
Number of missing events due to errors.
Definition: RTIInfo.h:82
float nPartTrk
Average number of ParticleR with Tracker track.
Definition: RTIInfo.h:121
unsigned int DayOfYear()
Get the current day of the year [1-366].
Definition: RTIInfo.cpp:46
unsigned long long m_processedEvents
Definition: RTIInfo.h:170
std::array< float, 20 > nTRDLayerHits
Average number of TRD hits in each layer.
Definition: RTIInfo.h:106
unsigned int DayOfMonth()
Get the current day of the month [1-31].
Definition: RTIInfo.cpp:41
int good
0 if good (Thanks, Qi. Very descriptive)
Definition: RTIInfo.h:91
float nTrClusterX
Average number of TrRawCluster on x side.
Definition: RTIInfo.h:111
std::array< std::array< float, 3 >, 2 > MeanAlignDiffExtLayer
mean difference(um) bewteen PG ad CIEMAT alignment of L1 and L9(XYZ)
Definition: RTIInfo.h:87
bool IsInSAA() const
Check if the ISS is in the SAA for this second.
Definition: RTIInfo.cpp:66
tm m_humanTime
Definition: RTIInfo.h:169
void Dump() const
Dump on screen container content.
Definition: RTIInfo.cpp:176
float LShell
L shell.
Definition: RTIInfo.h:102
float AntiRaw_nftdc
Fast Trigger history.
Definition: RTIInfo.h:149
std::array< std::array< float, 2 >, 2 > MinIGRFCutoff
Min IGRF cutoff within a 25,40 degrees field of view (for both negative and positive particles) ...
Definition: RTIInfo.h:73
float nTofClusterH
Average number of TofClusterH objects.
Definition: RTIInfo.h:116
float nGoodParticle
Average number of &quot;good&quot; ParticleR objects.
Definition: RTIInfo.h:119
float TofRaw_nstdc
Low Threshold history.
Definition: RTIInfo.h:143
std::array< std::array< float, nrigbins+1 >, nqbins+1 > nPartRate
Average number of ParticleR object divided by charge and rigidity.
Definition: RTIInfo.h:123
unsigned int Year()
Get the current year.
Definition: RTIInfo.cpp:31
float AntiRaw_ntdct
Low Threshold history.
Definition: RTIInfo.h:148
std::array< std::array< float, nrigbins+1 >, nqbins+1 > nPartInnRate
Average number of ParticleR object divided by charge and rigidity (inner tracker fit) ...
Definition: RTIInfo.h:125
unsigned int Hour()
Get the current hour [0-23].
Definition: RTIInfo.cpp:51
bool DSPErrorJINJ
Has a DSP error occurred in JINJ in this second?
Definition: RTIInfo.h:95
float nTRDTrack
Average number of TrdTrack objects.
Definition: RTIInfo.h:104
float TofRaw_nsumsh
Super-High Threshold history.
Definition: RTIInfo.h:146
static constexpr unsigned int nrigbins
Definition: RTIInfo.h:60
float nTrClusterL1Y
Average number of TrRawCluster on y side of L1.
Definition: RTIInfo.h:114
float GalacticLat
Galactic latitude of AMS pointing direction (degrees)
Definition: RTIInfo.h:79
static const std::array< float, nrigbins+1 > rigbins
Bin edges for rigidity-binned variables.
Definition: RTIInfo.h:159
Container class for RTI info.
Definition: RTIInfo.h:33
float nRoomError
Average number of room errors.
Definition: RTIInfo.h:151
unsigned int Run
Run number.
Definition: RTIInfo.h:64