![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include "CaloDetDescr/CaloDetDescrElement.h"
29 m_caloCell_Tot(
"TotalCalibCell"), m_caloCell_Vis(
"VisCalibCell"),
30 m_caloCell_Em(
""), m_caloCell_NonEm(
"")
32 declareInterface<CalibHitToCaloCellTool>(
this);
81 return StatusCode::SUCCESS;
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" );
134 int unknown_nchan = 0 ;
136 std::vector<Identifier>
ID;
140 std::vector<CaloCell*> CellsEtot;
141 std::vector<CaloCell*> CellsEvis;
142 std::vector<CaloCell*> CellsEem;
144 int nhitsInactive = 0;
146 for (
unsigned int i=0;
i<calibHitContainers.size();
i++) {
147 for(
const auto *
const calibhit: *(calibHitContainers[
i])) {
149 if ((
int)calibhit->particleID()!=
barcode)
continue;
151 double Etot = calibhit->energyTotal();
152 double Eem = calibhit->energy(0);
153 double Enonem = calibhit->energy(1);
154 double Evis = Eem + Enonem;
162 for (
int n=0;
n<nhitsInactive;
n++) {
164 CellsEtot[
n]->addEnergy(Etot);
165 CellsEvis[
n]->addEnergy(Evis);
166 CellsEem[
n]->addEnergy(Eem);
171 if(!isNewId)
continue;
199 if (
i==0) nhitsInactive = (
int)
ID.size();
210 for(
int itr=0; itr!=
nchan; itr++) {
222 for(
int itr=0; itr!=
nchan; itr++) {
234 for(
int itr=0; itr!=
nchan; itr++) {
246 for(
int itr=0; itr!=
nchan; itr++) {
276 if (!truthCluster[
i]) {
278 return StatusCode::FAILURE;
280 for (
const auto cell: *truthCells[
i]) {
282 truthCluster[
i]->
addCell( truthCells[
i]->findIndex(
cell->caloDDE()->calo_hash()) , 1.);
288 truthClusters[
i].ptr()));
294 return StatusCode::SUCCESS;
302 return StatusCode::SUCCESS;
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
def retrieve(aClass, aKey=None)
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
std::vector< Identifier > ID
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
bool is_lar(Identifier id) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
#define ATH_MSG_VERBOSE(x)
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
bool is_hec(const Identifier id) const
test if the id belongs to the HEC
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
bool is_em(const Identifier id) const
test if the id belongs to LArEM
Description of a calorimeter cluster.
bool is_fcal(const Identifier id) const
test if the id belongs to the FCAL - true also for MiniFCAL
::StatusCode StatusCode
StatusCode definition for legacy code.
constexpr int SINGLE_PARTICLE
StatusCode initialize(bool used=true)
Data object for LAr calorimeter readout cell.
This class provides the client interface for accessing the detector description information common to...
void setClusterSize(const ClusterSize)
Get cluster size.
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
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.