|
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 |
|
const Trk::Volume * | m_calorimeterVolume |
|
const 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 53 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 1235 of file TrkMaterialProviderTool.cxx.
1237 std::vector<const Trk::TrackStateOnSurface*>::const_iterator
it = vecTSOS->begin();
1238 std::vector<const Trk::TrackStateOnSurface*>::const_iterator itEnd = vecTSOS->end();
1239 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 981 of file TrkMaterialProviderTool.cxx.
985 std::vector<const Trk::TrackStateOnSurface*>::const_iterator
it = caloTSOS->begin();
986 std::vector<const Trk::TrackStateOnSurface*>::const_iterator itEnd = caloTSOS->end();
987 for(;
it!=itEnd; ++
it) {
988 if((*it)->trackParameters()) {
989 ATH_MSG_DEBUG(
"Parameters at CALO entry found : "<< *((*it)->trackParameters()));
990 tsosAtCaloEntry = *
it;
991 return tsosAtCaloEntry;
995 std::vector<const Trk::TrackStateOnSurface*>::const_reverse_iterator
it = caloTSOS->rbegin();
996 std::vector<const Trk::TrackStateOnSurface*>::const_reverse_iterator itEnd = caloTSOS->rend();
997 for(;
it!=itEnd; ++
it) {
998 if((*it)->trackParameters()) {
999 ATH_MSG_DEBUG(
"Parameters at CALO entry found : "<< *((*it)->trackParameters()));
1000 tsosAtCaloEntry = *
it;
1001 return tsosAtCaloEntry;
1005 return tsosAtCaloEntry;
◆ getCaloExitTSOS()
Helper to get last calo TSOS with TP.
Definition at line 952 of file TrkMaterialProviderTool.cxx.
956 std::vector<const Trk::TrackStateOnSurface*>::const_reverse_iterator
it = caloTSOS->rbegin();
957 std::vector<const Trk::TrackStateOnSurface*>::const_reverse_iterator itEnd = caloTSOS->rend();
958 for(;
it!=itEnd; ++
it) {
959 if((*it)->trackParameters()) {
960 ATH_MSG_DEBUG(
"Parameters at CALO exit found : "<< *((*it)->trackParameters()));
961 tsosAtCaloExit = *
it;
962 return tsosAtCaloExit;
966 std::vector<const Trk::TrackStateOnSurface*>::const_iterator
it = caloTSOS->begin();
967 std::vector<const Trk::TrackStateOnSurface*>::const_iterator itEnd = caloTSOS->end();
968 for(;
it!=itEnd; ++
it) {
969 if((*it)->trackParameters()) {
970 ATH_MSG_DEBUG(
"Parameters at CALO exit found : "<< *((*it)->trackParameters()));
971 tsosAtCaloExit = *
it;
972 return tsosAtCaloExit;
976 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 1952 of file TrkMaterialProviderTool.cxx.
1958 std::unique_ptr<Rec::CaloMeas> caloMeas =
m_caloMeasTool->energyMeasurement(Gaudi::Hive::currentContext(),eta,
phi,eta,
phi);
1962 double FinalMeasuredEnergy =
getFinalMeasuredEnergy(caloMeas.get(), totalEloss, meanElossIoni, eta, fsrCaloEnergy);
1964 return FinalMeasuredEnergy;
◆ getCaloMEOT()
Get Calorimeter MEOT.
Implements Trk::ITrkMaterialProviderTool.
Definition at line 367 of file TrkMaterialProviderTool.cxx.
370 ATH_MSG_VERBOSE(
"getCaloMEOT(const Trk::Track& idTrack, const Trk::Track& msTrack, std::vector<MaterialEffectsOnTrack>& calomeots)");
376 for(
auto m : *inputTSOS_ID)
printTSOS(
m,
"TSOS ID TRACK");
377 for(
auto m : *inputTSOS_MS)
printTSOS(
m,
"TSOS MS TRACK");
382 for (
auto it = inputTSOS_ID->rbegin();
it != inputTSOS_ID->rend(); ++
it) {
389 if(lastIDwP == inputTSOS_ID->rend()) {
399 for(
auto it = inputTSOS_MS->begin();
it!=itEnd ; ++
it) {
403 if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
410 if(firstMS == inputTSOS_MS->end()) {
419 firstMSnotPerigee=firstMS+1;
424 printTSOS(*firstMSnotPerigee,
"FIRST MS");
425 if(firstMSwP != inputTSOS_MS->end())
428 ATH_MSG_WARNING(
"Unable to find first MS TSOS with Track Parameters!");
433 const EventContext& ctx = Gaudi::Hive::currentContext();
437 if (fieldCondObj ==
nullptr) {
441 fieldCondObj->getInitializedCache (fieldCache);
444 double X0ScaleMS = 0.;
445 double ElossScaleMS = 0.;
449 fieldCache.
toroidOn() ? msTrack : idTrack,
450 (*firstMSnotPerigee)->surface(),
453 Eloss, X0ScaleMS, ElossScaleMS,
454 (firstMSwP == inputTSOS_MS->end()) ?
nullptr : (*firstMSwP)->trackParameters(),
458 if (!caloTSOS || caloTSOS->
size() != 3)
463 if ((!fieldCache.
toroidOn() && idqOverP * 4000. < 1) || (fieldCache.
toroidOn() && msqOverP != 1 / 100000. && msqOverP != 0))
467 ATH_MSG_WARNING(
" Toroid off q*momentum of ID track " << 1. / idqOverP);
469 ATH_MSG_WARNING(
" Toroid on q*momentum of MS track " << 1. / msqOverP);
470 ATH_MSG_WARNING(
"Unable to retrieve Calorimeter TSOS from extrapolateM+aggregation (null or !=3)");
472 ATH_MSG_WARNING(
" Zero Calorimeter TSOS from extrapolateM+aggregation");
474 ATH_MSG_WARNING(
" nr Calorimeter TSOS from extrapolateM+aggregation not equal to 3 " << caloTSOS->
size());
483 for (
auto &&
i : *caloTSOS){
486 throw std::logic_error(
"TrackStateOnSurface without material effects on track." );
489 double qoverp=
i->trackParameters()->parameters()[
Trk::qOverP];
493 std::unique_ptr<Trk::EnergyLoss> neweloss=
nullptr;
494 std::optional<Trk::ScatteringAngles> newsa= std::nullopt;
495 if (eloss) neweloss = std::make_unique<CaloEnergy>(*eloss);
498 double sigmascat = std::abs(qoverp)>0.0 ? std::sqrt(
m_scattool->sigmaSquare(matprop,std::abs(1./qoverp),1.,
Trk::muon)) : 0.0;
505 i->trackParameters()->associatedSurface());
506 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 664 of file TrkMaterialProviderTool.cxx.
676 const EventContext& ctx = Gaudi::Hive::currentContext();
677 bool fremoveMS =
false;
678 if(!removeOoC) fremoveMS =
true;
680 ATH_MSG_DEBUG(
"Retrieving Calorimeter TSOS from extrapolateM (dir=" <<
dir <<
") with starting parameters : "
681 << parm <<
" to surface "<<surf);
682 if(parms)
ATH_MSG_DEBUG(
"Parameters in MS provided : "<< *parms);
684 double pOri = parm.
momentum().mag();
687 std::vector<const Trk::TrackStateOnSurface*>* caloTSOS =
m_muonExtrapolator->extrapolateM(ctx,
693 ATH_MSG_DEBUG(
"Retrieved " << caloTSOS->size() <<
" Calorimeter TSOS from extrapolateM, no-removal");
696 ATH_MSG_DEBUG(
"Retrieved " << caloTSOS->size() <<
" Calorimeter TSOS from extrapolateM, no-removal");
697 for(
auto m : *caloTSOS) this->
printTSOS(
m,
"BEFORE-REMOVAL CALO TSOS");
703 double ElossCalo = 0.;
705 for(
const auto *
m : *caloTSOS) {
706 if(
m->materialEffectsOnTrack()) {
713 Eloss += std::abs(energyLoss->
deltaE());
722 ATH_MSG_DEBUG(
"Total Eloss on TSOS from extrapolateM " << Eloss <<
" ElossID " << ElossID <<
" ElossMS " << ElossMS <<
" Elosscalo " << ElossCalo);
723 if(fremoveMS)
ATH_MSG_DEBUG(
" ID Eloss will be added to Calo Eloss " << ElossID+ElossCalo);
729 ATH_MSG_DEBUG(
"Retrieved " << caloTSOS->size() <<
" Calorimeter TSOS from extrapolateM");
731 if(fremoveMS && !caloTSOS->empty())
removeMS(caloTSOS);
732 ATH_MSG_DEBUG(
"Retrieved " << caloTSOS->size() <<
" Calorimeter TSOS from extrapolateM");
735 for(
auto m : *caloTSOS) this->
printTSOS(
m,
"ORIGINAL CALO TSOS");
740 if(caloTSOS->empty() || Eloss<=0) {
742 ATH_MSG_WARNING(
"Unable to retrieve Calorimeter TSOS from extrapolateM caloTSOS->size() "<< caloTSOS->size() <<
" Eloss " << Eloss );
749 return finalCaloTSOS;
753 double X0ScaleCALO=1.0;
754 double ElossScaleCALO=1.0;
759 if(!tsosAtCaloExit) {
760 ATH_MSG_WARNING(
name() <<
" Unable to find Calorimeter Exit TSOS with TrackParameters! No TG Scaling applied!" );
765 X0ScaleCALO, ElossScaleCALO);
769 X0ScaleMS, ElossScaleMS);
772 ATH_MSG_DEBUG(
"Eloss/X0 scaling corrections set to : " << ElossScaleCALO <<
" " << X0ScaleCALO);
776 double pAtCaloEntry = 0;
778 double OneOverP = std::abs(parm.parameters()[
Trk::qOverP]);
780 pAtCaloEntry = 1./OneOverP;
782 pAtCaloEntry = parm.
momentum().norm();
785 if(!tsosAtCaloEntry) {
786 ATH_MSG_WARNING(
name() <<
" Unable to find Calorimeter Entry TSOS with TrackParameters! Momentum at Calo Entry not available!" );
790 pAtCaloEntry = 1./OneOverP;
800 if(!tsosAtCaloExit) {
801 ATH_MSG_DEBUG(
"Unable to find Calorimeter Exit TSOS with TrackParameters! Momentum at MS not available!" );
804 ATH_MSG_DEBUG(
"MS track parameters taken from calorimeter TSOS");
809 double pAtMuonEntryError = 0.0;
811 if( std::abs(parms->parameters()[
Trk::qOverP]) > 0.0 ) {
812 double pAtMuonEntry = std::abs(1./parms->parameters()[
Trk::qOverP]);
813 if (!parms->covariance() ||
816 "MS track parameters without covariance, using 10% relative error!");
817 pAtMuonEntryError = pAtMuonEntry*0.1;
820 pAtMuonEntryError = pAtMuonEntry*pAtMuonEntry*qOverpAtMuonEntryError;
825 ATH_MSG_DEBUG(
"Momentum Error at MS Entry : " << pAtMuonEntryError);
828 double measCaloEnergy = 0.0;
829 double measCaloEnergyError = 0.0;
830 double fsrCaloEnergy = 0.0;
833 double totalEloss=0.0;
834 double meanElossIoni=0.0;
835 double sigmaElossIoni=0.0;
847 double E_em_meas = 0.;
848 double E_em_exp = 0.;
849 double E_tile_meas = 0.;
850 double E_tile_exp = 0.;
851 double E_HEC_meas = 0.;
852 double E_HEC_exp = 0.;
853 double E_dead_exp = 0.;
862 totalEloss, meanElossIoni, 0.45*sigmaElossIoni,
863 measCaloEnergy, measCaloEnergyError, fsrCaloEnergy, e_exp,
864 E_em_meas,E_em_exp,E_tile_meas,E_tile_exp,E_HEC_meas,E_HEC_exp,E_dead_exp);
867 ATH_MSG_DEBUG(
" eta " << eta <<
" Energy measurement from calorimeter: inputs totalEloss, meanElossIoni, sigmaElossIoni "
868 << totalEloss <<
" " << meanElossIoni <<
" " << sigmaElossIoni <<
" e_exp Ioni from TG " << e_exp <<
" e_exp original " << e_exp*totalEloss/(meanElossIoni+0.001));
880 ATH_MSG_DEBUG(
"Final measured energy in calorimeter : " << measCaloEnergy <<
" +- " << measCaloEnergyError <<
" MeV"
881 <<
" momentum fraction " << measCaloEnergy/pAtCaloEntry);
890 double Eloss_tot=0.0;
897 measCaloEnergy, measCaloEnergyError, fsrCaloEnergy,
898 pAtCaloEntry, pAtMuonEntryError,
899 Eloss_tot, useMeasuredEnergy,
900 totalEloss, meanElossIoni, sigmaElossIoni);
902 ATH_MSG_DEBUG(
" after modifyTSOSvector X0ScaleCALO " << X0ScaleCALO <<
" ElossScaleCALO " << ElossScaleCALO <<
903 " pAtCaloEntry " << pAtCaloEntry <<
" pAtMuonEntryError " << pAtMuonEntryError <<
" total Eloss from TG through MuonEnergyTool " << Eloss_tot );
904 ATH_MSG_DEBUG(
"Aggregating and correcting TSOS down to : " << finalCaloTSOS->
size() <<
" with total Eloss " << Eloss_tot);
908 for(
auto m : *finalCaloTSOS) this->
printTSOS(
m,
"FINAL CALO TSOS");
914 return finalCaloTSOS;
◆ getCaloTSOS() [2/2]
Retrieve Calorimeter TSOS from TG and apply corrections.
Implements Trk::ITrkMaterialProviderTool.
Definition at line 516 of file TrkMaterialProviderTool.cxx.
519 std::vector<const Trk::TrackStateOnSurface*>* caloTSOS =
new std::vector<const Trk::TrackStateOnSurface*>();
522 const EventContext& ctx = Gaudi::Hive::currentContext();
525 if(!trackingGeometry) {
534 targetVolume = trackingGeometry->
trackingVolume(
"MuonSpectrometerEntrance");
536 ATH_MSG_WARNING(
"Unable to get target volume for calo material collection!");
539 ATH_MSG_VERBOSE(
"TP inside ID -> extrapolating TP "<<parm<<
" to MS entry volume "<<*targetVolume);
544 targetVolume = trackingGeometry->
trackingVolume(
"InDet::Containers::InnerDetector");
546 ATH_MSG_WARNING(
"Unable to get target volume for calo material collection!");
549 ATH_MSG_VERBOSE(
"TP inside MS -> extrapolating TP "<<parm<<
" to ID exit volume "<<*targetVolume);
554 targetVolume = trackingGeometry->
trackingVolume(
"InDet::Containers::InnerDetector");
556 ATH_MSG_WARNING(
"Unable to get target volume for calo material collection!");
559 ATH_MSG_DEBUG(
"TP inside CALO or between CALO and MS -> assuming ID as target : "<<*targetVolume);
570 for(;
it!=itEnd; ++
it) {
572 if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
573 parms = (*it)->trackParameters();
585 PerigeeSurface surface(globPos);
587 double X0ScaleMS = 0.;
588 double ElossScaleMS = 0.;
595 Eloss, X0ScaleMS, ElossScaleMS,
601 ATH_MSG_DEBUG(
" go to Beam Line destination surface position radius " << surface.center().perp() <<
" z " << surface.center().z());
604 for(
unsigned int i=0;
i<caloTSOSdv->
size(); ++
i)
605 caloTSOS->push_back(caloTSOSdv->
get(
i));
616 double Eloss_previous = 0.;
617 for (
auto& boundaryCandidate : boundaryIntersections){
621 if(!surfaceTV)
continue;
626 double X0ScaleMS = 0.;
627 double ElossScaleMS = 0.;
634 Eloss, X0ScaleMS, ElossScaleMS,
639 if(caloTSOSdv&&Eloss>Eloss_previous) {
645 ATH_MSG_DEBUG(
" getCaloTSOS: Previous solution had Eloss " << Eloss_previous <<
" latest " << Eloss);
649 for(
unsigned int i=0;
i<caloTSOSdv->
size(); ++
i)
650 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 1968 of file TrkMaterialProviderTool.cxx.
1974 double MopLossCorrected = totalEloss;
1975 double MopLoss = totalEloss;
1987 double MaterialCorrection =
InertMaterial * MopLossCorrected;
2001 double ForwardHECCorrection = 0.;
2003 ForwardHECCorrection = (1. - LArHECMeasurementMaterial) * HECMaterial * MopLossCorrected;
2006 double TotalMeasuredEnergy = TileEnergy + EmEnergy + LArHECEnergy;
2009 <<
" LArHEC " << LArHECEnergy
2010 <<
" EM " << EmEnergy);
2012 <<
" HECMaterial " << HECMaterial
2013 <<
" MopLossCorrected " << MopLossCorrected );
2019 if (std::abs(eta)<1.4) {
2020 if (LArHECEnergy + TileEnergy > 0.1 * MopLoss * HECMaterial) bHEC=
true;
2022 else if (std::abs(eta)>1.8) {
2023 if (LArHECEnergy + TileEnergy > 0.2 * MopLoss * HECMaterial) bHEC=
true;
2025 if (LArHECEnergy + TileEnergy > 0.25 * MopLoss * HECMaterial) bHEC=
true;
2027 if (EmEnergy > 0.5 * MopLoss * EmMaterial) bEM =
true;
2029 double MeasCorrected = TotalMeasuredEnergy + MaterialCorrection;
2034 const double IonizationLoss = (1./1.4) * meanElossIoni;
2035 double eOverMipCorrectionEm = 0.;
2036 double eOverMipCorrectionHEC = 0.;
2040 const double emipEM = 0.78;
2041 eOverMipCorrectionEm = - (1./emipEM-1.) * IonizationLoss * EmMaterial * LArEmMeasurementMaterial;
2042 if (EmEnergy + eOverMipCorrectionEm<0.)eOverMipCorrectionEm=0.;
2045 const double emipTile = 0.86;
2046 const double emipLAr = 0.94;
2047 const double HECEnergy = TileEnergy + LArHECEnergy;
2048 const double eOverMipCorrectionTile = - (1./emipTile-1.) * TileEnergy / HECEnergy * IonizationLoss * HECMaterial * TileMeasurementMaterial;
2049 const double eOverMipCorrectionLAr = - (1./emipLAr-1.) * LArHECEnergy / HECEnergy * IonizationLoss * HECMaterial * LArHECMeasurementMaterial;
2050 eOverMipCorrectionHEC = eOverMipCorrectionTile + eOverMipCorrectionLAr;
2051 if (LArHECEnergy + TileEnergy + eOverMipCorrectionHEC < 0.0) eOverMipCorrectionHEC=0.;
2053 const double eOverMipCorrection = eOverMipCorrectionEm + eOverMipCorrectionHEC;
2072 double FinalMeasuredEnergy = MeasCorrected + eOverMipCorrection;
2074 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 1865 of file TrkMaterialProviderTool.cxx.
1879 double deltaE_tot = 0.;
1880 double sigmaDeltaE_tot = 0.;
1881 double sigmaPlusDeltaE_tot = 0.;
1882 double sigmaMinusDeltaE_tot = 0.;
1883 double deltaE_ioni_tot = 0.;
1884 double sigmaDeltaE_ioni_tot=0.;
1885 double deltaE_rad_tot = 0.;
1886 double sigmaDeltaE_rad_tot =0.;
1888 for(
const auto *
m : *matvec) {
1889 if(!
m->trackParameters()) {
1893 if(
m->materialEffectsOnTrack()) {
1906 deltaE_tot += std::abs(scaleEloss*energyLoss->
deltaE());
1907 sigmaDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaDeltaE());
1908 sigmaPlusDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaPlusDeltaE());
1909 sigmaMinusDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaMinusDeltaE());
1910 deltaE_ioni_tot += std::abs(scaleEloss*energyLoss->
meanIoni());
1911 sigmaDeltaE_ioni_tot += std::abs(scaleEloss*energyLoss->
sigmaIoni());
1912 deltaE_rad_tot += std::abs(scaleEloss*energyLoss->
meanRad());
1913 sigmaDeltaE_rad_tot += std::abs(scaleEloss*energyLoss->
sigmaRad());
1915 ATH_MSG_DEBUG(
" position x " <<
m->trackParameters()->position().x() <<
" y " <<
m->trackParameters()->position().y() <<
" perp " <<
m->trackParameters()->position().perp() <<
" z " <<
m->trackParameters()->position().z() );
1916 ATH_MSG_DEBUG(
" deltaE " << (scaleEloss*energyLoss->
deltaE()) <<
" deltaE_ioni " << (scaleEloss*energyLoss->
meanIoni()) <<
" sigmaDeltaE_ioni " << (scaleEloss*energyLoss->
sigmaIoni()));
1917 ATH_MSG_DEBUG(
" deltaE_tot " << deltaE_tot <<
" deltaE_ioni_tot " << deltaE_ioni_tot <<
" sigmaDeltaE_ioni_tot " << sigmaDeltaE_ioni_tot);
1924 EnergyLoss eLoss = EnergyLoss(deltaE_tot, sigmaDeltaE_tot, sigmaMinusDeltaE_tot, sigmaPlusDeltaE_tot,
1925 deltaE_ioni_tot, sigmaDeltaE_ioni_tot,
1926 deltaE_rad_tot, sigmaDeltaE_rad_tot, 0.) ;
1930 EnergyLoss eLoss2 (
m_elossupdator->updateEnergyLoss(eLoss, 0, 0, pCaloEntry, 0, elossFlag) );
1932 totalEloss = eLoss2.meanIoni() + eLoss2.meanRad();
1933 meanElossIoni = eLoss2.meanIoni();
1934 sigmaElossIoni = eLoss2.sigmaIoni();
1936 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 68 of file TrkMaterialProviderTool.cxx.
98 return StatusCode::FAILURE;
105 ATH_MSG_ERROR(
"Unable to retrieve MuonSpectrometerEntryLayer volume");
106 return StatusCode::FAILURE;
111 ATH_MSG_ERROR(
"Unable to retrieve CalorimeterEntryLayer volume");
112 return StatusCode::FAILURE;
120 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 1301 of file TrkMaterialProviderTool.cxx.
1334 <<
" with X0, Eloss scales " << scaleX0 <<
" " << scaleEloss
1335 <<
" rep agg upd " << reposition <<
" " << aggregate <<
" " << updateEloss
1336 <<
" caloE " << caloEnergy <<
" +- " << caloEnergyError
1337 <<
" fsrCaloEnergy "<< fsrCaloEnergy
1338 <<
" p " << pCaloEntry <<
" dp " << momentumError);
1350 double sigmaDeltaPhi2_tot = 0.;
1351 double sigmaDeltaTheta2_tot = 0.;
1352 double deltaE_tot = 0.;
1353 double sigmaDeltaE_tot = 0.;
1354 double sigmaPlusDeltaE_tot = 0.;
1355 double sigmaMinusDeltaE_tot = 0.;
1356 double deltaE_ioni_tot = 0.;
1357 double sigmaDeltaE_ioni_tot=0.;
1358 double deltaE_rad_tot = 0.;
1359 double sigmaDeltaE_rad_tot =0.;
1365 double deltaEFirst = 0.;
1368 double deltaTheta = 0.;
1377 std::bitset<Trk::MaterialEffectsBase::NumberOfMaterialEffectsTypes> meotPattern(0);
1381 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
1385 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePatternScat(0);
1388 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePatternDeposit(0);
1390 const auto sqrt12=std::sqrt(12.);
1391 for(
const auto *
m : *matvec) {
1393 if(!
m->trackParameters()) {
1397 if(
m->materialEffectsOnTrack()) {
1398 double X0 =
m->materialEffectsOnTrack()->thicknessInX0();
1419 X0_tot += std::abs(scaleX0 *
X0);
1425 deltaE_tot += std::abs(scaleEloss*energyLoss->
deltaE());
1426 sigmaDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaDeltaE());
1427 sigmaPlusDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaPlusDeltaE());
1428 sigmaMinusDeltaE_tot += std::abs(scaleEloss*energyLoss->
sigmaMinusDeltaE());
1429 deltaE_ioni_tot += std::abs(scaleEloss*energyLoss->
meanIoni());
1430 sigmaDeltaE_ioni_tot += std::abs(scaleEloss*energyLoss->
sigmaIoni());
1431 deltaE_rad_tot += std::abs(scaleEloss*energyLoss->
meanRad());
1432 sigmaDeltaE_rad_tot += std::abs(scaleEloss*energyLoss->
sigmaRad());
1448 deltaEFirst = energyLoss->
deltaE();
1456 wpos +=
w*posNew/2.;
1459 wdist2 +=
w*(pos0-posFirst).
mag2()/2.;
1460 wdist2 +=
w*(posNew-posFirst).
mag2()/2.;
1462 if (!aggregate&&!reposition) {
1464 auto scatNew = ScatteringAngles(
deltaPhi,
1466 std::sqrt(sigmaDeltaPhi2_tot),
1467 std::sqrt(sigmaDeltaTheta2_tot));
1470 sigmaMinusDeltaE_tot,
1471 sigmaPlusDeltaE_tot,
1473 sigmaDeltaE_ioni_tot,
1475 sigmaDeltaE_rad_tot,
1477 auto caloEnergyNew = std::make_unique<CaloEnergy>(energyLossNew);
1478 Eloss_tot += caloEnergyNew->deltaE();
1481 std::make_unique<Trk::MaterialEffectsOnTrack>(
1482 X0_tot, scatNew, std::move(caloEnergyNew), surf, meotPattern);
1483 auto pars =
m->trackParameters()->uniqueClone();
1487 nullptr, std::move(
pars), std::move(meotLast), typePattern);
1492 sigmaDeltaTheta2_tot = 0.;
1493 sigmaDeltaPhi2_tot = 0.;
1495 sigmaDeltaE_tot = 0;
1496 sigmaPlusDeltaE_tot = 0.;
1497 sigmaMinusDeltaE_tot = 0.;
1498 deltaE_ioni_tot = 0.;
1499 sigmaDeltaE_ioni_tot = 0.;
1500 deltaE_rad_tot = 0.;
1501 sigmaDeltaE_rad_tot = 0.;
1504 }
else if(!aggregate&&reposition) {
1506 if(std::abs(
depth)<10.) {
1513 sqrt(sigmaDeltaPhi2_tot),
1514 sqrt(sigmaDeltaTheta2_tot));
1517 sigmaMinusDeltaE_tot,
1518 sigmaPlusDeltaE_tot,
1520 sigmaDeltaE_ioni_tot,
1522 sigmaDeltaE_rad_tot,
1524 auto caloEnergyNew = std::make_unique<CaloEnergy>(energyLossNew);
1525 Eloss_tot += caloEnergyNew->deltaE();
1528 std::make_unique<Trk::MaterialEffectsOnTrack>(
1529 X0_tot, scatNew, std::move(caloEnergyNew), surf, meotPattern);
1530 auto pars =
m->trackParameters()->uniqueClone();
1534 nullptr, std::move(
pars), std::move(meotLast), typePattern);
1538 sigmaDeltaTheta2_tot = 0.;
1539 sigmaDeltaPhi2_tot = 0.;
1541 sigmaDeltaE_tot = 0;
1542 sigmaPlusDeltaE_tot = 0.;
1543 sigmaMinusDeltaE_tot = 0.;
1544 deltaE_ioni_tot = 0.;
1545 sigmaDeltaE_ioni_tot = 0.;
1546 deltaE_rad_tot = 0.;
1547 sigmaDeltaE_rad_tot = 0.;
1554 auto energyLoss0 = std::make_unique<Trk::EnergyLoss>(0.,0.,0.,0.);
1555 auto scatFirst = ScatteringAngles(
deltaPhi,
1557 std::sqrt(sigmaDeltaPhi2_tot / 2.),
1558 std::sqrt(sigmaDeltaTheta2_tot / 2.));
1564 std::sqrt(sigmaDeltaPhi2_tot / 2.),
1565 std::sqrt(sigmaDeltaTheta2_tot / 2.));
1568 sigmaMinusDeltaE_tot,
1569 sigmaPlusDeltaE_tot,
1571 sigmaDeltaE_ioni_tot,
1573 sigmaDeltaE_rad_tot,
1575 auto caloEnergyNew = std::make_unique<CaloEnergy>(energyLossNew);
1576 Eloss_tot += caloEnergyNew->deltaE();
1592 std::make_unique<Trk::MaterialEffectsOnTrack>(
1593 X0_tot / 2., scatFirst, std::move(energyLoss0), surfFirst, meotPattern);
1595 std::make_unique<Trk::MaterialEffectsOnTrack>(
1596 X0_tot / 2., scatNew, std::move(caloEnergyNew), surfLast, meotPattern);
1600 double qOverP0 =
m->trackParameters()->charge()/ (
m->trackParameters()->momentum().mag()-std::abs(energyLoss->
deltaE()));
1603 std::unique_ptr<Trk::TrackParameters> parsFirst =
1605 0., 0.,
dir.phi(),
dir.theta(), qOverP0);
1607 double qOverPNew =
m->trackParameters()->charge() /
1608 m->trackParameters()->momentum().mag();
1609 std::unique_ptr<Trk::TrackParameters> parsLast =
1611 0., 0.,
dir.phi(),
dir.theta(), qOverPNew);
1616 nullptr, std::move(parsFirst), std::move(meotFirst), typePattern);
1619 nullptr, std::move(parsLast), std::move(meotLast), typePattern);
1626 sigmaDeltaTheta2_tot = 0.;
1627 sigmaDeltaPhi2_tot = 0.;
1629 sigmaDeltaE_tot = 0;
1630 sigmaPlusDeltaE_tot = 0.;
1631 sigmaMinusDeltaE_tot = 0.;
1632 deltaE_ioni_tot = 0.;
1633 sigmaDeltaE_ioni_tot = 0.;
1634 deltaE_rad_tot = 0.;
1635 sigmaDeltaE_rad_tot = 0.;
1644 if (aggregate&&reposition) {
1651 bool threePlanes =
false;
1652 if (std::abs(
pos.z()) < 6700 &&
pos.perp() < 4200)
1658 std::sqrt(sigmaDeltaPhi2_tot / 2.),
1659 std::sqrt(sigmaDeltaTheta2_tot / 2.));
1663 std::sqrt(sigmaDeltaPhi2_tot / 2.),
1664 std::sqrt(sigmaDeltaTheta2_tot / 2.));
1667 sigmaMinusDeltaE_tot,
1668 sigmaPlusDeltaE_tot,
1670 sigmaDeltaE_ioni_tot,
1672 sigmaDeltaE_rad_tot,
1676 << energyLoss2.
deltaE() <<
" meanIoni "
1677 << energyLoss2.
meanIoni() <<
" sigmaIoni "
1678 << energyLoss2.
sigmaIoni() <<
" X0_tot " << X0_tot);
1683 double calE = caloEnergy;
1684 double calEr = caloEnergyError;
1687 if (!useMeasuredEnergy)
1693 energyLoss2, calE, calEr, pCaloEntry, momentumError, elossFlag)
1694 : EnergyLoss(deltaE_tot,
1696 sigmaMinusDeltaE_tot,
1697 sigmaPlusDeltaE_tot,
1699 sigmaDeltaE_ioni_tot,
1701 sigmaDeltaE_rad_tot,
1703 auto caloEnergyNew = std::make_unique<CaloEnergy>(energyLossNew);
1706 << energyLossNew.
deltaE() <<
" meanIoni "
1707 << energyLossNew.
meanIoni() <<
" sigmaIoni "
1710 caloEnergyNew->set_measEnergyLoss(caloEnergy, caloEnergyError);
1712 caloEnergyNew->set_fsrCandidateEnergy(fsrCaloEnergy);
1720 int eLossFlagTmp = 0;
1725 ATH_MSG_DEBUG(
" modifyTSOSvector energyLossParam Eloss " << energyLossParam.
deltaE() <<
" on TSOS " << energyLossNew.
deltaE() <<
" calE " << calE);
1726 Eloss_tot += caloEnergyNew->deltaE();
1737 double halflength2 = wdist2/w_tot - (
pos-posFirst).
mag()*(
pos-posFirst).
mag();
1738 double halflength = 0.;
1739 if(halflength2>0) halflength = sqrt(halflength2);
1745 double scaleCalo = 1.;
1746 double scaleCaloNew = std::abs(pos0.z())/6700;
1747 if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
1748 scaleCaloNew = std::abs(posNew.z())/6700;
1749 if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
1750 scaleCaloNew = std::abs(pos0.perp())/4200;
1751 if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
1752 scaleCaloNew = std::abs(posNew.perp())/4200;
1753 if(scaleCaloNew>scaleCalo) scaleCalo = scaleCaloNew;
1756 pos0 = pos0/scaleCalo;
1758 posNew = posNew/scaleCalo;
1759 halflength = halflength/scaleCalo;
1760 ATH_MSG_VERBOSE(
" position scattering planes inside calo scale factor " << scaleCalo);
1772 std::unique_ptr<Trk::TrackParameters> parsFirst =
1774 0., 0.,
dir.phi(),
dir.theta(), qOverP0);
1775 std::unique_ptr<Trk::TrackParameters> parsLast =
1777 0., 0.,
dir.phi(),
dir.theta(), qOverPNew);
1786 std::make_unique<Trk::MaterialEffectsOnTrack>(X0_tot / 2.,
1794 std::make_unique<Trk::MaterialEffectsOnTrack>(X0_tot / 2.,
1796 std::move(caloEnergyNew),
1803 nullptr, std::move(parsFirst), std::move(meotFirst), typePattern);
1807 nullptr, std::move(parsLast), std::move(meotLast), typePatternDeposit)
1808 :
new Trk::TrackStateOnSurface(
1809 nullptr, std::move(parsLast), std::move(meotLast), typePattern));
1818 std::unique_ptr<Trk::TrackParameters>
pars =
1820 0., 0.,
dir.phi(),
dir.theta(), qOverPNew);
1825 std::make_unique<Trk::MaterialEffectsOnTrack>(
1826 X0_tot / 2., scatFirst,
nullptr, surfFirst, meotPattern);
1831 std::make_unique<Trk::MaterialEffectsOnTrack>(
1832 0.,std::nullopt, std::move(caloEnergyNew), surf, meotPattern);
1837 std::make_unique<Trk::MaterialEffectsOnTrack>(
1838 X0_tot / 2., scatNew,
nullptr, surfLast, meotPattern);
1843 nullptr, std::move(parsFirst), std::move(meotFirst), typePatternScat);
1845 nullptr, std::move(
pars), std::move(meot), typePatternDeposit);
1848 nullptr, std::move(parsLast), std::move(meotLast), typePatternScat);
1860 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 1254 of file TrkMaterialProviderTool.cxx.
1257 std::string volGeo=
"ID";
1258 if(ivolGeo==2) volGeo=
"CALO";
1259 else if(ivolGeo==3) volGeo=
"MS";
1261 <<
" Volume "<<std::left<<std::setw(5)<<volGeo
1262 <<
" r "<<std::left<<std::setw(10)<<
m->surface().globalReferencePoint().perp()
1263 <<
" z "<<std::left<<std::setw(10)<<
m->surface().globalReferencePoint().z());
1264 if(
m->materialEffectsOnTrack()) {
1265 ATH_MSG_VERBOSE(
" -> Material: X0 "<<std::left<<std::setw(10)<<
m->materialEffectsOnTrack()->thicknessInX0());
1270 ATH_MSG_DEBUG(
" geo " << volGeo <<
" radius " <<
m->surface().globalReferencePoint().perp() <<
" z " <<
m->surface().globalReferencePoint().z() <<
" TSOS Eloss " <<energyLoss->
deltaE());
1271 std::string
type=
"P";
1276 <<
" MopIoni "<<std::left<<std::setw(10)<<energyLoss->
meanIoni()<<
" +- "<<std::left<<std::setw(10)<<energyLoss->
sigmaIoni()
1277 <<
" MeanRad "<<std::left<<std::setw(10)<<energyLoss->
meanRad()<<
" +- "<<std::left<<std::setw(10)<<energyLoss->
sigmaRad() );
1282 " dTheta "<<std::left<<std::setw(10)<<scatAngles->
deltaTheta()<<
" +- "<<std::left<<std::setw(10)<<scatAngles->
sigmaDeltaTheta());
1286 if(
m->trackParameters()) {
1287 ATH_MSG_VERBOSE(
" -> TP: r "<<std::left<<std::setw(10)<<
m->trackParameters()->position().perp()
1288 <<
" z "<<std::left<<std::setw(10)<<
m->trackParameters()->position().z()
1289 <<
" phi0 "<<std::left<<std::setw(10)<<
m->trackParameters()->parameters()[
Trk::phi0]
1291 if(
m->trackParameters()->covariance()) {
1293 <<
" 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 1034 of file TrkMaterialProviderTool.cxx.
1041 caloTSOS->erase( std::remove_if(caloTSOS->begin(),
1044 if (state && this_->getVolumeByGeo(state)==3) {
◆ removeOutOfCalo()
Helper to remove MS and ID TSOS.
Definition at line 1010 of file TrkMaterialProviderTool.cxx.
1017 caloTSOS->erase( std::remove_if(caloTSOS->begin(),
1020 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 245 of file TrkMaterialProviderTool.cxx.
247 ATH_MSG_VERBOSE(
"updateCaloTSOS(Trk::Track& idTrack, Trk::Track& extrapolatedTrack)");
252 auto inputTSOS_MS = std::make_unique<Trk::TrackStates>();
254 inputTSOS_MS->push_back (tsos->clone());
263 if(this->
getVolumeByGeo(*itID)==1 && (*itID)->trackParameters()) {
267 if(itID==itFront)
break;
277 for(;
it!=itEnd; ++
it) {
283 if(firstCALO==inputTSOS_MS->end() && this->getVolumeByGeo(*
it)==2)
288 if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
295 if(firstCALO == inputTSOS_MS->end()) {
299 if(lastIDwP == inputTSOS_ID->
end()) {
304 if(firstMS == inputTSOS_MS->end()) {
314 firstMSnotPerigee=firstMS+1;
321 printTSOS(*firstMSnotPerigee,
"FIRST MS");
322 if(firstMSwP != inputTSOS_MS->end())
328 double X0ScaleMS = 0.;
329 double ElossScaleMS = 0.;
333 (*firstMSnotPerigee)->surface(),
336 Eloss, X0ScaleMS, ElossScaleMS,
337 (firstMSwP == inputTSOS_MS->end()) ?
nullptr : (*firstMSwP)->trackParameters(),
342 if(!caloTSOS || caloTSOS->
size()!=3) {
343 ATH_MSG_WARNING(
"Unable to retrieve Calorimeter TSOS from extrapolateM (null or <3)");
350 for(
auto m : *inputTSOS_ID)
printTSOS(
m,
"ID TSOS");
351 ATH_MSG_VERBOSE(
"OLD-MS TSOS multiplicity : " << inputTSOS_MS->size());
352 for(
auto m : *inputTSOS_MS)
printTSOS(
m,
"OLD-MS TSOS");
356 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 133 of file TrkMaterialProviderTool.cxx.
135 ATH_MSG_VERBOSE(
"updateCaloTSOS(Trk::Track& track, const Trk::TrackParameters* startParameters)");
141 auto inputTSOS = std::make_unique<Trk::TrackStates>();
143 inputTSOS->push_back (tsos->clone());
155 for(;
it!=itEnd; ++
it) {
163 if(firstCALO==inputTSOS->end() && this->getVolumeByGeo(*
it)==2 && firstMS==itEnd)
165 else if(this->
getVolumeByGeo(*it)==3 && firstCALO!=inputTSOS->end()) {
168 if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
176 if(lastIDwP != inputTSOS->end()) {
180 startParameters = (*lastIDwP)->trackParameters();
183 if(lastIDwP == inputTSOS->end() && !startParameters) {
184 ATH_MSG_WARNING(
"Unable to find starting parameters for extrapolation");
188 if(firstCALO == inputTSOS->end()) {
192 if(firstMS == inputTSOS->end()) {
202 firstMSnotPerigee=firstMS+1;
208 printTSOS(*firstMSnotPerigee,
"FIRST MS");
211 double X0ScaleMS = 0.;
212 double ElossScaleMS = 0.;
216 (*firstMSnotPerigee)->surface(),
219 Eloss, X0ScaleMS, ElossScaleMS,
220 (firstMSwP == inputTSOS->end()) ?
nullptr : (*firstMSwP)->trackParameters(),
224 if(!caloTSOS || caloTSOS->
size()!=3) {
225 ATH_MSG_WARNING(
"Unable to retrieve Calorimeter TSOS from extrapolateM (null or <3)");
232 for(
auto m : *inputTSOS) this->
printTSOS(
m,
"OLD TSOS");
236 this->
updateVectorMS(inputTSOS.get(),firstMS,X0ScaleMS,ElossScaleMS);
239 track.setTrackStateOnSurfaces (std::move (inputTSOS));
◆ updateVector()
Helper to update entries in the vector.
Definition at line 1059 of file TrkMaterialProviderTool.cxx.
1066 unsigned int ntoupdate=0;
1068 while(
it!=firstMS) {
1074 if(ntoupdate==caloTSOS->
size()) {
1079 while(
i<ntoupdate) {
◆ updateVectorMS()
update the TSOS vector for the Muon Spectrometer applying X0 and Eloss scaling
Definition at line 1089 of file TrkMaterialProviderTool.cxx.
1098 std::bitset<Trk::MaterialEffectsBase::NumberOfMaterialEffectsTypes> meotPattern(0);
1101 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
1105 if(X0ScaleMS<0.5||ElossScaleMS<0.5||X0ScaleMS>2.||ElossScaleMS>2.) {
1106 ATH_MSG_WARNING(
"Too large or too small X0ScaleMS " << X0ScaleMS <<
" ElossScaleMS " << ElossScaleMS);
1111 int msMatStates = 0;
1112 int msMatParStates = 0;
1116 for(;
it!= inputTSOS->
end();++
it) {
1118 if((*it)->materialEffectsOnTrack()) {
1136 double deltaE = (ElossScaleMS * energyLoss->
deltaE());
1137 double sigmaDeltaE = (ElossScaleMS * energyLoss->
sigmaDeltaE());
1138 double sigmaPlusDeltaE =
1140 double sigmaMinusDeltaE =
1142 double deltaE_ioni = (ElossScaleMS * energyLoss->
meanIoni());
1143 double sigmaDeltaE_ioni = (ElossScaleMS * energyLoss->
sigmaIoni());
1144 double deltaE_rad = (ElossScaleMS * energyLoss->
meanRad());
1145 double sigmaDeltaE_rad = (ElossScaleMS * energyLoss->
sigmaRad());
1149 std::cout <<
" updateVectorMS Old Eloss " << energyLoss->
deltaE()
1150 <<
" new Eloss " << deltaE << std::endl;
1152 auto energyLossNew = std::make_unique<Trk::EnergyLoss>(deltaE,
1163 std::make_unique<Trk::MaterialEffectsOnTrack>(X0ScaleMS * meot->
thicknessInX0(),
1165 std::move(energyLossNew),
1168 std::unique_ptr<Trk::TrackParameters>
pars{};
1169 if ((*it)->trackParameters())
1170 pars = (*it)->trackParameters()->uniqueClone();
1174 nullptr, std::move(
pars), std::move(newMeot), typePattern);
1180 delete newTSOSvector;
1189 std::cout <<
" msStates " << msStates <<
" msMatStates " << msMatStates <<
" msMatParStates " << msMatParStates << std::endl;
1192 for(
it = firstMS;
it!= inputTSOS->
end();++
it) {
1193 if((*it)->materialEffectsOnTrack()) {
1200 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
◆ 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 218 of file TrkMaterialProviderTool.h.
◆ m_indetVolume
◆ 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 200 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
bool inside(const Amg::Vector3D &gp, double tol=0.) const
Inside() method for checks.
@ 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.
Ensure that the ATLAS eigen extensions are properly loaded.
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