24 constexpr float cellEtaSize = 0.1;
25 constexpr float cellPhiSize = 0.1;
29 ISvcLocator* pSvcLocator)
65 "Number of selectors doesn't match number of given fwd-electron selector names"
68 return StatusCode::FAILURE;
83 return StatusCode::SUCCESS;
89 ATH_MSG_INFO(
"====> Forward Egamma Statistics =============");
92 ATH_MSG_INFO(
"=============================================");
94 return StatusCode::SUCCESS;
102 std::make_unique<xAOD::ElectronContainer>(),
103 std::make_unique<xAOD::ElectronAuxContainer>())
119 std::make_unique<CaloClusterCellLinkContainer>())
136 std::vector<ElementLink<xAOD::CaloClusterContainer>>
137 > caloClusterLinks(
"constituentClusterLinks");
141 size_t origClusterIndex = 0;
145 std::pair<float,float> nPVmu = this->
getnPVmu(ctx);
146 gei.
nPV = nPVmu.first;
147 gei.
acmu = nPVmu.second;
156 std::vector<ElementLink<xAOD::CaloClusterContainer>> constituentLinks;
165 cluster->getSisterClusterLink();
168 constituentLinks.push_back(sisterCluster);
173 constituentLinks.emplace_back(*inputClusters, origClusterIndex, ctx);
177 cluster->getCellLinks()->getCellContainerLink();
180 std::unique_ptr<xAOD::CaloCluster> newCluster =
184 std::make_unique<xAOD::CaloCluster>(*cluster);
186 if (!newCluster || newCluster->size() == 0) {
187 ATH_MSG_DEBUG(
"Could not build a new cluster, or has 0 cell");
193 {
ATH_MSG_ERROR(
"Problem executing MVA cluster tool for fwd electron"); }
195 caloClusterLinks(*newCluster) = constituentLinks;
196 outClusterContainer->push_back(std::move(newCluster));
198 size_t index = outClusterContainer->size() - 1;
200 const std::vector<ElementLink<xAOD::CaloClusterContainer>> clusterLinkVector{clusterLink};
203 egammaRecsFwd.
push_back(std::make_unique<egammaRec>(clusterLinkVector));
217 for (
const egammaRec* egRec : egammaRecsFwd) {
219 return StatusCode::FAILURE;
231 xAOD::Electron* el = xaodFrwd->push_back(std::make_unique<xAOD::Electron>());
233 el->setCaloClusterLinks(egRec->caloClusterElementLinks());
239 ++buff_MatchedClusters;
240 el->setTrackParticleLinks(egRec->trackParticleElementLinks());
244 el->setCharge(trackParticle->
charge());
247 " corresponding egammaRec has at least one");
251 el->setTrackCaloMatchValues(
254 egRec->deltaPhiRescaled(),
255 egRec->deltaPhiLast()
269 el->setPassSelection(
static_cast<bool>(accept), name);
272 el->setSelectionisEM(accept.getCutResultInverted(),
"isEM" + name);
280 outClusterContainerCellLink);
282 return StatusCode::SUCCESS;
287 const EventContext& ctx,
301 return StatusCode::SUCCESS;
305 ATH_MSG_ERROR(
"EMTrackMatchBuilder is empty, but track matching is enabled");
306 return StatusCode::FAILURE;
311 return StatusCode::FAILURE;
314 return StatusCode::SUCCESS;
318 const EventContext& ctx)
const {
325 <<
" container, returning nPV = 0");
327 for (
const auto *vtx : *vtxCont) {
337 mu = eiCont.
get()->actualInteractionsPerCrossing();
340 return std::make_pair(npv,mu);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Definition of CaloDetDescrManager.
An algorithm that can be simultaneously executed in multiple threads.
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.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ElementLink implementation for ROOT usage.
SG::Accessor< T, ALLOC > Accessor
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ToolHandleArray< IAsgForwardElectronIsEMSelector > m_forwardElectronIsEMSelectors
Handle to the selectors.
std::pair< unsigned int, float > getnPVmu(const EventContext &ctx) const
Gaudi::Property< bool > m_doCookieCutting
Private member flag to do cookie cutting.
virtual StatusCode execute(const EventContext &ctx) const override final
Execute method.
Gaudi::Property< float > m_maxDelR
Size of cone to cookie cut on FCal.
Gaudi::Accumulators::Counter m_AllClusters
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_topoClusterKey
Input topo cluster type.
ServiceHandle< IegammaMVASvc > m_MVACalibSvc
Handle to the MVA calibration service.
Gaudi::Property< int > m_maxDelEtaCells
Size of maximum search window in eta.
SG::ReadHandleKey< xAOD::EventInfo > m_eiKey
Input EventInfo for fwd energy calibration.
Gaudi::Property< bool > m_doEnergyCal
Private member flag to do energy calibration.
egammaClusterCookieCut::CookieCutPars m_CookieCutPars
SG::ReadHandleKey< xAOD::VertexContainer > m_pVtxKey
Input primary vertices for fwd energy calibration.
StatusCode ExecObjectQualityTool(const EventContext &ctx, xAOD::Egamma *eg) const
ToolHandle< IegammaOQFlagsBuilder > m_objectQualityTool
Tool to perform object quality.
StatusCode RetrieveEMTrackMatchBuilder()
virtual StatusCode finalize() override final
Finalize method.
virtual StatusCode initialize() override final
Initialize method.
SG::WriteHandleKey< xAOD::ElectronContainer > m_electronOutputKey
Output electron container.
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outClusterContainerKey
Output cluster container.
ToolHandle< IEMTrackMatchBuilder > m_trackMatchBuilder
Tool to perform track-cluster matching.
Gaudi::Property< bool > m_doTrackMatching
Private member flag to do the track matching.
egammaForwardBuilder(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Calorimeter description.
Gaudi::Accumulators::Counter m_MatchedClusters
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_outClusterContainerCellLinkKey
Output cluster container cell links: name taken from containter name.
Gaudi::Property< std::vector< std::string > > m_forwardElectronIsEMSelectorResultNames
Gaudi::Property< int > m_maxDelPhiCells
Size of maximum search window in phi.
Represent an egamma object for internal egamma usage during reconstruction.
float charge() const
Returns the charge.
DataVector< egammaRec > EgammaRecContainer
The container is a simple typedef for now.
void calculate(xAOD::Electron &electron)
std::unique_ptr< xAOD::CaloCluster > cookieCut(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &mgr, const DataLink< CaloCellContainer > &cellCont, const egammaClusterCookieCut::CookieCutPars &pars)
const uint16_t AuthorFwdElectron
Electron reconstructed by the Forward cluster-based algorithm.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Egamma_v1 Egamma
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".
A structure holding some global event information.