larlight::hit Class Reference

LArSoft Hit class equivalent data container. More...

#include <hit.hh>

Inheritance diagram for larlight::hit:
larlight::data_base

List of all members.

Public Member Functions

 hit (DATA::DATA_TYPE type=DATA::Hit)
 Default constructor.
 hit (const hit &original)
 Copy constructor.
virtual ~hit ()
 Default destructor.
void clear_data ()
 Clear method.
void set_waveform (const std::vector< Double_t > &wf)
void set_times (Double_t start, Double_t peak, Double_t end)
void set_times_err (Double_t start, Double_t peak, Double_t end)
void set_charge (Double_t q, Double_t q_max)
void set_charge_err (Double_t q, Double_t q_max)
void set_multiplicity (Int_t m)
void set_channel (UInt_t ch)
void set_wire (UInt_t wire)
void set_fit_goodness (Double_t v)
void set_view (GEO::View_t v)
void set_sigtype (GEO::SigType_t t)
const std::vector< Double_t > & HitSignal () const
Double_t StartTime () const
Double_t EndTime () const
Double_t PeakTime () const
Double_t SigmaStartTime () const
Double_t SigmaEndTime () const
Double_t SigmaPeakTime () const
Int_t Multiplicity () const
UInt_t Channel () const
UInt_t Wire () const
Double_t Charge (bool max=false) const
Double_t SigmaCharge (bool max=false) const
Double_t GoodnessOfFit () const
GEO::SigType_t SignalType () const
GEO::View_t View () 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

std::vector< Double_t > fHitSignal
 vector of ADC values within the hit window
Double_t fStartTime
 initial tdc tick for hit
Double_t fSigmaStartTime
 uncertainty on initial tick
Double_t fPeakTime
 tdc for the peak charge deposition
Double_t fSigmaPeakTime
 uncertainty for tdc of the peak
Double_t fEndTime
 final tdc tick for hit
Double_t fSigmaEndTime
 uncertainty on final tick
Double_t fCharge
 total charge deposited for hit
Double_t fSigmaCharge
 uncertainty in total charge deposited
Double_t fMaxCharge
 maximum ADC value in hit window
Double_t fSigmaMaxCharge
 maximum ADC value in hit window
Int_t fMultiplicity
 how many hits could this one be shared with
Double_t fGoodnessOfFit
 how well do we believe we know this hit?
GEO::View_t fView
 view for the plane of the hit
GEO::SigType_t fSignalType
 signal type for the plane of the hit
UInt_t fChannel
 channel number
UInt_t fWire
 wire number
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.

Detailed Description

LArSoft Hit class equivalent data container.

Definition at line 25 of file hit.hh.


Constructor & Destructor Documentation

larlight::hit::hit ( DATA::DATA_TYPE  type = DATA::Hit  ) 

Default constructor.

Definition at line 9 of file hit.cc.

References larlight::data_base::_type, larlight::DATA::APAHit, clear_data(), larlight::DATA::CrawlerHit, larlight::DATA::DATA_TREE_NAME, larlight::MSG::ERROR, larlight::DATA::FFTHit, larlight::DATA::GausHit, larlight::DATA::Hit, larlight::DATA::RFFHit, and larlight::Message::send().

00009                              : data_base(type), 
00010                    fHitSignal() 
00011   //#################################################
00012   {
00013     if( _type != DATA::Hit &&
00014     _type != DATA::CrawlerHit &&
00015     _type != DATA::GausHit &&
00016     _type != DATA::APAHit &&
00017     _type != DATA::FFTHit &&
00018     _type != DATA::RFFHit ) {
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       
00023       _type = DATA::Hit;
00024     }
00025     clear_data();
00026   }

larlight::hit::hit ( const hit original  ) 

Copy constructor.

Definition at line 29 of file hit.cc.

00029                               : data_base(original),
00030                   fHitSignal(original.fHitSignal),
00031                   fStartTime(original.fStartTime),
00032                   fSigmaStartTime(original.fSigmaStartTime),
00033                   fPeakTime(original.fPeakTime),
00034                   fSigmaPeakTime(original.fSigmaPeakTime),
00035                   fEndTime(original.fEndTime),
00036                   fSigmaEndTime(original.fSigmaEndTime),
00037                   fCharge(original.fCharge),
00038                   fSigmaCharge(original.fSigmaCharge),
00039                   fMaxCharge(original.fMaxCharge),
00040                   fSigmaMaxCharge(original.fSigmaMaxCharge),
00041                   fMultiplicity(original.fMultiplicity),
00042                   fGoodnessOfFit(original.fGoodnessOfFit),
00043                   fView(original.fView),
00044                   fSignalType(original.fSignalType),
00045                                   fChannel(original.fChannel),
00046                                   fWire(original.fWire)
00047   //##########################################################################
00048   {};

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

Default destructor.

Definition at line 36 of file hit.hh.

00036 {}


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   }

UInt_t larlight::hit::Channel (  )  const [inline]

Definition at line 66 of file hit.hh.

References fChannel.

Referenced by larutil::GeometryUtilities::GetPlaneAndTPC().

00066 { return fChannel;        }

Double_t larlight::hit::Charge ( bool  max = false  )  const [inline]

Definition at line 68 of file hit.hh.

References fCharge, and fMaxCharge.

00068 { return ( max ? fMaxCharge : fCharge);}

void larlight::hit::clear_data (  )  [virtual]

Clear method.

Reimplemented from larlight::data_base.

Definition at line 51 of file hit.cc.

References fChannel, fCharge, fEndTime, fGoodnessOfFit, fHitSignal, fMaxCharge, fMultiplicity, fPeakTime, fSigmaCharge, fSigmaEndTime, fSigmaMaxCharge, fSigmaPeakTime, fSigmaStartTime, fSignalType, fStartTime, fView, fWire, larlight::GEO::kMysteryType, and larlight::GEO::kUnknown.

Referenced by hit().

00053   {
00054     data_base::clear_data();
00055     fHitSignal.clear();
00056     fStartTime = fPeakTime = fEndTime = -1;
00057     fSigmaStartTime = fSigmaPeakTime = fSigmaEndTime = -1;
00058     fCharge = fMaxCharge = -1;
00059     fSigmaCharge = fSigmaMaxCharge = -1;
00060     fMultiplicity = -1;
00061     fGoodnessOfFit = -1;
00062     fView = GEO::kUnknown;
00063     fSignalType = GEO::kMysteryType;
00064     fChannel = 0xffffffff;
00065     fWire    = 0xffffffff;
00066   }

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

Double_t larlight::hit::EndTime (  )  const [inline]

Definition at line 60 of file hit.hh.

References fEndTime.

00060 { return fEndTime;        }

Double_t larlight::hit::GoodnessOfFit (  )  const [inline]

Definition at line 70 of file hit.hh.

References fGoodnessOfFit.

00070 { return fGoodnessOfFit;  }

const std::vector<Double_t>& larlight::hit::HitSignal (  )  const [inline]

Definition at line 58 of file hit.hh.

References fHitSignal.

00058 { return fHitSignal;      }  

Int_t larlight::hit::Multiplicity (  )  const [inline]

Definition at line 65 of file hit.hh.

References fMultiplicity.

00065 { return fMultiplicity;   }

Double_t larlight::hit::PeakTime (  )  const [inline]

Definition at line 61 of file hit.hh.

References fPeakTime.

00061 { return fPeakTime;       }

void larlight::hit::set_channel ( UInt_t  ch  )  [inline]

Definition at line 51 of file hit.hh.

References fChannel.

00051 { fChannel=ch;}

void larlight::hit::set_charge ( Double_t  q,
Double_t  q_max 
) [inline]

Definition at line 46 of file hit.hh.

References fCharge, and fMaxCharge.

00047     {fCharge=q; fMaxCharge = q_max;}

void larlight::hit::set_charge_err ( Double_t  q,
Double_t  q_max 
) [inline]

Definition at line 48 of file hit.hh.

References fSigmaCharge, and fSigmaMaxCharge.

00049     {fSigmaCharge=q; fSigmaMaxCharge=q_max;}

void larlight::hit::set_fit_goodness ( Double_t  v  )  [inline]

Definition at line 53 of file hit.hh.

References fGoodnessOfFit.

00053 { fGoodnessOfFit = v;}

void larlight::hit::set_multiplicity ( Int_t  m  )  [inline]

Definition at line 50 of file hit.hh.

References fMultiplicity.

00050 { fMultiplicity=m;}

void larlight::hit::set_sigtype ( GEO::SigType_t  t  )  [inline]

Definition at line 55 of file hit.hh.

References fSignalType.

00055 {fSignalType=t;}

void larlight::hit::set_times ( Double_t  start,
Double_t  peak,
Double_t  end 
) [inline]

Definition at line 42 of file hit.hh.

References fEndTime, fPeakTime, and fStartTime.

00043     {fStartTime = start; fPeakTime = peak; fEndTime = end;}

void larlight::hit::set_times_err ( Double_t  start,
Double_t  peak,
Double_t  end 
) [inline]

Definition at line 44 of file hit.hh.

References fSigmaEndTime, fSigmaPeakTime, and fSigmaStartTime.

00045     {fSigmaStartTime = start; fSigmaPeakTime = peak; fSigmaEndTime = end;}

void larlight::hit::set_view ( GEO::View_t  v  )  [inline]

Definition at line 54 of file hit.hh.

References fView.

00054 { fView = v;}

void larlight::hit::set_waveform ( const std::vector< Double_t > &  wf  )  [inline]

Definition at line 41 of file hit.hh.

References fHitSignal.

00041 { fHitSignal = wf;}

void larlight::hit::set_wire ( UInt_t  wire  )  [inline]

Definition at line 52 of file hit.hh.

References fWire.

00052 { fWire=wire;}

Double_t larlight::hit::SigmaCharge ( bool  max = false  )  const [inline]

Definition at line 69 of file hit.hh.

References fSigmaCharge, and fSigmaMaxCharge.

00069 { return ( max ? fSigmaMaxCharge : fSigmaCharge ); }

Double_t larlight::hit::SigmaEndTime (  )  const [inline]

Definition at line 63 of file hit.hh.

References fSigmaEndTime.

00063 { return fSigmaEndTime;   }

Double_t larlight::hit::SigmaPeakTime (  )  const [inline]

Definition at line 64 of file hit.hh.

References fSigmaPeakTime.

00064 { return fSigmaPeakTime;  }

Double_t larlight::hit::SigmaStartTime (  )  const [inline]

Definition at line 62 of file hit.hh.

References fSigmaStartTime.

00062 { return fSigmaStartTime; }

GEO::SigType_t larlight::hit::SignalType (  )  const [inline]

Definition at line 71 of file hit.hh.

References fSignalType.

00071 { return fSignalType;     }

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::hit::StartTime (  )  const [inline]

Definition at line 59 of file hit.hh.

References fStartTime.

00059 { return fStartTime;      }  

GEO::View_t larlight::hit::View (  )  const [inline]

Definition at line 72 of file hit.hh.

References fView.

00072 { return fView;           }

UInt_t larlight::hit::Wire (  )  const [inline]

Definition at line 67 of file hit.hh.

References fWire.

00067 { return fWire;           }


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

UInt_t larlight::hit::fChannel [protected]

channel number

Definition at line 91 of file hit.hh.

Referenced by Channel(), clear_data(), and set_channel().

Double_t larlight::hit::fCharge [protected]

total charge deposited for hit

Definition at line 83 of file hit.hh.

Referenced by Charge(), clear_data(), and set_charge().

Double_t larlight::hit::fEndTime [protected]

final tdc tick for hit

Definition at line 81 of file hit.hh.

Referenced by clear_data(), EndTime(), and set_times().

Double_t larlight::hit::fGoodnessOfFit [protected]

how well do we believe we know this hit?

Definition at line 88 of file hit.hh.

Referenced by clear_data(), GoodnessOfFit(), and set_fit_goodness().

std::vector<Double_t> larlight::hit::fHitSignal [protected]

vector of ADC values within the hit window

Definition at line 76 of file hit.hh.

Referenced by clear_data(), HitSignal(), and set_waveform().

Double_t larlight::hit::fMaxCharge [protected]

maximum ADC value in hit window

Definition at line 85 of file hit.hh.

Referenced by Charge(), clear_data(), and set_charge().

Int_t larlight::hit::fMultiplicity [protected]

how many hits could this one be shared with

Definition at line 87 of file hit.hh.

Referenced by clear_data(), Multiplicity(), and set_multiplicity().

Double_t larlight::hit::fPeakTime [protected]

tdc for the peak charge deposition

Definition at line 79 of file hit.hh.

Referenced by clear_data(), PeakTime(), and set_times().

Double_t larlight::hit::fSigmaCharge [protected]

uncertainty in total charge deposited

Definition at line 84 of file hit.hh.

Referenced by clear_data(), set_charge_err(), and SigmaCharge().

Double_t larlight::hit::fSigmaEndTime [protected]

uncertainty on final tick

Definition at line 82 of file hit.hh.

Referenced by clear_data(), set_times_err(), and SigmaEndTime().

Double_t larlight::hit::fSigmaMaxCharge [protected]

maximum ADC value in hit window

Definition at line 86 of file hit.hh.

Referenced by clear_data(), set_charge_err(), and SigmaCharge().

Double_t larlight::hit::fSigmaPeakTime [protected]

uncertainty for tdc of the peak

Definition at line 80 of file hit.hh.

Referenced by clear_data(), set_times_err(), and SigmaPeakTime().

Double_t larlight::hit::fSigmaStartTime [protected]

uncertainty on initial tick

Definition at line 78 of file hit.hh.

Referenced by clear_data(), set_times_err(), and SigmaStartTime().

signal type for the plane of the hit

Definition at line 90 of file hit.hh.

Referenced by clear_data(), set_sigtype(), and SignalType().

Double_t larlight::hit::fStartTime [protected]

initial tdc tick for hit

Definition at line 77 of file hit.hh.

Referenced by clear_data(), set_times(), and StartTime().

view for the plane of the hit

Definition at line 89 of file hit.hh.

Referenced by clear_data(), set_view(), and View().

UInt_t larlight::hit::fWire [protected]

wire number

Definition at line 92 of file hit.hh.

Referenced by clear_data(), set_wire(), and Wire().


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