Ignore:
Timestamp:
07/10/01 12:41:13 (23 years ago)
Author:
jlopez
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
4 edited

Legend:

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

    r859 r861  
    2323\* ======================================================================== */
    2424
     25/////////////////////////////////////////////////////////////////////////////
     26//
     27//  MHMcEnergies
     28//
     29// This class holds and array of MHMcEnergy objects in order to be able
     30// to compute the threshold for each of the different trigger conditions
     31// in a root file.
     32//
     33////////////////////////////////////////////////////////////////////////////
    2534#include "MHMcEnergies.h"
    2635
     
    3039ClassImp(MHMcEnergies);
    3140
     41// --------------------------------------------------------------------------
     42//
     43// Default Constructor.
     44//
    3245MHMcEnergies::MHMcEnergies(const UInt_t count, const char *name, const char *title)
    3346    : fNum(count)
    3447{
    35     //
    36     //   default constructor
    37     //
    3848    char aux[25]="MHMcEnergies";
    3949    sprintf(aux+12, "[%i]", fNum);
     
    4858}
    4959
     60// --------------------------------------------------------------------------
     61//
     62// Default Destructor.
     63//
    5064MHMcEnergies::~MHMcEnergies()
    5165{
    5266    delete fHists;
    5367}
    54 
     68// --------------------------------------------------------------------------
     69//
     70// Add to the parameter list all the MHMcEnergy objects contained in the array.
     71//
    5572void MHMcEnergies::AddEntriesToList(MParList *plist)
    5673{
  • trunk/MagicSoft/Mars/mhist/MHMcEnergies.h

    r855 r861  
    2020{
    2121private:
    22     UInt_t        fNum;
    23     TClonesArray *fHists; // histograms
     22    UInt_t        fNum;   // Num of histograms
     23    TClonesArray *fHists; // Array with the energy histograms
    2424
    2525public:
     
    3636
    3737#endif
     38
  • 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
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.h

    r851 r861  
    3232    void Fill(Float_t log10E, Float_t w);
    3333    void Fit(Axis_t xxmin, Axis_t xxmax);
     34    void SetBins(Int_t nbins = 100);
    3435
    3536    void Draw(Option_t* option = "");
    3637    void Print(Option_t* option = NULL);
    3738
    38     ClassDef(MHMcEnergy, 1)  // Histogram container for montecarlo energy
     39    ClassDef(MHMcEnergy, 1)  // Histogram container for montecarlo energy threshold
    3940};
    4041
Note: See TracChangeset for help on using the changeset viewer.