Changeset 3140 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 02/13/04 15:28:02 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/ONOFFAnalysis.C
r2798 r3140 80 80 81 81 MBinning *binsdiff = new MBinning("BinningDiffsigma2"); 82 binsdiff->SetEdges(100, - 5.0, 20.0);82 binsdiff->SetEdges(100, -10.0, 15.0); 83 83 plist->AddToList(binsdiff); 84 84 … … 176 176 //const char *onfile = "~magican/ct1test/wittek/mkn421_on.preproc"; 177 177 // const char *onfile = "~magican/ct1test/wittek/mkn421_00-01"; 178 const char *onfile = " /data/MAGIC/rootdata/2003_11_29/20031128_031*_D_Crab-Nebula_E.root";178 const char *onfile = "20040126_Crab_"; 179 179 180 180 const char *mcfile = "/data/MAGIC/mc_eth/magLQE_3/gh/0/0/G_M0_00_0_550*.root"; … … 184 184 185 185 // path for input for Mars 186 TString inPath = "/ data/MAGIC/scratch/wittek/";186 TString inPath = "/.magic/magicserv01/scratch/"; 187 187 188 188 // path for output from Mars 189 TString outPath = " /data/MAGIC/scratch/wittek/";189 TString outPath = "~wittek/datacrab/"; 190 190 191 191 //----------------------------------------------- … … 203 203 // - write root file for ON (or OFF or MC) data (ON1.root, ...); 204 204 205 Bool_t JobA = k TRUE;205 Bool_t JobA = kFALSE; 206 206 Bool_t GPad = kFALSE; // generate padding histograms? 207 207 Bool_t WPad = kFALSE; // write out padding histograms ? … … 234 234 235 235 Bool_t JobB_SC_UP = kTRUE; 236 Bool_t CMatrix = k TRUE; // create training and test matrices237 Bool_t RMatrix = k FALSE; // read training and test matrices from file238 Bool_t WOptimize = k FALSE; // do optimization using the training sample236 Bool_t CMatrix = kFALSE; // create training and test matrices 237 Bool_t RMatrix = kTRUE; // read training and test matrices from file 238 Bool_t WOptimize = kTRUE; // do optimization using the training sample 239 239 // and write supercuts parameter values 240 240 // onto the file parSCfile 241 Bool_t RTest = k FALSE; // test the supercuts using the test matrix241 Bool_t RTest = kTRUE; // test the supercuts using the test matrix 242 242 Bool_t WSC = kFALSE; // update input root file ? 243 243 … … 312 312 // names of ON and OFF files to be read 313 313 // for generating the histograms to be used in the padding 314 TString fileON = onfile; 314 315 TString fileON = inPath; 316 fileON += onfile; 317 fileON += "CalibratedEvts"; 318 fileON += ".root"; 315 319 TString fileOFF = offfile; 316 320 TString fileMC = mcfile; … … 333 337 // name of input root file 334 338 if (typeInput == "ON") 335 TString filenamein( onfile);339 TString filenamein(fileON); 336 340 else if (typeInput == "OFF") 337 TString filenamein( offfile);341 TString filenamein(fileOFF); 338 342 else if (typeInput == "MC") 339 TString filenamein( mcfile);343 TString filenamein(fileMC); 340 344 gLog << "data to be padded : " << filenamein << endl; 341 345 342 346 // name of output root file 343 347 TString outNameImage = outPath; 348 outNameImage += onfile; 349 outNameImage += "Hillas"; 344 350 outNameImage += typeInput; 345 351 outNameImage += "1.root"; … … 375 381 376 382 MReadMarsFile readON("Events", fileON); 377 read .DisableAutoScheme();378 383 readON.DisableAutoScheme(); 384 //MCT1ReadPreProc readON(fileON); 379 385 380 386 //MFSelBasic selthetaon; … … 454 460 455 461 MReadMarsFile readOFF("Events", fileOFF); 456 read .DisableAutoScheme();462 readOFF.DisableAutoScheme(); 457 463 // MCT1ReadPreProc readOFF(fileOFF); 458 464 … … 534 540 535 541 MReadMarsFile readMC("Events", fileMC); 536 read .DisableAutoScheme();542 readMC.DisableAutoScheme(); 537 543 // MCT1ReadPreProc readMC(fileMC); 538 544 … … 656 662 657 663 MGeomApply apply; 658 MMcPedestalCopy pcopy;659 MMcPedestalNSBAdd pnsb;660 664 661 665 MPedestalWorkaround waround; … … 667 671 f2.SetName("Select Data"); 668 672 669 MCerPhotCalc ncalc;670 ncalc.SetFilter(&f1);671 MCerPhotAnal2 nanal;672 nanal.SetFilter(&f2);673 674 673 //if (typeInput == "ON") 675 674 //{ … … 690 689 contbasic.SetName("SelBasic"); 691 690 692 MFillH fillblind("BlindPixels[MHBlindPixels]", "MBlindPixels");693 fillblind.SetName("HBlind");691 //MFillH fillblind("BlindPixels[MHBlindPixels]", "MBlindPixels"); 692 //fillblind.SetName("HBlind"); 694 693 695 694 MSigmabarCalc sigbarcalc; … … 734 733 selstandard.SetHillasName(fHilName); 735 734 selstandard.SetImgParName(fImgParName); 736 selstandard.SetCuts( 92, 4, 60, 0.4, 1.05, 0.0, 0.0);735 selstandard.SetCuts(100, 4, 20, 0.0, 1.0, 0.0, 0.0); 737 736 MContinue contstandard(&selstandard); 738 737 contstandard.SetName("SelStandard"); 739 738 740 739 741 740 MWriteRootFile write(outNameImage); 742 741 743 742 write.AddContainer("MRawRunHeader", "RunHeaders"); 744 write.AddContainer("MMcRunHeader", "RunHeaders", kFALSE);743 //write.AddContainer("MMcRunHeader", "RunHeaders", kFALSE); 745 744 //write.AddContainer("MTime", "Events"); 746 745 write.AddContainer("MMcEvt", "Events"); … … 752 751 write.AddContainer("MHillasSrc", "Events"); 753 752 write.AddContainer("MNewImagePar", "Events"); 754 753 755 754 756 755 //***************************** … … 767 766 tliston.AddToList(&read); 768 767 769 tliston.AddToList(&f1);770 tliston.AddToList(&f2);768 //tliston.AddToList(&f1); 769 //tliston.AddToList(&f2); 771 770 tliston.AddToList(&apply); 772 tliston.AddToList(&pcopy); 773 //tliston.AddToList(&waround); 774 775 tliston.AddToList(&pnsb); 776 tliston.AddToList(&ncalc); 777 tliston.AddToList(&nanal); 778 779 tliston.AddToList(&blindbeforepad); 771 tliston.AddToList(&waround); 772 773 //tliston.AddToList(&blindbeforepad); 780 774 // tliston.AddToList(&pad); 781 775 // if (typeInput == "ON") 782 776 // tliston.AddToList(&pointcorr); 783 tliston.AddToList(&blind); 777 778 //tliston.AddToList(&blind); 784 779 tliston.AddToList(&contbasic); 785 780 786 tliston.AddToList(&fillblind);781 //tliston.AddToList(&fillblind); 787 782 tliston.AddToList(&sigbarcalc); 788 783 tliston.AddToList(&fillsigtheta); … … 825 820 826 821 pliston.FindObject("SigmaTheta", "MHSigmaTheta")->DrawClone(); 827 pliston.FindObject("BlindPixels", "MHBlindPixels")->DrawClone();822 //pliston.FindObject("BlindPixels", "MHBlindPixels")->DrawClone(); 828 823 829 824 pliston.FindObject("MHHillas")->DrawClone(); … … 1770 1765 1771 1766 TString parSCinit = outPath; 1772 //parSCinit += "parSC_1709d"; 1773 parSCinit = ""; 1774 1775 gLog << "parSCinit = " << parSCinit << endl; 1767 parSCinit += "parSC_060204a"; 1768 //parSCinit = ""; 1769 1770 if (parSCinit != "") 1771 { 1772 gLog << "Initial values of parameters are taken from file '" 1773 << parSCinit << "'" << endl; 1774 } 1775 else 1776 { 1777 gLog << "Initial values of parameters are taken from the constructor of MSupercuts" 1778 << endl; 1779 } 1780 1776 1781 1777 1782 //--------------- … … 1780 1785 1781 1786 TString parSCfile = outPath; 1782 parSCfile += "parSC_ 2310a";1787 parSCfile += "parSC_060204b"; 1783 1788 1784 1789 gLog << "parSCfile = " << parSCfile << endl; … … 1787 1792 // file to be updated (either ON or MC) 1788 1793 1789 //TString typeInput = "ON";1794 TString typeInput = "ON"; 1790 1795 //TString typeInput = "OFF"; 1791 TString typeInput = "MC";1796 //TString typeInput = "MC"; 1792 1797 gLog << "typeInput = " << typeInput << endl; 1793 1798 1794 1799 // name of input root file 1795 1800 TString filenameData = outPath; 1801 filenameData += onfile; 1802 filenameData += "Hillas"; 1796 1803 filenameData += typeInput; 1797 filenameData += " 2.root";1804 filenameData += "1.root"; 1798 1805 gLog << "filenameData = " << filenameData << endl; 1799 1806 1800 1807 // name of output root file 1801 1808 TString outNameImage = outPath; 1809 outNameImage += onfile; 1810 outNameImage += "Hillas"; 1802 1811 outNameImage += typeInput; 1803 outNameImage += " 3.root";1812 outNameImage += "2.root"; 1804 1813 1805 1814 … … 1813 1822 // for the training 1814 1823 TString filenameTrain = outPath; 1815 filenameTrain += "ON"; 1824 filenameTrain += onfile; 1825 filenameTrain += "Hillas"; 1826 filenameTrain += typeInput; 1816 1827 filenameTrain += "1.root"; 1817 Int_t howManyTrain = 800000;1828 Int_t howManyTrain = 7000; 1818 1829 gLog << "filenameTrain = " << filenameTrain << ", howManyTrain = " 1819 1830 << howManyTrain << endl; … … 1821 1832 // for testing 1822 1833 TString filenameTest = outPath; 1823 filenameTest += "ON"; 1834 filenameTest += onfile; 1835 filenameTest += "Hillas"; 1836 filenameTest += typeInput; 1824 1837 filenameTest += "1.root"; 1825 Int_t howManyTest = 800000;1838 Int_t howManyTest = 7000; 1826 1839 1827 1840 gLog << "filenameTest = " << filenameTest << ", howManyTest = " … … 1930 1943 TArrayD steps(0); 1931 1944 1945 1932 1946 if (parSCinit == "") 1933 1947 { 1934 1948 Double_t vparams[104] = { 1935 1949 // LengthUp 1936 0. 315585, 0.001455, 0.203198, 0.005532, -0.001670, -0.020362,1937 0. 007388, -0.013463,1950 0.2, 0., 0., 0., 0., 0.0, 1951 0., 0., 1938 1952 // LengthLo 1939 0. 151530, 0.028323, 0.510707, 0.053089, 0.013708, 2.357993,1940 0. 000080, -0.007157,1953 0., 0., 0., 0., 0., 0.0, 1954 0., 0., 1941 1955 // WidthUp 1942 0.1 45412, -0.001771, 0.054462, 0.022280, -0.009893, 0.056353,1943 0.020711, -0.016703,1956 0.1, 0., 0., 0., 0., 0.0, 1957 0., 0., 1944 1958 // WidthLo 1945 0. 089187, -0.006430, 0.074442, 0.003738, -0.004256, -0.014101,1946 0.006126, -0.002849,1959 0., 0., 0., 0., 0., 0.0, 1960 0., 0., 1947 1961 // DistUp 1948 1.787943, 0.0, 2.942310, 0.199815, 0.0, 0.249909,1949 0.189697, 0.0,1962 0., 0., 0., 0., 0., 0.0, 1963 0., 0., 1950 1964 // DistLo 1951 0. 589406, 0.0, -0.083964,-0.007975, 0.0, 0.045374,1952 -0.001750, 0.0,1965 0., 0., 0., 0., 0., 0.0, 1966 0., 0., 1953 1967 // AsymUp 1954 1968 1.e10, 0.0, 0.0, 0.0, 0.0, 0.0, … … 1975 1989 Double_t vsteps[104] = { 1976 1990 // LengthUp 1977 0.03, 0.0002, 0.02, 0.0006, 0.0002, 0.002,1978 0.0008, 0.002,1991 0.02, 0., 0., 0., 0., 0.0, 1992 0., 0., 1979 1993 // LengthLo 1980 0. 02, 0.003, 0.05, 0.006, 0.002, 0.3,1981 0.0001, 0.0008,1994 0., 0., 0., 0., 0., 0.0, 1995 0., 0., 1982 1996 // WidthUp 1983 0.0 2, 0.0002, 0.006, 0.003, 0.002, 0.006,1984 0.002, 0.002,1997 0.01, 0., 0., 0., 0., 0.0, 1998 0., 0., 1985 1999 // WidthLo 1986 0. 009, 0.0007, 0.008, 0.0004, 0.0005, 0.002,1987 0.0007, 0.003,2000 0., 0., 0., 0., 0., 0.0, 2001 0., 0., 1988 2002 // DistUp 1989 0. 2, 0.0, 0.3, 0.02, 0.0, 0.03,1990 0.02, 0.0 2003 0., 0., 0., 0., 0., 0.0, 2004 0., 0., 1991 2005 // DistLo 1992 0. 06, 0.0, 0.009, 0.0008, 0.0, 0.005,1993 0.0002, 0.0 1994 // AsymUp 2006 0., 0., 0., 0., 0., 0.0, 2007 0., 0., 2008 // AsymUp 1995 2009 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1996 2010 0.0, 0.0, 1997 // AsymLo 2011 // AsymLo 1998 2012 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1999 2013 0.0, 0.0, 2000 // ConcUp 2014 // ConcUp 2001 2015 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2002 2016 0.0, 0.0, 2003 // ConcLo 2017 // ConcLo 2004 2018 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2005 2019 0.0, 0.0, 2006 // Leakage1Up 2020 // Leakage1Up 2007 2021 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2008 2022 0.0, 0.0, 2009 // Leakage1Lo 2023 // Leakage1Lo 2010 2024 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2011 2025 0.0, 0.0, 2012 // AlphaUp 2013 2026 // AlphaUp 2027 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2014 2028 0.0, 0.0 }; 2029 2015 2030 2016 2031 params.Set(104, vparams); … … 2142 2157 2143 2158 write.AddContainer("MRawRunHeader", "RunHeaders"); 2144 write.AddContainer("MTime", "Events");2159 //write.AddContainer("MTime", "Events"); 2145 2160 write.AddContainer("MMcEvt", "Events"); 2146 write.AddContainer("ThetaOrig", "Events");2161 //write.AddContainer("ThetaOrig", "Events"); 2147 2162 write.AddContainer("MSrcPosCam", "Events"); 2148 2163 write.AddContainer("MSigmabar", "Events"); … … 2152 2167 write.AddContainer("MNewImagePar", "Events"); 2153 2168 2154 write.AddContainer("HadRF", "Events");2169 //write.AddContainer("HadRF", "Events"); 2155 2170 write.AddContainer(hadSCName, "Events"); 2156 2171
Note:
See TracChangeset
for help on using the changeset viewer.