Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix review comments (#20)
Browse files Browse the repository at this point in the history
tomalin authored May 21, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 90f6c41 commit 9b8d2c4
Showing 44 changed files with 278 additions and 417 deletions.
4 changes: 2 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/ChiSquaredFitBase.h
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@
#include "L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h"
#include "L1Trigger/TrackFindingTMTT/interface/Settings.h"
#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h"
#include "TMatrixD.h"
#include "TVectorD.h"
#include <TMatrixD.h>
#include <TVectorD.h>

#include <vector>
#include <map>
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ namespace tmtt {
class ConverterToTTTrack {
public:
// Initialize constants.
ConverterToTTTrack(const Settings* settings) : settings_(settings) { invPtToInvR_ = settings->invPtToInvR(); }
ConverterToTTTrack(const Settings* settings) : settings_(settings), invPtToInvR_(settings->invPtToInvR()) {}

// Convert L1fittedTrack or L1track3D (track candidates after/before fit) to TTTrack format.
TTTrack<Ref_Phase2TrackerDigi_> makeTTTrack(const L1trackBase* trk,
2 changes: 0 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/DigitalStub.h
Original file line number Diff line number Diff line change
@@ -29,8 +29,6 @@ namespace tmtt {
double bend_orig,
unsigned int iPhiSec);

~DigitalStub() {}

// Redo phi digitisation assigning stub to a different phi sector;
// (Return arg indicates if any work done).
bool changePhiSec(unsigned int iPhiSec);
2 changes: 0 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/DigitalTrack.h
Original file line number Diff line number Diff line change
@@ -24,8 +24,6 @@ namespace tmtt {
// Digitize track
DigitalTrack(const Settings* settings, const std::string& fitterName, const L1fittedTrack* fitTrk);

~DigitalTrack() {}

//--- The functions below return variables post-digitization.

// half inverse curvature of track.
2 changes: 0 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h
Original file line number Diff line number Diff line change
@@ -25,8 +25,6 @@ namespace tmtt {
*/
DupFitTrkKiller(const Settings* settings);

~DupFitTrkKiller() {}

/**
* Eliminate duplicate tracks from the input collection, and so return a reduced list of tracks.
*/
5 changes: 1 addition & 4 deletions L1Trigger/TrackFindingTMTT/interface/GlobalCacheTMTT.h
Original file line number Diff line number Diff line change
@@ -18,10 +18,6 @@

namespace tmtt {

namespace {
std::mutex myMutex;
}

class GlobalCacheTMTT {
public:
GlobalCacheTMTT(const edm::ParameterSet& iConfig)
@@ -43,6 +39,7 @@ namespace tmtt {
// Set functions
void setListTrackerModule(const std::list<TrackerModule>& list) const {
// Allow only one thread to run this function at a time
static std::mutex myMutex;
std::lock_guard<std::mutex> myGuard(myMutex);

// Only need one copy of tracker geometry for histogramming.
5 changes: 3 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/HTbase.h
Original file line number Diff line number Diff line change
@@ -4,7 +4,8 @@
#include "L1Trigger/TrackFindingTMTT/interface/HTcell.h"
#include "L1Trigger/TrackFindingTMTT/interface/L1track2D.h"

#include "boost/numeric/ublas/matrix.hpp"
#include <boost/numeric/ublas/matrix.hpp>

#include <vector>
#include <list>
#include <utility>
@@ -27,7 +28,7 @@ namespace tmtt {
HTbase(
const Settings* settings, unsigned int iPhiSec, unsigned int iEtaReg, unsigned int nBinsX, unsigned int nBinsY);

virtual ~HTbase() {}
virtual ~HTbase() = default;

// Termination. Causes HT array to search for tracks etc.
virtual void end();
6 changes: 3 additions & 3 deletions L1Trigger/TrackFindingTMTT/interface/HTrphi.h
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ namespace tmtt {
float phiCentreSector,
ErrorMonitor* errMon = nullptr);

~HTrphi() override {}
~HTrphi() override = default;

// Add stub to HT array.
// If eta subsectors are being used within each sector, specify which ones the stub is compatible with.
@@ -143,12 +143,12 @@ namespace tmtt {
unsigned int killSomeHTCellsRphi_;
// Options for killing stubs/tracks that cant be sent within time-multiplexed period.
bool busyInputSectorKill_;
unsigned int busyInputSectorNumStubs_;
bool busySectorKill_;
unsigned int busyInputSectorNumStubs_;
unsigned int busySectorNumStubs_;
std::vector<unsigned int> busySectorMbinRanges_;
bool busySectorUseMbinRanges_;
std::vector<unsigned int> busySectorMbinOrder_;
bool busySectorUseMbinRanges_;
bool busySectorUseMbinOrder_;
std::vector<unsigned int> busySectorMbinLow_;
std::vector<unsigned int> busySectorMbinHigh_;
15 changes: 6 additions & 9 deletions L1Trigger/TrackFindingTMTT/interface/Histos.h
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h"
#include "L1Trigger/TrackFindingTMTT/interface/TrackerModule.h"

#include "boost/numeric/ublas/matrix.hpp"
#include <boost/numeric/ublas/matrix.hpp>
using boost::numeric::ublas::matrix;

#include <vector>
@@ -39,7 +39,7 @@ namespace tmtt {
// Store cfg parameters.
Histos(const Settings* settings);

virtual ~Histos() {}
virtual ~Histos() = default;

// Book & fill all histograms.
virtual void book();
@@ -112,6 +112,8 @@ namespace tmtt {
virtual void printHybridDupRemovalPerformance(){};

protected:
edm::Service<TFileService> fs_;

// Configuration parameters.
const Settings* settings_;
unsigned int genMinStubLayers_;
@@ -126,8 +128,6 @@ namespace tmtt {
bool ranRZfilter_;
bool resPlotOpt_;

edm::Service<TFileService> fs_;

bool oldSumW2opt_;

// Histograms of input data.
@@ -217,7 +217,6 @@ namespace tmtt {
std::map<std::string, TH1F*> hisNumFitTrks_;
std::map<std::string, TH1F*> hisNumFitTrksPerNon_;
std::map<std::string, TH1F*> hisNumFitTrksPerSect_;

std::map<std::string, TH1F*> hisStubsPerFitTrack_;
std::map<std::string, TProfile*> profStubsOnFitTracks_;

@@ -241,15 +240,13 @@ namespace tmtt {
std::map<std::string, TH1F*> hisKalmanChi2DofSkipLay1Unmatched_;
std::map<std::string, TH1F*> hisKalmanChi2DofSkipLay2Unmatched_;

std::map<std::string, TH1F*> hisFitChi2DofMatched_;
std::map<std::string, TH1F*> hisFitChi2DofRphiMatched_;
std::map<std::string, TH1F*> hisFitChi2DofRzMatched_;
std::map<std::string, TProfile*> profFitChi2DofVsInvPtMatched_;
std::map<std::string, TProfile*> profFitChi2DofRphiVsInvPtMatched_;

std::map<std::string, TH1F*> hisFitChi2DofUnmatched_;
std::map<std::string, TH1F*> hisFitChi2DofRphiUnmatched_;
std::map<std::string, TH1F*> hisFitChi2DofRzUnmatched_;
std::map<std::string, TProfile*> profFitChi2DofVsInvPtUnmatched_;
std::map<std::string, TProfile*> profFitChi2DofRphiVsInvPtUnmatched_;

std::map<std::string, TProfile*> hisQoverPtResVsTrueEta_;
std::map<std::string, TProfile*> hisPhi0ResVsTrueEta_;
5 changes: 1 addition & 4 deletions L1Trigger/TrackFindingTMTT/interface/KFParamsComb.h
Original file line number Diff line number Diff line change
@@ -3,9 +3,6 @@

#include "L1Trigger/TrackFindingTMTT/interface/KFbase.h"
#include "L1Trigger/TrackFindingTMTT/interface/L1track3D.h"
#include "TMatrixD.h"

#include <vector>

///=== This is the Kalman Combinatorial Filter for 4 & 5 helix parameters track fit algorithm.
///=== All variable names & equations come from Fruhwirth KF paper
@@ -17,7 +14,7 @@ namespace tmtt {
public:
KFParamsComb(const Settings* settings, const uint nHelixPar, const std::string& fitterName);

~KFParamsComb() override {}
~KFParamsComb() override = default;

protected:
//--- Input data
14 changes: 5 additions & 9 deletions L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h
Original file line number Diff line number Diff line change
@@ -65,14 +65,10 @@ namespace tmtt {
iPhiSec_(iPhiSec),
iEtaReg_(iEtaReg),
optoLinkID_(l1track3D->optoLinkID()),
accepted_(accepted),
nSkippedLayers_(0),
numUpdateCalls_(0),
numIterations_(0) {}

KFTrackletTrack(){}; // Creates track object, but doesn't std::set any variables.

~KFTrackletTrack() {}
numIterations_(0),
accepted_(accepted) {}

//--- Optionally std::set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit).
void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) {
@@ -235,9 +231,6 @@ namespace tmtt {
std::vector<const Stub*> matchedStubs_;
unsigned int nMatchedLayers_;

//--- Has the track fit declared this to be a valid track?
bool accepted_;

//--- Info specific to KF fitter.
unsigned int nSkippedLayers_;
unsigned int numUpdateCalls_;
@@ -247,6 +240,9 @@ namespace tmtt {
std::unordered_map<std::string, int> stateCalls_;

std::shared_ptr<DigitalTrack> digitalTrack_; // Class used to digitize track if required.

//--- Has the track fit declared this to be a valid track?
bool accepted_;
};

} // namespace tmtt
4 changes: 2 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/KFbase.h
Original file line number Diff line number Diff line change
@@ -159,10 +159,10 @@ namespace tmtt {

unsigned int numUpdateCalls_;

const TP *tpa_;

// All helix states KF produces for current track.
std::vector<std::unique_ptr<const KalmanState>> listAllStates_;

const TP *tpa_;
};

} // namespace tmtt
10 changes: 2 additions & 8 deletions L1Trigger/TrackFindingTMTT/interface/KalmanState.h
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@

#include "L1Trigger/TrackFindingTMTT/interface/Stub.h"
#include "L1Trigger/TrackFindingTMTT/interface/KFbase.h"
#include "TMatrixD.h"
#include "TVectorD.h"
#include <TMatrixD.h>
#include <TVectorD.h>

#include <map>

@@ -21,7 +21,6 @@ namespace tmtt {

class KalmanState {
public:
KalmanState();
KalmanState(const Settings *settings,
const L1track3D &candidate,
unsigned nSkipped,
@@ -35,11 +34,6 @@ namespace tmtt {
double chi2rphi,
double chi2rz);

KalmanState(const KalmanState &p);
~KalmanState() {}

KalmanState &operator=(const KalmanState &other);

const Settings *settings() const { return settings_; }
// KF layer where next stub to extend this state should be sought.
unsigned nextLayer() const { return (1 + kLayer_); }
14 changes: 7 additions & 7 deletions L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h
Original file line number Diff line number Diff line change
@@ -66,10 +66,10 @@ namespace tmtt {
phi0_bcon_(phi0),
chi2rphi_bcon_(chi2rphi),
nHelixParam_(nHelixParam),
accepted_(accepted),
nSkippedLayers_(0),
numUpdateCalls_(0),
numIterations_(0) {
numIterations_(0),
accepted_(accepted) {
if (l1track3D != nullptr) {
iPhiSec_ = l1track3D->iPhiSec();
iEtaReg_ = l1track3D->iEtaReg();
@@ -108,7 +108,7 @@ namespace tmtt {
// Creates track rejected by fitter.
L1fittedTrack() : L1fittedTrack(nullptr, nullptr, noStubs_, 0, 0., 0., 0., 0., 0., 0., 0., 0, false) {}

~L1fittedTrack() override {}
~L1fittedTrack() override = default;

//--- Optionally std::set track helix params & chi2 if beam-spot constraint is used (for 5-parameter fit).
void setBeamConstr(float qOverPt_bcon, float phi0_bcon, float chi2rphi_bcon) {
@@ -384,9 +384,6 @@ namespace tmtt {
std::vector<const Stub*> matchedStubs_;
unsigned int nMatchedLayers_;

//--- Has the track fit declared this to be a valid track?
bool accepted_;

//--- Sector class used to check if fitted track trajectory is in same sector as HT used to find it.
std::shared_ptr<Sector> secTmp_; // shared so as to allow copy of L1fittedTrack.
//--- r-phi HT class used to determine HT cell location that corresponds to fitted track helix parameters.
@@ -402,9 +399,12 @@ namespace tmtt {

std::shared_ptr<DigitalTrack> digitalTrack_; // Class used to digitize track if required.

static const std::vector<Stub*> noStubs_; // Empty vector used to initialize rejected tracks.

bool consistentCell_;

static const std::vector<Stub*> noStubs_; // Empty vector used to initialize rejected tracks.
//--- Has the track fit declared this to be a valid track?
bool accepted_;
};

} // namespace tmtt
4 changes: 1 addition & 3 deletions L1Trigger/TrackFindingTMTT/interface/L1track2D.h
Original file line number Diff line number Diff line change
@@ -48,9 +48,7 @@ namespace tmtt {
matchedStubs_); // Find associated truth particle & calculate info about match.
}

L1track2D() : L1trackBase(){}; // Creates track object, but doesn't std::set any variables.

~L1track2D() override {}
~L1track2D() override = default;

//--- Get information about the reconstructed track.

4 changes: 1 addition & 3 deletions L1Trigger/TrackFindingTMTT/interface/L1track3D.h
Original file line number Diff line number Diff line change
@@ -72,9 +72,7 @@ namespace tmtt {
: L1track3D(
settings, stubs, cellLocationHT, helixRphi, helixRz, 0.0, iPhiSec, iEtaReg, optoLinkID, mergedHTcell) {}

L1track3D() : L1trackBase(){}; // Creates track object, but doesn't std::set any variables.

~L1track3D() override {}
~L1track3D() override = default;

//--- Set/get optional info for tracklet tracks.

2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTMTT/interface/L1trackBase.h
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ namespace tmtt {
public:
L1trackBase() {}

virtual ~L1trackBase() {}
virtual ~L1trackBase() = default;

//--- Get information about the reconstructed track.

2 changes: 0 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h
Original file line number Diff line number Diff line change
@@ -32,8 +32,6 @@ namespace tmtt {
float etaMaxSector,
float phiCentreSector);

~Make3Dtracks() {}

//=== Main routines to make 3D tracks.

// Make 3D track collections.
2 changes: 0 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@ namespace tmtt {
public:
MiniHTstage(const Settings* settings);

~MiniHTstage(){};

void exec(matrix<std::unique_ptr<HTrphi>>& mHtRphis);

private:
2 changes: 0 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h
Original file line number Diff line number Diff line change
@@ -33,8 +33,6 @@ namespace tmtt {
// Initialize constants from configuration parameters.
MuxHToutputs(const Settings* settings);

~MuxHToutputs() {}

// Determine which tracks are transmitted on each HT output optical link, taking into account the multiplexing
// of multiple (eta,phi) sectors onto single links and the truncation of the tracks caused by the requirement
// to output all the tracks within the time-multiplexed period.
12 changes: 5 additions & 7 deletions L1Trigger/TrackFindingTMTT/interface/Sector.h
Original file line number Diff line number Diff line change
@@ -16,8 +16,6 @@ namespace tmtt {
// Initialization.
Sector(const Settings* settings, unsigned int iPhiSec, unsigned int iEtaSec);

~Sector() {}

// Check if stub within the eta and/or phi boundaries of this sector.
bool inside(const Stub* stub) const { return (this->insideEta(stub) && this->insidePhi(stub)); }
bool insideEta(const Stub* stub) const;
@@ -83,13 +81,13 @@ namespace tmtt {
float zOuterMax_;

// Define phi sector.
float phiCentre_; // phi of centre of sector.
float sectorHalfWidth_; // sector half-width excluding overlaps.
float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define phi sectors.
float phiCentre_; // phi of centre of sector.
float sectorHalfWidth_; // sector half-width excluding overlaps.
float chosenRofPhi_; // Use phi of track at radius="chosenRofPhi" to define phi sectors.
float minPt_; // Min Pt covered by HT array.
float assumedPhiTrkRes_; // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors).
bool useStubPhi_; // Require stub phi to be consistent with track of Pt > HTArraySpec.HoughMinPt that crosses HT phi axis?
float minPt_; // Min Pt covered by HT array.
bool useStubPhiTrk_; // Require stub phi0 (or phi65 etc.) as estimated from stub bend, to lie within HT phi axis, allowing tolerance specified below?
float assumedPhiTrkRes_; // Tolerance in stub phi0 (or phi65) assumed to be this fraction of phi sector width. (N.B. If > 0.5, then stubs can be shared by more than 2 phi sectors).
bool calcPhiTrkRes_; // If true, tolerance in stub phi0 (or phi65 etc.) will be reduced below AssumedPhiTrkRes if stub bend resolution specified in HTFilling.BendResolution suggests it is safe to do so.

// Possible subsectors in eta within each sector.
2 changes: 0 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/Settings.h
Original file line number Diff line number Diff line change
@@ -22,8 +22,6 @@ namespace tmtt {
// Constructor for TMTT (reads config from python cfg)
Settings(const edm::ParameterSet& iConfig);

~Settings() {}

// Input tags for ES & ED data.
edm::ESInputTag magneticFieldInputTag() const { return magneticFieldInputTag_; }
edm::ESInputTag trackerGeometryInputTag() const { return trackerGeometryInputTag_; }
8 changes: 4 additions & 4 deletions L1Trigger/TrackFindingTMTT/interface/SimpleLR4.h
Original file line number Diff line number Diff line change
@@ -21,13 +21,11 @@ namespace tmtt {
public:
SimpleLR4(const Settings* settings);

~SimpleLR4() override{};
~SimpleLR4() override = default;

L1fittedTrack fit(const L1track3D& l1track3D) override;

protected:
bool debug_;

float phiSectorWidth_;
float phiSectorCentre_;
float phiNonantWidth_;
@@ -51,7 +49,6 @@ namespace tmtt {
float chosenRofPhi_;
unsigned int minStubLayersRed_;

bool digitize_;
unsigned int dividerBitsHelix_;
unsigned int dividerBitsHelixZ_;
unsigned int dividerBitsChi2_;
@@ -61,6 +58,9 @@ namespace tmtt {
unsigned int shiftingBitsPt_;
unsigned int shiftingBitsz0_;
unsigned int shiftingBitsLambda_;
bool digitize_;

bool debug_;
};

} // namespace tmtt
10 changes: 4 additions & 6 deletions L1Trigger/TrackFindingTMTT/interface/Stub.h
Original file line number Diff line number Diff line change
@@ -69,8 +69,6 @@ namespace tmtt {
const DegradeBend* degradeBend,
const StubKiller* stubKiller);

~Stub() {}

bool operator==(const Stub& stubOther) { return (this->index() == stubOther.index()); }

// Return reference to original TTStub.
@@ -269,8 +267,8 @@ namespace tmtt {
std::array<const TP*, 2> assocTPofCluster_;

std::unique_ptr<DigitalStub> digitalStub_; // Class used to digitize stub if required.
bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities.
DigiStage lastDigiStep_;
bool digitizeWarningsOn_; // Enable warnings about accessing non-digitized quantities.

// Info about tracker module containing stub.
const TrackerModule* trackerModule_;
@@ -280,15 +278,15 @@ namespace tmtt {

// These module variables are needed only to support the Hybrid stub constructor.
// (Otherwise, they could be taken from trackerModule_).
bool psModule_;
unsigned int layerId_;
unsigned int layerIdReduced_;
bool barrel_;
bool tiltedBarrel_;
float tiltAngle_;
float stripPitch_;
float stripLength_;
unsigned int nStrips_;
bool psModule_;
bool barrel_;
bool tiltedBarrel_;

const float rejectedStubBend_ = 99999.; // Bend set to this if stub rejected.

1 change: 0 additions & 1 deletion L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ namespace tmtt {

class StubFEWindows {
public:
StubFEWindows(){};
// Initialize stub window sizes from TTStubProducer cfg.
StubFEWindows(const edm::ParameterSet& pSetStubAlgo);

2 changes: 0 additions & 2 deletions L1Trigger/TrackFindingTMTT/interface/StubKiller.h
Original file line number Diff line number Diff line change
@@ -26,8 +26,6 @@ namespace tmtt {
const TrackerGeometry* trackerGeometry,
const edm::Event& iEvent);

~StubKiller() {}

// Indicate if given stub was killed by dead tracker module, based on dead module scenario.
bool killStub(const TTStub<Ref_Phase2TrackerDigi_>* stub) const;

10 changes: 3 additions & 7 deletions L1Trigger/TrackFindingTMTT/interface/StubWindowSuggest.h
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
#include "L1Trigger/TrackFindingTMTT/interface/StubFEWindows.h"

#include <vector>
#include <memory>

class TrackerTopology;

@@ -29,13 +30,8 @@ namespace tmtt {
// Configure
StubWindowSuggest(const Settings* settings) : settings_(settings), ptMin_(settings->houghMinPt()) {}

~StubWindowSuggest() {}

// Get FE window size arrays (via copy) used with stub producer, but set to zero.
void setFEWindows(const StubFEWindows* sw) {
sw_ = *sw;
sw_.setZero();
}
void setFEWindows(const StubFEWindows* sw);

// Analyse stub window required for this stub.
void process(const TrackerTopology* trackerTopo, const Stub* stub);
@@ -53,7 +49,7 @@ namespace tmtt {
const float ptMin_;

// Stub window sizes as encoded in L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h
StubFEWindows sw_;
std::unique_ptr<StubFEWindows> sw_;
};

} // namespace tmtt
7 changes: 3 additions & 4 deletions L1Trigger/TrackFindingTMTT/interface/TP.h
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ namespace tmtt {
public:
// Fill useful info about tracking particle.
TP(const TrackingParticlePtr& tpPtr, unsigned int index_in_vTPs, const Settings* settings);
~TP() {}

// Return pointer to original tracking particle.
const TrackingParticlePtr& trackingParticlePtr() const { return trackingParticlePtr_; }
@@ -126,13 +125,13 @@ namespace tmtt {
float d0_; // d0 impact parameter with respect to (x,y) = (0,0)
float z0_; // z0 impact parameter with respect to (x,y) = (0,0)

std::vector<const Stub*> assocStubs_;
unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP.

bool use_; // TP is worth keeping (e.g. for fake rate measurement)
bool useForEff_; // TP can be used for tracking efficiency measurement.
bool useForAlgEff_; // TP can be used for tracking algorithmic efficiency measurement.

std::vector<const Stub*> assocStubs_;
unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP.

bool tpInJet_;
float nearestJetPt_;
};
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTMTT/interface/TrackFitGeneric.h
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ namespace tmtt {
TrackFitGeneric(const Settings* settings, const std::string& fitterName = "")
: settings_(settings), fitterName_(fitterName) {}

virtual ~TrackFitGeneric() {}
virtual ~TrackFitGeneric() = default;

// Fit a track candidate obtained from the Hough Transform.
virtual L1fittedTrack fit(const L1track3D& l1track3D) { return L1fittedTrack(); }
6 changes: 1 addition & 5 deletions L1Trigger/TrackFindingTMTT/interface/TrkRZfilter.h
Original file line number Diff line number Diff line change
@@ -38,10 +38,6 @@ namespace tmtt {
float etaMaxSector,
float phiCentreSector);

struct SortStubsByLayer {
inline bool operator()(const Stub* stub1, const Stub* stub2) { return (stub1->layerId() < stub2->layerId()); }
};

// Filters track candidates (found by the r-phi Hough transform), removing inconsistent stubs from the tracks,
// also killing some of the tracks altogether if they are left with too few stubs.
// Also adds an estimate of r-z helix parameters to the selected track objects, returning the tracks as L1track3D type.
@@ -95,8 +91,8 @@ namespace tmtt {
bool useSeedFilter_;

// Options for Seed filter.
float seedResCut_;
bool keepAllSeed_;
float seedResCut_;

// Number of seed combinations considered by the Seed Filter, for each input track.
std::vector<unsigned int> numSeedCombsPerTrk_;
27 changes: 14 additions & 13 deletions L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h>
#include <L1Trigger/TrackFindingTMTT/interface/InputData.h>
#include <L1Trigger/TrackFindingTMTT/interface/Sector.h>
#include <L1Trigger/TrackFindingTMTT/interface/HTrphi.h>
#include <L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h>
#include <L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h>
#include <L1Trigger/TrackFindingTMTT/interface/TrackFitFactory.h>
#include <L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h>
#include <L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h>
#include "L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h"
#include "L1Trigger/TrackFindingTMTT/interface/InputData.h"
#include "L1Trigger/TrackFindingTMTT/interface/Sector.h"
#include "L1Trigger/TrackFindingTMTT/interface/HTrphi.h"
#include "L1Trigger/TrackFindingTMTT/interface/Make3Dtracks.h"
#include "L1Trigger/TrackFindingTMTT/interface/DupFitTrkKiller.h"
#include "L1Trigger/TrackFindingTMTT/interface/TrackFitFactory.h"
#include "L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h"
#include "L1Trigger/TrackFindingTMTT/interface/ConverterToTTTrack.h"
#include "L1Trigger/TrackFindingTMTT/interface/HTcell.h"
#include "L1Trigger/TrackFindingTMTT/interface/MuxHToutputs.h"
#include "L1Trigger/TrackFindingTMTT/interface/MiniHTstage.h"
@@ -15,7 +15,8 @@
#include "FWCore/MessageService/interface/MessageLogger.h"
#include "FWCore/Framework/interface/ESHandle.h"

#include "boost/numeric/ublas/matrix.hpp"
#include <boost/numeric/ublas/matrix.hpp>

#include <iostream>
#include <vector>
#include <list>
@@ -38,11 +39,11 @@ namespace tmtt {
}

TMTrackProducer::TMTrackProducer(const edm::ParameterSet& iConfig, GlobalCacheTMTT const* globalCacheTMTT)
: debug_(true), // Debug printout
settings_(iConfig), // Set configuration parameters
: settings_(iConfig), // Set configuration parameters
stubWindowSuggest_(globalCacheTMTT->stubWindowSuggest()), // For tuning FE stub window sizes
hists_(globalCacheTMTT->hists()), // Initialize histograms
htRphiErrMon_(globalCacheTMTT->htRphiErrMon()) // rphi HT error monitoring
htRphiErrMon_(globalCacheTMTT->htRphiErrMon()), // rphi HT error monitoring
debug_(true) // Debug printout
{
using namespace edm;

4 changes: 2 additions & 2 deletions L1Trigger/TrackFindingTMTT/plugins/TMTrackProducer.h
Original file line number Diff line number Diff line change
@@ -56,8 +56,6 @@ namespace tmtt {
void produce(edm::Event &, const edm::EventSetup &) override;

private:
bool debug_;

// ES tokens
edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magneticFieldToken_;
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeometryToken_;
@@ -91,6 +89,8 @@ namespace tmtt {
HTrphi::ErrorMonitor &htRphiErrMon_;

std::map<std::string, std::unique_ptr<TrackFitGeneric>> fitterWorkerMap_;

bool debug_;
};

} // namespace tmtt
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTMTT/src/HTcell.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <L1Trigger/TrackFindingTMTT/interface/HTcell.h>
#include "L1Trigger/TrackFindingTMTT/interface/HTcell.h"
#include "L1Trigger/TrackFindingTMTT/interface/TP.h"
#include "L1Trigger/TrackFindingTMTT/interface/Stub.h"

31 changes: 15 additions & 16 deletions L1Trigger/TrackFindingTMTT/src/HTrphi.cc
Original file line number Diff line number Diff line change
@@ -24,10 +24,6 @@ namespace tmtt {
//=== Its axes are (q/Pt, phiTrk), where phiTrk is the phi at which the track crosses a
//=== user-configurable radius from the beam-line.

namespace {
std::once_flag printOnce;
}

//=== Initialise

HTrphi::HTrphi(const Settings* settings,
@@ -94,18 +90,18 @@ namespace tmtt {
// Used to kill excess stubs or tracks that can't be transmitted within time-multiplexed period.
nReceivedStubs_ = 0;
busyInputSectorKill_ = settings_->busyInputSectorKill(); // Kill excess stubs going fron GP to HT?
busyInputSectorNumStubs_ =
settings_->busyInputSectorNumStubs(); // Max. num. of stubs that can be sent from GP to HT within TM period
busySectorKill_ = settings_->busySectorKill(); // Kill excess tracks flowing out of HT?
busySectorNumStubs_ =
settings_->busySectorNumStubs(); // Max. num. of stubs that can be sent out of HT within TM period
busySectorMbinRanges_ =
settings_->busySectorMbinRanges(); // or individual m bin (=q/Pt) ranges to be output to optical links.
busySectorUseMbinRanges_ = (!busySectorMbinRanges_.empty()); // m bin ranges option disabled if vector empty.
busySectorMbinOrder_ =
settings_
->busySectorMbinOrder(); // Specifies which m bins should be grouped together by BusySectorMbinRanges. If empty, then they are grouped in order 0,1,2,3,4,5 ...
busySectorUseMbinOrder_ = (!busySectorMbinOrder_.empty());
busySectorKill_ = settings_->busySectorKill(); // Kill excess tracks flowing out of HT?
// Max. num. of stubs that can be sent from GP to HT within TM period
busyInputSectorNumStubs_ = settings_->busyInputSectorNumStubs();
// Max. num. of stubs that can be sent out of HT within TM period
busySectorNumStubs_ = settings_->busySectorNumStubs();
// or individual m bin (=q/Pt) ranges to be output to optical links.
busySectorMbinRanges_ = settings_->busySectorMbinRanges();
// Specifies which m bins should be grouped together by BusySectorMbinRanges. If empty, then they are grouped in order 0,1,2,3,4,5 ...
busySectorMbinOrder_ = settings_->busySectorMbinOrder();
// m bin ranges option disabled if vector empty
busySectorUseMbinRanges_ = (not busySectorMbinRanges_.empty());
busySectorUseMbinOrder_ = (not busySectorMbinOrder_.empty());

bool rescaleMbins = false;
if (busySectorUseMbinRanges_) {
@@ -147,6 +143,7 @@ namespace tmtt {
}

std::stringstream text;
text << "\n";
text << "=== R-PHI HOUGH TRANSFORM AXES RANGES: abs(q/Pt) < " << maxAbsQoverPtAxis_ << " & abs(track-phi) < "
<< maxAbsPhiTrkAxis_ << " ===\n";
text << "=== R-PHI HOUGH TRANSFORM ARRAY SIZE: q/Pt bins = " << nBinsQoverPtAxis_
@@ -161,6 +158,8 @@ namespace tmtt {
text << " " << (busySectorMbinHigh_[i] - busySectorMbinLow_[i] + 1);
}
}
text << "\n";
static std::once_flag printOnce;
std::call_once(
printOnce, [](string t) { PrintL1trk() << t; }, text.str());

300 changes: 143 additions & 157 deletions L1Trigger/TrackFindingTMTT/src/Histos.cc

Large diffs are not rendered by default.

52 changes: 0 additions & 52 deletions L1Trigger/TrackFindingTMTT/src/KalmanState.cc
Original file line number Diff line number Diff line change
@@ -6,17 +6,6 @@ using namespace std;

namespace tmtt {

KalmanState::KalmanState()
: settings_(nullptr),
kLayer_(0),
last_state_(nullptr),
stub_(nullptr),
chi2rphi_(0),
chi2rz_(0),
barrel_(true),
nSkipped_(0),
hitPattern_(0) {}

KalmanState::KalmanState(const Settings *settings,
const L1track3D &candidate,
unsigned nSkipped,
@@ -66,47 +55,6 @@ namespace tmtt {
n_stubs_ = 1 + kLayer_ - nSkipped_;
}

KalmanState::KalmanState(const KalmanState &p)
: settings_(p.settings()),
kLayer_(p.layer()),
r_(p.r()),
z_(p.z()),
last_state_(p.last_state()),
vecX_(p.vectorX()),
matC_(p.matrixC()),
matK_(p.matrixK()),
matV_(p.matrixV()),
stub_(p.stub()),
chi2rphi_(p.chi2rphi()),
chi2rz_(p.chi2rz()),
n_stubs_(p.nStubLayers()),
barrel_(p.barrel()),
nSkipped_(p.nSkippedLayers()),
l1track3D_(p.candidate()) {}

KalmanState &KalmanState::operator=(const KalmanState &other) {
if (&other == this)
return *this;

settings_ = other.settings();
kLayer_ = other.layer();
r_ = other.r();
z_ = other.z();
last_state_ = other.last_state();
vecX_ = other.vectorX();
matC_ = other.matrixC();
matK_ = other.matrixK();
matV_ = other.matrixV();
stub_ = other.stub();
chi2rphi_ = other.chi2rphi();
chi2rz_ = other.chi2rz();
n_stubs_ = other.nStubLayers();
barrel_ = other.barrel();
nSkipped_ = other.nSkippedLayers();
l1track3D_ = other.candidate();
return *this;
}

bool KalmanState::good(const TP *tp) const {
const KalmanState *state = this;
while (state) {
5 changes: 1 addition & 4 deletions L1Trigger/TrackFindingTMTT/src/MuxHToutputs.cc
Original file line number Diff line number Diff line change
@@ -14,10 +14,6 @@ using namespace std;

namespace tmtt {

namespace {
std::once_flag printOnce;
}

//=== Initialize constants from configuration parameters.

MuxHToutputs::MuxHToutputs(const Settings* settings)
@@ -48,6 +44,7 @@ namespace tmtt {
std::stringstream text;
text << "=== The R-PHI HT output is multiplexed onto " << this->numLinksPerNonant()
<< " pairs of opto-links per nonant.";
static std::once_flag printOnce;
std::call_once(
printOnce, [](string t) { PrintL1trk() << t; }, text.str());
}
4 changes: 2 additions & 2 deletions L1Trigger/TrackFindingTMTT/src/Sector.cc
Original file line number Diff line number Diff line change
@@ -30,10 +30,10 @@ namespace tmtt {

//=== Characteristics of this phi region.
chosenRofPhi_(settings->chosenRofPhi()),
useStubPhi_(settings->useStubPhi()),
minPt_(settings->houghMinPt()), // Min Pt covered by HT array.
useStubPhiTrk_(settings->useStubPhiTrk()),
assumedPhiTrkRes_(settings->assumedPhiTrkRes()),
useStubPhi_(settings->useStubPhi()),
useStubPhiTrk_(settings->useStubPhiTrk()),
calcPhiTrkRes_(settings->calcPhiTrkRes()),
//=== Check if subsectors in eta are being used within each sector.
numSubSecsEta_(settings->numSubSecsEta()) {
5 changes: 5 additions & 0 deletions L1Trigger/TrackFindingTMTT/src/Settings.cc
Original file line number Diff line number Diff line change
@@ -397,6 +397,11 @@ namespace tmtt {
<< "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type E.";
}

constexpr float verySmall = 0.1;
if (houghMinPt_ < verySmall)
throw cms::Exception("BadConfig") << "Settings: Invalid cfg parameters -- HoughMinPt must be positive.";
miniHoughMinPt_ = std::max(miniHoughMinPt_, houghMinPt_);

for (const unsigned int& iEtaReg : etaSecsReduceLayers_) {
if (iEtaReg >= etaRegions_.size())
throw cms::Exception("BadConfig") << "Settings: You specified an eta sector number in EtaSecsReduceLayers "
7 changes: 3 additions & 4 deletions L1Trigger/TrackFindingTMTT/src/SimpleLR4.cc
Original file line number Diff line number Diff line change
@@ -19,8 +19,6 @@ using namespace std;
namespace tmtt {

SimpleLR4::SimpleLR4(const Settings* settings) : TrackFitGeneric(settings) {
debug_ = false; // Enable debug printout.

// Initialize digitization parameters
phiMult_ = pow(2., settings_->phiSBits()) / settings_->phiSRange();
rTMult_ = pow(2., settings_->rtBits()) / settings_->rtRange();
@@ -39,16 +37,15 @@ namespace tmtt {
denominatorMult_ = rTMult_ * rTMult_;
resMult_ = rTMult_ * qOverPtMult_;

digitize_ = settings_->digitizeSLR() and settings_->enableDigitize();
dividerBitsHelix_ = settings_->dividerBitsHelix();
dividerBitsHelixZ_ = settings_->dividerBitsHelixZ();
shiftingBitsDenRPhi_ = settings_->ShiftingBitsDenRPhi();
shiftingBitsDenRZ_ = settings_->ShiftingBitsDenRZ();

shiftingBitsPhi_ = settings_->ShiftingBitsPhi();
shiftingBitsz0_ = settings_->ShiftingBitsZ0();
shiftingBitsPt_ = settings_->ShiftingBitsPt();
shiftingBitsLambda_ = settings_->ShiftingBitsLambda();
digitize_ = settings_->digitizeSLR() and settings_->enableDigitize();

phiSectorWidth_ = 2. * M_PI / float(settings_->numPhiSectors());
phiNonantWidth_ = 2. * M_PI / float(settings_->numPhiNonants());
@@ -57,6 +54,8 @@ namespace tmtt {
chosenRofPhi_ = settings_->chosenRofPhi();
if (digitize_)
chosenRofPhi_ = floor(chosenRofPhi_ * rTMult_) / rTMult_;

debug_ = false; // Enable debug printout.
};

static bool pair_compare(std::pair<const Stub*, float> a, std::pair<const Stub*, float> b) {
18 changes: 9 additions & 9 deletions L1Trigger/TrackFindingTMTT/src/Stub.cc
Original file line number Diff line number Diff line change
@@ -42,14 +42,14 @@ namespace tmtt {
iphi_(iphi),
alpha_(alpha),
digitalStub_(std::make_unique<DigitalStub>(settings, r, phi, z, iPhiSec)),
psModule_(psModule),
layerId_(layerId),
layerIdReduced_(TrackerModule::calcLayerIdReduced(layerId)),
barrel_(barrel),
tiltedBarrel_(tiltedBarrel),
stripPitch_(stripPitch),
stripLength_(stripLength),
nStrips_(nStrips) {}
nStrips_(nStrips),
psModule_(psModule),
barrel_(barrel),
tiltedBarrel_(tiltedBarrel) {}

//=== TMTT L1 tracking: stub constructor.

@@ -64,20 +64,20 @@ namespace tmtt {
settings_(settings),
index_in_vStubs_(index_in_vStubs),
assocTP_(nullptr), // Initialize in case job is using no MC truth info.
digitizeWarningsOn_(true),
lastDigiStep_(Stub::DigiStage::NONE),
digitizeWarningsOn_(true),
trackerModule_(trackerModule), // Info about tracker module containing stub
degradeBend_(degradeBend), // Used to degrade stub bend information.
// Module related variables (need to be stored for Hybrid)
psModule_(trackerModule->psModule()),
layerId_(trackerModule->layerId()),
layerIdReduced_(trackerModule->layerIdReduced()),
barrel_(trackerModule->barrel()),
tiltedBarrel_(trackerModule->tiltedBarrel()),
tiltAngle_(trackerModule->tiltAngle()),
stripPitch_(trackerModule->stripPitch()),
stripLength_(trackerModule->stripLength()),
nStrips_(trackerModule->nStrips()) {
nStrips_(trackerModule->nStrips()),
psModule_(trackerModule->psModule()),
barrel_(trackerModule->barrel()),
tiltedBarrel_(trackerModule->tiltedBarrel()) {
// Get coordinates of stub.
const TTStub<Ref_Phase2TrackerDigi_>* ttStubP = ttStubRef_.get();

54 changes: 17 additions & 37 deletions L1Trigger/TrackFindingTMTT/src/StubWindowSuggest.cc
Original file line number Diff line number Diff line change
@@ -11,15 +11,24 @@

using namespace std;

namespace {
std::mutex myMutex;
}

namespace tmtt {

//=== Get FE window size arrays (via copy) used with stub producer, but set to zero.

void StubWindowSuggest::setFEWindows(const StubFEWindows* sw) {
static std::mutex myMutex;
std::lock_guard<std::mutex> myGuard(myMutex); // Allow only one thread.
// Only need to create FE windows once.
if (not sw_) {
sw_ = std::make_unique<StubFEWindows>(*sw); // Copy
sw_->setZero();
}
}

//=== Analyse stub window required for this stub.

void StubWindowSuggest::process(const TrackerTopology* trackerTopo, const Stub* stub) {
static std::mutex myMutex;
std::lock_guard<std::mutex> myGuard(myMutex); // Allow only one thread.

// Half-size of FE chip bend window corresponding to Pt range in which tracks are to be found.
@@ -43,37 +52,8 @@ namespace tmtt {

DetId stDetId(stub->trackerModule()->detId());

double* storedHalfWindow = sw_.storedWindowSize(trackerTopo, stDetId);
/*
if (stDetId.subdetId() == StripSubdetector::TOB) {
unsigned int layer = trackerTopo->layer(stDetId);
unsigned int ladder = trackerTopo->tobRod(stDetId);
int type = 2 * trackerTopo->tobSide(stDetId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat
double corr = 0;
if (type != TrackerModule::BarrelModuleType::flat) // Only for tilted modules
{
corr = (sw_.numTiltedLayerRings().at(layer) + 1) / 2.;
// Corrected ring number, between 0 and barrelNTilt.at(layer), in ascending |z|
ladder = corr - (corr - ladder) * type;
double& storedHalfWindow = (sw_.windowSizeTiltedLayersRings().at(layer)).at(ladder);
if (storedHalfWindow < bendHalfWind)
storedHalfWindow = bendHalfWind;
} else // Classic barrel window otherwise
{
double& storedHalfWindow = sw_.windowSizeBarrelLayers().at(layer);
if (storedHalfWindow < bendHalfWind)
storedHalfWindow = bendHalfWind;
}
double* storedHalfWindow = sw_->storedWindowSize(trackerTopo, stDetId);

} else if (stDetId.subdetId() == StripSubdetector::TID) {
unsigned int wheel = trackerTopo->tidWheel(stDetId);
unsigned int ring = trackerTopo->tidRing(stDetId);
double& storedHalfWindow = sw_.windowSizeEndcapDisksRings().at(wheel).at(ring);
if (storedHalfWindow < bendHalfWind)
storedHalfWindow = bendHalfWind;
}
*/
if (*storedHalfWindow < bendHalfWind)
*storedHalfWindow = bendHalfWind;
}
@@ -93,15 +73,15 @@ namespace tmtt {

text << "BarrelCut = cms.vdouble( ";
div = "";
for (const auto& cut : sw_.windowSizeBarrelLayers()) {
for (const auto& cut : sw_->windowSizeBarrelLayers()) {
text << div << cut;
div = ", ";
}
text << "),";
PrintL1trk(1) << text.str();

PrintL1trk(1) << "TiltedBarrelCutSet = cms.VPSET( ";
for (const auto& cutVec : sw_.windowSizeTiltedLayersRings()) {
for (const auto& cutVec : sw_->windowSizeTiltedLayersRings()) {
text.str("");
text << " cms.PSet( TiltedCut = cms.vdouble(";
if (cutVec.empty())
@@ -117,7 +97,7 @@ namespace tmtt {
PrintL1trk(1) << "),";

PrintL1trk(1) << "EndcapCutSet = cms.VPSET( ";
for (const auto& cutVec : sw_.windowSizeEndcapDisksRings()) {
for (const auto& cutVec : sw_->windowSizeEndcapDisksRings()) {
text.str("");
text << " cms.PSet( EndcapCut = cms.vdouble(";
if (cutVec.empty())
7 changes: 1 addition & 6 deletions L1Trigger/TrackFindingTMTT/src/TrackerModule.cc
Original file line number Diff line number Diff line change
@@ -81,12 +81,7 @@ namespace tmtt {
tiltedBarrel_ = barrel_ && (trackerTopology->tobSide(detId) != BarrelModuleType::flat);
float deltaR = std::abs(R1 - R0);
float deltaZ = (R1 - R0 > 0) ? (Z1 - Z0) : -(Z1 - Z0);
tiltAngle_ = atan2(deltaR, deltaZ);
// Put in range -PI/2 to +PI/2.
if (tiltAngle_ > M_PI / 2.)
tiltAngle_ -= M_PI;
if (tiltAngle_ < -M_PI / 2.)
tiltAngle_ += M_PI;
tiltAngle_ = atan(deltaR / deltaZ);

// Get sensor strip or pixel pitch using innermost sensor of pair.

13 changes: 8 additions & 5 deletions L1Trigger/TrackFindingTMTT/src/TrkRZfilter.cc
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
#include "L1Trigger/TrackFindingTMTT/interface/Stub.h"
#include "L1Trigger/TrackFindingTMTT/interface/PrintL1trk.h"

#include <array>

using namespace std;

namespace tmtt {
@@ -54,10 +56,10 @@ namespace tmtt {
rzFilterName_ = settings->rzFilterName();

// --- Options for Seed filter.
//Added resolution for a tracklet-like filter algorithm, beyond that estimated from hit resolution.
seedResCut_ = settings->seedResCut();
// Keep stubs compatible with all possible good seed.
keepAllSeed_ = settings->keepAllSeed();
//Added resolution for a tracklet-like filter algorithm, beyond that estimated from hit resolution.
seedResCut_ = settings->seedResCut();
// Maximum number of seed combinations to bother checking per track candidate.
maxSeedCombinations_ = settings->maxSeedCombinations();
// Maximum number of seed combinations consistent with sector (z0,eta) constraints to bother checking per track candidate.
@@ -144,8 +146,8 @@ namespace tmtt {
std::vector<Stub*> filtStubs = stubs; // Copy stubs vector in filtStubs
bool FirstSeed = true;
//Allowed layers for the first & second seeding stubs
static const std::vector<unsigned int> FirstSeedLayers = {1, 2, 11, 21, 3, 12, 22, 4};
static const std::vector<unsigned int> SecondSeedLayers = {1, 2, 11, 3, 21, 22, 12, 23, 13, 4};
constexpr std::array<unsigned int, 8> FirstSeedLayers = {{1, 2, 11, 21, 3, 12, 22, 4}};
constexpr std::array<unsigned int, 10> SecondSeedLayers = {{1, 2, 11, 3, 21, 22, 12, 23, 13, 4}};
set<Stub*> uniqueFilteredStubs;

unsigned int numSeedCombinations = 0; // Counter for number of seed combinations considered.
@@ -154,7 +156,8 @@ namespace tmtt {

unsigned int oldNumLay = 0; //Number of Layers counter, used to keep the seed with more layers

std::sort(filtStubs.begin(), filtStubs.end(), SortStubsByLayer());
auto orderByLayer = [](const Stub* a, const Stub* b) { return bool(a->layerId() < b->layerId()); };
std::sort(filtStubs.begin(), filtStubs.end(), orderByLayer);

// Loop over stubs in the HT Cell
for (Stub* s0 : filtStubs) {

0 comments on commit 9b8d2c4

Please sign in to comment.