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

performs space charge distortion reconstruction using tracks To reconstruct the distortions dr0, drphi0 and dz0 in a given volume element, the following chisquare is minimized chisquare = sum_cluster (drphi - (drphi0 + dr0 tan alpha))**2/error**2 + sum_cluster ( dz - (dz0 + dr0 tan beta))**2/error**2 with More...

#include <coresoftware/blob/master/offline/packages/tpccalib/TpcSpaceChargeReconstruction.h>

+ Inheritance diagram for TpcSpaceChargeReconstruction:
+ Collaboration diagram for TpcSpaceChargeReconstruction:

Public Member Functions

 TpcSpaceChargeReconstruction (const std::string &="TPCSPACECHARGERECONSTRUCTION")
 constructor
 
int Init (PHCompositeNode *) override
 global initialization
 
int InitRun (PHCompositeNode *) override
 run initialization
 
int process_event (PHCompositeNode *) override
 event processing
 
int End (PHCompositeNode *) override
 end of processing
 
void SetDefaultParameters () override
 parameters
 
configuration
void set_use_micromegas (bool value)
 set whether to use only tracks with micromegas or not
 
void set_grid_dimensions (int phibins, int rbins, int zbins)
 set grid dimensions
 
void set_outputfile (const std::string &filename)
 output file
 
- Public Member Functions inherited from SubsysReco
 ~SubsysReco () override
 
virtual int EndRun (const int)
 Called at the end of each run.
 
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.
 
- Public Member Functions inherited from PHParameterInterface
 PHParameterInterface (const std::string &name)
 
 PHParameterInterface (const PHParameterInterface &)=delete
 
virtual ~PHParameterInterface ()
 
void set_paramname (const std::string &name)
 
void set_double_param (const std::string &name, const double dval)
 
double get_double_param (const std::string &name) const
 
void set_int_param (const std::string &name, const int ival)
 
int get_int_param (const std::string &name) const
 
void set_string_param (const std::string &name, const std::string &sval)
 
std::string get_string_param (const std::string &name) const
 
void UpdateParametersWithMacro ()
 
void SaveToNodeTree (PHCompositeNode *runNode, const std::string &nodename)
 
void PutOnParNode (PHCompositeNode *parNode, const std::string &nodename)
 

Private Member Functions

int load_nodes (PHCompositeNode *)
 load nodes
 
void process_tracks ()
 process tracks
 
bool accept_track (SvtxTrack *) const
 returns true if track fulfills basic requirement for distortion calculations
 
void process_track (SvtxTrack *)
 process track
 
int get_cell_index (TrkrCluster *) const
 get relevant cell for a given cluster
 

Private Attributes

std::string m_outputfile = "TpcSpaceChargeMatrices.root"
 output file
 
bool m_use_micromegas = true
 true if only tracks with micromegas must be used
 
std::unique_ptr
< TpcSpaceChargeMatrixContainer
m_matrix_container
 matrix container
 
selection parameters
float m_max_talpha = 0.6
 
float m_max_drphi = 0.5
 
float m_max_tbeta = 1.5
 
float m_max_dz = 0.5
 
counters
int m_total_tracks = 0
 
int m_accepted_tracks = 0
 
int m_total_clusters = 0
 
int m_accepted_clusters = 0
 
nodes
SvtxTrackMapm_track_map = nullptr
 
TrkrClusterContainerm_cluster_map = nullptr
 

Additional Inherited Members

- Public Types inherited from Fun4AllBase
enum  enu_Verbosity {
  VERBOSITY_QUIET = 0, VERBOSITY_SOME = 1, VERBOSITY_MORE = 2, VERBOSITY_EVEN_MORE = 3,
  VERBOSITY_A_LOT = 4, VERBOSITY_MAX = INT_MAX - 10
}
 
- Protected Member Functions inherited from SubsysReco
 SubsysReco (const std::string &name="NONAME")
 
- Protected Member Functions inherited from PHParameterInterface
void set_default_double_param (const std::string &name, const double dval)
 
void set_default_int_param (const std::string &name, const int ival)
 
void set_default_string_param (const std::string &name, const std::string &sval)
 
void InitializeParameters ()
 

Detailed Description

performs space charge distortion reconstruction using tracks To reconstruct the distortions dr0, drphi0 and dz0 in a given volume element, the following chisquare is minimized chisquare = sum_cluster (drphi - (drphi0 + dr0 tan alpha))**2/error**2 + sum_cluster ( dz - (dz0 + dr0 tan beta))**2/error**2 with

  • drphi and dz the residuals (track - cluster) measured for a given cluster
  • alpha and beta the track angles at the cluster in the rphi,r plane and the z,r plane, respectively The chisquare being quadratic in dr0, drphi0 and dz0, it can be minimized analytically. This results in a linear equation lhs[i].[corrections] = rhs[i], and thus [corrections] = lhs[i]**(-1).rhs[i] The lhs and rhs matrices are filled in TpcSpaceChargeReconstruction::process_track The actual inversion is performed in TpcSpaceChargeMatrixInversion::calculate_distortions

Definition at line 37 of file TpcSpaceChargeReconstruction.h.

View newest version in sPHENIX GitHub at line 37 of file TpcSpaceChargeReconstruction.h

Constructor & Destructor Documentation

TpcSpaceChargeReconstruction::TpcSpaceChargeReconstruction ( const std::string &  name = "TPCSPACECHARGERECONSTRUCTION")

constructor

Definition at line 69 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 69 of file TpcSpaceChargeReconstruction.cc

References PHParameterInterface::InitializeParameters().

+ Here is the call graph for this function:

Member Function Documentation

bool TpcSpaceChargeReconstruction::accept_track ( SvtxTrack track) const
private

returns true if track fulfills basic requirement for distortion calculations

Definition at line 204 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 204 of file TpcSpaceChargeReconstruction.cc

References SvtxTrack::get_px(), SvtxTrack::get_py(), m_use_micromegas, pt, and square().

Referenced by process_tracks().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpcSpaceChargeReconstruction::End ( PHCompositeNode )
overridevirtual

end of processing

Reimplemented from SubsysReco.

Definition at line 137 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 137 of file TpcSpaceChargeReconstruction.cc

References Fun4AllReturnCodes::EVENT_OK, m_accepted_clusters, m_accepted_tracks, m_matrix_container, m_outputfile, m_total_clusters, and m_total_tracks.

int TpcSpaceChargeReconstruction::get_cell_index ( TrkrCluster cluster) const
private

get relevant cell for a given cluster

Definition at line 397 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 397 of file TpcSpaceChargeReconstruction.cc

References QAG4Util::get_r(), TrkrCluster::getX(), TrkrCluster::getY(), TrkrCluster::getZ(), m_matrix_container, M_PI, MATSCAN::phibins, r, and z.

Referenced by process_track().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TpcSpaceChargeReconstruction::Init ( PHCompositeNode )
overridevirtual

global initialization

Reimplemented from SubsysReco.

Definition at line 82 of file TpcSpaceChargeReconstruction.cc.

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

References Fun4AllReturnCodes::EVENT_OK, m_accepted_clusters, m_accepted_tracks, m_total_clusters, and m_total_tracks.

int TpcSpaceChargeReconstruction::InitRun ( PHCompositeNode )
overridevirtual

run initialization

Reimplemented from SubsysReco.

Definition at line 95 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 95 of file TpcSpaceChargeReconstruction.cc

References Fun4AllReturnCodes::EVENT_OK, PHParameterInterface::get_double_param(), m_matrix_container, m_max_drphi, m_max_dz, m_max_talpha, m_max_tbeta, m_outputfile, m_use_micromegas, PHParameterInterface::UpdateParametersWithMacro(), and Fun4AllBase::Verbosity().

+ Here is the call graph for this function:

int TpcSpaceChargeReconstruction::load_nodes ( PHCompositeNode topNode)
private

load nodes

Definition at line 177 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 177 of file TpcSpaceChargeReconstruction.cc

References Fun4AllReturnCodes::EVENT_OK, m_cluster_map, and m_track_map.

Referenced by process_event().

+ Here is the caller graph for this function:

int TpcSpaceChargeReconstruction::process_event ( PHCompositeNode topNode)
overridevirtual

event processing

Reimplemented from SubsysReco.

Definition at line 126 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 126 of file TpcSpaceChargeReconstruction.cc

References Fun4AllReturnCodes::EVENT_OK, load_nodes(), and process_tracks().

+ Here is the call graph for this function:

void TpcSpaceChargeReconstruction::process_track ( SvtxTrack track)
private

process track

Definition at line 220 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 220 of file TpcSpaceChargeReconstruction.cc

References kdfinder::abs(), SvtxTrack::begin_cluster_keys(), SvtxTrack::begin_states(), QAG4Util::delta_phi(), dz, SvtxTrack::end_cluster_keys(), SvtxTrack::end_states(), TrkrClusterContainer::findCluster(), get_cell_index(), QAG4Util::get_r(), TrkrDefs::getTrkrId(), m_accepted_clusters, m_cluster_map, m_matrix_container, m_max_drphi, m_max_dz, m_max_talpha, m_max_tbeta, m_total_clusters, PHWHERE, square(), and TrkrDefs::tpcId.

Referenced by process_tracks().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TpcSpaceChargeReconstruction::process_tracks ( )
private

process tracks

Definition at line 189 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 189 of file TpcSpaceChargeReconstruction.cc

References accept_track(), SvtxTrackMap::begin(), SvtxTrackMap::end(), m_accepted_tracks, m_cluster_map, m_total_tracks, m_track_map, and process_track().

Referenced by process_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TpcSpaceChargeReconstruction::set_grid_dimensions ( int  phibins,
int  rbins,
int  zbins 
)

set grid dimensions

Parameters
phibinsthe number of bins in the azimuth direction
zbinsthe number of bins along z

Definition at line 78 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 78 of file TpcSpaceChargeReconstruction.cc

References m_matrix_container.

void TpcSpaceChargeReconstruction::set_outputfile ( const std::string &  filename)
inline

output file

this is the file where space charge matrix container is stored

Definition at line 62 of file TpcSpaceChargeReconstruction.h.

View newest version in sPHENIX GitHub at line 62 of file TpcSpaceChargeReconstruction.h

References INPUTHEPMC::filename, and m_outputfile.

void TpcSpaceChargeReconstruction::set_use_micromegas ( bool  value)
inline

set whether to use only tracks with micromegas or not

Definition at line 48 of file TpcSpaceChargeReconstruction.h.

View newest version in sPHENIX GitHub at line 48 of file TpcSpaceChargeReconstruction.h

References m_use_micromegas.

void TpcSpaceChargeReconstruction::SetDefaultParameters ( )
overridevirtual

parameters

Implements PHParameterInterface.

Definition at line 167 of file TpcSpaceChargeReconstruction.cc.

View newest version in sPHENIX GitHub at line 167 of file TpcSpaceChargeReconstruction.cc

References PHParameterInterface::set_default_double_param().

+ Here is the call graph for this function:

Member Data Documentation

int TpcSpaceChargeReconstruction::m_accepted_clusters = 0
private

Definition at line 125 of file TpcSpaceChargeReconstruction.h.

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

Referenced by End(), Init(), and process_track().

int TpcSpaceChargeReconstruction::m_accepted_tracks = 0
private

Definition at line 122 of file TpcSpaceChargeReconstruction.h.

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

Referenced by End(), Init(), and process_tracks().

TrkrClusterContainer* TpcSpaceChargeReconstruction::m_cluster_map = nullptr
private

Definition at line 131 of file TpcSpaceChargeReconstruction.h.

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

Referenced by load_nodes(), process_track(), and process_tracks().

std::unique_ptr<TpcSpaceChargeMatrixContainer> TpcSpaceChargeReconstruction::m_matrix_container
private

matrix container

Definition at line 117 of file TpcSpaceChargeReconstruction.h.

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

Referenced by End(), get_cell_index(), InitRun(), process_track(), and set_grid_dimensions().

float TpcSpaceChargeReconstruction::m_max_drphi = 0.5
private

Definition at line 109 of file TpcSpaceChargeReconstruction.h.

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

Referenced by InitRun(), and process_track().

float TpcSpaceChargeReconstruction::m_max_dz = 0.5
private

Definition at line 113 of file TpcSpaceChargeReconstruction.h.

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

Referenced by InitRun(), and process_track().

float TpcSpaceChargeReconstruction::m_max_talpha = 0.6
private

Definition at line 108 of file TpcSpaceChargeReconstruction.h.

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

Referenced by InitRun(), and process_track().

float TpcSpaceChargeReconstruction::m_max_tbeta = 1.5
private

Definition at line 112 of file TpcSpaceChargeReconstruction.h.

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

Referenced by InitRun(), and process_track().

std::string TpcSpaceChargeReconstruction::m_outputfile = "TpcSpaceChargeMatrices.root"
private

output file

Definition at line 100 of file TpcSpaceChargeReconstruction.h.

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

Referenced by End(), InitRun(), and set_outputfile().

int TpcSpaceChargeReconstruction::m_total_clusters = 0
private

Definition at line 124 of file TpcSpaceChargeReconstruction.h.

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

Referenced by End(), Init(), and process_track().

int TpcSpaceChargeReconstruction::m_total_tracks = 0
private

Definition at line 121 of file TpcSpaceChargeReconstruction.h.

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

Referenced by End(), Init(), and process_tracks().

SvtxTrackMap* TpcSpaceChargeReconstruction::m_track_map = nullptr
private

Definition at line 130 of file TpcSpaceChargeReconstruction.h.

View newest version in sPHENIX GitHub at line 130 of file TpcSpaceChargeReconstruction.h

Referenced by load_nodes(), and process_tracks().

bool TpcSpaceChargeReconstruction::m_use_micromegas = true
private

true if only tracks with micromegas must be used

Definition at line 103 of file TpcSpaceChargeReconstruction.h.

View newest version in sPHENIX GitHub at line 103 of file TpcSpaceChargeReconstruction.h

Referenced by accept_track(), InitRun(), and set_use_micromegas().


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