Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-05 03:36:50

0001 #ifndef IOMC_HLLHCEvtVtxGenerator_H
0002 #define IOMC_HLLHCEvtVtxGenerator_H
0003 
0004 /**
0005  * Generate event vertices given beams sizes, crossing angle
0006  * offset, and crab rotation. 
0007  * Attention: All values are assumed to be mm for spatial coordinates
0008  * and ns for time.
0009  * Attention: This class fix the the vertex time generation of HLLHCEvtVtxGenerator
0010  *
0011  * $Id: HLLHCEvtVtxGenerator_Fix.h,v 1.0 2015/03/15 10:34:38 Exp $
0012  */
0013 
0014 #include "IOMC/EventVertexGenerators/interface/BaseEvtVtxGenerator.h"
0015 #include "FWCore/Framework/interface/ESWatcher.h"
0016 #include "FWCore/Utilities/interface/ESGetToken.h"
0017 #include "CondFormats/DataRecord/interface/SimBeamSpotHLLHCObjectsRcd.h"
0018 #include "CondFormats/BeamSpotObjects/interface/SimBeamSpotHLLHCObjects.h"
0019 
0020 #include <string>
0021 
0022 namespace CLHEP {
0023   class RandFlat;
0024 }
0025 
0026 namespace edm {
0027   class ConfigurationDescriptions;
0028 }
0029 
0030 class HLLHCEvtVtxGenerator : public BaseEvtVtxGenerator {
0031 public:
0032   HLLHCEvtVtxGenerator(const edm::ParameterSet& p);
0033 
0034   /** Copy constructor */
0035   HLLHCEvtVtxGenerator(const HLLHCEvtVtxGenerator& p) = delete;
0036 
0037   /** Copy assignment operator */
0038   HLLHCEvtVtxGenerator& operator=(const HLLHCEvtVtxGenerator& rhs) = delete;
0039 
0040   ~HLLHCEvtVtxGenerator() override = default;
0041 
0042   void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0043 
0044   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0045 
0046   /// return a new event vertex
0047   HepMC::FourVector newVertex(CLHEP::HepRandomEngine*) const override;
0048 
0049   TMatrixD const* GetInvLorentzBoost() const override { return nullptr; };
0050 
0051 private:
0052   // Configurable parameters
0053   double fMeanX, fMeanY, fMeanZ, fTimeOffset_c_light;  //spatial and time offset for mean collision
0054   double fEProton;                                     // proton beam energy
0055   double fCrossingAngle;                               // crossing angle
0056   double fCrabFrequency;                               // crab cavity frequency
0057   bool fRF800;                                         // 800 MHz RF?
0058   double fBetaCrossingPlane;                           // beta crossing plane (m)
0059   double fBetaSeparationPlane;                         // beta separation plane (m)
0060   double fHorizontalEmittance;                         // horizontal emittance
0061   double fVerticalEmittance;                           // vertical emittance
0062   double fBunchLength;                                 // bunch length
0063   double fCrabbingAngleCrossing;                       // crabbing angle crossing
0064   double fCrabbingAngleSeparation;                     // crabbing angle separation
0065 
0066   // Parameters inferred from configurables
0067   double gamma;  // beam configurations
0068   double beta;
0069   double betagamma;
0070   double oncc;   // ratio of crabbing angle to crossing angle
0071   double epsx;   // normalized crossing emittance
0072   double epss;   // normalized separation emittance
0073   double sigx;   // size in x
0074   double phiCR;  // crossing angle * crab frequency
0075 
0076   //width for y plane
0077   double sigma(double z, double epsilon, double beta, double betagamma) const;
0078 
0079   //density with crabbing
0080   double integrandCC(double x, double z, double t) const;
0081 
0082   // 4D intensity
0083   double intensity(double x, double y, double z, double t) const;
0084 
0085   // Read from DB
0086   bool readDB_;
0087   void update(const edm::EventSetup& iEventSetup);
0088   edm::ESWatcher<SimBeamSpotHLLHCObjectsRcd> parameterWatcher_;
0089   edm::ESGetToken<SimBeamSpotHLLHCObjects, SimBeamSpotHLLHCObjectsRcd> beamToken_;
0090 };
0091 
0092 #endif