Changeset 14752 for fact/tools


Ignore:
Timestamp:
12/17/12 15:33:10 (12 years ago)
Author:
Jens Buss
Message:
bugfix: ampl and intergral error not yet implemented but writte to csv
Location:
fact/tools/rootmacros/PulseTemplates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/PulseTemplates/csv.C

    r14534 r14752  
    158158
    159159    //name coulums header
    160     mCsvFile << "TimeSlice [a.u.]"          << mSeparator;
    161     mCsvFile << "pixel [CHid]"          << mSeparator;
    162     mCsvFile << "Pulseorder [PhE]"          << mSeparator;
     160    mCsvFile << "TimeSlice[a.u.]"          << mSeparator;
     161    mCsvFile << "CHid"          << mSeparator;
     162    mCsvFile << "Pulseorder[PhE]"          << mSeparator;
    163163    mCsvFile << "OverlayPosition"       << mSeparator;
    164     mCsvFile << "AmplitudeMax [mV]"     << mSeparator;
    165     mCsvFile << "AmplitudeMean [mV]"    << mSeparator;
    166     mCsvFile << "AmplitudeMedian [mV]";
     164    mCsvFile << "AmplitudeMax[mV]"     << mSeparator;
     165    mCsvFile << "AmplitudeMean[mV]"    << mSeparator;
     166    mCsvFile << "AmplitudeMedian[mV]";
    167167    mCsvFile << endl;
    168168}
     
    172172{
    173173    //name coulums header
    174     mCsvFile << "pixel [CHid]"      << mSeparator;
     174    mCsvFile << "CHid"      << mSeparator;
    175175    mCsvFile << "OverlayPosition"   << mSeparator;
    176176    mCsvFile << "ModelName"         << mSeparator ;
     177    mCsvFile << "Order"             << mSeparator ;
     178    mCsvFile << "Type"              << mSeparator ;
    177179    mCsvFile << "Bsl"               << mSeparator;
    178180    mCsvFile << "BslErr"            << mSeparator;
     
    188190    mCsvFile << "Tau2Err"           << mSeparator ;
    189191    mCsvFile << "Integral"          << mSeparator ;
    190     mCsvFile << "IntegralErr"       << mSeparator ;
     192//    mCsvFile << "IntegralErr"       << mSeparator ;
    191193    mCsvFile << "Amplitude"         << mSeparator ;
    192     mCsvFile << "AmplitudeErr"      << mSeparator ;
     194//    mCsvFile << "AmplitudeErr"      << mSeparator ;
    193195    mCsvFile << "Phe"               << mSeparator ;
    194196    mCsvFile << "PheErr"            << mSeparator ;
    195     mCsvFile << "Order"             << mSeparator ;
    196     mCsvFile << "Type"              << mSeparator ;
    197197    mCsvFile << "FitProb"           << mSeparator ;
    198198    mCsvFile << "FitNCalls"         << mSeparator ;
     
    213213    mCsvFile << overlayMethod << mSeparator ;
    214214    mCsvFile << pulse->GetName() << mSeparator ;
     215    mCsvFile.precision(0);
     216    mCsvFile << order << mSeparator ;
     217    mCsvFile.precision(2);
     218    mCsvFile << pulse->GetType() << mSeparator ;
    215219    mCsvFile.precision(12);
    216220    mCsvFile << pulse->GetBsl() << mSeparator ;
     
    232236    mCsvFile.precision(2);
    233237    mCsvFile << pulse->GetPhE() << mSeparator ;
     238    mCsvFile.precision(24);
    234239    mCsvFile << pulse->GetPhEErr() << mSeparator ;
    235     mCsvFile << order << mSeparator ;
    236     mCsvFile << pulse->GetType() << mSeparator ;
     240    mCsvFile.precision(8);
    237241    mCsvFile << pulse->GetFitProb() << mSeparator ;
    238242    mCsvFile.precision(12);
  • fact/tools/rootmacros/PulseTemplates/csv.h

    r14533 r14752  
    6969// OPERATIONS
    7070private:
     71    /*! \brief Built the path to the CSV file */
    7172    void BuildPath();
     73    /*! \brief close the CSV file */
    7274    void CloseCsv();
     75    /*! \brief open the CSV file */
    7376    void OpenCsv();
    7477public:
     78    /*! \brief Write the point set and according header of an fitted pulse to CSV
     79     *  calls WritePointSetHeader() and WritePointSet()
     80     * \param pixel Datatype Pixel, containing all pulse histograms of a Pixel
     81     * \param overlayMethod chosen overlaymethod
     82     * \param order pulse order aka quantity of photons in signal
     83    */
    7584    bool WritePointSetToCsv(
    7685            Pixel* pixel,
     
    7887            int order
    7988            );
     89    /*! \brief Write header of the point set to CSV */
     90    void WritePointSetHeader();
     91    /*! \brief Write the point set of an fitted pulse to CSV
     92     * \param pixel Datatype Pixel, containing all pulse histograms of a Pixel
     93     * \param overlayMethod chosen overlaymethod
     94     * \param order pulse order aka quantity of photons in signal
     95    */
    8096    void WritePointSet(
    8197            Pixel*          pixel,
     
    8399            int             order
    84100            );
     101    /*! \brief Write header of the pulse parameters to CSV */
     102    void WritePulseAttributesHeader();
     103    /*! \brief Write parameters from pulse fit to CSV
     104     * \param pixel Datatype Pixel, containing all pulse histograms of a Pixel
     105     * \param pulse Datatype Pulse, containing pulse fit of a Pixel
     106     * \param overlayMethod chosen overlaymethod
     107     * \param order pulse order aka quantity of photons in signal
     108    */
    85109    void WritePulseAttributes(
    86110            Pixel*          pixel,
    87111            Pulse*          pulse,
    88             TString         overlayMethod, int order
     112            TString         overlayMethod,
     113            int order
    89114            );
    90     void WritePointSetHeader();
    91     void WritePulseAttributesHeader();
    92115
    93116// ACCESS
    94117public:
     118    /*! \brief Get the filename of the CSV file */
    95119    TString GetFilename();
     120    /*! \brief Get the path to the CSV file */
    96121    TString GetPath();
    97 
     122    /*! \brief Get the verbosity Level of the CSV file */
     123    int GetVerbLevel(){return mVerbLevel;}
     124    /*! \brief Set the verbosity Level of the CSV file */
     125    void SetVerbLevel(int verbLevel){mVerbLevel = verbLevel;}
     126    /*! \brief Get the column seperator of the CSV file */
     127    TString GetSeparator(){return mSeparator;}
     128    /*! \brief Set the column seperator of the CSV file */
     129    void SetSeparator(TString separator){mSeparator = separator;}
     130    /*! \brief Get ofstream's floating-point decimal precision */
     131    int GetPrecision(){return mPrecision;}
     132    /*! \brief Set ofstream's floating-point decimal precision */
     133    void SetPrecision(int precision){mPrecision = precision;}
    98134
    99135// INQUIRY
    100136private:
     137    /*! directory to save csv files */
    101138    TString     mDirectory;
     139    /*! csv's filename */
    102140    TString     mFilename;
     141    /*! csv's filename suffix */
    103142    TString     mSuffix;
     143    /*! path to the CSV file */
    104144    TString     mPath;
     145    /*! csv file outstream */
    105146    ofstream    mCsvFile;
     147    /*! verbosity Level */
    106148    int         mVerbLevel;
     149    /*! column separator in csv file */
    107150    TString     mSeparator;
     151    /*! ofstream's floating-point decimal precision */
    108152    int         mPrecision;
    109153};
Note: See TracChangeset for help on using the changeset viewer.