File: BeamParticleData.cc

package info (click to toggle)
thepeg 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 9,312 kB
  • ctags: 11,509
  • sloc: cpp: 57,129; sh: 11,315; java: 3,212; lisp: 1,402; makefile: 830; ansic: 58; perl: 3
file content (79 lines) | stat: -rw-r--r-- 2,428 bytes parent folder | download
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
// -*- C++ -*-
//
// BeamParticleData.cc is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the BeamParticleData class.
//

#include "BeamParticleData.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Interface/Reference.h"
#include "ThePEG/Interface/ClassDocumentation.h"

using namespace ThePEG;

BeamParticleData::BeamParticleData(long newId, string newPDGName)
  : ParticleData(newId, newPDGName) {}

PDPtr BeamParticleData::
Create(long newId, string newPDGName) {
  return new_ptr(BeamParticleData(newId, newPDGName));
}

PDPair BeamParticleData::
Create(long newId, string newPDGName, string newAntiPDGName) {
  PDPair pap;
  pap.first = new_ptr(BeamParticleData(newId, newPDGName));
  pap.second = new_ptr(BeamParticleData(-newId, newAntiPDGName));
  antiSetup(pap);
  return pap;
}

PDPtr BeamParticleData::pdclone() const {
  return new_ptr(*this);
}

void BeamParticleData::persistentOutput(PersistentOStream & os) const {
  os << thePDF;
}

void BeamParticleData::persistentInput(PersistentIStream & is, int) {
  is >> thePDF;
}

ClassDescription<BeamParticleData> BeamParticleData::initBeamParticleData;

void BeamParticleData::setPDF(PDFPtr pdf) {
  if ( pdf && !pdf->canHandle(tcPDPtr(dynamic_cast<const ParticleData *>(this))) )
    throw BeamParticleWrongPDF(name(), pdf? pdf->name(): string("<NULL>"));
  thePDF = pdf;
}

void BeamParticleData::Init() {

  static ClassDocumentation<BeamParticleData> documentation
    ("There is no documentation for the ThePEG::BeamParticleData class");

  static Reference<BeamParticleData,PDFBase> interfacePDF
    ("PDF",
     "The parton densities for this beam particle.",
     &BeamParticleData::thePDF, false, false, true, true,
     &BeamParticleData::setPDF, 0, 0);

  interfacePDF.rank(15);

}

BeamParticleWrongPDF::BeamParticleWrongPDF(string p, string pdf) {
  theMessage << "The parton density object '" << pdf << "' cannot be used to "
	     << "handle densities of particle '" << p << "'. (Possibly due to "
	     << "the remnant handler assigned to the parton density.)";
  severity(warning);
}