Changeset 4670 for trunk


Ignore:
Timestamp:
08/17/04 23:38:13 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4669 r4670  
    6060       function of MCalibrationCam
    6161
     62   * mcalib/MCalibrationChargeCalc.cc
     63     - some changes to the output
     64     - call to MCalibrationChargeBlindCam->IsValid() removed
     65
    6266   * mbadpixels/MBadPixelsCam.cc
    6367     - included kDeviatingNumPhots in GetPixelContent()
     
    6872     - found that the MFillH for the MHCalibrationChargeBlindCam had
    6973       been replaced to MHCalibrationChargeBlindPix -> redone
     74     - adapted InitBlindPixel() to new classes initializing the right
     75       MCalibrationChargeBlindCam's
    7076
    7177   * mcalib/MCalibrationTestPix.[h,cc]
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r4271 r4670  
    147147{
    148148
    149   fPixels->ForEach(TObject, Clear)();
    150 
    151   //
    152   // another ForEach does not compile, thus have to do the loop ourselves:
    153   //
    154   for (Int_t i=0;i<GetAverageAreas();i++)
    155     {
    156       fAverageAreas[i].Clear();
    157       fAverageBadAreas[i].Clear();
    158     }
    159 
    160   //
    161   // another ForEach does not compile, thus have to do the loop ourselves:
    162   //
    163   for (Int_t i=0;i<GetAverageSectors();i++)
    164     {
    165       fAverageSectors[i].Clear();
    166       fAverageBadSectors[i].Clear();
    167     }
     149  {  fPixels        ->ForEach(TObject, Clear)();  }
     150  {  fAverageAreas  ->ForEach(TObject, Clear)();  }
     151  {  fAverageSectors->ForEach(TObject, Clear)();  }
    168152 
    169153  return;
     
    366350}
    367351
     352// --------------------------------------------------------------------------
     353//
    368354// Returns the current size of the TClonesArray fPixels
    369355// independently if the MCalibrationPix is filled with values or not.
     356//
    370357const Int_t MCalibrationCam::GetSize() const
    371358{
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeBlindPix.cc

    r4244 r4670  
    3333//
    3434// Currently, the following numbers are implemented:
    35 // - gkBlindPixelArea: 100 mm^2
     35// - fArea: 100 mm^2
    3636// - Average QE of Blind Pixel:
    37 //    gkBlindPixelQEGreen: 0.154
    38 //    gkBlindPixelQEBlue : 0.226
    39 //    gkBlindPixelQEUV   : 0.247
    40 //    gkBlindPixelQECT1  : 0.247
     37//    fQEGreen: 0.154
     38//    fQEBlue : 0.226
     39//    fQEUV   : 0.247
     40//    fQECT1  : 0.247
    4141// - Average QE Error of Blind Pixel:
    42 //    gkBlindPixelQEGreenErr: 0.015;
    43 //    gkBlindPixelQEBlueErr : 0.02;
    44 //    gkBlindPixelQEUVErr   : 0.02;
    45 //    gkBlindPixelQECT1Err  : 0.02;
     42//    fQEGreenErr: 0.015;
     43//    fQEBlueErr : 0.02;
     44//    fQEUVErr   : 0.02;
     45//    fQECT1Err  : 0.02;
    4646// - Attenuation factor Blind Pixel:
    47 //    gkBlindPixelAttGreen :  1.97;
    48 //    gkBlindPixelAttBlue  :  1.96;
    49 //    gkBlindPixelAttUV    :  1.95;
    50 //    gkBlindPixelAttCT1   :  1.95;
     47//    fAttGreen :  1.97;
     48//    fAttBlue  :  1.96;
     49//    fAttUV    :  1.95;
     50//    fAttCT1   :  1.95;
    5151//
    5252//
     
    6363
    6464using namespace std;
    65 const Float_t MCalibrationChargeBlindPix::gkBlindPixelArea       = 100;
    66 const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttGreen   = 1.97;
    67 const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttBlue    = 1.96;
    68 const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttUV      = 1.95;
    69 const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttCT1     = 1.95;
    70 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedGreen    = 0.154;
    71 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedBlue     = 0.226;
    72 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedUV       = 0.247;
    73 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedCT1      = 0.247;
    74 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedGreenErr = 0.005;
    75 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedBlueErr  = 0.007;
    76 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedUVErr    = 0.01;
    77 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedCT1Err   = 0.01;
    78 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedGreen      = 0.192;
    79 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedBlue       = 0.27;
    80 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedUV         = 0.285;
    81 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedCT1        = 0.285;
    82 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedGreenErr   = 0.007;
    83 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedBlueErr    = 0.01;
    84 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedUVErr      = 0.012;
    85 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedCT1Err     = 0.012;
    86 const Float_t MCalibrationChargeBlindPix::gkBlindPixelCollectionEff      = 0.95;
    87 const Float_t MCalibrationChargeBlindPix::gkBlindPixelCollectionEffErr   = 0.02;
     65const Float_t MCalibrationChargeBlindPix::fgArea       = 100;
     66const Float_t MCalibrationChargeBlindPix::fgAttGreen   = 1.97;
     67const Float_t MCalibrationChargeBlindPix::fgAttBlue    = 1.96;
     68const Float_t MCalibrationChargeBlindPix::fgAttUV      = 1.95;
     69const Float_t MCalibrationChargeBlindPix::fgAttCT1     = 1.95;
     70const Float_t MCalibrationChargeBlindPix::fgAttErr     = 0.01;
     71const Float_t MCalibrationChargeBlindPix::fgQEGreen    = 0.154;
     72const Float_t MCalibrationChargeBlindPix::fgQEBlue     = 0.226;
     73const Float_t MCalibrationChargeBlindPix::fgQEUV       = 0.247;
     74const Float_t MCalibrationChargeBlindPix::fgQECT1      = 0.247;
     75const Float_t MCalibrationChargeBlindPix::fgQEErrGreen = 0.005;
     76const Float_t MCalibrationChargeBlindPix::fgQEErrBlue  = 0.007;
     77const Float_t MCalibrationChargeBlindPix::fgQEErrUV    = 0.01;
     78const Float_t MCalibrationChargeBlindPix::fgQEErrCT1   = 0.01;
     79const Float_t MCalibrationChargeBlindPix::fgCollEffGreen = 0.99;
     80const Float_t MCalibrationChargeBlindPix::fgCollEffBlue  = 0.93;
     81const Float_t MCalibrationChargeBlindPix::fgCollEffUV    = 0.90;
     82const Float_t MCalibrationChargeBlindPix::fgCollEffCT1   = 0.90;
     83const Float_t MCalibrationChargeBlindPix::fgCollEffErr   = 0.05;
    8884// --------------------------------------------------------------------------
    8985//
     
    9288// Calls:
    9389// - Clear()
    94 // - SetCoated()
     90//
     91// For backward-compatibility reasons, quantum eff., coll. eff. and att.
     92// are intialized from the static members. This should, however, be
     93// overwritten by a class deriving from MCalibrationChargeBlindCam.
    9594//
    9695MCalibrationChargeBlindPix::MCalibrationChargeBlindPix(const char *name, const char *title)
     
    10099  fTitle = title ? title : "Container of the fit results of the blind pixel";
    101100
    102   SetCoated();
    103101  Clear();
     102
     103  fArea = fgArea;
     104
     105  fAtt       .Set( MCalibrationCam::gkNumPulserColors );       
     106  fAttErr    .Set( MCalibrationCam::gkNumPulserColors );   
     107  fQE        .Set( MCalibrationCam::gkNumPulserColors );       
     108  fQEErr     .Set( MCalibrationCam::gkNumPulserColors );     
     109  fCollEff   .Set( MCalibrationCam::gkNumPulserColors );     
     110  fCollEffErr.Set( MCalibrationCam::gkNumPulserColors );
     111
     112  SetAtt        ( fgAttGreen,     MCalibrationCam::kGREEN );
     113  SetAtt        ( fgAttBlue,      MCalibrationCam::kBLUE  );
     114  SetAtt        ( fgAttUV   ,     MCalibrationCam::kUV    );
     115  SetAtt        ( fgAttCT1  ,     MCalibrationCam::kCT1   );
     116
     117  SetAttErr     ( fgAttErr  ,     MCalibrationCam::kGREEN );
     118  SetAttErr     ( fgAttErr ,      MCalibrationCam::kBLUE  );
     119  SetAttErr     ( fgAttErr  ,     MCalibrationCam::kUV    );
     120  SetAttErr     ( fgAttErr  ,     MCalibrationCam::kCT1   );
     121 
     122  SetQE         ( fgQEGreen,      MCalibrationCam::kGREEN );
     123  SetQE         ( fgQEBlue,       MCalibrationCam::kBLUE  );
     124  SetQE         ( fgQEUV   ,      MCalibrationCam::kUV    );
     125  SetQE         ( fgQECT1  ,      MCalibrationCam::kCT1   );
     126
     127  SetQEErr      ( fgQEErrGreen,   MCalibrationCam::kGREEN );
     128  SetQEErr      ( fgQEErrBlue,    MCalibrationCam::kBLUE  );
     129  SetQEErr      ( fgQEErrUV   ,   MCalibrationCam::kUV    );
     130  SetQEErr      ( fgQEErrCT1  ,   MCalibrationCam::kCT1   );
     131
     132  SetCollEff    ( fgCollEffGreen, MCalibrationCam::kGREEN );
     133  SetCollEff    ( fgCollEffBlue,  MCalibrationCam::kBLUE  );
     134  SetCollEff    ( fgCollEffUV   , MCalibrationCam::kUV    );
     135  SetCollEff    ( fgCollEffCT1  , MCalibrationCam::kCT1   );
     136
     137  SetCollEffErr ( fgCollEffErr,   MCalibrationCam::kGREEN );
     138  SetCollEffErr ( fgCollEffErr,   MCalibrationCam::kBLUE  );
     139  SetCollEffErr ( fgCollEffErr,   MCalibrationCam::kUV    );
     140  SetCollEffErr ( fgCollEffErr,   MCalibrationCam::kCT1   );
     141
    104142}
    105143
     
    141179  SetColor(MCalibrationCam::kNONE);
    142180
    143   MCalibrationChargePix::Clear();
     181  MCalibrationPix::Clear();
    144182}
    145183
     
    149187}
    150188
    151 // --------------------------------------------------------------------------
    152 //
    153 // Set the Coated Bit from outside
    154 //
    155 void  MCalibrationChargeBlindPix::SetCoated( const Bool_t b)
    156 {
    157     b ? SETBIT(fFlags,kCoated) : CLRBIT(fFlags,kCoated);
    158 }
    159189
    160190// --------------------------------------------------------------------------
     
    199229// Return square root of fFluxInsidePlexiglassVar
    200230//
    201 Float_t MCalibrationChargeBlindPix::GetFluxInsidePlexiglassErr() const
     231const Float_t MCalibrationChargeBlindPix::GetFluxInsidePlexiglassErr() const
    202232{
    203233  if (fFluxInsidePlexiglassVar < 0.)
     
    213243// Return fFluxInsidePlexiglassVar / fFluxInsidePlexiglass^2
    214244//
    215 Float_t MCalibrationChargeBlindPix::GetFluxInsidePlexiglassRelVar() const
     245const Float_t MCalibrationChargeBlindPix::GetFluxInsidePlexiglassRelVar() const
    216246{
    217247  if (fFluxInsidePlexiglassVar < 0.)
     
    229259// Return square root of fLambdaVar
    230260//
    231 Float_t MCalibrationChargeBlindPix::GetLambdaErr() const
     261const Float_t MCalibrationChargeBlindPix::GetLambdaErr() const
    232262{
    233263  if (fLambdaVar < 0.)
     
    243273// Return fLambdaVar / (fLambda * fLambda )
    244274//
    245 Float_t MCalibrationChargeBlindPix::GetLambdaRelVar() const
     275const Float_t MCalibrationChargeBlindPix::GetLambdaRelVar() const
    246276{
    247277  if (fLambdaVar < 0.)
     
    256286// --------------------------------------------------------------------------
    257287//
    258 // Return -1 if gkBlindPixelQEGreenErr is smaller than 0.
    259 // Return -1 if gkBlindPixelQEGreen    is 0.
    260 // Return gkBlindPixelQEGreenErr^2 / (gkBlindPixelQEGreen^2 )
    261 //
    262 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEGreen() const
    263 {
    264 
    265   if (IsCoated())
    266     {
    267       if (gkBlindPixelQECoatedGreen < 0.)
    268         return -1.;
    269      
    270       return gkBlindPixelQECoatedGreen;
    271     }
    272   else
    273     {
    274       if (gkBlindPixelQEUnCoatedGreen < 0.)
    275         return -1.;
    276      
    277       return gkBlindPixelQEUnCoatedGreen;
    278     }
    279  
    280 }
    281 
    282 // --------------------------------------------------------------------------
    283 //
    284 // Return -1 if gkBlindPixelQEBlueErr is smaller than 0.
    285 // Return -1 if gkBlindPixelQEBlue    is 0.
    286 // Return gkBlindPixelQEBlueErr^2 / gkBlindPixelQEBlue^2
    287 //
    288 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEBlue() const
    289 {
    290   if (IsCoated())
    291     {
    292       if (gkBlindPixelQECoatedBlue < 0.)
    293         return -1.;
    294      
    295       return gkBlindPixelQECoatedBlue;
    296     }
    297   else
    298     {
    299       if (gkBlindPixelQEUnCoatedBlue < 0.)
    300         return -1.;
    301      
    302       return gkBlindPixelQEUnCoatedBlue;
    303     }
    304 }
    305 
    306 // --------------------------------------------------------------------------
    307 //
    308 // Return -1 if gkBlindPixelQEUVErr is smaller than 0.
    309 // Return -1 if gkBlindPixelQEUV    is 0.
    310 // Return gkBlindPixelQEUVErr ^2 / gkBlindPixelQEUV^2
    311 //
    312 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEUV() const
    313 {
    314 
    315   if (IsCoated())
    316     {
    317       if (gkBlindPixelQECoatedUV < 0.)
    318         return -1.;
    319      
    320       return gkBlindPixelQECoatedUV;
    321     }
    322   else
    323     {
    324       if (gkBlindPixelQEUnCoatedUV < 0.)
    325         return -1.;
    326      
    327      
    328       return gkBlindPixelQEUnCoatedUV;
    329     }
    330 }
    331 
    332 // --------------------------------------------------------------------------
    333 //
    334 // Return -1 if gkBlindPixelQECT1Err is smaller than 0.
    335 // Return -1 if gkBlindPixelQECT1    is 0.
    336 // Return gkBlindPixelQECT1Err ^2 / gkBlindPixelQECT1^2
    337 //
    338 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQECT1() const
    339 {
    340 
    341   if (IsCoated())
    342     {
    343       if (gkBlindPixelQECoatedCT1 < 0.)
    344         return -1.;
    345      
    346       return gkBlindPixelQECoatedCT1;
    347     }
    348   else
    349     {
    350       if (gkBlindPixelQEUnCoatedCT1 < 0.)
    351         return -1.;
    352      
    353       return gkBlindPixelQEUnCoatedCT1;
    354     }
    355 }
    356 
    357 // --------------------------------------------------------------------------
    358 //
    359 // Return -1 if gkBlindPixelQEGreenErr is smaller than 0.
    360 // Return -1 if gkBlindPixelQEGreen    is 0.
    361 // Return gkBlindPixelQEGreenErr^2 / (gkBlindPixelQEGreen^2 )
    362 //
    363 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEGreenRelVar() const
    364 {
    365 
    366   if (IsCoated())
    367     {
    368       if (gkBlindPixelQECoatedGreenErr < 0.)
    369         return -1.;
    370      
    371       if (gkBlindPixelQECoatedGreen  == 0.)
    372         return -1.;
    373      
    374       return gkBlindPixelQECoatedGreenErr * gkBlindPixelQECoatedGreenErr
    375          / gkBlindPixelQECoatedGreen / gkBlindPixelQECoatedGreen ;
    376     }
    377   else
    378     {
    379       if (gkBlindPixelQEUnCoatedGreenErr < 0.)
    380         return -1.;
    381      
    382       if (gkBlindPixelQEUnCoatedGreen  == 0.)
    383         return -1.;
    384      
    385       return gkBlindPixelQEUnCoatedGreenErr * gkBlindPixelQEUnCoatedGreenErr
    386          / gkBlindPixelQEUnCoatedGreen / gkBlindPixelQEUnCoatedGreen ;
    387     }
    388  
    389 }
    390 
    391 // --------------------------------------------------------------------------
    392 //
    393 // Return -1 if gkBlindPixelQEBlueErr is smaller than 0.
    394 // Return -1 if gkBlindPixelQEBlue    is 0.
    395 // Return gkBlindPixelQEBlueErr^2 / gkBlindPixelQEBlue^2
    396 //
    397 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEBlueRelVar() const
    398 {
    399   if (IsCoated())
    400     {
    401       if (gkBlindPixelQECoatedBlueErr < 0.)
    402         return -1.;
    403      
    404       if (gkBlindPixelQECoatedBlue  == 0.)
    405         return -1.;
    406      
    407       return gkBlindPixelQECoatedBlueErr * gkBlindPixelQECoatedBlueErr
    408          / gkBlindPixelQECoatedBlue / gkBlindPixelQECoatedBlue ;
    409     }
    410   else
    411     {
    412       if (gkBlindPixelQEUnCoatedBlueErr < 0.)
    413         return -1.;
    414      
    415       if (gkBlindPixelQEUnCoatedBlue  == 0.)
    416         return -1.;
    417      
    418       return gkBlindPixelQEUnCoatedBlueErr * gkBlindPixelQEUnCoatedBlueErr
    419          / gkBlindPixelQEUnCoatedBlue / gkBlindPixelQEUnCoatedBlue ;
    420     }
    421 }
    422 
    423 // --------------------------------------------------------------------------
    424 //
    425 // Return -1 if gkBlindPixelQEUVErr is smaller than 0.
    426 // Return -1 if gkBlindPixelQEUV    is 0.
    427 // Return gkBlindPixelQEUVErr ^2 / gkBlindPixelQEUV^2
    428 //
    429 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEUVRelVar() const
    430 {
    431 
    432   if (IsCoated())
    433     {
    434       if (gkBlindPixelQECoatedUVErr < 0.)
    435         return -1.;
    436      
    437       if (gkBlindPixelQECoatedUV  == 0.)
    438         return -1.;
    439      
    440       return gkBlindPixelQECoatedUVErr * gkBlindPixelQECoatedUVErr
    441          / gkBlindPixelQECoatedUV / gkBlindPixelQECoatedUV ;
    442     }
    443   else
    444     {
    445       if (gkBlindPixelQEUnCoatedUVErr < 0.)
    446         return -1.;
    447      
    448       if (gkBlindPixelQEUnCoatedUV  == 0.)
    449         return -1.;
    450      
    451       return gkBlindPixelQEUnCoatedUVErr * gkBlindPixelQEUnCoatedUVErr
    452          / gkBlindPixelQEUnCoatedUV / gkBlindPixelQEUnCoatedUV ;
    453     }
    454 }
    455 
    456 // --------------------------------------------------------------------------
    457 //
    458 // Return -1 if gkBlindPixelQECT1Err is smaller than 0.
    459 // Return -1 if gkBlindPixelQECT1    is 0.
    460 // Return gkBlindPixelQECT1Err ^2 / gkBlindPixelQECT1^2
    461 //
    462 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQECT1RelVar() const
    463 {
    464 
    465   if (IsCoated())
    466     {
    467       if (gkBlindPixelQECoatedCT1Err < 0.)
    468         return -1.;
    469      
    470       if (gkBlindPixelQECoatedCT1  == 0.)
    471         return -1.;
    472      
    473       return gkBlindPixelQECoatedCT1Err * gkBlindPixelQECoatedCT1Err
    474          / gkBlindPixelQECoatedCT1 / gkBlindPixelQECoatedCT1 ;
    475     }
    476   else
    477     {
    478       if (gkBlindPixelQEUnCoatedCT1Err < 0.)
    479         return -1.;
    480      
    481       if (gkBlindPixelQEUnCoatedCT1  == 0.)
    482         return -1.;
    483      
    484       return gkBlindPixelQEUnCoatedCT1Err * gkBlindPixelQEUnCoatedCT1Err
    485          / gkBlindPixelQEUnCoatedCT1 / gkBlindPixelQEUnCoatedCT1 ;
    486     }
    487 }
    488 
    489 // --------------------------------------------------------------------------
    490 //
    491 // Return gkBlindPixelCollectionEffErr^2 / (gkBlindPixelCollectionEff^2 )
    492 //
    493 const Float_t MCalibrationChargeBlindPix::GetBlindPixelCollectionEffRelVar() const
    494 {
    495 
    496   return gkBlindPixelCollectionEffErr * gkBlindPixelCollectionEffErr
    497     / gkBlindPixelCollectionEff / gkBlindPixelCollectionEff ;
     288// Return TMath::Power(10,fAtt[fColor])
     289//
     290const Float_t MCalibrationChargeBlindPix::GetAtt() const
     291{
     292  return TMath::Power(10,fAtt[fColor]);   
     293}
     294
     295// --------------------------------------------------------------------------
     296//
     297// Return -1 if fAttErr[fColor] is smaller than 0.
     298// Error of TMath::Power(10,fAtt[fColor]) = TMath::Power(10,fAtt[fColor])*ln(10.)*fAttErr[fColor]
     299// Return fAttErr^2 / (fAtt^2 )
     300//
     301const Float_t MCalibrationChargeBlindPix::GetAttRelVar() const
     302{
     303
     304  const Float_t err = fAttErr[fColor];
     305
     306  if (err < 0.)
     307    return -1.;
     308 
     309  return err*err*2.3;
     310}
     311
     312// --------------------------------------------------------------------------
     313//
     314// Return fQE[fColor]
     315//
     316const Float_t MCalibrationChargeBlindPix::GetQE() const
     317{
     318  return fQE[fColor];
     319}
     320
     321// --------------------------------------------------------------------------
     322//
     323// Return -1 if fQEErr[fColor] is smaller than 0.
     324// Return fQEErr^2 / (fQE^2 )
     325//
     326const Float_t MCalibrationChargeBlindPix::GetQERelVar() const
     327{
     328
     329  if (fQEErr[fColor] < 0.)
     330    return -1.;
     331 
     332  return fQEErr[fColor]* fQEErr[fColor] / GetQE() / GetQE();
     333}
     334
     335// --------------------------------------------------------------------------
     336//
     337// Return fCollEff[fColor]
     338//
     339const Float_t MCalibrationChargeBlindPix::GetCollEff() const
     340{
     341  return fCollEff[fColor];
     342}
     343
     344// --------------------------------------------------------------------------
     345//
     346// Return -1 if fCollEffErr[fColor] is smaller than 0.
     347// Return fCollEffErr^2 / (fCollEff^2 )
     348//
     349const Float_t MCalibrationChargeBlindPix::GetCollEffRelVar() const
     350{
     351
     352  if (fCollEffErr[fColor] < 0.)
     353    return -1.;
     354 
     355  return fCollEffErr[fColor]* fCollEffErr[fColor] / GetCollEff() / GetCollEff();
    498356}
    499357
     
    502360// Test bit kChargeFitValid
    503361//
    504 Bool_t MCalibrationChargeBlindPix::IsChargeFitValid()  const
     362const Bool_t MCalibrationChargeBlindPix::IsChargeFitValid()  const
    505363{
    506364    return TESTBIT(fFlags,kChargeFitValid);
     
    509367// --------------------------------------------------------------------------
    510368//
    511 // Test bit kCoated
    512 //
    513 Bool_t MCalibrationChargeBlindPix::IsCoated()  const
    514 {
    515     return TESTBIT(fFlags,kCoated);
    516 }
    517 
    518 // --------------------------------------------------------------------------
    519 //
    520369// Test bit kOscillating
    521370//
    522 Bool_t MCalibrationChargeBlindPix::IsOscillating()  const
     371const Bool_t MCalibrationChargeBlindPix::IsOscillating()  const
    523372{
    524373    return TESTBIT(fFlags,kOscillating);
     
    529378// Test bit kPedestalFitValid
    530379//
    531 Bool_t MCalibrationChargeBlindPix::IsPedestalFitOK()  const
     380const Bool_t MCalibrationChargeBlindPix::IsPedestalFitOK()  const
    532381{
    533382    return TESTBIT(fFlags,kPedestalFitOK);
     
    538387// Test bit kSinglePheFitValid
    539388//
    540 Bool_t MCalibrationChargeBlindPix::IsSinglePheFitOK()  const
     389const Bool_t MCalibrationChargeBlindPix::IsSinglePheFitOK()  const
    541390{
    542391    return TESTBIT(fFlags,kSinglePheFitOK);
     
    547396// Test bit kFluxInsidePlexiglassAvailable
    548397//
    549 Bool_t  MCalibrationChargeBlindPix::IsFluxInsidePlexiglassAvailable()   const
     398const Bool_t  MCalibrationChargeBlindPix::IsFluxInsidePlexiglassAvailable()   const
    550399{
    551400  return TESTBIT(fFlags,kFluxInsidePlexiglassAvailable);
     
    559408// Calculate fFluxInsidePlexiglass with the formula:
    560409// - fFluxInsidePlexiglass    = fLambda
    561 //                            / GetBlindPixelCollectionEff()
    562 //                            / GetBlindPixelQE()
    563 //                            * 10**gkBlindPixelAtt[color]
    564 //                            / gkBlindPixelArea
     410//                            / GetCollEff()
     411//                            / GetQE()
     412//                            * GetAtt()
     413//                            / fArea
    565414// - fFluxInsidePlexiglassVar = sqrt( fLambdaVar / ( fLambda * fLambda )
    566 //                             + GetBlindPixelQERelVar()
    567 //                             + GetBlindPixelCollectionEffRelVar()
     415//                             + GetQERelVar()
     416//                             + GetCollEffRelVar()
     417//                             + GetAttRelVar()
    568418//                               ) * fFluxInsidePlexiglass * * fFluxInsidePlexiglass
    569419//
     
    584434  // The blind pixel has exactly 100 mm^2 area (with negligible error),
    585435  //
    586   switch (fColor)
    587     {
    588     case MCalibrationCam::kGREEN:
    589       fFluxInsidePlexiglass    = fLambda / GetBlindPixelQEGreen() * TMath::Power(10,gkBlindPixelAttGreen);   
    590       // attenuation has negligible error
    591       fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEGreenRelVar();
    592       break;
    593     case MCalibrationCam::kBLUE:
    594       fFluxInsidePlexiglass    = fLambda / GetBlindPixelQEBlue() * TMath::Power(10,gkBlindPixelAttBlue);   
    595       // attenuation has negligible error
    596       fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEBlueRelVar();
    597       break;
    598     case MCalibrationCam::kUV:
    599       fFluxInsidePlexiglass    = fLambda / GetBlindPixelQEUV() * TMath::Power(10,gkBlindPixelAttUV);   
    600       // attenuation has negligible error
    601       fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEUVRelVar();
    602       break;
    603     case MCalibrationCam::kCT1:
    604     default:
    605       fFluxInsidePlexiglass    = fLambda / GetBlindPixelQECT1() * TMath::Power(10,gkBlindPixelAttCT1);   
    606       // attenuation has negligible error
    607       fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQECT1RelVar();
    608       break;
    609     }
    610 
    611   fFluxInsidePlexiglass    /= gkBlindPixelArea;
    612   fFluxInsidePlexiglass    /= gkBlindPixelCollectionEff;
     436  fFluxInsidePlexiglass    = fLambda / GetQE() * GetAtt() / GetCollEff() / fArea;   
     437
     438  if (fFluxInsidePlexiglass < 0.)
     439      return kFALSE;
     440
     441  fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetQERelVar() + GetAttRelVar() + GetCollEffRelVar();
     442
    613443  //
    614444  // Finish calculation of errors -> convert from relative variance to absolute variance
    615445  //
    616   fFluxInsidePlexiglassVar += GetBlindPixelCollectionEffRelVar();
    617446  fFluxInsidePlexiglassVar *= fFluxInsidePlexiglass * fFluxInsidePlexiglass;
    618 
    619   if (fFluxInsidePlexiglass < 0.)
    620       return kFALSE;
    621447
    622448  if (fFluxInsidePlexiglassVar < 0.)
     
    633459}
    634460
    635 
    636 
    637 
    638 
    639 
    640 
    641 
    642 
    643 
     461void MCalibrationChargeBlindPix::Print(Option_t *opt) const
     462{
     463 
     464  *fLog << all << GetDescriptor()
     465        << Form("%s%3i","BlindPixel: ",GetPixId())
     466        << Form("%s%4.2f%s%4.2f","  Lambda: ",GetLambda(),"+-",GetLambdaErr())
     467        << Form("%s%4.2f%s%4.2f","  Mu0: ",GetMu0(),"+-",GetMu0Err())
     468        << Form("%s%4.2f%s%4.2f","  Mu1: ",GetMu1(),"+-",GetMu1Err())
     469        << Form("%s%4.2f%s%4.2f","  Sigma0: ",GetSigma0(),"+-",GetSigma0Err())
     470        << Form("%s%4.2f%s%4.2f","  Sigma1: ",GetSigma1(),"+-",GetSigma1Err())
     471        << endl;
     472  *fLog << all
     473        << " Pedestal Fit OK? :" << IsPedestalFitOK()
     474        << Form("%s%4.2f%s%4.2f","  Lambda (Check): " ,GetLambdaCheck(),"+-",GetLambdaCheckErr())
     475        << endl;
     476  *fLog << all
     477        << " Flux available? :" << IsFluxInsidePlexiglassAvailable()
     478        << Form("%s%4.2f%s%4.2f","  Flux: " ,GetFluxInsidePlexiglass(),"+-",GetFluxInsidePlexiglassErr())
     479        << endl;
     480}
     481
     482
     483
     484
     485
     486
     487
     488
     489
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r4659 r4670  
    600600      }
    601601
    602   if (fBlindCam)
    603     if (!fBlindCam->IsValid())
    604       {
    605         *fLog << warn << GetDescriptor()
    606               << ": MCalibrationChargeBlindCam is declared not valid... no Blind Pixel method! " << endl;
    607         fBlindCam = NULL;
    608       }
    609  
    610602  *fLog << endl;
    611603  //
     
    839831      *fLog << warn << GetDescriptor()
    840832            << Form(": Fitted Charge: %5.2f is smaller than %2.1f",cal.GetMean(),fChargeLimit)
    841             << Form("   Pedestal RMS: %5.2f in %s%4i",cal.GetPedRms(),what,cal.GetPixId()) << endl;
     833            << Form("  Pedestal RMS: %5.2f in %s%4i",cal.GetPedRms(),what,cal.GetPixId()) << endl;
    842834      bad.SetUncalibrated( MBadPixelsPix::kChargeIsPedestal);
    843835    }
     
    11781170        }
    11791171     
    1180       *fLog << inf << "Average total number phes in area idx " << aidx << ": "
     1172      *fLog << inf << GetDescriptor()
     1173            << "Average total number phes in area idx " << aidx << ": "
    11811174            << Form("%7.2f%s%6.2f",areaphes[aidx]," +- ",TMath::Sqrt(areaweights[aidx])) << endl;
    11821175                   
     
    12201213        }
    12211214
    1222       *fLog << inf << "Average number phes per area in sector " << sector << ": "
     1215      *fLog << inf << GetDescriptor()
     1216            << "Average number phes per area in sector " << sector << ": "
    12231217            << Form("%5.2f+-%4.2f  [phe/mm^2]",sectorphes[sector],TMath::Sqrt(sectorweights[sector]))
    12241218            << endl;
     
    15241518        }
    15251519
    1526       *fLog << inf << endl;
    15271520      *fLog << inf << GetDescriptor() << ": Mean F-Factor "
    15281521          << "with area index #" << i << ": "
    1529             << Form("%4.2f+-%4.2f",mean,sigma) << "fadc/ph" << endl;
     1522            << Form("%4.2f+-%4.2f",mean,sigma) << endl;
    15301523
    15311524      lowlim  [i] = 1.1;
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r4668 r4670  
    119119#include "MCalibrationChargeBlindPix.h"
    120120#include "MCalibrationChargeBlindCam.h"
    121 #include "MCalibrationChargeBlindPix.h"
     121#include "MCalibrationChargeBlindCamOneOldStyle.h"
     122#include "MCalibrationChargeBlindCamTwoNewStyle.h"
    122123#include "MCalibrationChargeCalc.h"
    123124
     
    14391440  if (run < gkSecondBlindPixelInstallation)
    14401441    {
    1441       blindext.SetModified(kFALSE);
     1442
     1443      MCalibrationChargeBlindCamOneOldStyle blindresults;
     1444      blindresults.Copy(fCalibrationBlindCam);
     1445
    14421446      blindext.SetExtractionType(MExtractBlindPixel::kIntegral);
    14431447      blindext.SetExtractionType(MExtractBlindPixel::kFilter);
     
    14461450      blindcam.SetFitFunc( MHCalibrationChargeBlindPix::kEPoisson5 );
    14471451    }
    1448   else
    1449     {
    1450       blindext.SetModified(kTRUE);
     1452  else if (run < gkThirdBlindPixelInstallation)
     1453    {
     1454
     1455      MCalibrationChargeBlindCamTwoNewStyle blindresults;
     1456      blindresults.Copy(fCalibrationBlindCam);
     1457
     1458      blindext.SetNumBlindPixels(blindresults.GetNumBlindPixels());
     1459      for (UInt_t i=0;i<blindresults.GetNumBlindPixels();i++)
     1460        blindext.SetBlindPixelIdx(blindresults[i].GetPixId(),i);
     1461
    14511462      blindext.SetExtractionType(MExtractBlindPixel::kAmplitude);
    14521463      blindext.SetExtractionType(MExtractBlindPixel::kFilter);
     
    14541465      blindext.SetNSBFilterLimit(38);
    14551466     
    1456       if (run < gkThirdBlindPixelInstallation)
    1457         blindext.SetNumBlindPixels(2);
    1458       else
    1459         blindext.SetNumBlindPixels(3);
    1460     }
     1467    }
     1468  else
     1469    {
     1470      *fLog << err << "Third blind pixel installation not yet completed, check your run number!!! " << endl;
     1471    }
     1472 
    14611473}
    14621474
     
    15681580    MExtractPINDiode         pinext;
    15691581    MExtractBlindPixel       blindext;
     1582
    15701583    InitBlindPixel(blindext, blindcam);
     1584
    15711585    MExtractSlidingWindow    extract2;
    15721586    MExtractTimeFastSpline   timespline;
Note: See TracChangeset for help on using the changeset viewer.