Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:08

0001 #ifndef BASEPROTONTRANSPORT
0002 #define BASEPROTONTRANSPORT
0003 #include "FWCore/Framework/interface/EventSetup.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "HepMC/GenEvent.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 #include "Utilities/PPS/interface/PPSUnitConversion.h"
0008 #include "SimDataFormats/Forward/interface/LHCTransportLink.h"
0009 #include <vector>
0010 #include <map>
0011 #include <string>
0012 #include "TLorentzVector.h"
0013 
0014 namespace CLHEP {
0015   class HepRandomEngine;
0016 }
0017 class BaseProtonTransport {
0018 public:
0019   BaseProtonTransport(const edm::ParameterSet& iConfig);
0020   virtual ~BaseProtonTransport();
0021 
0022   std::vector<LHCTransportLink>& getCorrespondenceMap() { return m_CorrespondenceMap; }
0023   virtual void process(const HepMC::GenEvent* ev, const edm::EventSetup& es, CLHEP::HepRandomEngine* engine) = 0;
0024 
0025   void clear();
0026 
0027   void addPartToHepMC(const HepMC::GenEvent*, HepMC::GenEvent*);
0028 
0029   void ApplyBeamCorrection(HepMC::GenParticle* p);
0030   void ApplyBeamCorrection(TLorentzVector& p);
0031 
0032   double beamEnergy() { return beamEnergy_; };
0033   double beamMomentum() { return beamMomentum_; };
0034 
0035 protected:
0036   void setBeamFileNames(const std::string& nam1, const std::string& nam2) {
0037     beam1Filename_ = nam1;
0038     beam2Filename_ = nam2;
0039   };
0040 
0041   void setBeamParameters(double stx, double sty, double sx, double sy, double se) {
0042     m_sigmaSTX = stx;
0043     m_sigmaSTY = sty;
0044     m_sigmaSX = sx;
0045     m_sigmaSY = sy;
0046     m_sig_E = se;
0047   };
0048 
0049   void setCrossingAngles(double cx45, double cx56, double cy45, double cy56) {
0050     fCrossingAngleX_45_ = cx45;
0051     fCrossingAngleX_56_ = cx56;
0052     fCrossingAngleY_45_ = cy45;
0053     fCrossingAngleY_56_ = cy56;
0054   };
0055 
0056   enum class TransportMode { HECTOR, TOTEM, OPTICALFUNCTIONS };
0057   TransportMode MODE;
0058 
0059   CLHEP::HepRandomEngine* engine_{nullptr};
0060   std::vector<LHCTransportLink> m_CorrespondenceMap;
0061   std::map<unsigned int, TLorentzVector> m_beamPart;
0062   std::map<unsigned int, double> m_xAtTrPoint;
0063   std::map<unsigned int, double> m_yAtTrPoint;
0064 
0065   bool verbosity_;
0066   bool bApplyZShift_;
0067   bool useBeamPositionFromLHCInfo_;
0068   bool produceHitsRelativeToBeam_;
0069 
0070   std::string beam1Filename_{""};
0071   std::string beam2Filename_{""};
0072 
0073   double fPPSRegionStart_45_;
0074   double fPPSRegionStart_56_;
0075   double fCrossingAngleX_45_{0.0};
0076   double fCrossingAngleX_56_{0.0};
0077   double fCrossingAngleY_45_{0.0};
0078   double fCrossingAngleY_56_{0.0};
0079 
0080   double etaCut_;
0081   double momentumCut_;
0082 
0083 private:
0084   double beamMomentum_;
0085   double beamEnergy_;
0086 
0087   double m_sigmaSTX{0.0};
0088   double m_sigmaSTY{0.0};
0089   double m_sigmaSX{0.0};
0090   double m_sigmaSY{0.0};
0091   double m_sig_E{0.0};
0092 };
0093 #endif