Belle II Software  release-05-01-25
KlId 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 (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 TVector3 &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 TVector3 &klmClusterPosition)
 find nearest KLMCluster, tis distance and the av intercluster distance
 
std::tuple< Belle2::RecoTrack *, double, std::unique_ptr< const TVector3 > > findClosestTrack (const TVector3 &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> KlId::findClosestECLCluster ( const TVector3 &  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 210 of file KlId.h.

210  {
211  int index = 0;
212  int indexOfClosestCluster = -1;
213  for (Belle2::ECLCluster& eclcluster : eclClusters) {
214 
215  if (eclcluster.hasHypothesis(eclhypothesis)) {
216 
217  const TVector3& eclclusterPos = eclcluster.getClusterPosition();
218  double angularDist = eclclusterPos.Angle(klmClusterPosition);
219  if (angularDist < closestECLAngleDist) {
220  closestECLAngleDist = angularDist;
221  indexOfClosestCluster = index;
222  }
223  }
224  ++index;
225  }
226  if (indexOfClosestCluster > -1)
227  closestECL = eclClusters[indexOfClosestCluster];
228  }
229  return std::make_pair(closestECL, closestECLAngleDist);
230  }
231 
232 
234  std::tuple<const Belle2::KLMCluster*, double, double> findClosestKLMCluster(const TVector3& klmClusterPosition)
235  {
236 
238  const Belle2::KLMCluster* closestKLM = nullptr;

◆ getPrimaryPDG()

int KlId::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 158 of file KlId.h.

Belle2::ECLCluster
ECL cluster data.
Definition: ECLCluster.h:39
Belle2::KLMCluster
KLM cluster data.
Definition: KLMCluster.h:38
KlId::findClosestKLMCluster
std::tuple< const Belle2::KLMCluster *, double, double > findClosestKLMCluster(const TVector3 &klmClusterPosition)
find nearest KLMCluster, tis distance and the av intercluster distance
Definition: KlId.h:242
Belle2::StoreArray< Belle2::KLMCluster >