Skip to content

Commit

Permalink
andrea's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ccaillol committed Sep 19, 2022
1 parent 2854e1c commit 7964d2c
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef L1Trigger_L1TTrackMatch_L1Clustering_HH
#define L1Trigger_L1TTrackMatch_L1Clustering_HH
#include <cmath>
#include <cstdlib>
#include <vector>
Expand Down Expand Up @@ -248,3 +249,4 @@ inline std::vector<EtaPhiBin> L2_clustering(std::vector<std::vector<EtaPhiBin>>
} // end of m-loop
return clusters;
}
#endif
63 changes: 41 additions & 22 deletions L1Trigger/L1TTrackMatch/plugins/L1TrackJetProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand All @@ -31,7 +30,7 @@

#include "DataFormats/L1Trigger/interface/Vertex.h"

#include "L1Trigger/L1TTrackMatch/interface/L1TrackJetProducer.h"
#include "L1Trigger/L1TTrackMatch/interface/L1Clustering.h"

#include "TH1D.h"
#include "TH2D.h"
Expand Down Expand Up @@ -207,9 +206,8 @@ void L1TrackJetProducer::produce(Event &iEvent, const EventSetup &iSetup) {
EtaPhiBin epbins_default[phiBins_][etaBins_]; // create grid of phiBins

float phi = -1.0 * M_PI;
float eta = -1.0 * trkEtaMax_;
for (int i = 0; i < phiBins_; ++i) {
eta = -1.0 * trkEtaMax_;
float eta = -1.0 * trkEtaMax_;
for (int j = 0; j < etaBins_; ++j) {
epbins_default[i][j].phi = (phi + (phi + phiStep_)) / 2.0; // phimin=phi; phimax= phimin+step
epbins_default[i][j].eta = (eta + (eta + etaStep_)) / 2.0; // phimin=phi; phimax phimin+step
Expand Down Expand Up @@ -242,19 +240,16 @@ void L1TrackJetProducer::produce(Event &iEvent, const EventSetup &iSetup) {

// fill grid
for (unsigned int k = 0; k < L1TrkPtrs_.size(); ++k) {
float trkpt = L1TrkPtrs_[k]->momentum().perp();
float trketa = L1TrkPtrs_[k]->momentum().eta();
float trkphi = L1TrkPtrs_[k]->momentum().phi();
float trkZ = L1TrkPtrs_[k]->z0();
if (zmax < trkZ)
continue;
if (zbin == 0) {
if (zmin > trkZ)
continue;
} else {
if (zmin >= trkZ)
continue;
}
if (zmin > trkZ)
continue;
if (zbin == 0 && zmin == trkZ)
continue;
float trkpt = L1TrkPtrs_[k]->momentum().perp();
float trketa = L1TrkPtrs_[k]->momentum().eta();
float trkphi = L1TrkPtrs_[k]->momentum().phi();
for (int i = 0; i < phiBins_; ++i) {
for (int j = 0; j < etaBins_; ++j) {
float eta_min = epbins[i][j].eta - etaStep_ / 2.0; //eta min
Expand Down Expand Up @@ -315,9 +310,7 @@ void L1TrackJetProducer::produce(Event &iEvent, const EventSetup &iSetup) {
float jetPz = jetPt * sinh(jetEta);
float jetP = jetPt * cosh(jetEta);
int totalDisptrk = mzb.clusters[j].numtdtrks;
bool isDispJet = false;
if (totalDisptrk > nDisplacedTracks_ || totalDisptrk == nDisplacedTracks_)
isDispJet = true;
bool isDispJet = (totalDisptrk > nDisplacedTracks_ || totalDisptrk == nDisplacedTracks_);

math::XYZTLorentzVector jetP4(jetPx, jetPy, jetPz, jetP);
L1TrackAssocJet.clear();
Expand Down Expand Up @@ -362,11 +355,37 @@ bool L1TrackJetProducer::trackQualityCuts(int trk_nstub, float trk_chi2, float t
}

void L1TrackJetProducer::fillDescriptions(ConfigurationDescriptions &descriptions) {
//The following says we do not know what parameters are allowed so do no validation
// Please change this to state exactly what you do use, even if it is no parameters
ParameterSetDescription desc;
desc.setUnknown();
descriptions.addDefault(desc);
// l1tTrackJets
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("L1TrackInputTag", edm::InputTag("l1tTTTracksFromTrackletEmulation", "Level1TTTracks"));
desc.add<edm::InputTag>("L1PVertexCollection", edm::InputTag("l1tVertexProducer", "l1vertices"));
desc.add<double>("MaxDzTrackPV", 1.0);
desc.add<double>("trk_zMax", 15.0);
desc.add<double>("trk_ptMax", 200.0);
desc.add<double>("trk_ptMin", 3.0);
desc.add<double>("trk_etaMax", 2.4);
desc.add<double>("nStubs4PromptChi2", 5.0);
desc.add<double>("nStubs4PromptBend", 1.7);
desc.add<double>("nStubs5PromptChi2", 2.75);
desc.add<double>("nStubs5PromptBend", 3.5);
desc.add<int>("trk_nPSStubMin", -1);
desc.add<double>("minTrkJetpT", -1.0);
desc.add<int>("etaBins", 24);
desc.add<int>("phiBins", 27);
desc.add<int>("zBins", 1);
desc.add<double>("d0_cutNStubs4", -1);
desc.add<double>("d0_cutNStubs5", -1);
desc.add<int>("lowpTJetMinTrackMultiplicity", 2);
desc.add<double>("lowpTJetThreshold", 50.0);
desc.add<int>("highpTJetMinTrackMultiplicity", 3);
desc.add<double>("highpTJetThreshold", 100.0);
desc.add<bool>("displaced", false);
desc.add<double>("nStubs4DisplacedChi2", 5.0);
desc.add<double>("nStubs4DisplacedBend", 1.7);
desc.add<double>("nStubs5DisplacedChi2", 2.75);
desc.add<double>("nStubs5DisplacedBend", 3.5);
desc.add<int>("nDisplacedTracks", 2);
descriptions.add("l1tTrackJets", desc);
}

//define this as a plug-in
Expand Down
40 changes: 11 additions & 29 deletions L1Trigger/L1TTrackMatch/python/l1tTrackJets_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,17 @@
nDisplacedTracks=cms.int32(2)
)

l1tTrackJetsExtended = cms.EDProducer('L1TrackJetProducer',
L1TrackInputTag= cms.InputTag("l1tTTTracksFromExtendedTrackletEmulation", "Level1TTTracks"),
L1PVertexCollection = cms.InputTag("l1tVertexProducer", "l1vertices"),
MaxDzTrackPV = cms.double( 5.0 ), # tracks with dz(trk,PV)>cut excluded
trk_zMax = cms.double (15.) , # max track z
trk_ptMax = cms.double(200.), # maxi track pT before saturation
trk_ptMin = cms.double(3.0), # min track pt
trk_etaMax = cms.double(2.4), # max track eta
nStubs4PromptChi2=cms.double(5.0), #Prompt track quality flags for loose/tight
nStubs4PromptBend=cms.double(1.7),
nStubs5PromptChi2=cms.double(2.75),
nStubs5PromptBend=cms.double(3.5),
trk_nPSStubMin=cms.int32(-1), # min # PS stubs, -1 means no cut
minTrkJetpT=cms.double(5.), # min track jet pt to be considered for most energetic zbin finding
etaBins=cms.int32(24), #number of eta bins
phiBins=cms.int32(27), #number of phi bins
zBins=cms.int32(1), #number of z bins
d0_cutNStubs4=cms.double(-1), # -1 excludes nstub=4 from disp tag process
d0_cutNStubs5=cms.double(0.22), # -1 excludes nstub>4 from disp tag process
lowpTJetMinTrackMultiplicity=cms.int32(2), #relevant only when N of z-bins >1; excludes from the HT calculation jets with low number of very energetic tracks; this cut selects the threshold on number of tracks
lowpTJetThreshold=cms.double(50.), # this threshold controls the pT of the jet
highpTJetMinTrackMultiplicity=cms.int32(3), #same as above for a different WP of tracks / pT
highpTJetThreshold=cms.double(100.),
displaced=cms.bool(True), #Flag for displaced tracks
nStubs4DisplacedChi2=cms.double(3.3), #Disp tracks selection [trk<cut]
nStubs4DisplacedBend=cms.double(2.3),
nStubs5DisplacedChi2=cms.double(11.3),
nStubs5DisplacedBend=cms.double(9.8),
nDisplacedTracks=cms.int32(3) #min Ntracks to tag a jet as displaced
l1tTrackJetsExtended = l1tTrackJets.clone(
L1TrackInputTag= ("l1tTTTracksFromExtendedTrackletEmulation", "Level1TTTracks"),
MaxDzTrackPV = 5.0 , # tracks with dz(trk,PV)>cut excluded
minTrkJetpT= 5., # min track jet pt to be considered for most energetic zbin finding
d0_cutNStubs5= 0.22, # -1 excludes nstub>4 from disp tag process
displaced=True, #Flag for displaced tracks
nStubs4DisplacedChi2= 3.3, #Disp tracks selection [trk<cut]
nStubs4DisplacedBend= 2.3,
nStubs5DisplacedChi2= 11.3,
nStubs5DisplacedBend= 9.8,
nDisplacedTracks= 3 #min Ntracks to tag a jet as displaced
)


Expand Down

0 comments on commit 7964d2c

Please sign in to comment.