|
ATLAS Offline Software
|
Go to the documentation of this file.
26 std::vector<ElementLink<xAOD::PFOContainer>>
empty;
32 return StatusCode::SUCCESS;
36 std::vector<const xAOD::PFO*> shotPFOs;
41 shotPFOs.push_back(shotPFO);
45 std::map<unsigned, const xAOD::CaloCluster*> shotToClusterMap =
getShotToClusterMap(shotPFOs, pi0ClusterContainer, tau);
56 TLorentzVector clusterP4;
59 clusterP4 = vertexedCluster.
p4();
62 clusterP4 = cluster->p4();
67 if (clusterP4.DeltaR(tauAxis) > 0.4)
continue;
71 neutralPFOContainer.
push_back(neutralPFO);
74 neutralPFO->
setP4(clusterP4.Pt(), clusterP4.Eta(), clusterP4.Phi(), 0.);
85 std::vector<xAOD::CaloVertexedTopoCluster> vertexedClusterList = tau.
vertexedClusters();
87 TLorentzVector clusterP4 = vertexedCluster.p4();
90 if(clusterP4.E()<=0.)
continue;
91 if(clusterP4.DeltaR(tauAxis) > 0.2)
continue;
93 double clusterEnergyHad = 0.;
102 for (; cellLink != cellLinks->
end(); ++cellLink) {
105 int sampling =
cell->caloDDE()->getSampling();
106 if (sampling < 8)
continue;
109 double cellEnergy =
cell->e() * cellLink.
weight();
110 clusterEnergyHad += cellEnergy;
114 if(clusterEnergyHad <= 0.)
continue;
118 hadronicPFOContainer.
push_back(hadronicPFO);
128 return StatusCode::SUCCESS;
136 std::map<unsigned, const xAOD::CaloCluster*> shotToClusterMap;
140 int seedHashInt = -1;
142 ATH_MSG_WARNING(
"Couldn't find seed hash. Set it to -1, no cluster will be associated to shot.");
152 float weightInCluster = -1.;
153 float weightInPreviousCluster = -1;
158 TLorentzVector clusterP4;
161 clusterP4 = vertexedCluster.
p4();
164 clusterP4 = cluster->p4();
167 weightInCluster = -1.;
169 if (clusterP4.DeltaR(tauAxis) > 0.4)
continue;
173 for (; cellLink != cellLinks->
end(); ++cellLink) {
177 if (
cell->caloDDE()->calo_hash() != seedHash)
continue;
179 weightInCluster = cellLink.
weight();
184 if (weightInCluster < 0)
continue;
187 if (weightInPreviousCluster < 0) {
190 shotToClusterMap[
index] = cluster;
191 weightInPreviousCluster = weightInCluster;
197 if (weightInCluster > weightInPreviousCluster) {
198 shotToClusterMap[
index] = cluster;
206 return shotToClusterMap;
212 const std::map<unsigned, const xAOD::CaloCluster*>& shotToClusterMap,
214 std::vector<unsigned> shotsMatchedToCluster;
219 if (
iterator == shotToClusterMap.end())
continue;
220 if (
iterator->second != &pi0Cluster)
continue;
222 shotsMatchedToCluster.push_back(
index);
225 return shotsMatchedToCluster;
231 const std::vector<unsigned>& shotsInCluster)
const {
232 int totalPhotons = 0;
240 totalPhotons += nPhotons;
249 std::vector<int> nPosECells(3, 0);
253 for (; cellLink != cellLinks->
end(); ++cellLink) {
255 int sampling =
cell->caloDDE()->getSampling();
258 int layer = sampling%4;
259 if (layer < 3 && cell->
e() > 0) {
270 float coreEnergyEM1 = 0.;
271 float totalEnergyEM1 = 0.;
275 for (; cellLink != cellLinks->
end(); ++cellLink) {
279 int sampling =
cell->caloDDE()->getSampling();
280 if (sampling != 1 && sampling != 5)
continue;
284 float cellEnergy =
cell->e() * cellLink.
weight();
285 if (cellEnergy <= 0)
continue;
287 totalEnergyEM1 += cellEnergy;
293 if(std::abs(
deltaPhi) > 0.05 || std::abs(
deltaEta) > 2 * 0.025/8.)
continue;
295 coreEnergyEM1 += cellEnergy;
298 if (totalEnergyEM1 <= 0.)
return 0.;
299 return coreEnergyEM1/totalEnergyEM1;
305 std::vector<float> deltaEtaFirstMom (3, 0.);
306 std::vector<float> totalEnergy (3, 0.);
310 for (; cellLink != cellLinks->
end(); ++cellLink) {
314 int sampling =
cell->caloDDE()->getSampling();
315 int layer = sampling%4;
316 if (
layer >= 3)
continue;
319 float cellEnergy =
cell->e();
320 if (cellEnergy <= 0)
continue;
324 totalEnergy[
layer] += cellEnergy;
328 if (totalEnergy[
layer] != 0.) {
329 deltaEtaFirstMom[
layer]/=std::abs(totalEnergy[
layer]);
332 deltaEtaFirstMom[
layer]=0.;
336 return deltaEtaFirstMom;
342 std::vector<float> deltaEtaSecondMom (3, 0.);
343 std::vector<float> totalEnergy (3, 0.);
347 for (; cellLink != cellLinks->
end(); ++cellLink) {
351 int sampling =
cell->caloDDE()->getSampling();
352 int layer = sampling%4;
353 if (
layer >= 3)
continue;
356 float cellEnergy=
cell->e();
357 if (cellEnergy <= 0)
continue;
361 totalEnergy[
layer] += cellEnergy;
365 if (totalEnergy[
layer] != 0.) {
366 deltaEtaSecondMom[
layer]/=std::abs(totalEnergy[
layer]);
369 deltaEtaSecondMom[
layer]=0.;
373 return deltaEtaSecondMom;
381 const std::vector<const xAOD::PFO*>& shotPFOs,
382 const std::map<unsigned, const xAOD::CaloCluster*>& shotToClusterMap,
399 int NHitsInEM1 =
getNPhotons(shotPFOs, shotsInCluster);
432 const std::array< std::pair<Moment, Attribute>, 12> momentAttributePairs {{
447 for (
const auto& [moment, attribute] : momentAttributePairs) {
461 std::vector<ElementLink<xAOD::IParticleContainer>> shotlinks;
465 if (!shotElementLink.
isValid()) {
468 shotlinks.push_back(shotElementLink);
474 return StatusCode::SUCCESS;
480 double clusterEnergyHad,
482 double clusterPtHad = clusterEnergyHad/std::cosh(cluster.
eta());
483 hadronicPFO.
setP4(clusterPtHad, cluster.
eta(), cluster.
phi(), 0.);
485 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
virtual double phi() const
The azimuthal angle ( ) of the particle.
bool CENTER_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
@ cellBased_firstEtaWRTClusterPosition_EM2
virtual FourMom_t p4() const final
The full 4-momentum of the particle.
@ cellBased_NPosECells_EM1
std::vector< float > get2ndEtaMomWRTCluster(const xAOD::CaloCluster &cluster) const
second eta moment in PS, EM1 and EM2 w.r.t cluster eta
void setProtoNeutralPFOLinks(const PFOLinks_t &protoNeutralPFOs)
StatusCode configureHadronicPFO(const xAOD::CaloVertexedTopoCluster &cluster, double clusterEnergyHad, xAOD::PFO &hadronicPFO) const
Configure the haronic PFO.
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
Gaudi::Property< double > m_clusterEtCut
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
bool attribute(PFODetails::PFOAttributes AttributeType, T &anAttribute) const
get a PFO Variable via enum
@ cellBased_NPosECells_PS
const_iterator begin() const
const begin method
virtual double phi() const final
The azimuthal angle ( ) of the particle.
virtual double eta() const final
The pseudorapidity ( ) of the particle.
bool setAssociatedParticleLinks(PFODetails::PFOParticleType ParticleType, const std::vector< ElementLink< IParticleContainer > > &theParticles)
Set a vector of PFO constituent particle types via enum - overwrite is allowed.
void addProtoNeutralPFOLink(const ElementLink< PFOContainer > &pfo)
add a cellbased_neutral PFO to the tau
@ cellBased_secondEtaWRTClusterPosition_EM1
bool isValid() const
Test to see if the link can be dereferenced.
weight_t weight() const
Accessor for weight associated to this cell.
@ cellBased_firstEtaWRTClusterPosition_EM1
MomentType
Enums to identify different moments.
bool setClusterLink(const ElementLink< xAOD::CaloClusterContainer > &theCluster)
Set a cluster constituent - does NOT append to existing container
@ cellBased_SECOND_LAMBDA
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Description of a calorimeter cluster.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
virtual double eta() const
The pseudorapidity ( ) of the particle.
TauPi0ClusterCreator(const std::string &name)
PFO_v1 PFO
Definition of the current "pfo version".
const PFOLinks_t & shotPFOLinks() const
::StatusCode StatusCode
StatusCode definition for legacy code.
@ cellBased_secondEtaWRTClusterPosition_EM2
Class describing a tau jet.
void addHadronicPFOLink(const ElementLink< PFOContainer > &pfo)
add a hadronic PFO to the tau
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
@ cellBased_FIRST_ETA
These variables belong to the cell-based particle flow algorithm.
bool SECOND_LAMBDA(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
void setBDTPi0Score(float BDTPi0Score)
set BDT Score used to classify clusters as Pi0 like or not
void setHadronicPFOLinks(const PFOLinks_t &hadronicPFOs)
virtual StatusCode executePi0ClusterCreator(xAOD::TauJet &pTau, xAOD::PFOContainer &neutralPFOContainer, xAOD::PFOContainer &hadronicClusterPFOContainer, const xAOD::CaloClusterContainer &pi0CaloClusContainer) const override
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
ElementLink implementation for ROOT usage.
Class describing a particle flow object.
bool SECOND_R(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
std::vector< xAOD::CaloVertexedTopoCluster > vertexedClusters() const
const_iterator end() const
const end method
@ cellBased_ENG_FRAC_CORE
bool CENTER_MAG(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
void setP4(const FourMom_t &vec)
set the 4-vec
void setCharge(float charge)
set charge of PFO
@ cellBased_SECOND_ENG_DENS
@ cellBased_NPosECells_EM2
float eSample(const CaloSample sampling) const
Class describing a Vertex.
Data object for each calorimeter readout cell.
const Vertex * vertex() const
#define ATH_MSG_WARNING(x)
@ cellBased_CENTER_LAMBDA
StatusCode configureNeutralPFO(const xAOD::CaloCluster &cluster, const xAOD::CaloClusterContainer &pi0ClusterContainer, const xAOD::TauJet &tau, const std::vector< const xAOD::PFO * > &shotPFOs, const std::map< unsigned, const xAOD::CaloCluster * > &shotsInCluster, xAOD::PFO &neutralPFO) const
Configure the neutral PFO.
std::map< unsigned, const xAOD::CaloCluster * > getShotToClusterMap(const std::vector< const xAOD::PFO * > &shotVector, const xAOD::CaloClusterContainer &pi0ClusterContainer, const xAOD::TauJet &pTau) const
int getNPhotons(const std::vector< const xAOD::PFO * > &shotVector, const std::vector< unsigned > &shotsInCluster) const
std::vector< float > get1stEtaMomWRTCluster(const xAOD::CaloCluster &cluster) const
first eta moment in PS, EM1 and EM2 w.r.t cluster eta
Evaluate cluster kinematics with a different vertex / signal state.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
const PFO * shotPFO(size_t i) const
Get the pointer to a given shot PFO associated with this tau.
float getEM1CoreFrac(const xAOD::CaloCluster &cluster) const
fraction of cluster enegry in central EM1 cells
void setAttribute(PFODetails::PFOAttributes AttributeType, const T &anAttribute)
Set a PFO Variable via enum - overwrite is allowed.
std::vector< int > getNPosECells(const xAOD::CaloCluster &cluster) const
number of cells from cluster with positive energy in PS, EM1 and EM2
const_iterator to loop over cells belonging to a cluster
std::vector< unsigned > getShotsMatchedToCluster(const std::vector< const xAOD::PFO * > &shotVector, const std::map< unsigned, const xAOD::CaloCluster * > &clusterToShotMap, const xAOD::CaloCluster &pi0Cluster) const
size_t nShotPFOs() const
Get the number of shot PFO particles associated with this tau.
void setCenterMag(float CenterMag)
set CenterMag moment needed for vertex correction