eic-smear  1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
Smear::ParticleID Struct Reference

#include <ParticleID.h>

Inheritance diagram for Smear::ParticleID:
Smear::Smearer

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.

Todo:
Implement data hiding
Remarks
Why is the bitwise AND assignment operator&= overloaded?!

Definition 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.

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

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

Definition at line 25 of file ParticleID.cxx.

Smear::ParticleID::~ParticleID ( )
virtual

Destructor.

Definition 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.

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.

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.

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

Return the TRandom3 instance used by the ParticleID.

Definition at line 208 of file ParticleID.h.

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

Print information about this device to standard output.

Definition at line 238 of file ParticleID.cxx.

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.

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.

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.

void Smear::ParticleID::SetPMatrixSize ( )

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

Definition at line 50 of file ParticleID.cxx.

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.

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.

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.

void Smear::ParticleID::Speak ( )

Dump the contents of the table to the screen.

Definition at line 35 of file ParticleID.cxx.

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.


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