#ifndef _JetVariables_HH_ #define _JetVariables_HH_ //////////////////////////////////////////////////////////////////// // File: JetVariables.hh // Authors: Abe DeBenedetti, Matt Reece // Purpose: High level analysis jet variables defined as functions // Created: 11/15/2000 // // Revision: 0.1 // //////////////////////////////////////////////////////////////////// //#include "JetObjects/CdfJet.hh" //#include "CLHEP/Vector/LorentzVector.h" #include class HepLorentzVector; class CdfJet; class Vertex; class VertexColl; // I can't seem to get a forward declaration to work, so: #include "TrackingObjects/Storable/CdfTrackView.hh" namespace JetVariables { const double NO_Z_CORRECTION = -10000.0; // 10/11/2001 Tracking Revisions // The CdfJet::tracksInCone() function checks only for (eta,phi0) // of track within a cone of 0.4 of (eta,phi) of jet. These could // be calculated from very different vertices, which could cause // some problems. In order to allow for different ways of assigning // tracks to jets, we have modified all track-related functions to // accept a CdfTrackView_h containing the tracks that are to be // considered "in the jet." A default listing of such tracks can // be obtained from the function below: bool jetTracksDefault(const CdfJet& jet, CdfTrackView_h& hTrkView, double coneSize = 0.4, string process = "PROD"); // Alternatively, just get the tracks as given by CdfJet bool jetTracksOriginal(const CdfJet& jet, CdfTrackView_h& hTrkView, double coneSize = 0.4, string process = "PROD"); // This should probably go somewhere else! // Given track's initial position, momentum, charge, // find the extrapolated (eta, phi) when it reaches // the calorimeter. bool extrapolatedEndEtaPhi(HepPoint3D position, Hep3Vector momentum, int charge, double& eta, double& phi); // 4/27/2001 Z-VERTEX CORRECTIONS // WARNING: These are rough corrections based on recalculating // sin(theta) from a different z-vertex than the one used in jet // clustering. It is recommended that the jet clustering module // is run again if accurate corrections are needed. Use the vertex // strategy talk-to parameter for this. // To use the data already contained in the jet, simply pass // zCorrect=false (which is the default). double jetCosTheta(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); double jetSinTheta(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); //what was written before // Jet Et, from four-vector double jetEt(const CdfJet& jet, double zVertex=NO_Z_CORRECTION) ; // Jet mass, from four-vector double jetMass(const CdfJet& jet); // Jet eta from vertex double jetEta(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); // Jet detector eta (i.e. eta from origin) double jetDetectorEta(const CdfJet& jet); // Jet phi (from four-vector) double jetPhi(const CdfJet& jet); double jetEmFraction(const CdfJet& jet); int jetNChargedTracks(const CdfJet& jet, const CdfTrackView_h& trks); double jetGuardEnergy(const CdfJet& jet); //the rest of the easly accessible variables // Jet charge fraction: this is Sum(track Pts) / Et, where Et is // calculated from the four-vector double jetChargeFraction(const CdfJet& jet, const CdfTrackView_h& trks, double zVertex=NO_Z_CORRECTION); // Centroid eta, phi: these are in global coordinates double jetCentroidEta(const CdfJet& jet); double jetCentroidPhi(const CdfJet& jet); // Various moments calculated by CdfJet double jetEtaEtaMoment(const CdfJet& jet); double jetEtaPhiMoment(const CdfJet& jet); double jetPhiPhiMoment(const CdfJet& jet); // This Et comes from the Centroid object stored by CdfJet double jetCentroidEt(const CdfJet& jet); // TotP is the total momentum from the four vector // For SumPt of tracks, use jetPtOut below. double jetTotP(const CdfJet& jet); // Pt from the four vector double jetPt(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); // Pt squared from the four-vector double jetPtSquared(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); // Theta from the given vertex double jetTheta(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); // Mass squared, from the four-vector double jetMassSquared(const CdfJet& jet); // Rapidity: (1/2) log((E+Pz)/(E-Pz)) wrt vertex (same formula used by CdfJet) double jetRapidity(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); // Access the four-vector itself, wrt. vertex given HepLorentzVector jetFourMomentum(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); // Access individual components double jetPx(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); double jetPy(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); double jetPz(const CdfJet& jet, double zVertex=NO_Z_CORRECTION); double jetTotEnergy(const CdfJet& jet); // New code 12/07/2000 Matt Reece // Mean z vertex position for all tracks in cone // (weighted by sigma^2) double jetZVertex(const CdfJet& jet, const CdfTrackView_h& trks); // Standard deviation of z vertex positions double jetRmsZ0(const CdfJet& jet, const CdfTrackView_h& trks); // Get Z vertex and standard deviation at once bool jetZVertexInfo(const CdfJet& jet, const CdfTrackView_h& trks, double& zVertex, double& zSigma); // sum of Pt for all tracks in cone double jetPtOut(const CdfJet& jet, const CdfTrackView_h& trks); // New code 1/10/2001 Matt Reece // number of tracks in jet with positive impact parameter // (in the sense of the IP vector d pointing within 90 degrees of the // jet direction). // Note that this just takes the sign of the dot product . // This means that when d is very small (i.e., probably the track came // directly from the vertex) this may count the IP as negative. // It is thus advisable to cut on the significance of d rather than // trusting this number too much! int jetNTracksPositiveIP(const CdfJet& jet, const CdfTrackView_h& trks); // number of tracks in jet with positive angular momentum about z-axis // (the way the tracking code defines sign of impact parameter) int jetNTracksPositiveLz(const CdfJet& jet, const CdfTrackView_h& trks); // New 7/1/2002: get occupancy (# tracks pointing at vertex) as well bool jetVtxStats(const CdfJet& jet, const CdfTrackView_h& trks, const Vertex& vertex, const VertexColl& allVertices, double& sumPt, int& occupancy, double& fractionOccupancy); // New code 2/1/2001 // The VertexColl parameter for these two functions // should come from the VxPrim module. // sum pt from all tracks in the jet pointing to the given vertex double jetVPt(const CdfJet& jet, const CdfTrackView_h& trks, const Vertex& vertex, const VertexColl& allVertices); // sum pt from all the tracks in the jet not located within // 5 cm of any vertex candidate. double jetNoVPt(const CdfJet& jet, const CdfTrackView_h& trks, const VertexColl& allVertices); // JTCORFM: Underlying event correction with event-by-event multiple // vertex correction, out-of-cone correction, absolute energy scale // correction. // Modified 10/12/2001: It appears new parameters have been added to makeJTC96Jet. // I'm adding them here too... // Modified 15 Mar 2003: Uses new framework. Thanks to J.F. Arguin for // the code. // NOTE: THE MEANING OF nRun HAS CHANGED. It now does run-by-run // corrections. // Meaning of parameters: // offVer = 2 for data, 0 for Monte Carlo // nVertex = # of class 12 ZVertices // nRun = run number // coneSize = jet cone size as a real number (the function will translate // to 0, 1, 2) double jetCorFM(const CdfJet& jet, int offVer=2, int nVertex=1, int nRun=138864, double coneSize=0.4); // JTCORFD: No underlying event correction no out-of-cone correction, // yes absolute energy scale correction. // Modified 15 Mar 2003: Uses new framework. Thanks to J.F. Arguin for // the code. // NOTE: THE MEANING OF nRun HAS CHANGED. It now does run-by-run // corrections. // Meaning of parameters: // offVer = 2 for data, 0 for Monte Carlo // nVertex = # of class 12 ZVertices // nRun = run number // coneSize = jet cone size as a real number (the function will translate // to 0, 1, 2) double jetCorFD(const CdfJet& jet, int offVer=2, int nVertex=1, int nRun=138864, double coneSize=0.4); // Number of tracks in the jet used by SECVTX // Assumes the SecVtxModule (from BTagMods/) has been called int jetNumSecVtxTracks(const CdfJet& jet, const CdfTrackView_h& trks, const char *theDescription="SecVtxTracks"); // int jetNumSecVtxTracks(const CdfJet& jet, const CdfTrackView_h& trks); // JTWORD: correspondence between jet and other physics objects in the event // WARNING: currently only photon matching (bits 7 and 8) and MET matching // (bit 0) are implemented unsigned short jetWord(const CdfJet& jet, const CdfTrackView_h& trks, double zVertex=NO_Z_CORRECTION, double coneSize=0.4); } #endif