ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DecayFinder Class Reference

#include <coresoftware/blob/master/generators/decayFinder/DecayFinder.h>

+ Inheritance diagram for DecayFinder:
+ Collaboration diagram for DecayFinder:

Public Types

typedef std::vector< std::pair
< int, int > > 
Decay
 

Public Member Functions

 DecayFinder ()
 
 DecayFinder (const std::string &name)
 
virtual ~DecayFinder ()
 
int Init (PHCompositeNode *topNode)
 
int process_event (PHCompositeNode *topNode)
 
int End (PHCompositeNode *topNode)
 Called at the end of all processing.
 
int parseDecayDescriptor ()
 
bool findDecay (PHCompositeNode *topNode)
 
bool findParticle (std::string particle)
 
int checkIfCorrectParticle (HepMC::GenParticle *particle, bool &trackFailedPT, bool &trackFailedETA)
 
int deleteElement (int arr[], int n, int x)
 
void multiplyVectorByScalarAndSort (std::vector< int > &v, int k)
 
int get_pdgcode (std::string name)
 
int get_charge (std::string name)
 
int createDecayNode (PHCompositeNode *topNode)
 
void fillDecayNode (PHCompositeNode *topNode, Decay decay)
 
void printInfo ()
 
void printNode (PHCompositeNode *topNode)
 
void setDecayDescriptor (const std::string &decayDescriptor)
 You define a particle decaying with "->", the mother on the left, the decay products on the right.
 
void triggerOnDecay (bool trigger)
 
void allowPhotons (bool allow)
 
void allowPi0 (bool allow)
 
void saveDST (bool save)
 
void setNodeName (const std::string &name)
 
- Public Member Functions inherited from SubsysReco
 ~SubsysReco () override
 
virtual int EndRun (const int)
 Called at the end of each run.
 
virtual int InitRun (PHCompositeNode *)
 
virtual int Reset (PHCompositeNode *)
 Reset.
 
virtual int ResetEvent (PHCompositeNode *)
 Clean up after each event.
 
void Print (const std::string &="ALL") const override
 
- Public Member Functions inherited from Fun4AllBase
virtual ~Fun4AllBase ()
 
virtual const std::string Name () const
 Returns the name of this module.
 
virtual void Name (const std::string &name)
 Sets the name of this module.
 
virtual void Verbosity (const int ival)
 Sets the verbosity of this module (0 by default=quiet).
 
virtual void Verbosity (enu_Verbosity ival)
 Sets the verbosity of this module (0 by default=quiet).
 
virtual int Verbosity () const
 Gets the verbosity of this module.
 

Private Attributes

PHHepMCGenEventMapm_geneventmap = nullptr
 
PHHepMCGenEventm_genevt = nullptr
 
int m_counter = 0
 
int m_nCandFail_pT = 0
 
int m_nCandFail_eta = 0
 
int m_nCandFail_pT_and_eta = 0
 
int m_nCandReconstructable = 0
 
bool m_getChargeConjugate = false
 
std::string m_decayDescriptor
 
bool m_triggerOnDecay = false
 
bool m_allowPi0 = false
 
bool m_allowPhotons = false
 
int m_mother_ID = 0
 
std::vector< intm_intermediates_ID
 
std::vector< intm_daughters_ID
 
int m_nTracksFromMother = 0
 
std::vector< intm_nTracksFromIntermediates
 
std::vector< intm_motherDecayProducts
 
bool m_save_dst
 
DecayFinderContainer_v1m_decayMap = nullptr
 
Decay decayChain
 
std::string m_nodeName
 
std::string m_container_name
 

Additional Inherited Members

- Protected Member Functions inherited from SubsysReco
 SubsysReco (const std::string &name="NONAME")
 

Detailed Description

Definition at line 18 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 18 of file DecayFinder.h

Member Typedef Documentation

typedef std::vector<std::pair<int, int> > DecayFinder::Decay

Definition at line 21 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 21 of file DecayFinder.h

Constructor & Destructor Documentation

DecayFinder::DecayFinder ( )

Definition at line 57 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 57 of file DecayFinder.cc

DecayFinder::DecayFinder ( const std::string &  name)
explicit

Definition at line 62 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 62 of file DecayFinder.cc

virtual DecayFinder::~DecayFinder ( )
inlinevirtual

Definition at line 27 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 27 of file DecayFinder.h

Member Function Documentation

void DecayFinder::allowPhotons ( bool  allow)
inline
Parameters
[in]allowSet to true to allow photons to be associated to your decay

Definition at line 91 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 91 of file DecayFinder.h

References m_allowPhotons.

void DecayFinder::allowPi0 ( bool  allow)
inline
Parameters
[in]allowSet to true to allow pi zero to be associated to your decay

Definition at line 95 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 95 of file DecayFinder.h

References m_allowPi0.

int DecayFinder::checkIfCorrectParticle ( HepMC::GenParticle *  particle,
bool &  trackFailedPT,
bool &  trackFailedETA 
)

Definition at line 400 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 400 of file DecayFinder.cc

References kdfinder::abs(), it, listOfResonantPIDs, m_allowPhotons, m_allowPi0, m_daughters_ID, m_getChargeConjugate, m_intermediates_ID, m_nTracksFromIntermediates, multiplyVectorByScalarAndSort(), Fun4AllBase::Verbosity(), and Fun4AllBase::VERBOSITY_MAX.

Referenced by findDecay().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int DecayFinder::createDecayNode ( PHCompositeNode topNode)

Definition at line 603 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 603 of file DecayFinder.cc

References PHCompositeNode::addNode(), Fun4AllReturnCodes::EVENT_OK, PHNodeIterator::findFirst(), m_container_name, m_decayMap, m_nodeName, and pos().

Referenced by Init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int DecayFinder::deleteElement ( int  arr[],
int  n,
int  x 
)

Definition at line 542 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 542 of file DecayFinder.cc

References n.

Referenced by findDecay().

+ Here is the caller graph for this function:

int DecayFinder::End ( PHCompositeNode )
virtual

Called at the end of all processing.

Reimplemented from SubsysReco.

Definition at line 103 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 103 of file DecayFinder.cc

References printInfo(), Fun4AllBase::Verbosity(), and Fun4AllBase::VERBOSITY_SOME.

+ Here is the call graph for this function:

void DecayFinder::fillDecayNode ( PHCompositeNode topNode,
Decay  decay 
)

Definition at line 649 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 649 of file DecayFinder.cc

References DecayFinderContainer_v1::insert(), m_decayMap, and m_nodeName.

Referenced by findDecay().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool DecayFinder::findDecay ( PHCompositeNode topNode)

Definition at line 251 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 251 of file DecayFinder.cc

References kdfinder::abs(), checkIfCorrectParticle(), decayChain, deleteElement(), fillDecayNode(), PHHepMCGenEventMap::get(), PHHepMCGenEvent::getEvent(), listOfResonantPIDs, m_allowPhotons, m_allowPi0, m_geneventmap, m_genevt, m_getChargeConjugate, m_intermediates_ID, m_mother_ID, m_motherDecayProducts, m_nCandFail_eta, m_nCandFail_pT, m_nCandFail_pT_and_eta, m_nCandReconstructable, m_save_dst, multiplyVectorByScalarAndSort(), n, Fun4AllBase::Verbosity(), and Fun4AllBase::VERBOSITY_MAX.

Referenced by process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool DecayFinder::findParticle ( std::string  particle)

Definition at line 564 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 564 of file DecayFinder.cc

References Fun4AllBase::Verbosity(), and Fun4AllBase::VERBOSITY_SOME.

Referenced by get_charge(), get_pdgcode(), and parseDecayDescriptor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int DecayFinder::get_charge ( std::string  name)

Definition at line 594 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 594 of file DecayFinder.cc

References findParticle().

Referenced by parseDecayDescriptor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int DecayFinder::get_pdgcode ( std::string  name)

Definition at line 586 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 586 of file DecayFinder.cc

References findParticle().

Referenced by parseDecayDescriptor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int DecayFinder::Init ( PHCompositeNode )
virtual

Called during initialization. Typically this is where you can book histograms, and e.g. register them to Fun4AllServer (so they can be output to file using Fun4AllServer::dumpHistos() method).

Reimplemented from SubsysReco.

Definition at line 67 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 67 of file DecayFinder.cc

References createDecayNode(), m_decayDescriptor, m_save_dst, Fun4AllBase::Name(), parseDecayDescriptor(), Fun4AllBase::Verbosity(), and Fun4AllBase::VERBOSITY_SOME.

+ Here is the call graph for this function:

void DecayFinder::multiplyVectorByScalarAndSort ( std::vector< int > &  v,
int  k 
)

Definition at line 579 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 579 of file DecayFinder.cc

References c, k, and Acts::Test::transform.

Referenced by checkIfCorrectParticle(), and findDecay().

+ Here is the caller graph for this function:

int DecayFinder::parseDecayDescriptor ( )

Definition at line 110 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 110 of file DecayFinder.cc

References kdfinder::abs(), c, Fun4AllReturnCodes::DONOTREGISTERSUBSYSTEM, findParticle(), get_charge(), get_pdgcode(), m_daughters_ID, m_decayDescriptor, m_getChargeConjugate, m_intermediates_ID, m_mother_ID, m_motherDecayProducts, m_nTracksFromIntermediates, m_nTracksFromMother, Fun4AllBase::Name(), pos(), Fun4AllBase::Verbosity(), Fun4AllBase::VERBOSITY_MORE, and Fun4AllBase::VERBOSITY_SOME.

Referenced by Init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DecayFinder::printInfo ( )

Definition at line 655 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 655 of file DecayFinder.cc

References m_counter, m_decayDescriptor, m_nCandFail_eta, m_nCandFail_pT, m_nCandFail_pT_and_eta, m_nCandReconstructable, and Fun4AllBase::Name().

Referenced by End().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void DecayFinder::printNode ( PHCompositeNode topNode)

Definition at line 669 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 669 of file DecayFinder.cc

References DecayFinderContainer_v1::begin(), G4INCL::ClusterDecay::decay(), DecayFinderContainer_v1::end(), and m_nodeName.

Referenced by process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int DecayFinder::process_event ( PHCompositeNode )
virtual

Called for each event. This is where you do the real work.

Reimplemented from SubsysReco.

Definition at line 82 of file DecayFinder.cc.

View newest version in sPHENIX GitHub at line 82 of file DecayFinder.cc

References Fun4AllReturnCodes::ABORTEVENT, Fun4AllReturnCodes::EVENT_OK, findDecay(), m_counter, m_decayDescriptor, m_triggerOnDecay, printNode(), Fun4AllBase::Verbosity(), and Fun4AllBase::VERBOSITY_MORE.

+ Here is the call graph for this function:

void DecayFinder::saveDST ( bool  save)
inline
Parameters
[in]allowSet to true to save any of your decays that are found back to the node tree in a DecayFinderContainer The default name is "decay" and will automatically have "_DecayMap" added to the end

Definition at line 100 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 100 of file DecayFinder.h

References m_save_dst.

void DecayFinder::setDecayDescriptor ( const std::string &  decayDescriptor)
inline

You define a particle decaying with "->", the mother on the left, the decay products on the right.

Use this function to define the decay you want to find in the HepMC record

Parameters
[in]decayDescriptorthe description of the decay chain, this is a string You define the decay with these rules: Set the charge of final state tracks with "^", the particle name on the left and the charge on the right. Accepted charges are +, - and 0 Use the same rules as above for any intermediatee decays but contain the entire decay within curled brackets, "{}" If you also want to find the charge conjugate decay, contain the entire decay descriptor within "[]cc" for charge-conjugate. The "cc" is NOT case sensitive The particle names you use must be kept in the TDatabasePDG class from root (https://root.cern.ch/doc/master/classTDatabasePDG.html). Print this table to see available particles with TDatabasePDG::Instance()->Print() An example of a decay would be: "[B+ -> {D0_bar -> kaon^+ pion^-} pion^+]cc"
Note
There is an internal list of resonances which, if they appear in the record, will be further analysed. For example, the f0(980)->pipi decay is too quick to have a flight distance and so we would only see the pion pair in the detector. If you are looking for B_s0 -> J/psi pipi then the decay of the f0 will be studied for a pipi final state, basically inclusive decays are handled automatically. If you wish to study the f0 decay, add it to your decay descriptor and it will automatically be removed from the "skip list"

Definition at line 81 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 81 of file DecayFinder.h

References m_decayDescriptor.

void DecayFinder::setNodeName ( const std::string &  name)
inline
Parameters
[in]nameChange the default name of the DecayFinderContainer.
Note
This name will still have "_DecayMap" added to the end, this cannot be changed

Definition at line 105 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 105 of file DecayFinder.h

References m_container_name.

void DecayFinder::triggerOnDecay ( bool  trigger)
inline
Parameters
[in]triggerSet to true to allow further processing of events in which your decay appears, if your decay does not appear, all further processing of this event is skipped. This defaults to false so every event is proccessed in F4A

Definition at line 87 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 87 of file DecayFinder.h

References m_triggerOnDecay.

Member Data Documentation

Decay DecayFinder::decayChain
private

Definition at line 135 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 135 of file DecayFinder.h

Referenced by findDecay().

bool DecayFinder::m_allowPhotons = false
private

Definition at line 122 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 122 of file DecayFinder.h

Referenced by allowPhotons(), checkIfCorrectParticle(), and findDecay().

bool DecayFinder::m_allowPi0 = false
private

Definition at line 121 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 121 of file DecayFinder.h

Referenced by allowPi0(), checkIfCorrectParticle(), and findDecay().

std::string DecayFinder::m_container_name
private

Definition at line 137 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 137 of file DecayFinder.h

Referenced by createDecayNode(), and setNodeName().

int DecayFinder::m_counter = 0
private

Definition at line 111 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 111 of file DecayFinder.h

Referenced by printInfo(), and process_event().

std::vector<int> DecayFinder::m_daughters_ID
private

Definition at line 126 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 126 of file DecayFinder.h

Referenced by checkIfCorrectParticle(), and parseDecayDescriptor().

std::string DecayFinder::m_decayDescriptor
private

Definition at line 119 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 119 of file DecayFinder.h

Referenced by Init(), parseDecayDescriptor(), printInfo(), process_event(), and setDecayDescriptor().

DecayFinderContainer_v1* DecayFinder::m_decayMap = nullptr
private

Definition at line 134 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 134 of file DecayFinder.h

Referenced by createDecayNode(), and fillDecayNode().

PHHepMCGenEventMap* DecayFinder::m_geneventmap = nullptr
private

Definition at line 108 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 108 of file DecayFinder.h

Referenced by findDecay().

PHHepMCGenEvent* DecayFinder::m_genevt = nullptr
private

Definition at line 109 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 109 of file DecayFinder.h

Referenced by findDecay().

bool DecayFinder::m_getChargeConjugate = false
private

Definition at line 117 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 117 of file DecayFinder.h

Referenced by checkIfCorrectParticle(), findDecay(), and parseDecayDescriptor().

std::vector<int> DecayFinder::m_intermediates_ID
private

Definition at line 125 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 125 of file DecayFinder.h

Referenced by checkIfCorrectParticle(), findDecay(), and parseDecayDescriptor().

int DecayFinder::m_mother_ID = 0
private

Definition at line 124 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 124 of file DecayFinder.h

Referenced by findDecay(), and parseDecayDescriptor().

std::vector<int> DecayFinder::m_motherDecayProducts
private

Definition at line 131 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 131 of file DecayFinder.h

Referenced by findDecay(), and parseDecayDescriptor().

int DecayFinder::m_nCandFail_eta = 0
private

Definition at line 113 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 113 of file DecayFinder.h

Referenced by findDecay(), and printInfo().

int DecayFinder::m_nCandFail_pT = 0
private

Definition at line 112 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 112 of file DecayFinder.h

Referenced by findDecay(), and printInfo().

int DecayFinder::m_nCandFail_pT_and_eta = 0
private

Definition at line 114 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 114 of file DecayFinder.h

Referenced by findDecay(), and printInfo().

int DecayFinder::m_nCandReconstructable = 0
private

Definition at line 115 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 115 of file DecayFinder.h

Referenced by findDecay(), and printInfo().

std::string DecayFinder::m_nodeName
private

Definition at line 136 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 136 of file DecayFinder.h

Referenced by createDecayNode(), fillDecayNode(), and printNode().

std::vector<int> DecayFinder::m_nTracksFromIntermediates
private

Definition at line 129 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 129 of file DecayFinder.h

Referenced by checkIfCorrectParticle(), and parseDecayDescriptor().

int DecayFinder::m_nTracksFromMother = 0
private

Definition at line 128 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 128 of file DecayFinder.h

Referenced by parseDecayDescriptor().

bool DecayFinder::m_save_dst
private

Definition at line 133 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 133 of file DecayFinder.h

Referenced by findDecay(), Init(), and saveDST().

bool DecayFinder::m_triggerOnDecay = false
private

Definition at line 120 of file DecayFinder.h.

View newest version in sPHENIX GitHub at line 120 of file DecayFinder.h

Referenced by process_event(), and triggerOnDecay().


The documentation for this class was generated from the following files: