Skip to content

Commit

Permalink
Move remaining properties to new properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlingema committed Dec 8, 2016
1 parent beb088d commit 913c99d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 40 deletions.
12 changes: 1 addition & 11 deletions Generation/src/components/MomentumRangeParticleGun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,10 @@ DECLARE_TOOL_FACTORY( MomentumRangeParticleGun )

/// Constructor
MomentumRangeParticleGun::MomentumRangeParticleGun( const std::string & type ,
const std::string & name ,
const std::string & name ,
const IInterface * parent )
: GaudiTool( type , name, parent ) {
declareInterface< IParticleGunTool >( this ) ;
declareProperty( "MomentumMin" , m_minMom = 100.0 * Gaudi::Units::GeV, "Minimal momentum" ) ;
declareProperty( "ThetaMin" , m_minTheta = 0.1 * Gaudi::Units::rad, "Minimal theta" ) ;
declareProperty( "PhiMin" , m_minPhi = 0. * Gaudi::Units::rad, "Minimal phi" ) ;

declareProperty( "MomentumMax" , m_maxMom = 100.0 * Gaudi::Units::GeV, "Maximal momentum" ) ;
declareProperty( "ThetaMax" , m_maxTheta = 0.4 * Gaudi::Units::rad, "Maximal theta" ) ;
declareProperty( "PhiMax" , m_maxPhi = Gaudi::Units::twopi * Gaudi::Units::rad, "Maximal phi" ) ;

m_pdgCodes.push_back( -211 ); // default pi-
declareProperty("PdgCodes",m_pdgCodes, "list of pdg codes to produce");
}

/// Destructor
Expand Down
51 changes: 31 additions & 20 deletions Generation/src/components/MomentumRangeParticleGun.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

#include "GaudiAlg/GaudiTool.h"
#include "GaudiKernel/RndmGenerators.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "GaudiKernel/PhysicalConstants.h"

#include "Generation/IParticleGunTool.h"

/** @class MomentumRangeParticleGun MomentumRangeParticleGun.h "MomentumRangeParticleGun.h"
*
* Particle gun with given momentum range
*
*
* @author Patrick Robbe
* @author Benedikt Hegner
* @date 2008-05-18
Expand All @@ -18,43 +20,52 @@ class MomentumRangeParticleGun : public GaudiTool , virtual public IParticleGunT

public:
/// Constructor
MomentumRangeParticleGun( const std::string & type , const std::string& name,
MomentumRangeParticleGun( const std::string & type , const std::string& name,
const IInterface * parent ) ;

/// Destructor
virtual ~MomentumRangeParticleGun();

/// Initialize particle gun parameters
virtual StatusCode initialize();

/// Generation of particles
virtual void generateParticle( Gaudi::LorentzVector & momentum ,
Gaudi::LorentzVector & origin ,
virtual void generateParticle( Gaudi::LorentzVector & momentum ,
Gaudi::LorentzVector & origin ,
int & pdgId ) ;

/// Print counters
virtual void printCounters( ) { ; } ;

private:
double m_minMom; ///< Minimum momentum (Set by options)
double m_minTheta; ///< Minimum theta angle (Set by options)
double m_minPhi; ///< Minimum phi angle (Set by options)
private:
/// Minimum momentum (Set by options)
Gaudi::Property<double> m_minMom{this, "MomentumMin", 100.0 * Gaudi::Units::GeV, "Minimal momentum"};
/// Minimum theta angle (Set by options)
Gaudi::Property<double> m_minTheta{"ThetaMin", 0.1 * Gaudi::Units::rad, "Minimal theta"};
/// Minimum phi angle (Set by options)
Gaudi::Property<double> m_minPhi{"PhiMin", 0. * Gaudi::Units::rad, "Minimal phi"};

double m_maxMom; ///< Maximum momentum (Set by options)
double m_maxTheta; ///< Maximum theta angle (Set by options)
double m_maxPhi; ///< Maximum phi angle (Set by options)
/// Maximum momentum (Set by options)
Gaudi::Property<double> m_maxMom{"MomentumMax", 100.0 * Gaudi::Units::GeV, "Maximal momentum"};
/// Maximum theta angle (Set by options)
Gaudi::Property<double> m_maxTheta{"ThetaMax", 0.4 * Gaudi::Units::rad, "Maximal theta"};
/// Maximum phi angle (Set by options)
Gaudi::Property<double> m_maxPhi{"PhiMax", Gaudi::Units::twopi * Gaudi::Units::rad, "Maximal phi"};

double m_deltaMom; ///< Momentum range
double m_deltaTheta; ///< Theta range
double m_deltaPhi; ///< Phi range
/// Momentum range
Gaudi::Property<double> m_deltaMom{};
/// Theta range
Gaudi::Property<double> m_deltaTheta{};
/// Phi range
Gaudi::Property<double> m_deltaPhi{};

/// Pdg Codes of particles to generate (Set by options)
std::vector<int> m_pdgCodes;
Gaudi::Property<std::vector<int>> m_pdgCodes{"PdgCodes", {-211}, "list of pdg codes to produce"};

/// Masses of particles to generate
std::vector<double> m_masses;
/// Masses of particles to generate (derived from PDG codes)
std::vector<double> m_masses;

/// Names of particles to generate
/// Names of particles to generate (derived from PDG codes)
std::vector<std::string> m_names;

/// Flat random number generator
Expand Down
12 changes: 3 additions & 9 deletions Reconstruction/RecCalorimeter/src/components/JetClustering.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ class JetClustering: public GaudiAlgorithm {

/// type of area calculation
fastjet::AreaType m_areaType;

/// verbosity flag
bool m_verbose;
};


Expand Down Expand Up @@ -192,11 +189,9 @@ template< class P, class J>
std::vector<fastjet::PseudoJet> pjets = fastjet::sorted_by_pt(cs->inclusive_jets(m_ptMin));

J* jets = new J();
if(m_verbose)
std::cout<<"njets = "<<pjets.size()<<std::endl;
debug() << "njets = " << pjets.size() << endmsg;
for(const auto& pjet : pjets) {
if(m_verbose)
std::cout<<pjet.e()<<" "<<pjet.pt()<<" "<<pjet.eta()<<" "<<pjet.phi()<<std::endl;
debug() << pjet.e() << " " << pjet.pt() << " " << pjet.eta() << " " << pjet.phi() << endmsg;
auto jet = jets->create();
auto& core = jet.core();
core.p4.px = pjet.px();
Expand All @@ -209,8 +204,7 @@ template< class P, class J>
core.area = -1;
const std::vector<fastjet::PseudoJet>& constituents = pjet.constituents();
for(const auto& constit : constituents) {
if(m_verbose)
std::cout<<"\t"<<constit.user_index()<<std::endl;
debug() << "\t" << constit.user_index() << endmsg;
jet.addparticles(particles->at(constit.user_index()));
}
}
Expand Down

0 comments on commit 913c99d

Please sign in to comment.