Changeset 5678 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
12/22/04 20:07:45 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5673 r5678  
    2121                                                 -*-*- END OF LINE -*-*-
    2222
     23
     24 2004/12/22 Markus Gaug
     25
     26    * mraw/MRawEvtHeader.[h,cc]
     27      - added some new Getter-functions for the calibration conf.
     28        pattern
    2329
    2430 2004/12/22 Eva Domingo
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSteer.h

    r5480 r5678  
    1717class MCalibrationIntensityRelTimeCam;
    1818class MBadPixelsIntensityCam;
     19class MBadPixelsCam;
    1920class MCalibColorSteer : public MTask
    2021{
     
    3031  MCalibrationIntensityRelTimeCam *fIntensRelTime;   //!
    3132  MBadPixelsIntensityCam          *fIntensBad;       //!
     33  MBadPixelsCam                   *fBad;             //!
    3234 
    3335  MCalibrationChargeCalc          *fChargeCalc;      //!
     
    4143  Bool_t ReInitialize();
    4244  Bool_t Finalize(const char* name);
    43   const char* GetNamePattern();
     45  TString GetNamePattern();
    4446 
    4547public:
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc

    r5567 r5678  
    8080// between the last and this event.
    8181//
    82 // UInt_t  fTrigPattern[2]
     82// UInt_t  fTrigPattern[0]
    8383// -----------------------
    8484// Trigger Pattern used for this event
    8585// Each event triggers for a particular configuration and each 
    8686// 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
    8797//
    8898// UShort_t fAllLowGainOn
     
    91101// This is a Byte (8 bit) to indicated if any of the pixels
    92102// have a non-negligible low gain (1) or not (0)
    93 //
    94 // UInt_t fCalibPattern
    95 // --------------------
    96 //
    97 // Bits 1-16: Pulser slot pattern: 16 LEDs slots (see Diploma Thesis
    98 // of Michele)
    99 //
    100 // Bits 17-24: Power of Continous light source: 256 level
    101 //
    102 // Bits 25-28: Farbe der Continuous Light: red-amber-green/blue-uv
    103 //
    104 // Bit 29: Calibration trigger On/off
    105 // Bit 30: Pedestal trigger on/off
    106 // Bit 31: PIN Diode calibration trigger on/off
    107 //
    108103//
    109104// Class Version 2:
     
    221216    case 2:
    222217        *fLog << "Calibration";
     218        break;
     219    case 3:
     220        *fLog << "PinDiode";
    223221        break;
    224222    }
     
    409407    return fTrigPattern[1];
    410408}
    411 /*
    412 // --------------------------------------------------------------------------
    413 //
    414 // return pulser slot patter, see class reference
    415 //
    416 UShort_t MRawEvtHeader::GetPulserSlotPattern() const
    417 {
    418     return fTrigPattern[1] & 0xffff;
    419 }
    420409
    421410// --------------------------------------------------------------------------
     
    423412// return power of continous light, see class reference
    424413//
    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 */
     414UShort_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//
     423UInt_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//
     433const 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//
     459Float_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//
     521MRawEvtHeader::CLColor_t MRawEvtHeader::GetContLightColor() const
     522{
     523  return (CLColor_t)((fTrigPattern[1]>>8)&0xf);
     524}
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h

    r5567 r5678  
    44#ifndef MARS_MParContainer
    55#include "MParContainer.h"
     6#endif
     7
     8#ifndef MARS_MCalibrationCam
     9#include "MCalibrationCam.h"
    610#endif
    711
     
    2327        kTTEvent       = 0,
    2428        kTTPedestal    = 1,
    25         kTTCalibration = 2
     29        kTTCalibration = 2,
     30        kTTPinDiode    = 3
    2631    };
    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
    3681private:
    3782    MTime   *fTime;            //! object to store the time in (ReadEvt)
     
    76121    UInt_t     GetCalibrationPattern() const;
    77122
    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   
    84132    Int_t ReadEvt(istream& fin, UShort_t ver);
    85133    void  SkipEvt(istream& fin, UShort_t ver);
Note: See TracChangeset for help on using the changeset viewer.