Changeset 6385
- Timestamp:
- 02/11/05 19:43:08 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r6206 r6385 150 150 #include <TLegend.h> 151 151 #include <TGraph.h> 152 #include <TEnv.h> 152 153 153 154 ClassImp(MHCalibrationChargeCam); … … 174 175 const Float_t MHCalibrationChargeCam::fgTimeLowerLimit = 1.; 175 176 const Float_t MHCalibrationChargeCam::fgTimeUpperLimit = 3.; 176 // 1Led Green, 1 LED blue, 5 LEDs blue, 10 LEDs blue, 10 LEDs UV, CT1, 5Leds Green 177 const Float_t MHCalibrationChargeCam::gkHiGainInnerRefLines[7] = { 245., 323. , 1065., 1467., 258., 211. , 533.5}; 178 const Float_t MHCalibrationChargeCam::gkHiGainOuterRefLines[7] = { 217., 307.5, 932. , 1405., 262.5, 183.5, 405.5}; 179 const Float_t MHCalibrationChargeCam::gkLoGainInnerRefLines[7] = { 20.8, 28.0 , 121. , 200.2, 16.5, 13.5 , 41.7 }; 180 const Float_t MHCalibrationChargeCam::gkLoGainOuterRefLines[7] = { 18.9, 26.0 , 108.3, 198. , 14.0, 11. , 42. }; 177 const TString MHCalibrationChargeCam::fgReferenceFile = "mjobs/calibrationref.rc"; 181 178 // -------------------------------------------------------------------------- 182 179 // … … 242 239 SetAbsHistXTitle(gsAbsHistXTitle.Data()); 243 240 SetAbsHistYTitle(gsAbsHistYTitle.Data()); 241 242 SetReferenceFile(); 243 244 fInnerRefCharge = 278.; 245 fOuterRefCharge = 282.; 244 246 } 245 247 … … 270 272 cam->fLoGainFirst = fLoGainFirst; 271 273 cam->fLoGainLast = fLoGainLast; 274 cam->fReferenceFile = fReferenceFile; 272 275 273 276 // … … 1201 1204 { 1202 1205 MHCalibrationChargePix &lopix = (MHCalibrationChargePix&)GetAverageLoGainArea(i); 1203 DrawDataCheckPixel(lopix,i ? gkLoGainOuterRefLines : gkLoGainInnerRefLines);1206 DrawDataCheckPixel(lopix,i ? fOuterRefCharge : fInnerRefCharge); 1204 1207 } 1205 1208 else 1206 DrawDataCheckPixel(hipix,i ? gkHiGainOuterRefLines : gkHiGainInnerRefLines);1209 DrawDataCheckPixel(hipix,i ? fOuterRefCharge : fInnerRefCharge); 1207 1210 1208 1211 } … … 1217 1220 // Calls the Draw of the fAverageHiGainAreas and fAverageLoGainAreas objects with options 1218 1221 // 1219 void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline [])1222 void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline) 1220 1223 { 1221 1224 … … 1331 1334 1332 1335 1333 void MHCalibrationChargeCam::DisplayRefLines(const TH1F *hist, const Float_t refline []) const1336 void MHCalibrationChargeCam::DisplayRefLines(const TH1F *hist, const Float_t refline) const 1334 1337 { 1335 1338 1336 TGraph *green1 = new TGraph(2);1337 green1->SetPoint(0,refline[0],0.1);1338 green1->SetPoint(1,refline[0],hist->GetMaximum());1339 green1->SetBit(kCanDelete);1340 green1->SetLineColor(kGreen);1341 green1->SetLineStyle(2);1342 green1->SetLineWidth(3);1343 green1->Draw("L");1344 1345 TGraph *green5 = new TGraph(2);1346 green5->SetPoint(0,refline[6],0.1);1347 green5->SetPoint(1,refline[6],hist->GetMaximum());1348 green5->SetBit(kCanDelete);1349 green5->SetLineColor(8);1350 green5->SetLineStyle(2);1351 green5->SetLineWidth(3);1352 green5->Draw("L");1353 1354 TGraph *blue1 = new TGraph(2);1355 blue1->SetPoint(0,refline[1],0.1);1356 blue1->SetPoint(1,refline[1],hist->GetMaximum());1357 blue1->SetBit(kCanDelete);1358 blue1->SetLineColor(227);1359 blue1->SetLineStyle(2);1360 blue1->SetLineWidth(3);1361 blue1->Draw("L");1362 1363 TGraph *blue5 = new TGraph(2);1364 blue5->SetPoint(0,refline[2],0.1);1365 blue5->SetPoint(1,refline[2],hist->GetMaximum());1366 blue5->SetBit(kCanDelete);1367 blue5->SetLineColor(68);1368 blue5->SetLineStyle(2);1369 blue5->SetLineWidth(3);1370 blue5->Draw("L");1371 1372 TGraph *blue10 = new TGraph(2);1373 blue10->SetPoint(0,refline[3],0.1);1374 blue10->SetPoint(1,refline[3],hist->GetMaximum());1375 blue10->SetBit(kCanDelete);1376 blue10->SetLineColor(4);1377 blue10->SetLineStyle(2);1378 blue10->SetLineWidth(3);1379 blue10->Draw("L");1380 1381 1339 TGraph *uv10 = new TGraph(2); 1382 uv10->SetPoint(0,refline [4],0.1);1383 uv10->SetPoint(1,refline [4],hist->GetMaximum());1340 uv10->SetPoint(0,refline,0.1); 1341 uv10->SetPoint(1,refline,hist->GetMaximum()); 1384 1342 uv10->SetBit(kCanDelete); 1385 1343 uv10->SetLineColor(106); … … 1388 1346 uv10->Draw("L"); 1389 1347 1390 TGraph *ct1 = new TGraph(2);1391 ct1->SetPoint(0,refline[5],0.1);1392 ct1->SetPoint(1,refline[5],hist->GetMaximum());1393 ct1->SetBit(kCanDelete);1394 ct1->SetLineColor(6);1395 ct1->SetLineStyle(2);1396 ct1->SetLineWidth(3);1397 ct1->Draw("L");1398 1399 1348 TLegend *leg = new TLegend(0.8,0.35,0.99,0.99); 1400 1349 leg->SetBit(kCanDelete); 1401 leg->AddEntry(green1,"1 Led GREEN","l");1402 leg->AddEntry(green5,"5 Leds GREEN","l");1403 leg->AddEntry(blue1,"1 Led BLUE","l");1404 leg->AddEntry(blue5,"5 Leds BLUE","l");1405 leg->AddEntry(blue10,"10 Leds BLUE","l");1406 1350 leg->AddEntry(uv10,"10 Leds UV","l"); 1407 leg->AddEntry(ct1,"CT1-Pulser","l");1408 1351 1409 1352 leg->Draw(); … … 1466 1409 } 1467 1410 1468 1411 if (IsEnvDefined(env, prefix, "ReferenceFile", print)) 1412 { 1413 SetReferenceFile(GetEnvValue(env,prefix,"ReferenceFile",fReferenceFile.Data())); 1414 rc = kTRUE; 1415 } 1416 1417 TEnv refenv(fReferenceFile); 1418 1419 fInnerRefCharge = refenv.GetValue("InnerRefCharge",fInnerRefCharge); 1420 fOuterRefCharge = refenv.GetValue("OuterRefCharge",fOuterRefCharge); 1421 1469 1422 return rc; 1470 1423 } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h
r5864 r6385 32 32 static const Float_t fgProbLimit; //! The default for fProbLimit (now set to: 0.00001) 33 33 34 static const TString fgReferenceFile; //! default for fReferenceFile ("mjobs/calibrationref.rc") 35 34 36 static const TString gsHistName; //! Default Histogram names 35 37 static const TString gsHistTitle; //! Default Histogram titles … … 37 39 static const TString gsHistYTitle; //! Default Histogram y-axis titles 38 40 39 static const TString gsAbsHistName; //! Default Histogram names abs.times40 static const TString gsAbsHistTitle; //! Default Histogram titles abs.times41 static const TString gsAbsHistXTitle; //! Default Histogram x-axis titles abs.times42 static const TString gsAbsHistYTitle; //! Default Histogram y-axis titles abs.times41 static const TString gsAbsHistName; //! Default Histogram names abs.times 42 static const TString gsAbsHistTitle; //! Default Histogram titles abs.times 43 static const TString gsAbsHistXTitle; //! Default Histogram x-axis titles abs.times 44 static const TString gsAbsHistYTitle; //! Default Histogram y-axis titles abs.times 43 45 44 46 static const Float_t fgNumHiGainSaturationLimit; //! The default for fNumHiGainSaturationLimit (now at: 0.01) … … 48 50 static const Float_t fgTimeUpperLimit; //! Default for fTimeUpperLimit (now set to: 2.) 49 51 50 static const Float_t gkHiGainInnerRefLines[7]; //!51 static const Float_t gkHiGainOuterRefLines[7]; //!52 static const Float_t gkLoGainInnerRefLines[7]; //!53 static const Float_t gkLoGainOuterRefLines[7]; //!54 55 52 Int_t fLoGainNbins; // Number of LoGain bins 56 53 Axis_t fLoGainFirst; // Lower histogram limit low gain … … 62 59 TString fAbsHistYTitle; // Histogram y-axis titles abs. times 63 60 61 TString fReferenceFile; // File name containing the reference values 62 63 Float_t fInnerRefCharge; // The reference mean arrival time inner pixels 64 Float_t fOuterRefCharge; // The reference mean arrival time outer pixels 65 64 66 MArrayD fSumhiarea ; //! 65 67 MArrayD fSumloarea ; //! … … 76 78 MArrayI fSatlosector; //! 77 79 78 Float_t fTimeLowerLimit; // Limit dist. to first signal slice (in units of FADC slices)79 Float_t fTimeUpperLimit; // Limit dist. to last signal slice (in units of FADC slices)80 Byte_t fFirstHiGain; // First used slice High Gain81 Byte_t fLastHiGain; // Last used slice High Gain82 Byte_t fFirstLoGain; // First used slice Low Gain83 Byte_t fLastLoGain; // Last used slice Low Gain80 Float_t fTimeLowerLimit; // Limit dist. to first signal slice (in units of FADC slices) 81 Float_t fTimeUpperLimit; // Limit dist. to last signal slice (in units of FADC slices) 82 Byte_t fFirstHiGain; // First used slice High Gain 83 Byte_t fLastHiGain; // Last used slice High Gain 84 Byte_t fFirstLoGain; // First used slice Low Gain 85 Byte_t fLastLoGain; // Last used slice Low Gain 84 86 85 MRawEvtData *fRawEvt; //! Raw event data87 MRawEvtData *fRawEvt; //! Raw event data 86 88 87 89 Bool_t SetupHists(const MParList *pList); … … 97 99 void FinalizeBadPixels(); 98 100 99 void DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline []);100 void DisplayRefLines ( const TH1F *hist, const Float_t refline []) const;101 void DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline); 102 void DisplayRefLines ( const TH1F *hist, const Float_t refline) const; 101 103 102 104 Int_t ReadEnv ( const TEnv &env, TString prefix, Bool_t print); … … 110 112 TObject *Clone(const char *name="") const; 111 113 112 void SetLoGainNbins ( const Int_t i ) { fLoGainNbins = i; } 113 void SetLoGainFirst ( const Axis_t f ) { fLoGainFirst = f; } 114 void SetLoGainLast ( const Axis_t f ) { fLoGainLast = f; } 114 // Draw 115 void Draw(const Option_t *opt); 115 116 116 void SetTimeLowerLimit ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; } 117 void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; } 117 void SetAbsHistName ( const char *name ) { fAbsHistName = name; } 118 void SetAbsHistTitle ( const char *name ) { fAbsHistTitle = name; } 119 void SetAbsHistXTitle ( const char *name ) { fAbsHistXTitle = name; } 120 void SetAbsHistYTitle ( const char *name ) { fAbsHistYTitle = name; } 121 122 void SetLoGainNbins ( const Int_t i ) { fLoGainNbins = i; } 123 void SetLoGainFirst ( const Axis_t f ) { fLoGainFirst = f; } 124 void SetLoGainLast ( const Axis_t f ) { fLoGainLast = f; } 125 126 void SetReferenceFile ( const TString ref=fgReferenceFile ) { fReferenceFile = ref; } 127 128 void SetTimeLowerLimit( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; } 129 void SetTimeUpperLimit( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; } 118 130 119 void SetAbsHistName ( const char *name ) { fAbsHistName = name; }120 void SetAbsHistTitle ( const char *name ) { fAbsHistTitle = name; }121 void SetAbsHistXTitle( const char *name ) { fAbsHistXTitle = name; }122 void SetAbsHistYTitle( const char *name ) { fAbsHistYTitle = name; }123 124 131 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; } 125 132 void DrawPixelContent( Int_t num ) const; 126 127 // Draw128 void Draw(const Option_t *opt);129 133 130 134 ClassDef(MHCalibrationChargeCam, 1) // Histogram class for Charge Camera Calibration -
trunk/MagicSoft/Mars/mjobs/calibrationref.rc
r6126 r6385 1 InnerRefCharge: 278. 2 OuterRefCharge: 282. 1 3 ConvFADC2PheMin: 0. 2 4 ConvFADC2PheMax: 5.
Note:
See TracChangeset
for help on using the changeset viewer.