NAIA  1.1.1
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  [[nodiscard]] 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;
74  std::array<double, 3> IGRFMagField;
75  float Bm;
76  float I;
77  float BEq;
78  float L;
80  float Theta;
81  float Phi;
82  float Altitude;
83  float Zenith;
84  float Roll;
85  float Pitch;
86  float Yaw;
87  float Velocity_s;
89  float Velocity_phi;
90  float GalacticLat;
91  float GalacticLong;
92  float nEvent;
93  float nError;
94  float nTrigger;
95  float nHWError;
97  std::array<std::array<float, 2>, 2> nEventInnerL1L9;
98  std::array<std::array<float, 3>, 2> nEventInnerL1L9Int90;
99  std::array<std::array<float, 3>, 2> MeanAlignDiffExtLayer;
100  // clang-format on
101  float nTRDHitAvg;
103  int good;
104  unsigned int UTCTime;
105 
106  bool DSPError;
110 
112  float MagPhiSphCoo;
113  float MagAltSphCoo;
114  float LShell;
115 
116  float nTRDTrack;
117  float nTRDHits;
118  std::array<float, 20> nTRDLayerHits;
119 
120  float nEcalShower;
121  float nEcalHits;
122 
123  float nTrClusterX;
124  float nTrClusterY;
127 
128  float nTofClusterH;
129 
130  float nParticle;
132  float nPartTrkInn;
133  float nPartTrk;
134  // clang-format off
135  std::array<std::array<float, nrigbins + 1>, nqbins + 1> nPartRate;
136  std::array<std::array<float, nbetabins + 1>, nqbins + 1> nPartBetaRate;
137  std::array<std::array<float, nrigbins + 1>, nqbins + 1> nPartInnRate;
138  // clang-format on
139  std::array<float, nqbins + 1> nPartAboveCutoff;
140  std::array<float, nqbins + 1> nPartBelowCutoff;
141 
142  float nTrk;
143  float nTrkInn;
144  // clang-format off
145  std::array<std::array<float, nrigbins + 1>, nqbins + 1> nTrkRate;
146  std::array<std::array<float, nrigbins + 1>, nqbins + 1> nTrkInnRate;
147  // clang-format on
148 
149  std::array<float, 8> TrigPhysBPatt;
150  std::array<float, 16> TrigJMembPatt;
151  std::array<float, 19> TrigRates;
152  float nACC;
153  std::array<float, 16> TofFlags;
154 
155  float TofRaw_nstdc;
156  float TofRaw_nftdc;
157  float TofRaw_nsumh;
159 
162 
163  float nRoomError;
164 
165 #ifdef ENABLE_PRODUCTION_CODE
166  void Fill(AMSSetupR::RTI *rtiPtr, unsigned int runTag);
167  void AccumulateEventVariables(AMSEventR *evPtr);
168  void FillEventVariables();
169 #endif
170 
171  static const std::array<float, nrigbins + 1> rigbins;
172  static const std::array<float, nbetabins + 1> betabins;
173 
174  // clang-format off
175  static const std::map<unsigned int, std::pair<float, float>> qbins;
176  // clang-format on
177 
178  static constexpr double Re = 6371.2e5; // cm
179 
180 private:
181  void UpdateTM();
182 
184  unsigned long long m_processedEvents = 0;
185 
186  static TGraph m_saaEdge;
187 
189 };
190 
191 } // namespace NAIA
192 
193 #endif
NAIA::RTIInfo::TrigJMembPatt
std::array< float, 16 > TrigJMembPatt
Average fraction of each trigger pattern.
Definition: RTIInfo.h:150
NAIA::RTIInfo::TofRaw_nsumsh
float TofRaw_nsumsh
Super-High Threshold history.
Definition: RTIInfo.h:158
NAIA::RTIInfo::nPartTrkInn
float nPartTrkInn
Average number of ParticleR with InnerTracker track.
Definition: RTIInfo.h:132
NAIA::RTIInfo::nTrClusterY
float nTrClusterY
Average number of TrRawCluster on y side.
Definition: RTIInfo.h:124
NAIA::RTIInfo::IsInSAA
bool IsInSAA() const
Check if the ISS is in the SAA for this second.
Definition: RTIInfo.cpp:66
NAIA::RTIInfo::nTrigger
float nTrigger
Number of events with trigger in this second.
Definition: RTIInfo.h:94
NAIA::RTIInfo::nbetabins
static constexpr unsigned int nbetabins
Definition: RTIInfo.h:61
NAIA::RTIInfo::Year
unsigned int Year()
Get the current year.
Definition: RTIInfo.cpp:31
NAIA::RTIInfo::MagAltSphCoo
float MagAltSphCoo
Magnetic coordinates altitude.
Definition: RTIInfo.h:113
NAIA::RTIInfo::nTrClusterL1Y
float nTrClusterL1Y
Average number of TrRawCluster on y side of L1.
Definition: RTIInfo.h:126
NAIA::RTIInfo::nEventInnerL1L9
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:97
NAIA::RTIInfo::Hour
unsigned int Hour()
Get the current hour [0-23].
Definition: RTIInfo.cpp:51
NAIA::RTIInfo::nqbins
static constexpr unsigned int nqbins
Definition: RTIInfo.h:62
NAIA::RTIInfo::Second
unsigned int Second()
Get the current second [0-59].
Definition: RTIInfo.cpp:61
NAIA::RTIInfo::nRoomError
float nRoomError
Average number of room errors.
Definition: RTIInfo.h:163
NAIA::RTIInfo::nTrk
float nTrk
Average number of TrTrackR objects with default fit.
Definition: RTIInfo.h:142
NAIA::RTIInfo::Re
static constexpr double Re
Definition: RTIInfo.h:178
NAIA::RTIInfo::UpdateTM
void UpdateTM()
Definition: RTIInfo.cpp:21
NAIA::RTIInfo::nTRDHits
float nTRDHits
Average number of total TrdRawHit.
Definition: RTIInfo.h:117
NAIA::RTIInfo::nTrkInnRate
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:146
NAIA::RTIInfo::Month
unsigned int Month()
Get the current month [1-12].
Definition: RTIInfo.cpp:36
NAIA::RTIInfo::nTrkRate
std::array< std::array< float, nrigbins+1 >, nqbins+1 > nTrkRate
Average number of TrTrackR object divided by charge and rigidity.
Definition: RTIInfo.h:145
NAIA::RTIInfo::nError
float nError
Number of missing events due to errors.
Definition: RTIInfo.h:93
NAIA
Definition: Event.h:13
NAIA::RTIInfo::TofRaw_nsumh
float TofRaw_nsumh
High Threshold history.
Definition: RTIInfo.h:157
NAIA::RTIInfo::nPartBelowCutoff
std::array< float, nqbins+1 > nPartBelowCutoff
Average number of ParticleR objects below cutoff.
Definition: RTIInfo.h:140
NAIA::RTIInfo::Minute
unsigned int Minute()
Get the current minute [0-59].
Definition: RTIInfo.cpp:56
NAIA::RTIInfo::DayOfMonth
unsigned int DayOfMonth()
Get the current day of the month [1-31].
Definition: RTIInfo.cpp:41
NAIA::RTIInfo::TofFlags
std::array< float, 16 > TofFlags
Average value of TofFlags.
Definition: RTIInfo.h:153
NAIA::RTIInfo::MostProbableHeRig
float MostProbableHeRig
Most probable He rigidity for this second;.
Definition: RTIInfo.h:79
NAIA::RTIInfo::qbins
static const std::map< unsigned int, std::pair< float, float > > qbins
Bin edges for charge-binned variables, depending on particle species.
Definition: RTIInfo.h:175
NAIA::RTIInfo::DSPError
bool DSPError
Has a DSP error occurred in this second?
Definition: RTIInfo.h:106
NAIA::RTIInfo::Clear
void Clear()
Clear container content.
Definition: RTIInfo.cpp:135
NAIA::RTIInfo::L
float L
L-shell.
Definition: RTIInfo.h:78
NAIA::RTIInfo::AntiRaw_ntdct
float AntiRaw_ntdct
Low Threshold history.
Definition: RTIInfo.h:160
NAIA::RTIInfo::Dump
void Dump() const
Dump on screen container content.
Definition: RTIInfo.cpp:176
NAIA::RTIInfo::Altitude
float Altitude
Altitude (gtod coordinate system) (cm)
Definition: RTIInfo.h:82
NAIA::RTIInfo::nHWError
float nHWError
Number of events with HW error (from JINJStatus)
Definition: RTIInfo.h:95
NAIA::RTIInfo::MagPhiSphCoo
float MagPhiSphCoo
Magnetic coordinates phi.
Definition: RTIInfo.h:112
NAIA::RTIInfo::nTrClusterX
float nTrClusterX
Average number of TrRawCluster on x side.
Definition: RTIInfo.h:123
NAIA::RTIInfo::Phi
float Phi
Phi (gtod coordinate system) (rad)
Definition: RTIInfo.h:81
NAIA::RTIInfo::nEcalHits
float nEcalHits
Average number of EcalHit objects.
Definition: RTIInfo.h:121
NAIA::RTIInfo::MaxStoermerCutoff
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
NAIA::RTIInfo::Theta
float Theta
Theta (gtod coordinate system) (rad)
Definition: RTIInfo.h:80
NAIA::RTIInfo::nEcalShower
float nEcalShower
Average number of EcalShower objects.
Definition: RTIInfo.h:120
NAIA::RTIInfo::Zenith
float Zenith
AMS zenith angle (degrees)
Definition: RTIInfo.h:83
NAIA::RTIInfo::TrigPhysBPatt
std::array< float, 8 > TrigPhysBPatt
Average fraction of each trigger pattern.
Definition: RTIInfo.h:149
NAIA::RTIInfo::nTrClusterL1X
float nTrClusterL1X
Average number of TrRawCluster on x side of L1.
Definition: RTIInfo.h:125
NAIA::RTIInfo::LShell
float LShell
L shell.
Definition: RTIInfo.h:114
NAIA::RTIInfo::nPartTrk
float nPartTrk
Average number of ParticleR with Tracker track.
Definition: RTIInfo.h:133
NAIA::RTIInfo::Roll
float Roll
ISS roll angle (rad)
Definition: RTIInfo.h:84
NAIA::RTIInfo::good
int good
0 if good (Thanks, Qi. Very descriptive)
Definition: RTIInfo.h:103
NAIA::RTIInfo::Yaw
float Yaw
ISS yaw angle (rad)
Definition: RTIInfo.h:86
NAIA::RTIInfo::m_saaEdge
static TGraph m_saaEdge
Definition: RTIInfo.h:186
NAIA::RTIInfo::DSPErrorJINF
bool DSPErrorJINF
Has a DSP error occurred in JINF in this second?
Definition: RTIInfo.h:108
NAIA::RTIInfo::RunTag
unsigned int RunTag
Run tag.
Definition: RTIInfo.h:65
NAIA::RTIInfo::TofRaw_nftdc
float TofRaw_nftdc
Fast Trigger history.
Definition: RTIInfo.h:156
NAIA::RTIInfo::MeanAlignDiffExtLayer
std::array< std::array< float, 3 >, 2 > MeanAlignDiffExtLayer
mean difference(um) bewteen PG ad CIEMAT alignment of L1 and L9(XYZ)
Definition: RTIInfo.h:99
NAIA::RTIInfo::rigbins
static const std::array< float, nrigbins+1 > rigbins
Bin edges for rigidity-binned variables.
Definition: RTIInfo.h:171
NAIA::RTIInfo::DSPErrorJINJ
bool DSPErrorJINJ
Has a DSP error occurred in JINJ in this second?
Definition: RTIInfo.h:107
NAIA::RTIInfo::Velocity_theta
float Velocity_theta
ISS angular velocity theta component (rad)
Definition: RTIInfo.h:88
NAIA::RTIInfo::I
float I
Second magnetic adiabatic invariant (km)
Definition: RTIInfo.h:76
NAIA::RTIInfo::nTrkInn
float nTrkInn
Average number of TrTrackR objects with inner fit.
Definition: RTIInfo.h:143
NAIA::RTIInfo::LivetimeFraction
float LivetimeFraction
Livetime fraction during this second.
Definition: RTIInfo.h:68
NAIA::RTIInfo::nParticle
float nParticle
Average number of ParticleR objects.
Definition: RTIInfo.h:130
NAIA::RTIInfo::betabins
static const std::array< float, nbetabins+1 > betabins
Bin edges for beta-binned variables.
Definition: RTIInfo.h:172
NAIA::RTIInfo::m_humanTime
tm m_humanTime
Definition: RTIInfo.h:183
NAIA::RTIInfo::nTrClusterAvg
float nTrClusterAvg
Average number of Tracker raw clusters for one event.
Definition: RTIInfo.h:102
NAIA::RTIInfo::GalacticLat
float GalacticLat
Galactic latitude of AMS pointing direction (degrees)
Definition: RTIInfo.h:90
NAIA::RTIInfo::nTofClusterH
float nTofClusterH
Average number of TofClusterH objects.
Definition: RTIInfo.h:128
NAIA::RTIInfo::nGoodParticle
float nGoodParticle
Average number of "good" ParticleR objects.
Definition: RTIInfo.h:131
NAIA::RTIInfo::m_processedEvents
unsigned long long m_processedEvents
Definition: RTIInfo.h:184
NAIA::RTIInfo::nrigbins
static constexpr unsigned int nrigbins
Definition: RTIInfo.h:60
NAIA::RTIInfo::nPartRate
std::array< std::array< float, nrigbins+1 >, nqbins+1 > nPartRate
Average number of ParticleR object divided by charge and rigidity.
Definition: RTIInfo.h:135
NAIA::RTIInfo::Bm
float Bm
Mirror magnetic field in nT.
Definition: RTIInfo.h:75
NAIA::RTIInfo::MaxIGRFCutoff
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
NAIA::RTIInfo::AntiRaw_nftdc
float AntiRaw_nftdc
Fast Trigger history.
Definition: RTIInfo.h:161
NAIA::RTIInfo::nEvent
float nEvent
Total number of events in this second.
Definition: RTIInfo.h:92
NAIA::RTIInfo
Container class for RTI info.
Definition: RTIInfo.h:33
NAIA::RTIInfo::nEventInnerL1L9Int90
std::array< std::array< float, 3 >, 2 > nEventInnerL1L9Int90
Number of events with a track with layer 1 and layer 9 XY hit integrated in a 90-second window (see h...
Definition: RTIInfo.h:98
NAIA::RTIInfo::LastEvNo
unsigned int LastEvNo
Last event no in this second.
Definition: RTIInfo.h:67
NAIA::RTIInfo::UTCTime
unsigned int UTCTime
JMDC unix time (seconds since 1 Jan 1970)
Definition: RTIInfo.h:104
NAIA::RTIInfo::ClassDef
ClassDef(RTIInfo, 2)
NAIA::RTIInfo::nEventParticle
float nEventParticle
Number of events with tof+trd+tracker+ecal data.
Definition: RTIInfo.h:96
NAIA::RTIInfo::MagThetaSphCoo
float MagThetaSphCoo
Magnetic coordinates theta.
Definition: RTIInfo.h:111
NAIA::RTIInfo::nTRDHitAvg
float nTRDHitAvg
Average number of TRD raw hits for one event.
Definition: RTIInfo.h:101
NAIA::RTIInfo::DSPErrorJLV1
bool DSPErrorJLV1
Has a DSP error occurred in JLV1 in this second?
Definition: RTIInfo.h:109
NAIA::RTIInfo::Velocity_s
float Velocity_s
ISS angular velocity magnitude (rad/s)
Definition: RTIInfo.h:87
NAIA::RTIInfo::nPartBetaRate
std::array< std::array< float, nbetabins+1 >, nqbins+1 > nPartBetaRate
Average number of ParticleR object divided by charge and beta.
Definition: RTIInfo.h:136
NAIA::RTIInfo::TrigRates
std::array< float, 19 > TrigRates
Average value of trigger rates.
Definition: RTIInfo.h:151
NAIA::RTIInfo::FirstEvNo
unsigned int FirstEvNo
First event nnumber in this second.
Definition: RTIInfo.h:66
NAIA::RTIInfo::nPartInnRate
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:137
NAIA::RTIInfo::MinIGRFCutoff
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
NAIA::RTIInfo::IGRFMagField
std::array< double, 3 > IGRFMagField
Geomagnetic field estimated from IGRF13 model in nT.
Definition: RTIInfo.h:74
NAIA::RTIInfo::nACC
float nACC
Average number of ACC sectors.
Definition: RTIInfo.h:152
NAIA::RTIInfo::BEq
float BEq
Equatorial magnetic field in nT.
Definition: RTIInfo.h:77
NAIA::RTIInfo::Run
unsigned int Run
Run number.
Definition: RTIInfo.h:64
NAIA::RTIInfo::nPartAboveCutoff
std::array< float, nqbins+1 > nPartAboveCutoff
Average number of ParticleR objects above cutoff.
Definition: RTIInfo.h:139
NAIA::RTIInfo::DayOfYear
unsigned int DayOfYear()
Get the current day of the year [1-366].
Definition: RTIInfo.cpp:46
NAIA::RTIInfo::TofRaw_nstdc
float TofRaw_nstdc
Low Threshold history.
Definition: RTIInfo.h:155
NAIA::RTIInfo::nTRDTrack
float nTRDTrack
Average number of TrdTrack objects.
Definition: RTIInfo.h:116
NAIA::RTIInfo::Velocity_phi
float Velocity_phi
ISS angular phi component (rad)
Definition: RTIInfo.h:89
NAIA::RTIInfo::nTRDLayerHits
std::array< float, 20 > nTRDLayerHits
Average number of TRD hits in each layer.
Definition: RTIInfo.h:118
NAIA::RTIInfo::Pitch
float Pitch
ISS pitch angle (rad)
Definition: RTIInfo.h:85
NAIA::RTIInfo::GalacticLong
float GalacticLong
Galactic longitude of AMS pointing direction (degrees)
Definition: RTIInfo.h:91