ROOTPWA
leptoProductionVertex.h
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 leptoproduction vertex
29 // the kinematics is defined by the incoming beam lepton, the
30 // scattered lepton and the target; if the recoil particle is not
31 // specified, elastic scattering is assumed
32 //
33 //
34 // Author List:
35 // Boris Grube TUM (original author)
36 //
37 //
38 //-------------------------------------------------------------------------
39 
40 
41 #ifndef LEPTOPRODUCTIONVERTEX_H
42 #define LEPTOPRODUCTIONVERTEX_H
43 
44 
45 #include <cmath>
46 
47 #include <boost/shared_ptr.hpp>
48 
49 #include "productionVertex.h"
50 
51 
52 class TClonesArray;
53 
54 
55 namespace rpwa {
56 
57 
59  typedef boost::shared_ptr<leptoProductionVertex> leptoProductionVertexPtr;
60 
61 
63 
64  public:
65 
67  const particlePtr& target,
68  const particlePtr& XParticle,
69  const particlePtr& recoil = particlePtr());
71  virtual ~leptoProductionVertex();
72 
75  const bool cloneOutParticles = false) const
77 
78  virtual bool addInParticle (const particlePtr&);
79  virtual bool addOutParticle(const particlePtr&);
80 
81  // production specific accessors
82  virtual const TLorentzVector& referenceLzVec() const { return virtPhoton()->lzVec(); }
83  virtual const particlePtr& XParticle () const { return outParticles()[0]; }
84 
85  virtual std::complex<double> productionAmp() const;
86 
87  virtual void setXFlavorQN();
88 
89  // leptoproduction specific accessors
90  inline const particlePtr& beamLepton () const { return inParticles ()[0]; }
91  inline const particlePtr& target () const { return inParticles ()[1]; }
92  inline const particlePtr& virtPhoton () const { return inParticles ()[2]; }
93  inline const particlePtr& scatteredLepton() const { return outParticles()[2]; }
94  inline const particlePtr& recoil () const { return outParticles()[1]; }
95 
96  inline double beamPol() const { return _longPol; }
97  inline void setBeamPol(const double longPol = 0) { _longPol = longPol; }
98 
99  // leptoproduction kinematic variables
100  inline double Q2 () const { return -virtPhoton()->lzVec().Mag2(); }
101  inline double nu () const { return target()->lzVec() * virtPhoton()->lzVec() / target()->mass(); }
102  inline double y () const;
103  double epsilon() const;
104  inline double delta () const { return (2 * beamLepton()->mass2() / Q2()) * (1 - epsilon()); }
105  inline double xBj () const { return Q2() / (2 * (target()->lzVec() * virtPhoton()->lzVec())); }
106  inline double s () const { return (target()->lzVec() + virtPhoton()->lzVec()).Mag2(); }
107  inline double W () const { return sqrt(s()); }
108  inline double delta(const double epsilon) const { return (2 * beamLepton()->mass2() / Q2()) * (1 - epsilon); }
109 
110  virtual bool initKinematicsData(const TClonesArray& prodKinPartNames);
111  virtual bool readKinematicsData(const TClonesArray& prodKinMomenta);
112 
113  virtual bool revertMomenta();
114 
115  virtual std::ostream& print (std::ostream& out) const;
116  virtual std::ostream& dump (std::ostream& out) const;
117  virtual std::ostream& printPointers(std::ostream& out) const;
118 
119  virtual std::string name() const { return "leptoProductionVertex"; }
120 
121  static bool debug() { return _debug; }
122  static void setDebug(const bool debug = true) { _debug = debug; }
123 
124 
125  protected:
126 
127  virtual leptoProductionVertex* doClone(const bool cloneInParticles,
128  const bool cloneOutParticles) const;
129 
130 
131  private:
132 
133  double _longPol;
134 
138  TVector3 _recoilMomCache;
139  TVector3 _targetMomCache;
140 
141  static bool _debug;
142 
143  };
144 
145 
146  inline
147  double
149  {
150  return (target()->lzVec() * virtPhoton()->lzVec()) / (target()->lzVec() * beamLepton()->lzVec());
151  }
152 
153 
154  inline
157  const particlePtr& target,
158  const particlePtr& XParticle,
159  const particlePtr& recoil = particlePtr())
160  {
161  leptoProductionVertexPtr vert(new leptoProductionVertex(beam, target, XParticle, recoil));
162  return vert;
163  }
164 
165 
166  inline
167  std::ostream&
168  operator <<(std::ostream& out,
169  const leptoProductionVertex& vert)
170  {
171  return vert.print(out);
172  }
173 
174 
175 } // namespace rpwa
176 
177 
178 #endif // LEPTOPRODUCTIONVERTEX_H