40 #include <fastjet/JetDefinition.hh> 69 virtual void endJob();
98 : trkZMax_((
float)iConfig.getParameter<double>(
"trk_zMax")),
99 trkChi2dofMax_((
float)iConfig.getParameter<double>(
"trk_chi2dofMax")),
100 trkBendChi2Max_(iConfig.getParameter<double>(
"trk_bendChi2Max")),
101 trkPtMin_((
float)iConfig.getParameter<double>(
"trk_ptMin")),
102 trkEtaMax_((
float)iConfig.getParameter<double>(
"trk_etaMax")),
103 trkNStubMin_((
int)iConfig.getParameter<
int>(
"trk_nStubMin")),
104 trkNPSStubMin_((
int)iConfig.getParameter<
int>(
"trk_nPSStubMin")),
105 deltaZ0Cut_((
float)iConfig.getParameter<double>(
"deltaZ0Cut")),
106 coneSize_((
float)iConfig.getParameter<double>(
"coneSize")),
107 doTightChi2_(iConfig.getParameter<
bool>(
"doTightChi2")),
108 trkPtTightChi2_((
float)iConfig.getParameter<double>(
"trk_ptTightChi2")),
109 trkChi2dofTightChi2_((
float)iConfig.getParameter<double>(
"trk_chi2dofTightChi2")),
110 displaced_(iConfig.getParameter<
bool>(
"displaced")),
111 selectTrkMatchGenTight_(iConfig.getParameter<
bool>(
"selectTrkMatchGenTight")),
112 selectTrkMatchGenLoose_(iConfig.getParameter<
bool>(
"selectTrkMatchGenLoose")),
113 selectTrkMatchGenOrPU_(iConfig.getParameter<
bool>(
"selectTrkMatchGenOrPU")),
115 iConfig.getParameter<
edm::
InputTag>(
"L1TrackInputTag"))),
122 produces<TkJetCollection>(
"L1FastTrackingJetsExtended");
124 produces<TkJetCollection>(
"L1FastTrackingJets");
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);
241 TkJet trkJet(jetP4, jetRef, L1TrackPtrs, avgZ);
242 L1FastTrackingJets->push_back(trkJet);
246 iEvent.put(
std::move(L1FastTrackingJets),
"L1FastTrackingJetsExtended");
262 desc.add<
double>(
"trk_zMax", 15.0);
263 desc.add<
double>(
"trk_chi2dofMax", 10.0);
264 desc.add<
double>(
"trk_bendChi2Max", 2.2);
265 desc.add<
double>(
"trk_ptMin", 2.0);
266 desc.add<
double>(
"trk_etaMax", 2.5);
267 desc.add<
int>(
"trk_nStubMin", 4);
268 desc.add<
int>(
"trk_nPSStubMin", -1);
269 desc.add<
double>(
"deltaZ0Cut", 0.5);
270 desc.add<
bool>(
"doTightChi2",
true);
271 desc.add<
double>(
"trk_ptTightChi2", 20.0);
272 desc.add<
double>(
"trk_chi2dofTightChi2", 5.0);
273 desc.add<
double>(
"coneSize", 0.4);
274 desc.add<
bool>(
"displaced",
false);
275 desc.add<
bool>(
"selectTrkMatchGenTight",
true);
276 desc.add<
bool>(
"selectTrkMatchGenLoose",
false);
277 desc.add<
bool>(
"selectTrkMatchGenOrPU",
false);
278 descriptions.
add(
"L1FastTrackingJets",
desc);
unsigned int tobLayer(const DetId &id) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > genToken_
L1FastTrackingJetProducer(const edm::ParameterSet &)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const double trkBendChi2Max_
const float trkChi2dofTightChi2_
edm::EDGetTokenT< std::vector< l1t::Vertex > > pvToken_
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
~L1FastTrackingJetProducer() override
GlobalVector momentum() const
Track momentum.
const float trkChi2dofMax_
Stores association of Truth Particles (TP) to L1 Track-Trigger Tracks.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool selectTrkMatchGenLoose_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
const float trkPtTightChi2_
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
static constexpr auto TOB
std::vector< L1TTTrackType > L1TTTrackCollectionType
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.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double z0() const
Track z0.
bool selectTrkMatchGenOrPU_
unsigned int tidRing(const DetId &id) const
std::vector< TkJet > TkJetCollection
static constexpr auto TID