void Array3DEvent::Render(wxDC & dc, int x, int y, unsigned int width, gd::EventsEditorItemsAreas & areas, gd::EventsEditorSelection & selection, const gd::Platform & platform) { gd::EventsRenderingHelper * renderingHelper = gd::EventsRenderingHelper::GetInstance(); int border = renderingHelper->instructionsListBorder; const int functionTextHeight = 20; //Draw header rectangle wxRect headerRect(x, y, width, functionTextHeight); renderingHelper->DrawNiceRectangle(dc, headerRect); //Name dc.SetFont( renderingHelper->GetNiceFont().Bold() ); dc.SetTextForeground(wxColour(0,0,0)); wxString caption = _("Iterate through ") + (GetArrayName() != "" ? GetArrayName() : _("(Not defined)")) + _(" on XYZ"); dc.DrawText( caption, x + 4, y + 3 ); //Draw conditions rectangle wxRect rect(x, y+functionTextHeight, renderingHelper->GetConditionsColumnWidth()+border, GetRenderedHeight(width, platform)-functionTextHeight); renderingHelper->DrawNiceRectangle(dc, rect); //Draw actions and conditions renderingHelper->DrawConditionsList(conditions, dc, x+border, y+functionTextHeight+border, renderingHelper->GetConditionsColumnWidth()-border, this, areas, selection, platform); renderingHelper->DrawActionsList(actions, dc, x+renderingHelper->GetConditionsColumnWidth()+border, y+functionTextHeight+border, width-renderingHelper->GetConditionsColumnWidth()-border*2, this, areas, selection, platform); }
KVDriftChamber::KVDriftChamber() { // Default constructor init(); SetType("FIL"); SetName(GetArrayName()); }
KVHarpeeSi::KVHarpeeSi(UInt_t number, Float_t thick) : KVVAMOSDetector(number, "Si") { // Make a silicon detector of Harpee. // Type of detector: "SI" // Label of detector: "SI" init(); SetType("SI"); SetLabel("SI"); SetName(GetArrayName()); Float_t w = 1.; // width Float_t h = 1.; // height Float_t th = thick * KVUnits::um; // thickness Double_t dx = w / 2; Double_t dy = h / 2; Double_t dz = th / 2; fTotThick += th; // adding the absorber TGeoShape* shape = new TGeoBBox(dx, dy, dz); AddAbsorber("Si", shape, 0, kTRUE); }
KVHarpeeSi::KVHarpeeSi(){ // Default constructor. init(); SetType("SI"); SetLabel("SI"); SetName(GetArrayName()); }
KVHarpeeIC::KVHarpeeIC() { // Default constructor // This constructor must exist in order for cloning of detectors // to work (as used in KVTelescope::AddDetector). // Do not replace this constructor by giving a default value for // the first argument of KVHarpeeIC(Float_t, Float_t). init(); SetType("CHI"); SetLabel("CHI"); SetName(GetArrayName()); }
/// Converts this object to a valid OIFITSLIB OI_ARRAY struct. oi_array Array::GetOIArray(void) { /// \todo This could be claned up to use datamembers instead of function calls. // init local vars: oi_array array; int nstations = GetNumStations(); string arrname = GetArrayName(); double GeocLat, GeocRadius; // Allocate room for the station information array.elem = (element *) malloc(nstations * sizeof(element)); // Set the revision number, array name, and coordiantes. array.revision = 1; strncpy(array.arrname, arrname.c_str(), FLEN_VALUE); strncpy(array.frame, "GEOCENTRIC", FLEN_VALUE); wgs84_to_geoc(latitude, altitude, &GeocLat, &GeocRadius); array.arrayx = GeocRadius * cos(GeocLat) * cos(this->longitude); array.arrayy = GeocRadius * cos(GeocLat) * sin(this->longitude); array.arrayz = GeocRadius * sin(GeocLat); array.nelement = nstations; Station * station; string station_name; for (int i = 0; i < nstations; i++) { station = this->GetStation(i); station_name = station->GetName(); station_name.resize(16); strncpy(array.elem[i].tel_name, station->GetName().c_str(), 16); strncpy(array.elem[i].sta_name, station->GetName().c_str(), 16); array.elem[i].sta_index = station->GetIndex(); array.elem[i].diameter = station->diameter; array.elem[i].staxyz[0] = station->xyz[0]; array.elem[i].staxyz[1] = station->xyz[1]; array.elem[i].staxyz[2] = station->xyz[2]; } return array; }
void Array3DEvent::SaveToXml(TiXmlElement * elem) const { TiXmlElement * conditionsElem = new TiXmlElement( "Conditions" ); elem->LinkEndChild( conditionsElem ); gd::EventsListSerialization::SaveConditions(conditions, conditionsElem); TiXmlElement * actionsElem = new TiXmlElement( "Actions" ); elem->LinkEndChild( actionsElem ); gd::EventsListSerialization::SaveActions(actions, actionsElem); if ( !GetSubEvents().empty() ) { TiXmlElement * subeventsElem; subeventsElem = new TiXmlElement( "Events" ); elem->LinkEndChild( subeventsElem ); gd::EventsListSerialization::SaveEventsToXml(events, subeventsElem); } GD_CURRENT_ELEMENT_SAVE_ATTRIBUTE_STRING("name", GetArrayName()); }
KVHarpeeIC::KVHarpeeIC(UInt_t number, Float_t pressure, Float_t temp, Float_t thick) : KVVAMOSDetector(number, "C4H10") { // Make the ionisation chamber of Harpee composed by: // - one 1.5 mylar window; // - 3 volumes of C4H10 with thicknesses (2*dz): 2.068 cm, thick, 1.278 cm. // By default thick=10.457 cm; // Only the 2nd gaz volume is "active". // // The width (2*dx) of this detector is ??? and the height (2*dy) is ???. // The ionisation chamber is closed with the silicon wall in Harpee. // // Input: pressure - pressure of the gaz in mbar // temp - temperature of the gaz in degrees celsius. // Default temperature = 19°C // thick - the thickness in cm of the 2nd volume of gaz. Warning("KVHarpeeIC", "Check if the width, the height and the thickness are correct in this constructor"); init(); SetType("CHI"); SetLabel("CHI"); SetName(GetArrayName()); // number of absorber Int_t Nabs = 4; // material of each absorber const Char_t* mat[] = {"Myl", "C4H10", "C4H10", "C4H10"}; // thickness of each absorber Float_t th[] = { static_cast<Float_t>(1.5 * KVUnits::um), static_cast<Float_t>(2.068 * KVUnits::cm), static_cast<Float_t>(thick * KVUnits::cm), static_cast<Float_t>(1.278 * KVUnits::cm) }; // active absorber flag Bool_t active[] = { kFALSE, kFALSE, kTRUE, kFALSE}; // width and height of the detector. TO BE VERIFIED Float_t w = 40 * KVUnits::cm; Float_t h = 12 * KVUnits::cm; // total thickness of the detector Float_t wtot = 0; for (Int_t i = 0; i < Nabs; i++) wtot += th[i]; // pressure and temperature of the detector SetPressure(pressure * KVUnits::mbar); SetTemperature(temp); // Adding the absorbers TGeoShape* shape = NULL; for (Int_t i = 0; i < Nabs; i++) { Double_t dx = w / 2; Double_t dy = h / 2; Double_t dz = th[i] / 2; fTotThick += th[i]; // box shape of the absorber shape = new TGeoBBox(dx, dy, dz); // build and position absorber in mother volume. // Reference is the center of absorber Double_t ztrans = dz - wtot / 2; for (Int_t j = 0; j < Nabs - 1; j++) ztrans += (j < i) * th[j]; TGeoTranslation* tr = new TGeoTranslation(0., 0., ztrans); AddAbsorber(mat[i], shape, tr, active[i]); } }