Ignore:
Timestamp:
09/29/03 17:39:49 (21 years ago)
Author:
stamerra
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1991 r2365  
    2424    parlist.AddToList(&tasklist);
    2525
    26     MGeomCamMagic geocam;
    27     parlist.AddToList(&geocam);
    28 
    29     //    MHillas hillas;
    30     // parlist.AddToList(&hillas);
    31 
    32     // An instance of the class MMcTriggerLvl2 is created and added to the
    33     //  parameter list
    34     MMcTriggerLvl2 cell;     
    35     parlist.AddToList(&cell);
    36 
    37     // Set the number of Next Neighbourhoods that define a compact pixel
    38     //
    39     cell.SetCompactNN(3);
    40     //  USER:       --^
    41 
    42     //
    43     //  A filter to select events using the L2T parameters is created
    44     //
    45     MF lvl2filter("MMcTriggerLvl2.fLutPseudoSize > 8");
    46 
    47     //
    48     // A second filter is created using the class MFTriggerLvl2
    49     //
    50     MFTriggerLvl2 fTrig("MMcTriggerLvl2", '>', 8);
    51     //      USER:       fValue to be compared --^
    52 
    53     //
    54     // A selection on the number and energy of the events
    55     //
    56     MF energyfilter("MMcEvt.fEnergy > 100");
    57     MFEventSelector selector;
    58     //selector.SetNumSelectEvts(4000);
    59 
    60 
    61     // Filter to select events according to a give slope
    62     MFEnergySlope eslope;
    63 
    64     eslope.SetMcMinEnergy(50.);
    65     eslope.SetMcMaxEnergy(400.);
    66     eslope.SetNewSlope(-3.91);
    67 
    68     // A filter list is created; the filters created can be added to the list
    69     //
    70     MFilterList flist;
    71     //   flist.AddToList(&energyfilter);
    72     //   flist.AddToList(&lvl2filter);
    73     //   flist.AddToList(&selector);
    74     //   flist.AddToList(&eslope);
    75        flist.AddToList(&fTrig);
    76 
    77 
    7826    //
    7927    // Setup our tasks:
     
    8129    //  - Then we can fill the efficiency histograms
    8230    //
     31   
     32
    8333    MReadMarsFile reader("Events", filename);
    8434    reader.DisableAutoScheme();
     
    8939    tasklist.AddToList(&reader);
    9040
     41    MGeomCamMagic geocam;
     42    parlist.AddToList(&geocam);
     43
     44    //    MHillas hillas;
     45    // parlist.AddToList(&hillas);
     46
     47    // An instance of the class MMcTriggerLvl2 is created and added to the
     48    //  parameter list
     49    MMcTriggerLvl2 cell;     
     50    parlist.AddToList(&cell);
     51
     52    MMcEvt mevt;
     53    parlist.AddToList(&mevt);
     54
     55    // Set the number of Next Neighbourhoods that define a compact pixel
     56    //
     57    cell.SetCompactNN(2);
     58    //  USER:       --^
     59
     60    //
     61    //  A filter to select events using the L2T parameters is created
     62    //
     63
     64    // MF lvl2filter("MMcTriggerLvl2.fPseudoSize > 25 && MMcTriggerLvl2.fPseudoSize < 31");
     65    MF lvl2filter("MMcTriggerLvl2.fPseudoSize > 15");
     66 
     67    //
     68    // A second filter is created using the class MFTriggerLvl2
     69    //
     70    MFTriggerLvl2 fTrig("MMcTriggerLvl2", '>', 8);
     71    //      USER:       fValue to be compared --^
     72
     73    //
     74    // A selection on the number and energy of the events
     75    //
     76    MF energyfilter("MMcEvt.fEnergy > 100");
     77    MFEventSelector selector;
     78    //selector.SetNumSelectEvts(4000);
     79
     80
     81    // Filter to select events according to a give slope
     82    MFEnergySlope eslope;
     83
     84    eslope.SetMcMinEnergy(50.);
     85    eslope.SetMcMaxEnergy(400.);
     86    eslope.SetNewSlope(-.5);
     87
     88    // A filter list is created; the filters created can be added to the list
     89    //
     90    MFilterList flist;
     91    //flist.AddToList(&energyfilter);
     92    //flist.AddToList(&lvl2filter);
     93    //   flist.AddToList(&selector);
     94    //   flist.AddToList(&eslope);
     95    //   flist.AddToList(&fTrig);
     96
     97
     98   
     99    //
     100    // The task to calculate the L2T parameter is added to the task list
     101    //
     102    MMcTriggerLvl2Calc calcps("MMcTriggerLvl2","MMcTriggerLvl2"); 
     103    tasklist.AddToList(&calcps);
     104
    91105    //
    92106    // The filter list is added to the task list
     
    98112    //
    99113    MMcCollectionAreaCalc effi;
    100     tasklist.AddToList(&effi);
    101 
     114    tasklist.AddToList(&effi);   
    102115    //
    103116    // The filter list selects events for the effective area calculation
     
    105118    effi.SetFilter(&flist);
    106119 
    107     //
    108     // The task to calculate the L2T parameter is added to the task list
    109     //
    110     MMcTriggerLvl2Calc fill("MMcTriggerLvl2","MMcTriggerLvl2"); 
    111     tasklist.AddToList(&fill);
    112120
    113121    //
     
    116124    MFillH hfill1("MHMcTriggerLvl2","MMcTriggerLvl2");
    117125    tasklist.AddToList(&hfill1);
    118 
     126    //hfill1.SetFilter(&flist);
     127    //MFillH hfill2("MHMcTriggerLvl2", &mevt, &cell);
     128    //tasklist.AddToList(&hfill2);
     129    //hfill2.SetFilter(&flist);
     130
     131   
     132   
    119133    //
    120134    // set up the loop for the processing
     
    123137    magic.SetParList(&parlist);
    124138
     139   
    125140    //
    126141    // Start to loop over all events
     
    129144    magic.SetProgressBar(&bar);
    130145
     146
    131147    if (!magic.Eventloop())
    132148      return;
     149    /*
     150    if (!magic.PreProcess())
     151    return;
     152   
     153    while (tasklist.Process())
     154      {
     155        cout<< mevt.GetEnergy()<<endl;
     156       
     157        cell.Print();
     158      }
     159    */
     160    //fMcEvt = (MMcEvt*)parlist->FindObject("MMcEvt");
     161    //if (!fMcEvt)
     162    //{
     163    //cout << "MMcEvt not found... exit." << endl;
     164    //*fLog << err << dbginf << "MMcEvt not found... exit." << endl;
     165    //  return kFALSE;
     166    //}
     167    //   cout << "fMcEvt = " << fMcEvt << endl;
     168
     169    //parlist.FindObject("MHMcTriggerLvl2")->Fill((Double_t) fMcEvt->GetEnergy(), cell);
     170
    133171
    134172    tasklist.PrintStatistics();
     
    140178    parlist.FindObject("MHMcCollectionArea")->DrawClone();
    141179
     180    parlist.FindObject("MHMcTriggerLvl2")->DrawClone("sbc");
    142181    parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps");
    143     //     parlist.FindObject("MHMcTriggerLvl2")->DrawClone();
     182    parlist.FindObject("MHMcTriggerLvl2")->DrawClone();
     183    parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy");
    144184
    145185    // Returns histogram of the class MHMcTriggerLvl2 
    146     //   parlist.FindObject("MHMcTriggerLvl2")->GetHistByName("hfPseudoSize"));
    147    
     186
     187    MHMcTriggerLvl2 *htrig = (MHMcTriggerLvl2 *)parlist.FindObject("MHMcTriggerLvl2");
     188    TH1F *h1 = htrig->GetHistByName("fHistPseudoSize");
     189    TH2D *h2 = htrig->GetHistPseudoSizeEnergy();
     190
     191    // h2->DrawClone();
     192
     193    hfile = new TFile("HistFileLUT.root", "RECREATE");
     194    h1->Write();
     195    h2->Write();
     196    hfile->Close();
     197
    148198}
    149199
Note: See TracChangeset for help on using the changeset viewer.