Changeset 3982 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
05/05/04 17:26:14 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3980 r3982  
    2121 2004/05/05: Markus Gaug
    2222 
     23   * mjobs/MJExtractCalibTest.[h,cc]
     24     - included setters for the time extractor
     25
    2326   * mcalib/MCalibrationChargeCalc.cc
    2427     - set default of fgPheErrLimit from 4 sigma to 5.
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r3936 r3982  
    228228const Float_t MCalibrationChargeCalc::fgLambdaErrLimit         = 0.2;
    229229const Float_t MCalibrationChargeCalc::fgLambdaCheckLimit       = 0.2;
    230 const Float_t MCalibrationChargeCalc::fgPheErrLimit            = 4.;
     230const Float_t MCalibrationChargeCalc::fgPheErrLimit            = 5.;
    231231const Float_t MCalibrationChargeCalc::fgFFactorErrLimit        = 3.;
    232232// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc

    r3960 r3982  
    7272using namespace std;
    7373
    74 const Float_t MCalibrationRelTimeCalc::fgRelTimeRelErrLimit      = 7.5;
     74const Float_t MCalibrationRelTimeCalc::fgRelTimeRelErrLimit      = 10.;
    7575// --------------------------------------------------------------------------
    7676//
     
    343343      areasum2[aidx] /= (numareavalid[aidx]-1.);
    344344      areasum [aidx] /= numareavalid[aidx];
    345       lowlim  [aidx]  = areasum [aidx] - fRelTimeRelErrLimit*areasum2[aidx];
     345      lowlim  [aidx]  = 0.;
    346346      upplim  [aidx]  = areasum [aidx] + fRelTimeRelErrLimit*areasum2[aidx];
    347347     
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationTestCam.cc

    r3855 r3982  
    115115  fTitle = title ? title : "Histogram class for testing the calibration";
    116116 
     117  SetAverageNbins(5000);
    117118}
    118119
     
    165166          (*fHiGainArray)[i] = new MHCalibrationTestPix("Calibrated Events",
    166167                                                "Test Calibration Pixel");
    167           if (!(*fBadPixels)[i].IsOK())
    168             (*this)[i].SetExcluded();
    169 
    170           (*this)[i].InitBins();
    171           (*this)[i].ChangeHistId(i);
    172           (*this)[i].SetEventFrequency(fPulserFrequency);
     168          InitHists((*this)[i],(*fBadPixels)[i],i);
    173169      }
    174170  }
     
    181177          (*fLoGainArray)[i] = new MHCalibrationTestPix("Calibrated Events",
    182178                                                "Test Calibration Pixel");
    183           if (!(*fBadPixels)[i].IsOK())
    184             (*this)[i].SetExcluded();
    185 
    186           (*this)[i].InitBins();
    187           (*this)[i].ChangeHistId(i);
    188           (*this)[i].SetEventFrequency(fPulserFrequency);
     179          InitHists((*this)(i),(*fBadPixels)[i],i);
    189180      }
    190181  }
     
    207198        GetAverageHiGainArea(j).SetEventFrequency(fPulserFrequency);
    208199
     200        TH1F *h =  GetAverageHiGainArea(j).GetHGausHist();
     201        h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
    209202      }
    210203  }
     
    245238          GetAverageHiGainSector(j).ChangeHistId(j);
    246239          GetAverageHiGainSector(j).SetEventFrequency(fPulserFrequency);
     240
     241          TH1F *h =  GetAverageHiGainSector(j).GetHGausHist();
     242          h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
     243
    247244      }
    248245  }
     
    307304  memset(sumareahi,   0, nareas * sizeof(Float_t));
    308305  memset(sumsectorhi, 0, nsectors*sizeof(Float_t));
     306  memset(numareahi,   0, nareas * sizeof(Int_t));
     307  memset(numsectorhi, 0, nsectors*sizeof(Int_t));
    309308 
    310309  for (Int_t i=0; i<npixels; i++)
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationTestPix.cc

    r3851 r3982  
    8181
    8282  fHGausHist.SetName("HCalibrationTest");
    83   fHGausHist.SetTitle("Distribution of calibrated Summed FADC slices Pixel"); 
    84   fHGausHist.SetXTitle("Sum FADC Slices");
     83  fHGausHist.SetTitle("Distribution of calibrated Photons Pixel"); 
     84  fHGausHist.SetXTitle("Nr. Photons");
    8585  fHGausHist.SetYTitle("Nr. of events");
    8686
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationTestTimeCam.cc

    r3980 r3982  
    113113  fName  = name  ? name  : "MHCalibrationTestTimeCam";
    114114  fTitle = title ? title : "Histogram class for testing the calibration of arrival times";
    115  
     115
     116  SetAverageNbins(5000);
    116117}
    117118
     
    195196        GetAverageHiGainArea(j).SetEventFrequency(fPulserFrequency);
    196197
     198        TH1F *h =  GetAverageHiGainArea(j).GetHGausHist();
     199        h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
     200
     201
    197202      }
    198203  }
     
    233238          GetAverageHiGainSector(j).ChangeHistId(j);
    234239          GetAverageHiGainSector(j).SetEventFrequency(fPulserFrequency);
     240          TH1F *h =  GetAverageHiGainSector(j).GetHGausHist();
     241          h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));
     242
     243
    235244      }
    236245  }
     
    295304  memset(sumareahi,   0, nareas * sizeof(Float_t));
    296305  memset(sumsectorhi, 0, nsectors*sizeof(Float_t));
     306  memset(numareahi,   0, nareas * sizeof(Int_t));
     307  memset(numsectorhi, 0, nsectors*sizeof(Int_t));
    297308 
    298309  for (Int_t i=0; i<npixels; i++)
  • trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.cc

    r3862 r3982  
    4848#include "MBadPixelsCam.h"
    4949#include "MCerPhotEvt.h"
     50#include "MArrivalTime.h"
    5051#include "MCalibrationChargeCam.h"
     52#include "MCalibrationRelTimeCam.h"
    5153#include "MCalibrationQECam.h"
    5254#include "MHCamEvent.h"
     
    5658#include "MExtractSlidingWindow.h"
    5759#include "MExtractor.h"
     60#include "MExtractTime.h"
     61#include "MExtractTimeFastSpline.h"
    5862#include "MFillH.h"
    5963#include "MCalibrate.h"
     64#include "MCalibrateRelTimes.h"
    6065#include "MPedPhotCalc.h"
    6166#include "MWriteRootFile.h"
     
    7075// Default constructor.
    7176//
    72 // Sets fRuns to 0, fExtractor to NULL
     77// Sets fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL
    7378//
    7479MJExtractCalibTest::MJExtractCalibTest(const char *name, const char *title)
    75     : fRuns(NULL), fExtractor(NULL)
     80    : fRuns(NULL), fExtractor(NULL), fTimeExtractor(NULL)
    7681{
    7782    fName  = name  ? name  : "MJExtractCalibTest";
     
    151156}
    152157
     158TString MJExtractCalibTest::GetOutputFileT() const
     159{
     160  if (!fRuns)
     161    return "";
     162 
     163  return Form("%s/%s-F4.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName());
     164}
     165
    153166TString MJExtractCalibTest::GetOutputFileP() const
    154167{
     
    240253    }
    241254
    242   if (TestBit(kEnableGraphicalOutput))
     255  //  if (TestBit(kEnableGraphicalOutput))
    243256    tlist.AddToList(&fill);
    244257  tlist.AddToList(&photcalc);
    245258  tlist.AddToList(&fillcam);
    246   //  tlist.AddToList(&write);
    247259 
    248260  // Create and setup the eventloop
     
    267279  return kTRUE;
    268280}
     281
     282Bool_t MJExtractCalibTest::ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam)
     283{
     284  const TString fname = GetOutputFileT();
     285 
     286  if (gSystem->AccessPathName(fname, kFileExists))
     287    return ProcessFileT(pedcam,relcam);
     288 
     289  return kTRUE;
     290}
     291
     292Bool_t MJExtractCalibTest::ProcessFileT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam)
     293{
     294
     295  if (!fRuns)
     296    {
     297      *fLog << err << "No Runs choosen... abort." << endl;
     298      return kFALSE;
     299    }
     300  if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
     301    {
     302      *fLog << err << "Number of files found doesn't match number of runs... abort." << endl;
     303      return kFALSE;
     304    }
     305 
     306  *fLog << inf;
     307  fLog->Separator(GetDescriptor());
     308  *fLog << "Calculate MExtractedSignalCam from Runs " << fRuns->GetRunsAsString() << endl;
     309  *fLog << endl;
     310 
     311  MArrivalTime  arrtime;
     312
     313  // Setup Lists
     314  MParList plist;
     315  plist.AddToList(&pedcam);
     316  plist.AddToList(&relcam);
     317  plist.AddToList(&arrtime);
     318  plist.AddToList(&fTestCam);
     319  plist.AddToList(&fBadPixels);
     320 
     321  MTaskList tlist;
     322  plist.AddToList(&tlist);
     323
     324  // Setup Task-lists
     325  MReadMarsFile read("Events");
     326  read.DisableAutoScheme();
     327  static_cast<MRead&>(read).AddFiles(*fRuns);
     328 
     329  MGeomApply             apply; // Only necessary to craete geometry
     330  MExtractTimeFastSpline extract;
     331  MCalibrateRelTimes     timecalc;
     332
     333  MHCamEvent evt("ExtTimes");
     334  evt.SetType(0);
     335  MFillH fill(&evt, "MArrivalTimeCam");
     336 
     337  MFillH fillcam("MHCalibrationTestTimeCam", "MArrivalTime");
     338  fillcam.SetNameTab("TestTime");
     339
     340  /*
     341  MWriteRootFile write(GetOutputFileD(), "RECREATE", fRuns->GetRunsAsString(), 2);
     342  write.AddContainer("MExtractedSignalCam", "Events");
     343  write.AddContainer("MTime",               "Events");
     344  write.AddContainer("MRawEvtHeader",       "Events");
     345  write.AddContainer("MPedestalCam",        "RunHeaders");
     346  write.AddContainer("MRawRunHeader",       "RunHeaders");
     347  write.AddContainer("MBadPixelsCam",       "RunHeaders");
     348  */
     349
     350  tlist.AddToList(&read);
     351  tlist.AddToList(&apply);
     352
     353  if (fTimeExtractor)
     354    tlist.AddToList(fTimeExtractor);
     355    else
     356    {
     357      *fLog << warn << GetDescriptor()
     358            << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;
     359      tlist.AddToList(&extract);
     360    }
     361
     362  //  if (TestBit(kEnableGraphicalOutput))
     363  tlist.AddToList(&fill);
     364  tlist.AddToList(&timecalc);
     365  tlist.AddToList(&fillcam);
     366 
     367  // Create and setup the eventloop
     368  MEvtLoop evtloop(fName);
     369  evtloop.SetParList(&plist);
     370  evtloop.SetDisplay(fDisplay);
     371  evtloop.SetLogStream(fLog);
     372 
     373  // Execute first analysis
     374  if (!evtloop.Eventloop())
     375    {
     376      *fLog << err << GetDescriptor() << ": Failed." << endl;
     377      return kFALSE;
     378    }
     379 
     380  tlist.PrintStatistics();
     381 
     382  DisplayResult(plist);
     383
     384  *fLog << inf << GetDescriptor() << ": Done." << endl;
     385 
     386  return kTRUE;
     387}
     388
    269389
    270390Bool_t MJExtractCalibTest::ReadPedPhotCam()
  • trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.h

    r3862 r3982  
    1818class MParList;
    1919class MPedestalCam;
     20class MCalibrationRelTimeCam;
    2021class MCalibrationChargeCam;
    2122class MCalibrationQECam;
    2223class MExtractor;
     24class MExtractTime;
    2325class MJExtractCalibTest : public MParContainer, public MGCamDisplays
    2426{
     
    2729  TString fOutputPath;
    2830
    29   MRunIter   *fRuns;                                       // Data files
    30   MExtractor *fExtractor;                                  // Signal extractor
     31  MRunIter     *fRuns;                       // Data files
     32  MExtractor   *fExtractor;                  // Signal extractor
     33  MExtractTime *fTimeExtractor;              // Arrival time extractor 
    3134 
    3235  MBadPixelsCam        fBadPixels;
     
    4043  Bool_t ProcessFileD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
    4144  Bool_t ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
     45  Bool_t ProcessFileT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 
    4246
    4347public:
     
    4953  TString GetOutputFileP() const;
    5054  TString GetOutputFileD() const;
     55  TString GetOutputFileT() const;
    5156 
    5257  MHCalibrationTestCam &GetTestCam()    { return fTestCam; }
     
    5560 
    5661  void SetExtractor(MExtractor* ext)              { fExtractor = ext; }
     62  void SetTimeExtractor(MExtractTime* ext)         { fTimeExtractor = ext; }
    5763  void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
    5864 
    5965  Bool_t ProcessD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
    6066  Bool_t ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);
     67  Bool_t ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 
    6168 
    6269  ClassDef(MJExtractCalibTest, 0) // Tool to extract, calibrate and test the signal
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r3889 r3982  
    258258    MGeomApply      geomapl;
    259259    // MBadPixelsMerge merge(&fBadPixels);
    260     //MExtractSignal sigcalc;
    261260    MPedCalcPedRun  pedcalc;
    262261
  • trunk/MagicSoft/Mars/mjobs/Makefile

    r3927 r3982  
    2121INCLUDES = -I. -I../mbase -I../mgui -I../mgeom -I../mdata -I../mhbase \
    2222           -I../mfileio -I../mfilter -I../manalysis -I../mhist -I../mcalib \
    23            -I../mbadpixels -I../msignal -I../mraw -I../mpedestal
     23           -I../mbadpixels -I../msignal -I../mraw -I../mpedestal -I../mtools
    2424
    2525#manalysis: MChisqEval (MParameters)
Note: See TracChangeset for help on using the changeset viewer.