bool TeenyVandleProcessor::PreProcess(RawEvent &event) { data_.clear(); if (!EventProcessor::PreProcess(event)) return(false); static const vector<ChanEvent*> & events = event.GetSummary("tvandle")->GetList(); for(vector<ChanEvent*>::const_iterator it = events.begin(); it != events.end(); it++) { unsigned int location = (*it)->GetChanID().GetLocation(); string subType = (*it)->GetChanID().GetSubtype(); TimingDefs::TimingIdentifier id(location, subType); data_.insert(make_pair(id, HighResTimingData(*it))); } if(data_.size() != 2) return(false); HighResTimingData right = (*data_.find(make_pair(0,"right"))).second; HighResTimingData left = (*data_.find(make_pair(0,"left"))).second; double timeDiff = left.GetHighResTime() - right.GetHighResTime(); double corTimeDiff = left.GetCorrectedTime() - right.GetCorrectedTime(); plot(DD_QDCVSMAX, right.GetMaximumValue(), right.GetTraceQdc()); if(right.GetIsValid() && left.GetIsValid()) { double timeRes = 50; //20 ps/bin double timeOff = 500; plot(D_TIMEDIFF, timeDiff*timeRes + timeOff); plot(DD_PVSP, right.GetPhase()*timeRes, left.GetPhase()*timeRes); plot(DD_MAXRIGHTVSTDIFF, timeDiff*timeRes+timeOff, right.GetMaximumValue()); plot(DD_MAXLEFTVSTDIFF, timeDiff*timeRes+timeOff, left.GetMaximumValue()); plot(DD_MAX, right.GetMaximumValue(), 0); plot(DD_MAX, left.GetMaximumValue(), 1); plot(DD_TQDC, right.GetTraceQdc(), 0); plot(DD_TQDC, left.GetTraceQdc(), 1); plot(DD_SNRANDSDEV, right.GetSignalToNoiseRatio()+50, 0); plot(DD_SNRANDSDEV, right.GetStdDevBaseline()*timeRes+timeOff, 1); plot(DD_SNRANDSDEV, left.GetSignalToNoiseRatio()+50, 2); plot(DD_SNRANDSDEV, left.GetStdDevBaseline()*timeRes+timeOff, 3); double ampDiff = fabs(right.GetMaximumValue()-left.GetMaximumValue()); if(ampDiff <=50) plot(DD_MAXLVSTDIFFAMP, timeDiff*timeRes+timeOff, left.GetMaximumValue()); plot(DD_MAXLCORGATE, corTimeDiff*timeRes+timeOff, left.GetMaximumValue()); if(right.GetMaximumValue() > 2500) { plot(DD_MAXLVSTDIFFGATE, timeDiff*timeRes+timeOff, left.GetMaximumValue()); } } return(true); }
BarDetector::BarDetector(const HighResTimingData &Left, const HighResTimingData &Right, const TimingCalibration &cal, const std::string &type) { left_ = Left; right_ = Right; cal_ = cal; type_ = type; timeDiff_ = (Left.GetHighResTime()-Right.GetHighResTime()) + cal.GetLeftRightTimeOffset(); CalcFlightPath(); BarEventCheck(); qdc_ = sqrt(Right.GetTraceQdc()*Left.GetTraceQdc()); theta_ = acos(cal.GetZ0()/flightPath_); timeAve_ = (Right.GetHighResTime() + Left.GetHighResTime())*0.5; walkCorTimeDiff_ = (Left.GetWalkCorrectedTime() - Right.GetWalkCorrectedTime()) + cal.GetLeftRightTimeOffset(); walkCorTimeAve_ = (Left.GetWalkCorrectedTime() + Right.GetWalkCorrectedTime())*0.5; }