Changeset 1777 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/20/03 17:00:31 (22 years ago)
Author:
stamerra
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
4 deleted
4 edited

Legend:

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

    r1741 r1777  
    1 
    2 Bool_t HandleInput()
    3 {
    4     TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
    5     while (1)
    6     {
    7         //
    8         // While reading the input process gui events asynchronously
    9         //
    10         timer.TurnOn();
    11         TString input = Getline("Type 'q' to exit, <return> to go on: ");
    12         timer.TurnOff();
    13 
    14         if (input=="q\n")
    15             return kFALSE;
    16 
    17         if (input=="\n")
    18             return kTRUE;
    19     };
    20 
    21     return kFALSE;
    22 }
    23 
    24 void triglvl2(char *filename = "../../Mars-0.8/gamma_new.root")
     1//   triglvl2.C
     2//  Macro to use the class MMcTriggerLvl2, which calculates the
     3//   2nd level trigger (L2T) selection parameters.
     4//  Filters to select events using these parameter are also created.
     5//
     6void triglvl2(char *filename = "Gamma.root")
    257{
    268    //
     
    3012    MTaskList tasklist;
    3113
    32     MTrigLvl2 cell;
    33      
    34     parlist.AddToList(&cell);
    3514    parlist.AddToList(&tasklist);
    3615
     16    // An instance of the class MMcTriggerLvl2 is created and added to the
     17    //  parameter list
     18    MMcTriggerLvl2 cell;     
     19    parlist.AddToList(&cell);
     20
    3721    //
    38     // Setup out tasks:
     22    //  A filter to select events using the L2T parameters is created
     23    //
     24    //    MF lvl2filter("MMcTriggerLvl2.fLutPseudoSize > 6");
     25    MF lvl2filter("MMcTriggerLvl2.fSizeBiggerCell > 16");
     26    // A second filter is created using the class MFTriggerLvl2
     27    MFTriggerLvl2 fTrig1("MMcTriggerLvl2", '>', 6);
     28    //       this is the value to be compared --^
     29
     30    //
     31    // A selection on the number and energy of the events
     32    //
     33    MF energyfilter("MMcEvt.fEnergy > 10");
     34    MFEventSelector selector;
     35    selector.SetNumSelectEvts(4000);
     36
     37    // A filter list is created; the filters created can be added to the list
     38    //
     39    MFilterList flist;
     40    flist.AddToList(&energyfilter);
     41    flist.AddToList(&lvl2filter);
     42    flist.AddToList(&selector);
     43    flist.AddToList(&fTrig1);
     44
     45    //
     46    // Setup our tasks:
    3947    //  - First we have to read the events
    4048    //  - Then we can fill the efficiency histograms
    4149    //
    4250    MReadMarsFile reader("Events", filename);
    43     reader.EnableBranch("fEnergy");
    44     reader.EnableBranch("fImpact"); reader.EnableBranch("fTimeFirst[4]");
    45     reader.EnableBranch("fPixelsFirst[73][4]");
     51    reader.DisableAutoScheme();
     52     //  reader.EnableBranch("fEnergy");
     53     //  reader.EnableBranch("fImpact"); reader.EnableBranch("fTimeFirst[4]");
     54     //  reader.EnableBranch("fPixelsFirst[73][4]");
    4655   
    47    
    48    
    49     MTrigLvl2FillTask fill("MTrigLvl2FillTask","MTrigLvl2FillTask"); 
    50  
    5156    tasklist.AddToList(&reader);
    52       tasklist.AddToList(&fill);
    5357
     58    //
     59    // The task to calculate the L2T parameter is added to the task list
     60    //
     61    MMcTriggerLvl2Calc fill("MMcTriggerLvl2","MMcTriggerLvl2"); 
     62    tasklist.AddToList(&fill);
     63
     64    //
     65    //  Task to calculate and plot the effective area
     66    //
     67    MMcCollectionAreaCalc effi;
     68    tasklist.AddToList(&effi);
     69    //
     70    // The filter list selects events for the effective area calculation
     71    //
     72    effi.SetFilter(&flist);
     73
     74    //
     75    // The filter list is added to the task list
     76    //
     77    tasklist.AddToList(&flist);
    5478
    5579    //
     
    6589    magic.SetProgressBar(&bar);
    6690
    67 
    68    //  if (!magic.Eventloop())
    69    //         return;
    70 
    71 
    7291    if (!magic.PreProcess())
    7392      return;
    7493
    75 
    76 
    77     while (tasklist.Process())
    78       {
    79         cout << "Event #" << reader.GetEventNum() ":" << endl;
    80 
    81         cell.DrawLv1();
    82      
    83         //if (!HandleInput())
    84          // break;
    85     }
    86 
    87 
    88 
    89     magic.PostProcess();
     94    if (!magic.Eventloop())
     95      return;
    9096
    9197    tasklist.PrintStatistics();
    92 
    9398    //
    9499    // Now the histogram we wanted to get out of the data is
    95100    // filled and can be displayd
    96101    //
    97   // parlist.FindObject("MHMcCollectionArea")->DrawClone();
     102    parlist.FindObject("MHMcCollectionArea")->DrawClone();
     103
     104    magic.PostProcess();
     105
    98106}
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r1769 r1777  
    5252#pragma link C++ class MSelFinal+;
    5353
    54 #pragma link C++ class MTrigLvl2+;
    55 #pragma link C++ class MTrigLvl2FillTask+;
     54#pragma link C++ class MMcTriggerLvl2+;
     55#pragma link C++ class MMcTriggerLvl2Calc+;
    5656
    5757#endif
  • trunk/MagicSoft/Mars/mfilter/FilterLinkDef.h

    r1661 r1777  
    1111#pragma link C++ class MFEventSelector+;
    1212#pragma link C++ class MFTriggerLvl1+;
     13#pragma link C++ class MFTriggerLvl2+;
    1314#pragma link C++ class MFParticleId+;
    1415#pragma link C++ class MFDataChain+;
  • trunk/MagicSoft/Mars/mfilter/Makefile

    r1661 r1777  
    3232
    3333SRCFILES = MFTriggerLvl1.cc \
     34           MFTriggerLvl2.cc \
    3435           MF.cc \
    3536           MFilterList.cc \
Note: See TracChangeset for help on using the changeset viewer.