Loading [MathJax]/jax/output/SVG/config.js
 |
ATLAS Offline Software
|
#include <TrkMaterialProviderTool.h>
|
| TrkMaterialProviderTool (const std::string &, const std::string &, const IInterface *) |
| AlgTool like constructor. More...
|
|
virtual | ~TrkMaterialProviderTool ()=default |
| Virtual destructor. More...
|
|
StatusCode | initialize () |
| AlgTool initailize method. More...
|
|
StatusCode | finalize () |
| AlgTool finalize method. More...
|
|
void | updateCaloTSOS (const Trk::Track &idTrack, Trk::Track &extrapolatedTrack) const |
| Update Calorimeter TSOS from input ID and MS tracks. More...
|
|
void | updateCaloTSOS (Trk::Track &track, const Trk::TrackParameters *startParamaters=nullptr) const |
| Update Calorimeter TSOS from input MS/CB track. More...
|
|
void | getCaloMEOT (const Trk::Track &idTrack, const Trk::Track &msTrack, std::vector< MaterialEffectsOnTrack > &calomeots) const |
| Get Calorimeter MEOT. More...
|
|
std::vector< const Trk::TrackStateOnSurface * > * | getCaloTSOS (const Trk::TrackParameters &parm, const Trk::Track &muonTrack, const Trk::TrackParameters *parms=nullptr) const |
| Retrieve Calorimeter TSOS from TG and apply corrections. More...
|
|
CaloEnergy * | getParamCaloELoss (Trk::Track *track) const |
| Retrieve a clone of the parametrised energy loss. 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 |
|
|
Trk::TrackStates * | getCaloTSOS (const Trk::TrackParameters &parm, const Trk::Track &muonTrack, const Trk::Surface &surf, Trk::PropDirection dir, Trk::ParticleHypothesis mateffects, double &Eloss, double &X0ScaleMS, double &ElossScaleMS, const Trk::TrackParameters *parms=nullptr, bool boundaryCheck=false, bool removeOoC=false) const |
| Internal method to retrieve Calorimeter TSOS from TG and apply corrections. More...
|
|
const Trk::TrackStateOnSurface * | getCaloExitTSOS (const std::vector< const Trk::TrackStateOnSurface * > *caloTSOS, Trk::PropDirection dir) const |
| Helper to get last calo TSOS with TP. More...
|
|
const Trk::TrackStateOnSurface * | getCaloEntryTSOS (const std::vector< const Trk::TrackStateOnSurface * > *caloTSOS, Trk::PropDirection dir) const |
| Helper to get first calo TSOS with TP. More...
|
|
void | removeOutOfCalo (std::vector< const Trk::TrackStateOnSurface * > *caloTSOS) const |
| Helper to remove MS and ID TSOS. More...
|
|
void | removeMS (std::vector< const Trk::TrackStateOnSurface * > *caloTSOS) const |
| Helper to remove only MS TSOS. More...
|
|
void | updateVectorMS (Trk::TrackStates *inputTSOS, const Trk::TrackStates::iterator &firstMS, double X0ScaleMS, double ElossScaleMS) const |
| update the TSOS vector for the Muon Spectrometer applying X0 and Eloss scaling More...
|
|
unsigned int | getVolumeByGeo (const Trk::TrackStateOnSurface *m) const |
|
void | printTSOS (const Trk::TrackStateOnSurface *m, const std::string &tag) const |
|
Trk::TrackStates * | modifyTSOSvector (const std::vector< const Trk::TrackStateOnSurface * > *matvec, double scaleX0, double scaleEloss, bool reposition, bool aggregate, bool updateEloss, double caloEnergy, double caloEnergyError, double fsrCaloEnergy, double pCaloEntry, double momentumError, double &Eloss_tot, bool useMeasuredEnergy=true, double mopEloss=0., double meanElossIoni=0., double sigmaElossIoni=0.) const |
| Function to modify TSOS doing repositioning, aggregation and corrections. More...
|
|
void | getMopAndIoniEnergyLoss (const std::vector< const Trk::TrackStateOnSurface * > *matvec, double pCaloEntry, double scaleEloss, double &mopEloss, double &meanElossIoni, double &sigmaElossIoni) const |
| Function to get mop and mean (ionization) energy loss. More...
|
|
bool | isIsolatedTrack (double eta, double phi) const |
| Function to check isolation. More...
|
|
double | getCaloMeasuredEnergy (double eta, double phi, double mopEloss, double meanElossIoni, double &fsrCaloEnergy) const |
| Function to get calorimeter measured energy loss. More...
|
|
double | getFinalMeasuredEnergy (Rec::CaloMeas *caloMeas, double mopEloss, double meanElossIoni, double eta, double &fsrCaloEnergy) const |
| Function to get corrected (final) calorimeter measured energy loss. More...
|
|
void | throwFailedToGetTrackingGeomtry () const |
|
const TrackingGeometry * | retrieveTrackingGeometry (const EventContext &ctx) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
PublicToolHandle< Trk::IExtrapolator > | m_muonExtrapolator {this,"Extrapolator","Trk::Extrapolator/AtlasExtrapolator",""} |
|
PublicToolHandle< Trk::IEnergyLossUpdator > | m_elossupdator {this,"EnergyLossUpdator","Trk::EnergyLossUpdator/AtlasEnergyLossUpdator",""} |
|
ServiceHandle< Trk::ITrackingVolumesSvc > | m_trackingVolumesSvc {this, "TrackingVolumeSvc", "TrackingVolumesSvc/TrackingVolumesSvc"} |
|
ServiceHandle< ITrackingGeometrySvc > | m_trackingGeometrySvc {this, "TrackingGeometrySvc", "", ""} |
|
SG::ReadCondHandleKey< TrackingGeometry > | m_trackingGeometryReadKey {this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."} |
|
ToolHandle< Trk::IMultipleScatteringUpdator > | m_scattool |
|
ToolHandle< Rec::IMuidCaloEnergyMeas > | m_caloMeasTool {this, "CaloMeasTool", "Rec::MuidCaloEnergyMeas/MuidCaloEnergyMeas"} |
|
ToolHandle< Rec::IMuidCaloEnergyParam > | m_caloParamTool {this, "CaloParamTool", "Rec::MuidCaloEnergyParam/MuidCaloEnergyParam"} |
|
ToolHandle< Rec::IMuidTrackIsolation > | m_trackIsolationTool {this, "TrackIsolationTool", "Rec::MuidTrackIsolation/MuidTrackIsolation"} |
|
ToolHandle< Rec::IMuonCaloEnergyTool > | m_muonCaloEnergyTool |
|
const AtlasDetectorID * | m_DetID |
|
std::unique_ptr< Trk::Volume > | m_calorimeterVolume |
|
std::unique_ptr< Trk::Volume > | m_indetVolume |
|
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > | m_fieldCacheCondObjInputKey |
|
bool | m_applyTGScaling |
|
bool | m_repositionTSOS |
|
bool | m_aggregateTSOS |
|
bool | m_updateTSOS |
|
int | m_maxNTracksIso |
|
double | m_paramPtCut |
|
bool | m_useCaloEnergyMeasurement |
|
bool | m_useMuonCaloEnergyTool |
|
bool | m_overwriteElossParam |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 55 of file TrkMaterialProviderTool.h.
◆ StoreGateSvc_t
◆ TrkMaterialProviderTool()
TrkMaterialProviderTool::TrkMaterialProviderTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TrkMaterialProviderTool()
virtual Trk::TrkMaterialProviderTool::~TrkMaterialProviderTool |
( |
| ) |
|
|
virtualdefault |
◆ 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]
◆ deleteTSOS() [1/2]
Definition at line 1233 of file TrkMaterialProviderTool.cxx.
1235 std::vector<const Trk::TrackStateOnSurface*>::const_iterator
it = vecTSOS->begin();
1236 std::vector<const Trk::TrackStateOnSurface*>::const_iterator itEnd = vecTSOS->end();
1237 for (;
it != itEnd; ++
it)
delete *
it;
◆ deleteTSOS() [2/2]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ 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
◆ finalize()
StatusCode TrkMaterialProviderTool::finalize |
( |
| ) |
|
◆ getCaloEntryTSOS()
Helper to get first calo TSOS with TP.
Definition at line 979 of file TrkMaterialProviderTool.cxx.
983 std::vector<const Trk::TrackStateOnSurface*>::const_iterator
it = caloTSOS->begin();
984 std::vector<const Trk::TrackStateOnSurface*>::const_iterator itEnd = caloTSOS->end();
985 for(;
it!=itEnd; ++
it) {
986 if((*it)->trackParameters()) {
987 ATH_MSG_DEBUG(
"Parameters at CALO entry found : "<< *((*it)->trackParameters()));
988 tsosAtCaloEntry = *
it;
989 return tsosAtCaloEntry;
993 std::vector<const Trk::TrackStateOnSurface*>::const_reverse_iterator
it = caloTSOS->rbegin();
994 std::vector<const Trk::TrackStateOnSurface*>::const_reverse_iterator itEnd = caloTSOS->rend();
995 for(;
it!=itEnd; ++
it) {
996 if((*it)->trackParameters()) {
997 ATH_MSG_DEBUG(
"Parameters at CALO entry found : "<< *((*it)->trackParameters()));
998 tsosAtCaloEntry = *
it;
999 return tsosAtCaloEntry;
1003 return tsosAtCaloEntry;
◆ getCaloExitTSOS()
Helper to get last calo TSOS with TP.
Definition at line 950 of file TrkMaterialProviderTool.cxx.
954 std::vector<const Trk::TrackStateOnSurface*>::const_reverse_iterator
it = caloTSOS->rbegin();
955 std::vector<const Trk::TrackStateOnSurface*>::const_reverse_iterator itEnd = caloTSOS->rend();
956 for(;
it!=itEnd; ++
it) {
957 if((*it)->trackParameters()) {
958 ATH_MSG_DEBUG(
"Parameters at CALO exit found : "<< *((*it)->trackParameters()));
959 tsosAtCaloExit = *
it;
960 return tsosAtCaloExit;
964 std::vector<const Trk::TrackStateOnSurface*>::const_iterator
it = caloTSOS->begin();
965 std::vector<const Trk::TrackStateOnSurface*>::const_iterator itEnd = caloTSOS->end();
966 for(;
it!=itEnd; ++
it) {
967 if((*it)->trackParameters()) {
968 ATH_MSG_DEBUG(
"Parameters at CALO exit found : "<< *((*it)->trackParameters()));
969 tsosAtCaloExit = *
it;
970 return tsosAtCaloExit;
974 return tsosAtCaloExit;
◆ getCaloMeasuredEnergy()
double TrkMaterialProviderTool::getCaloMeasuredEnergy |
( |
double |
eta, |
|
|
double |
phi, |
|
|
double |
mopEloss, |
|
|
double |
meanElossIoni, |
|
|
double & |
fsrCaloEnergy |
|
) |
| const |
|
private |
Function to get calorimeter measured energy loss.
Definition at line 1947 of file TrkMaterialProviderTool.cxx.
1953 std::unique_ptr<Rec::CaloMeas> caloMeas =
m_caloMeasTool->energyMeasurement(Gaudi::Hive::currentContext(),eta,
phi,eta,
phi);
1957 double FinalMeasuredEnergy =
getFinalMeasuredEnergy(caloMeas.get(), totalEloss, meanElossIoni, eta, fsrCaloEnergy);
1959 return FinalMeasuredEnergy;
◆ getCaloMEOT()
Get Calorimeter MEOT.
Implements Trk::ITrkMaterialProviderTool.
Definition at line 365 of file TrkMaterialProviderTool.cxx.
368 ATH_MSG_VERBOSE(
"getCaloMEOT(const Trk::Track& idTrack, const Trk::Track& msTrack, std::vector<MaterialEffectsOnTrack>& calomeots)");
374 for(
auto m : *inputTSOS_ID)
printTSOS(
m,
"TSOS ID TRACK");
375 for(
auto m : *inputTSOS_MS)
printTSOS(
m,
"TSOS MS TRACK");
380 for (
auto it = inputTSOS_ID->rbegin();
it != inputTSOS_ID->rend(); ++
it) {
387 if(lastIDwP == inputTSOS_ID->rend()) {
397 for(
auto it = inputTSOS_MS->begin();
it!=itEnd ; ++
it) {
401 if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
408 if(firstMS == inputTSOS_MS->end()) {
417 firstMSnotPerigee=firstMS+1;
422 printTSOS(*firstMSnotPerigee,
"FIRST MS");
423 if(firstMSwP != inputTSOS_MS->end())
426 ATH_MSG_WARNING(
"Unable to find first MS TSOS with Track Parameters!");
431 const EventContext& ctx = Gaudi::Hive::currentContext();
435 if (fieldCondObj ==
nullptr) {
439 fieldCondObj->getInitializedCache (fieldCache);
442 double X0ScaleMS = 0.;
443 double ElossScaleMS = 0.;
447 fieldCache.
toroidOn() ? msTrack : idTrack,
448 (*firstMSnotPerigee)->surface(),
451 Eloss, X0ScaleMS, ElossScaleMS,
452 (firstMSwP == inputTSOS_MS->end()) ?
nullptr : (*firstMSwP)->trackParameters(),
456 if (!caloTSOS || caloTSOS->
size() != 3)
461 if ((!fieldCache.
toroidOn() && idqOverP * 4000. < 1) || (fieldCache.
toroidOn() && msqOverP != 1 / 100000. && msqOverP != 0))
465 ATH_MSG_WARNING(
" Toroid off q*momentum of ID track " << 1. / idqOverP);
467 ATH_MSG_WARNING(
" Toroid on q*momentum of MS track " << 1. / msqOverP);
468 ATH_MSG_WARNING(
"Unable to retrieve Calorimeter TSOS from extrapolateM+aggregation (null or !=3)");
470 ATH_MSG_WARNING(
" Zero Calorimeter TSOS from extrapolateM+aggregation");
472 ATH_MSG_WARNING(
" nr Calorimeter TSOS from extrapolateM+aggregation not equal to 3 " << caloTSOS->
size());
481 for (
auto &&
i : *caloTSOS){
484 throw std::logic_error(
"TrackStateOnSurface without material effects on track." );
487 double qoverp=
i->trackParameters()->parameters()[
Trk::qOverP];
491 std::unique_ptr<Trk::EnergyLoss> neweloss=
nullptr;
492 std::optional<Trk::ScatteringAngles> newsa= std::nullopt;
493 if (eloss) neweloss = std::make_unique<CaloEnergy>(*eloss);
496 double sigmascat = std::abs(qoverp)>0.0 ? std::sqrt(
m_scattool->sigmaSquare(matprop,std::abs(1./qoverp),1.,
Trk::muon)) : 0.0;
503 i->trackParameters()->associatedSurface());
504 calomeots.push_back(newmeot);
◆ getCaloTSOS() [1/2]
Trk::TrackStates * TrkMaterialProviderTool::getCaloTSOS |
( |
const Trk::TrackParameters & |
parm, |
|
|
const Trk::Track & |
muonTrack, |
|
|
const Trk::Surface & |
surf, |
|
|
Trk::PropDirection |
dir, |
|
|
Trk::ParticleHypothesis |
mateffects, |
|
|
double & |
Eloss, |
|
|
double & |
X0ScaleMS, |
|
|
double & |
ElossScaleMS, |
|
|
const Trk::TrackParameters * |
parms = nullptr , |
|
|
bool |
boundaryCheck = false , |
|
|
bool |
removeOoC = false |
|
) |
| const |
|
private |
Internal method to retrieve Calorimeter TSOS from TG and apply corrections.
Definition at line 662 of file TrkMaterialProviderTool.cxx.
674 const EventContext& ctx = Gaudi::Hive::currentContext();
675 bool fremoveMS =
false;
676 if(!removeOoC) fremoveMS =
true;
678 ATH_MSG_DEBUG(
"Retrieving Calorimeter TSOS from extrapolateM (dir=" <<
dir <<
") with starting parameters : "
679 << parm <<
" to surface "<<surf);
680 if(parms)
ATH_MSG_DEBUG(
"Parameters in MS provided : "<< *parms);
682 double pOri = parm.
momentum().mag();
685 std::vector<const Trk::TrackStateOnSurface*>* caloTSOS =
m_muonExtrapolator->extrapolateM(ctx,
691 ATH_MSG_DEBUG(
"Retrieved " << caloTSOS->size() <<
" Calorimeter TSOS from extrapolateM, no-removal");
694 ATH_MSG_DEBUG(
"Retrieved " << caloTSOS->size() <<
" Calorimeter TSOS from extrapolateM, no-removal");
695 for(
auto m : *caloTSOS) this->
printTSOS(
m,
"BEFORE-REMOVAL CALO TSOS");
701 double ElossCalo = 0.;
703 for(
const auto *
m : *caloTSOS) {
704 if(
m->materialEffectsOnTrack()) {
711 Eloss += std::abs(energyLoss->
deltaE());
720 ATH_MSG_DEBUG(
"Total Eloss on TSOS from extrapolateM " << Eloss <<
" ElossID " << ElossID <<
" ElossMS " << ElossMS <<
" Elosscalo " << ElossCalo);
721 if(fremoveMS)
ATH_MSG_DEBUG(
" ID Eloss will be added to Calo Eloss " << ElossID+ElossCalo);
727 ATH_MSG_DEBUG(
"Retrieved " << caloTSOS->size() <<
" Calorimeter TSOS from extrapolateM");
729 if(fremoveMS && !caloTSOS->empty())
removeMS(caloTSOS);
730 ATH_MSG_DEBUG(
"Retrieved " << caloTSOS->size() <<
" Calorimeter TSOS from extrapolateM");
733 for(
auto m : *caloTSOS) this->
printTSOS(
m,
"ORIGINAL CALO TSOS");
738 if(caloTSOS->empty() || Eloss<=0) {
740 ATH_MSG_WARNING(
"Unable to retrieve Calorimeter TSOS from extrapolateM caloTSOS->size() "<< caloTSOS->size() <<
" Eloss " << Eloss );
747 return finalCaloTSOS;
751 double X0ScaleCALO=1.0;
752 double ElossScaleCALO=1.0;
757 if(!tsosAtCaloExit) {
758 ATH_MSG_WARNING(
name() <<
" Unable to find Calorimeter Exit TSOS with TrackParameters! No TG Scaling applied!" );
763 X0ScaleCALO, ElossScaleCALO);
767 X0ScaleMS, ElossScaleMS);
770 ATH_MSG_DEBUG(
"Eloss/X0 scaling corrections set to : " << ElossScaleCALO <<
" " << X0ScaleCALO);
774 double pAtCaloEntry = 0;
776 double OneOverP = std::abs(parm.parameters()[
Trk::qOverP]);
778 pAtCaloEntry = 1./OneOverP;
780 pAtCaloEntry = parm.
momentum().norm();
783 if(!tsosAtCaloEntry) {
784 ATH_MSG_WARNING(
name() <<
" Unable to find Calorimeter Entry TSOS with TrackParameters! Momentum at Calo Entry not available!" );
788 pAtCaloEntry = 1./OneOverP;
798 if(!tsosAtCaloExit) {
799 ATH_MSG_DEBUG(
"Unable to find Calorimeter Exit TSOS with TrackParameters! Momentum at MS not available!" );
802 ATH_MSG_DEBUG(
"MS track parameters taken from calorimeter TSOS");
807 double pAtMuonEntryError = 0.0;
809 if( std::abs(parms->parameters()[
Trk::qOverP]) > 0.0 ) {
810 double pAtMuonEntry = std::abs(1./parms->parameters()[
Trk::qOverP]);
811 if (!parms->covariance() ||
814 "MS track parameters without covariance, using 10% relative error!");
815 pAtMuonEntryError = pAtMuonEntry*0.1;
818 pAtMuonEntryError = pAtMuonEntry*pAtMuonEntry*qOverpAtMuonEntryError;
823 ATH_MSG_DEBUG(
"Momentum Error at MS Entry : " << pAtMuonEntryError);
826 double measCaloEnergy = 0.0;
827 double measCaloEnergyError = 0.0;
828 double fsrCaloEnergy = 0.0;
831 double totalEloss=0.0;
832 double meanElossIoni=0.0;
833 double sigmaElossIoni=0.0;
845 double E_em_meas = 0.;
846 double E_em_exp = 0.;
847 double E_tile_meas = 0.;
848 double E_tile_exp = 0.;
849 double E_HEC_meas = 0.;
850 double E_HEC_exp = 0.;
851 double E_dead_exp = 0.;
860 totalEloss, meanElossIoni, 0.45*sigmaElossIoni,
861 measCaloEnergy, measCaloEnergyError, fsrCaloEnergy, e_exp,
862 E_em_meas,E_em_exp,E_tile_meas,E_tile_exp,E_HEC_meas,E_HEC_exp,E_dead_exp);
865 ATH_MSG_DEBUG(
" eta " << eta <<
" Energy measurement from calorimeter: inputs totalEloss, meanElossIoni, sigmaElossIoni "
866 << totalEloss <<
" " << meanElossIoni <<
" " << sigmaElossIoni <<
" e_exp Ioni from TG " << e_exp <<
" e_exp original " << e_exp*totalEloss/(meanElossIoni+0.001));
878 ATH_MSG_DEBUG(
"Final measured energy in calorimeter : " << measCaloEnergy <<
" +- " << measCaloEnergyError <<
" MeV"
879 <<
" momentum fraction " << measCaloEnergy/pAtCaloEntry);
888 double Eloss_tot=0.0;
895 measCaloEnergy, measCaloEnergyError, fsrCaloEnergy,
896 pAtCaloEntry, pAtMuonEntryError,
897 Eloss_tot, useMeasuredEnergy,
898 totalEloss, meanElossIoni, sigmaElossIoni);
900 ATH_MSG_DEBUG(
" after modifyTSOSvector X0ScaleCALO " << X0ScaleCALO <<
" ElossScaleCALO " << ElossScaleCALO <<
901 " pAtCaloEntry " << pAtCaloEntry <<
" pAtMuonEntryError " << pAtMuonEntryError <<
" total Eloss from TG through MuonEnergyTool " << Eloss_tot );
902 ATH_MSG_DEBUG(
"Aggregating and correcting TSOS down to : " << finalCaloTSOS->
size() <<
" with total Eloss " << Eloss_tot);
906 for(
auto m : *finalCaloTSOS) this->
printTSOS(
m,
"FINAL CALO TSOS");
912 return finalCaloTSOS;
◆ getCaloTSOS() [2/2]
Retrieve Calorimeter TSOS from TG and apply corrections.
Implements Trk::ITrkMaterialProviderTool.
Definition at line 514 of file TrkMaterialProviderTool.cxx.
517 std::vector<const Trk::TrackStateOnSurface*>* caloTSOS =
new std::vector<const Trk::TrackStateOnSurface*>();
520 const EventContext& ctx = Gaudi::Hive::currentContext();
523 if(!trackingGeometry) {
532 targetVolume = trackingGeometry->
trackingVolume(
"MuonSpectrometerEntrance");
534 ATH_MSG_WARNING(
"Unable to get target volume for calo material collection!");
537 ATH_MSG_VERBOSE(
"TP inside ID -> extrapolating TP "<<parm<<
" to MS entry volume "<<*targetVolume);
542 targetVolume = trackingGeometry->
trackingVolume(
"InDet::Containers::InnerDetector");
544 ATH_MSG_WARNING(
"Unable to get target volume for calo material collection!");
547 ATH_MSG_VERBOSE(
"TP inside MS -> extrapolating TP "<<parm<<
" to ID exit volume "<<*targetVolume);
552 targetVolume = trackingGeometry->
trackingVolume(
"InDet::Containers::InnerDetector");
554 ATH_MSG_WARNING(
"Unable to get target volume for calo material collection!");
557 ATH_MSG_DEBUG(
"TP inside CALO or between CALO and MS -> assuming ID as target : "<<*targetVolume);
568 for(;
it!=itEnd; ++
it) {
570 if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
571 parms = (*it)->trackParameters();
583 PerigeeSurface surface(globPos);
585 double X0ScaleMS = 0.;
586 double ElossScaleMS = 0.;
593 Eloss, X0ScaleMS, ElossScaleMS,
599 ATH_MSG_DEBUG(
" go to Beam Line destination surface position radius " << surface.center().perp() <<
" z " << surface.center().z());
602 for(
unsigned int i=0;
i<caloTSOSdv->
size(); ++
i)
603 caloTSOS->push_back(caloTSOSdv->
get(
i));
614 double Eloss_previous = 0.;
615 for (
auto& boundaryCandidate : boundaryIntersections){
619 if(!surfaceTV)
continue;
624 double X0ScaleMS = 0.;
625 double ElossScaleMS = 0.;
632 Eloss, X0ScaleMS, ElossScaleMS,
637 if(caloTSOSdv&&Eloss>Eloss_previous) {
643 ATH_MSG_DEBUG(
" getCaloTSOS: Previous solution had Eloss " << Eloss_previous <<
" latest " << Eloss);
647 for(
unsigned int i=0;
i<caloTSOSdv->
size(); ++
i)
648 caloTSOS->push_back(caloTSOSdv->
get(
i));
◆ getFinalMeasuredEnergy()
double TrkMaterialProviderTool::getFinalMeasuredEnergy |
( |
Rec::CaloMeas * |
caloMeas, |
|
|
double |
mopEloss, |
|
|
double |
meanElossIoni, |
|
|
double |
eta, |
|
|
double & |
fsrCaloEnergy |
|
) |
| const |
|
private |
Function to get corrected (final) calorimeter measured energy loss.
Function to get corrected calorimeter measured energy loss.
Definition at line 1963 of file TrkMaterialProviderTool.cxx.
1969 double MopLossCorrected = totalEloss;
1970 double MopLoss = totalEloss;
1982 double MaterialCorrection =
InertMaterial * MopLossCorrected;
1996 double ForwardHECCorrection = 0.;
1998 ForwardHECCorrection = (1. - LArHECMeasurementMaterial) * HECMaterial * MopLossCorrected;
2001 double TotalMeasuredEnergy = TileEnergy + EmEnergy + LArHECEnergy;
2004 <<
" LArHEC " << LArHECEnergy
2005 <<
" EM " << EmEnergy);
2007 <<
" HECMaterial " << HECMaterial
2008 <<
" MopLossCorrected " << MopLossCorrected );
2014 if (std::abs(eta)<1.4) {
2015 if (LArHECEnergy + TileEnergy > 0.1 * MopLoss * HECMaterial) bHEC=
true;
2017 else if (std::abs(eta)>1.8) {
2018 if (LArHECEnergy + TileEnergy > 0.2 * MopLoss * HECMaterial) bHEC=
true;
2020 if (LArHECEnergy + TileEnergy > 0.25 * MopLoss * HECMaterial) bHEC=
true;
2022 if (EmEnergy > 0.5 * MopLoss * EmMaterial) bEM =
true;
2024 double MeasCorrected = TotalMeasuredEnergy + MaterialCorrection;
2029 const double IonizationLoss = (1./1.4) * meanElossIoni;
2030 double eOverMipCorrectionEm = 0.;
2031 double eOverMipCorrectionHEC = 0.;
2035 const double emipEM = 0.78;
2036 eOverMipCorrectionEm = - (1./emipEM-1.) * IonizationLoss * EmMaterial * LArEmMeasurementMaterial;
2037 if (EmEnergy + eOverMipCorrectionEm<0.)eOverMipCorrectionEm=0.;
2040 const double emipTile = 0.86;
2041 const double emipLAr = 0.94;
2042 const double HECEnergy = TileEnergy + LArHECEnergy;
2043 const double eOverMipCorrectionTile = - (1./emipTile-1.) * TileEnergy / HECEnergy * IonizationLoss * HECMaterial * TileMeasurementMaterial;
2044 const double eOverMipCorrectionLAr = - (1./emipLAr-1.) * LArHECEnergy / HECEnergy * IonizationLoss * HECMaterial * LArHECMeasurementMaterial;
2045 eOverMipCorrectionHEC = eOverMipCorrectionTile + eOverMipCorrectionLAr;
2046 if (LArHECEnergy + TileEnergy + eOverMipCorrectionHEC < 0.0) eOverMipCorrectionHEC=0.;
2048 const double eOverMipCorrection = eOverMipCorrectionEm + eOverMipCorrectionHEC;
2067 double FinalMeasuredEnergy = MeasCorrected + eOverMipCorrection;
2069 return FinalMeasuredEnergy;
◆ getMopAndIoniEnergyLoss()
void TrkMaterialProviderTool::getMopAndIoniEnergyLoss |
( |
const std::vector< const Trk::TrackStateOnSurface * > * |
matvec, |
|
|
double |
pCaloEntry, |
|
|
double |
scaleEloss, |
|
|
double & |
mopEloss, |
|
|
double & |
meanElossIoni, |
|
|
double & |
sigmaElossIoni |
|
) |
| const |
|
private |
Function to get mop and mean (ionization) energy loss.
Definition at line 1860 of file TrkMaterialProviderTool.cxx.
1874 double deltaE_tot = 0.;
1875 double sigmaDeltaE_tot = 0.;
1876 double sigmaPlusDeltaE_tot = 0.;
1877 double sigmaMinusDeltaE_tot = 0.;
1878 double deltaE_ioni_tot = 0.;
1879 double sigmaDeltaE_ioni_tot=0.;
1880 double deltaE_rad_tot = 0.;
1881 double sigmaDeltaE_rad_tot =0.;
1883 for(
const auto *
m : *matvec) {
1884 if(!
m->trackParameters()) {
1888 if(
m->materialEffectsOnTrack()) {
1901 deltaE_tot += std::abs(scaleEloss*energyLoss->
deltaE());
1902 sigmaDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaDeltaE());
1903 sigmaPlusDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaPlusDeltaE());
1904 sigmaMinusDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaMinusDeltaE());
1905 deltaE_ioni_tot += std::abs(scaleEloss*energyLoss->
meanIoni());
1906 sigmaDeltaE_ioni_tot += std::abs(scaleEloss*energyLoss->
sigmaIoni());
1907 deltaE_rad_tot += std::abs(scaleEloss*energyLoss->
meanRad());
1908 sigmaDeltaE_rad_tot += std::abs(scaleEloss*energyLoss->
sigmaRad());
1910 ATH_MSG_DEBUG(
" position x " <<
m->trackParameters()->position().x() <<
" y " <<
m->trackParameters()->position().y() <<
" perp " <<
m->trackParameters()->position().perp() <<
" z " <<
m->trackParameters()->position().z() );
1911 ATH_MSG_DEBUG(
" deltaE " << (scaleEloss*energyLoss->
deltaE()) <<
" deltaE_ioni " << (scaleEloss*energyLoss->
meanIoni()) <<
" sigmaDeltaE_ioni " << (scaleEloss*energyLoss->
sigmaIoni()));
1912 ATH_MSG_DEBUG(
" deltaE_tot " << deltaE_tot <<
" deltaE_ioni_tot " << deltaE_ioni_tot <<
" sigmaDeltaE_ioni_tot " << sigmaDeltaE_ioni_tot);
1919 EnergyLoss eLoss = EnergyLoss(deltaE_tot, sigmaDeltaE_tot, sigmaMinusDeltaE_tot, sigmaPlusDeltaE_tot,
1920 deltaE_ioni_tot, sigmaDeltaE_ioni_tot,
1921 deltaE_rad_tot, sigmaDeltaE_rad_tot, 0.) ;
1925 EnergyLoss eLoss2 (
m_elossupdator->updateEnergyLoss(eLoss, 0, 0, pCaloEntry, 0, elossFlag) );
1927 totalEloss = eLoss2.meanIoni() + eLoss2.meanRad();
1928 meanElossIoni = eLoss2.meanIoni();
1929 sigmaElossIoni = eLoss2.sigmaIoni();
1931 ATH_MSG_DEBUG(
"Mop Energy Loss " << totalEloss <<
" mean ionization energy loss " << meanElossIoni <<
" sigmaElossIoni " << sigmaElossIoni);
◆ getParamCaloELoss()
◆ getVolumeByGeo()
◆ initialize()
StatusCode TrkMaterialProviderTool::initialize |
( |
| ) |
|
AlgTool initailize method.
handle to the magnetic field cache
Definition at line 66 of file TrkMaterialProviderTool.cxx.
96 return StatusCode::FAILURE;
103 ATH_MSG_ERROR(
"Unable to retrieve MuonSpectrometerEntryLayer volume");
104 return StatusCode::FAILURE;
109 ATH_MSG_ERROR(
"Unable to retrieve CalorimeterEntryLayer volume");
110 return StatusCode::FAILURE;
118 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()
const InterfaceID & Trk::ITrkMaterialProviderTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ isIsolatedTrack()
bool TrkMaterialProviderTool::isIsolatedTrack |
( |
double |
eta, |
|
|
double |
phi |
|
) |
| const |
|
private |
◆ modifyTSOSvector()
Trk::TrackStates * TrkMaterialProviderTool::modifyTSOSvector |
( |
const std::vector< const Trk::TrackStateOnSurface * > * |
matvec, |
|
|
double |
scaleX0, |
|
|
double |
scaleEloss, |
|
|
bool |
reposition, |
|
|
bool |
aggregate, |
|
|
bool |
updateEloss, |
|
|
double |
caloEnergy, |
|
|
double |
caloEnergyError, |
|
|
double |
fsrCaloEnergy, |
|
|
double |
pCaloEntry, |
|
|
double |
momentumError, |
|
|
double & |
Eloss_tot, |
|
|
bool |
useMeasuredEnergy = true , |
|
|
double |
mopEloss = 0. , |
|
|
double |
meanElossIoni = 0. , |
|
|
double |
sigmaElossIoni = 0. |
|
) |
| const |
|
private |
Function to modify TSOS doing repositioning, aggregation and corrections.
Definition at line 1299 of file TrkMaterialProviderTool.cxx.
1332 <<
" with X0, Eloss scales " << scaleX0 <<
" " << scaleEloss
1333 <<
" rep agg upd " << reposition <<
" " << aggregate <<
" " << updateEloss
1334 <<
" caloE " << caloEnergy <<
" +- " << caloEnergyError
1335 <<
" fsrCaloEnergy "<< fsrCaloEnergy
1336 <<
" p " << pCaloEntry <<
" dp " << momentumError);
1348 double sigmaDeltaPhi2_tot = 0.;
1349 double sigmaDeltaTheta2_tot = 0.;
1350 double deltaE_tot = 0.;
1351 double sigmaDeltaE_tot = 0.;
1352 double sigmaPlusDeltaE_tot = 0.;
1353 double sigmaMinusDeltaE_tot = 0.;
1354 double deltaE_ioni_tot = 0.;
1355 double sigmaDeltaE_ioni_tot=0.;
1356 double deltaE_rad_tot = 0.;
1357 double sigmaDeltaE_rad_tot =0.;
1363 double deltaEFirst = 0.;
1366 double deltaTheta = 0.;
1375 std::bitset<Trk::MaterialEffectsBase::NumberOfMaterialEffectsTypes> meotPattern(0);
1379 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
1383 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePatternScat(0);
1386 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePatternDeposit(0);
1388 const auto sqrt12=std::sqrt(12.);
1389 for(
const auto *
m : *matvec) {
1391 if(!
m->trackParameters()) {
1395 if(
m->materialEffectsOnTrack()) {
1396 double X0 =
m->materialEffectsOnTrack()->thicknessInX0();
1417 X0_tot += std::abs(scaleX0 *
X0);
1423 deltaE_tot += std::abs(scaleEloss*energyLoss->
deltaE());
1424 sigmaDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaDeltaE());
1425 sigmaPlusDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaPlusDeltaE());
1426 sigmaMinusDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaMinusDeltaE());
1427 deltaE_ioni_tot += std::abs(scaleEloss*energyLoss->
meanIoni());
1428 sigmaDeltaE_ioni_tot += std::abs(scaleEloss*energyLoss->
sigmaIoni());
1429 deltaE_rad_tot += std::abs(scaleEloss*energyLoss->
meanRad());
1430 sigmaDeltaE_rad_tot += std::abs(scaleEloss*energyLoss->
sigmaRad());
1446 deltaEFirst = energyLoss->
deltaE();
1454 wpos +=
w*posNew/2.;
1457 wdist2 +=
w*(pos0-posFirst).
mag2()/2.;
1458 wdist2 +=
w*(posNew-posFirst).
mag2()/2.;
1460 if (!aggregate&&!reposition) {
1462 auto scatNew = ScatteringAngles(
deltaPhi,
1464 std::sqrt(sigmaDeltaPhi2_tot),
1465 std::sqrt(sigmaDeltaTheta2_tot));
1468 sigmaMinusDeltaE_tot,
1469 sigmaPlusDeltaE_tot,
1471 sigmaDeltaE_ioni_tot,
1473 sigmaDeltaE_rad_tot,
1475 auto caloEnergyNew = std::make_unique<CaloEnergy>(energyLossNew);
1476 Eloss_tot += caloEnergyNew->deltaE();
1479 std::make_unique<Trk::MaterialEffectsOnTrack>(
1480 X0_tot, scatNew, std::move(caloEnergyNew), surf, meotPattern);
1481 auto pars =
m->trackParameters()->uniqueClone();
1485 nullptr, std::move(
pars), std::move(meotLast), typePattern);
1490 sigmaDeltaTheta2_tot = 0.;
1491 sigmaDeltaPhi2_tot = 0.;
1493 sigmaDeltaE_tot = 0;
1494 sigmaPlusDeltaE_tot = 0.;
1495 sigmaMinusDeltaE_tot = 0.;
1496 deltaE_ioni_tot = 0.;
1497 sigmaDeltaE_ioni_tot = 0.;
1498 deltaE_rad_tot = 0.;
1499 sigmaDeltaE_rad_tot = 0.;
1502 }
else if(!aggregate&&reposition) {
1504 if(std::abs(
depth)<10.) {
1511 sqrt(sigmaDeltaPhi2_tot),
1512 sqrt(sigmaDeltaTheta2_tot));
1515 sigmaMinusDeltaE_tot,
1516 sigmaPlusDeltaE_tot,
1518 sigmaDeltaE_ioni_tot,
1520 sigmaDeltaE_rad_tot,
1522 auto caloEnergyNew = std::make_unique<CaloEnergy>(energyLossNew);
1523 Eloss_tot += caloEnergyNew->deltaE();
1526 std::make_unique<Trk::MaterialEffectsOnTrack>(
1527 X0_tot, scatNew, std::move(caloEnergyNew), surf, meotPattern);
1528 auto pars =
m->trackParameters()->uniqueClone();
1532 nullptr, std::move(
pars), std::move(meotLast), typePattern);
1536 sigmaDeltaTheta2_tot = 0.;
1537 sigmaDeltaPhi2_tot = 0.;
1539 sigmaDeltaE_tot = 0;
1540 sigmaPlusDeltaE_tot = 0.;
1541 sigmaMinusDeltaE_tot = 0.;
1542 deltaE_ioni_tot = 0.;
1543 sigmaDeltaE_ioni_tot = 0.;
1544 deltaE_rad_tot = 0.;
1545 sigmaDeltaE_rad_tot = 0.;
1552 auto energyLoss0 = std::make_unique<Trk::EnergyLoss>(0.,0.,0.,0.);
1553 auto scatFirst = ScatteringAngles(
deltaPhi,
1555 std::sqrt(sigmaDeltaPhi2_tot / 2.),
1556 std::sqrt(sigmaDeltaTheta2_tot / 2.));
1562 std::sqrt(sigmaDeltaPhi2_tot / 2.),
1563 std::sqrt(sigmaDeltaTheta2_tot / 2.));
1566 sigmaMinusDeltaE_tot,
1567 sigmaPlusDeltaE_tot,
1569 sigmaDeltaE_ioni_tot,
1571 sigmaDeltaE_rad_tot,
1573 auto caloEnergyNew = std::make_unique<CaloEnergy>(energyLossNew);
1574 Eloss_tot += caloEnergyNew->deltaE();
1590 std::make_unique<Trk::MaterialEffectsOnTrack>(
1591 X0_tot / 2., scatFirst, std::move(energyLoss0), surfFirst, meotPattern);
1593 std::make_unique<Trk::MaterialEffectsOnTrack>(
1594 X0_tot / 2., scatNew, std::move(caloEnergyNew), surfLast, meotPattern);
1598 double qOverP0 =
m->trackParameters()->charge()/ (
m->trackParameters()->momentum().mag()-std::abs(energyLoss->
deltaE()));
1601 std::unique_ptr<Trk::TrackParameters> parsFirst =
1603 0., 0.,
dir.phi(),
dir.theta(), qOverP0);
1605 double qOverPNew =
m->trackParameters()->charge() /
1606 m->trackParameters()->momentum().mag();
1607 std::unique_ptr<Trk::TrackParameters> parsLast =
1609 0., 0.,
dir.phi(),
dir.theta(), qOverPNew);
1614 nullptr, std::move(parsFirst), std::move(meotFirst), typePattern);
1617 nullptr, std::move(parsLast), std::move(meotLast), typePattern);
1624 sigmaDeltaTheta2_tot = 0.;
1625 sigmaDeltaPhi2_tot = 0.;
1627 sigmaDeltaE_tot = 0;
1628 sigmaPlusDeltaE_tot = 0.;
1629 sigmaMinusDeltaE_tot = 0.;
1630 deltaE_ioni_tot = 0.;
1631 sigmaDeltaE_ioni_tot = 0.;
1632 deltaE_rad_tot = 0.;
1633 sigmaDeltaE_rad_tot = 0.;
1642 if (aggregate&&reposition) {
1649 bool threePlanes =
false;
1650 if (std::abs(
pos.z()) < 6700 &&
pos.perp() < 4200)
1656 std::sqrt(sigmaDeltaPhi2_tot / 2.),
1657 std::sqrt(sigmaDeltaTheta2_tot / 2.));
1661 std::sqrt(sigmaDeltaPhi2_tot / 2.),
1662 std::sqrt(sigmaDeltaTheta2_tot / 2.));
1665 sigmaMinusDeltaE_tot,
1666 sigmaPlusDeltaE_tot,
1668 sigmaDeltaE_ioni_tot,
1670 sigmaDeltaE_rad_tot,
1674 << energyLoss2.
deltaE() <<
" meanIoni "
1675 << energyLoss2.
meanIoni() <<
" sigmaIoni "
1676 << energyLoss2.
sigmaIoni() <<
" X0_tot " << X0_tot);
1681 double calE = caloEnergy;
1682 double calEr = caloEnergyError;
1685 if (!useMeasuredEnergy)
1691 energyLoss2, calE, calEr, pCaloEntry, momentumError, elossFlag)
1692 : EnergyLoss(deltaE_tot,
1694 sigmaMinusDeltaE_tot,
1695 sigmaPlusDeltaE_tot,
1697 sigmaDeltaE_ioni_tot,
1699 sigmaDeltaE_rad_tot,
1701 auto caloEnergyNew = std::make_unique<CaloEnergy>(energyLossNew);
1704 << energyLossNew.
deltaE() <<
" meanIoni "
1705 << energyLossNew.
meanIoni() <<
" sigmaIoni "
1708 caloEnergyNew->set_measEnergyLoss(caloEnergy, caloEnergyError);
1710 caloEnergyNew->set_fsrCandidateEnergy(fsrCaloEnergy);
1718 int eLossFlagTmp = 0;
1723 ATH_MSG_DEBUG(
" modifyTSOSvector energyLossParam Eloss " << energyLossParam.
deltaE() <<
" on TSOS " << energyLossNew.
deltaE() <<
" calE " << calE);
1724 Eloss_tot += caloEnergyNew->deltaE();
1735 double halflength2 = wdist2/w_tot - (
pos-posFirst).
mag()*(
pos-posFirst).
mag();
1736 double halflength = 0.;
1737 if(halflength2>0) halflength = sqrt(halflength2);
1743 double scaleCalo = 1.;
1744 double scaleCaloNew = std::abs(pos0.z())/6700;
1745 if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
1746 scaleCaloNew = std::abs(posNew.z())/6700;
1747 if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
1748 scaleCaloNew = std::abs(pos0.perp())/4200;
1749 if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
1750 scaleCaloNew = std::abs(posNew.perp())/4200;
1751 if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
1754 pos0 = pos0/scaleCalo;
1756 posNew = posNew/scaleCalo;
1757 halflength = halflength/scaleCalo;
1758 ATH_MSG_VERBOSE(
" position scattering planes inside calo scale factor " << scaleCalo);
1770 std::unique_ptr<Trk::TrackParameters> parsFirst =
1772 0., 0.,
dir.phi(),
dir.theta(), qOverP0);
1773 std::unique_ptr<Trk::TrackParameters> parsLast =
1775 0., 0.,
dir.phi(),
dir.theta(), qOverPNew);
1784 std::make_unique<Trk::MaterialEffectsOnTrack>(X0_tot / 2.,
1792 std::make_unique<Trk::MaterialEffectsOnTrack>(X0_tot / 2.,
1794 std::move(caloEnergyNew),
1801 nullptr, std::move(parsFirst), std::move(meotFirst), typePattern);
1802 auto whichPattern = (elossFlag != 0) ? typePatternDeposit : typePattern;
1804 std::move(parsLast), std::move(meotLast), whichPattern);
1813 std::unique_ptr<Trk::TrackParameters>
pars =
1815 0., 0.,
dir.phi(),
dir.theta(), qOverPNew);
1820 std::make_unique<Trk::MaterialEffectsOnTrack>(
1821 X0_tot / 2., scatFirst,
nullptr, surfFirst, meotPattern);
1826 std::make_unique<Trk::MaterialEffectsOnTrack>(
1827 0.,std::nullopt, std::move(caloEnergyNew), surf, meotPattern);
1832 std::make_unique<Trk::MaterialEffectsOnTrack>(
1833 X0_tot / 2., scatNew,
nullptr, surfLast, meotPattern);
1838 nullptr, std::move(parsFirst), std::move(meotFirst), typePatternScat);
1840 nullptr, std::move(
pars), std::move(meot), typePatternDeposit);
1843 nullptr, std::move(parsLast), std::move(meotLast), typePatternScat);
1855 return newTSOSvector;
◆ 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.
◆ printTSOS()
Definition at line 1252 of file TrkMaterialProviderTool.cxx.
1255 std::string volGeo=
"ID";
1256 if(ivolGeo==2) volGeo=
"CALO";
1257 else if(ivolGeo==3) volGeo=
"MS";
1259 <<
" Volume "<<std::left<<std::setw(5)<<volGeo
1260 <<
" r "<<std::left<<std::setw(10)<<
m->surface().globalReferencePoint().perp()
1261 <<
" z "<<std::left<<std::setw(10)<<
m->surface().globalReferencePoint().z());
1262 if(
m->materialEffectsOnTrack()) {
1263 ATH_MSG_VERBOSE(
" -> Material: X0 "<<std::left<<std::setw(10)<<
m->materialEffectsOnTrack()->thicknessInX0());
1268 ATH_MSG_DEBUG(
" geo " << volGeo <<
" radius " <<
m->surface().globalReferencePoint().perp() <<
" z " <<
m->surface().globalReferencePoint().z() <<
" TSOS Eloss " <<energyLoss->
deltaE());
1269 std::string
type=
"P";
1274 <<
" MopIoni "<<std::left<<std::setw(10)<<energyLoss->
meanIoni()<<
" +- "<<std::left<<std::setw(10)<<energyLoss->
sigmaIoni()
1275 <<
" MeanRad "<<std::left<<std::setw(10)<<energyLoss->
meanRad()<<
" +- "<<std::left<<std::setw(10)<<energyLoss->
sigmaRad() );
1280 " dTheta "<<std::left<<std::setw(10)<<scatAngles->
deltaTheta()<<
" +- "<<std::left<<std::setw(10)<<scatAngles->
sigmaDeltaTheta());
1284 if(
m->trackParameters()) {
1285 ATH_MSG_VERBOSE(
" -> TP: r "<<std::left<<std::setw(10)<<
m->trackParameters()->position().perp()
1286 <<
" z "<<std::left<<std::setw(10)<<
m->trackParameters()->position().z()
1287 <<
" phi0 "<<std::left<<std::setw(10)<<
m->trackParameters()->parameters()[
Trk::phi0]
1289 if(
m->trackParameters()->covariance()) {
1291 <<
" phi0 "<<std::left<<std::setw(10)<<
Amg::error(*
m->trackParameters()->covariance(),
Trk::phi0)
◆ removeMS()
Helper to remove only MS TSOS.
Helper to remove MS TSOS.
Definition at line 1032 of file TrkMaterialProviderTool.cxx.
1039 caloTSOS->erase( std::remove_if(caloTSOS->begin(),
1042 if (state && this_->getVolumeByGeo(state)==3) {
◆ removeOutOfCalo()
Helper to remove MS and ID TSOS.
Definition at line 1008 of file TrkMaterialProviderTool.cxx.
1015 caloTSOS->erase( std::remove_if(caloTSOS->begin(),
1018 if (state && this_->getVolumeByGeo(state)!=2) {
◆ renounce()
◆ renounceArray()
◆ retrieveTrackingGeometry()
◆ 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.
◆ throwFailedToGetTrackingGeomtry()
void TrkMaterialProviderTool::throwFailedToGetTrackingGeomtry |
( |
| ) |
const |
|
private |
◆ updateCaloTSOS() [1/2]
Update Calorimeter TSOS from input ID and MS tracks.
Implements Trk::ITrkMaterialProviderTool.
Definition at line 243 of file TrkMaterialProviderTool.cxx.
245 ATH_MSG_VERBOSE(
"updateCaloTSOS(Trk::Track& idTrack, Trk::Track& extrapolatedTrack)");
250 auto inputTSOS_MS = std::make_unique<Trk::TrackStates>();
252 inputTSOS_MS->push_back (tsos->clone());
261 if(this->
getVolumeByGeo(*itID)==1 && (*itID)->trackParameters()) {
265 if(itID==itFront)
break;
275 for(;
it!=itEnd; ++
it) {
281 if(firstCALO==inputTSOS_MS->end() && this->getVolumeByGeo(*
it)==2)
286 if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
293 if(firstCALO == inputTSOS_MS->end()) {
297 if(lastIDwP == inputTSOS_ID->
end()) {
302 if(firstMS == inputTSOS_MS->end()) {
312 firstMSnotPerigee=firstMS+1;
319 printTSOS(*firstMSnotPerigee,
"FIRST MS");
320 if(firstMSwP != inputTSOS_MS->end())
326 double X0ScaleMS = 0.;
327 double ElossScaleMS = 0.;
331 (*firstMSnotPerigee)->surface(),
334 Eloss, X0ScaleMS, ElossScaleMS,
335 (firstMSwP == inputTSOS_MS->end()) ?
nullptr : (*firstMSwP)->trackParameters(),
340 if(!caloTSOS || caloTSOS->
size()!=3) {
341 ATH_MSG_WARNING(
"Unable to retrieve Calorimeter TSOS from extrapolateM (null or <3)");
348 for(
auto m : *inputTSOS_ID)
printTSOS(
m,
"ID TSOS");
349 ATH_MSG_VERBOSE(
"OLD-MS TSOS multiplicity : " << inputTSOS_MS->size());
350 for(
auto m : *inputTSOS_MS)
printTSOS(
m,
"OLD-MS TSOS");
354 this->
updateVectorMS(inputTSOS_MS.get(),firstMS,X0ScaleMS,ElossScaleMS);
◆ updateCaloTSOS() [2/2]
Update Calorimeter TSOS from input MS/CB track.
Implements Trk::ITrkMaterialProviderTool.
Definition at line 131 of file TrkMaterialProviderTool.cxx.
133 ATH_MSG_VERBOSE(
"updateCaloTSOS(Trk::Track& track, const Trk::TrackParameters* startParameters)");
139 auto inputTSOS = std::make_unique<Trk::TrackStates>();
141 inputTSOS->push_back (tsos->clone());
153 for(;
it!=itEnd; ++
it) {
161 if(firstCALO==inputTSOS->end() && this->getVolumeByGeo(*
it)==2 && firstMS==itEnd)
163 else if(this->
getVolumeByGeo(*it)==3 && firstCALO!=inputTSOS->end()) {
166 if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
174 if(lastIDwP != inputTSOS->end()) {
178 startParameters = (*lastIDwP)->trackParameters();
181 if(lastIDwP == inputTSOS->end() && !startParameters) {
182 ATH_MSG_WARNING(
"Unable to find starting parameters for extrapolation");
186 if(firstCALO == inputTSOS->end()) {
190 if(firstMS == inputTSOS->end()) {
200 firstMSnotPerigee=firstMS+1;
206 printTSOS(*firstMSnotPerigee,
"FIRST MS");
209 double X0ScaleMS = 0.;
210 double ElossScaleMS = 0.;
214 (*firstMSnotPerigee)->surface(),
217 Eloss, X0ScaleMS, ElossScaleMS,
218 (firstMSwP == inputTSOS->end()) ?
nullptr : (*firstMSwP)->trackParameters(),
222 if(!caloTSOS || caloTSOS->
size()!=3) {
223 ATH_MSG_WARNING(
"Unable to retrieve Calorimeter TSOS from extrapolateM (null or <3)");
230 for(
auto m : *inputTSOS) this->
printTSOS(
m,
"OLD TSOS");
234 this->
updateVectorMS(inputTSOS.get(),firstMS,X0ScaleMS,ElossScaleMS);
237 track.setTrackStateOnSurfaces (std::move (inputTSOS));
◆ updateVector()
Helper to update entries in the vector.
Definition at line 1057 of file TrkMaterialProviderTool.cxx.
1064 unsigned int ntoupdate=0;
1066 while(
it!=firstMS) {
1072 if(ntoupdate==caloTSOS->
size()) {
1077 while(
i<ntoupdate) {
◆ updateVectorMS()
update the TSOS vector for the Muon Spectrometer applying X0 and Eloss scaling
Definition at line 1087 of file TrkMaterialProviderTool.cxx.
1096 std::bitset<Trk::MaterialEffectsBase::NumberOfMaterialEffectsTypes> meotPattern(0);
1099 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
1103 if(X0ScaleMS<0.5||ElossScaleMS<0.5||X0ScaleMS>2.||ElossScaleMS>2.) {
1104 ATH_MSG_WARNING(
"Too large or too small X0ScaleMS " << X0ScaleMS <<
" ElossScaleMS " << ElossScaleMS);
1109 int msMatStates = 0;
1110 int msMatParStates = 0;
1114 for(;
it!= inputTSOS->
end();++
it) {
1116 if((*it)->materialEffectsOnTrack()) {
1134 double deltaE = (ElossScaleMS * energyLoss->
deltaE());
1135 double sigmaDeltaE = (ElossScaleMS * energyLoss->
sigmaDeltaE());
1136 double sigmaPlusDeltaE =
1138 double sigmaMinusDeltaE =
1140 double deltaE_ioni = (ElossScaleMS * energyLoss->
meanIoni());
1141 double sigmaDeltaE_ioni = (ElossScaleMS * energyLoss->
sigmaIoni());
1142 double deltaE_rad = (ElossScaleMS * energyLoss->
meanRad());
1143 double sigmaDeltaE_rad = (ElossScaleMS * energyLoss->
sigmaRad());
1147 std::cout <<
" updateVectorMS Old Eloss " << energyLoss->
deltaE()
1148 <<
" new Eloss " << deltaE << std::endl;
1150 auto energyLossNew = std::make_unique<Trk::EnergyLoss>(deltaE,
1161 std::make_unique<Trk::MaterialEffectsOnTrack>(X0ScaleMS * meot->
thicknessInX0(),
1163 std::move(energyLossNew),
1166 std::unique_ptr<Trk::TrackParameters>
pars{};
1167 if ((*it)->trackParameters())
1168 pars = (*it)->trackParameters()->uniqueClone();
1172 nullptr, std::move(
pars), std::move(newMeot), typePattern);
1178 delete newTSOSvector;
1187 std::cout <<
" msStates " << msStates <<
" msMatStates " << msMatStates <<
" msMatParStates " << msMatParStates << std::endl;
1190 for(
it = firstMS;
it!= inputTSOS->
end();++
it) {
1191 if((*it)->materialEffectsOnTrack()) {
1198 std::cout <<
" updateVectorMS dump NEW Eloss " << energyLoss->
deltaE() << std::endl;
◆ updateVHKA()
◆ m_aggregateTSOS
bool Trk::TrkMaterialProviderTool::m_aggregateTSOS |
|
private |
◆ m_applyTGScaling
bool Trk::TrkMaterialProviderTool::m_applyTGScaling |
|
private |
◆ m_caloMeasTool
◆ m_caloParamTool
◆ m_calorimeterVolume
std::unique_ptr<Trk::Volume> Trk::TrkMaterialProviderTool::m_calorimeterVolume |
|
private |
◆ m_DetID
◆ m_detStore
◆ m_elossupdator
◆ m_evtStore
◆ m_fieldCacheCondObjInputKey
Initial value:{this, "AtlasFieldCacheCondObj", "fieldCondObj",
"Name of the Magnetic Field conditions object key"}
Definition at line 220 of file TrkMaterialProviderTool.h.
◆ m_indetVolume
std::unique_ptr<Trk::Volume> Trk::TrkMaterialProviderTool::m_indetVolume |
|
private |
◆ m_maxNTracksIso
int Trk::TrkMaterialProviderTool::m_maxNTracksIso |
|
private |
◆ m_muonCaloEnergyTool
◆ m_muonExtrapolator
◆ m_overwriteElossParam
bool Trk::TrkMaterialProviderTool::m_overwriteElossParam |
|
private |
◆ m_paramPtCut
double Trk::TrkMaterialProviderTool::m_paramPtCut |
|
private |
◆ m_repositionTSOS
bool Trk::TrkMaterialProviderTool::m_repositionTSOS |
|
private |
◆ m_scattool
Initial value:{this, "MultipleScatteringTool",
"Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator"}
Definition at line 202 of file TrkMaterialProviderTool.h.
◆ m_trackingGeometryReadKey
◆ m_trackingGeometrySvc
◆ m_trackingVolumesSvc
◆ m_trackIsolationTool
◆ m_updateTSOS
bool Trk::TrkMaterialProviderTool::m_updateTSOS |
|
private |
◆ m_useCaloEnergyMeasurement
bool Trk::TrkMaterialProviderTool::m_useCaloEnergyMeasurement |
|
private |
◆ m_useMuonCaloEnergyTool
bool Trk::TrkMaterialProviderTool::m_useMuonCaloEnergyTool |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
double deltaPhi() const
returns the
double sigmaMinusDeltaE() const
returns the negative side
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
@ CaloDeposit
This TSOS contains a CaloEnergy object.
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Const iterator class for DataVector/DataList.
@ depth
pointing depth of the shower as calculated in egammaqgcld
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
CaloEnergy * clone() const
Virtual constructor.
class extending the basic Trk::EnergyLoss to describe the measured or parameterised muon energy loss ...
double charge() const
Returns the charge.
void set_paramEnergyLoss(const double deltaE, const double sigmaMinusDeltaE, const double sigmaPlusDeltaE)
set parametrised energy loss
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
const Amg::Vector3D & position() const
Access method for the position.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
double LArEM_EnergyMeasured(void) const
double deltaEMeas() const
get measured energy loss
@ MuonSpectrometerEntryLayer
Tracking Volume which defines the entrance surfaces of the MS.
double sigmaDeltaE() const
returns the symmatric error
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const T * get(size_type n) const
Access an element, as an rvalue.
represents a deflection of the track caused through multiple scattering in material.
double thicknessInX0() const
returns the actually traversed material .
double deltaEParam() const
get parametrised energy loss
#define ATH_MSG_VERBOSE(x)
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.
double LArHEC_EnergyMeasured(void) const
void set_measEnergyLoss(const double deltaE, const double sigmaDeltaE)
set measured energy loss
double sigmaDeltaEMeas() const
get measured energy loss error
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
represents the full description of deflection and e-loss of a track in material.
double sigmaDeltaTheta() const
returns the
CaloEnergy::EnergyLossType energyLossType(void) const
Accessor methods.
virtual const Surface & surfaceRepresentation() const =0
The Surface Representation of this.
DataVector< const Trk::TrackStateOnSurface > TrackStates
(Non-const) Iterator class for DataVector/DataList.
Eigen::Affine3d Transform3D
double deltaE() const
returns the
@ ScatteringEffects
contains material effects due to multiple scattering
iterator insert(iterator position, value_type pElem)
Add a new element to the collection.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
@ CalorimeterEntryLayer
Tracking Volume which defines the entrance srufaces of the calorimeter.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
const Perigee * perigeeParameters() const
return Perigee.
represents the track state (measurement, material, fit parameters and quality) at a surface.
std::reverse_iterator< const_iterator > const_reverse_iterator
Standard const_reverse_iterator.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
@ InertMaterial
This represents inert material, and so will contain MaterialEffectsBase.
double Tile_EnergyMeasured(void) const
void setTrackStateOnSurfaces(std::unique_ptr< Trk::TrackStates > input)
Set the TrackStateOnSurfaces.
unsigned short caloMuonIdTag() const
the Calo Muon Identification tag
This class describes energy loss material effects in the ATLAS tracking EDM.
double sigmaPlusDeltaEParam() const
get parametrised energy loss plus error
bool is_indet(Identifier id) const
std::vector< BoundaryIntersection< T > > boundarySurfacesOrdered(const T ¶meters, PropDirection pDir=alongMomentum, bool startOffBoundary=false) const
Returns the boundary surfaces ordered in probability to hit them based on straight line intersection.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
double sigmaMinusDeltaEParam() const
get parametrised energy loss minus error
Eigen::Matrix< double, 3, 1 > Vector3D
double Tile_SamplingFraction(void) const
@ EnergyLossEffects
contains energy loss corrections
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const EnergyLoss * energyLoss() const
returns the energy loss object.
bool is_muon(Identifier id) const
#define ATH_MSG_WARNING(x)
const ScatteringAngles * scatteringAngles() const
returns the MCS-angles object.
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
double sigmaDeltaPhi() const
returns the
@ 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.
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
double deltaTheta() const
returns the
iterator erase(iterator position)
Remove element at a given position.
Scalar mag2() const
mag2 method - forward to squaredNorm()
double LArEM_SamplingFraction(void) const
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const Surface & associatedSurface() const
returns the surface to which these m.eff. are associated.
double sigmaPlusDeltaE() const
returns the positive side
Scalar mag() const
mag method
double caloLRLikelihood() const
the calo Muon Identification likehood
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
double LArHEC_SamplingFraction(void) const