Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-19 10:28:29

0001 #ifndef gen_TauolaInterface_TauolappInterface_h
0002 #define gen_TauolaInterface_TauolappInterface_h
0003 
0004 #include "HepPDT/ParticleDataTable.hh"
0005 
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "FWCore/Framework/interface/ESHandle.h"
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009 #include "FWCore/Framework/interface/ConsumesCollector.h"
0010 #include "GeneratorInterface/TauolaInterface/interface/TauolaInterfaceBase.h"
0011 #include "TLorentzVector.h"
0012 #include "TVector.h"
0013 
0014 namespace HepMC {
0015   class GenEvent;
0016 }
0017 
0018 namespace CLHEP {
0019   class HepRandomEngine;
0020 }
0021 
0022 namespace gen {
0023   extern "C" {
0024   void ranmar_(float* rvec, int* lenv);
0025   void rmarin_(int*, int*, int*);
0026   }
0027 
0028   class TauolappInterface : public TauolaInterfaceBase {
0029   public:
0030     // ctor & dtor
0031     TauolappInterface(const edm::ParameterSet&, edm::ConsumesCollector);
0032     ~TauolappInterface() override;
0033 
0034     void enablePolarization() override {
0035       fPolarization = true;
0036       return;
0037     }
0038     void disablePolarization() override {
0039       fPolarization = false;
0040       return;
0041     }
0042     void init(const edm::EventSetup&) override;
0043     const std::vector<int>& operatesOnParticles() override { return fPDGs; }
0044     HepMC::GenEvent* decay(HepMC::GenEvent*) override;
0045     void statistics() override;
0046     void SetLHE(lhef::LHEEvent* l) override { lhe = l; }
0047     void setRandomEngine(CLHEP::HepRandomEngine* v) override { fRandomEngine = v; }
0048     static double flat();
0049 
0050   private:
0051     // member function(s)
0052     void decodeMDTAU(int);
0053     void selectDecayByMDTAU();
0054     int selectLeptonic();
0055     int selectHadronic();
0056 
0057     HepMC::GenEvent* make_simple_tau_event(const TLorentzVector& l, int pdgid, int status);
0058     void update_particles(HepMC::GenParticle* partHep,
0059                           HepMC::GenEvent* theEvent,
0060                           HepMC::GenParticle* p,
0061                           TVector3& boost);
0062     bool isLastTauInChain(const HepMC::GenParticle* tau);
0063     HepMC::GenParticle* GetMother(HepMC::GenParticle* tau);
0064     double MatchedLHESpinUp(HepMC::GenParticle* tau,
0065                             std::vector<HepMC::GenParticle>& p,
0066                             std::vector<double>& spinup,
0067                             std::vector<int>& m_idx);
0068     HepMC::GenParticle* FirstTauInChain(HepMC::GenParticle* tau);
0069     void BoostProdToLabLifeTimeInDecays(HepMC::GenParticle* p, TLorentzVector& lab, TLorentzVector& prod);
0070 
0071     //
0072     static CLHEP::HepRandomEngine* fRandomEngine;
0073     std::vector<int> fPDGs;
0074     bool fPolarization;
0075     edm::ESHandle<HepPDT::ParticleDataTable> fPDGTable;
0076     edm::ESGetToken<HepPDT::ParticleDataTable, edm::DefaultRecord> fPDGTableToken;
0077     edm::ParameterSet* fPSet;
0078     bool fIsInitialized;
0079 
0080     int fMDTAU;
0081     bool fSelectDecayByEvent;
0082     std::vector<int> fLeptonModes;
0083     std::vector<int> fHadronModes;
0084     std::vector<double> fScaledLeptonBrRatios;
0085     std::vector<double> fScaledHadronBrRatios;
0086     lhef::LHEEvent* lhe;
0087 
0088     double dmMatch;
0089     bool dolhe;
0090     bool dolheBosonCorr;
0091     int ntries;
0092     double lifetime;
0093   };
0094 
0095 }  // namespace gen
0096 
0097 #endif