Changeset 5343 for trunk


Ignore:
Timestamp:
11/05/04 10:21:19 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/calibration.C

    r4743 r5343  
    5454//  "calibrate" it and test the resulting outcome.
    5555//
    56 /////////////////////////////////////////////////////////////////////////////
     56//////////////////////////////////////////////////////////////////////////////////////////
    5757#include "MJPedestal.h"
    5858#include "MJCalibration.h"
     
    6666#include "MExtractTimeHighestIntegral.h"
    6767#include "MExtractTimeFastSpline.h"
     68#include "MExtractTimeAndChargeDigitalFilter.h"
     69#include "MExtractTimeAndChargeSlidingWindow.h"
     70#include "MExtractTimeAndChargeSpline.h"
    6871#include "MRunIter.h"
    6972#include "MStatusDisplay.h"
     73#include "MCalibrationQECamMagic.h"
    7074#include "MCalibrationQECam.h"
    71 #include "MHCalibrationTestCam.h"
    72 #include "MHCalibrationTestPix.h"
    7375#include "MBadPixelsCam.h"
    7476#include "MArgs.h"
     
    8789
    8890static TString outpath = "./";
    89 static TString inpath  = "/home/rootdata/Calib/2004_07_06/";
     91static TString inpath  = "/home/rootdata/Calib/2004_07_06";
    9092static TString badfile = "";
     93//static TString badfile = "badpixels_only0_559_560.dat";
     94static TString weightfile = "msignal/calibration_weights_UV.dat";
     95//static TString weightfile = "msignal/cosmics_weights.dat";
    9196//
    9297// the default pedestal run for the calibration
     
    101106// between calrun1 and calrun2)
    102107//
     108//static  const Int_t calrun2 = 31754;
    103109static  const Int_t calrun2 = 0;
    104110//
     
    110116//
    111117static Bool_t blindpix = kTRUE;
     118//
    112119// A switch to use the PIN Diode
    113120//
    114 static Bool_t pindiode = kFALSE;
     121static Bool_t pindiode = kTRUE;
    115122//
    116123// Tell if you want to calibrate times:
    117124//
    118 static Bool_t useTimes = kFALSE;
     125static Bool_t useTimes = kTRUE;
     126//
     127// Tell if you want to use a combined extractor:
     128//
     129static Bool_t useTimeAndCharge = kTRUE;
    119130//
    120131// Tell if you want to use the display:
     
    124135// Tell if you want to test the result afterwards
    125136//
    126 static Bool_t useTest = kTRUE;
     137static Bool_t useTest = kFALSE;
     138//
     139// Tell if you want to test the intensity calibration
     140//
     141static Bool_t useIntensity = kFALSE;
     142//
     143// Tell if you want to use MPedCalcFromLogain for the pedestal calculation
     144//
     145static Bool_t usedata      = kTRUE;
     146//
     147// Tell if you want to store and read the F0 and F1- files
     148//
     149static Bool_t usestorage   = kFALSE;
    127150//
    128151Int_t calibration(const Int_t prun=pedrun,
     
    136159  // Choose the signal Extractor:
    137160  //
    138   //  MExtractFixedWindowPeakSearch extractor;
    139   //  MExtractSlidingWindow  extractor;   
    140   //  MExtractFixedWindowSpline extractor;
    141   MExtractFixedWindow extractor;
    142   //  MExtractAmplitudeSpline extractor;
    143   //  MExtractTimeAndChargeSpline extractor;
    144   //
    145   // Set Ranges or Windows
    146   //
    147   extractor.SetRange(3,14,4,13);
    148   //  extractor.SetWindows(8,8);
    149 
    150   //
    151   // Choose the arrival time Extractor:
     161  // PURE CHARGE EXTRACTORS:
     162  //  MExtractFixedWindowPeakSearch  extractor;
     163  //  MExtractSlidingWindow         extractor;   
     164  //  MExtractFixedWindow           extractor;
     165  //  MExtractFixedWindowSpline     extractor;
     166  //  MExtractAmplitudeSpline       extractor;
     167  //
     168  // PURE TIME EXTRACTORS:
     169  // ATTENTION: If an extractor deriving from MExtractTimeAndCharge is
     170  //            used, you may want to use the timing calculated directly
     171  //            from there. Use the flag: "useTimeAndCharge" in this case
    152172  //
    153173  //  MExtractTimeHighestIntegral timeext;
    154   MExtractTimeFastSpline timeext;
    155   //
    156   // Set Ranges or Windows
    157   //
    158   timeext.SetRange(0,7,3,8);
     174  //  MExtractTimeFastSpline timeext;
     175  //  MExtractTimeSpline timeext;
     176  //
     177  // COMBINED TIME AND CHARGE EXTRACTORS:
     178  // (You have to set the variable "useTimeAndCharge" in order to use the
     179  //  time calculated by this extractor!)
     180  MExtractTimeAndChargeDigitalFilter extractor;
     181  //  MExtractTimeAndChargeSpline   extractor;
     182  //  MExtractTimeAndChargeSlidingWindow extractor;
     183  //
     184  //  Set Ranges or Windows
     185  //
     186  //  extractor.SetRange(1,14,4,12);
     187  //  extractor.SetWindowSize(6,6);
     188  //  timeext.SetRange(1,14,4,12);
     189  //  timeext.SetWindowSize(6,6);
     190  //
     191  // Set additional information for some extractors
     192  //
     193  // Digital Filter:
     194  extractor.ReadWeightsFile(weightfile.Data());
     195  //  extractor.ReadWeightsFile("");
     196  // TimeAndChargeSpline:
     197  //  extractor.SetChargeType(MExtractTimeAndChargeSpline::kIntegral);
     198  //  extractor.SetTimeType(MExtractTimeAndChargeSpline::kHalfMaximum);
    159199
    160200  MRunIter pruns;
     
    186226  /************************************/
    187227
    188   MCalibrationQECam qecam;
    189   MBadPixelsCam     badcam;
     228  //
     229  // Hand over to the jobs a QE Cam with Cornings initialized
     230  //
     231  MCalibrationQECamMagic qecam;
     232  MBadPixelsCam          badcam;
    190233  //
    191234  // If you want to exclude pixels from the beginning, read
     
    195238    {
    196239      ifstream f(badfile.Data());
    197       badcam.AsciiRead(f); 
     240      badcam.AsciiRead((istream&)f); 
    198241      f.close();
    199242    }
    200243
    201244  MJPedestal pedloop;
     245  pedloop.SetUseData(usedata);
     246  pedloop.SetNoStorage(!usestorage);
     247  pedloop.SetEnvDebug(debug);
    202248  pedloop.SetExtractor(&extractor);
    203249  pedloop.SetInput(&pruns);
     
    221267  if (debug)
    222268    calloop.SetDebug();
     269  calloop.SetEnvDebug(debug);
     270  if (useIntensity)
     271    calloop.SetIntensity();
     272  //  calloop.SetHistsStorage();
     273  calloop.SetNoStorage(!usestorage);
     274  //
     275  // If you want to set a colour explicitely from outside (not recommanded!)
     276  //  calloop.SetColor(MCalibrationCam::kUV);
    223277  //
    224278  // If you want to run the data-check on RAW DATA!!!, choose:
     
    227281  // If you want to see the data-check plots only, choose:
    228282  calloop.SetDataCheckDisplay();
     283  //calloop.SetNormalDisplay();
    229284  //
    230285  // For everything, you have ever dreamed of, choose:
    231   // calloop.SetFullDisplay();
     286  //  calloop.SetFullDisplay();
    232287
    233288  //
     
    236291  calloop.SetRelTimeCalibration(useTimes);
    237292  calloop.SetExtractor(&extractor);
     293  calloop.SetTimeAndCharge(useTimeAndCharge);
    238294  calloop.SetTimeExtractor(&timeext);
    239295  calloop.SetInput(&cruns);
     
    262318      badbad.Print();
    263319    }
    264 
    265   gLog << endl;
    266   gLog << "Mean number of photons from pulser Inner pixels (F-Factor Method): "
    267        << calloop.GetCalibrationCam().GetNumPhotonsFFactorMethod()
    268        << " +- " << calloop.GetCalibrationCam().GetNumPhotonsFFactorMethodErr() << endl;
    269   gLog << endl;
    270320
    271321  /********************************************************************/
     
    297347     
    298348    }
    299  
     349
    300350  /********************************************************************/
    301351  /* FOURTH LOOP: APPLY CALIBRATION TO THE PEDESTAL FILES             */
    302352  /********************************************************************/
    303353
     354  /*
    304355  MJExtractSignal pedphotloop;
    305356
     
    315366    return 5;
    316367
    317 
     368  */
    318369  if (debug)
    319370    TObject::SetObjectStat(kFALSE);
     
    324375  if (debug)
    325376    gObjectTable->Print();
    326 
    327   //
    328   // List of useful containers:
    329   //
    330 /*
    331   MPedestalCam          &pedcam      = pedloop.GetPedestalCam();
    332   MCalibrationChargeCam &chargecam   = calloop.GetCalibrationCam();
    333   MCalibrationQECam     &qecam       = calloop.GetCalibrationCam();
    334   MBadPixelsCam         &badcam      = calloop.GetBadPixels();
    335   MCalibrationTestCam   &testcam     = testloop.GetTestCam();
    336   MHCalibrationTestTimeCam &testtime = testloop.GetTestTimeCam();
    337 */
    338377
    339378  return 0;
Note: See TracChangeset for help on using the changeset viewer.