Ignore:
Timestamp:
03/07/05 17:43:58 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6753 r6768  
    9292using namespace std;
    9393
    94 const TString  MJPedestal::fgReferenceFile = "mjobs/pedestalref.rc";
    95 const TString  MJPedestal::fgBadPixelsFile = "mjobs/badpixels_0_559.rc";
     94const TString  MJPedestal::fgReferenceFile   = "mjobs/pedestalref.rc";
     95const TString  MJPedestal::fgBadPixelsFile   = "mjobs/badpixels_0_559.rc";
     96const Float_t  MJPedestal::fgExtractWinLeft  = 2.5;
     97const Float_t  MJPedestal::fgExtractWinRight = 6.0;
    9698// --------------------------------------------------------------------------
    9799//
     
    116118    SetBadPixelsFile();
    117119
     120    SetExtractWinLeft();
     121    SetExtractWinRight();
    118122    //
    119123    // Default references for case that no value references file is there
     
    301305    disp1.SetCamError  (fPedestalCamOut, 3);
    302306
     307    /*
    303308    if (fIsUseHists)
    304309      {
     
    340345          }
    341346      }
     347    */
    342348   
    343349    if (fExtractionType!=kFundamental/*fExtractorResolution*/)
     
    381387    // Display data
    382388    //
    383     if (fDisplayType != kDisplayDataCheck &&  !fIsUseHists && fExtractionType==kFundamental/*fExtractorResolution*/)
     389    if (fDisplayType != kDisplayDataCheck &&  fExtractionType==kFundamental/*fExtractorResolution*/)
    384390      {
    385391        TCanvas &c3 = fDisplay->AddTab("Pedestals");
     
    391397      }
    392398   
     399#if 0
    393400    if (fIsUseHists)
    394401      {
     
    406413        disp5.CamDraw(c4, 2, 2, 5);
    407414
    408 
     415        /*
    409416        TCanvas &c5 = fDisplay->AddTab("Difference Hist.");
    410417        c5.Divide(2,3);
     
    412419        disp6.CamDraw(c5, 1, 2, 1);
    413420        disp7.CamDraw(c5, 2, 2, 5);
     421        */
    414422
    415423        TCanvas &c6 = fDisplay->AddTab("Difference Calc.");
     
    420428        return;
    421429      }
    422 
     430#endif
    423431    if (fDisplayType == kDisplayDataCheck)
    424432      {
     
    812820    }
    813821
     822
     823    SetExtractWinLeft (GetEnv("ExtractWinLeft",  fExtractWinLeft ));
     824    SetExtractWinRight(GetEnv("ExtractWinRight", fExtractWinRight));
     825
    814826    if (!MJCalib::CheckEnvLocal())
    815827        return kFALSE;
     
    9961008    MHPedestalCam hpedcam;
    9971009    //    fPedestalHist.SetRenorm(kTRUE);
     1010    //    fPedestalHist.SetPedestalsOut(&fPedestalCamOut);
    9981011
    9991012    MPedestalCam pedinter;
     
    10011014
    10021015    MFillH fillped(&hpedcam, "MPedestalCamIntermediate", "FillPedCam");
     1016    //    MFillH fillped(&fPedestalHist, "MPedestalCamIntermediate", "FillPedCam");
    10031017    MFillH fillpul("MHCalibrationPulseTimeCam", "MRawEvtData", "FillPulseTime");
    1004     //    MFillH fillped(&fPedestalHist, "MPedestalCamIntermediate", "FillPedCam");
    10051018    fillped.SetBit(MFillH::kDoNotDisplay);
    10061019    fillpul.SetBit(MFillH::kDoNotDisplay);
     
    10121025    sel.SetNumSelectEvts(0);
    10131026     
    1014     if (fExtractionType!=kFundamental)
     1027    if (fExtractionType!=kFundamental && fExtractor)
    10151028      {
    10161029        fExtractor->SetFilter(&sel);
     
    12351248            const Float_t rmspulsetime = cam->GetAverageArea(0).GetHiGainRms();
    12361249            *fLog << inf << "Mean pulse time (cosmics): " << meanpulsetime << "+-" << rmspulsetime << endl;
    1237             const Int_t newfirst = (Int_t)(meanpulsetime-2.5);
     1250            const Int_t newfirst = (Int_t)(meanpulsetime-fExtractWinLeft);
    12381251            Int_t wshigain = fExtractor->InheritsFrom("MExtractTimeAndCharge")
    12391252              ?  ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeHiGain()
     
    12441257              ? ((MExtractTimeAndCharge*)fExtractor)->GetWindowSizeLoGain()
    12451258              : 6;
    1246             const Int_t newlast  = (Int_t)(meanpulsetime+6.);
    1247             *fLog << inf << "Try to set new range limits: ("<<newfirst<<","<<newlast+wshigain<<")"<<endl;
     1259            const Int_t newlast  = (Int_t)(meanpulsetime+fExtractWinRight);
     1260            *fLog << inf << "Try to set new range limits: ("<<newfirst<<","<<newlast<<"+"<<wshigain
     1261                  <<","<<newfirst<<","<<newlast<<"+"<<wslogain<<")"<<endl;
    12481262            if (newfirst < 0)
    12491263              {
     
    12511265                return kFALSE;
    12521266              }
    1253             if (newlast+wshigain > data->GetNumHiGainSamples())
     1267            if (newlast+wshigain > data->GetNumHiGainSamples()+data->GetNumLoGainSamples()-1)
    12541268              {
    1255                 *fLog << err << "Pulse is too much to the right, cannot go beyond higain limits! "
    1256                       << " Try to use a different extractor ... " << endl;
     1269                *fLog << err << "Pulse is too much to the right, cannot go beyond limits! "
     1270                      << " Cannot extract at all! ... " << endl;
    12571271                return kFALSE;
    12581272              }
     
    12631277                return kFALSE;
    12641278              }
    1265             fExtractor->SetRange(newfirst,newlast+wshigain,newfirst,data->GetNumLoGainSamples());
     1279            fExtractor->SetRange(newfirst,newlast+wshigain,newfirst,data->GetNumLoGainSamples()-1);
    12661280            if (!WriteExtractor())
    12671281              {
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.h

    r6751 r6768  
    2727private:
    2828
    29     static const TString  fgReferenceFile;   //! default for fReferenceFile ("pedestalref.rc")
    30     static const TString  fgBadPixelsFile;   //! default for fBadPixelsFile ("badpixels_0_559.rc")
     29    static const TString  fgReferenceFile;    //! default for fReferenceFile ("pedestalref.rc")
     30    static const TString  fgBadPixelsFile;    //! default for fBadPixelsFile ("badpixels_0_559.rc")
     31
     32    static const Float_t  fgExtractWinLeft;   //! default for fExtractWinLeft  (now set to: 2.5)
     33    static const Float_t  fgExtractWinRight;  //! default for fExtractWinRight (now set to: 6.0)
    3134
    3235    Axis_t fPedestalMin;                     //! Minimum Axis value for pedestal datacheck display
     
    4750    Float_t fRefPedRmsGalacticOuter;         //! Ref. line ped. RMS for galactic source - outer pixels
    4851
     52    Float_t fExtractWinLeft;                 //  Number of FADC slices to extract leftward from mean pulse pos. 
     53    Float_t fExtractWinRight;                //  Number of FADC slices to extract rightward from mean pulse pos.
     54   
    4955    TString fReferenceFile;                  // File name containing the reference values
    5056    TString fBadPixelsFile;                  // File name containing the bad pixels excluded beforehand
     
    119125    void SetBadPixelsFile( const TString ref=fgBadPixelsFile ) { fBadPixelsFile = ref; }
    120126
     127    void SetExtractWinLeft ( const Float_t f=fgExtractWinLeft  ) { fExtractWinLeft  = f; }
     128    void SetExtractWinRight( const Float_t f=fgExtractWinRight ) { fExtractWinRight = f; }   
     129
    121130    MExtractor *GetExtractor() const { return fExtractor; }
    122131
Note: See TracChangeset for help on using the changeset viewer.