Public Member Functions | Private Attributes | List of all members
leading_costheta Class Reference

#include <SelectionDefinitions.h>

Public Member Functions

 leading_costheta (int pdg)
 
double operator() (const double &Px, const double &Py, const double &Pz, const std::vector< int > &dPDGs, const std::vector< double > &dPx, const std::vector< double > &dPy, const std::vector< double > &dPz)
 

Private Attributes

int fPDG
 

Detailed Description

Definition at line 200 of file SelectionDefinitions.h.

Constructor & Destructor Documentation

leading_costheta::leading_costheta ( int  pdg)
inline

Definition at line 204 of file SelectionDefinitions.h.

Member Function Documentation

double leading_costheta::operator() ( const double &  Px,
const double &  Py,
const double &  Pz,
const std::vector< int > &  dPDGs,
const std::vector< double > &  dPx,
const std::vector< double > &  dPy,
const std::vector< double > &  dPz 
)
inline

Definition at line 206 of file SelectionDefinitions.h.

211  {
212  double costheta = -999.;
213  double max_p = -999.;
214  double P = sqrt(Px*Px + Py*Py + Pz*Pz);
215  for (size_t i = 0; i < dPDGs.size(); ++i) {
216  if (dPDGs[i] != fPDG) continue;
217 
218  double dP = sqrt(dPx[i]*dPx[i] + dPy[i]*dPy[i] + dPz[i]*dPz[i]);
219  if (dP > max_p) {
220  costheta = (dPx[i]*Px + dPy[i]*Py + dPz[i]*Pz)/(dP*P);
221  }
222  }
223  return costheta;
224  }
std::pair< float, std::string > P

Member Data Documentation

int leading_costheta::fPDG
private

Definition at line 202 of file SelectionDefinitions.h.


The documentation for this class was generated from the following file: