Belle II Software  release-08-01-10
Belle2::KlongId Namespace Reference

Helper functions for all klid modules to improve readability of the code. More...

Functions

int BelleTrackFlag (const Belle2::KLMCluster &cluster, const float angle=0.26)
 get Belle stle track flag
 
int BelleECLFlag (const Belle2::KLMCluster &cluster, const float angle=0.26)
 get Belle stle ECL flag
 
int mcParticleIsBeamBKG (const Belle2::MCParticle *part)
 return if MCparticle is beambkg
 
int mcParticleIsKlong (Belle2::MCParticle *part)
 return the mc hirachy of the klong 0:not a klong 1:final particle, 2: klong is mother etc
 
bool isKLMClusterSignal (const Belle2::KLMCluster &cluster, float mcWeigthCut=0.66)
 checks if a cluster is signal under the mcWeightcondition (mcWeight = energy deposition)
 
bool isECLClusterSignal (const Belle2::ECLCluster &cluster, float mcWeigthCut=0.66)
 checks if a cluster is signal under the mcWeightcondition (mcWeight = energy deposition)
 
int isMCParticlePDG (Belle2::MCParticle *part, int pdg)
 return if mc particle has a certain pdg in the decay chain
 
int getPrimaryPDG (Belle2::MCParticle *part)
 return if mc particles primary pdg. More...
 
std::pair< Belle2::ECLCluster *, double > findClosestECLCluster (const ROOT::Math::XYZVector &klmClusterPosition, const Belle2::ECLCluster::EHypothesisBit eclhypothesis=Belle2::ECLCluster::EHypothesisBit::c_neutralHadron)
 Find the closest ECLCluster with a neutral hadron hypothesis, and return it with its distance. More...
 
std::tuple< const Belle2::KLMCluster *, double, double > findClosestKLMCluster (const ROOT::Math::XYZVector &klmClusterPosition)
 find nearest KLMCluster, tis distance and the av intercluster distance
 
std::tuple< Belle2::RecoTrack *, double, std::unique_ptr< const ROOT::Math::XYZVector > > findClosestTrack (const ROOT::Math::XYZVector &clusterPosition, float cutAngle)
 find nearest genfit track and return it and its distance

 

Detailed Description

Helper functions for all klid modules to improve readability of the code.

Function Documentation

◆ findClosestECLCluster()

std::pair<Belle2::ECLCluster*, double> Belle2::KlongId::findClosestECLCluster ( const ROOT::Math::XYZVector &  klmClusterPosition,
const Belle2::ECLCluster::EHypothesisBit  eclhypothesis = Belle2::ECLCluster::EHypothesisBit::c_neutralHadron 
)

Find the closest ECLCluster with a neutral hadron hypothesis, and return it with its distance.

If there are no suitabile ECLClusters, a nullptr is returned.

Definition at line 203 of file KlId.h.

205  {
206 
207  Belle2::ECLCluster* closestECL = nullptr;
208  double closestECLAngleDist = 1e10;
210 
211  if (eclClusters.getEntries() > 0) {
212  int index = 0;
213  int indexOfClosestCluster = -1;
214  for (Belle2::ECLCluster& eclcluster : eclClusters) {
215 
216  if (eclcluster.hasHypothesis(eclhypothesis)) {
217 
218  const ROOT::Math::XYZVector& eclclusterPos = eclcluster.getClusterPosition();
219  double angularDist = ROOT::Math::VectorUtil::Angle(
220  eclclusterPos, klmClusterPosition);
221  if (angularDist < closestECLAngleDist) {
222  closestECLAngleDist = angularDist;
223  indexOfClosestCluster = index;
224  }
225  }
226  ++index;
227  }
228  if (indexOfClosestCluster > -1)
229  closestECL = eclClusters[indexOfClosestCluster];
230  }
231  return std::make_pair(closestECL, closestECLAngleDist);
232  }
ECL cluster data.
Definition: ECLCluster.h:27
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216

◆ getPrimaryPDG()

int Belle2::KlongId::getPrimaryPDG ( Belle2::MCParticle part)

return if mc particles primary pdg.

this is very imprecise but sufficient to understand if the backgrounds are charged, hadronic or gammas which is whats relevant for klid investigations.

Definition at line 151 of file KlId.h.