25 constexpr float cellEtaSize = 0.1;
26 constexpr float cellPhiSize = 0.1;
30 ISvcLocator* pSvcLocator)
66 "Number of selectors doesn't match number of given fwd-electron selector names"
69 return StatusCode::FAILURE;
79 "Number of selectors doesn't match number of given fwd-electron NN selector names"
82 return StatusCode::FAILURE;
102 return StatusCode::SUCCESS;
108 ATH_MSG_INFO(
"====> Forward Egamma Statistics =============");
111 ATH_MSG_INFO(
"=============================================");
113 return StatusCode::SUCCESS;
121 std::make_unique<xAOD::ElectronContainer>(),
122 std::make_unique<xAOD::ElectronAuxContainer>())
138 std::make_unique<CaloClusterCellLinkContainer>())
154 static const SG::AuxElement::Accessor<
155 std::vector<ElementLink<xAOD::CaloClusterContainer>>
156 > caloClusterLinks(
"constituentClusterLinks");
160 size_t origClusterIndex = 0;
164 std::pair<float,float> nPVmu = this->
getnPVmu(ctx);
165 gei.
nPV = nPVmu.first;
166 gei.
acmu = nPVmu.second;
175 std::vector<ElementLink<xAOD::CaloClusterContainer>> constituentLinks;
184 cluster->getSisterClusterLink();
187 constituentLinks.push_back(sisterCluster);
192 constituentLinks.emplace_back(*inputClusters, origClusterIndex, ctx);
196 cluster->getCellLinks()->getCellContainerLink();
199 std::unique_ptr<xAOD::CaloCluster> newCluster =
203 std::make_unique<xAOD::CaloCluster>(*cluster);
205 if (!newCluster || newCluster->size() == 0) {
206 ATH_MSG_DEBUG(
"Could not build a new cluster, or has 0 cell");
212 {
ATH_MSG_ERROR(
"Problem executing MVA cluster tool for fwd electron"); }
214 caloClusterLinks(*newCluster) = constituentLinks;
215 outClusterContainer->push_back(std::move(newCluster));
217 size_t index = outClusterContainer->size() - 1;
219 const std::vector<ElementLink<xAOD::CaloClusterContainer>> clusterLinkVector{clusterLink};
222 egammaRecsFwd.
push_back(std::make_unique<egammaRec>(clusterLinkVector));
236 for (
const egammaRec* egRec : egammaRecsFwd) {
238 return StatusCode::FAILURE;
250 xAOD::Electron* el = xaodFrwd->push_back(std::make_unique<xAOD::Electron>());
252 el->setCaloClusterLinks(egRec->caloClusterElementLinks());
258 ++buff_MatchedClusters;
259 el->setTrackParticleLinks(egRec->trackParticleElementLinks());
263 el->setCharge(trackParticle->
charge());
266 " corresponding egammaRec has at least one");
270 el->setTrackCaloMatchValues(
273 egRec->deltaPhiRescaled(),
274 egRec->deltaPhiLast()
294 el->setPassSelection(
static_cast<bool>(accept), name);
297 el->setSelectionisEM(accept.getCutResultInverted(),
"isEM" + name);
311 el->setPassSelection(
static_cast<bool>(accept),
"DNN"+name);
313 std::string LikeliHoodName =
"DNN_Score";
315 float val=selector->calculate(ctx,el);
316 el->setLikelihoodValue(val,LikeliHoodName);
324 outClusterContainerCellLink);
326 return StatusCode::SUCCESS;
331 const EventContext& ctx,
345 return StatusCode::SUCCESS;
349 ATH_MSG_ERROR(
"EMTrackMatchBuilder is empty, but track matching is enabled");
350 return StatusCode::FAILURE;
355 return StatusCode::FAILURE;
358 return StatusCode::SUCCESS;
362 const EventContext& ctx)
const {
369 <<
" container, returning nPV = 0");
371 for (
const auto *vtx : *vtxCont) {
381 mu = eiCont.
get()->actualInteractionsPerCrossing();
384 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.
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.
ToolHandle< IForwardElectronCalib > m_forwardElectronpTCalib
ToolHandleArray< IAsgForwardElectronIsEMSelector > m_forwardElectronIsEMSelectors
Handle to the selectors.
Gaudi::Property< bool > m_dopTCal
Private member flag to do pT calibration.
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
ToolHandleArray< IAsgElectronLikelihoodTool > m_forwardElectronNNSelectors
SG::ReadHandleKey< xAOD::VertexContainer > m_pVtxKey
Input primary vertices for fwd energy calibration.
Gaudi::Property< bool > m_fwdDNN
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_forwardElectronNNSelectorResultNames
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.