Changeset 1172 for trunk/MagicSoft


Ignore:
Timestamp:
01/14/02 17:34:02 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1171 r1172  
    11                                                                  -*-*- END -*-*-
     2 2002/01/14: Thomas Bretz
     3 
     4   * manalysis/MMcPedestalCopy.cc, manalysis/MMcPedestalNSBAdd.cc:
     5     - added comments
     6
     7   * mbase/MReadMarsFile.cc:
     8     - changed output when switching to new file
     9     
     10   * meventdisp/MGFadcDisp.cc:
     11     - made char array in constructor const
     12     - changed char-array to TString
     13
     14   * mmain/MBrowser.[h,cc]:
     15     - changed char-arrays to TString
     16
     17   * mmain/MDataCheck.[h,cc]:
     18     - made char array in constructor const
     19     
     20   * Makefile.conf.linux, Makefile.conf.linux-gnu:
     21     - changed to O5
     22     
     23   * mbase/MEvtLoop.cc:
     24     - check for inheritance from MTaskList
     25
     26
     27
    228 2002/01/11: Oscar Blanch Bigas
    3    * main/MAnalysis.cc:
     29   * mmain/MAnalysis.cc:
    430     - added MBlindPixelCalc step.
    531
  • trunk/MagicSoft/Mars/Makefile.conf.linux

    r1076 r1172  
    2020#  ----->>>   settings for compilation
    2121#
    22 OPTIM    = -O3 -Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual
     22OPTIM    = -O5 -Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual
    2323DEBUG    =
    2424ARCHDEF  = -D__LINUX__
  • trunk/MagicSoft/Mars/Makefile.conf.linux-gnu

    r1076 r1172  
    2020#
    2121
    22 OPTIM    = -O3 -Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual
     22OPTIM    = -O5 -Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual
    2323DEBUG    =
    2424ARCHDEF  = -D__LINUX__
  • trunk/MagicSoft/Mars/NEWS

    r1154 r1172  
    2121
    2222   - Introduced MMcRunHeaders which contains monte carlo run informations
     23
     24   - Added a 'Print'-Task (MPrint) which calls the Print function
     25     of a parameter container for each event
    2326
    2427
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r1131 r1172  
    2626//                                                                         //
    2727//  MMcPedestalCopy                                                        //
     28//                                                                         //
    2829//  This task looks for the ìnformation about FADC pedestals in            //
    2930//  MMcFadcHeader and translates it to the pedestal values in              //
     
    6465}
    6566
     67// --------------------------------------------------------------------------
     68//
     69// Check for the run type. Return kTRUE if it is a MC run or if there
     70// is no MC run header (old camera files) kFALSE in case of a different
     71// run type
     72//
    6673Bool_t MMcPedestalCopy::CheckRunType(MParList *pList) const
    6774{
     
    7683}
    7784
     85// --------------------------------------------------------------------------
     86//
     87// Check runtype and search for MPedestalCam and MMcFadcHeader.
     88// If the runtype check fails the task is removed from the task list.
     89//
    7890Bool_t MMcPedestalCopy::PreProcess(MParList *pList)
    7991{
     
    99111}
    100112
     113// --------------------------------------------------------------------------
     114//
     115// Check for the runtype. (not yet: If the check fails the eventloop is
     116// stopped.)
     117// Initialize the size of MPedestalCam to the number of pixels from
     118// MMcFadcHeader.
     119//
    101120Bool_t MMcPedestalCopy::ReInit(MParList *pList)
    102121{
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc

    r1132 r1172  
    3333//  MPedestalCam the NSB contribution.                                     //
    3434//  The number of photons from the diffuse NSB follows a poisson           //
    35 //  distribution with expected mean value X, then its standard desviation  //
     35//  distribution with expected mean value X, then its standard deviation   //
    3636//  is sqrt(X).                                                            //
    3737//  X is the number of phe per ns so we have to convert in FADC counts per //
     
    8585}
    8686
     87// --------------------------------------------------------------------------
     88//
     89// Check for the run type. Return kTRUE if it is a MC run or if there
     90// is no MC run header (old camera files) kFALSE in case of a different
     91// run type
     92//
    8793Bool_t MMcPedestalNSBAdd::CheckRunType(MParList *pList) const
    8894{
     
    141147
    142148    return kTRUE;
     149}
     150
     151Float_t MMcPedestalNSBAdd::GetDnsb(MParList *pList) const
     152{
     153    MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
     154    if (!mcrunheader && fDnsbPixel < 0 )
     155    {
     156        *fLog << err << dbginf << "Using the default argument of MMcPedestalNSB::MMcPedestalNSB() ";
     157        *fLog << "only allowed if MMcRunHeader is available... aborting." << endl;
     158        return -1;
     159    }
     160
     161    if (!mcrunheader)
     162        return fDnsbPixel;
     163
     164    if (fDnsbPixel >= 0 && fDnsbPixel != mcrunheader->GetNumPheFromDNSB())
     165    {
     166        *fLog << warn << dbginf << "The MC file has been generated with diffuse nsb " << mcrunheader->GetNumPheFromDNSB();
     167        *fLog <<" but you set up the diffuse NSB to " << fDnsbPixel << endl;
     168
     169        return fDnsbPixel;
     170    }
     171
     172    return mcrunheader->GetNumPheFromDNSB();
    143173}
    144174
     
    158188//   - MPedestalCam
    159189//
    160 Float_t MMcPedestalNSBAdd::GetDnsb(MParList *pList) const
    161 {
    162     MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
    163     if (!mcrunheader && fDnsbPixel < 0 )
    164     {
    165         *fLog << err << dbginf << "Using the default argument of MMcPedestalNSB::MMcPedestalNSB() ";
    166         *fLog << "only allowed if MMcRunHeader is available... aborting." << endl;
    167         return -1;
    168     }
    169 
    170     if (!mcrunheader)
    171         return fDnsbPixel;
    172 
    173     if (fDnsbPixel >= 0 && fDnsbPixel != mcrunheader->GetNumPheFromDNSB())
    174     {
    175         *fLog << warn << dbginf << "The MC file has been generated with diffuse nsb " << mcrunheader->GetNumPheFromDNSB();
    176         *fLog <<" but you set up the diffuse NSB to " << fDnsbPixel << endl;
    177 
    178         return fDnsbPixel;
    179     }
    180 
    181     return mcrunheader->GetNumPheFromDNSB();
    182 }
    183 
    184190Bool_t MMcPedestalNSBAdd::ReInit(MParList *pList)
    185191{
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r1130 r1172  
    129129    }
    130130
     131    if (!fTaskList->InheritsFrom("MTasklist"))
     132    {
     133        *fLog << err << dbginf << "'" << tlist << "' doesn't inherit from MTaskList!" << endl;
     134        return kFALSE;
     135    }
     136
    131137    if (fLog != &gLog)
    132         fParList ->SetLogStream(fLog);
     138        fParList->SetLogStream(fLog);
    133139
    134140    //
  • trunk/MagicSoft/Mars/mbase/MReadMarsFile.cc

    r1132 r1172  
    114114    if (fRun->Process())
    115115    {
    116         *fLog << inf << "MReadMarsFile: Switching to '" << GetFileName() << "' ";
    117         *fLog << "(before processing event #" << GetEventNum()-1 << ")" << endl;
     116        TString name(GetFileName());
     117        name.Remove(0, name.Last('/')+1);
     118
     119        *fLog << inf << "MReadMarsFile: Switching to '" << name << "' ";
     120        *fLog << "(before event #" << GetEventNum()-1 << ")" << endl;
    118121
    119122        fTaskList->ReInit();
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc

    r1081 r1172  
    112112//  Constructor
    113113//
    114 MGFadcDisp::MGFadcDisp(char *filename, char *treename,
     114MGFadcDisp::MGFadcDisp(const char *filename, const char *treename,
    115115                       const TGWindow *p, const TGWindow *main,
    116116                       UInt_t w, UInt_t h)
     
    172172        while (pixel.Next())
    173173        {
    174             char txt[100];
    175             sprintf(txt, "%d", pixel.GetPixelId());
     174            TString txt;
     175            txt += pixel.GetPixelId();
    176176            fPixelList->AddEntry(txt, pixel.GetPixelId());
    177177        }
     
    193193    }
    194194
    195     char txt[100];
    196     sprintf(txt, "GRAPH%d", lastsel);
     195    TString txt("GRAPH");
     196    txt += lastsel;
     197
    197198    data->Draw(txt);
     199
    198200    fPixelList->Select(lastsel, kTRUE);
    199201    fPixelList->SetTopEntry(lastsel);
  • trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.h

    r1015 r1172  
    2222public:
    2323
    24     MGFadcDisp(char *filename, char *treename,
     24    MGFadcDisp(const char *filename, const char *treename,
    2525               const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h);
    2626
  • trunk/MagicSoft/Mars/mmain/MBrowser.cc

    r1108 r1172  
    280280                   main?main:gClient->GetRoot(), w, h)
    281281{
    282     fInputFile[0] = '\0';
    283 
    284282    fList = new MGList;
    285283    fList->SetOwner();
     
    382380    // Checks if there is a selected input root file
    383381    //
    384     return fInputFile[0]!='\0';
     382    return !fInputFile.IsNull(); //[0]!='\0';
    385383}
    386384
     
    417415}
    418416
    419 void MBrowser::SetFileName(const char *name)
    420 {
    421     //
    422     // determine the file type by extensions
    423     //
    424     const char *ext=strrchr(name, '.');
    425 
    426     Bool_t failed = kFALSE;
    427 
    428     if (!ext)
    429         failed = kTRUE;
    430     else
    431         if (strcasecmp(ext, ".root"))
    432             failed = kTRUE;
    433 
    434     char *fname=NULL;
    435     if (!failed)
     417void MBrowser::SetFileName(TString name)
     418{
     419    if (name[0]!='/')
    436420    {
    437         const char *dir = fFileCont->GetDirectory();
    438 
    439         fname = Form("%s/%s", dir, name);
    440 
    441         failed = gSystem->AccessPathName(fname, kFileExists);
     421        name.Insert(0, "/");
     422        name.Insert(0, fFileCont->GetDirectory());
    442423    }
    443424
    444     if (!failed)
    445         strcpy(fInputFile, fname);
    446     else
    447         fname = Form(fInputFile);
    448 
    449     char *slash = strrchr(fname, '/');
    450 
    451     fEntry->SetText(slash ? slash+1 : "");
    452 
    453     if (!slash)
     425    if (gSystem->AccessPathName(name, kFileExists))
    454426        return;
    455427
    456     *slash = '\0';
    457     ChangeDir(fname);
     428    if (name.EndsWith(".root", TString::kIgnoreCase))
     429        fInputFile = name;
     430
     431    fEntry->SetText(gSystem->BaseName(name));
     432
     433    ChangeDir(gSystem->DirName(name));
    458434}
    459435
     
    483459    const TGTextLBEntry *selected = (TGTextLBEntry*)filter->GetListBox()->GetSelectedEntry();
    484460
    485     const char *txt = StrDup(selected->GetText()->GetString());
    486 
    487461    //
    488462    // find filter and remove leading spaces
    489463    //
    490     char *lt = strchr(txt, '<');
    491     if (lt)
    492     {
    493         do *lt-- = '\0';
    494         while (lt>txt && *lt==' ');
    495 
    496         //
    497         // Set new filter and refresh the file container
    498         //
    499         fFileCont->SetFilter(txt);
    500         fFileCont->DisplayDirectory();
    501     }
    502 
    503     delete [] txt;
     464    TString txt = selected->GetText()->GetString();
     465    if (txt.First('<') < 0)
     466        return;
     467
     468    //
     469    // Set new filter and refresh the file container
     470    //
     471    txt.Remove(txt.First('<'));
     472
     473    TString ftxt = txt.Strip();
     474    fFileCont->SetFilter(ftxt);
     475    fFileCont->DisplayDirectory();
    504476}
    505477
  • trunk/MagicSoft/Mars/mmain/MBrowser.h

    r1086 r1172  
    3636    void CreateDirListBox(TGCompositeFrame *frame);
    3737
    38     void SetFileName(const char *name);
     38    void SetFileName(TString name);
    3939
    4040    void SetFilter();
     
    4444protected:
    4545    MGList *fList;
    46     Char_t  fInputFile[256];
     46    TString fInputFile;
    4747
    4848    TGCompositeFrame *CreateNewTab(const char *name);
  • trunk/MagicSoft/Mars/mmain/MDataCheck.cc

    r1086 r1172  
    9797//  histograms.
    9898//
    99 void MDataCheck::ViewAdcSpectra(Char_t *inputfile, Char_t *treeName)
     99void MDataCheck::ViewAdcSpectra(const Char_t *inputfile, const Char_t *treeName)
    100100{
    101101    //
  • trunk/MagicSoft/Mars/mmain/MDataCheck.h

    r1016 r1172  
    99{
    1010private:
    11     void ViewAdcSpectra(Char_t *inputfile, Char_t *treeName);
     11    void ViewAdcSpectra(const Char_t *inputfile, const Char_t *treeName);
    1212
    1313public:
Note: See TracChangeset for help on using the changeset viewer.