larlight::mcnu Class Reference

Simplified version of MCParticle data container. More...

#include <mcnu.hh>

Inheritance diagram for larlight::mcnu:
larlight::data_base

List of all members.

Public Member Functions

 mcnu (DATA::DATA_TYPE type=DATA::MCNeutrino)
 Default constructor.
 mcnu (mcpart &nu, mcpart &lep, 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)
 Alternative constructor.
virtual ~mcnu ()
 Default destructor.
 mcnu (const mcnu &origin)
 Copy constructor.
virtual void clear_data ()
 Clear method.
const mcpartNu () const
 --- Getters ---///
const mcpartLepton () const
Int_t CCNC () const
Int_t Mode () const
Int_t InteractionType () const
Int_t Target () const
Int_t HitNuc () const
Int_t HitQuark () const
Double_t W () const
Double_t X () const
Double_t Y () const
Double_t QSqr () 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

mcpart fNu
 the incoming neutrino
mcpart fLepton
 the outgoing lepton
Int_t fMode
 Interaction mode (QE/1-pi/DIS...) see enum list.
Int_t fInteractionType
 More detailed interaction type, see enum list below kNuanceOffset.
Int_t fCCNC
 CC or NC interaction? see enum list.
Int_t fTarget
 Nuclear target, as PDG code.
Int_t fHitNuc
 Hit nucleon (2212 (proton) or 2112 (neutron)).
Int_t fHitQuark
 For DIS events only, as PDG code.
Double_t fW
 Hadronic invariant mass, in GeV.
Double_t fX
 Bjorken x=Q^2/(2M*(E_neutrino-E_lepton)), unitless.
Double_t fY
 Inelasticity y=1-(E_lepton/E_neutrino), unitless.
Double_t fQSqr
 Momentum transfer Q^2, in GeV^2.

Detailed Description

Simplified version of MCParticle data container.

Definition at line 25 of file mcnu.hh.


Constructor & Destructor Documentation

larlight::mcnu::mcnu ( DATA::DATA_TYPE  type = DATA::MCNeutrino  ) 

Default constructor.

Definition at line 9 of file mcnu.cc.

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

00009                                 : data_base(type),
00010                       fNu(DATA::MCParticle), 
00011                       fLepton(DATA::MCParticle)
00012   //***********************************************************
00013   {
00014     if(_type!=DATA::MCNeutrino) {
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::MCNeutrino;
00020     }
00021 
00022     clear_data();
00023   }

larlight::mcnu::mcnu ( mcpart nu,
mcpart lep,
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 
)

Alternative constructor.

Definition at line 26 of file mcnu.cc.

00030     : data_base(DATA::MCNeutrino),
00031       fNu(nu),
00032       fLepton(lep),
00033       fMode(mode),
00034       fInteractionType(interactionType),
00035       fCCNC(CCNC),
00036       fTarget(target),
00037       fHitNuc(nucleon),
00038       fHitQuark(quark),
00039       fW(w),
00040       fX(x),
00041       fY(y),
00042       fQSqr(qsqr)
00043   //***********************************************************
00044   {}

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

Default destructor.

Definition at line 47 of file mcnu.hh.

00047 {}

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

Copy constructor.

Definition at line 50 of file mcnu.hh.

00050                              : data_base(origin),
00051                    fNu(origin.fNu),
00052                    fLepton(origin.fLepton),
00053                    fMode(origin.fMode),
00054                    fInteractionType(origin.fInteractionType),
00055                    fCCNC(origin.fCCNC),
00056                    fTarget(origin.fTarget),
00057                    fHitNuc(origin.fHitNuc),
00058                    fHitQuark(origin.fHitQuark),
00059                    fW(origin.fW),
00060                    fX(origin.fX),
00061                    fY(origin.fY),
00062                    fQSqr(origin.fQSqr)
00063     {}


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   }

Int_t larlight::mcnu::CCNC (  )  const [inline]

Definition at line 71 of file mcnu.hh.

References fCCNC.

00071 { return fCCNC;            }

void larlight::mcnu::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; }

Int_t larlight::mcnu::HitNuc (  )  const [inline]

Definition at line 75 of file mcnu.hh.

References fHitNuc.

00075 { return fHitNuc;          }

Int_t larlight::mcnu::HitQuark (  )  const [inline]

Definition at line 76 of file mcnu.hh.

References fHitQuark.

00076 { return fHitQuark;        }

Int_t larlight::mcnu::InteractionType (  )  const [inline]

Definition at line 73 of file mcnu.hh.

References fInteractionType.

00073 { return fInteractionType; }

const mcpart& larlight::mcnu::Lepton (  )  const [inline]

Definition at line 70 of file mcnu.hh.

References fLepton.

00070 { return fLepton;          }

Int_t larlight::mcnu::Mode (  )  const [inline]

Definition at line 72 of file mcnu.hh.

References fMode.

00072 { return fMode;            }

const mcpart& larlight::mcnu::Nu (  )  const [inline]

--- Getters ---///

Definition at line 69 of file mcnu.hh.

References fNu.

00069 { return fNu;              }

Double_t larlight::mcnu::QSqr (  )  const [inline]

Definition at line 80 of file mcnu.hh.

References fQSqr.

00080 { return fQSqr;            }

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::mcnu::Target (  )  const [inline]

Definition at line 74 of file mcnu.hh.

References fTarget.

00074 { return fTarget;          }

Double_t larlight::mcnu::W (  )  const [inline]

Definition at line 77 of file mcnu.hh.

References fW.

00077 { return fW;               }

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

Definition at line 78 of file mcnu.hh.

References fX.

00078 { return fX;               }

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

Definition at line 79 of file mcnu.hh.

References fY.

00079 { return fY;               }


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

Int_t larlight::mcnu::fCCNC [private]

CC or NC interaction? see enum list.

Definition at line 88 of file mcnu.hh.

Referenced by CCNC(), and clear_data().

Int_t larlight::mcnu::fHitNuc [private]

Hit nucleon (2212 (proton) or 2112 (neutron)).

Definition at line 90 of file mcnu.hh.

Referenced by clear_data(), and HitNuc().

Int_t larlight::mcnu::fHitQuark [private]

For DIS events only, as PDG code.

Definition at line 91 of file mcnu.hh.

Referenced by clear_data(), and HitQuark().

More detailed interaction type, see enum list below kNuanceOffset.

Definition at line 87 of file mcnu.hh.

Referenced by clear_data(), and InteractionType().

the outgoing lepton

Definition at line 85 of file mcnu.hh.

Referenced by clear_data(), and Lepton().

Int_t larlight::mcnu::fMode [private]

Interaction mode (QE/1-pi/DIS...) see enum list.

Definition at line 86 of file mcnu.hh.

Referenced by clear_data(), and Mode().

the incoming neutrino

Definition at line 84 of file mcnu.hh.

Referenced by clear_data(), and Nu().

Double_t larlight::mcnu::fQSqr [private]

Momentum transfer Q^2, in GeV^2.

Definition at line 95 of file mcnu.hh.

Referenced by clear_data(), and QSqr().

Int_t larlight::mcnu::fTarget [private]

Nuclear target, as PDG code.

Definition at line 89 of file mcnu.hh.

Referenced by clear_data(), and Target().

Double_t larlight::mcnu::fW [private]

Hadronic invariant mass, in GeV.

Definition at line 92 of file mcnu.hh.

Referenced by clear_data(), and W().

Double_t larlight::mcnu::fX [private]

Bjorken x=Q^2/(2M*(E_neutrino-E_lepton)), unitless.

Definition at line 93 of file mcnu.hh.

Referenced by clear_data(), and X().

Double_t larlight::mcnu::fY [private]

Inelasticity y=1-(E_lepton/E_neutrino), unitless.

Definition at line 94 of file mcnu.hh.

Referenced by clear_data(), and Y().


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