28 (
const std::string&
t,
const std::string&
n,
const IInterface*
p)
95 double f[3], gP[3] ={10.,10.,0.};
101 if (fieldCondObj ==
nullptr) {
105 fieldCondObj->getInitializedCache (fieldCache);
110 data.K = 2./(300.*
f[2]);
112 data.K = 2./(300.* 5. );
115 data.i_spforseed =
data.l_spforseed.begin();
124 if (!prd_to_track_map.
isValid()) {
127 prd_to_track_map_cptr = prd_to_track_map.
cptr();
135 if (spacepointsPixel.isValid()) {
141 if (prd_to_track_map_cptr &&
isUsed(sp,*prd_to_track_map_cptr))
continue;
143 int ir =
static_cast<int>(
r*irstep);
145 data.r_Sorted[
ir].push_back(sps);
159 if (spacepointsSCT.isValid()) {
165 if (prd_to_track_map_cptr &&
isUsed(sp,*prd_to_track_map_cptr))
continue;
167 int ir =
static_cast<int>(
r*irstep);
169 data.r_Sorted[
ir].push_back(sps);
182 if (spacepointsOverlap.isValid()) {
188 if (prd_to_track_map_cptr &&
isUsed(sp,*prd_to_track_map_cptr))
continue;
190 int ir =
static_cast<int>(
r*irstep);
192 data.r_Sorted[
ir].push_back(sps);
209 const std::vector<IdentifierHash>& vPixel,
const std::vector<IdentifierHash>& vSCT)
const
218 double f[3], gP[3] ={10.,10.,0.};
224 if (fieldCondObj ==
nullptr) {
228 fieldCondObj->getInitializedCache (fieldCache);
233 data.K = 2./(300.*
f[2]);
235 data.K = 2./(300.* 5. );
238 data.i_spforseed =
data.l_spforseed.begin();
246 if (!prd_to_track_map.
isValid()) {
249 prd_to_track_map_cptr = prd_to_track_map.
cptr();
254 if (
m_pixel && !vPixel.empty()) {
257 if (spacepointsPixel.isValid()) {
262 const auto *
w = spacepointsPixel->indexFindPtr(
l);
263 if (
w==
nullptr)
continue;
267 if (prd_to_track_map_cptr &&
isUsed(sp, *prd_to_track_map_cptr))
continue;
268 int ir =
static_cast<int>(
r*irstep);
270 data.r_Sorted[
ir].push_back(sps);
281 if (
m_sct && !vSCT.empty()) {
284 if (spacepointsSCT.isValid()) {
288 const auto *
w = spacepointsSCT->indexFindPtr(
l);
289 if (
w==
nullptr)
continue;
293 if (prd_to_track_map_cptr &&
isUsed(sp,*prd_to_track_map_cptr))
continue;
294 int ir =
static_cast<int>(
r*irstep);
296 data.r_Sorted[
ir].push_back(sps);
314 const std::vector<IdentifierHash>& vPixel,
const std::vector<IdentifierHash>& vSCT,
const IRoiDescriptor&)
const
329 if (lv.begin()!=lv.end())
mode = 1;
332 data.i_seede =
data.l_seeds.begin();
360 if (lv.begin()!=lv.end())
mode = 3;
363 data.i_seede =
data.l_seeds.begin();
396 if (lv.begin()!=lv.end())
mode = 6;
399 data.i_seede =
data.l_seeds.begin();
436 std::string
s2;
for (
int i=0;
i<
n; ++
i)
s2.append(
" ");
s2.append(
"|");
438 std::string
s3;
for (
int i=0;
i<
n; ++
i)
s3.append(
" ");
s3.append(
"|");
440 std::string
s4;
for (
int i=0;
i<
n; ++
i)
s4.append(
" ");
s4.append(
"|");
442 std::string s5;
for (
int i=0;
i<
n; ++
i) s5.append(
" "); s5.append(
"|");
445 out<<
"|---------------------------------------------------------------------|"
459 <<std::setw(12)<<
m_sct
464 out<<
"| maxSizeSP | "
467 out<<
"| pTmin (mev) | "
468 <<std::setw(12)<<std::setprecision(5)<<
m_ptmin
471 <<std::setw(12)<<std::setprecision(5)<<
m_etamax
473 out<<
"| max radius SP | "
474 <<std::setw(12)<<std::setprecision(5)<<
m_r_rmax
476 out<<
"| radius step | "
477 <<std::setw(12)<<std::setprecision(5)<<
m_r_rstep
479 out<<
"| min Z-vertex position | "
480 <<std::setw(12)<<std::setprecision(5)<<
m_zmin
482 out<<
"| max Z-vertex position | "
483 <<std::setw(12)<<std::setprecision(5)<<
m_zmax
485 out<<
"| min radius first SP(3) | "
486 <<std::setw(12)<<std::setprecision(5)<<
m_r1min
488 out<<
"| min radius second SP(3) | "
489 <<std::setw(12)<<std::setprecision(5)<<
m_r2min
491 out<<
"| min radius last SP(3) | "
492 <<std::setw(12)<<std::setprecision(5)<<
m_r3min
494 out<<
"| max radius first SP(3) | "
495 <<std::setw(12)<<std::setprecision(4)<<
m_r1max
497 out<<
"| max radius second SP(3) | "
498 <<std::setw(12)<<std::setprecision(5)<<
m_r2max
500 out<<
"| max radius last SP(3) | "
501 <<std::setw(12)<<std::setprecision(5)<<
m_r3max
503 out<<
"| min space points dR | "
504 <<std::setw(12)<<std::setprecision(5)<<
m_drmin
506 out<<
"| max space points dR | "
507 <<std::setw(12)<<std::setprecision(5)<<
m_drmax
509 out<<
"| max impact | "
510 <<std::setw(12)<<std::setprecision(5)<<
m_diver
512 out<<
"| max impact pps | "
513 <<std::setw(12)<<std::setprecision(5)<<
m_diverpps
515 out<<
"|---------------------------------------------------------------------|"
517 out<<
"| Beam X center | "
518 <<std::setw(12)<<std::setprecision(5)<<
data.xbeam[0]
520 out<<
"| Beam Y center | "
521 <<std::setw(12)<<std::setprecision(5)<<
data.ybeam[0]
523 out<<
"| Beam Z center | "
524 <<std::setw(12)<<std::setprecision(5)<<
data.zbeam[0]
526 out<<
"| Beam X-axis direction | "
527 <<std::setw(12)<<std::setprecision(5)<<
data.xbeam[1]
528 <<std::setw(12)<<std::setprecision(5)<<
data.xbeam[2]
529 <<std::setw(12)<<std::setprecision(5)<<
data.xbeam[3]
531 out<<
"| Beam Y-axis direction | "
532 <<std::setw(12)<<std::setprecision(5)<<
data.ybeam[1]
533 <<std::setw(12)<<std::setprecision(5)<<
data.ybeam[2]
534 <<std::setw(12)<<std::setprecision(5)<<
data.ybeam[3]
536 out<<
"| Beam Z-axis direction | "
537 <<std::setw(12)<<std::setprecision(5)<<
data.zbeam[1]
538 <<std::setw(12)<<std::setprecision(5)<<
data.zbeam[2]
539 <<std::setw(12)<<std::setprecision(5)<<
data.zbeam[3]
541 out<<
"|---------------------------------------------------------------------|"
552 out<<
"|---------------------------------------------------------------------|"
555 <<std::setw(12)<<
data.ns
558 <<std::setw(12)<<
data.nsaz
561 <<std::setw(12)<<
data.l_seeds.size()
563 out<<
"|---------------------------------------------------------------------|"
574 if (
data.endlist)
return;
576 data.i_seede =
data.l_seeds.begin();
607 const float sFmax =
static_cast<float>(NFmax)/
pi2;
608 const float sFmin = 100./60.;
612 else if (
m_sF < sFmin)
m_sF = sFmin;
620 int fb =
f-1;
if (fb<0 ) fb=
m_fNmax;
685 double tx =
std::tan(beamSpotHandle->beamTilt(0));
686 double ty =
std::tan(beamSpotHandle->beamTilt(1));
688 double ph = atan2(ty,
tx);
689 double th = acos(1./sqrt(1.+
tx*
tx+ty*ty));
690 double sint =
sin(
th);
692 double sinp =
sin(ph);
693 double cosp =
cos(ph);
695 data.xbeam[0] =
static_cast<float>(cb.x());
696 data.xbeam[1] =
static_cast<float>(
cost*cosp*cosp+sinp*sinp);
697 data.xbeam[2] =
static_cast<float>(
cost*sinp*cosp-sinp*cosp);
698 data.xbeam[3] =-
static_cast<float>(sint*cosp );
700 data.ybeam[0] =
static_cast<float>(cb.y());
701 data.ybeam[1] =
static_cast<float>(
cost*cosp*sinp-sinp*cosp);
702 data.ybeam[2] =
static_cast<float>(
cost*sinp*sinp+cosp*cosp);
703 data.ybeam[3] =-
static_cast<float>(sint*sinp );
705 data.zbeam[0] =
static_cast<float>(cb.z());
706 data.zbeam[1] =
static_cast<float>(sint*cosp);
707 data.zbeam[2] =
static_cast<float>(sint*sinp);
708 data.zbeam[3] =
static_cast<float>(
cost);
738 if (!
data.r_map[
i])
continue;
739 r =
data.r_Sorted[
i].begin();
741 while (
r!=
data.r_Sorted[
i].end()) {
745 float F = (*r)->phi();
if (
F<0.)
F+=
pi2;
747 int f =
static_cast<int>(
F*
m_sF);
751 data.rf_Sorted[
f].push_back(*
r);
754 int z;
float Z = (*r)->z();
759 Z< 250.?
z=5:Z< 450.?
z=6:Z< 925.?
z=7:Z< 1400.?
z=8:Z< 2500.?
z=9:
z=10;
761 Z>-250.?
z=5:Z>-450.?
z=4:Z>-925.?
z=3:Z>-1400.?
z=2:Z>-2500.?
z=1:
z= 0;
765 data.rfz_Sorted[
n].push_back(*
r);
767 data.r_Sorted[
i].erase(
r++);
781 for (
int i=0;
i!=
data.nr; ++
i) {
784 data.r_Sorted[
n].erase(
data.r_Sorted[
n].begin(),
data.r_Sorted[
n].end());
787 for (
int i=0;
i!=
data.nrf; ++
i) {
790 data.rf_Sorted[
n].erase(
data.rf_Sorted[
n].begin(),
data.rf_Sorted[
n].end());
793 for (
int i=0;
i!=
data.nrfz; ++
i) {
794 int n =
data.rfz_index[
i];
796 data.rfz_Sorted[
n].erase(
data.rfz_Sorted[
n].begin(),
data.rfz_Sorted[
n].end());
822 if (
data.nsaz<3)
return;
824 const int ZI[
SizeZ]= {5,6,7,8,9,10,4,3,2,1,0};
844 if (!
data.rfz_map[an])
continue;
845 rb [NB] =
data.rfz_Sorted[an].begin();
846 rbe[NB++] =
data.rfz_Sorted[an].end();
851 if (!
data.rfz_map[an])
continue;
852 rt [NT] =
data.rfz_Sorted[an].begin();
853 rte[NT++] =
data.rfz_Sorted[an].end();
858 data.zMin =
z;
return;
875 int NB,
int NT,
int& nseed)
const
885 for (; r0!=rbe[0]; ++r0) {
888 data.mapOneSeeds.erase(
data.mapOneSeeds.begin(),
data.mapOneSeeds.end());
890 float R = (*r0)->radius();
899 float X = (*r0)->x();
900 float Y = (*r0)->y();
901 float Z = (*r0)->z();
906 for (
int i=0;
i!=NB; ++
i) {
908 for (
r=
rb[
i];
r!=rbe[
i]; ++
r) {
910 float Rb =(*r)->radius();
917 if (dR >
m_drmax || (*r)->sur()==sur0)
continue;
919 if ( !
pix && !(*r)->spacepoint->clusterList().second)
continue;
921 float Tz = (Z-(*r)->z())/dR;
923 if (Tz < m_dzdrmin || Tz >
m_dzdrmax)
continue;
940 for (
int i=0;
i!=NT; ++
i) {
942 for (
r=rt[
i];
r!=rte[
i]; ++
r) {
944 float Rt =(*r)->radius();
949 if ( (*r)->sur()==sur0)
continue;
951 float Tz = ((*r)->z()-Z)/dR;
953 if (Tz < m_dzdrmin || Tz >
m_dzdrmax)
continue;
965 if (!(Nt-Nb))
continue;
967 float covr0 = (*r0)->covr();
968 float covz0 = (*r0)->covz();
973 for (
int i=0;
i!=Nt; ++
i) {
977 float dx = sp->
x()-
X;
978 float dy = sp->
y()-
Y;
979 float dz = sp->
z()-Z;
982 float r2 = 1.f/(
x*
x+
y*
y);
983 float dr = std::sqrt(r2);
984 float tz = dz*
dr;
if (
i < Nb) tz = -tz;
1000 float ipt2K = ipt2/K2;
1001 float ipt2C = ipt2*COF;
1002 float COFK = COF*K2;
1008 for (
int b=0;
b!=Nb; ++
b) {
1012 float Zob =
data.Zo[
b];
1013 float Tzb =
data.Tz[
b];
1014 float Rb2r =
data.R [
b]*covr0;
1015 float Rb2z =
data.R [
b]*covz0;
1016 float Erb =
data.Er[
b];
1017 float Vb =
data.V [
b];
1018 float Ub =
data.U [
b];
1019 float Tzb2 = (1.f+Tzb*Tzb);
1020 float CSA = Tzb2*COFK;
1021 float ICSA = Tzb2*ipt2C;
1023 for (
int t=Nb;
t!=Nt; ++
t) {
1025 float Ts = .5f*(Tzb+
data.Tz[
t]);
1028 if ( dT > ICSA)
continue;
1029 float dU =
data.U[
t]-Ub;
if (dU == 0. )
continue;
1030 float A = (
data.V[
t]-Vb)/dU;
1034 if (B2 > ipt2K*
S2 || dT*
S2 > B2*CSA)
continue;
1035 float Im = std::abs((
A-B*R)*R);
1038 if ( Im > imc )
continue;
1039 if (
data.SP[
t]->spacepoint->clusterList().second && Im > imcs)
continue;
1044 nseed +=
data.mapOneSeeds.size();
1070 data.OneSeeds[
data.nOneSeeds].erase();
1074 data.OneSeeds[
data.nOneSeeds].setZVertex(
static_cast<double>(
z));
1075 data.mapOneSeeds.insert(std::make_pair(
q, &(
data.OneSeeds[
data.nOneSeeds])));
1078 std::multimap<float,InDet::SiSpacePointsSeed*>::reverse_iterator
1079 l =
data.mapOneSeeds.rbegin();
1080 if ((*l).first <=
q)
return;
1086 s->setZVertex(
static_cast<double>(
z));
1088 i =
data.mapOneSeeds.insert(std::make_pair(
q,
s));
1090 for (++
i;
i!=
data.mapOneSeeds.end(); ++
i) {
1091 if ((*i).second==
s) {
1092 data.mapOneSeeds.erase(
i);
1106 if (
data.i_seed==
data.i_seede)
return nullptr;
1108 return &(*
data.i_seed++);
1128 if (
data.i_spforseed!=
data.l_spforseed.end()) {
1129 sps = &(*
data.i_spforseed++);
1132 data.l_spforseed.emplace_back(sp,
r);
1133 sps = &(
data.l_spforseed.back());
1134 data.i_spforseed =
data.l_spforseed.end();
1149 if (
data.i_seede!=
data.l_seeds.end()) {
1154 s->setZVertex(
static_cast<double>(
z));
1170 if (
data.i_seede!=
data.l_seeds.end()) {
1176 s->setZVertex(
static_cast<double>(
z));
1190 l =
data.mapOneSeeds.begin(),
1191 le =
data.mapOneSeeds.end ();
1193 for (;
l!=le; ++
l) {
1194 if (
data.i_seede!=
data.l_seeds.end()) {
1198 data.l_seeds.emplace_back(*(*l).second);
1205 data.initialize(EventData::ToolType::BeamGas,