Ignore:
Timestamp:
09/28/01 10:51:06 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
6 edited

Legend:

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

    r929 r954  
    109109}
    110110
     111TObject *MHMcCollectionArea::DrawClone(Option_t* option)
     112{
     113    TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle());
     114
     115    //
     116    // This is necessary to get the expected bahviour of DrawClone
     117    //
     118    gROOT->SetSelectedPad(NULL);
     119
     120    fHistCol->DrawClone(option);
     121
     122    c->Modified();
     123    c->Update();
     124
     125    return c;
     126}
     127
    111128void MHMcCollectionArea::Draw(Option_t* option)
    112129{
  • trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h

    r867 r954  
    3636    void DrawAll(Option_t *option = "");
    3737    void DrawSel(Option_t *option = "");
    38     void Draw   (Option_t *option = "");
     38
     39    void Draw(Option_t *option = NULL);
     40    TObject *DrawClone(Option_t *option = NULL);
    3941
    4042    void CalcEfficiency();
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc

    r891 r954  
    133133}
    134134
    135 // ------------------------------------------------------------------------
    136 //
    137 // Drawing function. It creates its own canvas.
    138 //
    139 void MHMcEnergy::Draw(Option_t *option)
     135void MHMcEnergy::DrawLegend() const
    140136{
    141137    char text[256];
     
    144140    const Float_t max = fHist->GetMaximum();
    145141    const Float_t sum = min+max;
    146 
    147     TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
    148 
    149     fHist->Draw(option);
    150142
    151143    sprintf(text, "Energy Threshold = %4.1f +- %4.1f GeV",
     
    157149    label->SetBit(kCanDelete);
    158150    label->Draw();
     151}
     152
     153// ------------------------------------------------------------------------
     154//
     155// Drawing function. It creates its own canvas.
     156//
     157void MHMcEnergy::Draw(Option_t *option)
     158{
     159    TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
     160
     161    fHist->Draw(option);
     162
     163    DrawLegend();
    159164
    160165    c->Modified();
    161166    c->Update();
     167}
     168
     169TObject *MHMcEnergy::DrawClone(Option_t *option)
     170{
     171    TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
     172
     173    //
     174    // This is necessary to get the expected bahviour of DrawClone
     175    //
     176    gROOT->SetSelectedPad(NULL);
     177
     178    fHist->DrawClone(option);
     179
     180    DrawLegend();
     181
     182    c->Modified();
     183    c->Update();
     184
     185    return c;
    162186}
    163187
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.h

    r891 r954  
    2929    Float_t CalcGaussSigma(TF1 *gauss);
    3030
     31    void DrawLegend() const;
     32
    3133public:
    3234
     
    4749
    4850    void Draw(Option_t* option = "");
     51    TObject *DrawClone(Option_t* option = "");
    4952    void Print(Option_t* option = NULL);
    5053
  • trunk/MagicSoft/Mars/mhist/MHMcRate.cc

    r900 r954  
    2727
    2828#include "MLog.h"
     29#include "MLogManip.h"
    2930
    3031ClassImp(MHMcRate);
     
    3536    *fTitle = title ? title : "Task to calc the collection area ";
    3637
    37     fPartId=0;              // Type of particle
    38 
    39     fEnergyMax=0.0;         // Maximum Energy in GeV
    40     fEnergyMin=1000000.0;   // Minimum Energy in GeV
    41 
    42     fThetaMax=0.0;          // Maximum theta angle of run
    43     fThetaMin=370.0;        // Minimum theta angle of run
    44     fPhiMax=0.0;            // Maximum phi angle of run
    45     fPhiMin=370.0;          // Minimum phi angle of run
    46 
    47     fImpactMax=0.0;         // Maximum impact parameter
    48     fImpactMin=100000.0;    // Minimum impact parameter
    49 
    50     fBackTrig=-1.0;         // Number of triggers from background
    51     fBackSim=-1.0;          // Number of simulated showers for the background
    52 
    53     fTriggerRate= -1.0;        // Trigger rate in Hz
    54     fTriggerRateError= -1.0;   // Estimated error for the trigger rate in Hz
     38    fPartId=0;               // Type of particle
     39
     40    fEnergyMax=0.0;          // Maximum Energy in GeV
     41    fEnergyMin=1000000.0;    // Minimum Energy in GeV
     42
     43    fThetaMax=0.0;           // Maximum theta angle of run
     44    fThetaMin=370.0;         // Minimum theta angle of run
     45    fPhiMax=0.0;             // Maximum phi angle of run
     46    fPhiMin=370.0;           // Minimum phi angle of run
     47
     48    fImpactMax=0.0;          // Maximum impact parameter
     49    fImpactMin=100000.0;     // Minimum impact parameter
     50
     51    fBackTrig=-1.0;          // Number of triggers from background
     52    fBackSim=-1.0;           // Number of simulated showers for the background
     53
     54    fTriggerRate= -1.0;      // Trigger rate in Hz
     55    fTriggerRateError= -1.0; // Estimated error for the trigger rate in Hz
    5556}
    5657
     
    6768    fFlux0=-1.0;            // dn/dE = fFlux0 * E^{-a}
    6869
    69     fShowerRate= -1.0;        // Showers rate in Hz
    70     fShowerRateError=0.0;     // Estimated error of shower rate in Hz
     70    fShowerRate= -1.0;      // Showers rate in Hz
     71    fShowerRateError=0.0;   // Estimated error of shower rate in Hz
    7172}
    7273
     
    8283    Init(name, title);
    8384
    84     fSpecIndex=0.0;         // dn/dE = k * e^{- fSpecIndex}
    85     fFlux0=-1.0;            // dn/dE = fFlux0 * E^{-a}
    86 
    87     fShowerRate= showrate;               // Showers rate in Hz
    88     fShowerRateError=sqrt(showrate);     // Estimated error of shower rate in Hz
     85    fSpecIndex=0.0;                  // dn/dE = k * e^{- fSpecIndex}
     86    fFlux0=-1.0;                     // dn/dE = fFlux0 * E^{-a}
     87
     88    fShowerRate= showrate;           // Showers rate in Hz
     89    fShowerRateError=sqrt(showrate); // Estimated error of shower rate in Hz
    8990}
    9091
     
    133134                                Float_t phi, Float_t impact)
    134135{
    135   // It updates the limit values
    136 
    137   if (fThetaMax<theta) fThetaMax=theta;
    138   if (fThetaMin>theta) fThetaMin=theta;
    139 
    140   if (fPhiMax<phi) fPhiMax=phi;
    141   if (fPhiMin>phi) fPhiMin=phi;
    142 
    143   if (fImpactMax<impact) fImpactMax=impact;
    144   if (fImpactMin>impact) fImpactMin=impact;
    145 
    146   if (fEnergyMax<energy) fEnergyMax=energy;
    147   if (fEnergyMin>energy) fEnergyMin=energy;
    148 
     136    // It updates the limit values
     137
     138    if (fThetaMax<theta) fThetaMax=theta;
     139    if (fThetaMin>theta) fThetaMin=theta;
     140
     141    if (fPhiMax<phi) fPhiMax=phi;
     142    if (fPhiMin>phi) fPhiMin=phi;
     143
     144    if (fImpactMax<impact) fImpactMax=impact;
     145    if (fImpactMin>impact) fImpactMin=impact;
     146
     147    if (fEnergyMax<energy) fEnergyMax=energy;
     148    if (fEnergyMin>energy) fEnergyMin=energy;
    149149}
    150150
     
    180180    if(fBackTrig<0){
    181181        fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) +
    182                               (anal2*anal2*1/(fBackSim*back2*back2)));
     182                                 (anal2*anal2*1/(fBackSim*back2*back2)));
    183183        fBackTrig=0;
    184184    }
    185185    else
    186186        fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) +
    187                               (anal2*anal2*fBackTrig/(back2*back2)));
     187                                 (anal2*anal2*fBackTrig/(back2*back2)));
    188188
    189189    fTriggerRate = trig*fShowerRate/simu + anal2*fBackTrig/back2;
     
    205205//
    206206void MHMcRate::Draw(Option_t *)
    207 {
    208   *fLog << "To be iplemented" << endl;
     207{
     208    *fLog << dbginf << "To be iplemented" << endl;
     209}
     210
     211TObject *MHMcRate::DrawClone(Option_t *)
     212{
     213    *fLog << dbginf << "To be iplemented" << endl;
     214    return NULL;
    209215}
  • trunk/MagicSoft/Mars/mhist/MHMcRate.h

    r900 r954  
    5656
    5757    void Print(Option_t *o=NULL);
     58
    5859    void Draw(Option_t *o=NULL);
     60    TObject *DrawClone(Option_t *o=NULL);
    5961
    6062    ClassDef(MHMcRate, 1)  //  Data Container to calculate Collection Area
Note: See TracChangeset for help on using the changeset viewer.