Changeset 6232
- Timestamp:
- 02/03/05 12:42:21 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mmpi
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFF.cc
r4411 r6232 645 645 // The default is not cut, i.e. all values (0-1) are taken 646 646 647 fThetaMin = 0; // in miliradians // FIXME: change name 648 fThetaMax = 90; // new: in deg; old: (1570) in miliradians // FIXME: change name 649 647 //fThetaMin = 0; // in miliradians // FIXME: change name 648 //fThetaMax = 1570; // in miliradians // FIXME: change name 649 650 fThetaMin = 0; // degrees (new in magic) 651 fThetaMax = 90; // degrees (new in magic) 652 653 650 654 651 655 fAlphaSig = 20; // By default, signal is expected in alpha<20 for CT1 … … 770 774 771 775 // Angular cuts not yet implemented ... 772 Double_tConvMMToDeg = 0.00337034;773 774 fDistCutLow = 0.4/ ConvMMToDeg;775 fDistCutUp = 1.5/ ConvMMToDeg;776 777 fLengthCutLow = 0.1/ ConvMMToDeg;778 fLengthCutUp = 1/ ConvMMToDeg;779 780 fWidthCutLow = 0.07/ ConvMMToDeg;781 fWidthCutUp = 1/ ConvMMToDeg;776 fConvMMToDeg = 0.00337034; 777 778 fDistCutLow = 0.4/fConvMMToDeg; 779 fDistCutUp = 1.5/fConvMMToDeg; 780 781 fLengthCutLow = 0.1/fConvMMToDeg; 782 fLengthCutUp = 1/fConvMMToDeg; 783 784 fWidthCutLow = 0.07/fConvMMToDeg; 785 fWidthCutUp = 1/fConvMMToDeg; 782 786 783 787 // ENDTMP … … 1141 1145 // in previous functions... 1142 1146 1143 fThetaMin = int(ThetaMin*1000.0); 1144 fThetaMax = int(ThetaMax*1000.0); 1147 // fThetaMin = int(ThetaMin*1000.0); 1148 // fThetaMax = int(ThetaMax*1000.0); 1149 1150 1151 // in new magic theta is given in deg 1152 // 0.5 is added so that the rounding to integer is correct 1153 fThetaMin = int(ThetaMin + 0.5); 1154 fThetaMax = int(ThetaMax + 0.5); 1145 1155 1146 1156 fThetaRangeString = ("ThetaRange"); … … 1148 1158 fThetaRangeString += ("_"); 1149 1159 fThetaRangeString += (fThetaMax); 1150 fThetaRangeString += ("mRad"); 1160 // fThetaRangeString += ("mRad"); 1161 fThetaRangeString += ("_Degrees"); // new in magic 1162 1151 1163 1152 1164 return kTRUE; … … 1168 1180 1169 1181 1182 1183 return kTRUE; 1184 } 1185 1186 1187 Bool_t MFindSupercutsONOFF::SetFilters(Double_t LeakageMax, Double_t DistMax, Double_t DistMin) 1188 { 1189 1190 fDistCutLow = DistMin/fConvMMToDeg; 1191 fDistCutUp = DistMax/fConvMMToDeg; 1192 fLeakageMax = LeakageMax; 1193 1194 *fLog << "MFindSupercutsONOFF::SetSizeRange" << endl 1195 << "Data matrices will be filled with events whose MHillasSrc.fDist " << endl 1196 << "is in the range " 1197 << fDistCutLow <<"-"<< fDistCutUp << " degrees" << endl 1198 << "and fLeakage " << "< " << fLeakageMax << endl; 1170 1199 1171 1200 return kTRUE; … … 1682 1711 1683 1712 1684 // TMP1713 1685 1714 // Cuts in Size, 1686 1715 … … 1696 1725 SizeCutMax.SetInverted(); 1697 1726 1698 1699 1700 1701 // ENDTMP 1727 // Cuts in Dist 1728 TString DistCutMinString ("MHillasSrc.fDist>"); 1729 DistCutMinString += fDistCutLow; 1730 MContinue DistCutMin(DistCutMinString); 1731 DistCutMin.SetInverted(); 1732 1733 TString DistCutMaxString ("MHillasSrc.fDist<"); 1734 DistCutMaxString += fDistCutUp; 1735 MContinue DistCutMax(DistCutMaxString); 1736 DistCutMax.SetInverted(); 1737 1738 1739 // Cuts in leakage 1740 TString LeakCutMaxString ("MNewImagePar.fLeakage1<"); 1741 LeakCutMaxString += fLeakageMax; 1742 MContinue LeakCutMax(LeakCutMaxString); 1743 LeakCutMax.SetInverted(); 1702 1744 1703 1745 … … 1706 1748 Double_t prob = whichfractiontrain /(whichfractiontrain+whichfractiontest); 1707 1749 1750 1751 1752 1708 1753 MFRandomSplit split(prob); 1709 1754 … … 1735 1780 1736 1781 tlist.AddToList(&read); 1737 //tlist.AddToList(&ThetaCutMin);1738 //tlist.AddToList(&ThetaCutMax);1739 1740 //TMP1782 tlist.AddToList(&ThetaCutMin); 1783 tlist.AddToList(&ThetaCutMax); 1784 1785 1741 1786 tlist.AddToList(&SizeCutMin); 1742 1787 tlist.AddToList(&SizeCutMax); 1743 1788 1744 //ENDTMP 1789 tlist.AddToList(&DistCutMin); 1790 tlist.AddToList(&DistCutMax); 1791 tlist.AddToList(&LeakCutMax); 1792 1793 1745 1794 tlist.AddToList(&split); 1746 1795 tlist.AddToList(&filltrain); … … 1848 1897 1849 1898 1850 // TMP1899 1851 1900 // Cuts in Size, 1852 1901 … … 1863 1912 1864 1913 1865 1866 1867 // ENDTMP 1914 // Cuts in Dist 1915 TString DistCutMinString ("MHillasSrc.fDist>"); 1916 DistCutMinString += fDistCutLow; 1917 MContinue DistCutMin(DistCutMinString); 1918 DistCutMin.SetInverted(); 1919 1920 TString DistCutMaxString ("MHillasSrc.fDist<"); 1921 DistCutMaxString += fDistCutUp; 1922 MContinue DistCutMax(DistCutMaxString); 1923 DistCutMax.SetInverted(); 1924 1925 1926 // Cuts in leakage 1927 TString LeakCutMaxString ("MNewImagePar.fLeakage1<"); 1928 LeakCutMaxString += fLeakageMax; 1929 MContinue LeakCutMax(LeakCutMaxString); 1930 LeakCutMax.SetInverted(); 1931 1932 1933 1934 1935 1936 1868 1937 1869 1938 … … 1871 1940 1872 1941 Double_t prob = whichfractiontrain/(whichfractiontrain + whichfractiontest); 1873 1942 1943 1944 1874 1945 MFRandomSplit split(prob); 1875 1946 … … 1903 1974 1904 1975 tlist.AddToList(&read); 1905 //tlist.AddToList(&ThetaCutMin);1906 //tlist.AddToList(&ThetaCutMax);1976 tlist.AddToList(&ThetaCutMin); 1977 tlist.AddToList(&ThetaCutMax); 1907 1978 1908 1979 1909 //TMP1980 1910 1981 tlist.AddToList(&SizeCutMin); 1911 1982 tlist.AddToList(&SizeCutMax); 1912 1983 1913 //ENDTMP 1984 tlist.AddToList(&DistCutMin); 1985 tlist.AddToList(&DistCutMax); 1986 tlist.AddToList(&LeakCutMax); 1987 1988 1914 1989 1915 1990 tlist.AddToList(&split); … … 1975 2050 1976 2051 2052 2053 /// **********/// 2054 2055 // -------------------------------------------------------------------------- 2056 // 2057 // Read only training matrices ON and OFF 2058 // 2059 // 2060 2061 Bool_t MFindSupercutsONOFF::ReadMatrixTrain(const TString &filetrainON, const TString &filetrainOFF) 2062 { 2063 //-------------------------- 2064 // read in training matrix ON sample 2065 2066 TFile filetr(filetrainON); 2067 fMatrixTrain->Read("MatrixTrain"); 2068 fMatrixTrain->Print("SizeCols"); 2069 2070 *fLog << "MFindSupercuts::ReadMatrixTrain; Training matrix for ON sample was read in from file '" 2071 << filetrainON << "'" << endl; 2072 filetr.Close(); 2073 2074 2075 // read in training matrix OFF sample 2076 2077 TFile filetrOFF(filetrainOFF); 2078 fMatrixTrainOFF->Read("MatrixTrainOFF"); 2079 fMatrixTrainOFF->Print("SizeCols"); 2080 2081 *fLog << "MFindSupercutsONOFF::ReadMatrixTrain; Training matrix for OFF sample was read in from file '" 2082 << filetrainOFF << "'" << endl; 2083 filetrOFF.Close(); 2084 2085 return kTRUE; 2086 2087 } 2088 2089 // -------------------------------------------------------------------------- 2090 // 2091 // Read only test matrices ON and OFF 2092 // 2093 // 2094 2095 Bool_t MFindSupercutsONOFF::ReadMatrixTest(const TString &filetestON, const TString &filetestOFF) 2096 { 2097 //-------------------------- 2098 // read in testing matrix ON sample 2099 2100 //-------------------------- 2101 // read in test matrix for ON sample 2102 2103 TFile filete(filetestON); 2104 fMatrixTest->Read("MatrixTest"); 2105 fMatrixTest->Print("SizeCols"); 2106 2107 *fLog << "MFindSupercuts::ReadMatrixTest; Test matrix for ON sample was read in from file '" 2108 << filetestON << "'" << endl; 2109 filete.Close(); 2110 2111 2112 //-------------------------- 2113 // read in test matrix for OFF sample 2114 2115 TFile fileteOFF(filetestOFF); 2116 fMatrixTestOFF->Read("MatrixTestOFF"); 2117 fMatrixTestOFF->Print("SizeCols"); 2118 2119 *fLog << "MFindSupercutsONOFF::ReadMatrixTest; Test matrix for OFF sample was read in from file '" 2120 << filetestOFF << "'" << endl; 2121 filete.Close(); 2122 2123 2124 2125 return kTRUE; 2126 2127 } 2128 2129 1977 2130 /// **********/// 1978 2131 … … 1999 2152 //-------------------------- 2000 2153 // read in test matrix 2001 2154 2002 2155 TFile filete(filetest); 2003 2156 fMatrixTest->Read("MatrixTest"); … … 2007 2160 << filetest << "'" << endl; 2008 2161 filete.Close(); 2009 2162 2010 2163 return kTRUE; 2011 2164 } … … 2032 2185 //-------------------------- 2033 2186 // read in test matrix 2034 2187 2035 2188 TFile filete(filetest); 2036 2189 fMatrixTestOFF->Read("MatrixTestOFF"); … … 2040 2193 << filetest << "'" << endl; 2041 2194 filete.Close(); 2042 2195 2043 2196 return kTRUE; 2044 2197 } -
trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFF.h
r4411 r6232 59 59 Double_t fWidthCutUp; 60 60 61 Double_t fLeakageMax; 62 63 Double_t fConvMMToDeg; 61 64 62 65 // ENDTMP … … 85 88 Double_t fAlphaBkgMax; 86 89 87 Int_t fThetaMin; // Cut s in ThetaOrig.fVal (in mili radians!!!)88 Int_t fThetaMax; // Cuts in Theta Orig.fVal (in mili radians !!!)90 Int_t fThetaMin; // Cut in Theta value (in degrees) 91 Int_t fThetaMax; // Cuts in Theta value (in degrees) 89 92 TString fThetaRangeString; 90 93 … … 314 317 Bool_t CheckAlphaSigBkg(); 315 318 319 320 321 322 316 323 void SetUseFittedQuantities (Bool_t b) 317 324 {fUseFittedQuantities = b;} … … 371 378 Bool_t ReadMatrixOFF( const TString &filetrainOFF, const TString &filetestOFF); 372 379 380 381 Bool_t ReadMatrixTrain(const TString &filetrainON, const TString &filetrainOFF); 382 Bool_t ReadMatrixTest(const TString &filetestON, const TString &filetestOFF); 383 384 385 373 386 Bool_t ComputeNormFactorTrain (); 374 387 Bool_t ComputeNormFactorTest (); … … 395 408 396 409 Bool_t SetSizeRange(Double_t SizeMin, Double_t SizeMax); 410 411 Bool_t SetFilters(Double_t LeakageMax, Double_t DistMax, Double_t DistMin); 412 397 413 398 414 -
trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFFThetaLoop.cc
r4411 r6232 110 110 //--------------------------- 111 111 112 112 // ********************************* 113 // ** NOT TRUE ANY LONGER... ** // 113 114 // Cuts (low and up) in variable ThetaOrig.fVal 114 115 // The default is not cut, i.e. all values (0-1) are taken 115 116 // fThetaOrig.fVal is measured in Radians; thus 1 = 57 degrees. 116 117 118 // fThetaMin = 0.0; 119 // fThetaMax = 1.0; 120 // ********************************* 121 122 123 // For MAGIC new (July 2004) Theta is measured in degrees 124 117 125 fThetaMin = 0.0; 118 fThetaMax = 1.0; 126 fThetaMax = 90.0; 127 128 119 129 120 130 fAlphaSig = 20; // By default, signal is expected in alpha<20 for CT1 … … 545 555 546 556 547 // Give a "soft warning" if Vector has increasing values 548 // of CosThetas; which means decreasing values of Thetas 549 /* 550 if (fCosThetaRangeVector[0] <= fCosThetaRangeVector[1]) 551 { 552 *fLog << "MFindSupercutsONOFFThetaLoop::SetCosThetaRangeVector; " 553 << endl 554 << "Values in vector fCosThetaRangeVector are in increasing " 555 << "order, i.e., values in theta will be in decreasing order" 556 << endl 557 << "DO NOT forget it !!" << endl; 558 } 559 560 */ 557 561 558 562 559 // fCosThetaBinCenterVector is defined … … 622 619 // Now costheta values have to be converted to Radians 623 620 // Function TMath::ACos(x) gives angle in Radians 624 621 625 622 626 623 fThetaMin = TMath::ACos(fThetaMin); 627 624 fThetaMax = TMath::ACos(fThetaMax); 625 626 627 // For new MAGIC (July 2004), angles are given in degrees. 628 // So I convert angles into degrees by multiplying by a the 629 // conversion rad/degree 630 631 fThetaMin = fThetaMin * TMath::RadToDeg(); 632 fThetaMax = fThetaMax * TMath::RadToDeg(); 633 634 628 635 629 636 // If fThetaMin > fThetaMax means that fCosThetaRangeVector … … 644 651 << "MFindSupercutsONOFFThetaLoop::SetThetaRange; " << endl 645 652 << "Theta range for this iteration is set to " 646 << fThetaMin << "-" << fThetaMax << " Radians." << endl653 << fThetaMin << "-" << fThetaMax << " degrees." << endl 647 654 << "-------------------------------------------------"<< endl; 648 655 … … 932 939 933 940 934 // Histograms references are removed from the current directory 935 936 /* IT DOES NOT WORK !!! THESE STATEMENTS PRODUCE SEGMENTATION FAULT. 937 fNormFactorTrainHist -> SetDirectory(NULL); 938 939 fNormFactorTestHist -> SetDirectory(NULL); 940 941 fSigmaLiMaTrainHist -> SetDirectory(NULL); 942 943 fSigmaLiMaTestHist -> SetDirectory(NULL); 944 945 fSigmaLiMaTestHist -> SetDirectory(NULL); 946 947 fNexTestHist -> SetDirectory(NULL); 948 */ 941 949 942 950 943 … … 1059 1052 Double_t fofftest) 1060 1053 { 1054 1055 // Check that fractions set by user are within the expected limits 1056 1057 if (fontrain < 0.00 || fontrain > 1.00 || 1058 fontest < 0.00 || fontest > 1.00 || 1059 fofftrain < 0.00 || fofftrain > 1.00 || 1060 fofftest < 0.00 || fontest > 1.00) 1061 { 1062 *fLog << err 1063 << "MFindSupercutsONOFFThetaLoop::SetFractionTrainTestOnOffEvents: " 1064 << endl 1065 << "Fractions of ON/OFF data for TRAIN/TEST sample which were specified by user " << endl 1066 << "are outside the natural limits 0.0-1.0. " << endl 1067 << "Set reasonable fraction numbers for TRAIN/TEST please. The program will be aborted." 1068 << endl; 1069 1070 exit(1); 1071 1072 1073 } 1074 1075 1076 if((fontrain+fontest) > 1.00 || 1077 (fofftrain+fofftest) >1.00) 1078 1079 { 1080 *fLog << err 1081 << "MFindSupercutsONOFFThetaLoop::SetFractionTrainTestOnOffEvents: " 1082 << endl 1083 << "The sum of the fractions of TRAIN/TEST for ON or OFF data which were specified by user " << endl 1084 << "are larger than 1.0. " << endl 1085 << "Set reasonable fraction numbers for TRAIN/TEST please. The program will be aborted." 1086 << endl; 1087 1088 exit(1); 1089 1090 1091 } 1092 1061 1093 1062 1094 fWhichFractionTrain = fontrain; … … 1154 1186 1155 1187 // Path + "OptSCParametersONOFF" + "ThetaRange" 1156 // + int {(fThetaMin_fThetaMax) *1000} + ".root"1188 // + int {(fThetaMin_fThetaMax)} + ".root" 1157 1189 1158 1190 … … 1160 1192 1161 1193 // Path + "ON(OFF)Data" + "Train(Test)" + "Matrix" + Fraction 1162 // + "ThetaRange" + int {(fThetaMin_fThetaMax) *1000} + ".root"1194 // + "ThetaRange" + int {(fThetaMin_fThetaMax)} + ".root" 1163 1195 1164 1196 … … 1176 1208 1177 1209 1178 Int_t ThetaMinTimes1000 = 0; 1179 Int_t ThetaMaxTimes1000 = 0; 1210 // Int_t ThetaMinTimes1000 = 0; 1211 // Int_t ThetaMaxTimes1000 = 0; 1212 1213 // For MAGIC new (July 2004) Theta is given in deg 1214 1215 Int_t ThetaMinInt = 0; 1216 Int_t ThetaMaxInt = 0; 1217 1218 1180 1219 Int_t FractionONTrainTimes100 = 0; 1181 1220 Int_t FractionONTestTimes100 = 0; … … 1200 1239 1201 1240 1202 ThetaMinTimes1000 = int(fThetaMin*1000); 1203 ThetaMaxTimes1000 = int(fThetaMax*1000); 1204 sprintf(ThetaRangeString, "ThetaRange%d_%dmRad", 1205 ThetaMinTimes1000, ThetaMaxTimes1000); 1241 //ThetaMinTimes1000 = int(fThetaMin*1000); 1242 //ThetaMaxTimes1000 = int(fThetaMax*1000); 1243 //sprintf(ThetaRangeString, "ThetaRange%d_%dmRad", 1244 // ThetaMinTimes1000, ThetaMaxTimes1000); 1245 1246 // For New MAGIC (July 2004) 1247 // Theta is given in deg, no need to multiply by 1000 1248 1249 // 0.5 is added so that the rounding to integer is correct 1250 ThetaMinInt = int(fThetaMin + 0.5); 1251 ThetaMaxInt = int(fThetaMax + 0.5); 1252 sprintf(ThetaRangeString, "ThetaRange%d_%d_Degrees", 1253 ThetaMinInt, ThetaMaxInt); 1254 1255 1206 1256 1207 1257 fThetaRangeStringVector[i] = (ThetaRangeString); … … 1211 1261 // endtmp 1212 1262 1213 Double_t tmpdouble = 0.0; 1214 tmpdouble = fWhichFractionTrain*100 - int(fWhichFractionTrain*100); 1215 1216 FractionONTrainTimes100 = tmpdouble < 0.5 ? int(fWhichFractionTrain*100): 1217 int(fWhichFractionTrain*100) + 1; 1218 1219 1220 tmpdouble = fWhichFractionTest*100 - int(fWhichFractionTest*100); 1221 1222 FractionONTestTimes100 = tmpdouble < 0.5 ? int(fWhichFractionTest*100): 1223 int(fWhichFractionTest*100) + 1; 1224 1225 tmpdouble = fWhichFractionTrainOFF*100 - int(fWhichFractionTrainOFF*100); 1226 1227 FractionOFFTrainTimes100 = tmpdouble < 0.5 ? int(fWhichFractionTrainOFF*100): 1228 int(fWhichFractionTrainOFF*100) + 1; 1229 1230 tmpdouble = fWhichFractionTestOFF*100 - int(fWhichFractionTestOFF*100); 1231 FractionOFFTestTimes100 = tmpdouble < 0.5 ? int(fWhichFractionTestOFF*100): 1232 int(fWhichFractionTestOFF*100) + 1; 1263 // 0.5 is added so that the rounding to integer is correct 1264 1265 FractionONTrainTimes100 = int(fWhichFractionTrain*100 + 0.5); 1266 FractionONTestTimes100 = int(fWhichFractionTest*100 + 0.5); 1267 FractionOFFTrainTimes100 = int(fWhichFractionTrainOFF*100 + 0.5); 1268 FractionOFFTestTimes100 = int(fWhichFractionTestOFF*100 + 0.5); 1269 1270 1233 1271 1234 1272 … … 1525 1563 FindSupercuts.SetSizeRange(fSizeCutLow, fSizeCutUp); 1526 1564 1565 FindSupercuts.SetFilters(fLeakMax, fDistMax, fDistMin); 1527 1566 1528 1567 … … 1627 1666 << "Reading Data matrices from root files... " << endl; 1628 1667 1668 /* 1629 1669 FindSupercuts.ReadMatrix(fTrainMatrixONFilenameVector[i], 1630 1670 fTestMatrixONFilenameVector[i]); 1631 1671 FindSupercuts.ReadMatrixOFF(fTrainMatrixOFFFilenameVector[i], 1632 1672 fTestMatrixOFFFilenameVector[i]); 1673 */ 1674 1675 FindSupercuts.ReadMatrixTrain(fTrainMatrixONFilenameVector[i], 1676 fTrainMatrixOFFFilenameVector[i]); 1677 1678 if (fTestParameters) 1679 { 1680 FindSupercuts.ReadMatrixTest(fTestMatrixONFilenameVector[i], 1681 fTestMatrixOFFFilenameVector[i]); 1682 } 1633 1683 1634 1684 } … … 2325 2375 2326 2376 // TEMP 2327 // 2328 // 2377 //cout << NexVSAlphaNameTmp << endl; 2378 //cout << SignificanceVSAlphaNameTmp << endl; 2329 2379 // ENDTEMP 2330 2380 … … 2388 2438 2389 2439 AlphaOFFAfterCuts = (TH1F*) rootfile.Get(TmpAlphaOFFHistoName); 2440 2441 2442 2390 2443 2391 2444 … … 2885 2938 { 2886 2939 2940 2941 *fLog << endl << endl 2942 << "****************************************************************************" << endl 2943 << "Combining number of excess events and significance for the " << endl 2944 << "selected bins in theta angle using the function " << endl 2945 << " MFindSupercutsONOFFThetaLoop::ComputeOverallSignificance() " << endl 2946 << "****************************************************************************" << endl 2947 << endl; 2948 2949 2950 2951 2952 2953 2887 2954 // First of all let's check that we have the proper the "drinks" for the party 2888 2955 … … 2917 2984 // Remember that histogram index START AT 1 !!! 2918 2985 2986 2987 2988 // Histograms that will contain the alpha distributions 2989 // for the combined theta bins 2990 2991 2919 2992 TH1F* CombinedAlphaTrainON = NULL; 2920 TString CombinedAlphaTrainONName = (" CombinedAlphaTrainON");2993 TString CombinedAlphaTrainONName = ("TrainSampleAlphaONCombinedThetaBins"); 2921 2994 TH1F* CombinedAlphaTrainOFF = NULL; 2922 TString CombinedAlphaTrainOFFName = (" CombinedAlphaTrainOFF");2995 TString CombinedAlphaTrainOFFName = ("TrainSampleAlphaOFFCombinedThetaBins"); 2923 2996 2924 2997 TH1F* CombinedAlphaTestON = NULL; 2925 TString CombinedAlphaTestONName = (" CombinedAlphaTestON");2998 TString CombinedAlphaTestONName = ("TestSampleAlphaONCombinedThetaBins"); 2926 2999 2927 3000 TH1F* CombinedAlphaTestOFF = NULL; 2928 TString CombinedAlphaTestOFFName = (" CombinedAlphaTestOFF");3001 TString CombinedAlphaTestOFFName = ("TestSampleAlphaONCombinedThetaBins"); 2929 3002 2930 2931 3003 3004 2932 3005 2933 3006 … … 3089 3162 { 3090 3163 3164 3165 3166 *fLog << endl 3167 << "****************************************************************************" << endl 3168 << "Combining data for the TRAIN sample " << endl 3169 << "****************************************************************************" << endl 3170 << endl; 3171 3091 3172 // Retrieving NormFactorTrainHisto from root file. 3092 3173 … … 3489 3570 CombinedAlphaTrainOFF->SetEntries(tmpint); 3490 3571 3491 3572 // Check that the number of events in the combined normalized histogram is 3573 // that of the initial sample 3574 3575 /* 3492 3576 cout << "SILLY INFO FOR TRAIN SAMPLE: Total number of events Before nomralization and " 3493 3577 << " re-re normalized" << endl 3494 3578 << TotalNumberOFFTrain << " - " << EventCounter << endl; 3495 3579 3580 */ 3496 3581 } 3497 3582 … … 3506 3591 if (CombineTestData) 3507 3592 { 3593 3594 *fLog << endl 3595 << "****************************************************************************" << endl 3596 << "Combining data for the TEST sample " << endl 3597 << "****************************************************************************" << endl 3598 << endl; 3599 3508 3600 3509 3601 // Retrieving NormFactorTestHisto from root file. … … 3930 4022 3931 4023 4024 // Check that the number of events in the combined normalized histogram is 4025 // that of the initial sample 4026 4027 /* 3932 4028 cout << "SILLY INFO FOR TEST SAMPLE: Total number of events Before nomralization and " 3933 4029 << " re-re normalized" << endl 3934 4030 << TotalNumberOFFTest << " - " << EventCounter << endl; 4031 4032 */ 4033 3935 4034 3936 4035 /* … … 3982 4081 if (SuccessfulThetaBinsVector.GetSize() >= 1) 3983 4082 { 4083 4084 4085 *fLog << endl 4086 << "**************************************************************************************" << endl 4087 << "Computation of excess events and singnificance for the combined alpha histograms " << endl 4088 << "**************************************************************************************" << endl 4089 << endl; 4090 3984 4091 // There is, at least, ONE theta bin for which optimization of 3985 4092 // supercuts was SUCCESSFUL, and thus, it is worth to … … 4026 4133 4027 4134 // Name of psfile where Alpha plot will be stored 4028 TString psfilename = ("TRAINSampleCombined"); 4135 4136 TString psfilename = (fPathForFiles); 4137 psfilename += ("TRAINSampleCombinedThetaBins"); 4029 4138 4030 4139 findsig.FindSigmaONOFF(CombinedAlphaTrainON, CombinedAlphaTrainOFF, … … 4053 4162 4054 4163 // Name of psfile where Alpha plot will be stored 4055 TString psfilename = ("TESTSampleCombined"); 4164 TString psfilename = (fPathForFiles); 4165 psfilename += ("TESTSampleCombinedThetaBins"); 4056 4166 4057 4167 findsig.FindSigmaONOFF(CombinedAlphaTestON, CombinedAlphaTestOFF, … … 4075 4185 4076 4186 4187 *fLog << endl 4188 << "**************************************************************************************" << endl 4189 << "Alpha distributions (Train/Test and ON/OFF) for the combined " << endl 4190 << " theta bins are stored in the root file " << endl 4191 << fAlphaDistributionsRootFilename << endl 4192 << "**************************************************************************************" << endl 4193 << endl; 4194 4195 4196 4197 TFile rootfiletowrite(fAlphaDistributionsRootFilename, "UPDATE"); 4198 4199 4200 4201 // Histograms that will contain the Norm factors for the 4202 // combined TRAIN/TEST theta bins are created 4203 4204 4205 TString CombinedNormFactorTrainName = ("TrainSampleNormFactorCombinedThetaBins"); 4206 TH1F CombinedNormFactorTrain (CombinedNormFactorTrainName, 4207 CombinedNormFactorTrainName, 4208 1, 0.0, 1.0); 4209 4210 TString CombinedNormFactorTestName = ("TestSampleNormFactorCombinedThetaBins"); 4211 TH1F CombinedNormFactorTest (CombinedNormFactorTestName, 4212 CombinedNormFactorTestName, 4213 1, 0.0, 1.0); 4214 4215 4216 if (CombineTrainData) 4217 { 4218 4219 // Histogram that will contain the Norm factors for the 4220 // combined TRAIN theta bins are filled 4221 4222 4223 CombinedNormFactorTrain.Fill(0.5, MeanNormFactorTrain); 4224 4225 4226 // Train histos are written to root file 4227 4228 CombinedAlphaTrainON -> Write(); 4229 CombinedAlphaTrainOFF -> Write(); 4230 CombinedNormFactorTrain.Write(); 4231 4232 4233 4234 } 4235 4236 4237 if (CombineTestData) 4238 { 4239 4240 // Histogram that will contain the Norm factors for the 4241 // combined TEST theta bins are filled 4242 4243 4244 CombinedNormFactorTest.Fill(0.5, MeanNormFactorTest); 4245 4246 // Test histos are written to root file 4247 4248 CombinedAlphaTestON -> Write(); 4249 CombinedAlphaTestOFF -> Write(); 4250 CombinedNormFactorTest.Write(); 4251 4252 4253 } 4254 4255 4256 // Root file is closed 4257 4258 rootfiletowrite.Close(); 4259 4077 4260 4078 4261 } -
trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MFindSupercutsONOFFThetaLoop.h
r4411 r6232 73 73 Double_t fSizeCutUp; 74 74 75 Double_t fLeakMax; 76 Double_t fDistMax; 77 Double_t fDistMin; 75 78 76 79 // Variables for binning of alpha plots … … 373 376 void SetSizeRange(Double_t SizeMin, Double_t SizeMax) 374 377 {fSizeCutLow = SizeMin; fSizeCutUp = SizeMax; } 378 379 //DM: 380 void SetFilters(Double_t LeakageMax, Double_t DistMax, Double_t DistMin) 381 {fLeakMax = LeakageMax; fDistMax = DistMax; fDistMin = DistMin; } 375 382 376 383 // Function that loops over the theta ranges defined by -
trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MHFindSignificanceONOFF.cc
r5329 r6232 132 132 133 133 //----------------------------- 134 // ignore unwanted points 135 if (error > 1.e19) 134 // ignore unwanted points if (error > 1.e19) 136 135 continue; 137 136 … … 373 372 374 373 // allow rebinning of the alpha plot 375 fRebin = kTRUE; 374 // fRebin = kTRUE; 375 376 fRebin = kFALSE; 376 377 377 378 // allow reducing the degree of the polynomial … … 396 397 397 398 fPrintResultsOntoAlphaPlot = kTRUE; 399 //fPrintResultsOntoAlphaPlot = kFALSE; 398 400 399 401 … … 872 874 if (fDraw) 873 875 { 874 875 876 876 // TEMPORALLY I will plot fHistOFF and fHistOFFNormalized (with the fits) 877 877 … … 1046 1046 1047 1047 // count bins with zero entry 1048 if (content <= 0.0) 1049 { 1050 fNzeroOFF++; 1051 // The error of the bin is set to a huge number, 1052 // so that it does not have any weight in the fit 1053 fHistOFF->SetBinError(i, dummy); 1054 } 1048 if (content < 0.0001) 1049 fNzeroOFF++; 1050 1055 1051 // set minimum error 1056 if (content < 9.0) 1052 // modified by K. Mase 1053 if (content < 0.0) 1057 1054 { 1058 1055 fMlowOFF += 1; … … 1081 1078 mean /= ((Double_t) fMbinsOFF); 1082 1079 rms /= ((Double_t) fMbinsOFF); 1083 } 1084 1085 rms = sqrt( rms - mean*mean ); 1080 rms = sqrt( rms - mean*mean ); 1081 } 1082 1083 1086 1084 1087 1085 // if there are no events in the background region … … 1155 1153 1156 1154 fConstantBackg = kFALSE; 1157 1158 // Condition for disabling the fitting procedure and 1159 // assuming a constant background (before Nov 2004) 1160 1161 // if ( fNzeroOFF > 0 || (Double_t)fMlowOFF>0.05*(Double_t)fMbinsOFF ) 1162 1163 1164 // Condition for disabling the fitting procedure and 1165 // assuming a constant background (After Nov 01 2004) 1166 // I softened the condition to allow the fit also in situations 1167 // where the reduction of the background is such that very 1168 // few events survived; which is 1169 // Specially frequent with Random Forest at high Sizes) 1170 1171 if ( (Double_t)fNzeroOFF > 0.1*(Double_t)fMbinsOFF || 1172 (Double_t)fMlowOFF > 0.2*(Double_t)fMbinsOFF ) 1155 if ( fNzeroOFF > 0 || (Double_t)fMlowOFF>0.05*(Double_t)fMbinsOFF ) 1173 1156 { 1174 1157 *fLog << "MHFindSignificanceONOFF::FitPolynomialOFF; polynomial fit not possible, fNzeroOFF, fMlowOFF, fMbinsOFF = " … … 1201 1184 Double_t val, err; 1202 1185 val = mean; 1203 err = rms; // sqrt( mean / (Double_t)fMbinsOFF ); 1186 err = rms; 1187 1204 1188 1205 1189 fPolyOFF->SetParameter(0, val); … … 1571 1555 1572 1556 // count bins with zero entry 1573 if (content <= 0.0) 1574 { 1575 fNzero++; 1576 // The error of the bin is set to a huge number, 1577 // so that it does not have any weight in the fit 1578 fHistOFF->SetBinError(i, dummy); 1579 } 1580 1557 /*if (content <= 0.0) 1558 fNzero++;*/ 1559 1581 1560 // set minimum error 1582 if (content < 9.0)1561 /*if (content < 9.0) 1583 1562 { 1584 1563 fMlow += 1; 1585 1564 fHist->SetBinError(i, 3.0); 1586 } 1565 }*/ 1587 1566 1588 1567 //*fLog << "Take : i, content, error = " << i << ", " … … 1681 1660 1682 1661 fConstantBackg = kFALSE; 1683 1684 // Condition for disabling the fitting procedure and 1685 // assuming a constant background (before Nov 2004) 1686 1687 // if ( fNzero > 0 || (Double_t)fMlow>0.05*(Double_t)fMbins ) 1688 1689 1690 // Condition for disabling the fitting procedure and 1691 // assuming a constant background (After Nov 01 2004) 1692 // I softened the condition to allow the fit also in situations 1693 // where the reduction of the background is such that very 1694 // few events survived; which is 1695 // Specially frequent with Random Forest at high Sizes) 1696 1697 if ( (Double_t)fNzero > 0.1*(Double_t)fMbins || 1698 (Double_t)fMlow > 0.2*(Double_t)fMbins ) 1699 1662 if ( fNzero > 0 || (Double_t)fMlow>0.05*(Double_t)fMbins ) 1700 1663 { 1701 1664 *fLog << "MHFindSignificanceONOFF::FitPolynomial; polynomial fit not possible, fNzero, fMlow, fMbins = " … … 1728 1691 Double_t val, err; 1729 1692 val = mean; 1730 err = rms; //sqrt( mean / (Double_t)fMbins );1693 err = sqrt( mean / (Double_t)fMbins ); 1731 1694 1732 1695 fPoly->SetParameter(0, val); … … 2776 2739 } 2777 2740 sum *= fac*fac; 2778 2741 2779 2742 if (sum < 0.0) 2780 2743 { … … 3231 3194 3232 3195 CanvasHistOFFNormalized -> Update(); 3233 3234 3235 */ 3196 */ 3236 3197 3237 3198 return kTRUE; … … 3292 3253 fpoly->DrawCopy("same"); 3293 3254 } 3255 3256 fHistOFFNormalized->SetLineColor(kRed); 3257 fHistOFFNormalized->DrawCopy("same"); 3258 3294 3259 } 3295 3260 … … 3316 3281 { 3317 3282 // 10, 1 is white and solid 3318 fbackg->SetLineColor( 10);3283 fbackg->SetLineColor(kRed); 3319 3284 fbackg->SetLineStyle(1); 3320 3285 fbackg->SetLineWidth(4); 3321 // fbackg->DrawCopy("same");I do not want to draw it... already too many things.3286 //fbackg->DrawCopy("same"); // I do not want to draw it... already too many things. 3322 3287 } 3323 3288 } … … 3495 3460 // fPsFilenameString 3496 3461 3497 filename += ("AlphaPlot AfterSupercuts.ps");3462 filename += ("AlphaPlot.ps"); 3498 3463 cout << filename << endl; 3499 3464 fCanvas -> SaveAs(filename); -
trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MSupercutsCalcONOFF.cc
r4411 r6232 133 133 fWidthUpperLimit = 0.4; 134 134 135 // Temp upper limit to get rid of triangular events 136 fLog10ConcUpperLimit = -0.35; 137 135 138 fLeakage1UpperLimit = 0.25; 136 139 … … 138 141 139 142 fDistLowerLimit = 0.1; 140 fLengthLowerLimit = 0.0 9;141 fWidthLowerLimit = 0.0 5;143 fLengthLowerLimit = 0.05; // values at October 21th 2004 144 fWidthLowerLimit = 0.03; // values at October 21th 2004 142 145 143 146 … … 237 240 238 241 } 242 243 244 // Function implementing a filter for muon induced images 245 // (Values from Keichi cuts October 18th 2004) 246 247 // Function returns kTRUE if the event does NOT survive the 248 // muon filter. So kTRUE means event MUST be rejected 249 250 251 Bool_t MSupercutsCalcONOFF::MuonFilter (Double_t Size, 252 Double_t Length) 253 { 254 // Parametrization for cut in length. 255 // Event is rejected if 256 // Log10(Length) < k1*(log10(Size)) + k2 (Size<10000photons) 257 // k1 = 0.286; k2 = -1.91 (October 18th 2004) 258 259 // Length < 0.2 deg (Size > 10000) 260 261 262 // Parametrization for cut in Length/Size 263 // Event is rejected if 264 // log10(LenOverSize) < k3*(log10(Size)) + k4 (Size<4000photons) 265 // k3 = -0.780; k4 = -1.71 266 267 268 Double_t LengthUpperLimit = 0.0; 269 Double_t LengthOverSizeUpperLimit = 0.0; 270 271 272 Double_t SizeUpperLimitForCutInLength = 10000; // in photons 273 Double_t SizeUpperLimitForCutInLengthOverSize = 4000; // in photons 274 275 Double_t k1 = 0.286; 276 Double_t k2 = -1.91; 277 Double_t k3 = -0.78; 278 Double_t k4 = -1.71; 279 280 281 282 283 284 if (Size <= SizeUpperLimitForCutInLength) 285 { 286 LengthUpperLimit = k1 * TMath::Log10(Size) + k2; 287 LengthUpperLimit = TMath::Power(10, LengthUpperLimit); 288 } 289 else 290 { 291 LengthUpperLimit = 0.2; 292 } 293 294 // Apply cut in Length 295 296 if (Length < LengthUpperLimit) 297 return kTRUE; 298 299 300 301 if (Size < SizeUpperLimitForCutInLengthOverSize) 302 { 303 LengthOverSizeUpperLimit = k3 * TMath::Log10(Size) + k4; 304 LengthOverSizeUpperLimit = TMath::Power(10, LengthOverSizeUpperLimit); 305 306 if (Length/Size < LengthOverSizeUpperLimit) 307 return kTRUE; 308 } 309 310 311 return kFALSE; 312 313 } 314 315 316 317 318 239 319 240 320 … … 340 420 // ls2: ls^2 341 421 // ct: Cos(ZA.) - Cos(fThetaOffset) 342 // dd2: (DIST- fDistOffset)^2 422 // dd2: DIST^2 - fDistOffset^2 423 424 // lconc: log10CONC 425 343 426 344 427 Double_t limit; … … 488 571 489 572 573 574 // The parametrization of upper cut in CONC is just provisional. 575 // The aim is to get rid of triangular events. 576 // The parametrization is 577 // Log10(Conc)Uppercut = m*(log(Size) - log(SizeOffset)) + b 578 579 580 Double_t log10conc = TMath::Log10(conc); 581 582 490 583 // in the parameterization of the cuts 491 584 // the dist parameter used is the one computed from the source position, … … 508 601 const Double_t asym = asym0 * fMm2Deg; 509 602 510 603 604 // MuuonLikeEvent is a variable which is set 605 // to kFALSE/kTRUE by the filter cuts implemented 606 // in MuonFilter function. If kTRUE, the event 607 // will be rejected. 608 609 // DM: 610 //Bool_t MuonLikeEvent = MuonFilter (size, length); 611 511 612 512 613 // computation of the cut limits … … 524 625 Double_t asymlow = CtsMCut (fSuper->GetAsymLo(), dmls, dmcza, dmls2, dd2); 525 626 526 Double_t concup = CtsMCut (fSuper->GetConcUp(), dmls, dmcza, dmls2, dd2);527 Double_t conclow = CtsMCut (fSuper->GetConcLo(), dmls, dmcza, dmls2, dd2);627 Double_t log10concup = CtsMCut (fSuper->GetConcUp(), dmls, dmcza, dmls2, dd2); 628 Double_t log10conclow = CtsMCut (fSuper->GetConcLo(), dmls, dmcza, dmls2, dd2); 528 629 529 630 Double_t leakageup = CtsMCut (fSuper->GetLeakage1Up(),dmls, dmcza, dmls2, dd2); … … 533 634 Double_t lengthoverwidth = length/width; 534 635 636 637 // Cut in CONC is parametrized 638 535 639 Double_t hadronness = 0.0; 536 640 537 641 538 // If the cut values computed before for Dist, Length and Width exceed the upper limits set 539 // by the user through function MSupercutsCalcONOFF::SetHillasDistLengthWidthUpperLowerLimits, 540 // (or the default values defined in constructor); such cut values are replaced by the 642 // If the cut values computed before for Dist, 643 // Length and Width exceed the upper limits set 644 // by the user through function 645 // MSupercutsCalcONOFF::SetHillasDistLengthWidthUpperLowerLimits, 646 // (or the default values defined in constructor); such cut values 647 // are replaced by the 541 648 // the limit values 542 649 … … 576 683 } 577 684 685 if (log10concup > fLog10ConcUpperLimit) 686 { 687 log10concup = fLog10ConcUpperLimit; 688 } 689 578 690 579 691 if (leakageup > fLeakage1UpperLimit) … … 582 694 } 583 695 584 585 696 586 697 587 698 588 699 // Upper cut in leakage 1 also implemented 589 700 590 591 592 593 701 if (// 594 702 newdist > distup || … … 600 708 leakage > leakageup || 601 709 leakage < leakagelow || 602 lengthoverwidth < fLengthOverWidthUpperLimit 710 lengthoverwidth < fLengthOverWidthUpperLimit || 603 711 // 604 712 //asym < asymup && … … 608 716 //dist > distlow && 609 717 610 //conc < concup &&611 // conc > conclow &&718 log10conc > log10concup 719 // log10conc < log10conclow 612 720 // 721 //log10conc > log10concup || 722 // DM MuonLikeEvent // if KTRUE, event is rejected 613 723 ) 614 724 … … 641 751 ShowerParams[3] = newdist; 642 752 ShowerParams[4] = asym; 643 ShowerParams[5] = conc;753 ShowerParams[5] = log10conc; 644 754 ShowerParams[6] = leakage; 645 755 ShowerParams[7] = theta; … … 666 776 SuperCutParams[6] = asymup; 667 777 SuperCutParams[7] = asymlow; 668 SuperCutParams[8] = concup;669 SuperCutParams[9] = conclow;778 SuperCutParams[8] = log10concup; 779 SuperCutParams[9] = log10conclow; 670 780 SuperCutParams[10] = leakageup; 671 781 SuperCutParams[11] = leakagelow; -
trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MSupercutsCalcONOFF.h
r4411 r6232 94 94 Double_t fWidthUpperLimit; 95 95 96 Double_t fLog10ConcUpperLimit; 97 96 98 Double_t fDistLowerLimit; 97 99 Double_t fLengthLowerLimit; … … 149 151 Double_t widthlow); 150 152 153 // Function implementing a filter for muon induced images 154 // (Keichi cuts October 18th 2004) 155 156 Bool_t MuonFilter (Double_t Size, 157 Double_t Length); 158 159 160 151 161 void InitMapping(MHMatrix *mat); // use quantity ThetaOrig.fVal at theta 152 162 -
trunk/MagicSoft/Mars/mtemp/mmpi/SupercutsONOFFClasses/MTSupercutsApplied.cc
r4411 r6232 130 130 StringVector[6] = ("AsymUp/D"); 131 131 StringVector[7] = ("AsymLow/D"); 132 StringVector[8] = (" ConcUp/D");133 StringVector[9] = (" ConcLow/D");132 StringVector[8] = ("Log10ConcUp/D"); 133 StringVector[9] = ("Log10ConcLow/D"); 134 134 StringVector[10] = ("LeakageUp/D"); 135 135 StringVector[11] = ("LeakageLow/D"); … … 155 155 StringVector2[3] = ("NewDist/D"); 156 156 StringVector2[4] = ("Asym/D"); 157 StringVector2[5] = (" Conc/D");157 StringVector2[5] = ("Log10Conc/D"); 158 158 StringVector2[6] = ("Leakage/D"); 159 159 StringVector2[7] = ("Theta/D"); -
trunk/MagicSoft/Mars/mtemp/mmpi/macros/SuperCutsONOFFMacro.C
r4412 r6232 8 8 gROOT -> Reset(); 9 9 10 void SuperCutsONOFFMacro ()10 void SuperCutsONOFFMacroNew() 11 11 { 12 12 gLog.SetNoColors(); … … 15 15 16 16 // From magicserv01 17 TString ONDataFilename("/.magic/data16a/mazin/data/Mrk421/2004_04_22/4slices/Hillas_20040422_4sl_time_clean/Mrk421_*_HillasON.root");17 // TString ONDataFilename("/.magic/data16a/mazin/data/mcdata/2004_06_30/*HillasON.root"); 18 18 19 TString OFFDataFilename("/.magic/data16a/mazin/data/Mrk421/2004_04_22/4slices/Hillas_20040422_4sl_time_clean/Mrk421_*_HillasOFF.root"); 20 21 22 TString PathForFiles ("/mnt/magicserv01/scratch/David/SillyTestForCommiting_July20_2004/"); 23 24 25 // ********************************************** 19 // TString OFFDataFilename("/.magic/data16a/mazin/data/mcdata/2004_06_30/*HillasOFF.root"); 20 21 // TString ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040914.root"); 22 // TString ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040921.root"); 23 // TString ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_20040922.root"); 24 25 // TString ONDataFilename("/.magic/magicserv01/scratch/Period21/HillasFiles/CrabNebula_2004*.root"); 26 27 //TString ONDataFilename("/.magic/data22a/mazin/HillasParam/Period24/2004_12_18/Crab_40_25_1_AbsHillas.root"); 28 TString ONDataFilename("/.magic/data04a/nadia/Analysis/starfiles/DF/40_25_1/CrabNebula_*_Hillas_Abs.root"); 29 TString OFFDataFilename("/.magic/data04a/nadia/Analysis/starfiles/DF/40_25_1/OffCrab1*Hillas_Abs.root"); 30 //TString ONDataFilename("/.magic/data03a/mazin/results/2004_09_21/CrabNebulaNadiaHillas.root"); 31 //TString OFFDataFilename("/.magic/data03a/mazin/results/2004_09_21/CrabNebulaNadiaHillas.root"); 32 33 34 TString PathForFiles ("/.magic/data03a/mazin/results/Crab/DF/CrabNadia/SuperCuts/Size2000/"); 35 36 // TString PathForFiles ("/.magic/magicserv01/scratch/hbartko/SC/"); // was: Daniel/SuperCuts/Mrk421/2004_04_22/4slices_3520_nc/E800_1200_Opt_MC_Test/ 37 38 39 26 40 // Boolean variables defining the job of the 27 41 // macro 28 // ********************************************** 29 30 31 42 32 43 // Boolean variable that decides wether data is read from files specified above 33 44 // (ON/OFF) or read from already existing Matrices (which are obviously stored … … 36 47 // values must be specified by user. 37 48 38 // kTRUE reads alredy existing matrices, and kFALSE read data and produce matrices. 39 40 Bool_t ReadMatrixFromRootFiles = kTRUE; 49 Bool_t ReadMatrixFromRootFiles = kTRUE; 41 50 42 51 43 // Boolean variable that controls wether to use the 44 // TRAIN sample or not. 45 46 47 Bool_t TrainParams = kTRUE; 48 49 50 51 // Variable that allows the user to skip the optimization on the 52 // train sample. If optimization is skipped (value kTRUE), the 53 // previously optimized supercuts (stored in root file 54 // which is called OptSCParametersONOFFThetaRangeXXXXXmRad.root, and located 55 // in the directory specified by variable PathForFiles) are used 56 // on the train and/or the test sample. 57 58 // If value kFALSE, the cuts are optimized. 52 // Boolean variable that controls the supercuts 53 // optimization using the training sample 59 54 // The optimized cuts will be written in root file 60 55 // located in directory specified before. Name of 61 56 // the root files is created automatically. 62 63 Bool_t SkipOptimization = kTRUE; 64 65 66 67 57 58 Bool_t TrainParams = kTRUE; 59 60 // Variable that allows the user to skip the optimization on the 61 // train sample. If optimization is skipped (value kTRUE), the 62 // previously optimized supercuts (stored in root file) are used 63 // on the train sample. 64 65 Bool_t SkipOptimization = kFALSE; 68 66 69 67 // Boolean variable that allows the user to write the initial parameters 70 68 // into the root file that will be used to store the optimum cuts. 71 // If ApplyInitialParams = kTRUE , the initial 72 // parameters are written into this root file, and they 73 // will be applied to the data (TRAIN/TEST ) 74 // IF NO OPTIMIZATION PROCEDURE IS PERFORMED. 75 76 // If cuts are optimized (ie, variable SkipOptimization = kFALSE), 77 // the cuts applied to the data are the optimized cuts. 69 // If fUseInitialSCParams = kTRUE , parameters are written. 70 // In this way, the initial SC parameters can be applied on the data (train/test) 71 72 // The initial parameters are ONLY written to the root file if 73 // there is NO SC params optimization, i.e., if variable 74 // fSkipOptimization = kTRUE; 78 75 79 // NOTE: be aware that, if ApplyInitialSCParams = kTRUE and 80 // there was a root file with the optimized cuts 76 // NOTE: be aware that, if there was a file with the optimized cuts 81 77 // (previously computed), it will be overwritten with the initial 82 // SC parameters. 83 84 Bool_t ApplyInitialSCParams = kTRUE; 85 86 87 88 // Boolean variable that controls wether to use the 89 // TEST sample or not.90 91 92 Bool_t TestParams = k FALSE;78 // SC parameters. This is something that I WILL HAVE TO CHANGE IN 79 // future. Yet for the time being... 80 81 Bool_t UseInitialSCParams = kTRUE; // was kFALSE 82 83 84 85 // Variable that decides whether the optimized cuts are used 86 // in the test sample. 87 88 Bool_t TestParams = kTRUE; 93 89 94 90 … … 107 103 108 104 // Fraction of ON events used for the training/testing 109 Double_t whichfractiontrain = 0. 999;110 Double_t whichfractiontest = 0. 001;105 Double_t whichfractiontrain = 0.5; 106 Double_t whichfractiontest = 0.5; 111 107 112 108 // Fraction of OFF events used for the training/testing 113 Double_t whichfractiontrainOFF = 0. 999;114 Double_t whichfractiontestOFF = 0. 001;109 Double_t whichfractiontrainOFF = 0.5; 110 Double_t whichfractiontestOFF = 0.5; 115 111 116 112 … … 126 122 // Alpha value (degrees) below which signal is expected 127 123 128 Double_t alphasig = 12;124 Double_t alphasig = 9; 129 125 130 126 // Definition of alpha bkg region (where no signal is expected) … … 135 131 // Definition of the Size range 136 132 137 Double_t SizeLow = 800; 138 Double_t SizeUp = 1200; 139 // Double_t SizeUp = 1000000; 140 133 Double_t SizeLow = 2000; 134 // Double_t SizeUp = 2000; 135 Double_t SizeUp = 1000000; 136 137 Double_t LeakageMax = 0.04; 138 Double_t DistMax = 1.5; 139 Double_t DistMin = 0.1; 141 140 142 141 // Definition of binning of alpha plots … … 167 166 // in the computation of teh dynamical cuts that take place within 168 167 // class MCT1SupercutsCalc 169 Bool_t NotUseTheta = kTRUE; // kTRUE renoves theta from the parameterization of cuts 168 //Bool_t NotUseTheta = kFALSE; // kTRUE removes theta from the parameterization of cuts 169 Bool_t NotUseTheta = kTRUE; // kTRUE removes theta from the parameterization of cuts 170 170 171 171 // Boolean variable used to decide wether to use dynamical cuts or static cuts … … 192 192 // Boolean variable used to decide wether initial parameters are 193 193 // read from ascii file or not. If kTRUE, parameters are retrieved 194 // from ascii file. Otherwise, default parameters from MSupercuts 195 // class are used. 194 // from ascii file. 196 195 197 196 Bool_t ReadInitParamsFromAsciiFile = kTRUE; … … 219 218 // {"../InitialSCParametersSteps/StartingValuesForOptimizationMkn421DynCutsOnSize.txt"}; 220 219 // {"../InitialSCParametersSteps/StartingValuesForOptimizationMkn421DynCutsOnSizeAndDist.txt"}; 221 {"mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt"}; 220 //{"mtemp/mmpi/asciifiles/OptimizedMkn421DynCutsGridWithSelected22pointsMay19.txt"}; 221 //{"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/StartingValuesForSmallSizes1.txt"}; 222 // {"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/SmallSizeRFStartValues.txt"}; 223 {"/home/pcmagic16/mazin/mars/Mars260804/mtemp/mmpi/asciifiles/OptimizedCrabFrom2000_a.txt"}; 224 //{"mtemp/mmpi/asciifiles/VeryGoodDummyValuesWithConcCut.txt"}; 222 225 223 226 … … 244 247 245 248 TArrayD CosThetaRangeVector(2); 246 CosThetaRangeVector[0] = 0.0; 249 CosThetaRangeVector[1] = 0.866; //30 250 //CosThetaRangeVector[1] = 0.74; //42 251 //CosThetaRangeVector[1] = 0.82; //35 252 //CosThetaRangeVector[1] = 0; 247 253 //CosThetaRangeVector[1] = 0.825; 248 254 //CosThetaRangeVector[2] = 0.921; 249 255 //CosThetaRangeVector[3] = 0.961; 250 CosThetaRangeVector[1] = 1.0; 256 CosThetaRangeVector[0] = 0.5; // 60 257 //CosThetaRangeVector[0] = 1; 251 258 252 259 … … 303 310 304 311 FindSupercuts.SetSizeRange(SizeLow, SizeUp); 312 FindSupercuts.SetFilters(LeakageMax, DistMax, DistMin); 313 // FindSupercuts.SetFilters(0.001, 1.5, 0.2); 305 314 306 315 … … 318 327 FindSupercuts.SetTrainParameters(TrainParams); 319 328 FindSupercuts.SetSkipOptimization(SkipOptimization); 320 FindSupercuts.SetUseInitialSCParams( ApplyInitialSCParams);329 FindSupercuts.SetUseInitialSCParams(UseInitialSCParams); 321 330 322 331 FindSupercuts.SetTestParameters(TestParams);
Note:
See TracChangeset
for help on using the changeset viewer.