LArSoft Track class equivalent data container. More...
#include <track.hh>
Public Member Functions | |
track (DATA::DATA_TYPE type=DATA::Track) | |
Default constructor. | |
track (const track &original) | |
Copy constructor. | |
virtual | ~track () |
Default destructor. | |
Int_t | track_id () const |
size_t | n_point () const |
size_t | n_covariance () const |
size_t | n_momentum () const |
size_t | n_dQdx () const |
const TVector3 & | direction_at (UInt_t p) const |
const TVector3 & | vertex_at (UInt_t p) const |
Double_t | momentum_at (UInt_t p) const |
const TMatrixD & | covariance_at (UInt_t p) const |
void | set_track_id (const Int_t id) |
void | add_vertex (const TVector3 v) |
void | add_direction (const TVector3 v) |
void | add_momentum (const Double_t v) |
void | add_covariance (const TMatrixD m) |
virtual void | clear_data () |
Clear method. | |
void | get_axis_range (Double_t &max, Double_t &min, const Int_t axis) const |
A utility function to obtain maximum & minimum of spacepoints' vertex along the specified axis. | |
void | get_axis_range (Double_t &xmax, Double_t &xmin, Double_t &ymax, Double_t &ymin, Double_t &zmax, Double_t &zmin) const |
A utility function to obtain maximum & minimum of spacepoints' vertex along all axis. | |
DATA::DATA_TYPE | data_type () const |
data type getter | |
void | add_association (DATA::DATA_TYPE type, const std::vector< unsigned short > ass) |
Adder for a set of association. | |
size_t | size_association (DATA::DATA_TYPE type) const |
Getter for # of associations. | |
const std::vector< unsigned short > | association (DATA::DATA_TYPE type, size_t index=0) const |
Getter of an association. | |
Protected Attributes | |
Int_t | fID |
track's ID | |
std::vector< TVector3 > | fXYZ |
position of points along the track | |
std::vector< TVector3 > | fDir |
direction at each point along the track | |
std::vector< TMatrixD > | fCov |
covariance matrix of positions possibly only end points are stored | |
std::vector< std::vector < Double_t > > | fdQdx |
charge deposition per unit length at points along track outer vector index is over view | |
std::vector< Double_t > | fFitMomentum |
momentum at start and end of track determined from a fit. | |
DATA::DATA_TYPE | _type |
DATA_TYPE. | |
std::map < larlight::DATA::DATA_TYPE, std::vector< std::vector < unsigned short > > > | _ass |
Association storage ... allow multiple set of associations. |
LArSoft Track class equivalent data container.
Definition at line 27 of file track.hh.
larlight::track::track | ( | DATA::DATA_TYPE | type = DATA::Track |
) |
Default constructor.
Definition at line 9 of file track.cc.
References larlight::data_base::_type, larlight::DATA::Bezier, clear_data(), larlight::DATA::DATA_TREE_NAME, larlight::MSG::ERROR, larlight::DATA::Kalman3DHit, larlight::DATA::Kalman3DSPS, larlight::Message::send(), and larlight::DATA::Track.
00009 : data_base(type), 00010 fXYZ(), 00011 fDir(), 00012 fCov(), 00013 fdQdx(), 00014 fFitMomentum() 00015 //################################################### 00016 { 00017 if( _type != DATA::Track && 00018 _type != DATA::Bezier && 00019 _type != DATA::Kalman3DSPS && 00020 _type != DATA::Kalman3DHit ) { 00021 00022 Message::send(MSG::ERROR,__FUNCTION__, 00023 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str())); 00024 _type = DATA::Track; 00025 00026 } 00027 00028 clear_data(); 00029 }
larlight::track::track | ( | const track & | original | ) |
Copy constructor.
virtual larlight::track::~track | ( | ) | [inline, virtual] |
void larlight::data_base::add_association | ( | DATA::DATA_TYPE | type, | |
const std::vector< unsigned short > | ass | |||
) | [inherited] |
Adder for a set of association.
Definition at line 9 of file data_base.cc.
References larlight::data_base::_ass.
void larlight::track::add_covariance | ( | const TMatrixD | m | ) | [inline] |
void larlight::track::add_direction | ( | const TVector3 | v | ) | [inline] |
void larlight::track::add_momentum | ( | const Double_t | v | ) | [inline] |
Definition at line 54 of file track.hh.
References fFitMomentum.
Referenced by main().
00054 { fFitMomentum.push_back(v); }
void larlight::track::add_vertex | ( | const TVector3 | v | ) | [inline] |
const std::vector< unsigned short > larlight::data_base::association | ( | DATA::DATA_TYPE | type, | |
size_t | index = 0 | |||
) | const [inherited] |
Getter of an association.
Definition at line 35 of file data_base.cc.
References larlight::DATA::DATA_TREE_NAME, larlight::MSG::ERROR, and larlight::Message::send().
00037 { 00038 00039 size_t ass_length = size_association(type); 00040 00041 if( !(ass_length) ) { 00042 00043 Message::send(MSG::ERROR,__FUNCTION__, 00044 Form("There is no association to %s",DATA::DATA_TREE_NAME[type].c_str())); 00045 00046 return std::vector<unsigned short>(); 00047 00048 } 00049 00050 if( ass_length <= index ) { 00051 00052 Message::send(MSG::ERROR,__FUNCTION__, 00053 Form("There are only %zu associations. No association @ index=%zu",ass_length,index)); 00054 00055 return std::vector<unsigned short>(); 00056 00057 } 00058 00059 return ((_ass.find(type))->second).at(index); 00060 }
void larlight::track::clear_data | ( | ) | [virtual] |
Clear method.
Reimplemented from larlight::data_base.
Definition at line 44 of file track.cc.
References fCov, fDir, fdQdx, fFitMomentum, fID, and fXYZ.
Referenced by track().
00046 { 00047 data_base::clear_data(); 00048 fID = -1; 00049 fXYZ.clear(); 00050 fDir.clear(); 00051 fCov.clear(); 00052 fdQdx.clear(); 00053 fFitMomentum.clear(); 00054 }
const TMatrixD& larlight::track::covariance_at | ( | UInt_t | p | ) | const [inline] |
DATA::DATA_TYPE larlight::data_base::data_type | ( | ) | const [inline, inherited] |
data type getter
Reimplemented in larlight::event_base.
Definition at line 48 of file data_base.hh.
References larlight::data_base::_type.
00048 {return _type; }
const TVector3& larlight::track::direction_at | ( | UInt_t | p | ) | const [inline] |
void larlight::track::get_axis_range | ( | Double_t & | xmax, | |
Double_t & | xmin, | |||
Double_t & | ymax, | |||
Double_t & | ymin, | |||
Double_t & | zmax, | |||
Double_t & | zmin | |||
) | const |
A utility function to obtain maximum & minimum of spacepoints' vertex along all axis.
NOTE: the initial max/min values matter. It only modifies max/min if it finds values that is above/below those initial values.
Definition at line 81 of file track.cc.
00085 { 00086 00087 for(size_t i=0; i<fXYZ.size(); ++i) { 00088 00089 if(fXYZ[i][0] > xmax) xmax = fXYZ[i][0]; 00090 if(fXYZ[i][0] < xmin) xmin = fXYZ[i][0]; 00091 if(fXYZ[i][1] > ymax) ymax = fXYZ[i][1]; 00092 if(fXYZ[i][1] < ymin) ymin = fXYZ[i][1]; 00093 if(fXYZ[i][2] > zmax) zmax = fXYZ[i][2]; 00094 if(fXYZ[i][2] < zmin) zmin = fXYZ[i][2]; 00095 00096 } 00097 00098 return; 00099 }
void larlight::track::get_axis_range | ( | Double_t & | max, | |
Double_t & | min, | |||
const Int_t | axis | |||
) | const |
A utility function to obtain maximum & minimum of spacepoints' vertex along the specified axis.
NOTE: the initial max/min values matter. It only modifies max/min if it finds values that is above/below those initial values.
Definition at line 57 of file track.cc.
References larlight::MSG::ERROR, larlight::Message::get(), and larlight::Message::send().
00059 { 00060 00061 if(axis < 0 || axis>2) { 00062 00063 Message::get()->send(MSG::ERROR,__FUNCTION__,Form("Invalid axis index: %d",axis)); 00064 00065 return; 00066 00067 } 00068 00069 for(size_t i=0; i<fXYZ.size(); ++i) { 00070 00071 if(fXYZ[i][axis] > max) max = fXYZ[i][axis]; 00072 00073 if(fXYZ[i][axis] < min) min = fXYZ[i][axis]; 00074 00075 } 00076 00077 return; 00078 }
Double_t larlight::track::momentum_at | ( | UInt_t | p | ) | const [inline] |
Definition at line 48 of file track.hh.
References fFitMomentum.
00048 { return fFitMomentum.at(p); }
size_t larlight::track::n_covariance | ( | ) | const [inline] |
size_t larlight::track::n_dQdx | ( | ) | const [inline] |
size_t larlight::track::n_momentum | ( | ) | const [inline] |
Definition at line 43 of file track.hh.
References fFitMomentum.
00043 { return fFitMomentum.size(); }
size_t larlight::track::n_point | ( | ) | const [inline] |
void larlight::track::set_track_id | ( | const Int_t | id | ) | [inline] |
size_t larlight::data_base::size_association | ( | DATA::DATA_TYPE | type | ) | const [inherited] |
Getter for # of associations.
Definition at line 23 of file data_base.cc.
Referenced by larlight::cluster::get_hit_type().
Int_t larlight::track::track_id | ( | ) | const [inline] |
const TVector3& larlight::track::vertex_at | ( | UInt_t | p | ) | const [inline] |
std::map<larlight::DATA::DATA_TYPE,std::vector<std::vector<unsigned short> > > larlight::data_base::_ass [protected, inherited] |
Association storage ... allow multiple set of associations.
Definition at line 65 of file data_base.hh.
Referenced by larlight::data_base::add_association(), and larlight::data_base::clear_data().
DATA::DATA_TYPE larlight::data_base::_type [protected, inherited] |
DATA_TYPE.
Definition at line 62 of file data_base.hh.
Referenced by larlight::calorimetry::calorimetry(), larlight::cluster::cluster(), larlight::data_base::data_base(), larlight::event_base::data_type(), larlight::data_base::data_type(), larlight::endpoint2d::endpoint2d(), larlight::event_calorimetry::event_calorimetry(), larlight::event_cluster::event_cluster(), larlight::event_endpoint2d::event_endpoint2d(), larlight::event_fifo::event_fifo(), larlight::event_hit::event_hit(), larlight::event_mcpart::event_mcpart(), larlight::event_mcshower::event_mcshower(), larlight::event_mctruth::event_mctruth(), larlight::event_pulse::event_pulse(), larlight::event_shower::event_shower(), larlight::event_simch::event_simch(), larlight::event_sps::event_sps(), larlight::event_track::event_track(), larlight::event_user::event_user(), larlight::event_vertex::event_vertex(), larlight::event_wire::event_wire(), larlight::fifo::fifo(), larlight::hit::hit(), larlight::mcnu::mcnu(), larlight::mcpart::mcpart(), larlight::mcshower::mcshower(), larlight::mctrajectory::mctrajectory(), larlight::mctruth::mctruth(), larlight::pmtfifo::pmtfifo(), larlight::pulse::pulse(), larlight::fifo::readout_sample_number_16MHz(), larlight::fifo::readout_sample_number_2MHz(), larlight::fifo::readout_sample_number_64MHz(), larlight::shower::shower(), larlight::simch::simch(), larlight::spacepoint::spacepoint(), larlight::tpcfifo::tpcfifo(), track(), larlight::trigger::trigger(), larlight::user_info::user_info(), larlight::vertex::vertex(), and larlight::wire::wire().
std::vector<TMatrixD> larlight::track::fCov [protected] |
covariance matrix of positions possibly only end points are stored
Definition at line 91 of file track.hh.
Referenced by add_covariance(), clear_data(), covariance_at(), and n_covariance().
std::vector<TVector3> larlight::track::fDir [protected] |
direction at each point along the track
Definition at line 85 of file track.hh.
Referenced by add_direction(), clear_data(), direction_at(), and n_point().
std::vector< std::vector <Double_t> > larlight::track::fdQdx [protected] |
charge deposition per unit length at points along track outer vector index is over view
Definition at line 97 of file track.hh.
Referenced by clear_data(), and n_dQdx().
std::vector<Double_t> larlight::track::fFitMomentum [protected] |
momentum at start and end of track determined from a fit.
Intermediate points can be added if desired
Definition at line 104 of file track.hh.
Referenced by add_momentum(), clear_data(), momentum_at(), and n_momentum().
Int_t larlight::track::fID [protected] |
track's ID
Definition at line 79 of file track.hh.
Referenced by clear_data(), set_track_id(), and track_id().
std::vector<TVector3> larlight::track::fXYZ [protected] |
position of points along the track
Definition at line 82 of file track.hh.
Referenced by add_vertex(), clear_data(), and vertex_at().