source: trunk/MagicSoft/Mars/mtemp/mpadova/macros/plotnoise.C@ 5831

Last change on this file since 5831 was 5140, checked in by moralejo, 20 years ago
*** empty log message ***
File size: 1.9 KB
Line 
1void plotnoise()
2{
3 // Simple macro to read calibrated pedestal files, from MC and real data, and compare
4 // fluctuations
5
6 gStyle->SetOptStat(kFALSE);
7
8 TChain mc("Events");
9 TChain data("Events");
10
11 // Input files: MC and data files containing calibrated pedestal data, in the form
12 // of MCerPhotEvt containers (as produced by mccalibrate.C)
13
14 mc.Add("/data1/MAGIC/Period016/mcdata/noise/root/electronic_noise.root");
15 data.Add("/data1/MAGIC/Period014/rootdata/2004_03_03/calibrated_20122.root");
16
17 // Warning! Binnings have to be set somehow manually to get
18 // nice display... (due to rounding problems...)
19
20 TH1F* hinnermc = new TH1F("hinnermc","Noise inner",1001, -200.5, 200.5);
21 TH1F* hinnerdata = new TH1F("hinnerdata","Noise inner",500, -200.5, 200.5);
22
23 TH1F* houtermc = new TH1F("houtermc","Noise outer",601, -300.5, 300.5);
24 TH1F* houterdata = new TH1F("houterdata","Noise outer",100, -300.5, 300.5);
25
26 hinnermc->Sumw2();
27 hinnerdata->Sumw2();
28 houtermc->Sumw2();
29 houterdata->Sumw2();
30
31 // The normalizations of y axis (multiplicative factors in 3rd argument of Project)
32 // are for now introduced manually:
33
34 mc.Project("hinnermc", "MCerPhotEvt.fPixels.fPhot", "0.77*(MCerPhotEvt.fPixels.fPixId<397 && MCerPhotEvt.fPixels.fPixId>0 )");
35
36 data.Project("hinnerdata", "MCerPhotEvt.fPixels.fPhot", "(MCerPhotEvt.fPixels.fPixId<397 && MCerPhotEvt.fPixels.fPixId>0 )");
37
38
39 // Same for outer pixels:
40 // mc.Project("houtermc", "MCerPhotEvt.fPixels.fPhot", "1.26*(MCerPhotEvt.fPixels.fPixId>=397)");
41 // data.Project("houterdata", "MCerPhotEvt.fPixels.fPhot", "(MCerPhotEvt.fPixels.fPixId>=397)");
42
43 hinnerdata->DrawCopy("e");
44 hinnermc->SetLineColor(2);
45 hinnermc->SetMarkerColor(2);
46 hinnermc->DrawCopy("e,same");
47
48 // houterdata->DrawCopy("e");
49 // houtermc->SetLineColor(2);
50 // houtermc->SetMarkerColor(2);
51 // houtermc->DrawCopy("e,same");
52
53
54 return;
55}
Note: See TracBrowser for help on using the repository browser.