Ejemplo n.º 1
0
/// Declare some of the raw and basic plots that are going to be used in the
/// analysis of the data. These include raw and calibrated energy spectra,
/// information about the run time, and count rates on the detectors. This
/// also calls the DeclarePlots method that is present in all of the
/// Analyzers and Processors.
void DetectorDriver::DeclarePlots() {
    histo_.DeclareHistogram1D(D_HIT_SPECTRUM, S7, "channel hit spectrum");
    histo_.DeclareHistogram2D(DD_RUNTIME_SEC, SD, S7, "run time - s");
    histo_.DeclareHistogram2D(DD_RUNTIME_MSEC, SD, S7, "run time - ms");
    try {
        if (Globals::get()->HasRawHistogramsDefined()) {
            histo_.DeclareHistogram1D(D_NUMBER_OF_EVENTS, S4, "event counter");
            histo_.DeclareHistogram1D(D_HAS_TRACE, S8, "channels with traces");
            histo_.DeclareHistogram1D(D_SUBEVENT_GAP, SE, "Time Between Channels in 10 ns / bin");
            histo_.DeclareHistogram1D(D_EVENT_LENGTH, SE, "Event Length in ns");
            histo_.DeclareHistogram1D(D_EVENT_GAP, SE, "Time Between Events in ns");
            histo_.DeclareHistogram1D(D_EVENT_MULTIPLICITY, S7, "Number of Channels Event");
            histo_.DeclareHistogram1D(D_BUFFER_END_TIME,SE, "Buffer Length in ns");
                        
            DetectorLibrary *modChan = DetectorLibrary::get();
            DetectorLibrary::size_type maxChan = modChan->size();

            for (DetectorLibrary::size_type i = 0; i < maxChan; i++) {
                if (!modChan->HasValue(i))
                    continue;

                stringstream idstr;

                const ChannelConfiguration &id = modChan->at(i);

                idstr << "M" << modChan->ModuleFromIndex(i)
                      << " C" << modChan->ChannelFromIndex(i)
                      << " - " << id.GetType()
                      << ":" << id.GetSubtype()
                      << " L" << id.GetLocation();

                histo_.DeclareHistogram1D(D_RAW_ENERGY + i, SE, ("RawE " + idstr.str()).c_str());
                histo_.DeclareHistogram1D(D_FILTER_ENERGY + i, SE, ("FilterE " + idstr.str()).c_str());
                histo_.DeclareHistogram1D(D_SCALAR + i, SE, ("Scalar " + idstr.str()).c_str());
                histo_.DeclareHistogram1D(D_CAL_ENERGY + i, SE, ("CalE " + idstr.str()).c_str());
            }
        }
        for (const auto &analyzer : vecAnalyzer)
            analyzer->DeclarePlots();
        for (const auto &processor : vecProcess)
            processor->DeclarePlots();
    } catch (exception &e) {
        cout << Display::ErrorStr("Exception caught at DetectorDriver::DeclarePlots") << endl;
        throw;
    }
}
Ejemplo n.º 2
0
void DetectorDriver::DeclarePlots() {
    try {
        DeclareHistogram1D(D_HIT_SPECTRUM, S7, "channel hit spectrum");
        DeclareHistogram2D(DD_RUNTIME_SEC, SE, S6, "run time - s");
        DeclareHistogram2D(DD_RUNTIME_MSEC, SE, S7, "run time - ms");

        if(Globals::get()->hasRaw()) {
            DetectorLibrary* modChan = DetectorLibrary::get();
            DeclareHistogram1D(D_NUMBER_OF_EVENTS, S4, "event counter");
            DeclareHistogram1D(D_HAS_TRACE, S8, "channels with traces");
            DeclareHistogram2D(DD_BUFFER_START_TIME, SE, S6, "dead time - 0.1%");
            DeclareHistogram2D(DD_DEAD_TIME_CUMUL, SE, S6, "dead time - cumul");
            DeclareHistogram1D(D_SUBEVENT_GAP, SE,
                               "time btwn chan-in event,10ns bin");
            DeclareHistogram1D(D_EVENT_LENGTH, SE,
                               "time length of event, 10 ns bin");
            DeclareHistogram1D(D_EVENT_GAP, SE, "time between events, 10 ns bin");
            DeclareHistogram1D(D_EVENT_MULTIPLICITY, S7,
                               "number of channels in event");
            DeclareHistogram1D(D_BUFFER_END_TIME, SE, "length of buffer, 1 ms bin");
            DetectorLibrary::size_type maxChan = modChan->size();

            for (DetectorLibrary::size_type i = 0; i < maxChan; i++) {
                if (!modChan->HasValue(i)) {
                    continue;
                }
                stringstream idstr;

                const Identifier &id = modChan->at(i);

                idstr << "M" << modChan->ModuleFromIndex(i)
                    << " C" << modChan->ChannelFromIndex(i)
                    << " - " << id.GetType()
                    << ":" << id.GetSubtype()
                    << " L" << id.GetLocation();
                DeclareHistogram1D(D_RAW_ENERGY + i, SE,
                                  ("RawE " + idstr.str()).c_str() );
                DeclareHistogram1D(D_FILTER_ENERGY + i, SE,
                                  ("FilterE " + idstr.str()).c_str() );
                DeclareHistogram1D(D_SCALAR + i, SE,
                                  ("Scalar " + idstr.str()).c_str() );
                if (Globals::get()->revision() == "A")
                    DeclareHistogram1D(D_TIME + i, SE,
                                       ("Time " + idstr.str()).c_str() );
                DeclareHistogram1D(D_CAL_ENERGY + i, SE,
                                  ("CalE " + idstr.str()).c_str() );
            }
        }

        for (vector<TraceAnalyzer *>::const_iterator it = vecAnalyzer.begin();
             it != vecAnalyzer.end(); it++) {
            (*it)->DeclarePlots();
        }

        for (vector<EventProcessor *>::const_iterator it = vecProcess.begin();
             it != vecProcess.end(); it++) {
            (*it)->DeclarePlots();
        }

    } catch (exception &e) {
        cout << "Exception caught at DetectorDriver::DeclarePlots" << endl;
        cout << "\t" << e.what() << endl;
        exit(EXIT_FAILURE);
    }
}