Changeset 9597


Ignore:
Timestamp:
06/25/10 15:58:02 (15 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9595 r9597  
    1919                                                 -*-*- END OF LINE -*-*-
    2020
     21 2010/06/25 Thomas Bretz
     22
     23   * mjobs/MJSimulation.[h,cc]:
     24     - added data member fRunNumber
     25     - changed the rules to create the output file names
     26     - set default run-numbers for different run-ytpes
     27     - apply run-number
     28     - added IntendedPulsePosition to output
     29
     30   * mraw/MRawRunHeader.h:
     31     - added SetFileNumber member function
     32
     33
     34
    2135 2010/06/24 Thomas Bretz
    2236
  • trunk/MagicSoft/Mars/mjobs/MJSimulation.cc

    r9572 r9597  
    128128MJSimulation::MJSimulation(const char *name, const char *title)
    129129    : fForceMode(kFALSE), fCamera(kTRUE), fForceTrigger(kFALSE),
    130     fOperationMode(kModeData)
     130    fOperationMode(kModeData), fRunNumber(-1)
    131131{
    132132    fName  = name  ? name  : "MJSimulation";
     
    315315    case kModeData:
    316316        header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTData);
     317         header.SetRunInfo(0, fRunNumber<0 ? 3 : fRunNumber);
    317318        break;
    318319
     
    320321        header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPedestal);
    321322        header.SetSourceInfo("Pedestal");
     323        header.SetRunInfo(0, fRunNumber<0 ? 1 : fRunNumber);
    322324        break;
    323325
     
    325327        header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTCalibration);
    326328        header.SetSourceInfo("Calibration");
     329        header.SetRunInfo(0, fRunNumber<0 ? 2 : fRunNumber);
    327330        break;
    328331
    329332    case kModePointRun:
    330333        header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPointRun);
     334        header.SetRunInfo(0, fRunNumber<0 ? 0 : fRunNumber);
    331335        break;
    332336    }
     
    512516    // -------------------------------------------------------------------
    513517
    514     const char *fmt = Form("s/cer([0-9]+)/%%s\\/00$1_%c_MonteCarlo.root/", header.GetRunTypeChar());
    515 
    516     // FIXME: Pedestal and Calibration runs should get P and C
    517     const TString rule1(Form("s/cer([0-9]+)/%s\\/00$1_R_MonteCarlo.root/", Esc(fPathOut).Data()));
    518     const TString rule2(Form("s/cer([0-9]+)/%s\\/00$1_Y_MonteCarlo.root/", Esc(fPathOut).Data()));
    519     const TString rule4(Form("s/cer([0-9]+)/%s\\/00$1_I_MonteCarlo.root/", Esc(fPathOut).Data()));
    520     const TString rule3(Form(fmt, Esc(fPathOut).Data()));
     518    const char *fmt = Form("s/cer([0-9]+)([0-9][0-9][0-9])/%s\\/%08d.$2_%%c_MonteCarlo$1.root/", Esc(fPathOut).Data(), fRunNumber);
     519
     520    const TString rule1(Form(fmt, 'R'));
     521    const TString rule2(Form(fmt, 'Y'));
     522    const TString rule4(Form(fmt, 'I'));
     523    const TString rule3(Form(fmt, header.GetRunTypeChar()));
    521524
    522525    MWriteRootFile write4a( 2, rule4, fOverwrite?"RECREATE":"NEW", "Star file");
     
    551554
    552555    // D: Dedicated file structure
    553     write3a.AddContainer("ElectronicNoise", "RunHeaders");
    554     write3a.AddContainer("MRawEvtData", "Events");
     556    write3a.AddContainer("ElectronicNoise",  "RunHeaders");
     557    write3a.AddContainer("IntendedPulsePos", "RunHeaders");
     558    write3a.AddContainer("MRawEvtData",      "Events");
     559    // It doesn't make much sene to write this information
     560    // to the file because the units are internal units not
     561    // related to the output samples
     562    //    if (header.IsDataRun() || fForceTrigger)
     563    //        write3a.AddContainer("TriggerPos",   "Events");
    555564
    556565    // I: Dedicated file structure
  • trunk/MagicSoft/Mars/mjobs/MJSimulation.h

    r9441 r9597  
    2323    Bool_t fForceTrigger;   // Force the use of the trigger "electronics"
    2424
    25     Int_t fOperationMode;   // Operation mode (data, ped, cal, pointrun)
     25    Int_t  fOperationMode;  // Operation mode (data, ped, cal, pointrun)
     26    Int_t  fRunNumber;      // 8 digits run number to be used for the file names
    2627
    2728    Bool_t WriteResult(const MParList &plist, const MSequence &seq);
     
    3839    void SetMode(Int_t mode) { fOperationMode = mode; }
    3940
     41    void SetRunNumber(Int_t n=-1) { fRunNumber = n%100000000; }
     42
    4043    // Process
    4144    Bool_t Process(const MArgs &args, const MSequence &seq);
Note: See TracChangeset for help on using the changeset viewer.