Skip to content

Commit

Permalink
Merge pull request #299 from vvolkl/tracker-production-fixes
Browse files Browse the repository at this point in the history
Small Tracker production fixes: Install Triplet compact files, generalize ConstPtPGun
  • Loading branch information
clementhelsens authored Mar 12, 2018
2 parents e359b6e + dc4c6bc commit 89b9867
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions Detector/DetFCChhTrackerTkLayout/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include( DD4hep )
find_package(ROOT COMPONENTS MathCore GenVector Geom REQUIRED)

install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/compact DESTINATION Detector/DetFCChhTrackerTkLayout)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/triplet DESTINATION Detector/DetFCChhTrackerTkLayout)

gaudi_add_module(DetFCChhTrackerTkLayout
src/*.cpp
Expand Down
16 changes: 14 additions & 2 deletions Generation/src/components/ConstPtParticleGun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,20 @@ void ConstPtParticleGun::generateParticle(Gaudi::LorentzVector& momentum, Gaudi:
double eta = m_minEta + m_flatGenerator() * (m_deltaEta);

// Transform to x,y,z coordinates
int randIndex = m_flatGenerator() * m_ptList.size();
double pt = m_ptList[randIndex];
double pt = 0;
if (m_ptList.size() > 0) {
int randIndex = m_flatGenerator() * m_ptList.size();
pt = m_ptList[randIndex];
} else {
if (m_logSpacedPt) {
double logPtMin = std::log10(m_minPt);
double logPtMax = std::log10(m_maxPt);
pt = pow(10, logPtMin + (logPtMax - logPtMin) * m_flatGenerator());

} else {
pt = m_minPt + m_flatGenerator() * (m_maxPt - m_minPt);
}
}
px = pt * cos(phi);
py = pt * sin(phi);
pz = pt * sinh(eta);
Expand Down
13 changes: 12 additions & 1 deletion Generation/src/components/ConstPtParticleGun.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
/** @class ConstPtParticleGun ConstPtParticleGun.h "ConstPtParticleGun.h"
*
* Particle gun, that, given a list of pt's and an eta range, creates the desired four-momenta.
* To be more flexible, the gun uses only pt and eta values from a list, if given,
* and only if the lists are empty draws the values from a distribution between min and max.
*/
class ConstPtParticleGun : public GaudiTool, virtual public IParticleGunTool {

Expand All @@ -34,7 +36,16 @@ class ConstPtParticleGun : public GaudiTool, virtual public IParticleGunTool {
private:
/// Minimum momentum (Set by options)
Gaudi::Property<std::vector<double>> m_ptList{
this, "PtList", {100.0 * Gaudi::Units::GeV}, "List of transverse momenta to generate"};
this,
"PtList",
{},
"List of transverse momenta to generate. If empty, use flat distribution between PtMin and PtMax"};
Gaudi::Property<std::vector<double>> m_etaList{
this, "EtaList", {}, "List of eta values to generate. If empty, use flat distribution between EtaMin and EtaMax"};
Gaudi::Property<double> m_minPt{this, "PtMin", 1 * Gaudi::Units::GeV, "Minimal pt"};
/// Minimum phi angle (Set by options)
Gaudi::Property<double> m_maxPt{this, "PtMax", 100. * Gaudi::Units::GeV, "Maximal pt"};
Gaudi::Property<bool> m_logSpacedPt{this, "logSpacedPt", false, "Generate log spaced pt"};
/// Minimum theta angle (Set by options)
Gaudi::Property<double> m_minEta{this, "EtaMin", -3.5, "Minimal eta"};
/// Minimum phi angle (Set by options)
Expand Down

0 comments on commit 89b9867

Please sign in to comment.