104 std::vector<TrackingParticle>::const_iterator iterTP;
113 fastjet::JetDefinition jet_def(fastjet::antikt_algorithm,
coneSize_);
114 std::vector<fastjet::PseudoJet> JetInputs;
117 unsigned int this_tp = 0;
118 for (iterTP = TrackingParticleHandle->begin(); iterTP != TrackingParticleHandle->end(); iterTP++) {
123 theStubRefs = MCTruthTTStubHandle->findTTStubRefs(tp_ptr);
124 int nStubTP = (
int)theStubRefs.size();
127 int hasStubInLayer[11] = {0};
128 for (
auto& theStubRef : theStubRefs) {
129 DetId detid(theStubRef->getDetId());
133 layer =
static_cast<int>(tTopo.
layer(detid)) - 1;
135 layer =
static_cast<int>(tTopo.
layer(detid)) + 5;
139 if (MCTruthTTStubHandle->findTrackingParticlePtr(theStubRef).isNull() && hasStubInLayer[
layer] < 2)
140 hasStubInLayer[
layer] = 1;
142 hasStubInLayer[
layer] = 2;
145 int nStubLayerTP = 0;
146 for (
int isum : hasStubInLayer) {
160 if (fabs(iterTP->z0()) >
tpZMax_)
162 if (iterTP->charge() == 0.)
164 if (iterTP->eventId().event() > 0)
167 fastjet::PseudoJet psuedoJet(iterTP->px(), iterTP->py(), iterTP->pz(), iterTP->energy());
168 JetInputs.push_back(psuedoJet);
169 JetInputs.back().set_user_index(this_tp - 1);
172 fastjet::ClusterSequence
cs(JetInputs, jet_def);
173 std::vector<fastjet::PseudoJet> JetOutputs =
174 fastjet::sorted_by_pt(
cs.inclusive_jets(0));
176 for (
unsigned int ijet = 0; ijet < JetOutputs.size(); ++ijet) {
178 JetOutputs[ijet].
px(), JetOutputs[ijet].
py(), JetOutputs[ijet].pz(), JetOutputs[ijet].modp());
181 std::vector<edm::Ptr<TrackingParticle>> tpPtrs;
182 std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(
cs.constituents(JetOutputs[ijet]));
184 for (
unsigned int i = 0;
i < fjConstituents.size(); ++
i) {
185 auto index = fjConstituents[
i].user_index();
187 tpPtrs.push_back(tpPtr);
188 sumpt = sumpt + tpPtr->pt();
189 avgZ = avgZ + tpPtr->pt() * tpPtr->z0();
193 std::vector<edm::Ptr<TTTrack<Ref_Phase2TrackerDigi_>>> dummyL1TrackPtrs;
194 TkJet tpJet(jetP4, dummyL1TrackPtrs, avgZ, fjConstituents.size(), 0, 0, 0,
false);
195 TPFastJets->push_back(tpJet);
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
unsigned int layer(const DetId &id) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
static constexpr auto TOB
Class to store the L1 Track Trigger stubs.
edm::EDGetTokenT< TTStubAssociationMap< Ref_Phase2TrackerDigi_ > > ttStubMCTruthToken_
const int tpNStubLayerMin_
edm::EDGetTokenT< std::vector< TrackingParticle > > trackingParticleToken_
std::vector< TkJet > TkJetCollection
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
static constexpr auto TID