104{
105
106 if (isPrepared) { return; }
107 isPrepared = true;
108
115
116 auto nmod = fSharedModels->size();
117 if (0 == nmod) {
118
119 G4VXRayModel* mod = new G4StandardCerenkovModel();
120 fSharedModels->push_back(mod);
121 nmod = 1;
122 }
123
124 fSecondaries.reserve(fMaxPhotons);
125 nModels = (
G4int)nmod;
126
127
128 if (isInitializer) {
131
132
133 fLV->reserve(nmod);
134 for (
G4int i=0; i<nModels; ++i) {
135 auto v = new std::vector<const G4LogicalVolume*>;
136 fLV->push_back(v);
137 }
138
139 for (auto const & lv : *lvs) {
140
141 auto const MPT = lv->GetMaterial()->GetMaterialPropertiesTable();
142 if (nullptr == MPT) { continue; }
143
144 const G4String& lvname = lv->GetName();
146
147 if (!modAndVol.empty()) {
148 for (auto const & it : modAndVol) {
149 if (it.second == lvname) {
151 (*fLV)[0]->push_back(lv);
152 fLVNames->push_back(lvname);
153 ok = true;
154 break;
155 }
156 }
157 }
158 }
159 if (ok) { continue; }
160
161
162 for (
G4int i=0; i<nModels; ++i) {
163 if (lvname == (*fLVNames)[i]) {
164 (*fLV)[i]->push_back(lv);
165 ok = true;
166 break;
167 }
168 }
169 if (ok) { continue; }
170
171
172 if (
nullptr != MPT->GetProperty(
kRINDEX)) {
173 (*fLV)[0]->push_back(lv);
174 fLVNames->push_back(lvname);
175 }
176 }
177 }
178}
static G4LogicalVolumeStore * GetInstance()
G4int GetCerenkovVerboseLevel() const
const std::vector< std::pair< G4XRayModelType, const G4String > > & ActiveVolumes() const
G4int GetCerenkovMaxPhotonsPerStep() const
static G4OpticalParameters * Instance()
G4double GetCerenkovMaxBetaChange() const
G4bool GetCerenkovTrackSecondariesFirst() const
G4bool GetCerenkovStackPhotons() const