51 bool trackQualityCuts(
float trk_pt,
int trk_nstub,
float trk_chi2,
float trk_bendchi2,
float trk_d0);
59 void endStream()
override;
138 produces<TkJetCollection>(
"L1TrackJetsExtended");
140 produces<TkJetCollection>(
"L1TrackJets");
153 vector<TTTrack<Ref_Phase2TrackerDigi_> >::const_iterator iterL1Track;
161 unsigned int this_l1track = 0;
162 for (iterL1Track = TTTrackHandle->begin(); iterL1Track != TTTrackHandle->end(); iterL1Track++) {
165 float trk_pt = trkPtr->momentum().perp();
166 int trk_nstubs = (int)trkPtr->getStubRefs().size();
167 float trk_chi2dof = trkPtr->chi2Red();
168 float trk_d0 = trkPtr->d0();
169 float trk_bendchi2 = trkPtr->stubPtConsistency();
172 for (
int istub = 0; istub < trk_nstubs; istub++) {
173 DetId detId(trkPtr->getStubRefs().at(istub)->getDetId());
183 if (!
trackQualityCuts(trk_pt, trk_nstubs, trk_chi2dof, trk_bendchi2, fabs(trk_d0)))
185 if (fabs(iterL1Track->z0()) >
trkZMax_)
187 if (fabs(iterL1Track->momentum().eta()) >
trkEtaMax_)
217 vector<Ptr<L1TTTrackType> > L1TrackAssocJet;
230 float jetPx = jetPt *
cos(jetPhi);
231 float jetPy = jetPt *
sin(jetPhi);
232 float jetPz = jetPt * sinh(jetEta);
233 float jetP = jetPt * cosh(jetEta);
239 L1TrackAssocJet.clear();
258 if (!L1TrackAssocJet.empty())
259 L1L1TrackJetProducer->push_back(trkJet);
264 iEvent.
put(
std::move(L1L1TrackJetProducer),
"L1TrackJetsExtended");
266 iEvent.
put(
std::move(L1L1TrackJetProducer),
"L1TrackJets");
275 for (
int z = 0;
z < nz; ++
z)
276 all_zBins[
z] =
MaxZBin{0, 0, 0,
nullptr, 0};
279 float zmax = zmin + 2 *
zStep_;
294 epbins[
i][
j].
eta = (etamin + etamax) / 2.0;
304 for (
int zbin = 0; zbin <
zBins_ - 1; ++zbin) {
308 epbins[
i][
j].
used =
false;
314 L1clusters[
i] = epbins[
i];
325 L2cluster[
k] = epbins[
i][
j];
326 if ((zmin <= trkZ && zmax >= trkZ) &&
327 ((epbins[
i][
j].eta -
etaStep_ / 2.0 <= trketa && epbins[
i][
j].eta +
etaStep_ / 2.0 >= trketa) &&
344 for (
int phislice = 0; phislice <
phiBins_; ++phislice) {
345 L1clusters[phislice] =
L1_cluster(epbins[phislice]);
346 if (L1clusters[phislice] !=
nullptr) {
347 for (
int ind = 0; L1clusters[phislice][ind].
pTtot != 0; ++ind) {
348 L1clusters[phislice][ind].
used =
false;
366 int ttdtrk1, ttdtrk2;
367 int used1, used2, used3, used4;
369 for (phibin = 0; phibin <
phiBins_; ++phibin) {
372 for (index1 = 0; L1clusters[phibin][index1].
pTtot > 0; ++index1) {
373 if (!L1clusters[phibin][index1].used && L1clusters[phibin][index1].pTtot >= hipT) {
374 hipT = L1clusters[phibin][index1].
pTtot;
392 L2cluster[
nclust] = L1clusters[phibin][imax];
393 L1clusters[phibin][imax].
used =
true;
396 if (phibin != phiBins_ - 1) {
399 for (index1 = 0; L1clusters[phibin + 1][index1].
pTtot != 0; ++index1) {
400 if (L1clusters[phibin + 1][index1].used)
402 if (fabs(L1clusters[phibin + 1][index1].eta - L1clusters[phibin][imax].eta) <= 1.5 *
etaStep_) {
403 E1 += L1clusters[phibin + 1][index1].
pTtot;
404 trx1 += L1clusters[phibin + 1][index1].
numtracks;
405 ttrk1 += L1clusters[phibin + 1][index1].
numttrks;
406 tdtrk1 += L1clusters[phibin + 1][index1].
numtdtrks;
407 ttdtrk1 += L1clusters[phibin + 1][index1].
numttdtrks;
422 L1clusters[phibin + 1][used1].
used =
true;
424 L1clusters[phibin + 1][used2].
used =
true;
429 if (phibin != phiBins_ - 2) {
432 for (index1 = 0; L1clusters[phibin + 2][index1].
pTtot != 0; ++index1) {
433 if (L1clusters[phibin + 2][index1].used)
435 if (fabs(L1clusters[phibin + 2][index1].eta - L1clusters[phibin][imax].eta) <= 1.5 *
etaStep_) {
436 E2 += L1clusters[phibin + 2][index1].
pTtot;
437 trx2 += L1clusters[phibin + 2][index1].
numtracks;
438 ttrk2 += L1clusters[phibin + 2][index1].
numttrks;
439 tdtrk2 += L1clusters[phibin + 2][index1].
numtdtrks;
440 ttdtrk2 += L1clusters[phibin + 2][index1].
numttdtrks;
455 L2cluster[
nclust].
phi = L1clusters[phibin + 1][used1].
phi;
457 L1clusters[phibin + 1][used1].
used =
true;
459 L1clusters[phibin + 1][used2].
used =
true;
461 L1clusters[phibin + 2][used3].
used =
true;
463 L1clusters[phibin + 2][used4].
used =
true;
474 L2cluster[
nclust].
phi = L1clusters[phibin + 1][used1].
phi;
476 L1clusters[phibin + 1][used1].
used =
true;
478 L1clusters[phibin + 1][used2].
used =
true;
484 L1clusters[phibin][imax].
used =
true;
490 for (phibin = 0; phibin <
phiBins_; ++phibin)
491 delete[] L1clusters[phibin];
494 for (
int m = 0;
m < nclust - 1; ++
m) {
496 if (L2cluster[
n].eta == L2cluster[
m].eta && (fabs(L2cluster[
n].phi - L2cluster[
m].phi) < 1.5 *
phiStep_ ||
497 fabs(L2cluster[
n].phi - L2cluster[
m].phi) > 6.0)) {
498 if (L2cluster[
n].pTtot > L2cluster[
m].pTtot)
499 L2cluster[
m].
phi = L2cluster[
n].
phi;
505 for (
int m1 =
n; m1 < nclust - 1; ++m1)
506 L2cluster[m1] = L2cluster[m1 + 1];
525 all_zBins[zbin].
znum = zbin;
528 all_zBins[zbin].
zbincenter = (zmin + zmax) / 2.0;
538 all_zBins[zbin].
ht = ht;
540 mzb = all_zBins[zbin];
547 for (
int zbin = 0; zbin < zBins_ - 1; ++zbin) {
548 if (zbin == mzb.
znum)
556 if (clusters ==
nullptr)
557 edm::LogWarning(
"L1TrackJetProducer") <<
"Clusters memory not assigned!\n";
560 float my_pt, left_pt, right_pt, right2pt;
563 for (
int etabin = 0; etabin <
etaBins_; ++etabin) {
565 if (phislice[etabin].used)
567 my_pt = phislice[etabin].
pTtot;
568 if (etabin > 0 && !phislice[etabin - 1].used) {
569 left_pt = phislice[etabin - 1].
pTtot;
572 if (etabin < etaBins_ - 1 && !phislice[etabin + 1].used) {
573 right_pt = phislice[etabin + 1].
pTtot;
574 if (etabin < etaBins_ - 2 && !phislice[etabin + 2].used) {
575 right2pt = phislice[etabin + 2].
pTtot;
582 if (my_pt < left_pt || my_pt <= right_pt) {
585 clusters[
nclust] = phislice[etabin - 1];
586 phislice[etabin - 1].
used =
true;
595 clusters[
nclust] = phislice[etabin];
596 phislice[etabin].
used =
true;
598 if (clusters !=
nullptr) {
606 if (my_pt >= right2pt && right_pt > 0) {
607 if (clusters !=
nullptr) {
613 phislice[etabin + 1].
used =
true;
620 for (
int m = 0;
m < nclust - 1; ++
m) {
622 if (clusters[
m + 1].pTtot > clusters[
m].pTtot) {
623 clusters[
m].
eta = clusters[
m + 1].
eta;
630 for (
int m1 =
m + 1; m1 < nclust - 1; ++m1)
631 clusters[m1] = clusters[m1 + 1];
637 for (
int i = nclust;
i < etaBins_ / 2; ++
i)
638 clusters[
i].pTtot = 0;
647 float trk_pt,
int trk_nstub,
float trk_chi2,
float trk_bendchi2,
float trk_d0) {
648 bool PassQuality =
false;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int tidRing(const DetId &id) const
int highpTJetMinTrackMultiplicity_
float nStubs4DisplacedChi2Loose_
bool trackQualityCuts(float trk_pt, int trk_nstub, float trk_chi2, float trk_bendchi2, float trk_d0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
float nStubs5DisplacedBendTight_
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
int lowpTJetMinTrackMultiplicity_
L1TrackJetProducer(const ParameterSet &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
void L2_cluster(vector< Ptr< L1TTTrackType > > L1TrkPtrs_, vector< int > ttrk_, vector< int > tdtrk_, vector< int > ttdtrk_, MaxZBin &mzb)
bool getData(T &iHolder) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
vector< L1TTTrackType > L1TTTrackCollectionType
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
float nStubs5DisplacedBendLoose_
float nStubs5DisplacedChi2Loose_
vector< Ptr< L1TTTrackType > > L1TrkPtrs_
Cos< T >::type cos(const T &t)
virtual EtaPhiBin * L1_cluster(EtaPhiBin *phislice)
float nStubs5DisplacedChi2Tight_
void endStream() override
static constexpr auto TOB
void beginStream(StreamID) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(Event &, const EventSetup &) override
Class to store the L1 Track Trigger tracks.
T getParameter(std::string const &) const
float nStubs4DisplacedChi2Tight_
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
const EDGetTokenT< vector< TTTrack< Ref_Phase2TrackerDigi_ > > > trackToken_
float nStubs4DisplacedBendLoose_
Log< level::Warning, false > LogWarning
std::vector< TkJet > TkJetCollection
static constexpr auto TID
~L1TrackJetProducer() override
unsigned int tobLayer(const DetId &id) const
float nStubs4DisplacedBendTight_