20 widthLayerId_(pSetDRin_.getParameter<
int>(
"WidthLayerId")),
21 widthStubId_(pSetDRin_.getParameter<
int>(
"WidthStubId")),
22 widthSeedStubId_(pSetDRin_.getParameter<
int>(
"WidthSeedStubId")),
23 widthPSTilt_(pSetDRin_.getParameter<
int>(
"WidthPSTilt")),
24 depthMemory_(pSetDRin_.getParameter<
int>(
"DepthMemory")),
25 ptBoundaries_(pSetDRin_.getParameter<
vector<double>>(
"PtBoundaries")),
27 numComparisonModules_(pSetDR_.getParameter<
int>(
"NumComparisonModules")),
28 minIdenticalStubs_(pSetDR_.getParameter<
int>(
"MinIdenticalStubs")),
29 numNodesDR_(2 * (ptBoundaries_.size() + 1)),
30 seedTypeNames_(iConfig.getParameter<
vector<
string>>(
"SeedTypes")),
31 numSeedTypes_(seedTypeNames_.size()),
32 numChannelsTrack_(numSeedTypes_),
33 channelEncoding_(iConfig.getParameter<
vector<
int>>(
"IRChannelsIn")) {
46 static constexpr int invalidSeedLayer = -1;
47 static constexpr int invalidLayerDisk = 0;
49 const auto& seedlayers = settings.
seedlayers();
50 const auto& projlayers = settings.
projlayers();
51 const auto& projdisks = settings.
projdisks();
53 vector<set<int>> allSeedingLayer(seedlayers.size());
54 vector<set<int>> allProjectionLayer(seedlayers.size());
55 for (
int iSeed = 0; iSeed < (
int)seedlayers.size(); iSeed++)
56 for (
const auto& layer : seedlayers[iSeed])
57 if (layer != invalidSeedLayer)
58 allSeedingLayer[iSeed].insert(layer < numBarrelLayer ? layer + offsetBarrel
59 : layer + offsetDisk - numBarrelLayer);
60 for (
int iSeed = 0; iSeed < (
int)projlayers.size(); iSeed++)
61 for (
const auto& layer : projlayers[iSeed])
62 if (layer != invalidLayerDisk)
63 allProjectionLayer[iSeed].insert(layer);
64 for (
int iSeed = 0; iSeed < (
int)projdisks.size(); iSeed++)
65 for (
const auto& disk : projdisks[iSeed])
66 if (disk != invalidLayerDisk)
67 allProjectionLayer[iSeed].insert(disk - offsetBarrel + offsetDisk);
69 for (
int iSubSeed = 0; iSubSeed <
numSeedTypes_; iSubSeed++) {
72 for (
int iAllSeed = 0; iAllSeed < (
int)seedlayers.size(); iAllSeed++) {
74 const set<int>& asl = allSeedingLayer[iAllSeed];
75 set<int> sl(seedLayers.begin(), seedLayers.end());
77 set_intersection(sl.begin(), sl.end(), asl.begin(), asl.end(), inserter(intersect, intersect.begin()));
78 if (intersect == sl) {
82 const set<int>& apl = allProjectionLayer[iAllSeed];
83 set<int> pl(projectionLayers.begin(), projectionLayers.end());
85 set_intersection(pl.begin(), pl.end(), apl.begin(), apl.end(), inserter(intersect, intersect.begin()));
90 pl.begin(), pl.end(), intersect.begin(), intersect.end(), inserter(difference, difference.begin()));
93 for (
int layer : difference)
95 exception <<
") are not supported with seed type ( ";
96 for (
int layer : seedLayers)
99 exception.addContext(
"trklet::ChannelAssignment::ChannelAssignment");
107 for (
int layer : seedLayers)
110 exception.addContext(
"trklet::ChannelAssignment::ChannelAssignment");
113 auto bigger = [](
const vector<int>& lhs,
const vector<int>& rhs) {
return lhs.size() < rhs.size(); };
117 auto acc = [](
int sum, vector<int>
ints) {
return sum += (
int)
ints.size(); };
129 const int seedType = ttTrackRef->trackSeedType();
132 exception <<
"TTTracks form seed type" << seedType <<
" not in supported list: (";
136 exception.addContext(
"trklet:ChannelAssignment:channelId");
147 exception.addContext(
"trklet::ChannelAssignment::layerId");
148 exception <<
"TTTracks with with seed type " << seedType <<
" not supported.";
156 const auto pos =
find(projectingLayers.begin(), projectingLayers.end(), layer);
157 if (
pos == projectingLayers.end()) {
160 exception.addContext(
"trklet::ChannelAssignment::layerId");
161 exception <<
"TTStub from layer " << layer <<
" (barrel: 1-6; discs: 11-15) from seed type " <<
name 162 <<
" not supported.";
184 if (its !=
seeds.end())
191 const double pt = ttTrackRef->momentum().perp();
198 if (ttTrackRef->rInv() >= 0.)
T getParameter(std::string const &) const
std::vector< std::string > seedTypeNames_
unsigned int seedlayers(int inner, int seed) const
Class to process and provide run-time constants used by Track Trigger emulators.
const std::vector< int > & seedingLayers(int seedType) const
int nodeDR(const TTTrackRef &ttTrackRef) const
int channelId(const TTTrackRef &ttTrackRef) const
int maxNumProjectionLayers_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int offsetStub(int channelTrack) const
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
int layerId(const TTStubRef &ttStubRef) const
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
std::vector< int > offsetsStubs_
int offsetLayerDisks() const
int offsetLayerId() const
int numProjectionLayers(int seedType) const
std::vector< std::vector< int > > seedTypesProjectionLayers_
std::vector< std::vector< int > > seedTypesSeedLayers_
std::vector< double > ptBoundaries_
int numBarrelLayer() const
bool layerId(int seedType, const TTStubRef &ttStubRef, int &layerId) const
ROOT::VecOps::RVec< int > ints