18const SG::AuxElement::Accessor<float> s_acc_emfraction {
"EMFraction"};
22 const double emfrac_a = s_acc_emfraction(*
a);
23 const double emfrac_b = s_acc_emfraction(*b);
24 return (
a->et() * emfrac_a) > (
b->et() * emfrac_b);
28 double eg_tilegap = 0;
33 for (; cell_itr != cell_end; ++cell_itr) {
35 if (!cell) {
continue; }
38 if (!dde) {
continue; }
42 double ddAbsEta = std::abs(dde->
eta_raw());
43 if (ddAbsEta > 1.4 && ddAbsEta < 1.6) {
52bool checkIfValidForCentral(
58 return aeta <= etaCut && clusterE >= ECut;
61bool checkIfValidForFwd(
66 bool doForwardClusters,
69 if (doForwardClusters) {
72 const double clusterET = clus->
et();
78 return aeta >= etaCut && clusterET >= ETCut;
81 return aetaLC >= etaCut && clusterETLC >= ETCut;
90 ISvcLocator* pSvcLocator):
108 return StatusCode::SUCCESS;
112 ATH_MSG_INFO(
"=====> Selected Topo cluster statistics ===========");
120 ATH_MSG_INFO(
"===================================================");
122 return StatusCode::SUCCESS;
136 std::move(inputShallowcopy.first),
137 std::move(inputShallowcopy.second)
142 auto viewCopy = std::make_unique<ConstDataVector<xAOD::CaloClusterContainer>>(
SG::VIEW_ELEMENTS);
146 std::unique_ptr<ConstDataVector<xAOD::CaloClusterContainer>> fwdViewCopy;
154 fwdViewCopy = std::make_unique<ConstDataVector<xAOD::CaloClusterContainer>>(
SG::VIEW_ELEMENTS);
168 "->CHECKING Cluster at eta,phi,et " <<
169 clus->
eta() <<
" , " <<
170 clus->
phi() <<
" , " <<
175 s_acc_emfraction(*clus) = 0.0;
177 const double clusterE = clus->
e();
178 const double aeta = std::abs(clus->
eta());
180 const bool valid_for_central = checkIfValidForCentral(aeta,
m_etaCut, clusterE,
m_ECut);
182 if (valid_for_central) {
183 ++buff_CentralPassPreSelection;
184 }
else if (valid_for_fwd) {
185 ++buff_FwdPassPreSelection;
190 const bool valid_for_both = valid_for_central && valid_for_fwd;
191 if (valid_for_both) {
192 ++buff_FwdPassPreSelection;
193 ++buff_SharedPassPreSelection;
198 ++buff_FwdPassSelection;
202 double eg_tilegap = 0;
203 if (valid_for_central) {
204 if (aeta > 1.35 && aeta < 1.65 && clusterE > 0) {
205 eg_tilegap += addTileGapCellsEnergy(clus);
212 s_acc_emfraction(*clus) = emfrac;
215 "-->Selected Cluster at eta,phi,et,EMFraction " << clus->
eta() <<
216 " , " << clus->
phi() <<
217 " , " << clus->
et() <<
221 if (valid_for_central) {
222 viewCopy->push_back(clus);
223 ++buff_CentralPassSelection;
227 fwdViewCopy->push_back(clus);
228 ++buff_FwdPassSelection;
231 if (valid_for_both) {
232 ++buff_SharedPassSelection;
238 std::sort(viewCopy->begin(), viewCopy->end(), greater);
241 "Cloned container has size: " << viewCopy->size() <<
242 " selected out of : " << inputTopoclusters->size()
249 std::sort(fwdViewCopy->begin(), fwdViewCopy->end(), greater);
253 "Cloned fwd container has size: " << fwdViewCopy->size() <<
254 " selected out of : " << inputTopoclusters->size()
257 ATH_CHECK(outputFwdTopoclusters.record(std::move(fwdViewCopy)));
260 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
Data object for each calorimeter readout cell.
weight_t weight() const
Accessor for weight associated to this cell.
This class groups all DetDescr information related to a CaloCell.
float eta_raw() const
cell eta_raw
CaloCell_ID::CaloSample getSampling() const
cell sampling
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Gaudi::Accumulators::Counter m_FwdPassPreSelection
SG::WriteHandleKey< ConstDataVector< xAOD::CaloClusterContainer > > m_outputFwdTopoCollection
Gaudi::Accumulators::Counter m_AllClusters
Gaudi::Property< float > m_etaCut
Gaudi::Accumulators::Counter m_SharedPassSelection
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_inputTopoCollection
bool m_doForwardClusters
Private member flag to copy forward clusters.
Gaudi::Property< double > m_fwdETCut
Gaudi::Accumulators::Counter m_SharedPassPreSelection
virtual StatusCode initialize() override final
Gaudi::Property< bool > m_hasITk
Private member flag to do the track matching.
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outputTopoCollectionShallow
Gaudi::Accumulators::Counter m_CentralPassPreSelection
Gaudi::Accumulators::Counter m_FwdPassSelection
SG::WriteHandleKey< ConstDataVector< xAOD::CaloClusterContainer > > m_outputTopoCollection
Gaudi::Property< double > m_fwdEtaCut
virtual StatusCode finalize() override final
Gaudi::Accumulators::Counter m_CentralPassSelection
Gaudi::Property< float > m_ECut
virtual StatusCode execute(const EventContext &ctx) const override final
Gaudi::Property< float > m_EMFracCut
egammaTopoClusterCopier(const std::string &name, ISvcLocator *pSvcLocator)
const CaloCluster_v1 * getSisterCluster() const
Get a pointer to a 'sister' cluster (eg the non-calibrated counterpart).
const_cell_iterator cell_cend() const
const_cell_iterator cell_cbegin() const
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
CaloClusterCellLink::const_iterator const_cell_iterator
Iterator of the underlying CaloClusterCellLink (explicitly const version).
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
virtual double phi() const
The azimuthal angle ( ) of the particle.
bool greater(double a, double b)
Compare two FP numbers, working around x87 precision issues.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
bool isFCAL(const xAOD::CaloCluster *cluster)
return true if the cluster (or the majority of its energy) is in the FCAL0
typename ShallowCopyResult< T >::type ShallowCopyResult_t
Return type of xAOD::shallowCopy.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.