void KVSpectroDetector::AddAbsorberLayer( TGeoVolume *vol, Bool_t active){ // Add an absorber layer to the detector made from the shape of the // volume. // If active = kTRUE the layer is set active. TGeoMaterial* material = vol->GetMaterial(); KVIonRangeTableMaterial* irmat = KVMaterial::GetRangeTable()->GetMaterial(material); if(!irmat){ Warning("AddAbsorberLayer", "Unknown material %s/%s used in layer %s of detector %s", material->GetName(), material->GetTitle(), vol->GetName(), GetName()); return; } TGeoBBox* sh = dynamic_cast<TGeoBBox*>(vol->GetShape()); if(!sh) { Warning("AddAbsorberLayer", "Unknown shape class %s used in layer %s of detector %s", vol->GetShape()->ClassName(), vol->GetName(), GetName()); return; // just in case - for now, all shapes derive from TGeoBBox... } Double_t width = 2.*sh->GetDZ(); // thickness in centimetres KVMaterial* absorber; if( irmat->IsGas() ){ Double_t p = material->GetPressure(); Double_t T = material->GetTemperature(); absorber = new KVMaterial(irmat->GetType(), width, p, T); } else absorber = new KVMaterial(irmat->GetType(), width); KVDetector::AddAbsorber(absorber); ClearHits(); if( active ) SetActiveLayer( GetListOfAbsorbers()->GetEntries()-1 ); }
void KVHarpeeIC::SetTemperature(Double_t t) { // Set the same temperature for each gaz layer. // The units are: degrees celsius if (!IsGas()) return; KVMaterial* abs = NULL; TIter next(GetListOfAbsorbers()); while ((abs = (KVMaterial*)next())) { if (abs->IsGas()) { abs->SetTemperature(t); if (abs->GetAbsGeoVolume()) abs->GetAbsGeoVolume()->GetMaterial()->SetTemperature(t); } } }
void KVHarpeeIC::SetPressure(Double_t p /* mbar */) { // Set the same pressure for each gas layer (in mbar) if (!IsGas()) return; KVMaterial* abs = NULL; TIter next(GetListOfAbsorbers()); while ((abs = (KVMaterial*)next())) { if (abs->IsGas()) { abs->SetPressure(p * KVUnits::mbar); if (abs->GetAbsGeoVolume()) abs->GetAbsGeoVolume()->GetMaterial()->SetPressure(p * KVUnits::mbar); } } KVDetector::SetPressure(p * KVUnits::mbar); }