Skip to content

Commit

Permalink
Merge pull request #1258 from brownd1978/qval
Browse files Browse the repository at this point in the history
Use charge from KalSeed pdg code
  • Loading branch information
kutschke authored May 5, 2024
2 parents 07a76f5 + b8421cc commit f6fe4b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions Validation/src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mainlib = helper.make_mainlib ( [ 'mu2e_Validation_root',
'mu2e_MCDataProducts',
'mu2e_RecoDataProducts',
'mu2e_DataProducts',
'mu2e_GlobalConstantsService',
'mu2e_GeneralUtilities',
'mu2e_KinKalGeom',
babarlibs,
Expand Down
10 changes: 6 additions & 4 deletions Validation/src/ValKalSeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "Offline/MCDataProducts/inc/KalSeedMC.hh"
#include "Offline/MCDataProducts/inc/PrimaryParticle.hh"
#include "Offline/Mu2eKinKal/inc/WireHitState.hh"
#include "Offline/GlobalConstantsService/inc/GlobalConstantsHandle.hh"
#include "Offline/GlobalConstantsService/inc/ParticleDataList.hh"
#include <cmath>

namespace mu2e {
Expand Down Expand Up @@ -38,7 +40,7 @@ namespace mu2e {
_hpce = tfs.make<TH1D>("pce", "p CE", 100, 95.0, 110.);
_hpcep = tfs.make<TH1D>("pcep", "p CE+", 100, 82.0, 97.);
_hsignedp = tfs.make<TH1D>("signedp", "signedp", 200, -110., 110.);
_hsignedp2 = tfs.make<TH1D>("signedp", "signedp", 300, -500., 500.);
_hsignedp2 = tfs.make<TH1D>("signedp2", "signedp2", 300, -500., 500.);
_hpe = tfs.make<TH1D>("pe", "p error", 100, 0.0, 1.0);
_hRho = tfs.make<TH1D>("rho", "Transverse radius", 100, 0.0, 800.);
_hPhi = tfs.make<TH1D>("phi", "phi", 100, -M_PI, M_PI);
Expand Down Expand Up @@ -77,8 +79,8 @@ namespace mu2e {
return 0;
}

int ValKalSeed::fill(const KalSeedCollection& coll,
art::Event const& event) {
int ValKalSeed::fill(const KalSeedCollection& coll, art::Event const& event) {
auto const& ptable = GlobalConstantsHandle<ParticleDataList>();
// increment this by 1 any time the defnitions of the histograms or the
// histogram contents change, and will not match previous versions
_hVer->Fill(9.0);
Expand Down Expand Up @@ -117,7 +119,7 @@ namespace mu2e {
double p_mc = mcTrkP(event,vdid,p_pri);
SurfaceId sid = _vdmap[vdid];
auto ikinter = ks.intersection(sid);
double ksCharge = ks.intersections().front().pstate_.charge();
double ksCharge = ptable->particle(ks.particle()).charge();
if(ikinter != ks.intersections().end()){
auto mom3 = ikinter->momentum3();
double p = mom3.R();
Expand Down

0 comments on commit f6fe4b1

Please sign in to comment.