Public Member Functions | Private Member Functions | Private Attributes | List of all members
novaddt::DAQHit Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-04-12/DDTBaseDataProducts/DAQHit.h"

Public Member Functions

 DAQHit ()
 
 DAQHit (daqdataformats::RawMilliSlice *theMilli, daqdataformats::RawNanoSlice *theNano)
 
 DAQHit (novaddt::TDC tdc, novaddt::ADC adc, novaddt::Plane plane)
 
 DAQHit (int detID, daqchannelmap::dchan channel, novaddt::ADC adc, novaddt::TDC tdc)
 
daqchannelmap::dchan const & Chan () const
 
void reset ()
 
void print () const
 
 ~DAQHit ()
 
novaddt::Plane const & Plane () const
 
novaddt::Cell const & Cell () const
 
novaddt::View const & View () const
 
novaddt::ADC const & ADC () const
 
novaddt::TDC const & TDC () const
 
int const & DetID () const
 
novaddt::DCM getDCM () const
 
bool FEBOverflowError () const
 
 operator novaddt::Plane () const
 
 operator novaddt::Cell () const
 
 operator novaddt::View () const
 
 operator novaddt::ADC () const
 
 operator novaddt::TDC () const
 
 operator novaddt::DCM () const
 
bool operator== (const DAQHit &rhs) const
 

Private Member Functions

novaddt::ADC ADC_Extraction (daqdataformats::RawNanoSlice *theNano) const
 

Private Attributes

int _theDetID
 
daqchannelmap::dchan _theChannel
 
novaddt::Plane _thePlane
 
novaddt::Cell _theCell
 
novaddt::View _theView
 
novaddt::ADC _theADC
 
novaddt::TDC _theTDC
 
bool _FEBOverflowError
 

Detailed Description

Definition at line 38 of file DAQHit.h.

Constructor & Destructor Documentation

novaddt::DAQHit::DAQHit ( )

Definition at line 9 of file DAQHit.cxx.

Referenced by DAQHit().

9  :
11  _theChannel(0),
12  _thePlane(0),
13  _theCell(0),
14  _theView(0),
15  _theADC(0),
16  _theTDC(0),
17  _FEBOverflowError(false)
18 {
19 }
novaddt::Plane _thePlane
Definition: DAQHit.h:96
bool _FEBOverflowError
Definition: DAQHit.h:102
int _theDetID
Definition: DAQHit.h:94
novaddt::Cell _theCell
Definition: DAQHit.h:97
novaddt::TDC _theTDC
Definition: DAQHit.h:100
novaddt::View _theView
Definition: DAQHit.h:98
novaddt::ADC _theADC
Definition: DAQHit.h:99
daqchannelmap::dchan _theChannel
Definition: DAQHit.h:95
novaddt::DAQHit::DAQHit ( daqdataformats::RawMilliSlice theMilli,
daqdataformats::RawNanoSlice theNano 
)

Definition at line 24 of file DAQHit.cxx.

References _theADC, _theTDC, ADC_Extraction(), ana::assert(), om::cerr, DAQHit(), allTimeWatchdog::endl, daqdataformats::RawMilliSlice::getFloatingMicroSlice(), daqdataformats::RawMicroSlice::getHighWord(), and novaddt::ADC::val.

25  :
26  _theDetID(theMilli->getHeader()->getDetId()),
27  // encode the DAQ Format Channel (dchan)
28  _theChannel(DAQChannelMap::getInstance(_theDetID)
29  ->encodeDChan(_theDetID,
30  theMilli->getHeader()->getDiblockId(),
31  theMilli->getHeader()->getDCMId(),
32  theNano->getHeader()->getFEBId(),
33  theNano->getHeader()->getPixelAddr())),
34  // getPlane() requires Logical Format Channel (lchan)
35  _thePlane(DAQChannelMap::getInstance(_theDetID)->getPlane
36  (DAQChannelMap::getInstance(_theDetID)->encodeLChan(_theChannel))),
37  // getCell() requires lchan
38  _theCell(DAQChannelMap::getInstance(_theDetID)->getCell
39  (DAQChannelMap::getInstance(_theDetID)->encodeLChan(_theChannel))),
40  // getView() requires dchan
41  _theView(DAQChannelMap::getInstance(_theDetID)->getView(_theChannel)),
42  _theTDC(theNano->getTimeStamp()),
43  _FEBOverflowError(theNano->getHeader()->getOverflowError())
44 {
45  uint64_t time_high = theMilli->getFloatingMicroSlice()->getHighWord();
46 
47  // Combine the high 32 bits with the low 32 bits to
48  // form the 64-bit time:
49  _theTDC = (time_high << 32) | theNano->getTimeStamp();
50 
51  _theADC = ADC_Extraction(theNano);
52 
53  if (_theADC.val > 4096)
54  {
55  std::cerr << "Invalid ADC Value: " << _theADC.val << std::endl;
56  assert(false);
57  }
58 }
novaddt::Plane _thePlane
Definition: DAQHit.h:96
novaddt::ADC ADC_Extraction(daqdataformats::RawNanoSlice *theNano) const
Definition: DAQHit.cxx:96
IMPLEMENT_MAIN_STANDARD IMPLEMENT_MAIN_setBufferSource daqdataformats::RawNanoSliceHeader * getHeader() const
Get the NanoSlice header pointer.
Definition: RawNanoSlice.h:57
bool _FEBOverflowError
Definition: DAQHit.h:102
OStream cerr
Definition: OStream.cxx:7
daqdataformats::RawMicroSlice * getFloatingMicroSlice() const
Definition: RawMilliSlice.h:48
int _theDetID
Definition: DAQHit.h:94
daqdataformats::RawMilliSliceHeader * getHeader() const
Definition: RawMilliSlice.h:47
novaddt::Cell _theCell
Definition: DAQHit.h:97
novaddt::TDC _theTDC
Definition: DAQHit.h:100
novaddt::View _theView
Definition: DAQHit.h:98
novaddt::ADC _theADC
Definition: DAQHit.h:99
assert(nhit_max >=nhit_nbins)
value_type val
Definition: BaseProducts.h:65
uint32_t getHighWord() const
Get method for lower half of timing word.
daqchannelmap::dchan _theChannel
Definition: DAQHit.h:95
novaddt::DAQHit::DAQHit ( novaddt::TDC  tdc,
novaddt::ADC  adc,
novaddt::Plane  plane 
)

Definition at line 61 of file DAQHit.cxx.

References DAQHit().

61  :
63  _theChannel(0),
64  _thePlane(plane),
65  _theCell(0),
66  _theView(0),
67  _theADC(adc),
68  _theTDC(tdc),
69  _FEBOverflowError(false)
70 {
71 }
novaddt::Plane _thePlane
Definition: DAQHit.h:96
bool _FEBOverflowError
Definition: DAQHit.h:102
int _theDetID
Definition: DAQHit.h:94
novaddt::Cell _theCell
Definition: DAQHit.h:97
novaddt::TDC _theTDC
Definition: DAQHit.h:100
novaddt::View _theView
Definition: DAQHit.h:98
novaddt::ADC _theADC
Definition: DAQHit.h:99
daqchannelmap::dchan _theChannel
Definition: DAQHit.h:95
novaddt::DAQHit::DAQHit ( int  detID,
daqchannelmap::dchan  channel,
novaddt::ADC  adc,
novaddt::TDC  tdc 
)

Definition at line 74 of file DAQHit.cxx.

77  :
78  _theDetID(detID),
79  // pass the dchan
80  _theChannel(channel),
81  // getPlane() requires lchan
82  _thePlane(DAQChannelMap::getInstance(_theDetID)->getPlane
83  (DAQChannelMap::getInstance(_theDetID)->encodeLChan(_theChannel))),
84  // getCell() requires lchan
85  _theCell(DAQChannelMap::getInstance(_theDetID)->getCell
86  (DAQChannelMap::getInstance(_theDetID)->encodeLChan(_theChannel))),
87  // getView() requires dchan
88  _theView(DAQChannelMap::getInstance(_theDetID)->getView(_theChannel)),
89  _theADC(adc),
90  _theTDC(tdc),
91  _FEBOverflowError(false)
92 {
93 }
novaddt::Plane _thePlane
Definition: DAQHit.h:96
bool _FEBOverflowError
Definition: DAQHit.h:102
int _theDetID
Definition: DAQHit.h:94
novaddt::Cell _theCell
Definition: DAQHit.h:97
novaddt::TDC _theTDC
Definition: DAQHit.h:100
novaddt::View _theView
Definition: DAQHit.h:98
novaddt::ADC _theADC
Definition: DAQHit.h:99
daqchannelmap::dchan _theChannel
Definition: DAQHit.h:95
novaddt::DAQHit::~DAQHit ( )

Definition at line 21 of file DAQHit.cxx.

Referenced by Chan().

22 {
23 }

Member Function Documentation

novaddt::ADC const& novaddt::DAQHit::ADC ( ) const
inline
novaddt::ADC novaddt::DAQHit::ADC_Extraction ( daqdataformats::RawNanoSlice theNano) const
private

Definition at line 96 of file DAQHit.cxx.

References ana::assert(), daqdataformats::RawNanoSlice::getHeader(), daqdataformats::NanoSliceVersionConvention::getNPretriggeredSamples(), and daqdataformats::NanoSliceVersionConvention::getNSamples().

Referenced by DAQHit(), and operator==().

97 {
98  /*
99  This code is shamelessly copied and adapted from the offline
100  rawdata::RawDigit::ADC() method (see link below). It interprets the
101  raw data format and extracts the ADC value.
102 
103  https://cdcvs.fnal.gov/redmine/projects/novaart/repository/entry/trunk/RawData/RawDigit.cxx#L66
104  */
105 
106  const uint32_t version = theNano->getHeader()->getVersion();
107 
108  // non-multipoint nanoslice version
109  if (version == 0)
110  return theNano->getPulseHeight();
111 
112 
114 
115  const unsigned int nSamples = conv.getNSamples(version);
116  const unsigned int nPretrig = conv.getNPretriggeredSamples(version);
117 
118  // Otherwise it's raw and we need to calculate the DCS value for ourselves
119 
120  // Otherwise we don't have the peak value in our dataset
121  assert(nSamples > nPretrig);
122 
123  // Look back 3 samples (1.5us in the FD)
124  const unsigned int kDCSDistance = 3;
125 
126  // Otherwise we don't have the baseline point in our dataset
127  assert(nPretrig >= kDCSDistance);
128 
129  // The DCS value is the peak value minus the baseline value
130  return theNano->getValue(nPretrig) -
131  theNano->getValue(nPretrig - kDCSDistance);
132 }
IMPLEMENT_MAIN_STANDARD IMPLEMENT_MAIN_setBufferSource daqdataformats::RawNanoSliceHeader * getHeader() const
Get the NanoSlice header pointer.
Definition: RawNanoSlice.h:57
uint32_t getNSamples(const version_t ver) const
Get the number of samples.
uint32_t getNPretriggeredSamples(const version_t ver) const
Get number of pretriggered samples.
const XML_Char * version
Definition: expat.h:187
assert(nhit_max >=nhit_nbins)
novaddt::Cell const& novaddt::DAQHit::Cell ( ) const
inline

Definition at line 71 of file DAQHit.h.

References _theCell.

Referenced by novaddt::FEBFlashFilter::_febNum(), novaddt::HitsAna::addHit(), mono::SlowMonopoleTrigger::algorithm(), novaddt::Multiplet::deltaTCorr(), daq2raw::DAQHit2Raw::FillRawDigits(), novaddt::NuMuTrigger::filter(), novaddt::SlowMMTrigger::filter(), novaddt::MichelETrigger::filter(), novaddt::utils::_detail::FDUtil::GetDCMoffset(), novaddt::utils::_detail::NDOSUtil::GetDCMoffset(), novaddt::utils::_detail::FDUtil::GetPigtail(), novaddt::UpMuTrigger::GetPigtail(), novaddt::UpMuAna::GetPigtail(), novaddt::UpMuTrigger::GetXYZ(), novaddt::UpMuAna::GetXYZ(), novaddt::smt::Trigger::hit_is_between_track_end_points(), mono::SlowMonopoleTrigger::hit_is_between_track_end_points(), mono::SlowMonopoleTrigger::hit_is_on_road(), novaddt::smt::Trigger::hit_is_on_road(), mono::SlowMonopoleTrigger::hit_is_on_surface(), novaddt::smt::Trigger::hit_is_on_surface(), ddthelpers::is_equal(), novaddt::smt::Track::max_cell(), novaddt::smt::Track::min_cell(), novaddt::CompareDAQHit< TDC >::operator()(), novaddt::CompareDAQHit< Cell >::operator()(), novaddt::hitcomp::operator()(), operator<<(), operator==(), novaddt::calib::HitMap< T, Dimension >::operator[](), ddthelpers::print(), novaddt::RemoveOneDSlices::printDDTSlice(), novaddt::RemoveSpatialNoise::printDDTSlice(), novaddt::RemoveSpatialNoise::pruneOutlyingCells(), novaddt::smt::Trigger::run_algorithm(), novaddt::FastMMTrigger::SurfAssign(), novaddt::SlowMMTrigger::SurfAssign(), novaddt::NNFastMMTrigger::SurfAssign(), mono::Track::Track(), and novaddt::DDTEvd::WriteHitListInfo().

71 { return _theCell; }
novaddt::Cell _theCell
Definition: DAQHit.h:97
daqchannelmap::dchan const& novaddt::DAQHit::Chan ( ) const
inline

Definition at line 57 of file DAQHit.h.

References _theChannel, print(), reset(), and ~DAQHit().

Referenced by novaddt::Multiplet::HitCorrection().

57 {return _theChannel;}
daqchannelmap::dchan _theChannel
Definition: DAQHit.h:95
int const& novaddt::DAQHit::DetID ( ) const
inline

Definition at line 75 of file DAQHit.h.

References _theDetID, and getDCM().

Referenced by novaddt::Multiplet::HitCorrection().

75 { return _theDetID; }
int _theDetID
Definition: DAQHit.h:94
bool novaddt::DAQHit::FEBOverflowError ( ) const
inline

Definition at line 78 of file DAQHit.h.

References _FEBOverflowError.

78 { return _FEBOverflowError; }
bool _FEBOverflowError
Definition: DAQHit.h:102
novaddt::DCM novaddt::DAQHit::getDCM ( ) const

Definition at line 134 of file DAQHit.cxx.

References _theChannel, _theDetID, and fillBadChanDBTables::result.

Referenced by DetID(), operator novaddt::DCM(), and novaddt::CompareDAQHit< DCM >::operator()().

135 {
136  // getDCM() require dchan
137  dcm_id_t dcm_id =
138  DAQChannelMap::getInstance(_theDetID)->getDCM(_theChannel);
139  // getDiBlock require dchan
140  int db_id =
141  DAQChannelMap::getInstance(_theDetID)->getDiBlock(_theChannel);
142 
143  DCM result(dcm_id + 12 * (db_id - 1));
144 
145  return result;
146 }
int _theDetID
Definition: DAQHit.h:94
uint32_t dcm_id_t
Type for DCM number, counts from 1.
daqchannelmap::dchan _theChannel
Definition: DAQHit.h:95
novaddt::DAQHit::operator novaddt::ADC ( ) const
inline

Definition at line 84 of file DAQHit.h.

References operator novaddt::ADC().

Referenced by operator novaddt::ADC().

84 { return ADC(); }
novaddt::ADC const & ADC() const
Definition: DAQHit.h:73
novaddt::DAQHit::operator novaddt::Cell ( ) const
inline

Definition at line 82 of file DAQHit.h.

References operator novaddt::Cell().

Referenced by operator novaddt::Cell().

82 { return Cell(); }
novaddt::Cell const & Cell() const
Definition: DAQHit.h:71
novaddt::DAQHit::operator novaddt::DCM ( ) const
inline

Definition at line 86 of file DAQHit.h.

References getDCM().

86 { return getDCM(); }
novaddt::DCM getDCM() const
Definition: DAQHit.cxx:134
novaddt::DAQHit::operator novaddt::Plane ( ) const
inline

Definition at line 81 of file DAQHit.h.

References operator novaddt::Plane().

Referenced by operator novaddt::Plane().

81 { return Plane(); }
novaddt::Plane const & Plane() const
Definition: DAQHit.h:70
novaddt::DAQHit::operator novaddt::TDC ( ) const
inline

Definition at line 85 of file DAQHit.h.

References operator novaddt::TDC().

Referenced by operator novaddt::TDC().

85 { return TDC(); }
novaddt::TDC const & TDC() const
Definition: DAQHit.h:74
novaddt::DAQHit::operator novaddt::View ( ) const
inline

Definition at line 83 of file DAQHit.h.

References operator novaddt::View().

Referenced by operator novaddt::View().

83 { return View(); }
novaddt::View const & View() const
Definition: DAQHit.h:72
bool novaddt::DAQHit::operator== ( const DAQHit rhs) const
inline

Definition at line 88 of file DAQHit.h.

References ADC_Extraction(), Cell(), Plane(), and TDC().

89  { return this->Plane() == rhs.Plane() && this->Cell() == rhs.Cell() && this->TDC() == rhs.TDC();}
novaddt::Plane const & Plane() const
Definition: DAQHit.h:70
novaddt::TDC const & TDC() const
Definition: DAQHit.h:74
Cell()=default
TDC()=default
Plane()=default
novaddt::Cell const & Cell() const
Definition: DAQHit.h:71
novaddt::Plane const& novaddt::DAQHit::Plane ( ) const
inline

Definition at line 70 of file DAQHit.h.

References _thePlane.

Referenced by __attribute__(), novaddt::FEBFlashFilter::_febNum(), novaddt::HitsAna::addHit(), mono::SlowMonopoleTrigger::algorithm(), daq2raw::DAQHit2Raw::FillRawDigits(), novaddt::RestrictHitsByPlane::filter(), novaddt::NuMuTrigger::filter(), novaddt::SlowMMTrigger::filter(), novaddt::MichelETrigger::filter(), FindW(), novaddt::DDTEvd::GetX(), novaddt::UpMuTrigger::GetXYZ(), novaddt::UpMuAna::GetXYZ(), novaddt::DDTEvd::GetY(), novaddt::smt::Trigger::hit_is_between_track_end_points(), mono::SlowMonopoleTrigger::hit_is_between_track_end_points(), mono::SlowMonopoleTrigger::hit_is_in_time_with_road(), novaddt::smt::Trigger::hit_is_in_time_with_road(), mono::SlowMonopoleTrigger::hit_is_on_road(), novaddt::smt::Trigger::hit_is_on_road(), mono::SlowMonopoleTrigger::hit_is_on_surface(), novaddt::smt::Trigger::hit_is_on_surface(), novaddt::smt::Trigger::hits_are_view_matched(), mono::SlowMonopoleTrigger::hits_are_view_matched(), ddthelpers::is_equal(), novaddt::HorizontalMuonAna::IsHorzMuonTrack(), novaddt::smt::Track::max_plane(), novaddt::smt::Track::min_plane(), novaddt::CompareDAQHit< TDC >::operator()(), novaddt::CompareDAQHit< Plane >::operator()(), novaddt::hitcomp::operator()(), operator<<(), operator==(), novaddt::calib::HitMap< T, Dimension >::operator[](), ddthelpers::print(), novaddt::GHLTest::print(), novaddt::RemoveOneDSlices::printDDTSlice(), novaddt::RemoveSpatialNoise::printDDTSlice(), novaddt::smt::Trigger::run_algorithm(), novaddt::FastMMTrigger::SurfAssign(), novaddt::SlowMMTrigger::SurfAssign(), novaddt::NNFastMMTrigger::SurfAssign(), mono::Track::Track(), and novaddt::DDTEvd::WriteHitListInfo().

70 { return _thePlane; }
novaddt::Plane _thePlane
Definition: DAQHit.h:96
void novaddt::DAQHit::print ( ) const

Definition at line 148 of file DAQHit.cxx.

Referenced by Chan(), and novaddt::HoughPoint::print().

149 {
150  // this method was undefined so I defined it to be a "do-nothing"
151  // method as it is referenced by HoughPoint/cxx/src/HoughPoint.cpp
152  //
153  // ...great programming...
154  return;
155 }
void novaddt::DAQHit::reset ( )

Definition at line 157 of file DAQHit.cxx.

Referenced by Chan().

158 {
159  return;
160 }
novaddt::TDC const& novaddt::DAQHit::TDC ( ) const
inline
novaddt::View const& novaddt::DAQHit::View ( ) const
inline

Member Data Documentation

bool novaddt::DAQHit::_FEBOverflowError
private

Definition at line 102 of file DAQHit.h.

Referenced by FEBOverflowError().

novaddt::ADC novaddt::DAQHit::_theADC
private

Definition at line 99 of file DAQHit.h.

Referenced by ADC(), and DAQHit().

novaddt::Cell novaddt::DAQHit::_theCell
private

Definition at line 97 of file DAQHit.h.

Referenced by Cell().

daqchannelmap::dchan novaddt::DAQHit::_theChannel
private

Definition at line 95 of file DAQHit.h.

Referenced by Chan(), and getDCM().

int novaddt::DAQHit::_theDetID
private

Definition at line 94 of file DAQHit.h.

Referenced by DetID(), and getDCM().

novaddt::Plane novaddt::DAQHit::_thePlane
private

Definition at line 96 of file DAQHit.h.

Referenced by Plane().

novaddt::TDC novaddt::DAQHit::_theTDC
private

Definition at line 100 of file DAQHit.h.

Referenced by DAQHit(), and TDC().

novaddt::View novaddt::DAQHit::_theView
private

Definition at line 98 of file DAQHit.h.

Referenced by View().


The documentation for this class was generated from the following files: