Changeset 3862 for trunk/MagicSoft


Ignore:
Timestamp:
04/28/04 11:15:08 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3861 r3862  
    2828     - new base class for signal extractors
    2929
     30   * msignal/Makefile   
     31   * msignal/SignalLinkDef.h   
    3032   * msignal/MExtractFixedWindow.[h,cc]
    3133   * msignal/MExtractSlidindWindow.[h,cc]
  • trunk/MagicSoft/Mars/macros/bootcampstandardanalysis.C

    r3832 r3862  
    6060{
    6161
     62  MExtractSlidingWindow extractor;
     63
    6264  MRunIter pruns;
    6365  MRunIter cruns;
     
    118120  MJCalibration     calloop;
    119121  calloop.SetInput(&cruns);
    120   //
    121   // Use as signal extractor MExtractSignal:
    122   //
    123   calloop.SetExtractorLevel(1);
     122  calloop.SetExtractor(&extractor);
    124123  //
    125124  // Set the corr. cams:
     
    186185  static_cast<MRead&>(read3).AddFiles(pruns); 
    187186
    188   MExtractSignal   extsig;
    189187  MCalibrate       photcalc;
    190188  photcalc.SetCalibrationMode(MCalibrate::kFfactor);
     
    193191  tlist3.AddToList(&read3);
    194192  tlist3.AddToList(&geomapl);
    195   tlist3.AddToList(&extsig);
     193  tlist3.AddToList(&extractor);
    196194  tlist3.AddToList(&photcalc);
    197195  //    tlist3.AddToList(&photrmscalc);
     
    252250  tlist4.AddToList(&read4);
    253251  tlist4.AddToList(&geomapl);
    254   tlist4.AddToList(&extsig);
     252  tlist4.AddToList(&extractor);
    255253  tlist4.AddToList(&timecalc);
    256254  tlist4.AddToList(&photcalc);
     
    264262
    265263  if (!evtloop4.PreProcess())
    266 
    267264    return;
    268265 
  • trunk/MagicSoft/Mars/macros/calibration.C

    r3855 r3862  
    6363{
    6464
     65  MExtractFixedWindowPeakSearch extractor;
    6566 
    6667  MRunIter pruns;
     
    120121  //
    121122  //  calloop.SetRelTimeCalibration();
     123  calloop.SetExtractor(&extractor);
    122124  calloop.SetInput(&cruns);
    123125  calloop.SetDisplay(display);
     
    134136  MJExtractCalibTest testloop;
    135137
     138  testloop.SetExtractor(&extractor);
    136139  testloop.SetInput(&cruns);
    137140  testloop.SetDisplay(display);
  • trunk/MagicSoft/Mars/macros/pedphotcalc.C

    r3832 r3862  
    6565#include "MCalibrationQEPix.h"
    6666#include "MExtractedSignalCam.h"
    67 #include "MExtractSignal.h"
     67#include "MExtractSlidingWindow.h"
     68#include "MExtractFixedWindow.h"
    6869#include "MCerPhotEvt.h"
    6970#include "MCalibrate.h"
     
    210211                 )
    211212{
     213
     214  MExtractFixedWindow extractor;
    212215 
    213216  MRunIter pruns;
     
    266269  // Use as signal extractor MExtractSignal:
    267270  //
    268   calloop.SetExtractorLevel(1);
     271  calloop.SetExtractor(&extractor);
    269272  //
    270273  // The next two commands are for the display:
     
    313316  static_cast<MRead&>(read3).AddFiles(pruns); 
    314317
    315   MExtractSignal  sigcalc;
    316318  MCalibrate      photcalc;
    317319  photcalc.SetCalibrationMode(MCalibrate::kFfactor);
     
    320322  tlist3.AddToList(&read3);
    321323  tlist3.AddToList(&geomapl);
    322   tlist3.AddToList(&sigcalc);
     324  tlist3.AddToList(&extractor);
    323325  tlist3.AddToList(&photcalc);
    324326  tlist3.AddToList(&pedphotcalc);
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r3856 r3862  
    3838//End_Html
    3939//
    40 // Different signal extractors can be chosen via the command SetExtractorLevel(UInt_t i)
    41 // Up to now, the following extractors are available:
    42 // i=1: Use MExtractSignal  (fixed window)
    43 // i=2: Use MExtractSignal2 (sliding window: default)
    44 // i=3: Use MExtractSignal3 (coherent sliding window for all pixels)
     40// Different signal extractors can be set with the command SetExtractor()
     41// Only extractor deriving from MExtractor can be set, default is MExtractSlidingWindow
    4542//
    4643// At the end of the eventloop, plots and results are displayed, depending on
     
    119116#include "MBadPixelsMerge.h"
    120117#include "MBadPixelsCam.h"
    121 #include "MExtractSignal.h"
     118#include "MExtractor.h"
    122119#include "MExtractPINDiode.h"
    123120#include "MExtractBlindPixel.h"
    124 #include "MExtractSignal2.h"
    125 #include "MExtractSignal3.h"
     121#include "MExtractSlidingWindow.h"
    126122#include "MFCosmics.h"
    127123#include "MContinue.h"
     
    143139// Default constructor.
    144140//
    145 // Sets fRuns to 0, fColor to kNONE, fDisplay to kNormalDisplay,
     141// Sets fRuns to 0, fExtractor to NULL, fColor to kNONE, fDisplay to kNormalDisplay,
    146142// fRelTime to kFALSE, fExtractorLevel to 2, fArrivalTimeLevel to 2
    147143//
    148144MJCalibration::MJCalibration(const char *name, const char *title)
    149     : fRuns(0), fColor(MCalibrationCam::kNONE), fDisplayType(kNormalDisplay),
    150       fRelTimes(kFALSE), fDataCheck(kFALSE), fExtractorLevel(2), fArrivalTimeLevel(2)
     145    : fRuns(0), fExtractor(NULL), fColor(MCalibrationCam::kNONE), fDisplayType(kNormalDisplay),
     146      fRelTimes(kFALSE), fDataCheck(kFALSE), fArrivalTimeLevel(2)
    151147{
    152148  fName  = name  ? name  : "MJCalibration";
     
    765761//   2)  MBadPixelsMerge
    766762//   3)  MGeomApply
    767 //   4)  MExtractSignal, MExtractSignal2 or MExtractSignal3, depending on fExtractorLevel
     763//   4)  MExtractor
    768764//   5)  MExtractPINDiode
    769765//   6)  MExtractBlindPixel
     
    839835  MExtractPINDiode         pinext;
    840836  MExtractBlindPixel       blindext;
    841   MExtractSignal           extract1;
    842   MExtractSignal2          extract2;
    843   MExtractSignal3          extract3;
     837  MExtractSlidingWindow    extract2;
    844838  MArrivalTimeCalc         tmecalc1;
    845839  MArrivalTimeCalc2        tmecalc2;
     
    872866  tlist.AddToList(&apply);
    873867
    874   if (fExtractorLevel <= 1)
    875     tlist.AddToList(&extract1);
    876   else if (fExtractorLevel == 2)
    877     tlist.AddToList(&extract2);
    878   else if (fExtractorLevel == 3)
    879     tlist.AddToList(&extract3);
     868  if (fExtractor)
     869    tlist.AddToList(fExtractor);
    880870  else
    881871    {
    882       *fLog << err << GetDescriptor()
    883             << ": No valid Signal extractor has been chosen, have only: " << fExtractorLevel
    884             << " aborting..." << endl;
    885       return kFALSE;
     872      *fLog << warn << GetDescriptor()
     873            << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;
     874      tlist.AddToList(&extract2);
    886875    }
    887876 
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.h

    r3853 r3862  
    2121class MParList;
    2222class MPedestalCam;
     23class MExtractor;
    2324class MJCalibration : public MParContainer, public MGCamDisplays
    2425{
     
    2930  TString fOutputPath;                                     // Path to the output files
    3031 
    31   MRunIter *fRuns;                                         // Calibration files
     32  MRunIter   *fRuns;                                       // Calibration files
     33  MExtractor *fExtractor;                                  // Signal extractor
    3234 
    3335  MBadPixelsCam          fBadPixels;                       // Bad Pixels cam, can be set from previous runs
     
    4446  Bool_t fRelTimes;                                        // Flag if relative times have to be calibrated
    4547  Bool_t fDataCheck;                                       // Flag if the data check is run on raw data
    46   UInt_t fExtractorLevel;                                  // Level signal extractor (e.g. MExtractSignal2)
    4748  UInt_t fArrivalTimeLevel;                                // Level arr. time extractor (e.g. MArrivalTimeCalc2)
    4849 
     
    6768  const MBadPixelsCam    &GetBadPixels() const    { return fBadPixels;      }
    6869 
    69   void SetBadPixels(const MBadPixelsCam &bad)    { bad.Copy(fBadPixels);   }
     70  void SetBadPixels(const MBadPixelsCam &bad)     { bad.Copy(fBadPixels);   }
     71  void SetExtractor(MExtractor* ext)              { fExtractor = ext; }
    7072  void SetQECam    (const MCalibrationQECam &qe) { qe.Copy(fQECam);        }   
    7173  void SetColor    (const MCalibrationCam::PulserColor_t color) { fColor = color; }
     
    8385
    8486  // Extractors
    85   void SetExtractorLevel    (const UInt_t i=1    ) { fExtractorLevel   = i; }
    8687  void SetArrivalTimeLevel  (const UInt_t i=1    ) { fArrivalTimeLevel = i; } 
    87      
    8888 
    8989  Bool_t ReadCalibrationCam();
  • trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.cc

    r3854 r3862  
    5454#include "MReadMarsFile.h"
    5555#include "MGeomApply.h"
    56 #include "MExtractSignal.h"
     56#include "MExtractSlidingWindow.h"
     57#include "MExtractor.h"
    5758#include "MFillH.h"
    5859#include "MCalibrate.h"
     
    6566
    6667using namespace std;
    67 
    68 MJExtractCalibTest::MJExtractCalibTest(const char *name, const char *title) : fRuns(0)
     68// --------------------------------------------------------------------------
     69//
     70// Default constructor.
     71//
     72// Sets fRuns to 0, fExtractor to NULL
     73//
     74MJExtractCalibTest::MJExtractCalibTest(const char *name, const char *title)
     75    : fRuns(NULL), fExtractor(NULL)
    6976{
    7077    fName  = name  ? name  : "MJExtractCalibTest";
     
    93100 
    94101  // Create histograms to display
    95   MHCamera disp1 (geomcam, "Cal;Photons",           "Mean of calibrated Photons");
    96   MHCamera disp2 (geomcam, "Cal;SigmaPhotons",      "Sigma of calibrated photons");
    97   MHCamera disp3 (geomcam, "Cal;PhotonsPerArea",    "Mean Photons per Area");
    98   MHCamera disp4 (geomcam, "Cal;SigmaPhotPerArea",  "Sigma Photons per Area");
     102  MHCamera disp1 (geomcam, "Test;Photons",           "Mean of calibrated Photons");
     103  MHCamera disp2 (geomcam, "Test;SigmaPhotons",      "Sigma of calibrated photons");
     104  MHCamera disp3 (geomcam, "Test;PhotonsPerArea",    "Equiv. Cherenkov Photons per Area");
     105  MHCamera disp4 (geomcam, "Test;SigmaPhotPerArea",  "Sigma equiv. Cher. Photons per Area");
    99106
    100107  // Fitted charge means and sigmas
     
    199206  static_cast<MRead&>(read).AddFiles(*fRuns);
    200207 
    201   MGeomApply      apply; // Only necessary to craete geometry
    202   MExtractSignal  extract;
    203   MCalibrate      photcalc;
     208  MGeomApply            apply; // Only necessary to craete geometry
     209  MExtractSlidingWindow extract2;
     210  MCalibrate            photcalc;
    204211  photcalc.SetCalibrationMode(MCalibrate::kFfactor);
    205212
     
    223230  tlist.AddToList(&read);
    224231  tlist.AddToList(&apply);
    225   tlist.AddToList(&extract);
     232
     233  if (fExtractor)
     234    tlist.AddToList(fExtractor);
     235    else
     236    {
     237      *fLog << warn << GetDescriptor()
     238            << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;
     239      tlist.AddToList(&extract2);
     240    }
     241
    226242  if (TestBit(kEnableGraphicalOutput))
    227243    tlist.AddToList(&fill);
     
    328344    plist.AddToList(&tlist);
    329345
    330     MGeomApply      apply; // Only necessary to craete geometry
    331     MExtractSignal  extract;
    332     MCalibrate      calib;
    333     MPedPhotCalc    calc;
     346    MGeomApply            apply; // Only necessary to craete geometry
     347    MExtractSlidingWindow extract2;
     348    MCalibrate            calib;
     349    MPedPhotCalc          calc;
    334350
    335351    MHCamEvent evt1("ExtOffset");
     
    342358    tlist.AddToList(&read);
    343359    tlist.AddToList(&apply);
    344     tlist.AddToList(&extract);
     360
     361    if (fExtractor)
     362      tlist.AddToList(fExtractor);
     363    else
     364      {
     365      *fLog << warn << GetDescriptor()
     366            << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;
     367      tlist.AddToList(&extract2);
     368    }
     369
    345370    if (TestBit(kEnableGraphicalOutput))
    346371        tlist.AddToList(&fill1);
  • trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.h

    r3854 r3862  
    2020class MCalibrationChargeCam;
    2121class MCalibrationQECam;
    22 class MPedPhotCam;
    23 class MHCalibrationTestCam;
     22class MExtractor;
    2423class MJExtractCalibTest : public MParContainer, public MGCamDisplays
    2524{
     
    2827  TString fOutputPath;
    2928
    30   MRunIter *fRuns;
     29  MRunIter   *fRuns;                                       // Data files
     30  MExtractor *fExtractor;                                  // Signal extractor
    3131 
    3232  MBadPixelsCam        fBadPixels;
     
    5454  const MBadPixelsCam &GetBadPixels()  const { return fBadPixels; }
    5555 
     56  void SetExtractor(MExtractor* ext)              { fExtractor = ext; }
    5657  void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
    5758 
  • trunk/MagicSoft/Mars/msignal/Makefile

    r3816 r3862  
    3737SRCFILES = MExtractedSignalCam.cc \
    3838           MExtractedSignalPix.cc \
     39           MExtractor.cc \
     40           MExtractFixedWindow.cc \
     41           MExtractSlidingWindow.cc \
     42           MExtractFixedWindowPeakSearch.cc \
    3943           MExtractSignal.cc \
    4044           MExtractSignal2.cc \
  • trunk/MagicSoft/Mars/msignal/SignalLinkDef.h

    r3633 r3862  
    1010#pragma link C++ class MExtractSignal2+;
    1111#pragma link C++ class MExtractSignal3+;
     12
     13#pragma link C++ class MExtractor+;
     14#pragma link C++ class MExtractFixedWindow+;
     15#pragma link C++ class MExtractSlidingWindow+;
     16#pragma link C++ class MExtractFixedWindowPeakSearch+;
     17   
    1218
    1319#pragma link C++ class MExtractPINDiode++;
Note: See TracChangeset for help on using the changeset viewer.