Skip to content

Commit

Permalink
Change object passed by value to object passed by const reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Gartung committed May 28, 2013
1 parent 8db07b3 commit 5851f84
Show file tree
Hide file tree
Showing 34 changed files with 122 additions and 117 deletions.
8 changes: 4 additions & 4 deletions SimTracker/TrackHistory/plugins/TrackHistoryAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class TrackHistoryAnalyzer : public edm::EDAnalyzer
TrackClassifier classifier_;

std::string vertexString(
TrackingParticleRefVector,
TrackingParticleRefVector
const TrackingParticleRefVector&,
const TrackingParticleRefVector&
) const;

std::string vertexString(
Expand Down Expand Up @@ -209,8 +209,8 @@ std::string TrackHistoryAnalyzer::particleString(int pdgId) const


std::string TrackHistoryAnalyzer::vertexString(
TrackingParticleRefVector in,
TrackingParticleRefVector out
const TrackingParticleRefVector& in,
const TrackingParticleRefVector& out
) const
{
ParticleData const * pid;
Expand Down
8 changes: 4 additions & 4 deletions SimTracker/TrackHistory/plugins/VertexHistoryAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class VertexHistoryAnalyzer : public edm::EDAnalyzer
std::string particleString(int) const;

std::string vertexString(
TrackingParticleRefVector,
TrackingParticleRefVector
const TrackingParticleRefVector&,
const TrackingParticleRefVector&
) const;

std::string vertexString(
Expand Down Expand Up @@ -202,8 +202,8 @@ std::string VertexHistoryAnalyzer::particleString(int pdgId) const


std::string VertexHistoryAnalyzer::vertexString(
TrackingParticleRefVector in,
TrackingParticleRefVector out
const TrackingParticleRefVector& in,
const TrackingParticleRefVector& out
) const
{
ParticleData const * pid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// $Id: TtHadLRSignalSelCalc.h,v 1.1 2007/10/07 15:28:05 mfhansen Exp $
// $Id: TtHadLRSignalSelCalc.h,v 1.2 2008/02/17 11:18:53 rwolf Exp $
// Adapted TtHadLRSignalSelCalc.h,v 1.1 2007/06/15 08:49:19 heyninck Exp
// for fully hadronic channel

Expand Down Expand Up @@ -31,7 +31,7 @@ class TtHadLRSignalSelCalc {
public:

TtHadLRSignalSelCalc();
TtHadLRSignalSelCalc(TString,std::vector<int>);
TtHadLRSignalSelCalc(const TString&,const std::vector<int>&);
~TtHadLRSignalSelCalc();
void operator()(TtHadEvtSolution&);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TtHadLRSignalSelObservables{

// compare two jets in ET
struct CompareET {
bool operator()( pat::Jet j1, pat::Jet j2 ) const
bool operator()( const pat::Jet& j1, const pat::Jet& j2 ) const
{
return j1.et() > j2.et();
}
Expand All @@ -46,7 +46,7 @@ class TtHadLRSignalSelObservables{

// compare two jets in bdisc
struct CompareBdisc {
bool operator()( pat::Jet j1, pat::Jet j2 ) const
bool operator()( const pat::Jet& j1, const pat::Jet& j2 ) const
{
return j1.bDiscriminator("trackCountingJetTags") > j2.bDiscriminator("trackCountingJetTags");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Author: Jan Heyninck
// Created: Tue Apr 3 17:33:23 PDT 2007
//
// $Id: TtSemiLRSignalSelCalc.h,v 1.1 2007/06/15 08:49:19 heyninck Exp $
// $Id: TtSemiLRSignalSelCalc.h,v 1.2 2008/02/17 11:18:54 rwolf Exp $
//

#ifndef TtSemiLRSignalSelCalc_h
Expand All @@ -13,7 +13,7 @@
\brief Class to calculate the jet combination LR value and purity from a root-file with fit functions
\author Jan Heyninck
\version $Id: TtSemiLRSignalSelCalc.h,v 1.1 2007/06/15 08:49:19 heyninck Exp $
\version $Id: TtSemiLRSignalSelCalc.h,v 1.2 2008/02/17 11:18:54 rwolf Exp $
*/

#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -34,7 +34,7 @@ class TtSemiLRSignalSelCalc {
public:

TtSemiLRSignalSelCalc();
TtSemiLRSignalSelCalc(TString,std::vector<int>);
TtSemiLRSignalSelCalc(const TString&,const std::vector<int>&);
~TtSemiLRSignalSelCalc();

void operator()(TtSemiEvtSolution&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TtSemiLRSignalSelObservables{

// compare two jets in ET
struct CompareET {
bool operator()( pat::Jet j1, pat::Jet j2 ) const
bool operator()( const pat::Jet& j1, const pat::Jet& j2 ) const
{
return j1.et() > j2.et();
}
Expand All @@ -51,7 +51,7 @@ class TtSemiLRSignalSelObservables{

// compare two jets in bdisc
struct CompareBdisc {
bool operator()( pat::Jet j1, pat::Jet j2 ) const
bool operator()( const pat::Jet& j1, const pat::Jet& j2 ) const
{
return j1.bDiscriminator("trackCountingJetTags") > j2.bDiscriminator("trackCountingJetTags");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TtSemiLepSignalSel {
public:

TtSemiLepSignalSel();
TtSemiLepSignalSel(const std::vector<pat::Jet>&, math::XYZTLorentzVector, const edm::View<pat::MET>&);
TtSemiLepSignalSel(const std::vector<pat::Jet>&, const math::XYZTLorentzVector&, const edm::View<pat::MET>&);
~TtSemiLepSignalSel();

double sumEt() const { return var_sumEt; }
Expand All @@ -33,8 +33,8 @@ class TtSemiLepSignalSel {
double mindRjetlepton() const { return var_mindRjetlepton; }


double DeltaPhi(math::XYZTLorentzVector, math::XYZTLorentzVector);
double DeltaR(math::XYZTLorentzVector, math::XYZTLorentzVector);
double DeltaPhi(const math::XYZTLorentzVector&, const math::XYZTLorentzVector&);
double DeltaR(const math::XYZTLorentzVector&, const math::XYZTLorentzVector&);

private:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ TtSemiLepSignalSelMVAComputer::endJob()
{
}

double TtSemiLepSignalSelMVAComputer::DeltaPhi(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2)
double TtSemiLepSignalSelMVAComputer::DeltaPhi(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2)
{
double dPhi = fabs(v1.Phi() - v2.Phi());
if (dPhi > TMath::Pi()) dPhi = 2*TMath::Pi() - dPhi;
return dPhi;
}

double TtSemiLepSignalSelMVAComputer::DeltaR(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2)
double TtSemiLepSignalSelMVAComputer::DeltaR(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2)
{
double dPhi = DeltaPhi(v1,v2);
double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class TtSemiLepSignalSelMVAComputer : public edm::EDProducer {
virtual void produce(edm::Event& evt, const edm::EventSetup& setup);
virtual void endJob();

double DeltaPhi(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2);
double DeltaR(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2);
double DeltaPhi(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2);
double DeltaR(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2);

edm::InputTag muons_;
edm::InputTag jets_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ void TtSemiLepSignalSelMVATrainer::beginJob(){
}
}

double TtSemiLepSignalSelMVATrainer::DeltaPhi(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2)
double TtSemiLepSignalSelMVATrainer::DeltaPhi(const math::XYZTLorentzVector& v1,const math::XYZTLorentzVector& v2)
{
double dPhi = fabs(v1.Phi() - v2.Phi());
if (dPhi > TMath::Pi()) dPhi = 2*TMath::Pi() - dPhi;
return dPhi;
}

double TtSemiLepSignalSelMVATrainer::DeltaR(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2)
double TtSemiLepSignalSelMVATrainer::DeltaR(const math::XYZTLorentzVector& v1,const math::XYZTLorentzVector& v2)
{
double dPhi = DeltaPhi(v1,v2);
double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class TtSemiLepSignalSelMVATrainer : public edm::EDAnalyzer {
virtual void analyze(const edm::Event& evt, const edm::EventSetup& setup);
virtual void beginJob();

double DeltaPhi(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2);
double DeltaR(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2);
double DeltaPhi(const math::XYZTLorentzVector& v1,const math::XYZTLorentzVector& v2);
double DeltaR(const math::XYZTLorentzVector& v1,const math::XYZTLorentzVector& v2);

// pt sorting stuff
struct JetwithHigherPt {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// $Id: TtHadLRSignalSelCalc.cc,v 1.1 2007/10/07 15:29:05 mfhansen Exp $
// $Id: TtHadLRSignalSelCalc.cc,v 1.2 2008/02/17 11:18:10 rwolf Exp $
// copied TtSemiLRSignalSelCalc.cc,v 1.2 2007/06/18 14:12:18 heyninck Exp
// for fully hadronic channel

#include "TopQuarkAnalysis/TopEventSelection/interface/TtHadLRSignalSelCalc.h"

// constructor with path; default should not be used
TtHadLRSignalSelCalc::TtHadLRSignalSelCalc(TString fitInputPath, std::vector<int> observables)
TtHadLRSignalSelCalc::TtHadLRSignalSelCalc(const TString& fitInputPath, const std::vector<int>& observables)
{
std::cout << "=== Constructing a TtHadLRSignalSelCalc... " << std::endl;
myLR = new LRHelpFunctions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Author: Jan Heyninck
// Created: Tue Apr 3 17:33:23 PDT 2007
//
// $Id: TtSemiLRSignalSelCalc.cc,v 1.2 2007/06/18 14:12:18 heyninck Exp $
// $Id: TtSemiLRSignalSelCalc.cc,v 1.3 2008/02/17 11:18:10 rwolf Exp $
//
#include "TopQuarkAnalysis/TopEventSelection/interface/TtSemiLRSignalSelCalc.h"

// constructor with path; default should not be used
TtSemiLRSignalSelCalc::TtSemiLRSignalSelCalc(TString fitInputPath, std::vector<int> observables)
TtSemiLRSignalSelCalc::TtSemiLRSignalSelCalc(const TString& fitInputPath, const std::vector<int>& observables)
{
std::cout << "=== Constructing a TtSemiLRSignalSelCalc... " << std::endl;
myLR = new LRHelpFunctions();
Expand Down
6 changes: 3 additions & 3 deletions TopQuarkAnalysis/TopEventSelection/src/TtSemiLepSignalSel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

TtSemiLepSignalSel::TtSemiLepSignalSel(){}

TtSemiLepSignalSel::TtSemiLepSignalSel(const std::vector<pat::Jet>& topJets, math::XYZTLorentzVector lepton,
TtSemiLepSignalSel::TtSemiLepSignalSel(const std::vector<pat::Jet>& topJets, const math::XYZTLorentzVector& lepton,
const edm::View<pat::MET>& MET)
{ //function

Expand Down Expand Up @@ -73,14 +73,14 @@ TtSemiLepSignalSel::TtSemiLepSignalSel(const std::vector<pat::Jet>& topJets, mat

}

double TtSemiLepSignalSel::DeltaPhi(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2)
double TtSemiLepSignalSel::DeltaPhi(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2)
{
double dPhi = fabs(v1.Phi() - v2.Phi());
if (dPhi > TMath::Pi()) dPhi = 2*TMath::Pi() - dPhi;
return dPhi;
}

double TtSemiLepSignalSel::DeltaR(math::XYZTLorentzVector v1, math::XYZTLorentzVector v2)
double TtSemiLepSignalSel::DeltaR(const math::XYZTLorentzVector& v1, const math::XYZTLorentzVector& v2)
{
double dPhi = DeltaPhi(v1,v2);
double dR = TMath::Sqrt((v1.Eta()-v2.Eta())*(v1.Eta()-v2.Eta())+dPhi*dPhi);
Expand Down
4 changes: 2 additions & 2 deletions TopQuarkAnalysis/TopHitFit/interface/Fourvec_Event.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// $Id: Fourvec_Event.h,v 1.4 2009/11/18 12:38:02 haryo Exp $
// $Id: Fourvec_Event.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
//
// File: hitfit/Fourvec_Event.h
// Purpose: Represent an event for kinematic fitting as a collection
Expand Down Expand Up @@ -162,7 +162,7 @@ struct FE_Obj
@param the_muon_p Muon/inverse momentum flag.
*/
FE_Obj (Fourvec the_p,
FE_Obj (const Fourvec& the_p,
double the_mass,
int the_label,
double the_p_error,
Expand Down
8 changes: 4 additions & 4 deletions TopQuarkAnalysis/TopHitFit/interface/Top_Decaykin.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// $Id: Top_Decaykin.h,v 1.7 2010/07/19 13:57:51 haryo Exp $
// $Id: Top_Decaykin.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
//
// File: hitfit/Top_Decaykin.h
// Purpose: Calculate some kinematic quantities for ttbar events.
Expand Down Expand Up @@ -239,9 +239,9 @@ class Top_Decaykin
@param top The four-momentum of top.
*/
static double cos_theta_star(const Fourvec fermion,
const Fourvec W,
const Fourvec top);
static double cos_theta_star(const Fourvec& fermion,
const Fourvec& W,
const Fourvec& top);

// Solve cos theta star in lepton side of lepton+jets event
/**
Expand Down
4 changes: 2 additions & 2 deletions TopQuarkAnalysis/TopHitFit/src/Fourvec_Event.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// $Id: Fourvec_Event.cc,v 1.6 2011/04/26 13:35:49 haryo Exp $
// $Id: Fourvec_Event.cc,v 1.1 2011/05/26 09:47:00 mseidel Exp $
//
// File: src/Fourvec_Event.cc
// Purpose: Represent an event for kinematic fitting as a collection
Expand Down Expand Up @@ -46,7 +46,7 @@ using std::ostream;
namespace hitfit {


FE_Obj::FE_Obj (Fourvec the_p,
FE_Obj::FE_Obj (const Fourvec& the_p,
double the_mass,
int the_label,
double the_p_error,
Expand Down
8 changes: 4 additions & 4 deletions TopQuarkAnalysis/TopHitFit/src/Top_Decaykin.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// $Id: Top_Decaykin.cc,v 1.10 2010/08/05 02:31:24 haryo Exp $
// $Id: Top_Decaykin.cc,v 1.1 2011/05/26 09:47:00 mseidel Exp $
//
// File: src/Top_Decaykin.cc
// Purpose: Calculate some kinematic quantities for ttbar events.
Expand Down Expand Up @@ -433,9 +433,9 @@ ostream& Top_Decaykin::dump_ev (std::ostream& s, const Lepjets_Event& ev)
}


double Top_Decaykin::cos_theta_star(const Fourvec fermion,
const Fourvec W,
const Fourvec top)
double Top_Decaykin::cos_theta_star(const Fourvec& fermion,
const Fourvec& W,
const Fourvec& top)
//
// Purpose: Calculate cos theta star in top decay
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef TtHadLRJetCombCalc_h
#define TtHadLRJetCombCalc_h
// $Id: TtHadLRJetCombCalc.h,v 1.1 2007/10/07 15:33:27 mfhansen Exp $
// $Id: TtHadLRJetCombCalc.h,v 1.2 2008/02/17 11:27:11 rwolf Exp $
// copied TtSemiLRJetCombCalc.h,v 1.3 2007/06/15 08:53:52 by heyninck

#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -21,7 +21,7 @@ class TtHadLRJetCombCalc {
public:

TtHadLRJetCombCalc();
TtHadLRJetCombCalc(TString,std::vector<int>);
TtHadLRJetCombCalc(const TString&,const std::vector<int>&);
~TtHadLRJetCombCalc();

void operator()(TtHadEvtSolution&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Author: Jan Heyninck
// Created: Tue Apr 3 17:33:23 PDT 2007
//
// $Id: TtSemiLRJetCombCalc.h,v 1.3 2007/06/15 08:53:52 heyninck Exp $
// $Id: TtSemiLRJetCombCalc.h,v 1.4 2008/02/17 11:27:11 rwolf Exp $
//

#ifndef TtSemiLRJetCombCalc_h
Expand All @@ -13,7 +13,7 @@
\brief Class to calculate the jet combination LR value and purity from a root-file with fit functions
\author Jan Heyninck
\version $Id: TtSemiLRJetCombCalc.h,v 1.3 2007/06/15 08:53:52 heyninck Exp $
\version $Id: TtSemiLRJetCombCalc.h,v 1.4 2008/02/17 11:27:11 rwolf Exp $
*/

#include "FWCore/Framework/interface/EventSetup.h"
Expand All @@ -34,7 +34,7 @@ class TtSemiLRJetCombCalc {
public:

TtSemiLRJetCombCalc();
TtSemiLRJetCombCalc(TString,std::vector<int>);
TtSemiLRJetCombCalc(const TString&,const std::vector<int>&);
~TtSemiLRJetCombCalc();

void operator()(TtSemiEvtSolution&);
Expand Down
4 changes: 2 additions & 2 deletions TopQuarkAnalysis/TopJetCombination/src/TtHadLRJetCombCalc.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// $Id: TtHadLRJetCombCalc.cc,v 1.1 2007/10/07 15:34:16 mfhansen Exp $
// $Id: TtHadLRJetCombCalc.cc,v 1.2 2008/02/17 11:27:55 rwolf Exp $
// copied TtSemiLRJetCombCalc.cc,v 1.4 2007/06/18 14:08:16 by heyninck
//
#include "TopQuarkAnalysis/TopJetCombination/interface/TtHadLRJetCombCalc.h"

// constructor with path; default should not be used
TtHadLRJetCombCalc::TtHadLRJetCombCalc(TString fitInputPath, std::vector<int> observables)
TtHadLRJetCombCalc::TtHadLRJetCombCalc(const TString& fitInputPath, const std::vector<int>& observables)
{
std::cout << "=== Constructing a TtHadLRJetCombCalc... " << std::endl;
myLR = new LRHelpFunctions();
Expand Down
4 changes: 2 additions & 2 deletions TopQuarkAnalysis/TopJetCombination/src/TtSemiLRJetCombCalc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Author: Jan Heyninck
// Created: Tue Apr 3 17:33:23 PDT 2007
//
// $Id: TtSemiLRJetCombCalc.cc,v 1.3 2007/06/15 08:53:54 heyninck Exp $
// $Id: TtSemiLRJetCombCalc.cc,v 1.4 2007/06/18 14:08:16 heyninck Exp $
//
#include "TopQuarkAnalysis/TopJetCombination/interface/TtSemiLRJetCombCalc.h"

// constructor with path; default should not be used
TtSemiLRJetCombCalc::TtSemiLRJetCombCalc(TString fitInputPath, std::vector<int> observables) {
TtSemiLRJetCombCalc::TtSemiLRJetCombCalc(const TString& fitInputPath, const std::vector<int>& observables) {
std::cout << "=== Constructing a TtSemiLRJetCombCalc... " << std::endl;
myLR = new LRHelpFunctions();
addPurity = false;
Expand Down
Loading

0 comments on commit 5851f84

Please sign in to comment.