forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Channel Assignment TrackBuilder output Tracks + Stubs and InputRouter…
… input Stubs (cms-sw#110) * track builder channel upgraded to assign stubs to channel. * code format * readded missing pieces. * renamed TrackBuilderChannel to ChannelAssignment now also containing DTC to IR mapping * name change in L1Trigger/TrackFindingTracklet/python/ProducerKF_cff.py * bug fix * name change of config parameter * code-format * namespace change and consitency check added. * addressing ians comments * addressing ians comments
- Loading branch information
Showing
28 changed files
with
416 additions
and
226 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.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,63 @@ | ||
#ifndef L1Trigger_TrackFindingTracklet_ChannelAssignment_h | ||
#define L1Trigger_TrackFindingTracklet_ChannelAssignment_h | ||
|
||
#include "FWCore/Framework/interface/data_default_record_trait.h" | ||
#include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignmentRcd.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "DataFormats/L1TrackTrigger/interface/TTTypes.h" | ||
#include "L1Trigger/TrackTrigger/interface/Setup.h" | ||
|
||
#include <vector> | ||
|
||
namespace trklet { | ||
|
||
/*! \class trklet::ChannelAssignment | ||
* \brief Class to assign tracklet tracks and stubs to output channel | ||
* based on their Pt or seed type as well as DTC stubs to input channel | ||
* \author Thomas Schuh | ||
* \date 2020, Nov; updated 2021 Oct | ||
*/ | ||
class ChannelAssignment { | ||
public: | ||
ChannelAssignment() {} | ||
ChannelAssignment(const edm::ParameterSet& iConfig, const tt::Setup* setup); | ||
~ChannelAssignment() {} | ||
// sets channelId of given TTTrackRef from TrackBuilder or PurgeDuplicate (if enabled), return false if track outside pt range | ||
bool channelId(const TTTrackRef& ttTrackRef, int& channelId); | ||
// number of used channels | ||
int numChannels() const { return numChannels_; } | ||
// sets layerId (0-7 in sequence the seed type projects to) of given TTStubRef and TTTrackRef, returns false if seeed stub | ||
bool layerId(const TTTrackRef& ttTrackRef, const TTStubRef& ttStubRef, int& layerId); | ||
// max number layers a sedd type may project to | ||
int maxNumProjectionLayers() const { return maxNumProjectionLayers_; } | ||
// map of used DTC tfp channels in InputRouter | ||
std::vector<int> channelEncoding() const { return channelEncoding_; } | ||
|
||
private: | ||
// helper class to store configurations | ||
const tt::Setup* setup_; | ||
// use tracklet seed type as channel id if False, binned track pt used if True | ||
bool useDuplicateRemoval_; | ||
// pt Boundaries in GeV, last boundary is infinity | ||
std::vector<double> boundaries_; | ||
// seed type names | ||
std::vector<std::string> seedTypeNames_; | ||
// number of used seed types in tracklet algorithm | ||
int numSeedTypes_; | ||
// number of used channels | ||
int numChannels_; | ||
// max number layers a sedd type may project to | ||
int maxNumProjectionLayers_; | ||
// seeding layers of seed types using default layer id [barrel: 1-6, discs: 11-15] | ||
std::vector<std::vector<int>> seedTypesSeedLayers_; | ||
// layers a seed types can project to using default layer id [barrel: 1-6, discs: 11-15] | ||
std::vector<std::vector<int>> seedTypesProjectionLayers_; | ||
// map of used DTC tfp channels in InputRouter | ||
std::vector<int> channelEncoding_; | ||
}; | ||
|
||
} // namespace trklet | ||
|
||
EVENTSETUP_DATA_DEFAULT_RECORD(trklet::ChannelAssignment, trklet::ChannelAssignmentRcd); | ||
|
||
#endif |
17 changes: 17 additions & 0 deletions
17
L1Trigger/TrackFindingTracklet/interface/ChannelAssignmentRcd.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,17 @@ | ||
#ifndef L1Trigger_TrackFindingTracklet_ChannelAssignmentRcd_h | ||
#define L1Trigger_TrackFindingTracklet_ChannelAssignmentRcd_h | ||
|
||
#include "FWCore/Framework/interface/DependentRecordImplementation.h" | ||
#include "FWCore/Utilities/interface/mplVector.h" | ||
#include "L1Trigger/TrackTrigger/interface/SetupRcd.h" | ||
|
||
namespace trklet { | ||
|
||
typedef edm::mpl::Vector<tt::SetupRcd> RcdsChannelAssignment; | ||
|
||
class ChannelAssignmentRcd | ||
: public edm::eventsetup::DependentRecordImplementation<ChannelAssignmentRcd, RcdsChannelAssignment> {}; | ||
|
||
} // namespace trklet | ||
|
||
#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
42 changes: 0 additions & 42 deletions
42
L1Trigger/TrackFindingTracklet/interface/TrackBuilderChannel.h
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
L1Trigger/TrackFindingTracklet/interface/TrackBuilderChannelRcd.h
This file was deleted.
Oops, something went wrong.
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
45 changes: 45 additions & 0 deletions
45
L1Trigger/TrackFindingTracklet/plugins/ProducerChannelAssignment.cc
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 @@ | ||
#include "FWCore/Framework/interface/ESProducer.h" | ||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Utilities/interface/ESGetToken.h" | ||
#include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.h" | ||
#include "L1Trigger/TrackTrigger/interface/Setup.h" | ||
|
||
#include <memory> | ||
|
||
using namespace std; | ||
using namespace edm; | ||
using namespace tt; | ||
|
||
namespace trklet { | ||
|
||
/*! \class trklet::ProducerChannelAssignment | ||
* \brief Creates ChannelAssignment class that assigns tracklet tracks and stubs | ||
* to output channel as well as DTC stubs to input channel | ||
* \author Thomas Schuh | ||
* \date 2020, Nov | ||
*/ | ||
class ProducerChannelAssignment : public ESProducer { | ||
public: | ||
ProducerChannelAssignment(const ParameterSet& iConfig); | ||
~ProducerChannelAssignment() override {} | ||
unique_ptr<ChannelAssignment> produce(const ChannelAssignmentRcd& rcd); | ||
|
||
private: | ||
const ParameterSet* iConfig_; | ||
ESGetToken<Setup, SetupRcd> esGetToken_; | ||
}; | ||
|
||
ProducerChannelAssignment::ProducerChannelAssignment(const ParameterSet& iConfig) : iConfig_(&iConfig) { | ||
auto cc = setWhatProduced(this); | ||
esGetToken_ = cc.consumes(); | ||
} | ||
|
||
unique_ptr<ChannelAssignment> ProducerChannelAssignment::produce(const ChannelAssignmentRcd& rcd) { | ||
const Setup* setup = &rcd.get(esGetToken_); | ||
return make_unique<ChannelAssignment>(*iConfig_, setup); | ||
} | ||
|
||
} // namespace trklet | ||
|
||
DEFINE_FWK_EVENTSETUP_MODULE(trklet::ProducerChannelAssignment); |
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
Oops, something went wrong.