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

Public Member Functions | |
| AlgCaldetDigit () | |
| virtual | ~AlgCaldetDigit () |
| virtual void | RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx) |
| virtual void | Trace (const char *c) const |
|
|
Definition at line 34 of file AlgCaldetDigit.cxx. 00035 {
00036 }
|
|
|
Definition at line 39 of file AlgCaldetDigit.cxx. 00040 {
00041 }
|
|
||||||||||||||||
|
Implements AlgBase. Definition at line 45 of file AlgCaldetDigit.cxx. References digit(), CaldetRawDigitWrapper::fDigit, CaldetRawDigitWrapper::fFiducialDigit, RawDigit::GetADC(), CandContext::GetCandRecord(), RawDigit::GetChannel(), CandContext::GetDataIn(), RawChannelId::GetElecType(), RawDigit::GetErrorCode(), PlexHandle::GetSEIdAltL(), RawDigit::GetTDC(), CandDigitHandle::GetTime(), Calibrator::GetTimeFromTDC(), 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 AlgCaldetDigit::RunAlg()" << endl;
00050 #endif
00051
00052 assert(ch.InheritsFrom("CandDigitHandle"));
00053 CandDigitHandle &cdh = (CandDigitHandle &) ch;
00054
00055 assert(cx.GetDataIn());
00056 const CaldetRawDigitWrapper* wrapper =
00057 dynamic_cast<const CaldetRawDigitWrapper *> (cx.GetDataIn());
00058
00059 const RawDigit* digit = wrapper->fDigit;
00060 const RawDigit* fidDigit = wrapper->fFiducialDigit;
00061
00062 const RawChannelId digitRCId = digit->GetChannel();
00063
00064 assert(digit);
00065
00066 // Get VldContext
00067 const VldContext &vldc = *(cx.GetCandRecord()->GetVldContext());
00068
00069 // Use CandDigitHandle methods to set CandDigit member variables.
00070 cdh.SetChannelId(digitRCId);
00071
00072 Calibrator& cal = Calibrator::Instance();
00073
00074 double time = cal.GetTimeFromTDC(digit->GetTDC(),
00075 digitRCId);
00076
00077 double fidTime = 0;
00078 if(fidDigit)
00079 fidTime =cal.GetTimeFromTDC(fidDigit->GetTDC(),
00080 fidDigit->GetChannel());
00081
00082 // cout << digitRCId.AsString("e") << time << "\t" << fidTime << endl;
00083
00084 // Add on the fiducial time if this is a ND digit.
00085 if(digitRCId.GetElecType() == ElecType::kQIE)
00086 time = time + fidTime;
00087
00088
00089 Double_t adc_offset = 0.;
00090 if (digitRCId.GetElecType() == ElecType::kQIE) {
00091 adc_offset = 50.;
00092 cdh.SetQieErrorBits(digit->GetErrorCode());
00093 }
00094 else
00095 cdh.SetVaErrorBits(digit->GetErrorCode());
00096
00097 // Convert TDC counts to Double_t. Don't subtract Trigger time offset.
00098 cdh.SetTime(time);
00099
00100 // Set charge to offset-subtracted ADC value ( ~60. * p.e. )
00101 cdh.SetCharge(((Double_t) digit->GetADC()) - adc_offset);
00102
00103 // Get a PlexHandle for PlexStripEndId to RawChannelId conversions
00104 PlexHandle ph(vldc);
00105
00106 // Fill and calibrate PlexSEIdAltL
00107 PlexSEIdAltL altlist = ph.GetSEIdAltL(digitRCId,
00108 &cal,
00109 (int)(digit->GetADC()-adc_offset),
00110 cdh.GetTime());
00111
00112 cdh.SetPlexSEIdAltL(altlist);
00113 }
|
|
|
Reimplemented from AlgBase. Definition at line 116 of file AlgCaldetDigit.cxx. 00117 {
00118 }
|
1.3.9.1