Ignore:
Timestamp:
04/27/04 18:44:34 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/macros
Files:
2 edited

Legend:

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

    r3768 r3852  
    2828//  MMCALIBRATE - Calibration of MC data
    2929//
    30 //  This macro is a version of the standard procedure to convert raw MC data
    31 //  into calibrated data (photons per pixel)
     30//  This macro converts raw MC data into calibrated data (photons per pixel)
    3231//
    3332/////////////////////////////////////////////////////////////////////////////
     
    4342  //
    4443
    45 
    4644  // ------------- user change -----------------
    4745  TString* CalibrationFilename;
    48   CalibrationFilename = new TString("../../gammas_nonoise/Gamma_zbin0_0*.root");
    49   // File to be used for the calibration (must be a camera file without added noise)
    50 
    51   Char_t* AnalysisFilename = "Gamma_zbin0*.root";  // File to be analyzed
    52 
    53   Char_t* OutFilename      = "calibrated_data.root";       // Output file name
    54 
    55 
    56   Int_t BinsHigh[2] = {5, 10}; // First and last FADC bin of the range to be integrated,
    57   Int_t BinsLow[2]  = {5, 10}; // for high and low gain respectively.
    58 
    59   // -------------------------------------------
    60 
     46  CalibrationFilename = new TString("../../gammas_nonoise/Gamma_zbin0_0*.root");  // File to be used for the calibration (must be a camera file without added noise)
     47
     48  Char_t* AnalysisFilename = "Proton_zbin0_0*.root";  // File to be analyzed
     49
     50  Char_t* OutFilename      = "calibrated_data.root";  // Output file name
     51
     52
     53  MExtractSignal    sigextract; 
     54  // (other extraction methods can be used)
     55
     56  sigextract.SetSaturationLimit(240);
     57  // Defines when to switch to low gain
     58
     59  // Define FADC slices to be integrated in high and low gain:
     60  sigextract.SetRange(5, 10, 5, 10);
     61
     62  // ---------------------------------------------------------------------
    6163  //
    6264  // Create a empty Parameter List and an empty Task List
     
    7476
    7577  MBadPixelsCam badpix;
    76   plist.AddToList(&badpix);
    77  
    78 
     78  plist.AddToList(&badpix);  // Not used for now.
     79 
    7980  //
    8081  // Now setup the tasks and tasklist:
     
    8889  read.DisableAutoScheme();
    8990
    90   MGeomApply geom; // Reads in geometry from MC file and sets the right sizes for
     91  MGeomApply geom;
     92  // Reads in geometry from MC file and sets the right sizes for
    9193  // several parameter containers.
    9294
    9395  MMcPedestalCopy   pcopy;
    94   // Copies pedestal data from the MC file run fadc header to the MPedestalCam container.
    95 
    96   MExtractSignal    sigextract;
    97   sigextract.SetSaturationLimit(240);
    98 
    99   // Define ADC slices to be integrated in high and low gain:
    100   sigextract.SetRange(BinsHigh[0], BinsHigh[1], BinsLow[0], BinsLow[1]);
     96  // Copies pedestal data from the MC file run fadc header to the
     97  // MPedestalCam container.
     98
     99  MPointingPosCalc pointcalc;
     100  // Creates MPointingPos object and fill it with the telescope orientation
     101  // information taken from MMcEvt.
    101102
    102103  MMcCalibrationUpdate  mccalibupdate;
    103104
    104   MCalibrate calib; // Transforms signals from ADC counts into photons.
     105  MCalibrate calib;
     106  // MCalibrate transforms signals from ADC counts into photons. In the first
     107  // loop it applies a "dummy" calibration supplied by MMcCalibrationUpdate, just
     108  // to equalize inner and outer pixels. At the end of the first loop, in the
     109  // PostProcess of MMcCalibrationCalc (see below) the true calibration constants
     110  // are calculated.
     111
    105112  calib.SetCalibrationMode(MCalibrate::kFfactor);
    106113
    107   //    MBlindPixelCalc   blind;
    108   //    blind.SetUseInterpolation();
    109 
     114  MImgCleanStd clean;
    110115  //
    111116  // Applies tail cuts to image. Since the calibration is performed on
     
    114119  // be rejected).
    115120  //
    116   MImgCleanStd      clean;
    117 
    118 
    119   MHillasCalc       hcalc; // Calculates Hillas parameters not dependent on source position.
    120 
    121   MMcCalibrationCalc mccalibcalc;
     121
     122  MHillasCalc hcalc; // Calculates Hillas parameters not dependent on source position.
     123
     124  MMcCalibrationCalc mccalibcalc;
     125  // Calculates calibration constants to convert from ADC counts to photons.
     126 
    122127
    123128  tlist.AddToList(&read);
    124129  tlist.AddToList(&geom);
    125130  tlist.AddToList(&pcopy);
    126 
     131  tlist.AddToList(&pointcalc);
    127132  tlist.AddToList(&sigextract);
    128133  tlist.AddToList(&mccalibupdate);
    129134  tlist.AddToList(&calib);
    130135  tlist.AddToList(&clean);
    131   //    tlist.AddToList(&blind);
    132136  tlist.AddToList(&hcalc);
    133137
     
    150154  write.AddContainer("MMcEvt",        "Events");
    151155  write.AddContainer("MMcTrig",       "Events");
     156  write.AddContainer("MPointingPos",  "Events");
    152157  write.AddContainer("MRawEvtHeader", "Events");
    153158  write.AddContainer("MCerPhotEvt",   "Events");
     
    169174      if (!evtloop.Eventloop())
    170175        return;
    171       mccalibcalc->GetHist()->Write();
     176      mccalibcalc->GetHistADC2PhotEl()->Write();
     177      mccalibcalc->GetHistPhot2PhotEl()->Write();
     178      // Writes out the histograms used for calibration.
    172179    }
    173180
    174181  //
    175   // Second loop: analysis loop
     182  // Second loop: apply calibration factors to MC events in the
     183  // file to be anlyzed:
    176184  //
    177185
  • trunk/MagicSoft/Mars/macros/starmc2.C

    r3024 r3852  
    3838void starmc2()
    3939{
    40   Char_t* AnalysisFilename = "Calibrated_run.root"; // File to be analyzed
     40  Char_t* AnalysisFilename = "calibrated_data.root"; // File to be analyzed
    4141  Char_t* OutFilename      = "star.root";        // Output file name
    4242
     
    7777  tlist.AddToList(&read);
    7878  tlist.AddToList(&clean);
    79   //    tlist.AddToList(&blind);
    8079  tlist.AddToList(&hcalc);
    8180  tlist.AddToList(&scalc); // Calculates Source-dependent Hillas parameters
     
    8988  write.AddContainer("MSrcPosCam",    "RunHeaders");
    9089  write.AddContainer("MMcEvt",        "Events", kFALSE);
     90  write.AddContainer("MPointingPos",  "Events");
    9191  write.AddContainer("MHillas",       "Events");
    9292  write.AddContainer("MHillasExt",    "Events");
Note: See TracChangeset for help on using the changeset viewer.