Changeset 6077 for trunk


Ignore:
Timestamp:
01/28/05 10:52:54 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6076 r6077  
    6565     - fill MCalibConstCam with update results (once per calib. consts
    6666       update == every 10 sec.)
     67
     68   * mjobs/MJCalibrateSignal.cc:
     69     - display one MHCamera more with changing conv. factors (only for
     70       interlaced cal. events)
    6771
    6872
  • trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc

    r6004 r6077  
    244244    fRelTimeCalc->Finalize();
    245245  if (fCalibrate)
    246     {
    247       fCalibrate->SetCalibUpdate((MCalibrationChargeCam*)fIntensCharge->GetCam());
    248       fCalibrate->UpdateConversionFactors();
    249     }
     246    fCalibrate->UpdateConversionFactors((MCalibrationChargeCam*)fIntensCharge->GetCam());
    250247
    251248  ReInitialize();
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc

    r6040 r6077  
    117117#include "MCalibrationQEPix.h"
    118118
     119#include "MCalibConstCam.h"
     120#include "MCalibConstPix.h"
     121
    119122#include "MExtractedSignalCam.h"
    120123#include "MExtractedSignalPix.h"
     
    143146//
    144147MCalibrateData::MCalibrateData(CalibrationMode_t calmode,const char *name, const char *title)
    145     : fGeomCam(NULL),   fBadPixels(NULL), fCalibrations(NULL), fCalibUpdate(NULL),
    146       fQEs(NULL), fSignals(NULL), fCerPhotEvt(NULL),
     148    : fGeomCam(NULL),   fBadPixels(NULL), fCalibrations(NULL),
     149      fQEs(NULL), fSignals(NULL), fCerPhotEvt(NULL), fCalibConstCam(NULL),
    147150      fPedestalFlag(kNo), fSignalType(kPhot), fRenormFactor(1.)
    148151{
     
    213216        if (!fCerPhotEvt)
    214217            return kFALSE;
     218
     219        fCalibConstCam = (MCalibConstCam*)pList->FindCreateObj(AddSerialNumber("MCalibConstCam"));
     220        if (!fCalibConstCam)
     221            return kFALSE;
    215222    }
    216223
     
    233240        }
    234241
    235         SetCalibUpdate( fCalibrations );
    236242    }
    237243
     
    435441// have been updated...
    436442//
    437 Bool_t MCalibrateData::UpdateConversionFactors()
     443Bool_t MCalibrateData::UpdateConversionFactors( const MCalibrationChargeCam *updatecam)
    438444{
    439445
     
    467473        Float_t calibUpdate   = 1.;
    468474
     475        MCalibConstPix &cpix  = (*fCalibConstCam)[pixidx];
     476           
    469477        if(fCalibrationMode!=kNone)
    470478          {
     
    487495            MCalibrationQEPix &qe = (MCalibrationQEPix&) (*fQEs)[pixidx];
    488496
    489             if (fCalibUpdate)
     497            if (updatecam)
    490498              {
    491                 MCalibrationChargePix &upix = (MCalibrationChargePix&)(*fCalibUpdate)[pixidx];
     499                MCalibrationChargePix &upix = (MCalibrationChargePix&)(*updatecam)[pixidx];
    492500                //
    493501                // Correct for the possible change in amplification of the individual pixels chain
     
    498506                // Correct for global shifts in light emission
    499507                //
    500                 MCalibrationChargePix &ugpix = (MCalibrationChargePix&)fCalibUpdate->GetAverageArea(0);
    501                 //  MBadPixelsPix         &ubad  = (MBadPixelsPix&)        fCalibUpdate->GetAverageBadArea(0);
     508                MCalibrationChargePix &ugpix = (MCalibrationChargePix&)updatecam->GetAverageArea(0);
     509                //  MBadPixelsPix         &ubad  = (MBadPixelsPix&)        updatecam->GetAverageBadArea(0);
    502510                //  if (ubad.IsUnsuitable())
    503511                //    *fLog << err << "Average Area is unsuitable!!!!" << endl;
     
    588596          }
    589597
    590         calibConv *= fRenormFactor * calibUpdate;
     598        calibConv    *= fRenormFactor * calibUpdate;
     599        calibFFactor *= TMath::Sqrt(fRenormFactor);
    591600
    592601        fHiLoConv     [pixidx] = hiloconv;
     
    595604        fCalibFFactors[pixidx] = calibFFactor;
    596605
     606        cpix.SetCalibConst(calibConv);
     607        cpix.SetCalibFFactor(calibFFactor);
     608
    597609      } /*     for (Int_t pixidx=0; pixidx<fGeomCam->GetNumPixels(); pixidx++) */
    598610   
     
    603615        return kFALSE;
    604616    }
     617
     618   
    605619
    606620    //    Print();
     
    824838}
    825839
    826 //----------------------------------------------------------------------------------------------------
    827 //
    828 Bool_t MCalibrateData::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
    829 {
    830 
    831   if (idx > GetSize())
    832     return kFALSE;
    833 
    834   switch (type)
    835     {
    836     case 0:
    837       val = fCalibConsts[idx];
    838       break;
    839     default:
    840       return kFALSE;
    841     }
    842 
    843   return val!=0.;
    844 }
    845 
    846 
    847 // --------------------------------------------------------------------------
    848 //
    849 //
    850 void MCalibrateData::DrawPixelContent(Int_t idx) const
    851 {
    852   *fLog << warn << "DrawPixelContent not available in" << GetDescriptor() << endl;
    853 }
    854 
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.h

    r6040 r6077  
    2525#endif
    2626
    27 #ifndef MARS_MCamEvent
    28 #include "MCamEvent.h"
    29 #endif
    30 
    3127class MGeomCam;
    3228class MBadPixelsCam;
     
    3834class MPedPhotCam;
    3935class MCerPhotEvt;
    40 
    41 class MCalibrateData : public MTask, public MCamEvent
     36class MCalibConstCam;
     37class MCalibrateData : public MTask
    4238{
    4339private:
     
    4642  MBadPixelsCam         *fBadPixels;     //! Bad Pixels information
    4743  MCalibrationChargeCam *fCalibrations;  //! Calibration constants
    48   MCalibrationChargeCam *fCalibUpdate;   //! Calibration constants update (for interlaced cal events)
    4944  MCalibrationQECam     *fQEs;           //! Quantum efficiencies
    5045  MExtractedSignalCam   *fSignals;       //! Integrated charge in FADCs counts
    5146  MCerPhotEvt           *fCerPhotEvt;    //! Cerenkov Photon Event used for calculation
     47  MCalibConstCam        *fCalibConstCam; //! Temporary calib consts storage
    5248 
    5349  UShort_t fCalibrationMode;             // Flag defining the calibration mode (CalibrationMode_t)
     
    121117  void   SetSignalType      ( SignalType_t      sigtype=kPhot    ) { fSignalType     =sigtype; } 
    122118
    123   void   SetCalibUpdate     ( MCalibrationChargeCam *cam=NULL )    { fCalibUpdate    = cam;  }
     119  Bool_t UpdateConversionFactors( const MCalibrationChargeCam *updatecam=NULL);
    124120
    125   Bool_t UpdateConversionFactors();
    126 
    127   Bool_t GetPixelContent    ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0 ) const;
    128   void DrawPixelContent( Int_t num) const;
    129  
    130   ClassDef(MCalibrateData, 1)   // Task to calibrate FADC counts into Cherenkov photons
     121  ClassDef(MCalibrateData, 1)   // Task to calibrate FADC counts into photons or photo-electrons
    131122};
    132123
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6072 r6077  
    572572    MFillH fill6(&evt6, "MBadPixelsCam",          "FillUnsuitable");
    573573    MFillH fill7(&evt7, "MArrivalTime",           "FillTimes");
    574     MFillH fill8(&evt8, "MCalibrateData",         "FillConv");
     574    MFillH fill8(&evt8, "MCalibConstCam",         "FillConv");
    575575
    576576    MTaskEnv fillflorian("FinalFantasy");
     
    699699      tlist2.AddToList(&pextr);
    700700    tlist.AddToList(&tlist2, IsRootData() ? "Events" : "All");
    701     //    if (fIsInterlaced)
    702     //    tlist.AddToList(&fill8);
     701    if (fIsInterlaced)
     702      tlist.AddToList(&fill8);
    703703
    704704    if (IsMC())
Note: See TracChangeset for help on using the changeset viewer.