Changeset 705 for trunk/MagicSoft


Ignore:
Timestamp:
03/27/01 15:52:41 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/getCollArea.C

    r689 r705  
    1515
    1616
    17   MReadTree reader( filename ,"Events" ) ;
     17  MReadTree reader( "Events", filename) ;
    1818  tasklist->AddToList( &reader ) ;
    1919
  • trunk/MagicSoft/Mars/macros/readMagic.C

    r700 r705  
    1313    plist->AddToList(&tlist);
    1414
    15     MReadTree    read("oscar_protons.root", "Events") ;
     15    MReadTree    read("Events", "oscar_protons.root");
     16    MReadTree    read.AddFile("test.root");
    1617    MCerPhotCalc ncalc;
    1718    MImgCleanStd clean;
     
    3738    {
    3839        cout << "Event: " << icount++  << endl  ;
    39 
    40         if (icount < 45 )
    41             continue;
    4240
    4341        ncalc.Process();
  • trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc

    r698 r705  
    1414#include "MParList.h"
    1515#include "MCerPhotEvt.h"
    16 #include "MCT1Pedestals.h"
     16#include "MPedestalCam.h"
    1717
    1818ClassImp(MCT1ReadAscii)
     
    5757    //  look for the pedestal class in the plist
    5858    //
    59     fPedest = (MCT1Pedestals*)pList->FindCreateObj("MCT1Pedestals");
     59    fPedest = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    6060    if (!fPedest)
    6161        return kFALSE;
    6262
     63    fPedest->InitSize(127);
     64
    6365    return kTRUE;
     66}
     67
     68void MCT1ReadAscii::ReadPedestals()
     69{
     70    *fLog << "MCT1Pedestals::AsciiRead: Reading Pedestals..." << endl;
     71
     72    //
     73    // skip the next 4 values
     74    //
     75    Float_t val;
     76
     77    *fIn >> val;
     78    *fIn >> val;
     79    *fIn >> val;
     80    *fIn >> val;
     81
     82    //
     83    //    read in the next 127 numbers as the pedestals
     84    //
     85    for (Int_t i = 0; i<127; i++)
     86    {
     87        *fIn >> val;
     88
     89        if (val > 0.0)
     90            (*fPedest)[i].SetSigma(val);
     91    }
     92}
     93
     94void MCT1ReadAscii::ReadData()
     95{
     96    //
     97    // clear the list of cerphot-events
     98    //
     99    fNphot->Clear();
     100
     101    //
     102    // five unsused numbers
     103    //
     104    Int_t val;
     105
     106    *fIn >> val;   // ener
     107    *fIn >> val;   // zenang
     108    *fIn >> val;   // sec1
     109    *fIn >> val;   // sec2
     110
     111    //
     112    // read in the number of cerenkov photons and add the 'new' pixel
     113    // too the list with it's id, number of photons and error
     114    //
     115    for (Int_t i = 0; i<127; i++ )
     116    {
     117        Float_t nphot;
     118
     119        *fIn >> nphot;
     120
     121        if (nphot > 0.0)
     122            fNphot->AddPixel(i, nphot, (*fPedest)[i].GetSigma());
     123    }
     124
    64125}
    65126
     
    74135 
    75136    //
    76     // read in a dummy number (event number)
     137    // read in the event nr
    77138    //
    78     Int_t dummyI;
    79     *fIn >> dummyI;
     139    Int_t evtnr;
     140    *fIn >> evtnr;
    80141
    81142    //
     
    89150    // read in pedestals
    90151    //
    91     if (dummyI < 0)
    92         fPedest->AsciiRead(*fIn);
     152    // FIXME! Set InputStreamID
    93153
    94     //
    95     // five unsused numbers
    96     //
    97     *fIn >> dummyI;   // ener
    98     *fIn >> dummyI;   // zenang
    99     *fIn >> dummyI;   // sec1
    100     *fIn >> dummyI;   // sec2
     154    if (evtnr < 0)
     155    {
     156        ReadPedestals();
     157        return kCONTINUE;
     158    }
    101159
    102     //
    103     // clear the list of cerphot-events
    104     //
    105     fNphot->Clear();
    106 
    107     //
    108     // read in the number of cerenkov photons and add the 'new' pixel
    109     // too the list with it's id, number of photons and error
    110     //
    111     for (Int_t i = 0; i<127; i++ )
    112     {
    113         Float_t nphot;
    114 
    115         *fIn >> nphot;
    116 
    117         if (nphot > 0.0)
    118             fNphot->AddPixel(i, nphot, (*fPedest)[i]);
    119     }
     160    ReadData();
    120161
    121162    return kTRUE;
  • trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.h

    r698 r705  
    77
    88class MCerPhotEvt;
    9 class MCT1Pedestals;
     9class MPedestalCam;
    1010
    1111class MCT1ReadAscii : public MTask
    1212{
    1313private:
    14     TString        fFileName;    //! the file name of the string
    15     ifstream      *fIn;          //! the inputfile
    16     MCerPhotEvt   *fNphot;       //! the data container for all data.
    17     MCT1Pedestals *fPedest;      //! ct1 pedestals
     14    TString       fFileName;    //! the file name of the string
     15    ifstream     *fIn;          //! the inputfile
     16    MCerPhotEvt  *fNphot;       //! the data container for all data.
     17    MPedestalCam *fPedest;      //! ct1 pedestals
     18
     19    void ReadPedestals();
     20    void ReadData();
    1821
    1922public:
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r698 r705  
    2828.SUFFIXES: .c .cc .cxx .h .hxx .o
    2929
    30 SRCFILES = MCT1Pedestals.cc \
    31            MCT1ReadAscii.cc \
     30SRCFILES = MCT1ReadAscii.cc \
    3231           MPedestalCam.cc \
    3332           MPedestalPix.cc \
  • trunk/MagicSoft/Mars/mbase/BaseLinkDef.h

    r604 r705  
    44#pragma link off all classes;
    55#pragma link off all functions;
     6
     7#pragma link C++ global kCONTINUE;
     8#pragma link C++ global kGAMMA;
     9#pragma link C++ global kPROTON;
     10#pragma link C++ global kHELIUM;
     11#pragma link C++ global kOXIGEN;
     12#pragma link C++ global kIRON;
     13#pragma link C++ global kPI;
     14#pragma link C++ global kRad2Deg;
    615
    716#pragma link C++ global gLog;
  • trunk/MagicSoft/Mars/mbase/MLogManip.h

    r698 r705  
    5353//
    5454#ifndef __CINT__
    55 #define dbginf        __FILE__ << " l." << __LINE__ << ": "
     55#define dbginf      __FILE__ << " l." << __LINE__ << ": "
    5656#endif
    5757//
     
    6363//
    6464#ifndef __CINT__
    65 #define DEBUG(lvl)    flush << debug(lvl) << dbginf
     65#define DEBUG(lvl)  flush << debug(lvl) << dbginf
    6666#endif
    6767
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r698 r705  
    2121
    2222#include "MLog.h"
     23#include "MLogManip.h"
    2324
    2425ClassImp(MParList)
     
    9192  if (fContainer.FindObject(obj))
    9293  {
    93       *fLog << "WARNING: MParList::add: Container already added" << endl;
     94      *fLog << dbginf << "Container already added" << endl;
    9495      return kTRUE;
    9596  }
     
    103104      if (!fContainer.FindObject(where))
    104105      {
    105           *fLog << "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl;
     106          *fLog << dbginf << "Cannot find parameter container after which the new one should be added!" << endl;
    106107          return kFALSE;
    107108      }
     
    139140    // if object is not existing in the list try to create one
    140141    //
    141     *fLog << "MParList::CreateObject - Warning: '" << name << "' not found... creating." << endl;
     142    *fLog << dbginf << "'" << name << "' not found... creating." << endl;
    142143
    143144    //
     
    151152        // if class is not existing in the root environment
    152153        //
    153         *fLog << "MParList::CreateObject - Warning: Class '" << name << "' not existing in dictionary." << endl;
     154        *fLog << dbginf << "Class '" << name << "' not existing in dictionary." << endl;
    154155        return NULL;
    155156    }
     
    175176  //   print some information about the current status of MParList
    176177  //
    177   *fLog << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
     178  *fLog << dbginf << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
    178179  *fLog << endl;
    179180 
  • trunk/MagicSoft/Mars/mbase/MReadTree.h

    r698 r705  
    77
    88class TFile;
    9 class TTree;
     9class TChain;
    1010
    1111class MReadTree : public MTask
     
    1313private:
    1414    TFile  *fFile;       // Pointer to file
    15     TTree  *fTree;       // Pointer to tree
     15    TChain *fChain;      // Pointer to tree
    1616
    1717    UInt_t  fNumEntry;   // Number of actual entry
    1818    UInt_t  fNumEntries; // Number of Events in Tree
    1919
    20     TString fFileName;   // Name of File
    21     TString fTreeName;   // Name of Tree
    22 
    2320public:
    24     MReadTree(const char *filename, const char *treename, const char *name=NULL, const char *title=NULL);
     21    MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
     22    ~MReadTree();
    2523
    2624    Bool_t PreProcess(MParList *pList);
    2725    Bool_t Process();
    2826    Bool_t PostProcess();
     27
     28    void AddFile(const char *fname);
    2929
    3030    Bool_t GetEvent() ;
     
    3333    Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
    3434    Bool_t SetEventNum(UInt_t nr);    // set number of event (position in tree)
    35     UInt_t GetEventNum() {return fNumEntry;}
    36     UInt_t GetEntries() {return fNumEntries;}
     35
     36    UInt_t GetEventNum() const { return fNumEntry;   }
     37    UInt_t GetEntries() const  { return fNumEntries; }
    3738
    3839    ClassDef(MReadTree, 0)      // Reads one tree
  • trunk/MagicSoft/Mars/mdatacheck/MViewAdcSpectra.cc

    r698 r705  
    7474  plist.AddToList(&tasks);
    7575
    76   MReadTree readin ( inputfile, treeName ) ;
     76  MReadTree readin ( treeName, inputfile ) ;
    7777  tasks.AddToList( &readin ) ;
    7878
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc

    r698 r705  
    5252
    5353 
    54   fReadTree  =  new MReadTree ( filename, treename ) ;
     54  fReadTree  =  new MReadTree ( treename, filename ) ;
    5555  fReadTree->PreProcess( pList ) ;
    5656
Note: See TracChangeset for help on using the changeset viewer.