EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Smear::ParticleID Struct Reference

#include <eic-smear/blob/master/include/eicsmear/smear/ParticleID.h>

+ Inheritance diagram for Smear::ParticleID:
+ Collaboration diagram for Smear::ParticleID:

Public Member Functions

 ParticleID ()
 
 ParticleID (TString filename)
 
virtual ~ParticleID ()
 
void SetPMatrixPath (TString)
 
void SetPIDUseMC (bool useMc)
 
TRandom3 & GetRandomGenerator ()
 
void SetRanSeed (int seed)
 
void GetAcceptanceFromDevice (const Device &)
 
void SetPMatrixSize ()
 
void SetupProbabilityArray ()
 
virtual ParticleIDClone (const char *="") const
 
int Wild (int pbin, int trueID)
 
int InListOfTrue (int ID)
 
int InListOfFalse (int ID)
 
void ReadP (TString filename)
 
void Smear (const erhic::VirtualParticle &, ParticleMCS &)
 
void Speak ()
 
virtual void Clear (Option_t *="")
 
virtual void Print (Option_t *="") const
 
- Public Member Functions inherited from Smear::Smearer
virtual ~Smearer ()
 

Public Attributes

TRandom3 Ran
 
TString PMatPath
 
std::vector< int > TrueIdent
 
std::vector< int > FalseIdent
 
std::vector< double > PMin
 
std::vector< double > PMax
 
std::vector< std::vector
< std::vector< double > > > 
PMatrix
 
std::vector< std::vector
< std::vector< double > > > 
Range
 
bool bUseMC
 
- Public Attributes inherited from Smear::Smearer
Acceptance Accept
 

Detailed Description

This structure is used to generate particle ID.

The input file containing the P matrix must begin with format lines beginning with "!T", "!F" and "!P". For example

!T 211 321 2212 !F 211 321 2212 0 !P 15

The first line tells the PID generator which particles false ID will be generated for. The second line tells it which particles the particles in the first line can be identified as. The third line tells it how many momentum bins there are.

Lines of data should appear as:

1 pbinNumber pmin pmax FalseID P1 P2 P3

The line must begin with a 1 to be read. pbinNumber is the number of the momentum bin. pmin and pmax are the bounds of the momentum bin. FalseID is the ID that the particle will be mis-identified as, this should be a PDG particle code (unless it is an old Hermes file). P1 is the probability that the first particle appearing in the "!T" line will be misidentified as FalseID. Likewise for P2 and P3.

Remarks
Why is the bitwise AND assignment operator&= overloaded?!

Definition at line 67 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 67 of file ParticleID.h

Constructor & Destructor Documentation

Smear::ParticleID::ParticleID ( )

Default constructor. Default path for probability matrix is "PIDMatrix.dat". Also, by default, the particle ID uses smeared kinematic variables as input, rather than Monte Carlo values.

Definition at line 18 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 18 of file ParticleID.cxx

References PMatPath, and ReadP().

Referenced by Clone().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Smear::ParticleID::ParticleID ( TString  filename)
explicit

Constructor. Initialise the particle misidentification matrix from the named file.

Definition at line 25 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 25 of file ParticleID.cxx

References PMatPath, and ReadP().

+ Here is the call graph for this function:

Smear::ParticleID::~ParticleID ( )
virtual

Destructor.

Definition at line 32 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 32 of file ParticleID.cxx

Member Function Documentation

void Smear::ParticleID::Clear ( Option_t *  = "")
virtual

Clears existing table contents.

Definition at line 117 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 117 of file ParticleID.cxx

References FalseIdent, PMatrix, PMax, PMin, Range, and TrueIdent.

Referenced by ReadP().

+ Here is the caller graph for this function:

ParticleID * Smear::ParticleID::Clone ( const char *  = "") const
inlinevirtual

Returns a copy of this ParticleID. Inherited from TObject. The const char* argument has no effect.

Implements Smear::Smearer.

Definition at line 220 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 220 of file ParticleID.h

References ParticleID().

+ Here is the call graph for this function:

void Smear::ParticleID::GetAcceptanceFromDevice ( const Device dev)
inline

Set the ParticleID instance to have the same acceptance as the device. This includes all acceptance zones as well as the list of specific particles to be detected (if there is one).

Definition at line 216 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 216 of file ParticleID.h

References Smear::Smearer::Accept.

TRandom3 & Smear::ParticleID::GetRandomGenerator ( )
inline

Return the TRandom3 instance used by the ParticleID.

Definition at line 208 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 208 of file ParticleID.h

References Ran.

int Smear::ParticleID::InListOfFalse ( int  ID)

Definition at line 104 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 104 of file ParticleID.cxx

References kdfinder::abs(), and FalseIdent.

Referenced by ReadP().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Smear::ParticleID::InListOfTrue ( int  ID)

Definition at line 95 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 95 of file ParticleID.cxx

References kdfinder::abs(), and TrueIdent.

Referenced by Smear(), and Wild().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Smear::ParticleID::Print ( Option_t *  = "") const
virtual

Print information about this device to standard output.

Definition at line 238 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 238 of file ParticleID.cxx

References PMatPath.

void Smear::ParticleID::ReadP ( TString  filename)

Read in a P matrix and set up the ParticleID to be ready to generate. See the documentation for the detector function ReadPIDMatrix.

Definition at line 126 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 126 of file ParticleID.cxx

References Clear(), FalseIdent, getline, InListOfFalse(), pid, PMatrix, PMax, PMin, Acts::UnitConstants::s, SetPMatrixSize(), SetupProbabilityArray(), and TrueIdent.

Referenced by ParticleID(), and SetPMatrixPath().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Smear::ParticleID::SetPIDUseMC ( bool  useMc)
inline

If true, the ParticleID will use the original Monte Carlo values to generate ID's, rather than smeared values. Default is false.

Definition at line 204 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 204 of file ParticleID.h

References bUseMC, and d.

void Smear::ParticleID::SetPMatrixPath ( TString  str)
inline

Set the path to the file containing the particle ID probability matrix, and read it in.

Definition at line 199 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 199 of file ParticleID.h

References PMatPath, and ReadP().

+ Here is the call graph for this function:

void Smear::ParticleID::SetPMatrixSize ( )

Resize the PMatrix, (# of pbins, # of true, # of false).

Definition at line 50 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 50 of file ParticleID.cxx

References FalseIdent, PMatrix, PMin, and TrueIdent.

Referenced by ReadP().

+ Here is the caller graph for this function:

void Smear::ParticleID::SetRanSeed ( int  seed)
inline

Set the seed of the random number generator instance used by the ParticleID. See ROOT TRandom3 documentation for more information.

Definition at line 212 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 212 of file ParticleID.h

References Ran.

void Smear::ParticleID::SetupProbabilityArray ( )

Setup the range array used by wild.

Range is used to set up zones in [0,1], if a random number falls in one of the zones, the associated ID is used.

Definition at line 60 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 60 of file ParticleID.cxx

References k, PMatrix, Range, and t.

Referenced by ReadP().

+ Here is the caller graph for this function:

void Smear::ParticleID::Smear ( const erhic::VirtualParticle prt,
ParticleMCS prtOut 
)
virtual

Generates particle ID if the particle is in the list of particles to be identified, falls within the momentum range of the PMatrix and falls within acceptence. New id is stored in prtOut.id. By default, this will use the momentum prtOut.p to make its determination, but you can set it to use the values stored in prt instead using SetPIDUseMC(true).

Implements Smear::Smearer.

Definition at line 214 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 214 of file ParticleID.cxx

References Smear::Smearer::Accept, bUseMC, erhic::VirtualParticle::GetP(), Smear::ParticleMCS::GetP(), erhic::VirtualParticle::Id(), InListOfTrue(), Smear::Acceptance::Is(), momentum, pid, PMax, PMin, Smear::ParticleMCS::SetId(), and Wild().

+ Here is the call graph for this function:

void Smear::ParticleID::Speak ( )

Dump the contents of the table to the screen.

Definition at line 35 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 35 of file ParticleID.cxx

References FalseIdent, k, PMatrix, PMax, PMin, and TrueIdent.

int Smear::ParticleID::Wild ( int  pbin,
int  trueID 
)

Randomly generates a false ID based on the current, a momentum bin and a true particle ID.

Definition at line 76 of file ParticleID.cxx.

View newest version in sPHENIX GitHub at line 76 of file ParticleID.cxx

References FalseIdent, InListOfTrue(), k, Ran, Range, and Acts::Test::values.

Referenced by Smear().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool Smear::ParticleID::bUseMC

Definition at line 194 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 194 of file ParticleID.h

Referenced by SetPIDUseMC(), and Smear().

std::vector<int> Smear::ParticleID::FalseIdent

Definition at line 184 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 184 of file ParticleID.h

Referenced by Clear(), InListOfFalse(), ReadP(), SetPMatrixSize(), Speak(), and Wild().

TString Smear::ParticleID::PMatPath

Definition at line 182 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 182 of file ParticleID.h

Referenced by ParticleID(), Print(), and SetPMatrixPath().

std::vector< std::vector<std::vector<double> > > Smear::ParticleID::PMatrix

Definition at line 191 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 191 of file ParticleID.h

Referenced by Clear(), ReadP(), SetPMatrixSize(), SetupProbabilityArray(), and Speak().

std::vector<double> Smear::ParticleID::PMax

Definition at line 186 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 186 of file ParticleID.h

Referenced by Clear(), ReadP(), Smear(), and Speak().

std::vector<double> Smear::ParticleID::PMin

Definition at line 185 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 185 of file ParticleID.h

Referenced by Clear(), ReadP(), SetPMatrixSize(), Smear(), and Speak().

TRandom3 Smear::ParticleID::Ran

Definition at line 181 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 181 of file ParticleID.h

Referenced by GetRandomGenerator(), SetRanSeed(), and Wild().

std::vector< std::vector<std::vector<double> > > Smear::ParticleID::Range

Definition at line 193 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 193 of file ParticleID.h

Referenced by Clear(), SetupProbabilityArray(), and Wild().

std::vector<int> Smear::ParticleID::TrueIdent

Definition at line 183 of file ParticleID.h.

View newest version in sPHENIX GitHub at line 183 of file ParticleID.h

Referenced by Clear(), InListOfTrue(), ReadP(), SetPMatrixSize(), and Speak().


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