Ignore:
Timestamp:
04/09/04 12:00:29 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.cc

    r3681 r3691  
    3838// Averaged values over one whole area index (e.g. inner or outer pixels for
    3939// the MAGIC camera), can be retrieved via:
    40 // MCalibrationQEPix &avpix = (MCalibrationQEPix&)fRelCam->GetAverageArea(i)
     40// MCalibrationQEPix &avpix = (MCalibrationQEPix&)fQECam->GetAverageArea(i)
    4141//
    4242// Averaged values over one whole camera sector can be retrieved via:
    43 // MCalibrationQEPix &avpix = (MCalibrationQEPix&)fRelCam->GetAverageSector(i)
    44 //
    45 // The following "calibration" constants can be retrieved from each pixel:
    46 // - GetQEBlindPixel ( const PulserColor_t color ): The mean quantum
    47 //   efficiency obtained with the calibration pulser color (e.g. kGREEN, kBLUE, kUV)
    48 //   after the Blind Pixel Method
    49 // - GetQEFFactor ( const PulserColor_t color ): The mean quantum
    50 //   efficiency obtained with the calibration pulser color (e.g. kGREEN, kBLUE, kUV)
    51 //   after the F-Factor Method
    52 // - GetQEPINDiode ( const PulserColor_t color ): The mean quantum
    53 //   efficiency obtained with the calibration pulser color (e.g. kGREEN, kBLUE, kUV)
    54 //   after the PIN Diode Method
    55 // - GetQECombined ( const PulserColor_t color ): The mean quantum
    56 //   efficiency obtained with the calibration pulser color (e.g. kGREEN, kBLUE, kUV)
    57 //   after the combination of the three methods
     43// MCalibrationQEPix &avpix = (MCalibrationQEPix&)fQECam->GetAverageSector(i)
     44//
     45// The following "calibration" constants are used for the calibration of each pixel:
     46//
     47// - MCalibrationQEPix::GetQECascadesBlindPixel(): The mean quantum efficiency folded
     48//   into a cascades spectrum obtained with the Blind Pixel Method.
     49// - MCalibrationQEPix::GetQECascadesFFactor(): The mean quantum efficiency folded
     50//   into a cascades spectrum obtained with the F-Factor Method
     51// - MCalibrationQEPix::GetQECascadesPINDiode(): The mean quantum efficiency folded
     52//   into a cascades spectrum obtained with the PIN Diode Method
     53// - MCalibrationQEPix::GetQECascadesCombined(): The mean quantum efficiency folded
     54//   into a cascades spectrum obtained with the combination of the three methods
     55//
     56// The following "calibration" constants have been measured to obtain the above values:
     57//
     58// - MCalibrationQEPix::GetQEBlindPixel( MCalibrationCam::PulserColor_t color ):
     59//   The mean quantum efficiency obtained with the calibration pulser color
     60//   (e.g. kGREEN, kBLUE, kUV, kCT1) after the Blind Pixel Method
     61// - MCalibrationQEPix::GetQEFFactor( MCalibrationCam::PulserColor_t color ):
     62//   The mean quantum efficiency obtained with the calibration pulser color
     63//   (e.g. kGREEN, kBLUE, kUV, kCT1) after the F-Factor Method
     64// - MCalibrationQEPix::GetQEPINDiode( MCalibrationCam::PulserColor_t color ):
     65//   The mean quantum efficiency obtained with the calibration pulser color
     66//   (e.g. kGREEN, kBLUE, kUV, kCT1) after the PIN Diode Method
     67// - MCalibrationQEPix::GetQECombined( MCalibrationCam::PulserColor_t color ):
     68//   The mean quantum efficiency obtained with the calibration pulser color
     69//   (e.g. kGREEN, kBLUE, kUV, kCT1) after the combination of the three methods
    5870//
    5971// See also: MCalibrationQEPix, MCalibrationChargeCam, MCalibrationChargeCalc
     
    6173//
    6274//                                                                         
    63 // The calculated values (types of GetPixelContent) are:
    64 //
    65 // 0: Mean Quantum Efficiency of the color: kCT1
    66 // 1: Error of the Mean Quantum Efficiency of the color: kCT1
    67 // 2: Mean Quantum Efficiency of the color: kGREEN
    68 // 3: Error of the Mean Quantum Efficiency of the color: kGreen
    69 // 4: Mean Quantum Efficiency of the color: kBLUE
    70 // 5: Error of the Mean Quantum Efficiency of the color: kBlue
    71 // 6: Mean Quantum Efficiency of the color: kUV
    72 // 7: Error of the Mean Quantum Efficiency of the color: kUV
     75// The calculated values (types of GetPixelContent()) are:
     76//
     77//
     78// Types used by MCalibrate and MCalibrateData:
     79// ============================================
     80//
     81// 0: Mean Quantum Efficiency for cascades, obtained with the F-Factor method
     82// 1: Error of the Mean QE for cascades, obtained with the F-Factor method
     83// 2: Mean Quantum Efficiency for cascades, obtained with the Blind Pixel method
     84// 3: Error of the Mean QE for cascades, obtained with the Blind Pixel method
     85// 4: Mean Quantum Efficiency for cascades, obtained with the PIN Diode method
     86// 5: Error of the Mean QE for cascades, obtained with the PIN Diode method
     87// 6: Mean Quantum Efficiency for cascades, obtained with combination of the 3 methods
     88// 7: Error of the Mean QE for cascades, obtained with combination of the 3 methods
     89//
     90// Types filled by MCalibrationChargeCalc in combination of MCalibrationChargePix:
     91// ===============================================================================
     92//
     93// 8:  Mean Quantum Efficiency obtained with F-Factor Method ( color: kCT1)
     94// 9:  Error of the Mean QE obtained with F-Factor Method ( color: kCT1)
     95// 10: Mean Quantum Efficiency obtained with F-Factor Method ( color: kGREEN)
     96// 11: Error of the Mean QE obtained with F-Factor Method ( color: kGREEN)
     97// 12: Mean Quantum Efficiency obtained with F-Factor Method ( color: kBLUE)
     98// 13: Error of the Mean QE obtained with F-Factor Method ( color: kBLUE)
     99// 14: Mean Quantum Efficiency obtained with F-Factor Method ( color: kUV)
     100// 15: Error of the Mean QE obtained with F-Factor Method ( color: kUV)
     101//
     102// Types filled by MCalibrationChargeCalc in combination of MCalibrationChargeBlindPix:
     103// ====================================================================================
     104//
     105// 16: Mean Quantum Efficiency obtained with Blind Pixel Method ( color: kCT1)
     106// 17: Error of the Mean QE obtained with Blind Pixel Method ( color: kCT1)
     107// 18: Mean Quantum Efficiency obtained with Blind Pixel Method ( color: kGREEN)
     108// 19: Error of the Mean QE obtained with Blind Pixel Method ( color: kGREEN)
     109// 20: Mean Quantum Efficiency obtained with Blind Pixel Method ( color: kBLUE)
     110// 21: Error of the Mean QE obtained with Blind Pixel Method ( color: kBLUE)
     111// 22: Mean Quantum Efficiency obtained with Blind Pixel Method ( color: kUV)
     112// 23: Error of the Mean QE obtained with Blind Pixel Method ( color: kUV)
     113//
     114// Types filled by MCalibrationChargeCalc in combination of MCalibrationChargePINDiode:
     115// ====================================================================================
     116//
     117// 24: Mean Quantum Efficiency obtained with PIN Diode Method ( color: kCT1)
     118// 25: Error of the Mean QE obtained with PIN Diode Method ( color: kCT1)
     119// 26: Mean Quantum Efficiency obtained with PIN Diode Method ( color: kGREEN)
     120// 27: Error of the Mean QE obtained with PIN Diode Method ( color: kGREEN)
     121// 28: Mean Quantum Efficiency obtained with PIN Diode Method ( color: kBLUE)
     122// 29: Error of the Mean QE obtained with PIN Diode Method ( color: kBLUE)
     123// 30: Mean Quantum Efficiency obtained with PIN Diode Method ( color: kUV)
     124// 31: Error of the Mean QE obtained with PIN Diode Method ( color: kUV)
     125//
     126// Types filled by MCalibrationChargeCalc in combination of MCalibrationQEPix:
     127// ===========================================================================
     128//
     129// 24: Mean Quantum Efficiency obtained with combination of 3 methods ( color: kCT1)
     130// 25: Error of the Mean QE obtained with combination of 3 methods ( color: kCT1)
     131// 26: Mean Quantum Efficiency obtained with combination of 3 methods ( color: kGREEN)
     132// 27: Error of the Mean QE obtained with combination of 3 methods ( color: kGREEN)
     133// 28: Mean Quantum Efficiency obtained with combination of 3 methods ( color: kBLUE)
     134// 29: Error of the Mean QE obtained with combination of 3 methods ( color: kBLUE)
     135// 30: Mean Quantum Efficiency obtained with combination of 3 methods ( color: kUV)
     136// 31: Error of the Mean QE obtained with combination of 3 methods ( color: kUV)
    73137//
    74138/////////////////////////////////////////////////////////////////////////////
     
    95159// Creates a TClonesArray of MCalibrationQEPix containers, initialized to 1 entry, destinated
    96160// to hold one container per pixel. Later, a call to MCalibrationQECam::InitSize()
     161// has to be performed (in MGeomApply).
     162//
     163// Creates a TClonesArray of MCalibrationQEPix containers, initialized to 1 entry, destinated
     164// to hold one container per pixel AREA. Later, a call to MCalibrationQECam::InitAreas()
     165// has to be performed (in MGeomApply).
     166//
     167// Creates a TClonesArray of MCalibrationQEPix containers, initialized to 1 entry, destinated
     168// to hold one container per camera SECTOR. Later, a call to MCalibrationQECam::InitSectors()
    97169// has to be performed (in MGeomApply).
    98170//
     
    140212}
    141213
     214
     215// --------------------------------------------------------------------------
     216//
     217// Not yet implemented
     218//
     219void MCalibrationQECam::DrawPixelContent(Int_t idx) const
     220{
     221  return;
     222}
     223
     224// --------------------------------------------------------------------
     225//
     226// Types used by MCalibrate and MCalibrateData:
     227// ============================================
     228//
     229// 0: Mean Quantum Efficiency for cascades, obtained with the F-Factor method
     230// 1: Error of the Mean QE for cascades, obtained with the F-Factor method
     231// 2: Mean Quantum Efficiency for cascades, obtained with the Blind Pixel method
     232// 3: Error of the Mean QE for cascades, obtained with the Blind Pixel method
     233// 4: Mean Quantum Efficiency for cascades, obtained with the PIN Diode method
     234// 5: Error of the Mean QE for cascades, obtained with the PIN Diode method
     235// 6: Mean Quantum Efficiency for cascades, obtained with combination of the 3 methods
     236// 7: Error of the Mean QE for cascades, obtained with combination of the 3 methods
     237//
     238// Types filled by MCalibrationChargeCalc in combination of MCalibrationChargePix:
     239// ===============================================================================
     240//
     241// 8:  Mean Quantum Efficiency obtained with F-Factor Method ( color: kCT1)
     242// 9:  Error of the Mean QE obtained with F-Factor Method ( color: kCT1)
     243// 10: Mean Quantum Efficiency obtained with F-Factor Method ( color: kGREEN)
     244// 11: Error of the Mean QE obtained with F-Factor Method ( color: kGREEN)
     245// 12: Mean Quantum Efficiency obtained with F-Factor Method ( color: kBLUE)
     246// 13: Error of the Mean QE obtained with F-Factor Method ( color: kBLUE)
     247// 14: Mean Quantum Efficiency obtained with F-Factor Method ( color: kUV)
     248// 15: Error of the Mean QE obtained with F-Factor Method ( color: kUV)
     249//
     250// Types filled by MCalibrationChargeCalc in combination of MCalibrationChargeBlindPix:
     251// ====================================================================================
     252//
     253// 16: Mean Quantum Efficiency obtained with Blind Pixel Method ( color: kCT1)
     254// 17: Error of the Mean QE obtained with Blind Pixel Method ( color: kCT1)
     255// 18: Mean Quantum Efficiency obtained with Blind Pixel Method ( color: kGREEN)
     256// 19: Error of the Mean QE obtained with Blind Pixel Method ( color: kGREEN)
     257// 20: Mean Quantum Efficiency obtained with Blind Pixel Method ( color: kBLUE)
     258// 21: Error of the Mean QE obtained with Blind Pixel Method ( color: kBLUE)
     259// 22: Mean Quantum Efficiency obtained with Blind Pixel Method ( color: kUV)
     260// 23: Error of the Mean QE obtained with Blind Pixel Method ( color: kUV)
     261//
     262// Types filled by MCalibrationChargeCalc in combination of MCalibrationChargePINDiode:
     263// ====================================================================================
     264//
     265// 24: Mean Quantum Efficiency obtained with PIN Diode Method ( color: kCT1)
     266// 25: Error of the Mean QE obtained with PIN Diode Method ( color: kCT1)
     267// 26: Mean Quantum Efficiency obtained with PIN Diode Method ( color: kGREEN)
     268// 27: Error of the Mean QE obtained with PIN Diode Method ( color: kGREEN)
     269// 28: Mean Quantum Efficiency obtained with PIN Diode Method ( color: kBLUE)
     270// 29: Error of the Mean QE obtained with PIN Diode Method ( color: kBLUE)
     271// 30: Mean Quantum Efficiency obtained with PIN Diode Method ( color: kUV)
     272// 31: Error of the Mean QE obtained with PIN Diode Method ( color: kUV)
     273//
     274// Types filled by MCalibrationChargeCalc in combination of MCalibrationQEPix:
     275// ===========================================================================
     276//
     277// 24: Mean Quantum Efficiency obtained with combination of 3 methods ( color: kCT1)
     278// 25: Error of the Mean QE obtained with combination of 3 methods ( color: kCT1)
     279// 26: Mean Quantum Efficiency obtained with combination of 3 methods ( color: kGREEN)
     280// 27: Error of the Mean QE obtained with combination of 3 methods ( color: kGREEN)
     281// 28: Mean Quantum Efficiency obtained with combination of 3 methods ( color: kBLUE)
     282// 29: Error of the Mean QE obtained with combination of 3 methods ( color: kBLUE)
     283// 30: Mean Quantum Efficiency obtained with combination of 3 methods ( color: kUV)
     284// 31: Error of the Mean QE obtained with combination of 3 methods ( color: kUV)
     285//
     286Bool_t MCalibrationQECam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
     287{
     288
     289  if (idx > GetSize())
     290    return kFALSE;
     291
     292  MCalibrationQEPix &pix = (MCalibrationQEPix&)(*this)[idx];
     293
     294  if (pix.IsExcluded())
     295    return kFALSE;
     296
     297  switch (type)
     298    {
     299    case 0:
     300      val = pix.GetQECascadesFFactor();
     301      break;
     302    case 1:
     303      val = pix.GetQECascadesFFactorErr();
     304      break;
     305    case 2:
     306      val = pix.GetQECascadesBlindPixel();
     307      break;
     308    case 3:
     309      val = pix.GetQECascadesBlindPixelErr();
     310      break;
     311    case 4:
     312      val = pix.GetQECascadesPINDiode();
     313      break;
     314    case 5:
     315      val = pix.GetQECascadesPINDiodeErr();
     316      break;
     317    case 6:
     318      val = pix.GetQECascadesCombined();
     319      break;
     320    case 7:
     321      val = pix.GetQECascadesCombinedErr();
     322      break;
     323    case 8:
     324      val = pix.GetQEFFactor(kCT1);
     325      break;
     326    case 9:
     327      val = pix.GetQEFFactorErr(kCT1);
     328      break;
     329    case 10:
     330      val = pix.GetQEFFactor(kGREEN);
     331      break;
     332    case 11:
     333      val = pix.GetQEFFactorErr(kGREEN);
     334      break;
     335    case 12:
     336      val = pix.GetQEFFactor(kBLUE);
     337      break;
     338    case 13:
     339      val = pix.GetQEFFactorErr(kBLUE);
     340      break;
     341    case 14:
     342      val = pix.GetQEFFactor(kUV);
     343      break;
     344    case 15:
     345      val = pix.GetQEFFactorErr(kUV);
     346      break;
     347    case 16:
     348      val = pix.GetQEBlindPixel(kCT1);
     349      break;
     350    case 17:
     351      val = pix.GetQEBlindPixelErr(kCT1);
     352      break;
     353    case 18:
     354      val = pix.GetQEBlindPixel(kGREEN);
     355      break;
     356    case 19:
     357      val = pix.GetQEBlindPixelErr(kGREEN);
     358      break;
     359    case 20:
     360      val = pix.GetQEBlindPixel(kBLUE);
     361      break;
     362    case 21:
     363      val = pix.GetQEBlindPixelErr(kBLUE);
     364      break;
     365    case 22:
     366      val = pix.GetQEBlindPixel(kUV);
     367      break;
     368    case 23:
     369      val = pix.GetQEBlindPixelErr(kUV);
     370      break;
     371    case 24:
     372      val = pix.GetQEPINDiode(kCT1);
     373      break;
     374    case 25:
     375      val = pix.GetQEPINDiodeErr(kCT1);
     376      break;
     377    case 26:
     378      val = pix.GetQEPINDiode(kGREEN);
     379      break;
     380    case 27:
     381      val = pix.GetQEPINDiodeErr(kGREEN);
     382      break;
     383    case 28:
     384      val = pix.GetQEPINDiode(kBLUE);
     385      break;
     386    case 29:
     387      val = pix.GetQEPINDiodeErr(kBLUE);
     388      break;
     389    case 30:
     390      val = pix.GetQEPINDiode(kUV);
     391      break;
     392    case 31:
     393      val = pix.GetQEPINDiodeErr(kUV);
     394      break;
     395    case 32:
     396      val = pix.GetQECombined(kCT1);
     397      break;
     398    case 33:
     399      val = pix.GetQECombinedErr(kCT1);
     400      break;
     401    case 34:
     402      val = pix.GetQECombined(kGREEN);
     403      break;
     404    case 35:
     405      val = pix.GetQECombinedErr(kGREEN);
     406      break;
     407    case 36:
     408      val = pix.GetQECombined(kBLUE);
     409      break;
     410    case 37:
     411      val = pix.GetQECombinedErr(kBLUE);
     412      break;
     413    case 38:
     414      val = pix.GetQECombined(kUV);
     415      break;
     416    case 39:
     417      val = pix.GetQECombinedErr(kUV);
     418      break;
     419    default:
     420      return kFALSE;
     421    }
     422  return val!=-1.;
     423}
     424
    142425// --------------------------------------------------------------------------
    143426//
    144427// Return -1 if gkPlexiglassQEErr is smaller than 0.
    145428// Return -1 if gkPlexiglassQE    is 0.
    146 // Return gkPlexiglassQEErr^2 / (gkPlexiglassQE^2 )
     429// Return gkPlexiglassQEErr^2 / gkPlexiglassQE^2
    147430//
    148431Float_t MCalibrationQECam::GetPlexiglassQERelVar() const
     
    158441
    159442
    160 void MCalibrationQECam::SetBlindPixelMethodValid ( Bool_t b )
    161 {
    162   SetBlindPixelMethodValid ( b, MCalibrationCam::kGREEN);
    163   SetBlindPixelMethodValid ( b, MCalibrationCam::kBLUE );
    164   SetBlindPixelMethodValid ( b, MCalibrationCam::kUV   );
    165   SetBlindPixelMethodValid ( b, MCalibrationCam::kCT1  );
    166 }
    167 
    168 void MCalibrationQECam::SetCombinedMethodValid ( Bool_t b )
    169 {
    170   SetCombinedMethodValid ( b, MCalibrationCam::kGREEN);
    171   SetCombinedMethodValid ( b, MCalibrationCam::kBLUE );
    172   SetCombinedMethodValid ( b, MCalibrationCam::kUV   );
    173   SetCombinedMethodValid ( b, MCalibrationCam::kCT1  );
    174 }
    175 
    176 void MCalibrationQECam::SetFFactorMethodValid ( Bool_t b )
    177 {
    178   SetFFactorMethodValid ( b, MCalibrationCam::kGREEN);
    179   SetFFactorMethodValid ( b, MCalibrationCam::kBLUE );
    180   SetFFactorMethodValid ( b, MCalibrationCam::kUV   );
    181   SetFFactorMethodValid ( b, MCalibrationCam::kCT1  );
    182 }
    183 
    184 void MCalibrationQECam::SetPINDiodeMethodValid ( Bool_t b )
    185 {
    186   SetPINDiodeMethodValid ( b, MCalibrationCam::kGREEN);
    187   SetPINDiodeMethodValid ( b, MCalibrationCam::kBLUE );
    188   SetPINDiodeMethodValid ( b, MCalibrationCam::kUV   );
    189   SetPINDiodeMethodValid ( b, MCalibrationCam::kCT1  );
    190 }
    191 
    192 void MCalibrationQECam::SetBlindPixelMethodValid ( Bool_t b,  MCalibrationCam::PulserColor_t col )
    193 {
    194   if (b)
    195     SETBIT(fFlags[ MCalibrationCam::kGREEN ],kBlindPixelMethodValid);
    196   else
    197     CLRBIT(fFlags[ MCalibrationCam::kGREEN ],kBlindPixelMethodValid);   
    198 }
    199 
    200 void MCalibrationQECam::SetPINDiodeMethodValid ( Bool_t b,  MCalibrationCam::PulserColor_t col )
    201 {
    202   if (b)
    203     SETBIT(fFlags[ MCalibrationCam::kGREEN ],kPINDiodeMethodValid);
    204   else
    205     CLRBIT(fFlags[ MCalibrationCam::kGREEN ],kPINDiodeMethodValid);   
    206 }
    207 
    208 void MCalibrationQECam::SetFFactorMethodValid ( Bool_t b,  MCalibrationCam::PulserColor_t col )
    209 {
    210   if (b)
    211     SETBIT(fFlags[ MCalibrationCam::kGREEN ],kFFactorMethodValid);
    212   else
    213     CLRBIT(fFlags[ MCalibrationCam::kGREEN ],kFFactorMethodValid);   
    214 }
    215 
    216 void MCalibrationQECam::SetCombinedMethodValid ( Bool_t b,  MCalibrationCam::PulserColor_t col )
    217 {
    218   if (b)
    219     SETBIT(fFlags[ MCalibrationCam::kGREEN ],kCombinedMethodValid);
    220   else
    221     CLRBIT(fFlags[ MCalibrationCam::kGREEN ],kCombinedMethodValid);   
    222 }
    223 
     443// --------------------------------------------------------------------------------
     444//
     445// Returns kTRUE if ANY of the four colours have the bit kBlindPixelMethodValid set,
     446// otherwise kFALSE
     447//
    224448Bool_t MCalibrationQECam::IsBlindPixelMethodValid () const 
    225449{
     
    236460}
    237461
     462// --------------------------------------------------------------------------------
     463//
     464// Returns kTRUE if ANY of the four colours have the bit kCombinedMethodValid set,
     465// otherwise kFALSE
     466//
    238467Bool_t MCalibrationQECam::IsCombinedMethodValid () const
    239468{
     
    250479}
    251480
     481// --------------------------------------------------------------------------------
     482//
     483// Returns kTRUE if ANY of the four colours have the bit kFFactorMethodValid set,
     484// otherwise kFALSE
     485//
    252486Bool_t MCalibrationQECam::IsFFactorMethodValid () const
    253487{
     
    265499
    266500
     501// --------------------------------------------------------------------------------
     502//
     503// Returns kTRUE if ANY of the four colours have the bit kPINDiodeMethodValid set,
     504// otherwise kFALSE
     505//
    267506Bool_t MCalibrationQECam::IsPINDiodeMethodValid () const
    268507{
     
    279518}
    280519
     520// --------------------------------------------------------------------------------
     521//
     522// Returns kTRUE if ANY of the bit kBlindPixelMethodValid is set for colour "col"
     523// otherwise kFALSE
     524//
    281525Bool_t MCalibrationQECam::IsBlindPixelMethodValid (MCalibrationCam::PulserColor_t col)  const
    282526{
     
    284528}
    285529
     530// --------------------------------------------------------------------------------
     531//
     532// Returns kTRUE if ANY of the bit kCombinedMethodValid is set for colour "col"
     533// otherwise kFALSE
     534//
    286535Bool_t MCalibrationQECam::IsCombinedMethodValid (MCalibrationCam::PulserColor_t col)  const
    287536{
     
    289538}
    290539
     540// --------------------------------------------------------------------------------
     541//
     542// Returns kTRUE if ANY of the bit kFFactorMethodValid is set for colour "col"
     543// otherwise kFALSE
     544//
    291545Bool_t MCalibrationQECam::IsFFactorMethodValid (MCalibrationCam::PulserColor_t col)  const
    292546{
     
    294548}
    295549
     550// --------------------------------------------------------------------------------
     551//
     552// Returns kTRUE if ANY of the bit kPINDiodeMethodValid is set for colour "col"
     553// otherwise kFALSE
     554//
    296555Bool_t MCalibrationQECam::IsPINDiodeMethodValid (MCalibrationCam::PulserColor_t col)  const
    297556{
     
    301560// --------------------------------------------------------------------------
    302561//
    303 // Print first the well fitted pixels
    304 // and then the ones which are not FitValid
     562// Print the
     563// - MCalibrationQEPix::GetQECascadesFFactor()
     564// - MCalibrationQEPix::GetQECascadesBlindPixel()
     565// - MCalibrationQEPix::GetQECascadesPINDiode()
     566// - MCalibrationQEPix::GetQECascadesCombined()
     567// for all pixels
    305568//
    306569void MCalibrationQECam::Print(Option_t *o) const
     
    310573  int id = 0;
    311574 
     575  *fLog << all << endl;
     576  *fLog << all << "Quantum Efficiencies averaged over cascades spectra, measured with F-Factor method:" << endl;
     577  *fLog << all << endl;
     578
    312579  TIter Next(fPixels);
    313580  MCalibrationQEPix *pix;
     
    315582    {
    316583     
    317       if (!pix->IsExcluded() && pix->IsValid())
     584      if (!pix->IsExcluded() && pix->IsAverageQEFFactorAvailable())
    318585        {
     586          *fLog << all
     587                << Form("%s%4i%s%4.2f%s%4.2f","Pix  ",pix->GetPixId(),
     588                        ":  QE: ",pix->GetQECascadesFFactor()," +- ",pix->GetQECascadesFFactorErr())
     589                << endl;
    319590          id++;
    320591        }
     
    325596 
    326597  *fLog << all << endl;
    327   *fLog << all << "Pixels with errors:" << endl;
     598  *fLog << all << "Quantum Efficiencies averaged over cascades spectra, "
     599        << "measured with Blind Pixel method:" << endl;
    328600  *fLog << all << endl;
    329601 
     
    332604      {
    333605       
    334         if (!pix->IsExcluded() && !pix->IsValid())
    335           {
    336             id++;
    337           }
     606      if (!pix->IsExcluded() && pix->IsAverageQEBlindPixelAvailable())
     607        {
     608          *fLog << all
     609                << Form("%s%4i%s%4.2f%s%4.2f","Pix  ",pix->GetPixId(),
     610                        ":  QE: ",pix->GetQECascadesBlindPixel()," +- ",pix->GetQECascadesBlindPixelErr())
     611                << endl;
     612          id++;
     613        }
    338614      }
    339     *fLog << all << id << " pixels with errors :-((" << endl;
     615
     616  *fLog << all << id << " succesful pixels :-))" << endl;
     617  id = 0;
     618 
     619  *fLog << all << endl;
     620  *fLog << all << "Quantum Efficiencies averaged over cascades spectra, "
     621        << "measured with PIN Diode method:" << endl;
     622  *fLog << all << endl;
     623 
     624  TIter Next3(fPixels);
     625    while ((pix=(MCalibrationQEPix*)Next3()))
     626      {
     627       
     628      if (!pix->IsExcluded() && pix->IsAverageQEPINDiodeAvailable())
     629        {
     630          *fLog << all
     631                << Form("%s%4i%s%4.2f%s%4.2f","Pix  ",pix->GetPixId(),
     632                        ":  QE: ",pix->GetQECascadesPINDiode()," +- ",pix->GetQECascadesPINDiodeErr())
     633                << endl;
     634          id++;
     635        }
     636      }
     637
     638  *fLog << all << id << " succesful pixels :-))" << endl;
     639  id = 0;
    340640
    341641   
    342642  *fLog << all << endl;
     643  *fLog << all << "Quantum Efficiencies averaged over cascades spectra, "
     644        << "measured with combination of the 3 methods:" << endl;
     645  *fLog << all << endl;
     646 
     647  TIter Next4(fPixels);
     648    while ((pix=(MCalibrationQEPix*)Next4()))
     649      {
     650       
     651      if (!pix->IsExcluded() && pix->IsAverageQECombinedAvailable())
     652        {
     653          *fLog << all
     654                << Form("%s%4i%s%4.2f%s%4.2f","Pix  ",pix->GetPixId(),
     655                        ":  QE: ",pix->GetQECascadesCombined()," +- ",pix->GetQECascadesCombinedErr())
     656                << endl;
     657          id++;
     658        }
     659      }
     660
     661  *fLog << all << id << " succesful pixels :-))" << endl;
     662  id = 0;
     663
     664  *fLog << all << endl;
    343665  *fLog << all << "Excluded pixels:" << endl;
    344666  *fLog << all << endl;
    345667 
    346   id = 0;
    347 
    348   TIter Next4(fPixels);
    349   while ((pix=(MCalibrationQEPix*)Next4()))
     668  TIter Next5(fPixels);
     669  while ((pix=(MCalibrationQEPix*)Next5()))
    350670  {
    351671      if (pix->IsExcluded())
     
    358678}
    359679
    360 // --------------------------------------------------------------------
    361 //                                                                         
    362 // The calculated values (types) are:
    363 //
    364 // 0: Mean Quantum Efficiency of the color: kCT1
    365 // 1: Error of the Mean Quantum Efficiency of the color: kCT1
    366 // 2: Mean Quantum Efficiency of the color: kGREEN
    367 // 3: Error of the Mean Quantum Efficiency of the color: kGreen
    368 // 4: Mean Quantum Efficiency of the color: kBLUE
    369 // 5: Error of the Mean Quantum Efficiency of the color: kBlue
    370 // 6: Mean Quantum Efficiency of the color: kUV
    371 // 7: Error of the Mean Quantum Efficiency of the color: kUV
    372 //
    373 Bool_t MCalibrationQECam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
    374 {
    375 
    376   if (idx > GetSize())
    377     return kFALSE;
    378 
    379   MCalibrationQEPix &pix = (MCalibrationQEPix&)(*this)[idx];
    380 
    381   if (pix.IsExcluded())
    382     return kFALSE;
    383 
    384   switch (type)
    385     {
    386     case 0:
    387       val = pix.GetQECascadesFFactor();
    388       break;
    389     case 1:
    390       val = pix.GetQECascadesFFactorErr();
    391       break;
    392     case 2:
    393       val = pix.GetQECascadesBlindPixel();
    394       break;
    395     case 3:
    396       val = pix.GetQECascadesBlindPixelErr();
    397       break;
    398     case 4:
    399       val = pix.GetQECascadesPINDiode();
    400       break;
    401     case 5:
    402       val = pix.GetQECascadesPINDiodeErr();
    403       break;
    404     case 6:
    405       val = pix.GetQECascadesCombined();
    406       break;
    407     case 7:
    408       val = pix.GetQECascadesCombinedErr();
    409       break;
    410     case 8:
    411       val = pix.GetQEFFactor(kCT1);
    412       break;
    413     case 9:
    414       val = pix.GetQEFFactorErr(kCT1);
    415       break;
    416     case 10:
    417       val = pix.GetQEFFactor(kGREEN);
    418       break;
    419     case 11:
    420       val = pix.GetQEFFactorErr(kGREEN);
    421       break;
    422     case 12:
    423       val = pix.GetQEFFactor(kBLUE);
    424       break;
    425     case 13:
    426       val = pix.GetQEFFactorErr(kBLUE);
    427       break;
    428     case 14:
    429       val = pix.GetQEFFactor(kUV);
    430       break;
    431     case 15:
    432       val = pix.GetQEFFactorErr(kUV);
    433       break;
    434     default:
    435       return kFALSE;
    436     }
    437   return val!=-1.;
    438 }
    439 
    440 // --------------------------------------------------------------------------
    441 //
    442 // Not yet implemented
    443 //
    444 void MCalibrationQECam::DrawPixelContent(Int_t idx) const
    445 {
    446   return;
    447 }
    448 
    449 
    450 
    451 
    452 
    453 
    454 
    455 
    456 
     680
     681// --------------------------------------------------------------------------
     682//
     683// Sets the validity flag (according to b) for the Blind Pixel Method,
     684// for all colours (kGREEN, kBLUE, kUV, kCT1)
     685//
     686void MCalibrationQECam::SetBlindPixelMethodValid ( const Bool_t b )
     687{
     688  SetBlindPixelMethodValid ( b, MCalibrationCam::kGREEN);
     689  SetBlindPixelMethodValid ( b, MCalibrationCam::kBLUE );
     690  SetBlindPixelMethodValid ( b, MCalibrationCam::kUV   );
     691  SetBlindPixelMethodValid ( b, MCalibrationCam::kCT1  );
     692}
     693
     694// ----------------------------------------------------------------------------
     695//
     696// Sets the validity flag (according to b) for the combination of the 3 methods
     697// for all colours (kGREEN, kBLUE, kUV, kCT1)
     698//
     699void MCalibrationQECam::SetCombinedMethodValid ( const Bool_t b )
     700{
     701  SetCombinedMethodValid ( b, MCalibrationCam::kGREEN);
     702  SetCombinedMethodValid ( b, MCalibrationCam::kBLUE );
     703  SetCombinedMethodValid ( b, MCalibrationCam::kUV   );
     704  SetCombinedMethodValid ( b, MCalibrationCam::kCT1  );
     705}
     706
     707// --------------------------------------------------------------------------
     708//
     709// Sets the validity flag (according to b) for the F-Factor Method
     710// for all colours (kGREEN, kBLUE, kUV, kCT1)
     711//
     712void MCalibrationQECam::SetFFactorMethodValid ( const Bool_t b )
     713{
     714  SetFFactorMethodValid ( b, MCalibrationCam::kGREEN);
     715  SetFFactorMethodValid ( b, MCalibrationCam::kBLUE );
     716  SetFFactorMethodValid ( b, MCalibrationCam::kUV   );
     717  SetFFactorMethodValid ( b, MCalibrationCam::kCT1  );
     718}
     719
     720// --------------------------------------------------------------------------
     721//
     722// Sets the validity flag (according to b) for the PIN Diode Method,
     723// for all colours (kGREEN, kBLUE, kUV, kCT1)
     724//
     725void MCalibrationQECam::SetPINDiodeMethodValid ( const Bool_t b )
     726{
     727  SetPINDiodeMethodValid ( b, MCalibrationCam::kGREEN);
     728  SetPINDiodeMethodValid ( b, MCalibrationCam::kBLUE );
     729  SetPINDiodeMethodValid ( b, MCalibrationCam::kUV   );
     730  SetPINDiodeMethodValid ( b, MCalibrationCam::kCT1  );
     731}
     732
     733// --------------------------------------------------------------------------
     734//
     735// Sets the validity flag (according to b) for the Blind Pixel Method,
     736// for colour "col"
     737//
     738void MCalibrationQECam::SetBlindPixelMethodValid ( const Bool_t b,  MCalibrationCam::PulserColor_t col )
     739{
     740  if (b)
     741    SETBIT(fFlags[ MCalibrationCam::kGREEN ],kBlindPixelMethodValid);
     742  else
     743    CLRBIT(fFlags[ MCalibrationCam::kGREEN ],kBlindPixelMethodValid);   
     744}
     745
     746// --------------------------------------------------------------------------
     747//
     748// Sets the validity flag (according to b) for the combination of 3 methods
     749// for colour "col"
     750//
     751void MCalibrationQECam::SetCombinedMethodValid ( const Bool_t b,  MCalibrationCam::PulserColor_t col )
     752{
     753  if (b)
     754    SETBIT(fFlags[ MCalibrationCam::kGREEN ],kCombinedMethodValid);
     755  else
     756    CLRBIT(fFlags[ MCalibrationCam::kGREEN ],kCombinedMethodValid);   
     757}
     758
     759// --------------------------------------------------------------------------
     760//
     761// Sets the validity flag (according to b) for the F-Factor Method,
     762// for colour "col"
     763//
     764void MCalibrationQECam::SetFFactorMethodValid ( const Bool_t b,  MCalibrationCam::PulserColor_t col )
     765{
     766  if (b)
     767    SETBIT(fFlags[ MCalibrationCam::kGREEN ],kFFactorMethodValid);
     768  else
     769    CLRBIT(fFlags[ MCalibrationCam::kGREEN ],kFFactorMethodValid);   
     770}
     771
     772// --------------------------------------------------------------------------
     773//
     774// Sets the validity flag (according to b) for the PIN Diode Method,
     775// for colour "col"
     776//
     777void MCalibrationQECam::SetPINDiodeMethodValid ( const Bool_t b,  MCalibrationCam::PulserColor_t col )
     778{
     779  if (b)
     780    SETBIT(fFlags[ MCalibrationCam::kGREEN ],kPINDiodeMethodValid);
     781  else
     782    CLRBIT(fFlags[ MCalibrationCam::kGREEN ],kPINDiodeMethodValid);   
     783}
     784
     785
     786
     787
     788
     789
     790
     791
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.h

    r3680 r3691  
    2727  ~MCalibrationQECam() {}
    2828
    29   void Clear( Option_t *o="");
     29  void    Clear( Option_t *o="");
    3030 
    31   Float_t GetPlexiglassQE       () const { return gkPlexiglassQE; }
    32   Float_t GetPlexiglassQERelVar () const;
     31  // Others
     32  void    DrawPixelContent( Int_t num ) const;   
     33  Bool_t  GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0 ) const;
    3334
    34   // Only for MC (Ciao Abelardo!!)
    35   void SetBlindPixelMethodValid ( Bool_t  b=kTRUE );
    36   void SetFFactorMethodValid    ( Bool_t  b=kTRUE ); 
    37   void SetCombinedMethodValid   ( Bool_t  b=kTRUE );
    38   void SetPINDiodeMethodValid   ( Bool_t  b=kTRUE ); 
     35  Float_t GetPlexiglassQE          () const { return gkPlexiglassQE; }
     36  Float_t GetPlexiglassQERelVar    () const;
    3937
    40   void SetBlindPixelMethodValid ( Bool_t  b, MCalibrationCam::PulserColor_t col);
    41   void SetFFactorMethodValid    ( Bool_t  b, MCalibrationCam::PulserColor_t col); 
    42   void SetCombinedMethodValid   ( Bool_t  b, MCalibrationCam::PulserColor_t col);
    43   void SetPINDiodeMethodValid   ( Bool_t  b, MCalibrationCam::PulserColor_t col); 
    44 
    45   Bool_t IsBlindPixelMethodValid() const;
    46   Bool_t IsFFactorMethodValid   () const; 
    47   Bool_t IsCombinedMethodValid  () const; 
    48   Bool_t IsPINDiodeMethodValid  () const; 
    49 
    50   Bool_t IsBlindPixelMethodValid(MCalibrationCam::PulserColor_t col) const;
    51   Bool_t IsFFactorMethodValid   (MCalibrationCam::PulserColor_t col) const; 
    52   Bool_t IsCombinedMethodValid  (MCalibrationCam::PulserColor_t col) const; 
    53   Bool_t IsPINDiodeMethodValid  (MCalibrationCam::PulserColor_t col) const; 
     38  Bool_t  IsBlindPixelMethodValid  () const;
     39  Bool_t  IsFFactorMethodValid     () const; 
     40  Bool_t  IsCombinedMethodValid    () const; 
     41  Bool_t  IsPINDiodeMethodValid    () const; 
     42         
     43  Bool_t  IsBlindPixelMethodValid  ( MCalibrationCam::PulserColor_t col ) const;
     44  Bool_t  IsFFactorMethodValid     ( MCalibrationCam::PulserColor_t col ) const; 
     45  Bool_t  IsCombinedMethodValid    ( MCalibrationCam::PulserColor_t col ) const; 
     46  Bool_t  IsPINDiodeMethodValid    ( MCalibrationCam::PulserColor_t col ) const; 
    5447
    5548  // Prints
    56   void Print(Option_t *o="") const;
     49  void    Print(Option_t *o="")      const;
    5750 
    58   // Others
    59   Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    60   void DrawPixelContent(Int_t num) const;   
     51  // Setters (without color only for MC!)
     52  void    SetBlindPixelMethodValid ( const Bool_t  b=kTRUE );
     53  void    SetBlindPixelMethodValid ( const Bool_t  b, MCalibrationCam::PulserColor_t col);
     54  void    SetCombinedMethodValid   ( const Bool_t  b=kTRUE );
     55  void    SetCombinedMethodValid   ( const Bool_t  b, MCalibrationCam::PulserColor_t col);
     56  void    SetFFactorMethodValid    ( const Bool_t  b=kTRUE ); 
     57  void    SetFFactorMethodValid    ( const Bool_t  b, MCalibrationCam::PulserColor_t col); 
     58  void    SetPINDiodeMethodValid   ( const Bool_t  b=kTRUE ); 
     59  void    SetPINDiodeMethodValid   ( const Bool_t  b, MCalibrationCam::PulserColor_t col); 
    6160
    62   ClassDef(MCalibrationQECam, 1)        // Container Quantum Efficieny Calibration Results Camera
     61  ClassDef(MCalibrationQECam, 1) // Container Quantum Efficieny Calibration Results Camera
    6362};
    6463
Note: See TracChangeset for help on using the changeset viewer.