Changeset 954 for trunk


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r953 r954  
    11                                                                  -*-*- END -*-*-
     2
     3 2001/09/28: Thomas Bretz
     4
     5   * macros/getRate.C:
     6     - changed TObjArray to a non-pointer object
     7     - added Printing of the result at the end of the macro
     8     
     9   * mhist/MHMcCollectionArea.[h,cc], mhist/MHMcEnergy.[h,cc]:
     10     - added DrawClone
     11     
     12   * mhist/MHMcRate.[h,cc]:
     13     - added a dummy for DrawClone
     14     
     15   * mmain/MMonteCarlo.[cc, h]:
     16     - added Gui elements
     17     - added CalculateCollectionArea (not yet tested)
     18     - added CalculateTriggerRate (not yet tested)
     19     - added Threshold (not yet tested)
     20
     21   * mmontecarlo/MMcTriggerRateCalc.cc:
     22     - removed output stuff from PostProcessing
     23
     24
    225
    326 2001/09/27: Thomas Bretz
  • trunk/MagicSoft/Mars/macros/getRate.C

    r948 r954  
    6161    // macro yet)
    6262    //
    63     TObjArray *hists = new TObjArray(MParList::CreateObjList("MHMcRate", dim));
     63    TObjArray hists(MParList::CreateObjList("MHMcRate", dim));
     64    hists.SetOwner();
    6465
    6566    //
    6667    // Check if the list really contains the right number of histograms
    6768    //
    68     if (hists->GetEntriesFast() != dim)
     69    if (hists.GetEntriesFast() != dim)
    6970        return;
    7071
     
    7273    // Add the histograms to the paramater list.
    7374    //
    74     parlist.AddToList(hists);
     75    parlist.AddToList(&hists);
    7576
    7677    //
     
    99100    // Start to loop over all events
    100101    //
    101     magic.Eventloop();
     102    if (!magic.Eventloop())
     103        return;
    102104
     105    TIter Next(&hists);
     106    MHMcRate *rate=NULL;
     107    while ((rate=(MHMcRate*)Next()))
     108        rate->Print();
    103109}
  • 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
  • trunk/MagicSoft/Mars/mmain/MAnalysis.cc

    r953 r954  
    165165// ======================================================================
    166166
    167 #include "MLog.h"
    168167#include "MParList.h"
    169168#include "MTaskList.h"
     
    179178#include "MEvtLoop.h"
    180179#include "MHillas.h"
    181 #include <iostream.h>
     180
    182181void MAnalysis::CalculateHillas() const
    183182{
     
    212211    MTaskList tlist;
    213212    plist.AddToList(&tlist);
    214 
    215213
    216214    //
  • trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc

    r947 r954  
    2626#include "MMonteCarlo.h"
    2727
     28#include <stdlib.h>
     29#include <iostream.h>
     30
     31#include <TGLabel.h>        // TGLabel
    2832#include <TGButton.h>       // TGTextButton
     33#include <TGTextEntry.h>    // TGTextEntry
     34#include <TGButtonGroup.h>  // TGVButtonGroup
    2935
    3036ClassImp(MMonteCarlo)
    3137
    3238enum {
    33     M_BUTTON_ACTION
     39    M_BUTTON_COLAREA,
     40    M_BUTTON_RATE,
     41    M_BUTTON_THRESHOLD
    3442};
     43
     44void MMonteCarlo::AddButtons()
     45{
     46    TGTextButton *carea = new TGTextButton(fTop1, "Collection Area", M_BUTTON_COLAREA);
     47    TGTextButton *trate = new TGTextButton(fTop1, "Trigger Rate",    M_BUTTON_RATE);
     48    TGTextButton *thold = new TGTextButton(fTop1, "Threshold",       M_BUTTON_THRESHOLD);
     49
     50    fList->Add(carea);
     51    fList->Add(trate);
     52    fList->Add(thold);
     53
     54    carea->Associate(this);
     55    trate->Associate(this);
     56    thold->Associate(this);
     57
     58    TGLayoutHints *laybut = new TGLayoutHints(kLHintsNormal, 5, 5, 10, 10);
     59    fList->Add(laybut);
     60
     61    fTop1->AddFrame(carea, laybut);
     62    fTop1->AddFrame(trate, laybut);
     63    fTop1->AddFrame(thold, laybut);
     64}
     65
     66void MMonteCarlo::AddSetupTab()
     67{
     68    //
     69    // Create Setup Tab
     70    //
     71    TGCompositeFrame *frame = CreateNewTab("Setup");
     72
     73    //
     74    // Create a button group (it alignes the buttons and make
     75    // them automatic radio buttons)
     76    //
     77    TGVButtonGroup *group = new TGVButtonGroup(frame);
     78    fList->Add(group);
     79
     80    //
     81    // Create three (auto) radio buttons in the button group
     82    //
     83    fRadioButton1 = new TGRadioButton(group, "Use unnumbered trigger condition olny.");
     84    fRadioButton2 = new TGRadioButton(group, "Use only one trigger condition (specify number below).");
     85    fRadioButton3 = new TGRadioButton(group, "Use a number of trigger conditions (1..n).");
     86
     87    fList->Add(fRadioButton1);
     88    fList->Add(fRadioButton2);
     89    fList->Add(fRadioButton3);
     90
     91    //
     92    // Add the button group (all buttons) as first line
     93    //
     94    frame->AddFrame(group);
     95
     96    //
     97    // Create entry fields and labels for line 3 and 4
     98    //
     99
     100    /*
     101     * --> use with root >=3.02 <--
     102     *
     103
     104     TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
     105     TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
     106
     107     */
     108
     109    //
     110    // Align the lines:
     111    //  - top, left
     112    //  - padding: top=20, bottom=0, left=20, right=0
     113    //
     114    TGLayoutHints *layline = new TGLayoutHints(kLHintsNormal, 20, 0, 20);
     115    fList->Add(layline);
     116
     117
     118    //
     119    // Create a frame for line 3 and 4 to be able
     120    // to align entry field and label in one line
     121    //
     122    TGHorizontalFrame *f = new TGHorizontalFrame(frame, 0, 0);
     123    fNumEntry = new TGTextEntry(f, "****");
     124    fNumEntry->SetText("1");
     125    fList->Add(fNumEntry);
     126
     127    // --- doesn't work like expected --- fNumEntry1->SetAlignment(kTextRight);
     128    // --- doesn't work like expected --- fNumEntry2->SetAlignment(kTextRight);
     129
     130    TGLabel *l = new TGLabel(f, "Trigger Condition Setup.");
     131    l->SetTextJustify(kTextLeft);
     132    fList->Add(l);
     133
     134    //
     135    // Align the text of the label centered, left in the row
     136    // with a left padding of 10
     137    //
     138    TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); //, 10); //, 5, 5);
     139    fList->Add(laylabel);
     140
     141    //
     142    // Add one entry field and the corresponding label to each line
     143    //
     144    f->AddFrame(fNumEntry);
     145    f->AddFrame(l, laylabel);
     146
     147    //
     148    // Add line 3 and 4 to tab
     149    //
     150    frame->AddFrame(f, layline);
     151}
    35152
    36153MMonteCarlo::MMonteCarlo(const TGWindow *main, const TGWindow *p,
     
    38155: MBrowser(main, p, w, h)
    39156{
    40     TGTextButton *action = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION);
    41     fList->Add(action);
    42     action->Associate(this);
    43 
    44     TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
    45     fList->Add(laybut);
    46 
    47     fTop1->AddFrame(action, laybut);
     157    AddButtons();
     158    AddSetupTab();
    48159
    49160    MapSubwindows();
     
    58169
    59170// ======================================================================
     171#include <TObjArray.h>
     172
     173#include "MParList.h"
     174#include "MTaskList.h"
     175#include "MEvtLoop.h"
     176
     177#include "MReadTree.h"
     178
     179#include "MHMcRate.h"
     180#include "MHMcEnergy.h"
     181
     182#include "MMcTriggerRateCalc.h"
     183#include "MMcThresholdCalc.h"
     184#include "MMcCollectionAreaCalc.h"
     185
     186Int_t MMonteCarlo::GetDim() const
     187{
     188    Int_t dim = atoi(fNumEntry->GetText());
     189
     190    if (dim<0)
     191    {
     192        dim=0;
     193        fNumEntry->SetText("0");
     194    }
     195
     196    if (fRadioButton1->GetState())
     197        dim = 0;
     198
     199    if (fRadioButton2->GetState())
     200        dim = -dim;
     201
     202    return dim;
     203}
     204
     205void MMonteCarlo::CalculateCollectionArea() const
     206{
     207    //
     208    // first we have to create our empty lists
     209    //
     210    MParList plist;
     211
     212    MTaskList tlist;
     213    plist.AddToList(&tlist);
     214
     215    //
     216    // Setup out tasks:
     217    //  - First we have to read the events
     218    //  - Then we can fill the efficiency histograms
     219    //
     220    MReadTree reader("Events", fInputFile);
     221    tlist.AddToList(&reader);
     222
     223    MMcCollectionAreaCalc effi;
     224    tlist.AddToList(&effi);
     225
     226    //
     227    // set up the loop for the processing
     228    //
     229    MEvtLoop magic;
     230    magic.SetParList(&plist);
     231
     232    //
     233    // Start to loop over all events
     234    //
     235    if (!magic.Eventloop())
     236        return;
     237
     238    //
     239    // Now the histogram we wanted to get out of the data is
     240    // filled and can be displayd
     241    //
     242    plist.FindObject("MHMcCollectionArea")->DrawClone();
     243}
     244
     245void MMonteCarlo::CalculateTriggerRate() const
     246{
     247    // This macro has two input parameter:
     248    // dim : = 0 -> root file with 1 trigger condition.
     249    //       > 0 -> number of trigger condition to be analised
     250    //              in multi conditon file.
     251    //       < 0 -> selects the -dim trigger condition.
     252    //
     253    // first we have to create our empty lists
     254    //
     255    const Int_t dim = GetDim();
     256
     257    MParList plist;
     258    MTaskList tlist;
     259
     260    //
     261    // Setup the parameter list.
     262    //  - we do not need to create any other container. All of them
     263    //    are created automatically without loss - we don't have to
     264    //    access them-
     265    //
     266    //  - we need to create MHMcRate only. The other containers
     267    //    are created automatically without loss - we don't have to
     268    //    access them-
     269    //  - MHMcRate must be created by us because we need the pointer
     270    //    to it and if it would get created automatically it would also be
     271    //    deleted automatically
     272    //  - Actually, depending on using a single trigger option MonteCarlo
     273    //    file or a multyple trigger option, a MHMcRate or an array of
     274    //    MHMcRate are needed.
     275    //
     276    plist.AddToList(&tlist);
     277
     278    //
     279    // You don't have to add the MHMcRate container here by hand.
     280    // But if you want to print or display these containers later on
     281    // it is necessary (Rem: No printing or displaying is done in this
     282    // macro yet)
     283    //
     284    TObjArray hists(MParList::CreateObjList("MHMcRate", dim));
     285    hists.SetOwner();
     286
     287    //
     288    // Check if the list really contains the right number of histograms
     289    //
     290    if (hists.GetEntriesFast() != dim)
     291        return;
     292
     293    //
     294    // Add the histograms to the paramater list.
     295    //
     296    plist.AddToList(&hists);
     297
     298    //
     299    // Setup out tasks:
     300    //  - First we have to read the events
     301    //  - Then we can calculate rates, for what the number of
     302    //    triggered showers from a empty reflector file for the
     303    //    analised trigger conditions should be set (BgR[])
     304    //
     305    MReadTree reader("Events", fInputFile);
     306    tlist.AddToList(&reader);
     307
     308    Float_t BgR[10]={660,4,0,0,0,0,0,0,0,0};
     309
     310    MMcTriggerRateCalc crate(dim, 14, BgR, 100000, 2.75, 10.91e-2);
     311    tlist.AddToList(&crate);
     312
     313    //
     314    // set up the loop for the processing
     315    //
     316    MEvtLoop magic;
     317    magic.SetParList(&plist);
     318
     319    //
     320    // Start to loop over all events
     321    //
     322    if (!magic.Eventloop())
     323        return;
     324
     325    TIter Next(&hists);
     326    MHMcRate *rate=NULL;
     327    while ((rate=(MHMcRate*)Next()))
     328        rate->Print();
     329}
     330
     331void MMonteCarlo::CalculateThreshold() const
     332{
     333    const Int_t dim = GetDim();
     334
     335    //
     336    // This macro fill the container MHMcEnergies using the task
     337    // MMcThresholdCalc and shows the results.
     338    //
     339    MParList plist;
     340
     341    MTaskList tlist;
     342    plist.AddToList(&tlist);
     343
     344    //
     345    // Setup the parameter list
     346    // - You need create the container MHMcEnergies.
     347    //    + You need to put the number of trigger conditions when
     348    //      you declarete the MHMcEnergies
     349    //    + If you don't put any dimension to MHMcEnergies it works
     350    //      taking only the trigger information from MMcTrig
     351    //
     352
     353    //
     354    // Create numtriggerconditions histograms of type MHMcEnergy
     355    // and store the histograms in an TObjArray
     356    //
     357    TObjArray hists(MParList::CreateObjList("MHMcEnergy", dim));
     358    hists.SetOwner();
     359
     360    //
     361    // Check if the list really contains the right number of histograms
     362    //
     363    if (hists.GetEntriesFast() != dim)
     364        return;
     365
     366    //
     367    // Add the histograms to the paramater list.
     368    //
     369    plist.AddToList(&hists);
     370
     371    //
     372    // Setup the task list
     373    // - You need the read and the MMcThresholdCalc tasks
     374    // - You have to fill the histograms for the Energy threshold
     375    //    + You need to put the number of trigger conditions when
     376    //      you declarete the MMcThresholdCalc
     377    //    + If you don't put any dimension to MMcThresholdCalc it works
     378    //      like one dimension MMcThresholdCalc
     379    //
     380    MReadTree        read("Events", fInputFile);
     381    MMcThresholdCalc calc(dim);
     382
     383    tlist.AddToList(&read);
     384    tlist.AddToList(&calc);
     385
     386    MEvtLoop evtloop;
     387    evtloop.SetParList(&plist);
     388
     389    //
     390    // Begin the loop (if the loop wasn't succesfull
     391    // don't try to draw the results
     392    //
     393    if (!evtloop.Eventloop())
     394        return;
     395
     396    //
     397    // Now you can display the results
     398    //
     399    TIter Next(&hists);
     400    MHMcRate *hist=NULL;
     401    while ((hist=(MHMcRate*)Next()))
     402        hist->DrawClone();
     403}
     404
     405// ======================================================================
    60406
    61407Bool_t MMonteCarlo::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
    62 {     
    63     if (GET_MSG(msg) == kC_COMMAND &&
    64         GET_SUBMSG(msg) == kCM_BUTTON &&
    65         parm1 == M_BUTTON_ACTION)
    66     {
    67         DisplInfo("Put Intelligence here!");
    68         return kTRUE;
    69     }
     408{
     409    if (GET_MSG(msg) == kC_COMMAND && GET_SUBMSG(msg) == kCM_BUTTON)
     410        switch (parm1)
     411        {
     412        case M_BUTTON_COLAREA:
     413            CalculateCollectionArea();
     414            return kTRUE;
     415
     416        case M_BUTTON_RATE:
     417            CalculateTriggerRate();
     418            return kTRUE;
     419
     420        case M_BUTTON_THRESHOLD:
     421            CalculateThreshold();
     422            return kTRUE;
     423        }
    70424
    71425    return MBrowser::ProcessMessage(msg, parm1, parm2);
  • trunk/MagicSoft/Mars/mmain/MMonteCarlo.h

    r947 r954  
    1010#endif
    1111
     12class TGTextEntry;
     13class TGRadioButton;
     14
    1215class MMonteCarlo : public MBrowser
    13 {
     16{
     17private:
     18    TGRadioButton *fRadioButton1;
     19    TGRadioButton *fRadioButton2;
     20    TGRadioButton *fRadioButton3;
     21
     22    TGTextEntry   *fNumEntry;
     23
     24    Int_t GetDim() const;
     25
     26    void CalculateCollectionArea() const;
     27    void CalculateTriggerRate() const;
     28    void CalculateThreshold() const;
     29
     30    void AddButtons();
     31    void AddSetupTab();
     32
    1433public:
    1534    MMonteCarlo(const TGWindow *main=NULL, const TGWindow *p=NULL,
  • trunk/MagicSoft/Mars/mmain/Makefile

    r949 r954  
    2323#
    2424INCLUDES = -I. -I../mbase -I../manalysis -I../mdatacheck -I../meventdisp \
    25            -I../mgui -I../mhist
     25           -I../mgui -I../mhist -I../mmontecarlo
    2626
    2727#------------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc

    r898 r954  
    158158//  MHMcRate container.
    159159//
    160 Bool_t MMcTriggerRateCalc::Process ()
     160Bool_t MMcTriggerRateCalc::Process()
    161161{
    162162    //  Counting analysed and simulated showers
     
    189189//  The PostProcess-function calculates and shows the trigger rate
    190190//
    191 Bool_t MMcTriggerRateCalc::PostProcess ()
     191Bool_t MMcTriggerRateCalc::PostProcess()
    192192{
    193193    // Computing trigger rate and showing it
    194     for(int i=0; i<fDimension; i++)
     194    for (int i=0; i<fDimension; i++)
    195195    {
    196196        MHMcRate &rate = *GetRate(i);
    197197
    198198        rate.CalcRate(fTrigger[i], fAnalShow, fShowers);
    199         rate.Print();
    200         rate.Draw("S");
     199        // rate.Print();
     200        // rate.Draw("S");
    201201    }
    202202
    203203    return kTRUE;
    204204}
    205 
    206 
    207 
Note: See TracChangeset for help on using the changeset viewer.