-
Notifications
You must be signed in to change notification settings - Fork 0
/
HepMC2AnalysisProcessor.cc
87 lines (74 loc) · 2.49 KB
/
HepMC2AnalysisProcessor.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "HepMC2AnalysisProcessor.hh"
#include <iostream>
#include <stdexcept>
HepMC2AnalysisProcessor::HepMC2AnalysisProcessor( const std::string & filename ) :
reader( filename ) {}
void HepMC2AnalysisProcessor::runAnalysis( Int_t maxevt ) {
Int_t ievent= 0;
while( reader.GetNextEvent( maxevt ) ) {
const std::vector<TLorentzVector> vtlvisr= reader.GetLorentzVectors( "isr" );
if( reader.MCNonRad() ) {
const std::vector<TLorentzVector> vtlvh= reader.GetLorentzVectors( "hadron" );
std::cout << "HepMC2AnalysisProcessor::runAnalysis: event " << ievent+1 << std::endl;
std::cout << "Hadron level" << std::endl;
TLorentzVector sumh;
for( const TLorentzVector & tlv : vtlvh ) {
std::cout << tlv.Px() << " "
<< tlv.Py() << " "
<< tlv.Pz() << " "
<< tlv.E() << " "
<< tlv.M() << std::endl;
sumh+= tlv;
}
std::cout << "4-vector sum hadron level" << std::endl;
std::cout << sumh.Px() << " "
<< sumh.Py() << " "
<< sumh.Pz() << " "
<< sumh.E() << " "
<< sumh.M() << std::endl;
for( const TLorentzVector & tlv : vtlvisr ) {
sumh+= tlv;
}
std::cout << "4-vector sum hadron level incl isr" << std::endl;
std::cout << sumh.Px() << " "
<< sumh.Py() << " "
<< sumh.Pz() << " "
<< sumh.E() << " "
<< sumh.M() << std::endl;
const std::vector<TLorentzVector> vltvp= reader.GetLorentzVectors( "parton" );
std::cout << "Parton level" << std::endl;
TLorentzVector sump;
for( const TLorentzVector & tlv : vltvp ) {
std::cout << tlv.Px() << " "
<< tlv.Py() << " "
<< tlv.Pz() << " "
<< tlv.E() << " "
<< tlv.M() << std::endl;
sump+= tlv;
}
std::cout << "4-vector sum parton level" << std::endl;
std::cout << sump.Px() << " "
<< sump.Py() << " "
<< sump.Pz() << " "
<< sump.E() << " "
<< sump.M() << std::endl;
for( const TLorentzVector & tlv : vtlvisr ) {
sump+= tlv;
}
std::cout << "4-vector sum parton level incl isr" << std::endl;
std::cout << sumh.Px() << " "
<< sumh.Py() << " "
<< sumh.Pz() << " "
<< sumh.E() << " "
<< sumh.M() << std::endl;
}
else {
std::cout << "HepMC2AnalysisProcessor: MC radiative event " << ievent+1
<< std::endl;
for( const TLorentzVector & tlv : vtlvisr ) tlv.Print();
}
ievent++;
}
std::cout << "HepMC2AnalysisProcessor::runAnalysis: read " << ievent
<< " events" << std::endl;
}