41 #include <fastjet/JetDefinition.hh> 86 : trkZMax_((
float)iConfig.getParameter<double>(
"trk_zMax")),
87 trkPtMin_((
float)iConfig.getParameter<double>(
"trk_ptMin")),
88 trkEtaMax_((
float)iConfig.getParameter<double>(
"trk_etaMax")),
89 trkNStubMin_((
int)iConfig.getParameter<
int>(
"trk_nStubMin")),
90 trkNPSStubMin_((
int)iConfig.getParameter<
int>(
"trk_nPSStubMin")),
91 coneSize_((
float)iConfig.getParameter<double>(
"coneSize")),
92 displaced_(iConfig.getParameter<
bool>(
"displaced")),
94 iConfig.getParameter<
edm::
InputTag>(
"L1TrackInputTag"))),
97 iConfig.getParameter<
edm::
InputTag>(
"MCTruthTrackInputTag"))) {
99 produces<TkJetCollection>(
"L1TruthTrackFastJetsExtended");
101 produces<TkJetCollection>(
"L1TruthTrackFastJets");
111 std::vector<TTTrack<Ref_Phase2TrackerDigi_> >::const_iterator iterL1Track;
120 fastjet::JetDefinition jet_def(fastjet::antikt_algorithm,
coneSize_);
121 std::vector<fastjet::PseudoJet> JetInputs;
123 unsigned int this_l1track = 0;
124 for (iterL1Track = TTTrackHandle->begin(); iterL1Track != TTTrackHandle->end(); iterL1Track++) {
128 theStubs = iterL1Track->getStubRefs();
135 if (iterL1Track->momentum().perp() <
trkPtMin_)
137 int trk_nstub = (
int)theStubs.size();
142 for (
int istub = 0; istub < trk_nstub; istub++) {
144 bool tmp_isPS =
false;
165 fastjet::PseudoJet psuedoJet(iterL1Track->momentum().x(),
166 iterL1Track->momentum().y(),
167 iterL1Track->momentum().z(),
168 iterL1Track->momentum().mag());
169 JetInputs.push_back(psuedoJet);
170 JetInputs.back().set_user_index(this_l1track - 1);
173 fastjet::ClusterSequence
cs(JetInputs, jet_def);
174 std::vector<fastjet::PseudoJet> JetOutputs =
175 fastjet::sorted_by_pt(
cs.inclusive_jets(0));
177 for (
unsigned int ijet = 0; ijet < JetOutputs.size(); ++ijet) {
179 JetOutputs[ijet].
px(), JetOutputs[ijet].
py(), JetOutputs[ijet].pz(), JetOutputs[ijet].modp());
182 std::vector<edm::Ptr<L1TTTrackType> > L1TrackPtrs;
183 std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(
cs.constituents(JetOutputs[ijet]));
185 for (
unsigned int i = 0;
i < fjConstituents.size(); ++
i) {
186 auto index = fjConstituents[
i].user_index();
188 L1TrackPtrs.push_back(trkPtr);
194 TkJet trkJet(jetP4, jetRef, L1TrackPtrs, avgZ);
195 L1TrackFastJets->push_back(trkJet);
199 iEvent.put(
std::move(L1TrackFastJets),
"L1TruthTrackFastJetsExtended");
209 desc.add<
double>(
"trk_zMax", 15.);
210 desc.add<
double>(
"trk_ptMin", 2.0);
211 desc.add<
double>(
"trk_etaMax", 2.4);
212 desc.add<
int>(
"trk_nStubMin", 4);
213 desc.add<
int>(
"trk_nPSStubMin", -1);
214 desc.add<
double>(
"coneSize", 0.4);
215 desc.add<
bool>(
"displaced",
false);
216 descriptions.
add(
"l1tTruthTrackFastJets",
desc);
unsigned int tobLayer(const DetId &id) const
EncodedEventId eventId() const
Signal source, crossing number.
int event() const
get the contents of the subdetector field (should be protected?)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::vector< L1TTTrackType > L1TTTrackCollectionType
L1TruthTrackFastJetProducer(const edm::ParameterSet &)
GlobalVector momentum() const
Track momentum.
Stores association of Truth Particles (TP) to L1 Track-Trigger Tracks.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool isNull() const
Checks for null.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::Event &, const edm::EventSetup &) override
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
static constexpr auto TOB
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
Class to store the L1 Track Trigger stubs.
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Class to store the L1 Track Trigger tracks.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double z0() const
Track z0.
unsigned int tidRing(const DetId &id) const
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
std::vector< TkJet > TkJetCollection
static constexpr auto TID
const edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > ttTrackMCTruthToken_