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
new package L1Trigger/L1TMuonOverlapPhase1 (new version of the L1 Trigger Overlap Muon Track Finder (OMTF) emulator) #35111
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dee227f
addding new LUT DIST_PHI_SHIFT, needed for the OMTF patterns v4
66f95fe
initial commit of L1Trigger/L1TMuonOverlapPhase1
1b69e9d
using unique_ptr for the GoldenPatternVec and many other changes
455f4f8
code clean-up in L1TMuonOverlapPhase1
8d8a862
Switching to the new OMTF emulator
dcd88a1
deleting files and dirs that are not needed
84982d4
changes requested by Clang Build
a8d4e08
code cleanup
b8d8a96
correcting valOmtfDigis in the L1TStage2Emulator_cff.py
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/.cproject | ||
/.project | ||
/.pydevproject | ||
/.settings | ||
/test/*.xml | ||
/test/*.root | ||
/test/*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<export> | ||
<lib name="1"/> | ||
<use name="DataFormats/L1TMuon"/> | ||
<use name="L1Trigger/RPCTrigger"/> | ||
<use name="DataFormats/L1TMuon"/> | ||
<use name="Geometry/Records"/> | ||
<use name="Geometry/DTGeometry"/> | ||
<use name="Geometry/CSCGeometry"/> | ||
<use name="Geometry/RPCGeometry"/> | ||
<use name="root"/> | ||
<use name="xerces-c"/> | ||
</export> | ||
|
||
<flags ADD_SUBDIR="1"/> | ||
|
||
<use name="xerces-c"/> | ||
<use name="root"/> | ||
<use name="roofit"/> | ||
|
||
<!-- <use lib=boost_timer /> --> | ||
<lib name="boost_timer" /> | ||
|
||
<use name="L1Trigger/RPCTrigger"/> | ||
<use name="L1Trigger/DTUtilities"/> | ||
<use name="L1Trigger/L1TMuon" /> | ||
|
||
<use name="DataFormats/L1TMuon"/> | ||
<use name="DataFormats/L1DTTrackFinder"/> | ||
|
||
<use name="Geometry/Records"/> | ||
<use name="Geometry/DTGeometry"/> | ||
<use name="Geometry/CSCGeometry"/> | ||
<use name="Geometry/RPCGeometry"/> | ||
|
||
<use name="SimDataFormats/DigiSimLinks"/> | ||
<use name="SimDataFormats/Vertex"/> | ||
<use name="SimDataFormats/TrackingAnalysis"/> | ||
|
||
<use name="PhysicsTools/UtilAlgos"/> | ||
<use name="FWCore/ServiceRegistry"/> | ||
|
||
<use name="TrackingTools/Records" /> | ||
<use name="TrackingTools/TrajectoryState" /> | ||
<use name="TrackingTools/GeomPropagators" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* AlgoMuonBase.h | ||
* | ||
* Created on: Mar 1, 2019 | ||
* Author: Karol Bunkowski kbunkow@cern.ch | ||
*/ | ||
|
||
#ifndef L1T_OmtfP1_ALGOMUONBASE_H_ | ||
#define L1T_OmtfP1_ALGOMUONBASE_H_ | ||
|
||
#include "L1Trigger/L1TMuonOverlapPhase1/interface/ProcConfigurationBase.h" | ||
#include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h" | ||
#include "L1Trigger/L1TMuonOverlapPhase1/interface/StubResult.h" | ||
#include "boost/dynamic_bitset.hpp" | ||
|
||
class AlgoMuonBase { | ||
public: | ||
AlgoMuonBase(){}; | ||
|
||
AlgoMuonBase(const ProcConfigurationBase* config); | ||
virtual ~AlgoMuonBase(); | ||
|
||
virtual int getEtaHw() const = 0; | ||
|
||
virtual bool isValid() const = 0; | ||
|
||
virtual unsigned int getFiredLayerCnt() const { | ||
unsigned int count = 0; | ||
for (auto& firedLayerBits : firedLayerBitsInBx) { | ||
count += firedLayerBits.count(); | ||
} | ||
return count; | ||
} | ||
|
||
virtual unsigned int getFiredLayerCnt(int bx) const { return firedLayerBitsInBx.at(bx).count(); } | ||
|
||
boost::dynamic_bitset<> getFiredLayerBits() | ||
const { //TODO make it virtual, and change the return type in in the AlgoMuon to dynamic_bitset<> | ||
boost::dynamic_bitset<> firedLayerBitsSum(firedLayerBitsInBx[0].size()); | ||
for (auto& firedLayerBits : firedLayerBitsInBx) { | ||
firedLayerBitsSum |= firedLayerBits; | ||
} | ||
return firedLayerBitsSum; | ||
} | ||
|
||
virtual bool isLayerFired(unsigned int iLayer, unsigned int bx) const { return firedLayerBitsInBx.at(bx)[iLayer]; } | ||
|
||
virtual double getPdfSum() const = 0; | ||
|
||
virtual const StubResult& getStubResult(unsigned int iLayer) const = 0; | ||
|
||
virtual const StubResults& getStubResults() const = 0; | ||
|
||
protected: | ||
///bits representing fired logicLayers (including bending layers), | ||
std::vector<boost::dynamic_bitset<> > firedLayerBitsInBx; | ||
}; | ||
|
||
#endif /* L1T_OmtfP1_ALGOMUONBASE_H_ */ |
119 changes: 119 additions & 0 deletions
119
L1Trigger/L1TMuonOverlapPhase1/interface/AngleConverterBase.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#ifndef L1T_OmtfP1_ANGLECONVERTER_H | ||
#define L1T_OmtfP1_ANGLECONVERTER_H | ||
|
||
#include "L1Trigger/L1TMuonOverlapPhase1/interface/ProcConfigurationBase.h" | ||
|
||
#include "FWCore/Framework/interface/ESHandle.h" | ||
#include "DataFormats/GeometryVector/interface/GlobalPoint.h" | ||
#include "DataFormats/L1TMuon/interface/RegionalMuonCandFwd.h" | ||
#include "Geometry/Records/interface/MuonGeometryRecord.h" | ||
#include "FWCore/Framework/interface/ESWatcher.h" | ||
|
||
#include <memory> | ||
|
||
namespace edm { | ||
class EventSetup; | ||
} | ||
|
||
class RPCGeometry; | ||
class CSCGeometry; | ||
class CSCLayer; | ||
class DTGeometry; | ||
|
||
class L1MuDTChambPhDigi; | ||
class L1MuDTChambThDigi; | ||
class L1MuDTChambThContainer; | ||
class CSCCorrelatedLCTDigi; | ||
class RPCDigi; | ||
|
||
class DTChamberId; | ||
class CSCDetId; | ||
class RPCDetId; | ||
|
||
struct EtaValue { | ||
int eta = 0; | ||
///error of the eta measurement | ||
int etaSigma = 0; | ||
int quality = 0; | ||
|
||
int bx = 0; | ||
int timing = 0; //sub-bx timing, should be already in scale common for all muon subsystems | ||
}; | ||
|
||
struct MuonGeometryTokens { | ||
edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeometryEsToken; | ||
edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeometryEsToken; | ||
edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeometryEsToken; | ||
}; | ||
|
||
class AngleConverterBase { | ||
public: | ||
AngleConverterBase(); | ||
virtual ~AngleConverterBase(); | ||
|
||
///Update the Geometry with current Event Setup | ||
virtual void checkAndUpdateGeometry(const edm::EventSetup&, | ||
const ProcConfigurationBase* config, | ||
const MuonGeometryTokens& muonGeometryTokens); | ||
|
||
/// get phi of DT,CSC and RPC azimutal angle digi in processor scale, used by OMTF algorithm. | ||
/// in case of wrong phi returns OMTFConfiguration::instance()->nPhiBins | ||
/// phiZero - desired phi where the scale should start, should be in the desired scale, use getProcessorPhiZero to obtain it | ||
virtual int getProcessorPhi(int phiZero, l1t::tftype part, int dtScNum, int dtPhi) const; | ||
|
||
virtual int getProcessorPhi(int phiZero, | ||
l1t::tftype part, | ||
const CSCDetId& csc, | ||
const CSCCorrelatedLCTDigi& digi) const; | ||
|
||
virtual int getProcessorPhi(unsigned int iProcessor, | ||
l1t::tftype part, | ||
const RPCDetId& rollId, | ||
const unsigned int& digi) const; | ||
virtual int getProcessorPhi(int phiZero, | ||
l1t::tftype part, | ||
const RPCDetId& rollId, | ||
const unsigned int& digi1, | ||
const unsigned int& digi2) const; | ||
|
||
///returns the eta position of the DT chamber | ||
///(n.b. in the DT phi and eta segments are independent) | ||
virtual EtaValue getGlobalEtaDt(const DTChamberId& detId) const; | ||
|
||
//adds the eta segments from the thetaDigi to etaSegments | ||
virtual void getGlobalEta(const L1MuDTChambThDigi& thetaDigi, std::vector<EtaValue>& etaSegments) const; | ||
virtual std::vector<EtaValue> getGlobalEta(const L1MuDTChambThContainer* dtThDigis, int bxFrom, int bxTo) const; | ||
|
||
///Convert local eta coordinate to global digital microGMT scale. | ||
virtual EtaValue getGlobalEta(const CSCDetId& detId, const CSCCorrelatedLCTDigi& aDigi) const; | ||
|
||
///returns the eta position of the CSC chamber | ||
virtual EtaValue getGlobalEtaCsc(const CSCDetId& detId) const; | ||
|
||
///Convert local eta coordinate to global digital microGMT scale. | ||
///EtaValue::etaSigma is half of the strip | ||
virtual EtaValue getGlobalEta(unsigned int rawid, const unsigned int& aDigi) const; | ||
|
||
float cscChamberEtaSize(const CSCDetId& id) const; | ||
|
||
protected: | ||
///Check orientation of strips in given CSC chamber | ||
virtual bool isCSCCounterClockwise(const CSCLayer* layer) const; | ||
|
||
///Find BTI group | ||
virtual const int findBTIgroup(const L1MuDTChambPhDigi& aDigi, const L1MuDTChambThContainer* dtThDigis); | ||
|
||
// pointers to the current geometry records | ||
unsigned long long _geom_cache_id = 0; | ||
edm::ESHandle<RPCGeometry> _georpc; | ||
edm::ESHandle<CSCGeometry> _geocsc; | ||
edm::ESHandle<DTGeometry> _geodt; | ||
|
||
edm::ESWatcher<MuonGeometryRecord> muonGeometryRecordWatcher; | ||
|
||
const ProcConfigurationBase* config = nullptr; | ||
///Number of phi bins along 2Pi. | ||
unsigned int nPhiBins = 0; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* MuonStub.h | ||
* | ||
* Created on: Dec 21, 2018 | ||
* Author: kbunkow | ||
* | ||
* MuonStub - data structure for algorithm input | ||
*/ | ||
|
||
#ifndef L1T_OmtfP1_MUONSTUB_H_ | ||
#define L1T_OmtfP1_MUONSTUB_H_ | ||
|
||
#include <vector> | ||
#include <memory> | ||
|
||
struct MuonStub { | ||
public: | ||
enum Type { | ||
EMPTY, | ||
DT_PHI, | ||
DT_THETA, | ||
DT_PHI_ETA, | ||
DT_HIT, | ||
RPC, | ||
CSC_PHI, | ||
CSC_ETA, | ||
CSC_PHI_ETA, | ||
BARREL_SUPER_SEG, | ||
}; | ||
|
||
MuonStub(); | ||
|
||
MuonStub(int phiHw, int phiBHw) : phiHw(phiHw), phiBHw(phiBHw){}; | ||
|
||
virtual ~MuonStub(); | ||
|
||
Type type = EMPTY; | ||
|
||
int phiHw = 0; | ||
int phiBHw = 0; | ||
|
||
static const int EMTPY_PHI = 0xffffff; | ||
|
||
int etaHw = 0; | ||
int etaSigmaHw = 0; ///error of the eta measurement | ||
int qualityHw = 0; | ||
|
||
int bx = 0; | ||
int timing = 0; | ||
|
||
//used to address LUTs | ||
unsigned int logicLayer = 0; | ||
|
||
//int roll = 0; //TODO remove | ||
|
||
int detId = 0; | ||
|
||
friend std::ostream& operator<<(std::ostream& out, const MuonStub& stub); | ||
}; | ||
|
||
typedef std::vector<MuonStub> MuonStubs1D; | ||
typedef std::vector<MuonStubs1D> MuonStubs2D; | ||
|
||
typedef std::shared_ptr<const MuonStub> MuonStubPtr; | ||
typedef std::vector<MuonStubPtr> MuonStubPtrs1D; | ||
typedef std::vector<MuonStubPtrs1D> MuonStubPtrs2D; | ||
|
||
#endif /* L1T_OmtfP1_MUONSTUB_H_ */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid type declarations in cloned modules as recommended here:
Point 17 in http://cms-sw.github.io/cms_coding_rules.html#6--packaging-rules-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So do you mean it should be
bxMin = -3,
bxMax = 4
in the DQM/L1TMonitor/python/L1TStage2Emulator_cff.py?
This will require adding default values of the bxMin and bxMax to the L1Trigger/L1TMuonOverlapPhase1/python/simOmtfDigis_cfi.py (which in principle is not a problem)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is what I mean, and yes please add them to cfi, that's the recommended way to work
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, changes committed.