Changeset 3084 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/10/04 22:45:23 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3082 r3084  
    2929      spectrum
    3030
     31  * mfilter/MCosmics.[h,cc]
     32  * mfilter/Makefile
     33  * mfilter/FilterLinkDef.h
     34    - new filter removing cosmics, the same as in MCalibrationCalc
     35      where it was removed now.
     36      Call: MCosmics cosmics;
     37            MContinue cont(&cosmics);
     38            tlist.AddToList(&cont);
     39
     40  * mcalib/MCalibrationCalc.[h,cc]
     41    - removed cosmics rejection from there
     42 
     43  * macros/calibration.C
     44  * mjobs/MJCalibration.cc
     45    - changed cosmics rejection to the filter algorithm
     46 
    3147
    3248 2004/02/09: Markus Gaug
  • trunk/MagicSoft/Mars/macros/calibration.C

    r3060 r3084  
    219219    MArrivalTimeCalc     timecalc;
    220220    MCalibrationCalc     calcalc;
     221   
     222    //
     223    // Apply a filter against cosmics
     224    // (was directly in MCalibrationCalc in earlier versions)
     225    //
     226    MFCosmics            cosmics;
     227    MContinue            cont(&cosmics);
    221228
    222229    //
     
    241248    // (This is a preliminary feature)
    242249    //
    243     //calcalc.ExcludePixelsFromAsciiFile("badpixels_all.dat");
     250   calcalc.ExcludePixelsFromAsciiFile("badpixels.dat");
    244251   
    245252    //
     
    248255    //
    249256    // calcalc.SkipBlindPixelFit();
    250 
    251     //
    252     // In case, you want to skip the cosmics rejection
    253     // (NOT RECOMMENDED!!!)
    254     //
    255     // calcalc.SkipCosmicsRejection();
    256257
    257258    //
     
    276277    //
    277278    //    tlist2.AddToList(&timecalc);
     279    tlist2.AddToList(&cont);
    278280    tlist2.AddToList(&calcalc);
    279281
     
    301303    // just one example how to get the plots of individual pixels
    302304    //
    303     calcam[356].DrawClone();
     305    calcam[543].DrawClone();
    304306
    305307    // Create histograms to display
     
    312314    MHCamera disp7  (geomcam, "Cal;FFactorConv",    "Conversion Factor (F-Factor Method)");
    313315    MHCamera disp8  (geomcam, "Cal;FFactorFFactor", "Total F-Factor (F-Factor Method)");
    314     MHCamera disp9  (geomcam, "Cal;BlindPixPh",     "Nr. of Photons inside plexiglass (Blind Pixel Method)");
     316    MHCamera disp9  (geomcam, "Cal;BlindPixPh",     "Photon flux inside plexiglass (Blind Pixel Method)");
    315317    MHCamera disp10 (geomcam, "Cal;BlindPixConv",   "Conversion Factor (Blind Pixel Method)");
    316318    MHCamera disp11 (geomcam, "Cal;BlindPixFFactor","Total F-Factor (Blind Pixel Method)");
    317     MHCamera disp12 (geomcam, "Cal;PINDiodePh",     "Nr. of Photons outside plexiglass (PIN Diode Method)");
     319    MHCamera disp12 (geomcam, "Cal;PINDiodePh",     "Photon flux outside plexiglass (PIN Diode Method)");
    318320    MHCamera disp13 (geomcam, "Cal;PINDiodeConv",   "Conversion Factor (PIN Diode Method)");
    319321    MHCamera disp14 (geomcam, "Cal;PINDiodeFFactor","Total F-Factor (PIN Diode Method)");
     
    416418    disp8.SetYTitle("\\sqrt{N_{PhE}}*\\sigma_{Charge}/\\mu_{Charge} [1]");
    417419
    418     disp9.SetYTitle("Nr. Photons [1]");
     420    disp9.SetYTitle("Photon flux [ph/mm^2]");
    419421    disp10.SetYTitle("Conversion Factor [Phot/FADC Count]");
    420422    disp11.SetYTitle("\\sqrt{N_{Ph}}*\\sigma_{Charge}/\\mu_{Charge} [1]");
    421423
    422     disp12.SetYTitle("Nr. Photons [1]");
     424    disp12.SetYTitle("Photon flux [ph/mm^2]");
    423425    disp13.SetYTitle("Conversion Factor [Phot/FADC Count]");
    424426    disp14.SetYTitle("\\sqrt{N_{Ph}}*\\sigma_{Charge}/\\mu_{Charge} [1]");
     
    465467    // F-Factor Method
    466468    TCanvas &c4 = display->AddTab("F-Factor");
    467     c4.Divide(3,3);
    468 
    469     CamDraw(c4, disp6,calcam,1, 3 , 2);
    470     CamDraw(c4, disp7,calcam,2, 3 , 2);
    471     CamDraw(c4, disp8,calcam,3, 3 , 2);
     469    c4.Divide(2,3);
     470
     471    CamDraw(c4, disp6,calcam,1, 2 , 2);
     472    CamDraw(c4, disp7,calcam,2, 2 , 2);
     473    //    CamDraw(c4, disp8,calcam,3, 3 , 2);
    472474
    473475    // Blind Pixel Method
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc

    r3075 r3084  
    4343//               Optionally exclude pixels from calibration               
    4444//
    45 //   Process:    Optionally, a cut on cosmics can be performed
    46 //               
    47 //               Every MCalibrationPix holds a histogram class,
     45//   Process:    Every MCalibrationPix holds a histogram class,
    4846//               MHCalibrationPixel which itself hold histograms of type:
    4947//               HCharge(npix) (distribution of summed FADC time slice
     
    144142 
    145143    SETBIT(fFlags, kUseBlindPixelFit);
    146     SETBIT(fFlags, kUseCosmicsRejection);
    147144    SETBIT(fFlags, kUseQualityChecks);
    148145    SETBIT(fFlags, kHiLoGainCalibration);
     
    156153
    157154    fEvents            = 0;
    158     fCosmics           = 0;
    159155
    160156    fNumHiGainSamples  = 0;
     
    391387  MRawEvtPixelIter pixel(fRawEvt);
    392388 
    393   //
    394   // Perform cosmics cut
    395   //
    396   if (TESTBIT(fFlags,kUseCosmicsRejection))
    397     {
    398        
    399       Int_t cosmicpix = 0;
    400      
    401       //
    402       // Create a first loop to sort out the cosmics ...
    403       //
    404       // This is a very primitive check for the number of cosmicpixs
    405       // The cut will be applied in the fit, but for the blind pixel,
    406       // we need to remove this event
    407       //
    408       // FIXME: In the future need a much more sophisticated one!!!
    409       //
    410      
    411       while (pixel.Next())
    412         {
    413          
    414           const UInt_t pixid = pixel.GetPixelId();
    415          
    416           MExtractedSignalPix &sig =  (*fSignals)[pixid];
    417           MPedestalPix        &ped =  (*fPedestals)[pixid];
    418           Float_t pedrms           = ped.GetPedestalRms()*fSqrtHiGainSamples;
    419           Float_t sumhi            = sig.GetExtractedSignalHiGain();
    420          
    421           //
    422           // We consider a pixel as presumably due to cosmics
    423           // if its sum of FADC slices is lower than 3 pedestal RMS
    424           //
    425           if (sumhi < 3.*pedrms ) 
    426             cosmicpix++;
    427         }
    428      
    429       //
    430       // If the camera contains more than 230
    431       // (this is the number of outer pixels plus about 50 inner ones)
    432       // presumed pixels due to cosmics, then the event is discarted.
    433       // This procedure is more or less equivalent to keeping only events
    434       // with at least 350 pixels with high signals.
    435       //
    436       if (cosmicpix > 230.)
    437         {
    438           fCosmics++;
    439           return kCONTINUE;
    440         }
    441      
    442       pixel.Reset();
    443     }
    444  
    445389  fEvents++;
    446390
    447   //  Float_t referencetime = 0.;
    448  
    449391  //
    450392  // Create a (second) loop to do fill the calibration histograms
     
    624566    {
    625567      *fLog << err << GetDescriptor()
    626             << ": This run contains only cosmics or pedestals, "
    627             << "cannot find events with more than 350 illuminated pixels. " << endl;
     568            << ": This run contains no calibration data! " << endl;
    628569      return kFALSE;
    629570    }
    630571 
    631   if (fEvents < fCosmics)
    632     *fLog << warn << GetDescriptor()
    633           << ": WARNING: Run contains more cosmics or pedestals than calibration events " << endl;
    634 
    635 
    636572  *fLog << inf << GetDescriptor() << ": Cut Histogram Edges" << endl;
    637573
     
    784720  fCalibrations->SetReadyToSave();
    785721 
    786   if (GetNumExecutions()==0)
    787     return kTRUE;
    788  
    789   *fLog << inf << endl;
    790   *fLog << dec << setfill(' ') << fCosmics << " Events presumably cosmics" << endl;
    791 
    792722  return kTRUE;
    793723}
     724
    794725
    795726Bool_t MCalibrationCalc::CalcSignalBlindPixel(Byte_t *ptr, Float_t &signal, const Float_t ped) const
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.h

    r3056 r3084  
    5454
    5555  Int_t fEvents;                           // Number of events 
    56   Int_t fCosmics;                          // Number of events due to supposed cosmics
    5756 
    5857  Byte_t fNumHiGainSamples;
     
    6766
    6867  enum  { kUseBlindPixelFit, kUsePinDiodeFit,
    69           kUseCosmicsRejection, kUseQualityChecks,
     68          kUseQualityChecks,
    7069          kHiLoGainCalibration,
    7170          kHiGainOverFlow, kLoGainOverFlow  };
     
    9695  void SkipPinDiodeFit(Bool_t b=kTRUE)
    9796      {b ? CLRBIT(fFlags, kUsePinDiodeFit) : SETBIT(fFlags, kUsePinDiodeFit);}
    98   void SkipCosmicsRejection(Bool_t b=kTRUE)
    99       {b ? CLRBIT(fFlags, kUseCosmicsRejection) : SETBIT(fFlags, kUseCosmicsRejection);}
    10097  void SkipQualityChecks(Bool_t b=kTRUE)
    10198      {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);}
  • trunk/MagicSoft/Mars/mfilter/FilterLinkDef.h

    r2743 r3084  
    2626#pragma link C++ class MFSelFinal+;
    2727#pragma link C++ class MFSoftwareTrigger+;
     28#pragma link C++ class MFCosmics+;
    2829
    2930#pragma link C++ class MFEnergySlope+;
  • trunk/MagicSoft/Mars/mfilter/Makefile

    r2800 r3084  
    5252           MFSelFinal.cc \
    5353           MFSoftwareTrigger.cc \
     54           MFCosmics.cc \
    5455           MFEnergySlope.cc
    5556
  • trunk/MagicSoft/Mars/mtools/MFFT.cc

    r3074 r3084  
    6868#include "MFFT.h"
    6969
    70 #include "TMath.h"
     70#include <TMath.h>
    7171
    7272#include "MLog.h"
     
    930930
    931931}
    932 
  • trunk/MagicSoft/Mars/mtools/MFFT.h

    r3053 r3084  
    7676  TArrayF* PowerSpectrumDensity(const TArrayF *array);
    7777  TArrayD* PowerSpectrumDensity(const TArrayD *array);
    78  
     78
    7979  TArrayF*  RealFunctionSpectrum(const TArrayF *data);
    8080 
Note: See TracChangeset for help on using the changeset viewer.