#include <AlgDigit.h>
Inheritance diagram for AlgDigit:

Public Member Functions | |
| AlgDigit () | |
| virtual | ~AlgDigit () |
| virtual void | RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx) |
| virtual void | Trace (const char *c) const |
|
|
Definition at line 34 of file AlgDigit.cxx. 00035 {
00036 }
|
|
|
Definition at line 39 of file AlgDigit.cxx. 00040 {
00041 }
|
|
||||||||||||||||
|
Implements AlgBase. Definition at line 44 of file AlgDigit.cxx. References digit(), RawDigit::GetADC(), CandContext::GetCandRecord(), RawDigit::GetChannel(), RawDigit::GetCrateT0(), CandContext::GetDataIn(), RawChannelId::GetElecType(), RawDigit::GetErrorCode(), PlexHandle::GetSEIdAltL(), RawDigit::GetTDC(), CandDigitHandle::GetTime(), Calibrator::GetTimeFromTDC(), VldContext::GetTimeStamp(), RecMinos::GetVldContext(), Calibrator::Instance(), MSG, CandDigitHandle::SetChannelId(), CandDigitHandle::SetCharge(), CandDigitHandle::SetPlexSEIdAltL(), CandDigitHandle::SetQieErrorBits(), CandDigitHandle::SetTime(), and CandDigitHandle::SetVaErrorBits(). 00046 {
00047
00048 #ifdef ENABLE_DEBUG_MSG
00049 MSG("Alg", Msg::kDebug) << "Starting AlgDigit::RunAlg()" << endl;
00050 #endif
00051
00052 assert(ch.InheritsFrom("CandDigitHandle"));
00053 CandDigitHandle &cdh = (CandDigitHandle &) ch;
00054
00055 const RawDigit *digit =
00056 dynamic_cast<const RawDigit *> (cx.GetDataIn());
00057 assert(digit);
00058
00059 const Calibrator& cal = Calibrator::Instance();
00060
00061 const RawChannelId digitRCId = digit->GetChannel();
00062
00063 // Get VldContext
00064 const VldContext &vldc = *(cx.GetCandRecord()->GetVldContext());
00065
00066 // Use CandDigitHandle methods to set CandDigit member variables.
00067 cdh.SetChannelId(digitRCId);
00068
00069 // Take off a 50 ADC offset from QIE channels.
00070 Double_t adc_offset = 0.;
00071 if (digitRCId.GetElecType()==ElecType::kQIE) {
00072 adc_offset = 50.;
00073 cdh.SetQieErrorBits(digit->GetErrorCode());
00074 }
00075 else
00076 cdh.SetVaErrorBits(digit->GetErrorCode());
00077
00078 // Set charge to offset-subtracted ADC value ( ~60. * p.e. )
00079 cdh.SetCharge(((Double_t) digit->GetADC()) - adc_offset);
00080
00081 // Convert TDC counts to Double_t. Don't subtract Trigger time offset.
00082 Double_t t = cal.
00083 GetTimeFromTDC(digit->GetTDC(), digitRCId);
00084
00085 // Add CrateT0 (A.Weber)
00086 // this is needed to account for the counter->reset hold-off during the spill
00087 // Removed again my N.Tagg. This does the wrong thing in 99.9% of all cases,
00088 // as documented in Doc-DB 1870.
00089 // t += (digit->GetCrateT0()).GetNanoSec() * Munits::ns;
00090
00091 // And account for snarls overlapping 1 sec boundary. (A.Weber)
00092 // This assumes that the crate t0 is the t0 coresponding to the hit.
00093 // t now be <0 or >1
00094 t += ( (digit->GetCrateT0()).GetSec() -
00095 (vldc.GetTimeStamp()).GetSec() ) * Munits::s;
00096
00097 #ifdef ENABLE_DEBUG_MSG
00098 MSG("Alg", Msg::kDebug) << "rdid = " << digitRCId << endl
00099 << " tdc = " << digit->GetTDC() << " nsec = "
00100 << cal.GetTimeFromTDC(digit->GetTDC(),
00101 digitRCId) << " t = " << t << endl << " CrT0_ns = "
00102 << (digit->GetCrateT0()).GetNanoSec()*Munits::ns
00103 << " CrT0_s = " << (digit->GetCrateT0()).GetSec()
00104 << " TrigTime_s = " << (vldc.GetTimeStamp()).GetSec() << endl;
00105 #endif
00106
00107 cdh.SetTime(t);
00108
00109 // Get a PlexHandle for PlexStripEndId to RawChannelId conversions
00110 PlexHandle ph(vldc);
00111
00112 // Fill and calibrate PlexSEIdAltL
00113 PlexSEIdAltL altlist =
00114 ph.GetSEIdAltL(digitRCId, &cal,
00115 (int)(digit->GetADC()-adc_offset), cdh.GetTime());
00116
00117 cdh.SetPlexSEIdAltL(altlist);
00118 }
|
|
|
Reimplemented from AlgBase. Definition at line 121 of file AlgDigit.cxx. 00122 {
00123 }
|
1.3.9.1