- Timestamp:
- 02/26/04 04:21:51 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3314 r3317 6 6 7 7 2004/02/25: Markus Gaug 8 9 * mcalib/MHCalibrationRelTimeCam.cc 10 - is now filled from MArrivalTimeCam instead of MArrivalTime 11 12 * macros/calibration.C 13 - divided into two macros: calibration.C using the MJPedestal 14 standard procedure and pedestalstudies.C using the old procedures 15 16 * macros/pedestalstudies.C 17 - new macro containing the first previous part of calibration.C 18 8 19 9 20 * mcalib/MCalibrationChargeBlindPix.h -
trunk/MagicSoft/Mars/macros/calibration.C
r3310 r3317 22 22 ! 23 23 \* ======================================================================== */ 24 25 //const TString pedfile = "/remote/home/pc2/operator/Crab20040214/20040215_16743_P_CrabOn_E.root"; 26 //const TString calfile = "/remote/home/pc2/operator/Crab20040214/20040215_16744_C_CrabOn_E.root"; 27 const TString pedfile = "../20040215_16770_P_OffCrab4_E.root"; 28 const TString calfile = "../20040215_16771_C_OffCrab4_E.root"; 29 30 //const TString pedfile = "/mnt/users/mdoro/Mars/Data/20040201_14418_P_OffMrk421-1_E.root"; 31 //const TString calfile = "/mnt/users/mdoro/Mars/Data/20040201_1441*_C_OffMrk421-1_E.root"; 32 33 //const TString pedfile = "/mnt/Data/rootdata/CrabNebula/2004_02_10/20040210_14607_P_CrabNebula_E.root"; 34 //const TString calfile = "/mnt/Data/rootdata/CrabNebula/2004_02_10/20040210_14608_C_CrabNebula_E.root"; 35 36 //const TString pedfile = "/mnt/Data/rootdata/CrabNebula/2004_01_26/20040125_10412_P_Crab-On_E.root"; 37 //const TString calfile = "/mnt/Data/rootdata/CrabNebula/2004_01_26/20040125_1041*_C_Crab-On_E.root"; 38 39 //const TString pedfile = "/mnt/Data/rootdata/Miscellaneous/2003_12_19/20031218_03522_P_Park_E.root"; 40 //const TString calfile = "/mnt/Data/rootdata/Miscellaneous/2003_12_19/20031218_03527_C_Park_E.root"; 41 42 void calibration(TString pedname=pedfile, 43 TString calname=calfile) 24 #include "MAGIC.h" 25 26 27 void calibration() 44 28 { 29 30 const char *inpath = "/remote/home/pc2/operator/Crab20040214/"; 31 //const TString inpath = "/mnt/Data/rootdata/CrabNebula/2004_02_10/"; 32 //const TString inpath = "/mnt/Data/rootdata/CrabNebula/2004_01_26/"; 33 //const TString inpath = "/mnt/Data/rootdata/Miscellaneous/2003_12_19/"; 34 35 MRunIter pruns; 36 MRunIter cruns; 37 38 pruns.AddRuns(15487,15494,inpath); 39 cruns.AddRuns(15495,15508,inpath); 45 40 46 41 gStyle->SetOptStat(1111); … … 51 46 display->Resize(850,700); 52 47 53 // 54 // Create a empty Parameter List and an empty Task List 55 // The tasklist is identified in the eventloop by its name 48 MJPedestal pedloop; 49 pedloop.SetInput(&pruns); 50 pedloop.SetDisplay(display); 51 52 if (!pedloop.Process()) 53 return; 54 55 // 56 // Create a empty Parameter List and an empty Task List 56 57 // 57 58 MParList plist; 58 59 59 MTaskList tlist; 60 60 plist.AddToList(&tlist); 61 62 // 63 // Now setup the tasks and tasklist for the pedestals:64 // ---------------------------------------------------65 //66 67 MReadMarsFile read("Events" , pedname);61 plist.AddToList(&pedloop.GetPedestalCam()); 62 63 gLog << endl;; 64 gLog << "Calculate MCalibrationCam from Runs " << cruns.GetRunsAsString() << endl; 65 gLog << endl; 66 67 MReadMarsFile read("Events"); 68 68 read.DisableAutoScheme(); 69 70 MGeomApply geomapl; 71 MExtractSignal sigcalc; 72 73 // 74 // Set the extraction range higher: 75 // 76 //sigcalc.SetRange(1,14,1,14); 77 78 MPedCalcPedRun pedcalc; 79 80 // 81 // Additionally to calculating the pedestals, 82 // you can fill histograms and look at them 83 // 84 MFillH fill("MHPedestalCam", "MExtractedSignalCam"); 85 86 tlist.AddToList(&read); 87 tlist.AddToList(&geomapl); 88 tlist.AddToList(&sigcalc); 89 tlist.AddToList(&pedcalc); 90 tlist.AddToList(&fill); 91 92 MGeomCamMagic geomcam; 93 MPedestalCam pedcam; 94 MHPedestalCam hpedcam; 95 plist.AddToList(&geomcam); 96 plist.AddToList(&pedcam); 97 plist.AddToList(&hpedcam); 98 99 // 100 // Create and setup the eventloop 101 // 102 MEvtLoop evtloop; 103 evtloop.SetParList(&plist); 104 evtloop.SetDisplay(display); 105 106 // 107 // Execute first analysis 108 // 109 if (!evtloop.Eventloop()) 110 return; 111 112 tlist.PrintStatistics(); 113 114 // 115 // Look at one specific pixel, after all the histogram manipulations: 116 // 117 // hpedcam[9].DrawClone("fourierevents"); 118 119 120 MHCamera dispped0 (geomcam, "Ped;Pedestal", "Mean per Slice"); 121 MHCamera dispped1 (geomcam, "Ped;PedestalErr", "Mean Error per Slice"); 122 MHCamera dispped2 (geomcam, "Ped;PedestalRms", "RMS per Slice"); 123 MHCamera dispped3 (geomcam, "Ped;PedestalRmsErr", "RMS Error per Slice"); 124 125 MHCamera dispped4 (geomcam, "Ped;Mean", "Fitted Mean per Slice"); 126 MHCamera dispped5 (geomcam, "Ped;MeanErr", "Fitted Error of Mean per Slice"); 127 MHCamera dispped6 (geomcam, "Ped;Sigma", "Fitted Sigma per Slice"); 128 MHCamera dispped7 (geomcam, "Ped;SigmaErr", "Fitted Error of Sigma per Slice"); 129 MHCamera dispped8 (geomcam, "Ped;Prob", "Probability of Fit"); 130 MHCamera dispped9 (geomcam, "Ped;DeltaPedestalMean", "Rel. Diff. Mean per Slice (Calc.-Fitte)"); 131 MHCamera dispped10 (geomcam, "Ped;DeltaPedestalMeanError", "Rel. Diff. Mean Error per Slice (Calc.-Fitted)"); 132 MHCamera dispped11 (geomcam, "Ped;DeltaRmsSigma", "Rel. Diff. RMS per Slice (Calc.-Fitted)"); 133 MHCamera dispped12 (geomcam, "Ped;DeltaRmsSigmaError", "Rel. Diff. RMS Error per Slice (Calc.-Fitted)"); 134 MHCamera dispped13 (geomcam, "Ped;FitOK", "Gaus Fit not OK"); 135 MHCamera dispped14 (geomcam, "Ped;FourierOK", "Fourier Analysis not OK"); 136 137 dispped0.SetCamContent( pedcam, 0); 138 dispped0.SetCamError( pedcam, 1); 139 dispped1.SetCamContent( pedcam, 1); 140 dispped2.SetCamContent( pedcam, 2); 141 dispped2.SetCamError( pedcam, 3); 142 dispped3.SetCamContent( pedcam, 3); 143 144 dispped4.SetCamContent( hpedcam, 0); 145 dispped4.SetCamError( hpedcam, 1); 146 dispped5.SetCamContent( hpedcam, 1); 147 dispped6.SetCamContent( hpedcam, 2); 148 dispped6.SetCamError( hpedcam, 3); 149 dispped7.SetCamContent( hpedcam, 3); 150 dispped8.SetCamContent( hpedcam, 4); 151 dispped9.SetCamContent( hpedcam, 5); 152 dispped9.SetCamError( hpedcam, 6); 153 dispped10.SetCamContent(hpedcam, 7); 154 dispped11.SetCamContent(hpedcam, 8); 155 dispped11.SetCamError( hpedcam, 9); 156 dispped12.SetCamContent(hpedcam, 10); 157 dispped13.SetCamContent(hpedcam, 11); 158 dispped14.SetCamContent(hpedcam, 12); 159 160 dispped0.SetYTitle("Calc. Pedestal per slice [FADC counts]"); 161 dispped1.SetYTitle("Calc. Pedestal Error per slice [FADC counts]"); 162 dispped2.SetYTitle("Calc. Pedestal RMS per slice [FADC counts]"); 163 dispped3.SetYTitle("Calc. Pedestal RMS Error per slice [FADC counts]"); 164 dispped4.SetYTitle("Fitted Mean per slice [FADC counts]"); 165 dispped5.SetYTitle("Error of Fitted Mean per slice [FADC counts]"); 166 dispped6.SetYTitle("Fitted Sigma per slice [FADC counts]"); 167 dispped7.SetYTitle("Error of Fitted Sigma per slice [FADC counts]"); 168 dispped8.SetYTitle("Fit Probability [1]"); 169 dispped9.SetYTitle("Rel. Diff. Pedestal Calc.-Fitted per slice [1]"); 170 dispped10.SetYTitle("Rel. Diff. Pedestal Error Calc.-Fitted per slice [1]"); 171 dispped11.SetYTitle("Rel. Diff. Pedestal RMS Calc.-Fitted per slice [1]"); 172 dispped12.SetYTitle("Rel. Diff. Pedestal RMS Error Calc.-Fitted per slice [1]"); 173 dispped13.SetYTitle("[1]"); 174 dispped14.SetYTitle("[1]"); 175 176 // Histogram values 177 TCanvas &b1 = display->AddTab("Ped.Calc."); 178 b1.Divide(4,3); 179 180 CamDraw(b1,dispped0,pedcam,1,4,1); 181 CamDraw(b1,dispped1,pedcam,2,4,2); 182 CamDraw(b1,dispped2,pedcam,3,4,2); 183 CamDraw(b1,dispped3,pedcam,4,4,2); 184 185 // Fitted values 186 TCanvas &b2 = display->AddTab("Ped.Fit"); 187 b2.Divide(4,3); 188 189 CamDraw(b2,dispped4,hpedcam,1,4,1); 190 CamDraw(b2,dispped5,hpedcam,2,4,2); 191 CamDraw(b2,dispped6,hpedcam,3,4,2); 192 CamDraw(b2,dispped7,hpedcam,4,4,2); 193 194 195 // Fits Probability 196 TCanvas &b3 = display->AddTab("Ped.Fit Prob."); 197 b3.Divide(1,3); 198 199 CamDraw(b3,dispped8,hpedcam,1,1,3); 200 201 // Differences 202 TCanvas &c4 = display->AddTab("Rel.Diff.Calc.-Fit"); 203 c4.Divide(4,3); 204 205 CamDraw(c4,dispped9,hpedcam,1,4,1); 206 CamDraw(c4,dispped10,hpedcam,2,4,1); 207 CamDraw(c4,dispped11,hpedcam,3,4,1); 208 CamDraw(c4,dispped12,hpedcam,4,4,1); 209 210 // Defects 211 TCanvas &c5 = display->AddTab("Defects"); 212 c5.Divide(2,2); 213 214 CamDraw(c5,dispped13,hpedcam,1,2,0); 215 CamDraw(c5,dispped14,hpedcam,2,2,0); 216 217 // 218 // Create a empty Parameter List and an empty Task List 219 // 220 MParList plist2; 221 MTaskList tlist2; 222 plist2.AddToList(&tlist2); 223 69 static_cast<MRead&>(read).AddFiles(cruns); 70 71 MGeomCamMagic geomcam; 224 72 MExtractedSignalCam sigcam; 225 73 MCalibrationChargeCam calcam; … … 235 83 // we have to set the color of the pulser LED by hand 236 84 // 237 blindpix.SetColor( MCalibrationChargeBlindPix::kECT1);238 pindiode.SetColor( MCalibrationChargePINDiode::kECT1);85 blindpix.SetColor(kCT1); 86 pindiode.SetColor(kCT1); 239 87 // 240 88 // Get the previously created MPedestalCam into the new Parameter List 241 89 // 242 plist2.AddToList(&geomcam); 243 plist2.AddToList(&pedcam); 244 plist2.AddToList(&sigcam); 245 plist2.AddToList(&calcam); 246 plist2.AddToList(&histtime); 247 plist2.AddToList(&histcharge); 248 plist2.AddToList(&histpin); 249 plist2.AddToList(&histblind); 250 // 251 // Get the MAGIC geometry 252 // 253 tlist2.AddToList(&geomapl); 254 // 255 // Now setup the new tasks and tasklist for the calibration 256 // --------------------------------------------------- 257 // 258 259 MReadMarsFile read2("Events", calname); 260 read2.DisableAutoScheme(); 90 plist.AddToList(&geomcam); 91 plist.AddToList(&sigcam); 92 plist.AddToList(&calcam); 93 plist.AddToList(&histtime); 94 plist.AddToList(&histcharge); 95 plist.AddToList(&histpin); 96 plist.AddToList(&histblind); 261 97 262 98 // … … 264 100 // thus take the sliding window 265 101 // 102 MExtractSignal2 sigcalc2; 266 103 MExtractPINDiode pincalc; 267 104 MExtractBlindPixel blindcalc; 268 MExtractSignal2 sigcalc2;269 105 MArrivalTimeCalc2 timecalc; 270 106 MCalibrationChargeCalc calcalc; 271 272 MFillH filltime ("MHCalibrationRelTimeCam" , "MArrivalTime"); 107 MGeomApply geomapl; 108 109 MFillH filltime("MHCalibrationRelTimeCam", "MArrivalTime"); 273 110 MFillH fillpin ("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode"); 274 111 MFillH fillblind("MHCalibrationChargeBlindPix", "MExtractedSignalBlindPixel"); … … 276 113 277 114 // 278 // Set the range (other than default)279 // of FADC slices for the blind pixel280 //281 // calcalc.SetBlindPixelRange(10,25);282 283 //284 // Set the cut upon which a superposition of the blind pixel285 // FADC slices will be filled into the SinglePHE histogram286 //287 // calcalc.SetBlindPixelSinglePheCut(500);288 289 //290 115 // Skip the HiGain vs. LoGain calibration 291 116 // 292 117 calcalc.SkipHiLoGainCalibration(); 293 118 294 //295 // As long, as we don't have digital modules,296 // we have to set the color of the pulser LED by hand297 //298 // calcalc.SetPulserColor(MCalibrationCalc::kECT1);299 300 //301 // In case, we want to exclude a pre-defined list of bad pixels:302 // (This is a preliminary feature)303 //304 // calcalc.ExcludePixelsFromAsciiFile("badpixels.dat");305 306 //307 // In case, we want to apply another fit function to the308 // blind pixel309 //310 // MCalibrationBlindPix *bp = calcam.GetBlindPixel();311 // bp->ChangeFitFunc(MHCalibrationBlindPixel::kEPoisson5);312 313 119 // 314 120 // Apply a filter against cosmics … … 318 124 MContinue cont(&cosmics); 319 125 320 tlist2.AddToList(&read2); 321 tlist2.AddToList(&blindcalc); 322 tlist2.AddToList(&pincalc); 323 tlist2.AddToList(&sigcalc2); 126 tlist.AddToList(&read); 127 tlist.AddToList(&geomapl); 128 tlist.AddToList(&sigcalc2); 129 tlist.AddToList(&blindcalc); 130 tlist.AddToList(&pincalc); 324 131 // 325 132 // In case, you want to skip the cosmics rejection, 326 133 // uncomment the next line 327 134 // 328 tlist 2.AddToList(&cont);135 tlist.AddToList(&cont); 329 136 // 330 137 // In case, you want to skip the somewhat lengthy calculation 331 138 // of the arrival times using a spline, uncomment the next two lines 332 139 // 333 tlist 2.AddToList(&timecalc);334 tlist 2.AddToList(&filltime);335 tlist 2.AddToList(&fillpin);336 tlist 2.AddToList(&fillblind);337 tlist 2.AddToList(&fillcam);338 // 339 tlist 2.AddToList(&calcalc);140 tlist.AddToList(&timecalc); 141 tlist.AddToList(&filltime); 142 tlist.AddToList(&fillpin); 143 tlist.AddToList(&fillblind); 144 tlist.AddToList(&fillcam); 145 // 146 tlist.AddToList(&calcalc); 340 147 // 341 148 // Create and setup the eventloop 342 149 // 343 150 MEvtLoop evtloop2; 344 evtloop2.SetParList(&plist 2);151 evtloop2.SetParList(&plist); 345 152 evtloop2.SetDisplay(display); 346 153 … … 351 158 return; 352 159 353 tlist 2.PrintStatistics();160 tlist.PrintStatistics(); 354 161 355 162 // … … 361 168 calcam.Print(); 362 169 calcam.SetLogStream(&gLog); 363 364 170 // 365 171 // just one example how to get the plots of individual pixels 366 172 // 367 //histblind.DrawClone("all");368 //histcharge[5].DrawClone("time");173 histblind.DrawClone("all"); 174 histcharge[5].DrawClone("time"); 369 175 370 176 // Create histograms to display … … 646 452 TH1D *obj2 = (TH1D*)obj1->Projection(); 647 453 648 obj2->Sumw2();454 // obj2->Sumw2(); 649 455 obj2->Draw(); 650 456 obj2->SetBit(kCanDelete); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.cc
r3181 r3317 39 39 #include "MHCalibrationRelTimePix.h" 40 40 41 #include "MArrivalTime.h" 41 #include "MArrivalTimeCam.h" 42 #include "MArrivalTimePix.h" 42 43 43 44 ClassImp(MHCalibrationRelTimeCam); … … 147 148 { 148 149 149 MArrivalTime *arrtime = (MArrivalTime*)par;150 MArrivalTimeCam *arrtime = (MArrivalTimeCam*)par; 150 151 if (!arrtime) 151 152 { … … 175 176 } 176 177 178 const MArrivalTimePix &refpix = (*arrtime)[1]; 179 const Float_t reftime = refpix.IsLoGainUsed() ? refpix.GetArrivalTimeLoGain() : refpix.GetArrivalTimeHiGain(); 180 177 181 for (Int_t i=0; i<n; i++) 178 182 { 179 180 const Float_t reltime = (*arrtime)[i] - (*arrtime)[1]; 181 182 183 hist.FillHistAndArray(reltime);183 const MArrivalTimePix &pix = (*arrtime)[i]; 184 const Float_t time = pix.IsLoGainUsed() ? pix.GetArrivalTimeLoGain() : pix.GetArrivalTimeHiGain(); 185 186 MHCalibrationRelTimePix &hist = (*this)[i]; 187 hist.FillHistAndArray(time - reftime); 184 188 } 185 189
Note:
See TracChangeset
for help on using the changeset viewer.