Skip to content

Commit

Permalink
code style cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
mbluj committed May 5, 2020
1 parent b631c40 commit aea7414
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions RecoTauTag/RecoTau/src/PositionAtECalEntrance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,19 @@
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "CommonTools/BaseParticlePropagator/interface/BaseParticlePropagator.h"

#include <assert.h>
#include <cassert>

PositionAtECalEntrance::PositionAtECalEntrance()
: bField_z_(-1.)
{}
PositionAtECalEntrance::PositionAtECalEntrance() : bField_z_(-1.) {}

PositionAtECalEntrance::~PositionAtECalEntrance()
{}
PositionAtECalEntrance::~PositionAtECalEntrance() {}

void PositionAtECalEntrance::beginEvent(const edm::EventSetup& es)
{
void PositionAtECalEntrance::beginEvent(const edm::EventSetup& es) {
edm::ESHandle<MagneticField> bField;
es.get<IdealMagneticFieldRecord>().get(bField);
bField_z_ = bField->inTesla(GlobalPoint(0.,0.,0.)).z();
bField_z_ = bField->inTesla(GlobalPoint(0., 0., 0.)).z();
}

reco::Candidate::Point PositionAtECalEntrance::operator()(const reco::Candidate* particle, bool& success) const
{
reco::Candidate::Point PositionAtECalEntrance::operator()(const reco::Candidate* particle, bool& success) const {
assert(bField_z_ != -1.);
BaseParticlePropagator propagator = BaseParticlePropagator(
RawParticle(math::XYZTLorentzVector(particle->px(), particle->py(), particle->pz(), particle->energy()),
Expand All @@ -32,8 +27,9 @@ reco::Candidate::Point PositionAtECalEntrance::operator()(const reco::Candidate*
bField_z_);
propagator.propagateToEcalEntrance(false);
reco::Candidate::Point position;
if ( propagator.getSuccess() != 0 ) {
position = reco::Candidate::Point(propagator.particle().vertex().x(), propagator.particle().vertex().y(), propagator.particle().vertex().z());
if (propagator.getSuccess() != 0) {
position = reco::Candidate::Point(
propagator.particle().vertex().x(), propagator.particle().vertex().y(), propagator.particle().vertex().z());
success = true;
} else {
success = false;
Expand Down

0 comments on commit aea7414

Please sign in to comment.