Changeset 3341
- Timestamp:
- 02/27/04 15:19:57 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3338 r3341 5 5 -*-*- END OF LINE -*-*- 6 6 7 8 2004/02/27: Abelardo Moralejo 9 * macros/starmc.C 10 - added (optional) division of output into two, for use as train 11 and test samples in g/h separation studies. 12 13 7 14 2004/02/26: Hendrik Bartko 8 15 9 16 * macros/dohtml.C 10 17 - included the path msignals/ 11 12 18 13 19 -
trunk/MagicSoft/Mars/macros/starmc.C
r2981 r3341 41 41 // parameters from Magic Monte Carlo files (output of camera). 42 42 43 TString* CalibrationFilename; 44 TString* OutFilename1; 45 TString* OutFilename2; 43 46 44 47 // ------------- user change ----------------- 45 46 TString* CalibrationFilename; 47 48 // 49 // Comment out next line to disable calibration. In that case the units of the 50 // MHillas.fSize parameter will be ADC counts (rather, equivalent ADC counts in 51 // inner pixels, since we correct for the possible differences in gain of outer 52 // pixels) 53 // 54 CalibrationFilename = new TString("nonoise/Gamma_zbin0_0*.root"); 48 // 49 // Comment line starting "CalibrationFileName" to disable calibration. In that 50 // case the units of the MHillas.fSize parameter will be ADC counts (rather, 51 // equivalent ADC counts in inner pixels, since we correct for the possible 52 // differences in gain of outer pixels) 53 // 54 CalibrationFilename = new TString("nonoise/Gamma_zbin0_90_7_507*.root"); 55 55 // File to be used in the calibration (must be a camera file without added noise) 56 56 57 57 Char_t* AnalysisFilename = "Gamma_zbin0*.root"; // File to be analyzed 58 Char_t* OutFilename = "star_mc.root"; // Output file name 58 59 // ------------- user change ----------------- 60 // 61 // Change output file names as desired. If you want only one output, comment 62 // the initialization of OutFilename2. 63 64 OutFilename1 = new TString("star_train.root"); // Output file name 1 (test) 65 // OutFilename2 = new TString("star_test.root"); // Output file name 2 (train) 66 59 67 60 68 Float_t CleanLev[2] = {4., 3.}; // Tail cuts for image analysis … … 129 137 130 138 // 131 // Open output file: 132 // 133 MWriteRootFile write(OutFilename); // Writes output 134 write.AddContainer("MRawRunHeader", "RunHeaders"); 135 write.AddContainer("MMcRunHeader", "RunHeaders"); 136 write.AddContainer("MSrcPosCam", "RunHeaders"); 137 write.AddContainer("MMcEvt", "Events"); 138 write.AddContainer("MHillas", "Events"); 139 write.AddContainer("MHillasExt", "Events"); 140 write.AddContainer("MHillasSrc", "Events"); 141 write.AddContainer("MNewImagePar", "Events"); 139 // Open output files: 140 // 141 142 MWriteRootFile write1(OutFilename1.Data()); // Writes output1 143 write1.AddContainer("MRawRunHeader", "RunHeaders"); 144 write1.AddContainer("MMcRunHeader", "RunHeaders"); 145 write1.AddContainer("MSrcPosCam", "RunHeaders"); 146 write1.AddContainer("MMcEvt", "Events"); 147 write1.AddContainer("MHillas", "Events"); 148 write1.AddContainer("MHillasExt", "Events"); 149 write1.AddContainer("MHillasSrc", "Events"); 150 write1.AddContainer("MNewImagePar", "Events"); 151 152 if (OutFilename2) 153 { 154 MWriteRootFile write2(OutFilename2.Data()); // Writes output2 155 write2.AddContainer("MRawRunHeader", "RunHeaders"); 156 write2.AddContainer("MMcRunHeader", "RunHeaders"); 157 write2.AddContainer("MSrcPosCam", "RunHeaders"); 158 write2.AddContainer("MMcEvt", "Events"); 159 write2.AddContainer("MHillas", "Events"); 160 write2.AddContainer("MHillasExt", "Events"); 161 write2.AddContainer("MHillasSrc", "Events"); 162 write2.AddContainer("MNewImagePar", "Events"); 163 164 // 165 // Divide output in train and test samples, using the event number 166 // (odd/even) to achieve otherwise unbiased event samples: 167 // 168 169 MF filter1("{MMcEvt.fEvtNumber%2}>0.5"); 170 MF filter2("{MMcEvt.fEvtNumber%2}<0.5"); 171 172 write1.SetFilter(&filter1); 173 write2.SetFilter(&filter2); 174 } 142 175 143 176 // … … 179 212 tlist.AddToList(&scalc); // Calculates Source-dependent Hillas parameters 180 213 181 tlist.AddToList(&write); // Add task to write output. 214 215 // Add tasks to write output: 216 217 if (OutFilename2) 218 { 219 tlist.AddToList(&filter1); 220 tlist.AddToList(&filter2); 221 tlist.AddToList(&write2); 222 } 223 224 tlist.AddToList(&write1); 182 225 183 226 if (!evtloop.Eventloop())
Note:
See TracChangeset
for help on using the changeset viewer.