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


C++ Messenger::done方法代码示例

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


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

示例1: SanityCheck

void Globals::SanityCheck() {
    Messenger m;
    std::stringstream ss;

    if (!(revision_ == "A" || revision_ == "D" || revision_ == "F")) {
        ss << "Globals: unknown revision version named "
           << revision_;
        throw GeneralException(ss.str());
    }

    if (clockInSeconds_ <= 0) {
        ss << "Globals: illegal value of clockInSeconds "
            << clockInSeconds_;
        throw GeneralException(ss.str());
    }

    if (adcClockInSeconds_ <= 0) {
        ss << "Globals: illegal value of adcClockInSeconds "
            << adcClockInSeconds_;
        throw GeneralException(ss.str());
    }

    if (filterClockInSeconds_ <= 0) {
        ss << "Globals: illegal value of filterClockInSeconds "
            << filterClockInSeconds_;
        throw GeneralException(ss.str());
    }

    if (eventInSeconds_ <= 0) {
        ss << "Globals: illegal value of eventInSeconds "
            << eventInSeconds_;
        throw GeneralException(ss.str());
    }

    if (hasReject_) {
        ss << "Total number of rejection regions: " << reject_.size();
        m.detail(ss.str());
    } else {
        ss << "Not using rejection regions";
        m.detail(ss.str());
    }

    ss.str("");
    if (energyContraction_ <= 0) {
        ss << "Globals: Surely you don't want to use Energy contraction = "
            << energyContraction_ << ". I'd better stop the program.";
        throw GeneralException(ss.str());
    } else {
        ss << "Energy contraction: " << energyContraction_;
        m.detail(ss.str());
    }

    m.done();
}
开发者ID:gottardo7,项目名称:pixie_scan,代码行数:54,代码来源:Globals.cpp

示例2: histo

DetectorDriver::DetectorDriver() : histo(OFFSET, RANGE, "DetectorDriver") {
    Messenger m;
    try {
        m.start("Loading Processors");
        LoadProcessors(m);
    } catch (GeneralException &e) {
        /// Any exception in registering plots in Processors
        /// and possible other exceptions in creating Processors
        /// will be intercepted here
        m.fail();
        cout << "Exception caught at DetectorDriver::DetectorDriver" << endl;
        cout << "\t" << e.what() << endl;
        exit(EXIT_FAILURE);
    } catch (GeneralWarning &w) {
        cout << "Warning found at DetectorDriver::DetectorDriver" << endl;
        cout << "\t" << w.what() << endl;
    }
    m.done();
}
开发者ID:akeeler,项目名称:pixie_scan,代码行数:19,代码来源:DetectorDriver.cpp

示例3: buildTree

void TreeCorrelator::buildTree() {
    pugi::xml_document doc;

    Messenger m;
    m.start("Creating TreeCorrelator");
    pugi::xml_parse_result result = doc.load_file("Config.xml");
    if (!result) {
        stringstream ss;
        ss << "DetectorDriver: error parsing file Config.xml";
        ss << " : " << result.description();
        m.fail();
        throw IOException(ss.str());
    }

    pugi::xml_node tree = doc.child("Configuration").child("TreeCorrelator");
    bool verbose = tree.attribute("verbose").as_bool(false);

    Walker walker;
    walker.traverseTree(tree, string(tree.attribute("name").value()), verbose);

    m.done();
}
开发者ID:akeeler,项目名称:pixie_scan,代码行数:22,代码来源:TreeCorrelator.cpp

示例4: ReadWalkXml

void DetectorDriver::ReadWalkXml() {
    pugi::xml_document doc;

    pugi::xml_parse_result result = doc.load_file("Config.xml");
    if (!result) {
        stringstream ss;
        ss << "DetectorDriver: error parsing file Config.xml";
        ss << " : " << result.description();
        throw GeneralException(ss.str());
    }

    Messenger m;
    m.start("Loading Walk Corrections");

    pugi::xml_node map = doc.child("Configuration").child("Map");
    /** See comment in the similiar place at ReadCalXml() */
    bool verbose = map.attribute("verbose_walk").as_bool();
    for (pugi::xml_node module = map.child("Module"); module;
         module = module.next_sibling("Module")) {
        int module_number = module.attribute("number").as_int(-1);
        for (pugi::xml_node channel = module.child("Channel"); channel;
             channel = channel.next_sibling("Channel")) {
            int ch_number = channel.attribute("number").as_int(-1);
            Identifier chanID = DetectorLibrary::get()->at(module_number,
                                                           ch_number);
            bool corrected = false;
            for (pugi::xml_node walkcorr = channel.child("WalkCorrection");
                walkcorr; walkcorr = walkcorr.next_sibling("WalkCorrection")) {
                string model = walkcorr.attribute("model").as_string("None");
                double min = walkcorr.attribute("min").as_double(0);
                double max =
                  walkcorr.attribute("max").as_double(
                                              numeric_limits<double>::max());

                stringstream pars(walkcorr.text().as_string());
                vector<double> parameters;
                while (true) {
                    double p;
                    pars >> p;
                    if (pars)
                        parameters.push_back(p);
                    else
                        break;
                }
                if (verbose) {
                    stringstream ss;
                    ss << "Module " << module_number
                       << ", channel " << ch_number << ": ";
                    ss << " model: " << model;
                    for (vector<double>::iterator it = parameters.begin();
                         it != parameters.end(); ++it)
                        ss << " " << (*it);
                    m.detail(ss.str(), 1);
                }
                walk.AddChannel(chanID, model, min, max, parameters);
                corrected = true;
            }
            if (!corrected && verbose) {
                stringstream ss;
                ss << "Module " << module_number << ", channel "
                << ch_number << ": ";
                ss << " not corrected for walk";
                m.detail(ss.str(), 1);
            }
        }
    }
    m.done();
}
开发者ID:akeeler,项目名称:pixie_scan,代码行数:68,代码来源:DetectorDriver.cpp

示例5: ReadCalXml

void DetectorDriver::ReadCalXml() {
    pugi::xml_document doc;

    pugi::xml_parse_result result = doc.load_file("Config.xml");
    if (!result) {
        stringstream ss;
        ss << "DetectorDriver: error parsing file Config.xml";
        ss << " : " << result.description();
        throw GeneralException(ss.str());
    }

    Messenger m;
    m.start("Loading Calibration");

    pugi::xml_node map = doc.child("Configuration").child("Map");

    /** Note that before this reading in of the xml file, it was already
     * processed for the purpose of creating the channels map.
     * Some sanity checks (module and channel number) were done there
     * so they are not repeated here/
     */
    bool verbose = map.attribute("verbose_calibration").as_bool();
    for (pugi::xml_node module = map.child("Module"); module;
         module = module.next_sibling("Module")) {
        int module_number = module.attribute("number").as_int(-1);
        for (pugi::xml_node channel = module.child("Channel"); channel;
             channel = channel.next_sibling("Channel")) {
            int ch_number = channel.attribute("number").as_int(-1);
            Identifier chanID = DetectorLibrary::get()->at(module_number,
                                                           ch_number);
            bool calibrated = false;
            for (pugi::xml_node cal = channel.child("Calibration");
                cal; cal = cal.next_sibling("Calibration")) {
                string model = cal.attribute("model").as_string("None");
                double min = cal.attribute("min").as_double(0);
                double max =
                  cal.attribute("max").as_double(numeric_limits<double>::max());

                stringstream pars(cal.text().as_string());
                vector<double> parameters;
                while (true) {
                    double p;
                    pars >> p;
                    if (pars)
                        parameters.push_back(p);
                    else
                        break;
                }
                if (verbose) {
                    stringstream ss;
                    ss << "Module " << module_number << ", channel "
                       << ch_number << ": ";
                    ss << " model-" << model;
                    for (vector<double>::iterator it = parameters.begin();
                         it != parameters.end(); ++it)
                        ss << " " << (*it);
                    m.detail(ss.str(), 1);
                }
                cali.AddChannel(chanID, model, min, max, parameters);
                calibrated = true;
            }
            if (!calibrated && verbose) {
                stringstream ss;
                ss << "Module " << module_number << ", channel "
                   << ch_number << ": ";
                ss << " non-calibrated";
                m.detail(ss.str(), 1);
            }
        }
    }
    m.done();
}
开发者ID:akeeler,项目名称:pixie_scan,代码行数:72,代码来源:DetectorDriver.cpp

示例6: if


//.........这里部分代码省略.........
        ss << "First buffer at " << clockBegin << " sys time";
        messenger.detail(ss.str());
        ss.str("");

        /* After completion the descriptions of all channels are in the modChan
        * vector, the DetectorDriver and rawevent have been initialized with the
        * detectors that will be used in this analysis.
        */
        modChan->PrintUsedDetectors(rawev);
        driver->Init(rawev);

        /* Make a last check to see that everything is in order for the driver
        * before processing data. SanityCheck function throws exception if
        * something went wrong.
        */
        try {
            driver->SanityCheck();
        } catch (GeneralException &e) {
            messenger.fail();
            cout << "Exception caught while checking DetectorDriver"
                 << " sanity in PixieStd" << endl;
            cout << "\t" << e.what() << endl;
            exit(EXIT_FAILURE);
        } catch (GeneralWarning &w) {
            cout << "Warning caught during checking DetectorDriver"
                 << " at PixieStd" << endl;
            cout << "\t" << w.what() << endl;
        }

        lastVsn=-1; // set last vsn to -1 so we expect vsn 0 first

        ss << "Init at " << times(&tmsBegin) << " sys time.";
        messenger.detail(ss.str());
        messenger.done();
    }
    counter++;

    unsigned int nWords=0;  // buffer counter, reset only for new buffer

    // true if the buffer being analyzed is split across a spill from pixie
    bool multSpill;

    do {
        word_t vsn = pixie::U_DELIMITER;
        //true if spill had all vsn's
        bool fullSpill = false;
        //assume all buffers are not split between spills
        multSpill = false;

        /* while the current location in the buffer has not gone beyond the end
         * of the buffer (ignoring the last three delimiters,
         * continue reading */
        while (nWords < (nhw[0]/2 - 6)) {
            /*
            Retrieve the record length and the vsn number
            */
            word_t lenRec = lbuf[nWords];
            vsn = lbuf[nWords+1];

            /* If the record length is -1 (after end of spill), increment the
            location in the buffer by two and start over with the while loop
            */
            if (lenRec == pixie::U_DELIMITER) {
                nWords += 2;  // increment two whole words and try again
                continue;
            }
开发者ID:kmiernik,项目名称:pixie_scan,代码行数:67,代码来源:PixieStd.cpp


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