tau_reweight_lib.h

00001 #ifndef _TAU_REWEIGHT_LIB_H_
00002 #define _TAU_REWEIGHT_LIB_H_
00003 
00004 // Debug mode
00005 #ifdef DEBUG_MODE
00006 #define DEBUG(arg) arg;
00007 #else
00008 #define DEBUG(arg)
00009 #endif
00010 
00011 // TAUOLA header
00012 #include "Tauola/Tauola.h"
00013 
00014 #include "TauSpinner/Tauola_wrapper.h"
00015 #include "TauSpinner/SimpleParticle.h"
00016 #include "TauSpinner/Particle.h"
00017 
00018 // LHAPDF header
00019 #include "LHAPDF/LHAPDF.h"
00020 
00021 #include <vector>
00022 #include <iostream>
00023 using std::vector;
00024 using std::cout;
00025 using std::endl;
00026 
00027 namespace TauSpinner {
00028 
00029 /** Definition of REAL*8 FUNCTION DISTH(S,T,H1,H2) from disth.f */
00030 extern "C" double disth_(double *SVAR, double *COSTHE, int *TA, int *TB);
00031 
00032 /** Initialize TauSpinner
00033 
00034     Print info and set global variables */
00035 void initialize_spinner(bool _Ipp, int _Ipol, int _nonSM2, int _nonSMN, double _CMSENE);
00036 
00037 /** Set flag for calculating relative(NONSM-SM)/absolute  weight for X-section
00038   calculated as by product in longitudinal polarization method. */
00039 void setRelWTnonSM(int _relWTnonSM);
00040 
00041 /** activates simple formula and set Higgs mass, width and normalization for Higgs born (BW) function */
00042  void setHiggsParameters(int jak, double mass, double width, double normalization);
00043 
00044 /** Get Higgs mass, width and normalization of Higgs born function */
00045 void getHiggsParameters(double *mass, double *width, double *normalization);
00046 
00047 /**  Set spin of sample */
00048 void setSpinOfSample(bool _Ipol);
00049 
00050 /**  Turn calculation of nonSM on/off */
00051 void setNonSMkey(int key);
00052 
00053 /** Get nonSM weight */
00054 double getWtNonSM();
00055 
00056 /** Get tau+ amplitude weight */
00057 double getWtamplitP();
00058 
00059 /** Get tau- amplitude weight */
00060 double getWtamplitM();
00061 
00062 /** Get tau spin
00063   
00064   Used after sample is reweighted to obtain information about tau spin */
00065 double getTauSpin();
00066 
00067 /** Calculate weights.
00068 
00069   Determine decay channel and call polarization calculation function.
00070   Function for W+/- and H+/-  */
00071 double calculateWeightFromParticlesWorHpn(SimpleParticle &W, SimpleParticle &tau, SimpleParticle &nu_tau, vector<SimpleParticle> &tau_daughters);
00072 
00073 /** Calculate weights.
00074 
00075   Determine decay channel and call polarization calculation function.
00076   Function for H */
00077 double calculateWeightFromParticlesH(SimpleParticle &sp_X, SimpleParticle &sp_tau1, SimpleParticle &sp_tau2, vector<SimpleParticle> &sp_tau1_daughters, vector<SimpleParticle> &sp_tau2_daughters);
00078 
00079 /** Prepare kinematics for HH calculation
00080   
00081   Boost particles to effective bozon rest frame, and rotate them so that tau is on Z axis.
00082   Then rotate again with theta2 phi2 so neutrino from tau decay is along Z. */
00083 void prepareKinematicForHH(Particle &tau, Particle &nu_tau, vector<Particle> &tau_daughters, double *phi2, double *theta2);
00084 
00085 /** Calculate polarization vector.
00086 
00087   We use FORTRAN metdods to calculate HH.
00088   First decide what is the channel. After that, 4-vectors
00089   are moved to tau rest frame of tau.
00090   Polarimetric vector HH is then rotated using angles phi and theta.
00091   
00092   Order of the particles does not matter. */
00093 double* calculateHH(int tau_pdgid, vector<Particle> &tau_daughters, double phi, double theta);
00094 
00095 /**
00096  Get Longitudinal polarization
00097  
00098  Returns longitudinal polarization in Z/gamma* -> tau+ tau-
00099  S: invariant mass of the bozon */
00100 double getLongitudinalPolarization(double S, SimpleParticle &sp_tau, SimpleParticle &sp_nu_tau);
00101 
00102 /** Check if the list of particles match the list of pdgid
00103 
00104   Returns true if 'particles' contain all of the listed pdgid-s.
00105   If it does - 'particles' will be rearranged so thath they have
00106   the same order as listed pdgid-s.
00107 
00108   It is done so the order of particles is the same as the order used by
00109   TAUOLA Fortran routines. */
00110 bool channelMatch(vector<Particle> &particles, int p1, int p2=0, int p3=0, int p4=0, int p5=0, int p6=0);
00111 
00112 //------------------------------------------------------------------------------
00113 //-- Useful debug methods ------------------------------------------------------
00114 //------------------------------------------------------------------------------
00115 
00116 /** Prints out two vertices:
00117       W   -> tau, nu_tau
00118       tau -> tau_daughters */
00119 void print(Particle &W, Particle &nu_tau, Particle &tau, vector<Particle> &tau_daughters);
00120 
00121 /** Sums all 4-vectors of the particles on the list */
00122 Particle *vector_sum(vector<Particle> &x);
00123 
00124 } // namespace TauSpinner
00125 #endif
Generated on Sun Oct 20 20:24:10 2013 for C++InterfacetoTauola by  doxygen 1.6.3