diff --git a/Handlers/FixedTargetLuminosity.cc b/Handlers/FixedTargetLuminosity.cc new file mode 100644 --- /dev/null +++ b/Handlers/FixedTargetLuminosity.cc @@ -0,0 +1,91 @@ +// -*- C++ -*- +// +// This is the implementation of the non-inlined, non-templated member +// functions of the FixedTargetLuminosity class. +// + +#include "FixedTargetLuminosity.h" +#include "ThePEG/Interface/ClassDocumentation.h" +#include "ThePEG/Interface/Reference.h" +#include "ThePEG/EventRecord/Particle.h" +#include "ThePEG/Repository/UseRandom.h" +#include "ThePEG/Repository/EventGenerator.h" +#include "ThePEG/Utilities/DescribeClass.h" + + +#include "ThePEG/Persistency/PersistentOStream.h" +#include "ThePEG/Persistency/PersistentIStream.h" + +using namespace ThePEG; + +FixedTargetLuminosity::FixedTargetLuminosity() {} + +FixedTargetLuminosity::~FixedTargetLuminosity() {} + +IBPtr FixedTargetLuminosity::clone() const { + return new_ptr(*this); +} + +IBPtr FixedTargetLuminosity::fullclone() const { + return new_ptr(*this); +} + +void FixedTargetLuminosity::persistentOutput(PersistentOStream & os) const { + os << beam_ << target_ << ounit(ecms_,GeV) << beta_; +} + +void FixedTargetLuminosity::persistentInput(PersistentIStream & is, int) { + is >> beam_ >> target_ >> iunit(ecms_,GeV) >> beta_; +} + +// The following static variable is needed for the type +// description system in ThePEG. +DescribeClass +describeThePEGFixedTargetLuminosity("ThePEG::FixedTargetLuminosity", + "FixedTargetLuminosity.so"); + +void FixedTargetLuminosity::Init() { + + static ClassDocumentation documentation + ("The FixedTargetLuminosity class implements the luminosity for" + "fixed target collisions"); + + static Reference interfaceTargetParticle + ("TargetParticle", + "The target particle", + &FixedTargetLuminosity::target_, false, false, true, false, false); + + static Reference interfaceBeamParticle + ("BeamParticle", + "The beam particle", + &FixedTargetLuminosity::beam_, false, false, true, false, false); + +} + +bool FixedTargetLuminosity::canHandle(const cPDPair & pdpair) const { + return pdpair.first==beam_ && pdpair.second==target_; +} + +Energy FixedTargetLuminosity::maximumCMEnergy() const { + return ecms_; +} + +LorentzRotation FixedTargetLuminosity::getBoost() const { + return LorentzRotation(0.0, 0.0, beta_); +} + +double FixedTargetLuminosity::Y() const { + Energy en = beamEMaxA()+target_->mass(); + Energy pp = sqrt(sqr(beamEMaxA())+sqr(beam_->mass())); + return 0.5*log((en+pp)/(en-pp)); +} + +void FixedTargetLuminosity::doinit() { + Energy2 m12 = sqr(beam_ ->mass()); + Energy2 m22 = sqr(target_->mass()); + Energy2 Em2 = beamEMaxA()*target_->mass(); + Energy2 p2 = (sqr(Em2)-m12*m22)/(2.*Em2+m12+m22); + beta_ = sqrt(p2/(p2+m22)); + ecms_ = sqrt(2.*Em2+m12+m22); + LuminosityFunction::doinit(); +} diff --git a/Handlers/FixedTargetLuminosity.h b/Handlers/FixedTargetLuminosity.h new file mode 100644 --- /dev/null +++ b/Handlers/FixedTargetLuminosity.h @@ -0,0 +1,152 @@ +// -*- C++ -*- +#ifndef ThePEG_FixedTargetLuminosity_H +#define ThePEG_FixedTargetLuminosity_H +// +// This is the declaration of the FixedTargetLuminosity class. +// + +#include "LuminosityFunction.h" + +namespace ThePEG { + +/** + * Here is the documentation of the FixedTargetLuminosity class. + * + * @see \ref FixedTargetLuminosityInterfaces "The interfaces" + * defined for FixedTargetLuminosity. + */ +class FixedTargetLuminosity: public LuminosityFunction { + +public: + + /** @name Standard constructors and destructors. */ + //@{ + /** + * The default constructor. + */ + FixedTargetLuminosity(); + + /** + * The destructor. + */ + virtual ~FixedTargetLuminosity(); + //@} + + /** @name Virtual functions to be overridden by sub-classes. */ + //@{ + /** + * Return true if this luminosity function can actually handle a + * given pair of incoming particles. + */ + virtual bool canHandle(const cPDPair &) const; + + /** + * Return the maximum possible center of mass energy for an event. + */ + virtual Energy maximumCMEnergy() const; + + /** + * Return the rotation needed to transform from the collision cm + * system to the labotatory system. This default version returns the + * unit transformation. + */ + virtual LorentzRotation getBoost() const; + + /** + * Return the rapidity of the colliding particles (at the maximum + * energy) in the laboratory system. This default version assumes + * the CM system is the same as the lab system and returns zero. + */ + virtual double Y() const; + //@} + +public: + + /** @name Functions used by the persistent I/O system. */ + //@{ + /** + * Function used to write out object persistently. + * @param os the persistent output stream written to. + */ + void persistentOutput(PersistentOStream & os) const; + + /** + * Function used to read in object persistently. + * @param is the persistent input stream read from. + * @param version the version number of the object when written. + */ + void persistentInput(PersistentIStream & is, int version); + //@} + + /** + * The standard Init function used to initialize the interfaces. + * Called exactly once for each class by the class description system + * before the main function starts or + * when this class is dynamically loaded. + */ + static void Init(); + +protected: + + /** @name Clone Methods. */ + //@{ + /** + * Make a simple clone of this object. + * @return a pointer to the new object. + */ + virtual IBPtr clone() const; + + /** Make a clone of this object, possibly modifying the cloned object + * to make it sane. + * @return a pointer to the new object. + */ + virtual IBPtr fullclone() const; + //@} +protected: + + /** @name Standard Interfaced functions. */ + //@{ + /** + * Initialize this object after the setup phase before saving an + * EventGenerator to disk. + * @throws InitException if object could not be initialized properly. + */ + virtual void doinit(); + //@} + +private: + + /** + * The assignment operator is private and must never be called. + * In fact, it should not even be implemented. + */ + FixedTargetLuminosity & operator=(const FixedTargetLuminosity &); + +private: + + /** + * The beam particle + */ + PDPtr beam_; + + /** + * The target particle + */ + PDPtr target_; + + /** + * CMS energy + */ + Energy ecms_; + + /** + * Boost + */ + double beta_; + + +}; + +} + +#endif /* ThePEG_FixedTargetLuminosity_H */ diff --git a/Handlers/Makefile.am b/Handlers/Makefile.am --- a/Handlers/Makefile.am +++ b/Handlers/Makefile.am @@ -1,64 +1,69 @@ mySOURCES = EventHandler.cc SubProcessHandler.cc \ HandlerGroup.cc Hint.cc XComb.cc AnalysisHandler.cc \ CascadeHandler.cc MultipleInteractionHandler.cc DecayHandler.cc \ EventManipulator.cc StepHandler.cc HadronizationHandler.cc \ HandlerBase.cc \ FlavourGenerator.cc LuminosityFunction.cc \ StandardEventHandler.cc \ SamplerBase.cc ClusterCollapser.cc \ PtGenerator.cc ZGenerator.cc \ StandardXComb.cc StdXCombGroup.cc DOCFILES = AnalysisHandler.h CascadeHandler.h \ DecayHandler.h EventHandler.h EventManipulator.h \ FlavourGenerator.h HadronizationHandler.h \ HandlerBase.h HandlerGroup.h Hint.h \ LuminosityFunction.h \ MultipleInteractionHandler.h StandardEventHandler.h \ StepHandler.h SubProcessHandler.h XComb.h LastXCombInfo.h \ SamplerBase.h ClusterCollapser.h \ PtGenerator.h ZGenerator.h StandardXComb.h \ StdXCombGroup.h INCLUDEFILES = $(DOCFILES) HandlerGroup.tcc \ StandardEventHandler.fh \ SubProcessHandler.fh EventHandler.fh SamplerBase.fh \ ClusterCollapser.fh StandardXComb.fh \ StdXCombGroup.fh AnalysisHandler.fh noinst_LTLIBRARIES = libThePEGHandlers.la -pkglib_LTLIBRARIES = FixedCMSLuminosity.la \ +pkglib_LTLIBRARIES = FixedCMSLuminosity.la FixedTargetLuminosity.la \ ACDCSampler.la SimpleFlavour.la GaussianPtGenerator.la \ SimpleZGenerator.la libThePEGHandlers_la_SOURCES = $(mySOURCES) $(INCLUDEFILES) # Version info should be updated if any interface or persistent I/O # function is changed FixedCMSLuminosity_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO) FixedCMSLuminosity_la_SOURCES = FixedCMSLuminosity.cc FixedCMSLuminosity.h # Version info should be updated if any interface or persistent I/O # function is changed +FixedTargetLuminosity_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO) +FixedTargetLuminosity_la_SOURCES = FixedTargetLuminosity.cc FixedTargetLuminosity.h + +# Version info should be updated if any interface or persistent I/O +# function is changed ACDCSampler_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO) ACDCSampler_la_SOURCES = ACDCSampler.cc ACDCSampler.h # Version info should be updated if any interface or persistent I/O # function is changed SimpleFlavour_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO) SimpleFlavour_la_SOURCES = SimpleFlavour.cc SimpleFlavour.h # Version info should be updated if any interface or persistent I/O # function is changed GaussianPtGenerator_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO) GaussianPtGenerator_la_SOURCES = GaussianPtGenerator.cc GaussianPtGenerator.h # Version info should be updated if any interface or persistent I/O # function is changed SimpleZGenerator_la_LDFLAGS = $(AM_LDFLAGS) -module $(LIBTOOLVERSIONINFO) SimpleZGenerator_la_SOURCES = SimpleZGenerator.cc SimpleZGenerator.h include $(top_srcdir)/Config/Makefile.aminclude