source: trunk/source/processes/hadronic/models/util/src/G4ExcitedString.cc @ 846

Last change on this file since 846 was 819, checked in by garnier, 16 years ago

import all except CVS

File size: 5.4 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27//
28
29// ------------------------------------------------------------
30//      GEANT 4 class implementation file
31//
32//      ---------------- G4ExcitedString ----------------
33//             by Gunter Folger, June 1998.
34//       class for an excited string used by Parton String Models
35// ------------------------------------------------------------
36
37
38// G4ExcitedString
39#include "G4ExcitedString.hh"
40#include <algorithm>
41
42//G4ExcitedString::G4ExcitedString(const G4ExcitedString &right)
43//{}
44
45G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Direction)
46    {
47    thePartons.push_back(Color);
48    thePartons.push_back(AntiColor);
49    thePosition = Color->GetPosition();
50    theDirection = Direction;
51    theTrack=0;
52    }
53
54G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* Gluon,  G4Parton* AntiColor, G4int Direction)
55    {
56    thePartons.push_back(Color);
57    thePartons.push_back(Gluon);
58    thePartons.push_back(AntiColor);
59    thePosition = Color->GetPosition();
60    theDirection = Direction;
61    theTrack=0;
62    }
63
64G4ExcitedString::G4ExcitedString(G4KineticTrack * track)
65{
66        thePosition = track->GetPosition();
67        theTrack= track;
68        theDirection=0;
69}
70
71G4ExcitedString::~G4ExcitedString()
72{
73  std::for_each(thePartons.begin(), thePartons.end(), DeleteParton());
74}
75
76
77//const G4ExcitedString & G4ExcitedString::operator=(const G4ExcitedString &right)
78//{}
79
80
81//int G4ExcitedString::operator==(const G4ExcitedString &right) const
82//{}
83
84//int G4ExcitedString::operator!=(const G4ExcitedString &right) const
85//{}
86
87
88
89// Additional Declarations
90
91
92void G4ExcitedString::Boost(G4ThreeVector& Velocity)
93    {
94    for(unsigned int cParton = 0; cParton < thePartons.size() ; cParton++ )
95        {
96        G4LorentzVector Mom = thePartons[cParton]->Get4Momentum();
97        Mom.boost(Velocity);
98        thePartons[cParton]->Set4Momentum(Mom);
99        }
100    }
101
102//---------------------------------------------------------------------------------
103
104G4Parton* G4ExcitedString::GetColorParton(void) const
105    {
106    G4Parton * start = *(thePartons.begin());
107    G4Parton * end = *(thePartons.end()-1);
108    G4int Encoding = start->GetPDGcode();
109    if (Encoding < -1000 || ((Encoding  < 1000) && (Encoding > 0)))
110        return start;
111    return end; 
112    }
113
114//---------------------------------------------------------------------------------
115
116G4Parton* G4ExcitedString::GetGluon(void) const
117    {
118    return thePartons[1]; 
119    }
120
121//---------------------------------------------------------------------------------
122
123G4Parton* G4ExcitedString::GetGluon(G4int GluonPos) const
124    {
125    return thePartons[1 + GluonPos]; 
126    }
127
128//---------------------------------------------------------------------------------
129
130G4Parton* G4ExcitedString::GetAntiColorParton(void) const
131    {
132    G4Parton * start = *(thePartons.begin());
133    G4Parton * end = *(thePartons.end()-1);
134    G4int Encoding = start->GetPDGcode();
135    if (Encoding < -1000 || ((Encoding  < 1000) && (Encoding > 0)))
136        return end; 
137    return start; 
138    }
139
140//---------------------------------------------------------------------------------
141
142G4bool G4ExcitedString::IsItKinkyString(void) const
143    {
144    return (thePartons.size() > 2);   
145    }
146
147//---------------------------------------------------------------------------------
148
149G4int G4ExcitedString::GetDirection(void) const
150    {
151    return theDirection;   
152    }
153
154//*********************************************************************************
155
156G4Parton* G4ExcitedString::GetLeftParton(void) const
157    {
158    return *thePartons.begin(); 
159    }
160
161//---------------------------------------------------------------------------------
162
163G4Parton* G4ExcitedString::GetRightParton(void) const
164    {
165    return *(thePartons.end()-1); 
166    }
167
168//*********************************************************************************
Note: See TracBrowser for help on using the repository browser.