 |
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" );
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;
296 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
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
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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.