Miscellaneous functions. More...
#include <PaAlgo.h>
Static Public Member Functions | |
| static bool | GetTargetLocation (int run, double &xU, double &yU, double &zU_1, double &zU_2, double &xD, double &yD, double &zD_1, double &zD_2, double &R, double &yCUT) |
| Gives the target location in space: shift and tilting. Returns false if no information for the given year. | |
| static bool | CrossCells (PaTPar par, int run, double R_U=-9999, double yCUT_U=-9999) |
| The requirement that the muon beam trajectory crosses entirely two target cells. It is used in order to equalize fluxes through both cells. | |
| static bool | InTarget (PaTPar par, char Cell, int run, double R_U=-9999, double yCUT_U=-9999) |
| The check for the primary vertex to be in one of the target cells. | |
| static double | GetBeamPol (float mom, int year) |
| Returns the average muon beam polarization. | |
| static void | GetDepolarizationFactor (double q2, double xBj, double y, double R, double dR, double &D, double &dD, bool do_err=true) |
| Returns the depolarization factor. | |
| static void | GetDepolarizationFactor (double q2, double xBj, double y, double &D, double &dD, bool do_err=true) |
| Returns the depolarization factor. | |
| static void | GetDilutionFactor (float xBj, float y, char Cell, int run, int flag, float &f, float &df) |
| Returns the dilution factor and its error. | |
| static void | GetR (float q2, float xBj, float &R, float &dR, bool do_err=true) |
| Returns the R1990 value. | |
| static void | GetRadiativeWeight (float xBj, float y, int flag, float &rc) |
| Returns the radiative correction weight (DEPRECATED). | |
| static float | GetRadiativeWeight (float xBj, float y, int flag) |
| Returns the radiative correction weight. | |
| static bool | DoMW1ID (const PaTrack &t, int *nma1=0, int *nma2=0) |
| return "true" is track "t" is identified in MW1 | |
| static int | GetMW1ScatMuon (const PaEvent &e) |
| returns the index of the candidate scattered muon identified in MW1 | |
| static double | Q2 (double pmu0, double pmu, double Cos, double mmu=0.105658357) |
| Q2 via momenta and Cos. | |
| static double | Q2 (const TVector3 &pmu0, const TVector3 &pmu, double mmu=0.105658357) |
| Q2 via 3-vectors. | |
| static double | Q2 (const TLorentzVector &pmu0, const TLorentzVector &pmu) |
| Q2 via Lorentz vectors. | |
| static double | xbj (double pmu0, double pmu, double Cos, double m_P=0.93827231, double mmu=0.105658357) |
| xBjorken via momenta and Cos | |
| static double | xbj (const TVector3 &pmu0, const TVector3 &pmu, double m_P=0.93827231, double mmu=0.105658357) |
| xBjorken via 3-vectors | |
| static double | xbj (const TLorentzVector &pmu0, const TLorentzVector &pmu, double m_P=0.93827231) |
| xBjorken via Lorentz vectors | |
| static double | W2 (double pmu0, double pmu, double Cos, double m_P=0.93827231, double mmu=0.105658357) |
| W2 via momenta and Cos. | |
| static double | W2 (const TVector3 &pmu0, const TVector3 &pmu, double m_P=0.93827231, double mmu=0.105658357) |
| W2 via 3-vectors. | |
| static double | W2 (const TLorentzVector &pmu0, const TLorentzVector &pmu, double m_P=0.93827231) |
| W2 via Lorentz vectors. | |
| static void | Boost (const TVector3 &v0, double m0, const TVector3 &v1, double m1, TVector3 &v10) |
| boost via 3-vectors | |
| static void | Boost (const TLorentzVector &v0, const TLorentzVector &v1, TVector3 &v10) |
| boost via Lorentz vectors | |
| static void | Boost (const TLorentzVector &v0, const TLorentzVector &v1, TLorentzVector &v10) |
| boost via Lorentz vectors | |
| static double | Xf (const TVector3 &pmu0, const TVector3 &pmu, const TVector3 &plh, double mh=0.13957018, double m_P=0.93827231, double mmu=0.105658357) |
| xF via 3-vectors | |
| static double | Xf (const TLorentzVector &pmu0, const TLorentzVector &pmu, const TLorentzVector &plh, double m_P=0.93827231) |
| xF via Lorentz vectors | |
| static double | E (double m, const TVector3 &p) |
| Energy via mass and 3-vector. | |
| static double | M (double e, const TVector3 &p) |
| Mass via energy and 3-vector. | |
| static bool | RKutta (double *SU, double *VO, double &Path) |
| Trajectory propagation in magnetic field by Runge-Kutta method with Jacobian calculations. | |
| static void | RedefMass (TLorentzVector &lv, double mass) |
| Change the energy part of the Lorentz vector "lv" to corresponds exactly to mass "mass". | |
Miscellaneous functions.
Collection of independent,"self-contained" algorithms and useful physics-related functions.
| void PaAlgo::Boost | ( | const TLorentzVector & | v0, | |
| const TLorentzVector & | v1, | |||
| TLorentzVector & | v10 | |||
| ) | [inline, static] |
boost via Lorentz vectors
The Lorentz transformation of the particle v1 to the rest frame of the particle v0.
| v0 | the four-vector of particle 0 in laboratory frame | |
| v1 | the four-vector of particle 1 in laboratory frame | |
| v10 | the four-vector of the particle 1 in the rest frame of 0 |
References Boost().
| void PaAlgo::Boost | ( | const TLorentzVector & | v0, | |
| const TLorentzVector & | v1, | |||
| TVector3 & | v10 | |||
| ) | [inline, static] |
boost via Lorentz vectors
The Lorentz transformation of the particle v1 to the rest frame of the particle v0.
| v0 | the four-vector of particle 0 in laboratory frame | |
| v1 | the four-vector of particle 1 in laboratory frame | |
| v10 | the momentum vector of the particle 1 in the rest frame of 0 |
References Boost().
| void PaAlgo::Boost | ( | const TVector3 & | v0, | |
| double | m0, | |||
| const TVector3 & | v1, | |||
| double | m1, | |||
| TVector3 & | v10 | |||
| ) | [inline, static] |
boost via 3-vectors
The Lorentz transformation of the particle {v1, m1} to the rest frame of the particle {v0, m0}.
| v0 | the momentum vector of particle 0 in laboratory frame | |
| m0 | the mass of the particle 0 | |
| v1 | the momentum vector of particle 1 in laboratory frame | |
| m1 | the mass of the particle 1 | |
| v10 | the momentum vector of the particle 1 in the rest frame of 0 |
References E().
Referenced by Boost().
| bool PaAlgo::CrossCells | ( | PaTPar | par, | |
| int | run, | |||
| double | R_U = -9999, |
|||
| double | yCUT_U = -9999 | |||
| ) | [static] |
The requirement that the muon beam trajectory crosses entirely two target cells. It is used in order to equalize fluxes through both cells.
| par | the beam track parameters in the primary vertex | |
| run | the run number ("-2" = 2 cell MC, "-3" = 3 cell MC LiD, "-4" = 3 cell MC NH3) | |
| R_U | the user defined radial cut (R<1.4cm) | |
| yCUT_U | the user defined vertical cut (y<1cm) |
References PaTPar::Extrapolate(), and GetTargetLocation().
| bool PaAlgo::DoMW1ID | ( | const PaTrack & | t, | |
| int * | nma1 = 0, |
|||
| int * | nma2 = 0 | |||
| ) | [static] |
return "true" is track "t" is identified in MW1
The number of clusters associated to the track before and after the absorber is stored in nma1 and nma2 respectively if they are not null pointers.
References PaTrack::NHitsFoundInDetect().
Referenced by GetMW1ScatMuon().
| double PaAlgo::GetBeamPol | ( | float | mom, | |
| int | year | |||
| ) | [static] |
Returns the average muon beam polarization.
| mom | the momentum of the beam muon track | |
| year | the year of data taking (2002, 2003 or 2004). |
| void PaAlgo::GetDepolarizationFactor | ( | double | q2, | |
| double | xBj, | |||
| double | y, | |||
| double & | D, | |||
| double & | dD, | |||
| bool | do_err = true | |||
| ) | [static] |
Returns the depolarization factor.
| q2 | squared invariant mass of the virtual photon | |
| xBj | Bjorken x | |
| y | energy fraction carried by the virtual photon | |
| D | resulting depolarization factor | |
| dD | calculated error on D (if do_err==true) | |
| do_err | flag which controls whether the error calculation should be done (defaults to 'yes') |
This function is not available when Phast is compiled with NO_FORTRAN=1
This function is a convenience wrapper for the first variant which takes the value of R+-dR from PaAlgo::GetR().
References GetDepolarizationFactor(), and GetR().
| void PaAlgo::GetDepolarizationFactor | ( | double | q2, | |
| double | xBj, | |||
| double | y, | |||
| double | R, | |||
| double | dR, | |||
| double & | D, | |||
| double & | dD, | |||
| bool | do_err = true | |||
| ) | [static] |
Returns the depolarization factor.
| q2 | squared invariant mass of the virtual photon | |
| xBj | Bjorken x | |
| y | energy fraction carried by the virtual photon | |
| R | R value (e.g. from r1990.F) | |
| dR | error on R | |
| D | resulting depolarization factor | |
| dD | calculated error on D (if do_err==true) | |
| do_err | flag which controls whether the error calculation should be done (defaults to 'yes') |
The code in this function is taken from the A1 analysis code (thanks to A. Korzenev). This function does not invoke any external FORTRAN code, which means that if you have your own source for the R values you can use it even when compiling Phast with NO_FORTRAN=1.
References M().
Referenced by GetDepolarizationFactor().
| void PaAlgo::GetDilutionFactor | ( | float | xBj, | |
| float | y, | |||
| char | Cell, | |||
| int | run, | |||
| int | flag, | |||
| float & | f, | |||
| float & | df | |||
| ) | [static] |
Returns the dilution factor and its error.
| xBj | Bjorken x | |
| y | energy fraction carried by the virtual photon | |
| Cell | target cell (U=upstream, C=central, D=downstream) | |
| run | run number. | |
| flag | processing flag (1=inclusive, 2=hadron_tagged) | |
| f | dilution factor | |
| df | error for the dilution factor |
This function is not available when Phast is compiled with NO_FORTRAN=1
This function calls the FORTRAN routine dfdeut from ./fortran/dilut_main.F to get the dilution factor for the various regions of the target.
Beware: The FORTRAN routine gives only float values!
| int PaAlgo::GetMW1ScatMuon | ( | const PaEvent & | e | ) | [static] |
returns the index of the candidate scattered muon identified in MW1
Returns the best scattered muon candidate as identified by MW1. The track is selected among those coming out of the "best primary vertex", as given by iBestPrimaryVertex() function. The identification is performed only in the case of calorimetric trigger events.
References DoMW1ID(), PaEvent::iBestPrimaryVertex(), PaVertex::iOutParticle(), PaParticle::iTrack(), PaVertex::NOutParticles(), PaEvent::TrigMask(), PaEvent::vParticle(), PaEvent::vTrack(), and PaEvent::vVertex().
| void PaAlgo::GetR | ( | float | q2, | |
| float | xBj, | |||
| float & | R, | |||
| float & | dR, | |||
| bool | do_err = true | |||
| ) | [static] |
Returns the R1990 value.
| q2 | squared invariant mass of the virtual photon | |
| xBj | Bjorken x | |
| R | result (float!) | |
| dR | error on R (if do_err==true) | |
| do_err | flag which controls whether the error calculation should be done (defaults to 'yes') |
This function is not available when Phast is compiled with NO_FORTRAN=1
This function calls the FORTRAN routing r1990 from ./fortran/r1990.F to get the R parameterization.
Beware: The FORTRAN routine gives only float values!
Referenced by GetDepolarizationFactor().
| float PaAlgo::GetRadiativeWeight | ( | float | xBj, | |
| float | y, | |||
| int | flag | |||
| ) | [static] |
Returns the radiative correction weight.
| xBj | Bjorken x | |
| y | energy fraction carried by the virtual photon | |
| flag | processing flag (1=inclusive(deuter), 2=hadron_tagged(deuter), 11=inclusive(hydrogen), 12=hadron_tagged(hydrogen)) |
========================================================================= B. Badelek, D. Bardin, K. Kurek and K. Scholz, Z. Phys. C 66 (1995) 591 ========================================================================= and in particular the Eq (4) and Fig 5.
This function is not available when Phast is compiled with NO_FORTRAN=1
This function calls the FORTRAN routine rcinlx or rcinhd from ./fortran/dfdeut.F to get the radiative correction weights from precalculated tables. Tables that are used were generated for dilution factor calculations.
Beware: The FORTRAN routine gives only float values!
| void PaAlgo::GetRadiativeWeight | ( | float | xBj, | |
| float | y, | |||
| int | flag, | |||
| float & | rc | |||
| ) | [static] |
Returns the radiative correction weight (DEPRECATED).
| xBj | Bjorken x | |
| y | energy fraction carried by the virtual photon | |
| flag | processing flag (1=inclusive(deuter), 2=hadron_tagged(deuter), 11=inclusive(hydrogen), 12=hadron_tagged(hydrogen)) | |
| rc | resulting radiative correction weight it is defined as:
|
This function is not available when Phast is compiled with NO_FORTRAN=1
This function calls the FORTRAN routine rcinlx or rcinhd from ./fortran/dfdeut.F to get the radiative correction weights from precalculated tables. Tables that are used were generated for dilution factor calculations.
Beware: The FORTRAN routine gives only float values!
| bool PaAlgo::GetTargetLocation | ( | int | run, | |
| double & | xU, | |||
| double & | yU, | |||
| double & | zU_1, | |||
| double & | zU_2, | |||
| double & | xD, | |||
| double & | yD, | |||
| double & | zD_1, | |||
| double & | zD_2, | |||
| double & | R, | |||
| double & | yCUT | |||
| ) | [static] |
Gives the target location in space: shift and tilting. Returns false if no information for the given year.
| run | the run number ("-2" = 2 cell MC) | |
| xU | the shift of the target most upstream part along x | |
| yU | the shift of the target most upstream part along y | |
| zU_1 | z position of the upstream cell most upstream part | |
| zU_2 | z position of the upstream cell most downstream part | |
| xD | the shift of the target most downstream part along x | |
| yD | the shift of the target most downstream part along y | |
| zD_1 | z position of the downstream cell most upstream part | |
| zD_2 | z position of the downstream cell most downstream part | |
| R | the radial cut | |
| yCUT | the cut for upper part of the cell |
Referenced by CrossCells(), and InTarget().
| bool PaAlgo::InTarget | ( | PaTPar | par, | |
| char | Cell, | |||
| int | run, | |||
| double | R_U = -9999, |
|||
| double | yCUT_U = -9999 | |||
| ) | [static] |
The check for the primary vertex to be in one of the target cells.
| par | The beam track parameters in the primary vertex | |
| Cell | The one of cells (if 'U' - upstream cell, if 'D' - downstream, if 'C' - central) | |
| run | The run number ("-2" = 2 cell MC, "-3" = 3 cell MC LiD, "-4" = 3 cell MC NH3) | |
| R_U | the user defined radial cut (R<1.4cm) | |
| yCUT_U | the user defined vertical cut (y<1cm) |
References GetTargetLocation().
| double PaAlgo::Q2 | ( | const TLorentzVector & | pmu0, | |
| const TLorentzVector & | pmu | |||
| ) | [inline, static] |
Q2 via Lorentz vectors.
| pmu0 | the beam Lorentz vector | |
| pmu | the scattered lepton Lorentz vector |
References Q2().
| double PaAlgo::Q2 | ( | const TVector3 & | pmu0, | |
| const TVector3 & | pmu, | |||
| double | mmu = 0.105658357 | |||
| ) | [inline, static] |
Q2 via 3-vectors.
| pmu0 | the beam vector | |
| pmu | the scattered lepton vector | |
| mmu | the mass of the lepton (default is muon) |
References E().
| double PaAlgo::Q2 | ( | double | pmu0, | |
| double | pmu, | |||
| double | Cos, | |||
| double | mmu = 0.105658357 | |||
| ) | [inline, static] |
| bool PaAlgo::RKutta | ( | double * | SU, | |
| double * | VO, | |||
| double & | Path | |||
| ) | [static] |
Trajectory propagation in magnetic field by Runge-Kutta method with Jacobian calculations.
//------------------------------------------------------------------------------------// // Runge-Kutta method for tracking a particles through a magnetic field. // // Uses Nystroem algorithm (See Handbook Net. Bur. of Standards, procedure 25.5.20 // // // // Input parameteres: // // SU - plane parameters // // SU [0] - direction cosines normal to surface Ex // // SU [1] - ------- Ey // // SU [2] - ------- Ez, Ex*Ex+Ey*Ey+Ez*Ez=1 // // SU [3] - distance to surface from (0,0,0) > 0 cm // // VO - initial parameters (coordinates(cm), direction cosines, // // charge/momentum (Gev-1) and derivatives this parameters // // Ax*Ax+Ay*Ay+Az*Az=1 // // X Y Z Ax Ay Az q/P // // VO[ 0] VO[ 1] VO[ 2] VO[ 3] VO[ 4] VO[ 5] VO[ 6] // // dX/dp dY/dp dZ/dp dAx/dp dAy/dp dAz/dp d(q/P)/dp*VO[6] // // VO[ 7] VO[ 8] VO[ 9] VO[10] VO[11] VO[12] VO[13] d()/dp1 // // VO[14] VO[15] VO[16] VO[17] VO[18] VO[19] VO[20] d()/dp2 // // ........................................................... d()/dpND // // // // Output parameters: // // // // VO - output parameters and derivatives after propogation in magnetic field // // defined by Mfield (KGauss) // // Where a Mfield(R,H) - is interface to magnetic field information // // input R[ 0],R[ 1],R[ 2] - X , Y and Z of the track // // output H[ 0],H[ 1],H[ 2] - Hx , Hy and Hz of the magnetic field // // H[ 3],H[ 4],H[ 5] - dHx/dx, dHx/dy and dHx/dz // // H[ 6],H[ 7],H[ 8] - dHy/dx, dHy/dy and dHy/dz // // H[ 9],H[10],H[11] - dHz/dx, dHz/dy and dHz/dz // // // // Path - trajectory length // // // // Authors: R.Brun, M.Hansroul, V.Perevoztchikov (Geant3) // // // // Porting to C++, new interface and Jacobian calculation // // had been done by Igor.Gavrilenko@cern.ch // // // // Minor modification by Sergei.Gerassimov@cern.ch for use in Traffic and Phast // // // // Here is assumed, that field is smooth enough i.e. field gradients are negligible // //------------------------------------------------------------------------------------//
References PaSetup::Ref().
| double PaAlgo::W2 | ( | const TLorentzVector & | pmu0, | |
| const TLorentzVector & | pmu, | |||
| double | m_P = 0.93827231 | |||
| ) | [inline, static] |
W2 via Lorentz vectors.
| pmu0 | the beam Lorentz vector | |
| pmu | the scattered particle Lorentz vector | |
| m_P | the mass of the target particle (default is proton) |
References W2().
| double PaAlgo::W2 | ( | const TVector3 & | pmu0, | |
| const TVector3 & | pmu, | |||
| double | m_P = 0.93827231, |
|||
| double | mmu = 0.105658357 | |||
| ) | [inline, static] |
| double PaAlgo::W2 | ( | double | pmu0, | |
| double | pmu, | |||
| double | Cos, | |||
| double | m_P = 0.93827231, |
|||
| double | mmu = 0.105658357 | |||
| ) | [inline, static] |
W2 via momenta and Cos.
| pmu0 | the absolute value of the beam momentum | |
| pmu | the absolute value of the scattered lepton momentum | |
| Cos | the cos of angle between beam and scattered lepton | |
| m_P | the mass of the target particle (default is proton) | |
| mmu | the mass of the scattering particle (default is muon) |
Referenced by W2().
| double PaAlgo::xbj | ( | const TLorentzVector & | pmu0, | |
| const TLorentzVector & | pmu, | |||
| double | m_P = 0.93827231 | |||
| ) | [inline, static] |
xBjorken via Lorentz vectors
| pmu0 | the beam Lorentz vector | |
| pmu | the scattered particle Lorentz vector | |
| m_P | the mass of the target particle (default is proton) |
References xbj().
| double PaAlgo::xbj | ( | const TVector3 & | pmu0, | |
| const TVector3 & | pmu, | |||
| double | m_P = 0.93827231, |
|||
| double | mmu = 0.105658357 | |||
| ) | [inline, static] |
| double PaAlgo::xbj | ( | double | pmu0, | |
| double | pmu, | |||
| double | Cos, | |||
| double | m_P = 0.93827231, |
|||
| double | mmu = 0.105658357 | |||
| ) | [inline, static] |
xBjorken via momenta and Cos
| pmu0 | the absolute value of the beam momentum | |
| pmu | the absolute value of the scattered lepton momentum | |
| Cos | the cos of angle between beam and scattered lepton | |
| m_P | the mass of the target particle (default is proton) | |
| mmu | the mass of the scattering particle (default is muon) |
Referenced by xbj().
| double PaAlgo::Xf | ( | const TLorentzVector & | pmu0, | |
| const TLorentzVector & | pmu, | |||
| const TLorentzVector & | plh, | |||
| double | m_P = 0.93827231 | |||
| ) | [inline, static] |
xF via Lorentz vectors
| pmu0 | the beam four-vector | |
| pmu | the scattered lepton four-vector | |
| plh | the hadron four-vector | |
| m_P | the target particle mass (default is proton) |
References Xf().
| double PaAlgo::Xf | ( | const TVector3 & | pmu0, | |
| const TVector3 & | pmu, | |||
| const TVector3 & | plh, | |||
| double | mh = 0.13957018, |
|||
| double | m_P = 0.93827231, |
|||
| double | mmu = 0.105658357 | |||
| ) | [inline, static] |
1.6.2