Skip to content

Commit

Permalink
DTC phi range hard-wired constants removed (cms-sw#141)
Browse files Browse the repository at this point in the history
* Added function to get num ATCA slots

* Added comment

* Automatically calc DTC phi ranges

* Improved comments

* Added comment

* Simplified phi offset calc

* Fixed missing half-sector rotation bug

* Added comments

* Changed dtcphirange.txt to numbers instead of C++ code
  • Loading branch information
tomalin committed Jun 10, 2022
1 parent 492aae0 commit b2a3066
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 263 deletions.
3 changes: 3 additions & 0 deletions L1Trigger/TrackFindingTracklet/interface/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ namespace trklet {
void setNbitsseed(unsigned int nbitsseed) { nbitsseed_ = nbitsseed; }
void setNbitsseedextended(unsigned int nbitsseed) { nbitsseedextended_ = nbitsseed; }

// Phi width of nonant including overlaps (at widest point).
double dphisectorHG() const {
//These values are used in the DTC emulation code.
double rsectmin = 21.8;
Expand Down Expand Up @@ -501,6 +502,8 @@ namespace trklet {
{{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2}},
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1}}}};

// FIX: There should be 3 PS10G slots & 3 PS (5G) ones.
// (Will change output files used by HLS).
std::vector<std::string> slotToDTCname_{"PS10G_1","PS10G_2","PS10G_3","PS10G_4","PS_1","PS_2","2S_1","2S_2","2S_3","2S_4","2S_5","2S_6"};

std::map<std::string, std::vector<int> > dtclayers_{{"PS10G_1", {0, 6, 8, 10}},
Expand Down
25 changes: 21 additions & 4 deletions L1Trigger/TrackFindingTracklet/interface/TrackletConfigBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@
#include "L1Trigger/TrackFindingTracklet/interface/Settings.h"

#include <vector>
#include <list>
#include <utility>
#include <set>
#include <iostream>
#include <fstream>
#include <cstdlib>

namespace tt {class Setup;}

namespace trklet {

class TrackletConfigBuilder {
public:
//Builds the configuration for the tracklet based track finding
TrackletConfigBuilder(const Settings& settings);
TrackletConfigBuilder(const Settings& settings, const tt::Setup* setup = nullptr);

//This method writes out the configuration as files
void writeAll(std::ostream& wires, std::ostream& memories, std::ostream& modules);
Expand Down Expand Up @@ -75,6 +78,17 @@ namespace trklet {
//
void buildProjections();

#ifdef CMSSW_GIT_HASH
// Calculate phi range of modules read by each DTC.
void setDTCphirange(const tt::Setup* setup);

// Write DTC phi ranges to dtcphirange.txt for stand-alone emulation.
void writeDTCphirange() const;
#else
// Set phi ranges after reading them from dtcphirange.txt (stand-alone emulation)
void setDTCphirange(const tt::Setup* setup = nullptr);
#endif

//
// Helper function to determine if a pair of VM memories form valid TE
//
Expand Down Expand Up @@ -115,7 +129,7 @@ namespace trklet {
unsigned int ivm2,
unsigned int iseed) const;

//StubPaur displaced name
//StubPair displaced name
std::string SPDName(unsigned int l1,
unsigned int ireg1,
unsigned int ivm1,
Expand Down Expand Up @@ -244,10 +258,10 @@ namespace trklet {
std::pair<std::vector<std::pair<double, double> >, std::vector<std::pair<double, double> > >
VMStubsTE_[N_SEED_PROMPT];

//List of the TEs and the VM bins for each TE
// VM bin in inner/outer seeding layer of each TE.
std::vector<std::pair<unsigned int, unsigned int> > TE_[N_SEED_PROMPT];

//The TCs for each seeding combination
//The ID of all TE that send data to TCs for each seeding combination
std::vector<std::vector<unsigned int> > TC_[N_SEED_PROMPT];

//The projections to each layer/disk from a seed and TC
Expand All @@ -264,6 +278,9 @@ namespace trklet {
{-1, -1, -1, -1, -1, -1, -1, 1, 2, 3, 4}, //L1D1
{1, -1, -1, -1, -1, -1, -1, 2, 3, 4, -1}}; //L2D1

struct DTCinfo {std::string name; int layer; float phimin; float phimax;};
std::list<DTCinfo> vecDTCinfo_;

//Settings
const Settings& settings_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
#define L1Trigger_TrackFindingTracklet_interface_TrackletEventProcessor_h

#include "L1Trigger/TrackFindingTracklet/interface/Timer.h"
#include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.h"
#include "DataFormats/L1TrackTrigger/interface/TTTypes.h"

#include <map>
#include <memory>
#include <vector>
#include <deque>
#include <string>

namespace tt {class Setup;}

namespace trklet {

class Settings;
Expand All @@ -19,14 +21,15 @@ namespace trklet {
class Sector;
class HistBase;
class Track;
class ChannelAssignment;

class TrackletEventProcessor {
public:
TrackletEventProcessor();

~TrackletEventProcessor();

void init(Settings const& theSettings, const ChannelAssignment* channelAssignment);
void init(Settings const& theSettings, const ChannelAssignment* channelAssignment, const tt::Setup* setup = nullptr);

void event(SLHCEvent& ev);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void L1FPGATrackProducer::beginRun(const edm::Run& run, const edm::EventSetup& i
setup_ = iSetup.getData(esGetToken_);
channelAssignment_ = &iSetup.getData(esGetTokenChannelAssignment_);
// initialize the tracklet event processing (this sets all the processing & memory modules, wiring, etc)
eventProcessor.init(settings_, channelAssignment_);
eventProcessor.init(settings_, channelAssignment_, &setup_);
}

//////////
Expand Down
Loading

0 comments on commit b2a3066

Please sign in to comment.