Changeset 8434


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8433 r8434  
    1919                                                 -*-*- END OF LINE -*-*-
    2020
     21 2007/04/23 Thomas Bretz
     22
     23   * callisto.cc, star.cc:
     24     - removed "-raw" and "-root" option
     25     - replaced inflating sequence path by new InflatePath
     26       function
     27     - removed MJCalib::kUse* usage, use MSequence::IsMonteCarlo
     28       instead
     29
     30   * mhcalib/MHCalibrationChargeBlindCam.cc,
     31     mhcalib/MHCalibrationHiLoCam.cc,
     32     mhcalib/MHCalibrationPulseTimeCam.cc:
     33     - removed obsolete include of MCalibrationIntensityCam
     34
     35   * mhcalib/MHPedestalCam.cc:
     36     - removed obsolete usage of fIntensCam
     37
     38   * mhist/MHEvent.cc:
     39     - replacedcompilation of description string by new
     40       MMcEvt::GetDescription memeber function
     41
     42   * mjobs/MJCalib.[h,cc]:
     43     - removed fDataFlag and corresponding member functions and
     44       handling
     45
     46   * mjobs/MJCalibTest.cc, mjobs/MJCalibrateSignal.cc,
     47     mjobs/MJCalibration.cc, mjobs/MJPedestal.cc, mjobs/MJStar.[h,cc]:
     48     - replaced IsUseRawData and IsUseRootData by
     49       MSequence::IsMonteCarlo
     50     - use fSequence to determin whether it is MC sequence or not
     51
     52   * mjobs/MJCalibrateSignal.cc:
     53     - renamed movie encoding task list
     54     - do not write output files if encoding movie
     55
     56   * mjobs/MSequence.[h,cc]:
     57     - removed "merpp"-path
     58     - monte carlo files now always have 8digits run numbers
     59     - added new resource "MonteCarlo"
     60     - added new static member function InflatePath
     61     - increased version number to 2
     62
     63   * mmc/MMcEvt.[hxx,cxx]:
     64     - added new member function GetDescription
     65
     66   * mmovie/MMovieWrite.[h,cc]:
     67     - added a sanity check for strange rms values
     68     - search for MMcEvt in the parlist and improve output
     69       in case of monte carlo data
     70     - fixed some typos in the comments of ReadEnv
     71
     72   * mmovie/Makefile:
     73     - added mmc search path
     74
     75   * mraw/MRawRunHeader.cc:
     76     - set new defaults of fTelescopeNumber, fCameraVersion,
     77       fFreqSampling and fNumSignificantBits for old MC data
     78
     79
     80
    2181 2007/04/23 Daniela Dorner
    2282
  • trunk/MagicSoft/Mars/NEWS

    r8432 r8434  
    1717   - merpp: When reading raw data the data is now stored in a single
    1818     array. The lo-gain array is obsolete. The interface stays the same.
     19
     20   - callisto: The -root and -raw options to read merpped data have been
     21     removed
     22
     23   - callisto: If the -mc option is given the sequence-name can now be
     24     replaced by the MC sequence number
     25
     26   - callisto: If the sequence file contains "MonteCarlo: Yes" the
     27     -mc option can now be omitted
    1928
    2029   - callisto: Started further simplification by removing obsolete
  • trunk/MagicSoft/Mars/callisto.cc

    r8406 r8434  
    5555    gLog << "   -y                        Extract and calibrate signal" << endl << endl;
    5656    gLog << " Data Type (exclusive):" << endl;
    57     gLog << "   -raw                      Read input from raw-data <default>" << endl;
    5857    gLog << "   -mc                       Input root-files are monte carlo files" << endl;
    59     gLog << "   -root                     Read input from root-files (merpped)" << endl << endl;
    6058    gLog << " Options:" << endl;
    6159    gLog.Usage();
     
    192190          Bool_t  kModeC      = arg.HasOnlyAndRemove("-c");
    193191          Bool_t  kModeY      = arg.HasOnlyAndRemove("-y");
    194 
    195     MJCalib::DataType_t kDataType = MJCalib::kIsUseRawData; // root
    196     if (arg.HasOnlyAndRemove("-root"))
    197         kDataType = MJCalib::kIsUseRootData; // root
    198     if (arg.HasOnlyAndRemove("-raw"))
    199         kDataType = MJCalib::kIsUseRawData;  // raw
    200     if (arg.HasOnlyAndRemove("-mc"))
    201         kDataType = MJCalib::kIsUseMC;       // monte carlo
     192    const Bool_t  kIsMC       = arg.HasOnlyAndRemove("-mc");
    202193
    203194    if (!kInpathY.IsNull() || !kOutpathY.IsNull() || !kOutpath.IsNull() || !kPath.IsNull())
     
    267258    TString kSequence = arg.GetArgumentStr(0);
    268259
    269     if (kSequence.IsDigit())
    270     {
    271         const Int_t numseq = kSequence.Atoi();
    272         kSequence = Form("/magic/sequences/%04d/sequence%08d.txt", numseq/10000, numseq);
    273         gLog << inf << "Inflated sequence file: " << kSequence << endl;
    274     }
    275 
    276     if (gSystem->AccessPathName(kSequence, kFileExists))
    277     {
    278         gLog << err << "Sorry, sequence file '" << kSequence << "' doesn't exist." << endl;
     260    if (!MSequence::InflatePath(kSequence, kIsMC))
    279261        return 3;
    280     }
    281262
    282263    if (gSystem->AccessPathName(kConfig, kFileExists))
     
    293274    //
    294275    MSequence seq(kSequence, kInpathD);
     276    if (!seq.IsMonteCarlo())
     277        seq.SetMonteCarlo(kIsMC);
    295278    if (kPrintSeq)
    296279    {
     
    310293    //
    311294    if (kPrintFiles)
    312         PrintFiles(seq, kInpathD, kDataType==MJCalib::kIsUseRawData, kFALSE);
     295        PrintFiles(seq, kInpathD, !seq.IsMonteCarlo(), kFALSE);
    313296    if (kPrintFound)
    314         PrintFiles(seq, kInpathD, kDataType==MJCalib::kIsUseRawData, kTRUE);
     297        PrintFiles(seq, kInpathD, !seq.IsMonteCarlo(), kTRUE);
    315298
    316299    if (seq.HasMoon())
     
    381364        job1.SetDisplay(d);
    382365        job1.SetOverwrite(kOverwrite);
    383         job1.SetDataType(kDataType);
    384366        job1.SetUseHists(kMoon);
    385367
     
    411393        job2.SetDisplay(d);;
    412394        job2.SetOverwrite(kOverwrite);
    413         job2.SetDataType(kDataType);
    414395        job2.SetUseHists(kMoon);
    415396        job2.SetDeadPixelCheck();
     
    447428        job3.SetOverwrite(kOverwrite);
    448429        job3.SetPathOut(kOutpathC);
    449         job3.SetDataType(kDataType);
    450430        // job2.SetPathIn(kInpathC); // not yet needed
    451431
     
    479459            job4.SetOverwrite(kOverwrite);
    480460            job4.SetPathOut(kOutpathC);
    481             job4.SetDataType(kDataType);
    482461
    483462            if (!job4.Process(job1.GetPedestalCam()))
     
    514493        job1.SetOverwrite(kOverwrite);
    515494        job1.SetPathIn(kInpathY);   // --> READ Extractor from calib-file
    516         job1.SetDataType(kDataType);
    517495        //job1.SetPathOut(kOutpathY);   // not yet needed
    518496        job1.SetUseData();
     
    544522        job2.SetOverwrite(kOverwrite);
    545523        job2.SetPathIn(kInpathY);
    546         job2.SetDataType(kDataType);
    547         job2.SetPulsePosCheck(kDataType!=MJCalib::kIsUseMC);
     524        job2.SetPulsePosCheck(!seq.IsMonteCarlo());
    548525        job2.SetPathOut(kOutpathY); // for updating the extractor
    549526
     
    600577        job3.SetOverwrite(kOverwrite);
    601578        job3.SetPathIn(kInpathY);
    602         job3.SetDataType(kDataType);
    603579        // job1.SetPathOut(kOutpathC); // not yet needed
    604580        // job1.SetPathIn(kInpathC);   // not yet needed
     
    634610        job4.SetPathIn(kInpathY);
    635611        job4.SetPathOut(kOutpathY);
    636         job4.SetDataType(kDataType);
    637612        job4.SetMovieMode(kMovie);
    638         if (kDataType!=MJCalib::kIsUseMC)
     613        if (!seq.IsMonteCarlo())
    639614            job4.SetExtractor(job2.GetExtractor());
    640615
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc

    r8428 r8434  
    4646
    4747#include "MCalibrationBlindPix.h"
    48 #include "MCalibrationIntensityCam.h"
    4948
    5049#include "MParList.h"
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.cc

    r8428 r8434  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationHiLoCam.cc,v 1.22 2007-04-20 13:55:00 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCalibrationHiLoCam.cc,v 1.23 2007-04-23 19:06:28 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    105105#include "MCalibrationHiLoPix.h"
    106106#include "MCalibrationCam.h"
    107 #include "MCalibrationIntensityCam.h"
    108107#include "MCalibrationPix.h"
    109108
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc

    r8428 r8434  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.36 2007-04-20 13:55:00 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHCalibrationPulseTimeCam.cc,v 1.37 2007-04-23 19:06:28 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    123123#include "MCalibrationPix.h"
    124124#include "MHCalibrationPix.h"
    125 #include "MCalibrationIntensityCam.h"
    126125
    127126#include "MGeomCam.h"
  • trunk/MagicSoft/Mars/mhcalib/MHPedestalCam.cc

    r8417 r8434  
    101101#include "MPedestalPix.h"
    102102
    103 #include "MCalibrationIntensityCam.h"
    104103#include "MCalibrationPix.h"
    105104
     
    394393                       fFirst, fLast);
    395394       
    396         InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j);
     395        InitHists(pix, fCam->GetAverageBadArea(j), j);
    397396
    398397      }
     
    411410                         fFirst, fLast);
    412411
    413           InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j);
     412          InitHists(pix, fCam->GetAverageBadSector(j), j);
    414413
    415414      }
  • trunk/MagicSoft/Mars/mhist/MHEvent.cc

    r8364 r8434  
    282282
    283283    if (fMcEvt)
    284     {
    285         TString txt("#splitline{");
    286 
    287         txt += fMcEvt->GetParticleName();
    288         txt += " ";
    289 
    290         s.Insert(0, txt);
    291 
    292         s += "}{  E=";
    293 
    294         s+= fMcEvt->GetEnergyStr();
    295 
    296         s += " r=";
    297         s += (int)(fMcEvt->GetImpact()/100+.5);
    298         s += "m Zd=";
    299         s += 0.1*TMath::Nint(fMcEvt->GetTelescopeTheta()*180/TMath::Pi()*10);
    300         s += "\\circ ";
    301         if (fMcEvt->GetPhotElfromShower()>=10000)
    302             s += Form("%dk", (Int_t)(fMcEvt->GetPhotElfromShower()/1000.+.5));
    303         else
    304             if (fMcEvt->GetPhotElfromShower()>=1000)
    305                 s += Form("%.1fk", fMcEvt->GetPhotElfromShower()/1000.);
    306             else
    307                 s += fMcEvt->GetPhotElfromShower();
    308         s += "PhEl}";
    309     }
     284        s = fMcEvt->GetDescription(s);
    310285
    311286    gPad=NULL;
  • 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
  • trunk/MagicSoft/Mars/mmovie/MMovieWrite.cc

    r8411 r8434  
    7878//   MBadPixelsCam
    7979//   MMovieData
     80//   [MMcEvt]
    8081//
    8182/////////////////////////////////////////////////////////////////////////////
     
    9798#include "MGeomCam.h"
    9899#include "MGeomPix.h"
     100
     101#include "MMcEvt.hxx"
    99102
    100103#include "MH.h"
     
    279282        return kFALSE;
    280283    }
     284
     285    fMC = (MMcEvt*)plist->FindObject("MMcEvt");
    281286
    282287    return OpenPipe();
     
    592597
    593598    const Double_t rms = fIn->GetMedianPedestalRms();
    594 
    595     h.SetMinimum(fIn->GetMax()-(fIn->GetMax()-rms)*99/98); // rms0
    596     h.SetMaximum(fIn->GetMax());
     599    const Double_t max = fIn->GetMax();    // scale the lover limit such
     600    const Double_t dif = (max-rms)*99/98;  // that everything below rms is
     601    const Double_t min = max-dif;          // displayed as white
     602
     603    // If the maximum is equal or less the
     604    // pedestal rms something must be wrong
     605    if (dif<=0)
     606        return kFALSE;
     607
     608    h.SetMinimum(min);
     609    h.SetMaximum(max);
    597610
    598611    // -----------------------------------------
     
    763776
    764777    cout << "MED=" << rms0 << endl;
    765   */
     778    */
     779
     780    TString s = Form("%d: ", GetNumExecutions()+1);
     781    s += "Evt #";
     782    s += fHead->GetDAQEvtNumber();
     783    s += " of ";
     784    s += "Run #";
     785    s += fRun->GetRunNumber();
     786    if (fMC)
     787        s = fMC->GetDescription(s);
     788
    766789    MHCamera h(*fCam);
    767     h.SetTitle(Form("%d: Run #%d,  Evt %d", GetNumExecutions()+1,
    768                     fRun->GetRunNumber(), fHead->GetDAQEvtNumber()));
     790    h.SetTitle(s);
    769791    h.SetAllUsed();
    770792    h.SetYTitle("V [au]");
     
    815837//
    816838// Example:
    817 //   MMoviePrepare.TargetLength: 5 <seconds>
    818 //   MMoviePrepare.NumEvents: 500
    819 //   MMoviePrepare.Threshold: 2 <rms>
    820 //   MMoviePrepare.Filename: movie.mpg
     839//   MMovieWrite.TargetLength: 5 <seconds>
     840//   MMovieWrite.NumEvents: 500
     841//   MMovieWrite.Threshold: 2 <rms>
     842//   MMovieWrite.Filename: movie.mpg
    821843//
    822844Int_t MMovieWrite::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
  • trunk/MagicSoft/Mars/mmovie/MMovieWrite.h

    r8406 r8434  
    99class TASImage;
    1010
     11class MMcEvt;
    1112class MGeomCam;
    1213class MMovieData;
     
    2627    MBadPixelsCam *fBad;   //! Information about bad pixels
    2728    MPedestalCam  *fPed;   //! Fundamental pedestal for palette and cleaning
     29    MMcEvt        *fMC;    //! Informatio about MC events
    2830
    2931    MMovieData    *fIn;    //! Input data with splines for all pixels
  • trunk/MagicSoft/Mars/mmovie/Makefile

    r8397 r8434  
    2121INCLUDES = -I. -I../mbase -I../mraw -I../mgeom -I../mhbase -I../mgui \
    2222           -I../mcalib -I../msignal -I../mbadpixels -I../mpedestal   \
    23            -I../mhist
     23           -I../mhist -I../mmc
    2424
    2525SRCFILES = MMoviePrepare.cc \
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r8372 r8434  
    138138    fPixAssignment = new MArrayS(0);
    139139
     140    // Remark: If we read old MC data from a root file which do not
     141    // yet contain one of these variable, the value given here is
     142    // the default. Do not mix files with and without a value if the
     143    // files with the value do not match the default!
    140144    fFormatVersion=0;
    141145    fSoftVersion=0;
    142     fTelescopeNumber=0;
    143     fCameraVersion=0;
    144     fFadcType = 0;
     146    fTelescopeNumber=1;
     147    fCameraVersion=1;
     148    fFadcType=0;
    145149    fRunType=kRTNone;  // use 0xffff for invalidation, 0 means: Data run
    146150    fRunNumber=0;
     
    155159    fNumSamplesHiGain=0;
    156160    fNumEvents=0;
     161    fNumBytesPerSample=1;
     162    fFreqSampling=300;
     163    fNumSignificantBits=8;
    157164}
    158165
  • trunk/MagicSoft/Mars/star.cc

    r8245 r8434  
    157157    // Something special for datacenter access
    158158    //
    159     if (kSequence.IsDigit())
    160     {
    161         const Int_t numseq = kSequence.Atoi();
    162         kSequence = Form("/magic/sequences/%04d/sequence%08d.txt", numseq/10000, numseq);
    163         gLog << inf << "Inflated sequence file: " << kSequence <<  endl;
    164     }
    165 
    166     if (gSystem->AccessPathName(kSequence, kFileExists))
    167     {
    168         gLog << err << "Sorry, sequence file '" << kSequence << "' doesn't exist." << endl;
    169         return 2;
    170     }
     159    if (!MSequence::InflatePath(kSequence, kIsMC))
     160        return 2;
    171161
    172162    if (gSystem->AccessPathName(kConfig, kFileExists))
     
    180170    //
    181171    MSequence seq(kSequence, kInpath);
     172    if (!seq.IsMonteCarlo())
     173        seq.SetMonteCarlo(kIsMC);
    182174    if (kPrintSeq)
    183175    {
     
    248240            job.DisableMuonAnalysis();
    249241
    250         if (!job.Process(kIsMC))
     242        if (!job.Process())
    251243        {
    252244            gLog << err << "Calculation of image parameters failed." << endl << endl;
  • trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx

    r7880 r8434  
    1818!   Author(s):
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2005
     20!   Copyright: MAGIC Software Development, 2000-2007
    2121!
    2222!
     
    199199
    200200    fFadcTimeJitter = fadc_jitter;
    201    
     201
    202202    fEventReuse = reuse;
    203203}
     
    217217    TString str(opt);
    218218    if (str.IsNull())
    219     {
    220219        *fLog << " Photoelectrons: " << fPhotElfromShower << endl;
    221         return;
    222     }
    223 }
     220}
     221
     222// --------------------------------------------------------------------------
     223//
     224// Return a proper description of the monte carlo event
     225//
     226TString MMcEvt::GetDescription(TString s) const
     227{
     228    TString txt("#splitline{");
     229
     230    txt += GetParticleName();
     231    txt += " ";
     232    txt += s;
     233    txt += "}{  E=";
     234    txt += GetEnergyStr();
     235    txt += " r=";
     236    txt += (int)(GetImpact()/100+.5);
     237    txt += "m Zd=";
     238    txt += 0.1*TMath::Nint(GetTelescopeTheta()*180/TMath::Pi()*10);
     239    txt += "\\circ ";
     240    if (GetPhotElfromShower()>=10000)
     241        txt += Form("%dk", (Int_t)(GetPhotElfromShower()/1000.+.5));
     242    else
     243        if (GetPhotElfromShower()>=1000)
     244            txt += Form("%.1fk", GetPhotElfromShower()/1000.);
     245        else
     246            txt += GetPhotElfromShower();
     247    txt += "PhEl}";
     248
     249    return txt;
     250}
  • trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx

    r7880 r8434  
    100100    Float_t GetMuonCphFraction() const { return fMuonCphFraction; }
    101101
     102    TString GetDescription(TString s="") const;
     103
    102104    // Setter
    103105    void SetTheta(Float_t Theta) { fTheta=Theta; }                //Set Theta angle
Note: See TracChangeset for help on using the changeset viewer.