Changeset 4054 for trunk


Ignore:
Timestamp:
05/12/04 11:33:29 (21 years ago)
Author:
jlopez
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/MFindStars.cc

    r4053 r4054  
    6666const Float_t sqrt3 = sqrt(3.);
    6767
    68 Bool_t HandleInput()
    69 {
    70     TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);
    71     while (1)
    72     {
    73         //
    74         // While reading the input process gui events asynchronously
    75         //
    76         timer.TurnOn();
    77         cout << "Type 'q' to exit, <return> to go on: " << endl;
    78         char q;
    79         cin >> q;
    80         TString input = q;
    81         timer.TurnOff();
    82 
    83         if (input=="q\n")
    84             return kFALSE;
    85 
    86         if (input=="\n")
    87             return kTRUE;
    88     };
    89 }
    90 
    91 
    9268//______________________________________________________________________________
    9369//
     
    440416Bool_t MFindStars::DCPedestalCalc(Float_t &ped, Float_t &rms)
    441417{
     418  //-------------------------------------------------------------
     419  // save pointer to the MINUIT object for optimizing the supercuts
     420  // because it will be overwritten
     421  // when fitting the alpha distribution in MHFindSignificance
     422  TMinuit *savePointer = gMinuit;
     423  //-------------------------------------------------------------
     424
    442425   UInt_t numPixels = fGeomCam->GetNumPixels();
    443426
     
    470453   
    471454   dchist.Fit("func","QR0");
    472    // Remove the comments if you want to go through the file
    473    // event-by-event:
    474    //   HandleInput();
    475455
    476456   UInt_t aproxnumdegrees = 6*(bin-dchist.GetMaximumBin());
     
    485465   minbin=minbin<1?1:minbin;
    486466   Axis_t maxbin = ped+numsigmas*rms/dchist.GetBinWidth(1);
     467
    487468   *fLog << dbg << " Number of pixels with dc under " << numsigmas << " sigmas = " << dchist.Integral((int)minbin,(int)maxbin) << endl;
     469
     470   //Check results from the fit are consistent
     471   if (TMath::Abs(ped-maxprobdc) > rmsguess || rms > rmsguess)
     472     {
     473       *fLog << warn << GetName() << " Pedestal DC fit give non consistent results." << endl;
     474       *fLog << warn << " maxprobdc " << maxprobdc << " rmsguess " << rmsguess << endl;
     475       *fLog << warn << " ped " << ped << " rms " << rms << " chiq/ndof " << chiq << "/" << aproxnumdegrees << endl;
     476       ped = maxprobdc;
     477       rms = rmsguess/1.175; // FWHM=2.35*rms
     478     }
     479   
     480   //=================================================================
     481   // reset gMinuit to the MINUIT object for optimizing the supercuts
     482   gMinuit = savePointer;
     483   //-------------------------------------------
     484
    488485   return kTRUE;
    489486}
     
    621618    meanSqY /= sumCharge;
    622619
     620    //Substract pedestal from sumCharge
     621    sumCharge -= usedPx*fPedestalDC;
     622
    623623    Float_t rmsX = TMath::Sqrt(meanSqX - meanX*meanX);
    624624    Float_t rmsY = TMath::Sqrt(meanSqY - meanY*meanY);
     
    714714        Float_t pixXpos  = (*fGeomCam)[pix].GetX();
    715715        Float_t pixYpos  = (*fGeomCam)[pix].GetY();
    716         Float_t starXpos = star->GetMeanXCalc();
    717         Float_t starYpos = star->GetMeanYCalc();
    718        
    719         Float_t starSize = 3*star->GetSigmaMajorAxisCalc();
     716        Float_t starXpos = star->GetMeanX();
     717        Float_t starYpos = star->GetMeanY();
     718       
     719        Float_t starSize = 3*star->GetSigmaMajorAxis();
    720720       
    721721        Float_t dist = sqrt((pixXpos-starXpos)*(pixXpos-starXpos)+
Note: See TracChangeset for help on using the changeset viewer.