Changeset 2746 for trunk/MagicSoft


Ignore:
Timestamp:
12/23/03 07:25:11 (21 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2744 r2746  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6
     7 2003/12/23: Wolfgang Wittek
     8
     9   * macros/ONAnalysis.C
     10     - new macro for the MAGIC analysis, corresponding to CT1Analysis.C
     11
     12   * macros/AnalyseCT1.C
     13     - deleted because outdated
     14
     15   * manalysis/MPadOn.[h,cc]
     16     - new class for the MAGIC analysis, corresponding to MCT1PadSchweizer
     17
     18   * manalysis/MPadOnOFF.[h,cc]
     19     - minor changes (printouts)
     20
     21   * manalysis/MPedestalWorkaround.[h,cc]
     22     - put zenith angle into MMcEvt
     23
     24   * manalysis/Makefile
     25               AnalysisLinkDef.h
     26     - added MPadON
     27
     28   * mmc/MMcEvt.hxx
     29     - add member function SetTelescopeTheta(), SetTelescopePhi()
     30
     31
     32
    633 2003/12/22: Thomas Bretz
    734 
     
    451478       0.7 in which the array containing pixel ratios was not
    452479       initialized.
     480
     481
    453482
    454483
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r2734 r2746  
    4848#pragma link C++ class MCT1PadSchweizer+;
    4949#pragma link C++ class MCT1PadONOFF+;
     50#pragma link C++ class MPadON+;
    5051#pragma link C++ class MPadONOFF+;
    5152
  • trunk/MagicSoft/Mars/manalysis/MPadONOFF.cc

    r2663 r2746  
    110110
    111111  fPadFlag = 1;
    112   *fLog << all << "fPadFlag = " << fPadFlag << endl;
     112  *fLog << all << "MadONOFF : fPadFlag = " << fPadFlag << endl;
    113113
    114114  fType = "";
     
    175175                                  TH2D *blindnthon,  TH2D *blindnthoff)
    176176{
    177   *fLog << "----------------------------------------------------------------------------------" << endl;
    178   *fLog << all << "Merge the ON and OFF histograms to obtain the target distributions for the padding"
     177  *fLog << all << "----------------------------------------------------------------------------------" << endl;
     178  *fLog << all << "MPadONOFF::MergeHistograms(); Merge the ON and OFF histograms to obtain the target distributions for the padding"
    179179        << endl;
    180180
     
    242242  // at the end, it should be zero
    243243
    244   *fLog << all << "MergeHistograms; bins of Theta, Sigmabarold, Sigmabarnew, fraction of events to be padded" << endl;
     244  *fLog << all << "MPadONOFF::MergeHistograms(); bins of Theta, Sigmabarold, Sigmabarnew, fraction of events to be padded" << endl;
    245245  for (Int_t l=1; l<=nbinstheta; l++)
    246246  {
     
    417417
    418418    if( fabs(a-b)>3.0*eps  ||  fabs(c)>3.0*eps )
    419       *fLog << err << "Read; inconsistency in results; a, b, c = "
     419      *fLog << err << "MPadONOFF::MergeHistograms(); inconsistency in results; a, b, c = "
    420420            << a << ",  " << b << ",  " << c << endl;
    421421  }
     
    642642
    643643
    644   *fLog << all << "The target distributions for the padding have been created"
     644  *fLog << all
     645        << "MPadONOFF::MergeHistograms(); The target distributions for the padding have been created"
    645646        << endl;
    646647  *fLog << all << "----------------------------------------------------------"
     
    679680Bool_t MPadONOFF::ReadTargetDist(const char* namefilein)
    680681{
    681   *fLog << all << "Read padding histograms from file " << namefilein << endl;
     682  *fLog << all << "MPadONOFF : Read padding histograms from file "
     683        << namefilein << endl;
    682684
    683685  fInfile = new TFile(namefilein);
     
    690692      if (!fHSigmaTheta)
    691693        {
    692           *fLog << all << "Object '2D-ThetaSigmabar' not found on root file"
     694          *fLog << all
     695                << "MPadONOFF : Object '2D-ThetaSigmabar' not found on root file"
    693696                << endl;
    694697          return kFALSE;
    695698        }
    696       *fLog << all << "Object '2D-ThetaSigmabar' was read in" << endl;
     699      *fLog << all
     700            << "MPadONOFF : Object '2D-ThetaSigmabar' was read in" << endl;
    697701
    698702      fHSigmaThetaON =
     
    700704      if (!fHSigmaThetaON)
    701705        {
    702           *fLog << all << "Object '2D-ThetaSigmabarON' not found on root file"
     706          *fLog << all
     707                << "MPadONOFF : Object '2D-ThetaSigmabarON' not found on root file"
    703708                << endl;
    704709          return kFALSE;
    705710        }
    706       *fLog << all << "Object '2D-ThetaSigmabarON' was read in" << endl;
     711      *fLog << all
     712            << "MPadONOFF : Object '2D-ThetaSigmabarON' was read in" << endl;
    707713
    708714      fHSigmaThetaOFF =
     
    710716      if (!fHSigmaThetaOFF)
    711717        {
    712           *fLog << "Object '2D-ThetaSigmabarOFF' not found on root file"
     718          *fLog << all
     719                << "MPadONOFF : Object '2D-ThetaSigmabarOFF' not found on root file"
    713720                << endl;
    714721          return kFALSE;
    715722        }
    716       *fLog << all << "Object '2D-ThetaSigmabarOFF' was read in" << endl;
     723      *fLog << all
     724            << "MPadONOFF :Object '2D-ThetaSigmabarOFF' was read in" << endl;
    717725
    718726      fHSigmaPixTheta =
     
    720728      if (!fHSigmaPixTheta)
    721729        {
    722           *fLog << all << "Object '3D-ThetaPixSigma' not found on root file"
     730          *fLog << all
     731                << "MPadONOFF : Object '3D-ThetaPixSigma' not found on root file"
    723732                << endl;
    724733          return kFALSE;
    725734        }
    726       *fLog << all << "Object '3D-ThetaPixSigma' was read in" << endl;
     735      *fLog << all
     736            << "MPadONOFF : Object '3D-ThetaPixSigma' was read in" << endl;
    727737
    728738      fHSigmaPixThetaON =
     
    730740      if (!fHSigmaPixThetaON)
    731741        {
    732           *fLog << all << "Object '3D-ThetaPixSigmaON' not found on root file"
     742          *fLog << all
     743                << "MPadONOFF : Object '3D-ThetaPixSigmaON' not found on root file"
    733744                << endl;
    734745          return kFALSE;
    735746        }
    736       *fLog << all << "Object '3D-ThetaPixSigmaON' was read in" << endl;
     747      *fLog << all
     748            << "MPadONOFF : Object '3D-ThetaPixSigmaON' was read in" << endl;
    737749
    738750      fHSigmaPixThetaOFF =
     
    740752      if (!fHSigmaPixThetaOFF)
    741753        {
    742           *fLog << all << "Object '3D-ThetaPixSigmaOFF' not found on root file"
     754          *fLog << all
     755                << "MPadONOFF : Object '3D-ThetaPixSigmaOFF' not found on root file"
    743756                << endl;
    744757          return kFALSE;
    745758        }
    746       *fLog << "Object '3D-ThetaPixSigmaOFF' was read in" << endl;
     759      *fLog << all
     760            << "MPadONOFF : Object '3D-ThetaPixSigmaOFF' was read in" << endl;
    747761
    748762      fHDiffPixTheta =
     
    750764      if (!fHDiffPixTheta)
    751765        {
    752           *fLog << all << "Object '3D-ThetaPixDiff' not found on root file"
     766          *fLog << all
     767                << "MPadONOFF : Object '3D-ThetaPixDiff' not found on root file"
    753768                << endl;
    754769          return kFALSE;
    755770        }
    756       *fLog << all << "Object '3D-ThetaPixDiff' was read in" << endl;
     771      *fLog << all
     772            << "MPadONOFF : Object '3D-ThetaPixDiff' was read in" << endl;
    757773
    758774      fHDiffPixThetaON =
     
    760776      if (!fHDiffPixThetaON)
    761777        {
    762           *fLog << all << "Object '3D-ThetaPixDiffON' not found on root file"
     778          *fLog << all
     779                << "MPadONOFF : Object '3D-ThetaPixDiffON' not found on root file"
    763780                << endl;
    764781          return kFALSE;
    765782        }
    766       *fLog << "Object '3D-ThetaPixDiffON' was read in" << endl;
     783      *fLog << all
     784            << "MPadONOFF : Object '3D-ThetaPixDiffON' was read in" << endl;
    767785
    768786      fHDiffPixThetaOFF =
     
    770788      if (!fHDiffPixThetaOFF)
    771789        {
    772           *fLog << all << "Object '3D-ThetaPixDiffOFF' not found on root file"
     790          *fLog << all
     791                << "MPadONOFF : Object '3D-ThetaPixDiffOFF' not found on root file"
    773792                << endl;
    774793          return kFALSE;
    775794        }
    776       *fLog << all << "Object '3D-ThetaPixDiffOFF' was read in" << endl;
     795      *fLog << all
     796            << "MPadONOFF : Object '3D-ThetaPixDiffOFF' was read in" << endl;
    777797
    778798      fHgON =
     
    780800      if (!fHgON)
    781801        {
    782           *fLog << all << "Object '3D-PaddingMatrixON' not found on root file"
     802          *fLog << all
     803                << "MPadONOFF : Object '3D-PaddingMatrixON' not found on root file"
    783804                << endl;
    784805          return kFALSE;
    785806        }
    786       *fLog << all << "Object '3D-PaddingMatrixON' was read in" << endl;
     807      *fLog << all
     808            << "MPadONOFF : Object '3D-PaddingMatrixON' was read in" << endl;
    787809
    788810      fHgOFF =
     
    790812      if (!fHgOFF)
    791813        {
    792           *fLog << all << "Object '3D-PaddingMatrixOFF' not found on root file"
     814          *fLog << all
     815                << "MPadONOFF : Object '3D-PaddingMatrixOFF' not found on root file"
    793816                << endl;
    794817          return kFALSE;
    795818        }
    796       *fLog << all << "Object '3D-PaddingMatrixOFF' was read in" << endl;
     819      *fLog << all
     820            << "MPadONOFF : Object '3D-PaddingMatrixOFF' was read in" << endl;
    797821
    798822
     
    801825      if (!fHBlindPixIdTheta)
    802826        {
    803           *fLog << all << "Object '2D-ThetaBlindId' not found on root file"
     827          *fLog << all
     828                << "MPadONOFF : Object '2D-ThetaBlindId' not found on root file"
    804829                << endl;
    805830          return kFALSE;
    806831        }
    807       *fLog << all << "Object '2D-ThetaBlindId' was read in" << endl;
     832      *fLog << all
     833            << "MPadONOFF : Object '2D-ThetaBlindId' was read in" << endl;
    808834
    809835      fHBlindPixNTheta =
     
    811837      if (!fHBlindPixNTheta)
    812838        {
    813           *fLog << all << "Object '2D-ThetaBlindN' not found on root file"
     839          *fLog << all
     840                << "MPadONOFF : Object '2D-ThetaBlindN' not found on root file"
    814841                << endl;
    815842          return kFALSE;
    816843        }
    817       *fLog << all << "Object '2D-ThetaBlindN' was read in" << endl;
     844      *fLog << all
     845            << "MPadONOFF : Object '2D-ThetaBlindN' was read in" << endl;
    818846
    819847
     
    831859Bool_t MPadONOFF::WriteTargetDist(const char* namefileout)
    832860{
    833   *fLog << all << "Write padding histograms onto file " << namefileout << endl;
     861  *fLog << all << "MPadONOFF : Write padding histograms onto file "
     862        << namefileout << endl;
    834863
    835864  TFile outfile(namefileout, "RECREATE");
     
    853882  fHgOFF->Write();
    854883
    855   *fLog << all << "WriteTargetDist; target histograms written onto file "
     884  *fLog << all
     885        << "MPadONOFF::WriteTargetDist(); target histograms written onto file "
    856886        << namefileout << endl;
    857887
     
    870900{
    871901  fType = type;
    872   *fLog << all << "SetDataType(); type of data to be padded : "
     902  *fLog << all << "MPadONOFF::SetDataType(); type of data to be padded : "
    873903        << fType << endl;
    874904
     
    900930{
    901931  fPadFlag = padflag;
    902   *fLog << all << "SetPadFlag(); choose option " << fPadFlag << endl;
     932  *fLog << all << "MPadONOFF::SetPadFlag(); choose option " << fPadFlag
     933        << endl;
    903934}
    904935
     
    915946       !fHgON              ||  !fHgOFF)
    916947  {
    917        *fLog << err << "At least one of the histograms needed for the padding is not defined ... aborting." << endl;
     948       *fLog << err
     949             << "MPadONOFF : At least one of the histograms needed for the padding is not defined ... aborting."
     950             << endl;
    918951       return kFALSE;
    919952  }
     
    922955  if (!fMcEvt)
    923956    {
    924        *fLog << err << dbginf << "MMcEvt not found... aborting." << endl;
     957       *fLog << err << dbginf << "MPadONOFF : MMcEvt not found... aborting."
     958             << endl;
    925959       return kFALSE;
    926960     }
     
    929963   if (!fPed)
    930964     {
    931        *fLog << err << "MPedestalCam not found... aborting." << endl;
     965       *fLog << err << "MPadONOFF : MPedestalCam not found... aborting."
     966             << endl;
    932967       return kFALSE;
    933968     }
     
    936971   if (!fCam)
    937972     {
    938        *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
     973       *fLog << err
     974             << "MPadONOFF : MGeomCam not found (no geometry information available)... aborting."
     975             << endl;
    939976       return kFALSE;
    940977     }
     
    943980   if (!fEvt)
    944981     {
    945        *fLog << err << "MCerPhotEvt not found... aborting." << endl;
     982       *fLog << err << "MPadONOFF : MCerPhotEvt not found... aborting."
     983             << endl;
    946984       return kFALSE;
    947985     }
     
    950988   if (!fSigmabar)
    951989     {
    952        *fLog << err << "MSigmabar not found... aborting." << endl;
     990       *fLog << err << "MPadONOFF : MSigmabar not found... aborting." << endl;
    953991       return kFALSE;
    954992     }
     
    957995   if (!fBlinds)
    958996     {
    959        *fLog << err << "MBlindPixels not found... aborting." << endl;
     997       *fLog << err << "MPadONOFF : MBlindPixels not found... aborting."
     998             << endl;
    960999       return kFALSE;
    9611000     }
     
    9631002   if (fType !="ON"  &&  fType !="OFF"  &&  fType !="MC")
    9641003     {
    965        *fLog << err << "Type of data to be padded not defined... aborting." << endl;
     1004       *fLog << err
     1005             << "MPadONOFF : Type of data to be padded not defined... aborting."
     1006             << endl;
    9661007       return kFALSE;
    9671008     }
     
    10051046Int_t MPadONOFF::Process()
    10061047{
    1007   *fLog << all << "Entry Process();" << endl;
     1048  *fLog << all << "Entry MPadONOFF::Process();" << endl;
    10081049
    10091050  // this is the conversion factor from the number of photons
    10101051  //                                 to the number of photo electrons
    10111052  // later to be taken from MCalibration
    1012   // fPEpePhoton = PW * LG * QE * 1D
     1053  // fPEperPhoton = PW * LG * QE * 1D
    10131054  Double_t fPEperPhoton = 0.95 * 0.90 * 0.13 * 0.9;
    10141055
     
    10691110  //
    10701111  Double_t sigbarold_phot = fSigmabar->Calc(*fCam, *fPed, *fEvt);
    1071   *fLog << all << "before padding : " << endl;
     1112  *fLog << all << "MPadONOFF::Process(); before padding : " << endl;
    10721113  fSigmabar->Print("");
    10731114  Double_t sigbarold = sigbarold_phot * fPEperPhoton;
     
    10821123    if (sigbarold_phot > 0)
    10831124    {
    1084        *fLog << warn << "Process(); sigmabar of event to be padded is > 0 : "
     1125      *fLog << err
     1126            << "MPadONOFF::Process(); sigmabar of event to be padded is > 0 : "
    10851127            << sigbarold_phot << ". Stop event loop " << endl;
    10861128       // input data should have sigmabar = 0; stop event loop
     
    10881130      rc = 1;
    10891131      fErrors[rc]++;
    1090       return kCONTINUE;
     1132      return kERROR;
    10911133    }
    10921134  }
     
    10981140  if ( binTheta < 1  ||  binTheta > fHBlindPixNTheta->GetNbinsX() )
    10991141  {
    1100     *fLog << warn << "Process(); binNumber out of range : theta, binTheta = "
     1142    *fLog << warn
     1143          << "MPadONOFF::Process(); binNumber out of range : theta, binTheta = "
    11011144          << theta << ",  " << binTheta << ";  Skip event " << endl;
    11021145    // event cannot be padded; skip event
     
    11701213  if ( nblind->Integral() == 0.0 )
    11711214  {
    1172     *fLog << warn << "Process(); projection for Theta bin "
     1215    *fLog << warn << "MPadONOFF::Process(); projection for Theta bin "
    11731216          << binTheta << " has no entries; Skip event " << endl;
    11741217    // event cannot be padded; skip event
     
    13191362
    13201363    hsigma = fHSigmaTheta->ProjectionY("", binTheta, binTheta, "");
    1321     if ( hsigma->Integral() == 0.0 )
     1364    if ( hsigma->GetEntries() == 0.0 )
    13221365    {
    1323       *fLog << warn << "Process(); projection for Theta bin "
     1366      *fLog << warn << "MPadONOFF::Process(); projection for Theta bin "
    13241367            << binTheta << " has no entries; Skip event " << endl;
    13251368      // event cannot be padded; skip event
     
    13451388  //-------------------------------------------
    13461389
    1347   *fLog << all << "Process(); sigbarold, sigmabar = "
     1390  *fLog << all << "MPadONOFF::Process(); sigbarold, sigmabar = "
    13481391        << sigbarold << ",  "<< sigmabar << endl;
    13491392
     
    13511394  if (sigmabar <= sigbarold)
    13521395  {
    1353     *fLog << all << "Process(); target sigmabar is less than sigbarold : "
     1396    *fLog << all << "MPadONOFF::Process(); target sigmabar is less than sigbarold : "
    13541397          << sigmabar << ",  " << sigbarold << ",   Skip event" << endl;
    13551398
     
    13671410  //  - using a fixed value (F2excess)  for the excess noise factor
    13681411 
    1369   Double_t elNoise2;         // [photons] 
     1412  Double_t elNoise2;         // [photo electrons] 
    13701413  Double_t F2excess  = 1.3;
    1371   Double_t lambdabar;        // [photons]
     1414  Double_t lambdabar;        // [photo electrons]
    13721415
    13731416
     
    13761419  if (binTheta != bincheck)
    13771420  {
    1378     cout << "The binnings of the 2 histograms are not identical; aborting"
    1379          << endl;
     1421    *fLog << err
     1422          << "MPadONOFF::Process(); The binnings of the 2 histograms are not identical; aborting"
     1423          << endl;
    13801424    return kERROR;
    13811425  }
     
    13951439  else
    13961440  {
    1397     *fLog << err << "Process; illegal data type... aborting" << endl;
     1441    *fLog << err << "MPadONOFF::Process(); illegal data type... aborting"
     1442          << endl;
    13981443    return kERROR;
    13991444  }
     
    14061451  *fLog << all << "elNoise2 = " << elNoise2 << endl;
    14071452
    1408   lambdabar = (sigmabar2 - sigbarold2 - elNoise2) / F2excess;     // [photo electrons]
     1453  lambdabar = (sigmabar2 - sigbarold2 - elNoise2) / F2excess; 
    14091454
    14101455  // This value of lambdabar is the same for all pixels;
     
    14381483    //if ( pix.GetNumPhotons() == 0.0)
    14391484    //{
    1440     //  *fLog << warn << "Process(); no.of photons is 0 for used pixel"
     1485    //  *fLog << warn
     1486    //        << "MPadONOFF::Process(); no.of photons is 0 for used pixel"
    14411487    //        << endl;
    14421488    //  continue;
     
    14791525                                                  binPixel, binPixel, "");
    14801526
    1481      if ( hdiff->Integral() == 0 )
     1527     if ( hdiff->GetEntries() == 0 )
    14821528      {
    1483         *fLog << warn << "Process(); projection for Theta bin "
     1529        *fLog << warn << "MPadONOFF::Process(); projection for Theta bin "
    14841530              << binTheta << "  and pixel bin " << binPixel 
    14851531              << " has no entries;  aborting " << endl;
     
    15411587                                                  binPixel, binPixel, "");
    15421588
    1543       if ( hsig->Integral() == 0 )
     1589      if ( hsig->GetEntries() == 0 )
    15441590      {
    1545         *fLog << warn << "Process(); projection for Theta bin "
     1591        *fLog << warn << "MPadONOFF::Process(); projection for Theta bin "
    15461592              << binTheta << "  and pixel bin " << binPixel 
    15471593              << " has no entries;  aborting " << endl;
     
    16211667      if (arg < -1.e-10)
    16221668      {
    1623         *fLog << err << "Process(); argument of sqrt < 0 : "
     1669        *fLog << warn << "MPadONOFF::Process(); argument of sqrt < 0 : "
    16241670              << arg << endl;
    16251671      }
     
    16401686    Double_t oldphotons = oldphotons_phot * fPEperPhoton;
    16411687    Double_t newphotons = oldphotons + NSB;
    1642     Double_t newphotons_phot = newphotons / fPEperPhoton;;   
     1688    Double_t newphotons_phot = newphotons / fPEperPhoton;   
    16431689    pix.SetNumPhotons(  newphotons_phot );
    16441690
     
    16571703
    16581704    Double_t newsigma = sqrt( oldsigma2 + addSig2 );
    1659     Double_t newsigma_phot = newsigma / fPEperPhoton;;
     1705    Double_t newsigma_phot = newsigma / fPEperPhoton;
    16601706    ppix.SetPedestalRms( newsigma_phot );
    16611707
     
    16671713
    16681714  fSigmabar->Calc(*fCam, *fPed, *fEvt);
    1669   *fLog << all << "after padding : " << endl;
     1715  *fLog << all << "MPadONOFF::Process(); after padding : " << endl;
    16701716  fSigmabar->Print("");
     1717
     1718  *fLog << all << "Exit MPadONOFF::Process();" << endl;
    16711719
    16721720  rc = 0;
  • trunk/MagicSoft/Mars/manalysis/MPedestalWorkaround.cc

    r2733 r2746  
    1616!
    1717!
    18 !   Author(s): Sabrina Stark  12/2003 <mailto:lstark@particle.phys.ethz.ch>
     18!   Author(s): Sabrina Stark   12/2003 <mailto:lstark@particle.phys.ethz.ch>
     19!              Wolfgang Wittek 12/2003 <mailto:wittek@mppmu.mpg.de>
    1920!
    2021!   Copyright: MAGIC Software Development, 2000-2003
     
    2728// MPedestalWorkaround                                                     //
    2829//                                                                         //
    29 // This class contains the function to store the pedestal value and the    //
    30 //  RMS of the pedestal in units of photons.                               // 
     30// copies the pedestal value and the pedestal RMS                          //
     31//        from the container MPedPhotCam                                   //
     32//        into the contaier  MPedestalCam                                  //
     33//                                                                         //
     34// put the zenith angle into MMcEvt;                                       //
     35//     the zenith angle is taken from the runbooks                         //
     36//     (1 fixed zenith angle for a given run)                              //
     37//                                                                         //
     38// this workaround is necessary                                            //
     39// - as long as the analysis classes                                       //
     40//   take the pedestals from MPedestalCam; in the long run they have to    //
     41//   be taken from MPedPhotCam                                             //
     42// - and as long as the container for the zenith angle is not defined      //
    3143//                                                                         //
    3244/////////////////////////////////////////////////////////////////////////////
     
    4254#include "MPedestalPix.h"
    4355#include "MPedPhotCam.h"
     56#include "MMcEvt.hxx"
     57#include "MRawRunHeader.h"
    4458
    4559using namespace std;
     
    6579       return kFALSE;
    6680     }
     81
    6782   fPedPhot = (MPedPhotCam*)pList->FindObject("MPedPhotCam");
    6883   if (!fPedPhot)
     
    7186       return kFALSE;
    7287     }
     88
    7389   fCam = (MGeomCam*)pList->FindObject("MGeomCam");
    7490   if (!fCam)
     
    7894     }
    7995
    80     return kTRUE;
     96   fRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     97   if (!fRun)
     98   {
     99       *fLog << err << "MRawRunHeader not found... aborting." << endl;
     100       return kFALSE;
     101   }
     102
     103   fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
     104   if (!fMcEvt)
     105   {
     106       *fLog << err << "MMcEvt not found... aborting." << endl;
     107       return kFALSE;
     108   }
     109
     110   return kTRUE;
    81111}
    82112
     
    85115Int_t MPedestalWorkaround::Process()
    86116{
    87    
    88  UInt_t imaxnumpix = fCam->GetNumPixels();
     117  //-------------------------------------------------------------------
     118  // copy the pedestal and the pedestal RMS
     119  // from MPedPhotCam into MPedestalCam   
     120
     121  UInt_t imaxnumpix = fCam->GetNumPixels();
    89122
    90123  for (UInt_t i=0; i<imaxnumpix; i++)
     
    101134    valout = (*fPed)[i].GetPedestalRms();
    102135    (*fPed)[i].SetPedestalRms(val);
    103     *fLog << "RMS : i, val, valout : " << i <<",  "<<  val<<",  " << valout << endl;
     136    *fLog << "RMS : i, val, valout : " << i <<",  "<<  val<<",  " << valout
     137          << endl;
    104138  }
    105139
    106140
    107     return kTRUE;
     141  //-------------------------------------------------------------------
     142  // put the zenith angle into MMcEvt
     143
     144  Int_t run = fRun->GetRunNumber();
     145  Double_t thetadeg;
     146  Double_t thetarad;
     147
     148  if      (run == 3127)  thetadeg = 27.2;  // Crab
     149  else if (run == 3128)  thetadeg = 25.6;
     150  else if (run == 3129)  thetadeg = 24.3;
     151  else if (run == 3130)  thetadeg = 23.9;
     152
     153
     154  else if (run == 3132)  thetadeg = 22.9;
     155  else if (run == 3133)  thetadeg = 22.8;
     156  else if (run == 3134)  thetadeg = 22.3;
     157  else if (run == 3135)  thetadeg = 21.9;
     158  else if (run == 3136)  thetadeg = 21.5;
     159  else if (run == 3137)  thetadeg = 21.1;
     160  else if (run == 3138)  thetadeg = 20.8;
     161  else if (run == 3139)  thetadeg = 20.4;
     162
     163  else if (run == 3140)  thetadeg = 19.5;
     164  else if (run == 3141)  thetadeg = 19.4;
     165  else if (run == 3142)  thetadeg = 19.0;
     166  else if (run == 3143)  thetadeg = 18.6;
     167  else if (run == 3144)  thetadeg = 13.0;
     168  else if (run == 3145)  thetadeg = 12.4;
     169  else if (run == 3146)  thetadeg = 12.1;
     170  else if (run == 3147)  thetadeg = 11.7;
     171  else if (run == 3148)  thetadeg = 11.3;
     172  else if (run == 3149)  thetadeg = 11.9;
     173
     174  else if (run == 3150)  thetadeg = 10.6;
     175  else if (run == 3151)  thetadeg = 10.3;
     176  else if (run == 3152)  thetadeg = 10.0;
     177  else if (run == 3153)  thetadeg =  9.6;
     178  else if (run == 3154)  thetadeg =  9.3;
     179  else if (run == 3155)  thetadeg =  9.0;
     180  else if (run == 3156)  thetadeg =  8.7;
     181  else if (run == 3157)  thetadeg =  8.4;
     182  else if (run == 3158)  thetadeg =  8.1;
     183  else if (run == 3159)  thetadeg =  7.9;
     184
     185  else if (run == 3160)  thetadeg =  7.7;
     186  else if (run == 3161)  thetadeg =  7.3;
     187  else if (run == 3162)  thetadeg =  7.2;
     188  else if (run == 3163)  thetadeg =  7.0;
     189  else if (run == 3164)  thetadeg =  6.8;
     190  else if (run == 3165)  thetadeg =  6.7;
     191  else if (run == 3166)  thetadeg =  6.6;
     192  else if (run == 3167)  thetadeg =  6.5;
     193  else if (run == 3168)  thetadeg =  6.4;
     194  else if (run == 3169)  thetadeg =  6.4;
     195
     196  else if (run == 3170)  thetadeg =  6.4;
     197  else if (run == 3171)  thetadeg =  6.4;
     198  else if (run == 3172)  thetadeg =  6.5;
     199  else if (run == 3173)  thetadeg =  6.6;
     200  else if (run == 3174)  thetadeg =  6.7;
     201
     202  else if (run == 3176)  thetadeg =  7.1;
     203  else if (run == 3177)  thetadeg =  7.4;
     204  else if (run == 3178)  thetadeg =  7.6;
     205  else if (run == 3179)  thetadeg =  7.9;
     206
     207
     208  else if (run == 3182)  thetadeg =  8.4;
     209  else if (run == 3183)  thetadeg =  8.9;
     210  else if (run == 3184)  thetadeg =  9.2;
     211  else if (run == 3185)  thetadeg =  9.5;
     212  else if (run == 3186)  thetadeg =  9.8;
     213  else if (run == 3187)  thetadeg = 10.5;
     214  else if (run == 3188)  thetadeg = 10.9;
     215  else if (run == 3189)  thetadeg = 11.2;
     216
     217  else if (run == 3190)  thetadeg = 11.6;
     218  else if (run == 3191)  thetadeg = 11.6;
     219  else if (run == 3192)  thetadeg = 12.4;
     220  else if (run == 3193)  thetadeg = 12.7;
     221  else if (run == 3194)  thetadeg = 13.1;
     222  else if (run == 3195)  thetadeg = 13.5;
     223  else if (run == 3196)  thetadeg = 13.9;
     224  else if (run == 3197)  thetadeg = 14.3;
     225  else if (run == 3198)  thetadeg = 14.7;
     226  else if (run == 3199)  thetadeg = 15.1;
     227
     228  else if (run == 3200)  thetadeg = 15.6;
     229  else if (run == 3201)  thetadeg = 16.0;
     230  else if (run == 3202)  thetadeg = 16.5;
     231  else if (run == 3203)  thetadeg = 16.9;
     232  else if (run == 3204)  thetadeg = 17.3;
     233  else if (run == 3205)  thetadeg = 17.7;
     234  else if (run == 3206)  thetadeg = 18.2;
     235  else if (run == 3207)  thetadeg = 18.6;
     236  else if (run == 3208)  thetadeg = 19.0;
     237  else if (run == 3209)  thetadeg = 19.4;
     238
     239  else if (run == 3210)  thetadeg = 19.9;
     240  else if (run == 3211)  thetadeg = 20.4;
     241  else if (run == 3212)  thetadeg = 20.8;
     242  else if (run == 3213)  thetadeg = 21.2;
     243  else if (run == 3214)  thetadeg = 21.7;
     244  else if (run == 3215)  thetadeg = 22.2;
     245  else if (run == 3216)  thetadeg = 25.6;  // Off Crab1
     246  else if (run == 3217)  thetadeg = 25.0;
     247  else if (run == 3218)  thetadeg = 24.5;
     248  else if (run == 3219)  thetadeg = 24.0;
     249
     250  else if (run == 3220)  thetadeg = 23.5;
     251  else if (run == 3221)  thetadeg = 22.5;
     252  else if (run == 3222)  thetadeg = 22.1;
     253
     254  else if (run == 3225)  thetadeg = 15.1;
     255  else if (run == 3226)  thetadeg = 15.0;
     256  else if (run == 3227)  thetadeg = 14.5;
     257  else if (run == 3228)  thetadeg = 14.1;
     258  else if (run == 3229)  thetadeg = 13.8;
     259
     260  else if (run == 3230)  thetadeg = 13.3;
     261  else if (run == 3231)  thetadeg = 13.0;
     262  else if (run == 3232)  thetadeg = 12.6;
     263  else if (run == 3233)  thetadeg = 12.3;
     264  else if (run == 3234)  thetadeg = 12.0;
     265  else if (run == 3235)  thetadeg = 11.6;
     266  else if (run == 3236)  thetadeg = 11.3;
     267  else if (run == 3237)  thetadeg = 11.0;
     268  else if (run == 3238)  thetadeg = 10.8;
     269  else if (run == 3239)  thetadeg = 10.4;
     270
     271  else if (run == 3240)  thetadeg = 10.1;
     272  else if (run == 3241)  thetadeg =  9.9;
     273  else if (run == 3242)  thetadeg =  9.6;
     274  else if (run == 3243)  thetadeg =  9.4;
     275  else if (run == 3244)  thetadeg =  9.2;
     276  else if (run == 3245)  thetadeg =  9.0;
     277  else if (run == 3246)  thetadeg =  8.9;
     278  else if (run == 3247)  thetadeg =  8.8;
     279  else if (run == 3248)  thetadeg =  8.7;
     280  else if (run == 3249)  thetadeg =  8.6;
     281
     282  else if (run == 3250)  thetadeg =  8.6;
     283  else if (run == 3251)  thetadeg =  8.6;
     284  else if (run == 3252)  thetadeg =  8.6;
     285  else if (run == 3253)  thetadeg =  8.7;
     286  else if (run == 3254)  thetadeg =  8.8;
     287  else if (run == 3255)  thetadeg =  8.9;
     288  else if (run == 3256)  thetadeg =  9.1;
     289  else if (run == 3257)  thetadeg =  9.3;
     290  else if (run == 3258)  thetadeg =  9.5;
     291  else if (run == 3259)  thetadeg =  9.7;
     292  else if (run == 3260)  thetadeg =  9.9;
     293
     294  else if (run == 3261)  thetadeg = 10.2;
     295  else if (run == 3262)  thetadeg = 10.5;
     296  else if (run == 3263)  thetadeg = 10.8;
     297  else if (run == 3264)  thetadeg = 11.1;
     298  else if (run == 3265)  thetadeg = 11.4;
     299  else if (run == 3266)  thetadeg = 11.8;
     300  else if (run == 3267)  thetadeg = 12.1;
     301  else if (run == 3268)  thetadeg = 12.5;
     302  else if (run == 3269)  thetadeg = 12.8;
     303
     304  else if (run == 3270)  thetadeg = 13.2;
     305  else if (run == 3271)  thetadeg = 13.5;
     306  else if (run == 3272)  thetadeg = 13.9;
     307  else if (run == 3273)  thetadeg = 14.0;
     308  else if (run == 3274)  thetadeg = 14.4;
     309
     310  else if (run == 3284)  thetadeg =  7.0;  // Crab
     311  else if (run == 3285)  thetadeg =  7.2;
     312  else if (run == 3286)  thetadeg =  7.4;
     313  else if (run == 3287)  thetadeg =  7.5;
     314  else if (run == 3288)  thetadeg =  8.4;
     315  else if (run == 3289)  thetadeg =  9.0;
     316
     317  else if (run == 3290)  thetadeg =  9.4;
     318  else if (run == 3291)  thetadeg =  9.8;
     319  else if (run == 3292)  thetadeg = 10.2;
     320  else if (run == 3293)  thetadeg = 10.5;
     321  else if (run == 3294)  thetadeg = 10.9;
     322  else if (run == 3295)  thetadeg = 11.3;
     323  else if (run == 3296)  thetadeg = 11.8;
     324  else if (run == 3297)  thetadeg = 12.2;
     325  else if (run == 3298)  thetadeg = 12.6;
     326  else if (run == 3299)  thetadeg = 13.0;
     327
     328  else if (run == 3300)  thetadeg = 13.5;
     329  else if (run == 3301)  thetadeg = 13.9;
     330  else if (run == 3302)  thetadeg = 14.3;
     331  else if (run == 3303)  thetadeg = 14.8;
     332  else if (run == 3304)  thetadeg = 15.2;
     333  else if (run == 3305)  thetadeg = 15.7;
     334  else if (run == 3306)  thetadeg = 16.2;
     335  else if (run == 3307)  thetadeg = 16.6;
     336  else if (run == 3308)  thetadeg = 17.1;
     337  else if (run == 3309)  thetadeg = 17.6;
     338
     339  else if (run == 3310)  thetadeg = 17.9;
     340  else if (run == 3311)  thetadeg = 18.4;
     341  else if (run == 3312)  thetadeg = 18.9;
     342  else if (run == 3313)  thetadeg = 19.3;
     343  else if (run == 3314)  thetadeg = 19.8;
     344  else if (run == 3315)  thetadeg = 20.1;
     345  else if (run == 3316)  thetadeg = 20.7;
     346  else if (run == 3317)  thetadeg = 21.2;
     347  else if (run == 3318)  thetadeg = 21.7;
     348  else if (run == 3319)  thetadeg = 22.1;
     349
     350  else if (run == 3320)  thetadeg = 22.5;
     351  else if (run == 3321)  thetadeg = 23.1;
     352  else if (run == 3322)  thetadeg = 23.6;
     353  else if (run == 3323)  thetadeg = 24.1;
     354  else if (run == 3324)  thetadeg = 24.6;
     355  else if (run == 3325)  thetadeg = 24.9;
     356  else if (run == 3326)  thetadeg = 25.5;
     357  else if (run == 3327)  thetadeg = 26.0;
     358  else if (run == 3328)  thetadeg = 26.0;
     359  else if (run == 3329)  thetadeg = 26.6;
     360
     361  else if (run == 3330)  thetadeg = 26.6;
     362  else if (run == 3331)  thetadeg = 27.1;
     363  else if (run == 3332)  thetadeg = 27.7;
     364  else if (run == 3333)  thetadeg = 28.2;
     365  else if (run == 3334)  thetadeg = 28.5;
     366
     367  else if (run == 3340)  thetadeg = 10.5;
     368  else if (run == 3341)  thetadeg = 10.3;
     369  else if (run == 3342)  thetadeg =  9.6;
     370  else if (run == 3343)  thetadeg =  9.2;
     371  else if (run == 3344)  thetadeg =  8.9;
     372  else if (run == 3345)  thetadeg =  8.6;
     373  else if (run == 3346)  thetadeg =  8.3;
     374  else if (run == 3347)  thetadeg =  8.0;
     375  else if (run == 3348)  thetadeg =  7.7;
     376  else if (run == 3349)  thetadeg =  7.5;
     377
     378  else if (run == 3350)  thetadeg =  7.2;
     379  else if (run == 3351)  thetadeg =  7.0;
     380  else if (run == 3352)  thetadeg =  6.8;
     381  else if (run == 3353)  thetadeg =  6.7;
     382  else if (run == 3354)  thetadeg =  6.6;
     383  else if (run == 3355)  thetadeg =  6.5;
     384  else if (run == 3356)  thetadeg =  6.4;
     385  else if (run == 3357)  thetadeg =  6.4;
     386  else if (run == 3358)  thetadeg =  6.4;
     387  else if (run == 3359)  thetadeg =  6.5;
     388
     389  else if (run == 3360)  thetadeg =  6.6;
     390
     391  else if (run == 3362)  thetadeg =  6.7;
     392  else if (run == 3363)  thetadeg =  6.8;
     393  else if (run == 3364)  thetadeg =  7.0;
     394  else if (run == 3365)  thetadeg =  7.2;
     395  else if (run == 3366)  thetadeg =  7.5;
     396  else if (run == 3367)  thetadeg =  7.7;
     397  else if (run == 3368)  thetadeg =  8.0;
     398  else if (run == 3369)  thetadeg =  8.3;
     399
     400  else if (run == 3370)  thetadeg =  8.6;
     401  else if (run == 3371)  thetadeg =  9.0;
     402  else if (run == 3372)  thetadeg =  9.3;
     403  else if (run == 3373)  thetadeg =  9.6;
     404  else if (run == 3374)  thetadeg = 10.0;
     405  else if (run == 3375)  thetadeg = 10.4;
     406  else if (run == 3376)  thetadeg = 10.7;
     407  else if (run == 3377)  thetadeg = 11.1;
     408  else if (run == 3378)  thetadeg = 11.5;
     409  else if (run == 3379)  thetadeg = 11.9;
     410
     411  else if (run == 3380)  thetadeg = 12.3;
     412  else if (run == 3381)  thetadeg = 12.7;
     413  else if (run == 3382)  thetadeg = 13.1;
     414  else if (run == 3383)  thetadeg = 13.5;
     415  else if (run == 3384)  thetadeg = 13.9;
     416  else if (run == 3385)  thetadeg = 14.3;
     417  else if (run == 3386)  thetadeg = 14.7;
     418  else if (run == 3387)  thetadeg = 15.2;
     419  else if (run == 3388)  thetadeg = 15.6;
     420  else if (run == 3389)  thetadeg = 16.0;
     421
     422  else if (run == 3390)  thetadeg = 16.4;
     423  else if (run == 3391)  thetadeg = 16.7;
     424  else if (run == 3392)  thetadeg = 17.9;
     425  else if (run == 3393)  thetadeg = 18.3;
     426  else if (run == 3394)  thetadeg = 18.7;
     427  else if (run == 3395)  thetadeg = 19.2;
     428  else if (run == 3396)  thetadeg = 19.6;
     429  else if (run == 3397)  thetadeg = 20.0;
     430  else if (run == 3398)  thetadeg = 20.5;
     431  else if (run == 3399)  thetadeg = 20.9;
     432
     433  else if (run == 3400)  thetadeg = 21.4;
     434  else if (run == 3401)  thetadeg = 21.8;
     435  else if (run == 3402)  thetadeg = 22.1;
     436  else if (run == 3403)  thetadeg = 22.6;
     437  else if (run == 3404)  thetadeg = 23.1;
     438  else if (run == 3405)  thetadeg = 23.4;
     439  else if (run == 3406)  thetadeg = 23.9;
     440  else if (run == 3407)  thetadeg = 24.3;
     441  else if (run == 3408)  thetadeg = 24.7;
     442  else if (run == 3409)  thetadeg = 26.9;
     443
     444  else if (run == 3410)  thetadeg = 27.3;
     445  else if (run == 3411)  thetadeg = 27.7;
     446  else if (run == 3412)  thetadeg = 28.2;
     447  else if (run == 3413)  thetadeg = 28.7;
     448  else if (run == 3414)  thetadeg = 29.1;
     449  else if (run == 3415)  thetadeg = 29.2;
     450  else if (run == 3416)  thetadeg = 30.0;
     451  else if (run == 3417)  thetadeg = 18.5;  // Off Crab1
     452  else if (run == 3418)  thetadeg = 18.4;
     453  else if (run == 3419)  thetadeg = 17.5;
     454
     455  else if (run == 3420)  thetadeg = 17.2;
     456  else if (run == 3421)  thetadeg = 16.8;
     457  else if (run == 3422)  thetadeg = 16.4;
     458  else if (run == 3423)  thetadeg = 16.0;
     459  else if (run == 3424)  thetadeg = 15.6;
     460  else if (run == 3425)  thetadeg = 15.3;
     461  else if (run == 3426)  thetadeg = 14.9;
     462  else if (run == 3427)  thetadeg = 14.5;
     463  else if (run == 3428)  thetadeg = 14.1;
     464  else if (run == 3429)  thetadeg = 13.7;
     465
     466  else if (run == 3430)  thetadeg = 13.4;
     467  else if (run == 3431)  thetadeg = 13.0;
     468  else if (run == 3432)  thetadeg = 12.7;
     469  else if (run == 3433)  thetadeg = 12.3;
     470  else if (run == 3434)  thetadeg = 12.0;
     471  else if (run == 3435)  thetadeg = 12.0;
     472  else if (run == 3436)  thetadeg = 11.6;
     473  else if (run == 3437)  thetadeg = 11.3;
     474  else if (run == 3438)  thetadeg = 11.0;
     475  else if (run == 3439)  thetadeg = 10.7;
     476
     477  else if (run == 3440)  thetadeg = 10.4;
     478  else if (run == 3441)  thetadeg = 10.1;
     479  else if (run == 3442)  thetadeg =  9.9;
     480  else if (run == 3443)  thetadeg =  9.8;
     481  else if (run == 3444)  thetadeg = 30.8;  // Mkn 421
     482  else if (run == 3445)  thetadeg = 30.6;
     483  else if (run == 3446)  thetadeg = 29.7;
     484  else if (run == 3447)  thetadeg = 29.3;
     485  else if (run == 3448)  thetadeg = 28.9;
     486  else if (run == 3449)  thetadeg = 28.5;
     487
     488  else if (run == 3450)  thetadeg = 28.1;
     489  else if (run == 3451)  thetadeg = 27.7;
     490  else if (run == 3452)  thetadeg = 27.3;
     491  else if (run == 3453)  thetadeg = 26.9;
     492  else if (run == 3454)  thetadeg = 26.5;
     493  else if (run == 3455)  thetadeg = 26.1;
     494  else if (run == 3456)  thetadeg = 25.7;
     495  else if (run == 3457)  thetadeg = 25.3;
     496  else if (run == 3458)  thetadeg = 24.9;
     497  else if (run == 3459)  thetadeg = 24.5;
     498
     499  else if (run == 3460)  thetadeg = 24.1;
     500
     501  else if (run == 3463)  thetadeg = 23.2;
     502  else if (run == 3464)  thetadeg = 22.8;
     503  else if (run == 3465)  thetadeg = 22.4;
     504  else if (run == 3466)  thetadeg = 22.0;
     505  else if (run == 3467)  thetadeg = 21.6;
     506  else if (run == 3468)  thetadeg = 21.2;
     507  else if (run == 3469)  thetadeg = 20.8;
     508
     509  else if (run == 3470)  thetadeg = 20.4;
     510  else if (run == 3471)  thetadeg = 20.1;
     511  else if (run == 3472)  thetadeg = 19.7;
     512  else if (run == 3473)  thetadeg = 19.3;
     513  else if (run == 3474)  thetadeg = 18.9;
     514  else if (run == 3475)  thetadeg = 18.5;
     515  else if (run == 3476)  thetadeg = 18.2;
     516  else if (run == 3477)  thetadeg = 18.1;
     517  else if (run == 3478)  thetadeg = 17.7;
     518
     519
     520  else if (run == 3480)  thetadeg = 17.5;
     521  else if (run == 3481)  thetadeg = 17.1;
     522  else if (run == 3482)  thetadeg = 16.7;
     523  else if (run == 3483)  thetadeg = 16.3;
     524  else if (run == 3484)  thetadeg = 16.0;
     525  else if (run == 3485)  thetadeg = 15.6;
     526  else if (run == 3486)  thetadeg = 15.3;
     527  else if (run == 3487)  thetadeg = 15.0;
     528  else if (run == 3488)  thetadeg = 14.8;
     529  else if (run == 3489)  thetadeg = 14.8;
     530 
     531  else
     532  {
     533    *fLog << warn << "MPedestalWorkaround : no zenith angle for run number = "
     534          << run << endl;
     535    thetadeg = 90.0;
     536  }
     537
     538  thetarad = thetadeg / kRad2Deg;
     539  fMcEvt->SetTelescopeTheta(thetarad);
     540 
     541  return kTRUE;
    108542}
    109543
     
    113547}
    114548
     549
     550
     551
     552
     553
     554
  • trunk/MagicSoft/Mars/manalysis/MPedestalWorkaround.h

    r2733 r2746  
    1919class MGeomCam;
    2020class MParList;
    21 
     21class MMcEvt;
     22class MRawRunHeader;
    2223
    2324class MPedestalWorkaround : public MTask
     
    2526private:
    2627
    27     MPedestalCam *fPed;  //
    28     MPedPhotCam *fPedPhot; //
    29     MGeomCam *fCam;    //
     28    MPedestalCam  *fPed; 
     29    MPedPhotCam   *fPedPhot;
     30    MGeomCam      *fCam; 
     31    MMcEvt        *fMcEvt;
     32    MRawRunHeader *fRun; 
    3033
    3134    Int_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r2739 r2746  
    7474           MFiltercutsCalc.cc \
    7575           MCT1PadONOFF.cc  \
     76           MPadON.cc  \
    7677           MPadONOFF.cc  \
    7778           MPedestalWorkaround.cc \
  • trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx

    r2271 r2746  
    142142  void SetImpact(Float_t Impact)
    143143  { fImpact=Impact;}               //Set impact parameter
     144
     145  void SetTelescopeTheta(Float_t Theta) { fTelescopeTheta=Theta; }
     146  void SetTelescopePhi(Float_t Phi)     { fTelescopePhi=Phi; }
     147
    144148 
    145149/*    void SetPhotIni(Short_t PhotIni)  */
Note: See TracChangeset for help on using the changeset viewer.