Changeset 3598


Ignore:
Timestamp:
03/26/04 05:53:16 (21 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/ONOFFAnalysis.C

    r3484 r3598  
    170170
    171171      //-----------------------------------------------
     172      //TString tag = "040126";
     173      TString tag = "040127";
     174      //TString tag = "040215";
     175
    172176      //const char *offfile = "~magican/ct1test/wittek/offdata.preproc";
    173177      //const char *offfile = "20040126_OffCrab_";
    174178      //const char *offfile  = "*.OFF";
    175179      //const char *offfile  = "12776.OFF";
     180      // 27 Jan 04
    176181      //const char *offfile  = "12*.OFF";
     182      // 26 Jan 04
     183      //const char *offfile  = "*.OFF";
     184      // 15 Feb 04
    177185      const char *offfile  = "*.OFF";
     186
    178187
    179188      //const char *onfile  = "~magican/ct1test/wittek/mkn421_on.preproc";
     
    182191      //const char *onfile  = "MCerPhot_output";
    183192      //const char *onfile  = "*.ON";
    184       //const char *onfile  = "12162*.ON";
     193      const char *onfile  = "1216*.ON";
     194      // 27 Jan 04
    185195      //const char *onfile  = "12*.ON";
    186       const char *onfile  = "*.ON";
     196      // 26 Jan 04
     197      //const char *onfile  = "*.ON";
     198      // 15 Feb 04
     199      //const char *onfile  = "*.ON";
     200
    187201
    188202     const char *mcfile  = "/data/MAGIC/mc_eth/magLQE_3/gh/0/0/G_M0_00_0_550*.root";
     
    197211      //TString inPath = "~wittek/datacrab_26feb04/";
    198212     //TString inPath = "/.magic/magicserv01/scratch/David/CalibratedRuns/";
    199      //TString inPath = "/.magic/magicserv01/scratch/calibrated/";
    200      TString inPath = "/.magic/magicserv01/scratch/calibrated26/";
     213     // 26 Jan 04, Hendrik
     214     if (tag == "040126")
     215       TString inPath = "/.magic/magicserv01/scratch/calibrated26/";
     216
     217     // 27 Jan 04, Hendrik
     218     if (tag == "040127")
     219        TString inPath = "/.magic/magicserv01/scratch/calibrated/";
     220
     221     // 27 Jan 04, David
     222     //if (tag == "040127")
     223     //TString inPath = "/mnt/magicserv01/scratch/David/CalibratedData/Crab/2004_01_27/";
     224
     225     // 15 Feb 04, David
     226     if (tag == "040215")
     227       TString inPath = "/mnt/magicserv01/scratch/David/CalibratedData/Crab/2004_02_15/";
     228   
    201229
    202230      // path for output from Mars
    203231      //TString outPath = "~wittek/datacrab_feb04/";
    204232     //TString outPath = "~wittek/datacrab_01march04/";
    205       TString outPath = "~wittek/datacrab_04mar04/";
     233      TString outPath = "~wittek/datacrab_19mar04/";
    206234
    207235      //-----------------------------------------------
     
    352380    //--------------------------------------------------
    353381    // type of data to be padded
    354     //TString typeInput = "ON";
    355     TString typeInput = "OFF";
     382    TString typeInput = "ON";
     383    //TString typeInput = "OFF";
    356384    //TString typeInput = "MC";
    357385    gLog << "typeInput = " << typeInput << endl;
     
    368396
    369397    // name of output root file
    370     if (typeInput == "ON")
    371       TString file(onfile);
    372     else if (typeInput == "OFF")
    373       TString file(offfile);
    374     else if (typeInput == "MC")
    375       TString file(mcfile);
     398    //if (typeInput == "ON")
     399    //  TString file(onfile);
     400    //else if (typeInput == "OFF")
     401    //  TString file(offfile);
     402    //else if (typeInput == "MC")
     403    //  TString file(mcfile);
    376404
    377405    TString outNameImage = outPath;
    378     outNameImage += file;
     406    outNameImage += tag;
    379407    outNameImage += "Hillas";
    380408    outNameImage += typeInput;
     
    711739    if (typeInput == "ON")
    712740    {
    713       sourcefromstar.SetSourceAndStarPosition("Crab", 22, 0, 52, 5, 34, 32,
    714                                         "Zeta-Tau", 21, 8, 33, 5, 37, 38.7);
    715       sourcefromstar.AddFile("~wittek/datacrab_26feb04/positionsOn.4.txt", 0);
     741      sourcefromstar.SetSourceAndStarPosition(
     742                               "Crab", 22,  0, 52, 5, 34, 32.0,
     743                           "Zeta-Tau", 21,  8, 33, 5, 37, 38.7);
     744      sourcefromstar.AddStar("Tau114", 21, 56, 13, 5, 27, 38.1);
     745      //sourcefromstar.AddFile("~wittek/datacrab_26feb04/positionsOn.4.txt",0);
     746
     747      if(inPath == "/.magic/magicserv01/scratch/calibrated/")
     748      {
     749        sourcefromstar.AddFile("~wittek/datacrab_26feb04/positions2stars.txt", 0);
     750        //sourcefromstar.AddFile("~wittek/datacrab_26feb04/positionsNoStar.txt", 0);
     751      }
     752      else if(inPath == "/.magic/magicserv01/scratch/calibrated26/")
     753        sourcefromstar.AddFile("~wittek/datacrab_26feb04/stars_2004_01_26", 0);
     754
     755      else if(inPath == "/mnt/magicserv01/scratch/David/CalibratedData/Crab/2004_02_15/")
     756        sourcefromstar.AddFile("~wittek/datacrab_26feb04/positions040215.txt", 0);
    716757    }
    717758    else if (typeInput == "OFF")
    718       sourcefromstar.AddFile("~wittek/datacrab_26feb04/positionsOff.txt", 0);
     759    {
     760      if(inPath == "/.magic/magicserv01/scratch/calibrated/")
     761        sourcefromstar.AddFile("~wittek/datacrab_26feb04/positionsOff.txt", 0);
     762      else if(inPath == "/.magic/magicserv01/scratch/calibrated26/")
     763        sourcefromstar.AddFile("~wittek/datacrab_26feb04/positions_2004_01_26", 0);
     764      else if(inPath == "/mnt/magicserv01/scratch/David/CalibratedData/Crab/2004_02_15")
     765        sourcefromstar.AddFile("~wittek/datacrab_26feb04/positions040215.txt", 0);
     766    }
     767
    719768
    720769    //MBlindPixelCalc blindbeforepad;
     
    729778    MSigmabarCalc sigbar;
    730779
    731     MBadPixelCalcRms blind;
     780    //MBadPixelCalcRms blind;
     781    MBlindPixelsCalc2 blind;
    732782    //blind.SetUseBlindPixels();
    733783    blind.SetUseInterpolation();
    734     blind.SetCheckPedestalRMS();
     784    blind.SetCheckPedestalRms();
    735785    blind.SetName("BlindAfterPadding");
    736786
     
    748798
    749799    MImgCleanStd    clean(3.0, 2.5);
    750     clean.SetMethod(MImgCleanStd::kDemocratic);
     800    //clean.SetMethod(MImgCleanStd::kDemocratic);
    751801    clean.SetCleanRings(3);
    752802
     
    785835    selstandard.SetHillasName(fHilName);
    786836    selstandard.SetImgParName(fImgParName);
    787     selstandard.SetCuts(300, 6, 3000, 0.0, 1.1, 0.001, 0.001);
     837    selstandard.SetCuts(200, 5, 200, 0.0, 5.0, 0.1, 0.07);
    788838    MContinue contstandard(&selstandard);
    789839    contstandard.SetName("SelStandard");
  • trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc

    r3534 r3598  
    8888    fdPhiTel.Set(fSize);
    8989
    90     fDecStar.Set(1);
    91     fRaStar.Set(1);
    92     fxStar.ResizeTo(1,fSize);
    93     fyStar.ResizeTo(1,fSize);
    94     fdxStar.ResizeTo(1,fSize);
    95     fdyStar.ResizeTo(1,fSize);
     90    Int_t fRows = 1;
     91    fDecStar.Set(fRows);
     92    fRaStar.Set(fRows);
     93    fxStar.ResizeTo(fRows,fSize);
     94    fyStar.ResizeTo(fRows,fSize);
     95    fdxStar.ResizeTo(fRows,fSize);
     96    fdyStar.ResizeTo(fRows,fSize);
    9697
    9798    fStars = 0;
     
    194195
    195196  // convert into radians
    196   fStars = fDecStar.GetSize() + 1;
     197  fStars += 1;
    197198  fDecStar.Set(fStars);
    198199  fRaStar.Set(fStars);
     
    274275
    275276      *fLog << "read data" << endl;
     277
     278      // read "fStarsRead" = no.of (x,y) pairs to be read
     279      *fIn >> fStarsRead;
     280
    276281      while (1)
    277282      {
     
    294299    if (fDecSource == 0.0  ||  fRaSource == 0.0  ||  fStars == 0)
    295300    {
    296       *fLog << warn << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars; fStars = " << fStars
     301      *fLog << warn << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars; fStars, fStarsRead = "
     302            << fStars << ",  " << fStarsRead
    297303            << endl;
    298304    }
     
    482488Bool_t MSourcePosfromStarPos::ReInit(MParList *pList)
    483489{
     490  //if (1 == 1) return kTRUE;
     491
    484492
    485493  Int_t run = fRun->GetRunNumber();
     
    519527
    520528     
    521       if (fStars > 0)
     529      if (fStars > 0  && fStars == fStarsRead)
    522530      {
    523531        TArrayD xStar(fxStar.GetNrows());
     
    624632void MSourcePosfromStarPos::FixSize()
    625633{
    626   *fLog << "MSourcePosfromStarPos::FixSize; fix size of arrays : fRuns = "
    627         << fRuns << ",  fStars = " << fStars << endl;
    628   *fLog << "       first run : " << fRunNr[0] << ",  last run : "
    629         << fRunNr[fRuns-1] << endl;
    630 
    631634    fSize = fRuns;
     635    if (fRuns <= 0)
     636      fSize = 1;
    632637
    633638    fRunNr.Set(fSize);
     
    639644
    640645    Int_t fRows = fxStar.GetNrows();
    641     if (fRows <= 0)
    642       fRows = 1;
    643646    fxStar.ResizeTo(fRows, fSize);
    644647    fyStar.ResizeTo(fRows, fSize);
    645648    fdxStar.ResizeTo(fRows, fSize);
    646649    fdyStar.ResizeTo(fRows, fSize);
     650
     651  *fLog << "MSourcePosfromStarPos::FixSize; fix size of arrays : fStars = "
     652        << fStars << ",  fRuns = " << fRuns << ",  fRows = " << fRows
     653        << ",  fSize = " << fSize << endl;
     654  *fLog << "       first run : " << fRunNr[0] << ",  last run : "
     655        << fRunNr[fRuns-1] << endl;
    647656}
    648657
     
    657666
    658667  // extend size of arrays if necessary
    659   if ( fRuns >= (fSize-1) )
     668  if ( fRuns >= fSize )
    660669  {
    661670    fSize += 100;
     
    669678   
    670679    Int_t fRows = fxStar.GetNrows();
    671     if (fRows <= 0)
    672       fRows = 1;
    673680    fxStar.ResizeTo(fRows, fSize);
    674681    fyStar.ResizeTo(fRows, fSize);
    675682    fdxStar.ResizeTo(fRows, fSize);
    676683    fdyStar.ResizeTo(fRows, fSize);
     684
     685    *fLog << "MSourcePosfromStarPos::ReadData(); size of arrays has been increased to (fRows, fSize) = ("
     686          << fRows << ",  " << fSize << ")" << endl;
    677687  }
    678688
     
    694704  //*fIn >> val;
    695705  //-------------------
     706
    696707
    697708
     
    700711    *fIn >> ival;
    701712
     713    if (fIn->eof())
     714      return;
     715
    702716    // run number must be greater than 10000
    703     if (fabs((Double_t)ival) < 10000)
     717    if (fabs(ival) < 10000)
    704718    {
    705719      *fLog << err << "===========> Error when reading file with theta and phi <========="
     
    711725
    712726  fRuns += 1;
    713   //*fLog << fRuns <<"th run : " << ival << endl; 
     727  *fLog << fRuns <<"th run : " << ival << endl; 
    714728
    715729  fRunNr.AddAt(ival, fRuns-1);
     
    755769  // input is in [deg], convert to [mm]
    756770
    757   //*fLog << "ReadData : fStars = " << fStars << endl;
    758   for (Int_t i=0; i<fStars; i++)
    759   {
    760     *fIn >> val;
    761     //fxStar(i, fRuns-1) = val / fMm2Deg;
    762     fxStar(i, fRuns-1) = val;
    763     //*fLog << "val, fxStar(i, fRuns-1) = " << val << ",  "
    764     //      << fxStar(i, fRuns-1) << endl;
    765 
    766     *fIn >> val;
    767     //fyStar(i, fRuns-1) = val / fMm2Deg;
    768     fyStar(i, fRuns-1) = val;
    769     //*fLog << "val, fyStar(i, fRuns-1) = " << val << ",  "
    770     //      << fyStar(i, fRuns-1) << endl;
    771 
    772 
    773     //*fIn >> val;
    774     //*fLog << "y=dxStar = " << val << endl;
    775 
    776     //fdxStar(i, fRuns-1) = val / fMm2Deg;
    777     //fdxStar(i, fRuns-1) = val;
    778     fdxStar(i, fRuns-1) = 1.0;
    779     //*fIn >> val;
    780     //*fLog << "y=dyStar = " << val << endl;
    781 
    782     //fdyStar(i, fRuns-1) = val / fMm2Deg;
    783     //fdyStar(i, fRuns-1) = val;
    784     fdyStar(i, fRuns-1) = 1.0;
    785   }
    786 
     771  //*fLog << "ReadData : fStarsRead = " << fStarsRead << endl;
     772
     773    for (Int_t i=0; i<fStarsRead; i++)
     774    {
     775      *fIn >> val;
     776      if (i<fStars) fxStar(i, fRuns-1) = val;
     777
     778      *fIn >> val;
     779      if (i<fStars) fyStar(i, fRuns-1) = val;
     780
     781      //*fIn >> val;
     782      // if (i < fStars) fdxStar(i, fRuns-1) = val;
     783      if (i < fStars) fdxStar(i, fRuns-1) = 1.0;
     784
     785      //*fIn >> val;
     786      // if (i < fStars) fdyStar(i, fRuns-1) = val;
     787      if (i < fStars) fdyStar(i, fRuns-1) = 1.0;
     788    }
    787789}
    788790
  • trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.h

    r3531 r3598  
    5353    Int_t   fSize;                // final   number of runs
    5454    Int_t   fStars;               // number of stars
     55    Int_t   fStarsRead;           // number of (x,y) pairs to be read
    5556
    5657
Note: See TracChangeset for help on using the changeset viewer.