当前位置: 首页>>代码示例>>C++>>正文


C++ Trace::Plot方法代码示例

本文整理汇总了C++中Trace::Plot方法的典型用法代码示例。如果您正苦于以下问题:C++ Trace::Plot方法的具体用法?C++ Trace::Plot怎么用?C++ Trace::Plot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Trace的用法示例。


在下文中一共展示了Trace::Plot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Analyze

/** Plot the damm spectra of the first few traces analyzed with (level >= 1) */
void TracePlotter::Analyze(Trace &trace, const string &type, const string &subtype)
{   
    TraceAnalyzer::Analyze(trace, type, subtype);
    if (level >= 1 && numTracesAnalyzed < numTraces) {      
        trace.Plot(plotter::DD_TRACE, numTracesAnalyzed);
    }
    EndAnalyze(trace);
}
开发者ID:cthornsb,项目名称:RootPixieScan,代码行数:9,代码来源:TracePlotter.cpp

示例2: Analyze

/**
 *   Detect a second crossing of the fast filter corresponding to a piled-up
 *     trace and deduce its energy
 */
void DoubleTraceAnalyzer::Analyze(Trace &trace,
                                  const string &type, const string &subtype)
{
    if (subtype == "top" || subtype == "bottom")
        return;

    TraceFilterer::Analyze(trace, type, subtype);
    // class to see when the fast filter falls below threshold
    static binder2nd< less<Trace::value_type> > recrossesThreshold
    (less<Trace::value_type>(), fastThreshold);

    if ( pulse.isFound && level >= 10 ) {
        // cout << "Double trace #" << numTracesAnalyzed << " for type " << type << ":" << subtype << endl;
        // trace filterer found a first pulse

        Trace::iterator iThr = fastFilter.begin() + pulse.time;
        Trace::iterator iHigh = fastFilter.end();

        vector<PulseInfo> pulseVec;
        // put the original pulse in the vector
        pulseVec.push_back(pulse);
        const size_t pulseLimit = 50; // maximum number of pulses to find

        while (iThr < iHigh) {
            // find the trailing edge (use rise samples?)
            advance(iThr, fastParms.GetGapSamples());
            iThr = find_if(iThr, iHigh, recrossesThreshold);
            // advance(iThr, fastParms.GetSize());
            advance(iThr, fastParms.GetRiseSamples());

            FindPulse(iThr, iHigh);
            if (pulse.isFound) {
                pulseVec.push_back(pulse);
                iThr = fastFilter.begin() + pulse.time;
            } else break;
            if (pulseVec.size() > pulseLimit) {
                cout << "Too many pulses, limit = " << pulseLimit << ", breaking out." << endl;
                EndAnalyze(); // update timing
                return;
            }
        } // while searching for multiple traces

        trace.SetValue("numPulses", (int)pulseVec.size());

        // now plot stuff
        if ( pulseVec.size() > 1 ) {
            using namespace dammIds::trace;

            // fill the trace info
            // first pulse info is set in TraceFilterer
            for (Trace::size_type i=1; i < pulseVec.size(); i++) {
                stringstream str;
                // the first pulse in the vector is the SECOND pulse in the trace
                str << "filterEnergy" << i+1;
                trace.SetValue(str.str(), pulseVec[i].energy);
                str.str(""); // clear the string
                str << "filterTime" << i+1;
                trace.SetValue(str.str(), (int)pulseVec[i].time);
            }

            // plot the double pulse stuff
            trace.Plot(DD_DOUBLE_TRACE, numDoubleTraces);
            if (pulseVec.size() > 2) {
                static int numTripleTraces = 0;
                cout << "Found triple trace " << numTripleTraces
                     << ", num pulses = " << pulseVec.size()
                     << ", sigma baseline = " << trace.GetValue("sigmaBaseline") << endl;
                trace.Plot(DD_TRIPLE_TRACE, numTripleTraces);
                fastFilter.ScalePlot(DD_TRIPLE_TRACE_FILTER1, numTripleTraces, fastParms.GetRiseSamples());
                energyFilter.ScalePlot(DD_TRIPLE_TRACE_FILTER2, numTripleTraces, energyParms.GetRiseSamples());
                if (useThirdFilter)
                    thirdFilter.ScalePlot(DD_TRIPLE_TRACE_FILTER3, numTripleTraces, thirdParms.GetRiseSamples());
                numTripleTraces++;
            }

            plot(D_ENERGY2, pulseVec[1].energy);
            plot(DD_ENERGY2__TDIFF, pulseVec[1].energy, pulseVec[1].time - pulseVec[0].time);
            plot(DD_ENERGY2__ENERGY1, pulseVec[1].energy, pulseVec[0].energy);

            numDoubleTraces++;
        } // if found double trace
    } // sufficient analysis level

    EndAnalyze(trace);
}
开发者ID:mohmd7shudif,项目名称:pixie_scan,代码行数:89,代码来源:DoubleTraceAnalyzer.cpp


注:本文中的Trace::Plot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。