Skip to content

Commit dc36563

Browse files
authored
Merge pull request #60 from DUNE/feature/ingratta_add_beam_quality_info
adding beam quality info to the class
2 parents f437981 + bdb6ff8 commit dc36563

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

duneanaobj/StandardRecord/SRBeamBranch.h

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <cmath>
1010
#include <limits>
11+
#include <vector>
1112

1213
namespace caf
1314
{
@@ -18,6 +19,32 @@ namespace caf
1819
constexpr static float NaN = std::numeric_limits<float>::signaling_NaN();
1920

2021
public:
22+
/// @name beam variables
23+
/// @brief Quantities used to characterize the spill-by-spill beam quality.
24+
///
25+
/// These variables store measurements from multiple devices placed along the beam line.
26+
///
27+
/// - **POT (Protons on Target):** Measured by the toroids E:TRTGDT, E:TOR101, and E:TR101D.
28+
/// The POT value is given per pulse and includes a normalization factor of 1e12 so that
29+
/// users do not need to apply any additional scaling.
30+
///
31+
/// - **Horn Current:** Determined as a linear combination of four strip-line measurements
32+
/// (NSLINA, NSLINB, NSLINC, and NSLIND).
33+
/// The calculation follows the method described in
34+
/// <https://cdcvs.fnal.gov/redmine/projects/novaart/repository/svn/entry/trunk/IFDBSpillInfo/IFDBSpillInfo_module.cc#L685>.
35+
///
36+
/// - **Beam Position (Pre-target):** Measured by the monitors “121” and “TGT”, which provide
37+
/// the horizontal and vertical position of the beam, as well as its intensity, in the
38+
/// pre-target region for each of the six batches.
39+
///
40+
/// - **Beam Position (On target):** Computed as an intensity-weighted average of the
41+
/// measurements from the 121 and TGT monitors.
42+
///
43+
/// - **Beam Width (TGT location):** the MTGTDS device contains the readout voltages of
44+
/// horizontal and vertical wires (206 values, 48 horizontal + 48 vertical + additional values).
45+
/// The horizontal and vertical spread of the beam is obtained from a gaussian fit of the voltages
46+
/// as function of the wire postion
47+
///@{
2148
bool ismc; ///< data or simulated beam pulse?
2249

2350
bool isgoodpulse = true; ///< Was the pot for a pulse good? (only applicable to data)
@@ -26,15 +53,25 @@ namespace caf
2653
unsigned long int gpspulsetimesec = 0; ///< pulse time from GPS [s]
2754
unsigned long int gpspulsetimensec = 0; ///< pulse time from GPS [ns]
2855
signed long long int deltapulsetimensec = -9999999; ///< Delta time [ns]
29-
float pulsepot = NaN; ///< POT in pulse including factor of 1e12 so that a user does not have to apply this correction
56+
float pulsepot = NaN; ///< POT as measured by the toroid E:TRTGDT device
57+
float potTOR101 = NaN; ///< POT as measured by the toroid E:TOR101 device
58+
float potTR101D = NaN; ///< POT as measured by the toroid E:TR101D device
3059
float hornI = NaN; ///< Horn current [kA]
60+
float hornDir = NaN; ///< Horn polarity [V]
61+
float beamHwidth = NaN; ///< Beam horizontal width [mm]
62+
float beamVwidth = NaN; ///< Beam vertical width [mm]
63+
std::vector<double> horizontalposTGT; ///< horizontal beam position as measured by E:HPTGT device (7 values = 6 batches + 1 mean value) [mm]
64+
std::vector<double> horizontalintTGT; ///< horizontal beam intensity as measured by E:HITGT device (7 values = 6 batches + 1 mean value) []
65+
std::vector<double> horizontalpos121; ///< horizontal beam position as measured by E:HP121 device (7 values = 6 batches + 1 mean value) [mm]
66+
std::vector<double> verticalposTGT; ///< vertical beam position as measured by E:VPTGT device (7 values = 6 batches + 1 mean value) []
67+
std::vector<double> verticalintTGT; ///< vertical beam intensity as measured by E:VITGT device (7 values = 6 batches + 1 mean value) [mm]
68+
std::vector<double> verticalpos121; ///< vertical beam position as measured by E:VP121 device (7 values = 6 batches + 1 mean value) [mm]
69+
std::vector<double> multiwireInfo; ///< horizontal and vertical readout voltages measured by E:MTGTDS device (216 values) [a.u.]
3170

3271
bool isFHC() const { return hornI > 0; }; ///< Checks #hornI to see if the polarity is positive --> this is FHC
3372
bool is0HC() const { return std::abs(hornI) < 1; }; ///< Checks #hornI to see if the polarity is zero
3473
bool isRHC() const { return hornI < 0; } ///< Checks #hornI to see if the polarity is negative --> this is RHC
35-
36-
// someday when we have real beam we'll have beam parameters here to include.
37-
// this is just a reminder/placeholder for now.
74+
///@}
3875

3976
};
4077
}

0 commit comments

Comments
 (0)