Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
rawdata::RawDigit Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/RawData/RawDigit.h"

Inheritance diagram for rawdata::RawDigit:
rb::CellHit cheat::SimHit

Public Member Functions

 RawDigit ()
 
virtual ~RawDigit ()
 
 RawDigit (uint32_t channel, uint32_t daqchannel, std::vector< int16_t > adclist, int32_t tdc)
 
uint32_t NADC () const
 
int16_t ADC (uint32_t i) const
 
uint32_t Channel () const
 
uint32_t DaqChannel () const
 
uint8_t Version () const
 
int16_t ADC () const
 Best estimator of the hit charge. More...
 
int32_t TDC () const
 The time of the last baseline sample. More...
 
void SetADC (uint32_t i, int16_t iADC)
 
void SetTDC (int32_t iTDC)
 
void SetChannel (uint32_t iChan)
 
void SetDaqChannel (uint32_t iChan)
 
void SetVersion (uint8_t v)
 
void SetMC (bool isMC=true)
 
bool IsRealData () const
 
bool IsMC () const
 

Public Attributes

uint8_t fFrameSequenceNumber
 
uint8_t fFEBStatus
 
bool fDebugMode
 
bool fDataPresent
 
bool fLinkStatus
 
uint16_t fReserved
 Should be 0xCAFE. More...
 
std::vector< int16_t > fADC
 list of ADC(-like) charge values More...
 
std::vector< int32_t > fTDC
 TDC(-like) time value. Event time is subtracted. Vector structure is a historical artifact. More...
 
uint8_t fVersion
 NanoSlice version. More...
 

Private Attributes

uint32_t fChannel
 channel ID More...
 
uint32_t fDaqChannel
 DAQ readout channel. More...
 
uint32_t fMCBits
 status bits for MC information More...
 

Friends

std::ostream & operator<< (std::ostream &o, const RawDigit &r)
 

Detailed Description

Definition at line 36 of file RawDigit.h.

Constructor & Destructor Documentation

rawdata::RawDigit::RawDigit ( )

Definition at line 18 of file RawDigit.cxx.

18  :
20  fFEBStatus(1),
21  fDebugMode(false),
22  fDataPresent(false),
23  fLinkStatus(false),
24  fReserved(1),
25  fADC(0),
26  fTDC(1, 0),
27  fVersion(0),
28  fChannel(0),
29  fDaqChannel(0),
30  fMCBits(0)
31  {
32  }
uint16_t fReserved
Should be 0xCAFE.
Definition: RawDigit.h:47
uint32_t fDaqChannel
DAQ readout channel.
Definition: RawDigit.h:58
uint32_t fMCBits
status bits for MC information
Definition: RawDigit.h:70
uint8_t fVersion
NanoSlice version.
Definition: RawDigit.h:52
uint32_t fChannel
channel ID
Definition: RawDigit.h:57
uint8_t fFrameSequenceNumber
Definition: RawDigit.h:39
std::vector< int32_t > fTDC
TDC(-like) time value. Event time is subtracted. Vector structure is a historical artifact...
Definition: RawDigit.h:50
std::vector< int16_t > fADC
list of ADC(-like) charge values
Definition: RawDigit.h:49
uint8_t fFEBStatus
Definition: RawDigit.h:43
virtual rawdata::RawDigit::~RawDigit ( )
inlinevirtual

Definition at line 39 of file RawDigit.h.

References fFrameSequenceNumber.

39 {}; //Destructor
rawdata::RawDigit::RawDigit ( uint32_t  channel,
uint32_t  daqchannel,
std::vector< int16_t >  adclist,
int32_t  tdc 
)

Definition at line 36 of file RawDigit.cxx.

39  :
41  fFEBStatus(1),
42  fDebugMode(false),
43  fDataPresent(false),
44  fLinkStatus(false),
45  fReserved(1),
46  fADC(adclist),
47  fTDC(tdc),
48  fVersion(0),
49  fChannel(channel),
50  fDaqChannel(daqchannel),
51  fMCBits(0)
52  {
53  }
uint16_t fReserved
Should be 0xCAFE.
Definition: RawDigit.h:47
uint32_t fDaqChannel
DAQ readout channel.
Definition: RawDigit.h:58
uint32_t fMCBits
status bits for MC information
Definition: RawDigit.h:70
uint8_t fVersion
NanoSlice version.
Definition: RawDigit.h:52
uint32_t fChannel
channel ID
Definition: RawDigit.h:57
uint8_t fFrameSequenceNumber
Definition: RawDigit.h:39
std::vector< int32_t > fTDC
TDC(-like) time value. Event time is subtracted. Vector structure is a historical artifact...
Definition: RawDigit.h:50
std::vector< int16_t > fADC
list of ADC(-like) charge values
Definition: RawDigit.h:49
uint8_t fFEBStatus
Definition: RawDigit.h:43

Member Function Documentation

int16_t rawdata::RawDigit::ADC ( uint32_t  i) const

Definition at line 58 of file RawDigit.cxx.

References fADC, MECModelEnuComparisons::i, and printf().

Referenced by murem::MRCCParticle::AddHit(), me::MEFinder::AddMEHit(), murem::MRCCParticle::AddMRCCHit(), calib::ADCShapeFitAna::analyze(), rsim::RecordNoiseSpectrumFile::analyze(), calhit::CalHitAna::analyze(), rsim::MakeNoiseSpectrumFile::analyze(), ddt::SMMADC::analyze(), zcl::SMMTriggerAna::analyze(), mcchk::MonopoleAna::analyze(), sn::SupernovaAna::analyze(), murem::MuonRemoveAna::analyze(), pa::HitEva::analyze(), pa::ClusterEva::analyze(), zcl::MMCheater::analyze(), zcl::FmmTriggerAna::analyze(), zcl::FmmTrackerValidation::analyze(), zcl::FmmTrackerAna::analyze(), showere::ShowerEnergyAna::analyze(), rockmuon::NDRockMuon::analyze(), comi::NearlineAna::analyze(), remid::ReMIdDedxRock::analyze(), remid::ReMIdDedxFD::analyze(), remid::ReMIdDedxStudies::analyze(), zcl::FastMMStudy::analyze(), LightLevels::analyze(), ncs::Xeff::analyze(), ncs::ROCKMRE::analyze(), upmuana::UpMuRecoAna::analyze(), ncs::NCAna::analyze(), slid::NuEEnergyAlg::CellEnergy(), rsim::ReadoutSim::CreateRawDigits(), raw2daq::RawDigit2DAQHit::FillDAQHits(), filter::Filter::FillDigitVariables(), dprf::ChannelPlots::FillFebRawPlots(), calib::StopperThreshold::FillHist(), mcdatadaq::DAQSimulator::fillMicroSlices(), calib::StopperThreshold::FillTree(), calib::CalibAna::FillWithCellHit(), bsf::BremShowerFilter::filter(), showere::ShowerEnergyFilterMC::filter(), bsf::BremShowerFilter::findShowerByReco(), jmshower::RecoJMShower::GetCentroid(), calib::Calibrator::GetTNS(), slid::NuEEnergyAlg::HadronicDepEnergy(), evd::RawDataDrawer::HitColor(), ddthelpers::is_equal(), zcl::FastMonopoleTriggers::is_trigger_by_epoch1_fmmtrigger(), calib::Calibrator::MakeCellHit(), slid::NuEEnergyAlg::NonStdCellEnergy(), rb::operator<<(), rb::CellHit::operator==(), zcl::FastMonopoleTriggers::passed_epoch2_fmmtrigger(), ddthelpers::print(), slicer::MMSlicer::produce(), noe::noe::produce(), zcl::SPCluster::produce(), zcl::FmmTriggerEvd::produce(), murem::MergeDigits::produce(), murem::MuonRemove::produce(), jmshower::RecoJMShower::RecoShowers(), sn::LowHighADCRemover::remove(), rb::Cluster::TotalADC(), zcl::FMMTracker::Tracking2D(), dq::FlasherFinder::Veto(), zcl::FastMonopoleTriggers::WeightedCenterCut(), and zcl::FastMMStudy::WeightedCenterCut().

59  {
60  if(i > fADC.size()){
61  printf("RawDigit::ADC(%d) out of range!\n", i);
62  }
63  return fADC[i];
64  }
printf("%d Experimental points found\n", nlines)
std::vector< int16_t > fADC
list of ADC(-like) charge values
Definition: RawDigit.h:49
int16_t rawdata::RawDigit::ADC ( ) const

Best estimator of the hit charge.

The DCS value appropriate for this readout version

Definition at line 67 of file RawDigit.cxx.

References ana::assert(), fADC, fVersion, daqdataformats::NanoSliceVersionConvention::getNPretriggeredSamples(), daqdataformats::NanoSliceVersionConvention::getNSamples(), and IsMC().

Referenced by NADC(), rb::CellHit::operator==(), and Version().

68  {
69  if(IsMC() && fVersion == 0 && fADC.size() == 3){
70  // This is the old-style MC version of fast timing. ADC(0) is the DCS
71  // value.
72  return fADC[0];
73  }
74 
76 
77  const unsigned int nSamples = conv.getNSamples(fVersion);
78  const unsigned int nPretrig = conv.getNPretriggeredSamples(fVersion);
79 
80  assert(fADC.size() == nSamples);
81 
82  if(fVersion == 0){
83  // Version zero is a single DCS value. But I don't see anywhere that
84  // tells us it's DCS, so hardcode it. Check all the sizes make sense.
85  assert(nSamples == 1);
86  assert(nPretrig == 0);
87 
88  return fADC[0];
89  }
90 
91  // Otherwise it's raw and we need to calculate the DCS value for ourselves
92 
93  // Otherwise we don't have the peak value in our dataset
94  assert(nSamples > nPretrig);
95 
96  // Look back 3 samples (1.5us in the FD)
97  const unsigned int kDCSDistance = 3;
98 
99  // Otherwise we don't have the baseline point in our dataset
100  assert(nPretrig >= kDCSDistance);
101 
102  // The DCS value is the peak value minus the baseline value
103  return fADC[nPretrig]-fADC[nPretrig-kDCSDistance];
104  }
uint8_t fVersion
NanoSlice version.
Definition: RawDigit.h:52
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.
bool IsMC() const
Definition: RawDigit.h:108
std::vector< int16_t > fADC
list of ADC(-like) charge values
Definition: RawDigit.h:49
assert(nhit_max >=nhit_nbins)
uint32_t rawdata::RawDigit::Channel ( ) const
inline
uint32_t rawdata::RawDigit::DaqChannel ( ) const
inline
bool rawdata::RawDigit::IsMC ( ) const
inline
bool rawdata::RawDigit::IsRealData ( ) const
inline
uint32_t rawdata::RawDigit::NADC ( ) const
inline
void rawdata::RawDigit::SetADC ( uint32_t  i,
int16_t  iADC 
)
void rawdata::RawDigit::SetChannel ( uint32_t  iChan)
inline
void rawdata::RawDigit::SetDaqChannel ( uint32_t  iChan)
inline

Definition at line 100 of file RawDigit.h.

Referenced by rsim::ReadoutSim::CreateRawDigits(), and daq2raw::OnlineUnpack::ProcessRawEvent_().

100 { fDaqChannel = iChan; }
uint32_t fDaqChannel
DAQ readout channel.
Definition: RawDigit.h:58
void rawdata::RawDigit::SetMC ( bool  isMC = true)
inline
void rawdata::RawDigit::SetTDC ( int32_t  iTDC)

Definition at line 116 of file RawDigit.cxx.

References ana::assert(), and fTDC.

Referenced by rsim::FPGA_DualCorrelatedSampling::ASICToDigits(), rsim::FPGA_MatchedFiltering::ASICToDigits(), rsim::ReadoutSim::CreateRawDigits(), daq2raw::DAQHit2Raw::FillRawDigits(), daq2raw::OnlineUnpack::ProcessRawEvent_(), rawp::CheckDAQChannelMap::Reco(), rawp::FillRawDigits::Reco(), and TDC().

116  {
117  assert(fTDC.size() == 1);
118  fTDC[0] = iTDC;
119  }
std::vector< int32_t > fTDC
TDC(-like) time value. Event time is subtracted. Vector structure is a historical artifact...
Definition: RawDigit.h:50
assert(nhit_max >=nhit_nbins)
void rawdata::RawDigit::SetVersion ( uint8_t  v)
inline
int32_t rawdata::RawDigit::TDC ( ) const
inline

The time of the last baseline sample.

Definition at line 94 of file RawDigit.h.

References SetADC(), and SetTDC().

Referenced by calhit::CalHitAna::analyze(), sn::SupernovaAna::analyze(), pa::HitEva::analyze(), zcl::MMCheater::analyze(), zcl::FastMMStudy::analyze(), cheat::BackTracker::ClusterToParticle(), rsim::ReadoutSim::CreateRawDigits(), digi_sort(), evd::RawDataDrawer::DimFiltered(), raw2daq::RawDigit2DAQHit::FillDAQHits(), mcdatadaq::DAQSimulator::fillMicroSlices(), calib::CalibAna::FillWithCellHit(), bsf::BremShowerFilter::filter(), mono::Cluster::find(), util::HashFunctions::Generate(), mcdatadaq::DAQSimulator::getNanoSliceOrder(), calib::Calibrator::GetTNS(), mono::Cluster::hit_is_in_time_with_road(), evd::RawDataDrawer::HitColor(), sn::HighEnergyRemover::HitInTDCVetoWindow(), cheat::BackTracker::HitToParticlesMap(), ddthelpers::is_equal(), dq::FlasherFinder::IsInstigator(), mono::Cluster::make(), murem::FindParent::MatchToOrigSlice(), rb::operator<<(), rb::CellHit::operator==(), ddthelpers::print(), mcdatadaq::DAQSimulator::print(), noe::noe::produce(), MergeDaqCollections::MergeDaqCollections::produce(), murem::MuonRemove::produce(), evd::RawDataDrawer::RawDigit2D(), evd::RawDataDrawer::RawDigit3D(), evd::RawDataDrawer::RawDigitHardware(), mono::Track::Track(), dq::FlasherFinder::Veto(), moonshadowana::MoonShadowAna::WriteHitListInfo(), and moonshadowana::MoonShadowAnaHough::WriteHitListInfo().

94 { return fTDC[0]; }
std::vector< int32_t > fTDC
TDC(-like) time value. Event time is subtracted. Vector structure is a historical artifact...
Definition: RawDigit.h:50
uint8_t rawdata::RawDigit::Version ( ) const
inline

Definition at line 87 of file RawDigit.h.

References ADC(), and fVersion.

Referenced by calib::Calibrator::GetTNS(), calib::Calibrator::MakeCellHit(), rawdata::operator<<(), murem::MergeDigits::produce(), and murem::MuonRemove::produce().

87 { return fVersion; }
uint8_t fVersion
NanoSlice version.
Definition: RawDigit.h:52

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const RawDigit r 
)
friend

Definition at line 122 of file RawDigit.cxx.

Referenced by IsMC().

123  {
124  if(r.IsMC()){
125  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
126  o << " Version = " << std::setw(5) << std::right << (int)r.Version()
127  << " NADC = " << std::setw(5) << std::right << r.NADC();
128  }
129  else if (r.IsRealData()){
130  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
131  o << " Channel = " << std::setw(5) << std::right << r.Channel()
132  << " Version = " << std::setw(5) << std::right << (int)r.Version()
133  << " NADC = " << std::setw(5) << std::right << r.NADC();
134  }
135  return o;
136  }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:112
TRandom3 r(0)

Member Data Documentation

std::vector<int16_t> rawdata::RawDigit::fADC

list of ADC(-like) charge values

Definition at line 49 of file RawDigit.h.

Referenced by ADC(), calib::Calibrator::MakeCellHit(), SetADC(), and rb::standard_compare().

uint32_t rawdata::RawDigit::fChannel
private

channel ID

Definition at line 57 of file RawDigit.h.

Referenced by Channel().

uint32_t rawdata::RawDigit::fDaqChannel
private

DAQ readout channel.

Definition at line 58 of file RawDigit.h.

Referenced by DaqChannel().

bool rawdata::RawDigit::fDataPresent

Definition at line 45 of file RawDigit.h.

Referenced by daq2raw::OnlineUnpack::ProcessRawEvent_().

bool rawdata::RawDigit::fDebugMode

Definition at line 44 of file RawDigit.h.

Referenced by daq2raw::OnlineUnpack::ProcessRawEvent_().

uint8_t rawdata::RawDigit::fFEBStatus
uint8_t rawdata::RawDigit::fFrameSequenceNumber

Definition at line 39 of file RawDigit.h.

Referenced by daq2raw::OnlineUnpack::ProcessRawEvent_(), and ~RawDigit().

bool rawdata::RawDigit::fLinkStatus

Definition at line 46 of file RawDigit.h.

Referenced by daq2raw::OnlineUnpack::ProcessRawEvent_().

uint32_t rawdata::RawDigit::fMCBits
private

status bits for MC information

Definition at line 70 of file RawDigit.h.

uint16_t rawdata::RawDigit::fReserved

Should be 0xCAFE.

Definition at line 47 of file RawDigit.h.

Referenced by daq2raw::OnlineUnpack::ProcessRawEvent_().

std::vector<int32_t> rawdata::RawDigit::fTDC

TDC(-like) time value. Event time is subtracted. Vector structure is a historical artifact.

Definition at line 50 of file RawDigit.h.

Referenced by rb::CellHit::operator==(), SetTDC(), and rb::standard_compare().

uint8_t rawdata::RawDigit::fVersion

NanoSlice version.

Definition at line 52 of file RawDigit.h.

Referenced by ADC(), daq2raw::OnlineUnpack::ProcessRawEvent_(), and Version().


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