Ignore:
Timestamp:
04/20/05 11:59:48 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
10 edited

Legend:

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

    r6926 r6963  
    4646
    4747#include "MParList.h"
    48 #include "MTaskList.h"
     48
     49#include "MRawRunHeader.h"
    4950
    5051#include "MHCalibrationCam.h"
     
    6162#include "MCalibrateData.h"
    6263
    63 #include "MGeomCam.h"
    64 
    6564ClassImp(MCalibCalcFromPast);
    6665
     
    6867
    6968const UInt_t MCalibCalcFromPast::fgNumEventsDump = 500;
     69
    7070// --------------------------------------------------------------------------
    7171//
     
    7676//
    7777MCalibCalcFromPast::MCalibCalcFromPast(const char *name, const char *title)
    78     : fGeom(NULL), fParList(NULL),
     78    : fGeom(NULL), fParList(NULL), fRunHeader(NULL),
    7979      fIntensCharge(NULL), fIntensBlind(NULL), fIntensRelTime(NULL), fIntensBad(NULL),
    8080      fChargeCalc(NULL), fRelTimeCalc(NULL), fCalibrate(NULL),
     
    9090// -----------------------------------------------------------------------------------
    9191//
    92 // The following container are searched for and execution aborted if not in MParList:
    93 //  - MTaskList
    94 //
    9592Int_t MCalibCalcFromPast::PreProcess(MParList *pList)
    9693{
     
    109106      return kFALSE;
    110107    }
     108
     109  fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     110  if (!fRunHeader)
     111  {
     112      *fLog << err << "MRawRunHeader not found... abort." << endl;
     113      return kFALSE;
     114  }
    111115
    112116  //
     
    285289  *fLog << inf << "MCalibCalcFromPast::ReInitialize #" << fNumCam << " ";
    286290
     291  const Int_t runnumber = fRunHeader->GetRunNumber();
     292
    287293  if (fIntensBad)
    288294    {
     
    294300    {
    295301      fIntensCharge->AddToList(Form("MCalibrationChargeCam%04d",fNumCam),*fGeom);
     302      fIntensCharge->GetCam()->SetRunNumber(runnumber);
    296303      *fLog << "MCalibrationChargeCam...";
    297304    }
     
    299306    {
    300307      fIntensQE->AddToList(Form("MCalibrationQECam%04d",fNumCam),*fGeom);
     308      fIntensQE->GetCam()->SetRunNumber(runnumber);
    301309      *fLog << "MCalibrationQECam...";
    302310    }
     
    304312    {
    305313      fIntensBlind->AddToList(Form("MCalibrationBlindCam%04d",fNumCam),*fGeom);
     314      fIntensBlind->GetCam()->SetRunNumber(runnumber);
    306315      *fLog << "MCalibrationBlindCam...";
    307316    }
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.h

    r6004 r6963  
    88class MParList;
    99class MGeomCam;
     10class MRawRunHeader;
    1011class MPedCalcFromLoGain;
    1112class MCalibrationChargeCalc;
     
    1718class MCalibrationIntensityRelTimeCam;
    1819class MBadPixelsIntensityCam;
     20
    1921class MCalibCalcFromPast : public MTask
    2022{
     
    2527  MGeomCam                        *fGeom;            //! Camera Geometry
    2628  MParList                        *fParList;         //! Parameter List
     29  MRawRunHeader                   *fRunHeader;       //! Run header storing the run number
    2730  MCalibrationIntensityChargeCam  *fIntensCharge;    //! Intensity Charge Cam (to be created)
    2831  MCalibrationIntensityBlindCam   *fIntensBlind;     //! Intensity Blind  Cam (to be created)
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSet.cc

    r6913 r6963  
    445445              break;
    446446            case 2:
    447               fStrength = 5.;
     447              fStrength = 5.1;
    448448              break;
    449449            case 3:
     
    454454              break;
    455455            case 5:
    456               fStrength = 5.;
     456              fStrength = 5.2;
    457457              break;
    458458            case 6:
    459               fStrength = 5.;
     459              fStrength = 5.4;
    460460              break;
    461461            case 7:
     
    472472              break;
    473473            case 11:
    474               fStrength = 5.;
     474              fStrength = 5.8;
    475475              break;
    476476            case 12:
    477               fStrength = 5.;
     477              fStrength = 5.1;
    478478              break;
    479479            case 13:
    480               fStrength = 5.;
     480              fStrength = 5.2;
    481481              break;
    482482            case 14:
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSteer.cc

    r6926 r6963  
    5151
    5252#include "MHCalibrationCam.h"
    53 #include "MCalibrationCam.h"
     53#include "MCalibrationChargeCam.h"
    5454#include "MCalibrationBlindCam.h"
    5555
     
    6161#include "MBadPixelsIntensityCam.h"
    6262
     63#include "MCalibrationChargeCam.h"
    6364#include "MCalibrationChargeCalc.h"
    6465#include "MCalibrationRelTimeCalc.h"
    6566
    6667#include "MRawRunHeader.h"
    67 #include "MRawEvtHeader.h"
    6868#include "MCalibrationPattern.h"
    6969
     
    8181    : fCalibPattern(NULL), fGeom(NULL), fParList(NULL),
    8282      fIntensCharge(NULL), fIntensRelTime(NULL), fIntensBad(NULL),
    83       fBad(NULL), fChargeCalc(NULL), fRelTimeCalc(NULL), fPattern(0)
     83      fBad(NULL), fChargeCalc(NULL), fRelTimeCalc(NULL)
    8484{
    8585
     
    109109    {
    110110      *fLog << err << "MRawRunHeader not found... abort." << endl;
    111       return kFALSE;
    112     }
    113 
    114   fEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
    115   if (!fEvtHeader)
    116     {
    117       *fLog << err << "MRawEvtHeader not found... abort." << endl;
    118111      return kFALSE;
    119112    }
     
    228221      }
    229222  }
     223 
     224  fColor = MCalibrationCam::kNONE;
     225  fStrength = 0.;
    230226     
    231227  return kTRUE;
     
    241237{
    242238
    243   const UInt_t pattern = fEvtHeader->GetPulserSlotPattern();
    244 
    245   if (fPattern == 0)
    246     {
    247       fPattern = pattern;
     239  const MCalibrationCam::PulserColor_t col = fCalibPattern->GetPulserColor();
     240  const Float_t strength                   = fCalibPattern->GetPulserStrength();
     241
     242  if (fColor ==MCalibrationCam::kNONE)
     243    {
     244      fColor = col;
     245      fStrength = strength;
    248246      return kTRUE;
    249247    }
    250248
    251   if (pattern == 0 || pattern == fPattern)
     249  const Float_t strdiff = TMath::Abs(fStrength-strength);
     250
     251  if (col  == MCalibrationCam::kNONE || (col == fColor && strdiff < 0.05))
    252252    return kTRUE;
    253253
    254   *fLog << inf << GetDescriptor() << " : old pattern: " << fPattern << flush;
    255 
    256   fPattern = pattern;
    257  
    258   *fLog << " : new pattern: " << pattern << flush;
     254  *fLog << inf << GetDescriptor() << " : Color - old=" << fColor << flush;
     255  fColor = col;
     256  *fLog << " / new=" << fColor << endl;
     257
     258  *fLog << inf << GetDescriptor() << " : Strength - old=" << fStrength << flush;
     259  fStrength = strength;
     260  *fLog << " / new=" << fStrength << endl;
    259261
    260262  //
     
    325327  if (fIntensCharge)
    326328    {
     329      MCalibrationChargeCam *oldcam = (MCalibrationChargeCam*)fIntensCharge->GetCam();
    327330      fIntensCharge->AddToList(Form("MCalibrationChargeCam%s",namep.Data()),*fGeom);
    328       MCalibrationCam *cam = fIntensCharge->GetCam();
     331      MCalibrationChargeCam *cam    = (MCalibrationChargeCam*)fIntensCharge->GetCam();
    329332      cam->SetPulserColor(fCalibPattern->GetPulserColor());
     333      if (!cam->CopyHiLoConversionFactors(*oldcam))
     334        return kFALSE;
    330335      *fLog << inf << "New MCalibrationChargeCam with name: " << cam->GetName() << endl;
    331336    }
  • trunk/MagicSoft/Mars/mcalib/MCalibColorSteer.h

    r6013 r6963  
    66#endif
    77
     8#ifndef MARS_MCalibrationCam
     9#include "MCalibrationCam.h"
     10#endif
     11
     12
    813class MParList;
    914class MGeomCam;
    1015class MCalibrationPattern;
    1116class MRawRunHeader;
    12 class MRawEvtHeader;
    1317class MCalibrationChargeCalc;
    1418class MCalibrationRelTimeCalc;
     
    1923class MBadPixelsIntensityCam;
    2024class MBadPixelsCam;
     25
    2126class MCalibColorSteer : public MTask
    2227{
     
    2530
    2631  MCalibrationPattern             *fCalibPattern;    //!
    27   MRawEvtHeader                   *fEvtHeader;       //!
    2832  MRawRunHeader                   *fRunHeader;       //!
    2933  MGeomCam                        *fGeom;            //!
     
    3943  MCalibrationRelTimeCalc         *fRelTimeCalc;     //!
    4044                                                     
    41   UInt_t fPattern;                                   
     45  MCalibrationCam::PulserColor_t   fColor;
     46  Float_t                          fStrength;
    4247 
    4348  Int_t  PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r5047 r6963  
    4242//                    per camera SECTOR. Is created automatically.
    4343//
     44// Previous Class Versions haven't been commented by the author!
     45//
     46// Class Version 6:
     47// ----------------
     48//  + added fRunNumber
     49//
    4450// All TOrdCollections have to enlarged by the corresponding calls to (e.g. in MGeomApply):
    4551// - InitSize()
     
    6874
    6975const Int_t MCalibrationCam::gkNumPulserColors = 4;
     76
    7077// --------------------------------------------------------------------------
    7178//
     
    9198//
    9299MCalibrationCam::MCalibrationCam(const char *name, const char *title)
    93     : fPulserColor(kNONE)
     100    : fRunNumber(-1), fPulserColor(kNONE)
    94101{
    95102
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h

    r6775 r6963  
    2121class MBadPixelsCam;
    2222class MGeomCam;
     23
    2324class MCalibrationCam : public MParContainer, public MCamEvent
    2425{
     
    4243  TArrayF fNumLoGainFADCSlices;      // Number Low -Gain FADC slices used by extractor
    4344 
    44   PulserColor_t fPulserColor;        // Colour of the pulsed LEDs
     45  Int_t          fRunNumber;         // Store run number for interlaced calib. events
     46  PulserColor_t  fPulserColor;        // Colour of the pulsed LEDs
    4547
    4648  TOrdCollection *fPixels;            //-> Array of MCalibrationPix, one per pixel
     
    8688                                                  Int_t type=0       ) const;
    8789  const PulserColor_t    GetPulserColor         ()                     const { return fPulserColor; }
     90  const Int_t            GetRunNumer            ()                     const { return fRunNumber;   }
    8891  const Int_t            GetSize                ()                     const;
    8992
     
    100103  void  SetNumUnsuitable       ( const UInt_t i,  const Int_t aidx   ); 
    101104  void  SetNumUnreliable       ( const UInt_t i,  const Int_t aidx   );
    102   virtual void  SetPulserColor( const PulserColor_t col=kCT1 )  { fPulserColor = col; }
    103  
    104   ClassDef(MCalibrationCam, 5)  // Base class Container for Calibration Results Camera
     105  virtual void  SetPulserColor ( const PulserColor_t col=kCT1 )  { fPulserColor = col; }
     106  void  SetRunNumber           ( const Int_t run              )  { fRunNumber   = run; }
     107   
     108  ClassDef(MCalibrationCam, 6)  // Base class Container for Calibration Results Camera
    105109};
    106110
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r6774 r6963  
    250250// --------------------------------------------------------------------------
    251251//
     252// Copy High-gain vs. low-gain conversion factors from cam to this.
     253//
     254Bool_t MCalibrationChargeCam::CopyHiLoConversionFactors(const MCalibrationChargeCam &cam) const
     255{
     256
     257  if (GetSize() != cam.GetSize())
     258    {
     259      *fLog << warn << "Sizes mismatch! Cannot merge high-gain vs. low-gain convertion factors" << endl;
     260      return kFALSE;
     261    }
     262
     263  for (Int_t i=0; i<GetSize(); i++)
     264    {
     265      ((MCalibrationChargePix&)(*this)[i]).SetConversionHiLo   (((MCalibrationChargePix&)cam[i]).GetConversionHiLo());
     266      ((MCalibrationChargePix&)(*this)[i]).SetConversionHiLoErr(((MCalibrationChargePix&)cam[i]).GetConversionHiLoErr());
     267    }
     268
     269  return kTRUE;
     270}
     271
     272// --------------------------------------------------------------------------
     273//
    252274// Print first the well fitted pixels
    253275// and then the ones which are not FitValid
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h

    r6749 r6963  
    5858  TArrayF GetAveragedArrivalTimeRmsPerSector (const MGeomCam &geom,
    5959                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL);
     60
     61  Bool_t CopyHiLoConversionFactors(const MCalibrationChargeCam &cam) const;
    6062 
    6163  // Prints
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc

    r6932 r6963  
    208208
    209209  if (GetNumExecutions()==0)
    210     return kFALSE;
     210    return kTRUE;
    211211
    212212  return Finalize();
Note: See TracChangeset for help on using the changeset viewer.