CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
Phase2L1GMT::TopoAlgo Class Reference

#include <TopologicalAlgorithm.h>

Inheritance diagram for Phase2L1GMT::TopoAlgo:
Phase2L1GMT::Isolation Phase2L1GMT::Tauto3Mu

Public Member Functions

int deltaEta (const int eta1, const int eta2)
 
int deltaPhi (int phi1, int phi2)
 
int deltaZ0 (const int Z01, const int Z02)
 
void DumpInputs ()
 
void load (std::vector< l1t::TrackerMuon > &trkMus, std::vector< ConvertedTTTrack > &convertedTracks)
 
 TopoAlgo ()
 
 TopoAlgo (const TopoAlgo &cpy)
 
 ~TopoAlgo ()
 

Protected Attributes

std::vector< ConvertedTTTrack > * convertedTracks
 
std::ofstream dumpInput
 
std::vector< l1t::TrackerMuon > * trkMus
 

Detailed Description

Definition at line 28 of file TopologicalAlgorithm.h.

Constructor & Destructor Documentation

◆ TopoAlgo() [1/2]

Phase2L1GMT::TopoAlgo::TopoAlgo ( )
inline

Definition at line 46 of file TopologicalAlgorithm.h.

46 {}

◆ ~TopoAlgo()

Phase2L1GMT::TopoAlgo::~TopoAlgo ( )
inline

Definition at line 48 of file TopologicalAlgorithm.h.

48 {}

◆ TopoAlgo() [2/2]

Phase2L1GMT::TopoAlgo::TopoAlgo ( const TopoAlgo cpy)
inline

Definition at line 50 of file TopologicalAlgorithm.h.

50 {}

Member Function Documentation

◆ deltaEta()

int Phase2L1GMT::TopoAlgo::deltaEta ( const int  eta1,
const int  eta2 
)
inline

Definition at line 92 of file TopologicalAlgorithm.h.

References funct::abs(), Phase2L1GMT::BITSETA, HLT_2023v12_cff::eta1, and HLT_2023v12_cff::eta2.

Referenced by Phase2L1GMT::Isolation::compute_trk_iso(), and Phase2L1GMT::Tauto3Mu::GetDiMass().

92  {
93  static const int maxbits = (1 << BITSETA) - 1;
94  int deta = abs(eta1 - eta2);
95  deta &= maxbits;
96  return deta;
97  }
const int BITSETA
Definition: Constants.h:26
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ deltaPhi()

int Phase2L1GMT::TopoAlgo::deltaPhi ( int  phi1,
int  phi2 
)
inline

Definition at line 107 of file TopologicalAlgorithm.h.

References funct::abs(), and Phase2L1GMT::BITSPHI.

Referenced by Phase2L1GMT::Isolation::compute_trk_iso(), Phase2L1GMT::Tauto3Mu::Get3MuDphi(), and Phase2L1GMT::Tauto3Mu::GetDiMass().

107  {
108  static const int maxbits = (1 << BITSPHI) - 1;
109  static const int pibits = (1 << (BITSPHI - 1));
110  int dphi = abs(phi1 - phi2);
111  if (dphi >= pibits)
112  dphi = maxbits - dphi;
113  return dphi;
114  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int BITSPHI
Definition: Constants.h:25

◆ deltaZ0()

int Phase2L1GMT::TopoAlgo::deltaZ0 ( const int  Z01,
const int  Z02 
)
inline

Definition at line 99 of file TopologicalAlgorithm.h.

References funct::abs(), and Phase2L1GMT::BITSZ0.

Referenced by Phase2L1GMT::Isolation::compute_trk_iso().

99  {
100  static const int maxbits = (1 << BITSZ0) - 1;
101  int dZ0 = abs(Z01 - Z02);
102  dZ0 &= maxbits;
103  return dZ0;
104  }
const int BITSZ0
Definition: Constants.h:27
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ DumpInputs()

void Phase2L1GMT::TopoAlgo::DumpInputs ( )
inline

Definition at line 61 of file TopologicalAlgorithm.h.

References convertedTracks, dumpInput, mps_fire::i, Phase2L1GMT::LSBeta, Phase2L1GMT::LSBGTz0, Phase2L1GMT::LSBphi, Phase2L1GMT::LSBpt, findQualityFiles::size, and trkMus.

Referenced by Phase2L1GMT::Isolation::isolation_allmu_alltrk().

61  {
62  static std::atomic<int> nevti = 0;
63  auto evti = nevti++;
64  int totalsize = 0;
65  // Current setting
66  int constexpr exptotal = 12 + 18 * 100; // N_Muon + N_TRK_LINKS * NTRKperlinks
67  for (unsigned int i = 0; i < 12; ++i) {
68  if (i < trkMus->size())
69  dumpInput << " " << evti << " 0 " << i << " " << trkMus->at(i).hwPt() * LSBpt << " "
70  << trkMus->at(i).hwEta() * LSBeta << " " << trkMus->at(i).hwPhi() * LSBphi << " "
71  << trkMus->at(i).hwZ0() * LSBGTz0 << " " << trkMus->at(i).charge() << std::endl;
72  else
73  dumpInput << " " << evti << " 0 " << i << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << std::endl;
74  totalsize++;
75  }
76  for (unsigned int i = 0; i < convertedTracks->size(); ++i) {
77  dumpInput << " " << evti << " 1 " << i << " " << convertedTracks->at(i).pt() * LSBpt << " "
78  << convertedTracks->at(i).eta() * LSBeta << " " << convertedTracks->at(i).phi() * LSBphi << " "
79  << convertedTracks->at(i).z0() * LSBGTz0 << " " << convertedTracks->at(i).charge() << " "
80  << convertedTracks->at(i).quality() << std::endl;
81  totalsize++;
82  }
83  int ntrks = convertedTracks->size();
84  // Pat the remaining
85  while (totalsize < exptotal) {
86  dumpInput << " " << evti << " 1 " << ntrks++ << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0 << " "
87  << 0 << std::endl;
88  totalsize++;
89  }
90  }
size
Write out results.
const float LSBphi
Definition: Constants.h:82
const float LSBGTz0
Definition: Constants.h:84
const float LSBpt
Definition: Constants.h:81
std::vector< ConvertedTTTrack > * convertedTracks
const float LSBeta
Definition: Constants.h:83
std::vector< l1t::TrackerMuon > * trkMus

◆ load()

void Phase2L1GMT::TopoAlgo::load ( std::vector< l1t::TrackerMuon > &  trkMus,
std::vector< ConvertedTTTrack > &  convertedTracks 
)
inline

Definition at line 56 of file TopologicalAlgorithm.h.

References convertedTracks, and trkMus.

Referenced by Phase2L1GMT::Isolation::isolation_allmu_alltrk().

56  {
57  trkMus = &trkMus_;
58  convertedTracks = &convertedTracks_;
59  } // ----- end of function TopoAlgo::load -----
std::vector< ConvertedTTTrack > * convertedTracks
std::vector< l1t::TrackerMuon > * trkMus

Member Data Documentation

◆ convertedTracks

std::vector<ConvertedTTTrack>* Phase2L1GMT::TopoAlgo::convertedTracks
protected

◆ dumpInput

std::ofstream Phase2L1GMT::TopoAlgo::dumpInput
protected

◆ trkMus

std::vector<l1t::TrackerMuon>* Phase2L1GMT::TopoAlgo::trkMus
protected