35 std::ifstream
fin(
file.c_str());
38 return StatusCode::FAILURE;
44 std::array<unsigned int, 4096> sideALUTHG =
45 data[
"LucrodHighGain"][
"LUTs"][
"sideA"];
47 std::array<unsigned int, 4096> sideCLUTHG =
48 data[
"LucrodHighGain"][
"LUTs"][
"sideC"];
50 std::array<unsigned int, 256> combLUTHG =
51 data[
"LucrodHighGain"][
"LUTs"][
"comb"];
53 std::array<unsigned int, 4096> sideALUTLG =
54 data[
"LucrodLowGain"][
"LUTs"][
"sideA"];
56 std::array<unsigned int, 4096> sideCLUTLG =
57 data[
"LucrodLowGain"][
"LUTs"][
"sideC"];
59 std::array<unsigned int, 256> combLUTLG =
60 data[
"LucrodLowGain"][
"LUTs"][
"comb"];
63 const ZdcID *zdcId =
nullptr;
66 <<
"execute: Could not retrieve ZdcID object from the detector store"
68 return StatusCode::FAILURE;
74 std::array<std::array<unsigned int, 4>, 2> deriv2ndHGThresh;
75 std::array<std::array<unsigned int, 4>, 2> deriv2ndLGThresh;
77 for (
unsigned int side : {0, 1}) {
78 for (
unsigned int module : {0, 1, 2, 3}) {
86 deriv2ndLGThresh[0][0] = 4095;
87 deriv2ndLGThresh[1][0] = 4095;
89 std::cout <<
"Trigger simulation will use sample indices: " <<
m_minSampleAna
108 return StatusCode::SUCCESS;
117 const EventContext &ctx = Gaudi::Hive::currentContext();
120 unsigned int trigAvgAHG = 0;
121 unsigned int trigAvgCHG = 0;
122 unsigned int trigAvgALG = 0;
123 unsigned int trigAvgCLG = 0;
126 std::array<std::array<std::array<unsigned int, 24>, 4>, 2> FADCSamplesHG;
127 std::array<std::array<std::array<unsigned int, 24>, 4>, 2> FADCSamplesLG;
132 std::vector<unsigned int> FADCFlattenedHG;
133 std::vector<unsigned int> FADCFlattenedLG;
143 uint32_t lucrod_id = zld->GetLucrodID();
146 for (
size_t i = 0;
i < zld->GetChanDataSize();
i++) {
157 lucrod_id)[
"type"][lucrod_channel];
167 lucrod_id)[
"side"][lucrod_channel];
169 lucrod_id)[
"module"][lucrod_channel];
171 lucrod_id)[
"gain"][lucrod_channel];
182 }
else if (
gain == 1) {
193 trigAvgAHG = zld->GetTrigAvgA();
194 trigAvgCHG = zld->GetTrigAvgC();
196 trigAvgALG = zld->GetTrigAvgA();
197 trigAvgCLG = zld->GetTrigAvgC();
204 for (
int side : {1, 0}) {
205 for (
int module : {0, 1, 2, 3}) {
207 FADCFlattenedLG.push_back(
sample);
212 for (
int side : {1, 0}) {
213 for (
int module : {0, 1, 2, 3}) {
215 FADCFlattenedHG.push_back(
sample);
229 std::bitset<3> binhg(wordOutHG);
232 std::bitset<3> binlg(wordOutLG);
244 unsigned int word0 = 0;
245 word0 += (binhg[0] << 25);
246 word0 += (binhg[1] << 26);
247 word0 += (binhg[2] << 27);
250 unsigned int word1 = 0;
251 word1 += (binlg[0] << 28);
252 word1 += (binlg[1] << 29);
253 word1 += (binlg[2] << 30);
263 "Stored ZDC CTP object with words "
265 << std::hex << word0 <<
" from hgLUTOutput: " << std::dec << wordOutHG
266 <<
" AvgAmpA: " << trigAvgAHG <<
" C: " << trigAvgCHG << std::endl
267 << std::hex <<
word1 <<
" from lgLUTOutput: " << std::dec << wordOutLG
268 <<
" AvgAmpA: " << trigAvgALG <<
" C: " << trigAvgCLG);
270 return StatusCode::SUCCESS;