Changeset 1342 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
06/03/02 15:43:45 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1341 r1342  
    9292  * mdata/MReadTree.cc:
    9393     - fixed a root bug for root versions<3.03/00 (the open file in
    94        the TChain was not deleted (closed))
     94       the TChain was not deleted (closed))           
     95
     96   * mbase/MReadMarsFile.[h,cc]:
     97     - store parlist instead of tasklist
     98     - check for run types between files
     99     - check for used reflector version (because of a bug in the program)
     100
     101   * mmc/MMcRunheader.hxx:
     102     - added GetReflVersion()
     103
     104   * mmontecarlo/MMcTriggerRateCalc.cc:
     105     - changed particle Id numbers to predefined constants
    95106
    96107
  • trunk/MagicSoft/Mars/mbase/MReadMarsFile.cc

    r1337 r1342  
    4141#include "MParList.h"
    4242#include "MTaskList.h"
     43
     44#include "MRawRunHeader.h"
     45
     46#include "MMcRunHeader.hxx"
    4347
    4448ClassImp(MReadMarsFile);
     
    109113{
    110114    Int_t runtype = -1;
    111 /*
    112     const MRawRunHeader *runheader = (MRawRunHeader*)fParList->FindObject("MRawRunHeader");
    113     if (runheader)
    114         runtype = runheader->GetRunType();
    115 */
     115
     116    const MRawRunHeader *rawheader = (MRawRunHeader*)fParList->FindObject("MRawRunHeader");
     117    if (rawheader)
     118        runtype = rawheader->GetRunType();
     119
    116120    //
    117121    // Try to read the new run headers. If reading the new run header
     
    120124    const Int_t idx = GetFileIndex();
    121125    fRun->SetEventNum(idx<0?0:idx); // Assumption: One Entry per File!
    122     if (fRun->Process())
     126    if (!fRun->Process())
    123127    {
    124         *fLog << inf << "MReadMarsFile: Switching to #" << GetFileIndex();
    125         *fLog << " '" << GetFileName() << "' (before event #";
    126         *fLog << GetEventNum()-1 << ")" << endl;
    127 /*
    128         if (runheader)
    129             if (runtype != runheader->GetRunType())
    130                 *fLog << warn << "Warning - You are mixing files with different run types!" << endl;
    131 */
    132         if (fTaskList->ReInit())
    133             return kTRUE;
     128        *fLog << err << "ERROR - Cannot read new runheaders #" << idx;
     129        *fLog << " after reading event #" << GetEventNum() << endl;
     130        return kFALSE;
     131    }
    134132
    135         //MReadTree::Notify();
     133    *fLog << inf << "MReadMarsFile: Switching to #" << GetFileIndex();
     134    *fLog << " '" << GetFileName() << "' (before event #";
     135    *fLog << GetEventNum()-1 << ")" << endl;
    136136
    137         *fLog << err << "ERROR - ReInit of '" << fTaskList->GetName() << "' failed." << endl;
     137    if (rawheader)
     138    {
     139        if (runtype != rawheader->GetRunType())
     140            *fLog << warn << "Warning - You are mixing files with different run types!" << endl;
    138141    }
    139     else
    140         *fLog << err << "ERROR - Cannot read new runheaders after reading event #" << GetEventNum() << endl;
    141142
     143    const MMcRunHeader *mcheader = (MMcRunHeader*)fParList->FindObject("MMcRunHeader");
     144    if (mcheader)
     145    {
     146        if (mcheader->GetReflVersion()<=40 && mcheader->GetTelesTheta()>15)
     147        {
     148            *fLog << warn << "Warning - You may use Monte Carlo data produced with a version" << endl;
     149            *fLog << "of the reflector program < 0.4 and a zenith angle > 15," << endl;
     150            *fLog << "in this case you may get less photons than you would expect." << endl;
     151        }
     152    }
     153
     154    MTaskList *tlist = (MTaskList*)fParList->FindObject("MTaskList");
     155    if (!tlist)
     156    {
     157        *fLog << err << dbginf << "ERROR - Task List not found in Parameter List." << endl;
     158        return kFALSE;
     159    }
     160
     161    if (tlist->ReInit())
     162        return kTRUE;
     163
     164    //MReadTree::Notify();
     165
     166    *fLog << err << "ERROR - ReInit of '" << tlist->GetName() << "' failed." << endl;
    142167    return kFALSE;
    143168}
     
    151176{
    152177    fParList  = pList;
    153     fTaskList = (MTaskList*)pList->FindObject("MTaskList");
    154178
    155179    if (!fRun->PreProcess(pList))
  • trunk/MagicSoft/Mars/mbase/MReadMarsFile.h

    r1337 r1342  
    1414    MReadTree *fRun;
    1515    MParList  *fParList;  //! Parlist for reinitialization
    16     MTaskList *fTaskList; //! Tasklist for reinitialization
    1716
    1817    Bool_t Notify();
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc

    r1166 r1342  
    159159
    160160        rate.SetParticle(fPartId);
    161         if (fPartId ==14)
    162             rate.SetFlux(0.1091, 2.75);
    163         else if (fPartId == 402)
    164             rate.SetFlux(0.0660, 2.62);
    165         else {
     161        switch (fPartId)
     162        {
     163        case kPROTON:
     164            rate.SetFlux(0.1091, 2.75);
     165            break;
     166        case kHELIUM:
     167            rate.SetFlux(0.0660, 2.62);
     168            break;
     169        default:
    166170            *fLog << err << dbginf << "Unknown incident flux parameters for ";
    167171            *fLog << fPartId<< " particle Id ... aborting." << endl;
Note: See TracChangeset for help on using the changeset viewer.