Simplified version of MCParticle data container. More...
#include <mctruth.hh>
Public Member Functions | |
mctruth (DATA::DATA_TYPE type=DATA::MCTruth) | |
Default constructor. | |
virtual | ~mctruth () |
Default destructor. | |
mctruth (const mctruth &origin) | |
Copy constructor. | |
virtual void | clear_data () |
Clear method. | |
void | Add (mcpart part) |
--- Setters/Adders ---/// | |
void | SetOrigin (MC::Origin_t orig) |
void | SetNeutrino (Int_t CCNC, Int_t mode, Int_t interactionType, Int_t target, Int_t nucleon, Int_t quark, Double_t w, Double_t x, Double_t y, Double_t qsqr) |
const std::vector < larlight::mcpart > & | GetParticles () const |
--- Getters ---/// | |
const mcnu & | GetNeutrino () const |
MC::Origin_t | Origin () const |
Bool_t | NeutrinoSet () 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 | |
std::vector< larlight::mcpart > | fPartList |
list of particles in this event | |
mcnu | fMCNeutrino |
reference to neutrino info - null if not a neutrino | |
MC::Origin_t | fOrigin |
origin for this event | |
Bool_t | fNeutrinoSet |
flag for whether the neutrino information has been set |
Simplified version of MCParticle data container.
Definition at line 25 of file mctruth.hh.
larlight::mctruth::mctruth | ( | DATA::DATA_TYPE | type = DATA::MCTruth |
) |
Default constructor.
Definition at line 9 of file mctruth.cc.
References larlight::data_base::_type, clear_data(), larlight::DATA::DATA_TREE_NAME, larlight::MSG::ERROR, larlight::DATA::MCTruth, and larlight::Message::send().
00009 : data_base(type), 00010 fMCNeutrino(DATA::MCNeutrino) 00011 //******************************************************************** 00012 { 00013 00014 if(_type!=DATA::MCTruth) { 00015 00016 Message::send(MSG::ERROR,__FUNCTION__, 00017 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str())); 00018 00019 _type=DATA::MCTruth; 00020 } 00021 00022 clear_data(); 00023 }
virtual larlight::mctruth::~mctruth | ( | ) | [inline, virtual] |
larlight::mctruth::mctruth | ( | const mctruth & | origin | ) | [inline] |
Copy constructor.
Definition at line 36 of file mctruth.hh.
00036 : data_base(origin), 00037 fPartList(origin.fPartList), 00038 fMCNeutrino(origin.fMCNeutrino), 00039 fOrigin(origin.fOrigin), 00040 fNeutrinoSet(origin.fNeutrinoSet) 00041 {}
void larlight::mctruth::Add | ( | mcpart | part | ) | [inline] |
--- Setters/Adders ---///
Definition at line 47 of file mctruth.hh.
References fPartList.
00047 { fPartList.push_back(part); }
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.
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::mctruth::clear_data | ( | ) | [virtual] |
Clear method.
Reimplemented from larlight::data_base.
Definition at line 26 of file mctruth.cc.
References larlight::mcnu::clear_data(), fMCNeutrino, fNeutrinoSet, fOrigin, fPartList, and larlight::MC::kUnknown.
Referenced by mctruth().
00028 { 00029 data_base::clear_data(); 00030 fPartList.clear(); 00031 fMCNeutrino.clear_data(); 00032 fNeutrinoSet=false; 00033 fOrigin=MC::kUnknown; 00034 }
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 mcnu& larlight::mctruth::GetNeutrino | ( | ) | const [inline] |
const std::vector<larlight::mcpart>& larlight::mctruth::GetParticles | ( | ) | const [inline] |
--- Getters ---///
Definition at line 62 of file mctruth.hh.
References fPartList.
00062 { return fPartList; }
Bool_t larlight::mctruth::NeutrinoSet | ( | ) | const [inline] |
MC::Origin_t larlight::mctruth::Origin | ( | ) | const [inline] |
void larlight::mctruth::SetNeutrino | ( | Int_t | CCNC, | |
Int_t | mode, | |||
Int_t | interactionType, | |||
Int_t | target, | |||
Int_t | nucleon, | |||
Int_t | quark, | |||
Double_t | w, | |||
Double_t | x, | |||
Double_t | y, | |||
Double_t | qsqr | |||
) |
Definition at line 37 of file mctruth.cc.
References larlight::MSG::ERROR, fMCNeutrino, fNeutrinoSet, fPartList, larlight::mcpart::PdgCode(), larlight::Message::send(), and larlight::mcpart::TrackId().
00048 { 00049 00050 if( !fNeutrinoSet ){ 00051 fNeutrinoSet = true; 00052 // loop over the mcpart list and get the outgoing lepton 00053 // assume this is a neutral current interaction to begin with 00054 // which means the outgoing lepton is the incoming neutrino 00055 mcpart nu = fPartList[0]; 00056 mcpart lep = fPartList[0]; 00057 00058 // start at i = 1 because i = 0 is the incoming neutrino 00059 for(unsigned int i = 1; i < fPartList.size(); ++i){ 00060 if(fPartList[i].Mother() == nu.TrackId() && 00061 (fPartList[i].PdgCode() == nu.PdgCode() || 00062 abs(fPartList[i].PdgCode()) == abs(nu.PdgCode())-1) ){ 00063 lep = fPartList[i]; 00064 break; 00065 } 00066 }//done looping over particles 00067 00068 00069 fMCNeutrino = mcnu(nu, lep, 00070 CCNC, mode, interactionType, 00071 target, nucleon, quark, 00072 w, x, y, qsqr); 00073 00074 } // end if mcnu is not already set 00075 00076 else 00077 00078 Message::send(MSG::ERROR,__FUNCTION__,"Attempt to set neutrino when already set"); 00079 00080 return; 00081 00082 }
void larlight::mctruth::SetOrigin | ( | MC::Origin_t | orig | ) | [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().
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(), 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().
mcnu larlight::mctruth::fMCNeutrino [private] |
reference to neutrino info - null if not a neutrino
Definition at line 70 of file mctruth.hh.
Referenced by clear_data(), GetNeutrino(), and SetNeutrino().
Bool_t larlight::mctruth::fNeutrinoSet [private] |
flag for whether the neutrino information has been set
Definition at line 72 of file mctruth.hh.
Referenced by clear_data(), NeutrinoSet(), and SetNeutrino().
MC::Origin_t larlight::mctruth::fOrigin [private] |
origin for this event
Definition at line 71 of file mctruth.hh.
Referenced by clear_data(), Origin(), and SetOrigin().
std::vector<larlight::mcpart> larlight::mctruth::fPartList [private] |
list of particles in this event
Definition at line 69 of file mctruth.hh.
Referenced by Add(), clear_data(), GetParticles(), and SetNeutrino().