|
ATLAS Offline Software
|
#include <TrackDepositInCaloTool.h>
|
| TrackDepositInCaloTool (const std::string &type, const std::string &name, const IInterface *pInterface) |
|
virtual | ~TrackDepositInCaloTool ()=default |
|
StatusCode | initialize () override |
|
std::vector< DepositInCalo > | getDeposits (const Trk::TrackParameters *par, const CaloCellContainer *caloCellCont) const override |
| Fills the vector of DepositInCalo using TrackParameters as input. More...
|
|
std::vector< DepositInCalo > | getDeposits (const xAOD::TrackParticle *tp, const CaloCellContainer *caloCellCont, const CaloExtensionCollection *extensionCache) const override |
|
std::vector< DepositInCalo > | deposits (const Trk::TrackParameters *par, const CaloCellContainer *cellContainer) const override |
|
Trk::Surface * | createSurface (const CaloDetDescriptor *descr, CaloSurfaceType type) const override |
| Creates a Trk::Surface for a calorimeter region that is described by CaloDetDescr. More...
|
|
double | calcEnergy (const Trk::TrackParameters *par, const Trk::ParticleHypothesis &particleHypo) const override |
| Calculate the energy using \( E^2 = m^2 + p^2 \). 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 |
|
|
std::unique_ptr< const Trk::TrackParameters > | extrapolateToSolenoid (const EventContext &ctx, const Trk::TrackParameters *par, bool oppositeMomentum=false) const |
|
StatusCode | bookHistos () |
| Create histograms and register them to HistSvc. More...
|
|
const CaloCell * | getClosestCell (const CaloDetDescrManager *caloDDM, const Trk::TrackParameters *par, const CaloDetDescriptor *descr, const CaloCellContainer *cellContainer) const |
| Retrieve the CaloCell for which its center is closest to the position of the particle. More...
|
|
const CaloCell * | getClosestCellTile (const CaloDetDescrManager *caloDDM, const Trk::TrackParameters *par, const CaloDetDescriptor *descr, const CaloCellContainer *caloCellCont) const |
|
std::vector< const CaloCell * > | getCaloCellsForLayer (const CaloDetDescrManager *caloDDM, const CaloDetDescriptor *descr, const Trk::TrackParameters *parEntrance, const Trk::TrackParameters *parExit, const CaloCellContainer *caloCellCont) const |
|
std::vector< const CaloCell * > | getCaloCellsForTile (const CaloDetDescrManager *caloDDM, const CaloDetDescriptor *descr, const Trk::TrackParameters *parEntrance, const Trk::TrackParameters *parExit, const CaloCellContainer *caloCellCont) const |
|
StatusCode | getTraversedLayers (const CaloDetDescrManager *caloDDM, const Trk::TrackParameters *par, std::map< double, const CaloDetDescriptor * > &caloInfo, std::vector< Amg::Vector3D > &extrapolations) const |
| This function determines which calorimeter regions the tracks traverses. More...
|
|
std::unique_ptr< const Trk::TrackParameters > | extrapolateToEntranceOfLayer (const EventContext &ctx, const Trk::TrackParameters *par, const CaloDetDescriptor *descr) const |
|
std::unique_ptr< const Trk::TrackParameters > | extrapolateToExitOfLayer (const EventContext &ctx, const Trk::TrackParameters *par, const CaloDetDescriptor *descr) const |
|
LayerMaps | initializeDetectorInfo (const CaloDetDescrManager *caloDDM) const |
|
Hists & | getHists () 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...
|
|
|
static std::unique_ptr< Amg::Vector3D > | extrapolateR (const Amg::Vector3D &initialPosition, double phi0, double theta0, double r) |
| Extrapolate track to cylinder surface along straight line. More...
|
|
static std::unique_ptr< Amg::Vector3D > | extrapolateZ (const Amg::Vector3D &initialPosition, double phi0, double theta0, double z) |
| Extrapolate track to disc surface along straight line. More...
|
|
static const CaloCell * | getClosestCellLAr (const CaloDetDescrManager *caloDDM, const Trk::TrackParameters *par, const CaloDetDescriptor *descr, const CaloCellContainer *caloCellCont) |
|
static double | distance (const Amg::Vector3D &p1, const Amg::Vector3D &p2) |
|
static bool | isInsideDomain (double position, double domainCenter, double domainWidth, bool phiVariable=false) |
|
static bool | isInsideCell (const Amg::Vector3D &position, const CaloCell *cell) |
|
static bool | inCell (const CaloCell *cell, const Amg::Vector3D &pos) |
|
Tool to get the energy that is deposited by a particle in the calorimeter.
The core method of this tool is the deposits function that returns a std::vector of DepositInCalo. All other methods are essentially helper functions for this one.
- Author
- Gustavo.Ordonez.Sanz Gusta.nosp@m.vo.O.nosp@m.rdone.nosp@m.z.Sa.nosp@m.nz@ce.nosp@m.rn.c.nosp@m.h
-
Marcel Raas marce.nosp@m.lra@.nosp@m.cern..nosp@m.ch
Definition at line 41 of file TrackDepositInCaloTool.h.
◆ StoreGateSvc_t
◆ TrackDepositInCaloTool()
TrackDepositInCaloTool::TrackDepositInCaloTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
pInterface |
|
) |
| |
◆ ~TrackDepositInCaloTool()
virtual TrackDepositInCaloTool::~TrackDepositInCaloTool |
( |
| ) |
|
|
virtualdefault |
◆ bookHistos()
StatusCode TrackDepositInCaloTool::bookHistos |
( |
| ) |
|
|
private |
Create histograms and register them to HistSvc.
Definition at line 1007 of file TrackDepositInCaloTool.cxx.
1010 ATH_MSG_FATAL(
"Filling histograms not supported in MT jobs.");
1011 return StatusCode::FAILURE;
1015 m_h = std::make_unique<Hists>();
1017 return StatusCode::SUCCESS;
◆ calcEnergy()
Calculate the energy using \( E^2 = m^2 + p^2 \).
- Parameters
-
par | Input TrackParameters |
particleHypo | Particle type. This determines the mass. |
Definition at line 629 of file TrackDepositInCaloTool.cxx.
632 double pX =
par->momentum().x();
633 double pY =
par->momentum().y();
634 double pZ =
par->momentum().z();
635 return std::sqrt(
mass *
mass + pX * pX + pY * pY + pZ * pZ);
◆ createSurface()
Creates a Trk::Surface for a calorimeter region that is described by CaloDetDescr.
Works for both cylindrical and disc-like surfaces. The side of a cylindrical detector element is a disc and vice-versa. Don't forget to clear memory. CaloSurfaceType can be Entrance, Middle, Exit, Inside, Outside. Inside is the boundary of the region closest to the center of the detector, outside is the boundary that is furthest away.
- Parameters
-
descr | The CaloDetDescriptor for the surface that you want to create. |
type | What type of surface to create. |
Definition at line 831 of file TrackDepositInCaloTool.cxx.
841 if (
descr->is_tile() ||
descr->is_lar_em_barrel()) {
843 if (
type >= Entrance &&
type <= Exit) {
844 double thickness =
descr->calo_r_max() -
descr->calo_r_min();
845 double halfLength = (
descr->calo_z_max() -
descr->calo_z_min()) / 2;
846 double middle =
descr->calo_z_min() + halfLength;
852 }
else if (
type == Inside ||
type == Outside) {
854 if (
type == Inside) {
862 ATH_MSG_WARNING(
"Type error in CaloTrkMuIdDetStore::createSurface().");
867 if (
type >= Entrance &&
type <= Exit) {
868 double thickness =
descr->calo_z_max() -
descr->calo_z_min();
872 }
else if (
type == Inside ||
type == Outside) {
874 if (
type == Inside) {
879 double halfLength = (
descr->calo_z_max() -
descr->calo_z_min()) / 2.0;
884 ATH_MSG_WARNING(
"Type error in CaloTrkMuIdDetStore::createSurface().");
◆ 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]
◆ deposits()
Definition at line 478 of file TrackDepositInCaloTool.cxx.
491 std::vector<DepositInCalo>
result;
492 const EventContext& ctx = Gaudi::Hive::currentContext();
498 if (!caloDetDescrMgrHandle.isValid()) {
505 bool checkBoundary =
true;
508 std::vector<Amg::Vector3D> extrapolations;
509 std::map<double, const CaloDetDescriptor*> caloInfo;
512 if (
getTraversedLayers(caloDDM, parAtSolenoid.get(), caloInfo, extrapolations).isFailure()) {
522 for (
const std::pair<const double, const CaloDetDescriptor*>&
it : caloInfo) {
524 double energyEntrance{0}, energyExit{0},
energyDeposit{0}, ETDeposit{0}, energyLoss{0};
525 bool eLossFound =
false;
536 std::unique_ptr<const Trk::TrackParameters> paramEntrance{
538 if (!paramEntrance) {
542 const Amg::Vector3D& posVecEntrance = paramEntrance->position();
543 if (!surfEntrance->isOnSurface(posVecEntrance, checkBoundary)) {
546 std::unique_ptr<const Trk::TrackParameters> paramOnInside{
550 paramEntrance.swap(paramOnInside);
558 energyEntrance =
calcEnergy(paramEntrance.get(), muonHypo);
562 std::unique_ptr<const Trk::TrackParameters> paramMiddle{
569 ETDeposit =
cell->et();
573 std::unique_ptr<const Trk::TrackParameters> paramExit;
578 energyExit =
calcEnergy(paramExit.get(), muonHypo);
588 energyExit =
calcEnergy(paramExit.get(), muonHypo);
608 energyLoss = eLossFound ? -(energyExit - energyEntrance) : 0;
614 h.m_hParELossEta->Fill(energyLoss, itP->eta());
615 h.m_hParELossSample->Fill(energyLoss,
sample);
622 ATH_MSG_VERBOSE(
"---TRACKDEPOSITINCALOTOOL---TRACKDEPOSITINCALOTOOL---TRACKDEPOSITINCALOTOOL");
◆ detStore()
◆ distance()
Definition at line 1124 of file TrackDepositInCaloTool.cxx.
1125 double diff_x =
p1.x() -
p2.x();
1126 double diff_y =
p1.y() -
p2.y();
1127 double diff_z =
p1.z() -
p2.z();
1128 return std::hypot(diff_x, diff_y, diff_z);
◆ 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
◆ extrapolateR()
Extrapolate track to cylinder surface along straight line.
(x0, y0, z0) is the starting position, (phi0,theta0) is the direction of the momentum, r is the bound of the cylinder. The values are returned in (xe, ye, ze).
Definition at line 701 of file TrackDepositInCaloTool.cxx.
703 double x0 = initialPosition.x();
704 double y0 = initialPosition.y();
705 double z0 = initialPosition.z();
709 double det =
b *
b - 4 *
c;
714 lsin = (-
b + std::sqrt(
det)) / 2;
720 if (std::abs(xe * xe + ye * ye -
r *
r) > 10 &&
det > 0) {
725 return std::make_unique<Amg::Vector3D>(xe, ye, ze);
◆ extrapolateToEntranceOfLayer()
Definition at line 361 of file TrackDepositInCaloTool.cxx.
365 std::unique_ptr<const Trk::TrackParameters> paramEntrance;
366 bool checkBoundary =
true;
376 if (!paramEntrance) {
377 ATH_MSG_DEBUG(
"Extrapolation to entrance failed without boundary check.");
382 if (surfEntrance->isOnSurface(posVecEntrance, checkBoundary)) {
383 ATH_MSG_VERBOSE(
"Successfully extrapolated to entrance of calo for sample " <<
descr->getSampling());
384 return paramEntrance;
388 std::unique_ptr<const Trk::TrackParameters> paramOnInside{
391 ATH_MSG_VERBOSE(
"Successfully extrapolated to inner side of calo for sample " <<
descr->getSampling());
392 paramEntrance.swap(paramOnInside);
398 return paramEntrance;
◆ extrapolateToExitOfLayer()
Definition at line 404 of file TrackDepositInCaloTool.cxx.
407 std::unique_ptr<const Trk::TrackParameters> paramExit;
408 bool checkBoundary =
true;
425 if (!surfOutside) {
return nullptr; }
428 ATH_MSG_VERBOSE(
"Succesfully extrapolated to outer side of calo for sample " <<
descr->getSampling());
◆ extrapolateToSolenoid()
Definition at line 438 of file TrackDepositInCaloTool.cxx.
446 constexpr
double halfLengthOfCylinder = 3700;
447 bool checkBoundary =
true;
451 std::unique_ptr<const Trk::TrackParameters> parAtSolenoid{
452 m_extrapolator->extrapolate(ctx, *
par, solenoid, direction, checkBoundary, muonHypo)};
453 if (!parAtSolenoid) {
455 double zTrans =
par->eta() > 0 ? halfLengthOfCylinder : -halfLengthOfCylinder;
458 parAtSolenoid =
m_extrapolator->extrapolate(ctx, *
par, disc, direction, checkBoundary, muonHypo);
460 if (!parAtSolenoid) {
461 ATH_MSG_VERBOSE(
"extrapolateToSolenoid(): Extrapolation to cap of solenoid failed. Trying opposite side.");
463 parAtSolenoid =
m_extrapolator->extrapolate(ctx, *
par, discOpp, direction, checkBoundary, muonHypo);
466 if (parAtSolenoid) {
ATH_MSG_VERBOSE(
"extrapolateToSolenoid(): Extrapolation succeeded for disc-type surface."); }
469 ATH_MSG_VERBOSE(
"extrapolateToSolenoid(): Extrapolation succeeded for cylinder-type surface.");
472 return parAtSolenoid;
◆ extrapolateZ()
Extrapolate track to disc surface along straight line.
Parameter explanation in the same line as for extrapolateR().
Definition at line 731 of file TrackDepositInCaloTool.cxx.
733 double x0 = initialPosition.x();
734 double y0 = initialPosition.y();
735 double z0 = initialPosition.z();
736 double cosTheta0 =
std::cos(theta0);
738 double dist =
z -
z0;
739 double lambda = dist / cosTheta0;
748 return std::make_unique<Amg::Vector3D>(xe, ye, ze);
◆ getCaloCellsForLayer()
◆ getCaloCellsForTile()
Definition at line 261 of file TrackDepositInCaloTool.cxx.
271 std::vector<const CaloCell*>
result{};
273 double phiPar = parEntrance->
position().phi();
274 double phiParEntrance = phiPar;
275 double zParEntrance = parEntrance->
position().z();
276 double phiParExit = parExit->
position().phi();
277 double zParExit = parExit->
position().z();
278 double diffZPar = zParExit - zParEntrance;
279 double etaPar = parEntrance->
position().eta();
281 double etaWidth = 2 * (
descr->calo_eta_max() -
descr->calo_eta_min()) /
descr->n_eta();
282 double etaMin = etaPar - etaWidth;
283 double etaMax = etaPar + etaWidth;
291 std::vector<IdentifierHash> vecHash;
295 std::map<double, const CaloCell*> neighbourMap0;
296 std::map<double, const CaloCell*> neighbourMap1;
304 double dPhiCell = dde->
dphi();
305 double phiCellMin = dde->
phi() - dPhiCell / 2;
306 double phiCellMax = phiCellMin + dPhiCell;
307 if (!(phiParEntrance > phiCellMin && phiParExit < phiCellMax) && !(phiParExit > phiCellMin && phiParExit < phiCellMax)) {
312 double zCellMin0{0}, zCellMax0{0}, zCellMin1{0}, zCellMax1{0};
320 zCellMin0 = cellDim->
getZMin(0);
321 zCellMax0 = cellDim->
getZMax(0);
322 zCellMin1 = cellDim->
getZMin(3);
323 zCellMax1 = cellDim->
getZMax(3);
325 zCellMin0 = cellDim->
getZMin(0);
326 zCellMax0 = cellDim->
getZMax(0);
327 zCellMin1 = zCellMin0;
328 zCellMax1 = zCellMax0;
333 if (zParEntrance >= zCellMin0 && zParEntrance <= zCellMax0 && phiParEntrance > phiCellMin && phiParEntrance < phiCellMax) {
338 if (zParExit >= zCellMin1 && zParExit <= zCellMax1 && phiParExit > phiCellMin && phiParExit < phiCellMax) {
344 if (zParEntrance < zCellMin0 && zParExit > zCellMax1) {
349 if (zParEntrance > zCellMax0 && zParExit < zCellMin1) {
◆ getClosestCell()
Retrieve the CaloCell for which its center is closest to the position of the particle.
- Parameters
-
par | TrackParameters of the particle. |
descr | Calorimeter detector region information. Only cells from this detector region are considered. |
Definition at line 895 of file TrackDepositInCaloTool.cxx.
908 if (
descr->is_tile()) {
◆ getClosestCellLAr()
◆ getClosestCellTile()
Definition at line 940 of file TrackDepositInCaloTool.cxx.
946 std::map<double, const CaloCell*> neighbourMap;
949 double etaPar =
par->position().eta();
950 double phiPar =
par->position().phi();
951 double etaWidth = 2 * (
descr->calo_eta_max() -
descr->calo_eta_min()) /
descr->n_eta();
952 double etaMin = etaPar - etaWidth;
953 double etaMax = etaPar + etaWidth;
963 std::vector<IdentifierHash> vecHash;
967 double dR2Min{ 999 };
976 const double etaCell = dde->
eta();
977 const double phiCell = dde->
phi();
978 const double dEta = etaPar - etaCell;
981 neighbourMap[sqrt(dR2)] =
cell;
991 for (
const std::pair<const double, const CaloCell*>& mapIt : neighbourMap) {
◆ getDeposits() [1/2]
Fills the vector of DepositInCalo using TrackParameters as input.
- Parameters
-
par | TrackParameters to be used as input. The parameters are assumed to be within the solenoid volume. |
deltaR | Unused parameter. Kept for backward compatibility. |
inCell | Unused parameter. Kept for backward compatibility. |
Definition at line 70 of file TrackDepositInCaloTool.cxx.
72 const EventContext& ctx = Gaudi::Hive::currentContext();
74 std::vector<DepositInCalo>
result;
79 if (!caloCellCont)
return result;
82 if (!caloDetDescrMgrHandle.isValid()) {
91 std::vector<Amg::Vector3D> extrapolations;
92 std::map<double, const CaloDetDescriptor*> caloInfo;
98 if (
getTraversedLayers(caloDDM,currentPar.get(), caloInfo, extrapolations).isFailure()) {
104 for (
const std::pair<const double, const CaloDetDescriptor*>& detDescrIt : caloInfo) {
117 currentPar.swap(parEntrance);
121 double energyLoss =
calcEnergy(parEntrance.get(), muonHypo) -
calcEnergy(parExit.get(), muonHypo);
124 std::vector<const CaloCell*>
cells =
128 double sumEnergy = 0;
132 sumEnergy +=
cell->energy();
139 ATH_MSG_DEBUG(
"Energy = " << sumEnergy <<
" for sample " <<
descr->getSampling() <<
" in " <<
cells.size() <<
" cells.");
143 currentPar.swap(parEntrance);
◆ getDeposits() [2/2]
Definition at line 151 of file TrackDepositInCaloTool.cxx.
153 ATH_MSG_DEBUG(
"In TrackDepositsInCaloTool::getDeposits() - new");
154 std::vector<DepositInCalo>
result;
159 std::unique_ptr<const Rec::ParticleCellAssociation>
association =
167 std::vector<std::pair<const CaloCell*, Rec::ParticleCellIntersection*>> cellIntersections =
association->cellIntersections();
176 ATH_MSG_DEBUG(
" nr of cell intersections " << cellIntersections.size());
177 if (cellIntersections.size() < 3)
ATH_MSG_WARNING(
" Strange nr of calorimeter cell intersections " << cellIntersections.size());
187 std::vector<float> exp_E(
nSamples, 0.0);
188 std::vector<float> meas_E(
nSamples, 0.0);
189 std::vector<float> meas_Et(
nSamples, 0.0);
190 std::vector<int> LayerHit(
nSamples, 0);
196 for (
auto&
it : cellIntersections) {
198 if (curr_cell->
badcell())
continue;
204 lEntry =
pos->second.first;
205 lExit =
pos->second.second;
207 meas_E[cellSampling] += Float_t(curr_cell->
energy());
208 meas_Et[cellSampling] += Float_t(curr_cell->
energy() * curr_cell->
sinTh());
209 exp_E[cellSampling] = Float_t((
it.second)->expectedEnergyLoss());
210 LayerHit[cellSampling]++;
212 <<
" Exp : " << (
it.second)->expectedEnergyLoss());
219 if (LayerHit[
i] > 0) {
222 ATH_MSG_DEBUG(
" Layer : " <<
sample <<
" Energy = " << meas_E[
i] <<
" nCells : " << LayerHit[
i] <<
" Exp: " << exp_E[
i]);
◆ getHists()
◆ getTraversedLayers()
This function determines which calorimeter regions the tracks traverses.
The vector caloInfo and extrapolations are returned. Straight line approximation is employed in the calorimeter regions after the parameters are extrapolated to the surface of the solenoid. This accounts for the magnetic field bending. Covers EMB, TileBar, TileExt, EME and HEC acceptance. The FCAL and TileGap regions are not included. Do not forget to check the StatusCode.
- Parameters
-
par | Input track parameters |
caloInfo | Resulting vector of CaloDetDescriptor that is traversed. |
extrapolations | Resulting vector of straight-line extrapolations that were obtained. |
Definition at line 758 of file TrackDepositInCaloTool.cxx.
770 bool parIsAtSolenoid =
true;
771 if (parIsAtSolenoid) parAtSolenoid =
par;
777 double deltaR_solLast = std::abs(parAtSolenoid->
position().perp() -
par->position().perp());
778 double deltaEta_solLast = std::abs(parAtSolenoid->
position().eta() -
par->position().eta());
781 h.m_hDeltaEtaLastPar->Fill(deltaEta_solLast);
782 h.m_hDeltaRadiusLastPar->Fill(deltaR_solLast);
786 double theta0 = parAtSolenoid->
momentum().theta();
790 for (
const std::pair<
const double, std::vector<const CaloDetDescriptor*>>& mapIt : layerMaps.m_barrelLayerMap) {
791 const double&
radius = mapIt.first;
793 if (!extrapolation) {
continue; }
795 double zSigned = extrapolation->z() *
descr->calo_sign();
796 if (zSigned >=
descr->calo_z_min() && zSigned <= descr->calo_z_max()) {
797 double distance = (*extrapolation - positionAtSolenoid).
mag();
799 extrapolations.emplace_back(*extrapolation);
805 for (
const std::pair<
const double, std::vector<const CaloDetDescriptor*>>& mapIt : layerMaps.m_endCapLayerMap) {
806 const double& zCenter = mapIt.first;
808 double z = zCenter *
descr->calo_sign();
809 std::unique_ptr<Amg::Vector3D> extrapolation =
extrapolateZ(positionAtSolenoid,
phi0, theta0,
z);
810 if (!extrapolation)
continue;
812 double radius = extrapolation->perp();
813 if (
radius >=
descr->calo_r_min() && radius <= descr->calo_r_max()) {
814 double distance = (*extrapolation - positionAtSolenoid).
mag();
816 extrapolations.emplace_back(*extrapolation);
822 return StatusCode::FAILURE;
825 return StatusCode::SUCCESS;
◆ inCell()
◆ initialize()
StatusCode TrackDepositInCaloTool::initialize |
( |
| ) |
|
|
override |
◆ initializeDetectorInfo()
Definition at line 642 of file TrackDepositInCaloTool.cxx.
651 if (
descr->is_lar_em_barrel()) {
653 double thickness =
descr->calo_r_max() -
descr->calo_r_min();
654 double r =
descr->calo_r_min() + thickness / 2.0;
662 double thickness =
descr->calo_z_max() -
descr->calo_z_min();
663 double z =
descr->calo_z_min() + thickness / 2.0;
685 double thickness =
descr->calo_r_max() -
descr->calo_r_min();
686 double r =
descr->calo_r_min() + thickness / 2.0;
691 maps.m_barrelLayerMap[
r].push_back(
descr);
◆ 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.
◆ isInsideCell()
◆ isInsideDomain()
bool TrackDepositInCaloTool::isInsideDomain |
( |
double |
position, |
|
|
double |
domainCenter, |
|
|
double |
domainWidth, |
|
|
bool |
phiVariable = false |
|
) |
| |
|
staticprivate |
Definition at line 1081 of file TrackDepositInCaloTool.cxx.
1082 double halfWidth = domainWidth / 2;
1084 if (std::abs(std::abs(domainCenter) -
M_PI) < domainWidth) {
1086 domainCenter +=
M_PI;
1087 if (position >
M_PI) { position -= 2 *
M_PI; }
1088 if (domainCenter >
M_PI) { domainCenter -= 2 *
M_PI; }
1091 double boundLow = domainCenter - halfWidth;
1092 double boundHigh = domainCenter + halfWidth;
1093 if (position < boundLow)
return false;
1094 if (position > boundHigh)
return false;
◆ 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.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_caloCellAssociationTool
◆ m_caloDetDescrMgrKey
Initial value:{
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
}
Definition at line 184 of file TrackDepositInCaloTool.h.
◆ m_caloExtensionTool
Initial value:{this, "ParticleCaloExtensionTool", "",
"Tool to make the step-wise extrapolation"}
Definition at line 180 of file TrackDepositInCaloTool.h.
◆ m_detStore
◆ m_doExtr
bool TrackDepositInCaloTool::m_doExtr |
|
private |
◆ m_doHist
bool TrackDepositInCaloTool::m_doHist |
|
private |
◆ m_evtStore
◆ m_extrapolator
ToolHandle<Trk::IExtrapolator> TrackDepositInCaloTool::m_extrapolator {this, "ExtrapolatorHandle", ""} |
|
private |
◆ m_h
std::unique_ptr<Hists> TrackDepositInCaloTool::m_h |
|
private |
◆ m_histSvc
◆ m_layerMaps
◆ m_tileDDM
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
TileCellDim * get_cell_dim(const Identifier &cell_id) const
std::map< CaloSampling::CaloSample, double > ScalarLayerMap
Tracking class to hold the extrapolation from a particle from the ID to the muon system (or the other...
const Amg::Vector3D & position() const
Access method for the position.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
void entryExitLayerMap(const Trk::CaloExtension &extension, EntryExitLayerMap &result, const LayersToSelect *selection=nullptr)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
const TrackParameters * caloEntryLayerIntersection() const
access to intersection with the calorimeter entry layer return NULL if the intersection failed
#define ATH_MSG_VERBOSE(x)
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
double energy() const
get energy (data member)
IdentifierHash calo_hash() const
cell calo hash
unsigned int getNRows() const
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Eigen::Affine3d Transform3D
std::pair< std::vector< unsigned int >, bool > res
virtual bool badcell() const
check is cell is dead
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
void cellsInZone(double eta_min, double eta_max, double phi_min, double phi_max, std::vector< IdentifierHash > &cell_list) const
the only client is CaloCellList class
std::map< CaloSampling::CaloSample, std::pair< Amg::Vector3D, Amg::Vector3D > > EntryExitLayerMap
virtual void renounce()=0
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool is_tile() const
cell belongs to Tile
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
StatusCode initialize(bool used=true)
void eLossLayerMap(const Trk::CaloExtension &extension, ScalarLayerMap &result)
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
double getZMax(unsigned int index) const
Eigen::Matrix< double, 3, 1 > Vector3D
calo_descr_range calo_descriptors_range() const
Range over descriptors.
float dphi() const
cell dphi
const Amg::Vector3D & momentum() const
Access method for the momentum.
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
CaloCell_ID::CaloSample getSampling() const
cell sampling
#define ATH_MSG_WARNING(x)
size_t getNSlots()
Return the number of event slots.
Eigen::Translation< double, 3 > Translation3D
calo_descr_range tile_descriptors_range() const
Range over tile descriptors.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
float eta() const
cell eta
float phi() const
cell phi
#define ATLAS_THREAD_SAFE
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
double getZMin(unsigned int index) const
Scalar mag() const
mag method
virtual double sinTh() const override final
get sin(theta) (through CaloDetDescrElement)
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.