![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
This Algorithm is meant to be an example of use of the TrackToCalo tools :
More...
#include <TBTrackToCaloAlg.h>
|
| TBTrackToCaloAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
bool | CreateTrkImpactInCalo () |
|
ImpactInCalo * | GetImpactsInCalo (const Trk::Track *track, bool &got_a_track) |
|
void | CompareImpactWithCluster () |
|
void | PrintImpact () |
|
CaloCellList * | CellsCrossedByTrack (const Trk::Track *trk, const CaloCell_ID::CaloSample sam, int neta, int nphi) |
|
bool | PrintCellsCrossed () |
|
void | PrintBeamPosition () |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. 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 | 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 |
|
This Algorithm is meant to be an example of use of the TrackToCalo tools :
- It loops on a given Track collection ( choosen by jobOption ) and extrapolates all tracks to the layers of the calorimeter.
- Impacts are stored in an ImpactInCaloCollection, which is then used to fill CBNT
- An example of primitive Track to Cluster matching is provided, as well as an example of how one can retreive all the CaloCell's around a track extrapolation, using the CaloCellList class ( these 2 are off by default )
- One can also find an example of usage of the CaloDepthTool methods to define if one should extrapolate to the barrel or to the endcap.
Definition at line 63 of file TBTrackToCaloAlg.h.
◆ StoreGateSvc_t
◆ TBTrackToCaloAlg() [1/3]
TBTrackToCaloAlg::TBTrackToCaloAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ TBTrackToCaloAlg() [2/3]
TBTrackToCaloAlg::TBTrackToCaloAlg |
( |
| ) |
|
|
private |
◆ TBTrackToCaloAlg() [3/3]
◆ CellsCrossedByTrack()
Definition at line 576 of file TBTrackToCaloAlg.cxx.
586 if (
sc != StatusCode::SUCCESS )
return 0;
593 double trketa_at = 0.;
594 double trkphi_at = 0.;
598 TrackSeenByCalo(trk,sam,
offset,pt_ctb,pt_local,trketa_at,trkphi_at);
606 double eta = pt_local->eta();
607 double phi = pt_local->phi();
612 int sampling_or_module;
620 double deta =
int(neta/2)*dde->
deta();
621 double dphi =
int(nphi/2)*dde->
dphi();
626 my_list =
new CaloCellList(caloDDMgr, cell_container,subcalo);
◆ CompareImpactWithCluster()
void TBTrackToCaloAlg::CompareImpactWithCluster |
( |
| ) |
|
Definition at line 445 of file TBTrackToCaloAlg.cxx.
449 ATH_MSG_DEBUG (
"TBTrackToCaloAlg::CompareImpactWithCluster()" );
459 if(sc1 == StatusCode::SUCCESS && sc2 == StatusCode::SUCCESS ){
462 impact_iterator f_imp = impact_collection->
begin();
463 impact_iterator l_imp = impact_collection->
end();
465 for (
const CaloCluster* cluster : *cluster_container) {
466 double hecluster = cluster->energy()/
GeV;
467 double heta = cluster->eta();
468 double hphi = cluster->phi();
471 <<
"(GeV), etaCaloLocal=" << heta
472 <<
", phiCaloLocal=" << hphi );
474 for ( ; f_imp!=l_imp; ++f_imp){
478 (
"==> Comparison between cluster and impact in Middle : deta="
485 if (sc1 != StatusCode::SUCCESS)
488 if (sc2 != StatusCode::SUCCESS)
◆ CreateTrkImpactInCalo()
bool TBTrackToCaloAlg::CreateTrkImpactInCalo |
( |
| ) |
|
Definition at line 137 of file TBTrackToCaloAlg.cxx.
139 bool got_a_track =
false;
141 ATH_MSG_DEBUG (
"TBTrackToCaloAlg::CreateTrkImpactInCalo()" );
146 if(
sc != StatusCode::SUCCESS){
172 else ATH_MSG_DEBUG (
" ImpactInCalo pointer not valid for this track");
192 else ATH_MSG_DEBUG (
" ImpactInCalo pointer not valid for this track");
◆ 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);
◆ 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.
◆ 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode TBTrackToCaloAlg::execute |
( |
| ) |
|
|
overridevirtual |
◆ 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
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode TBTrackToCaloAlg::finalize |
( |
| ) |
|
|
overridevirtual |
◆ GetImpactsInCalo()
Definition at line 200 of file TBTrackToCaloAlg.cxx.
216 ATH_MSG_ERROR (
" No track parameters for this track ??? do nothing " );
221 double trketa_at = 0.;
222 double trkphi_at = 0.;
230 double etaCaloLocal_0 = 0;
231 double phiCaloLocal_0 = 0;
232 double trketa_at_0 = 0.;
233 double trkphi_at_0 = 0.;
238 double etaCaloLocal_1 = 0;
239 double phiCaloLocal_1 = 0;
240 double trketa_at_1 = 0.;
241 double trkphi_at_1 = 0.;
246 double etaCaloLocal_2 = 0;
247 double phiCaloLocal_2 = 0;
248 double trketa_at_2 = 0.;
249 double trkphi_at_2 = 0.;
254 double etaCaloLocal_3 = 0;
255 double phiCaloLocal_3 = 0;
256 double trketa_at_3 = 0.;
257 double trkphi_at_3 = 0.;
259 double x_ctb_tile = 0;
260 double y_ctb_tile = 0;
261 double z_ctb_tile = 0;
262 double etaCaloLocal_tile = 0;
263 double phiCaloLocal_tile = 0;
264 double trketa_at_tile = 0.;
265 double trkphi_at_tile = 0.;
273 ATH_MSG_DEBUG (
" TrackTo ...PS : for eta= " << trketa <<
" dist to Barrel =" << distbar
274 <<
" to endcap =" << distec );
282 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
286 x_ctb_0 = pt_calo_ctb->x();
287 y_ctb_0 = pt_calo_ctb->y();
288 z_ctb_0 = pt_calo_ctb->z();
289 etaCaloLocal_0 = pt_calo_local->eta();
290 phiCaloLocal_0 = pt_calo_local->phi();
291 trketa_at_0 = trketa_at;
292 trkphi_at_0 = trkphi_at;
295 <<
" etaCaloLocal=" << pt_calo_local->eta()
296 <<
" phiCaloLocal=" << pt_calo_local->phi() );
303 ATH_MSG_DEBUG (
" TrackTo ...Strip : for eta= " << trketa <<
" dist to Barrel =" << distbar
304 <<
" to endcap =" << distec );
312 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
316 x_ctb_1 = pt_calo_ctb->x();
317 y_ctb_1 = pt_calo_ctb->y();
318 z_ctb_1 = pt_calo_ctb->z();
319 etaCaloLocal_1 = pt_calo_local->eta();
320 phiCaloLocal_1 = pt_calo_local->phi();
321 trketa_at_1 = trketa_at;
322 trkphi_at_1 = trkphi_at;
325 <<
" etaCaloLocal=" << pt_calo_local->eta()
326 <<
" phiCaloLocal=" << pt_calo_local->phi() );
334 ATH_MSG_DEBUG (
" TrackTo ...Middle : for eta= " << trketa <<
" dist to Barrel =" << distbar
335 <<
" to endcap =" << distec );
343 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
347 x_ctb_2 = pt_calo_ctb->x();
348 y_ctb_2 = pt_calo_ctb->y();
349 z_ctb_2 = pt_calo_ctb->z();
350 etaCaloLocal_2 = pt_calo_local->eta();
351 phiCaloLocal_2 = pt_calo_local->phi();
352 trketa_at_2 = trketa_at;
353 trkphi_at_2 = trkphi_at;
356 <<
" etaCaloLocal=" << pt_calo_local->eta()
357 <<
" phiCaloLocal=" << pt_calo_local->phi() );
372 ATH_MSG_DEBUG (
" TrackTo ...Back : for eta= " << trketa <<
" dist to Barrel =" << distbar
373 <<
" to endcap =" << distec );
381 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
385 x_ctb_3 = pt_calo_ctb->x();
386 y_ctb_3 = pt_calo_ctb->y();
387 z_ctb_3 = pt_calo_ctb->z();
388 etaCaloLocal_3 = pt_calo_local->eta();
389 phiCaloLocal_3 = pt_calo_local->phi();
390 trketa_at_3 = trketa_at;
391 trkphi_at_3 = trkphi_at;
394 <<
" etaCaloLocal=" << pt_calo_local->eta()
395 <<
" phiCaloLocal=" << pt_calo_local->phi() );
402 ATH_MSG_DEBUG (
" TrackTo ...Tile : for eta= " << trketa <<
" dist to Barrel =" << distbar
403 <<
" to endcap =" << distec );
411 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
415 x_ctb_tile = pt_calo_ctb->x();
416 y_ctb_tile = pt_calo_ctb->y();
417 z_ctb_tile = pt_calo_ctb->z();
418 etaCaloLocal_tile = pt_calo_local->eta();
419 phiCaloLocal_tile = pt_calo_local->phi();
420 trketa_at_tile = trketa_at;
421 trkphi_at_tile = trkphi_at;
424 <<
" etaCaloLocal=" << pt_calo_local->eta()
425 <<
" phiCaloLocal=" << pt_calo_local->phi() );
429 ImpactInCalo * imp=
new ImpactInCalo(x_ctb_0, y_ctb_0, z_ctb_0, etaCaloLocal_0, phiCaloLocal_0, trketa_at_0, trkphi_at_0,
430 x_ctb_1, y_ctb_1, z_ctb_1, etaCaloLocal_1, phiCaloLocal_1, trketa_at_1, trkphi_at_1,
431 x_ctb_2, y_ctb_2, z_ctb_2, etaCaloLocal_2, phiCaloLocal_2, trketa_at_2, trkphi_at_2,
432 x_ctb_3, y_ctb_3, z_ctb_3, etaCaloLocal_3, phiCaloLocal_3, trketa_at_3, trkphi_at_3,
433 x_ctb_tile, y_ctb_tile, z_ctb_tile, etaCaloLocal_tile, phiCaloLocal_tile, trketa_at_tile, trkphi_at_tile);
435 if(pt_calo_ctb)
delete pt_calo_ctb;
436 if(pt_calo_local)
delete pt_calo_local;
◆ initialize()
StatusCode TBTrackToCaloAlg::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 65 of file TBTrackToCaloAlg.cxx.
72 IToolSvc* p_toolSvc = 0;
73 ATH_CHECK( service(
"ToolSvc", p_toolSvc) );
75 IAlgTool* algTool = 0;
77 StatusCode sc = p_toolSvc->retrieveTool(
"ExtrapolTrackToCaloTool", algTool,
this);
83 return StatusCode::FAILURE;
87 ATH_CHECK( p_toolSvc->retrieveTool(
"TBCaloCoordinate",
tool) );
94 return StatusCode::FAILURE;
98 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.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ operator=()
◆ 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.
◆ PrintBeamPosition()
void TBTrackToCaloAlg::PrintBeamPosition |
( |
| ) |
|
◆ PrintCellsCrossed()
bool TBTrackToCaloAlg::PrintCellsCrossed |
( |
| ) |
|
◆ PrintImpact()
void TBTrackToCaloAlg::PrintImpact |
( |
| ) |
|
Definition at line 495 of file TBTrackToCaloAlg.cxx.
507 if(
sc == StatusCode::SUCCESS ){
510 const double impcosPhi =
std::cos(impact->phiCaloLocal_1());
511 const double impeta = impact->etaCaloLocal_1();
513 ATH_MSG_INFO (
"Found an impact in strips : parameters are eta = " << impeta
514 <<
" cosPhi = " << impcosPhi );
532 dynamic_cast<const Trk::Perigee*
>(tr->perigeeParameters());
538 const double trkcosPhi =
cos(aMeasPer->parameters()[
Trk::phi]);
539 const double trketa = aMeasPer->eta();
541 ATH_MSG_INFO (
"Found a Trk::Track : parameters are eta = " << trketa
542 <<
" cosPhi = " << trkcosPhi );
550 ATH_MSG_INFO (
" Now loop on Trk::TrackParticle collection " );
559 ATH_MSG_ERROR (
"Could not get TrkParticle::MeasuredPerigee" );
563 const double partcosPhi =
cos(aMeasPer->parameters()[
Trk::phi]);
564 const double parteta = aMeasPer->eta();
566 ATH_MSG_INFO (
"Found a trackparticle : parameters are eta = " << parteta
567 <<
" cosPhi = " << partcosPhi );
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ 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_calo_id
◆ m_calo_tb_coord
◆ m_calodepth
◆ m_caloMgrKey
◆ m_cell_container
std::string TBTrackToCaloAlg::m_cell_container |
|
private |
◆ m_cluster_container
std::string TBTrackToCaloAlg::m_cluster_container |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_ImpactInCalosOutputName
std::string TBTrackToCaloAlg::m_ImpactInCalosOutputName |
|
private |
◆ m_particle
◆ m_phiRange
◆ m_toCalo
◆ m_TrackName
std::string TBTrackToCaloAlg::m_TrackName |
|
private |
◆ m_TrackParticleName
std::string TBTrackToCaloAlg::m_TrackParticleName |
|
private |
◆ m_tracks
◆ m_trkinput
std::string TBTrackToCaloAlg::m_trkinput |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
float deta() const
cell deta
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
def retrieve(aClass, aKey=None)
std::string m_ImpactInCalosOutputName
Const iterator class for DataVector/DataList.
Scalar phi() const
phi method
void select(double eta, double phi, double deta, double dphi)
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Storable container for CaloCluster.
The ImpactInCalo collection is created by the TrackToCaloAlg algorithm, which loops on all Tracks of ...
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Scalar theta() const
theta method
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
double etaCaloLocal_2() const
std::string m_TrackParticleName
TBExtrapolTrackToCaloTool * m_toCalo
std::string m_cell_container
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
const CaloCell_ID * m_calo_id
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
CaloDepthTool * m_calodepth
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string m_cluster_container
SUBCALO
enumeration of sub calorimeters
Principal data class for CaloCell clusters.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
double phiCaloLocal_2() const
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const TrackCollection * m_tracks
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
bool CreateTrkImpactInCalo()
ICaloCoordinateTool * m_calo_tb_coord
Eigen::Matrix< double, 3, 1 > Vector3D
Container class for CaloCell.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
float dphi() const
cell dphi
DataObjIDColl m_extendedExtraObjects
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
static void decode_sample(CaloCell_ID::SUBCALO &subCalo, bool &barrel, int &sampling_or_module, CaloCell_ID::CaloSample sample)
translate between the 2 ways to label a sub-detector:
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
CaloCellList * CellsCrossedByTrack(const Trk::Track *trk, const CaloCell_ID::CaloSample sam, int neta, int nphi)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const Rec::TrackParticleContainer * m_particle
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ImpactInCalo * GetImpactsInCalo(const Trk::Track *track, bool &got_a_track)