Changeset 3903 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 04/30/04 11:05:50 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc
r3819 r3903 66 66 #include "MParList.h" 67 67 68 #include "MRawRunHeader.h" 69 68 70 ClassImp(MHCalibrationCam); 69 71 … … 84 86 // - fAverageHiGainSectors, fAverageLoGainSectors 85 87 // 88 // Initializes to 0 entries: 89 // - fAverageAreaNum 90 // - fAverageAreaRelSigma 91 // - fAverageAreaRelSigmaVar 92 // - fAverageAreaSat 93 // - fAverageAreaSigma 94 // - fAverageAreaSigmaVar 95 // - fAverageSectorNum 96 // - fRunNumbers 97 // 86 98 // Initializes: 87 99 // - fPulserFrequency to fgPulserFrequency 88 100 // 89 101 MHCalibrationCam::MHCalibrationCam(const char *name, const char *title) 90 : fBadPixels(NULL), fCam(NULL), fGeom(NULL) 102 : fAverageAreaNum(0), 103 fAverageAreaRelSigma(0), 104 fAverageAreaRelSigmaVar(0), 105 fAverageAreaSat(0), 106 fAverageAreaSigma(0), 107 fAverageAreaSigmaVar(0), 108 fAverageSectorNum(0), 109 fRunNumbers(0), 110 fBadPixels(NULL), fCam(NULL), fGeom(NULL), fRunHeader(NULL) 91 111 { 92 112 fName = name ? name : "MHCalibrationCam"; … … 260 280 { 261 281 return *static_cast<MHGausEvents*>(fAverageLoGainSectors->UncheckedAt(i)); 282 } 283 284 285 const TArrayI &MHCalibrationCam::GetRunNumbers() const 286 { 287 return fRunNumbers; 262 288 } 263 289 … … 357 383 if (!fGeom) 358 384 { 359 *fLog << err << "MGeomCam not found... aborting." << endl; 385 *fLog << err << GetDescriptor() 386 << ": MGeomCam not found... aborting." << endl; 360 387 return kFALSE; 388 } 389 390 fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 391 if (!fRunHeader) 392 { 393 *fLog << warn << GetDescriptor() 394 << ": MRawRunHeader not found... will not store run numbers." << endl; 361 395 } 362 396 … … 410 444 // - MHCalibrationCam::fAverageHiGainSectors 411 445 // 446 // Retrieves the run numbers from MRawRunHeader and stores them in fRunNumbers 447 // 412 448 Bool_t MHCalibrationCam::ReInit(MParList *pList) 413 449 { … … 441 477 fAverageAreaRelSigmaVar.Set(nareas); 442 478 fAverageSectorNum. Set(nsectors); 479 fRunNumbers. Set(fRunNumbers.GetSize()+1); 443 480 444 481 for (Int_t aidx=0; aidx<nareas; aidx++) … … 457 494 fAverageSectorNum[(*fGeom)[i].GetSector()]++; 458 495 } 496 497 if (fRunHeader) 498 fRunNumbers[fRunNumbers.GetSize()-1] = fRunHeader->GetRunNumber(); 459 499 460 500 return ReInitHists(pList); … … 578 618 hist.ChangeHistId(i); 579 619 hist.SetEventFrequency(fPulserFrequency); 580 620 621 TH1F *h = hist.GetHGausHist(); 622 h->SetTitle( Form("%s%s", h->GetTitle()," Runs: ")); 581 623 } 582 624 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.cc
r3899 r3903 108 108 109 109 using namespace std; 110 111 const UInt_t MHCalibrationRelTimeCam::fgReferencePixel = 1; 110 112 // -------------------------------------------------------------------------- 111 113 // 112 // Default Constructor. 114 // Default Constructor. 115 // 116 // Sets: 117 // - fReferencePixel to fgReferencePixel 113 118 // 114 119 MHCalibrationRelTimeCam::MHCalibrationRelTimeCam(const char *name, const char *title) … … 117 122 fName = name ? name : "MHCalibrationRelTimeCam"; 118 123 fTitle = title ? title : "Histogram class for the relative time calibration of the camera"; 119 124 125 SetReferencePixel(); 120 126 } 121 127 … … 183 189 { 184 190 (*fHiGainArray)[i] = new MHCalibrationRelTimePix("MHCalibrationRelTimePixHiGain", 185 "Rel ative Arrival Time High Gain Pixel");191 "Rel. Arr. Time Hi-Gain Pixel "); 186 192 InitHists((*this)[i],(*fBadPixels)[i],i); 187 193 } 188 194 } 189 195 196 if (fRunHeader) 197 for (Int_t i=0; i<npixels; i++) 198 { 199 TH1F *h = (*this)[i].GetHGausHist(); 200 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 201 } 202 190 203 if (fLoGainArray->GetEntries()==0) 191 204 { … … 194 207 { 195 208 (*fLoGainArray)[i] = new MHCalibrationRelTimePix("MHCalibrationRelTimePixLoGain", 196 "Rel ative Arrival Time Low Gain Pixel");209 "Rel. Arr. Time Lo-Gain Pixel "); 197 210 InitHists((*this)(i),(*fBadPixels)[i],i); 198 211 } 199 212 } 213 214 if (fRunHeader) 215 for (Int_t i=0; i<npixels; i++) 216 { 217 TH1F *h = (*this)(i).GetHGausHist(); 218 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 219 } 200 220 201 221 if (fAverageHiGainAreas->GetEntries()==0) … … 207 227 (*fAverageHiGainAreas)[j] = 208 228 new MHCalibrationRelTimePix("MHCalibrationRelTimeAverageAreaHiGain", 209 "Average Rel ative Arrival Times HighGain Area Idx ");229 "Average Rel. Arr. Times Hi-Gain Area Idx "); 210 230 211 231 GetAverageHiGainArea(j).GetHGausHist()->SetTitle("Rel. Arr. Times HiGain Area Idx "); … … 216 236 } 217 237 238 if (fRunHeader) 239 for (Int_t j=0; j<nareas; j++) 240 { 241 TH1F *h = GetAverageHiGainArea(j).GetHGausHist(); 242 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 243 } 244 218 245 if (fAverageLoGainAreas->GetEntries()==0) 219 246 { … … 224 251 (*fAverageLoGainAreas)[j] = 225 252 new MHCalibrationRelTimePix("MHCalibrationRelTimeAverageAreaLoGain", 226 "Average Rel ative Arrival Times LowGain Area Idx ");253 "Average Rel. Arr. Times Lo-Gain Area Idx "); 227 254 228 255 GetAverageLoGainArea(j).GetHGausHist()->SetTitle("Rel. Arr. Times LoGain Area Idx "); … … 232 259 } 233 260 } 234 261 262 if (fRunHeader) 263 for (Int_t j=0; j<nareas; j++) 264 { 265 TH1F *h = GetAverageLoGainArea(j).GetHGausHist(); 266 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 267 } 268 235 269 if (fAverageHiGainSectors->GetEntries()==0) 236 {270 { 237 271 fAverageHiGainSectors->Expand(nsectors); 238 272 239 273 for (Int_t j=0; j<nsectors; j++) 240 {274 { 241 275 (*fAverageHiGainSectors)[j] = 242 276 new MHCalibrationRelTimePix("MHCalibrationRelTimeAverageSectorHiGain", 243 "Average Rel ative Arrival Times HighGain Sector ");244 277 "Average Rel. Arr. Times Hi-Gain Sector "); 278 245 279 GetAverageHiGainSector(j).GetHGausHist()->SetTitle("Rel. Arr. Times HiGain Sector "); 246 280 GetAverageHiGainSector(j).SetNbins(fAverageNbins); 247 281 248 282 InitHists(GetAverageHiGainSector(j),fCam->GetAverageBadSector(j),j); 249 283 } 250 284 } 285 286 if (fRunHeader) 287 for (Int_t j=0; j<nsectors; j++) 288 { 289 TH1F *h = GetAverageHiGainSector(j).GetHGausHist(); 290 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 291 } 251 292 252 293 if (fAverageLoGainSectors->GetEntries()==0) 253 {294 { 254 295 fAverageLoGainSectors->Expand(nsectors); 255 296 256 297 for (Int_t j=0; j<nsectors; j++) 257 {298 { 258 299 (*fAverageLoGainSectors)[j] = 259 300 new MHCalibrationRelTimePix("MHCalibrationRelTimeAverageSectorLoGain", 260 "Average Rel ative Arrival Times LowGain Sector ");261 301 "Average Rel. Arr. Times Lo-Gain Sector "); 302 262 303 GetAverageLoGainSector(j).GetHGausHist()->SetTitle("Rel. Arr. Times LoGain Sector "); 263 304 GetAverageLoGainSector(j).SetNbins(fAverageNbins); 264 305 265 306 InitHists(GetAverageLoGainSector(j),fCam->GetAverageBadSector(j),j); 266 307 267 } 268 } 269 308 } 309 } 310 311 if (fRunHeader) 312 for (Int_t j=0; j<nsectors; j++) 313 { 314 TH1F *h = GetAverageLoGainSector(j).GetHGausHist(); 315 h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," ")); 316 } 317 270 318 return kTRUE; 271 319 } … … 309 357 memset(sumsectorhi, 0, nsectors*sizeof(Float_t)); 310 358 memset(sumsectorlo, 0, nsectors*sizeof(Float_t)); 311 312 const MArrivalTimePix &refpix = (*arrtime)[1]; 359 memset(numareahi, 0, nareas * sizeof(Float_t)); 360 memset(numarealo, 0, nareas * sizeof(Float_t)); 361 memset(numsectorhi, 0, nsectors*sizeof(Float_t)); 362 memset(numsectorlo, 0, nsectors*sizeof(Float_t)); 363 364 const MArrivalTimePix &refpix = (*arrtime)[fReferencePixel]; 313 365 const Float_t reftime = refpix.IsLoGainUsed() 314 366 ? refpix.GetArrivalTimeLoGain() : refpix.GetArrivalTimeHiGain(); … … 324 376 325 377 const MArrivalTimePix &pix = (*arrtime)[i]; 326 const Float_t time = pix.IsLoGainUsed()327 ? pix.GetArrivalTimeLoGain() : pix.GetArrivalTimeHiGain();328 const Float_t reltime = time - reftime;329 330 378 const Int_t aidx = (*fGeom)[i].GetAidx(); 331 379 const Int_t sector = (*fGeom)[i].GetSector(); … … 333 381 if (pix.IsLoGainUsed()) 334 382 { 335 383 const Float_t reltime = pix.GetArrivalTimeLoGain() - reftime; 336 384 histlo.FillHistAndArray(reltime); 337 385 sumarealo [aidx] += reltime; … … 342 390 else 343 391 { 344 392 const Float_t reltime = pix.GetArrivalTimeHiGain() - reftime; 345 393 histhi.FillHistAndArray(reltime) ; 346 394 sumareahi [aidx] += reltime; -
trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.h
r3639 r3903 12 12 private: 13 13 14 static const UInt_t fgReferencePixel; // Default for fReferencePixel (now set to: 1) 15 UInt_t fReferencePixel; // The reference pixel for rel. times 16 14 17 Bool_t ReInitHists(MParList *pList); 15 18 Bool_t FillHists(const MParContainer *par, const Stat_t w=1); … … 22 25 ~MHCalibrationRelTimeCam() {} 23 26 27 UInt_t GetReferencePixel() const { return fReferencePixel; } 28 void SetReferencePixel(const UInt_t i=fgReferencePixel) { fReferencePixel = i; } 29 30 24 31 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 25 32 void DrawPixelContent(Int_t idx) const;
Note:
See TracChangeset
for help on using the changeset viewer.