Changeset 1337


Ignore:
Timestamp:
06/03/02 10:10:21 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
13 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1335 r1337  
    11                                                                  -*-*- END -*-*-
     2 2002/06/03: Thomas Bretz
     3
     4   * mhist/MHCompProb.[h,cc]:
     5     - added
     6
     7   * mhist/MHHadroness.[h,cc]:
     8     - added
     9
     10   * mhist/HistLinkDef.h, mhist/Makefile:
     11     - added MHCompProb
     12     - added MHHadroness
     13
     14   * mhist/MFillH.cc:
     15     - added a info-output
     16
     17   * mhist/MH3.cc:
     18     - excluded temporary profiles from directory
     19
     20   * mhist/MHMatrix.[h,cc]:
     21     - added code to calculate multi-dimensional distances
     22     - added comments
     23
     24   * mbase/MAGIC.h:
     25     - changed kGAMMA to 1
     26
     27   * mbase/MParList.[h,cc]:
     28     - added Replace-function
     29
     30   * mbase/MReadMarsFile.[h,cc]:
     31     - added correct seeking for the run headers
     32
     33   * mbase/MReadTree.[h,cc]:
     34     - added GetFileIndex()
     35
     36   * mbase/MTaskList.cc:
     37     - changed fTasksProcess.Delete() to fTasksProcess.Clear()
     38
     39   * mbase/MWriteAsciiFile.[h,cc]:
     40     - added some code for future usage (in comments)
     41
     42   * mbase/MLogo.[h,cc]:
     43     - added (not in use)
     44
     45   * mfilter/MFParticleId.[h,cc]:
     46     - added
     47
     48   * mfilter/Makefile, mfilter/FilterLinkDef.h:
     49     - added MFParticleId
     50
     51   * manalysis/MHadroness.[h,cc]:
     52     - added
     53
     54   * manalysis/MCompProbCalc.[h,cc]:
     55     - added
     56
     57   * manalysis/MMultiDimDistCalc.[h,cc]:
     58     - added
     59                                                           
     60   * manalysis/AnalysisLinkDef.h, manalysis/Makefile:
     61     - added MHadroness
     62     - added MCompProbCalc
     63     - added MMultiDimDistCalc
     64
     65   * manalysis/Makefile:
     66     - added ../mdata
     67     - added ../mhist
     68
     69   * macros/star.C:
     70     - added
     71
     72   * macros/comprob.C:
     73     - added
     74
     75   * macros/multidimdist.C:
     76     - added
     77 
     78  * macros/dohtml.C:
     79     - added star.C
     80     - added comprob.C
     81     - added multidimdist.C
     82
     83
     84
    285 2002/05/29: Thomas Bretz
    386
  • trunk/MagicSoft/Mars/macros/dohtml.C

    r1116 r1337  
    4141
    4242    html.SetSourceDir("macros");
    43     html.Convert("merpp.C",       "MARS - Merging and Preprocessing");
    44     html.Convert("readraw.C",     "MARS - How To Read A Raw");
    45     html.Convert("rootlogon.C",   "MARS - rootlogon.C");
    46     html.Convert("readCT1.C",     "MARS - Read and display CT1 Events");
    47     html.Convert("readMagic.C",   "MARS - Read and display Magic Events");
    48     html.Convert("CT1Hillas.C",   "MARS - Calculate CT1 Hillas");
    49     html.Convert("MagicHillas.C", "MARS - Calculate Magic Hillas");
    50     html.Convert("collarea.C",    "MARS - Calculate Collection Area from a MC root file");
    51     html.Convert("threshold.C",   "MARS - Calculate Energy Threshold from a MC root file");
    52     html.Convert("trigrate.C",    "MARS - Calculate Trigger Rate from a MC root file");
     43    html.Convert("merpp.C",        "MARS - Merging and Preprocessing");
     44    html.Convert("readraw.C",      "MARS - How To Read A Raw");
     45    html.Convert("rootlogon.C",    "MARS - rootlogon.C");
     46    html.Convert("readCT1.C",      "MARS - Read and display CT1 Events");
     47    html.Convert("readMagic.C",    "MARS - Read and display Magic Events");
     48    html.Convert("CT1Hillas.C",    "MARS - Calculate CT1 Hillas");
     49    html.Convert("MagicHillas.C",  "MARS - Calculate Magic Hillas");
     50    html.Convert("collarea.C",     "MARS - Calculate Collection Area from a MC root file");
     51    html.Convert("threshold.C",    "MARS - Calculate Energy Threshold from a MC root file");
     52    html.Convert("trigrate.C",     "MARS - Calculate Trigger Rate from a MC root file");
     53    html.Convert("star.C",         "MARS - (St)andard (A)nalysis and (R)econstruction");
     54    html.Convert("comprob.C",      "MARS - Calculation of composite probabilities for G/H-Seperation");
     55    html.Convert("multidimdist.C", "MARS - Calculation of multidimensional distances for G/H-Seperation");
    5356}
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r1210 r1337  
    2121#pragma link C++ class MMcPedestalNSBAdd+;
    2222
     23#pragma link C++ class MHadroness+;
     24
     25#pragma link C++ class MCompProbCalc+;
     26#pragma link C++ class MMultiDimDistCalc+;
     27
    2328#pragma link C++ class MSrcPosCam+;
    2429#pragma link C++ class MHillas+;
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r1211 r1337  
    2222#  connect the include files defined in the config.mk file
    2323#
    24 INCLUDES = -I. -I../mbase -I../mgui -I../mmc -I../mraw
     24INCLUDES = -I. -I../mbase -I../mgui -I../mmc -I../mraw -I../mdata -I../mhist
    2525
    2626#------------------------------------------------------------------------------
     
    3737           MEnergyEstimate.cc \
    3838           MSrcPosCam.cc \
     39           MHadroness.cc \
     40           MCompProbCalc.cc \
     41           MMultiDimDistCalc.cc \
    3942           MHillas.cc \
    4043           MHillasSrc.cc \
  • trunk/MagicSoft/Mars/mbase/MAGIC.h

    r1278 r1337  
    2222//     ParticleId for Monte Carlo simulation
    2323//
    24 const Int_t kGAMMA  =    0;
     24const Int_t kGAMMA  =    1;
    2525const Int_t kPROTON =   14;
    2626const Int_t kHELIUM =  402;
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r1320 r1337  
    215215// --------------------------------------------------------------------------
    216216//
     217//  Find an object with the same name in the list and replace it with
     218//  the new one. If the kIsOwner flag is set and the object was not
     219//  created automatically, the object is deleted.
     220//
     221Bool_t MParList::Replace(MParContainer *cont)
     222{
     223    //
     224    //  check if the object (you want to add) exists
     225    //
     226    if (!cont)
     227        return kFALSE;
     228
     229    TObject *obj = FindObject(cont->GetName());
     230    if (!obj)
     231    {
     232        *fLog << warn << "No object with the same name '";
     233        *fLog << cont->GetName() << "' in list... ignored." << endl;
     234        return kFALSE;
     235    }
     236
     237    fContainer->Remove(obj);
     238
     239    if (TestBit(kIsOwner) && !fAutodelete->FindObject(obj))
     240        delete obj;
     241
     242    *fLog << inf << "MParContainer '" << obj->GetName() << "' found and replaced..." << endl;
     243
     244    return AddToList(cont);
     245}
     246
     247// --------------------------------------------------------------------------
     248//
    217249//  Find an object in the list.
    218250//  'name' is the name of the object you are searching for.
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r1186 r1337  
    4242    void   AddToList(TObjArray *list);
    4343
     44    Bool_t Replace(MParContainer *obj);
     45
    4446    void SetLogStream(MLog *log);
    4547
  • trunk/MagicSoft/Mars/mbase/MReadMarsFile.cc

    r1332 r1337  
    108108Bool_t MReadMarsFile::Notify()
    109109{
     110    Int_t runtype = -1;
     111/*
     112    const MRawRunHeader *runheader = (MRawRunHeader*)fParList->FindObject("MRawRunHeader");
     113    if (runheader)
     114        runtype = runheader->GetRunType();
     115*/
    110116    //
    111117    // Try to read the new run headers. If reading the new run header
    112118    // was successfull call the ReInits
    113119    //
     120    const Int_t idx = GetFileIndex();
     121    fRun->SetEventNum(idx<0?0:idx); // Assumption: One Entry per File!
    114122    if (fRun->Process())
    115123    {
    116         *fLog << inf << "MReadMarsFile: Switching to '" << GetFileName() << "' ";
    117         *fLog << "(before event #" << GetEventNum()-1 << ")" << endl;
    118 
     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*/
    119132        if (fTaskList->ReInit())
    120133            return kTRUE;
     
    137150Bool_t MReadMarsFile::PreProcess(MParList *pList)
    138151{
     152    fParList  = pList;
    139153    fTaskList = (MTaskList*)pList->FindObject("MTaskList");
    140154
    141155    if (!fRun->PreProcess(pList))
     156    {
     157        *fLog << err << "Error - PreProcessing MReadMarsFile::fRun... aborting." << endl;
    142158        return kFALSE;
     159    }
    143160
     161    const Int_t idx = GetFileIndex();
     162    fRun->SetEventNum(idx<0?0:idx); // Assumption: One Entry per File!
    144163    if (!fRun->Process())
     164    {
     165        *fLog << err << "Error - Processing MReadMarsFile::fRun... aborting." << endl;
    145166        return kFALSE;
    146 
    147     fRun->SetEventNum(0);
     167    }
    148168
    149169    return MReadTree::PreProcess(pList);
  • trunk/MagicSoft/Mars/mbase/MReadMarsFile.h

    r1114 r1337  
    66#endif
    77
     8class MParList;
    89class MTaskList;
    910
     
    1213private:
    1314    MReadTree *fRun;
     15    MParList  *fParList;  //! Parlist for reinitialization
    1416    MTaskList *fTaskList; //! Tasklist for reinitialization
    1517
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r1333 r1337  
    5555#include <TFile.h>           // TFile::GetName
    5656#include <TChain.h>
     57#include <TSystem.h>         // gSystem->ExpandPath
    5758#include <TGProgressBar.h>
    5859#include <TChainElement.h>
     
    746747// --------------------------------------------------------------------------
    747748//
     749//  Return the number of the file in the chain, -1 in case of an error
     750//
     751Int_t MReadTree::GetFileIndex() const
     752{
     753    return fChain->GetTreeNumber();
     754    /*
     755    const TString filename = fChain->GetFile()->GetName();
     756
     757    int i=0;
     758    TObject *file = NULL;
     759
     760    TIter Next(fChain->GetListOfFiles());
     761    while ((file=Next()))
     762    {
     763        if (filename==gSystem->ExpandPathName(file->GetTitle()))
     764            return i;
     765        i++;
     766    }
     767    return -1;
     768    */
     769}
     770
     771// --------------------------------------------------------------------------
     772//
    748773//  This schedules a TObject which Notify(9 function is called in case
    749774//  of MReadTree (TChain) switches from one file in the chain to another
     
    759784    *fLog << all << GetDescriptor() << dec << endl;
    760785    *fLog << setfill('-') << setw(strlen(GetDescriptor())) << "" << endl;
    761     *fLog << " Files:" << endl;
     786    *fLog << " Files [Tree]:" << endl;
    762787
    763788    int i = 0;
     
    765790    TObject *obj = NULL;
    766791    while ((obj=Next()))
    767         *fLog << " " << i++ << ") " << obj->GetName() << endl;
    768 
    769     *fLog << " Entries: " << fNumEntries << endl;
    770     *fLog << " Next Entry: " << fNumEntry << endl;
    771 }
     792        *fLog << " " << i++ << ") " << obj->GetTitle() << " [" << obj->GetName() << "]" << endl;
     793
     794    *fLog << " Total Number of Entries: " << fNumEntries << endl;
     795    *fLog << " Next Entry to read: " << fNumEntry << endl;
     796}
  • trunk/MagicSoft/Mars/mbase/MReadTree.h

    r1203 r1337  
    5959
    6060    TString GetFileName() const;
     61    Int_t   GetFileIndex() const;
    6162
    6263    virtual void   AddNotify(TObject *obj);
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1332 r1337  
    303303    fParList = pList;
    304304
    305     fTasksProcess.Delete();
     305    fTasksProcess.Clear();
    306306
    307307    //
     
    317317    while ((task=(MTask*)Next()))
    318318    {
     319        *fLog << all << task->GetName() << "... " << flush;
     320
    319321        if (CheckClassForProcess(task->IsA()))
    320322            fTasksProcess.Add(task);
     
    457459    while ( (task=(MTask*)Next()) )
    458460    {
     461        *fLog << all << task->GetName() << "... " << flush;
     462
    459463        if (!task->CallPostProcess())
    460464            return kFALSE;
    461 
    462         *fLog << all << task->GetName() << "... " << flush;
    463465    }
    464466
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc

    r1331 r1337  
    263263}
    264264
     265/*
     266Bool_t MWriteAsciiFile::PreProcess(MParList *plist)
     267{
     268    MDataChain *chain=NULL;
     269
     270    TIter Next(&fList);
     271    while (((MDataChain*)chain=Next()))
     272        if (!chain->PreProcess(plist))
     273            return kFALSE;
     274
     275    return MWriteFile::PreProcess(plist);
     276}
     277
     278void MWriteAsciiFile::Add(const char *rule)
     279{
     280    MDataChain *chain = new MDataChain(rule);
     281    fList.Add(chain);
     282}
     283*/
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.h

    r1236 r1337  
    2929
    3030    TString fNameFile;
    31 
     31/*
     32    TList fList;
     33*/
    3234    virtual void   CheckAndWrite() const;
    3335    virtual Bool_t IsFileOpen() const;
     
    4749    void AddContainer(MParContainer *cont, const char *member="", Double_t scale=1);
    4850
     51    /*
     52     Bool_t PreProcess(MParList *plist);
     53     void Add(const char *rule);
     54     */
     55
    4956    ClassDef(MWriteAsciiFile, 0) // Class to write one container to an ascii file
    5057};
  • trunk/MagicSoft/Mars/mfilter/FilterLinkDef.h

    r1283 r1337  
    88#pragma link C++ class MFAlpha+;
    99#pragma link C++ class MFTriggerLvl1+;
     10#pragma link C++ class MFParticleId+;
    1011#pragma link C++ class MFDataMember+;
    1112
  • trunk/MagicSoft/Mars/mfilter/Makefile

    r1333 r1337  
    3434           MF.cc \
    3535           MFDataMember.cc \
    36            MFDataChain.cc \
     36           MFParticleId.cc \
    3737           MFAlpha.cc
     38#          MFDataChain.cc \
    3839
    3940SRCS    = $(SRCFILES)
Note: See TracChangeset for help on using the changeset viewer.