Changeset 5570 for trunk/MagicSoft/Mars
- Timestamp:
- 12/08/04 18:02:12 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5567 r5570 29 29 - added correct decoding of the 200ns information as proposed by 30 30 Florian to DecodeTime 31 32 * callisto.cc: 33 - more fixes to make calibration of signal (Y) work again 34 35 * mcalib/MCalibrateData.cc: 36 - allow calibration of Mean and Rms from different input 37 containers 38 39 * mjobs/MJCalibrateSignal.[h,cc]: 40 - removed SetNoiseCalculation -- now in its correct location 41 - added a second MPedCalcFromLoGain 42 - some more default setup 43 - added some new tabs with histograms 44 - ProcessFile now takes too input containers 45 46 * mjobs/MJCalibration.cc: 47 - set rel-time-calibration kTRUE by default 48 - removed SetNoiseCalculation -- now in its correct location 49 - enhanced writing extractors 50 51 * mjobs/MJPedestal.[h,cc]: 52 - if cloning extractor - don't use name 53 54 * mpedestal/MExtractPedestal.[h,cc]: 55 - some minor changes to output 56 - fixed order or arguments of FindObject 57 58 * mpedestal/MPedCalcFromLoGain.[h,cc]: 59 - handle SetNoiseCalculation when calculating noise! 60 61 * msignal/MExtractTimeAndCharge.cc: 62 - some minor changes to output 63 64 * msignal/MExtractTimeAndChargeDigitalFilter.[h,cc]: 65 - some minor changes to output 66 - do not write fNameWeightsFile 67 - do not write fWeightsSet 68 - do not write fRandomIter 31 69 32 70 -
trunk/MagicSoft/Mars/callisto.cc
r5564 r5570 414 414 job2.SetOverwrite(kOverwrite); 415 415 job2.SetPathData(kInpathD); 416 job1.SetPathIn(kInpathY); 416 417 // job1.SetPathOut(kOutpathC); // not yet needed 417 418 // job1.SetPathIn(kInpathC); // not yet needed … … 434 435 return 1; 435 436 } 436 /* 437 437 438 // 438 439 // Extract signal and calibrate it 439 440 // 440 MJCalibrateSignal job 2(Form("MJCalibrateSignal #%d", seq.GetSequence()));441 job 2.SetSequence(seq);442 job 2.SetDisplay(d);;443 job 2.SetEnv(kConfig);444 job 2.SetEnvDebug(kDebugEnv);445 job 2.SetOverwrite(kOverwrite);446 job 2.SetPathIn(kInpathY);447 job 2.SetPathOut(kOutpathY);448 job 2.SetPathData(kInpathD);441 MJCalibrateSignal job3(Form("MJCalibrateSignal #%d", seq.GetSequence())); 442 job3.SetSequence(seq); 443 job3.SetDisplay(d);; 444 job3.SetEnv(kConfig); 445 job3.SetEnvDebug(kDebugEnv); 446 job3.SetOverwrite(kOverwrite); 447 job3.SetPathIn(kInpathY); 448 job3.SetPathOut(kOutpathY); 449 job3.SetPathData(kInpathD); 449 450 450 451 // Where to search for calibration files 451 if (!job 2.ProcessFile(job1.GetPedestalCam()))452 return -1; 453 454 if (!job 2.GetDisplay())455 { 456 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 457 return 1; 458 } */452 if (!job3.ProcessFile(job1.GetPedestalCam(), job2.GetPedestalCam())) 453 return -1; 454 455 if (!job3.GetDisplay()) 456 { 457 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 458 return 1; 459 } 459 460 } 460 461 -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r5196 r5570 66 66 // SetPedestalFlag(MCalibrateData::kEvent) (calibration is done for each event) 67 67 // 68 // By calling SetNamePed ADCContainer() and/or SetNamePedPhotContainer() you68 // By calling SetNamePedestalCam() and/or SetNamePedPhotCam() you 69 69 // can control the name of the MPedestalCam and/or MPedPhotCam container which is used. 70 70 // … … 76 76 // MCalibrateData cal2; 77 77 // cal2.SetCalibrationMode(MCalibrateData::kSkip); 78 // cal2.SetNamePed ADCContainer("MPedestalFromLoGain");79 // cal2.SetNamePedPhotC ontainer("MPedPhotFromLoGain")78 // cal2.SetNamePedestalCam("MPedestalFromLoGain"); 79 // cal2.SetNamePedPhotCam("MPedPhotFromLoGain") 80 80 // cal2.SetPedestalFlag(MCalibrateData::kEvent); 81 81 // … … 133 133 using namespace std; 134 134 135 const TString MCalibrateData::fgNamePedADCContainer = "MPedestalCam"; 136 const TString MCalibrateData::fgNamePedPhotContainer = "MPedPhotCam"; 135 const TString MCalibrateData::fgNamePedestalCam = "MPedestalCam"; 136 const TString MCalibrateData::fgNamePedPhotCam = "MPedPhotCam"; 137 137 138 // -------------------------------------------------------------------------- 138 139 // … … 143 144 // Initializes: 144 145 // - fCalibrationMode to kDefault 145 // - fPedestalFlag to k Run146 // - fPedestalFlag to kNo 146 147 // - fNamePedADCRunContainer to "MPedestalCam" 147 148 // - fNamePedPhotRunContainer to "MPedPhotCam" 148 149 // 149 150 MCalibrateData::MCalibrateData(CalibrationMode_t calmode,const char *name, const char *title) 150 : fGeomCam(NULL), fPedestal (NULL),151 : fGeomCam(NULL), fPedestalMean(NULL), fPedestalRms(NULL), 151 152 fBadPixels(NULL), fCalibrations(NULL), fQEs(NULL), fSignals(NULL), 152 153 fPedPhot(NULL), fCerPhotEvt(NULL), fPedestalFlag(kNo) … … 158 159 SetCalibrationMode(calmode); 159 160 160 SetNamePed ADCContainer();161 SetNamePedPhotC ontainer();161 SetNamePedestalCam(); 162 SetNamePedPhotCam(); 162 163 } 163 164 … … 225 226 } 226 227 227 fPedestal = 0; 228 //fPedestalMean = 0; 229 //fPedestalRms = 0; 228 230 fPedPhot = 0; 229 231 if (fPedestalFlag) 230 232 { 231 fPedestal = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedADCContainer), "MPedestalCam"); 232 if (!fPedestal) 233 { 234 *fLog << err << AddSerialNumber(fNamePedADCContainer) << " [MPedestalCam] not found ... aborting" << endl; 235 return kFALSE; 236 } 237 238 fPedPhot = (MPedPhotCam*)pList->FindCreateObj("MPedPhotCam", AddSerialNumber(fNamePedPhotContainer)); 233 if (!fPedestalMean) 234 { 235 fPedestalMean = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedestalCam), "MPedestalCam"); 236 if (!fPedestalMean) 237 { 238 *fLog << err << AddSerialNumber(fNamePedestalCam) << " [MPedestalCam] not found ... aborting" << endl; 239 return kFALSE; 240 } 241 } 242 243 if (!fPedestalRms) 244 { 245 fPedestalRms = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedestalCam), "MPedestalCam"); 246 if (!fPedestalRms) 247 { 248 *fLog << err << AddSerialNumber(fNamePedestalCam) << " [MPedestalCam] not found ... aborting" << endl; 249 return kFALSE; 250 } 251 } 252 253 fPedPhot = (MPedPhotCam*)pList->FindCreateObj("MPedPhotCam", AddSerialNumber(fNamePedPhotCam)); 239 254 if (!fPedPhot) 240 255 return kFALSE; … … 266 281 267 282 // Sizes might have changed 268 if (fPedestalFlag && (Int_t)fPedestal->GetSize() != fSignals->GetSize()) 269 { 270 *fLog << err << "Size mismatch of MPedestalCam and MCalibrationCam... abort." << endl; 283 if (fPedestalFlag && (Int_t)fPedestalMean->GetSize() != fSignals->GetSize()) 284 { 285 *fLog << err << "Size mismatch of MPedestalCam for Mean and MCalibrationCam... abort." << endl; 286 return kFALSE; 287 } 288 289 if (fPedestalFlag && (Int_t)fPedestalRms->GetSize() != fSignals->GetSize()) 290 { 291 *fLog << err << "Size mismatch of MPedestalCam for RMS and MCalibrationCam... abort." << endl; 271 292 return kFALSE; 272 293 } … … 499 520 cpix->SetPixelSaturated(); 500 521 } 522 501 523 if (pedestal) 502 524 { 503 const MPedestalPix &ped = (*fPedestal)[pixidx];504 505 525 // pedestals/(used FADC slices) in [ADC] counts 506 const Float_t pedes = ped.GetPedestal()* slices;507 const Float_t pedrms = ped.GetPedestalRms() * sqrtslices;526 const Float_t pedes = (*fPedestalMean)[pixidx].GetPedestal() * slices; 527 const Float_t pedrms = (*fPedestalRms)[pixidx].GetPedestalRms() * sqrtslices; 508 528 509 529 // … … 590 610 } 591 611 592 if (fNamePed ADCContainer != fgNamePedADCContainer)593 { 594 out << " " << GetUniqueName() << ".SetNamePed ADCContainer(";595 out << fNamePed ADCContainer.Data()<< ");" << endl;596 } 597 598 if (fNamePedPhotC ontainer != fgNamePedPhotContainer)599 { 600 out << " " << GetUniqueName() << ".SetNamePedPhotC ontainer(";601 out << fNamePedPhotC ontainer.Data()<< ");" << endl;612 if (fNamePedestalCam != fgNamePedestalCam) 613 { 614 out << " " << GetUniqueName() << ".SetNamePedestalCam("; 615 out << fNamePedestalCam << ");" << endl; 616 } 617 618 if (fNamePedPhotCam != fgNamePedPhotCam) 619 { 620 out << " " << GetUniqueName() << ".SetNamePedPhotCam("; 621 out << fNamePedPhotCam << ");" << endl; 602 622 } 603 623 } -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
r5030 r5570 34 34 { 35 35 private: 36 static const TString fgNamePed ADCContainer; //! "MPedestalCam"37 static const TString fgNamePedPhotC ontainer;//! "MPedPhotCam"36 static const TString fgNamePedestalCam; //! "MPedestalCam" 37 static const TString fgNamePedPhotCam; //! "MPedPhotCam" 38 38 39 39 MGeomCam *fGeomCam; //! Camera geometry container 40 MPedestalCam *fPedestal; //! Pedestals/slice [ADC counts] 40 MPedestalCam *fPedestalMean; //! Pedestals/slice [ADC counts] 41 MPedestalCam *fPedestalRms; //! Pedestals/slice [ADC counts] 41 42 MBadPixelsCam *fBadPixels; //! Bad Pixels information 42 43 MCalibrationChargeCam *fCalibrations; //! Calibration constants … … 50 51 Byte_t fPedestalFlag; // Flags defining to calibrate the pedestal each event or each run 51 52 52 TString fNamePed ADCContainer; // name of fPedestal53 TString fNamePedPhotC ontainer; // name of fPedPhot53 TString fNamePedestalCam; // name of fPedestal 54 TString fNamePedPhotCam; // name of fPedPhot 54 55 55 56 Int_t Calibrate(Bool_t data, Bool_t pedestal) const; … … 95 96 void SetCalibrationMode ( CalibrationMode_t calmode=kDefault ) { fCalibrationMode=calmode; } 96 97 97 void SetNamePed ADCContainer(const char *name=fgNamePedADCContainer.Data())98 void SetNamePedestalCam(const char *name=fgNamePedestalCam.Data()) 98 99 { 99 fNamePed ADCContainer= name;100 fNamePedestalCam = name; 100 101 } 101 void SetNamePedPhotContainer(const char *name=fgNamePedPhotContainer.Data()) 102 void SetPedestalCamMean(MPedestalCam *cam) { fPedestalMean = cam; } 103 void SetPedestalCamRms(MPedestalCam *cam) { fPedestalRms = cam; } 104 105 void SetNamePedPhotCam(const char *name=fgNamePedPhotCam.Data()) 102 106 { 103 fNamePedPhotC ontainer= name;107 fNamePedPhotCam = name; 104 108 } 105 109 -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r5562 r5570 180 180 } 181 181 182 Bool_t MJCalibrateSignal::ProcessFile(MPedestalCam &pedcam )182 Bool_t MJCalibrateSignal::ProcessFile(MPedestalCam &pedcamab, MPedestalCam &pedcam) 183 183 { 184 184 if (!fSequence.IsValid()) … … 269 269 *fLog << inf << "No Camera geometry found using default <MGeomCamMagic>" << endl; 270 270 271 //272 // Switch off noise calculation273 //274 if (extractor1)275 extractor1->SetNoiseCalculation(kFALSE);276 if (extractor2)277 extractor2->SetNoiseCalculation(kFALSE);278 279 271 // This is necessary for the case in which it is not in the files 280 272 MBadPixelsCam badcam; … … 328 320 MBadPixelsMerge merge(&badpix); 329 321 330 MPedCalcFromLoGain pedlo; 331 pedlo.SetPedestalUpdate(kTRUE); 322 MPedCalcFromLoGain pedlo1("MPedCalcFromLoGainAB"); 323 pedlo1.SetPedestalUpdate(kTRUE); 324 pedlo1.SetPedestalsOut(&pedcamab); 325 326 MPedCalcFromLoGain pedlo2; 327 pedlo2.SetPedestalUpdate(kTRUE); 328 pedlo2.SetPedestalsIn(&pedcamab); 332 329 333 330 if (extractor1) … … 335 332 // FIXME: How to get the fixed value 15 automatically? 336 333 const Float_t win = extractor1->GetNumHiGainSamples(); 337 pedlo.SetExtractWindow(15, (UShort_t)TMath::Nint(win)); 334 pedlo1.SetExtractWindow(15, (UShort_t)TMath::Nint(win)); 335 pedlo2.SetExtractWindow(15, (UShort_t)TMath::Nint(win)); 336 337 if (extractor1->InheritsFrom("MExtractTimeAndCharge")) 338 pedlo2.SetExtractor((MExtractTimeAndCharge*)extractor1); 338 339 } 339 340 … … 345 346 MCalibrateData calib; 346 347 if (filetype==3) 348 { 347 349 calib.SetCalibrationMode(MCalibrateData::kFfactor); 350 calib.SetPedestalFlag(MCalibrateData::kRun); 351 } 352 else 353 { 354 calib.SetPedestalCamMean(&pedcamab); 355 calib.SetPedestalFlag(MCalibrateData::kEvent); 356 } 357 348 358 MCalibrateRelTimes caltm; 349 359 MBadPixelsCalc bpcal; 350 360 MBadPixelsTreat treat; 351 361 352 MHCamEvent evt0(0, "PedestalFLG", "Pedestal from Lo Gain;;P [fadc/sl]"); 353 MHCamEvent evt1(0, "Extra'd", "Extracted Signal;;S [fadc/sl]"); 354 MHCamEvent evt2(0, "PedPhot", "Calibrated Pedestal;;P [\\gamma]"); 355 MHCamEvent evt3(1, "PedRMS", "Calibrated Pedestal RMS;;\\sigma_{p} [\\gamma]"); 356 MHCamEvent evt4(0, "Interp'd", "Interpolated Signal;;S [\\gamma]"); 357 MHCamEvent evt5(2, "Unsuitable", "Unsuitable event ratio;;%"); 358 MHCamEvent evt6(0, "Times", "Arrival Time;;T [slice]"); 362 MHCamEvent evt0(0, "PedFLG", "Pedestal from Lo Gain;;P [fadc/sl]"); 363 MHCamEvent evt1(2, "PedRmsFLG", "Pedestal RMS from Lo Gain;;\\sigma_{p} [fadc/sl]"); 364 MHCamEvent evt2(0, "Extra'd", "Extracted Signal;;S [fadc/sl]"); 365 MHCamEvent evt3(0, "PedPhot", "Calibrated Pedestal;;P [\\gamma]"); 366 MHCamEvent evt4(1, "PedRMS", "Calibrated Pedestal RMS;;\\sigma_{p} [\\gamma]"); 367 MHCamEvent evt5(0, "Interp'd", "Interpolated Signal;;S [\\gamma]"); 368 MHCamEvent evt6(2, "Unsuitable", "Unsuitable event ratio;;%"); 369 MHCamEvent evt7(0, "Times", "Arrival Time;;T [slice]"); 359 370 evt0.EnableVariance(); 360 371 evt1.EnableVariance(); … … 362 373 evt3.EnableVariance(); 363 374 evt4.EnableVariance(); 364 evt6.EnableVariance(); 365 366 MFillH fill0(&evt0, "MPedestalCam", "FillPedestalFLG"); 367 MFillH fill1(&evt1, "MExtractedSignalCam", "FillExtracted"); 368 MFillH fill2(&evt2, "MPedPhotCam", "FillPedPhot"); 369 MFillH fill3(&evt3, "MPedPhotCam", "FillPedRMS"); 370 MFillH fill4(&evt4, "MCerPhotEvt", "FillInterpolated"); 371 MFillH fill5(&evt5, "MBadPixelsCam", "FillUnsuitable"); 372 MFillH fill6(&evt6, "MArrivalTime", "FillTimes"); 375 evt5.EnableVariance(); 376 evt7.EnableVariance(); 377 378 MFillH fill0(&evt0, &pedcamab, "FillPedFLG"); 379 MFillH fill1(&evt1, "MPedestalCam", "FillPedRmsFLG"); 380 MFillH fill2(&evt2, "MExtractedSignalCam", "FillExtracted"); 381 MFillH fill3(&evt3, "MPedPhotCam", "FillPedPhot"); 382 MFillH fill4(&evt4, "MPedPhotCam", "FillPedRMS"); 383 MFillH fill5(&evt5, "MCerPhotEvt", "FillInterpolated"); 384 MFillH fill6(&evt6, "MBadPixelsCam", "FillUnsuitable"); 385 MFillH fill7(&evt7, "MArrivalTime", "FillTimes"); 373 386 374 387 MWriteRootFile write(2, Form("%s{s/_D_/_Y_}", fPathOut.Data()), fOverwrite); … … 418 431 tlist2.AddToList(&apply); 419 432 tlist2.AddToList(&merge); 420 tlist2.AddToList(filetype==3 ? (MTask*)&pcopy : (MTask*)&pedlo); 433 if (filetype==3) 434 tlist2.AddToList(&pcopy); 435 else 436 { 437 tlist2.AddToList(&pedlo1); 438 tlist2.AddToList(&pedlo2); 439 } 421 440 tlist2.AddToList(&fill0); 441 tlist2.AddToList(&fill1); 422 442 if (extractor1) 423 443 tlist2.AddToList(&taskenv1); 424 444 if (extractor2) 425 445 tlist2.AddToList(&taskenv2); 426 tlist2.AddToList(&fill 1);446 tlist2.AddToList(&fill2); 427 447 tlist2.AddToList(&calib); 428 448 tlist2.AddToList(&caltm); 429 tlist2.AddToList(&fill 2);449 tlist2.AddToList(&fill3); 430 450 tlist2.AddToList(&bpcal); 431 451 tlist2.AddToList(&treat); 432 tlist2.AddToList(&fill3);433 452 tlist2.AddToList(&fill4); 434 453 tlist2.AddToList(&fill5); 435 454 tlist2.AddToList(&fill6); 455 tlist2.AddToList(&fill7); 436 456 437 457 // Setup List for Drive-tree -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h
r5562 r5570 34 34 MJCalibrateSignal(const char *name=NULL, const char *title=NULL); 35 35 36 Bool_t ProcessFile(MPedestalCam &cam );36 Bool_t ProcessFile(MPedestalCam &camab, MPedestalCam &cam); 37 37 38 38 ClassDef(MJCalibrateSignal, 0) // Tool to create a pedestal file (MPedestalCam) -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r5562 r5570 213 213 SetUsePINDiode(); 214 214 215 SetRelTimeCalibration( kFALSE);216 SetDataCheck ( kFALSE);217 SetDebug ( kFALSE);218 SetIntensity ( kFALSE);219 220 SetNoStorage ( kFALSE);221 SetHistsStorage ( kFALSE);215 SetRelTimeCalibration(); 216 SetDataCheck(kFALSE); 217 SetDebug(kFALSE); 218 SetIntensity(kFALSE); 219 220 SetNoStorage(kFALSE); 221 SetHistsStorage(kFALSE); 222 222 } 223 223 … … 1685 1685 1686 1686 // 1687 // Switch off noise calculation1688 //1689 fExtractor->SetNoiseCalculation(kFALSE);1690 fTimeExtractor->SetNoiseCalculation(kFALSE);1691 1692 //1693 1687 // Setup more tasks and tasklist 1694 1688 // … … 1718 1712 1719 1713 if (IsRelTimes()) 1720 tlist.AddToList(&taskenv2);1714 tlist.AddToList(&taskenv2); 1721 1715 } 1722 1716 … … 1766 1760 1767 1761 if (!WriteTasks(taskenv.GetTask(), taskenv2.GetTask())) 1768 return kFALSE;1762 return kFALSE; 1769 1763 1770 1764 // Execute first analysis … … 1908 1902 Bool_t MJCalibration::WriteTasks(MTask *t1, MTask *t2) const 1909 1903 { 1910 1911 if (IsNoStorage()) 1904 if (IsNoStorage()) 1905 return kTRUE; 1906 1907 if (fPathOut.IsNull()) 1908 return kTRUE; 1909 1910 const TString oname(GetOutputFile()); 1911 1912 *fLog << inf << "Writing to file: " << oname << endl; 1913 1914 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9); 1915 if (!file.IsOpen()) 1916 { 1917 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; 1918 return kFALSE; 1919 } 1920 1921 if (t1) 1922 { 1923 *fLog << inf << " - Writing Task " << t1->GetName() << " [" << t1->ClassName() << "]..." << flush; 1924 if (t1->Write()<=0) 1925 { 1926 *fLog << err << "Unable to write " << t1->GetName() << " to " << oname << endl; 1927 return kFALSE; 1928 } 1929 *fLog << "ok." << endl; 1930 } 1931 1932 if (t2) 1933 { 1934 *fLog << inf << " - Writing Task " << t2->GetName() << " [" << t2->ClassName() << "]..." << flush; 1935 if (t2->Write()<=0) 1936 { 1937 *fLog << err << "Unable to write " << t2->GetName() << " to " << oname << endl; 1938 return kFALSE; 1939 } 1940 *fLog << "ok." << endl; 1941 } 1942 1912 1943 return kTRUE; 1913 1914 if (fPathOut.IsNull())1915 return kTRUE;1916 1917 const TString oname(GetOutputFile());1918 1919 *fLog << inf << "Writing to file: " << oname << endl;1920 1921 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCalibration", 9);1922 if (!file.IsOpen())1923 {1924 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;1925 return kFALSE;1926 }1927 1928 if (t1 && t1->Write()<=0)1929 {1930 *fLog << err << "Unable to write " << t1->GetName() << " to " << oname << endl;1931 return kFALSE;1932 }1933 1934 if (t2 && t2->Write()<=0)1935 {1936 *fLog << err << "Unable to write " << t2->GetName() << " to " << oname << endl;1937 return kFALSE;1938 }1939 1940 return kTRUE;1941 1944 } 1942 1945 -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r5557 r5570 151 151 Bool_t MJPedestal::ReadPedestalCam() 152 152 { 153 if (IsNoStorage())154 return kFALSE;155 156 153 const TString fname = GetOutputFile(); 157 154 158 if (gSystem->AccessPathName(fname, kFileExists)) 159 { 160 *fLog << warn << "Input file " << fname << " doesn't exist, will create it." << endl; 161 return kFALSE; 162 } 163 164 *fLog << inf << "Reading from file: " << fname << endl; 155 *fLog << inf << "Reading pedestals from file: " << fname << endl; 165 156 166 157 TFile file(fname, "READ"); … … 198 189 const TString fname = Form("%s/calib%06d.root",fPathIn.Data(), fSequence.GetSequence()); 199 190 200 *fLog << inf << "Reading from file: " << fname << endl;191 *fLog << inf << "Reading extractor from file: " << fname << endl; 201 192 202 193 TFile file(fname, "READ"); … … 213 204 return NULL; 214 205 } 215 return o ? (MExtractor*)o->Clone() : NULL; 206 207 return o ? (MExtractor*)o->Clone("ExtractSignal") : NULL; 216 208 } 217 209 … … 684 676 if (fExtractor) 685 677 delete fExtractor; 686 fExtractor = ext ? (MExtractor*)ext->Clone( ) : NULL;678 fExtractor = ext ? (MExtractor*)ext->Clone(ext->GetName()) : NULL; 687 679 } 688 680 … … 721 713 SetNoStorage(GetEnv("DisableOutput", IsNoStorage())); 722 714 723 MTaskEnv tenv ;715 MTaskEnv tenv("ExtractSignal"); 724 716 tenv.SetDefault(fExtractor); 725 717 … … 737 729 738 730 SetExtractor((MExtractor*)tenv.GetTask()); 731 739 732 return kTRUE; 740 733 } … … 816 809 } 817 810 818 //if (!CheckEnv()) 819 // return kFALSE; 820 821 CheckEnv(); 811 if (!CheckEnv()) 812 return kFALSE; 822 813 823 814 // -------------------------------------------------------------------------------- … … 944 935 } 945 936 937 /* 946 938 if (!fPathIn.IsNull()) 947 939 { … … 949 941 fExtractor = 0; 950 942 } 951 952 // 953 // Check that the extractor has the bit Noise Calculation() set which 954 // means that the each "sliding" of the sliding window is not applied 955 // 956 if (fExtractor) 957 fExtractor->SetNoiseCalculation(fExtractorResolution); 958 943 */ 959 944 // 960 945 // Execute the eventloop -
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
r5558 r5570 250 250 fRunHeader = NULL; 251 251 fEvtHeader = NULL; 252 fPedestalsOut = NULL;253 252 254 253 // If the size is yet set, set the size … … 344 343 if (fExtractor && !fPedestalsIn) 345 344 { 346 fPedestalsIn = (MPedestalCam*)pList->FindObject( "MPedestalCam", AddSerialNumber(fNamePedestalCamIn));345 fPedestalsIn = (MPedestalCam*)pList->FindObject(AddSerialNumber(fNamePedestalCamIn), "MPedestalCam"); 347 346 if (!fPedestalsIn) 348 347 { … … 352 351 } 353 352 354 fPedestalsOut = (MPedestalCam*)pList->FindCreateObj("MPedestalCam", AddSerialNumber(fNamePedestalCamOut));355 353 if (!fPedestalsOut) 356 return kFALSE; 354 { 355 fPedestalsOut = (MPedestalCam*)pList->FindCreateObj("MPedestalCam", AddSerialNumber(fNamePedestalCamOut)); 356 if (!fPedestalsOut) 357 return kFALSE; 358 } 357 359 358 360 *fLog << inf; … … 630 632 *fLog << "Name of input MPedestalCam: " << (fPedestalsIn?fPedestalsIn->GetName():fNamePedestalCamIn.Data()) << " (" << fPedestalsIn << ")" << endl; 631 633 *fLog << "Name of output MPedestalCam: " << (fPedestalsOut?fPedestalsOut->GetName():fNamePedestalCamOut.Data()) << " (" << fPedestalsOut << ")" << endl; 632 *fLog << "Num evts for pedestal calc: " << fNumEventsDump << endl;633 *fLog << "Num evts for avg.areas calc: " << fNumAreasDump << endl;634 *fLog << "Num evts for avg.sector calc: " << fNumSectorsDump << endl;635 634 *fLog << "Pedestal Update is " << (fPedestalUpdate?"on":"off") << endl; 636 *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << fExtractWinLast << " incl." << endl; 637 635 if (fPedestalUpdate) 636 { 637 *fLog << "Num evts for pedestal calc: " << fNumEventsDump << endl; 638 *fLog << "Num evts for avg.areas calc: " << fNumAreasDump << endl; 639 *fLog << "Num evts for avg.sector calc: " << fNumSectorsDump << endl; 640 } 638 641 if (fExtractor) 639 642 *fLog << "Extractor used: " << fExtractor->ClassName() << endl; 640 } 643 *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << fExtractWinLast << " incl." << endl; 644 } -
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.h
r5558 r5570 94 94 95 95 void SetPedestalsIn(MPedestalCam *pedcam) { fPedestalsIn = pedcam; } 96 void SetPedestalsOut(MPedestalCam *pedcam) { fPedestalsOut = pedcam; } 96 97 97 98 void SetExtractor(MExtractTimeAndCharge *e) { fExtractor = e; } -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
r5558 r5570 320 320 321 321 Float_t sum = 0.; 322 UInt_t sumi = 0;323 322 324 323 //extract pedestal … … 327 326 else 328 327 { 328 UInt_t sumi = 0; 329 329 for(Byte_t *slice=slices+fExtractWinFirst; slice<=slices+fExtractWinLast; slice++) 330 330 sumi += *slice; … … 422 422 423 423 Float_t dummy; 424 fExtractor->SetNoiseCalculation(kTRUE); 424 425 fExtractor->FindTimeAndChargeHiGain(logain,logain,sum,dummy,dummy,dummy,sat,ped,logainabflag); 425 } 426 426 fExtractor->SetNoiseCalculation(kFALSE); 427 } 427 428 428 429 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc
r5559 r5570 316 316 317 317 Float_t dummy; 318 fExtractor->SetNoiseCalculation(kTRUE); 318 319 fExtractor->FindTimeAndChargeHiGain(first,logain,sum,dummy,dummy,dummy,sat,ped,abflag); 320 fExtractor->SetNoiseCalculation(kFALSE); 319 321 } 320 322 -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndCharge.cc
r5558 r5570 245 245 void MExtractTimeAndCharge::Print(Option_t *o) const 246 246 { 247 if (IsA()== MExtractTimeAndCharge::Class())247 if (IsA()==Class()) 248 248 *fLog << GetDescriptor() << ":" << endl; 249 250 *fLog << dec << endl;251 *fLog << " Taking " << fNumHiGainSamples249 250 *fLog << dec; 251 *fLog << " Taking " << fNumHiGainSamples 252 252 << " HiGain samples from slice " << (Int_t)fHiGainFirst 253 253 << " to " << (Int_t)(fHiGainLast+fHiLoLast) << " incl" << endl; 254 *fLog << inf << "Taking " << fNumLoGainSamples254 *fLog << " Taking " << fNumLoGainSamples 255 255 << " LoGain samples from slice " << (Int_t)fLoGainFirst 256 256 << " to " << (Int_t)fLoGainLast << " incl" << endl; -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
r5558 r5570 234 234 const Float_t pedes = ped.GetPedestal(); 235 235 const Float_t ABoffs = ped.GetPedestalABoffset(); 236 236 237 237 Float_t pedmean[2]; 238 238 pedmean[0] = pedes + ABoffs; … … 260 260 sat++; 261 261 } 262 262 263 263 if (fHiLoLast != 0) 264 264 { … … 284 284 } 285 285 } 286 286 287 287 // 288 288 // allow one saturated slice … … 300 300 fRandomIter = 0; 301 301 for (Int_t ids=0; ids < fWindowSizeHiGain; ids++) 302 302 { 303 303 const Int_t idx = fBinningResolutionHiGain*ids + fRandomIter; 304 304 sum += fAmpWeightsHiGain [idx]*fHiGainSignal[ids]; … … 364 364 } 365 365 } 366 366 367 367 sum = 0.; 368 368 time_sum = 0.; … … 1012 1012 void MExtractTimeAndChargeDigitalFilter::Print(Option_t *o) const 1013 1013 { 1014 if (IsA()==Class()) 1015 *fLog << GetDescriptor() << ":" << endl; 1016 1014 1017 MExtractTimeAndCharge::Print(o); 1015 1018 *fLog << " Time Shift HiGain: " << fTimeShiftHiGain << " LoGain: " << fTimeShiftLoGain << endl; 1016 1019 *fLog << " Window Size HiGain: " << fWindowSizeHiGain << " LoGain: " << fWindowSizeLoGain << endl; 1017 1020 *fLog << " Binning Res HiGain: " << fBinningResolutionHiGain << " LoGain: " << fBinningResolutionHiGain << endl; 1018 *fLog << " Weights File: " << fNameWeightsFile .Data()<< endl;1021 *fLog << " Weights File: " << fNameWeightsFile << endl; 1019 1022 1020 1023 TString opt(o); -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h
r5529 r5570 48 48 MArrayF fTimeWeightsLoGain; //! Time weights Low-Gain (from weights file) 49 49 50 TString fNameWeightsFile; // Name of the weights file51 Bool_t fWeightsSet; // Flag if weights have alreayd been set52 UInt_t fRandomIter; // Counter used to randomize weights for noise calculation50 TString fNameWeightsFile; //! Name of the weights file 51 Bool_t fWeightsSet; //! Flag if weights have alreayd been set 52 UInt_t fRandomIter; //! Counter used to randomize weights for noise calculation 53 53 54 54 Bool_t InitArrays();
Note:
See TracChangeset
for help on using the changeset viewer.