ATLAS Offline Software
List of all members
InDet::SiZvertexMaker_xk Class Referencefinal

#include <SiZvertexMaker_xk.h>

Inheritance diagram for InDet::SiZvertexMaker_xk:
Collaboration diagram for InDet::SiZvertexMaker_xk:

Public Member Functions

Standard tool methods
 SiZvertexMaker_xk (const std::string &, const std::string &, const IInterface *)
 
virtual ~SiZvertexMaker_xk ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
Methods to initialize tool for new event or region
virtual std::list< Trk::VertexnewEvent (const EventContext &ctx, SiSpacePointsSeedMakerEventData &data) const override
 
virtual std::list< Trk::VertexnewRegion (const EventContext &ctx, SiSpacePointsSeedMakerEventData &data, const std::vector< IdentifierHash > &, const std::vector< IdentifierHash > &) const override
 
virtual std::list< Trk::VertexnewRegion (const EventContext &ctx, SiSpacePointsSeedMakerEventData &data, const std::vector< IdentifierHash > &, const std::vector< IdentifierHash > &, const IRoiDescriptor &) const override
 
Print internal tool parameters and status
virtual MsgStream & dump (MsgStream &out) const override
 

Protected Attributes

Tool handles
ToolHandle< InDet::ISiSpacePointsSeedMakerm_seedsgenerator {this, "SeedMakerTool", "InDet::SiSpacePointsSeedMaker_ATLxk"}
 

Properties

IntegerProperty m_nspoint {this, "SeedSize", 2}
 
IntegerProperty m_histsize {this, "HistSize", 500}
 
IntegerProperty m_mincontent {this, "minContent", 20}
 
DoubleProperty m_zmin {this, "Zmin", -250.}
 
DoubleProperty m_zmax {this, "Zmax", +250.}
 
DoubleProperty m_ratio {this, "minRatio", 0.25}
 
std::list< Trk::Vertexproduction (const EventContext &ctx, SiSpacePointsSeedMakerEventData &data) const
 
MsgStream & dumpConditions (MsgStream &out) const
 

Detailed Description

Class for primary vertices z-coordinates generation (xKalman algorithm)

In AthenaMT, event dependent cache inside SiZvertexMaker_xk is not preferred. SiSpacePointsSeedMakerEventData class holds event dependent data for SiZvertexMaker_xk and ISiSpacePointsSeedMaker. Its object is instantiated in SiSPSeededTrackFinder::execute.

Definition at line 49 of file SiZvertexMaker_xk.h.

Constructor & Destructor Documentation

◆ SiZvertexMaker_xk()

InDet::SiZvertexMaker_xk::SiZvertexMaker_xk ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 27 of file SiZvertexMaker_xk.cxx.

29  : base_class(t, n, p)
30 {
31 }

◆ ~SiZvertexMaker_xk()

virtual InDet::SiZvertexMaker_xk::~SiZvertexMaker_xk ( )
virtualdefault

Member Function Documentation

◆ dump()

MsgStream & InDet::SiZvertexMaker_xk::dump ( MsgStream &  out) const
overridevirtual

Definition at line 220 of file SiZvertexMaker_xk.cxx.

221 {
222  out << std::endl;
223  return dumpConditions(out);
224 }

◆ dumpConditions()

MsgStream & InDet::SiZvertexMaker_xk::dumpConditions ( MsgStream &  out) const
protected

Definition at line 230 of file SiZvertexMaker_xk.cxx.

231 {
232  int n = 62-m_seedsgenerator.type().size();
233  std::string s1;
234  for (int i=0; i<n; ++i) s1.append(" ");
235  s1.append("|");
236 
237  out<<"|----------------------------------------------------------------------"
238  <<"-------------------|"
239  <<std::endl;
240  out<<"| SP seeds maker tool | "
241  <<m_seedsgenerator.type()<<s1<<std::endl;
242  out<<"| Histogram size | "
243  <<std::setw(12)<<m_histsize
244  <<" |"<<std::endl;
245  out<<"| SP seed length (2 or 3) | "
246  <<std::setw(12)<<m_nspoint
247  <<" |"<<std::endl;
248  out<<"| min content of hist.bin | "
249  <<std::setw(12)<<m_mincontent
250  <<" |"<<std::endl;
251  out<<"| min vertex Z-coordinate | "
252  <<std::setw(12)<<std::setprecision(4)<<m_zmin
253  <<" |"<<std::endl;
254  out<<"| max vertex Z-coordinate | "
255  <<std::setw(12)<<std::setprecision(4)<<m_zmax
256  <<" |"<<std::endl;
257  out<<"| min. ratio to max bin | "
258  <<std::setw(12)<<std::setprecision(4)<<m_ratio
259  <<" |"<<std::endl;
260  out<<"|----------------------------------------------------------------------"
261  <<"-------------------|"
262  <<std::endl;
263 
264  return out;
265 }

◆ finalize()

StatusCode InDet::SiZvertexMaker_xk::finalize ( )
overridevirtual

Definition at line 52 of file SiZvertexMaker_xk.cxx.

53 {
54  return AlgTool::finalize();
55 }

◆ initialize()

StatusCode InDet::SiZvertexMaker_xk::initialize ( )
overridevirtual

Definition at line 37 of file SiZvertexMaker_xk.cxx.

38 {
39  // Get tool for seed generator
40  //
41  ATH_CHECK(m_seedsgenerator.retrieve());
42 
44 
45  return StatusCode::SUCCESS;
46 }

◆ newEvent()

std::list< Trk::Vertex > InDet::SiZvertexMaker_xk::newEvent ( const EventContext &  ctx,
SiSpacePointsSeedMakerEventData data 
) const
overridevirtual

Definition at line 61 of file SiZvertexMaker_xk.cxx.

62 {
63  m_seedsgenerator->newEvent(ctx, data);
64  return production(ctx, data);
65 }

◆ newRegion() [1/2]

std::list< Trk::Vertex > InDet::SiZvertexMaker_xk::newRegion ( const EventContext &  ctx,
SiSpacePointsSeedMakerEventData data,
const std::vector< IdentifierHash > &  vPixel,
const std::vector< IdentifierHash > &  vSCT 
) const
overridevirtual

Definition at line 71 of file SiZvertexMaker_xk.cxx.

74 {
75  m_seedsgenerator->newRegion(ctx, data, vPixel, vSCT);
76  return production(ctx, data);
77 }

◆ newRegion() [2/2]

std::list< Trk::Vertex > InDet::SiZvertexMaker_xk::newRegion ( const EventContext &  ctx,
SiSpacePointsSeedMakerEventData data,
const std::vector< IdentifierHash > &  vPixel,
const std::vector< IdentifierHash > &  vSCT,
const IRoiDescriptor PhEt 
) const
overridevirtual

Definition at line 83 of file SiZvertexMaker_xk.cxx.

87 {
88  m_seedsgenerator->newRegion(ctx, data, vPixel, vSCT, PhEt);
89  return production(ctx, data);
90 }

◆ production()

std::list< Trk::Vertex > InDet::SiZvertexMaker_xk::production ( const EventContext &  ctx,
SiSpacePointsSeedMakerEventData data 
) const
protected

Definition at line 96 of file SiZvertexMaker_xk.cxx.

98 {
99  std::list<Trk::Vertex> vertices;
100 
101  std::vector<int> histogram(m_histsize+1, 0);
102  std::vector<double> z_histogram(m_histsize+1, 0.);
103 
104  double sZ = static_cast<double>(m_histsize)/(m_zmax-m_zmin);
105 
106  std::list<int> NMAX;
107  std::list<double> ZMAX;
108  const Trk::SpacePoint* p0 = nullptr;
109 
110  std::list<Trk::Vertex> lv;
111 
112  if (m_nspoint==2) m_seedsgenerator->find2Sp(data, lv);
113  else if (m_nspoint==3) m_seedsgenerator->find3Sp(ctx, data, lv);
114  else m_seedsgenerator->findVSp(ctx, data, lv);
115 
116  const InDet::SiSpacePointsSeed* seed = nullptr;
117  std::multimap<int,double> ver;
118 
119  int nmax = 0 ;
120  int Hmax = 0 ;
121  double zmax = 0.;
122 
123  while ((seed = m_seedsgenerator->next(ctx, data))) {
124 
125  std::vector<const Trk::SpacePoint*>::const_iterator
126  s = seed->spacePoints().begin();
127  ++s;
128  if ((*s)!=p0) {
129  if (Hmax!=0) {
130  NMAX.push_back(nmax);
131  ZMAX.push_back(zmax);
132  }
133  Hmax = nmax = 0;
134  p0=(*s);
135  }
136  int n = static_cast<int>((seed->zVertex()-m_zmin)*sZ);
137  if (n>=0 && n<=m_histsize) {
138  if (++histogram[n]>Hmax) {
139  Hmax = histogram[n];
140  nmax = n;
141  zmax = seed->zVertex();
142  }
143  }
144  }
145 
146  // Clear histogram
147  //
148  for (int i=0; i<=m_histsize; ++i) histogram[i] = 0;
149 
150  // Fill histogram again using NMAX information
151  //
152  std::list<int> ::iterator m, me = NMAX.end();
153  std::list<double>::iterator z = ZMAX.begin();
154  for (m=NMAX.begin(); m!=me; ++m) {
155  ++histogram[(*m)];
156  z_histogram[(*m)] += (*z++);
157  }
158 
159  // Max. content seach and output bank Z coordinates of vertices production
160  //
161  int HiZm = 0;
162  int im = 0;
163  int i = 1;
164  while (true) {
165 
166  if (histogram[i]>=histogram[i-1] && histogram[i]>=histogram[i+1]) {
167  int H3 = histogram[i-1]+histogram[i]+histogram[i+1];
168  if (H3>HiZm) {
169  HiZm=H3;
170  im=i;
171  }
172  if (++i==m_histsize) break;
173  }
174  if (++i==m_histsize) break;
175  }
176 
177  if (im==0 || HiZm < m_mincontent) {
178 
179  return vertices;
180  }
181  double zv = (z_histogram[im]+z_histogram[im-1]+z_histogram[im+1])/static_cast<double>(HiZm);
182  ver.insert(std::make_pair(-HiZm, zv));
183 
184  // Z-vertex coordinates
185  //
186  HiZm = static_cast<int>(m_ratio*static_cast<double>(HiZm));
187  if (HiZm<m_mincontent) HiZm = m_mincontent;
188  i = 1;
189  while (true) {
190  if (histogram[i]>=histogram[i-1] && histogram[i]>=histogram[i+1] && i!=im) {
191  int H3 = histogram[i-1]+histogram[i]+histogram[i+1];
192  if (H3>=HiZm) {
193  zv = (z_histogram[i]+z_histogram[i-1]+z_histogram[i+1])/static_cast<double>(H3);
194  ver.insert(std::make_pair(-H3, zv));
195  }
196  if (++i==m_histsize) break;
197  }
198  if (++i==m_histsize) break;
199  }
200 
201  if (!ver.empty()) {
202  std::multimap<int, double>::iterator v = ver.begin(), ve = ver.end();
203  for (; v!=ve; ++v) {
204  Amg::Vector3D Vp(0., 0., (*v).second);
205  Trk::Vertex Ver(Vp);
206  vertices.push_back(Ver);
207  }
208  }
209 
210  dump(msg(MSG::DEBUG));
211 
212  return vertices;
213 }

Member Data Documentation

◆ m_histsize

IntegerProperty InDet::SiZvertexMaker_xk::m_histsize {this, "HistSize", 500}
protected

Definition at line 105 of file SiZvertexMaker_xk.h.

◆ m_mincontent

IntegerProperty InDet::SiZvertexMaker_xk::m_mincontent {this, "minContent", 20}
protected

Definition at line 106 of file SiZvertexMaker_xk.h.

◆ m_nspoint

IntegerProperty InDet::SiZvertexMaker_xk::m_nspoint {this, "SeedSize", 2}
protected

Definition at line 104 of file SiZvertexMaker_xk.h.

◆ m_ratio

DoubleProperty InDet::SiZvertexMaker_xk::m_ratio {this, "minRatio", 0.25}
protected

Definition at line 109 of file SiZvertexMaker_xk.h.

◆ m_seedsgenerator

ToolHandle<InDet::ISiSpacePointsSeedMaker> InDet::SiZvertexMaker_xk::m_seedsgenerator {this, "SeedMakerTool", "InDet::SiSpacePointsSeedMaker_ATLxk"}
protected

Definition at line 98 of file SiZvertexMaker_xk.h.

◆ m_zmax

DoubleProperty InDet::SiZvertexMaker_xk::m_zmax {this, "Zmax", +250.}
protected

Definition at line 108 of file SiZvertexMaker_xk.h.

◆ m_zmin

DoubleProperty InDet::SiZvertexMaker_xk::m_zmin {this, "Zmin", -250.}
protected

Definition at line 107 of file SiZvertexMaker_xk.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
InDet::SiZvertexMaker_xk::m_zmax
DoubleProperty m_zmax
Definition: SiZvertexMaker_xk.h:108
Trk::Vertex
Definition: Tracking/TrkEvent/VxVertex/VxVertex/Vertex.h:26
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:53
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
InDet::SiZvertexMaker_xk::dump
virtual MsgStream & dump(MsgStream &out) const override
Definition: SiZvertexMaker_xk.cxx:220
NMAX
const int NMAX
Definition: LArPhysWaveHECTool.cxx:22
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
python.atlas_oh.im
im
Definition: atlas_oh.py:167
InDet::SiZvertexMaker_xk::production
std::list< Trk::Vertex > production(const EventContext &ctx, SiSpacePointsSeedMakerEventData &data) const
Definition: SiZvertexMaker_xk.cxx:96
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Pythia8_A14_NNPDF23LO_Var1Down_Common.ver
ver
Definition: Pythia8_A14_NNPDF23LO_Var1Down_Common.py:26
InDet::SiZvertexMaker_xk::dumpConditions
MsgStream & dumpConditions(MsgStream &out) const
Definition: SiZvertexMaker_xk.cxx:230
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
InDet::SiSpacePointsSeed
Definition: SiSpacePointsSeed.h:30
lumiFormat.i
int i
Definition: lumiFormat.py:92
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:176
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::SiZvertexMaker_xk::m_ratio
DoubleProperty m_ratio
Definition: SiZvertexMaker_xk.h:109
InDet::SiZvertexMaker_xk::m_seedsgenerator
ToolHandle< InDet::ISiSpacePointsSeedMaker > m_seedsgenerator
Definition: SiZvertexMaker_xk.h:99
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.PyAthena.v
v
Definition: PyAthena.py:157
InDet::SiZvertexMaker_xk::m_zmin
DoubleProperty m_zmin
Definition: SiZvertexMaker_xk.h:107
DEBUG
#define DEBUG
Definition: page_access.h:11
InDet::SiZvertexMaker_xk::m_nspoint
IntegerProperty m_nspoint
Definition: SiZvertexMaker_xk.h:104
InDet::SiZvertexMaker_xk::m_mincontent
IntegerProperty m_mincontent
Definition: SiZvertexMaker_xk.h:106
InDet::SiZvertexMaker_xk::m_histsize
IntegerProperty m_histsize
Definition: SiZvertexMaker_xk.h:105
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
nmax
const int nmax(200)
histogram
std::string histogram
Definition: chains.cxx:52