41 #include <fastjet/JetDefinition.hh>
70 virtual void endJob();
99 iConfig.getParameter<edm::
InputTag>(
"L1TrackInputTag"))),
100 pvToken_(consumes<std::
vector<l1t::
Vertex>>(iConfig.getParameter<edm::
InputTag>(
"L1PrimaryVertexTag"))),
121 produces<TkJetCollection>(
"L1FastTrackingJetsExtended");
123 produces<TkJetCollection>(
"L1FastTrackingJets");
136 std::vector<TTTrack<Ref_Phase2TrackerDigi_>>::const_iterator iterL1Track;
150 std::vector<fastjet::PseudoJet> JetInputs;
152 float recoVtx = L1VertexHandle->begin()->z0();
153 unsigned int this_l1track = 0;
154 for (iterL1Track = TTTrackHandle->begin(); iterL1Track != TTTrackHandle->end(); iterL1Track++) {
156 float trk_pt = iterL1Track->momentum().perp();
157 float trk_z0 = iterL1Track->z0();
158 float trk_chi2dof = iterL1Track->chi2Red();
159 float trk_bendchi2 = iterL1Track->stubPtConsistency();
161 theStubs = iterL1Track->getStubRefs();
162 int trk_nstub = (int)theStubs.size();
180 for (
int istub = 0; istub < trk_nstub; istub++) {
181 DetId detId(theStubs.at(istub)->getDetId());
182 bool tmp_isPS =
false;
201 if (!(MCTrkAssociation->isLooselyGenuine(trk_ptr) || MCTrkAssociation->isGenuine(trk_ptr)) &&
204 if (!(MCTrkAssociation->isLooselyGenuine(trk_ptr) || MCTrkAssociation->isGenuine(trk_ptr) ||
205 MCTrkAssociation->isCombinatoric(trk_ptr)) &&
210 fastjet::PseudoJet psuedoJet(iterL1Track->momentum().x(),
211 iterL1Track->momentum().y(),
212 iterL1Track->momentum().z(),
213 iterL1Track->momentum().mag());
214 JetInputs.push_back(psuedoJet);
215 JetInputs.back().set_user_index(this_l1track - 1);
218 fastjet::ClusterSequence
cs(JetInputs, jet_def);
219 std::vector<fastjet::PseudoJet> JetOutputs =
220 fastjet::sorted_by_pt(cs.inclusive_jets(0));
222 for (
unsigned int ijet = 0; ijet < JetOutputs.size(); ++ijet) {
224 JetOutputs[ijet].px(), JetOutputs[ijet].py(), JetOutputs[ijet].pz(), JetOutputs[ijet].modp());
227 std::vector<edm::Ptr<L1TTTrackType>> L1TrackPtrs;
228 std::vector<fastjet::PseudoJet> fjConstituents = fastjet::sorted_by_pt(cs.constituents(JetOutputs[ijet]));
230 for (
unsigned int i = 0;
i < fjConstituents.size(); ++
i) {
231 auto index = fjConstituents[
i].user_index();
233 L1TrackPtrs.push_back(trkPtr);
234 sumpt = sumpt + trkPtr->momentum().perp();
235 avgZ = avgZ + trkPtr->momentum().perp() * trkPtr->z0();
239 TkJet trkJet(jetP4, jetRef, L1TrackPtrs, avgZ);
240 L1FastTrackingJets->push_back(trkJet);
244 iEvent.
put(
std::move(L1FastTrackingJets),
"L1FastTrackingJetsExtended");
246 iEvent.
put(
std::move(L1FastTrackingJets),
"L1FastTrackingJets");
260 desc.
add<
double>(
"trk_zMax", 15.0);
261 desc.
add<
double>(
"trk_chi2dofMax", 10.0);
262 desc.
add<
double>(
"trk_bendChi2Max", 2.2);
263 desc.
add<
double>(
"trk_ptMin", 2.0);
264 desc.
add<
double>(
"trk_etaMax", 2.5);
265 desc.
add<
int>(
"trk_nStubMin", 4);
266 desc.
add<
int>(
"trk_nPSStubMin", -1);
267 desc.
add<
double>(
"deltaZ0Cut", 0.5);
268 desc.
add<
bool>(
"doTightChi2",
true);
269 desc.
add<
double>(
"trk_ptTightChi2", 20.0);
270 desc.
add<
double>(
"trk_chi2dofTightChi2", 5.0);
271 desc.
add<
double>(
"coneSize", 0.4);
272 desc.
add<
bool>(
"displaced",
false);
273 desc.
add<
bool>(
"selectTrkMatchGenTight",
true);
274 desc.
add<
bool>(
"selectTrkMatchGenLoose",
false);
275 desc.
add<
bool>(
"selectTrkMatchGenOrPU",
false);
276 descriptions.
add(
"L1FastTrackingJets", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > genToken_
L1FastTrackingJetProducer(const edm::ParameterSet &)
unsigned int tidRing(const DetId &id) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
unique_ptr< ClusterSequence > cs
edm::EDGetTokenT< std::vector< l1t::Vertex > > pvToken_
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
~L1FastTrackingJetProducer() override
float trkChi2dofTightChi2_
Stores association of Truth Particles (TP) to L1 Track-Trigger Tracks.
bool getData(T &iHolder) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool selectTrkMatchGenLoose_
Abs< T >::type abs(const T &t)
static constexpr auto TOB
std::vector< L1TTTrackType > L1TTTrackCollectionType
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Class to store the L1 Track Trigger stubs.
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
bool selectTrkMatchGenTight_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Class to store the L1 Track Trigger tracks.
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool selectTrkMatchGenOrPU_
std::vector< TkJet > TkJetCollection
static constexpr auto TID
unsigned int tobLayer(const DetId &id) const