Ignore:
Timestamp:
06/20/01 10:41:23 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmontecarlo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc

    r749 r852  
    1717!
    1818!   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
    19 !   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!             Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2001
     
    3535MCollArea::MCollArea(const char *name, const char *title)
    3636{
    37   //
    38   //   default constructor
    39   //
     37    //
     38    //   default constructor
     39    //
    4040
    41   //   initialize the histogram for the distribution r vs E
    42   //
    43   //   we set the energy range from 1 Gev to 10000 GeV (in log 5 orders
    44   //   of magnitude) and for each order we take 10 subdivision --> 50 xbins
    45   //
    46   //   we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins
     41    //   initialize the histogram for the distribution r vs E
     42    //
     43    //   we set the energy range from 1 Gev to 10000 GeV (in log 5 orders
     44    //   of magnitude) and for each order we take 10 subdivision --> 50 xbins
     45    //
     46    //   we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins
    4747
    4848 
    49   *fName  = name  ? name  : "MCollArea";
    50   *fTitle = title ? title : "Data to Calculate Coll-Area";
    51  
    52  
    53   fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution",
    54                       50, 0., 5.,
    55                       50, 0., 500. ) ;
    56  
    57   fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution",
    58                       50, 0., 5.,
    59                       50, 0., 500. ) ;
     49    *fName  = name  ? name  : "MCollArea";
     50    *fTitle = title ? title : "Data to Calculate Coll-Area";
    6051
    61   fHistCol = new TH1D("collArea", "Collection Area",
    62                       50, 0., 5.) ;
    63  
    64 }
     52
     53    fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution",
     54                        50, 0., 5.,
     55                        50, 0., 500. ) ;
     56
     57    fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution",
     58                        50, 0., 5.,
     59                        50, 0., 500. ) ;
     60
     61    fHistCol = new TH1D("collArea", "Collection Area",
     62                        50, 0., 5.) ;
     63
     64}
    6565
    6666MCollArea::~MCollArea()
    67 { 
    68   delete fHistAll ;
    69   delete fHistSel ;
    70   delete fHistCol ;
    71 } 
     67{
     68    delete fHistAll ;
     69    delete fHistSel ;
     70    delete fHistCol ;
     71}
    7272
    7373void MCollArea::FillAll(Float_t log10E, Float_t radius)
    74 { 
    75   fHistAll->Fill(log10E, radius ) ;
    76 } 
     74{
     75    fHistAll->Fill(log10E, radius ) ;
     76}
    7777
    7878void MCollArea::FillSel(Float_t log10E, Float_t radius)
    79 { 
    80   fHistSel->Fill(log10E, radius ) ;
    81 } 
     79{
     80    fHistSel->Fill(log10E, radius ) ;
     81}
    8282
    83 void MCollArea::DrawAll() 
    84 { 
    85   fHistAll->Draw() ;
    86 } 
     83void MCollArea::DrawAll()
     84{
     85    fHistAll->Draw() ;
     86}
    8787
    88 void MCollArea::DrawSel() 
    89 { 
    90   fHistSel->Draw() ;
    91 } 
     88void MCollArea::DrawSel()
     89{
     90    fHistSel->Draw() ;
     91}
    9292
    93 void MCollArea::Draw(Option_t* option) 
    94 { 
    95   fHistCol->Draw(option) ;
    96 } 
     93void MCollArea::Draw(Option_t* option)
     94{
     95    fHistCol->Draw(option) ;
     96}
    9797
    9898void MCollArea::CalcEfficiency()
    99 { 
     99{
    100100    // Description!
    101101
     
    114114            const Float_t Nall = fHistAll->GetCellContent(ix, iy);
    115115
    116             if ( Nall <= 0 ) {
    117                 // cout << ix << " " << iy << endl ;
     116            if (Nall <= 0)
    118117                continue;
    119             }
    120118
    121119            const Double_t eff = N / Nall ;
    122120            const Double_t err = sqrt(Nall + Nall*N - N*N - N) / (Nall*Nall);
    123             /*
    124              cout << ix << " " << iy
    125              << " N " << N
    126              << " Nall " << Nall
    127              << " effi  " << eff
    128              << " error " << err
    129              << endl ;
    130              */
     121
    131122            fHistSel->SetCellContent(ix, iy, eff);
    132123            fHistSel->SetCellError(ix, iy, err);
  • trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc

    r749 r852  
    1717!
    1818!   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
    19 !   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!             Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2001
     
    2626#include "MCollAreaTrigger.h"
    2727
     28#include "MParList.h"
     29
    2830#include "MLog.h"
    2931#include "MLogManip.h"
    30 #include "MParList.h"
    3132
    32 #include "MCollArea.h"
    33 #include "MMcEvt.hxx"
     33#include "MMcEvt.hxx"
    3434#include "MMcTrig.hxx"
     35
     36#include "MHMcCollectionArea.h"
    3537
    3638ClassImp(MCollAreaTrigger)
     
    3840MCollAreaTrigger::MCollAreaTrigger (const char *name, const char *title)
    3941{
    40   *fName  = name  ? name  : "MCollAreaTrigger";
    41   *fTitle = title ? title : "Task to calc the collection area ";
     42    *fName  = name  ? name  : "MCollAreaTrigger";
     43    *fTitle = title ? title : "Task to calc the collection area ";
    4244}
    43 
    4445
    4546Bool_t MCollAreaTrigger::PreProcess (MParList *pList)
    4647{
    47   // connect the raw data with this task
    48  
    49   fMcEvt  = (MMcEvt*)pList->FindObject("MMcEvt") ;
    50   if (!fMcEvt) {
    51     *fLog << dbginf << "MMcEvt not found... exit." << endl;
    52     return kFALSE;
    53   }
     48    // connect the raw data with this task
    5449
    55   fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig") ;
    56   if (!fMcTrig) {
    57     *fLog << dbginf << "MMcTrig not found... exit." << endl;
    58     return kFALSE;
    59   }
     50    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
     51    if (!fMcEvt)
     52    {
     53        *fLog << dbginf << "MMcEvt not found... exit." << endl;
     54        return kFALSE;
     55    }
    6056
    61   fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ;
    62   if (!fCollArea)
    63     return kFALSE;
     57    fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
     58    if (!fMcTrig)
     59    {
     60        *fLog << dbginf << "MMcTrig not found... exit." << endl;
     61        return kFALSE;
     62    }
    6463
    65   return kTRUE ;
     64    fCollArea = (MHMcCollectionArea*)pList->FindCreateObj("MHMcCollectionArea");
     65    if (!fCollArea)
     66        return kFALSE;
    6667
    67 }
    68 
     68    return kTRUE;
     69}
    6970
    7071Bool_t MCollAreaTrigger::Process ()
     
    7576    fCollArea->FillAll(energy, impact);
    7677
    77 
    7878    if (fMcTrig->GetFirstLevel() <= 0)
    7979        return kTRUE;
     
    8181    fCollArea->FillSel(energy, impact);
    8282
    83     return kTRUE ;
     83    return kTRUE;
    8484}
    8585
    8686Bool_t MCollAreaTrigger::PostProcess ()
    8787{
    88   //
    89   //   do the calculation of the effectiv area
    90   //
     88    //
     89    //   do the calculation of the effectiv area
     90    //
     91    fCollArea->CalcEfficiency();
    9192
    92   fCollArea->CalcEfficiency() ;
    93 
    94   return kTRUE ;
     93    return kTRUE;
    9594}
  • trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.h

    r698 r852  
    1 #ifndef MCOLLAREATRIGGER_H
    2 #define MCOLLAREATRIGGER_H
     1#ifndef MMCCOLLECTIONAREACALC_H
     2#define MMCCOLLECTIONAREACALC_H
    33
    44#ifndef MTASK_H
     
    77
    88class MParList;
    9 class MMcEvt ;
    10 class MMcTrig ;
    11 class MCollArea;
     9class MMcEvt;
     10class MMcTrig;
     11class MHMcCollectionArea;
    1212
    13 class MCollAreaTrigger : public MTask {
    14  private:
    15   MMcEvt          *fMcEvt    ; //!
    16   MMcTrig         *fMcTrig   ; //!
    17   MCollArea       *fCollArea ; //!
     13class MMcCollectionAreaCalc : public MTask
     14{
     15private:
     16    MMcEvt  *fMcEvt;
     17    MMcTrig *fMcTrig;
    1818
    19  public:   
    20   MCollAreaTrigger (const char *name=NULL, const char *title=NULL);
     19    MHMcCollectionArea *fCollArea;
    2120
    22   Bool_t PreProcess(MParList *pList);
    23   Bool_t Process() ;
    24   Bool_t PostProcess() ;
    25  
    26   ClassDef(MCollAreaTrigger, 0) // Task to fill the collection area histograms
     21public:
     22    MMcCollectionAreaCalc(const char *name=NULL, const char *title=NULL);
    2723
     24    Bool_t PreProcess(MParList *pList);
     25    Bool_t Process() ;
     26    Bool_t PostProcess() ;
     27
     28    ClassDef(MMcCollectionAreaCalc, 0) // Task to calculate the collection area histogram
    2829};
    2930
Note: See TracChangeset for help on using the changeset viewer.