Changeset 6196 for trunk/MagicSoft/Mars/mtemp
- Timestamp:
- 02/02/05 12:00:43 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/macros/makeHillasMC.C
r6045 r6196 50 50 TString* OutFilename2; 51 51 52 TString rffilename; 53 TString dispfilename; 54 52 55 // ------------- USER CHANGE ----------------- 53 56 // Comment line starting "CalibrationFileName" to disable calibration. … … 57 60 58 61 // File to be used in the calibration (must be a camera file without added noise) 59 CalibrationFilename = new TString("/ discpepe/root_0.73mirror/wuerzburg/gammas_nonoise/Gamma_zbin0_0_7_1000to1009_w0.root");62 CalibrationFilename = new TString("/mnt/local_wdjrico/jrico/mc/Gammas/Gamma_zbin3_90_7_1290to1299_w0_nonoise.root"); 60 63 // File to be analyzed 61 AnalysisFilename = new TString("/ discpepe/root_0.73mirror/wuerzburg/gammas/Gamma_zbin*.root");64 AnalysisFilename = new TString("/mnt/users/blanch/magic/TestSample/file*.root"); 62 65 63 66 // Change output file names as desired. 64 67 // If you want only one output (not dividing the events in Train and Test samples), 65 68 // comment the initialization of OutFilename2. 66 OutFilename1 = new TString("/mnt/users/domingo/MAGIC/Disp05/All_gammas_0.73mirror_zbin0to12_cleaned_4035_Spline.root"); 67 // OutFilename1 = new TString("star_train.root"); // Output file name 1 (test) 69 OutFilename1 = new TString("/mnt/users/blanch/Temp/Prova.root"); 68 70 // OutFilename2 = new TString("star_test.root"); // Output file name 2 (train) 71 72 // File to read RandomForest 73 rffilename="/mnt/users/blanch/magic/Mars-All/Mars_Standard06/mtemp/mifae/programs/RFstd.root"; 74 // File to read Disp 75 dispfilename="/mnt/users/blanch/magic/Mars-All/Mars_Standard06/mtemp/mifae/programs/DISPstd.root"; 69 76 70 77 // Fraction of events (taken at random) which one wants to process from the … … 115 122 plist.AddToList(&badpix); 116 123 124 MCerPhotEvt nphot; 125 // Stores number of phe 126 plist.AddToList(&nphot); 117 127 118 128 // Now setup the tasks and tasklist: … … 150 160 MMcCalibrationCalc mccalibcalc; 151 161 // Calculates calibration constants to convert from ADC counts to photons. 162 163 MAddGainFluctuation gainfluc; 164 //gainfluc.FillHist(1,0.5); 165 gainfluc.FillHist(0,0.1); // defaul line to not add fluctuations 166 // Adds Gain fluctuations 152 167 153 168 MImgCleanStd clean(CleanLev[0], CleanLev[1]); … … 189 204 write1.AddContainer("MMcFadcHeader", "RunHeaders"); 190 205 write1.AddContainer("MMcTrigHeader", "RunHeaders"); 206 write1.AddContainer("MGainFluctuationCam", "RunHeaders"); 191 207 192 208 write1.AddContainer("MRawEvtHeader", "Events"); … … 201 217 write1.AddContainer("MTopology", "Events"); 202 218 write1.AddContainer("MPointingPos", "Events"); 219 write1.AddContainer("MHadronness", "Events"); 220 write1.AddContainer("MImageParDisp" , "Events"); 203 221 //write1.AddContainer("MArrivalTimeCam", "Events"); 204 222 //write1.AddContainer("MCerPhotEvt", "Events"); … … 215 233 write2.AddContainer("MMcFadcHeader", "RunHeaders"); 216 234 write2.AddContainer("MMcTrigHeader", "RunHeaders"); 235 write2.AddContainer("MGainFluctuationCam", "RunHeaders"); 217 236 218 237 write2.AddContainer("MRawEvtHeader", "Events"); … … 227 246 write2.AddContainer("MTopology", "Events"); 228 247 write2.AddContainer("MPointingPos", "Events"); 248 write2.AddContainer("MHadronness", "Events"); 249 write2.AddContainer("MImageParDisp" , "Events"); 229 250 //write2.AddContainer("MArrivalTimeCam", "Events"); 230 251 //write2.AddContainer("MCerPhotEvt", "Events"); … … 260 281 } 261 282 262 263 // 264 // SECOND LOOP: Analysis loop (process file with noise) 283 // 284 // SECOND LOOP: TO READ THE RANDOM FOREST FILE(S) 285 // 286 287 MParList plistrf; 288 MTaskList tlistrf; 289 MRanForest ranforest; 290 MRanTree rantree; 291 292 if(rffilename.Length()) 293 { 294 plistrf.AddToList(&tlistrf); 295 plistrf.AddToList(&ranforest); 296 plistrf.AddToList(&rantree); 297 298 MReadTree readrf("Tree",rffilename); 299 readrf.DisableAutoScheme(); 300 301 MRanForestFill rffill; 302 rffill.SetNumTrees(100); 303 304 tlistrf.AddToList(&readrf); 305 tlistrf.AddToList(&rffill); 306 307 MEvtLoop evtlooprf; 308 evtlooprf.SetParList(&plistrf); 309 if (!evtlooprf.Eventloop()) 310 return; 311 312 tlistrf.PrintStatistics(); 313 } 314 315 316 // 317 // THIRD LOOP: Analysis loop (process file with noise) 265 318 // 266 319 bar.SetWindowName("Analyzing..."); … … 272 325 plist.AddToList(&timecam); 273 326 plist.AddToList(&topology); 274 327 plist.AddToList(&rantree); 328 plist.AddToList(&ranforest); 329 275 330 MArrivalTimeCalc2 timecalc; 276 331 // Calculates the arrival time as the mean time of the fWindowSize … … 290 345 291 346 // Change the read task by another one which reads the file we want to analyze: 292 MReadMarsFile read2("Events"); 293 read2.AddFile(AnalysisFilename->Data()); 347 MReadMarsFile read2("Events","/mnt/users/blanch/magic/TestSample/file*.root"); 348 // MReadMarsFile read2("Events","/mnt/users/blanch/magic/TestSample/file53.root"); 349 // read2.AddFile(AnalysisFilename->Data()); 294 350 read2.DisableAutoScheme(); 295 351 tlist.AddToListBefore(&read2, &read); 296 352 tlist.RemoveFromList(&read); 353 297 354 298 355 // Add new tasks (Islands and Topology calculations) … … 301 358 // tlist.AddToListBefore(&islclean,&hcalc); 302 359 tlist.AddToListBefore(&topcalc,&hcalc); 360 361 // Add Task to Add Gain Fluctuations 362 tlist.AddToListBefore(&gainfluc, &hcalc); 363 364 MGeomCamMagic geomcam;// = new MGeomCam(); 365 plist.AddToList(&geomcam); 366 367 368 MHillasDisplay* disphillas=NULL; 369 disphillas = new MHillasDisplay(&nphot,&geomcam); 303 370 304 371 // Analyze only the desired fraction of events, skip the rest: … … 312 379 tlist.RemoveFromList(&mccalibcalc); 313 380 381 // disp 382 // (read in optimum Disp parameter values) 383 MDispParameters dispin; 384 TArrayD dispPar; 385 if(dispfilename.Length()) 386 { 387 TFile inparam(dispfilename); 388 dispin.Read("MDispParameters"); 389 cout << "Optimum parameter values taken for calculating Disp : " << endl; 390 391 dispPar = dispin.GetParameters(); 392 for (Int_t i=0; i<dispPar.GetSize(); i++) 393 cout << dispPar[i] << ", "; 394 cout << endl; 395 396 inparam.Close(); 397 } 398 // Disp results container 399 MImageParDisp imagepardisp; 400 // Disp histograms 401 MHDisp hdisp; 402 hdisp.SetName("MHDispAsym"); 403 hdisp.SetSelectedPos(4); 404 MFillH filldisp("MHDispAsym[MHDisp]", ""); 405 406 // Add RandomForest and Disp task computation 407 MRanForestCalc hadrcalc; 408 MDispCalc dispcalc; 409 410 tlist.AddToList(&dispcalc); 411 tlist.AddToList(&filldisp); 412 if(rffilename.Length()) 413 tlist.AddToList(&hadrcalc); 414 314 415 // Add tasks to write output: 315 416 if (OutFilename2) … … 321 422 tlist.AddToList(&write1); 322 423 424 // Add display image with hillas 425 disphillas->SetPSFile(); 426 disphillas->SetPSFileName("provaGF.ps"); 427 disphillas->SetPause(kFALSE); 428 //tlist.AddToList(disphillas); 429 323 430 324 431 if (!evtloop.Eventloop())
Note:
See TracChangeset
for help on using the changeset viewer.