132 std::unique_ptr<TkJetCollection> L1FastTrackingJets(
new TkJetCollection);
137 std::vector<TTTrack<Ref_Phase2TrackerDigi_>>::const_iterator iterL1Track;
151 fastjet::JetDefinition jet_def(fastjet::antikt_algorithm,
coneSize_);
152 std::vector<fastjet::PseudoJet> JetInputs;
154 float recoVtx = L1VertexHandle->begin()->z0();
155 unsigned int this_l1track = 0;
156 for (iterL1Track = TTTrackHandle->begin(); iterL1Track != TTTrackHandle->end(); iterL1Track++) {
158 float trk_pt = iterL1Track->momentum().perp();
159 float trk_z0 = iterL1Track->z0();
160 float trk_chi2dof = iterL1Track->chi2Red();
161 float trk_bendchi2 = iterL1Track->stubPtConsistency();
163 theStubs = iterL1Track->getStubRefs();
164 int trk_nstub = (
int)theStubs.size();
182 for (
int istub = 0; istub < trk_nstub; istub++) {
183 DetId detId(theStubs.at(istub)->getDetId());
184 bool tmp_isPS =
false;
198 if (!
iEvent.isRealData()) {
203 if (!(MCTrkAssociation->isLooselyGenuine(trk_ptr) || MCTrkAssociation->isGenuine(trk_ptr)) &&
206 if (!(MCTrkAssociation->isLooselyGenuine(trk_ptr) || MCTrkAssociation->isGenuine(trk_ptr) ||
207 MCTrkAssociation->isCombinatoric(trk_ptr)) &&
212 fastjet::PseudoJet psuedoJet(iterL1Track->momentum().x(),
213 iterL1Track->momentum().y(),
214 iterL1Track->momentum().z(),
215 iterL1Track->momentum().mag());
216 JetInputs.push_back(psuedoJet);
217 JetInputs.back().set_user_index(this_l1track - 1);
220 fastjet::ClusterSequence
cs(JetInputs, jet_def);
221 std::vector<fastjet::PseudoJet> JetOutputs =
222 fastjet::sorted_by_pt(
cs.inclusive_jets(0));
224 for (
unsigned int ijet = 0; ijet < JetOutputs.size(); ++ijet) {
226 JetOutputs[ijet].
px(), JetOutputs[ijet].
py(), JetOutputs[ijet].pz(), JetOutputs[ijet].modp());
229 std::vector<edm::Ptr<L1TTTrackType>> L1TrackPtrs;
230 std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(
cs.constituents(JetOutputs[ijet]));
232 for (
unsigned int i = 0;
i < fjConstituents.size(); ++
i) {
233 auto index = fjConstituents[
i].user_index();
235 L1TrackPtrs.push_back(trkPtr);
236 sumpt = sumpt + trkPtr->momentum().perp();
237 avgZ = avgZ + trkPtr->momentum().perp() * trkPtr->z0();
241 TkJet trkJet(jetP4, jetRef, L1TrackPtrs, avgZ);
242 L1FastTrackingJets->push_back(trkJet);
246 iEvent.put(
std::move(L1FastTrackingJets),
"L1FastTrackingJetsExtended");
unsigned int tobLayer(const DetId &id) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > genToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const double trkBendChi2Max_
const float trkChi2dofTightChi2_
edm::EDGetTokenT< std::vector< l1t::Vertex > > pvToken_
const float trkChi2dofMax_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool selectTrkMatchGenLoose_
const float trkPtTightChi2_
Abs< T >::type abs(const T &t)
static constexpr auto TOB
Class to store the L1 Track Trigger stubs.
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
bool selectTrkMatchGenTight_
bool selectTrkMatchGenOrPU_
unsigned int tidRing(const DetId &id) const
std::vector< TkJet > TkJetCollection
static constexpr auto TID