Changeset 6569 for trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
- Timestamp:
- 02/17/05 17:09:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r6339 r6569 70 70 #include "MMcPedestalNSBAdd.h" // MMcPedestalNSBAdd 71 71 72 #include "MCerPhotAnal2.h" // MCerPhotAnal2 72 #include "MCerPhotAnal2.h" // MPedestalCalc 73 #include "MTaskEnv.h" // MTaskEnv 74 #include "MExtractTimeAndChargeDigitalFilter.h" 73 75 #include "MImgCleanStd.h" // MImgCleanStd 74 76 #include "MHillasCalc.h" // MHillasCalc 75 //#include "MHillasSrcCalc.h" // MHillasSrcCalc 76 //#include "MBlindPixelCalc.h" // MBlindPixelCalc 77 #include "MArrivalTimeCalc.h" // MArrivalTimeCalc 77 #include "MCalibrationRelTimeCalc.h" // MHillasSrcCalc 78 #include "MPrint.h" // 79 #include "MBadPixelsCalc.h" // MBadPixelsCalc 80 #include "MBadPixelsTreat.h" // MBadPixelsTreat 78 81 #include "MFillH.h" // MFillH 79 82 #include "MExtractSignal.h" // MExtractsignal … … 107 110 // Constructor. 108 111 // 109 MEventDisplay::MEventDisplay(const char *fname , const char *pname, const char *cname) : MStatusDisplay(), fEvtLoop(0)112 MEventDisplay::MEventDisplay(const char *fname) : MStatusDisplay(), fEvtLoop(0) 110 113 { 111 114 // 112 115 // Setup Task list for hillas calculation 113 116 // 114 SetupTaskList("Events", fname , pname, cname);117 SetupTaskList("Events", fname); 115 118 116 119 // … … 170 173 // preprocess tasks and read in first event (process) 171 174 // 172 void MEventDisplay::SetupTaskList(const char *tname, const char *fname, 173 const char *pname, const char *cname) 174 { 175 MCalibrationChargeCam *ccam=0; 176 MPedPhotCam *pcam=0; 175 void MEventDisplay::SetupTaskList(const char *tname, const char *fname) 176 { 177 // MCalibrationChargeCam *ccam=0; 178 // MPedPhotCam *pcam=0; 177 179 178 180 MBadPixelsCam *badpix = new MBadPixelsCam; … … 187 189 } 188 190 189 if (type==2)190 {191 TFile file(pname, "READ");192 if (!file.IsZombie())193 pcam = new MPedPhotCam;194 if (pcam)195 {196 if (pcam->Read()<=0)197 {198 delete pcam;199 pcam = NULL;200 }201 202 if (file.FindKey("MBadPixelsCam"))203 {204 MBadPixelsCam bad;205 if (bad.Read()>0)206 badpix->Merge(bad);207 }208 }209 file.Close();210 file.Open(cname, "READ");211 if (!file.IsZombie())212 ccam = new MCalibrationChargeCam;213 if (ccam)214 {215 if (ccam->Read()<=0)216 {217 delete ccam;218 ccam = NULL;219 }220 221 if (file.FindKey("MBadPixelsCam"))222 {223 MBadPixelsCam bad;224 if (bad.Read()>0)225 badpix->Merge(bad);226 }227 }228 file.Close();229 }230 231 191 // 232 192 // Setup an empty job, with a reader task only. … … 248 208 plist->AddToList(tlist); 249 209 plist->AddToList(badpix); 250 if (pcam)251 plist->AddToList(pcam);252 if (ccam)253 plist->AddToList(ccam);254 210 255 211 //MArrivalTime *atime = new MArrivalTime; … … 290 246 plist->AddToList(evt10); 291 247 248 MExtractTimeAndChargeDigitalFilter *digf = new MExtractTimeAndChargeDigitalFilter; 249 digf->ReadWeightsFile("msignal/MC_weights.dat"); 250 251 MTaskEnv *taskenv1=new MTaskEnv("ExtractSignal"); 252 taskenv1->SetDefault(digf); 253 taskenv1->SetOwner(); 254 292 255 MCerPhotAnal2 *nanal = new MCerPhotAnal2; 293 256 MFillH *fill01 = new MFillH(evt01, "MCerPhotEvt", "MFillH01"); 294 257 MImgCleanStd *clean = new MImgCleanStd; 295 258 MFillH *fill02 = new MFillH(evt02, "MCerPhotEvt", "MFillH02"); 296 MFillH *fill03 = new MFillH(evt03, type==1?"MPedPhotFundamental":"MPed PhotCam","MFillH03");297 MFillH *fill04 = new MFillH(evt04, type==1?"MPedPhotFromExtractorRndm":"MPed PhotCam", "MFillH04");259 MFillH *fill03 = new MFillH(evt03, type==1?"MPedPhotFundamental":"MPedestalCam", "MFillH03"); 260 MFillH *fill04 = new MFillH(evt04, type==1?"MPedPhotFromExtractorRndm":"MPedestalCam", "MFillH04"); 298 261 MFillH *fill06a= new MFillH(evt06a, "MCameraData", "MFillH06a"); 299 262 MFillH *fill06b= new MFillH(evt06b, "MCameraData", "MFillH06b"); 300 //MBlindPixelCalc *blind = new MBlindPixelCalc;301 263 MHillasCalc *hcalc = new MHillasCalc; 302 264 MMcTriggerLvl2Calc *trcal = new MMcTriggerLvl2Calc; … … 304 266 MFillH *fill10 = new MFillH(evt10, "MCerPhotEvt", "MFillH10"); 305 267 268 MBadPixelsCalc *bcalc = new MBadPixelsCalc; 269 MBadPixelsTreat *btreat = new MBadPixelsTreat; 270 btreat->SetProcessTimes(kFALSE); 306 271 if (type==1) 272 { 273 bcalc->SetNamePedPhotCam("MPedPhotFromExtractor"); 274 btreat->AddNamePedPhotCam("MPedPhotFromExtractorRndm"); 307 275 clean->SetNamePedPhotCam("MPedPhotFromExtractorRndm"); 276 } 308 277 309 278 // If no pedestal or no calibration file is availble 310 279 if (type==2) 311 280 { 312 if (!pcam || !ccam) 313 { 314 MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5); 315 MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5); 316 f1->SetName("MFMonteCarlo"); 317 f2->SetName("MFRealData"); 318 319 MMcPedestalCopy *pcopy = new MMcPedestalCopy; 320 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd; 321 322 MExtractSignal* extra = new MExtractSignal(); 323 extra->SetRange(0, 14, 0, 14); 324 extra->SetSaturationLimit(240); 325 326 MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate; 327 mcupd->SetOuterPixelsGainScaling(kFALSE); 328 329 MCalibrateData* mccal = new MCalibrateData; 330 mccal->SetCalibrationMode(MCalibrateData::kFfactor); 331 332 // MC 333 extra->SetFilter(f1); 334 mcupd->SetFilter(f1); 335 mccal->SetFilter(f1); 336 trcal->SetFilter(f1); 337 //fill09->SetFilter(f1); 338 339 // Data 340 nanal->SetFilter(f2); 341 342 // TaskList 343 tlist->AddToList(f1); 344 tlist->AddToList(f2); 345 tlist->AddToList(pcopy); 346 tlist->AddToList(pdnsb); 347 348 tlist->AddToList(extra); 349 tlist->AddToList(mcupd); 350 tlist->AddToList(mccal); 351 352 353 tlist->AddToList(nanal); 354 } 355 else 356 { 357 MCalibrateData* calib = new MCalibrateData; 358 tlist->AddToList(calib); 359 } 281 MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5); 282 f1->SetName("MFMonteCarlo"); 283 284 MMcPedestalCopy *pcopy = new MMcPedestalCopy; 285 MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd; 286 287 MMcCalibrationUpdate* mcupd = new MMcCalibrationUpdate; 288 mcupd->SetOuterPixelsGainScaling(kFALSE); 289 290 MCalibrateData* calib = new MCalibrateData; 291 calib->SetCalibrationMode(MCalibrateData::kFlatCharge); 292 calib->SetPedestalFlag(MCalibrateData::kEvent); 293 294 //MCalibrationRelTimeCalc *tcalc = new MCalibrationRelTimeCalc; 295 296 // MC 297 mcupd->SetFilter(f1); 298 trcal->SetFilter(f1); 299 300 // TaskList 301 tlist->AddToList(f1); 302 tlist->AddToList(pcopy); 303 tlist->AddToList(pdnsb); 304 305 tlist->AddToList(nanal); // Calculated MPedPhotCam 306 tlist->AddToList(taskenv1); // Calculates MExtractedSignalCam, MArrivalTimeCam 307 tlist->AddToList(mcupd); 308 tlist->AddToList(calib); // MExtractedSignalCam --> MCerPhotEvt 309 310 tlist->AddToList(bcalc); // Produce MBadPixelsCam 311 tlist->AddToList(btreat); // Treat MBadPixelsCam 360 312 } 361 313 … … 367 319 tlist->AddToList(fill06a); 368 320 tlist->AddToList(fill06b); 369 //tlist->AddToList(blind);370 321 tlist->AddToList(fill10); 371 tlist->AddToList(hcalc); 372 if ((!pcam || !ccam) && type==2) 373 { 374 MArrivalTimeCalc *tcalc = new MArrivalTimeCalc; 375 MFillH *fill07 = new MFillH(evt07, "MRawEvtData", "MFillH7"); 376 MFillH *fill08 = new MFillH(evt08, "MArrivalTimeCam", "MFillH8"); 377 tlist->AddToList(tcalc); 322 if (type==2) 323 { 324 MFillH *fill07 = new MFillH(evt07, "MRawEvtData", "MFillH7"); 325 MFillH *fill08 = new MFillH(evt08, "MArrivalTimeCam", "MFillH8"); 378 326 tlist->AddToList(fill07); 379 327 tlist->AddToList(fill08); … … 387 335 tlist->AddToList(fill08); 388 336 } 337 tlist->AddToList(hcalc); 389 338 390 339 // … … 570 519 } 571 520 572 if (!tlist->Process()) 521 const Int_t rc = tlist->Process(); 522 if (rc==kFALSE || rc==kERROR) 573 523 return; 574 524 … … 609 559 void MEventDisplay::ReadFirstEvent() 610 560 { 611 if (!fEvtLoop->PreProcess()) 561 const Int_t rc = fEvtLoop->PreProcess(); 562 if (rc==kFALSE || rc==kERROR) 612 563 return; 613 564
Note:
See TracChangeset
for help on using the changeset viewer.