larlight::mcpart Class Reference

LArSoft Mcpart data container. More...

#include <mcpart.hh>

Inheritance diagram for larlight::mcpart:
larlight::data_base

List of all members.

Public Member Functions

 mcpart (DATA::DATA_TYPE type=DATA::MCParticle)
 Default constructor.
 mcpart (const Int_t trackId, const Int_t pdgid, const std::string process, const Int_t mother=DATA::INVALID_INT, const Double_t mass=DATA::INVALID_DOUBLE, const Int_t status=DATA::INVALID_INT)
 Alternative constructor.
 mcpart (const mcpart &origin)
 Copy constructor.
virtual ~mcpart ()
 Default destructor.
virtual void clear_data ()
 --- Utility ---///
void AddDaughter (const int trackID)
 --- Setters ---///
void SetPolarization (TVector3 const &p)
void SetRescatter (Int_t code)
void SetWeight (Double_t wt)
void SetTrajectory (const mctrajectory steps)
void AddTrajectory (const mcstep step)
void AddTrajectory (const TLorentzVector &position, const TLorentzVector &momentum)
void AddFiducialTrack (size_t start, size_t end)
void AddFiducialTrack (const std::pair< size_t, size_t > &step)
Int_t StatusCode () const
 --- Getters ---///
Int_t TrackId () const
Int_t PdgCode () const
Int_t Mother () const
const std::string Process () const
const mctrajectoryTrajectory () const
Double_t Mass () const
const TVector3 & Polarization () const
const std::set< Int_t > & Daughters () const
Double_t Weight () const
TLorentzVector GetGvtx () const
Int_t Rescatter () const
const std::vector< std::pair
< size_t, size_t > > & 
FiducialTrack () 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

Int_t fstatus
 Status code from generator, geant, etc.
Int_t ftrackId
 TrackId.
Int_t fpdgCode
 PDG code.
Int_t fmother
 Mother.
std::string fprocess
 Detector-simulation physics process that created the particle.
mctrajectory ftrajectory
 particle trajectory (position,momentum)
Double_t fmass
 Mass; from PDG unless overridden Should be in GeV.
TVector3 fpolarization
 Polarization.
std::set< Int_t > fdaughters
 Sorted list of daughters of this particle.
Double_t fWeight
 Assigned weight to this particle for MC tests.
TLorentzVector fGvtx
 Vertex needed by generater (genie) to rebuild. genie::EventRecord for event reweighting.
Int_t frescatter
 rescatter code
std::vector< std::pair< size_t,
size_t > > 
ftrackFiducial
 mctrajectory indexes for a trajectory inside fiducial volume

Detailed Description

LArSoft Mcpart data container.

Definition at line 25 of file mcpart.hh.


Constructor & Destructor Documentation

larlight::mcpart::mcpart ( DATA::DATA_TYPE  type = DATA::MCParticle  ) 

Default constructor.

Definition at line 8 of file mcpart.cc.

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

00008                                    : data_base(type), 
00009                      ftrajectory(DATA::MCTrajectory),
00010                      fpolarization(),
00011                      fdaughters(),
00012                      fGvtx(),
00013                      ftrackFiducial()
00014   {
00015     if(_type!=DATA::MCParticle) {
00016 
00017       Message::send(MSG::ERROR,__FUNCTION__,
00018             Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00019 
00020       _type=DATA::MCParticle;
00021     }
00022 
00023     clear_data();
00024 
00025   }

larlight::mcpart::mcpart ( const Int_t  trackId,
const Int_t  pdgid,
const std::string  process,
const Int_t  mother = DATA::INVALID_INT,
const Double_t  mass = DATA::INVALID_DOUBLE,
const Int_t  status = DATA::INVALID_INT 
)

Alternative constructor.

Definition at line 28 of file mcpart.cc.

References clear_data(), fmass, fmother, fpdgCode, fprocess, fstatus, and ftrackId.

00034     : data_base(DATA::MCParticle), 
00035       ftrajectory(DATA::MCTrajectory),
00036       fpolarization(),
00037       fdaughters(),
00038       fGvtx(),
00039       ftrackFiducial()
00040   //********************************************
00041   {
00042     clear_data();
00043     ftrackId = trackId;
00044     fpdgCode = pdgid;
00045     fprocess = process;
00046     fmother  = mother;
00047     fmass    = mass;
00048     fstatus  = status;
00049   }

larlight::mcpart::mcpart ( const mcpart origin  )  [inline]

Copy constructor.

Definition at line 41 of file mcpart.hh.

00041                                  : data_base(origin),
00042                    fstatus(origin.fstatus),
00043                    ftrackId(origin.ftrackId),
00044                    fpdgCode(origin.fpdgCode),
00045                    fmother(origin.fmother),
00046                    fprocess(origin.fprocess),
00047                    ftrajectory(origin.ftrajectory),
00048                    fmass(origin.fmass),
00049                    fpolarization(origin.fpolarization),
00050                    fdaughters(origin.fdaughters),
00051                    fWeight(origin.fWeight),
00052                    fGvtx(origin.fGvtx),
00053                    frescatter(origin.frescatter),
00054                    ftrackFiducial(origin.ftrackFiducial)
00055     {}

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

Default destructor.

Definition at line 58 of file mcpart.hh.

00058 {}


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   }

void larlight::mcpart::AddDaughter ( const int  trackID  )  [inline]

--- Setters ---///

Definition at line 65 of file mcpart.hh.

References fdaughters.

00065 { fdaughters.insert(trackID);  }

void larlight::mcpart::AddFiducialTrack ( const std::pair< size_t, size_t > &  step  )  [inline]

Definition at line 78 of file mcpart.hh.

References ftrackFiducial.

00079     { ftrackFiducial.push_back(step); }

void larlight::mcpart::AddFiducialTrack ( size_t  start,
size_t  end 
) [inline]

Definition at line 75 of file mcpart.hh.

References ftrackFiducial.

00076     { ftrackFiducial.push_back(std::pair<size_t,size_t>(start,end)); }

void larlight::mcpart::AddTrajectory ( const TLorentzVector &  position,
const TLorentzVector &  momentum 
) [inline]

Definition at line 71 of file mcpart.hh.

References ftrajectory, and larlight::mctrajectory::push_back().

00073     { ftrajectory.push_back(position,momentum); }

void larlight::mcpart::AddTrajectory ( const mcstep  step  )  [inline]

Definition at line 70 of file mcpart.hh.

References ftrajectory, and larlight::mctrajectory::push_back().

00070 { ftrajectory.push_back(step); }

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::mcpart::clear_data (  )  [virtual]
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 std::set<Int_t>& larlight::mcpart::Daughters (  )  const [inline]

Definition at line 91 of file mcpart.hh.

References fdaughters.

00091 { return fdaughters;    } 

const std::vector<std::pair<size_t,size_t> >& larlight::mcpart::FiducialTrack (  )  const [inline]

Definition at line 96 of file mcpart.hh.

References ftrackFiducial.

00097     {return ftrackFiducial;}

TLorentzVector larlight::mcpart::GetGvtx (  )  const [inline]

Definition at line 93 of file mcpart.hh.

References fGvtx.

00093 { return fGvtx;         }

Double_t larlight::mcpart::Mass (  )  const [inline]

Definition at line 89 of file mcpart.hh.

References fmass.

00089 { return fmass;         }

Int_t larlight::mcpart::Mother (  )  const [inline]

Definition at line 86 of file mcpart.hh.

References fmother.

00086 { return fmother;       }

Int_t larlight::mcpart::PdgCode (  )  const [inline]

Definition at line 85 of file mcpart.hh.

References fpdgCode.

Referenced by larlight::mctruth::SetNeutrino().

00085 { return fpdgCode;      }

const TVector3& larlight::mcpart::Polarization (  )  const [inline]

Definition at line 90 of file mcpart.hh.

References fpolarization.

00090 { return fpolarization; }

const std::string larlight::mcpart::Process (  )  const [inline]

Definition at line 87 of file mcpart.hh.

References fprocess.

00087 { return fprocess;      }

Int_t larlight::mcpart::Rescatter (  )  const [inline]

Definition at line 94 of file mcpart.hh.

References frescatter.

00094 { return frescatter;    }

void larlight::mcpart::SetPolarization ( TVector3 const &  p  )  [inline]

Definition at line 66 of file mcpart.hh.

References fpolarization.

00066 { fpolarization = p;           }

void larlight::mcpart::SetRescatter ( Int_t  code  )  [inline]

Definition at line 67 of file mcpart.hh.

References frescatter.

00067 { frescatter    = code;        }

void larlight::mcpart::SetTrajectory ( const mctrajectory  steps  )  [inline]

Definition at line 69 of file mcpart.hh.

References ftrajectory.

00069 { ftrajectory   = steps;       }

void larlight::mcpart::SetWeight ( Double_t  wt  )  [inline]

Definition at line 68 of file mcpart.hh.

References fWeight.

00068 { fWeight       = wt;          }

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   }

Int_t larlight::mcpart::StatusCode (  )  const [inline]

--- Getters ---///

Definition at line 83 of file mcpart.hh.

References fstatus.

00083 { return fstatus;       }

Int_t larlight::mcpart::TrackId (  )  const [inline]

Definition at line 84 of file mcpart.hh.

References ftrackId.

Referenced by larlight::mctruth::SetNeutrino().

00084 { return ftrackId;      }

const mctrajectory& larlight::mcpart::Trajectory (  )  const [inline]

Definition at line 88 of file mcpart.hh.

References ftrajectory.

00088 { return ftrajectory;   }

Double_t larlight::mcpart::Weight (  )  const [inline]

Definition at line 92 of file mcpart.hh.

References fWeight.

00092 { return fWeight;       }


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

std::set<Int_t> larlight::mcpart::fdaughters [private]

Sorted list of daughters of this particle.

Definition at line 109 of file mcpart.hh.

Referenced by AddDaughter(), clear_data(), and Daughters().

TLorentzVector larlight::mcpart::fGvtx [private]

Vertex needed by generater (genie) to rebuild. genie::EventRecord for event reweighting.

Definition at line 111 of file mcpart.hh.

Referenced by clear_data(), and GetGvtx().

Double_t larlight::mcpart::fmass [private]

Mass; from PDG unless overridden Should be in GeV.

Definition at line 107 of file mcpart.hh.

Referenced by clear_data(), Mass(), and mcpart().

Int_t larlight::mcpart::fmother [private]

Mother.

Definition at line 104 of file mcpart.hh.

Referenced by clear_data(), mcpart(), and Mother().

Int_t larlight::mcpart::fpdgCode [private]

PDG code.

Definition at line 103 of file mcpart.hh.

Referenced by clear_data(), mcpart(), and PdgCode().

TVector3 larlight::mcpart::fpolarization [private]

Polarization.

Definition at line 108 of file mcpart.hh.

Referenced by clear_data(), Polarization(), and SetPolarization().

std::string larlight::mcpart::fprocess [private]

Detector-simulation physics process that created the particle.

Definition at line 105 of file mcpart.hh.

Referenced by clear_data(), mcpart(), and Process().

rescatter code

Definition at line 112 of file mcpart.hh.

Referenced by Rescatter(), and SetRescatter().

Int_t larlight::mcpart::fstatus [private]

Status code from generator, geant, etc.

Definition at line 101 of file mcpart.hh.

Referenced by clear_data(), mcpart(), and StatusCode().

std::vector<std::pair<size_t,size_t> > larlight::mcpart::ftrackFiducial [private]

mctrajectory indexes for a trajectory inside fiducial volume

Definition at line 114 of file mcpart.hh.

Referenced by AddFiducialTrack(), clear_data(), and FiducialTrack().

Int_t larlight::mcpart::ftrackId [private]

TrackId.

Definition at line 102 of file mcpart.hh.

Referenced by clear_data(), mcpart(), and TrackId().

particle trajectory (position,momentum)

Definition at line 106 of file mcpart.hh.

Referenced by AddTrajectory(), clear_data(), SetTrajectory(), and Trajectory().

Double_t larlight::mcpart::fWeight [private]

Assigned weight to this particle for MC tests.

Definition at line 110 of file mcpart.hh.

Referenced by clear_data(), SetWeight(), and Weight().


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