Changeset 3852 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 04/27/04 18:44:34 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/macros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/mccalibrate.C
r3768 r3852 28 28 // MMCALIBRATE - Calibration of MC data 29 29 // 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) 32 31 // 33 32 ///////////////////////////////////////////////////////////////////////////// … … 43 42 // 44 43 45 46 44 // ------------- user change ----------------- 47 45 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 // --------------------------------------------------------------------- 61 63 // 62 64 // Create a empty Parameter List and an empty Task List … … 74 76 75 77 MBadPixelsCam badpix; 76 plist.AddToList(&badpix); 77 78 78 plist.AddToList(&badpix); // Not used for now. 79 79 80 // 80 81 // Now setup the tasks and tasklist: … … 88 89 read.DisableAutoScheme(); 89 90 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 91 93 // several parameter containers. 92 94 93 95 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. 101 102 102 103 MMcCalibrationUpdate mccalibupdate; 103 104 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 105 112 calib.SetCalibrationMode(MCalibrate::kFfactor); 106 113 107 // MBlindPixelCalc blind; 108 // blind.SetUseInterpolation(); 109 114 MImgCleanStd clean; 110 115 // 111 116 // Applies tail cuts to image. Since the calibration is performed on … … 114 119 // be rejected). 115 120 // 116 MImgCleanStd clean; 117 118 119 M HillasCalc 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 122 127 123 128 tlist.AddToList(&read); 124 129 tlist.AddToList(&geom); 125 130 tlist.AddToList(&pcopy); 126 131 tlist.AddToList(&pointcalc); 127 132 tlist.AddToList(&sigextract); 128 133 tlist.AddToList(&mccalibupdate); 129 134 tlist.AddToList(&calib); 130 135 tlist.AddToList(&clean); 131 // tlist.AddToList(&blind);132 136 tlist.AddToList(&hcalc); 133 137 … … 150 154 write.AddContainer("MMcEvt", "Events"); 151 155 write.AddContainer("MMcTrig", "Events"); 156 write.AddContainer("MPointingPos", "Events"); 152 157 write.AddContainer("MRawEvtHeader", "Events"); 153 158 write.AddContainer("MCerPhotEvt", "Events"); … … 169 174 if (!evtloop.Eventloop()) 170 175 return; 171 mccalibcalc->GetHist()->Write(); 176 mccalibcalc->GetHistADC2PhotEl()->Write(); 177 mccalibcalc->GetHistPhot2PhotEl()->Write(); 178 // Writes out the histograms used for calibration. 172 179 } 173 180 174 181 // 175 // Second loop: analysis loop 182 // Second loop: apply calibration factors to MC events in the 183 // file to be anlyzed: 176 184 // 177 185 -
trunk/MagicSoft/Mars/macros/starmc2.C
r3024 r3852 38 38 void starmc2() 39 39 { 40 Char_t* AnalysisFilename = " Calibrated_run.root"; // File to be analyzed40 Char_t* AnalysisFilename = "calibrated_data.root"; // File to be analyzed 41 41 Char_t* OutFilename = "star.root"; // Output file name 42 42 … … 77 77 tlist.AddToList(&read); 78 78 tlist.AddToList(&clean); 79 // tlist.AddToList(&blind);80 79 tlist.AddToList(&hcalc); 81 80 tlist.AddToList(&scalc); // Calculates Source-dependent Hillas parameters … … 89 88 write.AddContainer("MSrcPosCam", "RunHeaders"); 90 89 write.AddContainer("MMcEvt", "Events", kFALSE); 90 write.AddContainer("MPointingPos", "Events"); 91 91 write.AddContainer("MHillas", "Events"); 92 92 write.AddContainer("MHillasExt", "Events");
Note:
See TracChangeset
for help on using the changeset viewer.