28 std::vector<IdentifierHash> neighHashes;
29 calo_id->get_neighbours(cell->caloDDE()->calo_hash(), option, neighHashes);
32 for (
const auto cell : links) {
37 if (cellHash == neighHash) {
49 using namespace TauShotVariableHelpers::msgTauShotVariableHelpers;
51 std::vector<std::vector<const CaloCell*>> cellBlock;
54 if (shot.
attribute(xAOD::PFODetails::PFOAttributes::tauShots_nCellsInEta, etaSize) ==
false) {
60 if (shot.
attribute(xAOD::PFODetails::PFOAttributes::tauShots_seedHash, seedHash) ==
false) {
66 std::vector<const CaloCell*> etaLayer;
67 for (
int etaIndex = 0; etaIndex < etaSize; ++ etaIndex) {
68 etaLayer.push_back(
nullptr);
71 for (
int phiIndex = 0; phiIndex < phiSize; ++phiIndex) {
72 cellBlock.push_back(etaLayer);
80 for (
const auto cell : *cellLinks) {
81 if (cell->caloDDE()->calo_hash() != (
unsigned) seedHash)
continue;
85 if (seedCell==
nullptr) {
86 ANA_MSG_WARNING(
"Couldn't find seed cell in shot cluster. Return empty cell block.");
89 int mediumEtaIndex = etaSize/2;
90 cellBlock.at(0).at(mediumEtaIndex) = seedCell;
95 int maxDepth = etaSize - mediumEtaIndex - 1;
98 if (lastCell !=
nullptr) {
99 cellBlock.at(0).at(mediumEtaIndex +
depth) = lastCell;
110 if (lastCell !=
nullptr) {
111 cellBlock.at(0).at(mediumEtaIndex -
depth) = lastCell;
120 if (mergedCell ==
nullptr) {
124 if (mergedCell !=
nullptr) {
125 cellBlock.at(1).at(mediumEtaIndex) = mergedCell;
129 lastCell = mergedCell;
132 if (lastCell !=
nullptr) {
133 cellBlock.at(1).at(mediumEtaIndex +
depth) = lastCell;
141 lastCell = mergedCell;
144 if (lastCell !=
nullptr) {
145 cellBlock.at(1).at(mediumEtaIndex -
depth) = lastCell;
158float ptWindow(
const std::vector<std::vector<const CaloCell*>>& shotCells,
160 const ToolHandle<IHadronicCalibrationTool>& caloWeightTool) {
162 if (windowSize%2 != 1)
return 0.;
164 int etaSize = shotCells.at(0).size();
165 if (windowSize > etaSize)
return 0.;
167 int seedIndex = etaSize/2;
168 int phiSize = shotCells.size();
171 for (
int etaIndex = 0; etaIndex != etaSize; ++etaIndex) {
172 if (std::abs(etaIndex-seedIndex) > windowSize/2)
continue;
174 for (
int phiIndex = 0; phiIndex != phiSize; ++phiIndex) {
175 const CaloCell* cell = shotCells.at(phiIndex).at(etaIndex);
176 if (cell !=
nullptr) {
177 ptWindow += cell->pt() * caloWeightTool->wtCell(cell);