StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
combinePIDTable.C
1 void combinePIDTable(){
2 
3 
4  TString eTableName;
5  eTableName +="PiPIDTable.root";
6 
7  TString allTableName;
8  allTableName += "PIDTableP02gd.root";
9 
10  TStringLong cpCMD;
11  cpCMD +="cp ";
12  cpCMD +=eTableName.Data();
13  cpCMD +=" ";
14  cpCMD +=allTableName.Data();
15 
16 
17  // gSystem->Exec("cp electronPIDTable_1.02_.root PIDTableP01he_1.02_.root");
18  gSystem->Exec(cpCMD.Data());
19 
20 
21 
22  //production Tag
23 
24  TObjString* productionTag = new TObjString("P02gd");
25 
26  TFile* table = new TFile (allTableName.Data(),"UPDATE");
27  // table->SetFormat(1);
28 
29  TFile* piFile = new TFile("PiPIDTable.root","R");
30  piFile->cd();
31 
32  TVectorD* piAmp = (TVectorD *) piFile->Get("PiAmp");
33  TVectorD* piCenter = (TVectorD *) piFile->Get("PiCenter");
34  TVectorD* piSigma = (TVectorD *) piFile->Get("PiSigma");
35 
36  TFile* eFile = new TFile("EPIDTable.root","R");
37  eFile->cd();
38 
39  TVectorD* eAmp = (TVectorD *) eFile->Get("EAmp");
40  TVectorD* eCenter = (TVectorD *) eFile->Get("ECenter");
41  TVectorD* eSigma = (TVectorD *) eFile->Get("ESigma");
42 
43 
44  TFile* kFile = new TFile("KPIDTable.root","R");
45  kFile->cd();
46 
47  TVectorD* kAmp = (TVectorD *) kFile->Get("KAmp");
48  TVectorD* kCenter = (TVectorD *) kFile->Get("KCenter");
49  TVectorD* kSigma = (TVectorD *) kFile->Get("KSigma");
50 
51  TFile* pFile = new TFile("PPIDTable.root","R");
52  pFile->cd();
53 
54  TVectorD* pAmp = (TVectorD *) pFile->Get("PAmp");
55  TVectorD* pCenter = (TVectorD *) pFile->Get("PCenter");
56  TVectorD* pSigma = (TVectorD *) pFile->Get("PSigma");
57 
58 
59  table->cd();
60 
61  piAmp->Write("piAmp",TObject::kOverwrite | TObject::kSingleKey);
62  piCenter->Write("piCenter",TObject::kOverwrite | TObject::kSingleKey);
63  piSigma->Write("piSigma",TObject::kOverwrite | TObject::kSingleKey);
64 
65  kAmp->Write("kAmp",TObject::kOverwrite | TObject::kSingleKey);
66  kCenter->Write("kCenter",TObject::kOverwrite | TObject::kSingleKey);
67  kSigma->Write("kSigma",TObject::kOverwrite | TObject::kSingleKey);
68 
69  pAmp->Write("pAmp",TObject::kOverwrite | TObject::kSingleKey);
70  pCenter->Write("pCenter",TObject::kOverwrite | TObject::kSingleKey);
71  pSigma->Write("pSigma",TObject::kOverwrite | TObject::kSingleKey);
72 
73 
74  eAmp->Write("eAmp",TObject::kOverwrite | TObject::kSingleKey);
75  eCenter->Write("eCenter",TObject::kOverwrite | TObject::kSingleKey);
76  eSigma->Write("eSigma",TObject::kOverwrite | TObject::kSingleKey);
77 
78  productionTag->Write("productionTag",TObject::kOverwrite | TObject::kSingleKey);
79 
80  table->Write();
81  table->Close();
82 
83 }