Changeset 5210


Ignore:
Timestamp:
10/08/04 10:48:10 (20 years ago)
Author:
mase
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmuon
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.cc

    r5173 r5210  
    1616!
    1717!
    18 !   Author(s): Keiichi Mase 09/2004 <mailto:mase@mppmu.mpg.de>
    19 !              Markus Meyer 09/2004 <mailto:meyer@astro.uni-wuerzburg.de>
     18!   Author(s): Keiichi Mase 10/2004 <mailto:mase@mppmu.mpg.de>
     19!              Markus Meyer 10/2004 <mailto:meyer@astro.uni-wuerzburg.de>
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2004
     
    7272    fTitle = title ? title : "Muon calibration parameters";
    7373
    74     fHistPhi.SetName("HistPhi");
    75     fHistPhi.SetTitle("HistPhi");
    76     fHistPhi.SetXTitle("phi [deg.]");
    77     fHistPhi.SetYTitle("sum of ADC");
    78     fHistPhi.SetDirectory(NULL);
    79     fHistPhi.SetFillStyle(4000);
    80     fHistPhi.UseCurrentStyle();
    81 
    82     fHistWid.SetName("HistWid");
    83     fHistWid.SetTitle("HistWid");
    84     fHistWid.SetXTitle("distance from the ring center [deg.]");
    85     fHistWid.SetYTitle("sum of ADC");
    86     fHistWid.SetDirectory(NULL);
    87     fHistWid.SetFillStyle(4000);
    88     fHistWid.UseCurrentStyle();
    89 
    90     fKeepHist = kFALSE;         // normally histgram is not kept
     74    fHistPhi   = new TH1F;
     75    fHistWidth = new TH1F;
     76
     77    fHistPhi->SetName("HistPhi");
     78    fHistPhi->SetTitle("HistPhi");
     79    fHistPhi->SetXTitle("phi [deg.]");
     80    fHistPhi->SetYTitle("sum of ADC");
     81    fHistPhi->SetDirectory(NULL);
     82    fHistPhi->SetFillStyle(4000);
     83    fHistPhi->UseCurrentStyle();
     84
     85    fHistWidth->SetName("HistWidth");
     86    fHistWidth->SetTitle("HistWidth");
     87    fHistWidth->SetXTitle("distance from the ring center [deg.]");
     88    fHistWidth->SetYTitle("sum of ADC");
     89    fHistWidth->SetDirectory(NULL);
     90    fHistWidth->SetFillStyle(4000);
     91    fHistWidth->UseCurrentStyle();
     92
    9193    fEnableImpactCalc = kFALSE; // By default the calculation of impact parameter is skipped.
    9294    fDisablePreCuts = kFALSE;   // By default the pre cuts will be applied.
    93     fUseCleanForWid = kFALSE;  // By default all the pixels will be used for the histogram of arc width.
     95    fUseCleanForWidth = kFALSE; // By default all the pixels will be used for the histogram of arc width.
    9496
    9597    fMargin = 60.;  // in mm
    9698    fArcPhiThres  = 100.;
    97     fArcWidThres  = 100.;
     99    fArcWidthThres  = 100.;
    98100    fArcPhiBinNum = 20;
    99101    fArcPhiHistStartVal = -180.; // deg.
    100102    fArcPhiHistEndVal   = 180.;  // deg.
    101     fArcWidBinNum = 28;
    102     fArcWidHistStartVal = 0.3;   // deg.
    103     fArcWidHistEndVal   = 1.7;   // deg.
     103    fArcWidthBinNum = 28;
     104    fArcWidthHistStartVal = 0.3;   // deg.
     105    fArcWidthHistEndVal   = 1.7;   // deg.
     106}
     107
     108// --------------------------------------------------------------------------
     109//
     110MMuonCalibPar::~MMuonCalibPar()
     111{
     112  delete fHistPhi;
     113  delete fHistWidth;
    104114}
    105115
     
    108118void MMuonCalibPar::Reset()
    109119{
    110   fArcLen      = -1.;
     120  fArcLength   = -1.;
    111121  fArcPhi      =  0.;
    112   fArcWid      = -1.;
     122  fArcWidth    = -1.;
    113123  fChiArcPhi   = -1.;
    114   fChiArcWid  = -1.;
     124  fChiArcWidth = -1.;
    115125  fMuonSize    =  0.;
    116126  fEstImpact   = -1.;
     
    122132//
    123133//  This function fill the histograms in order to get muon parameters.
    124 // For the evaluation of the Arc Width, we use only the signals in the inner part.
    125 // You can use the image after the cleaning by using the function of UseCleanForWid().
    126 // See the manual of MMuonCalibParCalc.
     134// For the evaluation of the Arc Width, we use only the signals in the inner
     135// part. You can use the image after the cleaning by using the function of
     136// UseCleanForWidth(). See the manual of MMuonCalibParCalc.
    127137//
    128138void MMuonCalibPar::FillHist
     
    133143  MBinning binsphi;
    134144  binsphi.SetEdges(fArcPhiBinNum, fArcPhiHistStartVal, fArcPhiHistEndVal);
    135   binsphi.Apply(fHistPhi);
     145  binsphi.Apply(*fHistPhi);
    136146
    137147  MBinning binswid;
    138   binswid.SetEdges(fArcWidBinNum, fArcWidHistStartVal, fArcWidHistEndVal);
    139   binswid.Apply(fHistWid);
     148  binswid.SetEdges(fArcWidthBinNum, fArcWidthHistStartVal, fArcWidthHistEndVal);
     149  binswid.Apply(*fHistWidth);
    140150
    141151 const Int_t entries = evt.GetNumPixels();
    142152
    143153  // the position of the center of a muon ring
    144   const Float_t cenx = musearch.GetCenX();
    145   const Float_t ceny = musearch.GetCenY();
     154  const Float_t cenx = musearch.GetCenterX();
     155  const Float_t ceny = musearch.GetCenterY();
    146156 
    147157  for (Int_t i=0; i<entries; i++ )
     
    161171     
    162172      // if the signal is not near the estimated circle, it is ignored.
    163       if(dist < musearch.GetRad() + fMargin && dist > musearch.GetRad() - fMargin)
     173      if(dist < musearch.GetRadius() + fMargin && dist > musearch.GetRadius() - fMargin)
    164174        {
    165175          // check whether ummapped pixel is used or not.
     
    170180              continue;
    171181            }
    172           fHistPhi.Fill(ang*kRad2Deg, pix.GetNumPhotons());
     182          fHistPhi->Fill(ang*kRad2Deg, pix.GetNumPhotons());
    173183          fMuonSize += pix.GetNumPhotons();
    174184        }
     
    177187        continue;  // use only the inner pixles
    178188     
    179       if(fUseCleanForWid)
     189      if(fUseCleanForWidth)
    180190        {
    181191          if(!pix.IsPixelUsed())
     
    183193        }
    184194
    185       fHistWid.Fill(dist*geom.GetConvMm2Deg(), pix.GetNumPhotons());
     195      fHistWidth->Fill(dist*geom.GetConvMm2Deg(), pix.GetNumPhotons());
    186196    }
    187197
     
    191201  // once convert the signal from ADC to photo-electron. Then we can get
    192202  // the fluctuation such as F-factor*sqrt(phe).
    193   //  Up to now, the error of pedestal is not taken into accout. This is not of
    194   // course correct. We will include this soon.
     203  //  Up to now, the error of pedestal is not taken into accout. This is not
     204  // of course correct. We will include this soon.
    195205    Double_t ADC2PhEl = 0.14;
    196206    Double_t Ffactor = 1.4;
    197207    for(Int_t i=0; i<fArcPhiBinNum+1; i++)
    198208      {
    199         Float_t rougherr  = TMath::Sqrt(TMath::Abs(fHistPhi.GetBinContent(i))*ADC2PhEl)/ADC2PhEl*Ffactor;
    200         {
    201           fHistPhi.SetBinError(i, rougherr);
     209        Float_t rougherr  = TMath::Sqrt(TMath::Abs(fHistPhi->GetBinContent(i))*ADC2PhEl)/ADC2PhEl*Ffactor;
     210        {
     211          fHistPhi->SetBinError(i, rougherr);
    202212        }
    203213      }
    204     for(Int_t i=0; i<fArcWidBinNum+1; i++)
     214    for(Int_t i=0; i<fArcWidthBinNum+1; i++)
    205215      {
    206         Float_t rougherr = TMath::Sqrt(TMath::Abs(fHistWid.GetBinContent(i))*ADC2PhEl)/ADC2PhEl*Ffactor;
    207         {
    208           fHistWid.SetBinError(i, rougherr);
     216        Float_t rougherr = TMath::Sqrt(TMath::Abs(fHistWidth->GetBinContent(i))*ADC2PhEl)/ADC2PhEl*Ffactor;
     217        {
     218          fHistWidth->SetBinError(i, rougherr);
    209219        }
    210220      }
     
    226236    Float_t maxval = 0.;
    227237    Int_t   maxbin = 0;
    228     maxval = fHistPhi.GetMaximum();
    229     maxbin = fHistPhi.GetMaximumBin();
     238    maxval = fHistPhi->GetMaximum();
     239    maxbin = fHistPhi->GetMaximumBin();
    230240    fPeakPhi = 180.-(Float_t)(maxbin-1)*convbin2val;
    231241    TArrayD tmp;
     
    233243    for(Int_t i=1; i<fArcPhiBinNum+1; i++)
    234244      {
    235         tmp[i] = fHistPhi.GetBinContent(i);
     245        tmp[i] = fHistPhi->GetBinContent(i);
    236246      }
    237247    for(Int_t i=1; i<fArcPhiBinNum+1; i++)
     
    247257            id+=(fArcPhiBinNum);
    248258          }
    249         fHistPhi.SetBinContent(i,tmp[id]);
     259        fHistPhi->SetBinContent(i,tmp[id]);
    250260      }
    251261    maxbin = (Int_t)((Float_t)fArcPhiBinNum/2.)+1;
     
    260270  for(Int_t i=1; i<fArcPhiBinNum+1; i++)
    261271    {
    262       Float_t content = fHistPhi.GetBinContent(i);
    263       Float_t content_pre = fHistPhi.GetBinContent(i-1);
     272      Float_t content = fHistPhi->GetBinContent(i);
     273      Float_t content_pre = fHistPhi->GetBinContent(i-1);
    264274     
    265275      if(content > fArcPhiThres && content_pre < fArcPhiThres)
     
    281291 
    282292  fArcPhi = effbinnum*convbin2val;
    283   fArcLen = fArcPhi*3.1415926/180.*musearch.GetRad()*geom.GetConvMm2Deg();
     293  fArcLength = fArcPhi*3.1415926/180.*musearch.GetRadius()*geom.GetConvMm2Deg();
    284294 
    285295  if(fEnableImpactCalc)
     
    310320  // impact parameter inside mirror radius (8.5m)
    311321  TString func1;
    312   Float_t tmpval = musearch.GetRad()*geom.GetConvMm2Deg()*3.1415926/180.;
     322  Float_t tmpval = musearch.GetRadius()*geom.GetConvMm2Deg()*3.1415926/180.;
    313323  tmpval = sin(2.*tmpval)*8.5;
    314324  func1 += "[0]*";
     
    321331  f1.SetParLimits(2,-180.,180.);
    322332 
    323   if(fKeepHist)
    324     {
    325       fHistPhi.Fit("f1","RQEM");
    326     }
    327   else
    328     {
    329       fHistPhi.Fit("f1","RQEM0");
    330     }
     333  fHistPhi->Fit("f1","RQEM");
    331334 
    332335  Float_t chi1 = -1;
     
    340343  // impact parameter beyond mirror area (8.5m)
    341344  TString func2;
    342   Float_t tmpval2 = musearch.GetRad()*geom.GetConvMm2Deg()*3.1415926/180.;
     345  Float_t tmpval2 = musearch.GetRadius()*geom.GetConvMm2Deg()*3.1415926/180.;
    343346  tmpval2 = sin(2.*tmpval2)*8.5*2.;
    344347  func2 += "[0]*";
     
    351354  f2.SetParLimits(2,-180.,180.);
    352355 
    353   if(fKeepHist)
    354     {
    355       fHistPhi.Fit("f2","RQEM+");
    356     }
    357   else
    358     {
    359       fHistPhi.Fit("f2","RQEM0+");
    360     }
     356  fHistPhi->Fit("f2","RQEM+");
    361357 
    362358  if(effbinnum>3)
     
    388384// can represent to the PSF of our reflector.
    389385//
    390 Float_t MMuonCalibPar::CalcWid
     386Float_t MMuonCalibPar::CalcWidth
    391387(const MGeomCam &geom, const MCerPhotEvt &evt,
    392388 const MMuonSearchPar &musearch)
    393389{
    394   Float_t convbin2val = (fArcWidHistEndVal - fArcWidHistStartVal)
    395     /(Float_t)fArcWidBinNum;
     390  Float_t convbin2val = (fArcWidthHistEndVal - fArcWidthHistStartVal)
     391    /(Float_t)fArcWidthBinNum;
    396392
    397393    // determination of fitting region
    398     Int_t maxbin = fHistWid.GetMaximumBin();
     394    Int_t maxbin = fHistWidth->GetMaximumBin();
    399395    Float_t startfitval = 0.;
    400396    Float_t endfitval   = 0.;
    401397    Bool_t   IsInMaxim = kFALSE;
    402398    Int_t    effbinnum = 0;
    403     for(Int_t i=1; i<fArcWidBinNum+1; i++)
     399    for(Int_t i=1; i<fArcWidthBinNum+1; i++)
    404400      {
    405         Float_t content = fHistWid.GetBinContent(i);
    406         Float_t content_pre = fHistWid.GetBinContent(i-1);
    407 
    408         if(content > fArcWidThres)
     401        Float_t content = fHistWidth->GetBinContent(i);
     402        Float_t content_pre = fHistWidth->GetBinContent(i-1);
     403
     404        if(content > fArcWidthThres)
    409405          effbinnum++;
    410406
    411         if(content > fArcWidThres && content_pre < fArcWidThres)
     407        if(content > fArcWidthThres && content_pre < fArcWidthThres)
    412408          {
    413             startfitval = (Float_t)(i-4)*convbin2val + fArcWidHistStartVal;
     409            startfitval = (Float_t)(i-4)*convbin2val + fArcWidthHistStartVal;
    414410            if(startfitval<0.) startfitval = 0.;
    415411          }
     
    417413          IsInMaxim = kTRUE;
    418414
    419         if(content < fArcWidThres && IsInMaxim == kTRUE)
     415        if(content < fArcWidthThres && IsInMaxim == kTRUE)
    420416          {
    421             endfitval = (Float_t)(i+2)*convbin2val + fArcWidHistStartVal;
     417            endfitval = (Float_t)(i+2)*convbin2val + fArcWidthHistStartVal;
    422418            if(endfitval>180.) endfitval = 180.;
    423419            break;
    424420          }
    425         endfitval = fArcWidHistEndVal;
     421        endfitval = fArcWidthHistEndVal;
    426422      }
    427423    effbinnum = (Int_t)((endfitval-startfitval)/convbin2val);
     
    429425    TF1 f1("f1","gaus",startfitval,endfitval);
    430426
    431     if(fKeepHist)
    432       {
    433         fHistWid.Fit("f1","QR","",startfitval,endfitval);
    434       }
    435     else
    436       {
    437         fHistWid.Fit("f1","QR0","",startfitval,endfitval);
    438       }
     427    fHistWidth->Fit("f1","QR","",startfitval,endfitval);
    439428   
    440429    if(effbinnum>3)
    441       fChiArcWid = f1.GetChisquare()/((Float_t)(effbinnum-3));
     430      fChiArcWidth = f1.GetChisquare()/((Float_t)(effbinnum-3));
    442431
    443432    Double_t val,err;
     
    453442Int_t MMuonCalibPar::Calc
    454443(const MGeomCam &geom, const MCerPhotEvt &evt,
    455  const MMuonSearchPar &musearch)
     444 MMuonSearchPar &musearch, const Float_t *cuts)
    456445{
    457446  // sanity check
     
    459448    return kCONTINUE;
    460449
    461   // if an event does not seem to be like muon, it will be skipped.
     450  // If an event does not seem to be like muon, the calculation will be skipped.
    462451  if(musearch.IsNoMuon())
    463452    return kCONTINUE;
     
    466455  if(!fDisablePreCuts)
    467456    {
    468       if(musearch.GetRad() < 180. || musearch.GetRad() > 400.)
    469         return kCONTINUE;
    470       if(musearch.GetDev() > 50.)
    471         return kCONTINUE;
     457      if(musearch.GetRadius() < cuts[0] || musearch.GetRadius() > cuts[1])
     458        {
     459          musearch.SetNoMuon();
     460          return kCONTINUE;
     461        }
     462      if(musearch.GetDeviation() > cuts[2])
     463        {
     464          musearch.SetNoMuon();
     465          return kCONTINUE;
     466        }
    472467    }
    473468
     
    481476  if(!fDisablePreCuts)
    482477    {
    483       if(fMuonSize < 2000. || fArcPhi < 150.)
    484         return kCONTINUE;
    485     }
    486 
    487   fArcWid = CalcWid(geom,evt,musearch);
    488  
    489   // Pre Cuts 3
    490   if(!fDisablePreCuts)
    491     {
    492       if(fArcWid < 0.16)
    493         return kCONTINUE;
    494     }
    495 
     478      if(fMuonSize < cuts[3] || fArcPhi < cuts[4])
     479        {
     480          musearch.SetNoMuon();
     481          return kCONTINUE;
     482        }
     483    }
     484
     485  fArcWidth = CalcWidth(geom,evt,musearch);
     486 
    496487  SetReadyToSave();
    497  
    498   if(!fKeepHist){
    499     fHistPhi.Reset();
    500     fHistWid.Reset();
    501   }
    502488
    503489  return kTRUE;
     
    508494    *fLog << all;
    509495    *fLog << "Muon Parameters (" << GetName() << ")"    << endl;
    510     *fLog << " - Arc Len.    [deg.]  = " << fArcLen     << endl;
    511     *fLog << " - Arc Phi     [deg.]  = " << fArcPhi     << endl;
    512     *fLog << " - Arc Wid.    [deg.]  = " << fArcWid     << endl;
    513     *fLog << " - Chi Arc Phi [x2/ndf]= " << fChiArcPhi  << endl;
    514     *fLog << " - Chi Arc Wid [x2/ndf]= " << fChiArcWid  << endl;
    515     *fLog << " - Est. I. P.  [m]     = " << fEstImpact  << endl;
    516     *fLog << " - Size of muon        = " << fMuonSize   << endl;
    517     *fLog << " - Peak Phi    [deg.]  = " << fPeakPhi    << endl;
    518     *fLog << " - UseUnmap            = " << fUseUnmap   << endl;
    519 }
    520 
    521 
    522 
    523 
     496    *fLog << " - Arc Length    [deg.]  = " << fArcLength     << endl;
     497    *fLog << " - Arc Phi       [deg.]  = " << fArcPhi     << endl;
     498    *fLog << " - Arc Width     [deg.]  = " << fArcWidth     << endl;
     499    *fLog << " - Chi Arc Phi   [x2/ndf]= " << fChiArcPhi  << endl;
     500    *fLog << " - Chi Arc Width [x2/ndf]= " << fChiArcWidth  << endl;
     501    *fLog << " - Est. I. P.    [m]     = " << fEstImpact  << endl;
     502    *fLog << " - Size of muon          = " << fMuonSize   << endl;
     503    *fLog << " - Peak Phi      [deg.]  = " << fPeakPhi    << endl;
     504    *fLog << " - UseUnmap              = " << fUseUnmap   << endl;
     505}
     506
     507
     508
     509
  • trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.h

    r5173 r5210  
    1717{
    1818private:
    19   Float_t fArcLen;       // An arc length of a muon along the arc [deg.]
    20   Float_t fArcPhi;       // A opening angle of a muon arc [deg.]
    21   Float_t fArcWid;       // A width of a muon [deg.] (1 sigma of gaussian fit)
    22   Float_t fChiArcPhi;    // A chisquare value of the cosine fit for arc phi
    23   Float_t fChiArcWid;    // A chisquare value of the cosine fit for arc wid
    24   Float_t fMuonSize;     // A SIZE of muon which is defined as a SIZE around the estimated circle
    25   Float_t fEstImpact;    // An estimated impact parameter from the photon distribution along the arc image
    26   Bool_t  fKeepHist;     // A flag to keep histgram
    27   Float_t fMargin;       // margin to evaluate muons [mm]. The defaut value is 60 mm, corresponding to 0.2 deg. This value can be changed by using the function of SetMargin
    28   Bool_t  fUseUnmap;     // This is a flag to know the Unmapped pixels are used. Refer to the class of MImgCleanStd
    29   Float_t fPeakPhi;      // The angle which indicates the peak position in the estimated circle
    30   Float_t fArcPhiThres;  // The threshold value to define arc phi
    31   Float_t fArcWidThres;  // The threshold value to define arc width
    32   Int_t   fArcPhiBinNum; // The bin number for the histogram of arc phi. You may change this value. However, if you change this, YOU ALSO HAVE TO CHANGE THE THRESHOLD VALUE TO GET ARC LENGTH.
    33   Int_t   fArcWidBinNum; // The bin number for the histogram of arc wid
    34   Float_t fArcPhiHistStartVal; // The starting value for the histogram of arc phi
    35   Float_t fArcPhiHistEndVal;   // The end value for the histogram of arc phi
    36   Float_t fArcWidHistStartVal; // The starting value for the histogram of arc width
    37   Float_t fArcWidHistEndVal;   // The end value for the histogram of arc width
    38   Float_t fEnableImpactCalc;   // If true, the impact calculation will be done, which will consume a lot of time.
    39   Float_t fDisablePreCuts;     // If true, the pre cuts to select muons for the calibration will be disabled.
    40   Float_t fUseCleanForWid;     // If true, the only signal after image cleaningwill be used for the histogram of arc width
     19  Float_t fArcLength;     // An arc length of a muon along the arc [deg.]
     20  Float_t fArcPhi;        // A opening angle of a muon arc [deg.]
     21  Float_t fArcWidth;      // A width of a muon [deg.] (1 sigma of gaussian fit)
     22  Float_t fChiArcPhi;     // A chisquare value of the cosine fit for arc phi
     23  Float_t fChiArcWidth;   // A chisquare value of the cosine fit for arc wid
     24  Float_t fMuonSize;      // A SIZE of muon which is defined as a SIZE around the estimated circle
     25  Float_t fEstImpact;     // An estimated impact parameter from the photon distribution along the arc image
     26  Float_t fMargin;        // margin to evaluate muons [mm]. The defaut value is 60 mm, corresponding to 0.2 deg. This value can be changed by using the function of SetMargin
     27  Bool_t  fUseUnmap;      // This is a flag to know the Unmapped pixels are used. Refer to the class of MImgCleanStd
     28  Float_t fPeakPhi;       // The angle which indicates the peak position in the estimated circle
     29  Float_t fArcPhiThres;   // The threshold value to define arc phi
     30  Float_t fArcWidthThres; // The threshold value to define arc width
     31  Int_t   fArcPhiBinNum;  // The bin number for the histogram of arc phi. You may change this value. However, if you change this, YOU ALSO HAVE TO CHANGE THE THRESHOLD VALUE TO GET ARC LENGTH.
     32  Int_t   fArcWidthBinNum;       // The bin number for the histogram of arc wid
     33  Float_t fArcPhiHistStartVal;   // The starting value for the histogram of arc phi
     34  Float_t fArcPhiHistEndVal;     // The end value for the histogram of arc phi
     35  Float_t fArcWidthHistStartVal; // The starting value for the histogram of arc width
     36  Float_t fArcWidthHistEndVal;   // The end value for the histogram of arc width
     37  Bool_t fEnableImpactCalc;      // If true, the impact calculation will be done, which will consume a lot of time.
     38  Bool_t fDisablePreCuts;        // If true, the pre cuts to select muons for the calibration will be disabled.
     39  Bool_t fUseCleanForWidth;      // If true, the only signal after image cleaningwill be used for the histogram of arc width
    4140
    42   TH1F fHistPhi;      // Histogram of photon distribution along the arc.
    43   TH1F fHistWid;      // Histogram of radial photon distribution of the arc.
     41  TH1F *fHistPhi;      // Histogram of photon distribution along the arc.
     42  TH1F *fHistWidth;    // Histogram of radial photon distribution of the arc.
    4443 
    4544public:
    4645  MMuonCalibPar(const char *name=NULL, const char *title=NULL);
     46  ~MMuonCalibPar();
    4747 
    4848  void Reset();
    4949 
    50   Float_t GetArcLen()    const { return fArcLen; }
    51   Float_t GetArcPhi()    const { return fArcPhi; }
    52   Float_t GetArcWid()    const { return fArcWid; }
    53   Float_t GetChiArcPhi() const { return fChiArcPhi; }
    54   Float_t GetChiArcWid() const { return fChiArcWid; }
    55   Float_t GetMargin()    const { return fMargin; }
    56   Float_t GetMuonSize()  const { return fMuonSize; }
    57   Float_t GetEstImpact() const { return fEstImpact; }
    58   Bool_t  IsUseUnmap()   const { return fUseUnmap; }
    59   Float_t GetPeakPhi()   const { return fPeakPhi; }
    60   Float_t GetArcPhiThres()  const { return fArcPhiThres; }
    61   Float_t GetArcWidThres()  const { return fArcWidThres; }
    62   Float_t GetArcPhiBinNum() const { return fArcPhiBinNum; }
    63   Float_t GetArcWidBinNum() const { return fArcWidBinNum; }
    64   TH1F    &GetHistPhi()        { return fHistPhi; }
    65   TH1F    &GetHistWid()        { return fHistWid; }
     50  Float_t GetArcLength()      const { return fArcLength; }
     51  Float_t GetArcPhi()         const { return fArcPhi; }
     52  Float_t GetArcWidth()       const { return fArcWidth; }
     53  Float_t GetChiArcPhi()      const { return fChiArcPhi; }
     54  Float_t GetChiArcWidth()    const { return fChiArcWidth; }
     55  Float_t GetMargin()         const { return fMargin; }
     56  Float_t GetMuonSize()       const { return fMuonSize; }
     57  Float_t GetEstImpact()      const { return fEstImpact; }
     58  Bool_t  IsUseUnmap()        const { return fUseUnmap; }
     59  Float_t GetPeakPhi()        const { return fPeakPhi; }
     60  Float_t GetArcPhiThres()    const { return fArcPhiThres; }
     61  Float_t GetArcWidthThres()  const { return fArcWidthThres; }
     62  Float_t GetArcPhiBinNum()   const { return fArcPhiBinNum; }
     63  Float_t GetArcWidthBinNum() const { return fArcWidthBinNum; }
     64  TH1F    *GetHistPhi()       { return fHistPhi; }
     65  TH1F    *GetHistWidth()     { return fHistWidth; }
    6666 
    67   void    SetMargin(Float_t margin) { fMargin = margin; }
    68   void    SetArcPhiThres(Float_t thres) { fArcPhiThres = thres; }
    69   void    SetArcWidThres(Float_t thres) { fArcWidThres = thres; }
    70   void    SetArcPhiBinNum(Int_t num) { fArcPhiBinNum = num; }
    71   void    SetArcWidBinNum(Int_t num) { fArcWidBinNum = num; }
    72  
    73   void    KeepHist() { fKeepHist = kTRUE; }
    74   Bool_t  IsKeepHist() { return fKeepHist; }
     67  void    SetMargin(Float_t margin)       { fMargin = margin; }
     68  void    SetArcPhiThres(Float_t thres)   { fArcPhiThres = thres; }
     69  void    SetArcWidthThres(Float_t thres) { fArcWidthThres = thres; }
     70  void    SetArcPhiBinNum(Int_t num)      { fArcPhiBinNum = num; }
     71  void    SetArcWidthBinNum(Int_t num)    { fArcWidthBinNum = num; }
    7572 
    7673  void    EnableImpactCalc()   { fEnableImpactCalc = kTRUE; }
     
    7875  void    DisablePreCuts()     { fDisablePreCuts = kTRUE; }
    7976  Bool_t  IsDisablePreCuts()   { return fDisablePreCuts; }
    80   void    UseCleanForWid()     { fUseCleanForWid = kTRUE; }
    81   Bool_t  IsUseCleanForWid()   { return fUseCleanForWid; }
     77  void    UseCleanForWidth()   { fUseCleanForWidth = kTRUE; }
     78  Bool_t  IsUseCleanForWidth() { return fUseCleanForWidth; }
    8279
    8380  void    Print(Option_t *opt=NULL) const;
     
    8986  void    CalcImpact(const MGeomCam &geom, const MMuonSearchPar &musearch,
    9087                     Int_t effbinnum, Float_t startfitval, Float_t endfitval);
    91   Float_t CalcWid(const MGeomCam &geom, const MCerPhotEvt &evt,
     88  Float_t CalcWidth(const MGeomCam &geom, const MCerPhotEvt &evt,
    9289                  const MMuonSearchPar &musearch);
    9390  Int_t   Calc(const MGeomCam &geom, const MCerPhotEvt &evt,
    94                const MMuonSearchPar &musearch);
     91               MMuonSearchPar &musearch, const Float_t *cuts);
    9592 
    96   ClassDef(MMuonCalibPar, 3) // Container to hold muon calibration parameters
     93  ClassDef(MMuonCalibPar, 1) // Container to hold muon calibration parameters
    9794};
    9895   
  • trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc

    r5173 r5210  
    1616!
    1717!
    18 !   Author(s): Keiichi Mase 09/2004 <mailto:mase@mppmu.mpg.de>
    19 !              Markus Meyer 09/2004 <mailto:meyer@astro.uni-wuerzburg.de>
     18!   Author(s): Keiichi Mase 10/2004 <mailto:mase@mppmu.mpg.de>
     19!              Markus Meyer 10/2004 <mailto:meyer@astro.uni-wuerzburg.de>
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2004
     
    105105void MMuonSearchPar::Reset()
    106106{
    107   fRad  = -1.;
    108   fDev  = -1.;
    109   fCenX = 0.;
    110   fCenY = 0.;
     107  fRadius  = -1.;
     108  fDeviation  = -1.;
     109  fCenterX = 0.;
     110  fCenterY = 0.;
    111111  fNoMuon = kFALSE;
    112112}
     
    123123  Float_t tmp_r = 300.;  // assume that the temporal cherenkov angle is 1 deg. (300 mm).
    124124
    125   a = tan(hillas.GetDelta());
    126 
    127   dx = a/sqrt(tmp_r+a*a)/3.;
    128   dy = -tmp_r/sqrt(1+a*a)/3.;
     125  a = TMath::Tan(hillas.GetDelta());
     126
     127  dx = a/TMath::Sqrt(tmp_r+a*a)/3.;
     128  dy = -tmp_r/TMath::Sqrt(1+a*a)/3.;
    129129
    130130  *xtmp1 = hillas.GetMeanX() + dx;
     
    180180// RMS of the fit, changing the center position of the circle.
    181181//
    182 void MMuonSearchPar::CalcMinimumDev
     182void MMuonSearchPar::CalcMinimumDeviation
    183183( const MGeomCam &geom, const MCerPhotEvt &evt, Float_t x, Float_t y,
    184184 Float_t xcog, Float_t ycog, Float_t sigma, Float_t *opt_rad,
     
    268268 
    269269  // find the best fit.
    270   CalcMinimumDev(geom, evt, xtmp1,ytmp1,hillas.GetMeanX(),hillas.GetMeanY(),
     270  CalcMinimumDeviation(geom, evt, xtmp1,ytmp1,hillas.GetMeanX(),hillas.GetMeanY(),
    271271                 dev, &opt_rad, &new_sigma, &newx, &newy);
    272272
    273   fRad = opt_rad;
    274   fDev = new_sigma;
    275  
    276   fCenX = newx;
    277   fCenY = newy;
     273  fRadius = opt_rad;
     274  fDeviation = new_sigma;
     275 
     276  fCenterX = newx;
     277  fCenterY = newy;
    278278 
    279279  SetReadyToSave();
     
    284284    *fLog << all;
    285285    *fLog << "Muon Parameters (" << GetName() << ")" << endl;
    286     *fLog << " - Est. Rad.   [mm]  = " << fRad  << endl;
    287     *fLog << " - Dev.        [mm]  = " << fDev  << endl;
    288     *fLog << " - Cen. Pos. X [mm]  = " << fCenX << endl;
    289     *fLog << " - Cen. Pos. Y [mm]  = " << fCenY << endl;
     286    *fLog << " - Est. Radius   [mm]  = " << fRadius  << endl;
     287    *fLog << " - Deviation     [mm]  = " << fDeviation  << endl;
     288    *fLog << " - Center Pos. X [mm]  = " << fCenterX << endl;
     289    *fLog << " - Center Pos. Y [mm]  = " << fCenterY << endl;
    290290}
    291291
     
    294294    *fLog << all;
    295295    *fLog << "Muon Parameters (" << GetName() << ")" << endl;
    296     *fLog << " - Est. Rad.   [deg.]  = " << fRad*geom.GetConvMm2Deg()   << endl;
    297     *fLog << " - Dev.        [deg.]  = " << fDev*geom.GetConvMm2Deg()   << endl;
    298     *fLog << " - Cen. Pos. X [deg.]  = " << fCenX*geom.GetConvMm2Deg()  << endl;
    299     *fLog << " - Cen. Pos. Y [deg.]  = " << fCenY*geom.GetConvMm2Deg()  << endl;
    300 }
    301 
    302 
    303 
     296    *fLog << " - Est. Radius   [deg.]  = " << fRadius*geom.GetConvMm2Deg()   << endl;
     297    *fLog << " - Deviation     [deg.]  = " << fDeviation*geom.GetConvMm2Deg()   << endl;
     298    *fLog << " - Center Pos. X [deg.]  = " << fCenterX*geom.GetConvMm2Deg()  << endl;
     299    *fLog << " - Center Pos. Y [deg.]  = " << fCenterY*geom.GetConvMm2Deg()  << endl;
     300}
     301
     302
     303
  • trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.h

    r5173 r5210  
    2121{
    2222private:
    23     Float_t fRad;    // An estimated radius of the muon ring [mm]
    24     Float_t fDev;    // The standard deviation from the estimated ring [mm]
    25     Float_t fCenX;   // An estimated center position in X of the muon ring [mm]
    26     Float_t fCenY;   // An estimated center position in Y of the muon ring [mm]
    27     Bool_t  fNoMuon; // if the radius is estimated above 600 mm (2 deg.), assumed it's not muon.
     23    Float_t fRadius;    // An estimated radius of the muon ring [mm]
     24    Float_t fDeviation; // The standard deviation from the estimated ring [mm]
     25    Float_t fCenterX;   // An estimated center position in X of the muon ring [mm]
     26    Float_t fCenterY;   // An estimated center position in Y of the muon ring [mm]
     27    Bool_t  fNoMuon;    // if the radius is estimated above 600 mm (2 deg.), assumed it's not muon. Later on, at the stage of MMuonCalibParCalc, this flag will be changed if the task judge the event as no muon.
    2828
    2929public:
     
    3232    void Reset();
    3333
    34     Float_t GetRad() const    { return fRad; }
    35     Float_t GetDev() const    { return fDev; }
    36     Float_t GetCenX() const   { return fCenX; }
    37     Float_t GetCenY() const   { return fCenY; }
    38     Bool_t  IsNoMuon() const  { return fNoMuon; }
     34    Float_t GetRadius()    const { return fRadius; }
     35    Float_t GetDeviation() const { return fDeviation; }
     36    Float_t GetCenterX()   const { return fCenterX; }
     37    Float_t GetCenterY()   const { return fCenterY; }
     38    Bool_t  IsNoMuon()     const { return fNoMuon; }
     39    void    SetNoMuon()          { fNoMuon = kTRUE; }
    3940
    4041    void   Print(Option_t *opt=NULL) const;
     
    4445    Bool_t CalcRadius(const MGeomCam &geom, const MCerPhotEvt &evt, Float_t x,
    4546                      Float_t y, Float_t *r, Float_t *sigma);
    46     void   CalcMinimumDev(const MGeomCam &geom, const MCerPhotEvt &evt,
     47    void   CalcMinimumDeviation(const MGeomCam &geom, const MCerPhotEvt &evt,
    4748                         Float_t x, Float_t y, Float_t xcog,
    4849                         Float_t ycog, Float_t sigma, Float_t *opt_rad,
Note: See TracChangeset for help on using the changeset viewer.