CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

JetVertexMain Class Reference

#include <JetVertexMain.h>

List of all members.

Public Member Functions

 JetVertexMain (const edm::ParameterSet &parameters)
std::pair< double, bool > Main (const reco::CaloJet &jet, edm::Handle< reco::TrackCollection > tracks, double SIGNAL_V_Z, double SIGNAL_V_Z_Error)
 ~JetVertexMain ()

Private Member Functions

double DeltaR (double eta1, double eta2, double phi1, double phi2)
double Track_Pt (double px, double py)

Private Attributes

int Algo
double cone_size
double cutDeltaZ
double cutSigmaZ
std::string cutType
bool discriminator
double threshold

Detailed Description

Definition at line 13 of file JetVertexMain.h.


Constructor & Destructor Documentation

JetVertexMain::JetVertexMain ( const edm::ParameterSet parameters)

Definition at line 12 of file JetVertexMain.cc.

References edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and dtDQMClient_cfg::threshold.

                                                            {

  cutSigmaZ = parameters.getParameter<double>("JV_sigmaZ");
  cutDeltaZ = parameters.getParameter<double>("JV_deltaZ");
  threshold = parameters.getParameter<double>("JV_alpha_threshold");
  cone_size = parameters.getParameter<double>("JV_cone_size");
  Algo =  parameters.getParameter<int>("JV_type_Algo");
  cutType = parameters.getParameter<std::string>("JV_cutType");

}
JetVertexMain::~JetVertexMain ( ) [inline]

Definition at line 19 of file JetVertexMain.h.

{};

Member Function Documentation

double JetVertexMain::DeltaR ( double  eta1,
double  eta2,
double  phi1,
double  phi2 
) [private]

Definition at line 89 of file JetVertexMain.cc.

References M_PI, and mathSSE::sqrt().

                                                                              {

  double dphi = fabs(phi1-phi2);
  if(dphi > M_PI) dphi = 2*M_PI - dphi;
  double deta = fabs(eta1-eta2);
  return sqrt(dphi*dphi + deta*deta);

}
std::pair< double, bool > JetVertexMain::Main ( const reco::CaloJet jet,
edm::Handle< reco::TrackCollection tracks,
double  SIGNAL_V_Z,
double  SIGNAL_V_Z_Error 
)

Definition at line 24 of file JetVertexMain.cc.

References gather_cfg::cout, reco::LeafCandidate::et(), reco::LeafCandidate::eta(), reco::LeafCandidate::phi(), mathSSE::sqrt(), and dtDQMClient_cfg::threshold.

Referenced by cms::JetVertexAssociation::produce().

                                                                                             {

  std::pair<double, bool> parameter; 
 
  double jet_et = jet.et();
  double jet_phi = jet.phi();
  double jet_eta = jet.eta();

  //  cout<<"JET: "<<jet_et<<endl;
  double Pt_jets_X = 0. ;
  double Pt_jets_Y = 0. ;
  double Pt_jets_X_tot = 0. ;
  double Pt_jets_Y_tot = 0. ;

  TrackCollection::const_iterator track = tracks->begin ();

  if (tracks->size() > 0 )   { 
   for (; track != tracks->end (); track++) {
     double Vertex_Z = track->vz();
     double Vertex_Z_Error = track->dzError();
     double track_eta = track->eta();
     double track_phi = track->phi();

     if (DeltaR(track_eta,jet_eta, track_phi, jet_phi) < cone_size) {

                  double DeltaZ = Vertex_Z-signal_vert_Z;
                  double DeltaZ_Error = sqrt((Vertex_Z_Error*Vertex_Z_Error)+(signal_vert_z_error*signal_vert_z_error));
                  Pt_jets_X_tot += track->px();
                  Pt_jets_Y_tot += track->py();  
                  if (cutType == "sig") discriminator = (fabs(DeltaZ)/DeltaZ_Error) <= cutSigmaZ;
                  else discriminator = fabs(DeltaZ) < cutDeltaZ;
        
                  if (discriminator){
                    
                      Pt_jets_X += track->px();
                      Pt_jets_Y += track->py();
                       
                  }
 
   }
 } 
}
  double Var = -1;
  
  if (Algo == 1) Var =  Track_Pt(Pt_jets_X, Pt_jets_Y)/jet_et;
  else if (Algo == 2) {
      if (Track_Pt(Pt_jets_X_tot, Pt_jets_Y_tot)!=0)  Var =  Track_Pt(Pt_jets_X, Pt_jets_Y)/Track_Pt(Pt_jets_X_tot, Pt_jets_Y_tot);
      else  std::cout << "[Jets] JetVertexAssociation: Warning! problems for  Algo = 2: possible division by zero .." << std::endl;
  }
  else {
    
      Var =  Track_Pt(Pt_jets_X, Pt_jets_Y)/jet_et;
      std::cout << "[Jets] JetVertexAssociation: Warning! Algo = " << Algo << " not found; using Algo = 1" << std::endl;
  }

  //  cout<<"Var = "<<Var<<endl;

  if (Var >= threshold) parameter = std::pair<double, bool>(Var, true);
  else  parameter = std::pair<double, bool>(Var, false);

  return parameter;

}
double JetVertexMain::Track_Pt ( double  px,
double  py 
) [private]

Definition at line 98 of file JetVertexMain.cc.

References mathSSE::sqrt().

                                                  {

  return sqrt(px*px+py*py);

}

Member Data Documentation

int JetVertexMain::Algo [private]

Definition at line 34 of file JetVertexMain.h.

double JetVertexMain::cone_size [private]

Definition at line 33 of file JetVertexMain.h.

double JetVertexMain::cutDeltaZ [private]

Definition at line 31 of file JetVertexMain.h.

double JetVertexMain::cutSigmaZ [private]

Definition at line 30 of file JetVertexMain.h.

std::string JetVertexMain::cutType [private]

Definition at line 35 of file JetVertexMain.h.

Definition at line 36 of file JetVertexMain.h.

double JetVertexMain::threshold [private]

Definition at line 32 of file JetVertexMain.h.