69 std::vector<SG::WriteHandle<CaloCellContainer> > truthCells;
70 std::vector<SG::WriteHandle<xAOD::CaloClusterContainer> > truthClusters;
71 std::vector<SG::WriteHandle<CaloClusterCellLinkContainer> > truthLinks;
78 ATH_CHECK(truthCells.back().record(std::make_unique<CaloCellContainer>()));
84 ATH_CHECK(truthLinks.back().record(std::make_unique<CaloClusterCellLinkContainer>()));
89 std::vector<const CaloCalibrationHitContainer*> calibHitContainers(nCont,
nullptr);
90 for (
unsigned int i=0; i<nCont; i++) {
93 ATH_MSG_DEBUG(
" Retrieved container " << calibHitContainers[i]->
Name() <<
" with size " << calibHitContainers[i]->Size() );
94 if( calibHitContainers[i]->Size() == 0 ) {
98 ATH_MSG_DEBUG(
"CaloCalibrationHitContainers retrieved successfuly" );
107 std::vector<Identifier> ID;
109 using CellPtr = std::unique_ptr<CaloCell>;
110 std::vector<CellPtr> CellsEtot;
111 std::vector<CellPtr> CellsEvis;
112 std::vector<CellPtr> CellsEem;
114 int nhitsInactive = 0;
116 for (
unsigned int i=0; i<calibHitContainers.size(); i++) {
117 for(
const auto *
const calibhit: *(calibHitContainers[i])) {
121 double Etot = calibhit->energyTotal();
122 double Eem = calibhit->energy(0);
123 double Enonem = calibhit->energy(1);
124 double Evis = Eem + Enonem;
132 for (
int n=0; n<nhitsInactive; n++) {
134 CellsEtot[n]->addEnergy(Etot);
135 CellsEvis[n]->addEnergy(Evis);
136 CellsEem[n]->addEnergy(Eem);
141 if(!isNewId)
continue;
169 if (i==0) nhitsInactive = (int)ID.size();
180 for(
int itr=0; itr!=nchan; itr++) {
192 for(
int itr=0; itr!=nchan; itr++) {
204 for(
int itr=0; itr!=nchan; itr++) {
216 for(
int itr=0; itr!=nchan; itr++) {
242 if (!truthCluster[i]) {
244 return StatusCode::FAILURE;
246 for (
const auto cell: *truthCells[i]) {
248 truthCluster[i]->
addCell( truthCells[i]->findIndex(cell->caloDDE()->calo_hash()) , 1.);
254 truthClusters[i].ptr()));
260 return StatusCode::SUCCESS;