Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:29:42

0001 //-*-c++-*-
0002 //-*-Event.h-*-
0003 //   Written by James Monk and Andrew Pilkington
0004 /////////////////////////////////////////////////////////////////////////////
0005 #ifndef EVENT_HH
0006 #define EVENT_HH
0007 
0008 #include "GeneratorInterface/ExhumeInterface/interface/Weight.h"
0009 #include "GeneratorInterface/ExhumeInterface/interface/CrossSection.h"
0010 
0011 namespace CLHEP {
0012   class HepRandomEngine;
0013 }
0014 
0015 namespace Exhume {
0016 
0017   class Event : public Weight {
0018   public:
0019     Event(CrossSection &, CLHEP::HepRandomEngine *);
0020     ~Event() override;
0021 
0022     inline void SetRandomEngine(CLHEP::HepRandomEngine *engine) {
0023       randomEngine = engine;
0024       Process->SetRandomEngine(engine);
0025     }
0026 
0027     void Generate();
0028     inline void Setx1Max(const double &xx_) {
0029       x1Max = xx_;
0030       return;
0031     };
0032     inline void Setx2Max(const double &xx_) {
0033       x2Max = xx_;
0034       return;
0035     };
0036     inline void Sett1Max(const double &xx_) {
0037       t1Max = xx_;
0038       return;
0039     };
0040     inline void Sett2Max(const double &xx_) {
0041       t2Max = xx_;
0042       return;
0043     };
0044     inline void Sett1Min(const double &xx_) {
0045       t1Min = xx_;
0046       return;
0047     };
0048     inline void Sett2Min(const double &xx_) {
0049       t2Min = xx_;
0050       return;
0051     };
0052     inline void SetMassRange(const double &Min_, const double &Max_) {
0053       MinMass = Min_;
0054       MaxMass = Max_;
0055       return;
0056     };
0057 
0058     inline unsigned int GetLastSeed() { return (rand()); };
0059 
0060     inline std::vector<std::pair<double, double> > GetVar() { return (Var); };
0061 
0062     void SetParameterSpace();
0063 
0064     double CrossSectionCalculation();
0065 
0066     inline double GetEfficiency() { return (100.0 * NumberOfEvents / TotalAttempts); };
0067 
0068   private:
0069     void SelectValues();
0070     double WeightFunc(const double &) override;
0071 
0072     std::vector<std::pair<double, double> > Var;
0073 
0074     double CSi, CSMass, Sigmai, wgt, yRange;
0075     double TwoPI, B, InvB, InvBlnB, Root_s, InvRoot_s;
0076     double SqrtsHat, Eta, t1, t2, Phi1, Phi2, VonNeu;
0077     double ymax, ymin;
0078     CrossSection *Process;
0079     unsigned int NumberOfEvents, TotalAttempts;
0080 
0081     double x1Max, x2Max, t1Min, t1Max, t2Min, t2Max, MinMass, MaxMass;
0082     double tt1max, tt1min, tt2max, tt2min;
0083 
0084     CLHEP::HepRandomEngine *randomEngine;
0085   };
0086 
0087 }  // namespace Exhume
0088 
0089 #endif