|
|
Go to the documentation of this file.
17 TrackletCalculatorBase::TrackletCalculatorBase(
string name,
38 double phiprojdisk[
N_DISK],
46 rinv = 2 *
sin(deltaphi) / dist;
48 double phi1tmp = phi1 -
phimin_;
52 double rhopsi1 = 2 * asin(0.5 *
r1 *
rinv) /
rinv;
53 double rhopsi2 = 2 * asin(0.5 *
r2 *
rinv) /
rinv;
55 t = (z1 -
z2) / (rhopsi1 - rhopsi2);
57 z0 = z1 -
t * rhopsi1;
59 for (
unsigned int i = 0;
i <
N_LAYER - 2;
i++) {
71 for (
unsigned int i = 0;
i <
N_DISK;
i++) {
91 double phiproj[
N_DISK - 2],
99 rinv = 2 *
sin(deltaphi) / dist;
101 double phi1tmp = phi1 -
phimin_;
105 double rhopsi1 = 2 * asin(0.5 *
r1 *
rinv) /
rinv;
106 double rhopsi2 = 2 * asin(0.5 *
r2 *
rinv) /
rinv;
108 t = (z1 -
z2) / (rhopsi1 - rhopsi2);
110 z0 = z1 -
t * rhopsi1;
112 for (
unsigned int i = 0;
i <
N_DISK - 2;
i++) {
124 for (
unsigned int i = 0;
i <
N_DISK - 2;
i++) {
144 double phiproj[
N_DISK - 2],
146 double phider[
N_DISK - 2],
147 double rder[
N_DISK - 2]) {
152 rinv = 2 *
sin(deltaphi) / dist;
157 double phi1tmp = phi1 -
phimin_;
161 double rhopsi1 = 2 * asin(0.5 *
r1 *
rinv) /
rinv;
162 double rhopsi2 = 2 * asin(0.5 *
r2 *
rinv) /
rinv;
164 t = (z1 -
z2) / (rhopsi1 - rhopsi2);
166 z0 = z1 -
t * rhopsi1;
168 for (
int i = 0;
i < 4;
i++) {
172 for (
int i = 0;
i < 1;
i++) {
186 phiproj = phi0 - asin(0.5 * rproj *
rinv);
187 zproj =
z0 + (2 *
t /
rinv) * asin(0.5 * rproj *
rinv);
207 phiproj = phi0 -
tmp;
209 phider = -
rinv / (2 *
t);
223 int iphivmRaw = fpgaphi.
value() >> (fpgaphi.
nbits() - 5);
247 int iphivmRaw = fpgaphi.
value() >> (fpgaphi.
nbits() - 5);
259 if (trackletprojs ==
nullptr) {
262 <<
" iphi = " <<
iphi + 1;
266 assert(trackletprojs !=
nullptr);
267 trackletprojs->
addProj(tracklet);
276 if (trackletprojs ==
nullptr) {
281 <<
" iphi = " <<
iphi + 1;
285 assert(trackletprojs !=
nullptr);
286 trackletprojs->
addProj(tracklet);
307 double phicritapprox = phi0approx - asin(0.5 *
settings_.
rcrit() * rinvapprox);
310 int iphicrit = iphi0 - (irinv >> 8) * ifactor;
316 keep = (iphicrit > iphicritmincut) && (iphicrit < iphicritmaxcut);
318 if (keepapprox && !
keep)
320 <<
" Tracklet kept with exact phicrit cut but not approximate, phicritapprox: "
333 const Stub* outerFPGAStub,
337 <<
" trying stub pair in layer (inner outer): " << innerFPGAStub->
layer().
value()
345 double r1 = innerStub->
r();
346 double z1 = innerStub->
z();
347 double phi1 = innerStub->
phi();
349 double r2 = outerStub->
r();
350 double z2 = outerStub->
z();
351 double phi2 = outerStub->
phi();
388 double rinvapprox, phi0approx, tapprox, z0approx;
390 double phiprojdiskapprox[
N_DISK], rprojdiskapprox[
N_DISK];
485 int irinv, iphi0, it, iz0;
492 int ir1 = innerFPGAStub->
r().
value();
493 int iphi1 = innerFPGAStub->
phi().
value();
494 int iz1 = innerFPGAStub->
z().
value();
496 int ir2 = outerFPGAStub->
r().
value();
497 int iphi2 = outerFPGAStub->
phi().
value();
498 int iz2 = outerFPGAStub->
z().
value();
566 if (!
inSector(iphi0, irinv, phi0approx, rinvapprox))
569 for (
unsigned int i = 0;
i <
N_LAYER - 2; ++
i) {
579 if (iphiproj[
i] <= 0)
619 for (
unsigned int i = 0;
i <
N_DISK; ++
i) {
620 if (iphiprojdisk[
i] <= 0)
640 phiprojdiskapprox[
i],
650 <<
" " << phi0 <<
" " << phi0approx <<
" " << ITC->
phi0_final.
fval() <<
" " <<
t <<
" " << tapprox <<
" "
689 ofstream
fout(
"seeds.txt", ofstream::app);
717 for (
unsigned int j = 0;
j <
N_LAYER - 2;
j++) {
722 if (added && lproj == 3)
724 if (added && lproj == 4)
726 if (added && lproj == 5)
728 if (added && lproj == 6)
733 for (
unsigned int j = 0;
j <
N_DISK - 1;
j++) {
735 if (disk == 4 && addL3)
737 if (disk == 3 && addL4)
739 if (disk == 2 && addL5)
741 if (disk == 1 && addL6)
755 const Stub* outerFPGAStub,
758 edm::LogVerbatim(
"Tracklet") <<
"TrackletCalculator::execute calculate disk seeds";
765 int disk = innerFPGAStub->
disk().
value();
771 double r1 = innerStub->
r();
772 double z1 = innerStub->
z();
773 double phi1 = innerStub->
phi();
775 double r2 = outerStub->
r();
776 double z2 = outerStub->
z();
777 double phi2 = outerStub->
phi();
819 double rinvapprox, phi0approx, tapprox, z0approx;
821 double phiprojdiskapprox[
N_DISK - 2], rprojdiskapprox[
N_DISK - 2];
835 int signt =
t > 0 ? 1 : -1;
901 int irinv, iphi0, it, iz0;
906 int ir1 = innerFPGAStub->
r().
value();
907 int iphi1 = innerFPGAStub->
phi().
value();
908 int iz1 = innerFPGAStub->
z().
value();
910 int ir2 = outerFPGAStub->
r().
value();
911 int iphi2 = outerFPGAStub->
phi().
value();
912 int iz2 = outerFPGAStub->
z().
value();
968 if (!
inSector(iphi0, irinv, phi0approx, rinvapprox))
974 for (
unsigned int i = 0;
i <
N_DISK - 2; ++
i) {
984 if (iphiproj[
i] <= 0)
1015 for (
unsigned int i = 0;
i <
N_DISK - 2; ++
i) {
1017 if (iphiprojdisk[
i] <= 0)
1037 phiprojdiskapprox[
i],
1045 <<
"Trackpars " <<
layerdisk1_ - 5 <<
" " <<
rinv <<
" " << rinvapprox <<
" "
1085 ofstream
fout(
"seeds.txt", ofstream::app);
1099 for (
unsigned int j = 0;
j <
N_DISK - 2;
j++) {
1110 const Stub* outerFPGAStub,
1117 int disk = innerFPGAStub->
disk().
value();
1123 double r1 = innerStub->
r();
1124 double z1 = innerStub->
z();
1125 double phi1 = innerStub->
phi();
1127 double r2 = outerStub->
r();
1128 double z2 = outerStub->
z();
1129 double phi2 = outerStub->
phi();
1132 if (
r1 <
r2 + 1.5) {
1164 z1 = innerFPGAStub->
zapprox();
1172 double rinvapprox, phi0approx, tapprox, z0approx;
1174 double phiprojdiskapprox[
N_DISK - 1], rprojdiskapprox[
N_DISK - 1];
1178 if (ll == 1 && disk == 1)
1180 else if (ll == 2 && disk == 1)
1182 else if (ll == 1 && disk == -1)
1184 else if (ll == 2 && disk == -1)
1187 throw cms::Exception(
"LogicError") << __FILE__ <<
" " << __LINE__ <<
" Invalid seeding!";
1191 int signt =
t > 0 ? 1 : -1;
1262 int irinv, iphi0, it, iz0;
1266 int ir2 = innerFPGAStub->
r().
value();
1267 int iphi2 = innerFPGAStub->
phi().
value();
1268 int iz2 = innerFPGAStub->
z().
value();
1270 int ir1 = outerFPGAStub->
r().
value();
1271 int iphi1 = outerFPGAStub->
phi().
value();
1272 int iz1 = outerFPGAStub->
z().
value();
1341 if (!
inSector(iphi0, irinv, phi0approx, rinvapprox))
1347 for (
unsigned int i = 0;
i <
N_DISK - 2; ++
i) {
1357 if (iphiproj[
i] <= 0)
1380 for (
int i = 0;
i < 4; ++
i) {
1382 if (iphiprojdisk[
i] <= 0)
1402 phiprojdiskapprox[
i],
1411 << phi0 <<
" " << iphi0 <<
" " << ITC->
phi0_final.
fval() <<
" " <<
t <<
" " << it <<
" "
1450 ofstream
fout(
"seeds.txt", ofstream::app);
1456 int layer = outerFPGAStub->
layer().
value() + 1;
1464 for (
unsigned int disk = 2; disk < 6; disk++) {
1465 if (layer == 2 && disk == 5)
constexpr unsigned int N_PSLAYER
VarAdjustK der_phiD_final
double phicritmaxmc() const
double rmindiskvm() const
IMATH_TrackletCalculator * ITC_L2L3()
void addProjectionDisk(int disk, int iphi, TrackletProjectionsMemory *trackletprojs, Tracklet *tracklet)
TrackletParametersMemory * trackletpars_
double krprojshiftdisk() const
const FPGAWord & fpgaphiprojdisk(int disk) const
void addTracklet(Tracklet *tracklet)
const FPGAWord & phi() const
void init(Settings const &settings, int projlayer, double rproj, int iphiproj, int izproj, int iphider, int izder, double phiproj, double zproj, double phiprojder, double zprojder, double phiprojapprox, double zprojapprox, double phiprojderapprox, double zprojderapprox)
double phicritminmc() const
bool calculate(int debug_level)
void addProjection(int layer, int iphi, TrackletProjectionsMemory *trackletprojs, Tracklet *tracklet)
double rmean(unsigned int iLayer) const
bool barrelSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
Settings const & settings_
double phiapprox(double phimin, double) const
IMATH_TrackletCalculatorDisk * ITC_B1B2()
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojlayers_
bool validProj(int layer) const
const FPGAWord & r() const
unsigned int nrbitsstub(unsigned int layerdisk) const
Sin< T >::type sin(const T &t)
IMATH_TrackletCalculatorOverlap * ITC_L1F1()
IMATH_TrackletCalculatorOverlap * ITC_L2B1()
const FPGAWord & fpgazproj(int layer) const
unsigned int projdisks(unsigned int iSeed, unsigned int i) const
Cos< T >::type cos(const T &t)
const FPGAWord & disk() const
const FPGAWord & z() const
unsigned int isPSmodule() const
IMATH_TrackletCalculatorDisk * ITC_F3F4()
void exactproj(double rproj, double rinv, double phi0, double t, double z0, double &phiproj, double &zproj, double &phider, double &zder)
VarAdjustK der_phiL_final
double zmean(unsigned int iDisk) const
void addDiskProj(Tracklet *tracklet, int disk)
VarAdjustK der_phiD_final
bool diskSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
bool addLayerProj(Tracklet *tracklet, int layer)
bool local_passes() const
void exacttracklet(double r1, double z1, double phi1, double r2, double z2, double phi2, double, double &rinv, double &phi0, double &t, double &z0, double phiproj[N_LAYER - 2], double zproj[N_LAYER - 2], double phider[N_LAYER - 2], double zder[N_LAYER - 2], double phiprojdisk[N_DISK], double rprojdisk[N_DISK], double phiderdisk[N_DISK], double rderdisk[N_DISK])
double rinv(double phi1, double phi2, double r1, double r2)
IMATH_TrackletCalculator * ITC_L1L2()
unsigned int projlayers(unsigned int iSeed, unsigned int i) const
unsigned int nzbitsstub(unsigned int layerdisk) const
bool overlapSeeding(const Stub *innerFPGAStub, const L1TStub *innerStub, const Stub *outerFPGAStub, const L1TStub *outerStub)
std::vector< std::vector< TrackletProjectionsMemory * > > trackletprojdisks_
unsigned int nphibitsstub(unsigned int layerdisk) const
IMATH_TrackletCalculatorDisk * ITC_F1F2()
void setTrackletIndex(int index)
VarAdjustK der_phiL_final
void exacttrackletOverlap(double r1, double z1, double phi1, double r2, double z2, double phi2, double, double &rinv, double &phi0, double &t, double &z0, double phiprojLayer[N_PSLAYER], double zprojLayer[N_PSLAYER], double phiderLayer[N_PSLAYER], double zderLayer[N_PSLAYER], double phiproj[N_DISK - 2], double rproj[N_DISK - 2], double phider[N_DISK - 2], double rder[N_DISK - 2])
IMATH_TrackletCalculator * ITC_L5L6()
IMATH_TrackletCalculatorDisk * ITC_B3B4()
constexpr valType make0To2pi(valType angle)
void set_fval(double fval)
bool writeMonitorData(std::string module) const
unsigned int nTracklets() const
bool usephicritapprox() const
void setTCIndex(int index)
IMATH_TrackletCalculatorOverlap * ITC_L1B1()
std::ofstream & ofstream(std::string fname)
void addProj(Tracklet *tracklet)
Log< level::Info, true > LogVerbatim
bool inSector(int iphi0, int irinv, double phi0approx, double rinvapprox)
std::string const & getName() const
const FPGAWord & fpgaphiproj(int layer) const
unsigned int nallstubs(unsigned int layerdisk) const
bool debugTracklet() const
IMATH_TrackletCalculator * ITC_L3L4()
void exactprojdisk(double zproj, double rinv, double phi0, double t, double z0, double &phiproj, double &rproj, double &phider, double &rder)
const FPGAWord & fpgarprojdisk(int disk) const
Power< A, B >::type pow(const A &a, const B &b)
IMATH_TrackletCalculatorOverlap * ITC_L2F1()
Abs< T >::type abs(const T &t)
VarAdjustK der_phiL_final
const FPGAWord & layer() const
bool validProjDisk(int disk) const
void exacttrackletdisk(double r1, double z1, double phi1, double r2, double z2, double phi2, double, double &rinv, double &phi0, double &t, double &z0, double phiprojLayer[N_PSLAYER], double zprojLayer[N_PSLAYER], double phiderLayer[N_PSLAYER], double zderLayer[N_PSLAYER], double phiproj[N_DISK - 2], double rproj[N_DISK - 2], double phider[N_DISK - 2], double rder[N_DISK - 2])
VarAdjustK der_phiD_final
bool goodTrackPars(bool goodrinv, bool goodz0)
constexpr T reduceRange(T x)
void init(Settings const &settings, int projdisk, double zproj, int iphiproj, int irproj, int iphider, int irder, double phiproj, double rproj, double phiprojder, double rprojder, double phiprojapprox, double rprojapprox, double phiprojderapprox, double rprojderapprox)