Ignore:
Timestamp:
04/25/02 11:21:46 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmontecarlo
Files:
2 edited

Legend:

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

    r1108 r1300  
    3333#include "MMcEvt.hxx"
    3434#include "MMcTrig.hxx"
     35#include "MMcRunHeader.hxx"
    3536
    3637#include "MHMcCollectionArea.h"
     
    7374        return kFALSE;
    7475
     76
     77    fTotalNumSimulatedShowers = 0;
     78    fCorsikaVersion           = 0;
     79    fAllEvtsTriggered         = kFALSE;
     80
     81    return kTRUE;
     82}
     83
     84Bool_t MMcCollectionAreaCalc::ReInit(MParList *plist)
     85{
     86    MMcRunHeader *runheader = (MMcRunHeader*)plist->FindObject("MMcRunHeader");
     87    if (!runheader)
     88    {
     89        *fLog << err << dbginf << "Error - MMcRunHeader not found... exit." << endl;
     90        return kFALSE;
     91    }
     92
     93    fTotalNumSimulatedShowers += runheader->GetNumSimulatedShowers();
     94
     95    *fLog << inf << "Total Number of Simulated showers: " << fTotalNumSimulatedShowers << endl;
     96
     97    if (fTheta>=0 && fTheta!=runheader->GetTelesTheta())
     98        *fLog << warn << dbginf << "Warning - Read files have different TelesTheta... exit." << endl;
     99
     100    fTheta = runheader->GetTelesTheta();
     101
     102    if (fCorsikaVersion!=0 && fCorsikaVersion!=runheader->GetCorsikaVersion())
     103        *fLog << warn << dbginf << "Warning - Read files have different Corsika versions... exit." << endl;
     104
     105    fCorsikaVersion = runheader->GetCorsikaVersion();
     106
     107    fAllEvtsTriggered |= runheader->GetAllEvtsTriggered();
     108
     109    *fLog << inf << "Only triggered events avail: " << (fAllEvtsTriggered?"yes":"no") << endl;
     110
    75111    return kTRUE;
    76112}
     
    81117    const Float_t impact = fMcEvt->GetImpact()/100.;
    82118
    83     fCollArea->FillAll(energy, impact);
     119    if (!fAllEvtsTriggered)
     120        fCollArea->FillAll(energy, impact);
    84121
    85122    if (fMcTrig->GetFirstLevel() <= 0)
     
    96133    //   do the calculation of the effectiv area
    97134    //
    98     fCollArea->CalcEfficiency();
     135    *fLog << inf << "Calculation Collection Area..." << endl;
     136
     137    if (!fAllEvtsTriggered)
     138        fCollArea->CalcEfficiency();
     139    else
     140    {
     141        *fLog << inf << "Total number of showers: " << fTotalNumSimulatedShowers << endl;
     142        fCollArea->CalcEfficiency(fTotalNumSimulatedShowers,
     143                                  fCorsikaVersion == 5200 ? fTheta : 0);
     144    }
    99145
    100146    return kTRUE;
    101147}
     148
  • trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.h

    r1016 r1300  
    2121    TString fObjName;
    2222
     23    UInt_t fTotalNumSimulatedShowers;
     24    UInt_t fCorsikaVersion;
     25    Float_t fTheta;
     26
     27    Bool_t fAllEvtsTriggered;
     28
    2329public:
    2430    MMcCollectionAreaCalc(const char *input=NULL,
    2531                          const char *name=NULL, const char *title=NULL);
     32
     33    Bool_t ReInit(MParList *plist);
    2634
    2735    Bool_t PreProcess(MParList *pList);
Note: See TracChangeset for help on using the changeset viewer.