Changeset 4605 for trunk


Ignore:
Timestamp:
08/12/04 21:43:15 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4604 r4605  
    2121
    2222  2004/08/12: Markus Gaug
     23
     24   * msignal/MExtractBlindPixel.[h,cc]
     25     - Set the method from outside
     26     - unified the defaults to new blind pixels
    2327
    2428   * mjobs/MJCalibration.[h,cc]
  • trunk/MagicSoft/Mars/mcalib/MCalibrate.cc

    r4580 r4605  
    398398
    399399      //
    400       // The following part is the outcommented first version of the error calculation
     400      // The following part is the commented first version of the error calculation
    401401      // Contact Markus Gaug for questions (or wait for the next documentation update...)
    402402      //
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r4451 r4605  
    109109#include "MCalibrationChargePINDiode.h"
    110110#include "MCalibrationChargeBlindPix.h"
     111#include "MCalibrationChargeBlindCam.h"
     112#include "MCalibrationChargeBlindPix.h"
    111113#include "MCalibrationChargeCalc.h"
    112114
     
    114116#include "MHCalibrationCam.h"
    115117#include "MHCalibrationChargeCam.h"
    116 #include "MHCalibrationChargeBlindPix.h"
     118#include "MHCalibrationChargeBlindCam.h"
     119#include "MHCalibrationChargePINDiode.h"
    117120#include "MHCalibrationRelTimeCam.h"
    118121#include "MCalibrationRelTimeCam.h"
     
    142145using namespace std;
    143146
    144 const Int_t MJCalibration::gkIFAEBoxInaugurationRun = 20113;
     147const Int_t MJCalibration::gkIFAEBoxInaugurationRun       = 20113;
     148const Int_t MJCalibration::gkSecondBlindPixelInstallation = 31693;
     149const Int_t MJCalibration::gkThirdBlindPixelInstallation  = 99999;
    145150// --------------------------------------------------------------------------
    146151//
     
    210215void MJCalibration::DisplayResult(MParList &plist)
    211216{
     217
    212218    if (!fDisplay)
    213219        return;
     
    417423    if (fDisplayType == kDataCheckDisplay)
    418424      {
     425
    419426        TCanvas &c1 = fDisplay->AddTab("Fit.Charge");
    420427        c1.Divide(3, 3);
    421428       
    422         disp1.CamDraw(c1, 1, 3, 5);
    423         disp4.CamDraw(c1, 2, 3, 5);
     429        disp1.CamDraw( c1, 1, 3, 5);
     430        disp4.CamDraw( c1, 2, 3, 5);
    424431        disp28.CamDraw(c1, 3, 3, 5);
    425432
     
    456463            disp31.CamDraw(c5, 2, 2, 2);
    457464          }
    458 
    459465
    460466        return;
     
    684690      //
    685691      // Here starts the list of runs where the shifters did not put
    686       // a colour, but which have been found out by other means
     692      // a colour, but which have been found out by other means.
     693      // FIXME: This list has is only preliminary and has to move into the
     694      //        database!!
    687695      //
     696      if (filenames.Contains("_30090_"))
     697        if (fColor == MCalibrationCam::kNONE)
     698          {
     699            *fLog << "Found colour: kGREEN  in " << filenames << endl;
     700            fColor = MCalibrationCam::kGREEN;
     701          }
     702        else if (fColor != MCalibrationCam::kNONE)
     703          {
     704            *fLog << err << "Different colour found in " << filenames << "... abort" << endl;
     705            return kFALSE;
     706          }
     707
    688708      if (filenames.Contains("_27474_"))
    689709        if (fColor == MCalibrationCam::kNONE)
     
    801821      //
    802822      // Here start the runs where the shifter put
    803       // the colour
     823      // the colour.
    804824      //
    805825      if (filenames.Contains("green"))
     
    933953//   8)  MContinue(MFCosmics)
    934954//   9)  MFillH("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode")
    935 //   10) MFillH("MHCalibrationChargeBlindPix", "MExtractedSignalBlindPixel")
     955//   10) MFillH("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel")
    936956//   11) MFillH("MHCalibrationChargeCam",      "MExtractedSignalCam")
    937957//   12) MFillH("MHCalibrationChargeCam",      "MExtractedSignalCam")
     
    9871007  }
    9881008
    989   MHCalibrationChargeCam   chargecam;
     1009  MHCalibrationChargeCam      chargecam;
     1010  MHCalibrationChargeBlindCam blindcam;
    9901011
    9911012  plist.AddToList(&pedcam);
    992   plist.AddToList(&chargecam);
     1013  plist.AddToList(&chargecam); 
     1014  plist.AddToList(&blindcam); 
    9931015  plist.AddToList(&fBadPixels);
    9941016  plist.AddToList(&fQECam);
    9951017  plist.AddToList(&fCalibrationCam);
    996   plist.AddToList(&fCalibrationBlindPix);
     1018  plist.AddToList(&fCalibrationBlindCam);
    9971019  plist.AddToList(&fCalibrationPINDiode);
    9981020  plist.AddToList(&fRelTimeCam);
    9991021
    10001022  MGeomApply               apply;
    1001   //    MBadPixelsMerge          merge(&fBadPixels);
    10021023  MExtractPINDiode         pinext;
    10031024  MExtractBlindPixel       blindext;
     1025 
     1026  //
     1027  // Initialize the blind pixel. Unfortunately, there is a hardware difference
     1028  // in the first blind pixel until run "gkSecondBlindPixelInstallation" and the
     1029  // later setup. The first needs to use a filter because of the length of
     1030  // spurious NSB photon signals. The latter get better along extracting the amplitude
     1031  // from a small window.
     1032  //
     1033  TArrayI arr = fRuns->GetRuns();
     1034  if (arr[fRuns->GetNumRuns()-1] < gkSecondBlindPixelInstallation)
     1035    {
     1036      blindext.SetModified(kFALSE);
     1037      blindext.SetExtractionType(MExtractBlindPixel::kIntegral);
     1038      blindext.SetExtractionType(MExtractBlindPixel::kFilter);
     1039      blindext.SetRange(10,19,0,2);
     1040      blindcam.SetFitFunc( MHCalibrationChargeBlindPix::kEPoisson5 );
     1041    }
     1042  else
     1043    {
     1044      blindext.SetModified(kTRUE);
     1045      blindext.SetExtractionType(MExtractBlindPixel::kAmplitude);
     1046      blindext.SetExtractionType(MExtractBlindPixel::kFilter);
     1047      blindext.SetRange(5,8,0,2);
     1048      blindext.SetNSBFilterLimit(38);
     1049      if (arr[fRuns->GetNumRuns()-1] < gkThirdBlindPixelInstallation)
     1050        blindext.SetNumBlindPixels(2);
     1051      else
     1052        blindext.SetNumBlindPixels(3);
     1053    }
     1054 
    10041055  MExtractSlidingWindow    extract2;
    10051056  MExtractTimeFastSpline   timespline;
     
    10241075 
    10251076  MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode");
    1026   MFillH fillbnd("MHCalibrationChargeBlindPix", "MExtractedSignalBlindPixel");
     1077  MFillH fillbnd("MHCalibrationChargeBlindCam", "MExtractedSignalBlindPixel");
    10271078  MFillH fillcam("MHCalibrationChargeCam",      "MExtractedSignalCam");
    10281079  MFillH filltme("MHCalibrationRelTimeCam",     "MArrivalTimeCam");
     
    10321083  filltme.SetNameTab("RelTimes");
    10331084
     1085  TString drawoption;
     1086
    10341087  if (fDisplayType == kDataCheckDisplay)
    1035     {
    1036       fillcam.SetDrawOption("datacheck");
    1037       fillbnd.SetDrawOption("datacheck");
    1038       fillpin.SetDrawOption("datacheck");
    1039       filltme.SetDrawOption("datacheck");
    1040     }
    1041 
     1088    drawoption += "datacheck";
    10421089  if (fDisplayType == kFullDisplay)
    1043     {
    1044       fillcam.SetDrawOption("all");
    1045       filltme.SetDrawOption("all");
    1046     }
    1047  
    1048  
     1090    drawoption += " all";
     1091 
     1092  fillcam.SetDrawOption(drawoption.Data());
     1093  fillbnd.SetDrawOption(drawoption.Data());
     1094  fillpin.SetDrawOption(drawoption.Data());
     1095  filltme.SetDrawOption(drawoption.Data());
    10491096  //
    10501097  // Apply a filter against cosmics
     
    10671114    }
    10681115 
    1069 
    10701116  tlist.AddToList(&pinext); 
    10711117  tlist.AddToList(&blindext);
     
    10881134  tlist.AddToList(&fillcam);
    10891135
     1136  if (fRelTimes)
     1137    {
     1138      tlist.AddToList(&filltme);
     1139      tlist.AddToList(&timecalc);
     1140    }
     1141 
     1142  if (IsUseBlindPixel())
     1143    tlist.AddToList(&fillbnd);
    10901144  if (IsUsePINDiode())
    10911145    tlist.AddToList(&fillpin);
    1092   if (IsUseBlindPixel())
    1093     tlist.AddToList(&fillbnd);
    10941146
    10951147  tlist.AddToList(&calcalc);
    1096 
    1097   if (fRelTimes)
    1098     {
    1099       tlist.AddToList(&filltme);
    1100       tlist.AddToList(&timecalc);
    1101     }
    1102  
    11031148
    11041149  // Create and setup the eventloop
     
    11171162  tlist.PrintStatistics();
    11181163
     1164  //
     1165  // The next lines are necessary in order to avoid that
     1166  // the last entry drawn by MFillH gets deleted again from
     1167  // the display. No idea where this comes from...
     1168  //
     1169  if (fDisplay)
     1170    {
     1171      if (IsUsePINDiode())
     1172        {
     1173          MHCalibrationChargePINDiode *pin =
     1174            (MHCalibrationChargePINDiode*)plist.FindObject("MHCalibrationChargePINDiode");
     1175          pin->DrawClone(Form("nonew %s",drawoption.Data()));
     1176        }
     1177      else if (IsUseBlindPixel())
     1178        {
     1179          MHCalibrationChargeBlindCam *cam =
     1180            (MHCalibrationChargeBlindCam*)plist.FindObject("MHCalibrationChargeBlindCam");
     1181          cam->DrawClone(Form("nonew %s",drawoption.Data()));
     1182        }
     1183      else if (fRelTimes)
     1184        {
     1185          MHCalibrationRelTimeCam *cam =
     1186            (MHCalibrationRelTimeCam*)plist.FindObject("MHCalibrationRelTimeCam");
     1187          cam->DrawClone(Form("nonew %s",drawoption.Data()));
     1188        }
     1189      else
     1190        {
     1191          MHCalibrationChargeCam *cam =
     1192            (MHCalibrationChargeCam*)plist.FindObject("MHCalibrationChargeCam");
     1193          cam->DrawClone(Form("nonew %s",drawoption.Data()));
     1194        }
     1195    }
     1196 
    11191197  DisplayResult(plist);
    11201198
     
    12491327    }
    12501328
    1251     if (fCalibrationBlindPix.Write()<=0)
    1252     {
    1253         *fLog << err << "Unable to write MCalibrationChargeBlindPix to " << oname << endl;
     1329    if (fCalibrationBlindCam.Write()<=0)
     1330    {
     1331        *fLog << err << "Unable to write MCalibrationChargeBlindCam to " << oname << endl;
    12541332        return kFALSE;
    12551333    }
  • trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.cc

    r4399 r4605  
    7474using namespace std;
    7575
     76const Int_t   MExtractBlindPixel::fgNumBlindPixels   = 2;
    7677const UInt_t  MExtractBlindPixel::fgBlindPixelIds[3] = { 559, 560, 561 };
    7778const UInt_t  MExtractBlindPixel::fgBlindPixelIdx    = 559;
    78 const Byte_t  MExtractBlindPixel::fgFirst            =   0;
    79 const Byte_t  MExtractBlindPixel::fgLast             =   7;
    8079const Byte_t  MExtractBlindPixel::fgHiGainFirst      =  10;
    8180const Byte_t  MExtractBlindPixel::fgHiGainLast       =  19;
     
    8483const Int_t   MExtractBlindPixel::fgNSBFilterLimit   =  70;
    8584const Float_t MExtractBlindPixel::fgResolution       = 0.003;
    86 const UInt_t  MExtractBlindPixel::gkModificationRun  = 31693;
    8785const Float_t MExtractBlindPixel::gkOverflow         = 300.;
    8886// --------------------------------------------------------------------------
     
    114112  SetRange(fgHiGainFirst, fgHiGainLast, fgLoGainFirst, fgLoGainLast);
    115113 
    116   SetFirst();
    117   SetLast();
     114  SetNumBlindPixels();
    118115
    119116  Clear();
     
    206203// - MExtractor::PreProcess(pList)
    207204//
    208 // Sets fModified to kTRUE if the current run number is greater or equal gkModificationRun
    209 //
    210205// The following output containers are also searched and created if
    211206// they were not found:
    212207//
    213208//  - MExtractedBlindPixel
    214 //
    215 //
    216209//
    217210Int_t MExtractBlindPixel::PreProcess(MParList *pList)
     
    255248    delete [] fHiGainSecondDeriv;
    256249
    257   if ( fRunHeader->GetRunNumber() >= gkModificationRun )
     250  if (fModified)
    258251  {
    259       fModified = kTRUE;
    260       SetExtractionType(kAmplitude);
    261       SetRange(fFirst,fLast);
    262       for (Int_t i=0;i<3;i++)
     252    for (Int_t i=0;i<fNumBlindPixels;i++)
    263253      {
    264           SetBlindPixelIdx(fgBlindPixelIds[i],i);
    265           fBlindPixel->SetBlindPixelIdx(fgBlindPixelIds[i],i);
     254        SetBlindPixelIdx(fgBlindPixelIds[i],i);
     255        fBlindPixel->SetBlindPixelIdx(fgBlindPixelIds[i],i);
    266256      }
    267257  }
    268258  else
    269   {
    270       fBlindPixel->SetBlindPixelIdx(fBlindPixelIdx.At(0));
    271       SetExtractionType(kIntegral);
    272       SetExtractionType(kFilter);
    273   }
     259    fBlindPixel->SetBlindPixelIdx(fBlindPixelIdx.At(0));
    274260
    275261  fBlindPixel->SetExtractionType(fExtractionType);
     
    351337                fHiLoLast ?  (Int_t)fHiLoLast-1 : (Int_t)fHiGainLast )
    352338        << endl;
     339
    353340  if (IsExtractionType(kFilter))
    354341    *fLog << inf << GetDescriptor() << ": Will use Filter using "
     
    377364
    378365  Int_t summ = 0;
    379   Byte_t *p     = ptr;
     366  Byte_t *p   = ptr;
    380367  Byte_t *end = ptr + fHiGainLast - fHiGainFirst + 1;
    381368
     
    694681      Byte_t sat  = 0;
    695682
    696       if (!fModified)
     683      if (IsExtractionType(kFilter))
    697684      {
    698685
     
    706693              continue;
    707694          }
     695
     696          sum = 0;
     697          FindSignalFilter(pixel.GetLoGainSamples(), sum, sat);         
     698
     699          /*
     700          if (fModified)
     701            {
     702              if (sum > fNSBFilterLimit)
     703                {
     704                  fBlindPixel->SetExtractedSignal(-1.,id);
     705                  fBlindPixel->SetNumSaturated(sat,id);
     706                  fBlindPixel->SetReadyToSave();
     707                  continue;
     708                }
     709            }
     710          */
    708711      }
    709 
     712     
    710713      Float_t newsum = 0.;
    711714      sat = 0;
     
    716719        FindIntegral    (pixel.GetHiGainSamples()+fHiGainFirst, pixel.GetLoGainSamples(), newsum, sat);
    717720 
     721
    718722      fBlindPixel->SetExtractedSignal(newsum,id);
    719723      fBlindPixel->SetNumSaturated(sat,id);
  • trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.h

    r4386 r4605  
    1515private:
    1616
     17  static const Int_t   fgNumBlindPixels;   //! Default number of blind pixels after modification run 
    1718  static const UInt_t  fgBlindPixelIds[3]; //! Default blind pixel indices after modification run
    1819  static const UInt_t  fgBlindPixelIdx;    //! Default blind pixels index before modification run
    19   static const Byte_t  fgFirst;            //! Default First FADC slice after modification run (currently set to: 2  )
    20   static const Byte_t  fgLast ;            //! Default Last  FADC slice after modification run (currently set to: 13 )
    2120  static const Byte_t  fgHiGainFirst;      //! Default First FADC slice Hi-Gain Signal (currently set to: 10   )
    2221  static const Byte_t  fgHiGainLast;       //! Default Last  FADC slice Hi-Gain Signal (currently set to: 29   )
     
    2625  static const Float_t fgResolution;       //! Default for fResolution         (currently set to: 0.003)
    2726  static const Float_t gkOverflow;         //! Default sum to assign overflow in case of saturation
    28   static const UInt_t  gkModificationRun;  //! Run number from which on three blind pixels are used
    2927
    3028  MExtractedSignalBlindPixel *fBlindPixel; // Extracted signal of the Blind Pixel
    3129
    32   Byte_t   fFirst;                         // First extraction slice for runs after modification
    33   Byte_t   fLast;                          // Last extraction slice for runs after modification
    3430  Byte_t   fHiLoFirst;                     // If not zero, start extraction from fHiLoFirst slice of Low-Gain
    3531
     
    4541  Byte_t  fExtractionType;                 // What extraction type has been chosen?
    4642
     43  Int_t   fNumBlindPixels;                 // Current number of blind pixels
     44 
    4745public:
    4846  enum ExtractionType_t { kAmplitude, kIntegral, kFilter };
     
    7472    fBlindPixelIdx.AddAt(idx,nr); }
    7573  void SetExtractionType( const ExtractionType_t typ=kAmplitude );
    76   void SetFirst         ( const Byte_t         first=fgFirst )  { fFirst          = first; }
    77   void SetLast          ( const Byte_t         last =fgLast  )  { fLast           = last;  }
    7874  void SetNSBFilterLimit( const Int_t   lim=fgNSBFilterLimit )  { fNSBFilterLimit = lim;   }     
     75  void SetModified     ( const Bool_t b=kTRUE)               {   fModified = b;    }
     76 
     77  void SetNumBlindPixels( const Int_t   num=fgNumBlindPixels )  { fNumBlindPixels = num;   }
     78 
    7979  void SetRange         ( const Byte_t  hifirst=0, const Byte_t hilast=0,
    8080                          const Byte_t  lofirst=0, const Byte_t lolast=0 );
Note: See TracChangeset for help on using the changeset viewer.