Ignore:
Timestamp:
07/05/01 13:23:12 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/macros
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/getThreshold.C

    r851 r855  
    1 void getThreshold( char* filename = "/hdb1/users/jlopez/temp_loop.root")
     1void getThreshold( char* filename = "data/oscar_protons.root")
    22{
     3    //
    34    // This macro fill the container MMcEnerThre using the task
    45    // MMcEnerThreCalc and shows the results.
     6    //
     7    MParList  parlist;
    58
    6     MParList parlist;
    79    MTaskList tasklist;
     10    parlist.AddToList(&tasklist);
    811
     12    //
    913    // Setup the parameter list
    1014    // - You need create the container MMcEnerThre.
    1115    //    + You need to put the number of trigger conditions when
    12     //      you declarete the MMcEnerThre
    13     //    + If you don't put any dimension to MMcEnerThre it works
     16    //      you declarete the MHMcEnergies
     17    //    + If you don't put any dimension to MHMcEnergies it works
    1418    //      taking only the trigger information from MMcTrig
    15     // - You can control the number of bins in the energy distribution
    16     //   histogram used to compute the energy threshold using
    17     //   the SetBins() function.
     19    //
     20    const UInt_t numtriggerconditions = 1;
    1821
    19     Int_t numtrigcond = 5;
    20     MHMcEnergies *hists = new MHMcEnergies(numtrigcond);
    21 
    22     parlist.AddToList(&tasklist);
     22    MHMcEnergies *hists = new MHMcEnergies(numtriggerconditions);
    2323    hists->AddEntriesToList(&parlist);
    2424
     25    //
    2526    // Setup the task list
    26     // - You need the read and the MMcEnerThreCalc tasks
     27    // - You need the read and the MMcThresholdCalc tasks
     28    // - You have to fill the histograms for the Energy threshold
    2729    //    + You need to put the number of trigger conditions when
    28     //      you declarete the MMcEnerThreCalc
    29     //    + If you don't put any dimension to MMcEnerThreCalc it works
    30     //      like one dimension MMcEnerThreCalc
    31 
    32     MReadTree read("Events", filename);
    33 
    34     MMcThresholdCalc tcalc(numtrigcond);
     30    //      you declarete the MMcThresholdCalc
     31    //    + If you don't put any dimension to MMcThresholdCalc it works
     32    //      like one dimension MMcThresholdCalc
     33    //
     34    MReadTree        read("Events", filename);
     35    MMcThresholdCalc calc(numtriggerconditions);
    3536
    3637    tasklist.AddToList(&read);
    37     tasklist.AddToList(&tcalc);
     38    tasklist.AddToList(&calc);
    3839
    3940    MEvtLoop evtloop;
    4041    evtloop.SetParList(&parlist);
    4142
     43    //
    4244    // Begin the loop
    43 
     45    //
    4446    evtloop.Eventloop();
    4547
     48    //
    4649    // Now you can display the results
    47 
    48     TCanvas *c;
    49 
    50     c=new TCanvas("c0","Energy distribution for triggered events", 50, 50, 850, 550);
    51     hists[0].Print();
    52     hists[0].Draw();
    53     c->Update();
    54 
    55     c= new TCanvas("c1","Energy distribution for triggered events", 50, 50, 850, 550);
    56     hists[1].Print();
    57     hists[1].Draw();
    58     c->Update();
    59 
    60     c= new TCanvas("c2","Energy distribution for triggered events", 50, 50, 850, 550);
    61     hists[2].Print();
    62     hists[2].Draw();
    63     c->Update();
    64 
    65     c= new TCanvas("c3","Energy distribution for triggered events", 50, 50, 850, 550);
    66     hists[3].Print();
    67     hists[3].Draw();
    68     c->Update();
    69 
    70     c= new TCanvas("c4","Energy distribution for triggered events", 50, 50, 850, 550);
    71     hists[4].Print();
    72     hists[4].Draw();
    73     c->Update();
     50    //
     51    for (UInt_t i=0; i<numtriggerconditions; i++)
     52        ((*hists)[i]).Draw();
    7453}
  • trunk/MagicSoft/Mars/macros/readMagic.C

    r706 r855  
    3131    MCerPhotEvt &phevt = *(MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
    3232
    33     Int_t icount = 0 ;
    3433    MCamDisplay display(&geomcam) ;
    3534
    3635    while (read.Process())
    3736    {
    38         cout << "Event: " << icount++  << endl  ;
     37        cout << "Event #" << read.GetEventNum() ":" << endl;
    3938
    4039        ncalc.Process();
Note: See TracChangeset for help on using the changeset viewer.