Changeset 5277


Ignore:
Timestamp:
10/15/04 13:49:59 (20 years ago)
Author:
rico
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mifae
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mifae/Changelog

    r5208 r5277  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21  2004/10/15  Javier Rico
     22    * macros/mmcCleaning.C
     23     - Include islands
     24     - Do not save uncalibrated nonoise file
    2025
    2126  2004/10/08  Javier Rico
  • trunk/MagicSoft/Mars/mtemp/mifae/macros/mmcCleaning.C

    r4822 r5277  
    1 /* ======================================================================== *\
    2    !
    3    ! *
    4    ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
    5    ! * Software. It is distributed to you in the hope that it can be a useful
    6    ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
    7    ! * It is distributed WITHOUT ANY WARRANTY.
    8    ! *
    9    ! * Permission to use, copy, modify and distribute this software and its
    10    ! * documentation for any purpose is hereby granted without fee,
    11    ! * provided that the above copyright notice appear in all copies and
    12    ! * that both that copyright notice and this permission notice appear
    13    ! * in supporting documentation. It is provided "as is" without express
    14    ! * or implied warranty.
    15    ! *
    16    !
    17    !
    18    !   Author(s):
    19    !
    20    !   Copyright: MAGIC Software Development, 2000-2004
    21    !
    22    !
    23    \* ======================================================================== */
    24 
    251/////////////////////////////////////////////////////////////////////////////
    262//
    27 //  mmcCleaning - study different cleaning levels with mc
    28 //
     3//  mmcCleaning - calibrate/clean mc events
    294//
    305/////////////////////////////////////////////////////////////////////////////
     
    4015
    4116  // ------------- user change -----------------
    42   Char_t*  NonoiseFilename = "/local_disk/jrico/mc/Gamma_zbin12_0_7_1250to1259_w0_nonoise.root";  // File to be used for the calibration (must be a camera file without added noise)
    43   Char_t*  NoiseFilename   = "/local_disk/jrico/mc/Gamma_zbin12_0_7_1250to1259_w0.root"; // File to be analyzed
     17  Char_t*  NonoiseFilename = "/local_disk/jrico/mc/Gammas/Gamma_zbin0_0_7_1000to1009_w0_nonoise.root";  // File to be used for the calibration (must be a camera file without added noise)
     18  Char_t*  NoiseFilename   = "/local_disk/jrico/mc/Gammas/Gamma_zbin0_0_7_1000to1009_w0.root"; // File to be analyzed
    4419
    45   Char_t* NonoiseOutFilename = "/local_disk/jrico/mc/Gamma_zbin12_0_7_1250to1259_w0_cleaned_nonoise.root";  // Output file name
    46   Char_t* NoiseOutFilename   = "/local_disk/jrico/mc/Gamma_zbin12_0_7_1250to1259_w0_cleaned_6045.root";     // Output file name
     20  Char_t* NoiseOutFilename   = "/local_disk/jrico/mc/Gammas/prueba.root";   // Output file name
    4721
    48 
    49   MExtractSignal    sigextract; 
     22  // Signal extractor
    5023  // (other extraction methods can be used)
    51 
    52   sigextract.SetSaturationLimit(240);
    53   // Defines when to switch to low gain
     24  MExtractFixedWindowPeakSearch sigextract;
    5425
    5526  // Define FADC slices to be integrated in high and low gain:
    56   sigextract.SetRange(1, 14, 3, 14);
     27  sigextract.SetRange(1, 14, 2, 14);
     28  sigextract.SetWindows(6,6,4);
     29
     30  // Defines when to switch to low gain
     31  sigextract.SetSaturationLimit(240);
    5732
    5833  // ---------------------------------------------------------------------
     
    10782  calib.SetCalibrationMode(MCalibrate::kFfactor);
    10883
    109   MImgCleanStd clean(6.0,4.5);
    110   clean.SetRemoveSingle(kFALSE);
     84  MImgCleanStd clean(6.5,2.0);
     85  clean.SetCleanRings(1);
     86  //  clean.SetRemoveSingle(kFALSE);
    11187  //
    11288  // Applies tail cuts to image. Since the calibration is performed on
     
    12298  // Calculates calibration constants to convert from ADC counts to photons.
    12399 
    124   MWriteRootFile write(NonoiseOutFilename); // Writes output
    125   write.AddContainer("MRawRunHeader", "Events");
    126   write.AddContainer("MMcEvt",        "Events");
    127   write.AddContainer("MRawEvtHeader", "Events");
    128   write.AddContainer("MCerPhotEvt",   "Events");
    129   write.AddContainer("MHillas",       "Events");
    130   write.AddContainer("MHillasSrc",    "Events");
    131 
    132100  tlist.AddToList(&read);
    133101  tlist.AddToList(&geom);
     
    139107  tlist.AddToList(&clean);
    140108  tlist.AddToList(&hcalc);
    141   tlist.AddToList(&hsrccalc);
    142   //  tlist.AddToList(&display2);
     109  tlist.AddToList(&hsrccalc);
    143110  tlist.AddToList(&mccalibcalc);
    144   tlist.AddToList(&write);
     111  //tlist.AddToList(&display2);
    145112
    146113  //
    147114  // First loop: No noise
    148115  //
    149 
    150116  MProgressBar bar;
    151117  bar.SetWindowName("No noise...");
     
    164130  //
    165131  // Second loop: process file with noise
    166   //
     132  // 
     133  MIslands      isl;
     134  MArrivalTimeCam timecam;     
     135  plist.AddToList(&isl);
     136  plist.AddToList(&timecam);
     137
     138  MArrivalTimeCalc2 timecalc;
     139  MIslandsCalc      islandcalc;
     140  islandcalc.SetOutputName("MIslands");
     141  islandcalc.SetAlgorithm(1);
     142  MIslandsClean     islclean(40);
     143  islclean.SetInputName("MIslands");
     144  islclean.SetMethod(1);
     145
    167146  MReadMarsFile read2("Events");
    168147  read2.AddFile(NoiseFilename);
     
    171150  tlist.RemoveFromList(&read);
    172151
    173   MWriteRootFile write2(NoiseOutFilename); // Writes output
    174   write2.AddContainer("MRawRunHeader", "Events");
    175   write2.AddContainer("MMcEvt",        "Events");
    176   write2.AddContainer("MRawEvtHeader", "Events");
    177   write2.AddContainer("MCerPhotEvt",   "Events");
    178   write2.AddContainer("MHillas",       "Events");
    179   write2.AddContainer("MHillasSrc",    "Events");
     152  tlist.AddToListBefore(&timecalc,&mccalibupdate,"All");
     153  tlist.AddToListBefore(&islandcalc,&hcalc,"All");
     154  tlist.AddToListBefore(&islclean,&hcalc,"All");
    180155
    181   //  tlist.AddToListBefore(&display2,&clean, "All");
    182   tlist.AddToListBefore(&write2, &write, "All");
    183   tlist.RemoveFromList(&write);
     156  MWriteRootFile write(NoiseOutFilename); // Writes output
     157  write.AddContainer("MRawRunHeader", "Events");
     158  write.AddContainer("MMcEvt",        "Events");
     159  write.AddContainer("MRawEvtHeader", "Events");
     160  write.AddContainer("MHillas",       "Events");
     161  write.AddContainer("MHillasSrc",    "Events");
     162  write.AddContainer("MImagePar",     "Events");
     163  write.AddContainer("MNewImagePar",  "Events");
     164  write.AddContainer("MIslands",      "Events");
    184165
     166  tlist.RemoveFromList(&mccalibcalc);
     167  tlist.AddToList(&write);
     168  //  tlist.AddToListBefore(&display2,&write, "All");
    185169
    186 
    187   bar.SetWindowName("Cleaning 3015...");
    188   clean.SetRemoveSingle();
    189 
    190   //  tlist.RemoveFromList(&clean);
    191   //  tlist.RemoveFromList(&hcalc);
    192   tlist.RemoveFromList(&mccalibcalc);
     170  bar.SetWindowName("Calibrating/Cleaning...");
     171  //  clean.SetRemoveSingle();
     172  //  clean.SetMethod(MImgCleanStd::kDemocratic);
    193173
    194174  if (!evtloop.Eventloop())
Note: See TracChangeset for help on using the changeset viewer.