Changeset 5570 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 12/08/04 18:02:12 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.