Ignore:
Timestamp:
07/10/01 12:41:13 (23 years ago)
Author:
jlopez
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc

    r859 r861  
    2323\* ======================================================================== */
    2424
     25/////////////////////////////////////////////////////////////////////////////
     26//
     27//  MHMcEnergy
     28//
     29// This class holds the information ( histogram and fit function ) 
     30// about the energy threshold for a particular trigger condition.
     31//
     32////////////////////////////////////////////////////////////////////////////
    2533#include "MHMcEnergy.h"
    2634
     
    3442ClassImp(MHMcEnergy);
    3543
     44// -------------------------------------------------------------------------
     45//
     46//  Default Constructor.
     47//
    3648MHMcEnergy::MHMcEnergy(const UInt_t idx, const char *name, const char *title)
    3749{
    38     //
    39     //   default constructor
    40     //
    4150    char aux[15]="MHMcEnergy";
    4251
     
    5867    if (idx>0)
    5968        sprintf(aux+10, ";%i", idx);
    60     hLogEner = new TH1F(aux, "", 100, 0.5, 4.5);
     69    hLogEner = new TH1F(aux, "", 40, 0.5, 4.5);
    6170    hLogEner->SetXTitle("log(E) [GeV]");
    6271    hLogEner->SetYTitle("dN/dE");
    63     //hLogEner->SetBins(60);
    6472}
    6573
     74//-------------------------------------------------------------------------
     75//
     76//  Defualt Destructor
     77//
    6678MHMcEnergy::~MHMcEnergy()
    6779{
     
    7082}
    7183
     84//--------------------------------------------------------------------------
     85//
     86//  Fill the histogram with the log10 of the energy for triggered events.
     87//
    7288void MHMcEnergy::Fill(Float_t log10E, Float_t w)
    7389{
     
    7591}
    7692
     93// -------------------------------------------------------------------------
     94//
     95// Fitting function
     96//
    7797void MHMcEnergy::Fit(Axis_t xxmin, Axis_t xxmax)
    7898{
    7999    //
    80100    // 0: don't draw the function (it is drawn together with the histogram)
    81     // +: add these function to the list of fits. Don't delete the last fit.
     101    // Q: quiet mode
    82102    //
    83     // FIXME: R means: use the range specified in the function (xxmin, xxmax are ignored!)
    84     //        Q means: quiet (why?)
    85     //
    86     //
    87     hLogEner->Fit(fLogEner->GetName(), "Q0+", "", xxmin, xxmax);
     103    hLogEner->Fit(fLogEner->GetName(), "Q0", "", xxmin, xxmax);
    88104}
    89105
     106// ------------------------------------------------------------------------
     107//
     108// Drawing function. It creates its own canvas.
     109//
    90110void MHMcEnergy::Draw(Option_t *option)
    91111{
     
    111131}
    112132
     133// --------------------------------------------------------------------------
     134//
     135// Set the number of bins in the histogran.
     136//
     137void MHMcEnergy::SetBins(Int_t nbins)
     138{
     139  hLogEner->SetBins(nbins,0.5,4.5);
     140}
     141// --------------------------------------------------------------------------
     142//
     143// Write the threshold and its error in the standard output
     144//
    113145void MHMcEnergy::Print(Option_t*)
    114146{
     
    116148}
    117149
     150// -------------------------------------------------------------------------
     151//
     152//  Return the threshold
     153//
    118154Float_t MHMcEnergy::GetThreshold() const
    119155{
     
    123159}
    124160
     161// -------------------------------------------------------------------------
     162//
     163// Return the error of the threshold.
     164//
    125165Float_t MHMcEnergy::GetThresholdErr() const
    126166{
     
    129169    const Float_t p1err = fLogEner->GetParError(1);
    130170
     171    // The error has into accuont the error in the fit
    131172    return pow(10, p1) * p1err * lg10;
    132173}
    133174
     175// -------------------------------------------------------------------------
     176//
     177// Return the peak of the fitted gaussan function.
     178//
    134179Float_t MHMcEnergy::GetGaussPeak() const
    135180{
     
    137182}
    138183
     184// -------------------------------------------------------------------------
     185//
     186// Return the sigma of the fitted gaussan function.
     187//
    139188Float_t MHMcEnergy::GetGaussSigma() const
    140189{
     
    142191}
    143192
     193
     194
     195
Note: See TracChangeset for help on using the changeset viewer.