Belle II Software  release-06-01-15
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 (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> Belle2::KlongId::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 199 of file KlId.h.

201  {
202 
203  Belle2::ECLCluster* closestECL = nullptr;
204  double closestECLAngleDist = 1e10;
206 
207  if (eclClusters.getEntries() > 0) {
208  int index = 0;
209  int indexOfClosestCluster = -1;
210  for (Belle2::ECLCluster& eclcluster : eclClusters) {
211 
212  if (eclcluster.hasHypothesis(eclhypothesis)) {
213 
214  const TVector3& eclclusterPos = eclcluster.getClusterPosition();
215  double angularDist = eclclusterPos.Angle(klmClusterPosition);
216  if (angularDist < closestECLAngleDist) {
217  closestECLAngleDist = angularDist;
218  indexOfClosestCluster = index;
219  }
220  }
221  ++index;
222  }
223  if (indexOfClosestCluster > -1)
224  closestECL = eclClusters[indexOfClosestCluster];
225  }
226  return std::make_pair(closestECL, closestECLAngleDist);
227  }
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 147 of file KlId.h.