|
ATLAS Offline Software
|
Go to the documentation of this file.
32 (
const std::string&
t,
const std::string&
n,
const IInterface*
p)
35 declareInterface<ITRT_TrackExtensionTool>(
this);
57 return StatusCode::FAILURE;
65 return StatusCode::FAILURE;
141 MsgStream& InDet::operator <<
151 std::ostream& InDet::operator <<
161 std::unique_ptr<InDet::ITRT_TrackExtensionTool::IEventData>
168 std::stringstream
msg;
170 throw std::runtime_error(
msg.str() );
173 std::unique_ptr<EventData> event_data(
new EventData(trtcontainer.
cptr()));
183 return std::unique_ptr<InDet::ITRT_TrackExtensionTool::IEventData>(event_data.release());
191 std::vector<const Trk::MeasurementBase*>&
210 parb = (*(tsos->
begin()))->trackParameters();
213 if(parb &&
par!=parb) {
236 std::vector< const Trk::TrackParameters* >::const_iterator parameterIter = tpars->begin();
237 for ( ; parameterIter != tpars->end(); ++parameterIter) {
240 if ( (*parameterIter)->associatedSurface().associatedDetectorElementIdentifier()==0 ) {
245 const Identifier& DCId = (*parameterIter)->associatedSurface().associatedDetectorElementIdentifier();
249 detElements[1]=(*parameterIter)->associatedSurface().associatedDetectorElement()->identifyHash();
258 if(phi_mod<0) phi_mod=31;
264 if(phi_mod>31) phi_mod=0;
271 for(
int i=-1;
i<2;
i++) {
278 if(container==
nullptr) {
286 InDet::TRT_DriftCircleCollection::const_iterator driftCircleIterator = container->begin();
287 for (; driftCircleIterator != container->end(); ++driftCircleIterator) {
290 const Trk::Surface &dc_surface=(*driftCircleIterator)->detectorElement()->surface((*driftCircleIterator)->identify());
293 std::optional<Amg::Vector2D> lpos=dc_surface.
globalToLocal((*parameterIter)->position());
300 double dist_locz=std::abs(lpos->y());
313 circ=(*driftCircleIterator);
321 if (lastz<-9999) lastz=(**parameterIter).position().z();
322 if (std::abs(lastz-(**parameterIter).position().z())>500.)
return;
323 lastz=(**parameterIter).position().z();
351 std::vector<const Trk::MeasurementBase*>&
362 std::vector<Identifier> vecID;
363 std::vector<const Trk::TrackParameters*> vecTP;
367 std::vector<const Trk::TrackParameters* >* tpars_down=
nullptr;
368 std::vector<const Trk::TrackParameters* >* tpars_up=
nullptr;
379 InDet::TRT_DriftCircleContainer::const_iterator
382 if ((**w).empty())
continue;
383 const Trk::Surface &surf=(**(**w).begin()).detectorElement()->surface();
396 vecTP.push_back(newpar);
398 tpars_down=
new std::vector<const Trk::TrackParameters* >;
399 tpars_up=
new std::vector<const Trk::TrackParameters* >;
401 if(!tpars_down || !tpars_up)
return event_data.
m_measurement;
404 std::sort(vecTP.begin(),vecTP.end(),
sorter);
405 for (
const auto *tmppar : vecTP){
406 if ((per->parameters()[
Trk::theta]>
M_PI/2 && per->position().z()<tmppar->position().z()) || (per->parameters()[
Trk::theta]<
M_PI/2 && per->position().z()>tmppar->position().z())) tpars_up->push_back(tmppar);
407 else tpars_down->push_back(tmppar);
410 if (!tpars_up->empty())
std::reverse(tpars_up->begin(),tpars_up->end());
422 std::vector< const Trk::TrackParameters* >::const_iterator parameterIter= tpars_up->begin();
423 for ( ; parameterIter != tpars_up->end(); ++parameterIter) {
424 delete *parameterIter;
430 std::vector< const Trk::TrackParameters* >::const_iterator parameterIter = tpars_down->begin();
431 for ( ; parameterIter != tpars_down->end(); ++parameterIter) {
432 delete *parameterIter;
462 const EventContext& ctx = Gaudi::Hive::currentContext();
494 double sinTheta =
std::sin(per->parameters()[3]);
495 double r= (std::abs(per->parameters()[
Trk::qOverP]) > 1
e-10) ? -sinTheta/(per->parameters()[
Trk::qOverP]*0.6) : 1e6;
496 double xc=per->position().x()-
r*
std::sin(per->parameters()[2]);
497 double yc=per->position().y()+
r*
std::cos(per->parameters()[2]);
498 double phi0=std::atan2(per->position().y()-yc,per->position().x()-xc);
500 double z0=per->position().z();
502 if (std::abs(surf->
normal().z())>0.5){
520 double discr=
b*
b-4*
a*
c;
522 double u1=(-
b-std::sqrt(discr))/(2*
a);
523 double u2=(-
b+std::sqrt(discr))/(2*
a);
524 double u=(std::abs(u1)<std::abs(u2)) ? u1 : u2;
527 double phi=std::atan2(
y-yc,
x-xc);
def retrieve(aClass, aKey=None)
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
const_pointer_type cptr()
Dereference the pointer.
const Amg::Vector3D & position() const
Access method for the position.
Eigen::Matrix< double, 2, 1 > Vector2D
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
return the detector element corresponding to this PRD
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
tp_sort_cosmics(double theta)
ParametersT< TrackParametersDim, Charged, DiscSurface > AtaDisc
bool is_trt(Identifier id) const
const std::string & key() const
Return the StoreGate ID for the referenced object.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
@ u
Enums for curvilinear frames.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
int layer_or_wheel(const Identifier &id) const
const_reverse_iterator rbegin() const noexcept
Return a const_reverse_iterator pointing past the end of the collection.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Identifier identify() const
return the identifier
bool operator()(const Trk::TrackParameters *par1, const Trk::TrackParameters *par2) const
const Perigee * perigeeParameters() const
return Perigee.
Trk::PrepRawDataCollection< TRT_DriftCircle > TRT_DriftCircleCollection
virtual bool insideBounds(const Amg::Vector2D &locpos, double tol1=0., double tol2=0.) const =0
virtual methods to be overwritten by the inherited surfaces
Eigen::Matrix< double, 3, 1 > Vector3D
int phi_module(const Identifier &id) const
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const =0
Specified by each surface type: GlobalToLocal method without dynamic memory allocation - boolean chec...
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
def delta_phi(phi1, phi2)
ParametersT< TrackParametersDim, Charged, PlaneSurface > AtaPlane
Eigen::Translation< double, 3 > Translation3D
std::array< std::vector< std::vector< Used_t > >, 3 > TRT_DetElemUsedMap
SiSpacePointsSeedMakerEventData EventData
static EventData & getPrivateEventData(InDet::ITRT_TrackExtensionTool::IEventData &virt_event_data)
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
virtual const Trk::Surface & surface() const override final
Element Surface: access to the Surface (straw layer)
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw: