Changeset 2036


Ignore:
Timestamp:
04/29/03 09:18:03 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2035 r2036  
    11                                                 -*-*- END OF LINE -*-*-
     2 2003/04/29: Abelardo Moralej0
     3
     4   * mmontecarlo/MMcCollectionareaCalc.[h,cc]
     5     - Now the energy limits and spectral slope used in Corsika are
     6       read from the run header. Warning: impact parameter is still
     7       fixed (I changed it from 400 m to 300 m, our present MC
     8       production default). Added warning message about this.
     9       Collection areas calculated up to now with the new MC library
     10       are overestimated by a ~77% ! This class will be removed in
     11       the future and replaced by MFillH.
     12
     13   * mhistmc/MHMcCollectionArea.[h,cc]
     14     - Adapted to the change of MMcCollectionAreaCalc. Added arguments
     15       to CalcEfficiency.
     16
    217 2003/04/28: Nadia Tonello
    318
    4   * mimage/MImgCleanStd.[h,cc]
     19   * mimage/MImgCleanStd.[h,cc]
    520     - added the option kDemocratic using sigmabar of the
    621        inner pixels
     
    924     - added documentation
    1025
    11   * manalysis/MCerPhotPix.[h,cc]
     26   * manalysis/MCerPhotPix.[h,cc]
    1227     - added fRing and Get-Set functions
    1328 
    1429 2003/04/28: Oscar Blanch
    1530
    16   * mgeom/MGeomCamECO1000.[h,cc]
    17     - New files for ECO 1000 camera geometry.
    18 
    19   * mgeom/GeomLinkDef.h
    20     - Added class MGeomCamECO1000
    21 
    22   * mgeom/Makefile
    23     - Added class MGeomCamECO1000
     31   * mgeom/MGeomCamECO1000.[h,cc]
     32     - New files for ECO 1000 camera geometry.
     33
     34   * mgeom/GeomLinkDef.h
     35     - Added class MGeomCamECO1000
     36
     37   * mgeom/Makefile
     38     - Added class MGeomCamECO1000
    2439
    2540 2003/04/28: Abelardo Moralejo
  • trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc

    r2015 r2036  
    4040#include "MHMcEnergyImpact.h"
    4141
     42#include "MLog.h"
     43#include "MLogManip.h"
     44
    4245ClassImp(MHMcCollectionArea);
    4346
     
    223226//  flag
    224227//
    225 void MHMcCollectionArea::CalcEfficiency(UInt_t numevts, Float_t angle)
     228void MHMcCollectionArea::CalcEfficiency(UInt_t numevts, Float_t emin, Float_t emax, Float_t index)
    226229{
    227230    // Here we estimate the total number of showers in each energy bin
     
    238241    MH::SetBinning(fHistCol, &xaxis);
    239242
    240     // TO BE FIXED! In forthcoming camera versions emin, emax and index
    241     // will be available in a run header, and should be read from it.
    242 
    243     const Float_t emin  = 10.;
    244     const Float_t emax  = 30000.;  // Energies in GeV.
    245     const Float_t index = 2.6;     // Differential spectral Index.
    246 
    247     const Float_t expo = 1.-index;
     243    const Float_t expo = 1+index;
    248244
    249245    const Float_t k = (Float_t)numevts / (pow(emax,expo) - pow(emin,expo));
     
    267263
    268264    // -----------------------------------------------------------
    269 
    270     // Impact parameter range:
     265    //
     266    // Impact parameter range:  TO BE FIXED! Impact parameter shoud be
     267    // read from run header, but it is not yet in!!
     268    //
    271269    const Float_t r1 = 0;
    272     const Float_t r2 = 400;
    273 
    274     const Float_t dr = TMath::Pi() * (r2*r2 - r1*r1);
    275 
    276     angle *= TMath::Pi()/180;
     270    const Float_t r2 = 300;
     271
     272    *fLog << warn << endl << dbginf << "WARNING! I will assume a maximum impact parameter of 300 meters for the MC events. Check that this is the true one!" <<endl<<endl;
     273    const Float_t area = TMath::Pi() * (r2*r2 - r1*r1);
    277274
    278275    for (Int_t ix=1; ix<=nbinx; ix++)
     
    294291        const Double_t eff = Ns/Na;
    295292
    296         const Double_t err = sqrt((1.-eff)*Ns)/Na;
    297 
    298         const Float_t area = dr * cos(angle);
     293        const Double_t efferr = sqrt((1.-eff)*Ns)/Na;
    299294
    300295        fHistCol->SetBinContent(ix, eff*area);
    301         fHistCol->SetBinError(ix, err*area);
     296        fHistCol->SetBinError(ix, efferr*area);
    302297    }
    303298
     
    340335
    341336            const Double_t eff = h.GetCellContent(ix, iy);
    342             const Double_t err = h.GetCellError(ix, iy);
     337            const Double_t efferr = h.GetCellError(ix, iy);
    343338
    344339            colA += eff*A;
    345             errA += A*A * err*err;
     340            errA += A*A * efferr*efferr;
    346341        }
    347342
  • trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h

    r2015 r2036  
    3838
    3939    void CalcEfficiency();
    40     void CalcEfficiency(UInt_t allevts, Float_t theta);
     40    void CalcEfficiency(UInt_t allevts, Float_t emin, Float_t emax, Float_t index);
    4141
    4242    void Calc(const MHMcEnergyImpact &mcsel, const MHMcEnergyImpact &mcall);
  • trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc

    r1715 r2036  
    2828//  MHMcCollectionAreaCalc
    2929//
    30 //  Remark: The initialization is maily done in the ReInit function.
     30//  Remark: The initialization is mainly done in the ReInit function.
    3131//          Please make sure, that you don't use MReadTree when processing
    3232//          a file. Use a 'ReInit'-calling task like MReadMarsFile
     
    4444#include "MMcTrig.hxx"
    4545#include "MMcRunHeader.hxx"
     46#include "MMcCorsikaRunHeader.h"
    4647
    4748#include "MHMcCollectionArea.h"
     
    7778        return kFALSE;
    7879
    79     fTheta                    = -1;
     80    fTheta                    =  -1;
     81    fEmin                     =  -1;
     82    fEmax                     =  -1;
     83    fSlope                    =   0;
    8084    fTotalNumSimulatedShowers =  0;
    8185    fCorsikaVersion           =  0;
     
    9195    {
    9296        *fLog << err << dbginf << "Error - MMcRunHeader not found... exit." << endl;
     97        return kFALSE;
     98    }
     99
     100    MMcCorsikaRunHeader *corrunheader  = (MMcCorsikaRunHeader*)plist->FindObject("MMcCorsikaRunHeader");
     101    if (!corrunheader)
     102    {
     103        *fLog << err << dbginf << "Error - MMcCorsikaRunHeader not found... exit." << endl;
    93104        return kFALSE;
    94105    }
     
    110121
    111122    fCorsikaVersion = runheader->GetCorsikaVersion();
     123
     124    if ( fEmin > 0 &&
     125         (fEmin  != corrunheader->GetELowLim() ||
     126          fEmax  != corrunheader->GetEUppLim() ||
     127          fSlope != corrunheader->GetSlopeSpec()) )
     128      *fLog << warn << dbginf << "Warning - Read files have different energy distribution..." << endl;
     129
     130    fEmin  = corrunheader->GetELowLim();
     131    fEmax  = corrunheader->GetEUppLim();
     132    fSlope = corrunheader->GetSlopeSpec();
    112133
    113134    fAllEvtsTriggered |= runheader->GetAllEvtsTriggered();
     
    167188    {
    168189        *fLog << inf << "Total number of showers: " << fTotalNumSimulatedShowers << endl;
    169         fCollArea->CalcEfficiency(fTotalNumSimulatedShowers,
    170                                   fCorsikaVersion == 5200 ? fTheta : 0);
     190        fCollArea->CalcEfficiency(fTotalNumSimulatedShowers, fEmin, fEmax, fSlope);
    171191    }
    172192
  • trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.h

    r1300 r2036  
    2424    UInt_t fCorsikaVersion;
    2525    Float_t fTheta;
     26    Float_t fEmin;
     27    Float_t fEmax;
     28    Float_t fSlope;
    2629
    2730    Bool_t fAllEvtsTriggered;
Note: See TracChangeset for help on using the changeset viewer.