36 #include <fastjet/JetDefinition.hh>
90 iConfig.getParameter<edm::
InputTag>(
"L1TrackInputTag"))),
107 produces<TkJetCollection>(
"L1TrackFastJetsExtended");
109 produces<TkJetCollection>(
"L1TrackFastJets");
122 std::vector<TTTrack<Ref_Phase2TrackerDigi_> >::const_iterator iterL1Track;
131 std::vector<fastjet::PseudoJet> JetInputs;
133 float recoVtx = TkPrimaryVertexHandle->begin()->zvertex();
134 unsigned int this_l1track = 0;
135 for (iterL1Track = TTTrackHandle->begin(); iterL1Track != TTTrackHandle->end(); iterL1Track++) {
137 float trk_pt = iterL1Track->momentum().perp();
138 float trk_z0 = iterL1Track->z0();
139 float trk_chi2dof = iterL1Track->chi2Red();
140 float trk_bendchi2 = iterL1Track->stubPtConsistency();
142 theStubs = iterL1Track->getStubRefs();
143 int trk_nstub = (int)theStubs.size();
147 if (fabs(iterL1Track->momentum().eta()) >
trkEtaMax_)
161 for (
int istub = 0; istub < trk_nstub; istub++) {
162 DetId detId(theStubs.at(istub)->getDetId());
163 bool tmp_isPS =
false;
178 fastjet::PseudoJet psuedoJet(iterL1Track->momentum().x(),
179 iterL1Track->momentum().y(),
180 iterL1Track->momentum().z(),
181 iterL1Track->momentum().mag());
182 JetInputs.push_back(psuedoJet);
183 JetInputs.back().set_user_index(this_l1track - 1);
186 fastjet::ClusterSequence
cs(JetInputs, jet_def);
187 std::vector<fastjet::PseudoJet> JetOutputs =
188 fastjet::sorted_by_pt(cs.inclusive_jets(0));
190 for (
unsigned int ijet = 0; ijet < JetOutputs.size(); ++ijet) {
192 JetOutputs[ijet].px(), JetOutputs[ijet].py(), JetOutputs[ijet].pz(), JetOutputs[ijet].modp());
195 std::vector<edm::Ptr<L1TTTrackType> > L1TrackPtrs;
196 std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(cs.constituents(JetOutputs[ijet]));
198 for (
unsigned int i = 0;
i < fjConstituents.size(); ++
i) {
199 auto index = fjConstituents[
i].user_index();
201 L1TrackPtrs.push_back(trkPtr);
202 sumpt = sumpt + trkPtr->momentum().perp();
203 avgZ = avgZ + trkPtr->momentum().perp() * trkPtr->z0();
207 TkJet trkJet(jetP4, jetRef, L1TrackPtrs, avgZ);
208 L1TrackFastJets->push_back(trkJet);
212 iEvent.
put(
std::move(L1TrackFastJets),
"L1TrackFastJetsExtended");
214 iEvent.
put(
std::move(L1TrackFastJets),
"L1TrackFastJets");
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int tidRing(const DetId &id) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
unique_ptr< ClusterSequence > cs
void produce(edm::Event &, const edm::EventSetup &) override
L1TrackFastJetProducer(const edm::ParameterSet &)
bool getData(T &iHolder) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< L1TTTrackType > L1TTTrackCollectionType
static constexpr auto TOB
Class to store the L1 Track Trigger stubs.
float trkChi2dofTightChi2_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Class to store the L1 Track Trigger tracks.
std::vector< TkPrimaryVertex > TkPrimaryVertexCollection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
~L1TrackFastJetProducer() override
std::vector< TkJet > TkJetCollection
edm::EDGetTokenT< TkPrimaryVertexCollection > pvToken_
static constexpr auto TID
unsigned int tobLayer(const DetId &id) const