File indexing completed on 2025-02-23 09:21:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 void SetLeafAddress(TNtuple* ntuple, const char* name, void* address);
0011
0012 void plotDeexcitation()
0013 {
0014 gROOT->Reset();
0015 gStyle->SetPalette(1);
0016 gROOT->SetStyle("Plain");
0017
0018 TCanvas* c1 = new TCanvas ("c1","",20,20,1000,500);
0019 c1->Divide(2,1);
0020
0021
0022
0023
0024
0025 TFile* f = new TFile("dna.root");
0026
0027 TNtuple* ntuple2;
0028 ntuple2 = (TNtuple*)f->Get("track");
0029 bool rowWise2 = true;
0030 TBranch* eventBranch2 = ntuple2->FindBranch("row_wise_branch");
0031 if ( ! eventBranch2 ) rowWise2 = false;
0032
0033
0034 c1->cd(1);
0035 gStyle->SetOptStat(000000);
0036
0037 ntuple2->SetFillStyle(1001);
0038 ntuple2->SetFillColor(2);
0039 ntuple2->Draw("kineticEnergy","kineticEnergy>450&&kineticEnergy<550&&flagParticle==1","B");
0040
0041 gPad->SetLogy();
0042
0043 TText *pt1 = new TText(510,500,"Auger electrons");
0044 pt1->Draw("SAME");
0045
0046
0047 c1->cd(2);
0048 gStyle->SetOptStat(000000);
0049
0050 ntuple2->SetFillStyle(1001);
0051 ntuple2->SetFillColor(4);
0052 ntuple2->Draw("kineticEnergy","flagParticle==0","B");
0053
0054 gPad->SetLogy();
0055
0056 TText *pt2 = new TText(523.1,10,"Fluo. photons");
0057 pt2->Draw("SAME");
0058
0059 }
0060
0061 void SetLeafAddress(TNtuple* ntuple, const char* name, void* address) {
0062 TLeaf* leaf = ntuple->FindLeaf(name);
0063 if ( ! leaf ) {
0064 std::cerr << "Error in <SetLeafAddress>: unknown leaf --> " << name << std::endl;
0065 return;
0066 }
0067 leaf->SetAddress(address);
0068 }