15 gStyle->SetPalette(1);
16 gROOT->SetStyle(
"Plain");
18 TCanvas*
c1 =
new TCanvas (
"c1",
"",20,20,1500,500);
25 TFile*
f =
new TFile(
"dna.root");
28 ntuple = (TNtuple*)f->Get(
"dna");
30 TBranch* eventBranch = ntuple->FindBranch(
"row_wise_branch");
31 if ( ! eventBranch ) rowWise =
false;
36 gStyle->SetOptStat(000000);
39 ntuple->SetFillStyle(1001);
40 ntuple->SetFillColor(2);
41 ntuple->Draw(
"flagProcess",
"",
"B");
44 ntuple->SetFillStyle(1001);
45 ntuple->SetFillColor(3);
46 ntuple->Draw(
"flagProcess",
"flagProcess==12||flagProcess==15||flagProcess==22||flagProcess==32||flagProcess==42||flagProcess==52||flagProcess==62",
"Bsame");
49 ntuple->SetFillStyle(1001);
50 ntuple->SetFillColor(4);
51 ntuple->Draw(
"flagProcess",
"flagProcess==11||flagProcess==21||flagProcess==31||flagProcess==41||flagProcess==51||flagProcess==61||flagProcess==110||flagProcess==210||flagProcess==410||flagProcess==510||flagProcess==710||flagProcess==120||flagProcess==220||flagProcess==420||flagProcess==520||flagProcess==720",
"Bsame");
54 ntuple->SetFillStyle(1001);
55 ntuple->SetFillColor(5);
56 ntuple->Draw(
"flagProcess",
"flagProcess==13||flagProcess==23||flagProcess==33||flagProcess==43||flagProcess==53||flagProcess==63||flagProcess==73||flagProcess==130||flagProcess==230||flagProcess==430||flagProcess==530||flagProcess==730",
"Bsame");
73 ntuple->SetMarkerColor(2);
75 ntuple->Draw(
"x:y:z",
"flagParticle==1");
84 Double_t flagParticle;
89 Double_t totalEnergyDeposit;
93 Double_t kineticEnergy;
100 ntuple->SetBranchAddress(
"flagParticle",&flagParticle);
101 ntuple->SetBranchAddress(
"flagProcess",&flagProcess);
102 ntuple->SetBranchAddress(
"x",&x);
103 ntuple->SetBranchAddress(
"y",&y);
104 ntuple->SetBranchAddress(
"z",&z);
105 ntuple->SetBranchAddress(
"totalEnergyDeposit",&totalEnergyDeposit);
106 ntuple->SetBranchAddress(
"stepLength",&stepLength);
107 ntuple->SetBranchAddress(
"kineticEnergyDifference",&kineticEnergyDifference);
108 ntuple->SetBranchAddress(
"kineticEnergy",&kineticEnergy);
109 ntuple->SetBranchAddress(
"cosTheta",&angle);
110 ntuple->SetBranchAddress(
"eventID",&eventID);
111 ntuple->SetBranchAddress(
"trackID",&trackID);
112 ntuple->SetBranchAddress(
"parentID",&parentID);
113 ntuple->SetBranchAddress(
"stepID",&stepID);
123 SetLeafAddress(ntuple,
"kineticEnergyDifference",&kineticEnergyDifference);
132 TH1F* hsolvE =
new TH1F (
"hsolvE",
"solvE",100,0,2000);
133 TH1F* helastE =
new TH1F (
"helastE",
"elastE",100,0,2000);
134 TH1F* hexcitE =
new TH1F (
"hexcitE",
"excitE",100,0,2000);
135 TH1F* hioniE =
new TH1F (
"hiioniE",
"ioniE",100,0,2000);
136 TH1F* hattE =
new TH1F (
"hattE",
"attE",100,0,2000);
137 TH1F* hvibE =
new TH1F (
"hvibE",
"vibE",100,0,2000);
139 for (Int_t j=0;j<ntuple->GetEntries(); j++)
142 if (flagProcess==10) hsolvE->Fill(x);
143 if (flagProcess==11) helastE->Fill(x);
144 if (flagProcess==12) hexcitE->Fill(x);
145 if (flagProcess==13) hioniE->Fill(x);
146 if (flagProcess==14) hattE->Fill(x);
147 if (flagProcess==15) hvibE->Fill(x);
151 helastE->GetXaxis()->SetTitle(
"x (nm)");
152 helastE->SetLineColor(2);
154 hexcitE->SetLineColor(3);
155 hioniE->SetLineColor(4);
156 hattE->SetLineColor(5);
157 hvibE->SetLineColor(6);
158 hsolvE->SetLineColor(7);
163 hexcitE->Draw(
"SAME");
164 hioniE->Draw(
"SAME");
167 hsolvE->Draw(
"SAME");
171 TLeaf* leaf = ntuple->FindLeaf(name);
173 std::cerr <<
"Error in <SetLeafAddress>: unknown leaf --> " << name << std::endl;
176 leaf->SetAddress(address);
double kineticEnergyDifference
TFile f("microbeam.root")
void SetLeafAddress(TNtuple *ntuple, const char *name, void *address)