2 DrawXsection(const char* filename="xsec.root",
3 const char* var="LOSS",
4 const char* medName="FMD_Si$",
6 const char* pdgName="pi+")
8 TFile* file = TFile::Open(filename, "READ");
9 TTree* tree = static_cast<TTree*>(file->Get(Form("%s_%s",medName,
11 TLeaf* tb = tree->GetLeaf("T");
12 TLeaf* vb = tree->GetLeaf(var);
14 std::cerr << "Leaf " << var << " not found" << std::endl;
18 tb->SetAddress(&tkine);
19 vb->SetAddress(&value);
20 Int_t n = tree->GetEntries();
22 TDatabasePDG* pdgDb = TDatabasePDG::Instance();
23 TParticlePDG* pdgP = pdgDb->GetParticle(pdgName);
25 std::cerr << "Couldn't find particle " << pdgName << std::endl;
28 // Double_t m = pdgP->Mass();
29 // Double_t q = pdgP->Charge() / 3;
30 // std::cout << q << "\t" << m << std::endl;
32 /// std::cerr << "Mass is 0" << std::endl;
36 TGraph* graph = new TGraph(n);
37 for (Int_t i = 0; i < n; i++) {
39 graph->SetPoint(i, tkine, value*thick); // /(m*q*q)
41 graph->Draw("LP same");
44 //____________________________________________________________________