28 std::ifstream
fin(
file.c_str());
31 return StatusCode::FAILURE;
37 std::array<unsigned int, 4096> sideALUTHG =
38 data[
"LucrodHighGain"][
"LUTs"][
"sideA"];
40 std::array<unsigned int, 4096> sideCLUTHG =
41 data[
"LucrodHighGain"][
"LUTs"][
"sideC"];
43 std::array<unsigned int, 256> combLUTHG =
44 data[
"LucrodHighGain"][
"LUTs"][
"comb"];
46 std::array<unsigned int, 4096> sideALUTLG =
47 data[
"LucrodLowGain"][
"LUTs"][
"sideA"];
49 std::array<unsigned int, 4096> sideCLUTLG =
50 data[
"LucrodLowGain"][
"LUTs"][
"sideC"];
52 std::array<unsigned int, 256> combLUTLG =
53 data[
"LucrodLowGain"][
"LUTs"][
"comb"];
56 const ZdcID *zdcId =
nullptr;
59 <<
"execute: Could not retrieve ZdcID object from the detector store"
61 return StatusCode::FAILURE;
67 std::array<std::array<unsigned int, 4>, 2> deriv2ndHGThresh;
68 std::array<std::array<unsigned int, 4>, 2> deriv2ndLGThresh;
70 for (
unsigned int side : {0, 1}) {
71 for (
unsigned int module : {0, 1, 2, 3}) {
79 deriv2ndLGThresh[0][0] = 4095;
80 deriv2ndLGThresh[1][0] = 4095;
82 std::cout <<
"Trigger simulation will use sample indices: " <<
m_minSampleAna
101 return StatusCode::SUCCESS;
111 unsigned int trigAvgAHG = 0;
112 unsigned int trigAvgCHG = 0;
113 unsigned int trigAvgALG = 0;
114 unsigned int trigAvgCLG = 0;
117 std::array<std::array<std::array<unsigned int, 24>, 4>, 2> FADCSamplesHG;
118 std::array<std::array<std::array<unsigned int, 24>, 4>, 2> FADCSamplesLG;
123 std::vector<unsigned int> FADCFlattenedHG;
124 std::vector<unsigned int> FADCFlattenedLG;
134 uint32_t lucrod_id = zld->GetLucrodID();
137 for (
size_t i = 0;
i < zld->GetChanDataSize();
i++) {
148 lucrod_id)[
"type"][lucrod_channel];
158 lucrod_id)[
"side"][lucrod_channel];
160 lucrod_id)[
"module"][lucrod_channel];
162 lucrod_id)[
"gain"][lucrod_channel];
173 }
else if (
gain == 1) {
184 trigAvgAHG = zld->GetTrigAvgA();
185 trigAvgCHG = zld->GetTrigAvgC();
187 trigAvgALG = zld->GetTrigAvgA();
188 trigAvgCLG = zld->GetTrigAvgC();
195 for (
int side : {1, 0}) {
196 for (
int module : {0, 1, 2, 3}) {
198 FADCFlattenedLG.push_back(
sample);
203 for (
int side : {1, 0}) {
204 for (
int module : {0, 1, 2, 3}) {
206 FADCFlattenedHG.push_back(
sample);
220 std::bitset<3> binhg(wordOutHG);
223 std::bitset<3> binlg(wordOutLG);
235 unsigned int word0 = 0;
236 word0 += (binhg[0] << 25);
237 word0 += (binhg[1] << 26);
238 word0 += (binhg[2] << 27);
241 unsigned int word1 = 0;
242 word1 += (binlg[0] << 28);
243 word1 += (binlg[1] << 29);
244 word1 += (binlg[2] << 30);
254 "Stored ZDC CTP object with words "
256 << std::hex << word0 <<
" from hgLUTOutput: " << std::dec << wordOutHG
257 <<
" AvgAmpA: " << trigAvgAHG <<
" C: " << trigAvgCHG << std::endl
258 << std::hex <<
word1 <<
" from lgLUTOutput: " << std::dec << wordOutLG
259 <<
" AvgAmpA: " << trigAvgALG <<
" C: " << trigAvgCLG);
261 return StatusCode::SUCCESS;