11/* *******************************************************************************
2- * Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+ * Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33 * *
44 * This software is distributed under the terms of the *
55 * GNU Lesser General Public Licence (LGPL) version 3, *
4747#include < map>
4848#include < memory>
4949
50+ thread_local std::vector<FairVolume*> FairModule::fAllSensitiveVolumes ;
51+
5052void FairModule::ConstructGeometry ()
5153{
5254 LOG (warn)
@@ -65,9 +67,6 @@ FairModule::FairModule(const char* Name, const char* title, Bool_t Active)
6567 : TNamed(Name, title)
6668 , fActive(Active)
6769{
68- if (!svList) {
69- svList = new TRefArray ();
70- }
7170 if (!vList) {
7271 vList = new FairVolumeList ();
7372 }
@@ -84,13 +83,6 @@ FairModule::FairModule(const FairModule& rhs)
8483 , fVerboseLevel(rhs.fVerboseLevel )
8584 , fGeoSaved(rhs.fGeoSaved )
8685{
87- if (!svList) {
88- svList = new TRefArray ();
89- for (Int_t i = 0 ; i < rhs.svList ->GetEntries (); i++) {
90- svList->Add (rhs.svList ->At (i));
91- }
92- }
93-
9486 if (!vList) {
9587 vList = new FairVolumeList ();
9688 for (Int_t i = 0 ; i < rhs.vList ->getEntries (); i++) {
@@ -218,9 +210,6 @@ void FairModule::ProcessNodes(TList* aList)
218210 from ConstructGeometry() of your detector class. Aborting..." ;
219211 }
220212
221- if (!svList) {
222- svList = new TRefArray ();
223- }
224213 if (!vList) {
225214 vList = new FairVolumeList ();
226215 }
@@ -251,7 +240,7 @@ void FairModule::ProcessNodes(TList* aList)
251240 if (node->isSensitive () && fActive ) {
252241 volume->setModId (fModId );
253242 volume->SetModule (this );
254- svList-> Add (volume);
243+ fAllSensitiveVolumes . push_back (volume);
255244 aVol = dynamic_cast <FairGeoVolume*>(node);
256245 fNodes ->AddLast (aVol);
257246 fNbOfSensitiveVol ++;
@@ -271,7 +260,7 @@ void FairModule::AddSensitiveVolume(TGeoVolume* v)
271260 vList->addVolume (volume);
272261 volume->setModId (fModId );
273262 volume->SetModule (this );
274- svList-> Add (volume);
263+ fAllSensitiveVolumes . push_back (volume);
275264 fNbOfSensitiveVol ++;
276265 }
277266}
0 commit comments