Ignore:
Timestamp:
02/09/09 14:14:59 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

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

    r9303 r9309  
    2727//  MJSimulation
    2828//
     29//
     30// Force reading a corsika file even if the footer (RUNE-section) is missing
     31// by setting fForceMode to kTRUE or from the resource file by
     32//
     33//    ForceMode: Yes
     34//
     35//
     36// In case of a pedestal or calibration run the artificial trigger can
     37// be "switched off" and the cosmics trrigger "switched on" by setting
     38// fForceTrigger to kTRUE or from the resource file by
     39//
     40//    ForceTrigger: Yes
     41//
     42//
    2943/////////////////////////////////////////////////////////////////////////////
    3044#include "MJSimulation.h"
     
    95109// Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE
    96110//
    97 MJSimulation::MJSimulation(const char *name, const char *title) : fForceMode(kFALSE)
     111MJSimulation::MJSimulation(const char *name, const char *title)
     112    : fForceMode(kFALSE), fForceTrigger(kFALSE)
    98113{
    99114    fName  = name  ? name  : "MJSimulation";
     
    103118Bool_t MJSimulation::CheckEnvLocal()
    104119{
    105     fForceMode = GetEnv("ForceMode", fForceMode);
     120    fForceMode    = GetEnv("ForceMode",    fForceMode);
     121    fForceTrigger = GetEnv("ForceTrigger", fForceTrigger);
    106122
    107123    return kTRUE;
     
    231247
    232248    MRawRunHeader header;
    233     header.InitFadcType(3);
     249    header.SetValidMagicNumber();
     250    //header.InitFadcType(3);
    234251
    235252    header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTData,        1, 1);
     
    237254    {
    238255        if (!args.GetArgumentStr(0).CompareTo("pedestal", TString::kIgnoreCase))
     256        {
    239257            header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTPedestal,    1, 1);
     258            header.SetSourceInfo("Pedestal");
     259        }
    240260        if (!args.GetArgumentStr(0).CompareTo("calibration", TString::kIgnoreCase))
     261        {
    241262            header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTCalibration,    1, 1);
     263            header.SetSourceInfo("Calibration");
     264        }
    242265        if (!args.GetArgumentStr(0).CompareTo("pointrun", TString::kIgnoreCase))
    243266            header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTPointRun,    1, 1);
     
    288311    MBinning binszd( 70,     0,       70, "BinningZd");
    289312    MBinning binsvc(155,     0,       31, "BinningViewCone");
    290     MBinning binstr(150,   -25,      125, "BinningTrigger");
    291313    MBinning binsew(150,     0,       25, "BinningEvtWidth");
     314    MBinning binstr("BinningTrigPos");
    292315
    293316    plist.AddToList(&binse);
     
    298321    plist.AddToList(&binsaz);
    299322    plist.AddToList(&binsvc);
     323    plist.AddToList(&binsew);
    300324    plist.AddToList(&binstr);
    301     plist.AddToList(&binsew);
    302325
    303326    MHn mhn1, mhn2, mhn3;
     
    307330
    308331    MH3 mhtp("TriggerPos.fVal-IntendedPulsePos.fVal-MPulseShape.GetPulseWidth");
    309     mhtp.SetName("Trigger");
     332    mhtp.SetName("TrigPos");
    310333    mhtp.SetTitle("Trigger position w.r.t. the first photon hitting an APD");
    311334
     
    456479    hcalc.Disable(MHillasCalc::kCalcConc);
    457480
    458     MHCamEvent evt0a(/*10*/0, "Signal",   "Average signal;;S [ph]");
    459     MHCamEvent evt0d(/*11*/8, "ArrTm",    "Time after first photon;;T [ns]");
     481    MHCamEvent evt0a(/*10*/0, "Signal",    "Average signal;;S [ph]");
     482    MHCamEvent evt0c(/*10*/0, "MaxSignal", "Maximum signal;;S [ph]");
     483    MHCamEvent evt0d(/*11*/8, "ArrTm",     "Time after first photon;;T [ns]");
    460484    evt0a.SetErrorSpread(kFALSE);
    461 
    462     MFillH fillx0a(&evt0a,             "MSignalCam",      "FillSignal");
     485    evt0c.SetCollectMax();
     486
     487    MFillH fillx0a(&evt0a,             "MSignalCam",      "FillAvgSignal");
     488    MFillH fillx0c(&evt0c,             "MSignalCam",      "FillMaxSignal");
    463489    MFillH fillx0d(&evt0d,             "MSignalCam",      "FillArrTm");
    464490    MFillH fillx1("MHHillas",          "MHillas",         "FillHillas");
     
    517543    tasks.AddToList(&simsum);
    518544    tasks.AddToList(&simcam);
    519     if (header.IsDataRun())
     545    if (header.IsDataRun() || fForceTrigger)
    520546        tasks.AddToList(&simtrig);
    521547    tasks.AddToList(&conttrig);
     
    525551    {
    526552        tasks.AddToList(&write1);
    527         tasks.AddToList(&write2);
     553        if (!header.IsPedestalRun())
     554            tasks.AddToList(&write2);
    528555        tasks.AddToList(&write3);
    529556    }
     
    532559        tasks.AddToList(&fillh3);
    533560    tasks.AddToList(&filltp);
    534     tasks.AddToList(&fillew);
    535     tasks.AddToList(&fillx0a);
    536 //    tasks.AddToList(&clean);
    537     tasks.AddToList(&hcalc);
    538     tasks.AddToList(&fillx0d);
    539     tasks.AddToList(&fillx1);
    540     //tasks.AddToList(&fillx2);
    541     tasks.AddToList(&fillx3);
    542     //tasks.AddToList(&fillx4);
    543     //tasks.AddToList(&fillx5);
     561    if (header.IsDataRun())
     562        tasks.AddToList(&fillew);
     563    if (!header.IsPedestalRun())
     564    {
     565        tasks.AddToList(&fillx0a);
     566        tasks.AddToList(&fillx0c);
     567        //tasks.AddToList(&clean);
     568        tasks.AddToList(&hcalc);
     569        tasks.AddToList(&fillx0d);
     570        tasks.AddToList(&fillx1);
     571        //tasks.AddToList(&fillx2);
     572        tasks.AddToList(&fillx3);
     573        //tasks.AddToList(&fillx4);
     574        //tasks.AddToList(&fillx5);
     575    }
    544576
    545577    //-------------------------------------------
     
    555587        return kFALSE;
    556588
     589    if (binstr.IsDefault())
     590        binstr.SetEdgesLin(150, -shape.GetPulseWidth(),
     591                           header.GetFreqSampling()/1000.*header.GetNumSamples()+shape.GetPulseWidth());
     592
     593    header.Print();
     594
    557595    // Execute first analysis
    558596    if (!evtloop.Eventloop(fMaxEvents))
  • trunk/MagicSoft/Mars/mjobs/MJSimulation.h

    r9275 r9309  
    1212{
    1313private:
    14     Bool_t fForceMode;
     14    Bool_t fForceMode;      // Force execution even if RUNE-section was not found
     15
     16    Bool_t fForceTrigger;   // Force the use of the trigger "electronics"
    1517
    1618    Bool_t WriteResult();
Note: See TracChangeset for help on using the changeset viewer.