|
ATLAS Offline Software
|
#include <MuPatHitTool.h>
|
| MuPatHitTool (const std::string &, const std::string &, const IInterface *) |
| default AlgTool constructor More...
|
|
| ~MuPatHitTool () |
| destructor More...
|
|
StatusCode | initialize () override |
| initialize method, method taken from bass-class AlgTool More...
|
|
bool | create (const EventContext &ctx, const MuonSegment &seg, MuPatHitList &hitList) const |
| create a MCTBList from a MuonSegment More...
|
|
bool | create (const Trk::Track &track, MuPatHitList &hitList) const |
| create a MuPatHitList from a Track More...
|
|
bool | create (const EventContext &ctx, const Trk::TrackParameters &pars, const std::vector< const Trk::MeasurementBase * > &measVec, MuPatHitList &hitList) const |
| create a MuPatHitList from a Track More...
|
|
std::string | print (const MuPatHitList &hitList, bool printPos=true, bool printDir=true, bool printMom=true) const |
| print the list of hits, with optional parts of the printout (position,direction,momentum) More...
|
|
bool | remove (const Trk::MeasurementBase &meas, MuPatHitList &hitList) const |
| remove hit containing give measurement (uses pointer comparison) More...
|
|
bool | update (const Trk::Track &track, MuPatHitList &hitList) const |
| update hit list for a give track More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Definition at line 27 of file MuPatHitTool.h.
◆ StoreGateSvc_t
◆ MuPatHitTool()
Muon::MuPatHitTool::MuPatHitTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
default AlgTool constructor
Definition at line 26 of file MuPatHitTool.cxx.
27 declareInterface<MuPatHitTool>(
this);
◆ ~MuPatHitTool()
Muon::MuPatHitTool::~MuPatHitTool |
( |
| ) |
|
|
default |
◆ calculateResiduals()
calculate the residuals
Definition at line 397 of file MuPatHitTool.cxx.
399 std::optional<Trk::ResidualPull> resPull(
402 residual = resPull->residual().front();
403 residualPull = resPull->pull().front();
◆ create() [1/3]
create a MCTBList from a MuonSegment
- Parameters
-
- Returns
- true if creation succeded
Definition at line 44 of file MuPatHitTool.cxx.
55 return create(ctx, *
pars, seg.containedMeasurements(), hitList);
◆ create() [2/3]
create a MuPatHitList from a Track
- Parameters
-
pars | the input parameters |
measVec | the list of measurements |
hitList | the list to be filled |
- Returns
- true if creation succeded
Definition at line 58 of file MuPatHitTool.cxx.
78 std::unique_ptr<const Trk::TrackParameters> exPars;
80 exPars =
pars.uniqueClone();
81 ATH_MSG_VERBOSE(
" start parameters and measurement expressed at same surface, cloning parameters ");
84 if (!exPars) {
continue; }
89 std::unique_ptr<MuPatHit> hit = std::make_unique<MuPatHit>(std::move(exPars), meas->uniqueClone(), std::move(broadMeas), hitInfo);
90 hitList.push_back(std::move(hit));
93 const SortByDirectionMuPatHits isLargerCal{
pars};
◆ create() [3/3]
create a MuPatHitList from a Track
- Parameters
-
track | the input track |
hitList | the list to be filled |
- Returns
- true if creation succeded
Definition at line 98 of file MuPatHitTool.cxx.
133 std::unique_ptr<MuPatHit> hit = std::make_unique<MuPatHit>(
pars->uniqueClone(), meas->
uniqueClone(), std::move(broadMeas), hitInfo);
138 hitList.push_back(std::move(hit));
142 const SortByDirectionMuPatHits isLargerCal{*
pars};
◆ createBroadMeasurement()
calculate broad measurement for a give precise measurement
Definition at line 251 of file MuPatHitTool.cxx.
255 const MdtDriftCircleOnTrack* mdt =
dynamic_cast<const MdtDriftCircleOnTrack*
>(&meas);
257 ATH_MSG_WARNING(
" found hit with a MDT Identifier that is not a MdtDriftCircleOnTrack "
263 return std::unique_ptr<const Trk::MeasurementBase>(
m_mdtRotCreator->updateError(*mdt));
265 }
else if (hitInfo.type ==
MuPatHit::CSC && !hitInfo.measuresPhi) {
270 const CscClusterOnTrack* csc =
dynamic_cast<const CscClusterOnTrack*
>(&meas);
277 return std::unique_ptr<const Trk::MeasurementBase>(
278 m_cscRotCreator->createRIO_OnTrack(*csc->prepRawData(), csc->globalPosition()));
282 return meas.uniqueClone();
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extract()
merge two MuPatHitLists into a new one.
The first list will be added to the second
- Parameters
-
hitList1 | the first list |
hitList2 | the second list |
- Returns
- true if merge succeded
Definition at line 171 of file MuPatHitTool.cxx.
174 measVec.reserve(hitList.size());
179 const Trk::MeasurementBase* meas = usePreciseHits ? &hit->preciseMeasurement() : &hit->broadMeasurement();
180 measVec.push_back(meas);
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ getHitInfo()
get hit info
Definition at line 233 of file MuPatHitTool.cxx.
234 MuPatHit::Info hitInfo{};
237 hitInfo.measuresPhi =
true;
240 if (hitInfo.id.is_valid() &&
m_idHelperSvc->isMuon(hitInfo.id)) {
242 hitInfo.measuresPhi =
m_idHelperSvc->measuresPhi(hitInfo.id);
◆ getHitType()
◆ initialize()
StatusCode Muon::MuPatHitTool::initialize |
( |
| ) |
|
|
override |
initialize method, method taken from bass-class AlgTool
Definition at line 32 of file MuPatHitTool.cxx.
41 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& Muon::MuPatHitTool::interfaceID |
( |
| ) |
|
|
inlinestatic |
access to tool interface
Definition at line 39 of file MuPatHitTool.h.
40 static const InterfaceID IID_MuPatHitTool(
"Muon::MuPatHitTool", 1, 0);
41 return IID_MuPatHitTool;
◆ isSorted()
check whether the list is correctly sorted
Definition at line 381 of file MuPatHitTool.cxx.
385 if (itNext != it_end) ++itNext;
386 bool isLarger =
true;
388 const SortByDirectionMuPatHits isLargerCal{
pars};
389 for (; itNext != it_end; ++
it, ++itNext) {
390 isLarger = isLargerCal(*
it, *itNext);
391 bool sameSurface = (isLarger == isLargerCal(*
it, *itNext));
392 if (!isLarger && !sameSurface)
return false;
393 if (sameSurface)
return false;
◆ merge()
merge two MuPatHitLists into a new one
- Parameters
-
hitList1 | the first list |
hitList2 | the second list |
outList | the resulting list |
- Returns
- true if merge succeded
Loop another time to ensure that duplicate hits are removed
Definition at line 148 of file MuPatHitTool.cxx.
151 tmpList.reserve(hitList1.size() + hitList2.size());
153 if (!hitList1.empty()) {
155 const SortByDirectionMuPatHits isLargerCal{
pars};
156 std::merge(hitList1.begin(), hitList1.end(), hitList2.begin(), hitList2.end(),
157 std::back_inserter(tmpList), isLargerCal);
162 outList.reserve(tmpList.size());
163 std::set<Identifier> used_hits{};
165 std::copy_if(std::make_move_iterator(tmpList.begin()), std::make_move_iterator(tmpList.end()), std::back_inserter(
outList),
166 [&used_hits](
const MuPatHitPtr& pathit) { return used_hits.insert(pathit->info().id).second; });
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ print()
std::string Muon::MuPatHitTool::print |
( |
const MuPatHitList & |
hitList, |
|
|
bool |
printPos = true , |
|
|
bool |
printDir = true , |
|
|
bool |
printMom = true |
|
) |
| const |
print the list of hits, with optional parts of the printout (position,direction,momentum)
Definition at line 314 of file MuPatHitTool.cxx.
315 std::ostringstream sout;
316 DistanceAlongParameters distCal{};
319 std::vector<std::string> idStrings;
320 std::vector<std::string> dataStrings;
321 idStrings.reserve(hitList.size());
322 unsigned int idWidth = 0;
323 std::string
result =
"first ";
324 bool isLarger =
true;
331 const SortByDirectionMuPatHits isLargerCal{
pars};
333 if (itNext != it_end) ++itNext;
334 for (;
it != it_end; ++
it, ++itNext) {
337 std::string idStr =
id.is_valid() ?
m_idHelperSvc->toString(
id) :
"pseudo-measurement";
338 idStrings.push_back(idStr);
339 if (idStr.length() > idWidth) idWidth = idStr.length();
341 std::ostringstream dataOss;
343 dataOss <<
"r " << std::fixed << std::setprecision(0) << std::setw(5) <<
pars.position().perp() <<
" z " << std::fixed
344 << std::setprecision(0) << std::setw(6) <<
pars.position().z();
347 dataOss <<
" theta " << std::fixed << std::setprecision(5) << std::setw(7) <<
pars.momentum().theta() <<
" phi "
348 << std::fixed << std::setprecision(3) << std::setw(6) <<
pars.momentum().phi();
351 dataOss <<
" q*p(GeV) " << std::scientific << std::setprecision(3) << std::setw(10)
352 <<
pars.momentum().mag() *
pars.charge() / 1000.;
357 dataStrings.push_back(dataOss.str());
358 if (itNext != it_end) {
359 isLarger = isLargerCal(*
it, *itNext);
362 result = isLarger ?
"larger " :
"smaller";
364 if (isLarger == isLargerCal(*itNext, *
it)) {
366 }
else if (!isLarger) {
367 result +=
" sorting problem ";
373 unsigned int n = idStrings.size();
374 for (
unsigned int i = 0;
i <
n; ++
i) {
375 sout <<
" " << std::left << std::setw(idWidth) << idStrings[
i] << std::right <<
" " << dataStrings[
i];
376 if (
i !=
n - 1) sout << std::endl;
◆ remove() [1/2]
remove hit with a give Identifier
Definition at line 185 of file MuPatHitTool.cxx.
187 MuPatHitIt lit = hitList.begin(), lit_end = hitList.end();
188 for (; lit != lit_end; ++lit) {
189 const MuPatHit& hit = **lit;
190 if (hit.info().id ==
id) {
◆ remove() [2/2]
remove hit containing give measurement (uses pointer comparison)
Definition at line 199 of file MuPatHitTool.cxx.
202 MuPatHitIt lit = hitList.begin(), lit_end = hitList.end();
203 for (; lit != lit_end; ++lit) {
204 const MuPatHit& hit = **lit;
205 if (
m_edmHelperSvc->getIdentifier(hit.preciseMeasurement()) == meas_id ||
206 m_edmHelperSvc->getIdentifier(hit.broadMeasurement()) == meas_id) {
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ update()
update hit list for a give track
Definition at line 285 of file MuPatHitTool.cxx.
287 if (!measurements)
return false;
289 std::set<Identifier>
ids;
293 for (; mit != mit_end; ++mit) {
295 if (!
id.is_valid())
continue;
303 MuPatHitIt lit = hitList.begin(), lit_end = hitList.end();
304 for (; lit != lit_end; ++lit) {
305 MuPatHit& hit = **lit;
306 if (!
ids.count(hit.info().id)) {
◆ updateVHKA()
◆ m_cscRotCreator
Initial value:{
this,
"CscRotCreator",
"Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator",
}
Definition at line 123 of file MuPatHitTool.h.
◆ m_detStore
◆ m_edmHelperSvc
Initial value:{
this,
"edmHelper",
"Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface",
}
Definition at line 145 of file MuPatHitTool.h.
◆ m_evtStore
◆ m_idHelperSvc
Initial value:{
this,
"MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
}
Definition at line 140 of file MuPatHitTool.h.
◆ m_isCosmic
Gaudi::Property<bool> Muon::MuPatHitTool::m_isCosmic |
|
private |
Initial value:{this, "isCosmic", false,
"Toggle whether the job runs on cosmic data. That influences the hit sorting on track"}
Definition at line 154 of file MuPatHitTool.h.
◆ m_magFieldProperties
◆ m_mdtRotCreator
Initial value:{
this,
"MdtRotCreator",
"Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator",
}
Definition at line 118 of file MuPatHitTool.h.
◆ m_printer
Initial value:{
this,
"Printer",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
}
Definition at line 134 of file MuPatHitTool.h.
◆ m_propagator
Initial value:{
this,
"AtlasRungeKuttaPropagator",
"Trk::RungeKuttaPropagator/AtlasRungeKuttaPropagator",
}
Definition at line 113 of file MuPatHitTool.h.
◆ m_pullCalculator
Initial value:{
this,
"ResidualPullCalculator",
"Trk::ResidualPullCalculator/ResidualPullCalculator",
}
Definition at line 129 of file MuPatHitTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
@ Unbiased
RP with track state that has measurement not included.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
#define ATH_MSG_VERBOSE(x)
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
virtual void setOwner(IDataHandleHolder *o)=0
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ Hole
A hole on the track - this is defined in the following way.
MuPatHitList::const_iterator MuPatHitCit
std::unique_ptr< MeasurementBase > uniqueClone() const
NVI Clone giving up unique pointer.
Out copy_if(In first, const In &last, Out res, const Pred &p)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::shared_ptr< MuPatHit > MuPatHitPtr
virtual void renounce()=0
MuPatHitList::iterator MuPatHitIt
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
represents the track state (measurement, material, fit parameters and quality) at a surface.
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
double charge(const T &p)
std::vector< MuPatHitPtr > MuPatHitList
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
#define ATH_MSG_WARNING(x)
def merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.