File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -250,19 +250,20 @@ void FairModule::ProcessNodes(TList* aList)
250250 }
251251}
252252
253- void FairModule::AddSensitiveVolume (TGeoVolume* v )
253+ void FairModule::AddSensitiveVolume (TGeoVolume* vol )
254254{
255- LOG (debug2) << " AddSensitiveVolume " << v->GetName ();
256-
257- // Only register volumes which are not already registered
258- // Otherwise the stepping will be slowed down
259- if (!vList->findObject (v->GetName ())) {
260- auto addedVol = vList->addVolume (std::make_unique<FairVolume>(v->GetName (), fNbOfVolumes ++));
261- addedVol->setModId (fModId );
262- addedVol->SetModule (this );
263- fAllSensitiveVolumes .push_back (addedVol);
264- fNbOfSensitiveVol ++;
255+ auto volName = vol->GetName ();
256+ LOG (debug2) << " AddSensitiveVolume " << volName;
257+
258+ auto addedVol = vList->addVolume (std::make_unique<FairVolume>(volName, fNbOfVolumes ));
259+ if (!addedVol) {
260+ return ;
265261 }
262+ ++fNbOfVolumes ;
263+ addedVol->setModId (fModId );
264+ addedVol->SetModule (this );
265+ fAllSensitiveVolumes .push_back (addedVol);
266+ ++fNbOfSensitiveVol ;
266267}
267268
268269FairVolume* FairModule::getFairVolume (FairGeoNode* fN )
You can’t perform that action at this time.
0 commit comments