Skip to content

Commit

Permalink
moving sinh conversion to constructor for speed-up
Browse files Browse the repository at this point in the history
  • Loading branch information
swagata87 committed Oct 1, 2021
1 parent 075154c commit a2fea42
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class MinHitsTrajectoryFilter final : public TrajectoryFilter {
public:
explicit MinHitsTrajectoryFilter(int minHits = 5,
double highEtaSwitch = 5.0,
double highEtaSwitch = sinh(5.0),
int minHitsAtHighEta = 5,
int seedPairPenalty = 0)
: theMinHits(minHits),
Expand All @@ -23,7 +23,7 @@ class MinHitsTrajectoryFilter final : public TrajectoryFilter {

MinHitsTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC)
: theMinHits(pset.getParameter<int>("minimumNumberOfHits")),
theHighEtaSwitch(pset.getParameter<double>("highEtaSwitch")),
theHighEtaSwitch(sinh(pset.getParameter<double>("highEtaSwitch"))),
theMinHitsAtHighEta(pset.getParameter<int>("minHitsAtHighEta")),
theSeedPairPenalty(pset.getParameter<int>("seedPairPenalty")) {}

Expand Down Expand Up @@ -51,11 +51,10 @@ class MinHitsTrajectoryFilter final : public TrajectoryFilter {
bool passed = false;

if (!traj.empty()) {
auto pt = traj.lastMeasurement().updatedState().freeTrajectoryState()->momentum().perp();
auto pt2 = traj.lastMeasurement().updatedState().freeTrajectoryState()->momentum().perp2();
auto pz = traj.lastMeasurement().updatedState().freeTrajectoryState()->momentum().z();
auto sinhTrajEta2 = (pz * pz) / (pt * pt);
auto myEtaSwitch = sinh(theHighEtaSwitch);
if (sinhTrajEta2 < (myEtaSwitch * myEtaSwitch)) {
auto sinhTrajEta2 = (pz * pz) / pt2;
if (sinhTrajEta2 < (theHighEtaSwitch * theHighEtaSwitch)) {
if (traj.foundHits() >= theMinHits + seedPenalty)
passed = true;
} else { //absTrajEta>theHighEtaSwitch, so apply relaxed cuts
Expand Down

0 comments on commit a2fea42

Please sign in to comment.