34 return (eg ?
isBarrel(eg->caloCluster()) :
false);
39 const bool isEndcap = cluster->
inEndcap();
41 return cluster->
eSample(CaloSampling::EMB2) >= cluster->
eSample(CaloSampling::EME2);
47 const bool hasEME2 = cluster->
hasSampling(CaloSampling::EME2);
48 const bool hasFCAL0 = cluster->
hasSampling(CaloSampling::FCAL0);
49 if (hasEME2 && hasFCAL0){
50 return cluster->
eSample(CaloSampling::FCAL0) >= cluster->
eSample(CaloSampling::EME2);
58 if (!eg) {
return nullptr; }
59 if (!cook) {
return eg->caloCluster(); }
61 cookClusLinkAcc(
"cookiecutClusterLink" );
62 if (!cookClusLinkAcc.
isAvailable(*eg) || !cookClusLinkAcc(*eg).isValid())
64 return (*cookClusLinkAcc(*eg));
70 std::vector< ElementLink< xAOD::CaloClusterContainer > > veclinks;
72 veclinks=caloClusterLinks(*cluster);
78 std::vector< const xAOD::CaloCluster* > topoclusters;
80 for (
const auto& i : veclinks){
82 topoclusters.push_back(*i);
85 topoclusters.push_back(
nullptr);
95 std::vector< ElementLink< xAOD::FlowElementContainer > > veclinks;
97 veclinks=nflowElementLinks(*eg);
98 }
else if(!neutral && cflowElementLinks.
isAvailable(*eg)){
99 veclinks=cflowElementLinks(*eg);
105 bool neutral,
bool charged){
106 std::vector< const xAOD::FlowElement* > flowelements;
107 if (!neutral && !charged)
110 for (
const auto& i : veclinks){
112 flowelements.push_back(*i);
115 flowelements.push_back(
nullptr);
118 if (neutral && charged) {
120 for (
const auto& i : oveclinks){
122 flowelements.push_back(*i);
125 flowelements.push_back(
nullptr);
150 return std::set<const xAOD::TrackParticle*>{};
170 return std::vector<const xAOD::TrackParticle*>{};
177 return (tp.summaryValue(dummy, info) ? dummy : deflt);
184 return (tp.summaryValue(dummy, info) ? dummy : deflt);
189 double& e2,
double& e3) {
194 unsigned short status = 0;
196 { e2 = acc_Eadded_s2(eg); }
200 { e3 = acc_Eadded_s3(eg); }
SG::ConstAccessor< T, ALLOC > ConstAccessor
SG::Accessor< T, ALLOC > Accessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
float eSample(const CaloSample sampling) const
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
@ Photon
The object is a photon.
@ Electron
The object is an electron.
std::vector< const xAOD::TrackParticle * > getTrackParticlesVec(const xAOD::Egamma *eg, bool useBremAssoc=true, bool allParticles=true)
Return a list of all or only the best TrackParticle associated to the object.
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
bool isFwdElectron(const xAOD::Egamma *eg)
is the object a Fwd electron
std::set< const xAOD::TrackParticle * > getTrackParticles(const xAOD::Egamma *eg, bool useBremAssoc=true, bool allParticles=true)
Return a list of all or only the best TrackParticle associated to the object.
bool isConvertedPhoton(const xAOD::Egamma *eg, bool excludeTRT=false)
is the object a converted photon
bool isFCAL(const xAOD::CaloCluster *cluster)
return true if the cluster (or the majority of its energy) is in the FCAL0
std::vector< ElementLink< xAOD::FlowElementContainer > > getAssociatedFlowElementsLinks(const xAOD::Egamma *eg, bool neutral=true)
Return a vector of the elementlinks to the flow elements associated with the egamma cluster (neutral ...
std::vector< const xAOD::CaloCluster * > getAssociatedTopoClusters(const xAOD::CaloCluster *cluster)
Return a vector of all the topo clusters associated with the egamma cluster.
const xAOD::CaloCluster * getCluster(const xAOD::Egamma *eg, bool cook=true)
return the associated egamma cluster, that might be cookie-cut cluster (fwd electron)
unsigned short energyInMissingCells(const xAOD::Egamma &eg, double &e2, double &e3)
Get the energies in sampling 2 and 3 that are in cells rejected by the topo-cluster timing cut but th...
float summaryValueFloat(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, float deflt=-999.)
return the summary value for a TrackParticle or default value (-999)
int summaryValueInt(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, int deflt=-999)
return the summary value for a TrackParticle or default value (-999) (to be used mostly in python whe...
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
std::vector< ElementLink< xAOD::CaloClusterContainer > > getAssociatedTopoClustersLinks(const xAOD::CaloCluster *cluster)
Return a vector of all the elementlinks to the topo clusters associated with the egamma cluster.
std::vector< const xAOD::FlowElement * > getAssociatedFlowElements(const xAOD::Egamma *eg, bool neutral=true, bool charged=false)
Return a vector of the flow elements associated with the egamma cluster (only neutral for default)
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
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".
Photon_v1 Photon
Definition of the current "egamma version".
SummaryType
Enumerates the different types of information stored in Summary.
Electron_v1 Electron
Definition of the current "egamma version".