|
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 572 of file TBTrackToCaloAlg.cxx.
582 if (
sc != StatusCode::SUCCESS )
return 0;
589 double trketa_at = 0.;
590 double trkphi_at = 0.;
594 TrackSeenByCalo(trk,sam,
offset,pt_ctb,pt_local,trketa_at,trkphi_at);
602 double eta = pt_local->eta();
603 double phi = pt_local->phi();
608 int sampling_or_module;
616 double deta =
int(neta/2)*dde->
deta();
617 double dphi =
int(nphi/2)*dde->
dphi();
622 my_list =
new CaloCellList(caloDDMgr, cell_container,subcalo);
◆ CompareImpactWithCluster()
void TBTrackToCaloAlg::CompareImpactWithCluster |
( |
| ) |
|
Definition at line 441 of file TBTrackToCaloAlg.cxx.
445 ATH_MSG_DEBUG (
"TBTrackToCaloAlg::CompareImpactWithCluster()" );
455 if(sc1 == StatusCode::SUCCESS && sc2 == StatusCode::SUCCESS ){
458 impact_iterator f_imp = impact_collection->
begin();
459 impact_iterator l_imp = impact_collection->
end();
461 for (
const CaloCluster* cluster : *cluster_container) {
462 double hecluster = cluster->energy()/
GeV;
463 double heta = cluster->eta();
464 double hphi = cluster->phi();
467 <<
"(GeV), etaCaloLocal=" << heta
468 <<
", phiCaloLocal=" << hphi );
470 for ( ; f_imp!=l_imp; ++f_imp){
474 (
"==> Comparison between cluster and impact in Middle : deta="
481 if (sc1 != StatusCode::SUCCESS)
484 if (sc2 != StatusCode::SUCCESS)
◆ CreateTrkImpactInCalo()
bool TBTrackToCaloAlg::CreateTrkImpactInCalo |
( |
| ) |
|
Definition at line 133 of file TBTrackToCaloAlg.cxx.
135 bool got_a_track =
false;
137 ATH_MSG_DEBUG (
"TBTrackToCaloAlg::CreateTrkImpactInCalo()" );
142 if(
sc != StatusCode::SUCCESS){
168 else ATH_MSG_DEBUG (
" ImpactInCalo pointer not valid for this track");
188 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ 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 196 of file TBTrackToCaloAlg.cxx.
212 ATH_MSG_ERROR (
" No track parameters for this track ??? do nothing " );
217 double trketa_at = 0.;
218 double trkphi_at = 0.;
226 double etaCaloLocal_0 = 0;
227 double phiCaloLocal_0 = 0;
228 double trketa_at_0 = 0.;
229 double trkphi_at_0 = 0.;
234 double etaCaloLocal_1 = 0;
235 double phiCaloLocal_1 = 0;
236 double trketa_at_1 = 0.;
237 double trkphi_at_1 = 0.;
242 double etaCaloLocal_2 = 0;
243 double phiCaloLocal_2 = 0;
244 double trketa_at_2 = 0.;
245 double trkphi_at_2 = 0.;
250 double etaCaloLocal_3 = 0;
251 double phiCaloLocal_3 = 0;
252 double trketa_at_3 = 0.;
253 double trkphi_at_3 = 0.;
255 double x_ctb_tile = 0;
256 double y_ctb_tile = 0;
257 double z_ctb_tile = 0;
258 double etaCaloLocal_tile = 0;
259 double phiCaloLocal_tile = 0;
260 double trketa_at_tile = 0.;
261 double trkphi_at_tile = 0.;
269 ATH_MSG_DEBUG (
" TrackTo ...PS : for eta= " << trketa <<
" dist to Barrel =" << distbar
270 <<
" to endcap =" << distec );
278 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
282 x_ctb_0 = pt_calo_ctb->x();
283 y_ctb_0 = pt_calo_ctb->y();
284 z_ctb_0 = pt_calo_ctb->z();
285 etaCaloLocal_0 = pt_calo_local->eta();
286 phiCaloLocal_0 = pt_calo_local->phi();
287 trketa_at_0 = trketa_at;
288 trkphi_at_0 = trkphi_at;
291 <<
" etaCaloLocal=" << pt_calo_local->eta()
292 <<
" phiCaloLocal=" << pt_calo_local->phi() );
299 ATH_MSG_DEBUG (
" TrackTo ...Strip : for eta= " << trketa <<
" dist to Barrel =" << distbar
300 <<
" to endcap =" << distec );
308 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
312 x_ctb_1 = pt_calo_ctb->x();
313 y_ctb_1 = pt_calo_ctb->y();
314 z_ctb_1 = pt_calo_ctb->z();
315 etaCaloLocal_1 = pt_calo_local->eta();
316 phiCaloLocal_1 = pt_calo_local->phi();
317 trketa_at_1 = trketa_at;
318 trkphi_at_1 = trkphi_at;
321 <<
" etaCaloLocal=" << pt_calo_local->eta()
322 <<
" phiCaloLocal=" << pt_calo_local->phi() );
330 ATH_MSG_DEBUG (
" TrackTo ...Middle : for eta= " << trketa <<
" dist to Barrel =" << distbar
331 <<
" to endcap =" << distec );
339 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
343 x_ctb_2 = pt_calo_ctb->x();
344 y_ctb_2 = pt_calo_ctb->y();
345 z_ctb_2 = pt_calo_ctb->z();
346 etaCaloLocal_2 = pt_calo_local->eta();
347 phiCaloLocal_2 = pt_calo_local->phi();
348 trketa_at_2 = trketa_at;
349 trkphi_at_2 = trkphi_at;
352 <<
" etaCaloLocal=" << pt_calo_local->eta()
353 <<
" phiCaloLocal=" << pt_calo_local->phi() );
368 ATH_MSG_DEBUG (
" TrackTo ...Back : for eta= " << trketa <<
" dist to Barrel =" << distbar
369 <<
" to endcap =" << distec );
377 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
381 x_ctb_3 = pt_calo_ctb->x();
382 y_ctb_3 = pt_calo_ctb->y();
383 z_ctb_3 = pt_calo_ctb->z();
384 etaCaloLocal_3 = pt_calo_local->eta();
385 phiCaloLocal_3 = pt_calo_local->phi();
386 trketa_at_3 = trketa_at;
387 trkphi_at_3 = trkphi_at;
390 <<
" etaCaloLocal=" << pt_calo_local->eta()
391 <<
" phiCaloLocal=" << pt_calo_local->phi() );
398 ATH_MSG_DEBUG (
" TrackTo ...Tile : for eta= " << trketa <<
" dist to Barrel =" << distbar
399 <<
" to endcap =" << distec );
407 pt_calo_ctb,pt_calo_local,trketa_at,trkphi_at);
411 x_ctb_tile = pt_calo_ctb->x();
412 y_ctb_tile = pt_calo_ctb->y();
413 z_ctb_tile = pt_calo_ctb->z();
414 etaCaloLocal_tile = pt_calo_local->eta();
415 phiCaloLocal_tile = pt_calo_local->phi();
416 trketa_at_tile = trketa_at;
417 trkphi_at_tile = trkphi_at;
420 <<
" etaCaloLocal=" << pt_calo_local->eta()
421 <<
" phiCaloLocal=" << pt_calo_local->phi() );
425 ImpactInCalo * imp=
new ImpactInCalo(x_ctb_0, y_ctb_0, z_ctb_0, etaCaloLocal_0, phiCaloLocal_0, trketa_at_0, trkphi_at_0,
426 x_ctb_1, y_ctb_1, z_ctb_1, etaCaloLocal_1, phiCaloLocal_1, trketa_at_1, trkphi_at_1,
427 x_ctb_2, y_ctb_2, z_ctb_2, etaCaloLocal_2, phiCaloLocal_2, trketa_at_2, trkphi_at_2,
428 x_ctb_3, y_ctb_3, z_ctb_3, etaCaloLocal_3, phiCaloLocal_3, trketa_at_3, trkphi_at_3,
429 x_ctb_tile, y_ctb_tile, z_ctb_tile, etaCaloLocal_tile, phiCaloLocal_tile, trketa_at_tile, trkphi_at_tile);
431 if(pt_calo_ctb)
delete pt_calo_ctb;
432 if(pt_calo_local)
delete pt_calo_local;
◆ initialize()
StatusCode TBTrackToCaloAlg::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 65 of file TBTrackToCaloAlg.cxx.
71 IAlgTool* algTool = 0;
73 StatusCode sc = toolSvc()->retrieveTool(
"ExtrapolTrackToCaloTool", algTool,
this);
79 return StatusCode::FAILURE;
83 ATH_CHECK( toolSvc()->retrieveTool(
"TBCaloCoordinate",
tool) );
90 return StatusCode::FAILURE;
94 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 491 of file TBTrackToCaloAlg.cxx.
503 if(
sc == StatusCode::SUCCESS ){
506 const double impcosPhi =
std::cos(impact->phiCaloLocal_1());
507 const double impeta = impact->etaCaloLocal_1();
509 ATH_MSG_INFO (
"Found an impact in strips : parameters are eta = " << impeta
510 <<
" cosPhi = " << impcosPhi );
528 dynamic_cast<const Trk::Perigee*
>(tr->perigeeParameters());
534 const double trkcosPhi =
cos(aMeasPer->parameters()[
Trk::phi]);
535 const double trketa = aMeasPer->eta();
537 ATH_MSG_INFO (
"Found a Trk::Track : parameters are eta = " << trketa
538 <<
" cosPhi = " << trkcosPhi );
546 ATH_MSG_INFO (
" Now loop on Trk::TrackParticle collection " );
555 ATH_MSG_ERROR (
"Could not get TrkParticle::MeasuredPerigee" );
559 const double partcosPhi =
cos(aMeasPer->parameters()[
Trk::phi]);
560 const double parteta = aMeasPer->eta();
562 ATH_MSG_INFO (
"Found a trackparticle : parameters are eta = " << parteta
563 <<
" 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)