AlgMCDigit Class Reference

#include <AlgMCDigit.h>

Inheritance diagram for AlgMCDigit:
AlgBase

List of all members.

Public Member Functions

 AlgMCDigit ()
virtual ~AlgMCDigit ()
virtual void RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx)
virtual void Trace (const char *c) const

Detailed Description

Definition at line 16 of file AlgMCDigit.h.


Constructor & Destructor Documentation

AlgMCDigit::AlgMCDigit (  ) 

Definition at line 35 of file AlgMCDigit.cxx.

00036 {
00037 }

AlgMCDigit::~AlgMCDigit (  )  [virtual]

Definition at line 40 of file AlgMCDigit.cxx.

00041 {
00042 }


Member Function Documentation

void AlgMCDigit::RunAlg ( AlgConfig ac,
CandHandle ch,
CandContext cx 
) [virtual]

Implements AlgBase.

Definition at line 45 of file AlgMCDigit.cxx.

References PlexSEIdAltL::AddStripEndId(), PlexSEIdAltL::ClearWeights(), digit(), PlexSEIdAltL::DropZeroWeights(), RawDigit::GetADC(), CandContext::GetCandRecord(), RawDigit::GetChannel(), RawDigit::GetCrateT0(), CandContext::GetDataIn(), RawChannelId::GetElecType(), RawDigit::GetErrorCode(), PlexHandle::GetPixelSpotId(), PlexHandle::GetSEIdAltL(), RawDigit::GetTDC(), Calibrator::GetTimeFromTDC(), VldContext::GetTimeStamp(), RawMCDigitMixIn::GetTrueSEIdEncoded(), RecMinos::GetVldContext(), Calibrator::Instance(), Msg::kDebug, ElecType::kQIE, MSG, Munits::ns, and Munits::s.

00047 {
00048    MSG("Alg", Msg::kDebug) << "Starting AlgMCDigit::RunAlg()" << endl;
00049    const Calibrator& cal = Calibrator::Instance();
00050 
00051    assert(ch.InheritsFrom("CandDigitHandle"));
00052    CandDigitHandle &cdh = (CandDigitHandle &) ch;
00053 
00054    const RawDigit *digit =
00055                         dynamic_cast<const RawDigit *> (cx.GetDataIn());
00056    assert(digit);
00057 
00058    const RawChannelId digitRCId = digit->GetChannel();
00059 
00060 // Get VldContext
00061    const VldContext &vldc = *(cx.GetCandRecord()->GetVldContext());
00062 
00063 // Use CandDigitHandle methods to set CandDigit member variables.
00064    cdh.SetChannelId(digitRCId);
00065 
00066 // Take off a 50 ADC offset from QIE channels.
00067    Double_t adc_offset  = 0.;
00068    if (digitRCId.GetElecType()==ElecType::kQIE) {
00069      adc_offset = 50.;
00070      cdh.SetQieErrorBits(digit->GetErrorCode());
00071    }
00072    else
00073      cdh.SetVaErrorBits(digit->GetErrorCode());
00074 
00075 // Set charge to offset-subtracted ADC value ( ~60. * p.e. )
00076    cdh.SetCharge(((Double_t) digit->GetADC()) - adc_offset);
00077 
00078 // Convert TDC counts to Double_t.  Don't subtract Trigger time offset.
00079    Double_t t = cal.GetTimeFromTDC(digit->GetTDC(), digitRCId);
00080 
00081 // Add CrateT0
00082    t += (digit->GetCrateT0()).GetNanoSec() * Munits::ns;
00083 
00084 // And account for snarls overlapping 1 sec boundary.
00085 // This assumes that the crate t0 is the t0 coresponding to the hit.
00086 // t now be <0 or >1
00087 
00088    t += ( (digit->GetCrateT0()).GetSec() -
00089           (vldc.GetTimeStamp()).GetSec() ) * Munits::s;
00090 
00091 #ifdef ENABLE_DEBUG_MSG
00092    MSG("Alg", Msg::kDebug) << "rdid = " << digitRCId << endl
00093                         << "    tdc = " << digit->GetTDC() << " nsec = "
00094    << cal.GetTimeFromTDC(digit->GetTDC(),
00095                   digitRCId) << " t = " << t << endl << "    CrT0_ns = "
00096                         << (digit->GetCrateT0()).GetNanoSec()*Munits::ns
00097                        << " CrT0_s = " << (digit->GetCrateT0()).GetSec()
00098           << " TrigTime_s = " << (vldc.GetTimeStamp()).GetSec() << endl;
00099 #endif
00100 
00101    cdh.SetTime(t);
00102 
00103 // Get a PlexHandle for PlexStripEndId to RawChannelId conversions
00104    PlexHandle ph(vldc);
00105 
00106 // Fill and calibrate PlexSEIdAltL
00107    PlexSEIdAltL altlist =
00108                       ph.GetSEIdAltL(digitRCId, &cal,
00109                       (int)(digit->GetADC()-adc_offset), cdh.GetTime());
00110    altlist.ClearWeights();
00111    altlist.DropZeroWeights();
00112 
00113    const RawMCDigitMixIn *truthDigit =
00114                             dynamic_cast<const RawMCDigitMixIn*>(digit);
00115    if (truthDigit) {
00116      PlexStripEndId seid(truthDigit->GetTrueSEIdEncoded());
00117      PlexPixelSpotId spotid = ph.GetPixelSpotId(seid);
00118      altlist.AddStripEndId(seid,spotid,1.0);
00119    } 
00120 
00121    cdh.SetPlexSEIdAltL(altlist);
00122 }

void AlgMCDigit::Trace ( const char *  c  )  const [virtual]

Reimplemented from AlgBase.

Definition at line 125 of file AlgMCDigit.cxx.

00126 {
00127 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1