Changeset 5277 for trunk/MagicSoft/Mars/mtemp/mifae/macros
- Timestamp:
- 10/15/04 13:49:59 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/macros/mmcCleaning.C
r4822 r5277 1 /* ======================================================================== *\2 !3 ! *4 ! * This file is part of MARS, the MAGIC Analysis and Reconstruction5 ! * Software. It is distributed to you in the hope that it can be a useful6 ! * 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 its10 ! * documentation for any purpose is hereby granted without fee,11 ! * provided that the above copyright notice appear in all copies and12 ! * that both that copyright notice and this permission notice appear13 ! * in supporting documentation. It is provided "as is" without express14 ! * or implied warranty.15 ! *16 !17 !18 ! Author(s):19 !20 ! Copyright: MAGIC Software Development, 2000-200421 !22 !23 \* ======================================================================== */24 25 1 ///////////////////////////////////////////////////////////////////////////// 26 2 // 27 // mmcCleaning - study different cleaning levels with mc 28 // 3 // mmcCleaning - calibrate/clean mc events 29 4 // 30 5 ///////////////////////////////////////////////////////////////////////////// … … 40 15 41 16 // ------------- 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 analyzed17 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 44 19 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 47 21 48 49 MExtractSignal sigextract; 22 // Signal extractor 50 23 // (other extraction methods can be used) 51 52 sigextract.SetSaturationLimit(240); 53 // Defines when to switch to low gain 24 MExtractFixedWindowPeakSearch sigextract; 54 25 55 26 // 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); 57 32 58 33 // --------------------------------------------------------------------- … … 107 82 calib.SetCalibrationMode(MCalibrate::kFfactor); 108 83 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); 111 87 // 112 88 // Applies tail cuts to image. Since the calibration is performed on … … 122 98 // Calculates calibration constants to convert from ADC counts to photons. 123 99 124 MWriteRootFile write(NonoiseOutFilename); // Writes output125 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 132 100 tlist.AddToList(&read); 133 101 tlist.AddToList(&geom); … … 139 107 tlist.AddToList(&clean); 140 108 tlist.AddToList(&hcalc); 141 tlist.AddToList(&hsrccalc); 142 // tlist.AddToList(&display2); 109 tlist.AddToList(&hsrccalc); 143 110 tlist.AddToList(&mccalibcalc); 144 tlist.AddToList(&write);111 //tlist.AddToList(&display2); 145 112 146 113 // 147 114 // First loop: No noise 148 115 // 149 150 116 MProgressBar bar; 151 117 bar.SetWindowName("No noise..."); … … 164 130 // 165 131 // 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 167 146 MReadMarsFile read2("Events"); 168 147 read2.AddFile(NoiseFilename); … … 171 150 tlist.RemoveFromList(&read); 172 151 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"); 180 155 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"); 184 165 166 tlist.RemoveFromList(&mccalibcalc); 167 tlist.AddToList(&write); 168 // tlist.AddToListBefore(&display2,&write, "All"); 185 169 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); 193 173 194 174 if (!evtloop.Eventloop())
Note:
See TracChangeset
for help on using the changeset viewer.