Belle II Software  release-06-01-15
analysis modules
Collaboration diagram for analysis modules:

Classes

class  AllParticleCombinerModule
 This module combines all particles of the provided list to one mother particle. More...
 
class  AnalysisConfigurationModule
 Class to hold general basf2 configuration Used to intiate and configure CreateAnalysis object. More...
 
class  BestCandidateSelectionModule
 Ranks particles by the values of a variable. More...
 
class  EnergyBiasCorrectionModule
 Energy bias correction. More...
 
class  BelleBremRecoveryModule
 Brem recovery module (used in past belle analyses) This module add four vector of all the brem photon to the four vector associated to the charged particle. More...
 
class  BremsFinderModule
 Bremsstrahlung finder correction module For each lepton in the input particle list, this module copies it to the output particle list and uses the results of the eclTrackBremFinder module to look for a possible bremsstrahlung photon; if this photon exists, adds its four momentum to the leptons in the output list. More...
 
class  BtubeCreatorModule
 Create a B particle from a Bbar particle. More...
 
class  ChargedPidMVAModule
 This module evaluates the response of an MVA trained for binary charged particle identification between two hypotheses, S and B. More...
 
class  ChargedPidMVAMulticlassModule
 This module evaluates the response of a multi-class MVA trained for global charged particle identification. More...
 
class  ContinuumSuppressionBuilderModule
 Creates for each Particle in given ParticleList an ContinuumSuppression dataobject and makes basf2 relation between them. More...
 
class  CurlTaggerModule
 This module is designed to tag curl tracks. More...
 
class  DistanceCalculatorModule
 Calculates distance between two vertices, distance of closest approach between a vertex and a track, distance of closest approach between a vertex and Btube. More...
 
class  DuplicateVertexMarkerModule
 Identify duplicate vertices (distinct particles, but built from the same daughters) and mark the one with best chi2. More...
 
class  EventKinematicsModule
 Module to compute global quantities related to the event kinematics, like total missing energy and mass2, visible energy, etc. More...
 
class  EventShapeCalculatorModule
 Module to compute event shape variables starting from three lists of particle objects (tracks, gammas, Klongs). More...
 
class  ExtraInfoPrinterModule
 Prints the names of the ExtraInfos for a ParticleList or for the Event. More...
 
class  ExtraInfoRemoverModule
 This module deletes the extrainfo of each particle in the given ParticleLists. More...
 
class  FixECLClustersModule
 Sets ConnectedRegionID and ClusterID to ECLClusters on MC samples with old ECLCluster design. More...
 
class  FlavorTaggerInfoBuilderModule
 Creates for each Particle and RestOfEvent object in the DataStore a FlavorTaggerInfo dataobject and makes basf2 relation between them. More...
 
class  FlavorTaggerInfoFillerModule
 Creates a new flavorTaggerInfoMap DataObject for the specific methods. More...
 
class  HelixErrorScalerModule
 scale the error of helix parameters More...
 
class  InclusiveBtagReconstructionModule
 Inclusively reconstructs anti-B:tag from input ParticleLists for given B:sig. More...
 
class  Map2Vector
 Helper class to make a vector of all possible combinations of int numbers contained in the input vectors (passed as values in a map). More...
 
class  InclusiveDstarReconstructionModule
 Inclusive D* reconstruction module. More...
 
class  KlongDecayReconstructorExpertModule
 reco missing module More...
 
class  KlongMomentumCalculatorExpertModule
 reco missing module More...
 
class  DecayTree< T >
 This is a helper class for the MCDecayFinderModule. More...
 
class  MCDecayFinderModule
 Find decays in MCParticle list matching a given DecayString. More...
 
class  MCMatcherParticlesModule
 MC matching module: module performs MC matching (sets the relation Particle -> MCParticle) for all particles and its (grand)^N-daughter particles in the user-specified ParticleList. More...
 
class  OnlyWriteOutParticleListsModule
 Marks all objects in DataStore except those of type ParticleList as WrtieOut=False. More...
 
class  ParticleCombinerModule
 particle combiner module More...
 
class  ParticleCombinerFromMCModule
 particle combiner module More...
 
class  ParticleCopierModule
 Module for creating copies of Particles. More...
 
class  ParticleListManipulatorModule
 Module for copying Particles (actually their indices) from two or more ParticleLists(s) to another ParticleList. More...
 
class  ParticleLoaderModule
 Loads MDST dataobjects as Particle objects to the StoreArray<Particle> and collects them in specified ParticleList. More...
 
class  ParticleMassUpdaterModule
 This module replaces the mass of the particles inside the given particleLists with the invariant mass of the particle corresponding to the given pdgCode. More...
 
class  ParticleMCDecayStringModule
 Adds the Monte Carlo decay string to a Particle. More...
 
class  ParticlePrinterModule
 prints particle list to screen More...
 
class  ParticleSelectorModule
 Loops over all Particles in the ParticleList and removes those Particles from the ParticleList that do not pass given selection criteria. More...
 
class  ParticleStatsModule
 This module summarises the ParticleLists in the event. More...
 
class  ParticleVertexFitterModule
 Vertex fitter module. More...
 
class  ParticleWeightingModule
 Module to apply weights from the database to particles and store added info in ExtraInfo. More...
 
class  ParticleWeightingLookUpCreatorModule
 Module that creates LookUpTable and upload it to the DB. More...
 
class  PhotonEfficiencySystematicsModule
 Adds Photon Detection Efficiency Data/MC ratios To Particle List. More...
 
class  PrintMCParticlesModule
 The PrintMCParticles module. More...
 
class  PseudoVertexFitterModule
 Pseudo Vertex fitter module. More...
 
class  RemoveParticlesNotInListsModule
 Removes all Particles that are not in a given list of ParticleLists (or daughters of those). More...
 
class  RestOfEventBuilderModule
 Creates for each Particle in given ParticleList an RestOfEvent (ROE) dataobject and makes basf2 relation between them. More...
 
class  RestOfEventInterpreterModule
 Creates a mask (vector of boolean values) for tracks and clusters in RestOfEvent regarding their usage. More...
 
class  RestOfEventPrinterModule
 prints ROE information and masks to screen More...
 
class  RestOfEventUpdaterModule
 Updates an existing mask (map of boolean values) for tracks or eclClusters in RestOfEvent with an available property (e.g. More...
 
class  SelectDaughtersModule
 Redefine (select) the daughters of a particle. More...
 
class  SignalSideParticleFilterModule
 The module returns true if the current RestOfEvent object is related to any of the Particles in the input ParticleLists. More...
 
class  SignalSideParticleListCreatorModule
 The module creates a ParticleList and fills it with one of the daughter Particles. More...
 
class  SignalSideVariablesToDaughterExtraInfoModule
 The module writes properties (values of specified variables) of the particle related to the current ROE as an ExtraInfo to the single particle in the input ParticleList. More...
 
class  SignalSideVariablesToExtraInfoModule
 The module writes property of single particle found in the input ParticleList as an ExtraInfo to the Particle related to the current ROE. More...
 
class  SkimFilterModule
 This module filters events based on presence of candidates in a list of ParticleLists. More...
 
class  TagUniqueSignalModule
 Loops through the particle list finds a unique signal candidate for each event. More...
 
class  TagVertexModule
 Tag side Vertex Fitter module for modular analysis. More...
 
struct  ParticleAndWeight
 this struct is used to store and sort the tag tracks More...
 
class  TauDecayMarkerModule
 Module to identify generated tau pair decays, using MCParticle information. More...
 
class  TauDecayModeModule
 Module to classify tau decay events according to a mapping given by the user or with a default mapping based on the TauolaBelle2 decay list. More...
 
class  TrackingEfficiencyModule
 This set of module is designed for tracking systematics studies. More...
 
class  TrackingMomentumModule
 Tracking momentum systematics. More...
 
class  DetSurfCylBoundaries
 Simple class to encapsulate a detector inner surface's boundaries in cylindrical coordinates. More...
 
class  TrackIsoCalculatorModule
 Calculate track isolation variables on the input ParticleList. More...
 
class  TreeFitterModule
 Module to fit an entire decay tree. More...
 
class  V0DaughterMassUpdaterModule
 This module replaces the mass of two daughters of the selected V0 particles inside the given particleLists with masses of given pdgCode. More...
 
class  VariablesToEventBasedTreeModule
 Module to calculate variables specified by the user for a given ParticleList and save them into a TTree. More...
 
class  VariablesToEventExtraInfoModule
 For each particle in the input list the selected variables are saved in an event-extra-info field with the given name, Can be used to save MC truth information, for example, in a ntuple of reconstructed particles. More...
 
class  VariablesToExtraInfoModule
 For each particle in the input list the selected variables are saved in an extra-info field with the given name, Can be used when wanting to save variables before modifying them, e.g. More...
 
class  VariablesToHistogramModule
 Module to calculate variables specified by the user for a given ParticleList and save them into an Histogram. More...
 
class  VariablesToNtupleModule
 Module to calculate variables specified by the user for a given ParticleList and save them into a ROOT TTree. More...
 
class  VariableToReturnValueModule
 Module to calculate variable specified by the user and set return value accordingly. More...
 

Typedefs

typedef std::tuple< double, double > BinLimitsTuple
 Currently, std::pair can not be retrieved from python list We will get ParticleWeightingLookUpTable entries with tuples and transform tuples to pairs here. More...
 
typedef std::map< std::string, BinLimitsTupleNDBinTuple
 the NDimensional tuple of bin limits
 
typedef std::tuple< WeightInfo, NDBinTuplenoIdEntry
 the ID
 
typedef std::tuple< noIdEntry, double > specificIDEntry
 the specific ID
 
typedef std::vector< noIdEntrylistOfNoIdEntries
 List of entries for table to be created from without specified ID.
 
typedef std::vector< specificIDEntrylistOfSpecificIDEntries
 List of entries for table to be created from with specified ID.
 

Functions

bool isFSP (int pdg)
 defines what is a final state particle for this purpose.
 
static const TVector3 vecNaN (realNaN, realNaN, realNaN)
 vector with NaN entries
 
static const TMatrixDSym matNaN (3,(double[]) { realNaN, realNaN, realNaN, realNaN, realNaN, realNaN, realNaN, realNaN, realNaN })
 3x3 matrix with NaN entries
 
static TLorentzVector flipVector (TLorentzVector vIn)
 Get vector which is opposite to vIn in CMS ref frame Be aware that input vIn and output are in the Lab frame.
 
static double getProperLifeTime (const MCParticle *mc)
 proper life time, i.e. More...
 
 BelleBremRecoveryModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
 BremsFinderModule ()
 Constructor, for setting module description and parameters.
 
virtual void initialize () override
 Use this to initialize resources or memory your module needs. More...
 
virtual void event () override
 Called once for each event. More...
 
 KlongDecayReconstructorExpertModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
 KlongMomentumCalculatorExpertModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
 DecayTree ()
 Default constructor.
 
 DecayTree (T *obj)
 Constructor with decaying object (e.g. More...
 
 ~DecayTree ()
 Destructor.
 
std::vector< DecayTree< T > * > getDaughters ()
 Return list of decay daughters.
 
T * getObj ()
 Return the decaying object itself, e.g. More...
 
void setObj (T *obj)
 Set the decaying object, e.g. More...
 
void clear ()
 Frees memory occupied by m_myObject and the daughter objects.
 
void append (DecayTree< T > *t)
 Add a daughter, which is a DecayTree itself.
 
 MCMatcherParticlesModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
void setLooseMCMatch (const Particle *particle)
 Finds common mother of the majority of daughters. More...
 
 ParticleCombinerModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
 ParticleCombinerFromMCModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
void registerParticleRecursively (const DecayDescriptor &decaydescriptor)
 Register particles which have (sub-)decay recursively. More...
 
void combineRecursively (const DecayDescriptor &decaydescriptor)
 Combine particles which have (sub-)decay recursively. More...
 
 ParticleCopierModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
 ParticleListManipulatorModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
void fillUniqueIdentifier (const Particle *p, std::vector< int > &idSequence)
 Fills unique identifier for the input particle. More...
 
bool isUnique (const std::vector< int > &idSequence)
 Compares input idSequence to all sequences already included in the list. More...
 
 ParticleLoaderModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
virtual void terminate () override
 Terminate the Module. More...
 
void roeToParticles ()
 Loads ROE object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleList.
 
void addROEToParticleList (RestOfEvent *roe, int mdstIndex, int pdgCode=0, bool isSelfConjugatedParticle=true)
 Helper method to load ROE object as Particle.
 
void v0sToParticles ()
 Loads V0 object as Particle of specified type to StoreArray<Particle> and adds it to the ParticleList.
 
void tracksToParticles ()
 Loads Track object as Particle to StoreArray<Particle> and adds it to the ParticleList.
 
void eclAndKLMClustersToParticles ()
 Loads ECLCluster and KLMCluster object as Particle to StoreArray<Particle> and adds it to the ParticleList.
 
void mcParticlesToParticles ()
 Loads specified MCParticles as Particle to StoreArray<Particle>
 
bool isValidPDGCode (const int pdgCode)
 returns true if the PDG code determined from the decayString is valid
 
void appendDaughtersRecursive (Particle *mother)
 recursively append bottom of a particle's decay chain (daughters of mother, granddaughters of daughter and so on).
 
 ParticleMCDecayStringModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the module.
 
virtual void event () override
 Called for each event.
 
virtual void terminate () override
 Terminate modules.
 
const MCParticlegetInitialParticle (const MCParticle *mcP)
 search from mcP upwards for a particle that matches specified mother PDG codes.
 
std::string getDecayString (const Particle &p)
 get the decay string for p.
 
std::string getDecayStringFromParticle (const Particle *p)
 get decay string of particle
 
std::string getMCDecayStringFromParticle (const Particle *p)
 get mc decay string from particle
 
std::string getMCDecayStringFromMCParticle (const MCParticle *mcPMatched)
 get mc decay string from mc particle
 
std::string buildMCDecayString (const MCParticle *mcPMother, const MCParticle *mcPMatched)
 return decay string for mcPMother, highlight mcPMatched.
 
void convertToConciseString (std::string &string)
 Convert the extended string to a more concise format.
 
 ParticlePrinterModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
void printVariables (const Particle *particle) const
 Prints out the values of variables specified by the user via the Variables module parameter.
 
 ParticleSelectorModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
 ParticleVertexFitterModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
bool doVertexFit (Particle *p)
 Main steering routine. More...
 
bool fillFitParticles (const Particle *mother, std::vector< const Particle * > &fitChildren, std::vector< const Particle * > &twoPhotonChildren)
 Fills valid particle's children (with valid error matrix) in the vector of Particles that will enter the fit. More...
 
bool redoTwoPhotonDaughterMassFit (Particle *postFit, const Particle *preFit, const analysis::VertexFitKFit &kv)
 Combines preFit particle and vertex information from vertex fit kv to create new postFit particle. More...
 
bool doKVertexFit (Particle *p, bool ipProfileConstraint, bool ipTubeConstraint)
 Unconstrained vertex fit using KFit. More...
 
bool doKMassVertexFit (Particle *p)
 Mass-constrained vertex fit using KFit. More...
 
bool doKMassPointingVertexFit (Particle *p)
 Mass-constrained vertex fit with additional pointing constraint using KFit. More...
 
bool doKMassFit (Particle *p)
 Mass fit using KFit. More...
 
bool doKFourCFit (Particle *p)
 FourC fit using KFit. More...
 
bool doKMassFourCFit (Particle *p)
 MassFourC fit using KFit. More...
 
bool makeKVertexMother (analysis::VertexFitKFit &kv, Particle *p)
 Update mother particle after unconstrained vertex fit using KFit. More...
 
bool makeKMassVertexMother (analysis::MassVertexFitKFit &kv, Particle *p)
 Update mother particle after mass-constrained vertex fit using KFit. More...
 
bool makeKMassPointingVertexMother (analysis::MassPointingVertexFitKFit &kv, Particle *p)
 Update mother particle after mass-constrained vertex fit with additional pointing constraint using KFit. More...
 
bool makeKMassMother (analysis::MassFitKFit &kv, Particle *p)
 Update mother particle after mass fit using KFit. More...
 
bool makeKFourCMother (analysis::FourCFitKFit &kv, Particle *p)
 Update mother particle after FourC fit using KFit. More...
 
bool makeMassKFourCMother (analysis::MassFourCFitKFit &kv, Particle *p)
 Update mother particle after MassFourC fit using KFit. More...
 
void updateMapOfTrackAndDaughter (unsigned &l, std::vector< std::vector< unsigned >> &pars, std::vector< unsigned > &pard, std::vector< Particle * > &allparticles, const Particle *daughter)
 update the map of daughter and tracks, find out which tracks belong to each daughter. More...
 
bool doRaveFit (Particle *mother)
 Fit using Rave. More...
 
bool allSelectedDaughters (const Particle *mother, const std::vector< const Particle * > &tracksVertex)
 check if all the Daughters (o grand-daughters) are selected for the vertex fit
 
bool addChildofParticletoKFit (analysis::FourCFitKFit &kv, const Particle *particle)
 Adds given particle's child to the FourCFitKFit. More...
 
bool addChildofParticletoMassKFit (analysis::MassFourCFitKFit &kf, const Particle *particle, std::vector< unsigned > &particleId)
 Adds given particle's child to the MassFourCFitKFit. More...
 
void addIPProfileToKFit (analysis::VertexFitKFit &kv)
 Adds IPProfile constraint to the vertex fit using KFit.
 
void addIPTubeToKFit (analysis::VertexFitKFit &kv)
 Adds IPTube constraint to the vertex fit using KFit.
 
void findConstraintBoost (double cut)
 calculate iptube constraint (quasi cylinder along boost direction) for RAVE fit
 
void smearBeamSpot (double width)
 smear beam spot covariance
 
 ParticleWeightingModule ()
 Constructor.
 
WeightInfo getInfo (const Particle *p)
 Get LookUp information for the particle. More...
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processing by the module. More...
 
 ParticleWeightingLookUpCreatorModule ()
 Constructor.
 
NDBin NDBinTupleToNDBin (const NDBinTuple &bin_tuple)
 Currently, std::pair can not be retrieved from python list We will get ParticleWeightingLookUpTable entries with tuples and transform tuples to pairs here. More...
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void terminate () override
 Clean up anything created in initialize().
 
 PseudoVertexFitterModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
bool add_matrix (Particle *p)
 Main steering routine. More...
 
 RestOfEventInterpreterModule ()
 Constructor: Sets the description, the properties and the parameters of the module.
 
virtual void initialize () override
 Overridden initialize method.
 
virtual void event () override
 Overridden event method.
 
 RestOfEventPrinterModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void event () override
 Event processor.
 
void printMaskParticles (const std::vector< const Particle * > &maskParticles) const
 Prints out values of the specific ROE mask.
 
 RestOfEventUpdaterModule ()
 Constructor: Sets the description, the properties and the parameters of the module.
 
virtual void initialize () override
 Overridden initialize method.
 
virtual void event () override
 Overridden event method.
 
void updateMasksWithV0 (const StoreObjPtr< RestOfEvent > &roe, std::vector< const Particle * > &particlesToUpdate)
 Update ROE masks with provided composite particle collection. More...
 
void updateMasksWithParticles (const StoreObjPtr< RestOfEvent > &roe, std::vector< const Particle * > &particlesToUpdate, Particle::EParticleSourceObject listType)
 Update ROE masks by excluding or keeping particles. More...
 
 TagVertexModule ()
 Constructor.
 
virtual void initialize () override
 Initialize the Module. More...
 
virtual void beginRun () override
 Called when entering a new run. More...
 
virtual void event () override
 Event processor.
 
bool doVertexFit (const Particle *Breco)
 central method for the tag side vertex fit
 
std::pair< TVector3, TMatrixDSym > findConstraint (const Particle *Breco, double cut) const
 calculate the constraint for the vertex fit on the tag side using Breco information
 
std::pair< TVector3, TMatrixDSym > findConstraintBTube (const Particle *Breco, double cut)
 calculate constraint for the vertex fit on the tag side using the B tube (cylinder along the expected BTag line of flights
 
std::pair< TVector3, TMatrixDSym > findConstraintBoost (double cut, double shiftAlongBoost=-2000.) const
 calculate the standard constraint for the vertex fit on the tag side
 
void BtagMCVertex (const Particle *Breco)
 get the vertex of the MC B particle associated to Btag. More...
 
static bool compBrecoBgen (const Particle *Breco, const MCParticle *Bgen)
 compare Breco with the two MC B particles
 
std::vector< const Particle * > getTagTracks_standardAlgorithm (const Particle *Breco, int nPXDHits) const
 performs the fit using the standard algorithm - using all tracks in RoE The user can specify a request on the PXD hits left by the tracks
 
std::vector< ParticleAndWeightgetParticlesWithoutKS (const std::vector< const Particle * > &tagParticles, double massWindowWidth=0.01) const
 Get a list of pions from a list of pions removing the Kshorts Warning: this assumes all the particles are pions, which is fine are all the particles are reconstructed as pions in the TagV module.
 
bool makeGeneralFit ()
 TO DO: tag side vertex fit in the case of semileptonic tag side decay. More...
 
void fillParticles (std::vector< ParticleAndWeight > &particleAndWeights)
 Fill sorted list of particles into external variable.
 
void fillTagVinfo (const TVector3 &tagVpos, const TMatrixDSym &tagVposErr)
 Fill tagV vertex info.
 
bool makeGeneralFitRave ()
 make the vertex fit on the tag side: RAVE AVF tracks coming from Ks removed all other tracks used
 
bool makeGeneralFitKFit ()
 make the vertex fit on the tag side: KFit tracks coming from Ks removed all other tracks used
 
void deltaT (const Particle *Breco)
 calculate DeltaT and MC-DeltaT (rec - tag) in ps from Breco and Btag vertices DT = Dl / gamma beta c , l = boost direction
 
ParticledoVertexFitForBTube (const Particle *mother, std::string fitType) const
 it returns an intersection between B rec and beam spot (= origin of BTube)
 
TrackFitResult getTrackWithTrueCoordinates (ParticleAndWeight const &paw) const
 If the fit has to be done with the truth info, Rave is fed with a track where the momentum is replaced by the true momentum and the position replaced by the point on the true particle trajectory closest to the measured track position The function below takes care of that.
 
static TVector3 getTruePoca (ParticleAndWeight const &paw)
 This finds the point on the true particle trajectory closest to the measured track position.
 
TrackFitResult getTrackWithRollBackCoordinates (ParticleAndWeight const &paw)
 If the fit has to be done with the rolled back tracks, Rave or KFit is fed with a track where the position of track is shifted by the vector difference of mother B and production point of track from truth info The function below takes care of that.
 
TVector3 getRollBackPoca (ParticleAndWeight const &paw)
 This shifts the position of tracks by the vector difference of mother B and production point of track from truth info.
 
void resetReturnParams ()
 Reset all parameters that are computed in each event and then used to compute tuple variables.
 
static std::string printVector (const TVector3 &vec)
 Print a TVector3 (useful for debugging)
 
static std::string printMatrix (const TMatrixD &mat)
 Print a TMatrix (useful for debugging)
 
static std::string printMatrix (const TMatrixDSym &mat)
 Print a TMatrixFSym (useful for debugging)
 

Variables

static const double realNaN = std::numeric_limits<double>::quiet_NaN()
 shortcut for NaN of double type
 

Detailed Description

Typedef Documentation

◆ BinLimitsTuple

typedef std::tuple<double, double> BinLimitsTuple

Currently, std::pair can not be retrieved from python list We will get ParticleWeightingLookUpTable entries with tuples and transform tuples to pairs here.

the tuple of bin limits

Definition at line 27 of file ParticleWeightingLookUpCreatorModule.h.

Function Documentation

◆ add_matrix()

bool add_matrix ( Particle p)
private

Main steering routine.

Parameters
ppointer to particle
Returns
true for successfully adding the covariance matrix

Definition at line 72 of file PseudoVertexFitterModule.cc.

73  {
74  // steering starts here
75  if (mother->getNDaughters() < 2) return false;
76 
77  bool ok = false;
78 
79  const std::vector<Particle*> daughters = mother->getDaughters();
80  std::vector<TMatrixFSym> daughter_matrices;
81  daughter_matrices.reserve(daughters.size());
82  for (auto daughter : daughters) {
83  daughter_matrices.push_back(daughter->getMomentumVertexErrorMatrix());
84  }
85 
86  TMatrixFSym mother_errMatrix(7);
87  for (int i = 0; i < 7; i++) {
88  for (int j = 0; j < 7; j++) {
89  for (unsigned int k = 0; k < daughters.size(); k++) {
90  mother_errMatrix[i][j] += daughter_matrices[k][i][j];
91  }
92  }
93  }
94 
95  mother->setMomentumVertexErrorMatrix(mother_errMatrix);
96  if (mother->getMomentumVertexErrorMatrix() == mother_errMatrix) {
97  ok = true;
98  }
99  if (!ok) return false;
100  return true;
101  }

◆ addChildofParticletoKFit()

bool addChildofParticletoKFit ( analysis::FourCFitKFit kv,
const Particle particle 
)
private

Adds given particle's child to the FourCFitKFit.

Parameters
kvreference to KFit FourCFit object
particlepointer to particle

Definition at line 1147 of file ParticleVertexFitterModule.cc.

1148  {
1149  for (unsigned ichild = 0; ichild < particle->getNDaughters(); ichild++) {
1150  const Particle* child = particle->getDaughter(ichild);
1151  if (child->getNDaughters() > 0) addChildofParticletoKFit(kf, child);
1152  else {
1153  if (child->getPValue() < 0) return false; // error matrix not valid
1154 
1155  kf.addParticle(child);
1156  }
1157  }
1158  return true;
1159  }
bool addChildofParticletoKFit(analysis::FourCFitKFit &kv, const Particle *particle)
Adds given particle's child to the FourCFitKFit.

◆ addChildofParticletoMassKFit()

bool addChildofParticletoMassKFit ( analysis::MassFourCFitKFit kf,
const Particle particle,
std::vector< unsigned > &  particleId 
)
private

Adds given particle's child to the MassFourCFitKFit.

Parameters
kfreference to KFit FourCFit object
particlepointer to particle
particleIdvector of daughters track id

Definition at line 1161 of file ParticleVertexFitterModule.cc.

◆ beginRun() [1/2]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things like run header parameters, alignment, etc.

Reimplemented from Module.

Definition at line 113 of file ParticleVertexFitterModule.cc.

◆ beginRun() [2/2]

void beginRun ( void  )
overridevirtual

Called when entering a new run.

Set run dependent things

Reimplemented from Module.

Definition at line 146 of file TagVertexModule.cc.

147  {
148  //TODO: set magnetic field for each run
149  //m_Bfield = BFieldMap::Instance().getBField(m_BeamSpotCenter).Z();
150  }

◆ BtagMCVertex()

void BtagMCVertex ( const Particle Breco)
private

get the vertex of the MC B particle associated to Btag.

It works only with signal MC

Definition at line 531 of file TagVertexModule.cc.

◆ combineRecursively()

void combineRecursively ( const DecayDescriptor decaydescriptor)

Combine particles which have (sub-)decay recursively.

The function is called in event().

Definition at line 159 of file ParticleCombinerFromMCModule.cc.

160  {
161  // Mother particle
162  const DecayDescriptorParticle* mother = decaydescriptor.getMother();
163  int pdgCode = mother->getPDGCode();
164  std::string listName = mother->getFullName();
165  std::string antiListName = ParticleListName::antiParticleListName(listName);
166  bool isSelfConjugatedParticle = (listName == antiListName);
167 
168  StoreObjPtr<ParticleList> outputList(listName);
169  outputList.create();
170  outputList->initialize(pdgCode, listName);
171 
172  if (!isSelfConjugatedParticle && m_chargeConjugation) {
173  StoreObjPtr<ParticleList> outputAntiList(antiListName);
174  outputAntiList.create();
175  outputAntiList->initialize(-1 * pdgCode, antiListName);
176 
177  outputList->bindAntiParticleList(*(outputAntiList));
178  }
179 
180  unsigned int numberOfLists = decaydescriptor.getNDaughters();
181 
182  for (unsigned int i = 0; i < numberOfLists; ++i) {
183  const DecayDescriptor* dDaughter = decaydescriptor.getDaughter(i);
184 
185  if (dDaughter->getNDaughters() == 0) {
186  // if daughter does not have daughters, check if it is not reconstructed particle.
187  const DecayDescriptorParticle* daughter = decaydescriptor.getDaughter(i)->getMother();
188  StoreObjPtr<ParticleList> plist(daughter->getFullName());
189  // if daughter is not created, returns error
190  if (!plist.isValid())
191  B2ERROR(daughter->getFullName() << " is not created");
192  // if daughter contains reconstructed particles, returns error.
193  unsigned nPart = plist->getListSize();
194  for (unsigned iPart = 0; iPart < nPart; iPart++) {
195  const Particle* part = plist->getParticle(iPart);
196  Particle::EParticleSourceObject particleType = part->getParticleSource();
197  if (particleType == Particle::c_Track or
198  particleType == Particle::c_ECLCluster or
199  particleType == Particle::c_KLMCluster)
200  B2ERROR(daughter->getFullName() << " contains a reconstructed particle! It is not accepted in ParticleCombinerFromMCModule!");
201  }
202  // if not, do nothing.
203  } else {
204  // if daughter has daughter, call the function recursively
205  combineRecursively(*dDaughter);
206  }
207  }
208 
209  // initialize the generator
210  m_generator = std::make_unique<ParticleGenerator>(decaydescriptor, "");
211  m_generator->init();
212 
213  while (m_generator->loadNext(m_chargeConjugation)) {
214  Particle&& particle = m_generator->getCurrentParticle();
215 
216  Particle* newParticle = m_particles.appendNew(particle);
217  // append to the created particle the user specified decay mode ID
218  newParticle->addExtraInfo("decayModeID", m_decayModeID);
219 
220  int iparticle = m_particles.getEntries() - 1;
221  outputList->addParticle(iparticle, particle.getPDGCode(), particle.getFlavorType());
222  }
223 
224  // select only signal particles
225  std::unique_ptr<Variable::Cut> cutIsSignal = Variable::Cut::compile("isSignal");
226 
227  std::vector<unsigned int> toRemove;
228  unsigned int n = outputList->getListSize();
229  for (unsigned i = 0; i < n; i++) {
230  const Particle* part = outputList->getParticle(i);
231 
234 
235  if (!cutIsSignal->check(part)) toRemove.push_back(part->getArrayIndex());
236  }
237  outputList->removeParticles(toRemove);
238 
239  }
static std::unique_ptr< GeneralCut > compile(const std::string &cut)
Creates an instance of a cut and returns a unique_ptr to it, if you need a copy-able object instead y...
Definition: GeneralCut.h:104
StoreArray< Particle > m_particles
StoreArray of Particles.
std::unique_ptr< ParticleGenerator > m_generator
Generates the combinations.
int m_decayModeID
user specified decay mode identifier
bool m_chargeConjugation
boolean to control whether charge conjugated decay should be reconstructed as well
EParticleSourceObject
particle source enumerators
Definition: Particle.h:81
void combineRecursively(const DecayDescriptor &decaydescriptor)
Combine particles which have (sub-)decay recursively.
std::string antiParticleListName(const std::string &listName)
Returns name of anti-particle-list corresponding to listName.
static bool setMCTruth(const Belle2::Particle *particle)
This is the main function of MC matching algorithm.
Definition: MCMatching.cc:86
static int getMCErrors(const Belle2::Particle *particle, const Belle2::MCParticle *mcParticle=nullptr)
Returns quality indicator of the match as a bit pattern where the individual bits indicate the the ty...
Definition: MCMatching.cc:279

◆ DecayTree()

DecayTree ( T *  obj)
explicit

Constructor with decaying object (e.g.

MCParticle) provided.

Definition at line 49 of file DecayTree.h.

49 : m_myObject(obj), m_daughters() {};
T * m_myObject
The decaying object, e.g.
Definition: DecayTree.h:23
std::vector< DecayTree< T > * > m_daughters
Decay daughters of m_myObject.
Definition: DecayTree.h:25

◆ doKFourCFit()

bool doKFourCFit ( Particle p)
private

FourC fit using KFit.

Parameters
ppointer to particle
Returns
true for successful fit

Definition at line 627 of file ParticleVertexFitterModule.cc.

◆ doKMassFit()

bool doKMassFit ( Particle p)
private

Mass fit using KFit.

Parameters
ppointer to particle
Returns
true for successful fit

Definition at line 600 of file ParticleVertexFitterModule.cc.

◆ doKMassFourCFit()

bool doKMassFourCFit ( Particle p)
private

MassFourC fit using KFit.

Parameters
ppointer to particle
Returns
true for successful fit

Definition at line 660 of file ParticleVertexFitterModule.cc.

◆ doKMassPointingVertexFit()

bool doKMassPointingVertexFit ( Particle p)
private

Mass-constrained vertex fit with additional pointing constraint using KFit.

Parameters
ppointer to particle
Returns
true for successful fit

Definition at line 555 of file ParticleVertexFitterModule.cc.

◆ doKMassVertexFit()

bool doKMassVertexFit ( Particle p)
private

Mass-constrained vertex fit using KFit.

Parameters
ppointer to particle
Returns
true for successful fit

Definition at line 475 of file ParticleVertexFitterModule.cc.

◆ doKVertexFit()

bool doKVertexFit ( Particle p,
bool  ipProfileConstraint,
bool  ipTubeConstraint 
)
private

Unconstrained vertex fit using KFit.

Parameters
ppointer to particle
ipProfileConstraintflag for IP profile constraint
ipTubeConstraintflag for IP tube constraint
Returns
true for successful fit

Definition at line 398 of file ParticleVertexFitterModule.cc.

◆ doRaveFit()

bool doRaveFit ( Particle mother)
private

Fit using Rave.

Parameters
motherpointer to particle
Returns
true for successful fit and update of mother

Definition at line 968 of file ParticleVertexFitterModule.cc.

◆ doVertexFit()

bool doVertexFit ( Particle p)
private

Main steering routine.

Parameters
ppointer to particle
Returns
true for successful fit and prob(chi^2,ndf) > m_confidenceLevel

Definition at line 194 of file ParticleVertexFitterModule.cc.

◆ event() [1/2]

void event ( void  )
overridevirtual

Called once for each event.

This is most likely where your module will actually do anything.

Reimplemented from Module.

Definition at line 163 of file BremsFinderModule.cc.

164  {
165  RelationArray particlesToMCParticles(m_particles, m_mcParticles);
166 
167  // new output particle list
168  m_outputList.create();
170 
171  m_outputAntiList.create();
173  m_outputAntiList->bindAntiParticleList(*(m_outputList));
174 
175  // Number of photons (calculate it here only once)
176  const unsigned int nGamma = m_gammaList->getListSize();
177 
178  // Number of leptons (calculate it here only once)
179  const unsigned int nLep = m_inputList->getListSize();
180 
181  const std::string relationName = "Bremsstrahlung";
182 
183  //In the case of only one track per photon
184  if (m_usePhotonOnlyOnce) {
185  for (unsigned n = 0; n < nGamma; n++) {
186  Particle* gamma = m_gammaList->getParticle(n);
187  //Skip this if it the best match has already been assigned (pathological case: happens only if you use the same gamma list
188  //to correct more than once. Performance studies, in which the same list is used with different options, are an example
189  if (gamma->hasExtraInfo("bestMatchIndex")) continue;
190 
191  auto cluster = gamma->getECLCluster();
192  //Get the tracks related to each photon...
193  RelationVector<Track> relatedTracks = cluster->getRelationsTo<Track>("", relationName);
194  double bestWeight = m_maximumAcceptance;
195  unsigned bestMatchIndex = 0;
196  unsigned trkIndex = 0;
197  //Loop over the related tracks...
198  for (auto trk = relatedTracks.begin(); trk != relatedTracks.end(); trk++, trkIndex++) {
199  //... and over the input particles' tracks...
200  for (unsigned i = 0; i < nLep; i++) {
201  const Particle* lepton = m_inputList->getParticle(i);
202  auto leptonTrack = lepton->getTrack();
203  //... check that the particle track corresponds to the related track....
204  if (leptonTrack->getArrayIndex() == trk->getArrayIndex()) {
205  double weight = relatedTracks.weight(trkIndex);
206  if (weight < bestWeight) {
207  bestWeight = weight;
208  //... and only select the best match among the tracks in the input list
209  bestMatchIndex = trk->getArrayIndex();
210  }
211  break; //If the particle corresponding to the related track is found, break the loop over the particles and go for the next related track
212  }
213  }
214  }
215  //... finally, add the best match index as an extra info for the photon
216  gamma->addExtraInfo("bestMatchIndex", bestMatchIndex);
217  }
218  }
219 
220  // loop over charged particles, correct them and add them to the output list
221 
222  for (unsigned i = 0; i < nLep; i++) {
223  const Particle* lepton = m_inputList->getParticle(i);
224 
225  //Get the track of this lepton...
226  auto track = lepton->getTrack();
227 
228  //... and get the bremsstrahlung clusters related to this track
229  RelationVector<ECLCluster> bremClusters = track->getRelationsFrom<ECLCluster>("", relationName);
230 
231  std::vector<std::pair <double, Particle*> > selectedGammas;
232 
233  unsigned j = 0;
234  for (auto bremCluster = bremClusters.begin(); bremCluster != bremClusters.end(); bremCluster++, j++) {
235  double weight = bremClusters.weight(j);
236 
237  if (weight > m_maximumAcceptance) continue;
238 
239  for (unsigned k = 0; k < nGamma; k++) {
240 
241  Particle* gamma = m_gammaList->getParticle(k);
242  auto cluster = gamma->getECLCluster();
243 
244  if (bremCluster->getClusterId() == cluster->getClusterId()) {
245  if (m_usePhotonOnlyOnce) { //If only one track per photon should be used...
246  if (track->getArrayIndex() == static_cast<int>
247  (gamma->getExtraInfo("bestMatchIndex"))) //... check if this track is the best match ...
248  selectedGammas.push_back(std::make_pair(weight, gamma)); //... and if it is, add it to the selected gammas
249  } else {
250  selectedGammas.push_back(std::make_pair(weight, gamma));
251  }
252  }
253 
254  } // Closes for loop on gammas
255 
256  } // Closes for loop on brem clusters
257 
258  //The 4-momentum of the new lepton in the output particle list
259  TLorentzVector new4Vec = lepton->get4Vector();
260 
261  //Sort weight-particle pairs by weight. Smaller weights go first
262  std::sort(selectedGammas.begin(), selectedGammas.end());
263 
264  //Add to this 4-momentum those of the selected photon(s)
265  for (auto const& bremsPair : selectedGammas) {
266  Particle* g = bremsPair.second;
267  new4Vec += g->get4Vector();
268  if (! m_addMultiplePhotons) break; //stop after adding the first photon
269  }
270 
271  //Create the new particle with the 4-momentum calculated before
272  Particle correctedLepton(new4Vec, lepton->getPDGCode(), Particle::EFlavorType::c_Flavored, Particle::c_Track,
273  track->getArrayIndex());
274 
275  //And add the original lepton as its daughter
276  correctedLepton.appendDaughter(lepton, false);
277 
278  const TMatrixFSym& lepErrorMatrix = lepton->getMomentumVertexErrorMatrix();
279  TMatrixFSym corLepMatrix(lepErrorMatrix);
280 
281  double bremsGammaEnergySum = 0.0;
282  //Now, if there are any, add the brems photons as daughters as well. As before, we distinguish between the multiple and only one brems photon cases
283  int photonIndex = 0;
284  for (auto const& bremsPair : selectedGammas) {
285  //Add the weights as extra info of the mother
286  Particle* bremsGamma = bremsPair.second;
287  std::string extraInfoName = "bremsWeightWithPhoton" + std::to_string(photonIndex);
288  correctedLepton.addExtraInfo(extraInfoName, bremsPair.first);
289  photonIndex++;
290  bremsGammaEnergySum += Variable::eclClusterE(bremsGamma);
291 
292  const TMatrixFSym& gammaErrorMatrix = bremsGamma->getMomentumVertexErrorMatrix();
293  for (int irow = 0; irow <= 3; irow++) {
294  for (int icol = irow; icol <= 3; icol++) corLepMatrix(irow, icol) += gammaErrorMatrix(irow, icol);
295  }
296  correctedLepton.appendDaughter(bremsGamma, false);
297  B2DEBUG(10, "[BremsFinderModule] Found a bremsstrahlung gamma and added its 4-vector to the charged particle");
298  if (! m_addMultiplePhotons) break; //stop after adding the first photon
299  }
300 
301  correctedLepton.setMomentumVertexErrorMatrix(corLepMatrix);
302 
303  // add the info from original lepton to the new lepton
304  correctedLepton.setVertex(lepton->getVertex());
305  correctedLepton.setPValue(lepton->getPValue());
306  correctedLepton.addExtraInfo("bremsCorrected", float(selectedGammas.size() > 0));
307  correctedLepton.addExtraInfo("bremsCorrectedPhotonEnergy", bremsGammaEnergySum);
308 
309  // add the mc relation
310  Particle* newLepton = m_particles.appendNew(correctedLepton);
311  const MCParticle* mcLepton = lepton->getRelated<MCParticle>();
312  const PIDLikelihood* pid = lepton->getPIDLikelihood();
313 
314  if (pid) newLepton->addRelationTo(pid);
315 
316  if (mcLepton != nullptr) newLepton->addRelationTo(mcLepton);
317 
318  m_outputList->addParticle(newLepton);
319 
320  } //Closes for loop on leptons
321 
322  } //Close event()
double m_maximumAcceptance
photons whose clusters have relation weights higher than this will not be used for bremsstrahlung cor...
bool m_addMultiplePhotons
In case there is more than one brems photon, use only the best one (based on the weight of the relati...
StoreObjPtr< ParticleList > m_outputAntiList
StoreObjptr for output antiparticlelist.
StoreArray< Particle > m_particles
StoreArray of Particle objects.
StoreObjPtr< ParticleList > m_outputList
StoreObjptr for output particlelist.
StoreObjPtr< ParticleList > m_inputList
StoreObjptr for input charged particle list.
StoreObjPtr< ParticleList > m_gammaList
StoreObjptr for gamma list.
StoreArray< MCParticle > m_mcParticles
StoreArray of MCParticle objects.
bool m_usePhotonOnlyOnce
Each brems photon can be used to correct only one particle (the one with the smallest relation weight...
int m_pdgCode
PDG code of the particle to be corrected.
std::string m_outputAntiListName
output anti-particle list name
std::string m_outputListName
output particle list name
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.

◆ event() [2/2]

void event ( void  )
overridevirtual

Event processing by the module.

This method is called once for each event.

Reimplemented from Module.

Definition at line 74 of file ParticleWeightingModule.cc.

75  {
76  if (!m_inputList) {
77  B2WARNING("Input list " << m_inputList.getName() << " was not created?");
78  return;
79  }
80  const unsigned int numParticles = m_inputList->getListSize();
81  for (unsigned int i = 0; i < numParticles; i++) {
82  const Particle* ppointer = m_inputList->getParticle(i);
83  double index = ppointer->getArrayIndex();
84  Particle* p = m_particles[index];
85  WeightInfo info = getInfo(p);
86  for (const auto& entry : info) {
87  p->addExtraInfo(m_tableName + "_" + entry.first, entry.second);
88  }
89  }
90  }
StoreArray< Particle > m_particles
StoreArray of Particles.
StoreObjPtr< ParticleList > m_inputList
input particle list
std::string m_tableName
Name of the table.
WeightInfo getInfo(const Particle *p)
Get LookUp information for the particle.
std::map< std::string, double > WeightInfo
Weight information: a line from the weight lookup table.

◆ fillFitParticles()

bool fillFitParticles ( const Particle mother,
std::vector< const Particle * > &  fitChildren,
std::vector< const Particle * > &  twoPhotonChildren 
)
private

Fills valid particle's children (with valid error matrix) in the vector of Particles that will enter the fit.

Particles formed from two photons (e.g. pi0) are treated separately so they are filled to another vector.

Definition at line 296 of file ParticleVertexFitterModule.cc.

◆ fillUniqueIdentifier()

void fillUniqueIdentifier ( const Particle p,
std::vector< int > &  idSequence 
)
private

Fills unique identifier for the input particle.

The unique identifier is a sequence of pairs (PDG code of the particle, number of daughters if composite or mdstArrayIndex if final state particle) for all particles in the decay chain.

Example: B+ -> (anti-D0 -> K+ pi-) pi+ idSequence: (521, 2, -421, 2, 321, K+ mdstArrayIndex, -211, pi- mdstArrayIndex, 211, pi+ mdstArrayIndex)

Definition at line 210 of file ParticleListManipulatorModule.cc.

211  {
212  idSequence.push_back(p->getPDGCode());
213 
214  if (p->getNDaughters() == 0) {
215  idSequence.push_back(p->getMdstArrayIndex());
216  } else {
217  idSequence.push_back(p->getNDaughters());
218  auto daughters = p->getDaughters();
219  // sorting the daughters by their pdgCode to identify decay chains only differing by the order of their daughters
220  sort(daughters.begin(), daughters.end(), [](const auto a, const auto b) {
221  return a->getPDGCode() > b->getPDGCode();
222  });
223  // this is not FSP (go one level down)
224  for (const auto& daughter : daughters)
225  fillUniqueIdentifier(daughter, idSequence);
226  }
227  }
void fillUniqueIdentifier(const Particle *p, std::vector< int > &idSequence)
Fills unique identifier for the input particle.

◆ getInfo()

WeightInfo getInfo ( const Particle p)

Get LookUp information for the particle.

Parameters
pparticle
Returns
LookUp information (map: key - LookUp parameter; value - value of the parameter )

Definition at line 49 of file ParticleWeightingModule.cc.

◆ getObj()

T * getObj

Return the decaying object itself, e.g.

an MCParticle.

Definition at line 68 of file DecayTree.h.

◆ getProperLifeTime()

static double Belle2::getProperLifeTime ( const MCParticle mc)
static

proper life time, i.e.

in the rest system (in ps)

Definition at line 525 of file TagVertexModule.cc.

◆ initialize() [1/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 72 of file BelleBremRecoveryModule.cc.

73  {
74  // check the validity of output ParticleList name
76  if (!valid)
77  B2ERROR("[BelleBremRecoveryModule] Invalid output ParticleList name: " << m_outputListName);
78 
79  // output particle
80  const DecayDescriptorParticle* mother = m_decaydescriptor.getMother();
81  m_pdgCode = mother->getPDGCode();
83 
84  // get existing particle lists
86  B2ERROR("[BelleBremRecoveryModule] Input and output particle list names are the same: " << m_inputListName);
87  } else if (!m_decaydescriptor.init(m_inputListName)) {
88  B2ERROR("[BelleBremRecoveryModule] Invalid input particle list name: " << m_inputListName);
89  } else {
91  }
92 
94  B2ERROR("[BelleBremRecoveryModule] Invalid gamma particle list name: " << m_gammaListName);
95  } else {
96  m_gammaList.isRequired(m_gammaListName);
97  }
98 
99  // make output list
101  m_outputparticleList.registerInDataStore(m_outputListName, flags);
102  m_outputAntiparticleList.registerInDataStore(m_outputAntiListName, flags);
103 
104  m_particles.registerRelationTo(m_pidlikelihoods);
105  }
StoreObjPtr< ParticleList > m_outputparticleList
StoreObjptr for output particlelist.
std::string m_gammaListName
input ParticleList names
StoreArray< Particle > m_particles
StoreArray of Particle objects.
StoreArray< PIDLikelihood > m_pidlikelihoods
StoreArray of PIDLikelihood objects.
StoreObjPtr< ParticleList > m_gammaList
StoreObjptr for gamma list.
StoreObjPtr< ParticleList > m_inputparticleList
StoreObjptr for input charged particlelist.
StoreObjPtr< ParticleList > m_outputAntiparticleList
StoreObjptr for output antiparticlelist.
DecayDescriptor m_decaydescriptorGamma
Decay descriptor of the decay being reconstructed.
DecayDescriptor m_decaydescriptor
Decay descriptor of the charged particle decay.
bool m_writeOut
toggle output particle list btw.
int m_pdgCode
PDG code of the combined mother particle.
std::string m_outputAntiListName
output anti-particle list name
std::string m_inputListName
input ParticleList names
std::string m_outputListName
output ParticleList name
EStoreFlags
Flags describing behaviours of objects etc.
Definition: DataStore.h:69
@ c_WriteOut
Object/array should be saved by output modules.
Definition: DataStore.h:70
@ c_DontWriteOut
Object/array should be NOT saved by output modules.
Definition: DataStore.h:71
bool init(const std::string &str)
Initialise the DecayDescriptor from given string.
const DecayDescriptorParticle * getMother() const
return mother.

◆ initialize() [2/18]

void initialize ( void  )
overridevirtual

Use this to initialize resources or memory your module needs.

Also register any outputs of your module (StoreArrays, RelationArrays, StoreObjPtrs) here, see the respective class documentation for details.

Reimplemented from Module.

Definition at line 119 of file BremsFinderModule.cc.

◆ initialize() [3/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 65 of file KlongDecayReconstructorExpertModule.cc.

66  {
67  m_particles.isRequired();
68 
69  // clear everything, initialize private members
70  m_listName = "";
71  m_generator = nullptr;
72 
73  // obtain the input and output particle lists from the decay string
74  bool valid = m_decaydescriptor.init(m_decayString);
75  if (!valid)
76  B2ERROR("Invalid input DecayString: " << m_decayString);
77 
78  // Mother particle
79  const DecayDescriptorParticle* mother = m_decaydescriptor.getMother();
80 
81  m_pdgCode = mother->getPDGCode();
82  m_listName = mother->getFullName();
83 
86 
87  std::string newDecayString;
88  std::string kListName;
89  newDecayString = m_listName + " -> ";
90 
91  bool k_check = false;
92 
93  // Daughters
94  int nProducts = m_decaydescriptor.getNDaughters();
95  for (int i = 0; i < nProducts; ++i) {
96  const DecayDescriptorParticle* daughter = m_decaydescriptor.getDaughter(i)->getMother();
97  if (daughter->getPDGCode() != Const::Klong.getPDGCode()) {
98  StoreObjPtr<ParticleList>().isRequired(daughter->getFullName());
99  newDecayString = newDecayString + daughter->getFullName() + " ";
100  } else {
101  StoreObjPtr<ParticleList>().isRequired(daughter->getFullName() + m_recoList);
102  kListName = daughter->getFullName() + m_recoList;
103  k_check = true;
104  }
105  }
106 
107  if (!k_check)
108  B2FATAL("This module is meant to reconstruct decays with a K_L0 in the final state. There is no K_L0 in this decay!");
109  newDecayString = newDecayString + kListName;
110 
111  m_generator = std::make_unique<ParticleGenerator>(newDecayString, m_cutParameter);
112 
114  m_outputList.registerInDataStore(m_listName, flags);
116  m_outputAntiList.registerInDataStore(m_antiListName, flags);
117  }
118 
120 
121  }
int getPDGCode() const
PDG code.
Definition: Const.h:354
static const ParticleType Klong
K^0_L particle.
Definition: Const.h:558
int getNDaughters() const
return number of direct daughters.
const DecayDescriptor * getDaughter(int i) const
return i-th daughter (0 based index).
bool m_isSelfConjugatedParticle
flag that indicates whether an anti-particle mother does not exist and should not be reconstructed as...
std::string m_antiListName
output anti-particle list name
std::string m_decayString
Input DecayString specifying the decay being reconstructed.
StoreObjPtr< ParticleList > m_outputAntiList
output anti-particle list
StoreArray< Particle > m_particles
StoreArray of Particles.
std::string m_recoList
suffix for input K_L0 list name
StoreObjPtr< ParticleList > m_outputList
output particle list
std::unique_ptr< ParticleGenerator > m_generator
Generates the combinations.
std::unique_ptr< Variable::Cut > m_cut
cut object which performs the cuts
DecayDescriptor m_decaydescriptor
Decay descriptor of the decay being reconstructed.
int m_pdgCode
PDG code of the combined mother particle.

◆ initialize() [4/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 68 of file KlongMomentumCalculatorExpertModule.cc.

69  {
70  StoreArray<Particle>().isRequired();
71 
72  // clear everything, initialize private members
73  m_pdgCode = 0;
74  m_listName = "";
76  m_generator = nullptr;
77 
78  // obtain the input and output particle lists from the decay string
79  bool valid = m_decaydescriptor.init(m_decayString);
80  if (!valid)
81  B2ERROR("Invalid input DecayString: " << m_decayString);
82 
83  // Mother particle
84  const DecayDescriptorParticle* mother = m_decaydescriptor.getMother();
85 
86  m_pdgCode = mother->getPDGCode();
87  m_listName = mother->getFullName();
88 
91 
93 
94  // Daughters
95  bool k_check = false;
96  int nProducts = m_decaydescriptor.getNDaughters();
97  for (int i = 0; i < nProducts; ++i) {
98  const DecayDescriptorParticle* daughter =
100  StoreObjPtr<ParticleList>().isRequired(daughter->getFullName());
101  if (daughter->getPDGCode() == Const::Klong.getPDGCode()) {
102  m_klistName = daughter->getFullName() + m_klistName;
103  k_check = true;
104  }
105  }
106 
107  if (!k_check)
108  B2FATAL("This module is meant to reconstruct decays with a K_L0 in the final state. There is no K_L0 in this decay!");
109 
110  m_generator = std::make_unique<ParticleGenerator>(m_decayString, m_cutParameter);
111 
113  m_koutputList.registerInDataStore(m_klistName, flags);
114 
116 
117  }
bool m_isSelfConjugatedParticle
flag that indicates whether an anti-particle mother does not exist and should not be reconstructed as...
StoreObjPtr< ParticleList > m_koutputList
Klong output particle list.
std::string m_antiListName
output anti-particle list name
std::string m_decayString
Input DecayString specifying the decay being reconstructed.
std::string m_recoList
Suffix attached to the output K_L list, if not defined it is set to '_reco'
std::unique_ptr< ParticleGenerator > m_generator
Generates the combinations.
std::unique_ptr< Variable::Cut > m_cut
cut object which performs the cuts
DecayDescriptor m_decaydescriptor
Decay descriptor of the decay being reconstructed.
int m_pdgCode
PDG code of the combined mother particle.
std::string m_klistName
output K_L0 particle list name

◆ initialize() [5/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 68 of file MCMatcherParticlesModule.cc.

69  {
70  // check that there are MCParticles: shout if not
71  if (!m_mcparticles.isValid()) {
72  B2WARNING("No MCParticles array found!"
73  << " This is obvously fine if you're analysing real data,"
74  << " but you have added the MCMatcher module to your path,"
75  << " did you mean to do this?");
76  return;
77  }
78 
79  // if we have MCParticles then continue with the initialisation
80  m_particles.isRequired();
81  m_particles.registerRelationTo(m_mcparticles);
82  m_plist.isRequired(m_listName);
83 
84  bool legacyAlgorithm = AnalysisConfiguration::instance()->useLegacyMCMatching();
85  B2INFO("MCMatcher module will search for Particle -> MCParticle associations for the ParticleList " << m_listName << ".");
86  if (legacyAlgorithm)
87  B2INFO(" - The MCMatcher will use legacy algorithm suitable for analysis of Belle MC or Belle II MC5.");
88  else
89  B2INFO(" - The MCMatcher will use default algorithm suitable for analysis of Belle II MC (for MC5 use legacy algorithm).");
90  }
void useLegacyMCMatching(const bool flag)
Determines whether to use the legacy MCMatching algorithm (true) or not (false).
static AnalysisConfiguration * instance()
Returns a pointer to the singleton instance.
StoreArray< MCParticle > m_mcparticles
the array of MCParticles.
std::string m_listName
steering variable: name of the input ParticleList
StoreArray< Particle > m_particles
the array of Particles.
StoreObjPtr< ParticleList > m_plist
the input ParticleList.
bool isValid() const
Check wether the array was registered.
Definition: StoreArray.h:288

◆ initialize() [6/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 87 of file ParticleCombinerModule.cc.

88  {
89  // clear everything
90  m_pdgCode = 0;
91  m_listName = "";
92 
93  // obtain the input and output particle lists from the decay string
94  bool valid = m_decaydescriptor.init(m_decayString);
95  if (!valid)
96  B2ERROR("Invalid input DecayString: " << m_decayString);
97 
98  // Mother particle
99  const DecayDescriptorParticle* mother = m_decaydescriptor.getMother();
100 
101  m_pdgCode = mother->getPDGCode();
102  m_listName = mother->getFullName();
103 
106 
107  // Daughters
108  int nProducts = m_decaydescriptor.getNDaughters();
109  int daughtersNetCharge = 0;
110  for (int i = 0; i < nProducts; ++i) {
111  const DecayDescriptorParticle* daughter =
113  StoreObjPtr<ParticleList>().isRequired(daughter->getFullName());
114  int daughterPDGCode = daughter->getPDGCode();
115  if (m_recoilParticleType == 2 && i == 0) {
116  daughtersNetCharge -= EvtPDLUtil::charge(daughterPDGCode);
117  } else {
118  daughtersNetCharge += EvtPDLUtil::charge(daughterPDGCode);
119  }
120  }
121 
122  if (daughtersNetCharge != EvtPDLUtil::charge(m_pdgCode)) {
123  if (!m_allowChargeViolation) {
124  B2FATAL("Your decay string " << m_decayString << " violates electric charge conservation!\n"
125  "If you want to allow this you can set the argument 'allowChargeViolation' to True. Something like:\n"
126  "modularAnalysis.reconstructDecay(" << m_decayString << ", your_cuts, allowChargeViolation=True, path=mypath)");
127  }
128  B2WARNING("Your decay string " << m_decayString << " violates electric charge conservation!\n"
129  "Processing is continued assuming that you allowed this deliberately, e.g. for systematic studies etc.");
130  }
131 
132  m_generator = std::make_unique<ParticleGenerator>(m_decayString, m_cutParameter);
133 
135  m_outputList.registerInDataStore(m_listName, flags);
137  m_outputAntiList.registerInDataStore(m_antiListName, flags);
138  }
139 
141  B2FATAL("Invalid recoil particle type = " << m_recoilParticleType <<
142  "! Valid values are 0 (not a recoil), 1 (recoiling against e+e- and daughters), 2 (daughter of a recoil)");
143  }
int m_recoilParticleType
type of recoil particle: 0 - not recoil (normal reconstruction); 1 - recoil against e+e- and all daug...
bool m_isSelfConjugatedParticle
flag that indicates whether an anti-particle mother does not exist and should not be reconstructed as...
std::string m_antiListName
output anti-particle list name
std::string m_decayString
Input DecayString specifying the decay being reconstructed.
std::string m_listName
output particle list name
StoreObjPtr< ParticleList > m_outputAntiList
output anti-particle list
StoreObjPtr< ParticleList > m_outputList
output particle list
std::unique_ptr< ParticleGenerator > m_generator
Generates the combinations.
bool m_allowChargeViolation
switch to turn on and off the requirement of electric charge conservation
std::string m_cutParameter
selection criteria
DecayDescriptor m_decaydescriptor
Decay descriptor of the decay being reconstructed.
bool m_writeOut
toggle output particle list btw.
int m_pdgCode
PDG code of the combined mother particle.
bool m_chargeConjugation
boolean to control whether charge conjugated decay should be reconstructed as well
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44

◆ initialize() [7/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 67 of file ParticleCombinerFromMCModule.cc.

◆ initialize() [8/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 58 of file ParticleCopierModule.cc.

59  {
60  // Input lists
61  for (const std::string& listName : m_inputListNames) {
62  StoreObjPtr<ParticleList>().isRequired(listName);
63  }
64  }
std::vector< std::string > m_inputListNames
input ParticleList names

◆ initialize() [9/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 70 of file ParticleListManipulatorModule.cc.

◆ initialize() [10/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 86 of file ParticleLoaderModule.cc.

87  {
88  B2INFO("ParticleLoader's Summary of Actions:");
89 
90  m_particles.registerInDataStore();
91  m_particleExtraInfoMap.registerInDataStore();
92  m_eventExtraInfo.registerInDataStore();
93  //register relations if these things exists
94  if (m_mcparticles.isOptional()) {
95  m_particles.registerRelationTo(m_mcparticles);
96  }
97  if (m_pidlikelihoods.isOptional()) {
98  m_particles.registerRelationTo(m_pidlikelihoods);
99  }
100  if (m_trackfitresults.isOptional()) {
101  m_particles.registerRelationTo(m_trackfitresults);
102  }
103 
104  if (m_useMCParticles) {
106  }
107 
108  if (m_decayStrings.empty()) {
109  B2WARNING("Obsolete usage of the ParticleLoader module (load all MDST objects as all possible Particle object types). Specify the particle type via decayStrings module parameter instead.");
110  } else {
111  for (auto decayString : m_decayStrings) {
112 
113  // obtain the output particle lists from the decay string
114  bool valid = m_decaydescriptor.init(decayString);
115  if (!valid)
116  B2ERROR("ParticleLoaderModule::initialize Invalid input DecayString: " << decayString);
117 
118  // Mother particle
119  const DecayDescriptorParticle* mother = m_decaydescriptor.getMother();
120  int nProducts = m_decaydescriptor.getNDaughters();
121 
122  int pdgCode = mother->getPDGCode();
123  // The default list name is "all"
124  string listName = mother->getName() + ":all";
125  // ROE particles get the full name
126  if (m_useROEs) listName = mother->getFullName();
127  // MC particles get the label "MC"
128  else if (m_useMCParticles) listName = mother->getName() + ":MC";
129  // V0s get the label "V0"
130  else if (nProducts > 0) listName = mother->getName() + ":V0";
131 
132  string antiListName = ParticleListName::antiParticleListName(listName);
133  bool isSelfConjugatedParticle = (listName == antiListName);
134 
135  StoreObjPtr<ParticleList> particleList(listName);
136  // if the particle list doesn't exist, we have to register it
137  if (!particleList.isOptional()) {
139  particleList.registerInDataStore(flags);
140  if (!isSelfConjugatedParticle) {
141  StoreObjPtr<ParticleList> antiParticleList(antiListName);
142  antiParticleList.registerInDataStore(flags);
143  }
144  }
145 
146  if (not isValidPDGCode(pdgCode) and (m_useMCParticles == false and m_useROEs == false))
147  B2ERROR("Invalid particle type requested to be loaded. Set a valid decayString module parameter.");
148 
149  // if we're not loading MCParticles and we are loading K0S, Lambdas, or photons --> ee then this decaystring is a V0
150  bool mdstSourceIsV0 = false;
151  if (!m_useMCParticles &&
152  (abs(pdgCode) == abs(Const::Kshort.getPDGCode()) || abs(pdgCode) == abs(Const::Lambda.getPDGCode())
153  || (abs(pdgCode) == abs(Const::photon.getPDGCode()) && m_addDaughters == true)))
154  mdstSourceIsV0 = true;
155 
156  if (mdstSourceIsV0 == false) {
157  if (nProducts > 0) {
158  if (!m_useROEs) {
159  B2ERROR("ParticleLoaderModule::initialize Invalid input DecayString " << decayString
160  << ". DecayString should not contain any daughters, only the mother particle.");
161  } else {
162  B2INFO("ParticleLoaderModule: Replacing the source particle list name by " <<
164  << " all other daughters will be ignored.");
166  }
167  }
168  } else {
169  if (nProducts != 2)
170  B2ERROR("ParticleLoaderModule::initialize Invalid input DecayString " << decayString
171  << ". MDST source of the particle list is V0, DecayString should contain exactly two daughters, as well as the mother particle.");
172  else {
174  B2ERROR("MDST source of the particle list is V0, the two daughters should have opposite charge");
175  }
176  }
177 
178  // add PList to corresponding collection of Lists
179  B2INFO(" o) creating (anti-)ParticleList with name: " << listName << " (" << antiListName << ")");
180  if (m_useROEs) {
181  B2INFO(" -> MDST source: RestOfEvents");
182  m_ROE2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
183  } else if (m_useMCParticles) {
184  B2INFO(" -> MDST source: MCParticles");
185  m_MCParticles2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
186  } else {
187  bool chargedFSP = Const::chargedStableSet.contains(Const::ParticleType(abs(pdgCode)));
188  if (chargedFSP) {
189  B2INFO(" -> MDST source: Tracks");
190  m_Tracks2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
191  }
192 
193  if (abs(pdgCode) == abs(Const::photon.getPDGCode())) {
194  if (m_addDaughters == false) {
195  m_ECLKLMClusters2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
196  B2INFO(" -> MDST source: ECLClusters and KLMClusters");
197  } else {
198  B2INFO(" -> MDST source: V0");
199  m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
200  }
201  }
202 
203  if (abs(pdgCode) == abs(Const::Kshort.getPDGCode())) {
204  B2INFO(" -> MDST source: V0");
205  m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
206  }
207 
208  if (abs(pdgCode) == abs(Const::Klong.getPDGCode()) || abs(pdgCode) == abs(Const::neutron.getPDGCode())) {
209  B2INFO(" -> MDST source: exclusively KLMClusters or exclusively ECLClusters (matching between those not used)");
210  m_ECLKLMClusters2Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
211  }
212 
213  if (abs(pdgCode) == abs(Const::Lambda.getPDGCode())) {
214  B2INFO(" -> MDST source: V0");
215  m_V02Plists.emplace_back(pdgCode, listName, antiListName, isSelfConjugatedParticle);
216  }
217  }
218  }
219  }
220 
221 
222  m_chargeZeroTrackCounts = std::vector<int>(m_Tracks2Plists.size(), 0);
223  m_sameChargeDaughtersV0Counts = std::vector<int>(m_V02Plists.size(), 0);
224  }
bool contains(const ParticleType &p) const
Returns true if and only if the set contains 'p'.
Definition: UnitConst.cc:390
static const ParticleType neutron
neutron particle
Definition: Const.h:556
static const ParticleType Lambda
Lambda particle.
Definition: Const.h:559
static const ParticleSet chargedStableSet
set of charged stable particles
Definition: Const.h:499
static const ParticleType Kshort
K^0_S particle.
Definition: Const.h:557
static const ParticleType photon
photon particle
Definition: Const.h:554
int getPDGCode() const
Return PDG code.
std::string getFullName() const
returns the full name of the particle full_name = name:label
std::vector< PList > m_ECLKLMClusters2Plists
Collection of PLists that will collect Particles created from ECLClusters and KLMClusters.
StoreArray< TrackFitResult > m_trackfitresults
StoreArray of TrackFitResults.
std::vector< std::string > m_decayStrings
Input decay strings specifying the particles being created/loaded.
std::vector< int > m_sameChargeDaughtersV0Counts
internally used to count the number of V0s with same charge daughters
std::string m_sourceParticleListName
Particle list name from which we need to get related ROEs.
StoreArray< MCParticle > m_mcparticles
StoreArray of MCParticles.
StoreArray< Particle > m_particles
StoreArray of Particles.
StoreObjPtr< ParticleExtraInfoMap > m_particleExtraInfoMap
object pointer to extra info map
bool m_addDaughters
toggle addition of the bottom part of the particle's decay chain
StoreArray< PIDLikelihood > m_pidlikelihoods
StoreArray of PIDLikelihoods.
std::vector< PList > m_ROE2Plists
Collection of PLists that will collect Particles created from V0.
std::vector< PList > m_MCParticles2Plists
Collection of PLists that will collect Particles created from MCParticles.
std::vector< PList > m_V02Plists
Collection of PLists that will collect Particles created from V0.
DecayDescriptor m_decaydescriptor
Decay descriptor for parsing the user specified DecayString.
bool m_writeOut
toggle particle list btw.
std::vector< int > m_chargeZeroTrackCounts
internally used to count number of tracks with charge zero
std::vector< PList > m_Tracks2Plists
Collection of PLists that will collect Particles created from Tracks.
StoreObjPtr< EventExtraInfo > m_eventExtraInfo
object pointer to event extra info
bool m_useROEs
Switch to load ROE as Particle.
bool m_useMCParticles
Load MCParticle as Particle instead of the corresponding MDST dataobject.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool isValidPDGCode(const int pdgCode)
returns true if the PDG code determined from the decayString is valid

◆ initialize() [11/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 51 of file ParticlePrinterModule.cc.

52  {
53  if (!m_listName.empty()) {
54  m_plist.isRequired(m_listName);
55 
56  // obtain the input and output particle lists from the decay string
57  bool valid = m_decaydescriptor.init(m_listName);
58  if (!valid)
59  B2ERROR("ParticlePrinterModule::initialize Invalid input DecayString: " << m_listName);
60 
61  int nProducts = m_decaydescriptor.getNDaughters();
62  if (nProducts > 0)
63  B2ERROR("ParticlePrinterModule::initialize Invalid input DecayString " << m_listName
64  << ". DecayString should not contain any daughters, only the mother particle.");
65  }
66  }
std::string m_listName
particle list name
DecayDescriptor m_decaydescriptor
Decay descriptor of the particle being selected.
StoreObjPtr< ParticleList > m_plist
particle list

◆ initialize() [12/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 50 of file ParticleSelectorModule.cc.

51  {
52  // obtain the input and output particle lists from the decay string
53  bool valid = m_decaydescriptor.init(m_decayString);
54  if (!valid)
55  B2ERROR("ParticleSelectorModule::initialize Invalid input DecayString: " << m_decayString);
56 
57  int nProducts = m_decaydescriptor.getNDaughters();
58  if (nProducts > 0)
59  B2ERROR("ParticleSelectorModule::initialize Invalid input DecayString " << m_decayString
60  << ". DecayString should not contain any daughters, only the mother particle.");
61 
62  // Mother particle
63  const DecayDescriptorParticle* mother = m_decaydescriptor.getMother();
64 
65  const int pdgCode = mother->getPDGCode();
66  string listLabel = mother->getLabel();
67  m_listName = mother->getFullName();
68  // Some labels are reserved for the particle loader which loads all particles of the corresponding type.
69  // If people applied cuts on these particle lists, very dangerous bugs could be introduced.
70  // An exception is made for the gamma:all list. This can be limited to photons from the ECL only.
71  if (Const::finalStateParticlesSet.contains(Const::ParticleType(abs(pdgCode))) and listLabel == "all"
72  and not(abs(pdgCode) == Const::photon.getPDGCode() and m_cutParameter == "isFromECL")) {
73  B2FATAL("You are trying to apply a cut on the list " << m_listName <<
74  " but the label 'all' is protected for lists of final-state particles." <<
75  " It could introduce *very* dangerous bugs.");
76  } else if (listLabel == "MC" or listLabel == "V0") {
77  // the labels MC and V0 are also protected
78  B2FATAL("You are trying to apply a cut on the list " << m_listName <<
79  " but the label " << listLabel << " is protected and can not be reduced.");
80  }
81 
82  m_particleList.isRequired(m_listName);
83 
85 
86  B2INFO("ParticleSelector: " << m_listName);
87  B2INFO(" -> With cuts : " << m_cutParameter);
88  }
static const ParticleSet finalStateParticlesSet
set of final set particles that can be created by the ParticleLoader
Definition: Const.h:538
std::string m_decayString
Input DecayString specifying the particle being selected.
std::string m_listName
output particle list name
std::unique_ptr< Variable::Cut > m_cut
cut object which performs the cuts
std::string m_cutParameter
selection criteria
DecayDescriptor m_decaydescriptor
Decay descriptor of the particle being selected.
StoreObjPtr< ParticleList > m_particleList
particle list

◆ initialize() [13/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 80 of file ParticleVertexFitterModule.cc.

◆ initialize() [14/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 66 of file ParticleWeightingModule.cc.

◆ initialize() [15/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 68 of file ParticleWeightingLookUpCreatorModule.cc.

69  {
70  ParticleWeightingLookUpTable table = ParticleWeightingLookUpTable();
71 
72  if (!m_outOfRangeWeight.empty()) {
73  table.defineOutOfRangeWeight(m_outOfRangeWeight);
74  }
75 
76  if (!m_tableIDNotSpec.empty() and m_tableIDSpec.empty()) {
77  for (auto entry : m_tableIDNotSpec) {
78  WeightInfo info = std::get<0>(entry);
79  NDBin bin = NDBinTupleToNDBin(std::get<1>(entry));
80  table.addEntry(info, bin);
81  }
82  } else if (!m_tableIDSpec.empty() and m_tableIDNotSpec.empty()) {
83  for (auto entry : m_tableIDSpec) {
84  noIdEntry noid = std::get<0>(entry);
85  double bin_id = std::get<1>(entry);
86  WeightInfo info = std::get<0>(noid);
87  NDBin bin = NDBinTupleToNDBin(std::get<1>(noid));
88  table.addEntry(info, bin, bin_id);
89  }
90  } else {
91  B2ERROR("Please define one table: with OR without specific bin IDs");
92  }
93 
94  if (!m_outOfRangeWeight.empty()) {
95  table.defineOutOfRangeWeight(m_outOfRangeWeight);
96  }
97  B2INFO("Printing LookUp table");
98  table.printParticleWeightingLookUpTable();
99 
101  importer.construct(table);
103 
104  }
Class for importing a single object to the database.
A class that describes the interval of experiments/runs for which an object in the database is valid.
listOfNoIdEntries m_tableIDNotSpec
List of entries for table to be created from without specified ID.
listOfSpecificIDEntries m_tableIDSpec
List of entries for table to be created from with specified ID.
WeightInfo m_outOfRangeWeight
Weight info for out-of-range bin.
NDBin NDBinTupleToNDBin(const NDBinTuple &bin_tuple)
Currently, std::pair can not be retrieved from python list We will get ParticleWeightingLookUpTable e...
std::tuple< WeightInfo, NDBinTuple > noIdEntry
the ID
std::map< std::string, ParticleWeightingBinLimits * > NDBin
N-dim bin: pairs of bin limits with name of the axis variable.

◆ initialize() [16/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 43 of file PseudoVertexFitterModule.cc.

◆ initialize() [17/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 57 of file RestOfEventPrinterModule.cc.

58  {
59  StoreArray<RestOfEvent>().isRequired();
60  }

◆ initialize() [18/18]

void initialize ( void  )
overridevirtual

Initialize the Module.

This method is called at the beginning of data processing.

Reimplemented from Module.

Definition at line 118 of file TagVertexModule.cc.

◆ isUnique()

bool isUnique ( const std::vector< int > &  idSequence)
private

Compares input idSequence to all sequences already included in the list.

If sequence is not found in the list a sequence is found to be unique.

Definition at line 229 of file ParticleListManipulatorModule.cc.

◆ makeGeneralFit()

bool makeGeneralFit ( )
private

TO DO: tag side vertex fit in the case of semileptonic tag side decay.

make the vertex fit on the tag side with chosen fit algorithm

Definition at line 670 of file TagVertexModule.cc.

◆ makeKFourCMother()

bool makeKFourCMother ( analysis::FourCFitKFit kv,
Particle p 
)
private

Update mother particle after FourC fit using KFit.

Parameters
kvreference to KFit MassFit object
ppointer to particle
Returns
true for successful construction of mother

Definition at line 821 of file ParticleVertexFitterModule.cc.

◆ makeKMassMother()

bool makeKMassMother ( analysis::MassFitKFit kv,
Particle p 
)
private

Update mother particle after mass fit using KFit.

Parameters
kvreference to KFit MassFit object
ppointer to particle
Returns
true for successful construction of mother

Definition at line 789 of file ParticleVertexFitterModule.cc.

◆ makeKMassPointingVertexMother()

bool makeKMassPointingVertexMother ( analysis::MassPointingVertexFitKFit kv,
Particle p 
)
private

Update mother particle after mass-constrained vertex fit with additional pointing constraint using KFit.

Parameters
kvreference to KFit MassPointingVertexFit object
ppointer to particle
Returns
true for successful construction of mother

Definition at line 756 of file ParticleVertexFitterModule.cc.

◆ makeKMassVertexMother()

bool makeKMassVertexMother ( analysis::MassVertexFitKFit kv,
Particle p 
)
private

Update mother particle after mass-constrained vertex fit using KFit.

Parameters
kvreference to KFit MassVertexFit object
ppointer to particle
Returns
true for successful construction of mother

Definition at line 726 of file ParticleVertexFitterModule.cc.

◆ makeKVertexMother()

bool makeKVertexMother ( analysis::VertexFitKFit kv,
Particle p 
)
private

Update mother particle after unconstrained vertex fit using KFit.

Parameters
kvreference to KFit VertexFit object
ppointer to particle
Returns
true for successful construction of mother

Definition at line 696 of file ParticleVertexFitterModule.cc.

◆ makeMassKFourCMother()

bool makeMassKFourCMother ( analysis::MassFourCFitKFit kv,
Particle p 
)
private

Update mother particle after MassFourC fit using KFit.

Parameters
kvreference to KFit MassFit object
ppointer to particle
Returns
true for successful construction of mother

Definition at line 882 of file ParticleVertexFitterModule.cc.

◆ NDBinTupleToNDBin()

NDBin NDBinTupleToNDBin ( const NDBinTuple bin_tuple)
private

Currently, std::pair can not be retrieved from python list We will get ParticleWeightingLookUpTable entries with tuples and transform tuples to pairs here.

Some massaging of python input is needed.

Definition at line 55 of file ParticleWeightingLookUpCreatorModule.cc.

◆ redoTwoPhotonDaughterMassFit()

bool redoTwoPhotonDaughterMassFit ( Particle postFit,
const Particle preFit,
const analysis::VertexFitKFit kv 
)
private

Combines preFit particle and vertex information from vertex fit kv to create new postFit particle.

A mass refit of this new particle is performed assuming that it originates from the point given by VertexFit.

Definition at line 345 of file ParticleVertexFitterModule.cc.

◆ registerParticleRecursively()

void registerParticleRecursively ( const DecayDescriptor decaydescriptor)

Register particles which have (sub-)decay recursively.

The function is called in initialize().

Definition at line 118 of file ParticleCombinerFromMCModule.cc.

◆ setLooseMCMatch()

void setLooseMCMatch ( const Particle particle)
private

Finds common mother of the majority of daughters.

The results are stored to extraInfo.

Definition at line 114 of file MCMatcherParticlesModule.cc.

◆ setObj()

void setObj ( T *  obj)

Set the decaying object, e.g.

an MCParticle.

Definition at line 74 of file DecayTree.h.

◆ terminate()

void terminate ( void  )
overridevirtual

Terminate the Module.

This method is called at the end of data processing.

Reimplemented from Module.

Definition at line 243 of file ParticleLoaderModule.cc.

◆ updateMapOfTrackAndDaughter()

void updateMapOfTrackAndDaughter ( unsigned &  l,
std::vector< std::vector< unsigned >> &  pars,
std::vector< unsigned > &  pard,
std::vector< Particle * > &  allparticles,
const Particle daughter 
)
private

update the map of daughter and tracks, find out which tracks belong to each daughter.

Parameters
lrepresent the tracks ID
parsmap of all parameters
pardvector of parameters
allparticlesvector of all particles
daughterpointer to particle

Definition at line 945 of file ParticleVertexFitterModule.cc.

◆ updateMasksWithParticles()

void updateMasksWithParticles ( const StoreObjPtr< RestOfEvent > &  roe,
std::vector< const Particle * > &  particlesToUpdate,
Particle::EParticleSourceObject  listType 
)
private

Update ROE masks by excluding or keeping particles.

Parameters
roePointer to RestOfEvent object for update
particlesToUpdateReference to particle collection
listTypeParticleType of the collection

Definition at line 131 of file RestOfEventUpdaterModule.cc.

133  {
134  for (auto& maskToUpdate : m_maskNamesForUpdating) {
135  if (maskToUpdate == "") {
136  B2FATAL("Cannot update ROE mask with no name!");
137  }
138  if (!roe->hasMask(maskToUpdate)) {
139  // Change name to get all ROE particles in case of new mask
140  roe->initializeMask(maskToUpdate, "ROEUpdaterModule");
141  }
142  roe->excludeParticlesFromMask(maskToUpdate, particlesToUpdate, listType, m_discard);
143 
144  }
145  }
std::vector< std::string > m_maskNamesForUpdating
Container for all mask names which will be updated.
bool m_discard
Update the ROE mask by passing or discarding particles in the provided particle list.

◆ updateMasksWithV0()

void updateMasksWithV0 ( const StoreObjPtr< RestOfEvent > &  roe,
std::vector< const Particle * > &  particlesToUpdate 
)
private

Update ROE masks with provided composite particle collection.

Parameters
roePointer to RestOfEvent object for update
particlesToUpdateReference to composite particle collection

Definition at line 111 of file RestOfEventUpdaterModule.cc.