Changeset 9328


Ignore:
Timestamp:
02/12/09 20:07:51 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9327 r9328  
    2222   * datacenter/macros/fillsources.C:
    2323     - updated
     24
     25   * mfileio/MWriteRootFile.[h,cc]:
     26     - added some comments
     27     - renamed GetNewFileName to SubstituteName
     28     - made SubstituteName static
     29
     30   * mhist/MHCamera.cc:
     31     - fixed the number in the legend (was wrong since last update)
     32
     33   * mjobs/MDataSet.cc:
     34     - replaced From by MString::Format
     35
     36   * mjobs/MJSimulation.cc:
     37     - a lot of things were renamed
     38     - the refelctor can now be set from the setup file
     39     - changed the binning for the event width
     40     - removed plot "CamShadow"
     41     - changed rules for file names
     42
     43   * ceres.rc:
     44     - updated according to the changes in MJSimulation
     45
     46   * mjobs/MSequence.cc:
     47     - replaced use of Form by MString::Format
     48     - allow non-setting of fNight
     49     - don't print period if -1
     50
     51   * mmain/MEventDisplay.cc:
     52     - decode trigger pattern for display
     53
     54   * mmain/Makefile:
     55     - included mtrigger
     56
     57   * msim/MHPhotonEvent.cc:
     58     - search Reflector instead of MReflector
     59
     60   * msim/MSimAbsorption.cc:
     61     - added some info output
     62
     63   * msimcamera/MSimAPD.[h,cc]:
     64     - added an option to set the geom cam name. Can be used to skip
     65       this task
     66
     67   * msimcamera/MSimCamera.[h,cc]:
     68     - allow to set BaselineGain from resource file
     69
     70   * msimreflector/MSimReflector.cc:
     71     - removed CamShadow container
     72     - search Reflector instead of MReflector
     73
    2474
    2575
  • trunk/MagicSoft/Mars/Makefile

    r9275 r9328  
    5555          mpedestal \
    5656          mfileio \
    57           mreflector \
    5857          mgeom \
    5958          melectronics \
  • trunk/MagicSoft/Mars/NEWS

    r9325 r9328  
    77   * fixed a few small bugs which could cause the display to crash in ganymed
    88     and sponde
     9
     10   * in sequence file the date can now be omittet. In this case the
     11     leading date with the underscore is missing in the expected filename
    912
    1013 ;database
  • trunk/MagicSoft/Mars/ceres.rc

    r9321 r9328  
    7373# Setup the reflector and camera geometry
    7474# -------------------------------------------------------------------------
    75 #MReflector.FileName: mreflector/reflector-magic.def
    76 MReflector.FileName: mreflector/reflector-dwarf.def
     75Reflector.Constructor: MReflector
     76#Reflector.FileName: mreflector/reflector-magic.def
     77Reflector.FileName: mreflector/reflector-dwarf.def
    7778
    7879# --- DWARF ---
    79 #GeomAPDs.Constructor:  MGeomCamDwarf(419., 15, 17);
    80 #MGeomCam.Constructor:  MGeomCamDwarf(419., 30, 17);
     80#GeomCones.Constructor:  MGeomCamDwarf(419., 15, 17);
     81#MGeomCam.Constructor:   MGeomCamDwarf(419., 30, 17);
    8182
    8283# distance from mirror to camera [cm]
     
    8586#paraboloid_focal   488.87
    8687
    87 GeomAPDs.Constructor:  MGeomCamDwarf(209.5, 7.5, 4.8887);
    88 MGeomCam.Constructor:  MGeomCamDwarf(209.5, 15,  4.8887);
     88GeomCones.Constructor:  MGeomCamDwarf(209.5, 7.5, 4.8887);
     89MGeomCam.Constructor:   MGeomCamDwarf(209.5, 15,  4.8887);
    8990
    9091MSimBundlePhotons.FileName: mreflector/dwarf-apdmap.txt
     
    9394
    9495# --- MAGIC ---
    95 #GeomAPDs.Class: MGeomCamMagic
    96 #MGeomCam.Class: MGeomCamMagic
    97 
     96#GeomCones.Class: MGeomCamMagic
     97#MGeomCam.Class:  MGeomCamMagic
     98#MSimAPD.NameGeomCam:
    9899
    99100# -------------------------------------------------------------------------
    100101# Setup the absorption, conversion efficiency and angular acceptance
    101102# -------------------------------------------------------------------------
    102 AbsorptionMirrors.FileName: mreflector/pde-mirror.txt
    103 AbsorptionAPDs.FileName:    mreflector/pde-apd.txt
    104 AbsorptionCones.FileName:   mreflector/dwarf-cones.txt
     103MirrorReflectivity.FileName:          mreflector/pde-mirror.txt
     104PhotonDetectionEfficiency.FileName:    mreflector/pde-apd.txt
     105ConesAngularAcceptance.FileName:       mreflector/dwarf-cones.txt
    105106
    106107
     
    134135
    135136# Magic like 3NN trigger (inner 396 pixel)
    136 #MSimTrigger.FileNameCoincidenceMap:  3NN-lut-uniq.txt
    137 #MSimTrigger.DiscriminatorThreshold:  4.5
     137MSimTrigger.FileNameCoincidenceMap:  3NN-lut-uniq.txt
     138MSimTrigger.DiscriminatorThreshold:  6.0
     139MSimTrigger.DigitalSignalLength:     8
     140MSimTrigger.CoincidenceTime:         0.5
     141
     142# Magic like 4NN trigger (inner 396 pixel)
     143#MSimTrigger.FileNameCoincidenceMap:  4NN-lut-uniq.txt
     144#MSimTrigger.DiscriminatorThreshold:  5.0
    138145#MSimTrigger.DigitalSignalLength:     8
    139146#MSimTrigger.CoincidenceTime:         0.5
    140 
    141 # Magic like 4NN trigger (inner 396 pixel)
    142 MSimTrigger.FileNameCoincidenceMap:  4NN-lut-uniq.txt
    143 MSimTrigger.DiscriminatorThreshold:  5.0
    144 MSimTrigger.DigitalSignalLength:     8
    145 MSimTrigger.CoincidenceTime:         0.5
    146147
    147148IntendedPulsePos.Val: 40
     
    167168MRawRunHeader.FadcResolution:      12
    168169
     170#MSimReadout.fConversionFactor: 1
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r9318 r9328  
    192192//
    193193// comp:        Compression Level (see TFile, TBranch)
    194 // rule:        Rule to create output file name (see GetNewFileName())
     194// rule:        Rule to create output file name (see SubstituteName())
    195195// overwrite:   Allow newly created file to overwrite old files ("RECREATE")
    196196// ftitle:      File title stored in the file (see TFile)
     
    849849//   "s/source/destination/"
    850850//
    851 // For more details on regular expression see a proper documentation.
     851// For more details on regular expression see a proper documentation,
     852// for example, "man 7 regex" if installed, or TPRegexp.
    852853//
    853854// Here is an example:
     
    862863// your set in your program it must look \\/.
    863864//
    864 TString MWriteRootFile::GetNewFileName(const char *inname) const
     865// Note, that this function has been made static to allow your to
     866// test your split rules, i.e. regular expressions.
     867//
     868TString MWriteRootFile::SubstituteName(const char *regexp, TString fname)
    865869{
    866870    // Remove the path from the filename
    867     TString fname(inname);
    868871    if (fname.Last('/')>=0)
    869872        fname.Remove(0, fname.Last('/')+1);
     
    873876
    874877    // Do splitting
    875     TObjArray *subStrL = TPRegexp(sed).MatchS(fSplitRule);
     878    TObjArray *subStrL = TPRegexp(sed).MatchS(regexp);
    876879    if (subStrL->GetEntries()!=6)
    877880    {
    878         *fLog << err << "ERROR - GetNewFileName: Evaluating split rule " << fSplitRule << " failed." << endl;
     881        gLog << err << "ERROR - SubstituteName: Evaluating regexp " << regexp << " failed." << endl;
    879882        subStrL->Print();
    880883        delete subStrL;
     
    10451048
    10461049    const TString oldname = read->GetFullFileName();
    1047     const TString newname = GetNewFileName(oldname);
     1050    const TString newname = SubstituteName(fSplitRule, oldname);
    10481051    if (!ChangeFile(newname))
    10491052        return kFALSE;
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h

    r8933 r9328  
    9494    // File handling
    9595    void    Close();
    96     TString GetNewFileName(const char *inname) const;
    9796    Bool_t  ChangeFile(const char *fname);
    9897    TFile  *OpenFile(const char *name, Option_t *option, const char *title, Int_t comp);
     
    145144    void RecursiveRemove(TObject *obj);
    146145
     146    static TString SubstituteName(const char *regexp, TString fname);
     147
    147148    ClassDef(MWriteRootFile, 1) // Task to write data into a root file
    148149};
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r9317 r9328  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.116 2009-02-11 12:25:42 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.117 2009-02-12 20:05:06 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    18891889        newtxt2.PaintText(-range*.95, -range*.95, text);
    18901890
    1891         text = MString::Format("%.2f\\circ", range*.3*fGeomCam->GetConvMm2Deg());
     1891        text = MString::Format("%.2f\\circ", range*(0.99-0.60)*fGeomCam->GetConvMm2Deg());
    18921892        text = text.Strip(TString::kLeading);
    18931893
  • trunk/MagicSoft/Mars/mjobs/MDataSet.cc

    r9212 r9328  
    217217#include "MEnv.h"
    218218#include "MAstro.h"
     219#include "MString.h"
    219220#include "MDirIter.h"
    220221#include "MSequence.h"
     
    297298        // Set default sequence file and dir name
    298299        if (name.IsNull())
    299             name = Form("%s%04d/sequence%08d.txt", sequences.Data(), num[i]/10000, num[i]);
     300            name = MString::Format("%s%04d/sequence%08d.txt", sequences.Data(), num[i]/10000, num[i]);
    300301        if (dir.IsNull())
    301             dir = Form("%s%04d/%08d", data.Data(), num[i]/10000, num[i]);
     302            dir = MString::Format("%s%04d/%08d", data.Data(), num[i]/10000, num[i]);
    302303
    303304        // Check if sequence information is contained in Dataset file
     
    385386
    386387    // Determin the prefix to access this resource
    387     const TString prefix = num==(UInt_t)-1 ? "" : Form("%d", num);
     388    const TString prefix = num==(UInt_t)-1 ? "" : MString::Format("%d", num);
    388389
    389390    // Open and read the file
     
    494495    const Bool_t useds = seq.GetFileName()==fFileName;
    495496
    496     out << "Sequence" << Form("%08d", seq.GetSequence()) << ".File:   " << (useds?"-":seq.GetFileName()) << endl;
    497     out << "Sequence" << Form("%08d", seq.GetSequence()) << ".Dir:    " << seq.GetDataPath() << endl;
     497    out << "Sequence" << MString::Format("%08d", seq.GetSequence()) << ".File:   " << (useds?"-":seq.GetFileName()) << endl;
     498    out << "Sequence" << MString::Format("%08d", seq.GetSequence()) << ".Dir:    " << seq.GetDataPath() << endl;
    498499    if (!useds && seq.GetNumExclRuns()>0)
    499         out << "Sequence" << Form("%08d", seq.GetSequence()) << ".Exclude: " << seq.GetExcludedRuns() << endl;
     500        out << "Sequence" << MString::Format("%08d", seq.GetSequence()) << ".Exclude: " << seq.GetExcludedRuns() << endl;
    500501
    501502    if (useds)
  • trunk/MagicSoft/Mars/mjobs/MJSimulation.cc

    r9319 r9328  
    152152
    153153    cont.Add(plist.FindObject("MPulseShape"));
    154     cont.Add(plist.FindObject("MReflector"));
     154    cont.Add(plist.FindObject("Reflector"));
    155155    cont.Add(plist.FindObject("MGeomCam"));
    156     cont.Add(plist.FindObject("GeomAPDs"));
     156    cont.Add(plist.FindObject("GeomCones"));
    157157
    158158    if (fDisplay)
     
    248248    // --------------------------------------------------------------------------------
    249249
    250     // ---------- FIXME FIXME FIXME -----------
    251     // FIXME: Find a better name (What if both cams are identical?)
    252     MParEnv env1("GeomAPDs");  // Inheritance!
    253     MParEnv env2("MGeomCam");  // Inheritance!
     250    // FIXME: Allow empty GeomCones!
     251    MParEnv env0("Reflector");
     252    MParEnv env1("GeomCones");
     253    MParEnv env2("MGeomCam");
     254    env0.SetClassName("MReflector");
    254255    env1.SetClassName("MGeomCam");
    255256    env2.SetClassName("MGeomCam");
     257    plist.AddToList(&env0);
    256258    plist.AddToList(&env1);
    257259    plist.AddToList(&env2);
    258 
    259     // FIXME: Allow the user to create other reflectors
    260     MReflector reflector;
    261     plist.AddToList(&reflector);
    262260
    263261    plist.FindCreateObj("MPedPhotCam", "MPedPhotFromExtractorRndm");
     
    314312    MSimMMCS simmmcs;
    315313
    316     MSimAbsorption absapd("AbsorptionAPDs");
    317     MSimAbsorption absmir("AbsorptionMirrors");
    318     MSimAbsorption cones("AbsorptionCones");
     314    MSimAbsorption absapd("PhotonDetectionEfficiency");
     315    MSimAbsorption absmir("MirrorReflectivity");
     316    MSimAbsorption cones("ConesAngularAcceptance");
    319317    cones.SetUseTheta();
    320318
     
    322320
    323321    MSimReflector reflect;
    324     reflect.SetNameGeomCam("GeomAPDs");
     322    reflect.SetNameGeomCam("GeomCones");
    325323//  MSimStarField stars;
    326324
     
    337335    MBinning binszd( 70,     0,       70, "BinningZd");
    338336    MBinning binsvc(155,     0,       31, "BinningViewCone");
    339     MBinning binsew(150,     0,       25, "BinningEvtWidth");
     337    MBinning binsew(150,     0,       50, "BinningEvtWidth");
    340338    MBinning binstr("BinningTrigPos");
    341339
     
    357355    MH3 mhtp("TriggerPos.fVal-IntendedPulsePos.fVal-MPulseShape.GetPulseWidth");
    358356    mhtp.SetName("TrigPos");
    359     mhtp.SetTitle("Trigger position w.r.t. the first photon hitting an APD");
     357    mhtp.SetTitle("Trigger position w.r.t. the first photon hitting a detector");
    360358
    361359    MH3 mhew("MPhotonStatistics.fTimeLast-MPhotonStatistics.fTimeFirst - MRawRunHeader.GetFreqSampling/1000.*MRawRunHeader.fNumSamplesHiGain - 2*MPulseShape.GetPulseWidth");
    362360    mhew.SetName("EvtWidth");
    363     mhew.SetTitle("Time between first and last photon hitting an APD");
     361    mhew.SetTitle("Time between first and last photon hitting a detector");
    364362
    365363    MFillH fillh1(&mhn1, "", "FillH1");
     
    372370    fillh3.SetNameTab("H3", "Distribution after trigger");
    373371    filltp.SetNameTab("TrigPos", "TriggerPosition w.r.t the first photon");
    374     fillew.SetNameTab("EvtWidth", "Time between first and last photon hitting an APD");
     372    fillew.SetNameTab("EvtWidth", "Time between first and last photon hitting a detector");
    375373
    376374    MHPhotonEvent planeG(1);     // Get from MaxImpact
     
    387385    MFillH fillG(&planeG,   "MPhotonEvent", "FillGround");
    388386    MFillH fill0(&plane0,   "MirrorPlane0", "FillReflector");
    389     MFillH fill1(&plane1,   "MirrorPlane1", "FillCamShadow");
     387    //MFillH fill1(&plane1,   "MirrorPlane1", "FillCamShadow");
    390388    MFillH fill2(&plane2,   "MirrorPlane2", "FillCandidates");
    391389    MFillH fill3(&plane3,   "MirrorPlane3", "FillReflected");
    392390    MFillH fill4(&plane4,   "MirrorPlane4", "FillFocal");
    393391    MFillH fillF1(&planeF1, "MPhotonEvent", "FillCamera");
    394     MFillH fillF2(&planeF2, "MPhotonEvent", "FillAPDs");
     392    MFillH fillF2(&planeF2, "MPhotonEvent", "FillCones");
    395393    //MFillH fillP(&psf,      "MPhotonEvent", "FillPSF");
    396394
    397395    fillG.SetNameTab("Ground",     "Photon distribution at ground");
    398396    fill0.SetNameTab("Reflector",  "Photon distribution at reflector plane w/o camera shadow");
    399     fill1.SetNameTab("CamShadow",  "Photon distribution at reflector plane w/ camera shadow");
     397    //fill1.SetNameTab("CamShadow",  "Photon distribution at reflector plane w/ camera shadow");
    400398    fill2.SetNameTab("Candidates", "'Can hit' photon distribution at reflector plane w/ camera shadow");
    401399    fill3.SetNameTab("Reflected",  "Photon distribution after reflector projected to reflector plane");
    402400    fill4.SetNameTab("Focal",      "Photon distribution at focal plane");
    403401    fillF1.SetNameTab("Camera",    "Photon distribution which hit the detector");
    404     fillF2.SetNameTab("APDs",      "Photon distribution after cones");
     402    fillF2.SetNameTab("Cones",     "Photon distribution after cones");
    405403    //fillP.SetNameTab("PSF",        "Photon distribution after cones for all mirrors");
    406404
    407405    // -------------------------------------------------------------------
    408406
    409     const TString rule1(Form("s/cer([0-9]+)/%s\\/ref$1.root/", Esc(fPathOut).Data()));
    410     const TString rule2(Form("s/cer([0-9]+)/%s\\/sig$1.root/", Esc(fPathOut).Data()));
    411     const TString rule3(Form("s/cer([0-9]+)/%s\\/cam$1.root/", Esc(fPathOut).Data()));
     407    // FIXME: Pedestal and Calibration runs should get P and C
     408    const TString rule1(Form("s/cer([0-9]+)/%s\\/00$1_R_MonteCarlo.root/", Esc(fPathOut).Data()));
     409    const TString rule2(Form("s/cer([0-9]+)/%s\\/00$1_I_MonteCarlo.root/", Esc(fPathOut).Data()));
     410    const TString rule3(Form("s/cer([0-9]+)/%s\\/00$1_D_MonteCarlo.root/", Esc(fPathOut).Data()));
    412411
    413412    MWriteRootFile write3a( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file");
     
    471470
    472471    MSimGeomCam simgeom;
    473     simgeom.SetNameGeomCam("GeomAPDs");
     472    simgeom.SetNameGeomCam("GeomCones");
    474473
    475474    MSimCalibrationSignal simcal;
    476     simcal.SetNameGeomCam("GeomAPDs");
     475    simcal.SetNameGeomCam("GeomCones");
    477476
    478477    //  Dark Current: 4MHz = 0.004 GHz
     
    484483//    simnsb.SetFreq(0.005, 0.004);    // 5MHz/cm^2, 4MHz
    485484    simnsb.SetFreq(0, 0.04);           // 40MHz fixed for each APD
    486     simnsb.SetNameGeomCam("GeomAPDs");
     485    simnsb.SetNameGeomCam("GeomCones");
    487486
    488487    // FIXME: How do we handle star-light? We need the rate but we also
     
    491490    MSimAPD simapd;
    492491    simapd.SetFreq(0.04); // Must be identical to MSimRanodmPhotons!!
    493     simapd.SetNameGeomCam("GeomAPDs");
     492    simapd.SetNameGeomCam("GeomCones");
    494493
    495494    MSimExcessNoise   simexcnoise;
     
    563562        {
    564563            tasks.AddToList(&fill0);
    565             tasks.AddToList(&fill1);
     564            //tasks.AddToList(&fill1);
    566565            tasks.AddToList(&fill2);
    567566            tasks.AddToList(&fill3);
     
    645644        return kFALSE;
    646645
     646    // FIXME: If pedestal file given use the values from this file
    647647    //-------------------------------------------
    648648
     
    652652
    653653    header.Print();
     654
     655    // FIXME: Display acceptance curves!
    654656
    655657    if (fDisplay)
     
    666668        shape.DrawClone()->SetBit(kCanDelete);
    667669
    668         if (header.IsDataRun() || header.IsPointRun())
     670        if (env0.GetCont() && (header.IsDataRun() || header.IsPointRun()))
    669671        {
    670672            c.cd(3);
     
    674676            gPad->SetGridy();
    675677            gROOT->SetSelectedPad(0);
    676             reflector.DrawClone("line")->SetBit(kCanDelete);
     678            static_cast<MReflector*>(env0.GetCont())->DrawClone("line")->SetBit(kCanDelete);
    677679
    678680        }
     
    680682        if (fCamera)
    681683        {
    682             if (dynamic_cast<MGeomCam*>(env1.GetCont()))
     684            if (env1.GetCont())
    683685            {
    684686                c.cd(2);
     
    696698            }
    697699
    698             if (dynamic_cast<MGeomCam*>(env2.GetCont()))
     700            if (env2.GetCont())
    699701            {
    700702                c.cd(4);
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r9318 r9328  
    416416        case kRoot: // mcdata
    417417            d += "rawfiles/";
     418            if (!fNight)
     419                *fLog << "WARNING - No Night-resource... path not supported." << endl;
    418420            d += fNight.GetStringFmt("%Y/%m/%d");
    419421            break;
     
    423425            break;
    424426        case kCalibrated:
    425             d += Form("callisto/%04d/%08d", fSequence/10000, fSequence);
     427            d += MString::Format("callisto/%04d/%08d", fSequence/10000, fSequence);
    426428            break;
    427429        case kImages:
    428             d += Form("star/%04d/%08d", fSequence/10000, fSequence);
     430            d += MString::Format("star/%04d/%08d", fSequence/10000, fSequence);
    429431            break;
    430432        }
     
    477479
    478480    // ------------- Create file name --------------
    479     TString n = night.GetStringFmt("%Y%m%d_");
     481    TString n;
     482
     483    if (night)
     484        n += night.GetStringFmt("%Y%m%d_");
    480485
    481486    // This is for MCs (FIXME!!!!)
    482487    if (run<0)
    483         n += Form("%08d", -run);
     488        n += MString::Format("%08d", -run);
    484489    else
    485490    {
    486491        if (tel>0)
    487             n += Form("M%d_", tel);
     492            n += MString::Format("M%d_", tel);
    488493
    489494        // R. DeLosReyes and T. Bretz
    490495        // Changes to read the DAQ numbering format. Changes takes place
    491496        // between runs 35487 and 00035488 (2004_08_30)
    492         n += Form(run>limit ? "%08d" : "%05d", run);
     497        n += MString::Format(run>limit ? "%08d" : "%05d", run);
    493498
    494499        if (tel>0)
    495             n += Form(".%03d", file);
     500            n += MString::Format(".%03d", file);
    496501    }
    497502
     
    876881    fSequence = (UInt_t)env.GetValue("Sequence", (Int_t)seq);
    877882
    878     const TString prefix = Form("Sequence%08d", fSequence);
     883    const TString prefix = MString::Format("Sequence%08d", fSequence);
    879884
    880885    fTelescope = GetEnvValue2(env, prefix, "Telescope",  1);
     
    890895
    891896    str = GetEnvValue2(env, prefix, "Night", "");
    892     if (str.IsNull())
    893         fNight = MTime();
    894     else
    895     {
    896         str += " 00:00:00";
    897         fNight.SetSqlDateTime(str);
    898     }
    899 
    900     fPeriod = fNight.GetMagicPeriod();
     897    SetNight(str);
    901898
    902899    fProject      = GetEnvValue2(env, prefix, "Project", "");
     
    11601157    while (p<pos+n)
    11611158    {
    1162         str += Form(" %d", f[p]);
     1159        str += MString::Format(" %d", f[p]);
    11631160
    11641161        if (p==pos+n-1)
     
    11711168
    11721169        if (i>1)
    1173             str += Form(":%d", f[p+i-1]);
     1170            str += MString::Format(":%d", f[p+i-1]);
    11741171
    11751172        p += i;
     
    12121209            return str;
    12131210
    1214         str += Form(" %d", r[p]);
     1211        str += MString::Format(" %d", r[p]);
    12151212        // p now points to the last entry which fits and
    12161213        // has a file number == 0
     
    12191216        // More tahn one found (i-1>1)
    12201217        str += i-1==1 ? " " : ":";
    1221         str += Form("%d", r[p]);
     1218        str += MString::Format("%d", r[p]);
    12221219
    12231220        // One step forward
     
    12941291                str += '\n';
    12951292                str += pre;
    1296                 str += Form("Run%08d:", r[pos]);
     1293                str += MString::Format("Run%08d:", r[pos]);
    12971294                str += GetNumSequence(pos, n, f);
    12981295            }
     
    13271324    const TString opt(o);
    13281325
    1329     const TString pre = opt.Contains("prefixed") ? Form("Sequence%08d.", fSequence) : "";
     1326    const TString pre = opt.Contains("prefixed") ? MString::Format("Sequence%08d.", fSequence) : "";
    13301327
    13311328    if (!IsValid())
     
    13451342    if (fMonteCarlo)
    13461343        out << pre << "MonteCarlo:     Yes" << endl;
    1347     if (fPeriod>=0)
     1344    if (fPeriod!=(UInt_t)-1)
    13481345        out << pre << "Period:         " << fPeriod << endl;
    13491346    if (fNight!=MTime())
     
    15131510{
    15141511    TString night(txt);
     1512
     1513    if (night.IsNull())
     1514    {
     1515        fNight  = MTime();
     1516        fPeriod = UInt_t(-1);
     1517        return;
     1518    }
     1519
    15151520    night += " 00:00:00";
    15161521    fNight.SetSqlDateTime(night);
     
    15741579            seq = "/magic/";
    15751580            if (ismc)
    1576             seq += "montecarlo/";
    1577             seq += Form("sequences/%04d/sequence%08d.txt", numseq/10000, numseq);
     1581                seq += "montecarlo/";
     1582            seq += MString::Format("sequences/%04d/sequence%08d.txt", numseq/10000, numseq);
    15781583            gLog << inf << "Inflated sequence file: " << seq << endl;
    15791584        }
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r9317 r9328  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.68 2009-02-11 12:31:47 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.69 2009-02-12 20:05:06 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    9191#include "MMuonCalibParCalc.h"         // MMuonCalibParCalc
    9292#include "MContinue.h"                 // MContinue
     93#include "MTriggerPatternDecode.h"     // MTriggerPatternDecode
    9394//#include "MMcTriggerLvl2Calc.h"        // MMcTriggerLvl2Calc
    9495
     
    250251    tlist->AddToList(apl);
    251252
     253    MTriggerPatternDecode *decode = new MTriggerPatternDecode;
     254    tlist->AddToList(decode);
    252255
    253256    //MArrivalTime *atime = new MArrivalTime;
  • trunk/MagicSoft/Mars/mmain/Makefile

    r8617 r9328  
    2323           -I../mfileio -I../mimage -I../mhistmc -I../mgbase -I../mfbase  \
    2424           -I../mdata -I../msignal -I../mcalib -I../mbadpixels            \
    25            -I../mpointing -I../mpedestal -I../mmuon -I../mfilter -I../mjobs
     25           -I../mpointing -I../mpedestal -I../mmuon -I../mfilter -I../mjobs \
     26           -I../mtrigger
    2627
    2728SRCFILES = MBrowser.cc \
  • trunk/MagicSoft/Mars/msim/MHPhotonEvent.cc

    r9308 r9328  
    194194    case 2:
    195195        {
    196             MReflector *r = (MReflector*)pList->FindObject("MReflector");
     196            MReflector *r = (MReflector*)pList->FindObject("Reflector", "MReflector");
    197197            if (!r)
    198198            {
    199                 *fLog << err << "MReflector not found... aborting." << endl;
     199                *fLog << err << "Reflector [MReflector] not found... aborting." << endl;
    200200                return kFALSE;
    201201            }
  • trunk/MagicSoft/Mars/msim/MSimAbsorption.cc

    r9243 r9328  
    235235Int_t MSimAbsorption::PreProcess(MParList *pList)
    236236{
     237    if (fFileName.IsNull())
     238    {
     239        *fLog << inf << "No file given... skipping." << endl;
     240        return kSKIP;
     241    }
     242
    237243    fEvt = (MPhotonEvent*)pList->FindObject("MPhotonEvent");
    238244    if (!fEvt)
     
    248254        return kFALSE;
    249255    }
     256
     257    *fLog << inf << "Using " << (fUseTheta?"Theta":"Wavelength") << " for absorption." << endl;
    250258
    251259    return ReadFile();
  • trunk/MagicSoft/Mars/msimcamera/MSimAPD.cc

    r9309 r9328  
    8989Int_t MSimAPD::PreProcess(MParList *pList)
    9090{
     91    if (fNameGeomCam.IsNull())
     92    {
     93        *fLog << inf << "No geometry container... skipping." << endl;
     94        return kSKIP;
     95    }
     96
    9197    fGeom = (MGeomCam*)pList->FindObject(fNameGeomCam, "MGeomCam");
    9298    if (!fGeom)
     
    199205    return kTRUE;
    200206}
     207
     208// --------------------------------------------------------------------------
     209//
     210// NameGeomCam
     211//
     212Int_t MSimAPD::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     213{
     214    Bool_t rc = kFALSE;
     215    if (IsEnvDefined(env, prefix, "NameGeomCam", print))
     216    {
     217        rc = kTRUE;
     218        fNameGeomCam = GetEnvValue(env, prefix, "NameGeomCam", fNameGeomCam);
     219    }
     220
     221    return rc;
     222}
  • trunk/MagicSoft/Mars/msimcamera/MSimAPD.h

    r9240 r9328  
    2828    Double_t fFreq;              // Frequency of random phtons which hit the APDs
    2929
     30    // MParContainer
     31    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     32
    3033    // MTask
    3134    Int_t  PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/msimcamera/MSimCamera.cc

    r9323 r9328  
    281281    return kTRUE;
    282282}
     283
     284// --------------------------------------------------------------------------
     285//
     286// BaselineGain: Off
     287//
     288Int_t MSimCamera::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     289{
     290    Bool_t rc = kFALSE;
     291    if (IsEnvDefined(env, prefix, "BaselineGain", print))
     292    {
     293        rc = kTRUE;
     294        fBaselineGain = GetEnvValue(env, prefix, "BaselineGain", fBaselineGain);
     295    }
     296
     297    return rc;
     298}
  • trunk/MagicSoft/Mars/msimcamera/MSimCamera.h

    r9319 r9328  
    3232    Bool_t fBaselineGain;  // Should the gain be applied to baseline and electronic noise?
    3333
     34    // MParContainer
     35    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     36
    3437    // MTask
    3538    Int_t  PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc

    r9312 r9328  
    103103        return kFALSE;
    104104
    105     fReflector = (MReflector*)pList->FindObject("MReflector");
     105    fReflector = (MReflector*)pList->FindObject("Reflector", "MReflector");
    106106    if (!fReflector)
    107107    {
    108         *fLog << err << "MReflector not found... aborting." << endl;
     108        *fLog << err << "Reflector [MReflector] not found... aborting." << endl;
    109109        return kFALSE;
    110110    }
     
    430430
    431431    TClonesArray &cpy0 = fMirror0->GetArray();
    432     TClonesArray &cpy1 = fMirror1->GetArray();
     432    //TClonesArray &cpy1 = fMirror1->GetArray();
    433433    TClonesArray &cpy2 = fMirror2->GetArray();
    434434    TClonesArray &cpy3 = fMirror3->GetArray();
    435435    TClonesArray &cpy4 = fMirror4->GetArray();
    436436    cpy0.ExpandCreateFast(arr.GetEntriesFast());
    437     cpy1.ExpandCreateFast(arr.GetEntriesFast());
     437    //cpy1.ExpandCreateFast(arr.GetEntriesFast());
    438438    cpy2.ExpandCreateFast(arr.GetEntriesFast());
    439439    cpy3.ExpandCreateFast(arr.GetEntriesFast());
     
    507507
    508508        // FIXME: Do we really need this one??
    509         *static_cast<MPhotonData*>(cpy1.UncheckedAt(cnt[1]++)) = *dat;
     509        //*static_cast<MPhotonData*>(cpy1.UncheckedAt(cnt[1]++)) = *dat;
    510510
    511511        // Check if the reflector can be hit at all
     
    549549    // MPhotonEvent::Shrink).
    550550    fMirror0->Shrink(cnt[0]);
    551     fMirror1->Shrink(cnt[1]);
     551    //fMirror1->Shrink(cnt[1]);
    552552    fMirror2->Shrink(cnt[2]);
    553553    fMirror3->Shrink(cnt[3]);
Note: See TracChangeset for help on using the changeset viewer.