|
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;
139 std::vector<CaloCell*> CellsEtot;
140 std::vector<CaloCell*> CellsEvis;
141 std::vector<CaloCell*> CellsEem;
143 int nhitsInactive = 0;
145 for (
unsigned int i=0;
i<calibHitContainers.size();
i++) {
146 for(
const auto *
const calibhit: *(calibHitContainers[
i])) {
150 double Etot = calibhit->energyTotal();
151 double Eem = calibhit->energy(0);
152 double Enonem = calibhit->energy(1);
153 double Evis = Eem + Enonem;
161 for (
int n=0;
n<nhitsInactive;
n++) {
163 CellsEtot[
n]->addEnergy(Etot);
164 CellsEvis[
n]->addEnergy(Evis);
165 CellsEem[
n]->addEnergy(Eem);
170 if(!isNewId)
continue;
198 if (
i==0) nhitsInactive = (
int)
ID.size();
209 for(
int itr=0; itr!=
nchan; itr++) {
221 for(
int itr=0; itr!=
nchan; itr++) {
233 for(
int itr=0; itr!=
nchan; itr++) {
245 for(
int itr=0; itr!=
nchan; itr++) {
275 if (!truthCluster[
i]) {
277 return StatusCode::FAILURE;
279 for (
const auto cell: *truthCells[
i]) {
281 truthCluster[
i]->
addCell( truthCells[
i]->findIndex(
cell->caloDDE()->calo_hash()) , 1.);
287 truthClusters[
i].
ptr()));
293 return StatusCode::SUCCESS;
301 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.
bool isSingleParticle(const T &p)
Identify a particlegun 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.