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

Public Member Functions | |
| AlgPassThru () | |
| virtual | ~AlgPassThru () |
| virtual void | RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx) |
| virtual void | Trace (const char *c) const |
|
|
Definition at line 27 of file AlgPassThru.cxx. 00028 {
00029 }
|
|
|
Definition at line 31 of file AlgPassThru.cxx. 00032 {
00033 }
|
|
||||||||||||||||
|
Implements AlgBase. Definition at line 35 of file AlgPassThru.cxx. References Registry::Get(), CandContext::GetCandRecord(), CandDigitHandle::GetChannelId(), CandDigitHandle::GetCharge(), CandContext::GetDataIn(), CandDigitHandle::GetPlexSEIdAltL(), CandDigitHandle::GetQieErrorBits(), CandDigitHandle::GetRawDigitIndex(), PlexHandle::GetSEIdAltL(), CandDigitHandle::GetTime(), CandDigitHandle::GetVaErrorBits(), RecMinos::GetVldContext(), Calibrator::Instance(), MSG, CalScheme::Reset(), CandDigitHandle::SetChannelId(), CandDigitHandle::SetCharge(), CandDigitHandle::SetPlexSEIdAltL(), CandDigitHandle::SetQieErrorBits(), CandDigitHandle::SetRawDigitIndex(), CandDigitHandle::SetTime(), and CandDigitHandle::SetVaErrorBits(). 00036 {
00037
00038 assert(ch.InheritsFrom("CandDigitHandle"));
00039
00040 //
00041 //Alg config
00042 //
00043 int cZeroWeights = 1;
00044 int cDoScale = 0;
00045 double cScaleFactor = 1.;
00046 double tmpf = 0;
00047 int tmpi = 0;
00048 if(ac.Get("ZeroWeights", tmpi)) cZeroWeights = tmpi;
00049 if(ac.Get("doscale", tmpi)) cDoScale = tmpi;
00050 if(ac.Get("scalefactor", tmpf)) cScaleFactor = tmpf;
00051
00052 //
00053 //Setup output digit
00054 //
00055 CandDigitHandle &digitout = (CandDigitHandle &) ch;
00056
00057 //
00058 //Get the input data
00059 //
00060 const TObjArray* input = dynamic_cast<const TObjArray*>(cx.GetDataIn());
00061 if(input==NULL){
00062 MSG("RmMu", Msg::kError) << " Unable to get input data "<<endl;
00063 return;
00064 }
00065
00066 const CandDigitHandle* digitin = dynamic_cast<const CandDigitHandle*> (input->At(0));
00067 assert(digitin);
00068
00069 //copy over everything blindly
00070 RawChannelId channel(digitin->GetChannelId());
00071 digitout.SetChannelId(channel);
00072 digitout.SetTime(digitin->GetTime(CalTimeType::kNone));
00073 digitout.SetVaErrorBits(digitin->GetVaErrorBits());
00074 digitout.SetQieErrorBits(digitin->GetQieErrorBits());
00075 digitout.SetRawDigitIndex(digitin->GetRawDigitIndex());
00076
00077 if(cDoScale==0){
00078 digitout.SetCharge(digitin->GetCharge(CalDigitType::kNone));
00079 }else{
00080 if(channel.GetElecType() == ElecType::kVA)
00081 digitout.SetVaErrorBits(digitin->GetVaErrorBits() | 0x80);
00082 else
00083 digitout.SetQieErrorBits(digitin->GetQieErrorBits() | 0x80);
00084
00085 digitout.SetCharge(digitin->GetCharge(CalDigitType::kNone)*cScaleFactor);
00086 }
00087
00088
00089 if(cZeroWeights==0){
00090 //retain the demux solutions
00091 PlexSEIdAltL psalt(digitin->GetPlexSEIdAltL());
00092 digitout.SetPlexSEIdAltL(psalt);
00093 }else{
00094 //re-multiplex the solution
00095 const VldContext &vldc = *(cx.GetCandRecord()->GetVldContext());
00096 Calibrator& calibrator = Calibrator::Instance();
00097 calibrator.Reset(vldc);
00098 PlexHandle ph(vldc);
00099 PlexSEIdAltL altlist = ph.GetSEIdAltL(channel,
00100 &(calibrator),
00101 (int)(digitin->GetCharge(CalDigitType::kNone)),
00102 digitin->GetTime());
00103 digitout.SetPlexSEIdAltL(altlist);
00104 }
00105 }
|
|
|
Reimplemented from AlgBase. Definition at line 108 of file AlgPassThru.cxx. 00109 {
00110 }
|
1.3.9.1