|
|
Go to the documentation of this file.
20 const Stub* innerFPGAStub,
21 const Stub* middleFPGAStub,
22 const Stub* outerFPGAStub,
42 : settings_(settings) {
88 for (
unsigned int i = 0;
i <
N_LAYER - 2;
i++) {
93 for (
unsigned int i = 0;
i <
N_DISK;
i++) {
98 for (
unsigned int i = 0;
i <
N_LAYER - 2;
i++) {
101 if (!layerprojs[
i].
valid())
107 for (
unsigned int i = 0;
i <
N_DISK;
i++) {
110 if (!diskprojs[
i].
valid())
123 set<int> tpsetstubinner;
124 set<int> tpsetstubouter;
127 for (
auto tp : tps) {
129 tpsetstubinner.insert(
tp);
130 tpset.insert(
abs(
tp));
135 for (
auto tp : tps) {
137 tpsetstubouter.insert(
tp);
138 tpset.insert(
abs(
tp));
142 for (
auto&
tp : tpset) {
143 if (tpsetstubinner.find(
tp) != tpsetstubinner.end() && tpsetstubinner.find(-
tp) != tpsetstubinner.end() &&
144 tpsetstubouter.find(
tp) != tpsetstubouter.end() && tpsetstubouter.find(-
tp) != tpsetstubouter.end()) {
154 set<int> tpsetstubinner;
155 set<int> tpsetstubouter;
157 vector<int> tps = stub->
tps();
158 for (
auto tp : tps) {
160 tpsetstub.insert(
tp);
161 tpset.insert(
abs(
tp));
165 for (
auto tp : tps) {
167 tpsetstubinner.insert(
tp);
168 tpset.insert(
abs(
tp));
172 for (
auto tp : tps) {
174 tpsetstubouter.insert(
tp);
175 tpset.insert(
abs(
tp));
179 for (
auto tp : tpset) {
180 if (tpsetstub.find(
tp) != tpsetstub.end() && tpsetstub.find(-
tp) != tpsetstub.end() &&
181 tpsetstubinner.find(
tp) != tpsetstubinner.end() && tpsetstubinner.find(-
tp) != tpsetstubinner.end() &&
182 tpsetstubouter.find(
tp) != tpsetstubouter.end() && tpsetstubouter.find(-
tp) != tpsetstubouter.end()) {
224 if (allstubindex >= (1 << 7)) {
225 edm::LogPrint(
"Tracklet") <<
"Warning projection number too large!";
226 index.set((1 << 7) - 1, 7,
true, __LINE__, __FILE__);
228 index.set(allstubindex, 7,
true, __LINE__, __FILE__);
240 int irinvvm = 16 + (tmp_irinv >> (nbits_irinv - 5));
243 edm::LogPrint(
"Tracklet") <<
"Warning irinvvm too large:" << irinvvm;
250 tmp.set(irinvvm, 5,
true, __LINE__, __FILE__);
253 "|" +
tmp.str() +
"|" + std::to_string(
PSseed());
259 if (allstubindex >= (1 << 7)) {
260 edm::LogPrint(
"Tracklet") <<
"Warning projection number too large!";
261 index.set((1 << 7) - 1, 7,
true, __LINE__, __FILE__);
263 index.set(allstubindex, 7,
true, __LINE__, __FILE__);
322 settings_,
layer, ideltaphi, ideltaz, stubid, dphi,
dz, dphiapprox, dzapprox,
rstub,
stubptr);
356 if (ilayerresid.valid()) {
368 if (idiskresid.valid()) {
414 std::vector<const L1TStub*>
tmp;
424 if (ilayerresid.valid())
425 tmp.push_back(ilayerresid.stubptr()->l1tstub());
429 if (idiskresid.valid())
430 tmp.push_back(idiskresid.stubptr()->l1tstub());
437 std::map<int, int> stubIDs;
602 double chisqrphifitexact,
603 double chisqrzfitexact,
612 const vector<const L1TStub*>& l1stubs) {
648 string stubid0 =
"111111111";
649 string stubid1 =
"111111111";
650 string stubid2 =
"111111111";
651 string stubid3 =
"111111111";
821 return (
l < 999 ?
l : 0);
834 return (
d < 999 ?
d : 0);
857 assert(iTC >= 0 && iTC <= 14);
863 int seedlayer =
layer();
864 int seeddisk =
disk();
866 if (seedlayer == 1 && seeddisk == 0)
868 if (seedlayer == 3 && seeddisk == 0)
870 if (seedlayer == 5 && seeddisk == 0)
872 if (seedlayer == 0 &&
abs(seeddisk) == 1)
874 if (seedlayer == 0 &&
abs(seeddisk) == 3)
876 if (seedlayer == 1 &&
abs(seeddisk) == 1)
878 if (seedlayer == 2 &&
abs(seeddisk) == 1)
880 if (seedlayer == 2 &&
abs(seeddisk) == 0)
892 if (l1 + l2 + l3 < 1998) {
900 throw cms::Exception(
"BadConfig") << __FILE__ <<
" " << __LINE__ <<
" seedlayer abs(seeddisk) : " << seedlayer
901 <<
" " <<
abs(seeddisk);
const FPGAWord & fpgafinezvm() const
std::string fullmatchstr(int layer)
bool stubtruthmatch(const L1TStub *stub)
std::vector< int > tps() const
double chisqrphifitexact_
unsigned int ntrackletmax() const
DiskProjection diskproj_[N_DISK]
unsigned int PSseed() const
std::string phiregionaddressstr() const
Settings const & settings_
double phi0fitexact() const
TrackPars< double > fitpars_
const FPGAWord & getBendIndex() const
unsigned int layer() const
const FPGAWord & fpgarprojder() const
const L1TStub * innerStub_
void init(Settings const &settings, int layer, int iphiresid, int izresid, int istubid, double phiresid, double zresid, double phiresidapprox, double zresidapprox, double rstub, const Stub *stubptr)
DiskResidual diskresid_[N_DISK]
const Stub * middleFPGAStub_
TrackPars< double > trackpars_
LayerProjection layerproj_[N_LAYER]
Log< level::Warning, true > LogPrint
const FPGAWord & fpgaphiresid() const
void addMatch(int layer, int ideltaphi, int ideltaz, double dphi, double dz, double dphiapprox, double dzapprox, int stubid, double rstub, const trklet::Stub *stubptr)
LayerResidual layerresid_[N_LAYER]
void set(int value, int nbits, bool positive=true, int line=-1, const char *file=nullptr)
const FPGAWord & fpgafinervm() const
double d0fitexact() const
const FPGAWord & fpgarbin2projvm() const
const FPGAWord & itfit() const
double rinvapprox() const
double z0fitexact() const
std::string vmstrdisk(int disk, unsigned int allstubindex)
const FPGAWord & irinvfit() const
const FPGAWord & fpgaphiproj() const
const Stub * outerFPGAStub_
unsigned int nbitstrackletindex() const
void addMatchDisk(int disk, int ideltaphi, int ideltar, double dphi, double dr, double dphiapprox, double drapprox, double alpha, int stubid, double zstub, const trklet::Stub *stubptr)
std::unique_ptr< Track > fpgatrack_
const Stub * middleFPGAStub()
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
const FPGAWord & disk() const
std::string trackletprojstr(int layer) const
const FPGAWord & fpgaphiproj() const
const L1TStub * middleStub()
const trklet::Stub * stubptr(int layer) const
const FPGAWord & fpgastubid() const
const L1TStub * innerStub()
const FPGAWord & fpgaphiprojder() const
std::string trackletprojstrD(int disk) const
void init(Settings const &settings, int disk, int iphiresid, int irresid, int istubid, double phiresid, double rresid, double phiresidapprox, double rresidapprox, double zstub, double alpha, FPGAWord ialpha, const Stub *stubptr)
double phi0approx() const
std::string fullmatchdiskstr(int disk)
const FPGAWord & fpgazproj() const
unsigned int nbitsd0() const
unsigned int calcSeedIndex() const
constexpr std::array< uint8_t, layerIndexSize > layer
const FPGAWord & fpgaphiprojder() const
constexpr unsigned int N_SEED
void setTrackletIndex(unsigned int index)
const FPGAWord & alphanew() const
double rinv(double phi1, double phi2, double r1, double r2)
const FPGAWord & iphi0fit() const
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
const L1TStub * outerStub_
constexpr unsigned int N_PROJ
std::string trackletparstr()
double rinvfitexact() const
const FPGAWord & fpgarproj() const
std::map< int, int > getStubIDs()
const Stub * innerFPGAStub_
const L1TStub * outerStub()
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
const FPGAWord & fpgaphiresid() const
void init(T rinv, T phi0, T d0, T t, T z0)
const FPGAWord & id0fit() const
TrackPars< FPGAWord > fpgafitpars_
const FPGAWord & fpgastubid() const
const Stub * innerFPGAStub()
const FPGAWord & fpgarresid() const
unsigned int phiregionaddress() const
Track makeTrack(const std::vector< const L1TStub * > &l1stubs)
const FPGAWord & fpgazprojder() const
TrackPars< FPGAWord > fpgapars_
const Stub * outerFPGAStub()
void setFitPars(double rinvfit, double phi0fit, double d0fit, double tfit, double z0fit, double chisqrphifit, double chisqrzfit, double rinvfitexact, double phi0fitexact, double d0fitexact, double tfitexact, double z0fitexact, double chisqrphifitexact, double chisqrzfitexact, int irinvfit, int iphi0fit, int id0fit, int itfit, int iz0fit, int ichisqrphifit, int ichisqrzfit, int hitpattern, const std::vector< const L1TStub * > &l1stubs=std::vector< const L1TStub * >())
const FPGAWord & stubindex() const
std::string trackfitstr()
const FPGAWord & fpgazbin2projvm() const
Abs< T >::type abs(const T &t)
const FPGAWord & fpgazresid() const
const FPGAWord & layer() const
const FPGAWord & fpgarbin1projvm() const
TrackPars< double > trackparsapprox_
const L1TStub * middleStub_
std::vector< const L1TStub * > getL1Stubs()
static constexpr float d0
TrackPars< double > fitparsexact_
const FPGAWord & fpgazbin1projvm() const
static constexpr float d1
bool writeoutReal() const
std::string vmstrlayer(int layer, unsigned int allstubindex)
int projlayer_[N_LAYER - 2]
const FPGAWord & iz0fit() const