Changeset 983 for trunk


Ignore:
Timestamp:
10/24/01 12:53:58 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmontecarlo
Files:
4 edited

Legend:

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

    r967 r983  
    7272}
    7373
    74 Bool_t MMcCollectionAreaCalc::Process ()
     74Bool_t MMcCollectionAreaCalc::Process()
    7575{
    7676    const Float_t energy = log10(fMcEvt->GetEnergy());
  • trunk/MagicSoft/Mars/mmontecarlo/MMcThresholdCalc.cc

    r893 r983  
    6666//
    6767MMcThresholdCalc::MMcThresholdCalc(const Int_t dim, const char* name,
    68                                    const char* title) : fDimension(dim)
     68                                   const char* title)
     69    : fDimension(dim), fMcTrig(NULL), fEnergy(NULL)
    6970{
    7071    *fName  = name  ? name  : "MMcThresholdCalc";
     
    108109        fDimension = -fDimension;
    109110
     111    if (fDimension==0)
     112        fDimension=1;
     113
    110114    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, fDimension));
    111115    if (fMcTrig->GetEntriesFast() != fDimension)
     
    116120
    117121    fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", from, fDimension));
    118     if (fMcTrig->GetEntriesFast() != fDimension)
     122    if (fMcTrig->GetEntriesFast() != fDimension && fDimension)
     123    {
     124        *fLog << dbginf << "Error: Not all requested MHMcEnergy objects are available...aborting." << endl;
    119125        return kFALSE;
     126    }
    120127
    121128    return kTRUE;
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc

    r954 r983  
    3737
    3838void MMcTriggerRateCalc::Init(int dim, int part, float *trigbg,
    39                               float simbg, float spec, float flux0,
     39                              float simbg,
    4040                              const char *name, const char *title)
    4141{
     
    5252
    5353    fPartId=part;
    54 
    55     fSpecInd=spec;
    56     fFlux0=flux0;
    5754}
    5855
     
    6158//  overloaded constructor I
    6259//
    63 //      dim: fDimension
    64 //      part: fPartId
     60//      dim:     fDimension
     61//      part:    fPartId
    6562//      *trigbg: number of shower from bacground that triggers
    6663//               a given trigger condition.
    67 //      simbg: Number of simulated showers for the bacground
    68 //      rate: rate of incident showers
     64//      simbg:   Number of simulated showers for the background
     65//      rate:    rate of incident showers
    6966//
    7067
     
    7370                                       const char *name, const char *title)
    7471{
    75     Init(dim, part, trigbg, simbg, rate, 0, name, title);
     72    Init(dim, part, trigbg, simbg, name, title);
    7673}
    7774
     
    8178//  overloaded constructor II
    8279//
    83 //      dim: fDimension
    84 //      part: fPartId
     80//      dim:     fDimension
     81//      part:    fPartId
    8582//      *trigbg: number of shower from bacground that triggers
    8683//               a given trigger condition.
    87 //      simbg: Number of simulated showers for the bacground
    88 //      spec: spectral index
    89 //      flux0; fFlux0
    90 //
    91 
     84//      simbg:   Number of simulated showers for the background
     85//
    9286MMcTriggerRateCalc::MMcTriggerRateCalc(int dim, int part, float *trigbg,
    93                                        float simbg, float spec, float flux0,
     87                                       float simbg,
    9488                                       const char *name, const char *title)
    9589{
    96     Init(dim, part, trigbg, simbg, spec, flux0, name, title);
     90    Init(dim, part, trigbg, simbg, name, title);
    9791}
    9892
     
    122116        fDimension = -fDimension;
    123117
     118    if (fDimension==0)
     119        fDimension=1;
     120
    124121    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, fDimension));
    125122    if (fMcTrig->GetEntriesFast() != fDimension)
     
    160157Bool_t MMcTriggerRateCalc::Process()
    161158{
     159    //
    162160    //  Counting analysed and simulated showers
    163 
     161    //
    164162    fShowers++;
    165163    if (fMcEvt->GetPhotElfromShower())
    166164        fAnalShow++;
    167165
     166    //
    168167    //  Getting angles, energy and impact parameter to set boundaries
    169 
    170     const Float_t theta=fMcEvt->GetTheta();
    171     const Float_t phi  =fMcEvt->GetPhi();
    172     const Float_t param=fMcEvt->GetImpact();
    173     const Float_t ener =fMcEvt->GetEnergy()/1000.0;
    174 
     168    //
     169    const Float_t theta = fMcEvt->GetTheta();
     170    const Float_t phi   = fMcEvt->GetPhi();
     171    const Float_t param = fMcEvt->GetImpact();
     172    const Float_t ener  = fMcEvt->GetEnergy()/1000.0;
     173
     174    //
    175175    //  Counting number of triggers
    176 
     176    //
    177177    for (int i=0; i<fDimension; i++)
    178178    {
     
    191191Bool_t MMcTriggerRateCalc::PostProcess()
    192192{
    193     // Computing trigger rate and showing it
     193    //
     194    // Computing trigger rate
     195    //
    194196    for (int i=0; i<fDimension; i++)
    195     {
    196         MHMcRate &rate = *GetRate(i);
    197 
    198         rate.CalcRate(fTrigger[i], fAnalShow, fShowers);
    199         // rate.Print();
    200         // rate.Draw("S");
    201     }
     197        GetRate(i)->CalcRate(fTrigger[i], fAnalShow, fShowers);
    202198
    203199    return kTRUE;
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h

    r898 r983  
    2626
    2727    Int_t      fDimension;     // Information about the trigger conditions
    28     // in the root file to be read.
     28                               // in the root file to be read.
    2929
    3030    Float_t    fTrigger[10];   // Number of triggered showers
     
    3434    Int_t      fPartId;        // Incident particle that generates showers
    3535
    36     Float_t    fSpecInd;       // Spectral indec of the simualtion
    37     Float_t    fFlux0;         // Flux 0 for the differential flux
    38 
    3936    void Init(int dim, int part, float *trigbg,
    40               float simbg, float spec, float flux0,
    41               const char *name, const char *title);
     37              float simbg, const char *name, const char *title);
    4238
    4339    MHMcRate *GetRate(UInt_t i) const { return (MHMcRate*)((*fMcRate)[i]); }
     
    4642public:
    4743    MMcTriggerRateCalc(int dim=0, int part=14, float *trigbg=NULL,
    48                        float simbg=100000, float spec=2.75, float flux0=10.92e-2,
     44                       float simbg=100000,
    4945                       const char *name=NULL, const char *title=NULL);
    5046
Note: See TracChangeset for help on using the changeset viewer.