Skip to content

Commit 5777b47

Browse files
author
Michael Lomnitz
committed
Implementation to read target information and convert it to tree
1 parent be7941b commit 5777b47

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

trunk/utils/ConvertStarlightAsciiToTree.C

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ void ConvertStarlightAsciiToTree(const char* inFileName = "slight.out",
5151
TLorentzVector* parentParticle = new TLorentzVector();
5252
TClonesArray* daughterParticles = new TClonesArray("TLorentzVector");
5353
TLorentzVector* source = new TLorentzVector();
54+
TLorentzVector* target = new TLorentzVector();
5455
Float_t q2, Egamma;
5556

5657
outTree->Branch("Egamma", &Egamma, "Egamma/F");
5758
outTree->Branch("Q2", &q2, "q2/F");
59+
outTree->Branch("Target","TLorentzVector", &target, 32000, -1);
5860
outTree->Branch("source", "TLorentzVector", &source, 32000, -1);
5961
outTree->Branch("parent", "TLorentzVector", &parentParticle, 32000, -1);
6062
outTree->Branch("daughters", "TClonesArray", &daughterParticles, 32000, -1);
@@ -102,6 +104,18 @@ void ConvertStarlightAsciiToTree(const char* inFileName = "slight.out",
102104
assert(label == "GAMMA:");
103105
lineStream.clear();
104106

107+
// read target
108+
if(!getline(inFile, line))
109+
break;
110+
++countLines;
111+
lineStream.str(line);
112+
//cout<<line.c_str()<<endl;
113+
float tpx=0., tpy=0., tpz=0., tE=0.;
114+
assert(lineStream >> label >> tpx >> tpy >> tpz >> tE) ;
115+
assert(label == "TARGET:");
116+
*target = TLorentzVector(tpx, tpy, tpz, tE);
117+
118+
lineStream.clear();
105119
// read source
106120
if(!getline(inFile, line))
107121
break;

0 commit comments

Comments
 (0)