Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates on the L1 DT Phase2 algorithm #37237

Merged
merged 22 commits into from May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f92e1e7
adding missing files from Nicolò
folguera Feb 2, 2022
4fdfc7d
Fix geometry and some couts uncommented
folguera Feb 3, 2022
76a818d
Added limit on the number of output primitives
jaimeleonh Feb 28, 2022
43a46bc
Added minimal cfg
jaimeleonh Feb 28, 2022
9bc5f34
Added FW comparison parameters to minimal cfg
jaimeleonh Feb 28, 2022
ec7a9bf
Keep only AM information
jaimeleonh Mar 1, 2022
0de6e94
Fix quality mapping
jaimeleonh Mar 1, 2022
cb3e65f
Code checks and format
jaimeleonh Mar 8, 2022
2e0287e
Fix unused variable
jaimeleonh Mar 15, 2022
497cebd
Merge pull request #90 from dtp2-tpg-am/AM_12_3_X_integration_fix
jaimeleonh Mar 15, 2022
e4aabff
Fixes related to the cms-l1t-offline repo
jaimeleonh Apr 1, 2022
6d431ba
Fix back test file
jaimeleonh Apr 1, 2022
1bee309
Merge pull request #91 from jaimeleonh/AM_12_3_X_integration_fix
jaimeleonh Apr 1, 2022
b33cb2b
Fixes after comments
jaimeleonh Apr 12, 2022
2fc5e78
Merge pull request #92 from jaimeleonh/AM_12_3_X_integration_com
jaimeleonh Apr 12, 2022
2331c89
Comments from PR
jaimeleonh Apr 21, 2022
b185cff
Merge pull request #93 from jaimeleonh/AM_12_3_X_integration_com
jaimeleonh Apr 21, 2022
e889655
Fix code format
jaimeleonh Apr 21, 2022
ce7cce1
Merge pull request #94 from jaimeleonh/AM_12_3_X_integration_com
jaimeleonh Apr 21, 2022
abc1116
More comments
jaimeleonh Apr 26, 2022
12af797
Merge pull request #95 from jaimeleonh/AM_12_3_X_integration_com
jaimeleonh Apr 26, 2022
3389f1f
Substituting ifs with else ifs
jaimeleonh May 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion L1Trigger/DTTriggerPhase2/interface/DTPattern.h
Expand Up @@ -57,7 +57,7 @@ class DTPattern {
//Generated seeds + hits translated to a given seed pair
int recoseedUp_;
int recoseedDown_;
bool debug_ = false;
const bool debug_ = false;
};

#endif
3 changes: 1 addition & 2 deletions L1Trigger/DTTriggerPhase2/interface/GlobalCoordsObtainer.h
@@ -1,7 +1,6 @@
#ifndef L1Trigger_DTTriggerPhase2_GlobalCoordsObtainer_h
#define L1Trigger_DTTriggerPhase2_GlobalCoordsObtainer_h

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
Expand Down Expand Up @@ -77,4 +76,4 @@ class GlobalCoordsObtainer {
std::map<uint32_t, lut_group> luts;
};

#endif
#endif
3 changes: 2 additions & 1 deletion L1Trigger/DTTriggerPhase2/interface/HoughGrouping.h
Expand Up @@ -75,7 +75,8 @@ class HoughGrouping : public MotherGrouping {
bool areThereEnoughHits(const ProtoCand& tupl);

// Private attributes
bool debug_, allowUncorrelatedPatterns_;
const bool debug_;
bool allowUncorrelatedPatterns_;
unsigned short int minNLayerHits_, minSingleSLHitsMax_, minSingleSLHitsMin_, minUncorrelatedHits_, upperNumber_,
lowerNumber_;
double angletan_, anglebinwidth_, posbinwidth_, maxdeltaAngDeg_, maxdeltaPos_, maxDistanceToWire_;
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/DTTriggerPhase2/interface/InitialGrouping.h
Expand Up @@ -86,7 +86,7 @@ class InitialGrouping : public MotherGrouping {
bool isEqualComb2Previous(DTPrimitives& ptr);

// Private attributes
bool debug_;
const bool debug_;

DTPrimitives muxInChannels_[cmsdt::NUM_CELLS_PER_BLOCK];
DTPrimitives channelIn_[cmsdt::NUM_LAYERS][cmsdt::NUM_CH_PER_LAYER];
Expand Down
51 changes: 51 additions & 0 deletions L1Trigger/DTTriggerPhase2/interface/MPCleanHitsFilter.h
@@ -0,0 +1,51 @@
#ifndef L1Trigger_DTTriggerPhase2_MPCleanHitsFilter_h
#define L1Trigger_DTTriggerPhase2_MPCleanHitsFilter_h

#include "L1Trigger/DTTriggerPhase2/interface/MPFilter.h"

#include <iostream>
#include <fstream>

// ===============================================================================
// Previous definitions and declarations
// ===============================================================================

// ===============================================================================
// Class declarations
// ===============================================================================

class MPCleanHitsFilter : public MPFilter {
public:
// Constructors and destructor
MPCleanHitsFilter(const edm::ParameterSet& pset);
~MPCleanHitsFilter() override = default;

// Main methods
void initialise(const edm::EventSetup& iEventSetup) override{};
void run(edm::Event& iEvent,
const edm::EventSetup& iEventSetup,
std::vector<cmsdt::metaPrimitive>& inMPath,
std::vector<cmsdt::metaPrimitive>& outMPath) override{};

void run(edm::Event& iEvent,
const edm::EventSetup& iEventSetup,
MuonPathPtrs& inMPath,
MuonPathPtrs& outMPath) override;

void finish() override{};

// Other public methods
void removeOutliers(MuonPathPtr& mpath);

double getMeanTime(MuonPathPtr& mpath);

void setTimeTolerance(int time) { timeTolerance_ = time; }
int getTimeTolerance() { return timeTolerance_; }

private:
// Private attributes
const bool debug_;
int timeTolerance_;
};

#endif
3 changes: 1 addition & 2 deletions L1Trigger/DTTriggerPhase2/interface/MPFilter.h
@@ -1,7 +1,6 @@
#ifndef Phase2L1Trigger_DTTrigger_MPFilter_h
#define Phase2L1Trigger_DTTrigger_MPFilter_h

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand Down Expand Up @@ -49,7 +48,7 @@ class MPFilter {

private:
// Private attributes
bool debug_;
const bool debug_;
};

#endif
5 changes: 2 additions & 3 deletions L1Trigger/DTTriggerPhase2/interface/MPQualityEnhancerFilter.h
Expand Up @@ -18,7 +18,7 @@ class MPQualityEnhancerFilter : public MPFilter {
public:
// Constructors and destructor
MPQualityEnhancerFilter(const edm::ParameterSet &pset);
~MPQualityEnhancerFilter() override;
~MPQualityEnhancerFilter() override = default;

// Main methods
void initialise(const edm::EventSetup &iEventSetup) override;
Expand Down Expand Up @@ -48,8 +48,7 @@ class MPQualityEnhancerFilter : public MPFilter {
void filterUnique(std::vector<cmsdt::metaPrimitive> &inMPath, std::vector<cmsdt::metaPrimitive> &outMPath);

// Private attributes
bool debug_;
bool filter_cousins_;
const bool debug_;
};

#endif
55 changes: 55 additions & 0 deletions L1Trigger/DTTriggerPhase2/interface/MPQualityEnhancerFilterBayes.h
@@ -0,0 +1,55 @@
#ifndef Phase2L1Trigger_DTTrigger_MPQualityEnhancerFilterBayes_h
#define Phase2L1Trigger_DTTrigger_MPQualityEnhancerFilterBayes_h

#include "L1Trigger/DTTriggerPhase2/interface/MPFilter.h"
#include "DataFormats/MuonDetId/interface/DTChamberId.h"

#include <iostream>
#include <fstream>

// ===============================================================================
// Previous definitions and declarations
// ===============================================================================

// ===============================================================================
// Class declarations
// ===============================================================================

class MPQualityEnhancerFilterBayes : public MPFilter {
public:
// Constructors and destructor
MPQualityEnhancerFilterBayes(const edm::ParameterSet &pset);
~MPQualityEnhancerFilterBayes() override = default;

// Main methods
void initialise(const edm::EventSetup &iEventSetup) override;
void run(edm::Event &iEvent,
const edm::EventSetup &iEventSetup,
std::vector<cmsdt::metaPrimitive> &inMPath,
std::vector<cmsdt::metaPrimitive> &outMPath) override;
void run(edm::Event &iEvent,
const edm::EventSetup &iEventSetup,
MuonPathPtrs &inMPath,
MuonPathPtrs &outMPath) override{};

void finish() override;

// Other public methods

// Public attributes
int areCousins(cmsdt::metaPrimitive mp1, cmsdt::metaPrimitive mp2);
int shareSL(cmsdt::metaPrimitive mp1, cmsdt::metaPrimitive mp2);
bool areSame(cmsdt::metaPrimitive mp1, cmsdt::metaPrimitive mp2);
int rango(cmsdt::metaPrimitive mp);
int BX(cmsdt::metaPrimitive mp);
void printmP(cmsdt::metaPrimitive mP);

private:
// Private methods
void filterCousins(std::vector<cmsdt::metaPrimitive> &inMPath, std::vector<cmsdt::metaPrimitive> &outMPath);

// Private attributes
const bool debug_;
};

#endif
2 changes: 1 addition & 1 deletion L1Trigger/DTTriggerPhase2/interface/MPRedundantFilter.h
Expand Up @@ -40,7 +40,7 @@ class MPRedundantFilter : public MPFilter {
bool isInBuffer(MuonPathPtr& mpath);

// Private attributes
bool debug_;
const bool debug_;
unsigned int maxBufferSize_;
std::deque<MuonPathPtr> buffer_;
};
Expand Down
3 changes: 1 addition & 2 deletions L1Trigger/DTTriggerPhase2/interface/MotherGrouping.h
@@ -1,7 +1,6 @@
#ifndef Phase2L1Trigger_DTTrigger_MotherGrouping_h
#define Phase2L1Trigger_DTTrigger_MotherGrouping_h

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand Down Expand Up @@ -48,7 +47,7 @@ class MotherGrouping {
// Private methods

// Private attributes
bool debug_;
const bool debug_;
};

#endif
Expand Up @@ -98,7 +98,7 @@ class MuonPathAnalyticAnalyzer : public MuonPathAnalyzer {

// Private attributes

bool debug_;
const bool debug_;
double chi2Th_;
double tanPhiTh_;
double tanPhiThw2max_;
Expand All @@ -107,7 +107,6 @@ class MuonPathAnalyticAnalyzer : public MuonPathAnalyzer {
double tanPhiThw1min_;
double tanPhiThw0_;
int cellLayout_[cmsdt::NUM_LAYERS];
std::string geometry_tag_;
std::vector<CELL_VALID_LAYOUT_CONSTANTS> LAYOUT_VALID_TO_LATCOMB_CONSTS_ENCODER;

// global coordinates
Expand Down
3 changes: 1 addition & 2 deletions L1Trigger/DTTriggerPhase2/interface/MuonPathAnalyzer.h
@@ -1,7 +1,6 @@
#ifndef Phase2L1Trigger_DTTrigger_MuonPathAnalyzer_h
#define Phase2L1Trigger_DTTrigger_MuonPathAnalyzer_h

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
Expand Down Expand Up @@ -62,7 +61,7 @@ class MuonPathAnalyzer {
// Private methods

// Private attributes
bool debug_;
const bool debug_;
};

#endif
12 changes: 7 additions & 5 deletions L1Trigger/DTTriggerPhase2/interface/MuonPathAnalyzerInChamber.h
Expand Up @@ -7,8 +7,7 @@
// Previous definitions and declarations
// ===============================================================================
namespace {
constexpr int NLayers = 8;
typedef std::array<cmsdt::LATERAL_CASES, NLayers> TLateralities;
typedef std::array<cmsdt::LATERAL_CASES, cmsdt::NUM_LAYERS_2SL> TLateralities;
} // namespace
// ===============================================================================
// Class declarations
Expand Down Expand Up @@ -65,21 +64,24 @@ class MuonPathAnalyzerInChamber : public MuonPathAnalyzer {
void buildLateralities(MuonPathPtr &mpath);
void setLateralitiesInMP(MuonPathPtr &mpath, TLateralities lat);
void setWirePosAndTimeInMP(MuonPathPtr &mpath);
void calculateFitParameters(MuonPathPtr &mpath, TLateralities lat, int present_layer[NLayers], int &lat_added);
void calculateFitParameters(MuonPathPtr &mpath,
TLateralities lat,
int present_layer[cmsdt::NUM_LAYERS_2SL],
int &lat_added);

void evaluateQuality(MuonPathPtr &mPath);
int totalNumValLateralities_;
std::vector<TLateralities> lateralities_;
std::vector<cmsdt::LATQ_TYPE> latQuality_;

bool debug_;
const bool debug_;
double chi2Th_;
edm::FileInPath shift_filename_;
int bxTolerance_;
cmsdt::MP_QUALITY minQuality_;
float chiSquareThreshold_;
short minHits4Fit_;
int cellLayout_[NLayers];
int cellLayout_[cmsdt::NUM_LAYERS_2SL];
bool splitPathPerSL_;

// global coordinates
Expand Down
3 changes: 1 addition & 2 deletions L1Trigger/DTTriggerPhase2/interface/MuonPathAssociator.h
Expand Up @@ -74,7 +74,7 @@ class MuonPathAssociator {
bool hasPosRF(int wh, int sec) { return wh > 0 || (wh == 0 && sec % 4 > 1); }

// Private attributes
bool debug_;
const bool debug_;
bool clean_chi2_correlation_;
bool useBX_correlation_;
bool allow_confirmation_;
Expand All @@ -83,7 +83,6 @@ class MuonPathAssociator {
double dTanPsi_correlate_TP_;
double minx_match_2digis_;
double chi2corTh_;
std::string geometry_tag_;

//shift
edm::FileInPath shift_filename_;
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/DTTriggerPhase2/interface/PseudoBayesGrouping.h
Expand Up @@ -47,7 +47,7 @@ class PseudoBayesGrouping : public MotherGrouping {

// Private attributes
// Config variables
bool debug_;
const bool debug_;
std::string pattern_filename_;
int pidx_;
int minNLayerHits_;
Expand Down
10 changes: 3 additions & 7 deletions L1Trigger/DTTriggerPhase2/interface/RPCIntegrator.h
@@ -1,7 +1,6 @@
#ifndef Phase2L1Trigger_DTTrigger_RPCIntegrator_h
#define Phase2L1Trigger_DTTrigger_RPCIntegrator_h

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EventSetup.h"
Expand Down Expand Up @@ -81,20 +80,17 @@ class RPCIntegrator {
std::vector<RPCMetaprimitive> RPCMetaprimitives_;

private:
//RPCRecHitCollection m_rpcRecHits;
bool m_debug_;
const bool m_debug_;
int m_max_quality_to_overwrite_t0_;
int m_bx_window_;
double m_phi_window_;
bool m_storeAllRPCHits_;
edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH_;
edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeomH_;

DTGeometry const* dtGeo_;
RPCGeometry const* rpcGeo_;
edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH_;
edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeomH_;

static constexpr double m_dt_phi_granularity_ = (65536. / 0.8); // 65536 different values per 0.8 radian
static constexpr double m_dt_phiB_granularity_ = (2048. / 1.4); // 2048. different values per 1.4 radian
// Constant geometry values
//R[stat][layer] - radius of rpc station/layer from center of CMS
static constexpr double R_[2][2] = {{410.0, 444.8}, {492.7, 527.3}};
Expand Down
7 changes: 3 additions & 4 deletions L1Trigger/DTTriggerPhase2/plugins/CalibratedDigis.cc
@@ -1,9 +1,9 @@
// -*- C++ -*-
//
// Package: UserCode/CalibratedDigis
// Package: L1Trigger/DTTriggerPhase2
// Class: CalibratedDigis
//
/**\class CalibratedDigis CalibratedDigis.cc UserCode/CalibratedDigis/plugins/CalibratedDigis.cc
/**\class CalibratedDigis CalibratedDigis.cc L1Trigger/DTTriggerPhase2/plugins/CalibratedDigis.cc

Description: [one line class summary]

Expand Down Expand Up @@ -32,7 +32,6 @@
#include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"

#include "CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h"

Expand Down Expand Up @@ -97,7 +96,7 @@ CalibratedDigis::CalibratedDigis(const edm::ParameterSet& iConfig) {
flat_calib_ = iConfig.getParameter<int>("flat_calib");
timeOffset_ = iConfig.getParameter<int>("timeOffset");

scenario = iConfig.getUntrackedParameter<int>("scenario");
scenario = iConfig.getParameter<int>("scenario");

produces<DTDigiCollection>();
//now do what ever other initialization is needed
Expand Down