 |
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();
70 neutralPFOContainer.
push_back(neutralPFO);
73 neutralPFO->
setP4(clusterP4.Pt(), clusterP4.Eta(), clusterP4.Phi(), 0.);
84 std::vector<xAOD::CaloVertexedTopoCluster> vertexedClusterList = tau.
vertexedClusters();
86 TLorentzVector clusterP4 = vertexedCluster.p4();
91 double clusterEnergyHad = 0.;
100 for (; cellLink != cellLinks->
end(); ++cellLink) {
103 int sampling =
cell->caloDDE()->getSampling();
104 if (sampling < 8)
continue;
107 double cellEnergy =
cell->e() * cellLink.
weight();
108 clusterEnergyHad += cellEnergy;
112 if(clusterEnergyHad <= 0.)
continue;
116 hadronicPFOContainer.
push_back(hadronicPFO);
126 return StatusCode::SUCCESS;
134 std::map<unsigned, const xAOD::CaloCluster*> shotToClusterMap;
138 int seedHashInt = -1;
140 ATH_MSG_WARNING(
"Couldn't find seed hash. Set it to -1, no cluster will be associated to shot.");
150 float weightInCluster = -1.;
151 float weightInPreviousCluster = -1;
156 TLorentzVector clusterP4;
159 clusterP4 = vertexedCluster.
p4();
162 clusterP4 = cluster->p4();
165 weightInCluster = -1.;
170 for (; cellLink != cellLinks->
end(); ++cellLink) {
174 if (
cell->caloDDE()->calo_hash() != seedHash)
continue;
176 weightInCluster = cellLink.
weight();
181 if (weightInCluster < 0)
continue;
184 if (weightInPreviousCluster < 0) {
187 shotToClusterMap[
index] = cluster;
188 weightInPreviousCluster = weightInCluster;
194 if (weightInCluster > weightInPreviousCluster) {
195 shotToClusterMap[
index] = cluster;
203 return shotToClusterMap;
209 const std::map<unsigned, const xAOD::CaloCluster*>& shotToClusterMap,
211 std::vector<unsigned> shotsMatchedToCluster;
216 if (
iterator == shotToClusterMap.end())
continue;
217 if (
iterator->second != &pi0Cluster)
continue;
219 shotsMatchedToCluster.push_back(
index);
222 return shotsMatchedToCluster;
228 const std::vector<unsigned>& shotsInCluster)
const {
229 int totalPhotons = 0;
237 totalPhotons += nPhotons;
246 std::vector<int> nPosECells(3, 0);
250 for (; cellLink != cellLinks->
end(); ++cellLink) {
252 int sampling =
cell->caloDDE()->getSampling();
255 int layer = sampling%4;
256 if (layer < 3 && cell->
e() > 0) {
267 float coreEnergyEM1 = 0.;
268 float totalEnergyEM1 = 0.;
272 for (; cellLink != cellLinks->
end(); ++cellLink) {
276 int sampling =
cell->caloDDE()->getSampling();
277 if (sampling != 1 && sampling != 5)
continue;
281 float cellEnergy =
cell->e() * cellLink.
weight();
282 if (cellEnergy <= 0)
continue;
284 totalEnergyEM1 += cellEnergy;
290 if(std::abs(
deltaPhi) > 0.05 || std::abs(
deltaEta) > 2 * 0.025/8.)
continue;
292 coreEnergyEM1 += cellEnergy;
295 if (totalEnergyEM1 <= 0.)
return 0.;
296 return coreEnergyEM1/totalEnergyEM1;
302 std::vector<float> deltaEtaFirstMom (3, 0.);
303 std::vector<float> totalEnergy (3, 0.);
307 for (; cellLink != cellLinks->
end(); ++cellLink) {
311 int sampling =
cell->caloDDE()->getSampling();
312 int layer = sampling%4;
313 if (
layer >= 3)
continue;
316 float cellEnergy =
cell->e();
317 if (cellEnergy <= 0)
continue;
321 totalEnergy[
layer] += cellEnergy;
325 if (totalEnergy[
layer] != 0.) {
326 deltaEtaFirstMom[
layer]/=std::abs(totalEnergy[
layer]);
329 deltaEtaFirstMom[
layer]=0.;
333 return deltaEtaFirstMom;
339 std::vector<float> deltaEtaSecondMom (3, 0.);
340 std::vector<float> totalEnergy (3, 0.);
344 for (; cellLink != cellLinks->
end(); ++cellLink) {
348 int sampling =
cell->caloDDE()->getSampling();
349 int layer = sampling%4;
350 if (
layer >= 3)
continue;
353 float cellEnergy=
cell->e();
354 if (cellEnergy <= 0)
continue;
358 totalEnergy[
layer] += cellEnergy;
362 if (totalEnergy[
layer] != 0.) {
363 deltaEtaSecondMom[
layer]/=std::abs(totalEnergy[
layer]);
366 deltaEtaSecondMom[
layer]=0.;
370 return deltaEtaSecondMom;
378 const std::vector<const xAOD::PFO*>& shotPFOs,
379 const std::map<unsigned, const xAOD::CaloCluster*>& shotToClusterMap,
396 int NHitsInEM1 =
getNPhotons(shotPFOs, shotsInCluster);
429 const std::array< std::pair<Moment, Attribute>, 12> momentAttributePairs {{
444 for (
const auto& [moment, attribute] : momentAttributePairs) {
458 std::vector<ElementLink<xAOD::IParticleContainer>> shotlinks;
462 if (!shotElementLink.
isValid()) {
465 shotlinks.push_back(shotElementLink);
471 return StatusCode::SUCCESS;
477 double clusterEnergyHad,
479 double clusterPtHad = clusterEnergyHad/std::cosh(cluster.
eta());
480 hadronicPFO.
setP4(clusterPtHad, cluster.
eta(), cluster.
phi(), 0.);
482 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.
Gaudi::Property< double > m_maxDeltaRNeutral
@ 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
Gaudi::Property< double > m_maxDeltaRJetClust
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