Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-28 07:02:48

0001 /**
0002  \file
0003  Declarations of kinematic calculation classes.
0004  
0005  \author    Thomas Burton
0006  \date      2011-07-07
0007  \copyright 2011 Brookhaven National Lab
0008  */
0009 
0010 #ifndef INCLUDE_EICSMEAR_ERHIC_KINEMATICS_H_
0011 #define INCLUDE_EICSMEAR_ERHIC_KINEMATICS_H_
0012 
0013 #include <list>
0014 #include <vector>
0015 
0016 #include <Rtypes.h>
0017 #include <TLorentzVector.h>
0018 
0019 #include "eicsmear/erhic/ParticleMC.h"
0020 #include "eicsmear/erhic/ParticleIdentifier.h"
0021 #include "eicsmear/erhic/VirtualParticle.h"
0022 
0023 namespace erhic {
0024 
0025 class EventDis;
0026 class VirtualParticle;
0027 
0028 /**
0029  A collection of DIS kinematic variables.
0030  */
0031 struct DisKinematics : public TObject {
0032   /**
0033    Default constructor.
0034    */
0035   DisKinematics();
0036   /**
0037    Constructor initialising each variable.
0038    */
0039   DisKinematics(double x, double y, double nu, double Q2, double W2);
0040   Double32_t mX;
0041   Double32_t mQ2;
0042   Double32_t mW2;
0043   Double32_t mNu;
0044   Double32_t mY;
0045 
0046  static bool BoundaryWarning; ///< Issue warnings if calculations return x or y outside [0,1]
0047 
0048  ClassDef(erhic::DisKinematics, 1)
0049 };
0050 
0051 /**
0052  Abstract base class for computations of event kinematics.
0053  */
0054 class KinematicsComputer {
0055  public:
0056   virtual ~KinematicsComputer() { }
0057   virtual TObject* Calculate() = 0;
0058   ClassDef(erhic::KinematicsComputer, 1)
0059 };
0060 
0061 /**
0062  Computes DIS event kinematics from the scattered lepton.
0063  Uses lepton momentum in place of energy if momentum is available,
0064  as this is typically measured more precisely for EIC kinematics.
0065  */
0066 class LeptonKinematicsComputer : public KinematicsComputer {
0067  public:
0068   virtual ~LeptonKinematicsComputer() { }
0069   /**
0070    Determine the beam info from the input event
0071    */
0072   explicit LeptonKinematicsComputer(const EventDis&);
0073   virtual DisKinematics* Calculate();
0074 
0075  protected:
0076   std::vector<const VirtualParticle*> mBeams;
0077 
0078   ClassDef(erhic::LeptonKinematicsComputer, 1)
0079 };
0080 
0081 /**
0082  Computes DIS event kinematics from final-state hadrons using
0083  the Jacquet-Blondel method.
0084  \todo Revisit implementation, giving option for using particle energy
0085  or momentum when computing "energy", and think how to handle mass for
0086  smeared particles.
0087  */
0088 class JacquetBlondelComputer : public KinematicsComputer {
0089  public:
0090   virtual ~JacquetBlondelComputer();
0091   /**
0092    Initialise with the event to compute.
0093    If the second argument is non-NULL, use the beam information from it
0094    in the computation.
0095    If it is NULL, determine the beam information automatically from
0096    the event.
0097    This allows the same class to be used with smeared calculations, where
0098    the beam information isn't associated with the smeared event itself.
0099    */
0100   explicit JacquetBlondelComputer(const EventDis&);
0101   virtual DisKinematics* Calculate();
0102 
0103  protected:
0104   virtual Double_t ComputeY() const;
0105   virtual Double_t ComputeQSquared() const;
0106   virtual Double_t ComputeX() const;
0107   /// The event for which kinematics are being calculated.
0108   const EventDis& mEvent;
0109   /// Array of final-state particles used in computing kinematics.
0110   std::vector<const VirtualParticle*> mParticles;
0111 
0112   ClassDef(erhic::JacquetBlondelComputer, 1)
0113 };
0114 
0115 /**
0116  Computes DIS event kinematics from a mixture of hadronic and lepton
0117  variables using the double-angle method.
0118  */
0119 class DoubleAngleComputer : public KinematicsComputer {
0120  public:
0121   virtual ~DoubleAngleComputer();
0122   /**
0123    Initialise with the event to compute.
0124    If the second argument is non-NULL, use the beam information from it
0125    in the computation.
0126    If it is NULL, determine the beam information automatically from
0127    the event.
0128    This allows the same class to be used with smeared calculations, where
0129    the beam information isn't associated with the smeared event itself.
0130    */
0131   explicit DoubleAngleComputer(const EventDis&);
0132   virtual DisKinematics* Calculate();
0133 
0134  protected:
0135   const EventDis& mEvent;
0136   /**
0137    Scattering angle of struck quark.
0138    */
0139   virtual Double_t ComputeQuarkAngle() const;
0140   virtual Double_t ComputeY() const;
0141   virtual Double_t ComputeQSquared() const;
0142   virtual Double_t ComputeX() const;
0143   /// Stores whether the particle list has changed since the last
0144   /// computation of the quark angle.
0145   mutable Bool_t mHasChanged;
0146   /// Caches the quark angle
0147   mutable Double_t mAngle;
0148   std::vector<const VirtualParticle*> mParticles;
0149 
0150   ClassDef(erhic::DoubleAngleComputer, 1)
0151 };
0152 
0153 }  // namespace erhic
0154 
0155 #endif  // INCLUDE_EICSMEAR_ERHIC_KINEMATICS_H_