source: branches/Mars_McMismatchStudy/macros/fact/plotBiasOffset.C@ 18066

Last change on this file since 18066 was 15216, checked in by tbretz, 12 years ago
File size: 1.2 KB
Line 
1void plotBiasOffset()
2{
3 PixelMap map;
4 if (!map.Read("/home/fact/operation/FACTmap111030.txt"))
5 return;
6
7 BiasMap bias;
8 if (!bias.Read("/home/fact/operation/GAPDmap_with_spare_module.txt"))
9 return;
10
11 MGeomCamFACT fact;
12
13 MHCamera h1(fact);
14 MHCamera h2(fact);
15 MHCamera h3(fact);
16 MHCamera h4(fact);
17
18 h1.SetName("Vnom [V]");
19 h2.SetName("Voff [V]");
20 h3.SetName("Vnom+Voff [DAC]");
21 h4.SetName("Voff [-0.12V/0.19V]");
22
23 h1.SetAllUsed();
24 h2.SetAllUsed();
25 h3.SetAllUsed();
26 h4.SetAllUsed();
27
28 for (int i=0; i<1440; i++)
29 {
30 // Get entry corresponding to pixel index
31 PixelMapEntry &pix = map.index(i);
32
33 // Get entry corresponding to pixel
34 BiasMapEntry &ch = bias.hv(pix);
35
36 h1.SetBinContent(i+1, ch.Vnom); // Volt
37 h2.SetBinContent(i+1, ch.Voff); // Volt
38 h3.SetBinContent(i+1, (ch.Vnom+ch.Voff)*4096/90.); // DAC counts
39 h4.SetBinContent(i+1, ch.Voff); // Volt
40 }
41
42
43 TCanvas *c = new TCanvas;
44 c->Divide(2,2);
45
46 c->cd(1);
47 h1.DrawCopy();
48
49 c->cd(2);
50 h2.DrawCopy();
51
52 c->cd(3);
53 h3.DrawCopy();
54
55 c->cd(4);
56 h4.SetMinMax(-0.12, 0.19);
57 h4.DrawCopy();
58}
Note: See TracBrowser for help on using the repository browser.