Changeset 3903 for trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.cc
- Timestamp:
- 04/30/04 11:05:50 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.