60 void endStream()
override;
102 : trkZMax_((
float)iConfig.getParameter<double>(
"trk_zMax")),
103 trkPtMax_((
float)iConfig.getParameter<double>(
"trk_ptMax")),
104 trkPtMin_((
float)iConfig.getParameter<double>(
"trk_ptMin")),
105 trkEtaMax_((
float)iConfig.getParameter<double>(
"trk_etaMax")),
106 trkChi2dofMax_((
float)iConfig.getParameter<double>(
"trk_chi2dofMax")),
107 trkBendChi2Max_((
float)iConfig.getParameter<double>(
"trk_bendChi2Max")),
108 trkNPSStubMin_((
int)iConfig.getParameter<
int>(
"trk_nPSStubMin")),
109 minTrkJetpT_(iConfig.getParameter<double>(
"minTrkJetpT")),
110 minJetEtLowPt_(iConfig.getParameter<double>(
"minJetEtLowPt")),
111 minJetEtHighPt_(iConfig.getParameter<double>(
"minJetEtHighPt")),
112 etaBins_((
int)iConfig.getParameter<
int>(
"etaBins")),
113 phiBins_((
int)iConfig.getParameter<
int>(
"phiBins")),
114 zBins_((
int)iConfig.getParameter<
int>(
"zBins")),
115 d0CutNStubs4_((
float)iConfig.getParameter<double>(
"d0_cutNStubs4")),
116 d0CutNStubs5_((
float)iConfig.getParameter<double>(
"d0_cutNStubs5")),
117 lowpTJetMinTrackMultiplicity_((
int)iConfig.getParameter<
int>(
"lowpTJetMinTrackMultiplicity")),
118 highpTJetMinTrackMultiplicity_((
int)iConfig.getParameter<
int>(
"highpTJetMinTrackMultiplicity")),
119 displaced_(iConfig.getParameter<
bool>(
"displaced")),
120 nStubs4DisplacedChi2_((
float)iConfig.getParameter<double>(
"nStubs4DisplacedChi2")),
121 nStubs5DisplacedChi2_((
float)iConfig.getParameter<double>(
"nStubs5DisplacedChi2")),
122 nStubs4DisplacedBend_((
float)iConfig.getParameter<double>(
"nStubs4Displacedbend")),
123 nStubs5DisplacedBend_((
float)iConfig.getParameter<double>(
"nStubs5Displacedbend")),
124 nDisplacedTracks_((
int)iConfig.getParameter<
int>(
"nDisplacedTracks")),
125 dzPVTrk_((
float)iConfig.getParameter<double>(
"MaxDzTrackPV")),
135 produces<TkJetCollection>(
"L1TrackJetsExtended");
137 produces<TkJetCollection>(
"L1TrackJets");
150 vector<TTTrack<Ref_Phase2TrackerDigi_> >::const_iterator iterL1Track;
154 float PVz = (PVtx->at(0)).
z0();
159 unsigned int this_l1track = 0;
160 for (iterL1Track = TTTrackHandle->begin(); iterL1Track != TTTrackHandle->end(); iterL1Track++) {
165 float trk_chi2dof = trkPtr->
chi2Red();
166 float trk_d0 = trkPtr->
d0();
168 float trk_z0 = trkPtr->
z0();
171 for (
int istub = 0; istub < trk_nstubs; istub++) {
205 vector<Ptr<L1TTTrackType> > L1TrackAssocJet;
225 L1TrackAssocJet.clear();
231 if (!L1TrackAssocJet.empty()) {
232 L1L1TrackJetProducer->push_back(trkJet);
246 const int nz =
zBins_ + 1;
249 for (
int z = 0;
z < nz; ++
z)
250 all_zBins[
z] = mzbtemp;
281 for (
int zbin = 0; zbin <
zBins_; ++zbin) {
285 epbins[
i][
j].
used =
false;
292 L1clusters[
i] = epbins[
i];
303 L2cluster[
k] = epbins[
i][
j];
304 if ((zmin <= trkZ && zmax >= trkZ) &&
321 for (
int phislice = 0; phislice <
phiBins_; ++phislice) {
322 L1clusters[phislice] =
L1_cluster(epbins[phislice]);
323 if (L1clusters[phislice] !=
nullptr) {
324 for (
int ind = 0; L1clusters[phislice][ind].
pTtot != 0; ++ind) {
325 L1clusters[phislice][ind].
used =
false;
342 int used1, used2, used3, used4;
344 for (phibin = 0; phibin <
phiBins_; ++phibin) {
347 for (index1 = 0; L1clusters[phibin][index1].
pTtot > 0; ++index1) {
348 if (!L1clusters[phibin][index1].used && L1clusters[phibin][index1].pTtot >= hipT) {
349 hipT = L1clusters[phibin][index1].
pTtot;
363 std::vector<unsigned int> trkidx1;
364 std::vector<unsigned int> trkidx2;
365 L2cluster[
nclust] = L1clusters[phibin][imax];
366 L1clusters[phibin][imax].
used =
true;
372 for (index1 = 0; L1clusters[phibin + 1][index1].
pTtot != 0; ++index1) {
373 if (L1clusters[phibin + 1][index1].used)
377 E1 += L1clusters[phibin + 1][index1].
pTtot;
378 trx1 += L1clusters[phibin + 1][index1].
numtracks;
379 tdtrk1 += L1clusters[phibin + 1][index1].
numtdtrks;
380 for (
unsigned int itrk = 0; itrk < L1clusters[phibin + 1][index1].
trackidx.size(); itrk++) {
381 trkidx1.push_back(L1clusters[phibin + 1][index1].trackidx[itrk]);
394 for (
unsigned int itrk = 0; itrk < trkidx1.size(); itrk++) {
399 L1clusters[phibin + 1][used1].
used =
true;
401 L1clusters[phibin + 1][used2].
used =
true;
409 for (index1 = 0; L1clusters[phibin + 2][index1].
pTtot != 0; ++index1) {
410 if (L1clusters[phibin + 2][index1].used)
413 E2 += L1clusters[phibin + 2][index1].
pTtot;
414 trx2 += L1clusters[phibin + 2][index1].
numtracks;
415 tdtrk2 += L1clusters[phibin + 2][index1].
numtdtrks;
416 for (
unsigned int itrk = 0; itrk < L1clusters[phibin + 2][index1].
trackidx.size(); itrk++)
417 trkidx2.push_back(L1clusters[phibin + 2][index1].
trackidx[itrk]);
432 L2cluster[
nclust].
phi = L1clusters[phibin + 1][used1].
phi;
433 for (
unsigned int itrk = 0; itrk < trkidx1.size(); itrk++) {
436 for (
unsigned int itrk = 0; itrk < trkidx2.size(); itrk++) {
441 L1clusters[phibin + 1][used1].
used =
true;
443 L1clusters[phibin + 1][used2].
used =
true;
445 L1clusters[phibin + 2][used3].
used =
true;
447 L1clusters[phibin + 2][used4].
used =
true;
456 L2cluster[
nclust].
phi = L1clusters[phibin + 1][used1].
phi;
457 for (
unsigned int itrk = 0; itrk < trkidx1.size(); itrk++) {
462 L1clusters[phibin + 1][used1].
used =
true;
464 L1clusters[phibin + 1][used2].
used =
true;
470 L1clusters[phibin][imax].
used =
true;
476 for (phibin = 0; phibin <
phiBins_; ++phibin)
477 delete[] L1clusters[phibin];
484 if (L2cluster[
n].pTtot > L2cluster[
m].pTtot) {
485 L2cluster[
m].
phi = L2cluster[
n].
phi;
490 for (
unsigned int itrk = 0; itrk < L2cluster[
n].
trackidx.size(); itrk++)
491 L2cluster[
m].trackidx.push_back(L2cluster[
n].
trackidx[itrk]);
493 for (
int m1 =
n; m1 <
nclust - 1; ++m1) {
494 L2cluster[m1] = L2cluster[m1 + 1];
517 all_zBins[zbin].
znum = zbin;
527 for (
unsigned int itrk = 0; itrk < L2cluster[
k].
trackidx.size(); itrk++)
531 all_zBins[zbin].
ht = ht;
533 mzb = all_zBins[zbin];
540 for (
int zbin = 0; zbin <
zBins_; ++zbin) {
541 if (zbin == mzb.
znum)
550 edm::LogWarning(
"L1TrackJetProducer") <<
"Clusters memory not assigned!\n";
553 float my_pt, left_pt, right_pt, right2pt;
556 for (
int etabin = 0; etabin <
etaBins_; ++etabin) {
558 if (phislice[etabin].used)
560 my_pt = phislice[etabin].
pTtot;
561 if (etabin > 0 && !phislice[etabin - 1].used) {
562 left_pt = phislice[etabin - 1].
pTtot;
565 if (etabin <
etaBins_ - 1 && !phislice[etabin + 1].used) {
566 right_pt = phislice[etabin + 1].
pTtot;
567 if (etabin <
etaBins_ - 2 && !phislice[etabin + 2].used) {
568 right2pt = phislice[etabin + 2].
pTtot;
575 if (my_pt < left_pt || my_pt <= right_pt) {
579 phislice[etabin - 1].
used =
true;
589 phislice[etabin].
used =
true;
595 for (
unsigned int itrk = 0; itrk < phislice[etabin - 1].
trackidx.size(); itrk++)
599 if (my_pt >= right2pt && right_pt > 0) {
604 for (
unsigned int itrk = 0; itrk < phislice[etabin + 1].
trackidx.size(); itrk++)
606 phislice[etabin + 1].
used =
true;
621 for (
unsigned int itrk = 0; itrk <
clusters[
m + 1].trackidx.size(); itrk++)
624 for (
int m1 =
m + 1; m1 <
nclust - 1; ++m1)
641 bool PassQuality =
false;
bool trackQualityCuts(int trk_nstub, float trk_chi2, float trk_bendchi2)
const int highpTJetMinTrackMultiplicity_
unsigned int tobLayer(const DetId &id) const
#define DEFINE_FWK_MODULE(type)
float nStubs5DisplacedChi2_
Sin< T >::type sin(const T &t)
float nStubs5DisplacedBend_
L1TrackJetProducer(const ParameterSet &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::vector< unsigned int > trackidx
GlobalVector momentum() const
Track momentum.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
vector< L1TTTrackType > L1TTTrackCollectionType
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
const double minJetEtLowPt_
vector< Ptr< L1TTTrackType > > L1TrkPtrs_
Cos< T >::type cos(const T &t)
virtual EtaPhiBin * L1_cluster(EtaPhiBin *phislice)
Abs< T >::type abs(const T &t)
bool getData(T &iHolder) const
void endStream() override
static constexpr auto TOB
float nStubs4DisplacedBend_
const float trkChi2dofMax_
float nStubs4DisplacedChi2_
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > getStubRefs() const
Track components.
void beginStream(StreamID) override
const edm::EDGetTokenT< std::vector< l1t::Vertex > > PVtxToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(Event &, const EventSetup &) override
Class to store the L1 Track Trigger tracks.
double stubPtConsistency() const
StubPtConsistency.
double d0() const
Track d0.
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
const double minJetEtHighPt_
const int lowpTJetMinTrackMultiplicity_
const EDGetTokenT< vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
double chi2Red() const
Chi2 reduced.
void L2_cluster(vector< Ptr< L1TTTrackType > > L1TrkPtrs_, vector< int > tdtrk_, MaxZBin &mzb)
double z0() const
Track z0.
unsigned int tidRing(const DetId &id) const
Log< level::Warning, false > LogWarning
std::vector< TkJet > TkJetCollection
const float trkBendChi2Max_
static constexpr auto TID
~L1TrackJetProducer() override
const double minTrkJetpT_