Changeset 5678 for trunk/MagicSoft/Mars/mraw
- Timestamp:
- 12/22/04 20:07:45 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mraw
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
r5567 r5678 80 80 // between the last and this event. 81 81 // 82 // UInt_t fTrigPattern[ 2]82 // UInt_t fTrigPattern[0] 83 83 // ----------------------- 84 84 // Trigger Pattern used for this event 85 85 // Each event triggers for a particular configuration and each 86 86 // configuration should have an ID (which is not fixed yet). 87 // 88 // UInt_t fCalibPattern == fTrigPattern[1] 89 // ----------------------- 90 // Calibration Pattern used for this event 91 // Each (calibration) event uses a particular LEDs configuration and 92 // particular strength and colour of the continunous light. 93 // Bits 1-16: Pulser slot pattern: 16 LEDs slots. 94 // Bits 17: CT1 Pulser 95 // Bits 21-24: Colour of Continous light source: 96 // Bits 25-32: Strength of continuous light source: 256 level 87 97 // 88 98 // UShort_t fAllLowGainOn … … 91 101 // This is a Byte (8 bit) to indicated if any of the pixels 92 102 // have a non-negligible low gain (1) or not (0) 93 //94 // UInt_t fCalibPattern95 // --------------------96 //97 // Bits 1-16: Pulser slot pattern: 16 LEDs slots (see Diploma Thesis98 // of Michele)99 //100 // Bits 17-24: Power of Continous light source: 256 level101 //102 // Bits 25-28: Farbe der Continuous Light: red-amber-green/blue-uv103 //104 // Bit 29: Calibration trigger On/off105 // Bit 30: Pedestal trigger on/off106 // Bit 31: PIN Diode calibration trigger on/off107 //108 103 // 109 104 // Class Version 2: … … 221 216 case 2: 222 217 *fLog << "Calibration"; 218 break; 219 case 3: 220 *fLog << "PinDiode"; 223 221 break; 224 222 } … … 409 407 return fTrigPattern[1]; 410 408 } 411 /*412 // --------------------------------------------------------------------------413 //414 // return pulser slot patter, see class reference415 //416 UShort_t MRawEvtHeader::GetPulserSlotPattern() const417 {418 return fTrigPattern[1] & 0xffff;419 }420 409 421 410 // -------------------------------------------------------------------------- … … 423 412 // return power of continous light, see class reference 424 413 // 425 Byte_t MRawEvtHeader::GetPowerOfContLight() const 426 { 427 return (fTrigPattern[1]<<16) & 0xff; 428 } 429 430 // -------------------------------------------------------------------------- 431 // 432 // return color of continous light, see class reference 433 // 434 MRawEvtHeader::CalibCol_t MRawEvtHeader::GetContLedColor() const 435 { 436 return (CalibCol_t)((fTrigPattern[1]<<24)&0xf); 437 } 438 */ 414 UShort_t MRawEvtHeader::GetPowerOfContLight() const 415 { 416 return fTrigPattern[1] & 0xff; 417 } 418 419 // -------------------------------------------------------------------------- 420 // 421 // return pulser slot patter as a 17-bit-field 422 // 423 UInt_t MRawEvtHeader::GetPulserSlotPattern() const 424 { 425 return (fTrigPattern[1] >> 16) & 0x1ffff; 426 } 427 428 // -------------------------------------------------------------------------- 429 // 430 // return colour of the pulsed light as an MCalibrationCam::PulserColor_t 431 // ATTENTION: In case of mulitple colours, kNONE is returned 432 // 433 const MCalibrationCam::PulserColor_t MRawEvtHeader::GetPulserColor() const 434 { 435 436 const UInt_t pattern = GetPulserSlotPattern(); 437 438 if ((pattern & kGreenAndBlue) || (pattern & kBlueAndUV) || (pattern & kGreenAndUV)) 439 return MCalibrationCam::kNONE; 440 441 if (pattern & kCT1Pulser) 442 return MCalibrationCam::kCT1; 443 if (pattern & kAnyUV) 444 return MCalibrationCam::kUV; 445 if (pattern & kAnyGreen) 446 return MCalibrationCam::kGREEN; 447 if (pattern & kAnyBlue) 448 return MCalibrationCam::kBLUE; 449 450 return MCalibrationCam::kNONE; 451 } 452 453 454 // -------------------------------------------------------------------------- 455 // 456 // return strength of the pulsed light 457 // ATTENTION: In case of mulitple colours, kNONE is returned 458 // 459 Float_t MRawEvtHeader::GetPulserStrength() const 460 { 461 462 const MCalibrationCam::PulserColor_t col = GetPulserColor(); 463 const UInt_t pattern = GetPulserSlotPattern(); 464 465 Float_t strength = 0.; 466 467 switch (col) 468 { 469 case MCalibrationCam::kNONE: 470 break; 471 case MCalibrationCam::kGREEN: 472 if (pattern & kSlot1Green) 473 strength += 5.; 474 if (pattern & kSlot2Green) 475 strength += 2.; 476 if (pattern & kSlot15Green) 477 strength += 1.; 478 if (pattern & kSlot16AttGreen) 479 strength += 0.2; 480 break; 481 case MCalibrationCam::kBLUE: 482 if (pattern & kSlot3Blue) 483 strength += 5.; 484 if (pattern & kSlot6Blue) 485 strength += 5.; 486 if (pattern & kSlot7Blue) 487 strength += 5.; 488 if (pattern & kSlot8Blue) 489 strength += 2.; 490 if (pattern & kSlot9AttBlue) 491 strength += 0.2; 492 if (pattern & kSlot10Blue) 493 strength += 0.; 494 if (pattern & kSlot11Blue) 495 strength += 1.; 496 if (pattern & kSlot14Blue) 497 strength += 5.; 498 break; 499 case MCalibrationCam::kUV: 500 if (pattern & kSlot4UV) 501 strength += 1.; 502 if (pattern & kSlot5UV) 503 strength += 2.; 504 if (pattern & kSlot12UV) 505 strength += 5.; 506 if (pattern & kSlot13UV) 507 strength += 5.; 508 break; 509 case MCalibrationCam::kCT1: 510 strength = 20.; 511 break; 512 } 513 514 return strength; 515 } 516 517 // -------------------------------------------------------------------------- 518 // 519 // return color of continous light 520 // 521 MRawEvtHeader::CLColor_t MRawEvtHeader::GetContLightColor() const 522 { 523 return (CLColor_t)((fTrigPattern[1]>>8)&0xf); 524 } -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
r5567 r5678 4 4 #ifndef MARS_MParContainer 5 5 #include "MParContainer.h" 6 #endif 7 8 #ifndef MARS_MCalibrationCam 9 #include "MCalibrationCam.h" 6 10 #endif 7 11 … … 23 27 kTTEvent = 0, 24 28 kTTPedestal = 1, 25 kTTCalibration = 2 29 kTTCalibration = 2, 30 kTTPinDiode = 3 26 31 }; 27 /* 28 enum CalibCol_t { 29 kColRed = BIT(0), 30 kColAmber = BIT(1), 31 kColGreen = BIT(2), 32 kColBlue = BIT(3), 33 kColUV = BIT(4) 34 }; 35 */ 32 33 enum CLColor_t 34 { 35 kCLUV = BIT(0), 36 kCLGreen = BIT(1), 37 kCLAmber = BIT(2), 38 kCLRed = BIT(3), 39 kCLRedAmber = kCLRed & kCLAmber, 40 kCLRedGreen = kCLRed & kCLGreen, 41 kCLRedUV = kCLRed & kCLUV , 42 kCLAmberGreen = kCLAmber & kCLGreen, 43 kCLAmberUV = kCLAmber & kCLUV , 44 kCLGreenUV = kCLGreen & kCLUV , 45 kCLRedAmberGreen = kCLRedAmber & kCLGreen, 46 kCLRedGreenUV = kCLRedGreen & kCLUV, 47 kCLAmberGreenUV = kCLAmberGreen & kCLUV, 48 kCLAll = kCLRedAmberGreen & kCLUV 49 }; 50 51 enum PulserColorCode_t 52 { 53 kSlot1Green = BIT(0), 54 kSlot2Green = BIT(1), 55 kSlot3Blue = BIT(2), 56 kSlot4UV = BIT(3), 57 kSlot5UV = BIT(4), 58 kSlot6Blue = BIT(5), 59 kSlot7Blue = BIT(6), 60 kSlot8Blue = BIT(7), 61 kSlot9AttBlue = BIT(8), 62 kSlot10Blue = BIT(9), 63 kSlot11Blue = BIT(10), 64 kSlot12UV = BIT(11), 65 kSlot13UV = BIT(12), 66 kSlot14Blue = BIT(13), 67 kSlot15Green = BIT(14), 68 kSlot16AttGreen = BIT(15), 69 kCT1Pulser = BIT(16), 70 kAnyGreen = kSlot1Green | kSlot2Green | kSlot15Green | kSlot16AttGreen, 71 kAnyUV = kSlot4UV | kSlot5UV | kSlot12UV | kSlot13UV, 72 kAnyBlue = kSlot3Blue | kSlot6Blue | kSlot7Blue | kSlot8Blue 73 | kSlot9AttBlue| kSlot10Blue | kSlot11Blue | kSlot14Blue, 74 kGreenAndBlue = kAnyGreen & kAnyBlue, 75 kBlueAndUV = kAnyBlue & kAnyUV, 76 kGreenAndUV = kAnyGreen & kAnyUV, 77 kIFAEPulser = kAnyGreen | kAnyBlue | kAnyUV, 78 kAny = kAnyGreen | kAnyBlue | kAnyUV | kCT1Pulser 79 }; 80 36 81 private: 37 82 MTime *fTime; //! object to store the time in (ReadEvt) … … 76 121 UInt_t GetCalibrationPattern() const; 77 122 78 void SetCalibrationPattern(UInt_t pat) { fTrigPattern[1] = pat; } // USE THIS FUNCTION WITH EXTREME CARE -- IT IS A WORKAROUND! 79 /* 80 UShort_t GetPulserSlotPattern() const; 81 Byte_t GetPowerOfContLight() const; 82 CalibCol_t GetContLedColor() const; 83 */ 123 void SetCalibrationPattern(UInt_t pat) { fTrigPattern[1] += (pat << 16); } // USE THIS FUNCTION WITH EXTREME CARE -- IT IS A WORKAROUND! 124 125 UShort_t GetPowerOfContLight() const; 126 UInt_t GetPulserSlotPattern() const; 127 const MCalibrationCam::PulserColor_t GetPulserColor() const; 128 Float_t GetPulserStrength() const; 129 130 CLColor_t GetContLightColor() const; 131 84 132 Int_t ReadEvt(istream& fin, UShort_t ver); 85 133 void SkipEvt(istream& fin, UShort_t ver);
Note:
See TracChangeset
for help on using the changeset viewer.