ATLAS Offline Software
MBTSModuleCnvTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Gaudi/Athena include(s):
7 
8 // Old EDM Includes:
9 //#include "TileEvent/TileCell.h"
12 
13 //New EDM
15 
16 // Local include(s):
17 #include "MBTSModuleCnvTool.h"
18 
19 
20 namespace xAODMaker {
21 
23  const std::string& name,
24  const IInterface* parent )
25  : AthAlgTool( type, name, parent ) {
26 
27  // Declare the interface(s) provided by the tool:
28  declareInterface< IMBTSModuleCnvTool >(this);
29  }
30 
32  xAOD::MBTSModuleContainer* xaod) const
33  {
34  if (!aod) {
35  ATH_MSG_WARNING("No input MBTSModule Collection passed");
36  return StatusCode::SUCCESS;
37  }
38 
39  // Create the xAOD objects:
40  const auto end = aod->end();
41  for(auto itr = aod->begin(); itr != end; ++itr ) {
42  //fill it here
43  xAOD::MBTSModule *xmbtsmod = new xAOD::MBTSModule();
44  xaod->push_back( xmbtsmod );
45 
46  xmbtsmod->setE((*itr)->energy());
47  xmbtsmod->setEta((*itr)->eta());
48  xmbtsmod->setPhi((*itr)->phi());
49  xmbtsmod->setTime((*itr)->time());
50  //xmbtsmod->setMbtsQuality((*itr)->quality()); // original
51  xmbtsmod->setMbtsQuality ( ((*itr)->provenance()<<16 ) | (*itr)->quality()); //fix
52  ATH_MSG_DEBUG( "MBTS: quality=" << (*itr)->quality() << " provenance=" << (*itr)->provenance() << " mbtsQuality=" << xmbtsmod->mbtsQuality() );
53  const TileTBID* tileid = nullptr;
54  CHECK( detStore() -> retrieve(tileid) );
55  Identifier id = (*itr)->ID();
56 
57  xmbtsmod->setType(tileid->type(id));
58  xmbtsmod->setMbtsModule(tileid->module(id));
59  xmbtsmod->setChannel(tileid->channel(id));
60 
61  }
62  // Return gracefully:
63  return StatusCode::SUCCESS;
64  }
65 }
66 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MBTSModuleAuxContainer.h
xAOD::MBTSModule_v1::setTime
void setTime(float val_time)
xAODMaker::MBTSModuleCnvTool::convert
virtual StatusCode convert(const TileCellContainer *aod, xAOD::MBTSModuleContainer *xaod) const override
Function that fills an existing xAOD::MBTSModuleContainer.
Definition: MBTSModuleCnvTool.cxx:31
xAOD::MBTSModule_v1::setMbtsQuality
void setMbtsQuality(int val_quality)
xAOD::MBTSModule_v1
add description
Definition: MBTSModule_v1.h:18
xAOD::MBTSModule_v1::setMbtsModule
void setMbtsModule(int val_module)
xAODMaker
Definition: StoreGateSvc.h:72
TileTBID::type
int type(const Identifier &id) const
extract type field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:146
xAOD::MBTSModule_v1::mbtsQuality
int mbtsQuality() const
xAODMaker::MBTSModuleCnvTool::MBTSModuleCnvTool
MBTSModuleCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: MBTSModuleCnvTool.cxx:22
TileTBID::module
int module(const Identifier &id) const
extract module field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:150
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
xAOD::MBTSModule_v1::setPhi
void setPhi(float val_phi)
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MBTSModuleCnvTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
TileTBID::channel
int channel(const Identifier &id) const
extract channel field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:154
xAOD::MBTSModule_v1::setType
void setType(int val_type)
xAOD::MBTSModule_v1::setChannel
void setChannel(int val_channel)
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
errorcheck.h
Helpers for checking error return status codes and reporting errors.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::MBTSModule
MBTSModule_v1 MBTSModule
Definition: MBTSModule.h:17
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::MBTSModule_v1::setE
void setE(float val_e)
TileTBID
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:65
TileTBID.h
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::MBTSModule_v1::setEta
void setEta(float val_eta)
TileContainer
Definition: TileContainer.h:38
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
TileCellContainer.h