75 ProducerKFout::ProducerKFout(
const ParameterSet& iConfig) : iConfig_(iConfig) {
76 const string& labelKF = iConfig.
getParameter<
string>(
"LabelKF");
77 const string& labelAS = iConfig.
getParameter<
string>(
"LabelAS");
78 const string& branchStubs = iConfig.
getParameter<
string>(
"BranchAcceptedStubs");
79 const string& branchTracks = iConfig.
getParameter<
string>(
"BranchAcceptedTracks");
80 const string& branchLost = iConfig.
getParameter<
string>(
"BranchLostTracks");
120 template <
typename T>
122 for (
int i = 0;
i < (
int)Bins.size();
i++) {
157 temp.emplace_back(std::make_shared<TrackKFOut>());
158 temp_collection.push_back(
temp);
160 OutTrackStreams.push_back(temp_collection);
166 for (
int iLink = 0; iLink <
numWorkers_; iLink++) {
169 temp.emplace_back(std::make_shared<TrackKFOut>());
170 temp_collection.push_back(
temp);
172 InTrackStreams.push_back(temp_collection);
177 for (
int iLink = 0; iLink < (
int)streamsTracks.size(); iLink++) {
178 for (
int iTrack = 0; iTrack < (
int)streamsTracks[iLink].
size(); iTrack++) {
179 const auto&
track = streamsTracks[iLink].at(iTrack);
193 double tempchi2rphi = 0;
194 double tempchi2rz = 0;
197 const auto& stub = streamsStubs[
setup_->
numLayers() * iLink + iStub].at(iTrack);
200 if (!stub.first.isNonnull())
203 HitPattern.set(iStub);
204 double phiSquared =
pow(InStub.
phi(), 2);
205 double zSquared =
pow(InStub.
z(), 2);
212 double tempRphi = phiSquared * tempv0;
213 double tempRz = zSquared * tempv1;
215 tempchi2rphi += tempRphi;
216 tempchi2rz += tempRz;
220 TTBV TrackValid(1, 1,
false);
221 TTBV extraMVA(0, 6,
false);
222 TTBV TQMVA(0, 3,
false);
223 TTBV BendChi2(0, 3,
false);
243 PartialTrack1.
set(31), PartialTrack2, PartialTrack3, sortKey,
track, iTrack, iLink,
true);
245 InTrackStreams[iLink /
numWorkers_][iLink %
numWorkers_][iTrack] = (std::make_shared<TrackKFOut>(Temp_track));
250 int iFinTrack = (
int)streamsTracks[iLink].
size();
254 (std::make_shared<TrackKFOut>(null_track));
260 vector<DistServer> distServers(
267 for (
int iWorker = 0; iWorker <
numWorkers_; iWorker++)
268 DistIn.push_back(InTrackStreams[iRegion][iWorker][iTrack]);
271 OutTrackStreams[iRegion][iLink][iTrack] =
279 for (
int iTrack = 0; iTrack < (
int)OutTrackStreams[iRegion][iLink].
size(); iTrack++) {
280 SortedPartialTracks[2 * iRegion + iLink].push_back(
281 OutTrackStreams[iRegion][iLink][iTrack]->PartialTrack1());
282 SortedPartialTracks[2 * iRegion + iLink].push_back(
283 OutTrackStreams[iRegion][iLink][iTrack]->PartialTrack2());
284 SortedPartialTracks[2 * iRegion + iLink].push_back(
285 OutTrackStreams[iRegion][iLink][iTrack]->PartialTrack3());
286 OutputStreamsTracks[2 * iRegion + iLink].emplace_back(OutTrackStreams[iRegion][iLink][iTrack]->
track());
292 for (
int iLink = 0; iLink < (
int)OutputStreamsTracks.size(); iLink++) {
294 int numLinkTracks = (
int)OutputStreamsTracks[iLink].
size();
295 if (numLinkTracks == 0)
297 if ((numLinkTracks % 2 != 0)) {
298 SortedPartialTracks[iLink].push_back(NullBitTrack);
299 OutputStreamsTracks[iLink].emplace_back(
300 OutputStreamsTracks[iLink][numLinkTracks++]);
302 for (
int iTrack = 0; iTrack < (
int)(SortedPartialTracks[iLink].
size()); iTrack++) {
306 for (
auto& it : ttTrackRefMap) {
307 if (it.second == OutputStreamsTracks[iLink][(
int)(iTrack - 1) / 3].
first)
311 accepted[iLink].emplace_back(
317 lost[iLink].emplace_back(
EDPutTokenT< StreamsTrack > edPutTokenAccepted_
std::vector< std::vector< std::vector< std::shared_ptr< TrackKFOut > > > > TrackKFOutSAPtrCollectionss
T getParameter(std::string const &) const
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
std::vector< StreamTrack > StreamsTrack
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::map< TTTrackRef, TTTrackRef > TTTrackRefMap
int kfoutchi2rzConv() const
double chosenRofZ() const
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
vector< double > dPhiBins_
Class to process and provide run-time constants used by Track Trigger emulators.
std::vector< StreamStub > StreamsStub
int tfpNumChannel() const
T const * product() const
std::vector< std::vector< std::shared_ptr< TrackKFOut > > > TrackKFOutSAPtrCollections
int partialTrackWordBits_
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
std::pair< TTTrackRef, Frame > FrameTrack
std::vector< double > kfoutchi2rzBins() const
int numSectorsEta() const
int kfoutchi2rphiConv() const
EDGetTokenT< StreamsStub > edGetTokenStubs_
double baseSector() const
EDPutTokenT< StreamsTrack > edPutTokenLost_
reco::JetExtendedAssociation::JetExtendedData Value
bool configurationSupported() const
#define DEFINE_FWK_MODULE(type)
ProcessHistory const & processHistory() const
void beginRun(const Run &, const EventSetup &) override
int weightBinFraction() const
double hybridChosenRofPhi() const
std::vector< TrackKFOutSAPtr > TrackKFOutSAPtrCollection
void checkHistory(const edm::ProcessHistory &processHistory) const
void produce(Event &, const EventSetup &) override
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
~ProducerKFout() override
std::vector< double > kfoutchi2rphiBins() const
EDGetTokenT< TTTrackRefMap > edGetTokenTTTrackRefMap_
int digitise(const vector< T > Bins, T Value, T factor=1)
Converts KF output into TFP output.
const DataFormats * dataFormats_
EDGetTokenT< StreamsTrack > edGetTokenTracks_