62{
63 const FCALDetectorManager *fcalManager{};
65
66 m_caloGeo = std::make_unique<CaloGeometryFromCaloDDM>();
67
69 if(caloMgr) {
70 m_caloGeo->LoadGeometryFromCaloDDM(caloMgr);
71 }
72 else {
75 m_caloGeo->LoadGeometryFromCaloDDM(caloMgrPtr.get());
77 }
78
79 if (!
m_caloGeo->LoadFCalChannelMapFromFCalDDM(fcalManager)) {
80 ATH_MSG_FATAL(
"Found inconsistency between FCal_Channel map and GEO file. Please, check if they are configured properly.");
81 return StatusCode::FAILURE;
82 }
83
87 if (paramsFile == nullptr) {
89 return StatusCode::FAILURE;
90 }
96 return StatusCode::FAILURE;
97 }
98
100
106 }
108
109#ifdef USE_GPU
110
111
113 return StatusCode::SUCCESS;
115 ATH_MSG_WARNING(
"no GPU device is found, will run everything on the CPU." );
117 return StatusCode::SUCCESS;
118 }
119
120
121
122 ATH_MSG_INFO(
"start copying all parametrization files to GPU");
124
125 unsigned long long seed=23424352;
127
129 m_gl = new GeoLoadGpu();
131 m_gl->set_ncells( calogeo->get_cells()->size() );
132
133 if(calogeo->get_cells()->size() ==0 ) return StatusCode::SUCCESS;
134
136 int nrgns= calogeo->get_tot_regions();
137 m_gl->set_nregions( nrgns);
138
139
140 if(!convert_cellmap(calogeo->get_cells(),&m_cellmap_gpu)){
141 ATH_MSG_ERROR(
"can not convert the CaloDetDescrElement to CaloDetDescrElement_GPU ");
142 }
143 m_gl->set_cellmap( &m_cellmap_gpu);
144 GeoRegion* GR_ptr = (GeoRegion*)
malloc( nrgns *
sizeof( GeoRegion ));
145 m_gl->set_regions( GR_ptr );
146
148
149 m_gl->set_sample_index_h( si );
150
154 int nr = calogeo->get_n_regions( is );
156 for (
int ir = 0;
ir < nr; ++
ir ) region_data_cpy( calogeo->get_region( is,
ir), &GR_ptr[i++] );
157 }
158
159 if(m_gl->LoadGpu())
160 ATH_MSG_INFO(
"calo geometry loaded successfully in GPU");
161 else
163#endif
164
165 return StatusCode::SUCCESS;
166}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::unique_ptr< CaloDetDescrManager > buildCaloDetDescrNoAlign(ISvcLocator *svcLocator, IMessageSvc *msgSvc)
static constexpr const char * caloMgrStaticKey
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static const Info & instance()
Singleton accessor function.
static const int MAX_SAMPLING
std::unique_ptr< CaloGeometryFromCaloDDM > m_caloGeo
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
TFCSParametrizationBase * m_param
int ir
counter of the current depth
IMessageSvc * getMessageSvc(bool quiet=false)
void * Rand4Hits_init(long long, unsigned short, unsigned long long, bool)
retrieve(aClass, aKey=None)