97 std::vector<SG::WriteHandle<CaloCellContainer> > truthCells;
98 std::vector<SG::WriteHandle<xAOD::CaloClusterContainer> > truthClusters;
99 std::vector<SG::WriteHandle<CaloClusterCellLinkContainer> > truthLinks;
106 ATH_CHECK(truthCells.back().record(std::make_unique<CaloCellContainer>()));
112 ATH_CHECK(truthLinks.back().record(std::make_unique<CaloClusterCellLinkContainer>()));
117 std::vector<const CaloCalibrationHitContainer*> calibHitContainers(nCont,
nullptr);
118 for (
unsigned int i=0; i<nCont; i++) {
121 ATH_MSG_DEBUG(
" Retrieved container " << calibHitContainers[i]->
Name() <<
" with size " << calibHitContainers[i]->Size() );
122 if( calibHitContainers[i]->Size() == 0 ) {
126 ATH_MSG_DEBUG(
"CaloCalibrationHitContainers retrieved successfuly" );
135 std::vector<Identifier>
ID;
138 std::vector<CaloCell*> CellsEtot;
139 std::vector<CaloCell*> CellsEvis;
140 std::vector<CaloCell*> CellsEem;
142 int nhitsInactive = 0;
144 for (
unsigned int i=0; i<calibHitContainers.size(); i++) {
145 for(
const auto *
const calibhit: *(calibHitContainers[i])) {
149 double Etot = calibhit->energyTotal();
150 double Eem = calibhit->energy(0);
151 double Enonem = calibhit->energy(1);
152 double Evis = Eem + Enonem;
160 for (
int n=0; n<nhitsInactive; n++) {
162 CellsEtot[n]->addEnergy(Etot);
163 CellsEvis[n]->addEnergy(Evis);
164 CellsEem[n]->addEnergy(Eem);
169 if(!isNewId)
continue;
197 if (i==0) nhitsInactive = (int)
ID.size();
208 for(
int itr=0; itr!=nchan; itr++) {
220 for(
int itr=0; itr!=nchan; itr++) {
232 for(
int itr=0; itr!=nchan; itr++) {
244 for(
int itr=0; itr!=nchan; itr++) {
270 if (!truthCluster[i]) {
272 return StatusCode::FAILURE;
274 for (
const auto cell: *truthCells[i]) {
276 truthCluster[i]->
addCell( truthCells[i]->findIndex(cell->caloDDE()->calo_hash()) , 1.);
282 truthClusters[i].ptr()));
288 return StatusCode::SUCCESS;
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.