larlight::vertex Class Reference

LArSoft Vertex class equivalent data container. More...

#include <vertex.hh>

Inheritance diagram for larlight::vertex:
larlight::data_base

List of all members.

Public Member Functions

 vertex (DATA::DATA_TYPE type=DATA::Vertex)
 Default constructor.
 vertex (Double_t *xyz, Int_t id=DATA::INVALID_INT, DATA::DATA_TYPE type=DATA::Vertex)
 Alternative constructor.
 vertex (const vertex &original)
 Copy constructor.
virtual ~vertex ()
 Default destructor.
virtual void clear_data ()
 Clear method.
void XYZ (Double_t *xyz) const
 --- Getters ---///
Int_t ID () const
Double_t X () const
Double_t Y () const
Double_t Z () const
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

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.

Private Attributes

Double_t fXYZ [3]
 location of vertex
Int_t fID
 id number for vertex

Detailed Description

LArSoft Vertex class equivalent data container.

Definition at line 25 of file vertex.hh.


Constructor & Destructor Documentation

larlight::vertex::vertex ( DATA::DATA_TYPE  type = DATA::Vertex  ) 

Default constructor.

Definition at line 13 of file vertex.cc.

References larlight::data_base::_type, clear_data(), larlight::DATA::DATA_TREE_NAME, larlight::MSG::ERROR, larlight::DATA::FeatureVertex, larlight::DATA::HarrisVertex, larlight::Message::send(), and larlight::DATA::Vertex.

00013                                    : data_base(type)
00014   //************************************************************
00015   {
00016     if(_type!=DATA::Vertex &&
00017        _type!=DATA::FeatureVertex &&
00018        _type!=DATA::HarrisVertex) {
00019       
00020       Message::send(MSG::ERROR,__FUNCTION__,
00021             Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00022       _type=DATA::Vertex;
00023     }
00024     
00025     clear_data();
00026     
00027   }

larlight::vertex::vertex ( Double_t *  xyz,
Int_t  id = DATA::INVALID_INT,
DATA::DATA_TYPE  type = DATA::Vertex 
)

Alternative constructor.

Definition at line 30 of file vertex.cc.

References larlight::data_base::_type, larlight::DATA::DATA_TREE_NAME, larlight::MSG::ERROR, larlight::DATA::FeatureVertex, fXYZ, larlight::DATA::HarrisVertex, larlight::Message::send(), and larlight::DATA::Vertex.

00033     : data_base(type),
00034       fID(id)
00035   //************************************************************
00036   {
00037     if(_type!=DATA::Vertex &&
00038        _type!=DATA::FeatureVertex &&
00039        _type!=DATA::HarrisVertex) {
00040       
00041       Message::send(MSG::ERROR,__FUNCTION__,
00042             Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00043       _type=DATA::Vertex;
00044     }
00045 
00046     fXYZ[0] = xyz[0];
00047     fXYZ[1] = xyz[1];
00048     fXYZ[2] = xyz[2];
00049   }

larlight::vertex::vertex ( const vertex original  )  [inline]

Copy constructor.

Definition at line 38 of file vertex.hh.

References fXYZ, and XYZ().

00038                                    : data_base(original),
00039                      fID(original.fID)
00040     {original.XYZ(fXYZ);}

virtual larlight::vertex::~vertex (  )  [inline, virtual]

Default destructor.

Definition at line 43 of file vertex.hh.

00043 {}


Member Function Documentation

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.

00011   {
00012 
00013     if( _ass.find(type) == _ass.end() )
00014       
00015       _ass[type]=std::vector<std::vector<unsigned short> >();
00016     
00017     _ass[type].push_back(ass);
00018     
00019     
00020   }

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::vertex::clear_data (  )  [virtual]

Clear method.

Reimplemented from larlight::data_base.

Definition at line 61 of file vertex.cc.

References fID, fXYZ, larlight::DATA::INVALID_DOUBLE, and larlight::DATA::INVALID_INT.

Referenced by vertex().

00063   {
00064     data_base::clear_data();
00065     fXYZ[0] = DATA::INVALID_DOUBLE;
00066     fXYZ[1] = DATA::INVALID_DOUBLE;
00067     fXYZ[2] = DATA::INVALID_DOUBLE;
00068     fID = DATA::INVALID_INT;
00069   }

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; }

Int_t larlight::vertex::ID (  )  const [inline]

Definition at line 50 of file vertex.hh.

References fID.

00050 { return fID;     }

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().

00025   {
00026     
00027     if( _ass.find(type) == _ass.end() ) return 0;
00028     
00029     return ((_ass.find(type))->second).size();
00030     //return _ass[type].size();
00031     
00032   }

Double_t larlight::vertex::X (  )  const [inline]

Definition at line 51 of file vertex.hh.

References fXYZ.

00051 { return fXYZ[0]; }

void larlight::vertex::XYZ ( Double_t *  xyz  )  const

--- Getters ---///

Definition at line 52 of file vertex.cc.

Referenced by vertex().

00054   {
00055     xyz[0] = fXYZ[0];
00056     xyz[1] = fXYZ[1];
00057     xyz[2] = fXYZ[2];
00058   }

Double_t larlight::vertex::Y (  )  const [inline]

Definition at line 52 of file vertex.hh.

References fXYZ.

00052 { return fXYZ[1]; }

Double_t larlight::vertex::Z (  )  const [inline]

Definition at line 53 of file vertex.hh.

References fXYZ.

00053 { return fXYZ[2]; }


Member Data Documentation

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_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(), larlight::track::track(), larlight::trigger::trigger(), larlight::user_info::user_info(), vertex(), and larlight::wire::wire().

Int_t larlight::vertex::fID [private]

id number for vertex

Definition at line 58 of file vertex.hh.

Referenced by clear_data(), and ID().

Double_t larlight::vertex::fXYZ[3] [private]

location of vertex

Definition at line 57 of file vertex.hh.

Referenced by clear_data(), vertex(), X(), Y(), and Z().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator

Generated on 3 Jun 2014 for MyProject by  doxygen 1.6.1