Changeset 4326 for trunk/MagicSoft
- Timestamp:
- 06/22/04 18:20:04 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4324 r4326 44 44 - upper histogram limit lowered for the better visibility in the 45 45 data check. 46 47 * mcalib/MHCalibrationChargeCam.[h,cc] 48 - adapted Draw for the datacheck 46 49 47 50 -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
r4315 r4326 141 141 #include <TVirtualPad.h> 142 142 #include <TCanvas.h> 143 #include <TStyle.h> 144 #include <TF1.h> 145 #include <TH2D.h> 146 #include <TLine.h> 147 #include <TLatex.h> 148 #include <TLegend.h> 143 149 144 150 ClassImp(MHCalibrationChargeCam); … … 150 156 const Float_t MHCalibrationChargeCam::fgTimeLowerLimit = 1.; 151 157 const Float_t MHCalibrationChargeCam::fgTimeUpperLimit = 2.; 158 const Int_t MHCalibrationChargeCam::gkNumRefColours = 6; 152 159 // -------------------------------------------------------------------------- 153 160 // … … 173 180 SetTimeLowerLimit(); 174 181 SetTimeUpperLimit(); 182 183 gkHiGainInnerRefLines.Set(gkNumRefColours); 184 gkHiGainOuterRefLines.Set(gkNumRefColours); 185 gkLoGainInnerRefLines.Set(gkNumRefColours); 186 gkLoGainOuterRefLines.Set(gkNumRefColours); 187 188 gkHiGainInnerRefLines.AddAt(245. ,0); 189 gkHiGainOuterRefLines.AddAt(217. ,0); 190 gkLoGainInnerRefLines.AddAt(20.8 ,0); 191 gkLoGainOuterRefLines.AddAt(18.9 ,0); 192 193 gkHiGainInnerRefLines.AddAt(323. ,1); 194 gkHiGainOuterRefLines.AddAt(307.5,1); 195 gkLoGainInnerRefLines.AddAt(28.0 ,1); 196 gkLoGainOuterRefLines.AddAt(26.0 ,1); 197 198 gkHiGainInnerRefLines.AddAt(1065.,2); 199 gkHiGainOuterRefLines.AddAt(932. ,2); 200 gkLoGainInnerRefLines.AddAt(121. ,2); 201 gkLoGainOuterRefLines.AddAt(108.3,2); 202 203 gkHiGainInnerRefLines.AddAt(1467.,3); 204 gkHiGainOuterRefLines.AddAt(1405.,3); 205 gkLoGainInnerRefLines.AddAt(200.2,3); 206 gkLoGainOuterRefLines.AddAt(198. ,3); 207 208 gkHiGainInnerRefLines.AddAt(180.,4); 209 gkHiGainOuterRefLines.AddAt(167.,4); 210 gkLoGainInnerRefLines.AddAt(16.5,4); 211 gkLoGainOuterRefLines.AddAt(14.0,4); 212 213 gkHiGainInnerRefLines.AddAt(211.,5); 214 gkHiGainOuterRefLines.AddAt(183.5,5); 215 gkLoGainInnerRefLines.AddAt(13.5,5); 216 gkLoGainOuterRefLines.AddAt(11.,5); 175 217 } 176 218 … … 312 354 MHCalibrationChargePix &hist = (MHCalibrationChargePix&)GetAverageHiGainArea(j); 313 355 314 hist.GetHGausHist()->SetTitle("Summed FADC slices average HiGain Area Idx ");315 356 hist.SetNbins(fAverageNbins); 316 357 hist.SetLast(2.*hist.GetLast()); 317 358 hist.GetHAbsTime()->SetTitle("Absolute Arrival Time average HiGain Area Idx "); 318 359 319 InitHists(hist,fCam->GetAverageBadArea(j),j); 320 360 if (fGeom->InheritsFrom("MGeomCamMagic")) 361 { 362 hist.GetHGausHist()->SetTitle(Form("%s%s%s","Signal averaged on event-by-event basis ", 363 j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: ")); 364 hist.InitBins(); 365 hist.SetEventFrequency(fPulserFrequency); 366 } 367 else 368 { 369 hist.GetHGausHist()->SetTitle("Signal averaged on event-by-event basis High Gain Area Idx "); 370 InitHists(hist,fCam->GetAverageBadArea(j),j); 371 } 321 372 } 322 373 } … … 335 386 MHCalibrationChargePix &hist = (MHCalibrationChargePix&)GetAverageLoGainArea(j); 336 387 337 hist.GetHGausHist()->SetTitle("Summed FADC slices average LoGain Area Idx ");338 388 hist.SetNbins(fAverageNbins); 339 389 hist.GetHAbsTime()->SetTitle("Absolute Arrival Time average LoGain Area Idx "); 340 390 341 InitHists(hist,fCam->GetAverageBadArea(j),j); 342 391 if (fGeom->InheritsFrom("MGeomCamMagic")) 392 { 393 hist.GetHGausHist()->SetTitle(Form("%s%s%s","Signal averaged on event-by-event basis ", 394 j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: ")); 395 hist.InitBins(); 396 hist.SetEventFrequency(fPulserFrequency); 397 } 398 else 399 { 400 hist.GetHGausHist()->SetTitle("Signal averaged on event-by-event basis High Gain Area Idx "); 401 InitHists(hist,fCam->GetAverageBadArea(j),j); 402 } 343 403 } 344 404 } … … 833 893 { 834 894 pad->cd(2*(i+1)-1); 835 GetAverageHiGainArea(i).Draw("datacheck"); 895 MHCalibrationChargePix &hipix = (MHCalibrationChargePix&)GetAverageHiGainArea(i); 896 897 if (i==0) 898 DrawDataCheckPixel(hipix,gkHiGainInnerRefLines); 899 else 900 DrawDataCheckPixel(hipix,gkHiGainOuterRefLines); 901 836 902 pad->cd(2*(i+1)); 837 GetAverageLoGainArea(i).Draw("datacheck"); 903 904 MHCalibrationChargePix &lopix = (MHCalibrationChargePix&)GetAverageLoGainArea(i); 905 906 if (i==0) 907 DrawDataCheckPixel(lopix,gkLoGainInnerRefLines); 908 else 909 DrawDataCheckPixel(lopix,gkLoGainOuterRefLines); 910 838 911 } 839 912 } … … 907 980 } 908 981 982 void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const TArrayF &refline) 983 { 984 985 TVirtualPad *newpad = gPad; 986 newpad->Divide(1,2); 987 newpad->cd(1); 988 989 gPad->SetTicks(); 990 if (!pix.IsEmpty()) 991 gPad->SetLogy(); 992 993 gStyle->SetOptStat(0); 994 995 TH1F *hist = pix.GetHGausHist(); 996 997 998 TH2D *null = new TH2D("Null",hist->GetTitle(),100,pix.GetFirst(),pix.GetLast(), 999 100,0.,hist->GetEntries()/10.); 1000 1001 null->SetDirectory(NULL); 1002 null->SetBit(kCanDelete); 1003 null->GetXaxis()->SetTitle(hist->GetXaxis()->GetTitle()); 1004 null->GetYaxis()->SetTitle(hist->GetYaxis()->GetTitle()); 1005 null->GetXaxis()->CenterTitle(); 1006 null->GetYaxis()->CenterTitle(); 1007 null->Draw(); 1008 hist->Draw("same"); 1009 1010 gStyle->SetOptFit(); 1011 1012 if (pix.GetFGausFit()) 1013 { 1014 pix.GetFGausFit()->SetLineColor(pix.IsGausFitOK() ? kGreen : kRed); 1015 pix.GetFGausFit()->Draw("same"); 1016 } 1017 1018 DisplayRefLines(null,refline); 1019 1020 1021 newpad->cd(2); 1022 gPad->SetTicks(); 1023 1024 pix.DrawEvents(); 1025 return; 1026 1027 } 1028 1029 1030 void MHCalibrationChargeCam::DisplayRefLines(const TH2D *hist, const TArrayF &refline) const 1031 { 1032 1033 TLine *green1 = new TLine(refline.At(0),0.,refline.At(0),hist->GetYaxis()->GetXmax()); 1034 green1->SetBit(kCanDelete); 1035 green1->SetLineColor(kGreen); 1036 green1->SetLineStyle(2); 1037 green1->SetLineWidth(3); 1038 green1->Draw(); 1039 1040 TLine *blue1 = new TLine(refline.At(1),0.,refline.At(1),hist->GetYaxis()->GetXmax()); 1041 blue1->SetBit(kCanDelete); 1042 blue1->SetLineColor(007); 1043 blue1->SetLineStyle(2); 1044 blue1->SetLineWidth(3); 1045 blue1->Draw(); 1046 1047 TLine *blue5 = new TLine(refline.At(2),0.,refline.At(2),hist->GetYaxis()->GetXmax()); 1048 blue5->SetBit(kCanDelete); 1049 blue5->SetLineColor(062); 1050 blue5->SetLineStyle(2); 1051 blue5->SetLineWidth(3); 1052 blue5->Draw(); 1053 1054 TLine *blue10 = new TLine(refline.At(3),0.,refline.At(3),hist->GetYaxis()->GetXmax()); 1055 blue10->SetBit(kCanDelete); 1056 blue10->SetLineColor(004); 1057 blue10->SetLineStyle(2); 1058 blue10->SetLineWidth(3); 1059 blue10->Draw(); 1060 1061 TLine *uv10 = new TLine(refline.At(4),0.,refline.At(4),hist->GetYaxis()->GetXmax()); 1062 uv10->SetBit(kCanDelete); 1063 uv10->SetLineColor(106); 1064 uv10->SetLineStyle(2); 1065 uv10->SetLineWidth(3); 1066 uv10->Draw(); 1067 1068 TLine *ct1 = new TLine(refline.At(5),0.,refline.At(5),hist->GetYaxis()->GetXmax()); 1069 ct1->SetBit(kCanDelete); 1070 ct1->SetLineColor(006); 1071 ct1->SetLineStyle(2); 1072 ct1->SetLineWidth(3); 1073 ct1->Draw(); 1074 1075 TLegend *leg = new TLegend(0.4,0.75,0.7,0.99); 1076 leg->SetBit(kCanDelete); 1077 leg->AddEntry(green1,"1 Led GREEN","l"); 1078 leg->AddEntry(blue1,"1 Led BLUE","l"); 1079 leg->AddEntry(blue5,"5 Leds BLUE","l"); 1080 leg->AddEntry(blue10,"10 Leds BLUE","l"); 1081 leg->AddEntry(uv10,"10 Leds UV","l"); 1082 leg->AddEntry(ct1,"CT1-Pulser","l"); 1083 1084 leg->Draw(); 1085 } -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h
r4315 r4326 6 6 #endif 7 7 8 #ifndef ROOT_TArrayF 9 #include "TArrayF.h" 10 #endif 11 12 class TH2D; 8 13 class MRawEvtData; 9 14 class MExtractedSignalCam; … … 18 23 static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit (now set to: 1.) 19 24 static const Float_t fgTimeUpperLimit; //! Default for fTimeUpperLimit (now set to: 2.) 25 static const Int_t gkNumRefColours; 26 27 TArrayF gkHiGainInnerRefLines; 28 TArrayF gkHiGainOuterRefLines; 29 TArrayF gkLoGainInnerRefLines; 30 TArrayF gkLoGainOuterRefLines; 20 31 21 32 Float_t fTimeLowerLimit; // Limit dist. to first signal slice (in units of FADC slices) … … 37 48 void FinalizeBadPixels(); 38 49 39 40 public: 50 void DrawDataCheckPixel(MHCalibrationChargePix &pix, const TArrayF &refline); 51 void DisplayRefLines(const TH2D *hist, const TArrayF &refline) const; 52 53 public: 41 54 42 55 MHCalibrationChargeCam(const char *name=NULL, const char *title=NULL); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeLoGainPix.cc
r4325 r4326 42 42 const Int_t MHCalibrationChargeLoGainPix::fgChargeNbins = 350; 43 43 const Axis_t MHCalibrationChargeLoGainPix::fgChargeFirst = -0.5; 44 const Axis_t MHCalibrationChargeLoGainPix::fgChargeLast = 249.5;44 const Axis_t MHCalibrationChargeLoGainPix::fgChargeLast = 349.5; 45 45 const Int_t MHCalibrationChargeLoGainPix::fgAbsTimeNbins = 15; 46 46 const Axis_t MHCalibrationChargeLoGainPix::fgAbsTimeFirst = -0.5;
Note:
See TracChangeset
for help on using the changeset viewer.