ATLAS Offline Software
CellsInCone.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "CellsInCone.h"
10 #include "xAODEgamma/Egamma.h"
11 
12 void
14  xAOD::CaloCluster* inputCl,
15  const CaloCellContainer* inputcells,
16  const CaloDetDescrManager* caloMgr,
17  const xAOD::Egamma* eg,
18  const double dr)
19 {
20 
21  std::vector<const CaloCell*> cells;
22  cells.reserve(100);
23  CaloCellList myList(caloMgr, inputcells);
24 
25  double egEta = eg->caloCluster()->etaBE(2);
26  double egPhi = eg->caloCluster()->phiBE(2);
27  std::vector<CaloSampling::CaloSample> samples = {
39  };
40 
41  for (auto samp : samples) {
42  myList.select(egEta, egPhi, dr, samp);
43  cells.insert(cells.end(), myList.begin(), myList.end());
44  }
45 
46  for (const auto* cell : cells) {
47  if (!cell || !cell->caloDDE())
48  continue;
49  int index = inputcells->findIndex(cell->caloDDE()->calo_hash());
50  if (index == -1)
51  continue;
52  inputCl->addCell(index, 1.);
53  }
54 }
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
CaloCellList::begin
list_iterator begin() const
Definition: CaloCellList.h:87
CaloCellList
Definition: CaloCellList.h:40
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloCellList::select
void select(double eta, double phi, double deta, double dphi)
Definition: CaloCellList.cxx:67
ParticleTest.eg
eg
Definition: ParticleTest.py:29
index
Definition: index.py:1
CaloCellList.h
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
DerivationFramework::CellsInCone::egammaSelect
void egammaSelect(xAOD::CaloCluster *inputCl, const CaloCellContainer *inputcells, const CaloDetDescrManager *caloMgr, const xAOD::Egamma *eg, const double dr)
Definition: CellsInCone.cxx:13
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCellList::end
list_iterator end() const
Definition: CaloCellList.h:93
Egamma.h
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
CaloCluster.h
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CellsInCone.h
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
xAOD::CaloCluster_v1::addCell
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
Definition: CaloCluster_v1.h:771
CaloCellContainer::findIndex
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Definition: CaloCellContainer.cxx:363
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56