18 #include <TLorentzVector.h>
20 #include <TParticlePDG.h>
34 size_t index = line.find_first_not_of(
" \t");
36 if (index != std::string::npos) {
37 first = line.at(index);
53 const TLorentzVector& leptonInPrf,
54 const TLorentzVector& photonInPrf) {
55 const TVector3& q = photonInPrf.Vect();
56 const TVector3&
k = leptonInPrf.Vect();
57 const TVector3& Ph = hadronInPrf.Vect();
58 const TVector3& qCrossK = q.Cross(k);
59 const TVector3& qCrossPh = q.Cross(Ph);
61 double qCrossKDotPh = qCrossK.Dot(Ph);
62 if (::fabs(qCrossKDotPh) < 1.0
e-5)
return -999.0;
65 double phi = TMath::ACos(qCrossK.Dot(qCrossPh)
71 phi *= qCrossKDotPh / ::fabs(qCrossKDotPh);
73 return TVector2::Phi_0_2pi(phi);
86 if (other.
a ==
a)
return b < other.
b;
93 const std::string&
name)
const {
94 std::ofstream
file(name.c_str());
95 std::ostringstream oss;
97 file <<
"digraph G {" << std::endl;
98 oss <<
" label = \"Event " <<
event.GetN() <<
"\"';";
99 file << oss.str() << std::endl;
101 std::set<Pair> pairs;
106 std::set<const erhic::ParticleMC*> used;
112 for (
unsigned i(0); i <
event.GetNTracks(); ++i) {
116 pairs.insert(
Pair(parent->
GetIndex(),
event.GetTrack(i)->GetIndex()));
121 for (
unsigned j(0); j <
event.GetTrack(i)->GetNChildren(); ++j) {
123 event.GetTrack(i)->GetChild(j)->GetIndex()));
129 for (std::set<Pair>::const_iterator i = pairs.begin();
135 oss <<
" " << a->
GetIndex() <<
" -> " <<
137 file << oss.str() << std::endl;
139 file <<
"# Node attributes" << std::endl;
141 for (std::set<const erhic::ParticleMC*>::const_iterator i = used.begin();
144 std::string shape(
"ellipse");
145 if ((*i)->GetStatus() == 1) {
148 if ((*i)->GetIndex() < 3) {
152 oss <<
" " << (*i)->GetIndex() <<
" [label=\"" << (*i)->GetIndex() <<
" ";
153 if ((*i)->Id().Info()) {
154 oss << (*i)->Id().Info()->GetName();
156 oss <<
"unknown PDG " << (*i)->Id().Code();
158 oss <<
"\", shape=" << shape <<
"];";
159 file << oss.str() << std::endl;