Skip to content

Commit

Permalink
add explanations and got rid of hard-coded values
Browse files Browse the repository at this point in the history
  • Loading branch information
beaudett committed Sep 4, 2018
1 parent 124bf7a commit d08a22d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions HGCalAnalysis/plugins/HGCalAnalysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ class HGCalAnalysis : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one:
std::vector<float> layerPositions_;
std::vector<double> dEdXWeights_;
std::vector<double> invThicknessCorrection_;
float hgcalOuterRadius_;
float hgcalInnerRadius_;

// and also the magnetic field
MagneticField const *aField_;
Expand All @@ -499,6 +501,8 @@ HGCalAnalysis::HGCalAnalysis(const edm::ParameterSet &iConfig)
particleFilter_(iConfig.getParameter<edm::ParameterSet>("TestParticleFilter")),
dEdXWeights_(iConfig.getParameter<std::vector<double>>("dEdXWeights")),
invThicknessCorrection_({1. / 1.132, 1. / 1.092, 1. / 1.084}),
hgcalOuterRadius_(iConfig.getParameter<double>("hgcalOuterRadius")),
hgcalInnerRadius_(iConfig.getParameter<double>("hgcalInnerRadius")),
pca_(new TPrincipal(3, "D")) {
// now do what ever initialization is needed
mySimEvent_ = new FSimEvent(particleFilter_);
Expand Down Expand Up @@ -1125,21 +1129,21 @@ void HGCalAnalysis::analyze(const edm::Event &iEvent, const edm::EventSetup &iSe

if (std::abs(myTrack.vertex().position().z()) >= layerPositions_[0]) continue;

unsigned nlayers = 40;
unsigned nlayers = recHitTools_.lastLayerFH();
if (myTrack.noEndVertex()) // || myTrack.genpartIndex()>=0)
{
HGCal_helpers::coordinates propcoords;
bool reachesHGCal = toHGCalPropagator.propagate(
myTrack.momentum(), myTrack.vertex().position(), myTrack.charge(), propcoords);
vtx = propcoords.toVector();

if (reachesHGCal && vtx.Rho() < 160 && vtx.Rho() > 25) {
if (reachesHGCal && vtx.Rho() < hgcalOuterRadius_ && vtx.Rho() > hgcalInnerRadius_) {
reachedEE = 2;
double dpt = 0;

for (int i = 0; i < myTrack.nDaughters(); ++i) dpt += myTrack.daughter(i).momentum().pt();
if (abs(myTrack.type()) == 11) fbrem = dpt / myTrack.momentum().pt();
} else if (reachesHGCal && vtx.Rho() > 160)
} else if (reachesHGCal && vtx.Rho() > hgcalOuterRadius_)
reachedEE = 1;

HGCal_helpers::simpleTrackPropagator indiv_particleProp(aField_);
Expand Down
2 changes: 2 additions & 0 deletions HGCalAnalysis/test/exampleConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
includeHaloPCA = cms.bool(True),
dEdXWeights = dEdX,
layerClusterPtThreshold = cms.double(-1), # All LayerCluster belonging to a multicluster are saved; this Pt threshold applied to the others
hgcalOuterRadius = cms.double(160.),
hgcalInnerRadius = cms.double(25.),
TestParticleFilter = ParticleFilterBlock.ParticleFilter
)

Expand Down

0 comments on commit d08a22d

Please sign in to comment.