 |
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))
75 return StatusCode::SUCCESS;
90 return StatusCode::FAILURE;
103 prdmtColl = h_prdmtColl.
cptr();
113 if (not h_sdoCollection.
isValid()) {
117 sdoCollection = h_sdoCollection.
cptr();
124 ATH_CHECK(xaod.
record(std::make_unique<xAOD::TrackMeasurementValidationContainer>(),std::make_unique<xAOD::TrackMeasurementValidationAuxContainer>() ) );
129 InDet::TRT_DriftCircleContainer::const_iterator
it = h_trtPrds->begin();
130 InDet::TRT_DriftCircleContainer::const_iterator it_end = h_trtPrds->end();
132 for( ;
it!=it_end; ++
it ) {
136 ATH_MSG_ERROR(
"My assumption about the maximum size of the hash was wrong");
137 (*offsets)[ (*it)->identifyHash() ] =
counter;
140 if( (*it)->empty() )
continue;
143 for(
const auto prd : **
it ){
163 AUXDATA(xprd,
float, strawphi) = element->
center(surfaceID).phi();
176 AUXDATA(xprd,
int, TRTboard) = board ;
177 AUXDATA(xprd,
int, TRTchip) = chip ;
183 float locX = locpos.x();
184 if ( !(std::isinf(locpos.y()) || std::isnan(locpos.y())) ){
185 if (locpos.y()>=1
e-07)
195 if(localCov.size() == 1){
197 }
else if(localCov.size() == 2){
205 const Amg::Vector3D gpos = prd->detectorElement()->surface(surfaceID).localToGlobal(prd->localPosition());
210 unsigned int word = prd->getWord();
213 double tot = prd->timeOverThreshold();
215 AUXDATA(xprd,
float, drifttime) = prd->driftTime(isvalid) ;
217 AUXDATA(xprd,
float, tot) = tot ;
218 AUXDATA(xprd,
char, isHT) = prd->highLevel() ;
223 AUXDATA(xprd,
float, leadingEdge) = prd->rawDriftTime();
227 if(prd->highLevel()) {
231 AUXDATA(xprd,
float, driftTimeHTCorrection) = 0;
236 unsigned int theWord = word & 0x04020100;
237 char highThreshold = 0;
239 if (theWord == 0x04000000)
241 else if (theWord == 0x00020000)
243 else if (theWord == 0x00000100)
245 else if (theWord == 0x04020000)
247 else if (theWord == 0x00020100)
249 else if (theWord == 0x04000100)
251 else if (theWord == 0x04020100)
254 AUXDATA(xprd,
char, highThreshold) = highThreshold;
257 AUXDATA(xprd,
unsigned int, bitPattern) = word;
269 AUXDATA(xprd,
char, gasType) = gas_type;
274 std::vector<int> uniqueIDs;
275 auto range = prdmtColl->equal_range(surfaceID);
279 AUXDATA(xprd, std::vector<int> , truth_barcode) = uniqueIDs;
285 auto pos = sdoCollection->find(surfaceID);
286 int sdo_word = -1000000;
287 if(
pos != sdoCollection->end() ) {
288 sdo_word =
pos->second.word();
290 AUXDATA(xprd,
int, sdo_word) = sdo_word;
316 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
TrackMeasurementValidation_v1 TrackMeasurementValidation
Reference the current persistent version:
bool m_firstEventWarnings
A PRD is mapped onto all contributing particles.
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.
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
size_type straw_layer_hash_max() const
Gaudi::Property< bool > m_writeSDOs
size_type size() const noexcept
Returns the number of elements in the collection.