Changeset 2543
- Timestamp:
- 11/20/03 09:13:31 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/macros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/CT1Analysis.C
r2475 r2543 286 286 287 287 288 288 289 // Job E_XX : extended version of E_XX (including flux plots) 289 290 // - select g/h separation method XX … … 297 298 298 299 299 Bool_t JobE_XX = kFALSE; 300 Bool_t JobE_XX = kTRUE; 301 Bool_t CCollArea= kFALSE; // calculate eff. collection areas 300 302 Bool_t OEEst = kFALSE; // optimize energy estimator 301 Bool_t WEX = kFALSE; // update root file ? 302 Bool_t WRobert = kFALSE; // write out Robert's file ? 303 Bool_t WEX = kTRUE; // update root file ? 304 Bool_t WRobert = kTRUE; // write out Robert's file ? 305 303 306 304 307 … … 2527 2530 2528 2531 2529 2530 2532 //--------------------------------------------------------------------- 2531 2533 // Job E_XX … … 2547 2549 2548 2550 gLog << "" << endl; 2549 gLog << "Macro CT1Analysis : JobE_XX, OEEst, WEX = "2551 gLog << "Macro CT1Analysis : JobE_XX, CCollArea, OEEst, WEX = " 2550 2552 << (JobE_XX ? "kTRUE" : "kFALSE") << ", " 2553 << (CCollArea?"kTRUE" : "kFALSE") << ", " 2551 2554 << (OEEst ? "kTRUE" : "kFALSE") << ", " 2552 2555 << (WEX ? "kTRUE" : "kFALSE") << endl; … … 2554 2557 2555 2558 // type of data to be analysed 2556 TString typeData = "ON";2559 //TString typeData = "ON"; 2557 2560 //TString typeData = "OFF"; 2558 //TString typeData = "MC";2561 TString typeData = "MC"; 2559 2562 gLog << "typeData = " << typeData << endl; 2560 2563 … … 2567 2570 // and definition of final selections 2568 2571 2569 TString XX("SC");2570 //TString XX("RF");2572 //TString XX("SC"); 2573 TString XX("RF"); 2571 2574 TString fhadronnessName("Had"); 2572 2575 fhadronnessName += XX; … … 2574 2577 2575 2578 // maximum values of the hadronness, |ALPHA| and DIST 2576 Float_t maxhadronness = 0. 4;2579 Float_t maxhadronness = 0.23; 2577 2580 Float_t maxalpha = 20.0; 2578 2581 Float_t maxdist = 10.0; … … 2638 2641 2639 2642 //==================================================================== 2643 2644 MHMcCT1CollectionArea collarea; 2645 collarea.SetEaxis(MHMcCT1CollectionArea::kLinear); 2646 2647 MParList parlist; 2648 InitBinnings(&parlist); 2649 2650 if (CCollArea) 2651 { 2640 2652 gLog << "-----------------------------------------------" << endl; 2641 2653 gLog << "Start calculation of effective collection areas" << endl; 2642 MParList parlist; 2654 2655 2643 2656 MTaskList tasklist; 2644 2657 … … 2655 2668 MContinue conthadrons(&cuthadrons); 2656 2669 2657 MHMcCT1CollectionArea collarea;2658 collarea.SetEaxis(MHMcCT1CollectionArea::kLinear);2659 2670 2660 2671 MFillH filler("MHMcCT1CollectionArea", "MMcEvt"); … … 2665 2676 2666 2677 parlist.AddToList(&tasklist); 2667 InitBinnings(&parlist); 2678 2668 2679 parlist.AddToList(&collarea); 2669 2680 … … 2697 2708 collarea.CalcEfficiency(); 2698 2709 collarea.DrawClone(); 2710 2711 2712 2713 //--------------------------------------------- 2714 // Write histograms to a file 2715 // 2716 2717 TFile f(collareaName, "RECREATE"); 2718 //collarea.GetHist()->Write(); 2719 //collarea.GetHAll()->Write(); 2720 //collarea.GetHSel()->Write(); 2721 collarea.Write(); 2722 2723 f.Close(); 2724 2725 gLog << "Collection area plots written onto file " << collareaName << endl; 2726 2727 gLog << "Calculation of effective collection areas done" << endl; 2728 gLog << "-----------------------------------------------" << endl; 2729 //------------------------------------------------------------------ 2730 } 2731 2732 if (!CCollArea) 2733 { 2734 gLog << "-----------------------------------------------" << endl; 2735 gLog << "Read in effective collection areas from file " 2736 << collareaName << endl; 2737 2738 TFile collfile(collareaName); 2739 collfile.ls(); 2740 collarea.Read("MHMcCT1CollectionArea"); 2741 collarea.DrawClone(); 2742 2743 gLog << "Effective collection areas were read in from file " 2744 << collareaName << endl; 2745 gLog << "-----------------------------------------------" << endl; 2746 } 2747 2699 2748 2700 2749 // save binnings for call to CT1EEst … … 2712 2761 } 2713 2762 2714 2715 //--------------------------------------------- 2716 // Write histograms to a file 2717 // 2718 2719 TFile f(collareaName, "RECREATE"); 2720 collarea.GetHist()->Write(); 2721 collarea.GetHAll()->Write(); 2722 collarea.GetHSel()->Write(); 2723 f.Close(); 2724 2725 gLog << "Collection area plots written onto file " << collareaName << endl; 2726 2727 gLog << "Calculation of effective collection areas done" << endl; 2728 gLog << "-----------------------------------------------" << endl; 2729 //------------------------------------------------------------------ 2730 2731 2763 //------------------------------------- 2732 2764 TString fHilName = "MHillas"; 2733 2765 TString fHilNameExt = "MHillasExt"; -
trunk/MagicSoft/Mars/macros/ONOFFCT1Analysis.C
r2475 r2543 207 207 208 208 // Job B_RF_UP : read ON1.root (OFF1.root or MC1.root) file 209 // - if CTrainRF = TRUE : create matrices of training events 210 // and root files of training and test events 209 211 // - if RTrainRF = TRUE : read in training matrices for hadrons and gammas 210 // - if CTrainRF = TRUE : create matrices of training events211 212 // - if RTree = TRUE : read in trees, otherwise create trees 212 213 // - calculate hadroness for method of RANDOM FOREST … … 214 215 // or MC2.root) 215 216 216 Bool_t JobB_RF_UP = kFALSE; 217 Bool_t CTrainRF = kFALSE; // create matrices of training events 217 Bool_t JobB_RF_UP = kTRUE; 218 Bool_t CTrainRF = kTRUE; // create matrices of training events 219 // and root files of training and test events 218 220 Bool_t RTrainRF = kFALSE; // read in matrices of training events 219 221 Bool_t RTree = kFALSE; // read in trees (otherwise grow them) … … 268 270 269 271 270 Bool_t JobE_XX = kTRUE; 272 Bool_t JobE_XX = kFALSE; 273 Bool_t CCollArea= kFALSE; // calculate eff. collection areas 271 274 Bool_t OEEst = kFALSE; // optimize energy estimator 272 Bool_t WEX = k TRUE; // update root file ?273 Bool_t WRobert = k TRUE; // write out Robert's file ?275 Bool_t WEX = kFALSE; // update root file ? 276 Bool_t WRobert = kFALSE; // write out Robert's file ? 274 277 275 278 … … 802 805 803 806 //-------------------------------------------- 804 // files to be read for generating the matrices of training events 807 // files to be read for generating 808 // - the matrices of training events 809 // - and the root files of training and test events 810 811 TString typeMatrixHadrons = "OFF"; 812 gLog << "typeMatrixHadrons = " << typeMatrixHadrons << endl; 813 805 814 // "hadrons" : 806 815 TString filenameHad = outPath; 807 filenameHad += "OFF";816 filenameHad += typeMatrixHadrons; 808 817 filenameHad += "1.root"; 809 Int_t howManyHadrons = 1000000; 810 gLog << "filenameHad = " << filenameHad << ", howManyHadrons = " 811 << howManyHadrons << endl; 818 Int_t howManyHadronsTrain = 8000; 819 Int_t howManyHadronsTest = 8000; 820 gLog << "filenameHad = " << filenameHad << ", howManyHadronsTrain = " 821 << howManyHadronsTrain << ", howManyHadronsTest = " 822 << howManyHadronsTest << endl; 812 823 813 824 … … 816 827 filenameMC += "MC"; 817 828 filenameMC += "1.root"; 818 Int_t howManyGammas = 50000; 819 gLog << "filenameMC = " << filenameMC << ", howManyGammas = " 820 << howManyGammas << endl; 829 Int_t howManyGammasTrain = 8000; 830 Int_t howManyGammasTest = 8000; 831 gLog << "filenameMC = " << filenameMC << ", howManyGammasTrain = " 832 << howManyGammasTrain << ", howManyGammasTest = " 833 << howManyGammasTest << endl; 821 834 822 835 //-------------------------------------------- 823 // files of training events836 // files for the matrices of training events 824 837 825 838 TString outNameGammas = outPath; 826 outNameGammas += "RFmatrix_gammas_ ";839 outNameGammas += "RFmatrix_gammas_Train_"; 827 840 outNameGammas += "MC"; 828 841 outNameGammas += ".root"; 829 842 830 TString typeMatrixHadrons = "OFF";831 gLog << "typeMatrixHadrons = " << typeMatrixHadrons << endl;832 833 843 TString outNameHadrons = outPath; 834 outNameHadrons += "RFmatrix_hadrons_ ";844 outNameHadrons += "RFmatrix_hadrons_Train_"; 835 845 outNameHadrons += typeMatrixHadrons; 836 846 outNameHadrons += ".root"; 847 848 849 //-------------------------------------------- 850 // root files for the training events 851 852 TString outNameGammasTrain = outPath; 853 outNameGammasTrain += "RF_gammas_Train_"; 854 outNameGammasTrain += "MC"; 855 outNameGammasTrain += ".root"; 856 857 TString outNameHadronsTrain = outPath; 858 outNameHadronsTrain += "RF_hadrons_Train_"; 859 outNameHadronsTrain += typeMatrixHadrons; 860 outNameHadronsTrain += ".root"; 861 862 863 //-------------------------------------------- 864 // root files for the test events 865 866 TString outNameGammasTest = outPath; 867 outNameGammasTest += "RF_gammas_Test_"; 868 outNameGammasTest += "MC"; 869 outNameGammasTest += ".root"; 870 871 TString outNameHadronsTest = outPath; 872 outNameHadronsTest += "RF_hadrons_Test_"; 873 outNameHadronsTest += typeMatrixHadrons; 874 outNameHadronsTest += ".root"; 875 876 //-------------------------------------------------------------------- 837 877 838 878 … … 908 948 //************************************************************************* 909 949 // create matrices of training events 950 // and root files of training and test events 951 910 952 if (CTrainRF) 911 953 { 912 954 gLog << "" << endl; 913 955 gLog << "========================================================" << endl; 914 gLog << " Create matrices of training events" << endl; 956 gLog << " Create matrices of training events and root files of training and test events" 957 << endl; 915 958 gLog << " Gammas :" << endl; 916 959 gLog << "---------" << endl; 917 960 918 961 MParList plistg; 919 962 MTaskList tlistg; 920 MFilterList flistg; 921 922 MParList plisth;923 M TaskList tlisth;924 MFilterList flisth;963 964 MFilterList flistgtrain; 965 flistgtrain.SetName("GammaFilterTrain"); 966 MFilterList flistgtest; 967 flistgtest.SetName("GammaFilterTest"); 925 968 926 969 MReadMarsFile readg("Events", filenameMC); 927 970 readg.DisableAutoScheme(); 928 971 929 MReadMarsFile readh("Events", filenameHad);930 readh.DisableAutoScheme();931 972 932 973 MFParticleId fgamma("MMcEvt", '=', kGAMMA); 933 974 fgamma.SetName("gammaID"); 934 MFParticleId fhadrons("MMcEvt", '!', kGAMMA);935 fhadrons.SetName("hadronID)");936 975 937 976 TString mgname("costhg"); … … 946 985 947 986 MFEventSelector2 selectorg(gref); 948 selectorg.SetNumMax(howManyGammas); 949 selectorg.SetName("selectGammas"); 987 selectorg.SetNumMax(howManyGammasTrain+howManyGammasTest); 988 selectorg.SetName("selectGammasTrainTest"); 989 990 TString strgtrain = "gRandom->Rndm()*("; 991 strgtrain += howManyGammasTrain; 992 strgtrain += "+"; 993 strgtrain += howManyGammasTest; 994 strgtrain += ")<"; 995 strgtrain += howManyGammasTrain; 996 MF selsplitg(strgtrain); 950 997 951 998 MFillH fillmatg("MatrixGammas"); 952 fillmatg.SetFilter(&flistg );999 fillmatg.SetFilter(&flistgtrain); 953 1000 fillmatg.SetName("fillGammas"); 954 1001 1002 //----------------------- 1003 // for writing the root files of training and test events 1004 // for gammas 1005 1006 MWriteRootFile writetraing(outNameGammasTrain, "RECREATE"); 1007 writetraing.SetName("WriteGammasTrain"); 1008 writetraing.SetFilter(&flistgtrain); 1009 1010 writetraing.AddContainer("MRawRunHeader", "RunHeaders"); 1011 writetraing.AddContainer("MTime", "Events"); 1012 writetraing.AddContainer("MMcEvt", "Events"); 1013 writetraing.AddContainer("ThetaOrig", "Events"); 1014 writetraing.AddContainer("MSrcPosCam", "Events"); 1015 writetraing.AddContainer("MSigmabar", "Events"); 1016 writetraing.AddContainer("MHillas", "Events"); 1017 writetraing.AddContainer("MHillasExt", "Events"); 1018 writetraing.AddContainer("MHillasSrc", "Events"); 1019 writetraing.AddContainer("MNewImagePar", "Events"); 1020 1021 MContinue contg(&flistgtrain); 1022 1023 MWriteRootFile writetestg(outNameGammasTest, "RECREATE"); 1024 writetestg.SetName("WriteGammasTest"); 1025 writetestg.SetFilter(&flistgtest); 1026 1027 writetestg.AddContainer("MRawRunHeader", "RunHeaders"); 1028 writetestg.AddContainer("MTime", "Events"); 1029 writetestg.AddContainer("MMcEvt", "Events"); 1030 writetestg.AddContainer("ThetaOrig", "Events"); 1031 writetestg.AddContainer("MSrcPosCam", "Events"); 1032 writetestg.AddContainer("MSigmabar", "Events"); 1033 writetestg.AddContainer("MHillas", "Events"); 1034 writetestg.AddContainer("MHillasExt", "Events"); 1035 writetestg.AddContainer("MHillasSrc", "Events"); 1036 writetestg.AddContainer("MNewImagePar", "Events"); 1037 1038 //----------------------- 955 1039 956 1040 //***************************** fill gammas *** 957 1041 // entries in MFilterList 958 1042 959 flistg.AddToList(&fgamma); 960 flistg.AddToList(&selectorg); 1043 flistgtrain.AddToList(&fgamma); 1044 flistgtrain.AddToList(&selectorg); 1045 flistgtrain.AddToList(&selsplitg); 1046 1047 flistgtest.AddToList(&fgamma); 1048 flistgtest.AddToList(&selectorg); 1049 flistgtest.AddToList(&selsplitg); 961 1050 962 1051 //***************************** … … 972 1061 973 1062 tlistg.AddToList(&readg); 974 tlistg.AddToList(&flistg); 1063 1064 tlistg.AddToList(&flistgtrain); 975 1065 tlistg.AddToList(&fillmatg); 1066 tlistg.AddToList(&writetraing); 1067 1068 tlistg.AddToList(&contg); 1069 1070 tlistg.AddToList(&flistgtest); 1071 tlistg.AddToList(&writetestg); 976 1072 977 1073 //***************************** … … 990 1086 tlistg.PrintStatistics(0, kTRUE); 991 1087 1088 matrixg.Print("SizeCols"); 1089 Int_t generatedgTrain = matrixg.GetM().GetNrows(); 1090 if ( fabs(generatedgTrain-howManyGammasTrain) > 1091 3.0*sqrt(howManyGammasTrain) ) 1092 { 1093 gLog << "ONOFFCT1Analysis.C : no.of generated gamma training events (" 1094 << generatedgTrain << ") is incompatible with the no.of requested events (" 1095 << howManyGammasTrain << ")" << endl; 1096 } 1097 1098 1099 Int_t generatedgTest = writetestg.GetNumExecutions(); 1100 if ( fabs(generatedgTest-howManyGammasTest) > 1101 3.0*sqrt(howManyGammasTest) ) 1102 { 1103 gLog << "ONOFFCT1Analysis.C : no.of generated gamma test events (" 1104 << generatedgTest << ") is incompatible with the no.of requested events (" 1105 << howManyGammasTest << ")" << endl; 1106 } 992 1107 993 1108 //***************************** fill hadrons *** 994 1109 995 1110 gLog << " Hadrons :" << endl; 1111 gLog << "----------" << endl; 1112 1113 MParList plisth; 1114 MTaskList tlisth; 1115 1116 MFilterList flisthtrain; 1117 flisthtrain.SetName("HadronFilterTrain"); 1118 MFilterList flisthtest; 1119 flisthtest.SetName("HadronFilterTest"); 1120 1121 MReadMarsFile readh("Events", filenameHad); 1122 readh.DisableAutoScheme(); 1123 1124 MFParticleId fhadrons("MMcEvt", '!', kGAMMA); 1125 fhadrons.SetName("hadronID)"); 996 1126 997 1127 TString mhname("costhh"); … … 1006 1136 1007 1137 MFEventSelector2 selectorh(href); 1008 //selectorh.SetNumMax(howManyHadrons); 1009 // select as many hadrons as gammas 1010 selectorh.SetNumMax(matrixg.GetM().GetNrows()); 1011 selectorh.SetName("selectHadrons"); 1138 selectorh.SetNumMax(howManyHadronsTrain+howManyHadronsTest); 1139 selectorh.SetName("selectHadronsTrainTest"); 1140 1141 TString strhtrain = "gRandom->Rndm()*("; 1142 strhtrain += howManyHadronsTrain; 1143 strhtrain += "+"; 1144 strhtrain += howManyHadronsTest; 1145 strhtrain += ")<"; 1146 strhtrain += howManyHadronsTrain; 1147 MF selsplith(strhtrain); 1012 1148 1013 1149 MFillH fillmath("MatrixHadrons"); 1014 fillmath.SetFilter(&flisth );1150 fillmath.SetFilter(&flisthtrain); 1015 1151 fillmath.SetName("fillHadrons"); 1016 1152 1153 //----------------------- 1154 // for writing the root files of training and test events 1155 // for hadrons 1156 1157 MWriteRootFile writetrainh(outNameHadronsTrain, "RECREATE"); 1158 writetrainh.SetName("WriteHadronsTrain"); 1159 writetrainh.SetFilter(&flisthtrain); 1160 1161 writetrainh.AddContainer("MRawRunHeader", "RunHeaders"); 1162 writetrainh.AddContainer("MTime", "Events"); 1163 writetrainh.AddContainer("MMcEvt", "Events"); 1164 writetrainh.AddContainer("ThetaOrig", "Events"); 1165 writetrainh.AddContainer("MSrcPosCam", "Events"); 1166 writetrainh.AddContainer("MSigmabar", "Events"); 1167 writetrainh.AddContainer("MHillas", "Events"); 1168 writetrainh.AddContainer("MHillasExt", "Events"); 1169 writetrainh.AddContainer("MHillasSrc", "Events"); 1170 writetrainh.AddContainer("MNewImagePar", "Events"); 1171 1172 MContinue conth(&flisthtrain); 1173 1174 MWriteRootFile writetesth(outNameHadronsTest, "RECREATE"); 1175 writetesth.SetName("WriteHadronsTest"); 1176 writetesth.SetFilter(&flisthtest); 1177 1178 writetesth.AddContainer("MRawRunHeader", "RunHeaders"); 1179 writetesth.AddContainer("MTime", "Events"); 1180 writetesth.AddContainer("MMcEvt", "Events"); 1181 writetesth.AddContainer("ThetaOrig", "Events"); 1182 writetesth.AddContainer("MSrcPosCam", "Events"); 1183 writetesth.AddContainer("MSigmabar", "Events"); 1184 writetesth.AddContainer("MHillas", "Events"); 1185 writetesth.AddContainer("MHillasExt", "Events"); 1186 writetesth.AddContainer("MHillasSrc", "Events"); 1187 writetesth.AddContainer("MNewImagePar", "Events"); 1188 1189 //----------------------- 1017 1190 1018 1191 // entries in MFilterList 1019 1192 1020 flisth.AddToList(&fhadrons); 1021 flisth.AddToList(&selectorh); 1193 flisthtrain.AddToList(&fhadrons); 1194 flisthtrain.AddToList(&selectorh); 1195 flisthtrain.AddToList(&selsplith); 1196 1197 flisthtest.AddToList(&fhadrons); 1198 flisthtest.AddToList(&selectorh); 1199 flisthtest.AddToList(&selsplith); 1022 1200 1023 1201 //***************************** … … 1033 1211 1034 1212 tlisth.AddToList(&readh); 1035 tlisth.AddToList(&flisth); 1213 1214 tlisth.AddToList(&flisthtrain); 1036 1215 tlisth.AddToList(&fillmath); 1216 tlisth.AddToList(&writetrainh); 1217 1218 tlisth.AddToList(&conth); 1219 1220 tlisth.AddToList(&flisthtest); 1221 tlisth.AddToList(&writetesth); 1037 1222 1038 1223 //***************************** … … 1050 1235 1051 1236 tlisth.PrintStatistics(0, kTRUE); 1237 1238 matrixh.Print("SizeCols"); 1239 Int_t generatedhTrain = matrixh.GetM().GetNrows(); 1240 if ( fabs(generatedhTrain-howManyHadronsTrain) > 1241 3.0*sqrt(howManyHadronsTrain) ) 1242 { 1243 gLog << "ONOFFCT1Analysis.C : no.of generated hadron training events (" 1244 << generatedhTrain << ") is incompatible with the no.of requested events (" 1245 << howManyHadronsTrain << ")" << endl; 1246 } 1247 1248 1249 Int_t generatedhTest = writetesth.GetNumExecutions(); 1250 if ( fabs(generatedhTest-howManyHadronsTest) > 1251 3.0*sqrt(howManyHadronsTest) ) 1252 { 1253 gLog << "ONOFFCT1Analysis.C : no.of generated gamma test events (" 1254 << generatedhTest << ") is incompatible with the no.of requested events (" 1255 << howManyHadronsTest << ")" << endl; 1256 } 1257 1258 1052 1259 //***************************************************** 1053 1260 … … 1204 1411 // end of growing the trees of the random forest 1205 1412 //----------------------------------------------------------------- 1206 1207 1208 1413 1209 1414 … … 2419 2624 2420 2625 gLog << "" << endl; 2421 gLog << "Macro CT1Analysis : JobE_XX, OEEst, WEX = "2626 gLog << "Macro CT1Analysis : JobE_XX, CCollArea, OEEst, WEX = " 2422 2627 << (JobE_XX ? "kTRUE" : "kFALSE") << ", " 2628 << (CCollArea?"kTRUE" : "kFALSE") << ", " 2423 2629 << (OEEst ? "kTRUE" : "kFALSE") << ", " 2424 2630 << (WEX ? "kTRUE" : "kFALSE") << endl; … … 2510 2716 2511 2717 //==================================================================== 2718 2719 MHMcCT1CollectionArea collarea; 2720 collarea.SetEaxis(MHMcCT1CollectionArea::kLinear); 2721 2722 MParList parlist; 2723 InitBinnings(&parlist); 2724 2725 if (CCollArea) 2726 { 2512 2727 gLog << "-----------------------------------------------" << endl; 2513 2728 gLog << "Start calculation of effective collection areas" << endl; 2514 MParList parlist; 2729 2730 2515 2731 MTaskList tasklist; 2516 2732 … … 2527 2743 MContinue conthadrons(&cuthadrons); 2528 2744 2529 MHMcCT1CollectionArea collarea;2530 collarea.SetEaxis(MHMcCT1CollectionArea::kLinear);2531 2745 2532 2746 MFillH filler("MHMcCT1CollectionArea", "MMcEvt"); … … 2537 2751 2538 2752 parlist.AddToList(&tasklist); 2539 InitBinnings(&parlist); 2753 2540 2754 parlist.AddToList(&collarea); 2541 2755 … … 2569 2783 collarea.CalcEfficiency(); 2570 2784 collarea.DrawClone(); 2785 2786 2787 2788 //--------------------------------------------- 2789 // Write histograms to a file 2790 // 2791 2792 TFile f(collareaName, "RECREATE"); 2793 //collarea.GetHist()->Write(); 2794 //collarea.GetHAll()->Write(); 2795 //collarea.GetHSel()->Write(); 2796 collarea.Write(); 2797 2798 f.Close(); 2799 2800 gLog << "Collection area plots written onto file " << collareaName << endl; 2801 2802 gLog << "Calculation of effective collection areas done" << endl; 2803 gLog << "-----------------------------------------------" << endl; 2804 //------------------------------------------------------------------ 2805 } 2806 2807 if (!CCollArea) 2808 { 2809 gLog << "-----------------------------------------------" << endl; 2810 gLog << "Read in effective collection areas from file " 2811 << collareaName << endl; 2812 2813 TFile collfile(collareaName); 2814 collfile.ls(); 2815 collarea.Read("MHMcCT1CollectionArea"); 2816 collarea.DrawClone(); 2817 2818 gLog << "Effective collection areas were read in from file " 2819 << collareaName << endl; 2820 gLog << "-----------------------------------------------" << endl; 2821 } 2822 2571 2823 2572 2824 // save binnings for call to CT1EEst … … 2584 2836 } 2585 2837 2586 2587 //--------------------------------------------- 2588 // Write histograms to a file 2589 // 2590 2591 TFile f(collareaName, "RECREATE"); 2592 collarea.GetHist()->Write(); 2593 collarea.GetHAll()->Write(); 2594 collarea.GetHSel()->Write(); 2595 f.Close(); 2596 2597 gLog << "Collection area plots written onto file " << collareaName << endl; 2598 2599 gLog << "Calculation of effective collection areas done" << endl; 2600 gLog << "-----------------------------------------------" << endl; 2601 //------------------------------------------------------------------ 2602 2603 2838 //------------------------------------- 2604 2839 TString fHilName = "MHillas"; 2605 2840 TString fHilNameExt = "MHillasExt";
Note:
See TracChangeset
for help on using the changeset viewer.