Ignore:
Timestamp:
04/23/07 20:11:25 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCalib.cc

    r8369 r8434  
    4848// - fPulsePosCheck to kFALSE
    4949//
    50 MJCalib::MJCalib() : fDataFlag(kIsUseRawData), fStorage(0),
    51                      fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE)/*,
    52                      fIsHiLoCalibration(kFALSE)*/
     50MJCalib::MJCalib() : fStorage(0), fIsPixelCheck(kFALSE), fIsPulsePosCheck(kFALSE)
    5351{
    5452  SetUseBlindPixel(kFALSE);
    5553  SetUsePINDiode(kFALSE);
    56  
     54
    5755  SetCheckedPixId();
    5856}
     
    6361    SetPulsePosCheck(GetEnv("PulsePosCheck", fIsPulsePosCheck));
    6462    SetCheckedPixId(GetEnv("CheckedPixId",fCheckedPixId));
    65     //SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration));
    6663
    6764    if (HasEnv("StorageType"))
     
    8178        return kTRUE;
    8279
    83     TString dat = GetEnv("DataType", "");
    84     dat = dat.Strip(TString::kBoth);
    85     dat.ToLower();
    86 
    87     if (dat == (TString)"raw")
    88         SetUseRawData();
    89 
    90     if (dat == (TString)"mc" || dat == (TString)"montecarlo")
    91         SetUseMC();
    92 
    93     if (dat == (TString)"root")
    94         SetUseRootData();
    95 
    9680    return kTRUE;
    9781}
  • trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc

    r8245 r8434  
    287287  if (fSequence.IsValid())
    288288    {
    289         if (fSequence.SetupCalRuns(iter, 0, IsUseRawData())<=0)
     289        if (fSequence.SetupCalRuns(iter, 0, !fSequence.IsMonteCarlo())<=0)
    290290            return kFALSE;
    291291    }
     
    369369  read.DisableAutoScheme();
    370370
    371   if (IsUseRawData())
     371  if (!fSequence.IsMonteCarlo())
    372372    rawread.AddFiles(iter);
    373373  else
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r8428 r8434  
    8080#include "MCalibCalcFromPast.h"
    8181
    82 #include "MReadReports.h"
    8382#include "MReadMarsFile.h"
    8483#include "MRawFileRead.h"
     
    9089#include "MGeomApply.h"
    9190#include "MPedestalSubtract.h"
    92 //#include "MMcPedestalCopy.h"
    9391#include "MPointingPosCalc.h"
    9492#include "MPedCalcFromLoGain.h"
     
    102100#include "MCalibrateData.h"
    103101#include "MCalibrateRelTimes.h"
    104 //#include "MBadPixelsMerge.h"
    105102#include "MBadPixelsCalc.h"
    106103#include "MBadPixelsTreat.h"
     
    248245    if (fSequence.IsValid())
    249246    {
    250         if (fSequence.SetupDatRuns(iter, 0, IsUseRawData())<=0)
     247        if (fSequence.SetupDatRuns(iter, 0, !fSequence.IsMonteCarlo())<=0)
    251248            return kFALSE;
    252249    }
     
    362359    plist.AddToList(&tlist);
    363360
    364     MReadReports readreal;
    365     readreal.AddTree("Events", "MTime.", MReadReports::kMaster);
    366     readreal.AddTree("Trigger");
    367     readreal.AddTree("Camera");
    368     readreal.AddTree("Drive");
    369     readreal.AddTree("CC");
    370     readreal.AddTree("Currents");
    371 
    372361    MReadMarsFile readmc("Events");
    373362    readmc.DisableAutoScheme();
     
    375364    MRawFileRead rawread(NULL);
    376365
    377     MRead *read = 0;
    378     switch (GetDataFlag())
    379     {
    380     case kIsUseRawData:  read = &rawread;  break;
    381     case kIsUseMC:       read = &readmc;   break;
    382     case kIsUseRootData: read = &readreal; break;
    383     }
     366    MRead *read = fSequence.IsMonteCarlo() ? (MRead*)&readmc : (MRead*)&rawread;
    384367    read->AddFiles(iter);
    385368
    386369    const TString fname(Form("%s{s/_D_/_Y_}{s/\\.raw$/.root}{s/\\.raw\\.gz$/.root}", fPathOut.Data()));
    387370
    388    
    389371    // Skips MC which have no contents. This are precisely the
    390372    // events which fullfilled the MC Lvl1 trigger and an
     
    808790    movwrite.SetFilter(&movfilt);
    809791
    810     MTaskList tlistmov;
     792    MTaskList tlistmov("MovieEncoder");
    811793    tlistmov.AddToList(&movprep);
    812794    tlistmov.AddToList(&movfilt);
     
    835817    tlist.AddToList(read);
    836818
    837     if (IsUseMC())
    838     {
    839         tlist.AddToList(&writemc);
     819    if (fSequence.IsMonteCarlo())
     820    {
     821        if (!fIsMovieMode)
     822            tlist.AddToList(&writemc);
    840823        tlist.AddToList(&contmc);
    841824    }
     
    843826    //if (IsUseRootData())
    844827    //  tlist2.AddToList(&pextr);
    845     tlist.AddToList(&tlist2, IsUseRootData() ? "Events" : "All");
    846 
    847     //if (IsUseMC())
     828    tlist.AddToList(&tlist2, fSequence.IsMonteCarlo() ? "Events" : "Alls");
     829
     830    //if (fSequence.IsMonteCarlo())
    848831    //  tlist.AddToList(&pcalc, "Drive");
    849832
    850     tlist.AddToList(&write);
     833    if (!fIsMovieMode)
     834        tlist.AddToList(&write);
    851835
    852836    // Create and setup the eventloop
     
    901885
    902886    if (!WriteResult(interlacedcont))
    903       return kFALSE;
     887        return kFALSE;
    904888
    905889    // return if job went ok
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r8428 r8434  
    14581458
    14591459    // Defined resource id
    1460     const TString id = IsUseMC() ? "MC" : Form("%02d", period);
     1460    const TString id = fSequence.IsMonteCarlo() ? "MC" : Form("%02d", period);
    14611461
    14621462    // Check for a valid entry for the correct period
     
    17071707
    17081708    MDirIter iter;
    1709     if (fSequence.SetupCalRuns(iter, 0, IsUseRawData())<=0)
     1709    if (fSequence.SetupCalRuns(iter, 0, !fSequence.IsMonteCarlo())<=0)
    17101710        return kFALSE;
    17111711
     
    17461746    MRawFileRead rawread(NULL);
    17471747
    1748     if (IsUseRawData())
     1748    if (!fSequence.IsMonteCarlo())
    17491749    {
    17501750        rawread.AddFiles(iter);
     
    19481948        SetUsePINDiode(kFALSE);
    19491949
    1950     const Int_t numexec = IsUseRawData() ? rawread.GetNumExecutions() : read.GetNumExecutions();
     1950    const Int_t numexec = !fSequence.IsMonteCarlo() ? rawread.GetNumExecutions() : read.GetNumExecutions();
    19511951    if (numexec>0)
    19521952    {
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r8323 r8434  
    119119}
    120120
    121 Bool_t MJStar::Process(Bool_t ismc)
     121Bool_t MJStar::Process()
    122122{
    123123    if (!fSequence.IsValid())
     
    275275    write.AddContainer("MMuonSetup",                "RunHeaders");
    276276
    277     if (ismc)
     277    if (fSequence.IsMonteCarlo())
    278278    {
    279279        // Monte Carlo Data
     
    311311    writem.AddContainer("MRawEvtHeader",            "Muons");
    312312    writem.AddContainer("MPointingPos",             "Muons");
    313     if (ismc)
     313    if (fSequence.IsMonteCarlo())
    314314    {
    315315        // Monte Carlo Data
     
    318318    }
    319319
    320     if (ismc)
     320    if (fSequence.IsMonteCarlo())
    321321        if (fMuonAnalysis)
    322322            writem.AddCopySource("OriginalMC");
     
    326326    MTaskList tlist2("Events");
    327327    tlist2.AddToList(&apply);
    328     if (!ismc)
     328    if (!fSequence.IsMonteCarlo())
    329329        tlist2.AddToList(&cont);
    330330    tlist2.AddToList(&contsw);
    331     if (!ismc)
     331    if (!fSequence.IsMonteCarlo())
    332332    {
    333333        // Calibration events don't enter star at all.
     
    450450    // ------------------------------------------------------------
    451451
    452     tlist.AddToList(ismc ? (MTask*)&readmc : (MTask*)&readreal);
    453     tlist.AddToList(&pcalc,  ismc ? "Events" : "Drive");
     452    tlist.AddToList(fSequence.IsMonteCarlo() ? (MTask*)&readmc : (MTask*)&readreal);
     453    tlist.AddToList(&pcalc,  fSequence.IsMonteCarlo() ? "Events" : "Drive");
    454454    //tlist.AddToList(&filltst, "Events");
    455455    tlist.AddToList(&tlist2, "Events");
    456     if (!ismc)
     456    if (!fSequence.IsMonteCarlo())
    457457    {
    458458        // initiate task list
  • trunk/MagicSoft/Mars/mjobs/MJStar.h

    r6993 r8434  
    2121
    2222    // Process
    23     Bool_t Process(Bool_t ismc=kFALSE);
     23    Bool_t Process();
    2424
    2525    ClassDef(MJStar, 0) // Tool to create a pedestal file (MPedestalCam)
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r8371 r8434  
    118118//    seq.SetupPedRuns(iter, "/mypath", "[DPC]");
    119119//
     120// ===========================================================================
     121//
     122//  Class Version 2:
     123//   + fMonteCarlo
     124//
    120125/////////////////////////////////////////////////////////////////////////////
    121126#include "MSequence.h"
     
    220225        switch (type)
    221226        {
    222         case kRawDat:
     227        case kRawDat:  // rawdata
    223228        case kRawPed:
    224229        case kRawCal:
    225230        case kRawAll:
    226             d += "rawfiles/";
    227             d += fNight.GetStringFmt("%Y/%m/%d");
    228             break;
    229         case kRootDat:
     231        case kRootDat: // mcdata
    230232        case kRootPed:
    231233        case kRootCal:
    232234        case kRootAll:
    233             d += "merpp/";
     235            d += "rawfiles/";
    234236            d += fNight.GetStringFmt("%Y/%m/%d");
    235237            break;
     
    253255        // Changes to read the DAQ numbering format. Changes takes place
    254256        // between runs 35487 and 00035488 (2004_08_30)
    255         const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E";
     257        const char *fmt = arr[i]>35487 || fMonteCarlo ? "%08d_%s_*_E" : "%05d_%s_*_E";
    256258
    257259        TString n;
     
    447449    fTriggerTable = env.GetValue("TriggerTable", "");
    448450    fHvSettings   = env.GetValue("HvSettings", "");
     451    fMonteCarlo   = env.GetValue("MonteCarlo", kFALSE);
    449452
    450453    str = env.GetValue("Runs", "");
     
    488491    }
    489492    gLog << "Sequence:       " << fSequence << endl;
     493    if (fMonteCarlo)
     494        gLog << "MonteCarlo:     Yes" << endl;
    490495    gLog << "Period:         " << fPeriod << endl;
    491496    gLog << "Night:          " << fNight << endl << endl;
     
    646651    fPeriod = MAstro::GetMagicPeriod(fNight.GetMjd());
    647652}
     653
     654// --------------------------------------------------------------------------
     655//
     656// If the sequence name seq is just a digit it is inflated to a full
     657// path following the datacenter standard.
     658//
     659// Returns if file accessible or not.
     660//
     661Bool_t MSequence::InflatePath(TString &seq, Bool_t ismc)
     662{
     663    if (seq.IsDigit())
     664    {
     665        const Int_t numseq = seq.Atoi();
     666        seq = "/magic/";
     667        if (ismc)
     668            seq += "montecarlo/";
     669        seq += Form("sequences/%04d/sequence%08d.txt", numseq/10000, numseq);
     670        gLog << inf << "Inflated sequence file: " << seq << endl;
     671    }
     672
     673    if (!gSystem->AccessPathName(seq, kFileExists))
     674        return kTRUE;
     675
     676    gLog << err << "Sorry, sequence file '" << seq << "' doesn't exist." << endl;
     677    return kFALSE;
     678}
  • trunk/MagicSoft/Mars/mjobs/MSequence.h

    r8398 r8434  
    5151    TArrayI fDatRuns;
    5252
     53    Bool_t fMonteCarlo;
     54
    5355    //TExMap fFileNames;
    5456
     
    6567public:
    6668    MSequence() : fSequence((UInt_t)-1), fLastRun((UInt_t)-1),
    67         fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1) { }
     69        fNumEvents((UInt_t)-1), fPeriod((UInt_t)-1), fMonteCarlo(kFALSE) { }
    6870    MSequence(const char *fname, const char *path="");
    6971    MSequence(const MSequence &s) : fSequence(s.fSequence), fStart(s.fStart),
     
    7274        fTriggerTable(s.fTriggerTable), fHvSettings(s.fHvSettings),
    7375        fRuns(s.fRuns), fCalRuns(s.fCalRuns), fPedRuns(s.fPedRuns),
    74         fDatRuns(s.fDatRuns) { }
     76        fDatRuns(s.fDatRuns), fMonteCarlo(s.fMonteCarlo) { }
    7577    ~MSequence();
    7678
     
    8082    // Genaral interface
    8183    Bool_t IsValid() const { return fSequence!=(UInt_t)-1; }
     84    Bool_t IsMonteCarlo() const { return fMonteCarlo; }
     85
     86    void SetMonteCarlo(Bool_t ismc=kTRUE) { fMonteCarlo=ismc; }
    8287
    8388    UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
     
    115120    const TString &GetSource() const { return fSource; }
    116121
    117     const TString GetStandardPath() const { return "/magic/data/"; }
     122    const TString GetStandardPath() const { return fMonteCarlo?"/magic/montecarlo/":"/magic/data/"; }
    118123
    119124    const TString &GetFileName() const { return fFileName; }
     
    133138    UInt_t AddDatRuns(UInt_t num) { return AddDatRuns(num, num); }
    134139
    135     ClassDef(MSequence, 1)
     140    static Bool_t InflatePath(TString &seq, Bool_t ismc=kFALSE);
     141
     142    ClassDef(MSequence, 2)
    136143};
    137144
Note: See TracChangeset for help on using the changeset viewer.