42 return StatusCode::SUCCESS;
70 ATH_CHECK(outputRawChannels.
record(std::make_unique<LArRawChannelContainer>()));
75 auto keepCellSet = std::make_unique<std::bitset<200000> >();
76 size_t nCellsAllClus = 0;
84 ATH_MSG_DEBUG(
"Cluster pt: "<< clus->pt()<<
", eta/phi: "<< clus->eta() <<
" / "<< clus->phi());
89 ATH_MSG_DEBUG(
" Cluster without cell links found in collection: " <<
m_clusterCntKey.key() <<
" ===> cells cannot be written in AOD as requested ! " );
97 nCellsAllClus += cellLinks->
size();
100 for (; it != end; ++it) {
101 if (it.index() >= inputCellContainer->size()) {
102 ATH_MSG_DEBUG(
" Cell index " << it.index() <<
" is larger than the number of cells in " <<
m_caloCellInputKey.key() <<
" (" << inputCellContainer->size() <<
")" );
113 if (!keepCellSet->test(chOnlHash)){
114 keepCellSet->set(chOnlHash);
115 outputCells->push_back(cell);
120 ATH_MSG_DEBUG(
"\tTotal Copied " << outputCells->size() <<
" of " << nCellsAllClus <<
" calo cells, linked to CaloCluster.");
122 if (keepCellSet->any()){
126 if (keepCellSet->test(onlHash)) {
127 outputRawChannels->push_back(chan);
130 ATH_MSG_DEBUG(
"\tCopied " << outputRawChannels->size() <<
" of " << (*inputRawChContainer).size() <<
" raw channels.");
133 for (
const LArDigit* dig : *inputDigitsContainer) {
135 if (keepCellSet->test(onlHash)) {
136 outputDigits->push_back(dig);
139 ATH_MSG_DEBUG(
"\tCopied " << outputDigits->size() <<
" of " << inputDigitsContainer->size() <<
" digits.");
144 if (keepCellSet->any()){
147 for (
const LArHit* hit : *inputHitsContainer) {
151 if (keepCellSet->test(onlHash)) {
152 LArHit* clusHit =
new LArHit(hit->cellID(),hit->energy(),hit->time());
154 outputHits->push_back(clusHit);
158 ATH_MSG_DEBUG(
"\tCopied " << outputHits->size() <<
" of " << inputHitsContainer->size() <<
" hits.");
162 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
Data object for each calorimeter readout cell.
const_iterator to loop over cells belonging to a cluster
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
const_iterator end() const
const end method
const DataLink< CaloCellContainer > & getCellContainerLink() const
size_t size() const
size method
const_iterator begin() const
const begin method
Gaudi::Property< float > m_clusterPtCut
SG::ReadHandleKey< LArRawChannelContainer > m_rawChInputKey
SG::ReadHandleKey< LArDigitContainer > m_digitsInputKey
const CaloCell_ID * m_caloCellId
SG::ReadHandleKey< LArHitContainer > m_hitsInputKey
virtual StatusCode initialize() override
Gaudi initialize method.
virtual StatusCode execute(const EventContext &ctx) const override
Execute the algorithm.
SG::WriteHandleKey< LArRawChannelContainer > m_rawChOutputKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
SG::WriteHandleKey< ConstCaloCellCont_t > m_caloCellOutputKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterCntKey
SG::ReadHandleKey< CaloCellContainer > m_caloCellInputKey
const LArOnlineID * m_onlineID
Gaudi::Property< float > m_clusterEtaCut
SG::WriteHandleKey< LArHitContainer > m_hitsOutputKey
Gaudi::Property< bool > m_isMC
SG::WriteHandleKey< ConstLArDigitCont_t > m_digitsOutputKey
const ID_type & dataID() const
Get the key that we reference, as a string.
This is a "hash" representation of an Identifier.
Liquid Argon digit base class.
Class to store hit energy and time in LAr cell from G4 simulation.
void finalize()
The method to be called at the end of event by SD.
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
Liquid Argon ROD output object base class.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.