/** helper/create_geo.C @brief Calculates the values for media file Creates geometry file for disk DIRC @author Peter Koch @date 2008-04-06 @version 2 @since 2007-11-26 Version 2:\n Now we will put our detector in a air-mother, so all mcp/mirror/glass will be surrounded by \n air and the total reflections wont need further implementations.\n Also the photons will now reach the mcp and can be detected.\n \n Version 1:\n This version was made of the glass coated with air-volumes. surrounded by uncoated mirrors. \n So we cant get total reflection in the mirrors and the photons wont ever reach the mcp. **/ { // root gROOT->Reset(); gSystem->Load("libMathCore"); // control switches Bool_t fWithPip = true; // constants and controls const Double_t mm = 1.; const Double_t cm = 10.; const Double_t zero = 0.; const Double_t one = 1.; const Int_t prc = 6; Int_t pos = 0; // needed to create copies // fFile, definitions for output Int_t fFileGeoPrec = 6; // precision used in geo-file // TString fFileGeoName = "/opt/fairroot/pandaroot/geometry/dsk.geo"; const TString fFileGeoName = "/opt/panda/pandaroot/macro/dsk/dsk.geo"; // globals const TString fGlbName = "dsk"; const TString fGlbMother = "cave"; const Int_t fGlbEdges = 8; // a octagon; max: 36 const Int_t fGlbDetectorsPerEdge = 12; const Int_t fGlbDetectorTypes = 3; const Double_t fGlbDistance = 180. *cm; // z-coordinate of first disk-plane Double_t fGlbThickness; // calculated // beam pipe const Double_t fPipRadOuter = 30. *mm; // outer radius const Double_t fPipRadInner = 20. *mm; // inner radius // local mother Double_t fLMoThickness; // calculated Double_t fLMoRadInner; // calculated Double_t fLMoRadOuter; // calculated // coating const Double_t fCotThickness = 1. *cm; // disk const Double_t fDskThickness = 2. *cm; // thickness of disk Double_t fDskRadInner; // calculated Double_t fDskRadOuter; // calculated // window Double_t fWinHeightHalf; // calculated Double_t fWinWidthHalf; // calculated // array Double_t fAryHeight; // calculated Double_t fAryWidth; // calculated Double_t fAryWidthHalf; // calculated // detector Double_t fDetWidth; // calculated const Double_t fDetGapBetween = 0. *mm; const Double_t fDetGapBorder = 0. *mm; // mirror const Double_t fMirHeight = 5. *mm; // mcp const Double_t fMcpHeight = 1.7 *cm; // the dskXX numbers TString fNmbrPip = "49"; // the Beampipe TString fNmbrLMo = "01"; // local mother TString fNmbrDsk = "02"; // glass polygon Int_t fNmbrWin = 10; // window inside 02; so will be 10, 11, 12, ..., 18 TString fNmbrAry = "19"; // mother for all detecttors of an edge TString fNmbrDet = "2"; // detector: a mirror and an mcp TString fNmbrMir = "3"; // mirror TString fNmbrMcp = "4"; // mcp // the materials TString fMatPip = "DISKmirror0"; TString fMatLMo = "DISKair"; TString fMatDsk = "DISKglass"; TString fMatWin = "vacuum"; TString fMatAry = "DISKair"; TString fMatDet = "DISKair"; TString fMatMir = "DISKmirror"; TString fMatMcp = "DISKmcp"; // calculated values // angles // segment angle [rad]; 2\pi/fEdges const Double_t fAlphaRad = 360./fGlbEdges*TMath::DegToRad(); // offset from x=0-line to first segment, angle [dgree] const Double_t fPhi = 180./fGlbEdges; const Double_t fPhiRad = fPhi * TMath::DegToRad(); fGlbThickness = fDskThickness + fCotThickness; fWinHeightHalf = fGlbDistance*TMath::Tan(5.*TMath::DegToRad()); fWinWidthHalf = fGlbDistance*TMath::Tan(10.*TMath::DegToRad()); fDskRadOuter = fGlbDistance*TMath::Tan(22.*TMath::DegToRad()); fDskRadInner = fWinHeightHalf; fAryHeight = fMirHeight + fMcpHeight; fAryWidthHalf = fDskRadOuter*TMath::Tan(fAlphaRad/2.); fAryWidth = 2.*fAryWidthHalf; fLMoThickness = fGlbThickness + fCotThickness; fLMoRadInner = fPipRadOuter + 1.*cm; fLMoRadOuter = fDskRadOuter + fAryHeight + fCotThickness; fDetWidth = (fAryWidth-2.*fDetGapBorder-(fGlbDetectorsPerEdge-1)*fDetGapBetween)/fGlbDetectorsPerEdge; // z-koordinate shifts const Double_t fLMoZ = -fCotThickness; // ----------------------------------------------------------------------------- // output to .geo - file // ----------------------------------------------------------------------------- FILE* fFile; // fFile = fopen(fFileGeoName.Data(), "w"); fFile = fopen("/opt/panda/pandaroot/macro/dsk/dsk.geo", "w"); if (fWithPip) { cout<<"-I- calculating beampipe (debug)"<