57 virtual void endJob();
61 std::vector<l1tmetemu::global_phi_t>
cosLUT_;
69 bool cordicDebug_ =
false;
71 bool GTTinput_ =
false;
123 std::unique_ptr<std::vector<l1t::EtSum>>
METCollection(
new std::vector<l1t::EtSum>(0));
137 if (!L1VertexHandle.
isValid()) {
138 LogError(
"L1TrackerEtMissEmulatorProducer") <<
"\nWarning: VertexCollection not found in the event. Exit\n";
142 if (!L1TTTrackHandle.
isValid()) {
143 LogError(
"L1TrackerEtMissEmulatorProducer") <<
"\nWarning: L1TTTrackCollection not found in the event. Exit\n";
147 if (!L1TTTrackAssociatedHandle.
isValid()) {
148 LogError(
"L1TrackerEtMissEmulatorProducer")
149 <<
"\nWarning: L1TTTrackAssociatedCollection not found in the event. Exit\n";
155 l1tmetemu::Et_t sumPx[
l1tmetemu::kNSector * 2] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
156 l1tmetemu::Et_t sumPy[
l1tmetemu::kNSector * 2] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
160 int num_quality_tracks{0};
161 int num_assoc_tracks{0};
166 for (
const auto&
track : *L1TTTrackHandle) {
167 num_quality_tracks++;
173 if (
std::find(L1TTTrackAssociatedHandle->begin(), L1TTTrackAssociatedHandle->end(),
track) !=
174 L1TTTrackAssociatedHandle->end()) {
178 <<
"Track to Vertex ID: " << num_quality_tracks <<
"\n" 179 <<
"Phi Sector: " << EtTrack.
Sector <<
" pT: " << EtTrack.
pt <<
" Phi: " << EtTrack.
globalPhi 180 <<
" TanL: " << EtTrack.
eta <<
" Z0: " << EtTrack.
z0 <<
" Nstub: " << EtTrack.
nstubs 182 <<
" bendChi2: " << EtTrack.
bendChi2 <<
" PV: " << EtTrack.
pV <<
"\n" 183 <<
"--------------------------------------------------------------\n";
188 <<
"========================Phi debug=================================\n" 189 <<
"Int pT: " << EtTrack.
pt <<
"\n" 190 <<
"Int Phi: " << EtTrack.
globalPhi <<
" Float Phi: " << EtTrack.
phi 191 <<
" Actual Float Cos(Phi): " <<
cos(EtTrack.
phi) <<
" Actual Float Sin(Phi): " <<
sin(EtTrack.
phi) <<
"\n";
198 sector_totals[EtTrack.
Sector] += 1;
205 <<
"Sector: " << EtTrack.
Sector <<
" Quadrant: " << 1 <<
"\n" 211 <<
" Float Sin(Phi): " 220 <<
"Sector: " << EtTrack.
Sector <<
" Quadrant: " << 2 <<
"\n" 221 <<
"Int Phi: " << EtTrack.
globalPhi <<
" Int Cos(Phi): -" 236 <<
"Sector: " << EtTrack.
Sector <<
" Quadrant: " << 3 <<
"\n" 242 <<
" Float Sin(Phi): -" 252 <<
"Sector: " << EtTrack.
Sector <<
" Quadrant: " << 4 <<
"\n" 259 <<
" Float Sin(Phi): -" 290 GlobalPx = tempsumPx;
291 GlobalPy = tempsumPy;
300 if ((GlobalPx < 0) && (GlobalPy < 0))
302 else if ((GlobalPx >= 0) && (GlobalPy >= 0))
304 else if ((GlobalPx >= 0) && (GlobalPy < 0))
306 else if ((GlobalPx < 0) && (GlobalPy >= 0))
323 totalsarray[
i] =
to_string(sector_totals[
i]) +
"|";
327 <<
"====Sector Pt====\n" 328 <<
"Float Px: " << flpxarray <<
"Float Py: " << flpyarray <<
"Integer Px: " << intpyarray
329 <<
"Integer Px: " << intpyarray <<
"Sector Totals: " << totalsarray
331 <<
"====Global Pt====\n" 332 <<
"Integer Global Px: " << GlobalPx <<
"| Integer Global Py: " << GlobalPy <<
"\n" 340 <<
"Integer MET: " << EtMiss.
Et <<
"| Integer MET phi: " << EtMiss.
Phi <<
"\n" 343 <<
"# Tracks after Quality Cuts: " << num_quality_tracks <<
"\n" 344 <<
"# Tracks Associated to Vertex: " << num_assoc_tracks <<
"\n" 345 <<
"========================================================\n";
const unsigned int kGlobalPhiBins
Log< level::Info, true > LogVerbatim
ap_uint< kMETPhiSize > METphi_t
T getParameter(std::string const &) const
TTTrack< Ref_Phase2TrackerDigi_ > L1TTTrackType
~L1TrackerEtMissEmulatorProducer() override
TTTrack_TrackWord::chi2rphi_t chi2rphidof
std::vector< l1tmetemu::global_phi_t > phiQuadrants_
Sin< T >::type sin(const T &t)
ap_uint< kInternalVTXWidth > z_t
std::string to_string(const V &value)
EtMiss cordicSqrt(Et_t x, Et_t y, int cordicSteps, std::vector< l1tmhtemu::MHTphi_t > atanLUT, std::vector< Et_t > magNormalisationLUT)
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< reco::MET > METCollection
collection of MET objects
TTTrack_TrackWord::chi2rz_t chi2rzdof
const edm::EDGetTokenT< L1VertexCollectionType > pvToken_
const unsigned int kNSector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
L1TkEtMissEmuTrackTransform TrackTransform
void addDefault(ParameterSetDescription const &psetDescription)
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< L1TTTrackRefCollectionType > vtxAssocTrackToken_
L1TrackerEtMissEmulatorProducer(const edm::ParameterSet &)
Cos< T >::type cos(const T &t)
const edm::EDGetTokenT< L1TTTrackRefCollectionType > trackToken_
const unsigned int kMETPhiBins
#define DEFINE_FWK_MODULE(type)
const unsigned int kMETSize
std::vector< VertexWord > VertexWordCollection
l1t::VertexWordCollection L1VertexCollectionType
std::vector< l1tmetemu::global_phi_t > phiShifts_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
l1tmetemu::nstub_t nstubs
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Class to store the L1 Track Trigger tracks.
std::vector< global_phi_t > generateCosLUT(unsigned int size)
l1t::VertexWord L1VertexType
l1tmetemu::global_phi_t globalPhi
const float kMaxCosLUTPhi
std::vector< l1tmetemu::global_phi_t > cosLUT_
TTTrack_TrackWord::bendChi2_t bendChi2
edm::RefVector< L1TTTrackCollectionType > L1TTTrackRefCollectionType
std::string L1MetCollectionName_
std::vector< L1TTTrackType > L1TTTrackCollectionType
ap_int< kInternalPtWidth+kEtExtra > Et_t