|
ATLAS Offline Software
|
Go to the documentation of this file.
20 #include "Identifier/Identifier.h"
33 #define AUXDATA(OBJ, TYP, NAME) \
34 static const SG::AuxElement::Accessor<TYP> acc_##NAME (#NAME); acc_##NAME(*(OBJ))
43 m_driftFunctionTool(
"TRT_DriftFunctionTool", this),
44 m_trtcaldbTool(
"TRT_CalDbTool", this),
45 m_neighbourSvc(
"TRT_StrawNeighbourSvc",
name),
46 m_TRTStrawSummaryTool(
"TRT_StrawStatusSummaryTool",this),
49 m_firstEventWarnings(true)
89 return StatusCode::SUCCESS;
104 return StatusCode::FAILURE;
113 if (not h_prdmtColl.
isValid()){
117 prdmtColl = h_prdmtColl.
cptr();
127 if (not h_sdoCollection.
isValid()) {
131 sdoCollection = h_sdoCollection.
cptr();
138 ATH_CHECK(xaod.
record(std::make_unique<xAOD::TrackMeasurementValidationContainer>(),std::make_unique<xAOD::TrackMeasurementValidationAuxContainer>() ) );
143 InDet::TRT_DriftCircleContainer::const_iterator
it = h_trtPrds->begin();
144 InDet::TRT_DriftCircleContainer::const_iterator it_end = h_trtPrds->end();
146 for( ;
it!=it_end; ++
it ) {
150 ATH_MSG_ERROR(
"My assumption about the maximum size of the hash was wrong");
151 (*offsets)[ (*it)->identifyHash() ] =
counter;
154 if( (*it)->empty() )
continue;
157 for(
const auto prd : **
it ){
177 AUXDATA(xprd,
float, strawphi) = element->
center(surfaceID).phi();
190 AUXDATA(xprd,
int, TRTboard) = board ;
191 AUXDATA(xprd,
int, TRTchip) = chip ;
197 float locX = locpos.x();
198 if ( !(std::isinf(locpos.y()) || std::isnan(locpos.y())) ){
199 if (locpos.y()>=1
e-07)
209 if(localCov.size() == 1){
211 }
else if(localCov.size() == 2){
219 const Amg::Vector3D gpos = prd->detectorElement()->surface(surfaceID).localToGlobal(prd->localPosition());
224 unsigned int word = prd->getWord();
227 double tot = prd->timeOverThreshold();
229 AUXDATA(xprd,
float, drifttime) = prd->driftTime(isvalid) ;
231 AUXDATA(xprd,
float, tot) = tot ;
232 AUXDATA(xprd,
char, isHT) = prd->highLevel() ;
237 AUXDATA(xprd,
float, leadingEdge) = prd->rawDriftTime();
241 if(prd->highLevel()) {
245 AUXDATA(xprd,
float, driftTimeHTCorrection) = 0;
250 unsigned int theWord = word & 0x04020100;
251 char highThreshold = 0;
253 if (theWord == 0x04000000)
255 else if (theWord == 0x00020000)
257 else if (theWord == 0x00000100)
259 else if (theWord == 0x04020000)
261 else if (theWord == 0x00020100)
263 else if (theWord == 0x04000100)
265 else if (theWord == 0x04020100)
268 AUXDATA(xprd,
char, highThreshold) = highThreshold;
271 AUXDATA(xprd,
unsigned int, bitPattern) = word;
283 AUXDATA(xprd,
char, gasType) = gas_type;
289 auto range = prdmtColl->equal_range(surfaceID);
291 barcodes.push_back(
i->second.barcode() );
299 auto pos = sdoCollection->find(surfaceID);
300 int sdo_word = -1000000;
301 if(
pos != sdoCollection->end() ) {
302 sdo_word =
pos->second.word();
304 AUXDATA(xprd,
int, sdo_word) = sdo_word;
330 return StatusCode::SUCCESS;
TRT_PrepDataToxAOD(const std::string &name, ISvcLocator *pSvcLocator)
def retrieve(aClass, aKey=None)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
const_pointer_type cptr()
Dereference the pointer.
SG::ReadHandleKey< InDet::TRT_DriftCircleContainer > m_driftcirclecontainer
Eigen::Matrix< double, 2, 1 > Vector2D
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
TrackMeasurementValidation_v1 TrackMeasurementValidation
Reference the current persistent version:
bool m_firstEventWarnings
A PRD is mapped onto all contributing particles.
size_type straw_layer_hash_max(void) const
const InDetDD::TRT_DetectorManager * m_trtman
#define AUXDATA(OBJ, TYP, NAME)
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
value_type get_compact() const
Get the compact id.
const TRT_ID * m_TRTHelper
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::ReadHandleKey< PRD_MultiTruthCollection > m_multiTruth
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
SG::ReadHandleKey< InDetSimDataCollection > m_SDOcontainer
ServiceHandle< ITRT_StrawNeighbourSvc > m_neighbourSvc
Class describing a TrackMeasurementValidation.
Handle class for recording to StoreGate.
int straw(const Identifier &id) const
void setLocalPosition(float localX, float localY)
Sets the local position.
def barcodes(beg, end, sz)
virtual StatusCode initialize()
::StatusCode StatusCode
StatusCode definition for legacy code.
ToolHandle< ITRT_StrawStatusSummaryTool > m_TRTStrawSummaryTool
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode finalize()
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
void setIdentifier(uint64_t identifier)
Sets the identifier.
virtual StatusCode execute()
int layer_or_wheel(const Identifier &id) const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Gaudi::Property< bool > m_useTruthInfo
SG::WriteHandleKey< std::vector< unsigned int > > m_xAodOffset
void setGlobalPosition(float globalX, float globalY, float globalZ)
Sets the global position.
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
void setLocalPositionError(float localXError, float localYError, float localXYCorrelation)
Sets the local position error.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Eigen::Matrix< double, 3, 1 > Vector3D
int phi_module(const Identifier &id) const
ToolHandle< ITRT_CalDbTool > m_trtcaldbTool
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
#define ATH_MSG_WARNING(x)
virtual const Amg::Vector3D & center() const override final
Element Surface: center of a straw layer.
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainer > m_xAodContainer
Handle class for reading from StoreGate.
ToolHandle< ITRT_DriftFunctionTool > m_driftFunctionTool
DriftFunctionTool.
Gaudi::Property< bool > m_writeSDOs
size_type size() const noexcept
Returns the number of elements in the collection.