10using json = nlohmann::json;
33 std::ifstream fin(
file.c_str());
36 return StatusCode::FAILURE;
41 std::vector<float> convfact;
48 std::array<unsigned int, 4096> sideALUT =
data[
"LucrodHighGain"][
"LUTs"][
"sideA"];
50 std::array<unsigned int, 4096> sideCLUT =
data[
"LucrodHighGain"][
"LUTs"][
"sideC"];
52 std::array<unsigned int, 256> combLUT =
data[
"LucrodHighGain"][
"LUTs"][
"comb"];
59 return StatusCode::SUCCESS;
73 std::vector<float> moduleEnergy = {0., 0., 0., 0., 0., 0., 0., 0.};
78 for (
const auto zdcModule : *zdcModules)
80 if (zdcModule->zdcType() == 0)
83 ATH_MSG_DEBUG(
"ZDC Side " << zdcModule->zdcSide() <<
", Module: " << zdcModule->zdcModule() <<
" and Energy: " << zdcModuleCalibEnergyHandle(*zdcModule));
86 if (zdcModule->zdcSide() > 0)
88 moduleEnergy.at(zdcModule->zdcModule()) = (!
m_energyToADCScaleFactor && lucrodTriggerAmpAcc.
isAvailable(*zdcModule)) ?
static_cast<float>(lucrodTriggerAmpAcc(*zdcModule)) : zdcModuleCalibEnergyHandle(*zdcModule);
92 if (zdcModule->zdcSide() < 0)
94 moduleEnergy.at(zdcModule->zdcModule() + 4) = (!
m_energyToADCScaleFactor && lucrodTriggerAmpAcc.
isAvailable(*zdcModule)) ?
static_cast<float>(lucrodTriggerAmpAcc(*zdcModule)) : zdcModuleCalibEnergyHandle(*zdcModule);
107 std::bitset<3>
bin(wordOut);
110 unsigned int word0 = 0;
111 word0 += (
bin[0] << 25);
112 word0 += (
bin[1] << 26);
113 word0 += (
bin[2] << 27);
120 ATH_MSG_DEBUG(
"Stored ZDC CTP object with words " << std::hex << (zdcCTP->cableWord0()) <<
" from LUTOutput " << std::dec << wordOut);
121 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Helper class to provide constant type-safe access to aux data.
char data[hepevt_bytes_allocation_ATLAS]
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< ZdcCTP > m_zdcCTPLocation
TrigT1Run2ZDC(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode initialize() override
Gaudi::Property< float > m_energyToADCScaleFactor
Gaudi::Property< std::string > m_lutFile
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_zdcModuleCalibEnergyKey
std::shared_ptr< ZDCTriggerSimModuleAmpls > m_simTrig
A data member to hold the ZDCTrigger Object that computes the LUT logic: shared ptr to ensure cleanup...
std::shared_ptr< ZDCTriggerSim::ModuleAmplInputsFloat > m_modInputs_p
A data member to hold the ZDCTrigger Object that stores input floats: shared ptr to ensure cleanup.
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_zdcModuleKey
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Handle class for reading a decoration on an object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
ZDCTriggerSimData< float, 8, 12, TModAmplsInput > ModuleAmplInputsFloat
std::shared_ptr< const ZDCTriggerSimDataBase > SimDataCPtr