Changeset 6014


Ignore:
Timestamp:
01/26/05 08:40:22 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mraw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc

    r5678 r6014  
    408408}
    409409
    410 // --------------------------------------------------------------------------
    411 //
    412 // return power of continous light, see class reference
    413 //
    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 //
    423410UInt_t MRawEvtHeader::GetPulserSlotPattern() const
    424411{
    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 }
     412    return (fTrigPattern[1] >> 16) & 0x1ffff;
     413}
     414
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h

    r5800 r6014  
    4949      };
    5050   
    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       };
    8051
    8152private:
     
    12091    UInt_t     GetTriggerID() const;
    12192    UInt_t     GetCalibrationPattern() const;
     93    UInt_t     GetPulserSlotPattern()  const;
    12294
    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    
    13295    Int_t ReadEvt(istream& fin, UShort_t ver);
    13396    void  SkipEvt(istream& fin, UShort_t ver);
Note: See TracChangeset for help on using the changeset viewer.