Changeset 2255
- Timestamp:
- 07/01/03 10:46:07 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2252 r2255 1 1 -*-*- END OF LINE -*-*- 2 3 4 2003/07/01: Wolfgang Wittek 5 6 * mhist/MHSigmaTheta.cc 7 - change code because GetPixRatio returns area(pixel_zero)/area(pixel) 8 and not area(pixel)/area(pixel_zero) 9 10 * manalysis/MSigmabar.cc 11 MCT1PadSchweizer.cc 12 MCT1PadONOFF.cc 13 - change code because GetPixRatio returns area(pixel_zero)/area(pixel) 14 and not area(pixel)/area(pixel_zero) 15 16 * macros/CT1Analysis.C 17 ONOFFCT1Analysis.C 18 - current versions of CT1 macros 19 20 * macros/unfold.C 21 fluxunfold.C 22 - macros for testing the unfolding within root 23 24 2 25 3 26 2003/06/30: Thomas Bretz … … 752 775 753 776 777 778 754 779 2003/06/09: Wolfgang Wittek 755 780 -
trunk/MagicSoft/Mars/macros/CT1Analysis.C
r2167 r2255 232 232 // - write root file for ON data after final cuts (ON3.root)) 233 233 234 Bool_t JobF_XX = k FALSE;234 Bool_t JobF_XX = kTRUE; 235 235 Bool_t WXX = kFALSE; // write out root file ON3.root ? 236 236 … … 2175 2175 2176 2176 // type of data to be analysed 2177 //TString typeData = "ON";2177 TString typeData = "ON"; 2178 2178 //TString typeData = "OFF"; 2179 TString typeData = "MC";2179 //TString typeData = "MC"; 2180 2180 gLog << "typeData = " << typeData << endl; 2181 2181 … … 2188 2188 2189 2189 //TString XX("NN"); 2190 //TString XX("SC");2191 TString XX("RF");2190 TString XX("SC"); 2191 //TString XX("RF"); 2192 2192 TString fhadronnessName("Had"); 2193 2193 fhadronnessName += XX; … … 2195 2195 2196 2196 // maximum values of the hadronness, |ALPHA| and DIST 2197 Float_t maxhadronness = 0. 20;2197 Float_t maxhadronness = 0.30; 2198 2198 Float_t maxalpha = 20.0; 2199 2199 Float_t maxdist = 10.0; … … 2295 2295 tliston.AddToList(&contfinalgh); 2296 2296 2297 tliston.AddToList(&contfinal);2298 2299 2297 tliston.AddToList(&fillhadnn); 2300 2298 tliston.AddToList(&fillhadsc); … … 2307 2305 tliston.AddToList(&hfill5); 2308 2306 2309 2307 tliston.AddToList(&contfinal); 2310 2308 2311 2309 //***************************** … … 2340 2338 pliston.FindObject("MHNewImagePar")->DrawClone(); 2341 2339 pliston.FindObject("MHStarMap")->DrawClone(); 2340 2341 2342 //------------------------------------------- 2343 // fit alpha distribution to get the number of excess events 2344 // 2345 2346 MHHillasSrc* hillasSrc = 2347 (MHHillasSrc*)(pliston.FindObject("MHHillasSrc")); 2348 TH1F* alphaHist = (TH1F*)(hillasSrc->GetHistAlpha()); 2349 2350 MHOnSubtraction onsub; 2351 onsub.Calc(alphaHist, &pliston, kTRUE, 13.1); 2352 //------------------------------------------- 2353 2342 2354 2343 2355 DeleteBinnings(&pliston); … … 2713 2725 2714 2726 TString typeMC = "MC"; 2715 TString ext = " 2.root";2716 TString extout = " 3.root";2727 TString ext = "3.root"; 2728 TString extout = "4.root"; 2717 2729 2718 2730 //------------------------------ … … 2721 2733 2722 2734 //TString XX("NN"); 2723 TString XX("SC");2724 //TString XX("RF");2735 //TString XX("SC"); 2736 TString XX("RF"); 2725 2737 TString fhadronnessName("Had"); 2726 2738 fhadronnessName += XX; … … 2735 2747 << maxdist << endl; 2736 2748 2749 //------------------------------ 2750 // name of MC file to be used for optimizing the energy estimator 2751 TString filenameOpt(outPath); 2752 filenameOpt += typeMC; 2753 filenameOpt += ext; 2754 gLog << "filenameOpt = " << filenameOpt << endl; 2755 2756 //------------------------------ 2757 // name of file containing the parameters of the energy estimator 2758 TString energyParName(outPath); 2759 energyParName += "energyest_"; 2760 //energyParName += XX; 2761 energyParName += ".root"; 2762 gLog << "energyParName = " << energyParName << endl; 2737 2763 2738 2764 //------------------------------ … … 2740 2766 TString filenameArea(outPath); 2741 2767 filenameArea += typeMC; 2742 filenameArea += "_";2743 filenameArea += XX;2768 //filenameArea += "_"; 2769 //filenameArea += XX; 2744 2770 filenameArea += ext; 2745 2771 gLog << "filenameArea = " << filenameArea << endl; … … 2749 2775 TString collareaName(outPath); 2750 2776 collareaName += "area_"; 2751 collareaName += XX;2777 //collareaName += XX; 2752 2778 collareaName += ".root"; 2753 2779 gLog << "collareaName = " << collareaName << endl; … … 2757 2783 TString filenameData(outPath); 2758 2784 filenameData += typeData; 2759 filenameData += "_";2760 filenameData += XX;2785 //filenameData += "_"; 2786 //filenameData += XX; 2761 2787 filenameData += ext; 2762 2788 gLog << "filenameData = " << filenameData << endl; … … 2766 2792 TString filenameDataout(outPath); 2767 2793 filenameDataout += typeData; 2768 filenameDataout += "_";2769 filenameDataout += XX;2794 //filenameDataout += "_"; 2795 //filenameDataout += XX; 2770 2796 filenameDataout += extout; 2771 2797 gLog << "filenameDataout = " << filenameDataout << endl; … … 2790 2816 MContinue conthadrons(&cuthadrons); 2791 2817 2792 MHMcCT1CollectionArea* collarea = new MHMcCT1CollectionArea(); 2818 //MHMcCT1CollectionArea* collarea = new MHMcCT1CollectionArea(); 2819 //MHMcCT1CollectionArea* collarea; 2793 2820 2794 2821 MFillH filler("MHMcCT1CollectionArea", "MMcEvt"); … … 2800 2827 parlist.AddToList(&tasklist); 2801 2828 InitBinnings(&parlist); 2802 parlist.AddToList(collarea);2829 //parlist.AddToList(collarea); 2803 2830 2804 2831 //******************************** … … 2827 2854 // and display the histograms 2828 2855 // 2829 //MHMcCT1CollectionArea *collarea = parlist.FindObject("MHMcCT1CollectionArea"); 2856 MHMcCT1CollectionArea *collarea = 2857 (MHMcCT1CollectionArea*)parlist.FindObject("MHMcCT1CollectionArea"); 2830 2858 collarea->CalcEfficiency(); 2831 2859 collarea->DrawClone("lego"); … … 2847 2875 2848 2876 2849 //*************************************************************************2850 //2851 // Analyse the data2852 //2853 2854 MTaskList tliston;2855 MParList pliston;2856 2857 // geometry is needed in MHHillas... classes2858 MGeomCam *fGeom =2859 (MGeomCam*)pliston->FindCreateObj("MGeomCamCT1", "MGeomCam");2860 2861 2862 2877 TString fHilName = "MHillas"; 2863 2878 TString fHilNameExt = "MHillasExt"; 2864 2879 TString fHilNameSrc = "MHillasSrc"; 2865 2880 TString fImgParName = "MNewImagePar"; 2881 2882 2883 //=========================================================== 2884 // 2885 // Optimization of energy estimator 2886 // 2887 2888 TString inpath(""); 2889 TString outpath(""); 2890 Int_t howMany = 2000; 2891 CT1EEst(inpath, filenameOpt, outpath, energyParName, 2892 fHilName, fHilNameSrc, fhadronnessName, 2893 howMany, maxhadronness, maxalpha, maxdist); 2894 2895 //----------------------------------------------------------- 2896 // 2897 // Read in parameters of energy estimator ("MMcEnergyEst") 2898 // and migration matrix ("MHMcEnergyMigration") 2899 // 2900 gLog << "================================================================" 2901 << endl; 2902 gLog << "Macro CT1Analysis.C : read parameters of energy estimator and migration matrix from file '" 2903 << energyParName << "'" << endl; 2904 TFile enparam(energyParName); 2905 enparam.ls(); 2906 2907 //MMcEnergyEst mcest("MMcEnergyEst"); 2908 //mcest.Read("MMcEnergyEst"); 2909 MMcEnergyEst &mcest = *((MMcEnergyEst*)gROOT->FindObject("MMcEnergyEst")); 2910 2911 gLog << "Parameters of energy estimator were read in" << endl; 2912 2913 TArrayD parA(5); 2914 TArrayD parB(7); 2915 for (Int_t i=0; i<parA.GetSize(); i++) 2916 parA[i] = mcest.GetCoeff(i); 2917 for (Int_t i=0; i<parB.GetSize(); i++) 2918 parB[i] = mcest.GetCoeff( i+parA.GetSize() ); 2919 2920 gLog << "Read in Migration matrix" << endl; 2921 2922 //MHMcEnergyMigration mighiston("MHMcEnergyMigration"); 2923 //mighiston.Read("MHMcEnergyMigration"); 2924 MHMcEnergyMigration &mighiston = 2925 *((MHMcEnergyMigration*)gROOT->FindObject("MHMcEnergyMigration")); 2926 2927 gLog << "Migration matrix was read in" << endl; 2928 2929 //************************************************************************* 2930 // 2931 // Analyse the data 2932 // 2933 gLog << "============================================================" 2934 << endl; 2935 gLog << "Analyse the data" << endl; 2936 2937 MTaskList tliston; 2938 MParList pliston; 2939 2940 // geometry is needed in MHHillas... classes 2941 MGeomCam *fGeom = 2942 (MGeomCam*)pliston->FindCreateObj("MGeomCamCT1", "MGeomCam"); 2943 2866 2944 2867 2945 //------------------------------------------- … … 2914 2992 fillhadrf.SetName("HhadRF"); 2915 2993 2994 //--------------------------- 2995 // calculate estimated energy 2996 2997 MEnergyEstParam eeston(fHilName); 2998 eeston.Add(fHilNameSrc); 2999 3000 eeston.SetCoeffA(parA); 3001 eeston.SetCoeffB(parB); 3002 //--------------------------- 3003 2916 3004 2917 3005 MFillH hfill1("MHHillas", fHilName); … … 2955 3043 tliston.AddToList(&write); 2956 3044 3045 tliston.AddToList(&eeston); 3046 2957 3047 tliston.AddToList(&fillhadnn); 2958 3048 tliston.AddToList(&fillhadsc); … … 2977 3067 evtloop.SetProgressBar(&bar); 2978 3068 2979 Int_t maxevents = -1;2980 //Int_t maxevents = 10000;3069 //Int_t maxevents = -1; 3070 Int_t maxevents = 10000; 2981 3071 if ( !evtloop.Eventloop(maxevents) ) 2982 3072 return; … … 3010 3100 3011 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 -
trunk/MagicSoft/Mars/macros/ONOFFCT1Analysis.C
r2169 r2255 75 75 gLog << "DeleteBinnings" << endl; 76 76 77 if (!plist) 78 { 79 gLog << "Deletebinnins : MParlist no longer existing" << endl; 80 return; 81 } 82 77 83 TObject *bin; 78 84 … … 113 119 bin = plist->FindObject("BinningDiffsigma2"); 114 120 if (bin) delete bin; 121 122 gLog << "exit DeleteBinnings" << endl; 115 123 } 116 124 … … 134 142 135 143 // path for input for Mars 136 TString inPath = "~magican/ct1test/wittek/marsoutput/option A/";144 TString inPath = "~magican/ct1test/wittek/marsoutput/optionC/"; 137 145 138 146 // path for output from Mars 139 TString outPath = "~magican/ct1test/wittek/marsoutput/option A/";147 TString outPath = "~magican/ct1test/wittek/marsoutput/optionC/"; 140 148 141 149 //----------------------------------------------- … … 153 161 // - write root file for ON (or OFF or MC) data (ON1.root, ...); 154 162 155 Bool_t JobA = k FALSE;156 Bool_t WPad = k FALSE; // write out padding histograms ?163 Bool_t JobA = kTRUE; 164 Bool_t WPad = kTRUE; // write out padding histograms ? 157 165 Bool_t RPad = kFALSE; // read in padding histograms ? 158 166 Bool_t Wout = kFALSE; // write out root file ON1.root … … 203 211 // - make plots 204 212 205 Bool_t JobD = k TRUE;213 Bool_t JobD = kFALSE; 206 214 207 215 … … 2245 2253 2246 2254 MHHillasSrc* hillasSrc = 2247 (MHHillasSrc*)(pliston ->FindObject("MHHillasSrc"));2255 (MHHillasSrc*)(pliston.FindObject("MHHillasSrc")); 2248 2256 TH1F* alphaHist = (TH1F*)(hillasSrc->GetHistAlpha()); 2249 2257 2250 2258 MHOnSubtraction onsub; 2251 onsub.Calc(alphaHist, &pliston, kTRUE, 25);2259 onsub.Calc(alphaHist, &pliston, kTRUE, 13.1); 2252 2260 //------------------------------------------- 2253 2261 -
trunk/MagicSoft/Mars/manalysis/MCT1PadONOFF.cc
r2206 r2255 1401 1401 Int_t j = pix.GetPixId(); 1402 1402 1403 Double_t ratioArea = fCam->GetPixRatio(j); 1403 // GetPixRatio returns (area of pixel 0 / area of current pixel) 1404 Double_t ratioArea = 1.0 / fCam->GetPixRatio(j); 1404 1405 1405 1406 MPedestalPix &ppix = (*fPed)[j]; -
trunk/MagicSoft/Mars/manalysis/MCT1PadSchweizer.cc
r2237 r2255 540 540 Int_t j = pix.GetPixId(); 541 541 542 Double_t ratioArea = fCam->GetPixRatio(j); 542 // GetPixRatio returns (area of pixel 0 / area of current pixel) 543 Double_t ratioArea = 1.0 / fCam->GetPixRatio(j); 543 544 544 545 MPedestalPix &ppix = (*fPed)[j]; -
trunk/MagicSoft/Mars/manalysis/MSigmabar.cc
r2237 r2255 136 136 137 137 const Int_t idx = cerpix.GetPixId(); 138 const Double_t area = geom.GetPixRatio(idx);139 140 138 if (idx == 0) 141 139 { … … 145 143 } 146 144 145 // ratio is the area of pixel 0 146 // divided by the area of the current pixel 147 const Double_t ratio = geom.GetPixRatio(idx); 148 147 149 const MGeomPix &gpix = geom[idx]; 148 150 … … 157 159 continue; 158 160 159 if (area < 1.5) 161 //if (area < 1.5) 162 if (ratio > 0.5) 160 163 { 161 164 innerPixels[sector]++; 162 innerSquaredSum[sector]+= sigma*sigma / area;165 innerSquaredSum[sector]+= sigma*sigma * ratio; 163 166 } 164 167 else 165 168 { 166 169 outerPixels[sector]++; 167 outerSquaredSum[sector]+= sigma*sigma / area;170 outerSquaredSum[sector]+= sigma*sigma * ratio; 168 171 } 169 172 } … … 243 246 244 247 } 248 249 250 251 252 253 254 255 256
Note:
See TracChangeset
for help on using the changeset viewer.