ROOTPWA
diffractiveDissVertex.cc
Go to the documentation of this file.
1 
2 //
3 // Copyright 2010
4 //
5 // This file is part of rootpwa
6 //
7 // rootpwa is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // rootpwa is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with rootpwa. If not, see <http://www.gnu.org/licenses/>.
19 //
21 //-------------------------------------------------------------------------
22 // File and Version Information:
23 // $Rev:: $: revision of last commit
24 // $Author:: $: author of last commit
25 // $Date:: $: date of last commit
26 //
27 // Description:
28 // class that describes production vertex in diffractive
29 // dissociation the beam-Reggeon-X vertex has exactly one
30 // incoming beam and one outgoing particle (X), which
31 // unambiguously defines the Reggeon kinematics; if the target
32 // momentum is not specified, a fixed target is assumed; if the
33 // recoil particle is not specified, elastic scattering is
34 // assumed
35 //
36 //
37 // Author List:
38 // Boris Grube TUM (original author)
39 //
40 //
41 //-------------------------------------------------------------------------
42 
43 
44 #include "TClonesArray.h"
45 #include "TClass.h"
46 #include "TObjString.h"
47 #include "TVector3.h"
48 
49 #include "reportingUtils.hpp"
50 #include "reportingUtilsRoot.hpp"
51 #include "diffractiveDissVertex.h"
52 
53 
54 using namespace std;
55 using namespace rpwa;
56 
57 
58 bool diffractiveDissVertex::_debug = false;
59 
60 
61 diffractiveDissVertex::diffractiveDissVertex(const particlePtr& beam,
62  const particlePtr& target,
63  const particlePtr& XParticle,
64  const particlePtr& recoil)
65  : productionVertex(),
66  _beamMomCache (),
67  _recoilMomCache (),
68  _targetMomCache ()
69 {
70  if (not beam) {
71  printErr << "null pointer to beam particle. aborting." << endl;
72  throw;
73  }
74  if (not target) {
75  printErr << "null pointer to target particle. aborting." << endl;
76  throw;
77  }
78  if (not XParticle) {
79  printErr << "null pointer to particle representing X system. aborting." << endl;
80  throw;
81  }
85  if (recoil)
87  else {
88  if (_debug)
89  printWarn << "recoil not specified. assuming elastic scattering." << endl;
91  }
92  if (_debug)
93  printDebug << "constructed " << *this << endl;
94 }
95 
96 
98 {
99  *this = vert;
100 }
101 
102 
104 { }
105 
106 
109 {
110  if (this != &vert) {
115  }
116  return *this;
117 }
118 
119 
121 diffractiveDissVertex::doClone(const bool cloneInParticles,
122  const bool cloneOutParticles) const
123 {
124  diffractiveDissVertex* vertexClone = new diffractiveDissVertex(*this);
125  if (cloneInParticles)
126  vertexClone->cloneInParticles();
127  if (cloneOutParticles)
128  vertexClone->cloneOutParticles();
129  if (_debug)
130  printDebug << "cloned " << *this << "; " << this << " -> " << vertexClone << " "
131  << ((cloneInParticles ) ? "in" : "ex") << "cluding incoming particles, "
132  << ((cloneOutParticles) ? "in" : "ex") << "cluding outgoing particles" << std::endl;
133  return vertexClone;
134 }
135 
136 
137 bool
139 {
140  if (_debug)
141  printWarn << "cannot add incoming particle to " << *this << endl;
142  return false;
143 }
144 
145 
146 bool
148 {
149  if (_debug)
150  printWarn << "cannot add outgoing particle to " << *this << endl;
151  return false;
152 }
153 
154 
155 complex<double>
157 {
158  return 1;
159 }
160 
161 
162 void
164 {
165  particle& X = *XParticle();
166  particle& beam = *(this->beam());
167  X.setBaryonNmb (beam.baryonNmb());
168  X.setStrangeness(beam.strangeness());
169  X.setCharm (beam.charm());
170  X.setBeauty (beam.beauty());
171 }
172 
173 
174 bool
175 diffractiveDissVertex::initKinematicsData(const TClonesArray& prodKinPartNames)
176 {
177  _nmbProdKinPart = 0;
178 
179  // check production vertex data
180  const string partClassName = prodKinPartNames.GetClass()->GetName();
181  if (partClassName != "TObjString") {
182  printWarn << "production kinematics particle names are of type '" << partClassName
183  << "' and not TObjString." << endl;
184  return false;
185  }
186  _nmbProdKinPart = prodKinPartNames.GetEntriesFast();
187  if (_nmbProdKinPart < 1) {
188  printWarn << "array of production kinematics particle names has wrong size: "
189  << _nmbProdKinPart << ". need at least beam (index 0); recoil (index 1) and "
190  << "target (index 2) are optional." << endl;
191  return false;
192  }
193 
194  // beam at index 0
195  bool success = true;
196  const string beamName = ((TObjString*)prodKinPartNames[0])->GetString().Data();
197  if (beamName != beam()->name()) {
198  printWarn << "wrong particle at index 0 in production kinematics input data: "
199  << "read '" << beamName << "', "
200  << "expected beam particle '" << beam()->name() << "'" << endl;
201  success = false;
202  }
203 
204  // recoil at index 1 (optional)
205  if (_nmbProdKinPart >= 2) {
206  const string recoilName = ((TObjString*)prodKinPartNames[1])->GetString().Data();
207  if (recoilName != recoil()->name()) {
208  printWarn << "wrong particle at index 1 in production kinematics input data: "
209  << "read '" << recoilName << "', "
210  << "expected recoil particle '" << recoil()->name() << "'" << endl;
211  success = false;
212  }
213  }
214 
215  // target at index 2 (optional)
216  if (_nmbProdKinPart >= 3) {
217  const string targetName = ((TObjString*)prodKinPartNames[2])->GetString().Data();
218  if (targetName != target()->name()) {
219  printWarn << "wrong particle at index 2 in production kinematics input data: "
220  << "read '" << targetName << "', "
221  << "expected target particle '" << target()->name() << "'" << endl;
222  success = false;
223  }
224  }
225 
226  return success;
227 }
228 
229 
230 bool
231 diffractiveDissVertex::readKinematicsData(const TClonesArray& prodKinMomenta)
232 {
233  _beamMomCache = TVector3();
234  _recoilMomCache = TVector3();
235  _targetMomCache = TVector3();
236 
237  // check production vertex data
238  const int nmbProdKinMom = prodKinMomenta.GetEntriesFast();
239  if (nmbProdKinMom != _nmbProdKinPart) {
240  printWarn << "array of production kinematics particle momenta has wrong size: "
241  << nmbProdKinMom << " (expected " << _nmbProdKinPart << "). "
242  << "cannot read production kinematics." << endl;
243  return false;
244  }
245 
246  // set beam
247  bool success = true;
248  TVector3* beamMom = dynamic_cast<TVector3*>(prodKinMomenta[0]);
249  if (beamMom) {
250  if (_debug)
251  printDebug << "setting momentum of beam particle '" << beam()->name()
252  << "' to " << *beamMom << " GeV" << endl;
253  beam()->setMomentum(*beamMom);
254  _beamMomCache = beam()->momentum();
255  } else {
256  printWarn << "production kinematics data entry [0] is not of type TVector3. "
257  << "cannot read beam particle momentum." << endl;
258  success = false;
259  }
260 
261  // set recoil (optional)
262  if (_nmbProdKinPart >= 2) {
263  TVector3* recoilMom = dynamic_cast<TVector3*>(prodKinMomenta[1]);
264  if (recoilMom) {
265  if (_debug)
266  printDebug << "setting momentum of recoil particle '" << recoil()->name()
267  << "' to " << *recoilMom << " GeV" << endl;
268  recoil()->setMomentum(*recoilMom);
269  _recoilMomCache = recoil()->momentum();
270  } else {
271  printWarn << "production kinematics data entry [1] is not of type TVector3. "
272  << "cannot read recoil particle momentum." << endl;
273  success = false;
274  }
275  }
276 
277  // set target (optional); if not defined fixed target is assumed
278  if (_nmbProdKinPart >= 3) {
279  TVector3* targetMom = dynamic_cast<TVector3*>(prodKinMomenta[2]);
280  if (targetMom) {
281  if (_debug)
282  printDebug << "setting momentum of target particle '" << target()->name()
283  << "' to " << *targetMom << " GeV" << endl;
284  target()->setMomentum(*targetMom);
285  _targetMomCache = target()->momentum();
286  } else {
287  printWarn << "production kinematics data entry [2] is not of type TVector3. "
288  << "cannot read target particle momentum." << endl;
289  success = false;
290  }
291  }
292 
293  return success;
294 }
295 
296 
297 bool
299 {
300  if (_debug) {
301  printDebug << "resetting beam momentum to " << _beamMomCache << " GeV" << endl
302  << " resetting recoil momentum to " << _recoilMomCache << " GeV" << endl
303  << " resetting target momentum to " << _targetMomCache << " GeV" << endl;
304  }
305  beam ()->setMomentum(_beamMomCache );
306  recoil()->setMomentum(_recoilMomCache);
307  target()->setMomentum(_targetMomCache);
308  return true;
309 }
310 
311 
312 ostream&
313 diffractiveDissVertex::print(ostream& out) const
314 {
315  out << name() << ": beam " << beam()->qnSummary() << " + target " << target()->qnSummary()
316  << " ---> " << XParticle()->qnSummary() << " + recoil " << recoil()->qnSummary();
317  return out;
318 }
319 
320 
321 ostream&
322 diffractiveDissVertex::dump(ostream& out) const
323 {
324  out << name() << ": " << endl
325  << " beam ..... " << *beam() << endl
326  << " target ... " << *target() << endl
327  << " X ........ " << *XParticle() << endl
328  << " recoil ... " << *recoil() << endl;
329  return out;
330 }
331 
332 
333 ostream&
335 {
336  out << name() << " " << this << ": "
337  << "beam particle = " << beam() << "; "
338  << "target particle = " << target() << "; "
339  << "X particle = " << XParticle() << "; "
340  << "recoil particle = " << recoil() << endl;
341  return out;
342 }