15 constexpr float cellEtaSize = 0.1;
16 constexpr float cellPhiSize = 0.1;
27 ATH_MSG_DEBUG(
"Will store cookie cut clusters in this container "
38 if (msgLvl(MSG::DEBUG)) {
55 return StatusCode::SUCCESS;
64 static const std::vector<CaloSampling::CaloSample> s_sam
65 { CaloSampling::PreSamplerB, CaloSampling::EMB1,
66 CaloSampling::EMB2, CaloSampling::EMB3,
67 CaloSampling::PreSamplerE, CaloSampling::EME1,
68 CaloSampling::EME2, CaloSampling::EME3,
69 CaloSampling::TileBar0, CaloSampling::TileBar1, CaloSampling::TileBar2,
70 CaloSampling::TileExt0, CaloSampling::TileExt1, CaloSampling::TileExt2,
71 CaloSampling::TileGap1, CaloSampling::TileGap2, CaloSampling::TileGap3,
72 CaloSampling::HEC0, CaloSampling::HEC1,
73 CaloSampling::HEC2, CaloSampling::HEC3,
74 CaloSampling::FCAL0, CaloSampling::FCAL1, CaloSampling::FCAL2 };
88 std::make_unique<CaloClusterCellLinkContainer>())
96 return StatusCode::SUCCESS;
99 std::vector<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> decoM;
101 for (
int i = 0; i <
m_nDecor - 1; i++) {
105 if (msgLevel(MSG::DEBUG)) {
106 std::call_once(
m_Seen, [
this,&decoM]() {
107 for (
int i = 0; i <
m_nDecor - 1; i++) {
110 <<
" " << decoM[i].decorKey());
127 std::vector<bool> success(nF,
true);
133 <<
" pT = " << cluster->
pt()
134 <<
" eta = " << cluster->
eta());
139 std::unique_ptr<xAOD::CaloCluster> newCluster =
143 if (!newCluster || newCluster->getCellLinks()->size() == 0) {
146 <<
" pT = " << electron->pt()
147 <<
" eta = " << electron->eta()
148 <<
" original cluster " << cluster->index()
149 <<
" pT = " << cluster->
pt()
150 <<
" eta = " << cluster->
eta()
151 <<
" has EME2 or FCAL0"
153 <<
" " << cluster->
hasSampling(CaloSampling::FCAL0)
155 << (newCluster ?
" no cells in cluster" :
" no cluster"));
162 success[iel] =
false;
168 <<
" pT = " << newCluster->pt()
169 <<
" eta = " << newCluster->eta());
171 outClusterContainer->push_back(std::move(newCluster));
172 size_t index = outClusterContainer->size() - 1;
174 clusterLink(*outClusterContainer,
index, ctx);
176 decoEl(*electron) = clusterLink;
181 for (
size_t i = 0; i <
m_vecM.size(); i++) {
188 <<
" does not exist for the original cluster");
190 decoM[indexDecor](*electron) = float(m);
192 <<
" with original moment "
194 <<
" = " << m <<
" (decoration index =" << indexDecor
195 <<
" key = " << decoM[indexDecor].decorKey() <<
")");
202 ToolHandleArray<CaloClusterCollectionProcessor>::const_iterator
205 for (; toolIt != toolIt_e; ++toolIt) {
206 ATH_CHECK((*toolIt)->execute(ctx, outClusterContainer.
ptr()));
210 static const SG::AuxElement::Accessor<
212 cookClusLinkAcc(
"cookiecutClusterLink" );
219 if (success[iel] && cluster ==
nullptr) {
221 "could not be retrieved");
224 for (
size_t i = 0; i <
m_vecM.size(); i++) {
232 <<
" does not exist for the new cluster");
235 decoM[indexDecor](*electron) = float(m);
237 <<
" with new moment "
239 <<
" = " << m <<
" (decoration index = " << indexDecor
240 <<
" key = " << decoM[indexDecor].decorKey() <<
")");
250 outClusterContainerCellLink);
253 <<
" cookie cut clusters");
255 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
xAOD::ElectronContainer * electronContainer
const DataLink< CaloCellContainer > & getCellContainerLink() const
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
This class provides the client interface for accessing the detector description information common to...
Object reference supporting deferred reading from StoreGate.
ElementLink implementation for ROOT usage.
Handle class for adding a decoration to an object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version).
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters).
virtual double eta() const
The pseudorapidity ( ) of the particle.
float eSample(const CaloSample sampling) const
MomentType
Enums to identify different moments.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::unique_ptr< xAOD::CaloCluster > cookieCut(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &mgr, const DataLink< CaloCellContainer > &cellCont, const egammaClusterCookieCut::CookieCutPars &pars)
const xAOD::CaloCluster * getCluster(const xAOD::Egamma *eg, bool cook=true)
return the associated egamma cluster, that might be cookie-cut cluster (fwd electron)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".