19 useDuplicateRemoval_(iConfig.getParameter<
bool>(
"UseDuplicateRemoval")),
20 boundaries_(iConfig.getParameter<
vector<double>>(
"PtBoundaries")),
21 seedTypeNames_(iConfig.getParameter<
vector<
string>>(
"SeedTypes")),
22 numSeedTypes_(seedTypeNames_.
size()),
23 numChannelsTrack_(useDuplicateRemoval_ ? 2 * boundaries_.
size() : numSeedTypes_),
24 channelEncoding_(iConfig.getParameter<
vector<
int>>(
"IRChannelsIn")) {
33 auto acc = [](
int sum, vector<int>
ints) {
return sum + (
int)
ints.size(); };
44 static constexpr
int invalidSeedLayer = -1;
45 static constexpr
int invalidLayerDisk = 0;
47 const auto& seedlayers = settings.
seedlayers();
48 const auto& projlayers = settings.
projlayers();
49 const auto& projdisks = settings.
projdisks();
51 vector<set<int>> allSeedingLayer(seedlayers.size());
52 vector<set<int>> allProjectionLayer(seedlayers.size());
53 for (
int iSeed = 0; iSeed < (
int)seedlayers.size(); iSeed++)
54 for (
const auto& layer : seedlayers[iSeed])
55 if (layer != invalidSeedLayer)
56 allSeedingLayer[iSeed].insert(layer < numBarrelLayer ? layer + offsetBarrel
57 : layer + offsetDisk - numBarrelLayer);
58 for (
int iSeed = 0; iSeed < (
int)projlayers.size(); iSeed++)
59 for (
const auto& layer : projlayers[iSeed])
60 if (layer != invalidLayerDisk)
61 allProjectionLayer[iSeed].insert(layer);
62 for (
int iSeed = 0; iSeed < (
int)projdisks.size(); iSeed++)
63 for (
const auto& disk : projdisks[iSeed])
64 if (disk != invalidLayerDisk)
65 allProjectionLayer[iSeed].insert(disk - offsetBarrel + offsetDisk);
67 for (
int iSubSeed = 0; iSubSeed <
numSeedTypes_; iSubSeed++) {
70 for (
int iAllSeed = 0; iAllSeed < (
int)seedlayers.size(); iAllSeed++) {
72 const set<int>& asl = allSeedingLayer[iAllSeed];
73 set<int> sl(seedLayers.begin(), seedLayers.end());
75 set_intersection(sl.begin(), sl.end(), asl.begin(), asl.end(), inserter(intersect, intersect.begin()));
76 if (intersect == sl) {
80 const set<int>& apl = allProjectionLayer[iAllSeed];
81 set<int> pl(projectionLayers.begin(), projectionLayers.end());
83 set_intersection(pl.begin(), pl.end(), apl.begin(), apl.end(), inserter(intersect, intersect.begin()));
88 pl.begin(), pl.end(), intersect.begin(), intersect.end(), inserter(difference, difference.begin()));
91 for (
int layer : difference)
93 exception <<
") are not supported with seed type ( ";
94 for (
int layer : seedLayers)
97 exception.addContext(
"trklet::ChannelAssignment::ChannelAssignment");
105 for (
int layer : seedLayers)
108 exception.addContext(
"trklet::ChannelAssignment::ChannelAssignment");
111 auto bigger = [](
const vector<int>& lhs,
const vector<int>& rhs) {
return lhs.size() < rhs.size(); };
120 const int seedType = ttTrackRef->trackSeedType();
123 exception <<
"TTTracks form seed type" << seedType <<
" not in supported list: (";
127 exception.addContext(
"trklet:ChannelAssignment:channelId");
133 const double pt = ttTrackRef->momentum().perp();
153 exception.addContext(
"trklet::ChannelAssignment::layerId");
154 exception <<
"TTTracks with with seed type " << seedType <<
" not supported.";
162 const auto pos =
find(projectingLayers.begin(), projectingLayers.end(), layer);
163 if (
pos == projectingLayers.end()) {
166 exception.addContext(
"trklet::ChannelAssignment::layerId");
167 exception <<
"TTStub from layer " << layer <<
" (barrel: 1-6; discs: 11-15) from seed type " <<
name 168 <<
" not supported.";
186 if (its !=
seeds.end())
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
bool useDuplicateRemoval_
int maxNumProjectionLayers_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int offsetStub(int channelTrack) const
bool channelId(const TTTrackRef &ttTrackRef, int &channelId)
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
int layerId(const TTStubRef &ttStubRef) const
std::vector< double > boundaries_
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
std::vector< int > offsetsStubs_
int offsetLayerDisks() const
int offsetLayerId() const
std::vector< std::vector< int > > seedTypesProjectionLayers_
std::vector< std::vector< int > > seedTypesSeedLayers_
int numBarrelLayer() const
bool layerId(int seedType, const TTStubRef &ttStubRef, int &layerId) const
ROOT::VecOps::RVec< int > ints