a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
ParticleLine.cpp
Go to the documentation of this file.
1/*
2 * ParticleLine.cpp
3 *
4 * Created on: Jan 25, 2012
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 * Copyright 2012 Ben O'Leary
7 *
8 * This file is part of LesHouchesParserClasses, released under the
9 * GNU General Public License. Please see the accompanying
10 * README.LHPC_CPP.txt file for a full list of files, brief documentation
11 * on how to use these classes, and further details on the license.
12 */
13
14#include "LHEF.hpp"
15
16namespace LHPC
17{
18 namespace LHEF
19 {
21 particleCode( (int)BOL::UsefulStuff::notANumber ),
22 initialOrIntermediateOrFinalState( (int)BOL::UsefulStuff::notANumber ),
23 primaryMotherLineNumber( (int)BOL::UsefulStuff::notANumber ),
24 secondaryMotherLineNumber( (int)BOL::UsefulStuff::notANumber ),
25 colorCode( (int)BOL::UsefulStuff::notANumber ),
26 anticolorCode( (int)BOL::UsefulStuff::notANumber ),
27 xMomentum( BOL::UsefulStuff::notANumber ),
28 yMomentum( BOL::UsefulStuff::notANumber ),
29 zMomentum( BOL::UsefulStuff::notANumber ),
30 tMomentum( BOL::UsefulStuff::notANumber ),
31 restMass( BOL::UsefulStuff::notANumber ),
32 properLifetime( BOL::UsefulStuff::notANumber ),
33 twiceSpin( (int)BOL::UsefulStuff::notANumber ),
34 ownLineNumber( (int)BOL::UsefulStuff::notANumber ),
35 primaryMotherLinePointer( NULL ),
36 secondaryMotherLinePointer( NULL ),
37 daughterLines(),
38 lineParser()
39 {
40 // just an initialization list.
41 }
42
44 particleCode( copySource.particleCode ),
45 initialOrIntermediateOrFinalState(
46 copySource.initialOrIntermediateOrFinalState ),
47 primaryMotherLineNumber( copySource.primaryMotherLineNumber ),
48 secondaryMotherLineNumber( copySource.secondaryMotherLineNumber ),
49 colorCode( copySource.colorCode ),
50 anticolorCode( copySource.anticolorCode ),
51 xMomentum( copySource.xMomentum ),
52 yMomentum( copySource.yMomentum ),
53 zMomentum( copySource.zMomentum ),
54 tMomentum( copySource.tMomentum),
55 restMass( copySource.restMass ),
56 properLifetime( copySource.properLifetime ),
57 twiceSpin( copySource.twiceSpin ),
58 ownLineNumber( (int)BOL::UsefulStuff::notANumber ),
59 primaryMotherLinePointer( NULL ),
60 secondaryMotherLinePointer( NULL ),
61 daughterLines(),
62 lineParser()
63 {
64 /* just an initialization list. unfortunately there's no easy way to copy
65 * the mother & daughter pointers. however, that should be taken care of
66 * by the copy constructor of the LhefEvent that is copying its
67 * ParticleLines.
68 */
69 }
70
72 {
73 // does nothing.
74 }
75
76
77 double
78 ParticleLine::IPUP( int const whichComponent ) const
79 {
80 if( 1 == whichComponent )
81 {
82 return getXMomentum();
83 }
84 else if( 2 == whichComponent )
85 {
86 return getYMomentum();
87 }
88 else if( 3 == whichComponent )
89 {
90 return getZMomentum();
91 }
92 else if( 4 == whichComponent )
93 {
94 return getEnergy();
95 }
96 else if( 5 == whichComponent )
97 {
98 return getMass();
99 }
100 else
101 {
103 }
104 }
105
106 bool
107 ParticleLine::recordLine( int const ownLineNumber,
108 std::string const& lineAsString )
109 /* this interprets a string as the data it is meant to correspond to. it
110 * returns false if the wrong number of data were given, & in that case
111 * it sets all its entries to BOL::UsefulStuff::reallyWrongValue. it
112 * returns true if all the entries were filled as expected. this function
113 * also clears daughterLines.
114 */
115 {
116 this->ownLineNumber = ownLineNumber;
117 daughterLines.clear();
120 lineParser.clearEntries();
121 BOL::StringParser::parseByChar( lineAsString,
124 if( 13 != lineParser.getSize() )
125 // if the wrong number of data was given...
126 {
140 return false;
141 }
142 else
143 {
160 return true;
161 }
162 }
163
164 }
165
166}
static std::string const whitespaceChars
static double stringToDouble(std::string const &stringToInterpret)
static int stringToInt(std::string const &stringToInterpret)
static void parseByChar(std::string const &stringToParse, VectorlikeArray< std::string > &destinationArray, std::string const &divisionCharSet=whitespaceChars)
static double const notANumber
Definition: UsefulStuff.hpp:28
BOL::VectorlikeArray< std::string > lineParser
ParticleLine * primaryMotherLinePointer
double getXMomentum() const
double getYMomentum() const
bool recordLine(int const ownLineNumber, std::string const &lineAsString)
double IPUP(int const whichComponent) const
double getZMomentum() const
ParticleLine * secondaryMotherLinePointer
std::vector< ParticleLine * > daughterLines