- Timestamp:
- 09/15/04 22:12:28 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r5032 r5046 265 265 // 266 266 MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title) 267 : 268 fGeom(NULL), fSignal(NULL), fHeader(NULL) 267 : fGeom(NULL), fSignal(NULL), fHeader(NULL) 269 268 { 270 269 … … 340 339 // 341 340 // The following container are searched for and execution aborted if not in MParList: 341 // - MRawEvtHeader 342 342 // - MPedestalCam 343 // 344 // The following containers are searched and created if they were not found: 345 // 346 // - MCalibrationQECam 347 // - MBadPixelsCam 343 // - MExtractedSignalCam 348 344 // 349 345 Int_t MCalibrationChargeCalc::PreProcess(MParList *pList) … … 374 370 } 375 371 376 fHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");377 if (!fHeader)378 {379 *fLog << err << "MRawEvtHeader not found... abort." << endl;380 return kFALSE;381 }382 383 372 384 373 return kTRUE; … … 390 379 // Search for the following input containers and abort if not existing: 391 380 // - MGeomCam 392 // - MCalibrationChargeCam 381 // - MCalibrationIntensityChargeCam or MCalibrationChargeCam 382 // - MCalibrationIntensityQECam or MCalibrationQECam 383 // - MBadPixelsIntensityCam or MBadPixelsCam 393 384 // 394 385 // Search for the following input containers and give a warning if not existing: -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityBlindCam.cc
r5020 r5046 41 41 #include "MCalibrationBlindCam.h" 42 42 43 #include <TO bjArray.h>43 #include <TOrdCollection.h> 44 44 45 45 ClassImp(MCalibrationIntensityBlindCam); … … 60 60 } 61 61 62 // ------------------------------------------------------------------- 63 // 64 // Add MCalibrationBlindCam's in the ranges from - to. 65 // 66 void MCalibrationIntensityBlindCam::Add(const UInt_t from, const UInt_t to) 67 { 68 for (UInt_t i=from; i<to; i++) 69 fCams->AddAt(new MCalibrationBlindCam,i); 70 } 71 62 72 // -------------------------------------------------------------------------- 63 73 // 64 // Calls TO bjArray::Expand() for fCams and initialze one MCalibrationBlindCam74 // Calls TOrdCollection::Expand() for fCams and initialze one MCalibrationBlindCam 65 75 // and copy the entries 66 76 // … … 74 84 75 85 MCalibrationIntensityCam::InitSize(n); 76 (*fCams)[n-1] = new MCalibrationBlindCam;77 86 78 87 MCalibrationBlindCam *newcam = (MCalibrationBlindCam*)GetCam(); -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityBlindCam.h
r5019 r5046 12 12 class MCalibrationIntensityBlindCam : public MCalibrationIntensityCam 13 13 { 14 private: 15 16 void Add(const UInt_t from, const UInt_t tox); 17 14 18 public: 15 19 -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc
r5043 r5046 28 28 // Base class for intensity calibration results 29 29 // 30 // Contains TO bjArrays for the following objects:30 // Contains TOrdCollections for the following objects: 31 31 // - fCams: Array of classes derived from MCalibrationCam, one entry 32 32 // per calibration camera result. Has to be created … … 43 43 #include "MCalibrationIntensityCam.h" 44 44 45 #include <TO bjArray.h>45 #include <TOrdCollection.h> 46 46 47 47 #include "MGeomCam.h" … … 64 64 fTitle = title ? title : "Base container for the Intensity Calibration"; 65 65 66 fCams = new TO bjArray;66 fCams = new TOrdCollection; 67 67 fCams->SetOwner(); 68 68 … … 188 188 // ------------------------------------------------------------------- 189 189 // 190 // Calls TObjArray::Expand() for fCams 191 // 192 void MCalibrationIntensityCam::InitSize(const UInt_t n) 193 { 194 fCams->Expand(n); 190 // Initialize the objects inside the TOrdCollection using the 191 // virtual function Add(). 192 // 193 // InitSize can only increase the size, but not shrink. 194 // 195 // It can be called more than one time. New Containers are 196 // added only from the current size to the argument i. 197 // 198 void MCalibrationIntensityCam::InitSize(const UInt_t i) 199 { 200 201 const UInt_t save = GetSize(); 202 203 if (i==save) 204 return; 205 206 if (i>save) 207 Add(save,i); 208 } 209 210 // ------------------------------------------------------------------- 211 // 212 // Add MCalibrationCams in the ranges from - to. In order to initialize 213 // from MCalibrationCam derived containers, overwrite this function 214 // 215 void MCalibrationIntensityCam::Add(const UInt_t from, const UInt_t to) 216 { 217 for (UInt_t i=from; i<to; i++) 218 fCams->AddAt(new MCalibrationCam,i); 195 219 } 196 220 … … 211 235 // -------------------------------------------------------------------------- 212 236 // 213 // Returns the current size of the TO bjArrayfCams237 // Returns the current size of the TOrdCollection fCams 214 238 // independently if the MCalibrationCam is filled with values or not. 215 239 // 216 240 const Int_t MCalibrationIntensityCam::GetSize() const 217 241 { 218 return fCams->Get EntriesFast();242 return fCams->GetSize(); 219 243 } 220 244 … … 240 264 // -------------------------------------------------------------------------- 241 265 // 242 // Returns the current size of the TO bjArrayfAverageAreas of the current camera.266 // Returns the current size of the TOrdCollection fAverageAreas of the current camera. 243 267 // 244 268 const Int_t MCalibrationIntensityCam::GetAverageAreas() const … … 285 309 // -------------------------------------------------------------------------- 286 310 // 287 // Returns the current size of the TO bjArrayfAverageSectors or the current camera311 // Returns the current size of the TOrdCollection fAverageSectors or the current camera 288 312 // 289 313 const Int_t MCalibrationIntensityCam::GetAverageSectors() const -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.h
r5015 r5046 18 18 #endif 19 19 20 class TO bjArray;20 class TOrdCollection; 21 21 class MCalibrationPix; 22 22 class MBadPixelsPix; … … 31 31 protected: 32 32 33 TO bjArray*fCams; // Array of MCalibrationCams, one per pulse colour and intensity33 TOrdCollection *fCams; // Array of MCalibrationCams, one per pulse colour and intensity 34 34 35 virtual void Add(const UInt_t from, const UInt_t to); 35 36 virtual void InitSize( const UInt_t n ); 36 37 -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc
r5020 r5046 35 35 // See also: MCalibrationIntensityCam, MCalibrationChargeCam, 36 36 // MCalibrationChargePix, MCalibrationChargeCalc, MCalibrationQECam 37 // MCalibrationBlindCam, MCalibrationChargePINDiode 37 38 // MHCalibrationChargePix, MHCalibrationChargeCam 38 // MCalibrationChargeBlindPix, MCalibrationChargePINDiode39 39 // 40 40 ///////////////////////////////////////////////////////////////////////////// … … 42 42 #include "MCalibrationChargeCam.h" 43 43 44 #include <TO bjArray.h>44 #include <TOrdCollection.h> 45 45 46 46 ClassImp(MCalibrationIntensityChargeCam); … … 51 51 // 52 52 // Default constructor. 53 // 53 // 54 54 MCalibrationIntensityChargeCam::MCalibrationIntensityChargeCam(const char *name, const char *title) 55 55 { … … 57 57 fName = name ? name : "MCalibrationIntensityChargeCam"; 58 58 fTitle = title ? title : "Results of the Intensity Calibration"; 59 59 60 60 InitSize(1); 61 61 } 62 62 63 // ------------------------------------------------------------------- -------63 // ------------------------------------------------------------------- 64 64 // 65 // Calls TObjArray::Expand() for fCams and initialze one CalibrationChargeCam65 // Add MCalibrationChargeCam's in the ranges from - to. 66 66 // 67 void MCalibrationIntensityChargeCam:: InitSize(const UInt_t n)67 void MCalibrationIntensityChargeCam::Add(const UInt_t from, const UInt_t to) 68 68 { 69 MCalibrationIntensityCam::InitSize(n);70 (*fCams)[n-1] = new MCalibrationChargeCam;69 for (UInt_t i=from; i<to; i++) 70 fCams->AddAt(new MCalibrationChargeCam,i); 71 71 } 72 72 -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.h
r5015 r5046 12 12 class MCalibrationIntensityChargeCam : public MCalibrationIntensityCam 13 13 { 14 private: 15 16 void Add(const UInt_t a, const UInt_t b); 17 14 18 public: 15 19 16 20 MCalibrationIntensityChargeCam(const char *name=NULL, const char *title=NULL); 17 18 void InitSize( const UInt_t n );19 21 20 22 // Setters -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityQECam.cc
r5020 r5046 41 41 #include "MCalibrationQECam.h" 42 42 43 #include <TO bjArray.h>43 #include <TOrdCollection.h> 44 44 45 45 ClassImp(MCalibrationIntensityQECam); … … 59 59 } 60 60 61 // ------------------------------------------------------------------- 62 // 63 // Add MCalibrationQECams in the ranges from - to. 64 // 65 void MCalibrationIntensityQECam::Add(const UInt_t from, const UInt_t to) 66 { 67 for (UInt_t i=from; i<to; i++) 68 fCams->AddAt(new MCalibrationQECam,i); 69 } 70 61 71 // -------------------------------------------------------------------------- 62 72 // … … 73 83 74 84 MCalibrationIntensityCam::InitSize(n); 75 (*fCams)[n-1] = new MCalibrationQECam; 76 85 77 86 MCalibrationQECam *newcam = (MCalibrationQECam*)GetCam(); 78 87 -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityQECam.h
r5022 r5046 12 12 class MCalibrationIntensityQECam : public MCalibrationIntensityCam 13 13 { 14 private: 15 16 void Add(const UInt_t from, const UInt_t to); 17 14 18 public: 15 19 16 20 MCalibrationIntensityQECam(const char *name=NULL, const char *title=NULL); 17 21 18 void InitSize( const UInt_t n ); 22 void InitSize( const UInt_t n ); 23 24 const MArrayD &GetCorningBlues () const { 25 return ((MCalibrationQECam*)GetCam())->GetCorningBlues(); } 26 const MArrayD &GetCorningReds () const { 27 return ((MCalibrationQECam*)GetCam())->GetCorningReds(); } 19 28 20 29 Float_t GetPlexiglassQE () const { -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityRelTimeCam.cc
r5030 r5046 41 41 #include "MCalibrationRelTimeCam.h" 42 42 43 #include <TO bjArray.h>43 #include <TOrdCollection.h> 44 44 45 45 ClassImp(MCalibrationIntensityRelTimeCam); … … 60 60 } 61 61 62 63 // -------------------------------------------------------------------------- 62 // ------------------------------------------------------------------- 64 63 // 65 // Calls TObjArray::Expand() for fCams and initialze one CalibrationRelTimeCam64 // Add MCalibrationRelTimeCam's in the ranges from - to. 66 65 // 67 void MCalibrationIntensityRelTimeCam:: InitSize(const UInt_t n)66 void MCalibrationIntensityRelTimeCam::Add(const UInt_t from, const UInt_t to) 68 67 { 69 MCalibrationIntensityCam::InitSize(n);70 (*fCams)[n-1] = new MCalibrationRelTimeCam;68 for (UInt_t i=from; i<to; i++) 69 fCams->AddAt(new MCalibrationRelTimeCam,i); 71 70 } 72 71 -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityRelTimeCam.h
r5015 r5046 8 8 class MCalibrationIntensityRelTimeCam : public MCalibrationIntensityCam 9 9 { 10 private: 11 12 void Add(const UInt_t from, const UInt_t to); 13 10 14 public: 11 15 12 16 MCalibrationIntensityRelTimeCam(const char *name=NULL, const char *title=NULL); 13 17 14 void InitSize( const UInt_t n );15 16 18 ClassDef(MCalibrationIntensityRelTimeCam, 1) // Container Intensity Rel.Times Calibration Results Camera 17 19 }; -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc
r4908 r5046 62 62 63 63 #include "MCalibrationIntensityRelTimeCam.h" 64 65 64 #include "MCalibrationRelTimeCam.h" 66 65 #include "MCalibrationRelTimePix.h" 67 66 67 #include "MBadPixelsIntensityCam.h" 68 68 #include "MBadPixelsCam.h" 69 69 #include "MBadPixelsPix.h" … … 113 113 { 114 114 115 fIntensBad = NULL; 115 116 fBadPixels = NULL; 116 117 fCam = NULL; … … 120 121 121 122 122 // -----------------------------------------------------------------------------------123 //124 // The following containers are searched and created if they were not found:125 //126 // - MBadPixelsCam127 //128 Int_t MCalibrationRelTimeCalc::PreProcess(MParList *pList)129 {130 131 132 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");133 if (!fBadPixels)134 {135 *fLog << err << "Could not find or create MBadPixelsCam ... aborting." << endl;136 return kFALSE;137 }138 139 140 141 return kTRUE;142 }143 144 123 145 124 // -------------------------------------------------------------------------- … … 147 126 // Search for the following input containers and abort if not existing: 148 127 // - MGeomCam 149 // - MCalibrationRelTimeCam 128 // - MCalibrationIntensityRelTimeCam or MCalibrationRelTimeCam 129 // - MBadPixelsIntensityCam or MBadPixelsCam 150 130 // 151 131 // It defines the PixId of every pixel in: … … 167 147 } 168 148 149 fIntensBad = (MBadPixelsIntensityCam*)pList->FindObject(AddSerialNumber("MBadPixelsIntensityCam")); 150 if (fIntensBad) 151 *fLog << inf << "Found MBadPixelsIntensityCam ... " << endl; 152 else 153 { 154 fBadPixels = (MBadPixelsCam*)pList->FindObject(AddSerialNumber("MBadPixelsCam")); 155 if (!fBadPixels) 156 { 157 *fLog << err << "Cannot find MBadPixelsCam ... abort." << endl; 158 return kFALSE; 159 } 160 } 161 169 162 fIntensCam = (MCalibrationIntensityRelTimeCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityRelTimeCam")); 170 163 if (fIntensCam) … … 183 176 UInt_t npixels = fGeom->GetNumPixels(); 184 177 178 MCalibrationRelTimeCam *relcam = fIntensCam 179 ? (MCalibrationRelTimeCam*)fIntensCam->GetCam() : fCam; 180 MBadPixelsCam *badcam = fIntensBad 181 ? (MBadPixelsCam*) fIntensBad->GetCam() : fBadPixels; 182 185 183 for (UInt_t i=0; i<npixels; i++) 186 184 { 187 185 188 MCalibrationRelTimePix &pix = fIntensCam 189 ? (MCalibrationRelTimePix&)(*fIntensCam)[i] 190 : (MCalibrationRelTimePix&)(*fCam) [i]; 191 MBadPixelsPix &bad = (*fBadPixels)[i]; 186 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*relcam)[i]; 187 MBadPixelsPix &bad = (*badcam)[i]; 192 188 193 189 pix.SetPixId(i); … … 203 199 } 204 200 205 return kTRUE;206 }207 208 // ----------------------------------------------------------------------------------209 //210 // Nothing to be done in Process, but have a look at MHCalibrationRelTimeCam, instead211 //212 Int_t MCalibrationRelTimeCalc::Process()213 {214 201 return kTRUE; 215 202 } … … 265 252 else 266 253 fCam ->SetReadyToSave(); 267 fBadPixels->SetReadyToSave(); 254 255 if (fIntensBad) 256 fIntensBad->SetReadyToSave(); 257 else 258 fBadPixels->SetReadyToSave(); 268 259 269 260 *fLog << inf << endl; … … 301 292 { 302 293 294 MCalibrationRelTimeCam *relcam = fIntensCam 295 ? (MCalibrationRelTimeCam*)fIntensCam->GetCam() : fCam; 296 MBadPixelsCam *badcam = fIntensBad 297 ? (MBadPixelsCam*) fIntensBad->GetCam() : fBadPixels; 298 303 299 const UInt_t npixels = fGeom->GetNumPixels(); 304 300 const UInt_t nareas = fGeom->GetNumAreas(); … … 316 312 for (UInt_t i=0; i<npixels; i++) 317 313 { 318 MBadPixelsPix &bad = (* fBadPixels)[i];314 MBadPixelsPix &bad = (*badcam)[i]; 319 315 const Int_t aidx = (*fGeom)[i].GetAidx(); 320 316 … … 340 336 { 341 337 342 MCalibrationRelTimePix &pix = fIntensCam 343 ? (MCalibrationRelTimePix&)(*fIntensCam)[i] 344 : (MCalibrationRelTimePix&)(*fCam) [i]; 345 MBadPixelsPix &bad = (*fBadPixels)[i]; 338 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*relcam)[i]; 339 MBadPixelsPix &bad = (*badcam)[i]; 346 340 347 341 if (pix.IsExcluded()) … … 390 384 { 391 385 392 MCalibrationRelTimePix &pix = fIntensCam 393 ? (MCalibrationRelTimePix&)(*fIntensCam)[i] 394 : (MCalibrationRelTimePix&)(*fCam) [i]; 395 MBadPixelsPix &bad = (*fBadPixels)[i]; 386 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*relcam)[i]; 387 MBadPixelsPix &bad = (*badcam)[i]; 396 388 397 389 if (pix.IsExcluded()) … … 428 420 { 429 421 422 MCalibrationRelTimeCam *relcam = fIntensCam 423 ? (MCalibrationRelTimeCam*)fIntensCam->GetCam() : fCam; 424 MBadPixelsCam *badcam = fIntensBad 425 ? (MBadPixelsCam*) fIntensBad->GetCam() : fBadPixels; 426 430 427 for (Int_t i=0; i<fBadPixels->GetSize(); i++) 431 428 { 432 429 433 MBadPixelsPix &bad = (*fBadPixels)[i]; 434 MCalibrationRelTimePix &pix = fIntensCam 435 ? (MCalibrationRelTimePix&)(*fIntensCam)[i] 436 : (MCalibrationRelTimePix&)(*fCam) [i]; 430 MBadPixelsPix &bad = (*badcam)[i]; 431 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*relcam)[i]; 437 432 438 433 if (bad.IsUncalibrated( MBadPixelsPix::kDeviatingTimeResolution)) … … 464 459 *fLog << dec << setfill(' '); 465 460 461 MCalibrationRelTimeCam *relcam = fIntensCam 462 ? (MCalibrationRelTimeCam*)fIntensCam->GetCam() : fCam; 463 MBadPixelsCam *badcam = fIntensBad 464 ? (MBadPixelsCam*) fIntensBad->GetCam() : fBadPixels; 465 466 466 const Int_t nareas = fGeom->GetNumAreas(); 467 467 468 468 TArrayI counts(nareas); 469 469 470 for (Int_t i=0; i< fBadPixels->GetSize(); i++)471 { 472 MBadPixelsPix &bad = (* fBadPixels)[i];470 for (Int_t i=0; i<badcam->GetSize(); i++) 471 { 472 MBadPixelsPix &bad = (*badcam)[i]; 473 473 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 474 474 { … … 479 479 480 480 for (Int_t aidx=0; aidx<nareas; aidx++) 481 if (fIntensCam) 482 fIntensCam->SetNumUnsuitable(counts[aidx], aidx); 483 else 484 fCam->SetNumUnsuitable(counts[aidx], aidx); 481 relcam->SetNumUnsuitable(counts[aidx], aidx); 485 482 486 483 if (fGeom->InheritsFrom("MGeomCamMagic")) … … 490 487 counts.Reset(); 491 488 492 for (Int_t i=0; i< fBadPixels->GetSize(); i++)493 { 494 MBadPixelsPix &bad = (* fBadPixels)[i];489 for (Int_t i=0; i<badcam->GetSize(); i++) 490 { 491 MBadPixelsPix &bad = (*badcam)[i]; 495 492 if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 496 493 { … … 501 498 502 499 for (Int_t aidx=0; aidx<nareas; aidx++) 503 if (fIntensCam) 504 fIntensCam->SetNumUnreliable(counts[aidx], aidx); 505 else 506 fCam->SetNumUnreliable(counts[aidx], aidx); 500 relcam->SetNumUnreliable(counts[aidx], aidx); 507 501 508 502 *fLog << " " << setw(7) << "Unreliable Pixels: " … … 518 512 { 519 513 514 MBadPixelsCam *badcam = fIntensBad 515 ? (MBadPixelsCam*) fIntensBad->GetCam() : fBadPixels; 516 520 517 UInt_t countinner = 0; 521 518 UInt_t countouter = 0; 522 for (Int_t i=0; i< fBadPixels->GetSize(); i++)523 { 524 MBadPixelsPix &bad = (* fBadPixels)[i];519 for (Int_t i=0; i<badcam->GetSize(); i++) 520 { 521 MBadPixelsPix &bad = (*badcam)[i]; 525 522 if (bad.IsUncalibrated(typ)) 526 523 { -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.h
r4908 r5046 22 22 class MCalibrationRelTimeCam; 23 23 class MGeomCam; 24 class MBadPixelsIntensityCam; 24 25 class MBadPixelsCam; 25 26 … … 36 37 37 38 // Pointers 39 MBadPixelsIntensityCam *fIntensBad; // Bad Pixels Intensity Cam 38 40 MBadPixelsCam *fBadPixels; // Bad Pixels 39 41 MCalibrationIntensityRelTimeCam *fIntensCam; // Calibrated RelTimes for different intensities … … 54 56 void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const; 55 57 56 Int_t PreProcess (MParList *pList);57 58 Bool_t ReInit (MParList *pList); 58 Int_t Process ();59 59 Int_t PostProcess(); 60 60 -
trunk/MagicSoft/Mars/mcalib/MCalibrationTestCalc.cc
r4810 r5046 64 64 #include "MHCalibrationTestPix.h" 65 65 66 #include "MCalibrationIntensityTestCam.h" 66 67 #include "MCalibrationTestCam.h" 67 68 #include "MCalibrationTestPix.h" 68 69 70 #include "MBadPixelsIntensityCam.h" 69 71 #include "MBadPixelsCam.h" 70 72 #include "MBadPixelsPix.h" … … 88 90 // 89 91 MCalibrationTestCalc::MCalibrationTestCalc(const char *name, const char *title) 90 : fBadPixels(NULL), fTestCam(NULL), fCam(NULL), fGeom(NULL) 92 : fIntensBad(NULL), fBadPixels(NULL), 93 fTestCam(NULL), fIntensCam(NULL), fCam(NULL), 94 fGeom(NULL) 91 95 { 92 96 … … 102 106 103 107 104 // -----------------------------------------------------------------------------------105 //106 // The following containers are searched and created if they were not found:107 //108 // - MBadPixelsCam109 //110 Int_t MCalibrationTestCalc::PreProcess(MParList *pList)111 {112 113 //114 // Containers that are created in case that they are not there.115 //116 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj(AddSerialNumber("MBadPixelsCam"));117 if (!fBadPixels)118 {119 *fLog << err << "Could not find or create MBadPixelsCam ... aborting." << endl;120 return kFALSE;121 }122 123 fCam = (MCalibrationTestCam*)pList->FindCreateObj("MCalibrationTestCam");124 if (!fCam)125 {126 *fLog << err << "Could not find or create MCalibrationTestCam ... aborting." << endl;127 return kFALSE;128 }129 130 return kTRUE;131 }132 133 134 108 // -------------------------------------------------------------------------- 135 109 // 136 110 // Search for the following input containers and abort if not existing: 137 // - MGeomCam 138 // - MHCalibrationTestCam 111 // - MGeomCam 112 // - MHCalibrationTestCam 113 // - MCalibrationIntensityTestCam or MCalibrationTestCam 114 // - MBadPixelsIntensityCam or MBadPixelsCam 139 115 // 140 //141 116 Bool_t MCalibrationTestCalc::ReInit(MParList *pList ) 142 117 { … … 155 130 *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationTestCam before..." << endl; 156 131 return kFALSE; 132 } 133 134 fIntensCam = (MCalibrationIntensityTestCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityTestCam")); 135 if (fIntensCam) 136 *fLog << inf << "Found MCalibrationIntensityTestCam ... " << endl; 137 else 138 { 139 fCam = (MCalibrationTestCam*)pList->FindObject(AddSerialNumber("MCalibrationTestCam")); 140 if (!fCam) 141 { 142 *fLog << err << "Cannot find MCalibrationTestCam ... abort." << endl; 143 *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationTestCam before..." << endl; 144 return kFALSE; 145 } 146 } 147 148 fIntensBad = (MBadPixelsIntensityCam*)pList->FindObject(AddSerialNumber("MBadPixelsIntensityCam")); 149 if (fIntensBad) 150 *fLog << inf << "Found MBadPixelsIntensityCam ... " << endl; 151 else 152 { 153 fBadPixels = (MBadPixelsCam*)pList->FindObject(AddSerialNumber("MBadPixelsCam")); 154 if (!fBadPixels) 155 { 156 *fLog << err << "Cannot find MBadPixelsCam ... abort." << endl; 157 return kFALSE; 158 } 157 159 } 158 160 … … 182 184 return kFALSE; 183 185 186 MCalibrationTestCam *testcam = fIntensCam 187 ? (MCalibrationTestCam*)fIntensCam->GetCam() : fCam; 188 184 189 // 185 190 // Re-direct the output to an ascii-file from now on: … … 202 207 { 203 208 *fLog << " " << setw(7) << "Not interpolateable Pixels: " 204 << Form("%s%3i%s%3i","Inner: ", fCam->GetNumUninterpolated(0),205 " Outer: ", fCam->GetNumUninterpolated(1)) << endl;209 << Form("%s%3i%s%3i","Inner: ",testcam->GetNumUninterpolated(0), 210 " Outer: ",testcam->GetNumUninterpolated(1)) << endl; 206 211 *fLog << " " << setw(7) << "Biggest not-interpolateable cluster: " 207 212 << maxbad << endl; 208 213 } 209 214 210 fCam->SetNumUninterpolatedInMaxCluster(maxbad);215 testcam->SetNumUninterpolatedInMaxCluster(maxbad); 211 216 212 217 *fLog << endl; … … 234 239 const UInt_t nareas = fGeom->GetNumAreas(); 235 240 const UInt_t nsectors = fGeom->GetNumSectors(); 241 242 MCalibrationTestCam *testcam = fIntensCam 243 ? (MCalibrationTestCam*)fIntensCam->GetCam() : fCam; 244 MBadPixelsCam *badcam = fIntensBad 245 ? (MBadPixelsCam*) fIntensBad->GetCam() : fBadPixels; 236 246 237 247 TArrayD lowlim (nareas); … … 256 266 257 267 MHCalibrationTestPix &hist = (MHCalibrationTestPix&)(*fTestCam)[i]; 258 MCalibrationTestPix &pix = (*fCam)[i];268 MCalibrationTestPix &pix = (MCalibrationTestPix &) (*testcam)[i]; 259 269 // 260 270 // We assume that the pixels have been interpolated so far. … … 316 326 const Float_t areaerr = TMath::Sqrt(areavars[aidx]); 317 327 318 MCalibrationTestPix &avpix = fCam->GetAverageArea(aidx);328 MCalibrationTestPix &avpix = (MCalibrationTestPix&)testcam->GetAverageArea(aidx); 319 329 avpix.SetNumPhotons (areamean); 320 330 avpix.SetNumPhotonsErr(areaerr ); … … 385 395 386 396 MHCalibrationTestPix &hist = (MHCalibrationTestPix&)(*fTestCam)[i]; 387 MCalibrationTestPix &pix = (*fCam)[i];397 MCalibrationTestPix &pix = (MCalibrationTestPix&) (*testcam)[i]; 388 398 389 399 const Int_t aidx = (*fGeom)[i].GetAidx(); … … 401 411 << Form("%8.2f out of %3.1f sigma limit: ",nphot,fPhotErrLimit) 402 412 << Form("[%8.2f,%8.2f] pixel%4i",lowlim[aidx],upplim[aidx],i) << endl; 403 MBadPixelsPix &bad = (* fBadPixels)[i];413 MBadPixelsPix &bad = (*badcam)[i]; 404 414 bad.SetUncalibrated( MBadPixelsPix::kDeviatingNumPhots ); 405 415 bad.SetUnsuitable ( MBadPixelsPix::kUnsuitableRun ); … … 436 446 437 447 438 MCalibrationTestPix &avpix = fCam->GetAverageArea(aidx);448 MCalibrationTestPix &avpix = (MCalibrationTestPix&)testcam->GetAverageArea(aidx); 439 449 440 450 if (areavars[aidx] < 0. || areaphotons[aidx] <= 0.) … … 479 489 } 480 490 481 MCalibrationTestPix &avpix = fCam->GetAverageSector(sector);491 MCalibrationTestPix &avpix = (MCalibrationTestPix&)testcam->GetAverageSector(sector); 482 492 483 493 if (sectorvars[sector] < 0. || sectorphotons[sector] <= 0.) … … 513 523 { 514 524 525 MCalibrationTestCam *testcam = fIntensCam 526 ? (MCalibrationTestCam*)fIntensCam->GetCam() : fCam; 527 515 528 const Int_t areas = fGeom->GetNumAreas(); 516 529 TArrayI *newarr[areas]; … … 519 532 newarr[aidx] = new TArrayI(0); 520 533 521 for (Int_t i=0; i< fCam->GetSize(); i++)534 for (Int_t i=0; i<testcam->GetSize(); i++) 522 535 { 523 536 const Int_t aidx = (*fGeom)[i].GetAidx(); 524 if ((*fCam)[i].IsExcluded()) 537 MCalibrationTestPix &pix = (MCalibrationTestPix&)(*testcam)[i]; 538 if (pix.IsExcluded()) 525 539 { 526 540 const Int_t size = newarr[aidx]->GetSize(); … … 542 556 num++; 543 557 } 544 fCam->SetNumUninterpolated(newarr[aidx]->GetSize(),aidx);558 testcam->SetNumUninterpolated(newarr[aidx]->GetSize(),aidx); 545 559 *fLog << endl; 546 560 } … … 553 567 { 554 568 569 MCalibrationTestCam *testcam = fIntensCam 570 ? (MCalibrationTestCam*)fIntensCam->GetCam() : fCam; 571 555 572 TArrayI arr(0); 556 573 557 for (Int_t i=0; i<fCam->GetSize(); i++) 558 if ((*fCam)[i].IsExcluded()) 559 { 574 for (Int_t i=0; i<testcam->GetSize(); i++) 575 { 576 MCalibrationTestPix &pix = (MCalibrationTestPix&)(*testcam)[i]; 577 if (pix.IsExcluded()) 578 { 560 579 const Int_t s = arr.GetSize(); 561 580 arr.Set(s+1); 562 581 arr[s] = i; 563 } 564 582 } 583 } 584 565 585 const Int_t size = arr.GetSize(); 566 586 … … 634 654 } 635 655 636 637 638 639 640 656 // -------------------------------------------------------------------------- 641 657 // -
trunk/MagicSoft/Mars/mcalib/MCalibrationTestCalc.h
r4882 r5046 20 20 21 21 class MHCalibrationTestCam; 22 class MCalibrationIntensityTestCam; 22 23 class MCalibrationTestCam; 24 class MBadPixelsIntensityCam; 23 25 class MBadPixelsCam; 24 26 class MGeomCam; … … 37 39 38 40 // Pointers 39 MBadPixelsCam *fBadPixels; //! Bad Pixels 40 MHCalibrationTestCam *fTestCam; //! Calibrated Photons in the camera 41 MCalibrationTestCam *fCam; //! Storage Calibrated Photons in the camera 42 MGeomCam *fGeom; //! Camera geometry 41 MBadPixelsIntensityCam *fIntensBad; //! Bad Pixels 42 MBadPixelsCam *fBadPixels; //! Bad Pixels 43 MHCalibrationTestCam *fTestCam; //! Calibrated Photons in the camera 44 MCalibrationIntensityTestCam *fIntensCam; //! Storage Calibrated Photons in the camera 45 MCalibrationTestCam *fCam; //! Storage Calibrated Photons in the camera 46 MGeomCam *fGeom; //! Camera geometry 43 47 44 48 // functions … … 50 54 void LoopNeighbours( const TArrayI &arr, TArrayI &known, Int_t &clustersize, const Int_t idx ); 51 55 52 Int_t PreProcess (MParList *pList);53 56 Bool_t ReInit (MParList *pList); 54 57 Int_t Process ();
Note:
See TracChangeset
for help on using the changeset viewer.