Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-12-10 02:31:53

0001 #ifndef IOMC_FlatEvtVtxGenerator_H
0002 #define IOMC_FlatEvtVtxGenerator_H
0003 
0004 /**
0005  * Generate event vertices according to a Flat distribution. 
0006  * Attention: All values are assumed to be cm!
0007  *
0008  * Important note: flat independent distributions in Z and T are not correct for physics production
0009  * In reality, if two flat beams interact the real distribution will not be flat with independent Z and T
0010  * but Z and T will be correlated, as example in GaussEvtVtxGenerator.
0011  * Can restore correlation in configuration via MinT += (MinZ - MaxZ)/2 and MaxT += (MaxZ - MinZ)/2
0012  * in [ns] units (recall c_light = 29.98cm/ns)
0013  *
0014  */
0015 
0016 #include "IOMC/EventVertexGenerators/interface/BaseEvtVtxGenerator.h"
0017 
0018 namespace CLHEP {
0019   class HepRandomEngine;
0020 }
0021 
0022 class FlatEvtVtxGenerator : public BaseEvtVtxGenerator {
0023 public:
0024   FlatEvtVtxGenerator(const edm::ParameterSet& p);
0025   /** Copy constructor */
0026   FlatEvtVtxGenerator(const FlatEvtVtxGenerator& p) = delete;
0027   /** Copy assignment operator */
0028   FlatEvtVtxGenerator& operator=(const FlatEvtVtxGenerator& rhs) = delete;
0029   ~FlatEvtVtxGenerator() override;
0030 
0031   /// return a new event vertex
0032   ROOT::Math::XYZTVector vertexShift(CLHEP::HepRandomEngine*) const override;
0033 
0034   const TMatrixD* GetInvLorentzBoost() const override { return nullptr; }
0035 
0036   /// set min in X in cm
0037   void minX(double m = 0.0);
0038   /// set min in Y in cm
0039   void minY(double m = 0.0);
0040   /// set min in Z in cm
0041   void minZ(double m = 0.0);
0042 
0043   /// set max in X in cm
0044   void maxX(double m = 0);
0045   /// set max in Y in cm
0046   void maxY(double m = 0);
0047   /// set max in Z in cm
0048   void maxZ(double m = 0);
0049 
0050 private:
0051   double fMinX, fMinY, fMinZ, fMinT;
0052   double fMaxX, fMaxY, fMaxZ, fMaxT;
0053 };
0054 
0055 #endif