Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LBNEVolumePlacements Class Reference

#include <LBNEVolumePlacements.hh>

Public Types

enum  TargetType { SAT = 0, Cylinder = 1 }
 

Public Member Functions

void InitializeMessenger ()
 
void Initialize (const G4LogicalVolume *matriarch)
 
LBNEVolumePlacementDataCreate (const G4String &name)
 
G4PVPlacement * PlaceFinal (const G4String &name, G4VPhysicalVolume *mother)
 
void PlaceFinalUpstrTarget (G4PVPlacement *mother)
 
void PlaceFinalDownstrTarget (G4PVPlacement *mother)
 
void PlaceFinalHorn1 (G4PVPlacement *mother, G4PVPlacement *motherDownstrTarget)
 
void PlaceFinalNoSplitHorn1 (G4PVPlacement *mother, G4PVPlacement *motherTop)
 
void UpdateParamsForHorn1MotherPoly ()
 
void PlaceFinalSimpleHornPolyNumber (size_t iHorn, G4PVPlacement *mother)
 
void UpdateParamsForHornMotherPolyNum (size_t iH)
 
void ExtendChaseLengthForHorn2 ()
 
void PlaceFinalHorn2 (G4PVPlacement *mother)
 
void PlaceFinalDecayPipeSnout (G4PVPlacement *mother)
 
double GetMaxRadiusMotherHorn1 ()
 
void PrintAll () const
 
double GetTargetHallZ () const
 
double GetDecayHallZ () const
 
double GetDecayPipeLength () const
 
double GetDecayPipeRadius () const
 
double GetDecayPipeUpstrWindowThick () const
 
double GetDecayPipeLongPosition () const
 
G4String GetDecayPipeGas () const
 
G4String GetHorn1InnerConductorMaterial () const
 
G4String GetHorn2InnerConductorMaterial () const
 
G4String GetHorn3InnerConductorMaterial () const
 
G4String GetHorn1AllConductorMaterial () const
 
G4String GetHorn2AllConductorMaterial () const
 
G4String GetHorn3AllConductorMaterial () const
 
double GetAbsorberHallZ () const
 
double GetHorn1Length () const
 
double GetBaffleLength () const
 
double GetBaffleWindowThickness () const
 
double GetBaffleInnerRadius () const
 
double GetBaffleZPosition () const
 
double GetPlugLength () const
 
double GetPlugInnerRadius () const
 
double GetPlugOuterRadius () const
 
double GetPlugZPosition () const
 
std::string GetPlugMaterial () const
 
void SetTotalLengthOfRock (double l)
 
double GetTotalLengthOfRock () const
 
void SetLengthOfRockDownstreamAlcove (double l)
 
double GetLengthOfRockDownstreamAlcove () const
 
void SetDecayPipeLength (double l)
 
void SetDecayPipeRadius (double l)
 
void SetDecayPipeLongPosition (double l)
 
void SetDecayPipeUpstrWindowThick (double l)
 
void SetDecayPipeGas (G4String &name)
 
void SetHorn1InnerConductorMaterial (G4String &name)
 
void SetHorn2InnerConductorMaterial (G4String &name)
 
void SetHorn3InnerConductorMaterial (G4String &name)
 
void SetHorn1AllConductorMaterial (G4String &name)
 
void SetHorn2AllConductorMaterial (G4String &name)
 
void SetHorn3AllConductorMaterial (G4String &name)
 
void SetTotalLength (double l)
 
void SetWaterLayerThickInHorns (double l)
 
void SetHorn1Length (double l)
 
void SetBaffleLength (double l)
 
void SetBaffleInnerRadius (double r)
 
void SetBaffleZPosition (double z)
 
void SetPlugLength (double l)
 
void SetPlugInnerRadius (double r)
 
void SetPlugOuterRadius (double r)
 
void SetPlugMaterial (std::string name)
 
void SetPlugZPosition (double z)
 
void SetConstructPlug (bool t)
 
void SetConstructPlugInHorn1 (bool t)
 
void SetUseSimpleTargetBox (bool t)
 
void SetUseSimpleTargetCylinder (bool t)
 
void SetSimpleTargetRadius (double r)
 
void SetSimpleTargetWidth (double r)
 
void SetSimpleTargetHeight (double r)
 
void SetSimpleTargetLength (double l)
 
bool GetUseSimpleTargetBox () const
 
bool GetUseSimpleTargetCylinder () const
 
bool GetConstructPlug () const
 
bool GetConstructPlugInHorn1 () const
 
double GetSimpleTargetRadius () const
 
double GetSimpleTargetWidth () const
 
double GetSimpleTargetHeight () const
 
double GetSimpleTargetLength () const
 
void SetRemoveTargetAlltogether (bool t)
 
bool GetRemoveTargetAlltogether ()
 
double GetTargetSLengthGraphite () const
 
void SetTargetSLengthGraphite (double l)
 
double GetTargetFinWidth () const
 
void SetTargetFinWidth (double l)
 
unsigned int GetTargetNumFinsWithWings () const
 
void SetTargetNumFinsWithWings (unsigned int n)
 
double GetTargetDensity () const
 
void SetTargetDensity (double l)
 
double GetTargetSpecificLambda () const
 
void SetTargetSpecificLambda (double l)
 
G4String GetTargetMaterialName () const
 
void SetTargetMaterialName (G4String &aName)
 
double GetTargetLengthIntoHorn () const
 
void SetTargetLengthIntoHorn (double l)
 
void SetTargetLengthOutsideHorn (double l)
 
double GetTargetBerylDownstrWindowThick () const
 
void SetTargetBerylDownstrWindowThick (double t)
 
void SetHorn1RadialSafetyMargin (double t)
 
double GetHorn1RadialSafetyMargin () const
 
void SetHorn1RadiusBigEnough (bool t)
 
bool IsHorn1RadiusBigEnough () const
 
void SetHorn1LongRescale (double r)
 
double GetHorn1LongRescale () const
 
void SetHorn1RadialRescale (double r)
 
double GetHorn2LongRescale () const
 
void SetHorn2LongRescale (double r)
 
double GetHorn2RadialRescale ()
 
void SetHorn2RadialRescale (double r)
 
void SetHorn2RadialRescaleCst (double r)
 
double GetHorn2LongPosition () const
 
void SetHorn2LongPosition (double l)
 
bool GetUseMarsTargetHorns () const
 
void SetUseMarsTargetHorns (bool v)
 
G4String GetMarsTargetHornsGDMLFilename () const
 
void SetMarsTargetHornsGDMLFilename (G4String &name)
 
G4String GetAbsorberGDMLFilename () const
 
void SetAbsorberGDMLFilename (G4String &name)
 
double GetHorn1NeckZPosition () const
 
double GetHorn1NeckLength () const
 
double GetHorn1NeckOuterRadius () const
 
double GetHorn1NeckInnerRadius () const
 
double GetHorn1ZDEndNeckRegion () const
 
double GetHorn1ZEndIC () const
 
double GetHorn1EffectiveLength () const
 
double GetHorn1DeltaZEntranceToZOrigin () const
 
double GetHorn1OuterTubeOuterRad () const
 
double GetHornsOuterTubeOuterRad (size_t iH) const
 
double GetHorn2NeckZPosition () const
 
double GetHorn2NeckLength () const
 
double GetHorn2NeckOuterRadius () const
 
double GetHorn2NeckInnerRadius () const
 
double GetHorn2ZEndIC () const
 
double GetHorn2ZEqnChange (size_t k) const
 
size_t GetHorn2ZEqnChangeNumEqn () const
 
double GetHorn2DeltaZEntranceToZOrigin () const
 
double GetHorn2OuterTubeOuterRad () const
 
bool GetDoInstallShield () const
 
void SetDoInstallShield (bool v)
 
void SegmentTarget ()
 
void SegmentTargetSmallTgt ()
 
void SegmentRALTGTv1 ()
 
std::vector< G4String > GetHorn1ICList () const
 
std::vector< G4String > GetHorn2ICList () const
 
void RescaleHorn1Lengthwise ()
 
void RescaleHorn2Lengthwise ()
 
void RescaleHorn1Radially ()
 
void RescaleHorn2Radially ()
 
void ShiftHorn2Radially ()
 
LBNEVolumePlacementDataCreateHorn1TopLevelUpstr ()
 
const LBNEVolumePlacementDataFind (const G4String &name, const char *motherName, const char *method) const
 
double GetConductorRadiusHorn1 (double zD, size_t eqn) const
 
double GetConductorRadiusHorn2 (double zD, size_t eqn) const
 
bool GetUse1p2MW () const
 
void SetUse1p2MW (bool t)
 
bool GetUse1p2MWSmallTgt () const
 
void SetUse1p2MWSmallTgt (bool t)
 
bool GetUseRALTGTv1 () const
 
void SetUseRALTGTv1 (bool t)
 
bool GetUseRoundedTargetFins () const
 
void SetUseRoundedTargetFins (bool t)
 
void adaptTargetFor1p2MW ()
 
void adaptTargetFor1p2MWSmallTgt ()
 
void adaptRALTGTv1 ()
 
void configureTargetForConceptHornARev2 ()
 
std::vector< double > GetHornsPolyInnerConductorRadiiHornARev2 () const
 
std::vector< double > GetHornsPolyInnerConductorZsHornARev2 () const
 
double GetThickICDRevisedHornA () const
 
std::vector< double > GetHornsPolyInnerConductorRadiiHornBRev2 () const
 
std::vector< double > GetHornsPolyInnerConductorZsHornBRev2 () const
 
double GetThickICDRevisedHornB () const
 
std::vector< double > GetHornsPolyInnerConductorRadiiHornCRev2 () const
 
std::vector< double > GetHornsPolyInnerConductorZsHornCRev2 () const
 
double GetThickICDRevisedHornC () const
 
bool GetUseHorn1Polycone () const
 
int GetUseHorn1PolyNumInnerPts () const
 
double GetHorn1PolyInnerConductorRadius (size_t numPts) const
 
double GetHorn1PolyInnerConductorThickness (size_t numPts) const
 
double GetHorn1PolyInnerConductorZCoord (size_t numPts) const
 
double GetHorn1PolyOuterRadius () const
 
void SetUseHorn1Polycone (bool t)
 
void SetUseHorn1PolyNumInnerPts (int n)
 
void SetHorn1PolyInnerThreeVect (size_t iP, G4ThreeVector vVal)
 
void SetHorn1PolyOuterRadius (double r)
 
int GetNumberOfHornsPolycone () const
 
int GetUseHornsPolyNumInnerPts (size_t i) const
 
double GetHornsPolyInnerConductorRadius (size_t iH, size_t numPts) const
 
double GetHornsPolyInnerConductorThickness (size_t iH, size_t numPts) const
 
double GetHornsPolyInnerConductorZCoord (size_t iH, size_t numPts) const
 
double GetHornsPolyOuterRadius (size_t iH) const
 
double GetHornsPolyZStartPos (size_t iH) const
 
bool IsHornPnParabolic (size_t numHorn) const
 
bool IsHorn1PlParabolic () const
 
size_t GetHornParabolicNumInnerPts (size_t iH) const
 
double GetHornParabolicRZCoord (size_t iH, size_t k) const
 
double GetHornParabolicRIn (size_t iH, size_t k) const
 
double GetHornParabolicThick (size_t iH, size_t k) const
 
void SetNumberOfHornsPolycone (int n)
 
void SetPolyconeHornParabolic (size_t hornNumber, bool t)
 
void SetPolyconeHorn1Parabolic (bool t)
 
void SetUseHornsPolyNumInnerPts (size_t hornNumber, size_t nElem)
 
void SetHornsPolyInnerThreeVect (size_t hornNumber, size_t iP, G4ThreeVector vVal)
 
void SetHornsPolyOuterRadius (size_t hornNumber, double r)
 
void SetHornsPolyZStartPos (size_t hornNumber, double z)
 
double GetHorn1RMinAllBG () const
 
double GetHorn1RMaxAllBG () const
 
void SetUsePseudoNova (bool t)
 
bool GetUsePseudoNova () const
 
void SetTargetNoSplitM1 (G4VPhysicalVolume *p)
 
void SetTargetHorn1HallPhysPtr (G4VPhysicalVolume *p)
 
void SetHorn1HallPhysPtr (G4PVPlacement *p)
 
bool GetHorn1MotherIsPolycone () const
 
void SetUseMultiSphereTarget (bool t)
 
void SetMultiSphereTargetLength (double r)
 
void SetMultiSphereTargetRadius (double r)
 
bool GetUseMultiSphereTarget () const
 
double GetMultiSphereTargetRadius () const
 
void AdaptForMultiSphereTarget ()
 
void PlaceFinalMultiSphereTarget (LBNEVolumePlacementData *plHelium, G4PVPlacement *mother)
 
bool GetRemoveDecayPipeSnout () const
 
void SetRemoveDecayPipeSnout (bool t)
 
double GetRadiusMilindWire () const
 
void SetRadiusMilindWire (double r)
 
double GetCurrentMilindWire () const
 
void SetCurrentMilindWire (double r)
 
bool GetWriteGDMLFile () const
 
void SetWriteGDMLFile (bool t)
 
double GetChaseWidthForLBNF () const
 
void SetUseTargetModule (bool t)
 
bool GetUseTargetModule () const
 
void SetUseTarget2Module (bool t)
 
bool GetUseTarget2Module () const
 
void SetTargetModuleType (int i)
 
int GetTargetModuleType () const
 
void SetTarget2ModuleType (int i)
 
int GetTarget2ModuleType () const
 
void InitTargetModule ()
 
void InitTarget2Module ()
 
void PlaceTargetModule (int number=1)
 
LBNEVolumePlacementDataCreateTargetVol (const G4String &volName, int number=1)
 
void PlaceTargetOuterCan (int number=1)
 
void PlaceTargetInnerCan (int number=1)
 
void PlaceTargetSupport (int number=1)
 
void PlaceTargetObject (int number=1)
 
void SetTargetRadius (double r)
 
double GetTargetRadius () const
 
void SetTarget2Radius (double r)
 
double GetTarget2Radius () const
 
void SetTargetLength (double l)
 
double GetTargetLength () const
 
void SetTarget2Length (double l)
 
double GetTarget2Length () const
 
void SetTargetFracOutHornL (double l)
 
G4double GetTargetFracOutHornL () const
 
void SetTargetNLambda (double N)
 
G4double GetTargetNLambda () const
 
void SetTarget2NLambda (double N)
 
G4double GetTarget2NLambda () const
 
void SetTargetLengthOutsideExtra (double l)
 
G4double GetTargetLengthOutsideExtra () const
 
G4double FindNTargetSpheres (int number=1) const
 
double GetTarget2Density () const
 
void SetTarget2Density (double l)
 
double GetTarget2SpecificLambda () const
 
void SetTarget2SpecificLambda (double l)
 
G4String GetTarget2MaterialName () const
 
void SetTarget2MaterialName (G4String &aName)
 
bool GetUseLBNFOptimConceptDesignHornA () const
 
bool GetUseLBNFOptimConceptDesignHornB () const
 
bool GetUseLBNFOptimConceptDesignHornC () const
 
bool GetUseCDR2015Optimized () const
 
double GetZShiftConceptHornAStartIC ()
 
double GetZHallHorn1ToHorn1PolyM1 ()
 
void SetUseLBNFOptimConceptDesignHornA (bool f)
 
void SetUseLBNFOptimConceptDesignHornB (bool f)
 
void SetUseLBNFOptimConceptDesignHornC (bool f)
 
void SetUseCDR2015Optimized (bool f)
 
void SetZHallHorn1ToHorn1PolyM1 (double d)
 
void PlaceFinalLBNFConceptHornA ()
 
void PlaceFinalLBNFConceptTgtSupport ()
 
void PlaceFinalLBNFConceptHornB ()
 
void PlaceFinalLBNFConceptStripLinesConnectHornB ()
 
void PlaceFinalLBNFConceptHornC ()
 
void PreparePolyconForConceptHornA ()
 
void PreparePolyconForConceptHornB ()
 
void PreparePolyconForConceptHornC ()
 
void PlaceFinalLBNFConceptStripLinesConnectHornC ()
 
bool GetInstallBaffle () const
 
bool GetInstallUpstreamHorizontalTarget () const
 
void SetInstallBaffle (bool f)
 
void SetInstallUpstreamHorizontalTarget (bool f)
 
bool GetInstallDownstTargetSupport () const
 
void SetInstallDownstTargetSupport (bool t)
 
bool GetRemoveRALBafflet () const
 
void SetRemoveRALBafflet (bool f)
 
bool GetInstallRALShortTarget () const
 
void SetInstallRALShortTarget (bool f)
 
double GetRALSimpleTargetLength () const
 
void SetRALSimpleTargetLength (double l)
 

Static Public Member Functions

static LBNEVolumePlacementsInstance ()
 

Public Attributes

bool fUseHorn1Polycone
 
bool fUseHornsPolycone
 
int fUseHorn1PolyNumInnerPts
 
std::vector< G4ThreeVector > fHorn1PolyListRinThickZVects
 
double fHorn1PolyOuterRadius
 
int fUseNumberOfHornsPoly
 
std::vector< int > fUseHornsPolyNumInnerPts
 
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
 
std::vector< double > fHornsPolyOuterRadius
 
std::vector< double > fHornsPolyZStartPos
 
std::vector< boolfPolyconeHornsAreParabolic
 
bool fPolyconeHorn1IsParabolic
 
std::vector< double > fZCoordCDRevisedHornA
 
std::vector< double > fRInCoordCDRevisedHornA
 
double fThickICDRevisedHornA
 
std::vector< double > fZCoordCDRevisedHornB
 
std::vector< double > fRInCoordCDRevisedHornB
 
double fThickICDRevisedHornB
 
std::vector< double > fZCoordCDRevisedHornC
 
std::vector< double > fRInCoordCDRevisedHornC
 
double fThickICDRevisedHornC
 
bool fUseTargetModule
 
bool fUseTarget2Module
 
int fTargetModuleType
 
int fTarget2ModuleType
 
G4double fTargetRadius
 
G4double fTarget2Radius
 
G4double fTargetLength
 
G4double fTarget2Length
 
G4double fTargetSupportD
 
G4double fTargetSupportL
 
G4double fTargetCaseT
 
G4double fTargetHeGap
 
G4double fTargetOutCaseInnerR
 
G4double fTarget2OutCaseInnerR
 
int fNumTargetObjects
 
int fNumTarget2Objects
 
G4double fTargetInCaseL
 
G4double fTarget2InCaseL
 
G4double fTargetInCaseUpL
 
G4double fTargetInCaseDnL
 
G4double fTargetCaseDiffL
 
G4double fTargetOutCaseL
 
G4double fTarget2OutCaseL
 
G4double fTargetModuleTotL
 
G4double fTarget2ModuleTotL
 
G4double fTargetFracOutHornL
 
G4double fTargetNLambda
 
G4double fTarget2NLambda
 
G4double fTarget2Density
 
G4double fTarget2SpecificLambda
 
G4String fTarget2MaterialName
 
G4RotationMatrix * fMirrorRotation
 
G4double fZModuleShift
 

Private Member Functions

 LBNEVolumePlacements ()
 
 ~LBNEVolumePlacements ()
 
 LBNEVolumePlacements (LBNEVolumePlacements const &)
 
LBNEVolumePlacementsoperator= (LBNEVolumePlacements const &)
 
bool CheckOverlaps (const G4PVPlacement *phys, G4int nres, G4double eps, G4bool verbose) const
 
void DeclareHorn1Dims ()
 
void CheckHorn1InnerConductAndTargetRadii ()
 
int GetNumberOfInnerHornSubSections (size_t eqn, double z1, double z2, int nMax) const
 
int GetNumberOfInnerHorn2SubSections (size_t eqn, double z1, double z2, int nMax) const
 
void Horn1InstallSpiderHanger (const G4String &name, double zFromStartInnerConduct, double zPos, G4PVPlacement *vMother)
 
void Horn2InstallSpiderHanger (const G4String &name, G4PVPlacement *vMother)
 
void Horn1PlaceAWeld (const G4String &name, double z, const LBNEVolumePlacementData *plInfo, G4PVPlacement *vMother)
 
void DeclareHorn2Dims ()
 
void PlaceFinalUpstrTarget1p2MW (G4PVPlacement *mother)
 
void PlaceFinalDownstrTarget1p2MW (G4PVPlacement *mother)
 
void PlaceFinalSmallTarget1p2MW (G4PVPlacement *mother)
 
void PlaceRALTGTv1 (G4PVPlacement *mother)
 
void PlaceFinalRALTarget (G4PVPlacement *mother)
 
void PlaceFinalUpstrTargetSimpleCylinder (G4PVPlacement *mother)
 
void PlaceFinalUpstrTargetSimpleBox (G4PVPlacement *mother)
 
void declareTargetFinVertCorners (LBNEVolumePlacementData &info)
 
void PlaceFinalUpstrMultiSphereTarget (LBNEVolumePlacementData *plHelium, G4PVPlacement *mother)
 
void setMotherVolumeForHorn1 ()
 
void setEntireTargetDims ()
 
void DumpAllHornsPolyconeParameters ()
 

Private Attributes

G4UImessenger * fPlacementMessenger
 
std::map< G4String, LBNEVolumePlacementDatafSubVolumes
 
G4RotationMatrix fRotVertical
 
G4RotationMatrix fRotTgtTitCTubeVert
 
G4RotationMatrix fRotTgtTitCTubeHor
 
G4double fTotalLength
 
G4double fLengthOfRockDownstr
 
G4double fTargetHallZ
 
G4double fAbsorberHallZ
 
G4double fDecayHallZ
 
G4double fDecayPipeLength
 
G4double fDecayPipeLengthCorrection
 
G4double fDecayPipeRadius
 
G4double fDecayPipeUpstrWindowThick
 
G4double fDecayPipeWallThick
 
G4double fDecayPipeLongPosition
 
G4String fDecayPipeGas
 
G4double fWaterLayerThickInHorns
 
G4double fHorn1Length
 
std::vector< double > fHornsLength
 
G4double fTargetAndBaffleLengthApprox
 
G4double fTargetAndPlugLengthApprox
 
G4double fHorn1DownstreamPlateLength
 
G4double fDistMCZeroToACTRN1Pts
 
G4double fBaffleInnerRadius
 
G4double fBaffleOuterRadius
 
G4double fBaffleLength
 
G4double fBaffleWindowThickness
 
G4double fBaffleZPosition
 
G4double fPlugInnerRadius
 
G4double fPlugOuterRadius
 
G4double fPlugLength
 
G4double fPlugZPosition
 
std::string fPlugMaterial
 
G4double fTargetSLength
 
G4double fTargetSLengthGraphite
 
G4double fTargetDensity
 
G4double fTargetSpecificLambda
 
G4String fTargetMaterialName
 
G4double fTargetLengthIntoHorn
 
G4double fTargetLengthOutsideHorn
 
G4double fTargetLengthOutsideExtra
 
G4double fTargetSLengthDownstrEnd
 
G4double fTargetZOffsetStart
 
G4double fTargetFinWidth
 
G4double fTargetFinWidthRequired
 
unsigned int fTargetNumFinsWithWings
 
G4double fTargetFinWWingRadius
 
G4double fTargetFinContainerWidth
 
G4double fTargetFinExtraWidth
 
G4double fTargetFinHeight
 
G4double fTargetFinLength
 
G4int fTargetNumFins
 
G4int fTargetNumFinsUpstr
 
G4int fTargetNumFinsInHorn
 
G4int fTargetNumSphere
 
G4double fTargetFinLengthSplitUpstr
 
G4double fTargetFinLengthSplitDwnstr
 
G4double fTargetFinSpacingLength
 
G4double fTargetUpstrUpstrMargin
 
G4double fTargetUpstrDwnstrMargin
 
G4String fTargetUpstrPlateMaterial
 
G4double fTargetUpstrPlateHoleRadius
 
G4double fTargetUpstrPlateOuterRadius
 
G4double fTargetUpstrPlateThick
 
G4String fTargetCanMaterial
 
G4double fTargetCanInnerRadius
 
G4double fTargetCanOuterRadius
 
G4double fTargetCanLength
 
G4String fTargetDownstrCanFlangeMaterial
 
G4double fTargetDownstrCanFlangeOuterRadius
 
G4double fTargetDownstrCanFlangeInnerRadius
 
G4double fTargetDownstrCanFlangeThick
 
G4String fTargetFlangeMaterial
 
G4double fTargetFlangeInnerRadius
 
G4double fTargetFlangeOuterRadius
 
G4double fTargetFlangeThick
 
G4String fTargetCTubeMaterial
 
G4double fTargetCTubeOuterRadius
 
G4double fTargetCTubeInnerRadius
 
G4double fTargetCTubeUpstrLength
 
G4double fTargetCTubeUpstrOffset
 
G4double fTargetCTubeUpstrRadCurve
 
G4double fTargetCTubeReturnLengthUpstr
 
G4int fTargetCTubeUpstrNumSegCurve
 
G4double fTargetCTubeReturnHOffset
 
G4double fTargetCTubeReturnLengthDownstr
 
G4double fTargetCTubeReturnDownstrCutAngleStart
 
G4double fTargetCTubeReturnDownstrCutAngleSize
 
G4double fTargetCTubeReturnDownstrRadInner
 
G4double fTargetCTubeReturnDownstrRadOuter
 
G4double fTargetCTubeReturnDownstrThickTitanium
 
G4double fTargetCTubeReturnDownstrThickWater
 
G4double fTargetCTubeReturnLengthUstr
 
G4double fTargetCTubeReturnLengthUpstrEnd
 
G4double fTargetDistFlangeToTargetStart
 
G4double fTargetDistToStartOfFlange
 
G4double fTargetAlignRingThick
 
G4double fTargetAlignRingInnerRadius
 
G4double fTargetAlignRingOuterRadius
 
G4double fTargetAlignRingCutAngle
 
G4String fTargetAlignRingMaterial
 
G4double fTargetAlignRingSpacing
 
G4int fMaxNumAlignRings
 
G4double fTargetBerylDownstrWindowThick
 
G4double fTargetBerylDownstrWindowRadius
 
G4double fTargetBerylUpstrWindowThick
 
G4double fTargetBerylUpstrWindowRadius
 
G4double fTargetHeContTubeThickness
 
G4double fTargetHeContTubeInnerRadius
 
G4double fTargetHeContTubeOuterRadius
 
G4double fTargetOutHeContTubeInnerRadius
 
G4double fTargetOutHeContTubeOuterRadius
 
G4double fTargetCTubeLength
 
G4double fTargetHeContTubeSmallConeLength
 
G4double fTargetHeContTubeSmallCylLength
 
G4double fTargetHeContTubeSmallConeInnerRad
 
G4double fTargetHeContTubeSmallConeOuterRad
 
G4double fRALSimpleTargetLength
 
G4double fTargetHeContTubeLargeConeInnerRad
 
G4double fTargetHeContTubeLargeConeOuterRad
 
G4double fTargetHeContTubeLargeConeLength
 
G4double fTargetHeContTubeBaffletLength
 
G4double fTargetBaffletOutRadius
 
G4double fTargetDSSupportConnRing
 
G4double fTargetBaffletLengthNoFlange
 
G4double fTargetBaffletFlangeLength
 
G4double fTargetHeContTubeColdHeCurvature
 
G4double fTargetOutHeContTubeInnerRadiusTapered
 
G4double fTargetOutHeContTubeOuterRadiusTapered
 
G4double fTargetOutHeContTubeTaperedLength
 
G4double fTargetOutHeContTubeStraightLength
 
G4double fTargetOutHeContTubeOuterSphericalEndCap
 
G4double fTargetOutHeContTubeInnerSphericalEndCap
 
G4double fTargetHeContTubeLengthUpstr
 
G4double fTargetHeContTubeLengthInHorn
 
G4double fTargetHeContTubeLength
 
G4double fThicknessWall
 
G4double fTargetDSSupportAlRingThickness
 
G4double fTargetDSSupportAlRingInnerRad
 
G4double fTargetDSSupportSmallConeLength
 
G4double fTargetDSSupportLargeConeLength
 
G4double fTargetDSSupportSmallConeSmallInnerRad
 
G4double fTargetDSSupportSmallConeSmallOuterRad
 
G4double fTargetDSSupportSmallConeLargeInnerRad
 
G4double fTargetDSSupportSmallConeLargeOuterRad
 
G4double fTargetDSSupportLargeConeSmallInnerRad
 
G4double fTargetDSSupportLargeConeSmallOuterRad
 
G4double fTargetDSSupportLargeConeLargeInnerRad
 
G4double fTargetDSSupportLargeConeLargeOuterRad
 
G4double fTargetDSSupportOuterRingInnerRad
 
G4double fTargetDSSupportOuterRingOuterRad
 
G4double fTargetDSSupportOuterRingLength
 
G4double fTargetZ0
 
G4double fTargetZ0Upstr
 
G4double fTargetZ0Downstr
 
G4double fTargetSWidth
 
G4double fTargetSHeight
 
std::vector< G4double > fTargetHorn1InnerRadsUpstr
 
std::vector< G4double > fTargetHorn1InnerRadsDownstr
 
std::vector< G4double > fTargetHorn1TransThick
 
std::vector< G4double > fTargetHorn1Lengths
 
std::vector< G4double > fTargetHorn1ZPositions
 
G4bool fUseSimpleTargetBox
 
G4bool fConstructPlug
 
G4bool fConstructPlugInHorn1
 
G4bool fUseSimpleTargetCylinder
 
G4double fSimpleTargetLength
 
G4double fSimpleTargetRALLength
 
G4double fRALTargetRing
 
G4double fRALTargetRadius
 
G4double fThicknessBafflet
 
G4double fSimpleTargetRadius
 
G4double fSimpleTargetHeight
 
G4double fSimpleTargetWidth
 
G4double fTotalLengthUpstreamAssembly
 
G4double fTotalLengthTargetAndHorn1Hall
 
G4bool fUseMultiSphereTarget
 
G4double fMultiSphereTargetLength
 
G4double fMultiSphereTargetRadius
 
bool fRemoveTargetAlltogether
 
bool fFillHornsWithArgon
 
G4int fHorn1RadialRescaleCnt
 
G4int fHorn1LongRescaleCnt
 
G4double fHorn1RadialRescale
 
G4double fHorn1LongRescale
 
G4double fHorn1RadialSafetyMargin
 
G4double fHorn1RMinAllBG
 
G4double fHorn1RMaxAllBG
 
bool fHorn1RadiusBigEnough
 
G4double fHorn1IOTransLength
 
G4double fHorn1IOTransInnerRad
 
G4double fHorn1IOTransOuterRad
 
std::vector< G4double > fHorn1UpstrInnerRadsUpstr
 
std::vector< G4double > fHorn1UpstrInnerRadsDownstr
 
std::vector< G4double > fHorn1UpstrInnerRadsOuterUpstr
 
std::vector< G4double > fHorn1UpstrInnerRadsOuterDownstr
 
std::vector< G4double > fHorn1UpstrLengths
 
std::vector< G4double > fHorn1UpstrZPositions
 
std::vector< G4double > fHorn1UpstrOuterIOTransInnerRads
 
std::vector< G4double > fHorn1UpstrOuterIOTransThicks
 
std::vector< G4double > fHorn1UpstrOuterIOTransLengths
 
std::vector< G4double > fHorn1UpstrOuterIOTransPositions
 
G4double fHorn1TopUpstrLength
 
G4double fHorn1TopUpstrInnerRad
 
G4double fHorn1TopUpstrOuterRad
 
G4double fZHorn1ACRNT1Shift
 
G4double fHorn1TopDownstrLength
 
G4double fHorn1TopDownstrOuterRad
 
G4double fHorn1NeckLength
 
G4double fHorn1NeckOuterRadius
 
G4double fHorn1NeckInnerRadius
 
G4double fHorn1ZDEndNeckRegion
 
G4double fHorn1NeckZPosition
 
G4double fHorn1ZEndIC
 
G4double fHorn1OuterTubeInnerRad
 
G4double fHorn1OuterTubeOuterRad
 
std::vector< double > fHornsOuterTubeOuterRad
 
G4double fHorn1OuterConnectorRad
 
G4double fHorn1OuterConnectorThick
 
G4double fHorn1OuterConnectorLength
 
G4double fHorn1OuterConnectorPosition
 
G4double fHorn1InnerConnectorRad
 
G4double fHorn1InnerConnectorThick
 
G4double fHorn1InnerConnectorLength
 
G4double fHorn1InnerConnectorPosition
 
G4String fHorn1InnerCondMat
 
G4String fHorn1AllCondMat
 
std::vector< LBNEHornRadialEquationfHorn1Equations
 
G4VPhysicalVolume * fTargetNoSplitM1
 
G4VPhysicalVolume * fTargetHorn1HallPhysPtr
 
G4PVPlacement * fHorn1HallPhysPtr
 
G4int fHorn2RadialRescaleCnt
 
G4int fHorn2LongRescaleCnt
 
G4double fHorn2RadialRescale
 
G4double fHorn2RadialRescaleCst
 
G4double fHorn2LongRescale
 
G4double fHorn2LongPosition
 
G4double fHorn2Length
 
G4double fHorn2LengthNominal
 
G4double fHorn2Radius
 
G4double fHorn2OffsetIOTr1
 
std::vector< G4double > fHorn2PartsLengths
 
std::vector< G4double > fHorn2PartsRadii
 
G4double fHorn2LengthMargin
 
std::vector< G4double > fHorn2UpstrOuterIOTransRadsOne
 
std::vector< G4double > fHorn2UpstrOuterIOTransRadsTwo
 
std::vector< G4double > fHorn2UpstrOuterIOTransLengths
 
std::vector< G4double > fHorn2UpstrOuterIOTransPositions
 
G4double fHorn2InnerIOTransLength
 
std::vector< LBNEHornRadialEquationfHorn2Equations
 
G4double fHorn2OuterTubeInnerRad
 
G4double fHorn2OuterTubeOuterRad
 
G4double fHorn2OuterTubeOuterRadMax
 
G4double fLengthCurrEqICInMotherHorn2
 
G4double fRadInnerICCurrEqHorn2
 
G4double fRadOuterICCurrEqHorn2
 
G4double fLengthCurrEqOCInMotherHorn2
 
G4double fRadInnerOCCurrEqHorn2
 
G4double fRadOuterOCCurrEqHorn2
 
G4RotationMatrix * fRotHornBStrpLineConnFlatB [4]
 
G4RotationMatrix * fRotHornBStrpLineConnFlatC [4]
 
G4RotationMatrix * fRotHornBStrpLineRotY
 
std::vector< G4double > fHorn2ZEqnChanges
 
G4double fHorn2NeckLength
 
G4double fHorn2NeckOuterRadius
 
G4double fHorn2NeckInnerRadius
 
G4double fHorn2NeckZPosition
 
G4double fHorn2ZEndIC
 
G4double fHorn2DeltaZEntranceToZOrigin
 
G4String fHorn2InnerCondMat
 
G4String fHorn2AllCondMat
 
G4String fHorn3InnerCondMat
 
G4String fHorn3AllCondMat
 
G4double fHorn3ICQLengthIntoHornMother
 
G4double fHorn3OCQLengthIntoHornMother
 
G4double fRadOuterOCCurrEqHornC
 
G4double fRadInnerOCCurrEqHornC
 
G4double fRadOuterICCurrEqHornC
 
G4double fRadInnerICCurrEqHornC
 
G4double fExtendChaseLength
 
G4double fRadiusMilindWire
 
G4double fCurrentMilindWire
 
G4double fWriteGDMLFile
 
G4double fChaseWidthForLBNF
 
G4double fDecayPipeWindowZLocation
 
G4double fDecayPipeWindowRadiusAlum
 
G4double fDecayPipeWindowRadiusBeryl
 
G4double fDecayPipeWindowThickBeryl
 
G4double fDecayPipeWindowThickAlum
 
G4bool fUse1p2MW
 
G4bool fUse1p2MWSmallTgt
 
G4bool fUseRALTGTv1
 
G4bool fUseRoundedTargetFins
 
G4bool fUsePseudoNova
 
bool fUseMarsTargetHorns
 
G4String fMarsTargetHornsGDMLFilename
 
G4String fAbsorberGDMLFilename
 
bool fDoInstallShield
 
bool fCheckVolumeOverLapWC
 
const G4LogicalVolume * fTopLogicalVolume
 
bool fHorn1MotherIsPolycone
 
double fArbitraryOffsetHystericalOne
 
std::vector< double > fMotherHorn1AllRads
 
std::vector< double > fMotherHorn1AllLengths
 
std::vector< double > fMotherHorn1AllThick
 
std::vector< std::vector< double > > fMotherHornsAllRads
 
std::vector< std::vector< double > > fMotherHornsAllThick
 
std::vector< std::vector< double > > fMotherHornsAllLengths
 
bool fRemoveDecayPipeSnout
 
bool fUseGDMLFile
 
std::vector< G4String > fHorn1IC
 
std::vector< G4String > fHorn2IC
 
bool fUseLBNFOptimConceptDesignHornA
 
bool fUseLBNFOptimConceptDesignHornB
 
bool fUseLBNFOptimConceptDesignHornC
 
bool fUseCDR2015Optimized
 
double fZShiftConceptHornAStartIC
 
double fZHallHorn1ToHorn1PolyM1
 
bool fInstallBaffle
 
bool fRemoveRALBafflet
 
bool fInstallUpstreamHorizontalTarget
 
bool fInstallRALShortTarget
 
bool fInstallDownstTargetSupport
 
size_t fLBNFOptimConceptDesignHornCNumStepIC [10]
 

Static Private Attributes

static LBNEVolumePlacementsfInstance = 0
 

Detailed Description

Definition at line 114 of file LBNEVolumePlacements.hh.

Member Enumeration Documentation

Enumerator
SAT 
Cylinder 

Definition at line 1264 of file LBNEVolumePlacements.hh.

Constructor & Destructor Documentation

LBNEVolumePlacements::LBNEVolumePlacements ( )
private

Definition at line 62 of file LBNEVolumePlacements.cc.

62  {
63 
64  fCheckVolumeOverLapWC = true;
65  fUse1p2MW = true; // We do make it true, August/September 2014.
66  fUse1p2MWSmallTgt = true; // by default, we will use the short target.. Jan 2017
67  fUsePseudoNova = false;
68  fConstructPlug = false;
69  fConstructPlugInHorn1 = false;
70  fRemoveDecayPipeSnout = false; // By default, we have the decay pipe snout, but
71  // if we optimize the Horn 1/2, then we may not have room for it.
72  // We simplify our life by removing temporarely. See G4UI card of the same name.
73  fUseHorn1Polycone = false; // By default, we still use the NuMI Horn1
74  // It's mother is now a Polycone, but the inner conductor
75  // is still based on the set of equation froun in drawing 36309x
76  // However, a simple polycone based Horn1 is available.
77  // See wiki page for details
78  // September 2014.
79  fUseHornsPolycone = false; //
80  // August 2015, Extension to multiple simple horns.
81  // Similar to Horn1Polycone.
82  //
83  fUseNumberOfHornsPoly = 0; // ditto
84  fHorn1RadiusBigEnough = false; // To fully contain (~ 1 m. long) the target. October 2014: a rather stale command...
85  // No longer recommended for use.
86  fUseRALTGTv1 = false;
87 
88  //
89  // Ferbuary 2017: Alberto would like to re-run the CDR Optim 2015 case. We install a new switch, in principle,
90  // not needed, but to make sure we have the re-scale horn2 running..
91  //
92  fUseCDR2015Optimized = false;
93 
94  fArbitraryOffsetHystericalOne = 25.3*CLHEP::mm;
95  const G4double in = 2.54*CLHEP::cm;
96  // declaration of some constant which should not impact the physics at all,
97  // but are needed to build the G4 geometry.
98  fDecayPipeLength=203.7*CLHEP::m; // CDR, Vol 2 LBNE Doc Db 4317-v25
99  fDecayPipeLengthCorrection = -1996*CLHEP::mm; // Thic correction
100  // comes about the fact that the Hadron absorber had to be placed a bit recessed with respect to
101  // end of the decay pipe to avoid volume overlaps. The Hadron absorber is tilte by the beamline angle,
102  // as it has be vertical for mechanical reasons. The value above for that correction has been obtained empirically
103  // by running geantino down the beam line. The shift makes sense, based on the height of the Hadron Absorber
104  // enclosure.
106  const double aRockLength = 2.0*(fDecayPipeLength + 160.*CLHEP::m );
107  // Approximate.. 150 m. is for the target hall, Horn1 + horn2, and the Hadron absorber hall + muon alcove.
108  fLengthOfRockDownstr = 2.0*250.0*CLHEP::m; // to absorb muons..
109  fTotalLength = aRockLength+fLengthOfRockDownstr;
110  fDecayPipeRadius = 4.0*CLHEP::m/2.;
111  fDecayPipeUpstrWindowThick = 1.3*CLHEP::mm; // After discussion with Alberto M., Sept 3 2013. Material is Berylium
112  fDecayPipeWallThick = 12.5*CLHEP::mm; // CDR, March 2012, Vol-2, p 3.130
113  fDecayPipeLongPosition = 22.2*CLHEP::m; // From the target, CDR-Vol2, March 2012, Decay pipe section, p. 3.130
114  // The above will be overwritten in placing the DecayPipeHall, downstream of the decay pipe snout.
115  fDecayPipeGas = G4String("Helium");
116 
117  fHorn1Length = 138.0*in; // Oversized.. Drawing 8875 - ME - 363093
118  fHorn1DownstreamPlateLength = in*(0.00005); // To be defined later...
119  // With respect to the center of the mother volume UpstreamTargetAssembly
120  // Obsolete, August 2014..
121 //
122 // Target The first quantity is the target length as far as the beam is concerned
123 // Can be changed vis G4UIMessenger command
124  fTargetSLengthGraphite = 953.8*CLHEP::mm; // Russian drawing 7589-00-00-00.
125 
126  fTargetSLengthDownstrEnd = 0.964*in; // Doc db 6100. Consistent with Russian drawing.
127 //
128 // The following quantity can be changed via messenger command.
129 //
130  fTargetLengthIntoHorn = fTargetSLengthGraphite - 350.*CLHEP::mm + fArbitraryOffsetHystericalOne; // Integration drawing 8875.000-ME-363028
131  //last number emprically set
132  // to have the first fin target at coord 0.3mm, to follow the convention.
133  // Related to the following quantity...
134 
135  fTargetLengthOutsideHorn = 450.0*CLHEP::mm; // Default with 1.2 mW (to avoid overlap.. )
136  fTargetMaterialName = G4String("Graphite");
137  fTargetDensity = 1.78*CLHEP::g/CLHEP::cm3; // Assume density of POCO ZXF-5Q graphite
138  fTargetSpecificLambda = 85.8*CLHEP::g/CLHEP::cm2; // Specific nuclear interaction length (g/cm2) for graphite
139 
140  fUseRoundedTargetFins = (fUse1p2MW) ? true : false; // If need be, we "back implement" for the 700 kW option.
141  // No fTargetX0, Y0: These would be surveyed point, part of the alignement
142  // realm, i.e. handled in the Surveyor class.
143  fTargetFinHeight = 21.4*CLHEP::mm - 0.005*CLHEP::mm; // It includes half of the cooling tube, which will be inside the fins
144  // Subract 200 microns such that the segments in the He containment tube.
145  // Drawing 7589-01-50-02
146  // The round edges (grinded
147 // fTargetFinWidth = 6.4*CLHEP::mm;
148  fTargetFinWidth = 7.4*CLHEP::mm; // 6.4 -> 7.4 Per discussion with Jim and Alberto, July 25 2013.
149  fTargetFinWidthRequired = fTargetFinWidth; // Used only for 1p2MW option..
150  fTargetFinContainerWidth = fTargetFinWidth; // old behavior, prior to 1p2 MW upgrade.
151  fTargetFinLength = 20*CLHEP::mm; //
152  // We add the fin that span the Usptream target and downstream target part.
153 
154  // fTargetNumberFins = 47; // LBNE Doc 6100.. But we have to compute it from the graphite target length
155  // Since fTargetSLengthGraphite can be changed..Use the same algorithm..
156  fTargetZOffsetStart = 32.2*CLHEP::mm; // From Russian drawing 7589-00-00-00
157  fTargetUpstrUpstrMargin = 1.0*CLHEP::cm; // Perhaps one ought to extend it is Upstream vacuum flange thicker.
158  fTargetUpstrDwnstrMargin = 1.0*CLHEP::mm;
160  fTargetUpstrPlateHoleRadius = (35.0/2.)*CLHEP::mm;//From Russian drawing 7589-00-00-00
161  fTargetUpstrPlateOuterRadius = (214./2.)*CLHEP::mm; //From Russian drawing 7589-00-00-00
162  fTargetUpstrPlateThick = 18.4*CLHEP::mm; // From Russian drawing 7589-00-00-00
163  fTargetCanMaterial = std::string("Aluminum");
164  fTargetCanInnerRadius = (155./2.)*CLHEP::mm; // From Russian drawing 7589-00-00-00
166  fTargetCanLength = 9.80*in; // read out from my scree from LBNE Doc 6100, page 1
169  fTargetDownstrCanFlangeInnerRadius = (155.0/2.)*CLHEP::mm;
170  fTargetDownstrCanFlangeOuterRadius = 120.0*CLHEP::mm; // Approximate
171  fThicknessWall = 0.5*CLHEP::mm;
172 // fTargetDownstrCanFlangeThick = (3.0/8.0)*in; ??? mistake See above
173  fTargetFlangeMaterial = std::string("Steel316");
174  fTargetFlangeInnerRadius = 15.8*CLHEP::mm; // Approximate... +- 0.5 mm
175  fTargetFlangeOuterRadius= (8.24/2.)*in;;
176  fTargetFlangeThick = 25.*CLHEP::mm;
177  fTargetCTubeMaterial = std::string("Titanium");
178  fTargetCTubeOuterRadius = (3. + 0.2)*CLHEP::mm ; // Doc db 6100
179  fRALTargetRing = 10.*CLHEP::mm;
180  fRALTargetRadius = 8.*CLHEP::mm;
181  fTargetCTubeInnerRadius = 3.0*CLHEP::mm;
182  fTargetCTubeUpstrLength = 9.621*in; // Length from the upstream bend to the fron the steel drawnstream flange
183  fTargetCTubeUpstrOffset = 2.32*in; // from the beam line tp to the center of the cooling tube.
184  fTargetCTubeUpstrRadCurve = 0.965*in;
185  fTargetCTubeUpstrNumSegCurve = 12; // 30 degrees angles Should be good enough.
186  fTargetCTubeReturnHOffset = 0.1*in; // guess !!! barely at 3 sigma of the beam...
189  fTargetLengthOutsideExtra = 0.; // differ from zero only for the Pseudo Nova option.
190  // Above quantity obsolete, use a simple model for the downstream end of the Helium target return
191  // cooling pipe.
192  // We will model the bends in the cooling tube with a simple tubular section, of titanium, filled with water.
193  const double lEffCTubeReturnDownstr = 2.0*(0.6*in) + 15*CLHEP::mm; // 1rst term is the bend, horizontal part, top & bottom.
194  const double vCTubeReturnDownstrTitanium = lEffCTubeReturnDownstr*M_PI*
196  const double vCTubeReturnDownstrWater = lEffCTubeReturnDownstr*M_PI*
198  fTargetCTubeReturnDownstrRadInner = 11.0*CLHEP::mm; // Rougly 14.5 - 3 - a bit, to make up the mass
199  // without increasing the thickness by too much
200  fTargetCTubeReturnDownstrRadOuter = 14.25*CLHEP::mm;
203  const double aWedgeRelSize = fTargetCTubeReturnDownstrCutAngleSize/(2.0*M_PI);
205  vCTubeReturnDownstrTitanium/(M_PI*aWedgeRelSize*aSurfWedge);
207  vCTubeReturnDownstrWater/(M_PI*aWedgeRelSize*aSurfWedge);
208 // std::cerr << " Effective thickness for cTube return, " << fTargetCTubeReturnDownstrThickTitanium <<
209 // " Water " << fTargetCTubeReturnDownstrThickWater << std::endl;
210 
211  // A small correction for the tilt angle
212  fTargetDistFlangeToTargetStart = 32.2*CLHEP::mm;
213  fTargetDistToStartOfFlange = 1180.51*CLHEP::mm;
214  fTargetCTubeReturnLengthUpstr = fTargetDistFlangeToTargetStart + 10.25*in; // from the upstream end of target to
215  // Upstr bend return
217  fTargetHeContTubeThickness = 0.4*CLHEP::mm;
218  fTargetHeContTubeInnerRadius = 30.0*CLHEP::mm/2.0 - fTargetHeContTubeThickness; // Doc DB 6100, page 1
220 
221  fTargetAlignRingThick = 11.0*CLHEP::mm; // Accurate to +- 1 mm, from Russian drawing. Err on the excess side.
222  fTargetAlignRingInnerRadius = (18.0/2)*CLHEP::mm + 0.25*CLHEP::mm; // final tweak to avoid overlaps. compensate by increaing thickness.
224 // fTargetAlignRingCutAngle = 0.1735; // Assume atan(3.4 mm/fTargetAlignRingInnerRadius), to remove overlaps
225  fTargetAlignRingCutAngle = 0.45; // Too tight... increase it
226  fTargetAlignRingThick *= 1.0 + 2.0*fTargetAlignRingCutAngle/M_PI; // We compensate the deleted region of the rings
227  // by increasing the thickness. //
228  fTargetAlignRingSpacing = 243.6*CLHEP::mm; // Such we can have 5 alignment rings over the entire distance.
229  fMaxNumAlignRings = 5; // assiming a target length of ~ 1 m. long
230  fTargetBerylDownstrWindowThick = 0.5*CLHEP::mm; // Docdb 6100
232  fTargetBerylUpstrWindowThick = 1.0*CLHEP::mm; // pure guess
233  fTargetBerylUpstrWindowRadius = 0.8425*in/2.; // ???? Again, guessing...
234 //
235 // Simple target code:
236 //
237  fUseSimpleTargetBox = false;
238  fRemoveTargetAlltogether = false;
239  fRALSimpleTargetLength = 2197.33*CLHEP::mm;
240  fSimpleTargetLength = fTargetSLengthGraphite; // default should be what NUMI used, respecting traditions.
241  fSimpleTargetRadius = 7.4*CLHEP::mm; // not used if box.
242  fThicknessBafflet = 1*CLHEP::mm;
243  fSimpleTargetHeight = 20.0*CLHEP::mm; // not used if cylinder
245  fSimpleTargetWidth = 7.4*CLHEP::mm; // not used if cylinder
246 
247 // Quynh, August 2014.
248  fUseMultiSphereTarget = false;//Quynh. Set by G4 UI card /LBNE/det/UseMultiSphereTarget
249  fMultiSphereTargetLength = fTargetSLengthGraphite;// Quynh.real target.(1) - // Preliminary value, see AdaptForMultiSphereTarget
250  fMultiSphereTargetRadius = 8.5*CLHEP::mm ; //controllabe by a UI card
251 
252  // Section of Horn1 which is the logical volume of the target Upstream Assembly.
253  // Drawing NUMI HORN#1, TRANSITION INNER TO OUTER Drawing number 8875. 112-MD-363097
254  // August 2014: "target" is now a misnomer, we place these volume in the Horn1PolyM1
255  fFillHornsWithArgon = true; // momentarily... ! For CD1-Refresh (pre June 2015), this was Air.
256  fTargetHorn1InnerRadsUpstr.resize(5);
258  fTargetHorn1TransThick.resize(5);
259  fTargetHorn1Lengths.resize(5);
260  fTargetHorn1ZPositions.resize(5);
261  fTargetHorn1InnerRadsUpstr[0] = 1.88*in;
262  fTargetHorn1InnerRadsUpstr[1] = 2.28*in;
263  fTargetHorn1InnerRadsUpstr[2] = 2.78*in; // It will a G4tubs, not G4Cons
264  fTargetHorn1InnerRadsUpstr[3] = 4.49*in;
265  fTargetHorn1InnerRadsUpstr[4] = 5.10*in;
266  fTargetHorn1InnerRadsDownstr[0] = 1.573*in;
267  fTargetHorn1InnerRadsDownstr[1] = 1.88*in;
268  fTargetHorn1InnerRadsDownstr[2] = 4.49*in; // It will a G4tubs, not G4Cons This is the outer radius
269  fTargetHorn1InnerRadsDownstr[3] = 5.10*in;
270  fTargetHorn1InnerRadsDownstr[4] = 5.53*in;
271  fTargetHorn1TransThick[0] = (0.25*in)/std::cos(M_PI*45./180.);
272  fTargetHorn1TransThick[4] = (0.25*in)/std::cos(M_PI*45./180.);
273  fTargetHorn1TransThick[1] = (0.25*in)/std::cos(M_PI*60./180.);
274  fTargetHorn1TransThick[3] = (0.25*in)/std::cos(M_PI*60./180.);
276  fTargetHorn1Lengths[0] = 0.457*in;
278  fTargetHorn1Lengths[1] = 0.410*in;
280  fTargetHorn1Lengths[2] = 0.370*in; // Increase thickness
281  // August 2014 Minor adjustments..
282  const double aTotalPseudoTargetHorn1Length =
283  fTargetHorn1Lengths[0] + fTargetHorn1Lengths[1] + fTargetHorn1Lengths[2] + 0.05*CLHEP::mm;
284 // fTargetHorn1ZPositions[0] = -fTargetHorn1Lengths[0]/2. - 2.5*CLHEP::mm ; // With respect to MCZero, or the dowstream end of Upstream Target Assembly
285 // // push them bacward a bit to avoid overlaps
286 // With respecto the center of the container volume. (August 2014.. )
287  fTargetHorn1ZPositions[0] = aTotalPseudoTargetHorn1Length/2. - fTargetHorn1Lengths[0]/2. - 0.005;
289  fTargetHorn1ZPositions[1] = -aTotalPseudoTargetHorn1Length/2. + fTargetHorn1Lengths[2] + fTargetHorn1Lengths[1]/2.;
291  fTargetHorn1ZPositions[2] = -aTotalPseudoTargetHorn1Length/2. + fTargetHorn1Lengths[2]/2 + 0.005*CLHEP::mm; //
292  //
293  // Basic algorithm to determine position of the target main daughter volumes
294  //
295  // Details about the baffle
296  fBaffleInnerRadius = 6.5*CLHEP::mm; // Per discussion with Jim Hylen, July 22 2013
297  fBaffleOuterRadius = 28.3*CLHEP::mm; // from previous version and le010z185i_NumiDPHelium.input
298  fBaffleLength = 1474.8*CLHEP::mm; // Drawing 8875.000-ME-363028
299  fBaffleWindowThickness = 0.5*CLHEP::mm; // e-mail from Bob Zwaska to Minerva et al, August 2014.
300  fBaffleZPosition = -1.0e19; // to be determined one the Target Usptream segment is installed
301  // offset with respecto MCZERO of the center of target mother volume,
302  //
303  // Horn1 initialization.
304  //
307  fHorn1RadialRescale = 1.0; // No units... a ratio between the actual dimensions implemented in Geant4 over the nominal
308  // values found in drawing 8875.112-MD-363xxx
309  fHorn1LongRescale = 1.0;
311  fWaterLayerThickInHorns = 1.*CLHEP::mm; // Sept. 2014:New default value, e-mail from Cory Crowfields to Laura, March 26 2014.
312  fHorn1InnerCondMat = G4String("Aluminum");
313  fHorn1AllCondMat = G4String("Aluminum");
314 
315 
316 
317 // std::cerr << " LBNEVolumePlacements::LBNEVolumePlacements, O.K. done " << std::endl;
318 // Now configure the target. Note: this method can be called from the messenger callback, should the
319 // the users decide to run with non-standard target.
320 //
321  this->setEntireTargetDims(); // See below, first coded up August 18 2014.
322  if (fUseRALTGTv1) {
323  std::cerr << "Using the RAL adapt and segment options" << std::endl;
324  this -> adaptRALTGTv1();
325  //this -> SegmentRALTGTv1();
326  }
327 
328 
329  if (fUse1p2MW) {
331  std::cerr << "Using the adapt and segment options for the small target" << std::endl;
333  this->SegmentTargetSmallTgt();
334  } else {
335  std::cerr << "Using the adapt and segment options for the 1p2MW target" << std::endl;
336  this->adaptTargetFor1p2MW();
337  this->SegmentTarget();
338  }
339  }
340  this->DeclareHorn1Dims(); // See in file LBNEDownstrVolPlacements.cc
341  this->setMotherVolumeForHorn1(); // We do not want top do this for the multiHorn Polygone, but it should not hurt...
342 
343  fExtendChaseLength = 0.;
344 
345  this->DeclareHorn2Dims(); // See in file LBNEDownstrVolPlacements.cc
346  fHorn2InnerCondMat = G4String("Aluminum");
347  fHorn2AllCondMat = G4String("Aluminum");
348  fHorn3InnerCondMat = G4String("Aluminum");
349  fHorn3AllCondMat = G4String("Aluminum");
350 
351  // Details about the plug
352  fPlugInnerRadius = 0.*CLHEP::mm; // Solid cylinder
353  fPlugOuterRadius = 26.*CLHEP::mm; // To fit inside Horn2
354  fPlugLength = 250.0*CLHEP::mm;; // Just a reasonable default
355  fPlugZPosition = 1250.*CLHEP::mm; // An other reasonable default.. Please check target length.
356  fPlugMaterial = std::string("GraphiteBaffle");
357  // Default file name forthe GDML file describing the Hadron generator.
358 //
359 // Ad the decay pipe snout info, this is not very long...
360 //
361 // Old NuMI definition
362 // fDecayPipeLongPosition = 17.3*CLHEP::m; // Tentatively fixzed!!! See "Location Plans and List of Drawing, LBNE CD1 review, CDR-30"
363  // However, for the purpose of Horn placement optimization, this could be overwritten in
364  // ExtendChaseLengthForHorn2 Paul Lebrun, Feb 2015
365  // This will be the case for LBNF
366  //
368 //
369  // The above has been kindly measured off the actual drawing 2251.000-ME-487107, by Glenn Waver,
370  // Sept 2013. It is the distance between the apex of the window
371  // and the point W.P. H.E. ACRNT2, which the entrance of Horn2.
372  // We add to that the extra length of Horn2, should it be rescaled.
373  // However, if so, it is best to leave the decay pipe snout aside, until the
374  // the optimization of the Horn's dimensions and location is settled
375  // The RemoveDecayPipeSnout G4UI card has been introduced, late October 2014.
376  //
377  fDecayPipeWindowRadiusBeryl = 7.874*in/2.0;
378 // fDecayPipeWindowRadiusAlum = 33.0*in/2.0;
379 // Correction, April 9 2015, cross-checking again with the drawing 2251.000-ME-487107
380  fDecayPipeWindowRadiusAlum = 39.370*in/2.0;
382  fDecayPipeWindowThickAlum = 0.064*in; // make it a bit thicker, due to curvature.
383  // August 2015, CD1-R decision:
384  fChaseWidthForLBNF = 78.0*in;
385 // fAbsorberGDMLFilename = G4String("./gdml/lbne_absorber_112912.gdml");
386 //
387 // Received on Sept 27 2013 a new version from Diane Reitzner
388 //
389  fUseMarsTargetHorns = false;
390 
391  char* g4lbne_path = getenv("G4LBNE_DIR");
392  if(g4lbne_path == NULL) {
393  std::cout<<"You have not set $G4LBNE_DIR.... I'm assuming it's your current working directory. Please set $G4LBNE_DIR to the top level directory of your g4lbne installation if that's not the case."<<std::endl;
394  g4lbne_path = static_cast<char *>(malloc(4));
395  strncpy(g4lbne_path, "./\0",3);
396  }
397 
398  fMarsTargetHornsGDMLFilename = G4String(g4lbne_path)+G4String("/gdml/mars_horns.gdml");
399 
400  fAbsorberGDMLFilename = G4String(g4lbne_path)+G4String("/gdml/abs_geomSept13.gdml");
401 
402  std::cout << "Using absorber gdml file here: " << fAbsorberGDMLFilename <<std::endl;
403 
404 // fDoInstallShield = true;
405  fDoInstallShield = false ; // Jan 2017 Now the default for the extend Chase. To be reviewed when
406  // more info available from AD engineers
407 
408 // std::cerr << " Removing the shields until the position of Horn1 is confirmed !!! " << std::endl;
409 // fDoInstallShield = false;
410 
411 // August 2015: restore it, even with Polycone Horns..
412 
413  fRadiusMilindWire = 0.;
414  fCurrentMilindWire = 0.;
415 
416  fWriteGDMLFile = false;
417 
418 //
419 // Octobre 2015, John LoSecco, P.L.
420 //
421  fPolyconeHorn1IsParabolic = false; // default, overwrite with /LBNE/det/SetPolyconeHornParabolic
422 
423  // John Back, March 2016
424  fUseTargetModule = false; // default, overwrite with /LBNE/det/UseTargetModule
425  fTargetRadius = 8.5*CLHEP::mm;
426  fTargetLength = 953.8*CLHEP::mm;
427  // Specify the target module type: SAT, Cylinder
428  fTargetModuleType = LBNEVolumePlacements::SAT; // overwrite with /LBNE/det/TargetModuleType
429  // The fractional length of the full target outside the horn
430  fTargetFracOutHornL = -1.0; // overwrite with /LBNE/det/TargetFracOutHornL
431  // The number of interaction lengths for the target object. If =-1, use fTargetLength instead
432  fTargetNLambda = -1.0; // overwrite with /LBNE/det/TargetNLambda
433 
434  // John Back, Jan 2017 for 2nd target module option
435  fUseTarget2Module = false; // default, overwrite with /LBNE/det/UseTargetModule
436  fTarget2Radius = 8.5*CLHEP::mm;
437  fTarget2Length = 953.8*CLHEP::mm;
438  // Specify the target module type: SAT, Cylinder
439  fTarget2ModuleType = LBNEVolumePlacements::SAT; // overwrite with /LBNE/det/TargetModuleType
440  // The number of interaction lengths for the 2nd target object. If =-1, use fTarget2Length instead
441  fTarget2NLambda = -1.0; // overwrite with /LBNE/det/TargetNLambda
442 
443 //
444 // June 2016 Installation of detailed Horns, conceptual design.
445 //
449  fZShiftConceptHornAStartIC = -101.29*CLHEP::mm; // New value, Oct. 14 2016, after installing the short HornA
450  fZHallHorn1ToHorn1PolyM1 = 200.0*CLHEP::mm; // Approximate.. Re-adjusted when we decide on a final position of
451  // downstream target supports..Done when position Horn1PolyM1 in Create
452  fInstallBaffle = true;
453 // fInstallUpstreamHorizontalTarget = true;
454  //
455  // November 11 2016. This target segment now conflicts with the NuMI target. This is true for Idealistic horns as
456  // well as realistic ones.
457  //
459  // Complicated (helium cooled) downstream target support...
461  //
462  // Lastly, we set again the hysterical, historical variable that sets the position of the horn, only we are using the
463  // NuMI horns, default position.
464  // This variable has been overwritten by Segment target, a call-back to pre-existing G4UI data cards.
465  //
466  if (fUse1p2MWSmallTgt) fTargetLengthOutsideHorn = 45.0*CLHEP::cm;
467  //
468  // To avoid valgrind complains, we initialized some variable that may not be used, by default,
469  // or will be set by the logic of the code.
470  //
471  fHorn1PolyOuterRadius = 0.; // an illicit value.
472  fHorn1NeckInnerRadius = 0.; // will be redefined in PlaceFinalNoSplitHorn1
473  fHorn2NeckInnerRadius = 0.; // will be redefined in PlaceFinalHorn2
474 
475 }
std::vector< G4double > fTargetHorn1ZPositions
std::string string
Definition: nybbler.cc:12
G4double fTargetCTubeReturnDownstrCutAngleStart
G4double fTargetCTubeReturnDownstrThickTitanium
std::vector< G4double > fTargetHorn1InnerRadsUpstr
std::vector< G4double > fTargetHorn1Lengths
unsigned int fTargetNumFinsWithWings
std::string getenv(std::string const &name)
Definition: getenv.cc:15
G4double fTargetCTubeReturnDownstrThickWater
std::vector< G4double > fTargetHorn1TransThick
std::vector< G4double > fTargetHorn1InnerRadsDownstr
G4double fTargetCTubeReturnDownstrCutAngleSize
QTextStream & endl(QTextStream &s)
LBNEVolumePlacements::~LBNEVolumePlacements ( )
private

Definition at line 622 of file LBNEVolumePlacements.cc.

622  {
623  delete fPlacementMessenger;
624 }
G4UImessenger * fPlacementMessenger
LBNEVolumePlacements::LBNEVolumePlacements ( LBNEVolumePlacements const &  )
private

Member Function Documentation

void LBNEVolumePlacements::AdaptForMultiSphereTarget ( )

Definition at line 1012 of file LBNEVolumePlacementsAdd.cc.

1012  {
1013 
1014  fTargetSLengthGraphite = 969.285*CLHEP::mm ;//953.8*CLHEP::mm; // Quynh calculation . real target.(7). 57 spheres x (17mm diameter + 0.005 tolerance)
1015 
1016  fTargetSLengthDownstrEnd = 0; // Quynh. remove this. real target. (8). not sure. based on T2K target, add 9mm for Helium return when calculate target position.
1017 //
1018 // The following quantity can be changed via messenger command.
1019 //
1020 // fTargetLengthIntoHorn = fTargetSLengthGraphite- 400*CLHEP::mm; //Quynh -> this can be overwritten by a data card
1021 // fTargetLengthIntoHorn = fTargetSLengthGraphite - 350.*CLHEP::mm + 25.3; // Integration drawing 8875.000-ME-363028
1022 // Does not belong here!. P.L.
1023  //last number emprically set
1024  // to have the first fin target at coord 0.3mm, to follow the convention.
1025  double targetNumSphereNominal = fTargetSLengthGraphite/(fMultiSphereTargetRadius*2+0.005*CLHEP::mm);
1026  std::cout << "---Sphere Diameter: " << fMultiSphereTargetRadius*2;
1027  std::cout << "---Nominal number of Sphere: "<< targetNumSphereNominal <<std::endl;
1028 
1029  fTargetNumSphere = (int) (targetNumSphereNominal + 0.5); //rounding-fTargetNumSphere has been defined as int in .hh
1030  std::cout << "fTargetNumSphere is rounded to: "<< fTargetNumSphere <<std::endl;
1031 
1032  double deltaNumSphere = targetNumSphereNominal - (double) fTargetNumSphere;
1033 
1034  std::cout << "LBNEVolumePlacements::AdaptForMultiSphereTarget, total number of sphere: " << fTargetNumSphere <<
1035 "---Delta Num of Sphere: " << deltaNumSphere << std::endl;
1036  std::cout << "fTargetSLength: " << fTargetSLength << "---fTargetLengthOutsideHorn before adjustment: "
1038 
1039  const double oldLength = fTargetSLengthGraphite;
1040  std::cout << "Input fTargetsLengthGraphite: "<< oldLength <<std::endl;
1041  fTargetSLengthGraphite = fTargetNumSphere*(fMultiSphereTargetRadius*2 + 0.005*CLHEP::mm); //tolerance 5 micron
1042  std::cout <<"---fTargetSLengthGraphite adjusted to " <<fTargetSLengthGraphite<<"="<< fTargetNumSphere <<"x ("
1043  << fMultiSphereTargetRadius<<"x 2 + 0.005mm)"<<std::endl;
1044 
1045 
1046  if (std::abs(oldLength - fTargetSLengthGraphite) > 0.001*CLHEP::mm)
1047  std::cout << "LBNEVolumePlacements::AdaptForMultiSphereTarget: Warning: re-adjust the target length from " <<
1048  oldLength << " to " << fTargetSLengthGraphite << " to get an integer number of spheres " << std::endl;
1049  //
1050  // Change the diameter of the Helium Tube
1051  //
1052  fTargetHeContTubeInnerRadius = 35.2*CLHEP::mm/2.; // T2K drawing, August 2014. To be reviewed, Alberto in contact with Rutherford.
1053 }
T abs(T value)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::adaptRALTGTv1 ( )

Definition at line 125 of file LBNEVolumePlacementsAdd.cc.

125  {
126 //
127 // taken from release v3r2p6, December 2016. A re-adaptation.. Note the change in fTargetHeContTubeInnerRadius
128 //
129  std::cerr << " Adapting for the RAL target, length of graphite "
132 
133  //Dimensions for the outer helium containment tube, which is tapered
134 
135  fTargetOutHeContTubeInnerRadius = 37.5*CLHEP::mm; // LBNE Docdb 8639-v1
136  fTargetOutHeContTubeOuterRadius = 38*CLHEP::mm; // LBNE Docdb 8639-v1
137  fTargetOutHeContTubeInnerRadiusTapered = 27.22*CLHEP::mm;
138  fTargetOutHeContTubeOuterRadiusTapered = 27.72*CLHEP::mm;
139 
140 
141  fTargetOutHeContTubeTaperedLength = 1094.49*CLHEP::mm;
142  fTargetOutHeContTubeStraightLength = 1170.51*CLHEP::mm;
143  fTargetCTubeLength = 2225*CLHEP::mm;
144 
145 
148  fTargetDistFlangeToTargetStart = 55*CLHEP::mm;
149  fSimpleTargetRadius = 8*CLHEP::mm; // not used if box.
150 
151  //Smaller helium containment tube housing the target
152  fTargetCTubeInnerRadius = 15*CLHEP::mm;
153  fTargetCTubeOuterRadius = 15.5*CLHEP::mm;
154 
155  //Section connecting the bafflet to the target
156  fTargetHeContTubeSmallConeLength = 28.82*CLHEP::mm;
157  fTargetHeContTubeSmallConeInnerRad = 22.5*CLHEP::mm;
158  fTargetHeContTubeSmallConeOuterRad = 23.5*CLHEP::mm;
159  fTargetHeContTubeSmallCylLength = 22.5*CLHEP::mm;
160 
161  //Large conical section extending upstream from the inner helium containment tube
162  fTargetHeContTubeLargeConeInnerRad = 52.5*CLHEP::mm;
163  fTargetHeContTubeLargeConeOuterRad = 53*CLHEP::mm;
164  fTargetHeContTubeLargeConeLength = 109.32*CLHEP::mm;
165 
166  fTargetHeContTubeBaffletLength = 120*CLHEP::mm;
167  fTargetBaffletOutRadius = 14*CLHEP::mm;
168  fTargetBaffletLengthNoFlange = 105*CLHEP::mm;
169  fTargetBaffletFlangeLength = 15*CLHEP::mm;
170  fTargetHeContTubeColdHeCurvature = 38*CLHEP::mm;
171 
172  //DSSupport Structure
173  fTargetDSSupportConnRing = 12*CLHEP::mm;
174  fTargetDSSupportAlRingThickness = 1*CLHEP::mm;
175  fTargetDSSupportAlRingInnerRad = 24.988*CLHEP::mm;
176 
177  //DSSupport double cone structure where "Small cone" indicates the right cone and "large cone" indicates the left cone in this dual cone structure
178  fTargetDSSupportSmallConeLength = 6.9*CLHEP::mm;
179  fTargetDSSupportSmallConeSmallInnerRad = 25.4*CLHEP::mm;
183 
185  fTargetDSSupportLargeConeSmallOuterRad = 30.3384274344*CLHEP::mm;
187  fTargetDSSupportLargeConeLargeOuterRad = 40.3476088767*CLHEP::mm;
188  fTargetDSSupportLargeConeLength = 27.5*CLHEP::mm;
189 
190  fTargetDSSupportOuterRingInnerRad = 677*CLHEP::mm;
191  fTargetDSSupportOuterRingOuterRad = 697*CLHEP::mm;
192  fTargetDSSupportOuterRingLength = 20*CLHEP::mm;
193 
194  fTargetFinHeight = NAN; //2.0*(15 - 8 + 0.005)*CLHEP::mm; // This excludes the cooling tubes.
195  fTargetFinWidth = NAN;//10*CLHEP::mm; // // ajustable via G4 UI data card.
196  // fTargetFinWidth /= 2; // we divide by 2:We will place two of them, side by side, center offset of fTargetFinWidth/2.
198  // fTargetFinContainerWidth = 2.0*fTargetCTubeOuterRadius + 0.010*CLHEP::mm;
199  // fTargetFinExtraWidth = -1.0*CLHEP::mm; // No additional piece on the side, by defaul
200  fBaffleInnerRadius = 17.0*CLHEP::mm;
201  //
202  // The longitudinal segmentation of the target will be unchanged.
203  // April 11 2014 : set the default the target length outside Horn1 to 450 mm.
204  // I put it to 500 mm originally because of the presumed need for more tolerance
205  // near the neck, but 450 mm. is good enough after revision of the Horn1 geometry..
206  //
207 // fTargetLengthIntoHorn = 55. ; // Integration drawing 8875.000-ME-363028
208  fTargetLengthIntoHorn = 55.*CLHEP::mm; //+ 25.3*CLHEP::mm; // Integration drawing 8875.000-ME-363028
209  // The above is subject to change
210  fHorn1RadialSafetyMargin = 0.25*CLHEP::mm;
211  fRotVertical.set(CLHEP::HepRotationX(-90.0*CLHEP::deg));
212 // fUseRoundedTargetFins = (fUse1p2MW) ? true : false; // If need be, we "back implement" for the 700 kW option.
213 }
G4double fTargetOutHeContTubeInnerRadiusTapered
G4double fTargetDSSupportSmallConeSmallOuterRad
G4double fTargetOutHeContTubeOuterSphericalEndCap
G4double fTargetDSSupportSmallConeLargeOuterRad
G4double fTargetDSSupportSmallConeSmallInnerRad
G4double fTargetOutHeContTubeInnerSphericalEndCap
G4double fTargetDSSupportLargeConeSmallInnerRad
G4double fTargetDSSupportLargeConeLargeOuterRad
G4double fTargetDSSupportLargeConeLargeInnerRad
G4RotationMatrix fRotVertical
G4double fTargetDSSupportSmallConeLargeInnerRad
G4double fTargetDSSupportLargeConeSmallOuterRad
QTextStream & endl(QTextStream &s)
G4double fTargetOutHeContTubeOuterRadiusTapered
void LBNEVolumePlacements::adaptTargetFor1p2MW ( )

Definition at line 54 of file LBNEVolumePlacementsAdd.cc.

54  {
55  /*
56  * discard this implementation, we now move to the NuMI style target, Rev 2, with a bigger
57  * Helium cont. vessel.
58  */
59  if (fUseCDR2015Optimized) return; // We don't do this if we document the small cooling pipe 1.2 MW target..
60  //
61  if (fUseNumberOfHornsPoly != 0) {
63  return;
64  } else {
65  return; // July 31 2017: assume here that we deal with the old reference design..
66  }
67  fTargetHeContTubeInnerRadius = 35.2*CLHEP::mm/2.; // LBNE Docdb 8639-v1
68  fTargetCTubeOuterRadius = 3.0*CLHEP::mm;
69  fTargetCTubeInnerRadius = 5.2*CLHEP::mm/2.;
70  fTargetFinHeight = 20.0*CLHEP::mm; // This include the cooling tubes. Total height
71  fTargetFinWidth = 10*CLHEP::mm; // // ajustable via G4 UI data card.
73  fTargetFinWidth /= 2; // we divide by 2:We will place two of them, side by side, center offset of fTargetFinWidth/2.
75  fTargetFinWidthRequired + 0.010*CLHEP::mm);
76  fTargetFinExtraWidth = -1.0*CLHEP::mm; // No additional piece on the side, by defaul
77  fBaffleInnerRadius = 17.0*CLHEP::mm/2.;
78  //
79  // The longitudinal segmentation of the target will be unchanged.
80  // April 11 2014 : set the default the target length outside Horn1 to 450 mm.
81  // I put it to 500 mm originally because of the presumed need for more tolerance
82  // near the neck, but 450 mm. is good enough after revision of the Horn1 geometry..
83  //
84 // fTargetLengthIntoHorn = fTargetSLengthGraphite - 500.*CLHEP::mm + 25.3; // Integration drawing 8875.000-ME-363028
86  // Will be revised with the Conceptual Drawing. .. // Integration drawing 8875.000-ME-363028
87  fHorn1RadialSafetyMargin = 0.25*CLHEP::mm;
88  fRotVertical.set(CLHEP::HepRotationX(-90.0*CLHEP::deg));
89  fTargetFinWWingRadius = 12.0*CLHEP::mm;
90  fUseRoundedTargetFins = (fUse1p2MW) ? true : false; // If need be, we "back implement" for the 700 kW option.
91  fTargetNumFinsWithWings = 0; // We had no wings for the idealistic version of the "optimized" sequence.
92 
93 }
unsigned int fTargetNumFinsWithWings
static int max(int a, int b)
G4RotationMatrix fRotVertical
void LBNEVolumePlacements::adaptTargetFor1p2MWSmallTgt ( )

Definition at line 94 of file LBNEVolumePlacementsAdd.cc.

94  {
95 //
96 // taken from release v3r2p6, December 2016. A re-adaptation.. Note the change in fTargetHeContTubeInnerRadius
97 //
98  fTargetSLengthGraphite= 953.8*CLHEP::mm;
99  std::cerr << " Adapting for the NuMI target, short version length of graphite "
101  fTargetHeContTubeInnerRadius = 35.2*CLHEP::mm/2.; // LBNE Docdb 8639-v1
102  fTargetCTubeOuterRadius = 3.0*CLHEP::mm;
103  fTargetCTubeInnerRadius = 5.2*CLHEP::mm/2.;
104  fTargetFinHeight = 2.0*(13.3675 - 3.0 + 0.005)*CLHEP::mm; // This excludes the cooling tubes.
105  fTargetFinWidth = 10*CLHEP::mm; // // ajustable via G4 UI data card.
106  fTargetFinWidth /= 2; // we divide by 2:We will place two of them, side by side, center offset of fTargetFinWidth/2.
108  fTargetFinContainerWidth = 2.0*fTargetCTubeOuterRadius + 0.010*CLHEP::mm;
109  fTargetFinExtraWidth = -1.0*CLHEP::mm; // No additional piece on the side, by defaul
110  fBaffleInnerRadius = 17.0*CLHEP::mm/2.;
111  //
112  // The longitudinal segmentation of the target will be unchanged.
113  // April 11 2014 : set the default the target length outside Horn1 to 450 mm.
114  // I put it to 500 mm originally because of the presumed need for more tolerance
115  // near the neck, but 450 mm. is good enough after revision of the Horn1 geometry..
116  //
117 // fTargetLengthIntoHorn = fTargetSLengthGraphite - 500.*mm + 25.3; // Integration drawing 8875.000-ME-363028
118  fTargetLengthIntoHorn = fTargetSLengthGraphite - 450.*CLHEP::mm + 25.3*CLHEP::mm; // Integration drawing 8875.000-ME-363028
119  // The above is subject to change///
120  fHorn1RadialSafetyMargin = 0.25*CLHEP::mm;
121  fRotVertical.set(CLHEP::HepRotationX(-90.0*CLHEP::deg));
122  fUseRoundedTargetFins = (fUse1p2MW) ? true : false; // If need be, we "back implement" for the 700 kW option.
123 }
G4RotationMatrix fRotVertical
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::CheckHorn1InnerConductAndTargetRadii ( )
private

Definition at line 577 of file LBNEDownstrVolPlacements.cc.

577  {
578 
580  const double in = 2.54*CLHEP::cm;
581  const LBNEVolumePlacementData *plSmallRing;
582  const LBNEVolumePlacementData *plLargeRing;
583  plSmallRing = this->Find(G4String("Check"),
584  G4String("TargetNoSplitHeContainer"),
585  G4String("LBNEVolumePlacements::CheckHorn1InnerConductAndTargetRadii"));
586 
587  plLargeRing = this->Find(G4String("Check"),
588  G4String("Horn1PolyM1"),
589  G4String("LBNEVolumePlacements::CheckHorn1InnerConductAndTargetRadii"));
590 
591  const double xOffS = plSmallRing->fPosition[0] +
592  (plSmallRing->fParams[2]/2.)*plSmallRing->fRotation.xz(); // Assumed misaligned once (withe respect to perfectly
593  // aligned (HORN1. )
594  const double yOffS = plSmallRing->fPosition[1] +
595  (plSmallRing->fParams[2]/2.)*plSmallRing->fRotation.yz();
596 
597  // We take the full length, the clash is at the downstream end.
598 
599  double xOffL = plLargeRing->fPosition[0] +
600  (plLargeRing->fParams[2]/2.)*plLargeRing->fRotation.xz();
601 
602  double yOffL = plLargeRing->fPosition[1] +
603  (plLargeRing->fParams[2]/2.)*plLargeRing->fRotation.yz();
604  // Same, at the downstream end. But this is only approximate.
605  double maxLength = -100000.0*CLHEP::m;
607  if (*il > maxLength ) maxLength = *il;
608  xOffL = plLargeRing->fPosition[0] + maxLength*plLargeRing->fRotation.xz()/2.;
609 
610  yOffL = plLargeRing->fPosition[1] + maxLength*plLargeRing->fRotation.yz()/2.;
611  const double xOff = xOffS - xOffL;// now translated to ref. frame of the large ring.
612  const double yOff = yOffS - yOffL;
613 
614  const double rSmall = plSmallRing->fParams[1]; // Outer radius
615  // Compute the large radius based on equation 0, at the relevant Z
616  const double zMaxDC = fHorn1TopUpstrLength - 3.0*CLHEP::cm;
617  const double rMinEqn1 = fHorn1Equations[0].GetVal(zMaxDC); // Equation 1 or 0
618  const double rMinEqn2 = fHorn1Equations[1].GetVal(zMaxDC); // Equation 1 or 0
619  const double ratio0vs1 = std::min(1.0, (zMaxDC/(21.0888*in*fHorn1LongRescale)));
620  const double rLarge = rMinEqn2*ratio0vs1 + (1.0-ratio0vs1)*rMinEqn1;
621  // Equation 1 and 0, weighted by Z ; // Inner Radius
622 // std::cerr << " CheckHorn1InnerConductAndTargetRadii, zCoordEnd "
623 // << zCoordEnd << " rLarge " << rLarge << " rSmall " << rSmall << std::endl;
624 // std::cerr << " .. xOffS " << xOffS << " yOffS " << yOffS
625 // << " xOffL " << xOffL << " yOffL " << yOffL << std::endl;
626  G4String messHeader(" The downstream end target is touching (or nearly touching) the Horn1 inner conductor \n");
627  if ((std::abs(xOff) < 0.002*CLHEP::mm) && (std::abs(yOff) < 0.002*CLHEP::mm)) {
628  if (rSmall + fHorn1RadialSafetyMargin < rLarge) return;
629 
630  std::ostringstream messStrStr;
631  messStrStr << messHeader << " Helium Tube radius " << rSmall
632  << " Inner cond. radius " << rLarge << " \n";
633  messStrStr << messHeader << " Suggestion: Reduce fTargetLengthIntoHorn, currently set to " <<
634  fTargetLengthIntoHorn << " mm \n";
635  G4String messStr(messStrStr.str());
636  G4Exception("LBNEVolumePlacements::CheckHorn1InnerConductAndTargetRadii", " ",
637  FatalErrorInArgument, messStr.c_str());
638  } else { // Misalignment
639 // const double phic = std::atan2(yOff, xOff); // extremum in phis . We don't care where it is in phi..
640 // double rMaxDev = -1.0;
641 // for (int iQ=0; iQ!=4; iQ++) { //. but which quadrant? (Should be able to figure out this more simply..)
642 // const double xCrit = rSmall*std::sin(phic);
643 // const double yCrit = rSmall*std::cos(phic);
644 // const double rr = std::sqrt(xCrit*xCrit + yCrit*yCrit);
645 // if (rr > rMaxDev) rMaxDev = rr;
646 // }
647  const double rMaxDev = std::sqrt(xOff*xOff + yOff*yOff);
648 // std::cerr << " Misalignments detected in CheckHorn1InnerConductAndTargetRadii, phic " << phic
649 // << " rMaxDev " << rMaxDev << std::endl;
650  if ((rMaxDev + rSmall) < (rLarge - fHorn1RadialSafetyMargin)) return; // O.K>
651  std::ostringstream messStrStr;
652  messStrStr << messHeader << " Helium Tube radius " << rSmall
653  << " Inner cond. radius " << rLarge << " \n";
654  messStrStr << messHeader << " Tranvser Offset between the two rings " << xOff << " / " << yOff << "\n";
655  G4String messStr(messStrStr.str());
656  G4Exception("LBNEVolumePlacements::CheckHorn1InnerConductAndTargetRadii", " ",
657  FatalErrorInArgument, messStr.c_str());
658  }
659 }
std::vector< double > fMotherHorn1AllLengths
std::vector< LBNEHornRadialEquation > fHorn1Equations
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
intermediate_table::const_iterator const_iterator
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
T abs(T value)
std::vector< double > fParams
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
bool LBNEVolumePlacements::CheckOverlaps ( const G4PVPlacement *  phys,
G4int  nres,
G4double  eps,
G4bool  verbose 
) const
private

Definition at line 3174 of file LBNEVolumePlacements.cc.

3174  {
3175 
3176  if (res<=0) { return false; }
3177 
3178  G4VSolid* solid = plVol->GetLogicalVolume()->GetSolid();
3179  G4LogicalVolume* motherLog = plVol->GetMotherLogical();
3180  if (!motherLog) { return false; }
3181 
3182  G4VSolid* motherSolid = motherLog->GetSolid();
3183 
3184  if (verbose)
3185  {
3186  G4cout << "Checking overlaps for volume " << plVol->GetName() << " ... ";
3187  }
3188 
3189  // Create the transformation from daughter to mother
3190  //
3191  G4AffineTransform Tm( plVol->GetRotation(), plVol->GetTranslation() );
3192 
3193  for (G4int n=0; n<res; n++)
3194  {
3195  // Generate a random point on the solid's surface
3196  //
3197  G4ThreeVector point = solid->GetPointOnSurface();
3198 
3199  // Transform the generated point to the mother's coordinate system
3200  //
3201  G4ThreeVector mp = Tm.TransformPoint(point);
3202 
3203  // Checking overlaps with the mother volume
3204  //
3205  if (motherSolid->Inside(mp)==kOutside)
3206  {
3207  G4double distin = motherSolid->DistanceToIn(mp);
3208  if (distin > tol)
3209  {
3210  if (verbose) G4cout << G4endl;
3211  if (verbose) G4cout << "WARNING - G4PVPlacement::CheckOverlaps()" << G4endl
3212  << " Overlap is detected for volume "
3213  << plVol->GetName() << G4endl
3214  << " with its mother volume "
3215  << motherLog->GetName() << G4endl
3216  << " at mother local point " << mp << ", "
3217  << "overlapping by at least: " << G4BestUnit(distin, "Length")
3218  << G4endl;
3219  if (verbose) G4Exception("G4PVPlacement::CheckOverlaps()", "InvalidSetup",
3220  JustWarning, "Overlap with mother volume !");
3221  return true;
3222  }
3223  }
3224 
3225  // Checking overlaps with each 'sister' volume
3226  //
3227  for (G4int i=0; i<motherLog->GetNoDaughters(); i++)
3228  {
3229  G4VPhysicalVolume* daughter = motherLog->GetDaughter(i);
3230 
3231  if (daughter == plVol) { continue; }
3232 
3233  // Create the transformation for daughter volume and transform point
3234  //
3235  G4AffineTransform Td( daughter->GetRotation(),
3236  daughter->GetTranslation() );
3237  G4ThreeVector md = Td.Inverse().TransformPoint(mp);
3238 
3239  G4VSolid* daughterSolid = daughter->GetLogicalVolume()->GetSolid();
3240  if (daughterSolid->Inside(md)==kInside)
3241  {
3242  G4double distout = daughterSolid->DistanceToOut(md);
3243  if (distout > tol)
3244  {
3245  if (verbose) G4cout << G4endl;
3246  if (verbose) G4cout << "WARNING - G4PVPlacement::CheckOverlaps()" << G4endl
3247  << " Overlap is detected for volume "
3248  << plVol->GetName() << G4endl
3249  << " with " << daughter->GetName() << " volume's"
3250  << G4endl
3251  << " local point " << md << ", "
3252  << "overlapping by at least: " << G4BestUnit(distout,"Length")
3253  << G4endl;
3254  if (verbose) G4Exception("G4PVPlacement::CheckOverlaps()", "InvalidSetup",
3255  JustWarning, "Overlap with volume already placed !");
3256  return true;
3257  }
3258  }
3259 
3260  // Now checking that 'sister' volume is not totally included and
3261  // overlapping. Do it only once, for the first point generated
3262  //
3263  if (n==0)
3264  {
3265  // Generate a single point on the surface of the 'sister' volume
3266  // and verify that the point is NOT inside the current volume
3267 
3268  G4ThreeVector dPoint = daughterSolid->GetPointOnSurface();
3269 
3270  // Transform the generated point to the mother's coordinate system
3271  // and finally to current volume's coordinate system
3272  //
3273  G4ThreeVector mp2 = Td.TransformPoint(dPoint);
3274  G4ThreeVector msMp2 = Tm.Inverse().TransformPoint(mp2);
3275 
3276  if (solid->Inside(msMp2)==kInside)
3277  {
3278  if (verbose) G4cout << G4endl;
3279  if (verbose) G4cout << "WARNING - G4PVPlacement::CheckOverlaps()" << G4endl
3280  << " Overlap is detected for volume "
3281  << plVol->GetName() << G4endl
3282  << " apparently fully encapsulating volume "
3283  << daughter->GetName() << G4endl
3284  << " at the same level !" << G4endl;
3285  if (verbose) G4Exception("G4PVPlacement::CheckOverlaps()", "InvalidSetup",
3286  JustWarning, "Overlap with volume already placed !");
3287  return true;
3288  }
3289  }
3290  }
3291  }
3292 
3293  if (verbose)
3294  {
3295  G4cout << "OK! " << G4endl;
3296  }
3297 
3298  return false;
3299 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
verbose
Definition: train.py:477
void LBNEVolumePlacements::configureTargetForConceptHornARev2 ( )

Definition at line 216 of file LBNEVolumePlacementsAdd.cc.

216  {
217 
218  std::cerr << " Adapting for the NuMI target, long version, as Optimized horns are requested. " << std::endl;
219 
220  fTargetCTubeOuterRadius = 4.0*CLHEP::mm;
222  fTargetHeContTubeThickness = 1.0*CLHEP::mm;
224 // fTargetFinWidth = 13.4*CLHEP::mm; // // ajustable via G4 UI data card, but let us stick with this model
225  fTargetFinWidth = 10.0*CLHEP::mm; // For now... This does not
227  fTargetFinWidth /= 2.; // We divide by two, because we create left/right module, to avoid doing multiple
228  // volume subtractions.
229  fTargetFinContainerWidth = 16.125*CLHEP::mm; // This is to include the 4mm Outer Radius tubes.
230  // This might not be use anylonger, the volume hierarchy is still in the work.
231 // fTargetFinHeight = 24.0*CLHEP::mm; // increased size, per Cory e-mail, Nov 5 2016.
232  fTargetFinHeight = 26.0*CLHEP::mm; // increased size, again, per Cory & Jim H., Nov 11 2016.
233  fTargetFinHeight /= 2.; // Also divide by two, same reason as for along the X axis.
234  fTargetSLengthGraphite = 2.01*CLHEP::meter; // include specing. nominally, 2 m long of graphite.
235  fTargetSLength = 2243.0*CLHEP::mm; // include the empty (beside Helium) section, ~ 20 cm long
236  fTargetNumFins = 100; // 100 fins 20 mm length
237  fTargetFinWWingRadius = 13.0*CLHEP::mm;
238  fUseRoundedTargetFins = true; // for checking the geometry of the fins, avoiding complication for now..
239  std::cerr << " .... done target for HornA Rev2, fTargetLengthIntoHorn "
240  << fTargetLengthIntoHorn << " fTargetLengthOutsideHorn " << fTargetLengthOutsideHorn << std::endl;
241 }
QTextStream & endl(QTextStream &s)
LBNEVolumePlacementData * LBNEVolumePlacements::Create ( const G4String &  name)

Definition at line 638 of file LBNEVolumePlacements.cc.

638  {
639 
640  // Check that it is not already defined.
641 
643  if (itDupl != fSubVolumes.end()) {
644  std::ostringstream mStrStr;
645  mStrStr << " Volume named " << std::string(name) << " Already defined. Fatal ";
646  G4String mStr(mStrStr.str());
647  G4Exception("LBNEVolumePlacements::Create", " ", FatalErrorInArgument, mStr.c_str());
648  }
649 
650  const G4double in = 2.54*CLHEP::cm;
651  // look for a pre-existing placement. If there, fatal error, exit
653  info.fAlignmentModel = eNominal;
654  info.fIsPlaced = false;
655  info.fRotation = G4RotationMatrix(); // a bit of a waste of space, as, in most cases, not rotations are applied.
656  info.fRotationIsUnitMatrix= true;
657  info.fPosition = G4ThreeVector(0., 0., 0.);
658  info.fParams.resize(3, 0.);
659  info.fMother = 0;
660  info.fTypeName = G4String("Tubs"); // most common type of volume..
661  std::string volumeName(name); // volumeName += std::string("_solid"); Not necessary
662  if (name == G4String("Tunnel")) {
663  info.fParams[0] = std::max((18.5*CLHEP::m), 2.0*(fDecayPipeRadius));
664  // Note: the total volume is 60 m. wide => plenty enough rocks. The last term is for the Hadron Absorber cavern
665  info.fParams[1] = std::max((50*CLHEP::m), 2.0*(fDecayPipeRadius)); // Too tall... Set by the Hadron absorber requirement
666  info.fParams[2] = fTotalLength - fLengthOfRockDownstr -2.0*CLHEP::cm;
667  std::cerr << " Total half length of the tunnel " << info.fParams[2]/2. << std::endl;
668  std::cerr << " Total half Height of the tunnel " << info.fParams[1]/2. << std::endl;
669  std::cerr << " Total half Width of the tunnel " << info.fParams[0]/2. << std::endl;
670  G4Box* hallBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2. );
671  info.fCurrent = new G4LogicalVolume(hallBox, G4Material::GetMaterial("Air"), name);
672  info.fTypeName = G4String("Box");
673  }
674  if (name == G4String("TargetHallAndHorn1")) {
675 
676  // Initialise the target module (e.g. SAT) geometry parameters if required.
677  // This can affect the placement of the upstream section
678  if (fUseTargetModule) {
679  std::cout << "We are going to use the Target Module set-up" << std::endl;
680  this->InitTargetModule();
681  if (fUseTarget2Module) {
682  std::cout << "We are also going to use a 2nd mirror image target module" << std::endl;
683  this->InitTarget2Module();
684  }
685  }
686 
687  const LBNEVolumePlacementData *plInfo = Find(name, "Tunnel", "Create");
688  for (size_t k=0; k != 2; ++k)
689  info.fParams[k] = plInfo->fParams[k] - 2.0*CLHEP::cm;
691  + fHorn1Length + 1.0*CLHEP::cm + fTargetAndBaffleLengthApprox ; // 1 cm longitudinally for spare?
692 // Release r0 : this implies a relatiion ship between MCZERO and the word coordinate in G4 that
693 // depends on the tagert Length.
694 // Since the tunnel is centered on Rock and TargetHallAndHorn1 is subdivied in the Upstream Target Assembly and the
695 // the Horn1Hall, two volumes that do not have the same length, then MCZero is not Z = 0. in world coordinate.
696 // info.fPosition[2] = 0.; // Definiing MCZERO, Drawing 8875. 112-MD-363097, annotated by jim Hylen
697 // Jim H. - rightfully so, strongly asked for this to be fixed. We start here, by shifting this volume such that
698 // Horn1 starts at Z = 0.
699 // Formula found for placing Horn1 in TargetHallAndHorn1 (release r0)
700 //
701 // info.fPosition[2] = -1.0*plInfoM->fParams[2]/2. + plInfoC->fParams[2] + info.fParams[2]/2. + 0.020*CLHEP::mm;
702 //
703  const double totalLengthHorn1 = fHorn1DownstreamPlateLength + fHorn1Length + 0.5*CLHEP::cm;
704  const double totalLengthUpstr = fTargetAndBaffleLengthApprox;
705  info.fParams[2] = totalLengthHorn1 + totalLengthUpstr; // Obsolete, August 2014..
706 
710  info.fParams[2] = fHorn1Length + 1.0*CLHEP::cm + fTargetLengthOutsideHorn +
711  fTotalLengthUpstreamAssembly ; //To be adjusted..
712  std::cerr <<
713  " Defining length for mother of Horn1 and Target , fHorn1DownstreamPlateLength "
714  << fHorn1DownstreamPlateLength << std::endl;
715  std::cerr << " ............. fHorn1Length " << fHorn1Length
716  << " fTargetLengthOutsideHorn " << fTargetLengthOutsideHorn
717  << " fTotalLengthUpstreamAssembly " << fTotalLengthUpstreamAssembly << std::endl;
718 //
719 // We now need room for the downstream target support structure.
720 //
721  if (fUseLBNFOptimConceptDesignHornA) info.fParams[2] += 400.0*CLHEP::mm; // within a few cm.
723  std::cerr << " ....... Final fTotalLengthTargetAndHorn1Hall " << fTotalLengthTargetAndHorn1Hall << std::endl;
724  G4Box* hallBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2. );
725  info.fCurrent = new G4LogicalVolume(hallBox, G4Material::GetMaterial("Air"), volumeName);
726  info.fPosition[2] = (info.fParams[2]/2 - totalLengthUpstr + 0.5*CLHEP::cm); // Defining MCZERO, Drawing 8875. 112-MD-363097, annotated by jim Hylen
727  // Correction for Pseudo Nova: one must shift this volume by the extra length due to the comlete retraction..
729  const double distHorn1UpstrToZ0 = fTotalLengthTargetAndHorn1Hall/2. - (fHorn1Length
730  - 2.0*(2.436*in*fHorn1LongRescale) + 30.0*CLHEP::mm);
731  info.fPosition[2] = -1.0*distHorn1UpstrToZ0 - 1.84*CLHEP::mm; // Last offset due to various margins. Adjusted with Geantino's
733  info.fPosition[2] += -1.0*fZShiftConceptHornAStartIC + 298.3*CLHEP::mm; // Last term emprically set
734  // to align the Z start of the IC at Z = 0., per convention. We are innocent victim of our past
735  // see above for this historical burden. P.L., June 2016.
736  fZHallHorn1ToHorn1PolyM1 = 116.1*CLHEP::mm; // Used in positioning Horn1PolyM1 If this length changes,
737  //, to be revisited..!!!
738  fZHallHorn1ToHorn1PolyM1 += (90.0 + 150.0)*CLHEP::mm; // Correction, August 11-15 2016, based on Tyler J. work in
739  // verification of the geometry, and further discussion with Laura
740  // the want the target insterted a bit more into the horn.
741  // Move Horn1 a bit upstream, -15 cm.
742  // We also have to shift the field map..
743  fHornsPolyZStartPos[0] = -150.88*CLHEP::mm; // Hardcoded. Minor correction to the -150., established
744  // by looking at geantinos... This is the start of
745  // of the IC conductor, with respect to the start of the
746  // Horn1PolyM1, the mother volume of the IC, in global coordinates.
747  // This is not expected to change, it is the definition of our
748  // global coordinates, unless the geometry of HornA changes.
749  }
750  std::cerr << " Placing TargetHallAndHorn1 at " << info.fPosition[2] << " length " << info.fParams[2]
751  << " as upst off " << distHorn1UpstrToZ0 << std::endl << " ...... H1 Length " << fHorn1Length
752  << " with fTargetLengthOutsideHorn = " << fTargetLengthOutsideHorn << std::endl;
753  // Such that we keep the same global coordinate system.
754  info.fTypeName = G4String("Box");
755 
756  } else if (name == G4String("UpstreamTargetAssembly")) {
757  const LBNEVolumePlacementData *plInfo = Find(name, G4String("TargetHallAndHorn1"), G4String("Create"));
758  info.fParams[0] = 64*in - 1.0*CLHEP::cm;
759  info.fParams[1] = 60*in - 1.0*CLHEP::cm; // approximate, we need room for the rotation (Horn is tilted with respect to
760  // true horizontal
761  if (fUseRALTGTv1) {fTotalLengthUpstreamAssembly = 5*CLHEP::mm;}
762  info.fParams[2] = fTotalLengthUpstreamAssembly - 0.001*CLHEP::mm;
763  info.fPosition[2] =-plInfo->fParams[2]/2. + fTotalLengthUpstreamAssembly/2.;
764  // August 2014: Push the target into the horn, by pushing the whole assembly.
765  if (fUseSimpleTargetCylinder || fUseSimpleTargetBox) { // Remove geometrical constraint, such that
766  info.fParams[0] = 2.0*(fTargetHeContTubeInnerRadius + 0.175*CLHEP::mm);
767  info.fParams[1] = info.fParams[0];
768  std::cerr << " Creating UpstreamTargetAssembly with transv. size "
769  << info.fParams[0] << " fTotalLengthUpstreamAssembly "
770  << fTotalLengthUpstreamAssembly << " Position " << info.fPosition[2] << std::endl;
771  }
773  info.fPosition[2] =-plInfo->fParams[2]/2. + info.fParams[2]/2. + 0.5*CLHEP::mm;
774 
775  bool check1 = (!fUseHorn1Polycone) && (!fUseHornsPolycone);
776  // Checks for the target module z alignment
777  bool check2 = fUseTargetModule && fUseHorn1Polycone;
779 
780  if (check1 || check2 || check3) {info.fPosition[2] += fTargetLengthOutsideExtra;}
781 
782  std::cerr << " Correcting.. UpstreamTargetAssembly with transv. size "
783  << info.fParams[0] << " fTotalLengthUpstreamAssembly "
784  << fTotalLengthUpstreamAssembly << " Position " << info.fPosition[2] << std::endl;
785  G4Box* hallBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2. );
786  info.fCurrent = new G4LogicalVolume(hallBox, G4Material::GetMaterial("Air"), volumeName);
787  info.fTypeName = G4String("Box");
788 // std::cerr << " LBNEVolumePlacements::Create " << name << " half length " << info.fParams[2]/2. << std::endl;
789 
790  } else if (name == G4String("Baffle")) {
791  // more cases here... a long list.. a too long of a list?
792  // We now go one level down in the hierachy. Start from upstream
793  const LBNEVolumePlacementData *plInfo = Find(name, G4String("UpstreamTargetAssembly"), G4String("Create"));
794  info.fParams[0] = fBaffleInnerRadius;
795  info.fParams[1] = fBaffleOuterRadius;
796  info.fParams[2] = fBaffleLength - 0.75*CLHEP::mm; // to put the windows in...
797  G4Tubs* baffleTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
798  info.fCurrent = new G4LogicalVolume(baffleTube, G4Material::GetMaterial("GraphiteBaffle"), volumeName);
799  info.fPosition[2] = -plInfo->fParams[2]/2. + fBaffleLength/2.0 + 0.505*CLHEP::mm;
800  } else if (name == G4String("BaffleWindowUpstr")) {
801  // more cases here... a long list.. a too long of a list?
802  // We now go one level down in the hierachy. Start from upstream
803  const LBNEVolumePlacementData *plInfo = Find(name, G4String("UpstreamTargetAssembly"), G4String("Create"));
804  info.fParams[0] = 0.;
805  info.fParams[1] = 1.5*fBaffleInnerRadius; // not critical
807  G4Tubs* baffleTubeW = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
808  info.fCurrent = new G4LogicalVolume(baffleTubeW, G4Material::GetMaterial("Beryllium"), volumeName);
809  info.fPosition[2] = -plInfo->fParams[2]/2. + info.fParams[2]/2 + 0.005*CLHEP::mm;
810  } else if (name == G4String("BaffleWindowDownstr")) { // duplicate..except for position.
811  // more cases here... a long list.. a too long of a list?
812  // We now go one level down in the hierachy. Start from upstream
813  const LBNEVolumePlacementData *plInfo = Find(name, G4String("UpstreamTargetAssembly"), G4String("Create"));
814  info.fParams[0] = 0.;
815  info.fParams[1] = 1.5*fBaffleInnerRadius; // not critical
817  G4Tubs* baffleTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
818  info.fCurrent = new G4LogicalVolume(baffleTube, G4Material::GetMaterial("Beryllium"), volumeName);
819  info.fPosition[2] = -plInfo->fParams[2]/2. + fBaffleLength + 0.050*CLHEP::mm + info.fParams[2]/2 + fBaffleWindowThickness;
820  }
821  //
822  // Target stuff.. Lots of it
823  //
824  if (name.find("Target") != std::string::npos) {
825 // if (!fUseRALTGTv1) {
826 
827 // Upstream Stuff
828  // End of Obsolete splitted target. Kept for bacward compatibility and checks.
829  // Volume definition for the target that will fit into the polycone. August, Sept 2014.
830  //
831  // Cloned from the obsolete section above, with volumes renamed..
832 
833  if ((name.find("TargetUpstr") != std::string::npos) || (name.find("TargetConcept") != std::string::npos)) {
834  if (name == G4String("TargetUpstrMTop")) {
835  const LBNEVolumePlacementData *plInfo = Find(name, G4String("UpstreamTargetAssembly"), G4String("Create"));
836  // Complete container the target Canister and the portion of the target outside the horn
837  // Subject to misalignment!!!
838  info.fParams[1] = 10.*in; // mother volume, must hold the Inner/Outer Horn1 transition.
840  info.fParams[1] = plInfo->fParams[0]/2. - 0.025*CLHEP::mm; // radius is 1/2 the width (or height)
841  std::cerr << " Creating TargetUpstrMTop .... with radius " << info.fParams[1] << std::endl;
842  }
844  + fTargetDownstrCanFlangeThick + fTargetFlangeThick + 0.05*CLHEP::mm +
846  std::cerr << " Length of TargetUpstrMTop, ( with Horn1 Mother is Polycone) " << info.fParams[2] << std::endl;
847 
848  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
849  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial("Air"), volumeName);
850  info.fPosition[2] = plInfo->fParams[2]/2. - info.fParams[2]/2. - 0.01*CLHEP::mm; // Nominal:
851  // Half length of UpstreamTargetAssembly - length of this
852 
853  }
854  if (name == G4String("TargetUpstrM0")) { // Complete container for the target Canister and flange
855  const LBNEVolumePlacementData *plInfo = Find(name, G4String("TargetUpstrMTop"), G4String("Create"));
856  info.fParams[1] = fTargetDownstrCanFlangeOuterRadius + 1.0*CLHEP::cm;
859  // This volume hierarchy could be cleanup some more, evidently.
860  // August 27 2014.. Leave it as such for now..
861  info.fParams[2] = plInfo->fParams[2] - 0.010*CLHEP::mm ; // room for the downstream window of the baffle.
862  std::cerr << " Length of TargetUpstrMTop, ( with Horn1 Mother is Polycone) " << info.fParams[2] << std::endl;
863  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
864  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial("HeliumTarget"), volumeName);
865  info.fPosition[2] = -1.0*plInfo->fParams[2]/2. + info.fParams[2]/2. + 0.002*CLHEP::mm; //
866  }
867  if (name.find("TargetUpstrUpstr") != std::string::npos) {
868  const LBNEVolumePlacementData *plInfo = Find(name, G4String("TargetUpstrM0"), G4String("Create"));
869  if (name == G4String("TargetUpstrUpstrPlate")) { //
872  info.fParams[2] = fTargetUpstrPlateThick ;
873  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
874  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial("Aluminum"), volumeName);
875  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin + fTargetUpstrPlateThick/2.;
876  }
877  if (name == G4String("TargetUpstrUpstrCan")) { //
878  info.fParams[0] = fTargetCanInnerRadius;
879  info.fParams[1] = fTargetCanOuterRadius;
880  info.fParams[2] = fTargetCanLength ;
881  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
882  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(fTargetCanMaterial), volumeName);
883  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
885  }
886  if (name == G4String("TargetUpstrUpstrCanEndPlate")) { //
887  info.fParams[0] = fTargetCanInnerRadius;
888  info.fParams[1] = fTargetCanOuterRadius + 0.5*in; // ?? Guess for the 1/2 inch extra. not critical
890  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
891  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(fTargetCanMaterial), volumeName);
892  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
894 // ????? info.fParams[2] = fTargetUpstrUpstrMargin + fTargetUpstrPlateThick + fTargetCanLength // For M0
895 // + fTargetDownstrCanFlangeThick + fTargetFlangeThick;
896  }
897  if (name == G4String("TargetUpstrUpstrDwstrFlange")) { //
900  info.fParams[2] = fTargetFlangeThick ;
901  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
902  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(fTargetFlangeMaterial), volumeName);
903  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
905  fTargetDownstrCanFlangeThick + fTargetFlangeThick/2.;
906  }
907  if (name == G4String("TargetUpstrUpstrCoolingTube")) { //
908  info.fParams[0] = 0.; // Solid tube of copper, we'll define water below
909  info.fParams[1] = fTargetCTubeOuterRadius;
910  info.fParams[2] = fTargetCTubeUpstrLength ;
911  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
912  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(fTargetCTubeMaterial), volumeName);
913  // Leave the position blanks, as there will two copies (top and bottom.)
914  }
915  if (name == G4String("TargetUpstrUpstrCoolingTubeWater")) { //
916  info.fParams[0] = 0.;
917  info.fParams[1] = fTargetCTubeInnerRadius;
918  info.fParams[2] = fTargetCTubeUpstrLength ;
919  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
920  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
921  // Leave the position blanks, as there will two copies (top and bottom.)
922  }
923  if (name == G4String("TargetUpstrUpstrSupportBlockTopLeft")) { //
924  info.fParams[0] = 15.0*CLHEP::mm; // A block of presumed steel to support cooling tubes. +- 2 mm or so.
925  info.fParams[1] = 10.0*CLHEP::mm;
926  info.fParams[2] = 10.0*CLHEP::mm;
927  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2, info.fParams[2]/2.);
928  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Steel316")), volumeName);
929  info.fPosition[0] = -1.0;// Drawing 7589-00-00-00 Approximate. +- 1 mm
930  info.fPosition[1] = 22.5;// Drawing 7589-00-00-00
931  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
932  fTargetUpstrPlateThick + 140.*CLHEP::mm;// Drawing 7589-00-00-00
933  info.fTypeName = G4String("Box");
934  }
935  if (name == G4String("TargetUpstrUpstrSupportBlockBottomLeft")) { //
936  info.fParams[0] = 15.0*CLHEP::mm; // A block of presumed steel to support cooling tubes. +- 2 mm or so.
937  info.fParams[1] = 10.0*CLHEP::mm;
938  info.fParams[2] = 11.0*CLHEP::mm;
939  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2, info.fParams[2]/2.);
940  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Steel316")), volumeName);
941  info.fPosition[0] = -1.0*CLHEP::mm;// Drawing 7589-00-00-00
942  info.fPosition[1] = -20.0;// Drawing 7589-00-00-00
943  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
944  fTargetUpstrPlateThick + 140*CLHEP::mm;// Drawing 7589-00-00-00
945  info.fTypeName = G4String("Box");
946  }
947  if (name == G4String("TargetUpstrUpstrSupportBlockRight")) { //
948  info.fParams[0] = 10.0*CLHEP::mm; // A block of presumed steel to support cooling tubes. +- 2 mm or so.
949  info.fParams[1] = 15.0*CLHEP::mm;
950  info.fParams[2] = 11.0*CLHEP::mm;
951  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2, info.fParams[2]/2.);
952  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Steel316")), volumeName);
953  info.fPosition[0] = 14.0;// Drawing 7589-00-00-00
954  info.fPosition[1] = 7.5;// Drawing 7589-00-00-00
955  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
956  fTargetUpstrPlateThick + 140*CLHEP::mm;// Drawing 7589-00-00-00
957  info.fTypeName = G4String("Box");
958  }
959  if (name == G4String("TargetUpstrUpstrSupportRod")) { //
960  info.fParams[0] = 0.; //
961  info.fParams[1] = 12.*CLHEP::mm; // A bit oversize, the upstream part is thicker..
962  info.fParams[2] = 163.0*CLHEP::mm; // Approx to ~ 3 mm.
963  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.0*CLHEP::degree);
964  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Steel316")), volumeName);
965  // See special implementation due to multiple copies. These rods will not be "surveyable"
966 
967  }
968  if (name == G4String("TargetUpstrUpstrSupportSleeve")) { //
969  info.fParams[0] = fTargetFlangeInnerRadius - 0.2*CLHEP::mm; //
970  info.fParams[1] = info.fParams[0] + 3.0*CLHEP::mm; // Approx to 500 microns
971  info.fParams[2] = 72.0*CLHEP::mm;
972  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.0*CLHEP::degree );
973  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Steel316")), volumeName);
974  info.fPosition[2] =-1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
976  + fTargetDownstrCanFlangeThick - info.fParams[2]/2. -0.1*CLHEP::mm;
977  }
978  if (name == G4String("TargetUpstrUstrHorFin")) { //
979  info.fParams[0] = fTargetFinHeight; // X-Y inverted
980  info.fParams[1] = fTargetFinWidth;
981  info.fParams[2] = fTargetFinLength;
982  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2, info.fParams[2]/2.);
983  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
984  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
985  fTargetUpstrPlateThick + 140*CLHEP::mm;// Drawing 7589-00-00-00
986  info.fTypeName = G4String("Box");
987  }
988  // The following are probably too detailed, and too far away from axis.
989  // Will not be used for now...
990  if (name == G4String("TargetUpstrUpstrCoolingTubeBendSection")) { //
991  info.fParams[0] = 0.; // Solid block of copper, we'll define water below
992  info.fParams[1] = fTargetCTubeOuterRadius;
993  info.fParams[2] = fTargetCTubeUpstrRadCurve/fTargetCTubeUpstrNumSegCurve - 0.1*CLHEP::mm; // 100 microns to avoid overlaps
994  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
995  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(fTargetCTubeMaterial), volumeName);
996  // Leave the position blanks, as there will two copies (top and bottom.)
997  }
998  if (name == G4String("TargetUpstrUpstrCoolingTubeBendSectionWater")) { //
999  info.fParams[0] = 0.; // Solid block of copper, we'll define water below
1000  info.fParams[1] = fTargetCTubeInnerRadius;
1002  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1003  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
1004  // Leave the position blanks, as there will two copies (top and bottom.)
1005  }
1006  if (name == G4String("TargetUpstrUpstrCoolingTubeFlangeSection")) { //
1007  info.fParams[0] = 0.;
1008  info.fParams[1] = fTargetCTubeOuterRadius;
1009  info.fParams[2] = fTargetFlangeThick;
1010  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1011  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(fTargetCTubeMaterial), volumeName);
1012  // Leave the position blanks, as there will be two copies (top and bottom.)
1013  }
1014  if (name == G4String("TargetUpstrUpstrCoolingTubeFlangeSectionWater")) { //
1015  info.fParams[0] = 0.;
1016  info.fParams[1] = fTargetCTubeInnerRadius;
1017  info.fParams[2] = fTargetFlangeThick;
1018  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1019  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
1020  // at (0.,0., 0.)
1021  }
1022 
1023 
1024 
1025  } // UpstreamTargetAssembly as mother volume.
1026 
1027 
1028  if ((name.find("TargetUpstrDownstr") != std::string::npos) || (name.find("TargetConceptHelium") != std::string::npos)) {
1029  if (name == G4String("TargetUpstrDownstrHeContainer")) { //
1030  if (fUseLBNFOptimConceptDesignHornA) {
1031  std::cerr
1032  << " Suspicious volume TargetUpstrDownstrHeContainer created in LBNEVolumePlacement .. " << std::endl;
1033  exit(2);
1034  }
1035  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("TargetUpstrM1"), G4String("Create"));
1036  info.fParams[0] = 0.;
1038  info.fParams[2] = plInfoM->fParams[2]- .005*CLHEP::mm;
1039 // if (fUseLBNFOptimConceptDesignHornA) info.fParams[2] = ?????
1040  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1041  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Beryllium")), volumeName);
1042  info.fPosition[2] = 0.; // possibly tweak for the margin...
1043  }
1044  if (name == G4String("TargetUpstrDownstrHelium")) { //
1045  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("TargetUpstrDownstrHeContainer"), G4String("Create"));
1046  info.fParams[0] = 0.;
1048  info.fParams[2] = plInfoM->fParams[2]- .005*CLHEP::mm;
1049  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1050  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
1051  info.fPosition[2] = 0.; // possibly tweak for the margin...
1052  }
1053  if (name == G4String("TargetUpstrDownstrCoolingTube")) { //
1054  info.fParams[0] = 0.;
1055  info.fParams[1] = fTargetCTubeOuterRadius;
1057  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1058  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Titanium")), volumeName);
1059  info.fPosition[2] = fTargetFinHeight + 0.005*CLHEP::mm; // possibly tweak for the margin...
1060  }
1061  if (name == G4String("TargetUpstrDownstrCoolingTubeWater")) { //
1062  info.fParams[0] = 0.;
1063  info.fParams[1] = fTargetCTubeInnerRadius;
1065  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1066  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
1067  }
1068  //
1069  // Used for the normal fins, normal (no wings)
1070  if ((name == G4String("TargetConceptHeliumBoxSegment")) ||
1071  (name == G4String("TargetConceptHeliumTubWWings")) ||
1072  (name == G4String("TargetUpstrDownstrSegment")) ||
1073  (name == G4String("TargetUpstrDownstrSegmentLeft")) ||
1074  (name == G4String("TargetUpstrDownstrSegmentRight")) ) { //
1075 
1076  info.fParams[0] = fTargetFinContainerWidth + 0.025*CLHEP::mm;
1077  info.fParams[1] = fTargetFinHeight + 2.0*fTargetCTubeOuterRadius + 0.025*CLHEP::mm;
1078  // To avoid having to place bits of graphit in the corner, extend the segment upwards/downwards
1079  // to completely encompass the cooling tubes
1080  // Valid only for the old (circa 2014 NuMI short target ) (Jan 5 2017)
1082  if (fUse1p2MW && (name == G4String("TargetConceptHeliumBoxSegment"))) { // New NuMI-stlye target, but LBNF design.
1083  //
1084  // October/November 2016.
1085  // The width is set by either the fin width or the radius of the cooling pipe. We need two of them.
1086  // and the vale between the two pipe (1 mm. ) add 150 microns..
1087  info.fParams[0] = std::max(2.0*fTargetFinWidth + 0.050*CLHEP::mm, 4.0*fTargetCTubeOuterRadius + 1.150*CLHEP::mm);
1088  info.fParams[1] = 2.0*fTargetFinHeight + 2.0*fTargetCTubeOuterRadius + 0.175*CLHEP::mm;
1089  }
1090  if (name == G4String("TargetConceptHeliumTubWWings")) {
1091  info.fParams[0] = 0.;
1092  info.fParams[1] = fTargetHeContTubeInnerRadius - 3.0*CLHEP::mm;
1093  // To reviewed when we have a drawing for the clamps.
1094  }
1096  std::cerr << " Create Volume " << name << " fParams " << info.fParams[0] << " / "
1097  << info.fParams[1] << " / " << info.fParams[2]
1098  << " fin height " << fTargetFinHeight << std::endl;
1099  if (name == G4String("TargetConceptHeliumTubWWings")) {
1100  info.fTypeName = G4String("Box");
1101  G4Tubs* aTubs = new G4Tubs(volumeName, 0., info.fParams[1], info.fParams[2]/2., 0., 360.0*CLHEP::degree);
1102  info.fCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
1103  } else {
1104  std::cerr << " Creation of TargetUpstrDownstrSegment, sizes "
1105  << info.fParams[0] << " " << info.fParams[1] << " " << info.fParams[2] << std::endl;
1106 
1107  info.fTypeName = G4String("Box");
1108  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2.);
1109  if (fUse1p2MWSmallTgt)
1110  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
1111  else
1112  info.fCurrent =
1113  new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
1114  }
1115  }
1116  if (name == G4String("TargetUpstrDownstrCoolingTubeLast")) { //
1117  info.fParams[0] = 0.;
1118  info.fParams[1] = fTargetCTubeOuterRadius;
1119  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.025*CLHEP::mm;
1120  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1121  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Titanium")), volumeName);
1122  info.fPosition[2] = fTargetFinHeight + 0.005*CLHEP::mm; // possibly tweak for the margin...
1123  }
1124  if (name == G4String("TargetUpstrDownstrCoolingTubeLastWater")) { //
1125  info.fParams[0] = 0.;
1126  info.fParams[1] = fTargetCTubeInnerRadius;
1127  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.03*CLHEP::mm;
1128  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1129  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
1130  }
1131  if ((name == G4String("TargetUpstrDownstrSegmentLast")) ||
1132  (name == G4String("TargetUpstrDownstrSegmentLastLeft")) ||
1133  (name == G4String("TargetUpstrDownstrSegmentLastRight"))) { //
1134  info.fParams[0] = fTargetFinContainerWidth + 0.025*CLHEP::mm;
1135  info.fParams[1] = fTargetFinHeight + 2.0*fTargetCTubeOuterRadius + 0.025*CLHEP::mm;
1136  if (fUse1p2MW) info.fParams[1] += 2.0*fTargetCTubeOuterRadius;
1137  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.01*CLHEP::mm;
1138 
1139  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2.);
1140  if (!fUse1p2MW)
1141  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
1142  else info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
1143  info.fTypeName = G4String("Box");
1144  }
1145  //
1146  } // Downstream of the flange of the target canister.
1147  } // Upstream Stuff
1148  // End of Obsolete splitted target. Kept for bacward compatibility and checks.
1149  // Volume definition for the target that will fit into the polycone. August, Sept 2014.
1150  //
1151  // Cloned from the obsolete section above, with volumes renamed..
1152 
1153 
1154  if (!fUseRALTGTv1){
1155  if (name.find("TargetNoSplit") != std::string::npos) {
1156  std::cerr << " As the data card is off, we will be using the normal optimized design of target and cooling systems" << std::endl;
1157  if (name == G4String("TargetNoSplitM1")) { // Complete container volume placed in the Horn1 and target whole
1158  // to contain the downstream part of the target, i.e., the Helium container tube.
1159  std::cerr << " Creating TargetNoSplitM1 ... " << std::endl;
1160  info.fParams[0] = 0.;
1161  info.fParams[1] = fTargetHeContTubeInnerRadius + fTargetHeContTubeThickness + 0.1*CLHEP::mm; // August 2014, tighter
1162  // December 16 2014: save this radius for Perfect Focusing studies.
1163  LBNERunManager *pRunManager=static_cast<LBNERunManager*> (LBNERunManager::GetRunManager());
1164  const LBNEDetectorConstruction *pDetTmp =
1165  static_cast<const LBNEDetectorConstruction*> (pRunManager->GetUserDetectorConstruction());
1166  pDetTmp->SetRCoordOutOfTarget(fTargetHeContTubeInnerRadius); // mutable here, casting away constness...
1167  // Now position in the mother... Mother name(s) hardcoded here.
1168  // Target configuration dependent.. Quite messy
1170  info.fParams[2] = fTargetSLength + 0.2*CLHEP::mm;
1171  } else {
1172  info.fParams[2] =
1173  fTargetUpstrDwnstrMargin + fTargetDistFlangeToTargetStart + fTargetSLength + 0.01*CLHEP::mm;
1174  }
1175  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1176  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Air")), volumeName);
1177  double lengthMotherNow = 0.;
1178  if (fUse1p2MWSmallTgt) {
1179  //special code for the retro fitted target, if need be...
1180  // for now, cloned from 1.2 MW, long target.
1181  const LBNEVolumePlacementData *plInfo =
1182  Find(name, G4String("TargetHallAndHorn1"), G4String("Create"));
1183  const LBNEVolumePlacementData *plInfoUp = Find(name, G4String("UpstreamTargetAssembly"), G4String("Create"));
1184  lengthMotherNow = plInfo->fParams[2];
1185 //
1186 // We attached the real part of the target the upstream segment .
1187 //
1188  info.fPosition[2] = -plInfo->fParams[2]/2. + plInfoUp->fParams[2] + 1.0*CLHEP::cm + info.fParams[2]/2.;
1189 
1191  // easier to start from the downstream end .
1192  } else {
1193 // if (fUseLBNFOptimConceptDesignHornA) info.fParams[2] += 196.2*CLHEP::mm;
1194  // Note: fTargetHeContTubeLengthInHorn = 2243.0*CLHEP::mm;
1195  //Approximate.. Taken indirectly with measurement tool. Drawing F10068454
1196  // This is to extend the helium cooling tube to connect to the target containment vessel
1197  // to the dowsntream support.
1198 
1199  const LBNEVolumePlacementData *plInfo = Find(name, G4String("TargetUpstrMTop"), G4String("Create"));
1200  info.fPosition[2] = plInfo->fParams[2]/2. - info.fParams[2]/2. - 0.005*CLHEP::mm; // in TargetUpstrMTop To be checked, Aug - Sept 2014.
1201  // August 2014: the mother has to be the TargetHallAndHorn1, such that it can be instered in Horn1
1202  // to get the Z=0. at fTargetLengthOutsideHorn, start if the Horn A IC.
1203  plInfo = Find(name, G4String("TargetHallAndHorn1"), G4String("Create"));
1204  lengthMotherNow = plInfo->fParams[2];
1205  const LBNEVolumePlacementData *plInfoUp = Find(name, G4String("UpstreamTargetAssembly"), G4String("Create"));
1206 //
1207 // We attached the real part of the target the upstream segment .
1208 //
1209  info.fPosition[2] = -plInfo->fParams[2]/2. + plInfoUp->fParams[2] + 1.0*CLHEP::cm + info.fParams[2]/2.;
1210 // if ((!fUseHorn1Polycone) && (!fUseHornsPolycone)) info.fPosition[2] += fTargetLengthOutsideExtra;
1211 //
1212 // P.L., L. F., Oct 7 2015:
1213 // The above conditional move should be unconditional ...
1214 // To keep consistency on the definition of the target position with v3r3p8,
1215 // where this move was done for the NuMI-stlye or the Polycone horn,
1216 // we now just have
1217 // Adjusted in HornA is conceptual design, revision 2.
1218 //
1219 
1221  if (fUseLBNFOptimConceptDesignHornA) info.fPosition[2] += 0.01*CLHEP::mm; // To be adjusted, if target length changes.
1222  // or the position of the downstream support.
1223  }
1224  std::cerr << " ...............Done Creating TargetNoSplitM1, length of mother "
1225  << lengthMotherNow << " length of TargetNoSplitM1 " << info.fParams[2] << std::endl
1226  << " ...... Length of Graphite " << fTargetSLengthGraphite
1227  << std::endl << " ............. Z pos relative to mother "
1228  << info.fPosition[2] << std::endl;
1229  } else {
1230  if (name == G4String("TargetNoSplitHeContainer")) { //
1231  const LBNEVolumePlacementData *plInfoM =
1232  Find(name, G4String("TargetNoSplitM1"), G4String("Create"));
1233  info.fParams[0] = 0.;
1235  info.fParams[2] = plInfoM->fParams[2]- .005*CLHEP::mm;
1236  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1237  // November 7 : realized that I never changed the material of the long cooling pipe.. as (sort of agreed upon a year or two
1238  // ago..) that beryllimun would too expensive and hard to manage...
1239  info.fPosition[2] = 0.; // possibly tweak for the margin...
1240  G4Material *myMatTube = G4Material::GetMaterial(std::string("Titanium"));
1241 // temporary revert to Beryllium, to check the effect.. Same thickness. Unrealistic, perhaps...
1242 // G4Material *myMatTube = G4Material::GetMaterial(std::string("Beryllium"));
1243  info.fCurrent = new G4LogicalVolume(aTube,myMatTube , volumeName);
1244  std::cerr << " Defined TargetNoSplitHeContainer, " << myMatTube->GetName() << ", with inner radius "
1245  << fTargetHeContTubeInnerRadius << " Thickness " << fTargetHeContTubeThickness << std::endl;
1246  std::cerr << " Length Mother " << plInfoM->fParams[2]
1247  << " Inner Radius " << plInfoM->fParams[0] << " Outer Radius " << plInfoM->fParams[1] << std::endl;
1248  }
1249  if (name == G4String("TargetNoSplitHelium")) { //
1250  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("TargetNoSplitHeContainer"), G4String("Create"));
1251  info.fParams[0] = 0.;
1253  info.fParams[2] = plInfoM->fParams[2]- .005*CLHEP::mm;
1254  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1255  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
1256  std::cerr << " Length of TargetNoSplitHelium " << info.fParams[2]
1257  << " outer radius for helium " << fTargetHeContTubeInnerRadius << std::endl;
1258  info.fPosition[2] = 0.; // possibly tweak for the margin...
1259  }
1260  if ((name == G4String("TargetNoSplitSegment")) ||
1261  (name == G4String("TargetNoSplitSegmentLeft")) ||
1262  (name == G4String("TargetNoSplitSegmentRight")) ) { //
1263 
1264  info.fParams[0] = fTargetFinContainerWidth + 0.025*CLHEP::mm;
1265  info.fParams[1] = fTargetFinHeight + 2.0*fTargetCTubeOuterRadius + 0.025*CLHEP::mm;
1266  // To avoid having to place bits of graphit in the corner, extend the segment upwards/downwards
1267  // to completely encompass the cooling tubes.
1268  if (fUse1p2MW) info.fParams[1] += 2.0*fTargetCTubeOuterRadius;
1269  // the container vessel is bigger.
1270  std::cerr << " Creating " << name << " Height " << info.fParams[1] << std::endl;
1272  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2.);
1273  if (!fUse1p2MW)
1274  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
1275  else info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
1276  info.fTypeName = G4String("Box");
1277  }
1278  if (name == G4String("TargetNoSplitCoolingTubeLast")) { //
1279  info.fParams[0] = 0.;
1280  info.fParams[1] = fTargetCTubeOuterRadius;
1281  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.025*CLHEP::mm;
1282  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1283  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Titanium")), volumeName);
1284  info.fPosition[2] = fTargetFinHeight + 0.005*CLHEP::mm; // possibly tweak for the margin...
1285  }
1286  if (name == G4String("TargetNoSplitCoolingTubeLastWater")) { //
1287  info.fParams[0] = 0.;
1288  info.fParams[1] = fTargetCTubeInnerRadius;
1289  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.03*CLHEP::mm;
1290  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
1291  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
1292  }
1293  if ((name == G4String("TargetNoSplitSegmentLast")) ||
1294  (name == G4String("TargetNoSplitSegmentLastLeft")) ||
1295  (name == G4String("TargetNoSplitSegmentLastRight"))) { //
1296  info.fParams[0] = fTargetFinContainerWidth + 0.025*CLHEP::mm;
1297  info.fParams[1] = fTargetFinHeight + 2.0*fTargetCTubeOuterRadius + 0.025*CLHEP::mm;
1298  if (fUse1p2MW) info.fParams[1] += 2.0*fTargetCTubeOuterRadius;
1299  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.01*CLHEP::mm;
1300 
1301  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2.);
1302  if (!fUse1p2MW)
1303  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
1304  else info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
1305  info.fTypeName = G4String("Box");
1306  }
1307  //
1308  }
1309  } // Downstream of the flange of the target canister.
1310  // Upstream Stuff
1311  }
1312 
1313 //------------------------------------------------------------------------------------------------------------------------------------------------------------
1314  // Design RAL Target <<-----------
1315  //In case we want to use the RAL target, the data card /LBNE/det/fUseRALTGTv1 will implement the following chain instead of the one above
1316 
1317 
1318  else {
1319 
1320 // From this point onwards, we start defining the target helium containment tubes
1321 // We will stick to previous defined TargetNoSplit volume and go from there
1322 
1323 
1324  if (name.find("TargetNoSplit") != std::string::npos) {
1325 
1327  fTargetOutHeContTubeStraightLength = 1001*CLHEP::mm;
1328  fTargetOutHeContTubeTaperedLength = 500*CLHEP::mm;
1329  fTargetCTubeLength = 1500*CLHEP::mm;
1330  }
1331 
1332  std::cerr << " Using RAL configuration for the target and target cooling systems" << std::endl;
1333 
1334  if (name == G4String("TargetNoSplitM1")){
1335 
1336  std::cerr << "TargetNoSplitM1...: Defines the outermost helium containment vessel" << std::endl;
1337 
1338  //Defining the parameters that describe the tapered section of the Outer He Cont tube.
1339 
1340  info.fParams.resize(5);
1341  info.fParams[0] = 0*CLHEP::mm;
1343  info.fParams[2] = 0*CLHEP::mm;
1346 
1347  G4Cons* Outersurface = new G4Cons("Outersurface", info.fParams[0], info.fParams[1], info.fParams[2],
1348  info.fParams[3], info.fParams[4]/2., 0.*CLHEP::mm, 360.0*CLHEP::mm);
1349 
1350  LBNERunManager *pRunManager=static_cast<LBNERunManager*> (LBNERunManager::GetRunManager());
1351  const LBNEDetectorConstruction *pDetTmp =
1352  static_cast<const LBNEDetectorConstruction*> (pRunManager->GetUserDetectorConstruction());
1353  pDetTmp->SetRCoordOutOfTarget(fTargetOutHeContTubeOuterRadius); // mutable here, casting away constness...
1354 
1355 
1356  //Defining the parameters that describe the straight cylindrical section of the Outer He Cont tube.
1357 
1358  G4Tubs* aTube = new G4Tubs("section1", 0*CLHEP::mm, fTargetOutHeContTubeOuterRadius,
1359  fTargetOutHeContTubeStraightLength/2., 0., 360.*CLHEP::degree);
1360 
1361  G4ThreeVector zTrans(0., 0., fTargetOutHeContTubeTaperedLength/2. + fTargetOutHeContTubeStraightLength/2.);
1362  G4Material *myMatTube = G4Material::GetMaterial(std::string("TitaniumG5"));
1363 
1364 
1365  //Merging the straight and tapered section into a new volume
1366 
1367  G4UnionSolid* unionMoved = new G4UnionSolid("totaloutersurface", aTube, Outersurface, 0, zTrans);
1368 
1369  //Defining the volume that describes the half spherical tip of the Outer He Cont tube.
1370 
1371  G4Sphere* Sphere = new G4Sphere("Sphere", 0*CLHEP::mm, fTargetOutHeContTubeOuterSphericalEndCap, 0*CLHEP::degree,
1372  360*CLHEP::degree, 0*CLHEP::degree, 90*CLHEP::degree);
1373 
1374  //Defining the displacement zTrans2 of the half spherical volume w.r.t. the Outer He Cont tube.
1375 
1376  G4ThreeVector zTrans2(0., 0., fTargetOutHeContTubeTaperedLength + fTargetOutHeContTubeStraightLength/2.);
1377 
1378  //Merging the spherical section with the rest of the Outer He Cont tube.
1379 
1380  G4UnionSolid* unionMoved2 = new G4UnionSolid("With spherical end", unionMoved, Sphere, 0, zTrans2);
1381  info.fCurrent = new G4LogicalVolume(unionMoved2 ,myMatTube ,volumeName);
1382 
1383  double lengthMotherNow = 0.;
1384 
1385 
1386  if (fUse1p2MWSmallTgt) {
1387 
1388  const LBNEVolumePlacementData *plInfo =
1389  Find(name, G4String("TargetHallAndHorn1"), G4String("Create"));
1390 
1391  const LBNEVolumePlacementData *plInfoUp = Find(name, G4String("UpstreamTargetAssembly"), G4String("Create"));
1392  lengthMotherNow = plInfo->fParams[2];
1393 
1394  info.fPosition[2] = -plInfo->fParams[2]/2. + plInfoUp->fParams[2] + 1.0*CLHEP::cm + info.fParams[2]/2.;
1395 
1397 
1398  } else {
1399 
1400  const LBNEVolumePlacementData *plInfo = Find(name, G4String("TargetUpstrMTop"), G4String("Create"));
1401 
1402  plInfo = Find(name, G4String("TargetHallAndHorn1"), G4String("Create"));
1403  lengthMotherNow = plInfo->fParams[2];
1404 
1405  const LBNEVolumePlacementData *plInfoHorn =
1406  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1407 
1408 
1409  info.fPosition[2] = -plInfoHorn->fParams[2]/2. + plInfoHorn->fPosition[2] + fTargetOutHeContTubeStraightLength/2. + fTargetHeContTubeSmallConeLength +
1411  }
1412 
1413  std::cerr << " ...............Done Creating TargetNoSplitM1, length of mother "
1414  << lengthMotherNow << " length of TargetNoSplitM1 " << info.fParams[4] +
1416  << " ...... Length of Graphite " << fTargetSLengthGraphite
1417  << std::endl << " ............. Z pos relative to mother "
1418  << info.fPosition[2] << std::endl;
1419  }
1420 
1421  else {
1422  if (name == G4String("TargetNoSplitHeContainer")) {
1423  // Looking for mother volumes that define the Z position of the inner helium container
1424 
1425  //Defining the parameters that will describe the inner helium tube
1426  info.fParams.resize(3);
1427  info.fParams[0] = fTargetCTubeInnerRadius;
1428  info.fParams[1] = fTargetCTubeOuterRadius;
1429  info.fParams[2] = fTargetCTubeLength;
1430 
1431 
1432  //Constructing the volume
1433  G4Tubs* InnerHeliumTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1],
1434  info.fParams[2]/2., 0.*CLHEP::mm, 360.*CLHEP::degree);
1435 
1436  //Determines the position of the TargetNoSplitHeContainer inner radius of the outer helium containment tube
1437 
1439 
1440  G4Material *myMatTube = G4Material::GetMaterial(std::string("TitaniumG5"));
1441 
1442  info.fCurrent = new G4LogicalVolume(InnerHeliumTube ,myMatTube , volumeName);
1443 
1444  std::cerr << " Defined TargetNoSplitHeContainer, " << myMatTube->GetName() << ", with inner radius "
1445  << fTargetCTubeInnerRadius << " Outer radius " << fTargetHeContTubeInnerRadius << std::endl;
1446 
1447  }
1448 
1449  // The TitaniumG5 ring between the helium containment tube and the simple target
1450 
1451 
1452  if (name == G4String("TargetNoSplitCoolingTubeLast")) {
1453  //Defining the section of the helium cooling tube that connects the bafflet to the target
1454 
1455  const LBNEVolumePlacementData *plInfoM2 =
1456  Find(name, G4String("TargetNoSplitLargeConeHe"), G4String("Create"));
1457 
1458  //Defining the parameters of the small cylindrical section between the target and bafflet
1459 
1460  info.fParams.resize(6);
1461 
1462  info.fParams[0] = fSimpleTargetRadius;
1468 
1469 
1470  //Cylinder and Cone that make up the section between the bafflet and target
1471 
1472  G4Tubs* SmallCyl = new G4Tubs("Hetubebafflet", info.fParams[0], info.fParams[1], info.fParams[2]/2.,
1473  0.*CLHEP::degree, 360.*CLHEP::degree);
1474  G4Cons* SmallCone = new G4Cons("Conical section Helium Cont Tube", info.fParams[3], info.fParams[4],
1475  info.fParams[0], info.fParams[1], fTargetHeContTubeSmallConeLength/2.,
1476  0.*CLHEP::degree, 360.0*CLHEP::degree);
1477 
1478 
1479  G4ThreeVector zTrans(0., 0., info.fParams[2]/2. + info.fParams[5]/2.);
1480 
1481  G4UnionSolid* HeSection = new G4UnionSolid("Helium Tube Conical", SmallCone, SmallCyl, 0, zTrans);
1482 
1483  //Define the position of the this section within the mother volume TargetNoSplitLargeCone
1484 
1485  info.fPosition[2] = plInfoM2->fParams[4]/2. - info.fParams[5]/2. - info.fParams[2] - fRALTargetRing;
1486 
1487 
1488  info.fCurrent = new G4LogicalVolume(HeSection, G4Material::GetMaterial(std::string("TitaniumG5")),
1489  volumeName);
1490 
1491  }
1492 
1493  if (name == G4String("TargetNoSplitLargeCone")) {
1494 
1495  //Defining the large conical section upstream of the helium cooling tube that houses the target (incomplete)
1496 
1497  const LBNEVolumePlacementData *plInfoM1 =
1498  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1499 
1500  const LBNEVolumePlacementData *plInfoM =
1501  Find(name, G4String("TargetNoSplitHeContainer"), G4String("Create"));
1502 
1503  info.fParams.resize(5);
1504 
1505  //Defining the parameters of the large conical section upstream of the helium cooling tube
1506 
1507  info.fParams[0] = 0.;
1509  info.fParams[2] = 0.;plInfoM->fParams[0];
1510  info.fParams[3] = plInfoM->fParams[1];
1512 
1513  G4Cons* LargeCone = new G4Cons("LargeCone", info.fParams[0], info.fParams[1],
1514  info.fParams[2], info.fParams[3], info.fParams[4]/2.,
1515  0.*CLHEP::degree, 360.0*CLHEP::degree);
1516 
1517 
1518  G4Tubs* bafflet = new G4Tubs(volumeName, 0., fTargetHeContTubeSmallConeInnerRad +
1519  fThicknessBafflet, fTargetHeContTubeBaffletLength/2., 0., 360.*CLHEP::degree);
1520 
1521 
1522  G4ThreeVector zTrans(0., 0., fTargetHeContTubeLargeConeLength/2. - fTargetHeContTubeBaffletLength/2.
1524 
1525  G4SubtractionSolid* subtraction = new G4SubtractionSolid("LargeCone-Tube", LargeCone, bafflet, 0, zTrans);
1526 
1527 
1528  //Defining the position of the large conical section upstream of the helium cooling tube
1529 
1530  info.fPosition[2] = plInfoM1->fPosition[2] - plInfoM1->fParams[2]/2. + fTargetHeContTubeSmallConeLength +
1532 
1533  info.fCurrent = new G4LogicalVolume(subtraction, G4Material::GetMaterial(std::string("TitaniumG5")),
1534  volumeName);
1535 
1536  }
1537 
1538  if (name == G4String("TargetNoSplitLargeConeHe")) {
1539 
1540  //Filling the large conical section upstream of the helium cooling tube that houses the target (incomplete) with
1541  //helium
1542 
1543  info.fParams.resize(5);
1544 
1545  info.fParams[0] = 0;
1547  info.fParams[2] = 0;
1548  info.fParams[3] = fTargetCTubeInnerRadius;
1550 
1551  G4Cons* Cone = new G4Cons("LargeCone", info.fParams[0], info.fParams[1], info.fParams[2],
1552  info.fParams[3], info.fParams[4]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1553 
1554 
1555  G4Tubs* bafflet = new G4Tubs(volumeName, info.fParams[0], fTargetHeContTubeSmallConeInnerRad +
1556  fThicknessBafflet, fTargetHeContTubeBaffletLength/2., 0., 360.*CLHEP::degree);
1557 
1558 
1559  G4ThreeVector zTrans(0., 0., fTargetHeContTubeLargeConeLength/2. - fTargetHeContTubeBaffletLength/2.
1561 
1562  G4SubtractionSolid* subtraction = new G4SubtractionSolid("Cone-Tube", Cone, bafflet, 0, zTrans);
1563  info.fPosition[2] = 0.;
1564 
1565  info.fCurrent = new G4LogicalVolume(subtraction, G4Material::GetMaterial(std::string("Helium")),
1566  volumeName);
1567 
1568  }
1569 
1570 
1571  if (name == G4String("TargetNoSplitM1Helium")){
1572 
1573  //Filling the entire outer helium pipe with helium
1574 
1575  const LBNEVolumePlacementData *plInfoM =
1576  Find(name, G4String("TargetNoSplitM1"), G4String("Create"));
1577 
1578  info.fParams.resize(5);
1579 
1580  info.fParams[0] = 0;
1581  info.fParams[1] = plInfoM->fParams[1] - 1*CLHEP::mm;
1582  info.fParams[2] = 0;
1583  info.fParams[3] = plInfoM->fParams[3] - 1*CLHEP::mm;
1584  info.fParams[4] = plInfoM->fParams[4];
1585 
1586  //Redefining all the separate parts that build up the outer helium containment tube and shrinking it by a small
1587  //amount in order to fill it with helium.
1588 
1589  G4Cons* HeOuter = new G4Cons("HeOuter", info.fParams[0], info.fParams[1], info.fParams[2],
1590  info.fParams[3], info.fParams[4]/2., 0.*CLHEP::mm, 360.0*CLHEP::mm);
1591 
1592  G4Tubs* aTube = new G4Tubs("section1", 0, info.fParams[1], fTargetOutHeContTubeStraightLength/2., 0., 360.*CLHEP::degree);
1593 
1594  G4ThreeVector zTrans(0., 0., info.fParams[4]/2. + fTargetOutHeContTubeStraightLength/2.);
1595 
1596  G4UnionSolid* unionMoved = new G4UnionSolid("totaloutersurface", aTube, HeOuter, 0, zTrans);
1597 
1598  G4Sphere* Sphere = new G4Sphere("Sphere", 0., fTargetOutHeContTubeOuterSphericalEndCap - 1*CLHEP::mm, 0*CLHEP::degree,
1599  360*CLHEP::degree, 0*CLHEP::degree, 90*CLHEP::degree);
1600 
1601 
1602  G4ThreeVector zTrans2(0., 0., fTargetOutHeContTubeTaperedLength + fTargetOutHeContTubeStraightLength/2.);
1603 
1604  G4UnionSolid* unionMoved2 = new G4UnionSolid("With spherical end", unionMoved, Sphere, 0, zTrans2);
1605 
1606 
1607  G4Material *myMatTube = G4Material::GetMaterial(std::string("Helium"));
1608 
1609  info.fCurrent = new G4LogicalVolume(unionMoved2 ,myMatTube ,volumeName);
1610 
1611  info.fPosition[2]= 0.;
1612 
1613  }
1614 
1615 
1616  if (name == G4String("TargetNoSplitCoolingTubeFirstMoth")) { //
1617  const LBNEVolumePlacementData *plInfoM1 =
1618  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1619 
1620  //Defining the mother volume for the bafflet
1621 
1622  info.fParams[0] = 0;//fTargetHeContTubeSmallConeInnerRad;
1625 
1626  G4Tubs* bafflet = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
1627  0., 360.*CLHEP::degree);
1628  info.fCurrent = new G4LogicalVolume(bafflet, G4Material::GetMaterial(std::string("TitaniumG5")), volumeName);
1629 
1630  info.fPosition[2] = plInfoM1->fPosition[2] - plInfoM1->fParams[2]/2. - info.fParams[2]/2.;
1631 
1632  }
1633 
1634  if (name == G4String("TargetNoSplitCoolingTubeFirstHelium")) { //
1635 
1636  //Filling the mother volume for the bafflet with helium
1637 
1638  const LBNEVolumePlacementData *plInfoMoth =
1639  Find(name, G4String("TargetNoSplitCoolingTubeFirstMoth"), G4String("Create"));
1640 
1641 
1642  info.fParams[0] = 0.*CLHEP::mm;
1643  info.fParams[1] = plInfoMoth->fParams[1] - fThicknessBafflet;
1644 
1645  info.fParams[2] = plInfoMoth->fParams[2];
1646 
1647  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
1648  0., 360.*CLHEP::degree);
1649  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Helium")), volumeName);
1650 
1651  info.fPosition[2] = 0;
1652 
1653  }
1654 
1655  if (name == G4String("TargetNoSplitSimpleBafflet")) { //
1656  //Creating the bafflet and cutting out the outward flanging part by doing a subtraction
1657 
1658  const LBNEVolumePlacementData *plInfoM0 =
1659  Find(name, G4String("TargetNoSplitCoolingTubeFirstMoth"), G4String("Create"));
1660 
1661  info.fParams.resize(5);
1662 
1663  info.fParams[0] = fSimpleTargetRadius;
1664  info.fParams[1] = fTargetBaffletOutRadius;
1668 
1669  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
1670  0., 360.*CLHEP::degree);
1671  G4Cons* Cone = new G4Cons("Baffletflange", 0, info.fParams[0], 0, plInfoM0->fParams[1] - fThicknessBafflet, info.fParams[4]/2.,
1672  0.*CLHEP::degree, 360.0*CLHEP::degree);
1673 
1674  G4ThreeVector zTrans(0., 0., info.fParams[3]/2.);
1675 
1676  G4SubtractionSolid* subtraction = new G4SubtractionSolid("Tube-Cone", aTube, Cone, 0, zTrans);
1677 
1678  info.fCurrent = new G4LogicalVolume(subtraction, G4Material::GetMaterial(std::string("TitaniumG5")),
1679  volumeName);
1680 
1681  info.fPosition[2] = 0.;
1682  }
1683 
1684  //Defining the outward flanging section of the bafflet
1685 
1686 
1687  if (name == G4String("TargetNoSplitSimpleBaffletFlange")) { //
1688 
1689  const LBNEVolumePlacementData *plInfoM0 =
1690  Find(name, G4String("TargetNoSplitCoolingTubeFirstHelium"), G4String("Create"));
1691 
1692  info.fParams.resize(4);
1693 
1694  info.fParams[0] = fSimpleTargetRadius;
1695  info.fParams[1] = fTargetBaffletOutRadius;
1698 
1699 
1700  G4Cons* Cone2 = new G4Cons("Conical section Helium Cont Tube", info.fParams[0] - fThicknessWall,
1701  info.fParams[0], plInfoM0->fParams[1],
1702  plInfoM0->fParams[1], info.fParams[3]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1703 
1704  info.fCurrent = new G4LogicalVolume(Cone2, G4Material::GetMaterial(std::string("TitaniumG5")), volumeName);
1705 
1707  }
1708 
1709  if (name == G4String("TargetNoSplitBaffletCold")) { //
1710 
1711  //Defining cylindrical cooling tube that delivers the cold helium flow
1712 
1713  const LBNEVolumePlacementData *plInfoM =
1714  Find(name, G4String("TargetNoSplitSimpleBafflet"), G4String("Create"));
1715  const LBNEVolumePlacementData *plInfoM1 =
1716  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1717 
1718  info.fParams[0] = 0;
1721 
1722  G4Torus* Torus = new G4Torus("Torus", info.fParams[0], info.fParams[1], info.fParams[2] ,0., M_PI/2.);
1723 
1724  info.fCurrent = new G4LogicalVolume(Torus, G4Material::GetMaterial(std::string("TitaniumG5")), volumeName);
1725 
1726  //Describing the rotation and translation to connect the curved tube to the bafflet helium containment tube.
1727 
1728  info.fPosition[1] = info.fParams[2];
1729  info.fPosition[2] = plInfoM1->fPosition[2] - plInfoM1->fParams[2]/2. - plInfoM->fParams[2];
1730  info.fRotationIsUnitMatrix = false;
1731  info.fRotation.rotateY(3./2.*M_PI);
1732  info.fRotation.rotateZ(M_PI/2.);
1733 
1734 
1735 
1736  }
1737 
1738  if (name == G4String("TargetNoSplitBaffletColdHe")) { //
1739 
1740 
1741  //Filling the cylindrical cooling tube that delivers the cold helium flow with actual helium
1742 
1743  info.fParams[0] = 0.*CLHEP::mm;
1746 
1747  G4Torus* Torus = new G4Torus("Torus", info.fParams[0], info.fParams[1], info.fParams[2] ,0., M_PI/2.);
1748 
1749  info.fCurrent = new G4LogicalVolume(Torus, G4Material::GetMaterial(std::string("Helium")), volumeName);
1750 
1751  info.fPosition[2] = 0;
1752 
1753  }
1754 
1755  if (name == G4String("TargetNoSplitRingTube")) {
1756 
1757  //Describing the small ring that separates the small conical + cylindrical helium section from the target
1758 
1759  info.fParams[0] = 0.;
1760  info.fParams[1] = fSimpleTargetRadius;
1761 
1762  G4Tubs* RingTube = new G4Tubs("Ring", 0., info.fParams[1] + fThicknessBafflet, fRALTargetRing/2., 0., 360.*CLHEP::deg);
1763 
1765 
1766  info.fCurrent = new G4LogicalVolume(RingTube, G4Material::GetMaterial(std::string("TitaniumG5")),
1767  volumeName);
1768 
1769  std::cerr << "Placing the TitaniumG5 ring between the target and the helium tube. " <<std::endl;
1770 
1771  }
1772 
1773 
1774  if (name == G4String("TargetNoSplitDSSupportConnectionRing")) {
1775 
1776  info.fParams[0] = 0;
1779 
1780  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
1781  0., 360.*CLHEP::degree);
1782 
1783  G4Sphere* Sphere = new G4Sphere("Sphere", 0,
1785  360*CLHEP::degree, 0*CLHEP::degree, 90*CLHEP::degree);
1786 
1787 
1788  G4ThreeVector zTrans(0., 0., - fTargetDSSupportConnRing/2.);
1789 
1790  G4SubtractionSolid* subtraction = new G4SubtractionSolid("Ring-Sphere", aTube, Sphere, 0, zTrans);
1791 
1792  info.fCurrent = new G4LogicalVolume(subtraction, G4Material::GetMaterial(std::string("TitaniumG5")), volumeName);
1793 
1794  const LBNEVolumePlacementData *plInfoM1 =
1795  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1796 
1799  info.fParams[2]/2.;
1800 
1801  }
1802 
1803  if (name == G4String("TargetNoSplitDSSupportAlRing")) {
1804 
1808 
1809  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
1810  0., 360.*CLHEP::degree);
1811 
1812  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Aluminum")), volumeName);
1813 
1814  const LBNEVolumePlacementData *plInfoM1 =
1815  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1816 
1819  fTargetDSSupportConnRing + info.fParams[2]/2.;
1820 
1821  }
1822 
1823 
1824  if (name == G4String("TargetNoSplitDSSupportLargeCones")) {
1825 
1826  info.fParams.resize(10);
1832 
1838 
1839 
1840 
1841  G4Cons* ConeL = new G4Cons("DSSupportLargeCone", info.fParams[5], info.fParams[6], info.fParams[7],
1842  info.fParams[8], info.fParams[9]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1843 
1844 
1845 
1846  G4Cons* ConeS = new G4Cons("DSSupportSmallCone", info.fParams[0], info.fParams[1], info.fParams[2],
1847  info.fParams[3], info.fParams[4]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1848 
1849 
1850  G4ThreeVector zTrans2(0., 0., 27.5*CLHEP::mm/2. + fTargetDSSupportSmallConeLength/2.);
1851  G4UnionSolid* UnionMovedx3 = new G4UnionSolid("DSSupportLConeRings", ConeL, ConeS, 0, zTrans2);
1852 
1853 
1854 
1855 
1856 
1857  const LBNEVolumePlacementData *plInfoM1 =
1858  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1859 
1863 
1864 
1865 
1866  info.fCurrent = new G4LogicalVolume(UnionMovedx3, G4Material::GetMaterial(std::string("TitaniumG5")), volumeName);
1867 
1868  }
1869 
1870  /* if (name == G4String("TargetNoSplitDSSupportRingCone")) {
1871 
1872  //Thicknesses were given vertically, but there were angles that had to be taken into account
1873  info.fParams.resize(5);
1874 
1875  info.fParams[0] = fTargetDSSupportLargeConeLargeOuterRad;// + 0.2*CLHEP::mm;
1876  info.fParams[1] = info.fParams[0] + 2.0219*CLHEP::mm;
1877  info.fParams[2] = 38.7298*CLHEP::mm - 2.0219*CLHEP::mm;//38.775*CLHEP::mm - 2.0219*CLHEP::mm;// + 0.2*CLHEP::mm;
1878  info.fParams[3] = info.fParams[2] + 2.0219*CLHEP::mm;
1879  info.fParams[4] = 10.*CLHEP::mm;
1880 
1881  G4Cons* ConeExt = new G4Cons("DSSupportLargeConeExt", info.fParams[0], info.fParams[1]
1882  , info.fParams[2], info.fParams[3], info.fParams[4]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1883 
1884  const LBNEVolumePlacementData *plInfoM1 =
1885  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1886 
1887  info.fPosition[2] = plInfoM1->fPosition[2] - plInfoM1->fParams[2]/2. + fTargetOutHeContTubeStraightLength + fTargetOutHeContTubeTaperedLength +
1888  fTargetHeContTubeSmallConeLength + fTargetHeContTubeSmallCylLength + fRALTargetRing +
1889  fTargetDSSupportConnRing + fTargetDSSupportAlRingThickness + info.fParams[4]/2. -
1890  fTargetDSSupportLargeConeLength;
1891 
1892  info.fCurrent = new G4LogicalVolume(ConeExt, G4Material::GetMaterial(std::string("TitaniumG5")), volumeName);
1893 
1894  } */
1895 
1896  if (name == G4String("TargetNoSplitDSSupportHeLargeCone")) {
1897 
1898  //Thicknesses were given vertically, but there were angles that had to be taken into account
1899 
1900 
1901  info.fParams.resize(5);
1902  info.fParams[0] = 37.72*CLHEP::mm + 0.63850*CLHEP::mm;
1903  info.fParams[1] = info.fParams[0] + 1.1705*CLHEP::mm;
1904  info.fParams[2] = 28.5293*CLHEP::mm;
1905  info.fParams[3] = info.fParams[2] + 1.1705*CLHEP::mm;
1906  info.fParams[4] = 28.1*CLHEP::mm;
1907 
1908 
1909  G4Cons* ConeL = new G4Cons("DSSupportLargeConeHe", info.fParams[0], info.fParams[1], info.fParams[2],
1910  info.fParams[3], info.fParams[4]/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1911 
1912 
1913  G4Cons* ConeS = new G4Cons("DSSupportSmallConeHe", fTargetDSSupportSmallConeSmallInnerRad + 0.6092559*CLHEP::mm + 0.105796188*CLHEP::mm,
1914  fTargetDSSupportSmallConeSmallInnerRad + 0.6092559*CLHEP::mm + 0.105796188*CLHEP::mm + 3.960163786*CLHEP::mm, 26.6*CLHEP::mm + 0.6092559*CLHEP::mm,
1915  26.6*CLHEP::mm + 0.6092559*CLHEP::mm + 3.960163*CLHEP::mm, 5.3*CLHEP::mm/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
1916 
1917  G4ThreeVector zTrans(0., 0., 5.3*CLHEP::mm/2. + info.fParams[4]/2.);
1918 
1919  G4UnionSolid* RingplusConeHe = new G4UnionSolid("DSSupportLConeRingHe", ConeL, ConeS, 0, zTrans);
1920 
1921  info.fPosition[2] = 0.6*CLHEP::mm;
1922  info.fCurrent = new G4LogicalVolume(RingplusConeHe, G4Material::GetMaterial(std::string("Helium")), volumeName);
1923 
1924 
1925 
1926  }
1927 
1928  if (name == G4String("TargetNoSplitDSSupportInnerRing")) {
1929 
1930  const LBNEVolumePlacementData *plInfoM1 =
1931  Find(name, G4String("Horn1PolyM1"), G4String("Create"));
1932 
1933  const LBNEVolumePlacementData *plInfoM2 =
1934  Find(name, G4String("TargetNoSplitDSSupportLargeCones"), G4String("Create"));
1935 
1936  info.fParams.resize(4);
1937  info.fParams[0] = 2*CLHEP::mm;
1938  info.fParams[1] = 3*CLHEP::mm;
1939  info.fParams[2] = 677*CLHEP::mm - plInfoM2->fParams[3];
1940  info.fParams[3] = 677*CLHEP::mm - plInfoM2->fParams[6] - 2.0219*CLHEP::mm;
1941 
1942  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
1943  0., 360.*CLHEP::degree);
1944 
1945  G4RotationMatrix* xRot = new G4RotationMatrix;
1946  xRot->rotateX(M_PI/9.*rad);
1947  xRot->rotateY(+ M_PI/75.*rad);
1948 
1949  G4RotationMatrix* xRot2 = new G4RotationMatrix;
1950  xRot2->rotateX(2*M_PI/3.*rad);
1951  xRot2->rotateY(M_PI - 1/200.*M_PI);
1952 
1953  G4RotationMatrix* xRot3 = new G4RotationMatrix;
1954  xRot3->rotateX(14*M_PI/18.*rad);
1955  xRot3->rotateY(M_PI/75.*rad - M_PI/100.*rad);
1956 
1957  G4RotationMatrix* xRot4 = new G4RotationMatrix;
1958  xRot4->rotateX(4*M_PI/3.*rad);
1959  xRot4->rotateY(M_PI - 1/200.*M_PI);
1960 
1961  G4RotationMatrix* xRot5 = new G4RotationMatrix;
1962  xRot5->rotateX(26*M_PI/18.*rad);
1963  xRot5->rotateY(M_PI/75.*rad - M_PI/100.*rad);
1964 
1965  G4ThreeVector zTrans(std::sin(M_PI/75.*rad)*info.fParams[2]/2.,
1966  std::sin(M_PI/9.)*(677*CLHEP::mm/2. + plInfoM2->fParams[6] + 2.0219*CLHEP::mm),
1967  -(1-std::cos(M_PI/9.))*(677*CLHEP::mm/2. + plInfoM2->fParams[6] + 2.0219*CLHEP::mm));
1968 
1969  G4ThreeVector zTrans2(1*CLHEP::mm + std::sin(M_PI/200.*rad)*info.fParams[2]/2.,
1970  std::sin(M_PI/3.)*(info.fParams[2]/2.+ plInfoM2->fParams[3]),
1971  -(info.fParams[3]/2. + plInfoM2->fParams[6]) - std::cos(M_PI/3.)*(info.fParams[2]/2. + plInfoM2->fParams[3]));
1972 
1973  G4ThreeVector zTrans3(std::sin(M_PI/75.*rad + M_PI/100.*rad)*info.fParams[2]/2.,
1974  std::sin(2*M_PI/9.)*(info.fParams[3]/2.+ plInfoM2->fParams[6]),
1975  -(info.fParams[3]/2. + plInfoM2->fParams[6]) - (std::cos(2*M_PI/9.))*(info.fParams[3]/2. + plInfoM2->fParams[6]));
1976 
1977  G4ThreeVector zTrans4(1*CLHEP::mm + std::sin(M_PI/200.*rad)*info.fParams[2]/2.,
1978  -std::sin(M_PI/3.)*(info.fParams[2]/2.+ plInfoM2->fParams[3]),
1979  -(info.fParams[3]/2. + plInfoM2->fParams[6]) - std::cos(M_PI/3.)*(info.fParams[2]/2. + plInfoM2->fParams[3]));
1980 
1981  G4ThreeVector zTrans5(std::sin(M_PI/75.*rad + M_PI/100.*rad)*info.fParams[2]/2.,
1982  - std::sin(4*M_PI/9.)*(info.fParams[3]/2. + plInfoM2->fParams[6]),
1983  -(info.fParams[3]/2. + plInfoM2->fParams[6]) - (std::cos(4*M_PI/9.))*(info.fParams[3]/2. + plInfoM2->fParams[6]));
1984 
1985  G4UnionSolid* Spikes = new G4UnionSolid("DSSupportSpikes", aTube, aTube, xRot2, zTrans2);
1986 
1987  G4UnionSolid* Spikes2 = new G4UnionSolid("DSSupportSpikes", Spikes, aTube, xRot4, zTrans4);
1988 
1989  G4UnionSolid* Spikes3 = new G4UnionSolid("DSSupportSpikes", Spikes2, aTube, xRot, zTrans);
1990 
1991  G4UnionSolid* Spikes4 = new G4UnionSolid("DSSupportSpikes", Spikes3, aTube, xRot3, zTrans3);
1992 
1993  G4UnionSolid* Spikes5 = new G4UnionSolid("DSSupportSpikes", Spikes4, aTube, xRot5, zTrans5);
1994 
1995 
1996  G4Tubs* OUTERRING = new G4Tubs(volumeName, 677*CLHEP::mm, 697*CLHEP::mm, 20*CLHEP::mm/2.,
1997  0., 360.*CLHEP::degree);
1998 
1999  G4RotationMatrix* xRot6 = new G4RotationMatrix;
2000  xRot6->rotateY(- 3./2.*M_PI + 1/200.*M_PI);
2001 
2002  G4ThreeVector zTrans6(10*CLHEP::mm, 0., -(plInfoM2->fParams[6] + info.fParams[2]/2 - 5*CLHEP::mm));
2003 
2004  G4UnionSolid* Spikes6 = new G4UnionSolid("DSSupportSpikes", Spikes5, OUTERRING, xRot6, zTrans6);
2005 
2006 
2007 
2008  G4ThreeVector zTrans7(- fTargetDSSupportAlRingThickness + fTargetDSSupportLargeConeLength, 0., -(plInfoM2->fParams[6] + info.fParams[2]/2 - 5*CLHEP::mm));
2009 
2010 
2011  G4Cons* ConeExt = new G4Cons("DSSupportLargeConeExt", fTargetDSSupportLargeConeLargeOuterRad, fTargetDSSupportLargeConeLargeOuterRad+2.0219*CLHEP::mm
2012  , 38.7298*CLHEP::mm - 2.0219*CLHEP::mm, 38.7298*CLHEP::mm, 10.*CLHEP::mm/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
2013 
2014 
2015  G4Cons* ConeExt2sub = new G4Cons("DSSupportLargeConeExt", 0., fTargetDSSupportLargeConeLargeOuterRad, 0., 38.7298*CLHEP::mm, 10.*CLHEP::mm/2., 0.*CLHEP::degree, 360.0*CLHEP::degree);
2016 
2017 
2018 
2019  G4UnionSolid* Spikes7 = new G4UnionSolid("DSSupportSpikes", Spikes6, ConeExt, xRot6, zTrans7);
2020 
2021  G4SubtractionSolid* subtraction = new G4SubtractionSolid("Ring-Sphere", Spikes7, ConeExt2sub, xRot6, zTrans7);
2022 
2023 
2024 
2025  info.fCurrent = new G4LogicalVolume(subtraction, G4Material::GetMaterial(std::string("TitaniumG5")), volumeName);
2026 
2027 
2028 
2029 
2033  info.fPosition[0] = plInfoM2->fParams[6] + info.fParams[2]/2 - 5*CLHEP::mm;
2034 
2035  info.fRotationIsUnitMatrix = false;
2036  info.fRotation.rotateY(3./2.*M_PI - 1/200.*M_PI);
2037 
2038  }
2039  }
2040  } // Downstream of the flange of the target canister.
2041  // Upstream Stuff
2042  }
2043  }
2044 
2045  //In case we want to use the RAL target, the data card /LBNE/det/fUseRALTGTv1 will implement the following chain instead of the one above
2046 
2047  //
2048  // October November 2016: rename a few volume to make it clearer.
2049  //
2050  if (name == G4String("TargetNormalCoolingTube")) { //
2051  info.fParams[0] = 0.;
2052  info.fParams[1] = fTargetCTubeOuterRadius;
2054  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2055  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Titanium")), volumeName);
2056  info.fPosition[1] = fTargetFinHeight - fTargetCTubeOuterRadius + 0.005*CLHEP::mm; // No longer in use..
2057  }
2058 
2059  if (name == G4String("TargetNormalCoolingTubeWater")) { //
2060  info.fParams[0] = 0.;
2061  info.fParams[1] = fTargetCTubeInnerRadius;
2063  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2064  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
2065  }
2066  if (name == G4String("TargetWWingsCoolingTube")) { //
2067  info.fParams[0] = 0.;
2068  info.fParams[1] = fTargetCTubeOuterRadius;
2069  info.fParams[2] = fTargetFinLength - 0.150*CLHEP::mm;
2070  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2071  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Titanium")), volumeName);
2072  info.fPosition[1] = fTargetFinHeight - fTargetCTubeOuterRadius + 0.005*CLHEP::mm; // possibly tweak for the margin...
2073  }
2074  if (name == G4String("TargetWWingsCoolingTubeWater")) { //
2075  info.fParams[0] = 0.;
2076  info.fParams[1] = fTargetCTubeInnerRadius;
2077  info.fParams[2] = fTargetFinLength - 0.150*CLHEP::mm;
2078  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2079  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
2080  }
2081 
2082 //
2083 // December 2013 : Reverting back to a much simple target.
2084 
2085  if (name == G4String("TargetSimpleUpstrTube")) { //
2086  info.fParams[0] = 0.;
2087  info.fParams[1] = fSimpleTargetRadius;
2088  info.fParams[2] = fTargetSLength; // To be recommissioned, August 28 2014.
2089  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2090  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Target")), volumeName);
2091  // at (0.,0., 0.)
2092  }
2093  if (name == G4String("TargetSimpleUpstrBox")) { //
2094  info.fParams[0] = fSimpleTargetWidth;
2095  info.fParams[1] = fSimpleTargetHeight;
2096  info.fParams[2] = fTargetSLength;
2097  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2.);
2098  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
2099  // at (0.,0., 0.)
2100  }
2101 
2102  if (name == G4String("TargetSimpleDownstrTube")) { // Obsolete..
2103  info.fParams[0] = 0.;
2104  info.fParams[1] = fSimpleTargetRadius;
2106  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2107  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Target")), volumeName);
2108  // at (0.,0., 0.)
2109  }
2110  if (name == G4String("TargetSimpleDownstrBox")) { //
2111  info.fParams[0] = fSimpleTargetWidth;
2112  info.fParams[1] = fSimpleTargetHeight;
2114  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2.);
2115  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
2116  // at (0.,0., 0.)
2117  }
2118 
2119 //Quynh added for multisphere.
2120  if (name == G4String("TargetMultiSphere")) {
2121  info.fParams[0] = 0.;
2122  info.fParams[1] = fMultiSphereTargetRadius;
2123  info.fParams[2] = 0. ;
2124  G4Sphere* aSphere = new G4Sphere(volumeName,
2125  info.fParams[0],//inner radius = 0
2126  info.fParams[1],//outer radius
2127  0.,360.*CLHEP::degree,0.,180.*CLHEP::degree); //Phi and Theta angles
2128  info.fCurrent = new G4LogicalVolume(aSphere, G4Material::GetMaterial(std::string("Target")), volumeName);
2129 
2130  }
2131  //
2132  // Bits and pieces for the target itself.
2133  //
2134  if (name == G4String("TargetFinVert")) { //
2135  info.fParams[0] = fTargetFinWidth;
2136  info.fParams[1] = fTargetFinHeight - 2.0*fTargetCTubeOuterRadius - 0.05*CLHEP::mm;
2137  info.fParams[2] = fTargetFinLength ;
2138  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2139  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
2140  info.fTypeName = G4String("Box");
2141  }
2142  // October-November 2016: obsolote volume.
2143  if (name == G4String("TargetFinVertExtra")) { // Extra pieces to be place left and right of the center
2144  // of the cooling tube. This extends the target transversely
2145  if (fTargetFinExtraWidth < 0.) {
2146  std::ostringstream mStrStr;
2147  mStrStr << " Volume named " << name << " can not be handled, negative dimension ";
2148  G4String mStr(mStrStr.str());
2149  G4Exception("LBNEVolumePlacements::Create", " ", FatalErrorInArgument, mStr.c_str());
2150  }
2151  info.fParams[0] = fTargetFinExtraWidth;
2152  info.fParams[1] = fTargetFinHeight - 0.05*CLHEP::mm;
2153  info.fParams[2] = fTargetFinLength ;
2154  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2155  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
2156  info.fTypeName = G4String("Box");
2157  }
2158  if (name == G4String("TargetFinVertHeliumSide")) { // The fin container is made of graphite, or whatever target material
2159  // if so, we must replace some of back with helium, if the nominal target Fin width is smaller
2160  // then the cooling tube radius, which sets the size of the container.
2161  const double widthHe = 2.0*fTargetCTubeOuterRadius - fTargetFinWidthRequired - 0.005*CLHEP::mm;
2162  if (widthHe < 0.) {
2163  std::ostringstream mStrStr;
2164  mStrStr << " Volume named " << name << " can not be handled, negative dimension ";
2165 // G4String mStr(mStrStr.str());
2166 // G4Exception("LBNEVolumePlacements::Create", " ", FatalErrorInArgument, mStr.c_str());
2167 // July 2017, can not run the CDR case due to this error.. False error, no need for this complication.
2168 // I presume
2169  return 0;
2170  }
2171  info.fParams[0] = widthHe;
2172  info.fParams[1] = fTargetFinHeight - 0.07*CLHEP::mm;
2173  info.fParams[2] = fTargetFinLength ;
2174  // exclude the round corners.. They will already filled with Helium This is getting out of hand!..
2175 
2176  if (fUseRoundedTargetFins) {
2177  info.fParams[2] -= 2.0*fTargetFinWidthRequired - 0.001*CLHEP::mm;
2178  }
2179  std::cerr << " Creating TargetFinVertHeliumSide, width .." << widthHe
2180  << " heigth " << info.fParams[1] << std::endl;
2181  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2182  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
2183  info.fTypeName = G4String("Box");
2184  }
2185  if (name.find("TargetFinVertHeliumRounded") != std::string::npos) { // We carve out the rounded edges
2186  // We create 4 distinct volumes, because their orientation differ.
2187  // all of them carved out the same box
2188  info.fParams[0] = fTargetFinContainerWidth - 0.005*CLHEP::mm;
2189  info.fParams[1] = fTargetFinWidthRequired;
2190  info.fParams[2] = fTargetFinHeight - 0.010*CLHEP::mm; // Along z. We'll rotate once the volume subtraction is done.
2191  std::string aCuboidName(name); aCuboidName += std::string("_Cuboid");
2192  // Not really a cuboid, only if 12 mm target width
2193  G4Box* aCuboid = new G4Box(aCuboidName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2194  info.fParams.resize(10);
2195  info.fParams[3] = 0.;
2196  info.fParams[4] = fTargetFinWidthRequired;
2197  info.fParams[5] = fTargetFinHeight - 0.0076*CLHEP::mm;
2198  if (name == G4String("TargetFinVertHeliumRoundedDownstrLeft")) {
2199  info.fParams[6] = 90.*CLHEP::degree;
2200  info.fParams[7] = 180.*CLHEP::degree;
2201  info.fParams[8] = info.fParams[0]/2.;
2202  info.fParams[9] = -info.fParams[1]/2.;
2203  } else if (name == G4String("TargetFinVertHeliumRoundedDownstrRight")) {
2204  info.fParams[6] = 0.*CLHEP::degree;
2205  info.fParams[7] = 90.*CLHEP::degree;
2206  info.fParams[8] = -info.fParams[0]/2.;
2207  info.fParams[9] = -info.fParams[1]/2.;
2208  } else if (name == G4String("TargetFinVertHeliumRoundedUpstrRight")) {
2209  info.fParams[6] = 270.*CLHEP::degree;
2210  info.fParams[7] = 360.*CLHEP::degree;
2211  info.fParams[8] = -info.fParams[0]/2.;
2212  info.fParams[9] = info.fParams[1]/2.;
2213  } else if (name == G4String("TargetFinVertHeliumRoundedUpstrLeft")) {
2214  info.fParams[6] = 180.*CLHEP::degree;
2215  info.fParams[7] = 270.*CLHEP::degree;
2216  info.fParams[8] = info.fParams[0]/2.;
2217  info.fParams[9] = info.fParams[1]/2.;
2218  }
2219  std::string aRodName(name); aRodName += std::string("_Rod");
2220  G4Tubs* aRod = new G4Tubs(aRodName, info.fParams[3], info.fParams[4], info.fParams[5]/2., info.fParams[6], info.fParams[7]);
2221  G4ThreeVector xyTrans(info.fParams[8], info.fParams[9], 0.);
2222  G4RotationMatrix Ra;
2223  G4Transform3D transform(Ra, xyTrans);
2224  G4SubtractionSolid* subtraction = new G4SubtractionSolid("Box-Cylinder", aCuboid, aRod, transform);
2225  info.fCurrent = new G4LogicalVolume(subtraction, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
2226  info.fTypeName = G4String("Subtration");
2227  std::cerr << " Target Rounded Corners, defined for name " << name
2228  << " Params ";
2229  for (int k=0; k != 10; k++) std::cerr << " " << info.fParams[k];
2230  std::cerr << std::endl;
2231  }
2232 
2233  // Oct. November 2016
2234  if (name.find("TargetFinVertTargetCutV2") != std::string::npos) { // We carve out the Cut edges
2235  // for the cooling tubes.
2236  // We create 4 distinct volumes, because the cut for pipe. Unlike above, no need to rotate.
2237  // but volume subtraction is needed for the cooling pipe.
2238  // all of them carved out the same box
2239  info.fParams[0] = fTargetFinWidth;
2240  info.fParams[1] = fTargetFinHeight;
2241  info.fParams[2] = fTargetFinLength - 0.010*CLHEP::mm;
2242  std::string aCuboidName(name); aCuboidName += std::string("_Cuboid");
2243  // Not really a cuboid, only if 12 mm target width
2244  G4Box* aCuboid = new G4Box(aCuboidName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2245  info.fParams.resize(8);
2246  info.fParams[3] = 0.;
2247  info.fParams[4] = fTargetCTubeOuterRadius + 0.075*CLHEP::mm;
2248  const double cTubeShift = info.fParams[4] - 0.5*fTargetFinWidth + 0.500*CLHEP::mm;
2249  info.fParams[5] = fTargetFinLength - 0.010*CLHEP::mm;
2250  if (name == G4String("TargetFinVertTargetCutV2UpLeft")) {
2251  info.fParams[6] = -cTubeShift;
2252  info.fParams[7] = +info.fParams[1]/2.;
2253  // Now milling the graphite
2254  } else if (name == G4String("TargetFinVertTargetCutV2UpRight")) {
2255  info.fParams[6] = +cTubeShift ;
2256  info.fParams[7] = +info.fParams[1]/2.;
2257  } else if (name == G4String("TargetFinVertTargetCutV2DwnLeft")) {
2258  info.fParams[6] = -cTubeShift;
2259  info.fParams[7] = -info.fParams[1]/2.;
2260  } else if (name == G4String("TargetFinVertTargetCutV2DwnRight")) {
2261  info.fParams[6] = cTubeShift;
2262  info.fParams[7] = -info.fParams[1]/2.;
2263  }
2264  std::string aRodName(name); aRodName += std::string("_Rod");
2265  G4Tubs* aRod = new G4Tubs(aRodName, info.fParams[3], info.fParams[4], info.fParams[5]/2., 0., 360.*CLHEP::degree);
2266  G4ThreeVector xyTrans(info.fParams[6], info.fParams[7], 0.);
2267  G4RotationMatrix Ra;
2268  G4Transform3D transform(Ra, xyTrans);
2269  G4SubtractionSolid* subtraction = new G4SubtractionSolid("Box-Cylinder", aCuboid, aRod, transform);
2270  info.fCurrent = new G4LogicalVolume(subtraction, G4Material::GetMaterial(std::string("Target")), volumeName);
2271  info.fTypeName = G4String("Subtration");
2272  std::cerr << " Target Graphite, defined for name " << name
2273  << " Params ";
2274  for (int k=0; k != 8; k++) std::cerr << " " << info.fParams[k];
2275  std::cerr << std::endl;
2276  }
2277 
2278  if (name.find("TargetWWingCylinder") != std::string::npos) { // These are the upstream fins.
2279  // see also parameters. fTargetNumFinsWithWings
2280  // used in LBNEVolumePlacements::PlaceFinalUpstrTarget1p2MW, Conceptual design for HornA.
2281  //
2282  info.fParams[0] = 0.;
2283  info.fParams[1] = fTargetFinWWingRadius;
2284  info.fParams[2] = fTargetFinLength - 0.100*CLHEP::mm; // they won't be rounded, so make them a bit shorter.
2285  // P.L., minor input to the desgin, in absence of real drawing.
2286  info.fParams.resize(9);
2287  info.fParams[3] = 0.;
2288  info.fParams[4] = fTargetCTubeOuterRadius + 0.150*CLHEP::mm;
2289  const double cTubeShift = fTargetCTubeOuterRadius + 0.5*CLHEP::mm + 0.025*CLHEP::mm; // Per phone discussion with
2290  // Cory C., November 4 2016
2291  info.fParams[5] = fTargetFinLength + 0.300*CLHEP::mm; //length can be extended..
2292  if (name == G4String("TargetWWingCylinderUpLeft")) {
2293  info.fParams[6] = -cTubeShift;
2294  info.fParams[7] = +info.fParams[1] - 0.025*CLHEP::mm;
2295  info.fParams[8] = M_PI/2.;
2296  // Now milling the graphite
2297  } else if (name == G4String("TargetWWingCylinderUpRight")) {
2298  info.fParams[6] = +cTubeShift ;
2299  info.fParams[7] = +info.fParams[1] - 0.025*CLHEP::mm;
2300  info.fParams[8] = 0.;
2301  } else if (name == G4String("TargetWWingCylinderDwnLeft")) {
2302  info.fParams[6] = -cTubeShift;
2303  info.fParams[7] = -info.fParams[1] + 0.025*CLHEP::mm;
2304  info.fParams[8] = M_PI;
2305  } else if (name == G4String("TargetWWingCylinderDwnRight")) {
2306  info.fParams[6] = cTubeShift;
2307  info.fParams[7] = -info.fParams[1] + 0.025*CLHEP::mm;
2308  info.fParams[8] = 3.0*M_PI/2.;
2309  }
2310  G4Tubs* aTub = new G4Tubs(volumeName, info.fParams[0]/2, info.fParams[1],
2311  info.fParams[2]/2., info.fParams[8], 90.*CLHEP::degree);
2312  std::string aRodName(name); aRodName += std::string("_Rod");
2313  G4Tubs* aRod = new G4Tubs(aRodName, info.fParams[3], info.fParams[4],
2314  info.fParams[5]/2., 0., 360.*CLHEP::degree);
2315  G4ThreeVector xyTrans(info.fParams[6], info.fParams[7], 0.);
2316  G4RotationMatrix Ra;
2317  G4Transform3D transform(Ra, xyTrans);
2318  G4SubtractionSolid* subtraction = new G4SubtractionSolid("Cylinder-Cylinder", aTub, aRod, transform);
2319  info.fCurrent = new G4LogicalVolume(subtraction, G4Material::GetMaterial(std::string("Target")), volumeName);
2320  info.fTypeName = G4String("Subtration");
2321  std::cerr << " Target Graphite, defined for name " << name
2322  << " Params ";
2323  for (int k=0; k != 9; k++) std::cerr << " " << info.fParams[k];
2324  std::cerr << std::endl;
2325  }
2326 
2327  if (name == G4String("TargetFinVertLastHeliumSide")) { // The fin container might be made of graphite.
2328  // if so, we must replace some of back with helium, if the nominal target Fin width is smaller
2329  // then the cooling tube radius, which sets the size of the container.
2330  const double widthHe = 2.0*fTargetCTubeOuterRadius - fTargetFinWidth - 0.005*CLHEP::mm;
2331  if (widthHe < 0.) {
2332  std::ostringstream mStrStr;
2333  mStrStr << " Volume named " << name << " can not be handled, negative dimension ";
2334  G4String mStr(mStrStr.str());
2335  G4Exception("LBNEVolumePlacements::Create", " ", FatalErrorInArgument, mStr.c_str());
2336  }
2337  info.fParams[0] = widthHe;
2338  info.fParams[1] = fTargetFinHeight - 0.07*CLHEP::mm;
2339  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.02*CLHEP::mm;
2340  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2341  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("HeliumTarget")), volumeName);
2342  info.fTypeName = G4String("Box");
2343  }
2344 
2345  if (name == G4String("TargetFinHorizontal")) { // only one of those, fixed size
2346  info.fParams[0] = 62.0*CLHEP::mm;
2347  info.fParams[1] = fTargetFinWidth;
2348  info.fParams[2] = fTargetFinLength ;
2349  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2350  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
2351  info.fPosition[0] = -info.fParams[0]/2. + 10.0*CLHEP::mm; // Russian drawing 7589-00-00
2352  const LBNEVolumePlacementData *plInfo = Find(name, G4String("TargetUpstrM0"), G4String("Create"));
2353  info.fPosition[0] = -info.fParams[0]/2.0 + 10.*CLHEP::mm;
2354  info.fPosition[1] = 0.;
2355  info.fPosition[2] = -1.0*plInfo->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
2357  - 100.0*CLHEP::mm; // Russian drawing 7589-00-00
2358  info.fTypeName = G4String("Box");
2359  }
2360 
2361  if (name == G4String("TargetFinVertUpstrLast")) { //
2362  info.fParams[0] = fTargetFinWidth;
2363  info.fParams[1] = fTargetFinHeight - 2.0*fTargetCTubeOuterRadius - 0.1*CLHEP::mm;
2364  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.02*CLHEP::mm; // 20 micron safety.
2365  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2366  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
2367  info.fTypeName = G4String("Box");
2368  // despite being a single copy, do the placement in a separate method.
2369  }
2370 
2371  if (name == G4String("TargetFinVertExtraLast")) { // Extra pieces to be place left and right of the center
2372  // of the cooling tube. This extends the target transversely
2373  if (fTargetFinExtraWidth < 0.) {
2374  std::ostringstream mStrStr;
2375  mStrStr << " Volume named " << name << " can not be handled, negative dimension ";
2376  G4String mStr(mStrStr.str());
2377  G4Exception("LBNEVolumePlacements::Create", " ", FatalErrorInArgument, mStr.c_str());
2378  }
2379  info.fParams[0] = fTargetFinExtraWidth;
2380  info.fParams[1] = fTargetFinHeight - 2.0*fTargetCTubeOuterRadius - 0.05*CLHEP::mm;
2381  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.02*CLHEP::mm; // 20 micron safety.;
2382  G4Box* aBox = new G4Box(volumeName, info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2383  info.fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial(std::string("Target")), volumeName);
2384  info.fTypeName = G4String("Box");
2385  }
2386 
2387  // Adding 4 new small volumes to include the bit of graphite locate on each of the 4 corner
2388  // Oct. 29 2013:
2389  // Adding them as well for the last target segment, of the upstream section which has a different length.
2390  // Perhaps an overzealous choice: there will also be 4 more such volumes for the first
2391  // target segments of the downstream part of the target.
2392  if (name.find("TargetFinVertCorner") != std::string::npos) { //
2393  if (fUse1p2MW) {
2394 // this->declareTargetFinVertCorners(info); // simply to avoid too much code in this method. See LBNEVolumePlacementsAdd.cc
2395 // Obsolete..
2396  } else {
2397  info.fParams.resize(7);
2398  info.fParams[0] = fTargetFinContainerWidth/2. - 0.025*CLHEP::mm;
2399  info.fParams[1] = fTargetCTubeOuterRadius - 0.025*CLHEP::mm;
2400  info.fParams[2] = fTargetFinLength ;
2401  info.fParams[3] = 0.;
2402  info.fParams[4] = fTargetCTubeOuterRadius + 0.250*CLHEP::mm;
2403  info.fParams[5] = fTargetFinLength ;
2404  if (name.find("TargetFinVertCornerUpstrLast") != std::string::npos) {
2405  info.fParams[2] = fTargetFinLengthSplitUpstr - 0.02*CLHEP::mm;
2406  info.fParams[5] = fTargetFinLengthSplitUpstr - 0.02*CLHEP::mm;
2407  }
2408  if (name.find("TargetFinVertCornerDownstrFirst") != std::string::npos) {
2409  info.fParams[2] = fTargetFinLengthSplitDwnstr - 0.02*CLHEP::mm;
2410  info.fParams[5] = fTargetFinLengthSplitDwnstr - 0.02*CLHEP::mm;
2411  }
2412  G4Box* aBox = new G4Box(volumeName+G4String("Box"),
2413  info.fParams[0]/2, info.fParams[1]/2, info.fParams[2]/2.);
2414 
2415  G4Tubs* aTubs = new G4Tubs(volumeName+G4String("Tube"),
2416  info.fParams[3], info.fParams[4], info.fParams[5]/2., 0., 360.0*CLHEP::degree);
2417  G4ThreeVector trans(0., 0., 0.);
2418  if (name.find("UpLeft") != std::string::npos) { //
2419  trans[0] = fTargetFinContainerWidth/4.; trans[1] = fTargetCTubeOuterRadius/2.;
2420  } else if (name.find("UpRight") != std::string::npos) {
2421  trans[0] = -fTargetFinContainerWidth/4.; trans[1] = fTargetCTubeOuterRadius/2.;
2422  } else if (name.find("DwnLeft") != std::string::npos) {
2423  trans[0] = fTargetFinContainerWidth/4.; trans[1] = -fTargetCTubeOuterRadius/2.;
2424  } else if (name.find("DwnRight") != std::string::npos) {
2425  trans[0] = -fTargetFinContainerWidth/4.; trans[1] = -fTargetCTubeOuterRadius/2.;
2426  }
2427  G4RotationMatrix unitMatrix;
2428  G4Transform3D transform(unitMatrix, trans);
2429  G4SubtractionSolid *aRoundCorner = new G4SubtractionSolid(volumeName, aBox, aTubs, transform);
2430  info.fCurrent = new G4LogicalVolume(aRoundCorner, G4Material::GetMaterial(std::string("Target")), volumeName);
2431  info.fTypeName = G4String("G4SubtractionSolid");
2432  }
2433  }
2434 
2435  if (name == G4String("TargetAlignmentRingRight")) { //
2436  info.fParams.resize(5);
2439  info.fParams[2] = fTargetAlignRingThick;
2440  info.fParams[3] = M_PI/2. + fTargetAlignRingCutAngle ;
2441  info.fParams[4] = M_PI - 2.0*fTargetAlignRingCutAngle ;
2442  G4Tubs* aTubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
2443  info.fParams[3], info.fParams[4] );
2444  info.fCurrent =
2445  new G4LogicalVolume(aTubs, G4Material::GetMaterial(fTargetAlignRingMaterial), volumeName);
2446 
2447 // std::cerr << " Created TargetAlignmentRingRight, Params " ;
2448 // for (size_t k=0; k!=5; k++) std::cerr << " " << info.fParams[k] << " / ";
2449 // std::cerr << " dphi " << aTubs->GetDeltaPhiAngle();
2450 // std::cerr << std::endl;
2451  // Multiple copies..
2452 
2453  }
2454 
2455  if (name == G4String("TargetAlignmentRingLeft")) { //
2456  info.fParams.resize(5);
2459  info.fParams[2] = fTargetAlignRingThick;
2460  info.fParams[3] = -M_PI/2. + fTargetAlignRingCutAngle + 2.0*M_PI;
2461  info.fParams[4] = M_PI - 2.0*fTargetAlignRingCutAngle ;
2462  G4Tubs* aTubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
2463  info.fParams[3], info.fParams[4] );
2464  info.fCurrent =
2465  new G4LogicalVolume(aTubs, G4Material::GetMaterial(fTargetAlignRingMaterial), volumeName);
2466  // Multiple copies..
2467 // std::cerr << " Created TargetAlignmentRingLeft, Params " ;
2468 // for (size_t k=0; k!=5; k++) std::cerr << " " << info.fParams[k] << " / ";
2469 // std::cerr << " dphi " << aTubs->GetDeltaPhiAngle();
2470 // std::cerr << std::endl;
2471 
2472  }
2473 
2474  // Things that are physically part of Horn1, but placed in at the dowstream end of the target volume
2475  // These volumes are surrounding the target.
2476  if (name == G4String("UpstrHorn1TransInnerOuterCont")) { // Approximate!...
2477  info.fParams[0] = fTargetHorn1InnerRadsDownstr[0] - 0.2*CLHEP::mm;
2478  info.fParams[1] = fTargetHorn1InnerRadsDownstr[4] + fTargetHorn1TransThick[4] + 1.*CLHEP::mm;
2479  info.fParams[2] = fTargetHorn1Lengths[0] + fTargetHorn1Lengths[1] + fTargetHorn1Lengths[2] + 0.05*CLHEP::mm;; // few mm safety...
2480  G4Tubs* aTubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
2481  0., 360.0*CLHEP::degree);
2482  info.fCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(std::string("Air")), volumeName);
2483  // Pick volume Upstream TargetAssembly.
2484  const LBNEVolumePlacementData *plInfo = Find(name, G4String("Horn1PolyM1"), G4String("Create"));
2485  // Correction for Pseudo Nova: Shifted by the extra space we now have between the downstream end of the target.
2486  // The mother volume for this container volume will be Horn1Hall, and it will be placed a bit upstream
2487  // of the Horn1TopLevelUpstr
2488  double lHorn1Real = -10000.0*CLHEP::m;
2490  if (*il > lHorn1Real ) lHorn1Real = *il;
2491  info.fPosition[2] = -lHorn1Real/2. + info.fParams[2]/2;
2492  std::cerr << " Setting position for UpstrHorn1TransInnerOuterCont, length " << info.fParams[2]
2493  << " length mother " << plInfo->fParams[2] << " zRel " << info.fPosition[2] << std::endl;
2494  }
2495 
2496  if (name.find("UpstrHorn1TransInnerOuterPart") != std::string::npos) { // Still even more approximate!...
2497  size_t nameIndex= name.find("UpstrHorn1TransInnerOuterPart") + name.length() - 1;
2498  std::string nameIndexStr(name.substr(nameIndex));
2499  std::istringstream nameIndexStrStr(nameIndexStr);
2500  int iPart = -1;
2501  nameIndexStrStr >> iPart;
2502 // std::cerr << " from LBNEVolumePlacements::Create, for " << name << " Part number " << iPart << std::endl;
2503  if (iPart != 2) {
2504  info.fParams.resize(5);
2505  info.fParams[0] = fTargetHorn1InnerRadsUpstr[iPart];
2506  info.fParams[2] = fTargetHorn1InnerRadsDownstr[iPart];
2507  info.fParams[1] = fTargetHorn1InnerRadsUpstr[iPart] + fTargetHorn1TransThick[iPart];
2508  info.fParams[3] = fTargetHorn1InnerRadsDownstr[iPart] + fTargetHorn1TransThick[iPart];
2509  info.fParams[4] = fTargetHorn1Lengths[iPart];
2510  G4Cons* aCons = new G4Cons(volumeName, info.fParams[0], info.fParams[1], info.fParams[2], info.fParams[3],
2511  info.fParams[4]/2., 0., 360.0*CLHEP::degree);
2512  info.fCurrent = new G4LogicalVolume(aCons, G4Material::GetMaterial(fHorn1AllCondMat), volumeName);
2513  info.fTypeName = G4String("Cons");
2514  } else {
2515  info.fParams[0] = fTargetHorn1InnerRadsUpstr[iPart];
2516  info.fParams[1] = fTargetHorn1InnerRadsUpstr[iPart] + fTargetHorn1TransThick[iPart];
2517  info.fParams[2] = fTargetHorn1Lengths[iPart];
2518  G4Tubs* aTubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
2519  0., 360.0*CLHEP::degree);
2520  // Use Aluminum ! P.L. July 2014...
2521  info.fCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(fHorn1AllCondMat), volumeName);
2522  }
2523  info.fPosition[0] = 0.; info.fPosition[1] = 0.;
2524  info.fPosition[2] = fTargetHorn1ZPositions[iPart];
2525  }
2526 
2527  //
2528  // October/November 2016.
2529  //
2530  if ((name == G4String("TargetCoolingTubeReturnLoopRight")) ||
2531  (name == G4String("TargetCoolingTubeReturnLoopLeft"))) { //
2532  info.fParams.resize(5);
2533  info.fParams[0] = 0.; //rMin
2534  info.fParams[1] = fTargetCTubeOuterRadius; // rMax
2535  info.fParams[2] = fTargetCTubeOuterRadius + fTargetFinHeight + 0.4*CLHEP::mm;
2536  if (name.find("Right") != std::string::npos) {
2537  info.fParams[3] = -M_PI/2.;
2538  info.fParams[4] = M_PI;
2539  } else if (name.find("Left") != std::string::npos) {
2540  info.fParams[3] = M_PI/2.;
2541  info.fParams[4] = M_PI;
2542  }
2543  std::cerr << " Rad max torus.. " << name << " = " << info.fParams[1] << " rSweep Torus " << info.fParams[2] << std::endl;
2544  G4Torus* aTorus = new G4Torus(volumeName, info.fParams[0], info.fParams[1], info.fParams[2],
2545  info.fParams[3], info.fParams[4]);
2546  info.fCurrent = new G4LogicalVolume(aTorus, G4Material::GetMaterial(std::string("Titanium")), volumeName);
2547  info.fTypeName=std::string("Torus");
2548  info.fRotationIsUnitMatrix = false;
2549  if (name.find("Right") != std::string::npos) {
2550  info.fRotation.rotateY(M_PI/3.); // a bit arbitrary.
2551  } else if (name.find("Left") != std::string::npos) {
2552  info.fRotation.rotateY(-M_PI/3.); // a bit arbitrary.
2553  }
2554 
2555  }
2556  if ((name == G4String("TargetCoolingTubeReturnLoopRightWater")) ||
2557  (name == G4String("TargetCoolingTubeReturnLoopLeftWater"))) { //
2558  info.fParams.resize(5);
2559  info.fParams[0] = 0.; //rMin
2560  info.fParams[1] = fTargetCTubeInnerRadius; // rMin Titanium.
2561  info.fParams[2] = fTargetCTubeOuterRadius + fTargetFinHeight + 0.4*CLHEP::mm;
2562  std::cerr << " Rad max torus.. " << name << " = " << info.fParams[1] << " rSweep Torus " << info.fParams[2] << std::endl;
2563  if (name.find("Right") != std::string::npos) {
2564  info.fParams[3] = -M_PI/2. + 3.0e-3;
2565  info.fParams[4] = M_PI - 6.0e-3;
2566  } else if (name.find("Left") != std::string::npos) {
2567  info.fParams[3] = M_PI/2. + 3.0e-3;
2568  info.fParams[4] = M_PI - 6.0e-3;
2569  }
2570  info.fTypeName=std::string("Torus");
2571  G4Torus* aTorus = new G4Torus(volumeName, info.fParams[0], info.fParams[1], info.fParams[2],
2572  info.fParams[3], info.fParams[4]);
2573  info.fCurrent = new G4LogicalVolume(aTorus, G4Material::GetMaterial(std::string("Water")), volumeName);
2574  }
2575 
2576  //
2577  // Beginning of Horn1 declarations
2578  //
2579  if (name.find("Horn1") == 0) {
2580  if (name == G4String("Horn1Hall")) {
2581  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("TargetHallAndHorn1"), G4String("Create"));
2582  const LBNEVolumePlacementData *plInfoC = Find(name, G4String("UpstreamTargetAssembly"), G4String("Create"));
2583  info.fParams[0] = 64.0*in - 1.0*CLHEP::cm;
2584  info.fParams[1] = 50.0*in - 1.0*CLHEP::cm;
2586  G4Box* hallBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2. );
2587  info.fCurrent = new G4LogicalVolume(hallBox, G4Material::GetMaterial("Air"), volumeName);
2588  info.fPosition[2] = -1.0*plInfoM->fParams[2]/2. + plInfoC->fParams[2] + info.fParams[2]/2. + 0.020*CLHEP::mm;
2589  }
2590  // Note: to optimize the geometry, we place the downstream end of the target into the
2591  // horn1. Target is not a typo, nor misplaced in the information flow.
2592 
2593  if (name == G4String("Horn1TargetCoolingTubeDwnRetTit")) { //
2594  info.fParams.resize(5);
2598  info.fParams[3] = M_PI/2. + fTargetCTubeReturnDownstrCutAngleStart;
2600  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
2601  info.fParams[3], info.fParams[4]);
2602  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Titanium")), volumeName);
2603  // Two copies will be placed explictely
2604 // std::cerr << " Params for " << name << std::endl;
2605 // for (size_t k=0; k != info.fParams.size(); k++) {
2606 // std::cerr << " k " << k << " " << info.fParams[k] << std::endl;
2607 // }
2608  }
2609  if (name == G4String("Horn1TargetCoolingTubeDwnRetWater")) { //
2610  //
2611  // August 2014... This has been cloned from the 700 MW. target. we need to review these parameters
2612  // for the 1.2 MW target.
2613  //
2614  const LBNEVolumePlacementData *plInfoM;
2615  plInfoM = Find(name, G4String("TargetNoSplitHelium"), G4String("Create"));
2616  info.fParams.resize(5);
2620  info.fParams[3] = M_PI/2. + fTargetCTubeReturnDownstrCutAngleStart;
2622  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2.,
2623  info.fParams[3], info.fParams[4]);
2624  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Water")), volumeName);
2625  info.fPosition[0] = 0.; info.fPosition[1] = 0.;
2626  info.fPosition[2] = plInfoM->fParams[2]/2 -
2627  fTargetCTubeReturnDownstrThickWater/2. - fTargetCTubeReturnDownstrThickTitanium/2 - 1.5*CLHEP::mm ; // leave room for the cap.
2628  if (fUsePseudoNova) info.fPosition[2] += 0.1*CLHEP::mm; // A bit too tight is the target is not split
2629 // std::cerr << " Params for " << name << std::endl;
2630 // for (size_t k=0; k != info.fParams.size(); k++) {
2631 // std::cerr << " k " << k << " " << info.fParams[k] << std::endl;
2632 // }
2633  }
2634  if (name == G4String("Horn1TargetDownstrHeContainerCap")) { //
2635  const LBNEVolumePlacementData *plInfoM;
2636  plInfoM = Find(name, G4String("TargetNoSplitHelium"), G4String("Create"));
2637  info.fParams[0] = 0.;
2638  info.fParams[1] = fTargetHeContTubeInnerRadius-0.010*CLHEP::mm;
2639  info.fParams[2] = fTargetBerylDownstrWindowThick; // Nominal value
2640  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2641  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Beryllium")), volumeName);
2642  info.fPosition[2] = plInfoM->fParams[2]/2 - info.fParams[2] - 0.5*CLHEP::mm;
2643  }
2644  //
2645  // End of target related stuff.
2646  //
2647  if (name.find("Horn1IOTrans") == 0) {
2648  if (name == G4String("Horn1IOTransCont")) { // Transition Inner to Outer Drawing 8875-112-MD-363097
2649  // This is the part downstream of Z=0., MCZERO (not ACTRN1)
2650  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("Horn1PolyM1"), G4String("Create"));
2651  info.fParams[0] = fHorn1IOTransInnerRad;
2652  info.fParams[1] = fHorn1IOTransOuterRad;
2653  info.fParams[2] = fHorn1IOTransLength;
2654  std::cerr << " Params for " << name << " " << info.fParams[0] << " / " << info.fParams[1]
2655  << " / " << info.fParams[2] << " mother length " << plInfoM->fParams[2] << std::endl;
2656  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2657  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Air")), volumeName);
2658  info.fPosition[2] = -plInfoM->fParams[2]/2. + info.fParams[2]/2. + 0.025*CLHEP::mm;
2659  info.fPosition[2] += (2.436*in - 30*CLHEP::mm)*fHorn1LongRescale; // Worked on, for Horn1PolyM1 August 22 2014.
2660  std::cerr << " Checking long offset for " << name << " length of mother "
2661  << plInfoM->fParams[2] << " offset " << info.fPosition[2] << std::endl;
2662  }
2663 
2664  } // End of the Inner Outer Transition for Horn1
2665 
2666  if (name == G4String("Horn1TopLevelUpstr")) { // A container for the section of inner and outer conductors enveloping
2667  // the target. Obsolete!!! Aug-Sept 2014.
2668  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("Horn1Hall"), G4String("Create"));
2669 // info.fParams[0] = fTargetHeContTubeInnerRadius + fTargetHeContTubeThickness + 1.5*CLHEP::mm;
2670 // Above is not optimum if misalignment Use the equation set
2671 // Improved a bit on March 25 2014. See below..
2672 //
2673  const double zMaxDC = fHorn1TopUpstrLength - 3.0*CLHEP::cm;
2674 // const size_t iEqn = (zMaxDC < (21.0888*in*fHorn1LongRescale)) ? 0 : 1;
2675 // Better model with smooth change in equation number, as in the PlaceFinalHorn1.
2676 //
2677  const double rMinEqn1 = fHorn1Equations[0].GetVal(zMaxDC); // Equation 1 or 0
2678  const double rMinEqn2 = fHorn1Equations[1].GetVal(zMaxDC); // Equation 1 or 0
2679  const double ratio0vs1 = std::min(1.0, (zMaxDC/(21.0888*in*fHorn1LongRescale)));
2680  const double rMin = rMinEqn2*ratio0vs1 + (1.0-ratio0vs1)*rMinEqn1;
2681 // info.fParams[0] = rMin - 0.5*CLHEP::mm;
2682 // Too loose !... Leave only 5 microns We get wrong overlap at 2.9 mm offset.
2683  info.fParams[0] = rMin - 0.005*CLHEP::mm;
2684  if (fUsePseudoNova) info.fParams[0] = 1.0*CLHEP::mm; // The above equation are not applicable if zMaxDC ~ fHorn1TopUpstrLength
2685  const double rMaxOut = fTargetHeContTubeInnerRadius + fTargetHeContTubeThickness +0.050*CLHEP::mm;
2686 
2687  if ((!fUsePseudoNova) && (info.fParams[0] < rMaxOut) && (!fHorn1RadiusBigEnough)) {
2688  std::ostringstream mStrStr;
2689  mStrStr << " Can't create Horn1TopLevelUpstr, radial clash between Horn1 inner conductor, rMin " <<
2690  info.fParams[0] << " Target Helium tube + min. safety = " << rMaxOut << std::endl;
2691  mStrStr << " Length into horn " << fTargetLengthIntoHorn << std::endl;
2692  G4String mStr(mStrStr.str());
2693  G4Exception("LBNEVolumePlacements::Create", " ", FatalErrorInArgument, mStr.c_str());
2694  } else {
2695  std::cerr << " Successfull (preliminary check) of targetinto with max Z = " << zMaxDC
2696  << " (Drawing CS), rMin = " << rMin << std::endl;
2697  }
2698  info.fParams[1] = fHorn1TopUpstrOuterRad + 3.0*in; // room for the flanges.
2699  info.fParams[2] = fHorn1TopUpstrLength - 0.010*CLHEP::mm;
2700 // std::cerr << " Params for " << name << " " << info.fParams[0] << " / " << info.fParams[1]
2701 // << " / " << info.fParams[2] << std::endl;
2702 // std::cerr << " .... into Horn1Hall " << plInfoM->fParams[0] << " / " << plInfoM->fParams[1]
2703 // << " / " << plInfoM->fParams[2] << std::endl;
2704  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2705  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Air")), volumeName);
2706  info.fPosition[2] = -plInfoM->fParams[2]/2. + info.fParams[2]/2. + 0.005*CLHEP::mm;
2707  // Correction for Pseudo Nova: Shift by the extra space we now have between the downstream end of the target.
2708  // and Horn1.
2710  // This is a surveyed volume, tweaked in PlaceFinal
2711  }
2712  if (name == G4String("Horn1TopLevelDownstr")) { // A container for the section of inner and outer conductors
2713  // downstream of the target
2714  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("Horn1Hall"), G4String("Create"));
2715  const LBNEVolumePlacementData *plInfoC = Find(name, G4String("Horn1PolyM1"), G4String("Create"));
2716  info.fParams[0] = 0.;
2717  info.fParams[1] = fHorn1TopDownstrOuterRad + 15.0*in; // big stuff at the downstream end..
2718  info.fParams[2] = fHorn1TopDownstrLength + 0.010*CLHEP::mm;
2719  G4Tubs* aTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.*CLHEP::degree);
2720  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Air")), volumeName);
2721  info.fPosition[2] = -plInfoM->fParams[2]/2. + plInfoC->fParams[2] + info.fParams[2]/2. + 0.005*CLHEP::mm;
2722  // This is a surveyed volume, tweaked in PlaceFinal
2723  // Correction for Pseudo Nova: Shift by the extra space we now have between the downstream end of the target.
2724  // and Horn1.
2725  // Correction for the NoSplit configuration: Offsets to be checked, August 22 2014
2727  double rMin = 1.0e10*CLHEP::mm;
2729  if (*il < rMin) rMin = *il;
2730  info.fParams[0] = rMin - 0.010*CLHEP::mm ;
2731  const double z30p150 = fHorn1LongRescale*30.150*in; //Equation change. We will put the split Upst/Downstr here.
2732  const double zOffsetDrawingUpstrEdge = 5.752*in*fHorn1LongRescale; // Drawing 363097
2733  info.fPosition[2] = - plInfoC->fParams[2]/2. + zOffsetDrawingUpstrEdge + z30p150 + fHorn1TopDownstrLength/2. + 0.005*CLHEP::mm;
2734  // see PlaceFinalNoSplitHorn1..
2735  std::cerr << " Checking long offset for " << name
2736  << " length of mother " << plInfoC->fParams[2] << " length " << info.fParams[2] << " ZPos "
2737  << info.fPosition[2] << std::endl;
2738  }
2739 
2740  if (name == G4String("Horn1PolyM1")) { // A container for the section of inner and outer conductors
2741  // downstream of the target
2742  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("TargetHallAndHorn1"), G4String("Create"));
2743  std::cerr << " Horn1Poly Placement, mother info , long. info, length "
2744  << plInfoM->fParams[2] << " at Z = " << plInfoM->fPosition[2] << std::endl;
2745  info.fParams[0] = 0.; info.fParams[1] = 0.;
2746  info.fParams[2] = -100000.*CLHEP::m;
2748  if (*il > info.fParams[2]) info.fParams[2] = *il;
2749  //
2750  // We shift the Z position by half the length, such the relative definition is the same as for the other volumes.
2751  std::vector<double> zz(fMotherHorn1AllLengths);
2752  for (std::vector<double>::iterator il = zz.begin(); il != zz.end(); il++) *il -= info.fParams[2]/2.;
2753 // std::cerr << " Dump of Horn1 Polycon, mother, parameters.. Ih Z r " << std::endl;
2754 // for (size_t k=0; k!= zz.size(); k++)
2755 // std::cerr << " " << k << " " << zz[k] << " " << fMotherHorn1AllRads[k] << std::endl;
2756  std::cerr << " .... Total length HornPolyM1 " << info.fParams[2];
2757  G4GenericPolycone* aPCon = new G4GenericPolycone(volumeName, 0.*CLHEP::degree, 360.0*CLHEP::degree, static_cast<int>(fMotherHorn1AllLengths.size()),
2758  &fMotherHorn1AllRads[0], &zz[0]);
2759 
2760 
2761  if (fFillHornsWithArgon) {
2762  info.fCurrent = new G4LogicalVolume(aPCon, G4Material::GetMaterial(std::string("Argon")), volumeName);
2763  } else {
2764  info.fCurrent = new G4LogicalVolume(aPCon, G4Material::GetMaterial(std::string("Air")), volumeName);
2765  }
2766  const double lastCorrOnHorn1 = 9.99*CLHEP::mm*fHorn1LongRescale;
2767  info.fPosition[2] = plInfoM->fParams[2]/2. - info.fParams[2]/2. - lastCorrOnHorn1; // Probably needs corrections.
2768  // Indeed... No need for this last correction.. if Custom Horn1. November 7 2014.
2769  if (fUseHorn1Polycone || fUseHornsPolycone)
2770  info.fPosition[2] = plInfoM->fParams[2]/2. - info.fParams[2]/2. - 0.005*CLHEP::mm;
2771  // June 2016: if we use the Conceptual design, and implement the complete I/O transition section,
2772  // and keep Z = 0. at the same place, then we have to shift downstream the HornA mother Volume.
2773 // info.fPosition[2] += fZShiftConceptHornAStartIC; done with TargetAndHorn1.
2774  // if Horn1 is tilted, leave some room downstream.. Testing here, I should find out what that misalignment is..
2775  //
2776  if(fUseLBNFOptimConceptDesignHornA)
2777  info.fPosition[2] = plInfoM->fParams[2]/2. - info.fParams[2]/2. - fZHallHorn1ToHorn1PolyM1 - 0.005*CLHEP::mm;
2778 
2779  LBNESurveyor* theSurvey = LBNESurveyor::Instance();
2780  const std::string myHorn1SName("Horn1");
2781  // Use a fixed shift for now. To be refine when (if ever) we do the systemac analysis on misalignment.
2782  if (theSurvey->IsVolumeMisaligned(myHorn1SName)) info.fPosition[2] -= 5.0*CLHEP::mm;
2783  std::cerr << " Horn1Poly Placed, long. info, length "
2784  << info.fParams[2] << " at Z = " << info.fPosition[2] << std::endl;
2785  }
2786 
2787  } // End of Horn1
2788  if (name.find("Horn2") == 0) {
2789  if (name == G4String("Horn2Hall")) { // not align-able.
2790  const LBNEVolumePlacementData *plInfoTunnel = Find(name, G4String("Tunnel"), G4String("Create"));
2791  for (size_t k=0; k != 2; ++k)
2792  info.fParams[k] = plInfoTunnel->fParams[k] - 0.5*CLHEP::cm;
2793  info.fParams[2] = fHorn2Length + 4.0*fHorn2LengthMargin; // Add extra margin, 2 on each side, as there will
2794  // be the container volume
2795  G4Box* hallBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2. );
2796  info.fCurrent = new G4LogicalVolume(hallBox, G4Material::GetMaterial("Air"), volumeName);
2797 // The geometric center of tunnel is at z=0 (MCZERO=0), so, we simply have:
2798  info.fPosition[2] = info.fParams[2]/2. + fHorn2LongPosition - fHorn2OffsetIOTr1;
2799  }
2800  if (name == G4String("Horn2TopLevel")) { // align-able. Use survey data in PlaceFinal
2801  info.fParams[0] = 0.;
2802  info.fParams[1] = fHorn2OuterTubeOuterRadMax + 2.0*in;
2803  info.fParams[2] = fHorn2Length + 2.0*fHorn2LengthMargin; // Add extra margin, 2 on each side, as there will
2804  // be the container volume
2805  G4Tubs* tubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1],
2806  info.fParams[2]/2., 0. , 360.0*CLHEP::degree );
2807  if (fFillHornsWithArgon) {
2808  info.fCurrent = new G4LogicalVolume(tubs, G4Material::GetMaterial(std::string("Argon")), volumeName);
2809  } else {
2810  info.fCurrent = new G4LogicalVolume(tubs, G4Material::GetMaterial(std::string("Air")), volumeName);
2811  }
2812  info.fPosition[2] = 0.;
2813  }
2814  // Other subvolume defined the usual way in PlaceFinalHorn2
2815  } // End of Horn2
2816  //
2817  // LBNF design, Polycone Horns, generic design.
2818  if (name.find("LBNFChaseDwnstrHorn1") == 0) {
2819  const LBNEVolumePlacementData *plInfoTunnel = Find(name, G4String("Tunnel"), G4String("Create"));
2820  for (size_t k=0; k != 2; ++k)
2821  info.fParams[k] = plInfoTunnel->fParams[k] - 0.5*CLHEP::cm;
2822  const double zBeg = fHornsPolyZStartPos[1] - 1.0*CLHEP::mm;
2823  size_t lastIndex = fMotherHornsAllLengths[fHornsPolyZStartPos.size()-1].size() - 1;
2824  const double zEnd = fHornsPolyZStartPos[fHornsPolyZStartPos.size()-1] +
2825  fMotherHornsAllLengths[fHornsPolyZStartPos.size()-1][lastIndex] + 1.0*CLHEP::mm;
2826 
2827  info.fParams[2] = (zEnd - zBeg); //Simply.. They are ordered in Z.
2828  G4Box* hallBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2. );
2829  info.fCurrent = new G4LogicalVolume(hallBox, G4Material::GetMaterial("Air"), volumeName);
2830 // The geometric center of tunnel is at z=0 (MCZERO=0), so, we simply have:
2831  info.fPosition[2] = fHornsPolyZStartPos[1] + info.fParams[2]/2. - 0.5*CLHEP::mm;
2832  }
2833 
2834  if (name.find("LBNFSimpleHorn") == 0) {
2835  size_t ii = name.find("Horn"); ii+=4;
2836  char hornNumChr = name[ii];
2837 // const char *hornNumChrPtr = &hornNumChr; // What was this ? P.L. May 18 2016
2838  size_t iH = hornNumChr - '0' - 1;
2839  const LBNEVolumePlacementData *plInfoM = Find(name, G4String("Tunnel"), G4String("Create"));
2840  for (size_t k=0; k != 2; ++k) info.fParams[k] = plInfoM->fParams[k] - 0.2*CLHEP::mm;
2841  info.fParams[2] = fMotherHornsAllLengths[iH][fMotherHornsAllLengths[iH].size() -1] + 2.*CLHEP::mm; //Simply.. They are ordered in Z.
2842 //
2843 // Make it a tube, such that we can stick a plug if need be. Pick the smalles radii
2844 //
2845  info.fParams[0] = 1.0e8;
2846  for (size_t k=0; k != fMotherHornsAllRads[iH].size(); k++)
2847  info.fParams[0] = std::min(info.fParams[0], fMotherHornsAllRads[iH][k]);
2848  info.fParams[0] -= 0.1*CLHEP::mm;
2849  info.fParams[1] = fHornsPolyOuterRadius[iH] + 5.0*CLHEP::mm;
2850  G4Tubs* hallTube = new G4Tubs(volumeName, info.fParams[0], info.fParams[1], info.fParams[2]/2., 0., 360.0*CLHEP::degree );
2851  info.fCurrent = new G4LogicalVolume(hallTube, G4Material::GetMaterial("Air"), volumeName);
2852  // Assume the tunnel center is at Z = 0., G4 world coordinate..
2853  info.fPosition[2] = fHornsPolyZStartPos[iH] + info.fParams[2]/2.;
2854  std::cerr << " .... Placing Mother volume " << volumeName << " r min " << info.fParams[0]
2855  << " rMax " << info.fParams[1] << " Length "
2856  << info.fParams[2] << " At Z = " << info.fPosition[2] << std::endl;
2857  }
2858 
2859  if (name.find("DecayPipe") == 0) {
2860  if (name == G4String("DecayPipeHall")) { // Surveyable, for ease of convenience, let us do it at this level.
2861  const LBNEVolumePlacementData *plInfoTunnel = Find(name, G4String("Tunnel"), G4String("Create"));
2862  for (size_t k=0; k != 2; ++k)
2863  info.fParams[k] = plInfoTunnel->fParams[k] - 50.*CLHEP::cm; // 50 cm misalignement unlikely.
2864  info.fParams[2] = fDecayPipeLength + 4.0*CLHEP::cm; // Add extra margin, 2 on each side, as there will
2865  // be the container volume
2866  G4Box* hallBox = new G4Box(volumeName, info.fParams[0]/2., info.fParams[1]/2., info.fParams[2]/2. );
2867  info.fCurrent = new G4LogicalVolume(hallBox, G4Material::GetMaterial("Air"), volumeName);
2868  // we decide to place the decay pipe after the snout, and save
2869  if (!fRemoveDecayPipeSnout) {
2870  const LBNEVolumePlacementData *plInfoS = Find(name, G4String("DecayPipeSnout"), G4String("Create"));
2871  fDecayPipeLongPosition = plInfoS->fPosition[2] + plInfoS->fParams[2]/2.;
2872  } else {
2873  std::cerr << " The decay pipe will start " << fDecayPipeLongPosition
2874  << " meters from the start of Horn1, without Decay Pipe snout.. " << std::endl;
2875  }
2876  // longitudinal position of the entrance of the decay pipe hall.
2877  info.fPosition[2] = info.fParams[2]/2. + fDecayPipeLongPosition + 2.0*CLHEP::cm;
2878  std::cerr << " VolumePlacement, decay pipe, position " << info.fPosition[2] << std::endl;
2879  }
2880  if (name == G4String("DecayPipeConcrete")) {
2881  const LBNEVolumePlacementData *plInfo = Find(name, G4String("DecayPipeHall"), G4String("Create"));
2882  info.fParams[0] = fDecayPipeRadius + 2.0*fDecayPipeWallThick + 20.0*CLHEP::cm + 2.0*CLHEP::cm;
2883  info.fParams[1] = std::min(plInfo->fParams[0], plInfo->fParams[1])/2.0 - 1.0*CLHEP::m;
2884  // fill with concrete. Rock is a bit different
2885  // from concrete, but O.K. at such last distance from beam axis. Leave one meter for misalignment..
2886  info.fParams[2] = fDecayPipeLength + 2.0*CLHEP::cm; // Add extra margin, 2 on each side, as there will
2887  // be the container volume
2888  G4Tubs* tubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1],
2889  info.fParams[2]/2., 0., 360.0*CLHEP::degree );
2890  info.fCurrent = new G4LogicalVolume(tubs, G4Material::GetMaterial("Concrete"), volumeName);
2891  }
2892  if (name == G4String("DecayPipeWall")) {
2893  info.fParams[0] = fDecayPipeRadius; // such that the decay pipe wall & volume
2894  // can be surveyable.
2896  info.fParams[2] = fDecayPipeLength + 1.0*CLHEP::cm; // Add extra margin
2897  G4Tubs* tubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1],
2898  info.fParams[2]/2., 0., 360.*CLHEP::degree);
2899  info.fCurrent = new G4LogicalVolume(tubs, G4Material::GetMaterial("Steel316"), volumeName);
2900  }
2901  if (name == G4String("DecayPipeOuterWall")) {
2902  info.fParams[0] = fDecayPipeRadius + 20.0*CLHEP::cm + fDecayPipeWallThick; // such that the decay pipe wall & volume
2903  // can be surveyable.
2904  info.fParams[1] = fDecayPipeRadius + 2.0*fDecayPipeWallThick + 20.0*CLHEP::cm ;
2905  info.fParams[2] = fDecayPipeLength + 1.0*CLHEP::cm; // Add extra margin
2906  G4Tubs* tubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1],
2907  info.fParams[2]/2., 0., 360.*CLHEP::degree);
2908  info.fCurrent = new G4LogicalVolume(tubs, G4Material::GetMaterial("Steel316"), volumeName);
2909  }
2910 
2911  if (name == G4String("DecayPipeVolume")) {
2912  info.fParams[0] = 0.; // such that the decay pipe wall & volume
2913  // can be surveyable.
2914  info.fParams[1] = fDecayPipeRadius - 0.010*CLHEP::mm;
2915  info.fParams[2] = fDecayPipeLength ;
2916  G4Tubs* tubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1],
2917  info.fParams[2]/2., 0., 360.0*CLHEP::degree);
2918  info.fCurrent = new G4LogicalVolume(tubs, G4Material::GetMaterial("DecayPipeGas"), volumeName);
2919  }
2920  if (name == G4String("DecayPipeSnout")) {
2921  LBNERunManager *pRunManager=static_cast<LBNERunManager*> (LBNERunManager::GetRunManager());
2922  const LBNEDetectorConstruction *pDet =
2923  static_cast<const LBNEDetectorConstruction*> (pRunManager->GetUserDetectorConstruction());
2924  info.fParams[0] = 0.; // Centered
2925  // can be surveyable.
2926  info.fParams[1] = ((50.0*in*std::sqrt(2.))/std::cos(pDet->GetBeamlineAngle()) + 1.0*CLHEP::cm)/2.;
2927  info.fParams[2] = 25.5*in +
2928  25.0*in*std::abs(std::sin(pDet->GetBeamlineAngle())) + 15.0*in + 201.*in;
2929  // 15 in is the space upstream of the window box
2930  // and the upstream part is the window holder, which will have to be rotated.
2931  // the distance between the downstream end of the window unit and the beginning of
2932  // the decay pipe.
2933  // Ref Drawing 2251.000-ME-487107 + drawing from Rich Stefaneck, who obtained it
2934  // from Diane Reiztner
2935  // see also Doc db 5339-v5, page 30
2936  std::cerr << " radius of the snout " << info.fParams[1] << " Length " << info.fParams[2] << std::endl;
2937  G4Tubs* tubs = new G4Tubs(volumeName, info.fParams[0], info.fParams[1],
2938  info.fParams[2]/2., 0., 360.*CLHEP::degree);
2939  info.fCurrent = new G4LogicalVolume(tubs, G4Material::GetMaterial("DecayPipeGas"), volumeName);
2940  info.fPosition[2] = fDecayPipeWindowZLocation + info.fParams[2]/2. - 19.84*in;
2941  // This last number is the distance
2942  // between the upstream side of the container volume and the window itself,
2943  // and the length of the buffer volume, snout to snout container.
2944  std::cerr << " Z Position of the snout window " << info.fPosition[2] << std::endl;
2945  // the last number deduced from drawing 2251.000-ME-487107, right side (Scale 1/4 ) Correct within an inch
2946  // or so
2947  }
2948 
2949  } // End if decay pipe.
2950  fSubVolumes.insert(std::pair<G4String, LBNEVolumePlacementData>(name, info));
2951  return &(fSubVolumes.find(name)->second);
2952 
2953 }
static QCString name
Definition: declinfo.cpp:673
std::vector< double > fMotherHorn1AllLengths
std::vector< LBNEHornRadialEquation > fHorn1Equations
intermediate_table::iterator iterator
void SetRCoordOutOfTarget(double r) const
std::vector< G4double > fTargetHorn1ZPositions
G4double fTargetDSSupportSmallConeSmallOuterRad
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
std::vector< double > fHornsPolyOuterRadius
std::vector< std::vector< double > > fMotherHornsAllRads
G4double fTargetCTubeReturnDownstrCutAngleStart
std::vector< double > fHornsPolyZStartPos
G4double fTargetCTubeReturnDownstrThickTitanium
intermediate_table::const_iterator const_iterator
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
G4double fTargetOutHeContTubeOuterSphericalEndCap
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
G4double fTargetDSSupportSmallConeLargeOuterRad
std::vector< G4double > fTargetHorn1InnerRadsUpstr
G4double fTargetDSSupportSmallConeSmallInnerRad
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
T abs(T value)
std::vector< double > fParams
static LBNESurveyor * Instance()
bool IsVolumeMisaligned(const std::string &vName) const
G4VPhysicalVolume * fMother
std::vector< G4double > fTargetHorn1Lengths
G4double fTargetDSSupportLargeConeSmallInnerRad
G4double fTargetDSSupportLargeConeLargeOuterRad
static int max(int a, int b)
G4double fTargetDSSupportLargeConeLargeInnerRad
G4double fTargetCTubeReturnDownstrThickWater
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
std::vector< G4double > fTargetHorn1TransThick
std::vector< double > fMotherHorn1AllRads
G4double fTargetDSSupportSmallConeLargeInnerRad
std::vector< G4double > fTargetHorn1InnerRadsDownstr
if(!yymsg) yymsg
G4double fTargetDSSupportLargeConeSmallOuterRad
G4double fTargetCTubeReturnDownstrCutAngleSize
LBNEVolumePlacements_AlignmentAlgo fAlignmentModel
QTextStream & endl(QTextStream &s)
std::vector< std::vector< double > > fMotherHornsAllLengths
G4double fTargetOutHeContTubeOuterRadiusTapered
LBNEVolumePlacementData * LBNEVolumePlacements::CreateHorn1TopLevelUpstr ( )

Definition at line 530 of file LBNEDownstrVolPlacements.cc.

530  {
531 
532  // A bit special, case, we have to compute the inner conductor radius..
533  // at the length of the target.
534 
535  const double in = 2.54*CLHEP::cm;
537  fHorn1LongRescale*(3.0*CLHEP::cm - 3.316*in + 7.0*CLHEP::mm);
538  // The last factor is a tweak, coming from the various safety marging and/or arbitrariness
539  // in defining the geometry.
540  // The transition Inner to Outer is now included in the Horn1TopLevelUpstr volume!!
542  //
543  // The above equation to determine fHorn1TopUpstrLength looks wrong based on Geantino analysis
544  // Why not simply:
545 
546  fHorn1TopUpstrLength = fTargetHeContTubeLengthInHorn + 7.0*CLHEP::mm;
547  //
548  // Wrong if the entire target is out of Horn1..
549  //
550  if (fUsePseudoNova) fHorn1TopUpstrLength = fHorn1IOTransLength + + 3.36*in + 60.0*CLHEP::mm + 3.0*CLHEP::mm; // The 60 mm
551  // is very arbitrary. It provide enough space for the weld of the I/O to the most upstream inner conductor
552  // piece. Note that, if the target is completly outside Horn1, the raison d'etre
553  // of the split Upst/Downstream part of the Horn1 goes away.. But the structure of the code
554  // was there, try to coopt it..
555  //
556 
557 
558 
559 // std::cerr << " CreateHorn1TopLevelUpstr : fHorn1IOTransLength " << fHorn1IOTransLength
560 // << " fTargetHeContTubeLengthInHorn " << fTargetHeContTubeLengthInHorn
561 // << " fHorn1TopUpstrLength " << fHorn1TopUpstrLength << " and quit " << std::endl;
562 // exit(2);
563  double zEnd = fHorn1TopUpstrLength - fHorn1LongRescale*3.0*CLHEP::cm; // Crappy convention again..
564  if (zEnd > fHorn1LongRescale*30.3150*in) { // Z (drawing coordinate system)
565  std::ostringstream messStrStr;
566  messStrStr << " Helium Tube target hitting the neck! zEnd " << zEnd << "\n";
567  G4String messStr(messStrStr.str());
568  G4Exception("LBNEVolumePlacements::CreateHorn1TopLevelUpstr", " ",
569  FatalErrorInArgument, messStr.c_str());
570  }
571  fHorn1TopUpstrInnerRad = fHorn1Equations[0].GetVal(zEnd) - 0.005*CLHEP::mm; // recaled radially before construction, if need be.
572  return this->Create("Horn1TopLevelUpstr");
573 }
std::vector< LBNEHornRadialEquation > fHorn1Equations
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
LBNEVolumePlacementData * Create(const G4String &name)
LBNEVolumePlacementData * LBNEVolumePlacements::CreateTargetVol ( const G4String &  volName,
int  number = 1 
)

Definition at line 519 of file LBNFTargetModule.cc.

519  {
520 
521  // Based on LBNEVolumePlacements::Create() but put here in order to reduce
522  // the huge size of that function...
523 
524  // Check to see if the volume has already been created
526  if (itDupl != fSubVolumes.end()) {
527  std::ostringstream mStrStr;
528  mStrStr << " Volume named " << volName << " Already defined. Fatal ";
529  G4String mStr(mStrStr.str());
530  G4Exception("LBNEVolumePlacements::Create", " ", FatalErrorInArgument, mStr.c_str());
531  }
532 
534  info.initialize();
535 
536  // Check that the volume name at least contains "Target". Otherwise ignore it
537  std::ostringstream cNumStrStr; cNumStrStr << number;
538  G4String numString = cNumStrStr.str();
539  G4String targetLabel("Target"); targetLabel += numString;
540 
541  if (!volName.contains("Target")) {return 0;}
542 
543  double targetRadius = fTargetRadius;
544  double targetLength = fTargetLength;
545  double targetOutCaseInnerR = fTargetOutCaseInnerR;
546  double targetOutCaseL = fTargetOutCaseL;
547  double targetModuleTotL = fTargetModuleTotL;
548  double targetInCaseL = fTargetInCaseL;
549  if (number == 2) {
550  targetRadius = fTarget2Radius;
551  targetLength = fTarget2Length;
552  targetOutCaseInnerR = fTarget2OutCaseInnerR;
553  targetOutCaseL = fTarget2OutCaseL;
554  targetModuleTotL = fTarget2ModuleTotL;
555  targetInCaseL = fTarget2InCaseL;
556  }
557 
558  //G4cout<<"CreateTargetVol: r = "<<targetRadius<<", L = "<<targetLength<<", OCIR = "<<targetOutCaseInnerR
559  // <<", OCL = "<<targetOutCaseL<<", ModTotL = "<<targetModuleTotL<<", ICL = "<<targetInCaseL<<G4endl;
560 
561  if (volName.contains("Sphere")) {
562 
563  // One of the target spheres
564  info.fParams[0] = 0.0;
565  info.fParams[1] = targetRadius;
566  info.fParams[2] = 0.0;
567  G4Sphere* aSphere = new G4Sphere(volName,
568  info.fParams[0], //inner radius = 0
569  info.fParams[1], //outer radius
570  0.0, 360.0*CLHEP::degree,
571  0.0, 180.0*CLHEP::degree); //Phi and Theta angles
572 
573  info.fCurrent = new G4LogicalVolume(aSphere, G4Material::GetMaterial(targetLabel), volName);
574 
575  } else if (volName.contains("Cylinder")) {
576 
577  // The target cylinder object
578  info.fParams[0] = 0.0;
579  info.fParams[1] = targetRadius;
580  info.fParams[2] = targetLength;
581  G4Tubs* aTube = new G4Tubs(volName, 0.0, targetRadius,
582  0.5*targetLength, // half-length
583  0.0, 360.0*CLHEP::degree); // Phi angle extent
584 
585  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(targetLabel), volName);
586 
587  } else if (volName.contains("OuterCan")) {
588 
589  // The outer canister, containing the union of a tube with a downstream spherical "bulb"
590  double innerR = 0.0;
591  double outerR = targetOutCaseInnerR + fTargetCaseT;
592  double halfTubeL = 0.5*targetOutCaseL;
593 
594  // The cylindrical tube section
595  G4String tubeName(volName); tubeName += "Tube";
596  G4Tubs* aTube = new G4Tubs(tubeName, innerR, outerR,
597  halfTubeL, // half-length
598  0.0, 360.0*CLHEP::degree); // Phi angle extent
599 
600  // The end bulb section
601  G4String sphereName(volName); sphereName += "Sphere";
602  G4Sphere* aSphere = new G4Sphere(sphereName, innerR, outerR,
603  0.0, 360.0*CLHEP::degree,
604  0.0, 180.0*CLHEP::degree); //Phi and Theta angles
605 
606  // The union of the two volumes
607  G4UnionSolid* outerCan = new G4UnionSolid(volName, aTube, aSphere, 0, G4ThreeVector(0.0, 0.0, halfTubeL));
608 
609  info.fCurrent = new G4LogicalVolume(outerCan, G4Material::GetMaterial(std::string("Titanium")), volName);
610 
611  // Parameters: inner radius, outer radius, full length
612  info.fParams[0] = innerR;
613  info.fParams[1] = outerR;
614  info.fParams[2] = targetModuleTotL;
615 
616  } else if (volName.contains("OuterHeGas")) {
617 
618  // The outer canister, containing the union of a tube with a downstream spherical "bulb"
619  double innerR = 0.0;
620  double outerR = targetOutCaseInnerR;
621  double halfTubeL = 0.5*targetOutCaseL;
622 
623  // The cylindrical tube section
624  G4String tubeName(volName); tubeName += "Tube";
625  G4Tubs* aTube = new G4Tubs(tubeName, innerR, outerR,
626  halfTubeL, // half-length
627  0.0, 360.0*CLHEP::degree); // Phi angle extent
628 
629  // The end bulb section
630  G4String sphereName(volName); sphereName += "Sphere";
631  G4Sphere* aSphere = new G4Sphere(sphereName, innerR, outerR,
632  0.0, 360.0*CLHEP::degree,
633  0.0, 180.0*CLHEP::degree); //Phi and Theta angles
634 
635  // The union of the two volumes
636  G4UnionSolid* outerCan = new G4UnionSolid(volName, aTube, aSphere, 0, G4ThreeVector(0.0, 0.0, halfTubeL));
637 
638  info.fCurrent = new G4LogicalVolume(outerCan, G4Material::GetMaterial(std::string("HeliumTarget")), volName);
639 
640  // Parameters: inner radius, outer radius, full length
641  info.fParams[0] = innerR;
642  info.fParams[1] = outerR;
643  info.fParams[2] = targetModuleTotL - fTargetCaseT;
644 
645  } else if (volName.contains("InnerCan")) {
646 
647  // The inner, cylindrical canister of the target module
648  double innerR = 0.0;
649  double outerR = targetRadius + fTargetSupportD + fTargetCaseT;
650  double halfTubeL = 0.5*targetInCaseL;
651 
652  // The cylindrical tube section
653  G4String tubeName(volName); tubeName += "Tube";
654  G4Tubs* aTube = new G4Tubs(tubeName, innerR, outerR,
655  halfTubeL, // half-length
656  0.0, 360.0*CLHEP::degree); // Phi angle extent
657 
658  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Titanium")), volName);
659 
660  // Parameters: inner radius, outer radius, full length
661  info.fParams[0] = innerR;
662  info.fParams[1] = outerR;
663  info.fParams[2] = targetInCaseL;
664 
665  } else if (volName.contains("InnerHeGas")) {
666 
667  // The inner, cylindrical canister of the target module
668  double innerR = 0.0;
669  double outerR = targetRadius + fTargetSupportD;
670  double halfTubeL = 0.5*targetInCaseL;
671 
672  // The cylindrical tube section
673  G4String tubeName(volName); tubeName += "Tube";
674  G4Tubs* aTube = new G4Tubs(tubeName, innerR, outerR,
675  halfTubeL, // half-length
676  0.0, 360.0*CLHEP::degree); // Phi angle extent
677 
678  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("HeliumTarget")), volName);
679 
680  // Parameters: inner radius, outer radius, full length
681  info.fParams[0] = innerR;
682  info.fParams[1] = outerR;
683  info.fParams[2] = targetInCaseL;
684 
685  } else if (volName.contains("Support")) {
686 
687  // The target cylinder object
688  double radius = 0.5*fTargetSupportD;
689  info.fParams[0] = 0.0;
690  info.fParams[1] = radius;
691  info.fParams[2] = targetInCaseL;
692  G4Tubs* aTube = new G4Tubs(volName, 0.0, radius,
693  0.5*targetInCaseL, // half-length
694  0.0, 360.0*CLHEP::degree); // Phi angle extent
695 
696  info.fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial(std::string("Titanium")), volName);
697 
698  }
699 
700  // Keep track of the volume we've made
701  fSubVolumes.insert(std::pair<G4String, LBNEVolumePlacementData>(volName, info));
702 
703  return &(fSubVolumes.find(volName)->second);
704 
705 }
std::string string
Definition: nybbler.cc:12
intermediate_table::const_iterator const_iterator
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
void LBNEVolumePlacements::DeclareHorn1Dims ( )
private

Definition at line 306 of file LBNEDownstrVolPlacements.cc.

306  {
307 
308  const double in = 2.54*CLHEP::cm;
309  fHorn1IOTransLength = 3.0*CLHEP::cm + 3.316*in + 0.005*CLHEP::mm;
310  // Drawing 8875.112 -MD-363097 The 3 cm is the MCZERO offset, per verbal discussion
311  // with J. Hylen. The 5 microns if to avoid G4 volume overlaps.
312 
313 // fHorn1RadialSafetyMargin = 2.9*CLHEP::mm; // per agreement between Jim H. and Alberto M., Aug. 22 2013.
314  fHorn1RadialSafetyMargin = 2.5*CLHEP::mm; // per agreement between Jim H. and Alberto M., Oct 4 2013
315 
316  fHorn1IOTransInnerRad = 2.520*in/2. - fHorn1RadialSafetyMargin/2. ; // last term is the
317  fHorn1IOTransOuterRad = 16.250*in/2.;
318 
319  fHorn1UpstrInnerRadsUpstr.resize(4);
320  fHorn1UpstrInnerRadsDownstr.resize(4);
323  fHorn1UpstrLengths.resize(4);
324  fHorn1UpstrZPositions.resize(4);
325 
326  fHorn1UpstrInnerRadsUpstr[0] = 1.572*in;
328  fHorn1UpstrInnerRadsDownstr[0] = 1.41*in;
330  fHorn1UpstrLengths[0] = 0.508*in - 0.100*CLHEP::mm;
331  fHorn1UpstrZPositions[0] = fHorn1UpstrLengths[0]/2. + 0.025; // With respect to the beginning of mother volume.
332 
335  fHorn1UpstrInnerRadsDownstr[1] = 1.288*in;
337  fHorn1UpstrLengths[1] = 0.639*in - 0.100*CLHEP::mm;
338  fHorn1UpstrZPositions[1] = fHorn1UpstrZPositions[0] + 0.025*CLHEP::mm + fHorn1UpstrLengths[0]/2 + fHorn1UpstrLengths[1]/2.;
339 
342  fHorn1UpstrInnerRadsDownstr[2] = 1.268*in;
344  fHorn1UpstrLengths[2] = 2.835*in - 0.100*CLHEP::mm; // Reduce a bit, too tight..
345  fHorn1UpstrZPositions[2] = fHorn1UpstrZPositions[1] + 0.025*CLHEP::mm + fHorn1UpstrLengths[1]/2 + fHorn1UpstrLengths[2]/2.;
346 
351  fHorn1UpstrLengths[3] = 0.479*in - 0.100*CLHEP::mm; // Nov 19 2013 : change from 0.40 inches to 0.479, per more
352  // accurate reading of drawing 363097
353  fHorn1UpstrZPositions[3] = fHorn1UpstrZPositions[2] + 0.025*CLHEP::mm + fHorn1UpstrLengths[2]/2 + fHorn1UpstrLengths[3]/2.;
354  //
355  // These are elements, approximated as tubes, of the Inner Outer transition piece of Horn1
356  //
361 
362  fHorn1UpstrOuterIOTransInnerRads[0] = 5.625*in;
363  fHorn1UpstrOuterIOTransThicks[0] = 0.30*in;
364  fHorn1UpstrOuterIOTransLengths[0] = 0.421*in;
366 
367  fHorn1UpstrOuterIOTransInnerRads[1] = 5.763*in;
368  fHorn1UpstrOuterIOTransThicks[1] = 0.32*in;
369  fHorn1UpstrOuterIOTransLengths[1] = 0.421*in;
372 
373  fHorn1UpstrOuterIOTransInnerRads[2] = 5.763*in;
374  fHorn1UpstrOuterIOTransThicks[2] = 0.4*in;
375  fHorn1UpstrOuterIOTransLengths[2] = 0.75*in;
378 
379  fHorn1UpstrOuterIOTransInnerRads[3] = 5.763*in;
380  fHorn1UpstrOuterIOTransThicks[3] = 2.26*in;
381  fHorn1UpstrOuterIOTransLengths[3] = fHorn1IOTransLength - 0.250*CLHEP::mm -
383 
384  fHorn1UpstrOuterIOTransPositions[3] = fHorn1IOTransLength - fHorn1UpstrOuterIOTransLengths[3]/2. - 0.01*CLHEP::mm;;
385 
386 // Outer dimension of the big tube that contains almost everything..
387 // Except the big connedtors rings downsream (max dim are 23.5 in
388 
389  fHorn1OuterTubeOuterRad = 13.750*in/2.0;
390  fHorn1OuterTubeInnerRad = 11.750*in/2.0; // checked with drawing 364094
391  //
392 
393  //
394  // Now the top level sections. Only two of them, alignable.
395  fHorn1TopUpstrOuterRad = 16.250*in/2. + 5.0*CLHEP::mm; // safety 5 mm, big radius..// Drawing 8875.112-MD 363097
396  fHorn1NeckLength = 1.568*in; // Drawing 8875.112-MD 363105
397  fHorn1NeckZPosition = 30.315*in + fHorn1NeckLength/2.; // Drawing 8875.112-MD 363105
398  // In Z Drawing coordinates.
399 
400  fHorn1TopDownstrOuterRad = fHorn1TopUpstrOuterRad; // Initialization finally fixed on March 18 2014...
401  // Should have been done 9 months ago!
402 
403  fHorn1TopDownstrLength = 133.752*in; // We will have to subtract the upstream length, once we know it
404  // This include the downstream bulkhead.
405  // Other quantities defined in CreateHorn1TopLevelUpstr..
406  // The first one goes up the downstream end of the IO transition peace
407  // and up the downstream end of the target. If the target is completly out of the horn,
408  // it is the part before the neck. (Drawing 8875.112-MD-363104)
409  // This is a tube, set by the inner conductor
410  // radius at the end of the target.
411  //
412  // Load the equations Drawing 8875.112-MD 363104, 363105
413 //
414  fHorn1Equations.clear();
415  LBNEHornRadialEquation e1(1.975805, -0.055858, -0.078740); fHorn1Equations.push_back(e1);
416  LBNEHornRadialEquation e2(1.818869, -0.055858, 0.); fHorn1Equations.push_back(e2);
417  LBNEHornRadialEquation eBlank(0., 0., 0.); fHorn1Equations.push_back(eBlank); // equation 3 not found on drawing.
418  LBNEHornRadialEquation e4(-5.619190, 0.180183, 0.); fHorn1Equations.push_back(e4);
419  LBNEHornRadialEquation e5(-5.462253, 0.180183, -0.078740); fHorn1Equations.push_back(e5);
420  LBNEHornRadialEquation e6(1.97805, -0.055858, 0.); fHorn1Equations.push_back(e6);
421  fHorn1Equations.push_back(eBlank); // equation 7 not found on drawing as well
422  LBNEHornRadialEquation e8(-5.462253, 0.180183, 0.); fHorn1Equations.push_back(e8);
423 
424  // The 2nd top lelvel section is the remaining part of that part, up to the end of the Horn1Hall Z location.
425  // This is just a tube.
426  //
427  fHorn1InnerCondMat = G4String("Aluminum");
428  fHorn1AllCondMat = G4String("Aluminum");
429  // Then, conical sections, all in a tube that has an inner radius of the neck, our radius
430  //
431  // To compute all that, we need to locate the target first..
432  // So, done at construction time.
433  //
434 
435 }
std::vector< LBNEHornRadialEquation > fHorn1Equations
std::vector< G4double > fHorn1UpstrOuterIOTransPositions
std::vector< G4double > fHorn1UpstrOuterIOTransLengths
std::vector< G4double > fHorn1UpstrOuterIOTransInnerRads
std::vector< G4double > fHorn1UpstrInnerRadsOuterUpstr
std::vector< G4double > fHorn1UpstrInnerRadsOuterDownstr
std::vector< G4double > fHorn1UpstrOuterIOTransThicks
std::vector< G4double > fHorn1UpstrInnerRadsDownstr
std::vector< G4double > fHorn1UpstrZPositions
std::vector< G4double > fHorn1UpstrInnerRadsUpstr
std::vector< G4double > fHorn1UpstrLengths
void LBNEVolumePlacements::DeclareHorn2Dims ( )
private

Definition at line 788 of file LBNEDownstrVolPlacements.cc.

788  {
789 
790  const double in = 2.54*CLHEP::cm;
791  fHorn2RadialRescale = 1.0;
793  fHorn2LongRescale = 1.0;
796 
797  fHorn2PartsLengths.resize(7);
798  fHorn2PartsRadii.resize(fHorn2PartsLengths.size());
799 
800  fHorn2OuterTubeOuterRadMax = 37.0*in/2.0; // Drawing 8875.112-MD 363385 Need an other drawing.
801  fHorn2OuterTubeOuterRad = 31.30*in/2.0; // Drawing 8875.112-MD 363385 Need an other drawing.
802  fHorn2OuterTubeInnerRad = 29.25*in/2.0;
803  fHorn2LongPosition = 6600.0*CLHEP::mm; // Drawing received fropm Alberto M., who received from Rich Stefanek, we think.
804  // From MCZero (our Zero in g4lbne ref. frame ), to the z=0. of drawing 8875.112Md 363383
805 
806  for(size_t k=0; k!= fHorn2PartsRadii.size(); ++k)
808 
809  fHorn2OffsetIOTr1 = 1.889*in; // Offset between the entrance of Horn2TopLevel - margin and Z=0, drawing...
810  fHorn2PartsLengths[0] = fHorn2OffsetIOTr1 + 5.861*in; // Drawing 8875.112-MD 363385
811  fHorn2LengthNominal = 142.91*in; // Drawing 8875.112-MD 363382, Revision E
812 
813  fHorn2PartsRadii[0] = (33.75 + 1.0)*in/2. ; // Info only, take the outer Radius
814 
815  fHorn2PartsLengths[1] = (24.061)*in; // Drawing 8875.112-MD 363386
816 // fHorn2PartsRadii[1] = (19.385 + 1.0)*in ; // Info only, take the outer Radius
817 
818  fHorn2PartsLengths[2] = (20.092)*in; // Drawing 8875.112-MD 363387
819 // fHorn2PartsRadii[2] = (10.70 + 1.0)*in ; //
820 
821  fHorn2PartsLengths[3] = (20.061)*in; // Drawing 8875.112-MD 363388
822 // fHorn2PartsRadii[3] = (13.293 + 1.0)*in ; // info only.
823 
824  fHorn2PartsLengths[4] = (24.030)*in; // Drawing 8875.112-MD 363389
825 // fHorn2PartsRadii[4] = (17.755 + 1.0)*in ; // info only.
826 
827  fHorn2PartsLengths[5] = (24.325)*in; // Drawing 8875.112-MD 363390
828 // fHorn2PartsRadii[4] = (21.341 + 1.0)*in ; // info only.
829 
830  fHorn2PartsLengths[6] = (21.054)*in; // Drawing 8875.112-MD 363390
831  fHorn2PartsRadii[6] = fHorn2OuterTubeOuterRadMax+ 1.0*in ; // info only.
832 // add 1/2 inch margin for misalignment.
833 
834  fHorn2LengthMargin = 0.5*in;
835 
837  for (size_t k=0; k!= fHorn2PartsLengths.size(); ++k) fHorn2Length +=fHorn2PartsLengths[k];
839 //
840 // std::cout << " Check of Horn2 lengths, Sum of indivuals parts + margin " << fHorn2Length
841 // << " nominal " << fHorn2LengthNominal << std::endl;
842 
843  int numSctTr = 3 + 2; // Number of tubes, otherwise. Approximate..
844  // Take 10 for the transition bulge, 2 for the outer flat part.
845  const double radIOTrOut = 2.184*in;
846  const double radIOTrIn = 1.869*in;
847  const double radIOTrAv = 0.5*(radIOTrOut + radIOTrIn);
848  const double deltaRadIOTr = radIOTrOut - radIOTrIn;
849  const double thetaIOTRStart = std::abs(fHorn2OffsetIOTr1 - radIOTrOut)/radIOTrOut; // approximate..
850  const double surfXSect = (M_PI - thetaIOTRStart)*(radIOTrOut*radIOTrOut - radIOTrIn*radIOTrIn);
851  const double surfXSectPart = surfXSect/(numSctTr-2);
852  const double bigRadIOTr = 12.756*in;
853  // Valid only for
854  fHorn2UpstrOuterIOTransLengths.resize(numSctTr);
855  fHorn2UpstrOuterIOTransRadsOne.resize(numSctTr);
856  fHorn2UpstrOuterIOTransRadsTwo.resize(numSctTr);
857  fHorn2UpstrOuterIOTransPositions.resize(numSctTr);
858 
859  fHorn2UpstrOuterIOTransLengths[1] = deltaRadIOTr - 0.010*CLHEP::mm;
860  fHorn2UpstrOuterIOTransPositions[1] = deltaRadIOTr/2.; // with respect to the start of the mother volume
861  const double heightTmp1 = surfXSectPart/fHorn2UpstrOuterIOTransLengths[1];
862  fHorn2UpstrOuterIOTransRadsOne[1] = bigRadIOTr - heightTmp1/2.;
863  fHorn2UpstrOuterIOTransRadsTwo[1] = bigRadIOTr + heightTmp1/2.;
864  const double zMaxElemZeroUpstr = deltaRadIOTr + 0.010*CLHEP::mm;
865  const double zMaxElemZeroDownstr = fHorn2OffsetIOTr1 - 0.010*CLHEP::mm;
866  fHorn2UpstrOuterIOTransLengths[0] = zMaxElemZeroDownstr - zMaxElemZeroUpstr;
867  fHorn2UpstrOuterIOTransPositions[0] = (zMaxElemZeroDownstr + zMaxElemZeroUpstr)/2.;
870  const double heightTmp0 = surfXSectPart/fHorn2UpstrOuterIOTransLengths[0];
871  fHorn2UpstrOuterIOTransRadsOne[0] = bigRadIOTr - heightTmp0/2. - radIOTrAv/sqrt(2.) ;
872  fHorn2UpstrOuterIOTransRadsTwo[0] = bigRadIOTr + heightTmp0/2. - radIOTrAv/sqrt(2.) ;
873  fHorn2UpstrOuterIOTransRadsOne[2] = bigRadIOTr - heightTmp0/2. + radIOTrAv/sqrt(2.) ;
874  fHorn2UpstrOuterIOTransRadsTwo[2] = bigRadIOTr + heightTmp0/2. + radIOTrAv/sqrt(2.) ;
875  // Top part.
876  fHorn2UpstrOuterIOTransLengths[3] = 0.45*in - 0.010*CLHEP::mm;
877  fHorn2UpstrOuterIOTransPositions[3] = radIOTrOut + fHorn2UpstrOuterIOTransLengths[3]/2. + 0.005*CLHEP::mm;
878  fHorn2UpstrOuterIOTransRadsOne[3] = bigRadIOTr + radIOTrIn ;
879  fHorn2UpstrOuterIOTransRadsTwo[3] = bigRadIOTr + radIOTrOut;
880  // Fange part
881  fHorn2UpstrOuterIOTransLengths[4] = 1.30*in - 0.010*CLHEP::mm;
882  fHorn2UpstrOuterIOTransPositions[4] = radIOTrOut + 0.0075*CLHEP::mm +
884  fHorn2UpstrOuterIOTransRadsOne[4] = bigRadIOTr + fHorn2UpstrOuterIOTransLengths[3]/2. + 0.005*CLHEP::mm ;
885  fHorn2UpstrOuterIOTransRadsTwo[4] = 33.75*in/2;
886 
887 
888  fHorn2InnerIOTransLength = 5.8610*in;
889 
890  //
891  // Load the equations Drawing 8875.112-MD 36385 - 363092
892 //
893  fHorn2Equations.clear();
894  LBNEHornRadialEquation e1(114.73006, -2.91414, 0.); fHorn2Equations.push_back(e1);
895  LBNEHornRadialEquation e2(22.68402, -0.54203, 0., false); fHorn2Equations.push_back(e2);
896  LBNEHornRadialEquation e3(-10.63139, 0.30058, 0., false); fHorn2Equations.push_back(e3); // linear.
897  LBNEHornRadialEquation e4(-56.92263, 1.44583, 0.); fHorn2Equations.push_back(e4);
898  LBNEHornRadialEquation e5(0.12835, 0.0932, 0., false); fHorn2Equations.push_back(e5);
899  LBNEHornRadialEquation e6(1.93227, 0.07398, 0., false); fHorn2Equations.push_back(e6); // 363390
900  LBNEHornRadialEquation e7(114.73007, -2.91414, -0.11811); fHorn2Equations.push_back(e7); // equation 7 found 0n 363386
901  // equation 7 on 363385 differs sliggtly.. in the noise...
902  LBNEHornRadialEquation e8(-56.92263, 1.44583, -0.11811); fHorn2Equations.push_back(e8);
903  LBNEHornRadialEquation e9(0.01064, 0.0932, 0., false); fHorn2Equations.push_back(e9);
904  LBNEHornRadialEquation e10(1.81456, 0.07398, 0., false); fHorn2Equations.push_back(e10); // 363389
905  LBNEHornRadialEquation eIO(10.9108, -0.1780, 0., false); fHorn2Equations.push_back(eIO); // 363385
906  // The 2nd top lelvel section is the remaining part of that part, up to the end of the Horn1Hall Z location.
907  // This is just a tube.
908  //
909 
910  // Then, conical sections, all in a tube that has an inner radius of the neck, our radius
911  //
912  // To compute all that, we need to locate the target first..
913  // So, done at construction time.
914  //
915 
916 }
std::vector< G4double > fHorn2UpstrOuterIOTransRadsTwo
std::vector< G4double > fHorn2UpstrOuterIOTransPositions
std::vector< G4double > fHorn2PartsRadii
T abs(T value)
std::vector< LBNEHornRadialEquation > fHorn2Equations
std::vector< G4double > fHorn2PartsLengths
std::vector< G4double > fHorn2UpstrOuterIOTransLengths
std::vector< G4double > fHorn2UpstrOuterIOTransRadsOne
void LBNEVolumePlacements::declareTargetFinVertCorners ( LBNEVolumePlacementData info)
private
void LBNEVolumePlacements::DumpAllHornsPolyconeParameters ( )
private

Definition at line 1858 of file LBNEVolumePlacementsAdd.cc.

1858  {
1859  const double epsil = 0.050*CLHEP::mm;
1860  for (size_t iH=0; iH != fMotherHornsAllLengths.size(); iH++) {
1861  std::ostringstream aNStrStr; aNStrStr << "./AllHornsPolyconeParametersHorn_" << (iH+1) << ".txt";
1862  std::string aNStr(aNStrStr .str());
1863  std::ofstream fOut(aNStr.c_str());
1864  fOut << " ip Z Rin ROut " << std::endl;
1865  for (size_t k=0; k != fMotherHornsAllLengths[iH].size(); k++) {
1866  fOut << " " << k << " " << fMotherHornsAllLengths[iH][k] - epsil
1867  << " " << fMotherHornsAllRads[iH][k] + epsil << " "
1868  << fMotherHornsAllRads[iH][k] + epsil + fMotherHornsAllThick[iH][k] << std::endl; // Not counting the water layer.
1869  }
1870  fOut.close();
1871  }
1872 }
std::string string
Definition: nybbler.cc:12
std::vector< std::vector< double > > fMotherHornsAllRads
std::vector< std::vector< double > > fMotherHornsAllThick
static QCString str
QTextStream & endl(QTextStream &s)
std::vector< std::vector< double > > fMotherHornsAllLengths
void LBNEVolumePlacements::ExtendChaseLengthForHorn2 ( )

Definition at line 1574 of file LBNEDownstrVolPlacements.cc.

1574  {
1575  //
1576  // Pior to construct the long chase that contains both the target and the horns, we check the length of this mother volume
1577  // is sufficient. If not, we do not extend the tunnel, but reduce the decay pipe length. Paul L. Lebrun, Feb 2015.
1578  // Based on discussion with Alberto M., Feb 6 2015.
1579  //
1580  const double aH2AllLength = fHorn2Length + 4.0*fHorn2LengthMargin + 2.5*CLHEP::cm; // Last is the Amit's tracking plane
1581  // We assume here that the decay pipe snout will not be placed..
1582  const double aEndH2 = aH2AllLength + fHorn2LongPosition - fHorn2OffsetIOTr1; // See Placement of Horn2Hall
1583  if (aEndH2 > fDecayPipeLongPosition ) {
1584  const double delta = aEndH2 - fDecayPipeLongPosition + 1.0*CLHEP::cm; // Last if for good measure..
1585  fDecayPipeLongPosition += delta;
1586  fDecayPipeLength -= delta;
1587  std::cerr << " LBNEVolumePlacements::ExtendChaseLengthForHorn2, moving beginning of decay pipe downstream by "
1588  << delta/CLHEP::m << " meters " << std::endl;
1589  std::cerr << " New Decay length = " << fDecayPipeLength/CLHEP::m << " Starting at "
1590  << fDecayPipeLongPosition/CLHEP::m << " meters" << std::endl;
1591  }
1592 
1593 }
QTextStream & endl(QTextStream &s)
const LBNEVolumePlacementData * LBNEVolumePlacements::Find ( const G4String &  name,
const char *  motherName,
const char *  method 
) const

Definition at line 3156 of file LBNEVolumePlacements.cc.

3157  {
3159  if (itM == fSubVolumes.end()) {
3160  std::ostringstream mStrStr;
3161  mStrStr << " Internal error for " << name << " to be placed in "
3162  << motherName << "; mother not found " << " descriptor " << G4String(descr) << std::endl;
3163  G4String mStr(mStrStr.str());
3164  G4String origin("LBNEVolumePlacements::Find");
3165  G4Exception(origin, " ", FatalErrorInArgument, mStr.c_str());
3166  return 0;
3167  }
3168  return &(itM->second);
3169 }
static QCString name
Definition: declinfo.cpp:673
intermediate_table::const_iterator const_iterator
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
QTextStream & endl(QTextStream &s)
G4double LBNEVolumePlacements::FindNTargetSpheres ( int  number = 1) const

Definition at line 183 of file LBNFTargetModule.cc.

183  {
184 
185  // Find the length of the target (in mm) that gives the required number of interaction lengths
186  // for the specified radius, assuming a Gaussian beam distribution based on the calculation
187  // given in LBNE-doc-9547 (Quynh).
188  // Performs the double integral of the effective interaction length for sigma = radius/3.
189  // Note that the beam parameters are defined after the geometry, so the user needs to make
190  // sure the beam sigmas are set to radius/3...
191 
192  double targetRadius = fTargetRadius;
193  double targetNLambda = fTargetNLambda;
194  double targetSpecificLambda = fTargetSpecificLambda;
195  double targetDensity = fTargetDensity;
196 
197  if (number == 2) {
198  targetRadius = fTarget2Radius;
199  targetNLambda = fTarget2NLambda;
200  targetSpecificLambda = fTarget2SpecificLambda;
201  targetDensity = fTarget2Density;
202  }
203 
204  std::cout << "Finding number of target spheres for NLambda = " << targetNLambda << std::endl;
205 
206  double xSigma = targetRadius/3.0;
207  double ySigma = targetRadius/3.0;
208  double x0(0.0), y0(0.0);
209 
210  /*
211  // This part is what we could do if the generator action is available during geometry construction:
212  LBNERunManager* theRunManager = dynamic_cast<LBNERunManager*>(G4RunManager::GetRunManager());
213  if (theRunManager) {
214 
215  const LBNEPrimaryGeneratorAction* PGA = static_cast<const LBNEPrimaryGeneratorAction*> (theRunManager->GetUserPrimaryGeneratorAction());
216 
217  if (PGA) {
218 
219  xSigma = PGA->GetBeamSigmaX();
220  ySigma = PGA->GetBeamSigmaY();
221  x0 = PGA->GetBeamOffsetX();
222  y0 = PGA->GetBeamOffsetY();
223 
224  } else {
225 
226  std::cout << "Primary generator pointer not found" << std::endl;
227  }
228 
229  }
230  */
231 
232  std::cout << "Assuming beam sigma_x = " << xSigma << ", sigma_y = " << ySigma << std::endl;
233  std::cout << "Assuming beam offset_x = " << x0 << ", offset_y = " << y0 << std::endl;
234 
235  int N(1000);
236  int N1(N+1);
237  double RSq = targetRadius*targetRadius;
238 
239  double xMin(-targetRadius);
240  double xMax(targetRadius);
241  double dx = (xMax - xMin)/(N*1.0);
242  double dy(dx);
243  double yMin(-targetRadius);
244 
245  double invXSigmaSq(0.0);
246  if (xSigma > 0.0) {invXSigmaSq = 1.0/(xSigma*xSigma);}
247  double invYSigmaSq(0.0);
248  if (ySigma > 0.0) {invYSigmaSq = 1.0/(ySigma*ySigma);}
249 
250  double norm(1.0);
251  if (xSigma > 0.0 && ySigma > 0.0) {
252  norm = 1.0/(M_PI*xSigma*ySigma);
253  }
254 
255  double result(0.0);
256 
257  int i(0), j(0);
258  for (i = 0; i < N1; i++) {
259 
260  double x = dx*i + xMin - x0;
261  double xSq = x*x;
262 
263  for (j = 0; j < N1; j++) {
264 
265  double y = dy*j + yMin - y0;
266  double ySq = y*y;
267 
268  double rSq = xSq + ySq;
269 
270  if (rSq < RSq) {
271 
272  double expPower = -0.5*(xSq*invXSigmaSq + ySq*invYSigmaSq);
273  double expTerm(0.0);
274  if (fabs(expPower) < 30.0) {expTerm = exp(expPower);}
275 
276  result += expTerm*sqrt(RSq - rSq);
277 
278  }
279 
280  } // j
281 
282  } // i
283 
284  // Normalisation
285  result *= norm*dx*dy;
286  std::cout << "Sphere double integral = " << result << std::endl;
287 
288  G4double nSpheres = targetNLambda*targetSpecificLambda/(targetDensity*result);
289  return nSpheres;
290 
291 }
static QCString result
double y
auto norm(Vector const &v)
Return norm of the specified vector.
Definition: group.cpp:53
list x
Definition: train.py:276
QTextStream & endl(QTextStream &s)
G4String LBNEVolumePlacements::GetAbsorberGDMLFilename ( ) const
inline

Definition at line 312 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetAbsorberHallZ ( ) const
inline

Definition at line 176 of file LBNEVolumePlacements.hh.

176 { return fAbsorberHallZ; }
double LBNEVolumePlacements::GetBaffleInnerRadius ( ) const
inline

Definition at line 180 of file LBNEVolumePlacements.hh.

180 { return fBaffleInnerRadius; }
double LBNEVolumePlacements::GetBaffleLength ( ) const
inline

Definition at line 178 of file LBNEVolumePlacements.hh.

178 { return fBaffleLength; }
double LBNEVolumePlacements::GetBaffleWindowThickness ( ) const
inline

Definition at line 179 of file LBNEVolumePlacements.hh.

179 { return fBaffleWindowThickness; }
double LBNEVolumePlacements::GetBaffleZPosition ( ) const
inline

Definition at line 181 of file LBNEVolumePlacements.hh.

181 { return fBaffleZPosition; }
double LBNEVolumePlacements::GetChaseWidthForLBNF ( ) const
inline

Definition at line 1252 of file LBNEVolumePlacements.hh.

1252 { return fChaseWidthForLBNF;}
double LBNEVolumePlacements::GetConductorRadiusHorn1 ( double  zD,
size_t  eqn 
) const
inline

Definition at line 402 of file LBNEVolumePlacements.hh.

402  {
403  if (eqn >= fHorn1Equations.size()) return -1.;
404  return fHorn1Equations[eqn].GetVal(zD);
405  }
std::vector< LBNEHornRadialEquation > fHorn1Equations
double LBNEVolumePlacements::GetConductorRadiusHorn2 ( double  zD,
size_t  eqn 
) const
inline

Definition at line 406 of file LBNEVolumePlacements.hh.

406  {
407  if (eqn >= fHorn2Equations.size()) return -1.;
408  return fHorn2Equations[eqn].GetVal(zD);
409  }
std::vector< LBNEHornRadialEquation > fHorn2Equations
bool LBNEVolumePlacements::GetConstructPlug ( ) const
inline

Definition at line 241 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetConstructPlugInHorn1 ( ) const
inline

Definition at line 242 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetCurrentMilindWire ( ) const
inline

Definition at line 1245 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetDecayHallZ ( ) const
inline

Definition at line 164 of file LBNEVolumePlacements.hh.

164 { return fDecayHallZ; }
G4String LBNEVolumePlacements::GetDecayPipeGas ( ) const
inline

Definition at line 169 of file LBNEVolumePlacements.hh.

169 {return fDecayPipeGas; }
double LBNEVolumePlacements::GetDecayPipeLength ( ) const
inline

Definition at line 165 of file LBNEVolumePlacements.hh.

165 { return fDecayPipeLength; }
double LBNEVolumePlacements::GetDecayPipeLongPosition ( ) const
inline

Definition at line 168 of file LBNEVolumePlacements.hh.

168 { return fDecayPipeLongPosition; }
double LBNEVolumePlacements::GetDecayPipeRadius ( ) const
inline

Definition at line 166 of file LBNEVolumePlacements.hh.

166 { return fDecayPipeRadius; }
double LBNEVolumePlacements::GetDecayPipeUpstrWindowThick ( ) const
inline

Definition at line 167 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetDoInstallShield ( ) const
inline

Definition at line 337 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::GetHorn1AllConductorMaterial ( ) const
inline

Definition at line 173 of file LBNEVolumePlacements.hh.

173 {return fHorn1AllCondMat; }
double LBNEVolumePlacements::GetHorn1DeltaZEntranceToZOrigin ( ) const
inline

Definition at line 324 of file LBNEVolumePlacements.hh.

324 { return -fHorn1LongRescale*3.0*CLHEP::cm;} // To be checked!...
double LBNEVolumePlacements::GetHorn1EffectiveLength ( ) const
inline

Definition at line 323 of file LBNEVolumePlacements.hh.

std::vector<G4String> LBNEVolumePlacements::GetHorn1ICList ( ) const
inline

Definition at line 344 of file LBNEVolumePlacements.hh.

344 {return fHorn1IC;}
std::vector< G4String > fHorn1IC
G4String LBNEVolumePlacements::GetHorn1InnerConductorMaterial ( ) const
inline

Definition at line 170 of file LBNEVolumePlacements.hh.

170 {return fHorn1InnerCondMat; }
double LBNEVolumePlacements::GetHorn1Length ( ) const
inline

Definition at line 177 of file LBNEVolumePlacements.hh.

177 { return fHorn1Length; }
double LBNEVolumePlacements::GetHorn1LongRescale ( ) const
inline

Definition at line 296 of file LBNEVolumePlacements.hh.

296 {return fHorn1LongRescale;}
bool LBNEVolumePlacements::GetHorn1MotherIsPolycone ( ) const
inline

Definition at line 1228 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetHorn1NeckInnerRadius ( ) const
inline

Definition at line 320 of file LBNEVolumePlacements.hh.

320 { return fHorn1NeckInnerRadius; } // same coordinate system..
double LBNEVolumePlacements::GetHorn1NeckLength ( ) const
inline

Definition at line 318 of file LBNEVolumePlacements.hh.

318 { return fHorn1NeckLength; } // ... but rescaled is asked for..
double LBNEVolumePlacements::GetHorn1NeckOuterRadius ( ) const
inline

Definition at line 319 of file LBNEVolumePlacements.hh.

319 { return fHorn1NeckOuterRadius; } // same coordinate system..
double LBNEVolumePlacements::GetHorn1NeckZPosition ( ) const
inline

Definition at line 317 of file LBNEVolumePlacements.hh.

317 { return fHorn1NeckZPosition; } // in Drawing coordinate system
double LBNEVolumePlacements::GetHorn1OuterTubeOuterRad ( ) const
inline

Definition at line 325 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetHorn1PolyInnerConductorRadius ( size_t  numPts) const
inline

Definition at line 454 of file LBNEVolumePlacements.hh.

454  {
455  if (numPts >= static_cast<size_t>(fUseHorn1PolyNumInnerPts)) {
456  G4Exception("GetHorn1PolyInnerConductorRadius", " ", FatalErrorInArgument, "Bad Index");
457  }
458  G4ThreeVector v = fHorn1PolyListRinThickZVects[numPts];
459  return v[0];
460  }
std::vector< G4ThreeVector > fHorn1PolyListRinThickZVects
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
double LBNEVolumePlacements::GetHorn1PolyInnerConductorThickness ( size_t  numPts) const
inline

Definition at line 461 of file LBNEVolumePlacements.hh.

461  {
462  if (numPts >= static_cast<size_t>(fUseHorn1PolyNumInnerPts)) {
463  G4Exception("GetHorn1PolyInnerConductorThickness", " ", FatalErrorInArgument, "Bad Index");
464  }
465  G4ThreeVector v = fHorn1PolyListRinThickZVects[numPts];
466  return v[1];
467  }
std::vector< G4ThreeVector > fHorn1PolyListRinThickZVects
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
double LBNEVolumePlacements::GetHorn1PolyInnerConductorZCoord ( size_t  numPts) const
inline

Definition at line 468 of file LBNEVolumePlacements.hh.

468  {
469  if (numPts >= static_cast<size_t>(fUseHorn1PolyNumInnerPts)) {
470  G4Exception("GetHorn1PolyInnerConductorZCoord", " ", FatalErrorInArgument, "Bad Index");
471  }
472  G4ThreeVector v = fHorn1PolyListRinThickZVects[numPts];
473  return v[2];
474  }
std::vector< G4ThreeVector > fHorn1PolyListRinThickZVects
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
double LBNEVolumePlacements::GetHorn1PolyOuterRadius ( ) const
inline

Definition at line 475 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetHorn1RadialSafetyMargin ( ) const
inline

Definition at line 288 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetHorn1RMaxAllBG ( ) const
inline

Definition at line 1220 of file LBNEVolumePlacements.hh.

1220 {return fHorn1RMaxAllBG;}
double LBNEVolumePlacements::GetHorn1RMinAllBG ( ) const
inline

Definition at line 1219 of file LBNEVolumePlacements.hh.

1219 {return fHorn1RMinAllBG;} // Big radius of inner conductor, inner radius if 1p2 MW
double LBNEVolumePlacements::GetHorn1ZDEndNeckRegion ( ) const
inline

Definition at line 321 of file LBNEVolumePlacements.hh.

321 { return fHorn1ZDEndNeckRegion; } // same coordinate system..
double LBNEVolumePlacements::GetHorn1ZEndIC ( ) const
inline

Definition at line 322 of file LBNEVolumePlacements.hh.

322 { return fHorn1ZEndIC; } // the Z end of the inner conductor, rescaled..
G4String LBNEVolumePlacements::GetHorn2AllConductorMaterial ( ) const
inline

Definition at line 174 of file LBNEVolumePlacements.hh.

174 {return fHorn2AllCondMat; }
double LBNEVolumePlacements::GetHorn2DeltaZEntranceToZOrigin ( ) const
inline

Definition at line 335 of file LBNEVolumePlacements.hh.

std::vector<G4String> LBNEVolumePlacements::GetHorn2ICList ( ) const
inline

Definition at line 345 of file LBNEVolumePlacements.hh.

345 {return fHorn2IC;}
std::vector< G4String > fHorn2IC
G4String LBNEVolumePlacements::GetHorn2InnerConductorMaterial ( ) const
inline

Definition at line 171 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetHorn2LongPosition ( ) const
inline

Definition at line 303 of file LBNEVolumePlacements.hh.

303 { return fHorn2LongPosition; }
double LBNEVolumePlacements::GetHorn2LongRescale ( ) const
inline

Definition at line 298 of file LBNEVolumePlacements.hh.

298 {return fHorn2LongRescale;}
double LBNEVolumePlacements::GetHorn2NeckInnerRadius ( ) const
inline

Definition at line 331 of file LBNEVolumePlacements.hh.

331 { return fHorn2NeckInnerRadius; } // same coordinate system..
double LBNEVolumePlacements::GetHorn2NeckLength ( ) const
inline

Definition at line 329 of file LBNEVolumePlacements.hh.

329 { return fHorn2NeckLength; } // ... but rescaled is asked for..
double LBNEVolumePlacements::GetHorn2NeckOuterRadius ( ) const
inline

Definition at line 330 of file LBNEVolumePlacements.hh.

330 { return fHorn2NeckOuterRadius; } // same coordinate system..
double LBNEVolumePlacements::GetHorn2NeckZPosition ( ) const
inline

Definition at line 328 of file LBNEVolumePlacements.hh.

328 { return fHorn2NeckZPosition; } // in Drawing coordinate system
double LBNEVolumePlacements::GetHorn2OuterTubeOuterRad ( ) const
inline

Definition at line 336 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetHorn2RadialRescale ( )
inline

Definition at line 300 of file LBNEVolumePlacements.hh.

300 {return fHorn2LongRescale;}
double LBNEVolumePlacements::GetHorn2ZEndIC ( ) const
inline

Definition at line 332 of file LBNEVolumePlacements.hh.

332 { return fHorn2ZEndIC; } // the Z end of the inner conductor, rescaled..
double LBNEVolumePlacements::GetHorn2ZEqnChange ( size_t  k) const
inline

Definition at line 333 of file LBNEVolumePlacements.hh.

333 {return fHorn2ZEqnChanges[k]; }
std::vector< G4double > fHorn2ZEqnChanges
size_t LBNEVolumePlacements::GetHorn2ZEqnChangeNumEqn ( ) const
inline

Definition at line 334 of file LBNEVolumePlacements.hh.

334 {return fHorn2ZEqnChanges.size(); }
std::vector< G4double > fHorn2ZEqnChanges
G4String LBNEVolumePlacements::GetHorn3AllConductorMaterial ( ) const
inline

Definition at line 175 of file LBNEVolumePlacements.hh.

175 {return fHorn3AllCondMat; }
G4String LBNEVolumePlacements::GetHorn3InnerConductorMaterial ( ) const
inline

Definition at line 172 of file LBNEVolumePlacements.hh.

size_t LBNEVolumePlacements::GetHornParabolicNumInnerPts ( size_t  iH) const
inline

Definition at line 582 of file LBNEVolumePlacements.hh.

582 { return fMotherHornsAllLengths[iH].size();}
std::vector< std::vector< double > > fMotherHornsAllLengths
double LBNEVolumePlacements::GetHornParabolicRIn ( size_t  iH,
size_t  k 
) const
inline

Definition at line 584 of file LBNEVolumePlacements.hh.

584 { return fMotherHornsAllRads[iH][k];}
std::vector< std::vector< double > > fMotherHornsAllRads
double LBNEVolumePlacements::GetHornParabolicRZCoord ( size_t  iH,
size_t  k 
) const
inline

Definition at line 583 of file LBNEVolumePlacements.hh.

583 { return fMotherHornsAllLengths[iH][k];}
std::vector< std::vector< double > > fMotherHornsAllLengths
double LBNEVolumePlacements::GetHornParabolicThick ( size_t  iH,
size_t  k 
) const
inline

Definition at line 585 of file LBNEVolumePlacements.hh.

585 { return fMotherHornsAllThick[iH][k];}
std::vector< std::vector< double > > fMotherHornsAllThick
double LBNEVolumePlacements::GetHornsOuterTubeOuterRad ( size_t  iH) const
inline

Definition at line 326 of file LBNEVolumePlacements.hh.

326 {return fHornsOuterTubeOuterRad[iH]; }
std::vector< double > fHornsOuterTubeOuterRad
std::vector<double> LBNEVolumePlacements::GetHornsPolyInnerConductorRadiiHornARev2 ( ) const
inline

Definition at line 432 of file LBNEVolumePlacements.hh.

432 {return fRInCoordCDRevisedHornA;}
std::vector< double > fRInCoordCDRevisedHornA
std::vector<double> LBNEVolumePlacements::GetHornsPolyInnerConductorRadiiHornBRev2 ( ) const
inline

Definition at line 439 of file LBNEVolumePlacements.hh.

439 {return fRInCoordCDRevisedHornB;}
std::vector< double > fRInCoordCDRevisedHornB
std::vector<double> LBNEVolumePlacements::GetHornsPolyInnerConductorRadiiHornCRev2 ( ) const
inline

Definition at line 446 of file LBNEVolumePlacements.hh.

446 {return fRInCoordCDRevisedHornC;}
std::vector< double > fRInCoordCDRevisedHornC
double LBNEVolumePlacements::GetHornsPolyInnerConductorRadius ( size_t  iH,
size_t  numPts 
) const
inline

Definition at line 525 of file LBNEVolumePlacements.hh.

525  {
526  if ((iH < 1) || (iH > fUseHornsPolyNumInnerPts.size())) {
527  G4Exception("GetHornsPolyInnerConductorRadius", " ", FatalErrorInArgument, "Illegal Horn number");
528  }
529  std::vector<G4ThreeVector> data = fHornsPolyListRinThickZVects[(iH-1)];
530  if (numPts >= data.size()) {
531  G4Exception("GetHornsPolyInnerConductorRadius", " ", FatalErrorInArgument, "Bad Index");
532  }
533  G4ThreeVector v = data[numPts];
534  return v[0];
535  }
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
double LBNEVolumePlacements::GetHornsPolyInnerConductorThickness ( size_t  iH,
size_t  numPts 
) const
inline

Definition at line 536 of file LBNEVolumePlacements.hh.

536  {
537  if ((iH < 1) || (iH > fUseHornsPolyNumInnerPts.size())) {
538  G4Exception("GetHornsPolyInnerConductorThickness", " ", FatalErrorInArgument, "Illegal Horn number");
539  }
540  std::vector<G4ThreeVector> data = fHornsPolyListRinThickZVects[(iH-1)];
541  if (numPts >= data.size()) {
542  G4Exception("GetHornsPolyInnerConductorThickness", " ", FatalErrorInArgument, "Bad Index");
543  }
544  G4ThreeVector v = data[numPts];
545  return v[1];
546  }
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
double LBNEVolumePlacements::GetHornsPolyInnerConductorZCoord ( size_t  iH,
size_t  numPts 
) const
inline

Definition at line 547 of file LBNEVolumePlacements.hh.

547  {
548  if ((iH < 1) || (iH > fUseHornsPolyNumInnerPts.size())) {
549  G4Exception("GetHorn2PolyInnerConductorZCoord", " ", FatalErrorInArgument, "Illegal Horn number");
550  }
551  std::vector<G4ThreeVector> data = fHornsPolyListRinThickZVects[(iH-1)];
552  if (numPts >= data.size()) {
553  G4Exception("GetHornsPolyInnerConductorZCoord", " ", FatalErrorInArgument, "Bad Index");
554  }
555  G4ThreeVector v = data[numPts];
556  return v[2];
557  }
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::vector<double> LBNEVolumePlacements::GetHornsPolyInnerConductorZsHornARev2 ( ) const
inline

Definition at line 434 of file LBNEVolumePlacements.hh.

434 {return fZCoordCDRevisedHornA;}
std::vector< double > fZCoordCDRevisedHornA
std::vector<double> LBNEVolumePlacements::GetHornsPolyInnerConductorZsHornBRev2 ( ) const
inline

Definition at line 440 of file LBNEVolumePlacements.hh.

440 {return fZCoordCDRevisedHornB;}
std::vector< double > fZCoordCDRevisedHornB
std::vector<double> LBNEVolumePlacements::GetHornsPolyInnerConductorZsHornCRev2 ( ) const
inline

Definition at line 447 of file LBNEVolumePlacements.hh.

447 {return fZCoordCDRevisedHornC;}
std::vector< double > fZCoordCDRevisedHornC
double LBNEVolumePlacements::GetHornsPolyOuterRadius ( size_t  iH) const
inline

Definition at line 558 of file LBNEVolumePlacements.hh.

558  {
559  if ((iH < 1) || (iH > fHornsPolyOuterRadius.size())) {
560  std::cerr << " GetHornsPolyOuterRadius, iH = " << iH << " size of container.. " << fHornsPolyOuterRadius.size() << std::endl;
561  G4Exception("GetHornsPolyOuterRadius", " ", FatalErrorInArgument, "Illegal Horn number");
562  }
563 
564  return fHornsPolyOuterRadius[(iH-1)];
565  }
std::vector< double > fHornsPolyOuterRadius
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
QTextStream & endl(QTextStream &s)
double LBNEVolumePlacements::GetHornsPolyZStartPos ( size_t  iH) const
inline

Definition at line 566 of file LBNEVolumePlacements.hh.

566  {
567  if ((iH < 1) || (iH > fHornsPolyZStartPos.size())) {
568  G4Exception("GetHornsPolyZStartPos", " ", FatalErrorInArgument, "Illegal Horn number");
569  }
570 
571  return fHornsPolyZStartPos[(iH-1)];
572  }
std::vector< double > fHornsPolyZStartPos
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
bool LBNEVolumePlacements::GetInstallBaffle ( ) const
inline

Definition at line 1420 of file LBNEVolumePlacements.hh.

1420 { return fInstallBaffle; }
bool LBNEVolumePlacements::GetInstallDownstTargetSupport ( ) const
inline

Definition at line 1424 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetInstallRALShortTarget ( ) const
inline

Definition at line 1429 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetInstallUpstreamHorizontalTarget ( ) const
inline

Definition at line 1421 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetLengthOfRockDownstreamAlcove ( ) const
inline

Definition at line 198 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::GetMarsTargetHornsGDMLFilename ( ) const
inline

Definition at line 309 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetMaxRadiusMotherHorn1 ( )

Definition at line 3300 of file LBNEVolumePlacements.cc.

3300  {
3301  double maxR=-1.0;
3302  for (size_t k=0; k!= fMotherHorn1AllRads.size(); k++) maxR = std::max(fMotherHorn1AllRads[k], maxR);
3303  return maxR;
3304 }
static int max(int a, int b)
std::vector< double > fMotherHorn1AllRads
double LBNEVolumePlacements::GetMultiSphereTargetRadius ( ) const
inline

Definition at line 1236 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::GetNumberOfHornsPolycone ( ) const
inline

Definition at line 518 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::GetNumberOfInnerHorn2SubSections ( size_t  eqn,
double  z1,
double  z2,
int  nMax 
) const
private

Definition at line 1462 of file LBNEDownstrVolPlacements.cc.

1462  {
1463 
1464  int numSubSect = 1;
1465  double zEnd = z2;
1466  const double zLengthTotal = z2 - z1;
1467  double zLength = zLengthTotal;
1468  while (true) {
1469  const double r0 = fHorn2Equations[eqn].GetVal(z1);
1470  const double r1 = fHorn2Equations[eqn].GetVal(zEnd);
1471  const double rMid = fHorn2Equations[eqn].GetVal((z1 + zEnd)/2.);
1472 // std::cerr << " GetNumberOfInnerHorn2SubSections z1 " << z1 << " zEnd " << zEnd <<
1473 // " r0 " << r0 << " r1 " << r1 << " rMid " << rMid << std::endl;
1474  if (std::abs(rMid - 0.5*(r0+r1)) < 0.050*CLHEP::mm) break; // 50 microns good enough for Gov. work.
1475  // meachanical tolerance is one 5 mills, (127 microns)
1476  zLength /=2.;
1477  zEnd = z1 + zLength;
1478  numSubSect++;
1479  if (numSubSect > nMax) {
1480  G4Exception("LBNEVolumePlacements::PlaceFinalHorn2", " ", FatalErrorInArgument, " Crazy subdivision! ");
1481  break;
1482  }
1483  }
1484  return numSubSect;
1485 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
T abs(T value)
std::vector< LBNEHornRadialEquation > fHorn2Equations
int LBNEVolumePlacements::GetNumberOfInnerHornSubSections ( size_t  eqn,
double  z1,
double  z2,
int  nMax 
) const
private

Definition at line 667 of file LBNEDownstrVolPlacements.cc.

667  {
668 
669  int numSubSect = 1;
670  double zEnd = z2;
671  const double zLengthTotal = z2 - z1;
672  double zLength = zLengthTotal;
673  while (true) {
674  const double r0 = fHorn1Equations[eqn].GetVal(z1);
675  const double r1 = fHorn1Equations[eqn].GetVal(zEnd);
676  const double rMid = fHorn1Equations[eqn].GetVal((z1 + zEnd)/2.);
677 // std::cerr << " GetNumberOfInnerHornSubSections z1 " << z1 << " zEnd " << zEnd <<
678 // " r0 " << r0 << " r1 " << r1 << " rMid " << rMid << std::endl;
679  if (std::abs(rMid - 0.5*(r0+r1)) < 0.050*CLHEP::mm) break; // 50 microns good enough for Gov. work.
680  // meachanical tolerance is one 5 mills, (127 microns)
681  zLength /=2.;
682  zEnd = z1 + zLength;
683  numSubSect++;
684  if (numSubSect > nMax) {
685  G4Exception("LBNEVolumePlacements::GetNumberOfInnerHornSubSections", " ", FatalErrorInArgument, " Crazy subdivision! ");
686  break;
687  }
688  }
689  return numSubSect;
690 }
std::vector< LBNEHornRadialEquation > fHorn1Equations
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
T abs(T value)
double LBNEVolumePlacements::GetPlugInnerRadius ( ) const
inline

Definition at line 183 of file LBNEVolumePlacements.hh.

183 { return fPlugInnerRadius; }
double LBNEVolumePlacements::GetPlugLength ( ) const
inline

Definition at line 182 of file LBNEVolumePlacements.hh.

182 { return fPlugLength; }
std::string LBNEVolumePlacements::GetPlugMaterial ( ) const
inline

Definition at line 186 of file LBNEVolumePlacements.hh.

186 { return fPlugMaterial; }
double LBNEVolumePlacements::GetPlugOuterRadius ( ) const
inline

Definition at line 184 of file LBNEVolumePlacements.hh.

184 { return fPlugOuterRadius; }
double LBNEVolumePlacements::GetPlugZPosition ( ) const
inline

Definition at line 185 of file LBNEVolumePlacements.hh.

185 { return fPlugZPosition; }
double LBNEVolumePlacements::GetRadiusMilindWire ( ) const
inline

Definition at line 1243 of file LBNEVolumePlacements.hh.

1243 {return fRadiusMilindWire;}
double LBNEVolumePlacements::GetRALSimpleTargetLength ( ) const
inline

Definition at line 1432 of file LBNEVolumePlacements.hh.

1432  { return
bool LBNEVolumePlacements::GetRemoveDecayPipeSnout ( ) const
inline

Definition at line 1240 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetRemoveRALBafflet ( ) const
inline

Definition at line 1426 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetRemoveTargetAlltogether ( )
inline

Definition at line 251 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetSimpleTargetHeight ( ) const
inline

Definition at line 245 of file LBNEVolumePlacements.hh.

245 {return fSimpleTargetHeight;}
double LBNEVolumePlacements::GetSimpleTargetLength ( ) const
inline

Definition at line 246 of file LBNEVolumePlacements.hh.

246 {return fSimpleTargetLength;}
double LBNEVolumePlacements::GetSimpleTargetRadius ( ) const
inline

Definition at line 243 of file LBNEVolumePlacements.hh.

243 {return fSimpleTargetRadius;}
double LBNEVolumePlacements::GetSimpleTargetWidth ( ) const
inline

Definition at line 244 of file LBNEVolumePlacements.hh.

244 { return fSimpleTargetWidth;}
double LBNEVolumePlacements::GetTarget2Density ( ) const
inline

Definition at line 1382 of file LBNEVolumePlacements.hh.

1382 { return fTarget2Density; }
double LBNEVolumePlacements::GetTarget2Length ( ) const
inline

Definition at line 1309 of file LBNEVolumePlacements.hh.

1309 {return fTarget2Length;}
G4String LBNEVolumePlacements::GetTarget2MaterialName ( ) const
inline

Definition at line 1388 of file LBNEVolumePlacements.hh.

1388 { return fTarget2MaterialName; }
int LBNEVolumePlacements::GetTarget2ModuleType ( ) const
inline

Definition at line 1271 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::GetTarget2NLambda ( ) const
inline

Definition at line 1366 of file LBNEVolumePlacements.hh.

1366 {return fTarget2NLambda;}
double LBNEVolumePlacements::GetTarget2Radius ( ) const
inline

Definition at line 1301 of file LBNEVolumePlacements.hh.

1301 {return fTarget2Radius;}
double LBNEVolumePlacements::GetTarget2SpecificLambda ( ) const
inline

Definition at line 1385 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetTargetBerylDownstrWindowThick ( ) const
inline

Definition at line 285 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetTargetDensity ( ) const
inline

Definition at line 274 of file LBNEVolumePlacements.hh.

274 { return fTargetDensity; }
double LBNEVolumePlacements::GetTargetFinWidth ( ) const
inline

Definition at line 257 of file LBNEVolumePlacements.hh.

257 { return fTargetFinWidth; }
G4double LBNEVolumePlacements::GetTargetFracOutHornL ( ) const
inline

Definition at line 1358 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetTargetHallZ ( ) const
inline

Definition at line 163 of file LBNEVolumePlacements.hh.

163 { return fTargetHallZ; }
double LBNEVolumePlacements::GetTargetLength ( ) const
inline

Definition at line 1306 of file LBNEVolumePlacements.hh.

1306 {return fTargetLength;}
double LBNEVolumePlacements::GetTargetLengthIntoHorn ( ) const
inline

Definition at line 282 of file LBNEVolumePlacements.hh.

282 { return fTargetLengthIntoHorn; }
G4double LBNEVolumePlacements::GetTargetLengthOutsideExtra ( ) const
inline

Definition at line 1371 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::GetTargetMaterialName ( ) const
inline

Definition at line 280 of file LBNEVolumePlacements.hh.

280 { return fTargetMaterialName; }
int LBNEVolumePlacements::GetTargetModuleType ( ) const
inline

Definition at line 1268 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::GetTargetNLambda ( ) const
inline

Definition at line 1363 of file LBNEVolumePlacements.hh.

1363 {return fTargetNLambda;}
unsigned int LBNEVolumePlacements::GetTargetNumFinsWithWings ( ) const
inline

Definition at line 272 of file LBNEVolumePlacements.hh.

272 { return fTargetNumFinsWithWings; }
unsigned int fTargetNumFinsWithWings
double LBNEVolumePlacements::GetTargetRadius ( ) const
inline

Definition at line 1298 of file LBNEVolumePlacements.hh.

1298 {return fTargetRadius;}
double LBNEVolumePlacements::GetTargetSLengthGraphite ( ) const
inline

Definition at line 255 of file LBNEVolumePlacements.hh.

255 { return fTargetSLengthGraphite; }
double LBNEVolumePlacements::GetTargetSpecificLambda ( ) const
inline

Definition at line 277 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetThickICDRevisedHornA ( ) const
inline

Definition at line 435 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetThickICDRevisedHornB ( ) const
inline

Definition at line 442 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetThickICDRevisedHornC ( ) const
inline

Definition at line 449 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetTotalLengthOfRock ( ) const
inline

Definition at line 191 of file LBNEVolumePlacements.hh.

191 { return fTotalLength;}
bool LBNEVolumePlacements::GetUse1p2MW ( ) const
inline

Definition at line 413 of file LBNEVolumePlacements.hh.

413 { return fUse1p2MW; }
bool LBNEVolumePlacements::GetUse1p2MWSmallTgt ( ) const
inline

Definition at line 416 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseCDR2015Optimized ( ) const
inline

Definition at line 1402 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseHorn1Polycone ( ) const
inline

Definition at line 452 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::GetUseHorn1PolyNumInnerPts ( ) const
inline

Definition at line 453 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::GetUseHornsPolyNumInnerPts ( size_t  i) const
inline

Definition at line 519 of file LBNEVolumePlacements.hh.

519  {
520  if ((i < 1) || (i > fUseHornsPolyNumInnerPts.size())) {
521  G4Exception("GetUseHornsPolyNumInnerPts", " ", FatalErrorInArgument, "Illegal Horn number");
522  }
523  return fUseHornsPolyNumInnerPts[i-1];
524  }
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
bool LBNEVolumePlacements::GetUseLBNFOptimConceptDesignHornA ( ) const
inline

Definition at line 1399 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseLBNFOptimConceptDesignHornB ( ) const
inline

Definition at line 1400 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseLBNFOptimConceptDesignHornC ( ) const
inline

Definition at line 1401 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseMarsTargetHorns ( ) const
inline

Definition at line 306 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseMultiSphereTarget ( ) const
inline

Definition at line 1235 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUsePseudoNova ( ) const
inline

Definition at line 1223 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseRALTGTv1 ( ) const
inline

Definition at line 419 of file LBNEVolumePlacements.hh.

419 { return fUseRALTGTv1; }
bool LBNEVolumePlacements::GetUseRoundedTargetFins ( ) const
inline

Definition at line 423 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseSimpleTargetBox ( ) const
inline

Definition at line 239 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseSimpleTargetCylinder ( ) const
inline

Definition at line 240 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseTarget2Module ( ) const
inline

Definition at line 1261 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetUseTargetModule ( ) const
inline

Definition at line 1258 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::GetWriteGDMLFile ( ) const
inline

Definition at line 1248 of file LBNEVolumePlacements.hh.

1248 {return fWriteGDMLFile;}
double LBNEVolumePlacements::GetZHallHorn1ToHorn1PolyM1 ( )
inline

Definition at line 1404 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::GetZShiftConceptHornAStartIC ( )
inline

Definition at line 1403 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::Horn1InstallSpiderHanger ( const G4String &  name,
double  zFromStartInnerConduct,
double  zPos,
G4PVPlacement *  vMother 
)
private

Definition at line 695 of file LBNEDownstrVolPlacements.cc.

697  {
698 
699  const double in = 2.54*CLHEP::cm;
700  G4String nameStr(nameStrH);nameStr += G4String("Ring");
701  const double length = 0.750*in*fHorn1LongRescale;
702  const int eqnNum = (zLocTweakedDC < (41.076*fHorn1LongRescale*in)) ? 5 : 7;
703  const double zSignLength = (eqnNum == 5) ? -1.0 : 1.0; // to avoid collision with the inner conductor outer radius
704  // at the upstream or downstream end
705  double rTmp1 = fHorn1Equations[eqnNum].GetVal(zLocTweakedDC + length*zSignLength)
706  + 0.0015*CLHEP::mm + fWaterLayerThickInHorns;
707  if (fHorn1RadiusBigEnough) {
708  const double rr = fHorn1Equations[eqnNum].GetVal(zLocTweakedDC + length*zSignLength);
709  if (rr < fHorn1RMinAllBG ) rTmp1 = fHorn1RMinAllBG + 0.0015*CLHEP::mm + fWaterLayerThickInHorns;
710  }
711  const double rTmp2 = rTmp1 + 0.24*in; // Deduced from 363104 and equation 6
712  G4Tubs *aTubs = new G4Tubs(nameStr, rTmp1, rTmp2,
713  length/2. , 0., 360.0*CLHEP::degree);
714  G4LogicalVolume *pCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
715  G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
716  posTmp[2] = zPosMotherVolume;
717  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
718  vMother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
719 
720  //The connecting piece ring to the hangers.. There are three of them, at 120 degrees from each other.
721 
722  G4String nameStr2(nameStrH); nameStr2 += G4String("Riser");
723  const double heightRiser = 0.333*in - 0.020*CLHEP::mm;
724  const double widthH = 1.5*in; // See drawing 8875.112-MD 363115
725  const double thickH = 0.184*2*in;
726  G4Box *aBoxRiser = new G4Box(nameStr2, widthH/2., heightRiser/2.0, thickH/2.0);
727  G4LogicalVolume *pCurrentRiser =
728  new G4LogicalVolume(aBoxRiser, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr2);
729 
730  G4String nameStr3(nameStrH); nameStr3 += G4String("Hanger");
731  const double heightH = fHorn1OuterTubeInnerRad - rTmp2 - 1.0*CLHEP::mm - heightRiser;
732  const double widthH2 = 1.0*in; // 363115 Note: we collapsed both hanger along the horizontal, transverse
733  // direction.
734  const double thickH2 = 0.031*in;
735  G4Box *aBoxHanger = new G4Box(nameStr3, widthH2/2., heightH/2.0, thickH2/2.0);
736  G4LogicalVolume *pCurrentHanger =
737  new G4LogicalVolume(aBoxHanger, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr3);
738 
739  for (int iRot=0; iRot != 3; iRot++) {
740  std::ostringstream rnStrStr; rnStrStr << "_" << (iRot+1);
741  G4String rnStr(rnStrStr.str());
742  // Same Z position as above...
743  G4RotationMatrix * rMatPr = 0;
744  if (iRot == 1) {
745  rMatPr = new G4RotationMatrix;
746  rMatPr->rotateZ(2.0*M_PI/3.);
747  } else if (iRot == 2) {
748  rMatPr = new G4RotationMatrix;
749  rMatPr->rotateZ(-2.0*M_PI/3.);
750  }
751 
752  const double dHRiser = rTmp2 + 0.010*CLHEP::mm + heightRiser/2.;
753  posTmp[0] = 0.; posTmp[1] = dHRiser;
754  if (iRot != 0) {
755  posTmp[0] = dHRiser*rMatPr->xy();
756  posTmp[1] = dHRiser*rMatPr->yy();
757  }
758  if (iRot == 0) {
759  new G4PVPlacement(rMatPr, posTmp, pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
760  vMother->GetLogicalVolume(), false, iRot, fCheckVolumeOverLapWC);
761  } else {
762  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
763  vMother->GetLogicalVolume(), false, iRot, fCheckVolumeOverLapWC);
764  }
765 // Now the hanger it self
766 
767  const double dHHanger = rTmp2 + 0.010*CLHEP::mm + 0.5*CLHEP::mm + heightRiser + heightH/2.;
768  posTmp[0] = 0.; posTmp[1] = dHHanger;
769  if (iRot != 0) {
770  posTmp[0] = dHHanger*rMatPr->xy();
771  posTmp[1] = dHHanger*rMatPr->yy();
772  }
773  // Same Z position as above...
774  if (iRot == 0) {
775  new G4PVPlacement(rMatPr, posTmp, pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
776  vMother->GetLogicalVolume(), false, iRot, fCheckVolumeOverLapWC);
777  } else {
778  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
779  vMother->GetLogicalVolume(), false, iRot, fCheckVolumeOverLapWC);
780  }
781  } // on the 120 degree symmetry point.
782 }
std::vector< LBNEHornRadialEquation > fHorn1Equations
std::string string
Definition: nybbler.cc:12
void LBNEVolumePlacements::Horn1PlaceAWeld ( const G4String &  name,
double  z,
const LBNEVolumePlacementData plInfo,
G4PVPlacement *  vMother 
)
private
void LBNEVolumePlacements::Horn2InstallSpiderHanger ( const G4String &  name,
G4PVPlacement *  vMother 
)
private

Definition at line 1488 of file LBNEDownstrVolPlacements.cc.

1488  {
1489 
1490  const double in = 2.54*CLHEP::cm;
1491  G4String nameStr(nameStrH);nameStr += G4String("Ring");
1492  // Drawing 8875.112-MD 363388 and 363405
1493  const double length = 0.750*in*fHorn2LongRescale;
1494  const int eqnNum = 3;
1495  const double zLocDrawing = fHorn2LongRescale*60.4681*in;
1496  const double rTmp1 = fHorn2Equations[eqnNum].GetVal(zLocDrawing) + 0.015*CLHEP::mm + fWaterLayerThickInHorns;
1497 // const double rTmp2 = fHorn2RadialRescale*11.625*in + fWaterLayerThickInHorns + 0.015*CLHEP::mm; //
1498 // 11.625 inches is the outer diameter of this ring. Not it's radius. Arghh! Feb 4 2014, P. Lebrun
1499  const double rTmp2 = fHorn2RadialRescale*11.625*in/2.0 + fWaterLayerThickInHorns + 0.015*CLHEP::mm + fHorn2RadialRescaleCst; //
1500 // Re instate the error to study it.. Feb 19 2014
1501 // const double rTmp2 = fHorn2RadialRescale*11.625*in + fWaterLayerThickInHorns + 0.015*CLHEP::mm; //
1502 // std::cerr << " LBNEVolumePlacements::Horn2InstallSpiderHanger, radii of the rings.. " << rTmp1 << " " << rTmp2 << std::endl;
1503 // std::cerr << " .... Volume name ... " << nameStr << " ... Aud quit !!! " << std::endl; exit(2);
1504  G4Tubs *aTubs = new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::degree);
1505  G4LogicalVolume *pCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(fHorn2AllCondMat), nameStr);
1506  G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1507  posTmp[2] = fHorn2LongRescale*in*(-0.0180); // computed from drawing 8875.112MD-363388
1508  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1509  vMother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1510 
1511  //The connecting piece ring to the hangers.. There are three of them, at 120 degrees from each other.
1512 
1513  G4String nameStr2(nameStrH); nameStr2 += G4String("Riser");
1514  const double heightRiser = 0.333*in - 0.020*CLHEP::mm;
1515  const double widthH = 1.5*in; // See drawing 8875.112-MD 363115
1516  const double thickH = 0.184*2*in;
1517  G4Box *aBoxRiser = new G4Box(nameStr2, widthH/2., heightRiser/2.0, thickH/2.0);
1518  G4LogicalVolume *pCurrentRiser =
1519  new G4LogicalVolume(aBoxRiser, G4Material::GetMaterial(fHorn2AllCondMat), nameStr2);
1520 
1521  G4String nameStr3(nameStrH); nameStr3 += G4String("Hanger");
1522  const double heightH = fHorn2OuterTubeInnerRad - rTmp2 - 1.0*CLHEP::mm - heightRiser;
1523  const double widthH2 = 1.0*in; // 363115 Note: we collapsed both hanger along the horizontal, transverse
1524  // direction.
1525  const double thickH2 = 0.031*in;
1526  G4Box *aBoxHanger = new G4Box(nameStr3, widthH2/2., heightH/2.0, thickH2/2.0);
1527  G4LogicalVolume *pCurrentHanger =
1528  new G4LogicalVolume(aBoxHanger, G4Material::GetMaterial(fHorn2AllCondMat), nameStr3);
1529 
1530  for (int iRot=0; iRot != 3; iRot++) {
1531  std::ostringstream rnStrStr; rnStrStr << "_" << (iRot+1);
1532  G4String rnStr(rnStrStr.str());
1533  // Same Z position as above...
1534  G4RotationMatrix * rMatPr = 0;
1535  if (iRot == 1) {
1536  rMatPr = new G4RotationMatrix;
1537  rMatPr->rotateZ(2.0*M_PI/3.);
1538  } else if (iRot == 2) {
1539  rMatPr = new G4RotationMatrix;
1540  rMatPr->rotateZ(-2.0*M_PI/3.);
1541  }
1542 
1543  const double dHRiser = rTmp2 + 0.010*CLHEP::mm + heightRiser/2.;
1544  posTmp[0] = 0.; posTmp[1] = dHRiser;
1545  if (iRot != 0) {
1546  posTmp[0] = dHRiser*rMatPr->xy();
1547  posTmp[1] = dHRiser*rMatPr->yy();
1548  }
1549  if (iRot == 0) {
1550  new G4PVPlacement(rMatPr, posTmp, pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
1551  vMother->GetLogicalVolume(), false, iRot, fCheckVolumeOverLapWC);
1552  } else {
1553  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
1554  vMother->GetLogicalVolume(), false, iRot, fCheckVolumeOverLapWC);
1555  }
1556 // Now the hanger it self
1557 
1558  const double dHHanger = rTmp2 + 0.010*CLHEP::mm + 0.5*CLHEP::mm + heightRiser + heightH/2.;
1559  posTmp[0] = 0.; posTmp[1] = dHHanger;
1560  if (iRot != 0) {
1561  posTmp[0] = dHHanger*rMatPr->xy();
1562  posTmp[1] = dHHanger*rMatPr->yy();
1563  }
1564  // Same Z position as above...
1565  if (iRot == 0) {
1566  new G4PVPlacement(rMatPr, posTmp, pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
1567  vMother->GetLogicalVolume(), false, iRot, fCheckVolumeOverLapWC);
1568  } else {
1569  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
1570  vMother->GetLogicalVolume(), false, iRot, fCheckVolumeOverLapWC);
1571  }
1572  } // on the 120 degree symmetry point.
1573 }
std::string string
Definition: nybbler.cc:12
std::vector< LBNEHornRadialEquation > fHorn2Equations
void LBNEVolumePlacements::Initialize ( const G4LogicalVolume *  matriarch)

Definition at line 631 of file LBNEVolumePlacements.cc.

631  {
632 
633  fTopLogicalVolume = matriarch;
634 
635 }
const G4LogicalVolume * fTopLogicalVolume
void LBNEVolumePlacements::InitializeMessenger ( )

Definition at line 625 of file LBNEVolumePlacements.cc.

625  {
626 // std::cerr << " LBNEVolumePlacements::Initialize, about to instantiate PlacementMessengers " << std::endl;
627 // fPlacementMessenger = new LBNEPlacementMessenger();
628 // Why twice ??
629 }
void LBNEVolumePlacements::InitTarget2Module ( )

Definition at line 113 of file LBNFTargetModule.cc.

113  {
114 
115  std::cout << "Initialising the 2nd target module parameters for type = " << fTarget2ModuleType << std::endl;
116  std::cout << "Target2 radius = " << fTarget2Radius << std::endl;
117  std::cout << "Target2 total original length = " << fTarget2Length << std::endl;
118 
119  // Change the target object length if we have set the required number of interaction lengths
120  bool useLambda(false);
121 
122  if (fTarget2NLambda > -1.0 && fTarget2Density > 0.0) {
123 
124  std::cout << "Updating target 2 object length using interaction length info:" << std::endl;
126  std::cout << "Specific lambda = " << fTarget2SpecificLambda*CLHEP::cm2/CLHEP::g
127  << ", rho = " << fTarget2Density*CLHEP::cm3/CLHEP::g << ", NLambda = "
128  << fTarget2NLambda << " => target2 L = " << fTarget2Length << std::endl;
129 
130  useLambda = true;
131 
132  }
133 
134  fNumTarget2Objects = 1;
135 
137 
138  std::cout << "Checking length for 2nd SAT" << std::endl;
139 
140  double tolerance = 0.005*CLHEP::mm; // 5 micron tolerance
141  double diameter = fTarget2Radius*2.0;
142  double NumNominal = fTarget2Length/(diameter + tolerance);
143 
144  // If we have specified the number of interaction lengths, then
145  // find the required number of spheres using the full calculation
146  // given in LBNE-doc-9547 (Quynh) assuming a Gaussian beam
147  if (useLambda) {NumNominal = this->FindNTargetSpheres(2);}
148  std::cout << "Nominal number of spheres = " << NumNominal << std::endl;
149 
150  // Round to nearest integer
151  fNumTarget2Objects = (int) (NumNominal + 0.5);
152  std::cout << "Number of spheres rounded to "<< fNumTarget2Objects <<std::endl;
153 
154  // Update the total "useful" length of the SAT, i.e. the sum of the length of the spheres
156  std::cout << "SAT2 total length adjusted to " << fTarget2Length << std::endl;
157 
158  }
159 
160  // Inner radius of the outer casing
162  std::cout << "Target module 2 inner radius of outer Ti casing = " << fTarget2OutCaseInnerR << std::endl;
163 
164  // The length of the inner canister holding the spheres
166 
167  // The length of the outer target module canister
169 
170  // Total length of the target module, including the end bulb of the outer canister
172  std::cout << "Target module 2 total length = " << fTarget2ModuleTotL << std::endl;
173 
174  // Mirror image 180 degree rotation matrix: rotate around the y axis
175  fMirrorRotation = new G4RotationMatrix();
176  fMirrorRotation->rotateY(180.0*CLHEP::degree);
177 
178  // z displacement for the 2nd target module: depends on length of 1st module
179  fZModuleShift = fTargetModuleTotL + fTarget2OutCaseInnerR + fTargetCaseT + 1.0*CLHEP::mm;
180 
181 }
double const tolerance
G4RotationMatrix * fMirrorRotation
G4double FindNTargetSpheres(int number=1) const
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::InitTargetModule ( )

Definition at line 22 of file LBNFTargetModule.cc.

22  {
23 
24  std::cout << "Initialising the target module parameters for type = " << fTargetModuleType << std::endl;
25  std::cout << "Target radius = " << fTargetRadius << std::endl;
26  std::cout << "Target total original length = " << fTargetLength << std::endl;
27 
28  // Change the target object length if we have set the required number of interaction lengths
29  bool useLambda(false);
30 
31  if (fTargetNLambda > -1.0 && fTargetDensity > 0.0) {
32 
33  std::cout << "Updating target object length using interaction length info:" << std::endl;
35  std::cout << "Specific lambda = " << fTargetSpecificLambda*CLHEP::cm2/CLHEP::g
36  << ", rho = " << fTargetDensity*CLHEP::cm3/CLHEP::g << ", NLambda = "
37  << fTargetNLambda << " => target L = " << fTargetLength << std::endl;
38 
39  useLambda = true;
40 
41  }
42 
44 
46 
47  std::cout << "Checking length for SAT" << std::endl;
48 
49  double tolerance = 0.005*CLHEP::mm; // 5 micron tolerance
50  double diameter = fTargetRadius*2.0;
51  double NumNominal = fTargetLength/(diameter + tolerance);
52 
53  // If we have specified the number of interaction lengths, then
54  // find the required number of spheres using the full calculation
55  // given in LBNE-doc-9547 (Quynh) assuming a Gaussian beam
56  if (useLambda) {NumNominal = this->FindNTargetSpheres(1);}
57  std::cout << "Nominal number of spheres = " << NumNominal << std::endl;
58 
59  // Round to nearest integer
60  fNumTargetObjects = (int) (NumNominal + 0.5);
61  std::cout << "Number of spheres rounded to "<< fNumTargetObjects <<std::endl;
62 
63  // Update the total "useful" length of the SAT, i.e. the sum of the length of the spheres
65  std::cout << "SAT total length adjusted to " << fTargetLength << std::endl;
66 
67  }
68 
69  // The diameter thickness of the supporting rods, which also leaves a gap for He gas flow
70  // in the remaining azimuthal areas. For the cylinder target, we have just the gap, no rods
71  fTargetSupportD = 2.5*CLHEP::mm;
72  std::cout << "Target module support radial thickness = " << fTargetSupportD << std::endl;
73 
74  // Thickness of the titanium tube casings
75  fTargetCaseT = 1.0*CLHEP::mm;
76  std::cout << "Target module Ti casing thickness = " << fTargetCaseT << std::endl;
77 
78  // The He gas gap between the two inner and outer Ti cylindrical casings
79  fTargetHeGap = 4.0*CLHEP::mm;
80  std::cout << "Target module He gap between casings = " << fTargetHeGap << std::endl;
81 
82  // Inner radius of the outer casing
84  std::cout << "Target module inner radius of outer Ti casing = " << fTargetOutCaseInnerR << std::endl;
85 
86  // The length of the inner canister holding the spheres
87  fTargetInCaseUpL = 50.0*CLHEP::mm; // Could also use fTargetRadius if we want to scale the size to rSphere?
88  fTargetInCaseDnL = 5.0*CLHEP::mm;
90 
91  // The length of the outer target module canister
92  fTargetCaseDiffL = 5.0*CLHEP::mm;
94 
95  // Total length of the target module, including the end bulb of the outer canister
97  std::cout << "Target module total length = " << fTargetModuleTotL << std::endl;
98 
99  // Also update the target length outside the horn if we have specified the fraction.
100  // By default, this fraction is not set (=-1), with fTargetLengthOutsideHorn = 450.0 mm.
101  // The length includes the outer canister end regions
102  if (fTargetFracOutHornL > -1.0) {
103 
105  }
106 
107  std::cout << "TargetFracOutHornL = " << fTargetFracOutHornL
108  << ", TargetLengthOutsideHorn = " << fTargetLengthOutsideHorn << std::endl;
109  std::cout << "fTargetLengthOutsideExtra = " << fTargetLengthOutsideExtra << std::endl;
110 
111 }
double const tolerance
G4double FindNTargetSpheres(int number=1) const
QTextStream & endl(QTextStream &s)
LBNEVolumePlacements * LBNEVolumePlacements::Instance ( )
static

Definition at line 57 of file LBNEVolumePlacements.cc.

57  {
59  return fInstance;
60 }
static LBNEVolumePlacements * fInstance
bool LBNEVolumePlacements::IsHorn1PlParabolic ( ) const
inline

Definition at line 579 of file LBNEVolumePlacements.hh.

579  {
581  }
bool LBNEVolumePlacements::IsHorn1RadiusBigEnough ( ) const
inline

Definition at line 290 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::IsHornPnParabolic ( size_t  numHorn) const
inline

Definition at line 576 of file LBNEVolumePlacements.hh.

576  {
577  return fPolyconeHornsAreParabolic[numHorn-1]; // same convention as the other accessors.
578  }
std::vector< bool > fPolyconeHornsAreParabolic
LBNEVolumePlacements& LBNEVolumePlacements::operator= ( LBNEVolumePlacements const &  )
private
G4PVPlacement * LBNEVolumePlacements::PlaceFinal ( const G4String &  name,
G4VPhysicalVolume *  mother 
)

Definition at line 2956 of file LBNEVolumePlacements.cc.

2956  {
2957 
2958  const bool debugIsOn = false;
2959  G4LogicalVolume *lMother=mother->GetLogicalVolume();
2961  if (it == fSubVolumes.end()) {
2962  std::ostringstream mStrStr;
2963  mStrStr << " Internal error for " << name << " Mother Volume not found " << std::endl;
2964  G4String mStr(mStrStr.str());
2965  G4Exception("LBNEVolumePlacements::PlaceFinal", " ", FatalErrorInArgument, mStr.c_str());
2966  }
2967  std::string surveyedPtName("blank");
2968  if (debugIsOn) std::cerr << " LBNEVolumePlacements::PlaceFinal, name is " << name << std::endl;
2969  // List of suported cases, nomenclature confusion.. Otherwise, name Surveyed point would get too long.
2970  if (name == G4String("UpstreamTargetAssembly")) surveyedPtName = std::string("Canister");
2971  if (name == G4String("TargetUpstrDownstrHeContainer")) surveyedPtName = std::string("HeTube");
2972  if (name == G4String("Horn1TargetDownstrHeContainer")) surveyedPtName = std::string("HeTube");
2973  if (name == G4String("Horn1TopLevelUpstr")) surveyedPtName = std::string("Horn1");
2974  if (name == G4String("Horn1TopLevelDownstr")) surveyedPtName = std::string("Horn1");
2975  // Simplified geometry, Horn1 Mother volume is polycone and contains the entire Horn1
2976  if (name == G4String("TargetNoSplitHeContainer")) surveyedPtName = std::string("HeTube");
2977  if (name == G4String("Horn1PolyM1")) surveyedPtName = std::string("Horn1");
2978  if (name == G4String("LBNFSimpleHorn1Container")) surveyedPtName = std::string("Horn1");
2979  if (name == G4String("LBNFSimpleHorn2Container")) surveyedPtName = std::string("Horn2");
2980  if (name == G4String("LBNFSimpleHorn3Container")) surveyedPtName = std::string("Horn3");
2981  if (name == G4String("Horn2Hall")) surveyedPtName = std::string("Horn2");
2982  if (name == G4String("DecayPipeHall")) surveyedPtName = std::string("DecayPipe");
2983 
2984  LBNEVolumePlacementData &info=it->second;
2985  info.fMother = mother;
2986  LBNESurveyor* theSurvey = LBNESurveyor::Instance();
2987  std::vector<double> posA(3,0.);
2988  for (size_t k=0; k!=3; ++k) posA[k] = info.fPosition[k];
2989  if (debugIsOn) std::cerr << " LBNEVolumePlacements::PlaceFinal, Prior to alignment " << name << " half size "
2990  << info.fParams[2]/2. << " position X " << info.fPosition[0]
2991  << " Y " << info.fPosition[1] << " Z " << info.fPosition[2] << std::endl;
2992  if (theSurvey->size() != 0) {
2993  G4ThreeVector deltaUpstrLeft(0., 0., 0.);
2994  G4ThreeVector deltaUpstrRight(0., 0., 0.);
2995  G4ThreeVector deltaDownstrLeft(0., 0., 0.);
2996  G4ThreeVector deltaDownstrRight(0., 0., 0.);
2997  std::vector<double> deltaUpstr(3, 0.);
2998  std::vector<double> deltaDownstr(3, 0.);
2999  std::vector<double> deltaSlopes(2, 0.);
3000  // This code could be optimize a bit, by removing extra vector copies..
3001  for(std::vector<LBNESurveyedPt>::const_iterator itSurv = theSurvey->begin();
3002  itSurv != theSurvey->end(); itSurv++) {
3003  if (itSurv->GetName().find(surveyedPtName) == std::string::npos) continue;
3004  if (itSurv->GetName().find("Upstr") != std::string::npos) {
3005  if (itSurv->GetName().find("Left") != std::string::npos) deltaUpstrLeft = itSurv->GetPosition();
3006  else if (itSurv->GetName().find("Right") != std::string::npos) deltaUpstrRight = itSurv->GetPosition();
3007  } else if (itSurv->GetName().find("Downstr") != std::string::npos) {
3008  if (itSurv->GetName().find("Left") != std::string::npos) deltaDownstrLeft = itSurv->GetPosition();
3009  else if (itSurv->GetName().find("Right") != std::string::npos) deltaDownstrRight = itSurv->GetPosition();
3010  }
3011  }
3012  for (size_t k=0; k != 3; ++k) {
3013  if ((std::abs(deltaUpstrLeft[k]) > 2.0e-3*CLHEP::mm) && (std::abs(deltaUpstrLeft[k]) > 2.0e-3*CLHEP::mm))
3014  deltaUpstr[k] = 0.5*(deltaUpstrLeft[k] + deltaUpstrRight[k]);
3015  else if (std::abs(deltaUpstrLeft[k]) > 2.0e-3*CLHEP::mm) deltaUpstr[k] = deltaUpstrLeft[k];
3016  else if (std::abs(deltaUpstrRight[k]) > 2.0e-3*CLHEP::mm) deltaUpstr[k] = deltaUpstrRight[k];
3017  if ((std::abs(deltaDownstrLeft[k]) > 2.0e-3*CLHEP::mm) && (std::abs(deltaDownstrLeft[k]) > 2.0e-3*CLHEP::mm))
3018  deltaDownstr[k] = 0.5*(deltaDownstrLeft[k] + deltaDownstrRight[k]);
3019  else if (std::abs(deltaDownstrLeft[k]) > 2.0e-3*CLHEP::mm) deltaDownstr[k] = deltaDownstrLeft[k];
3020  else if (std::abs(deltaDownstrRight[k]) > 2.0e-3*CLHEP::mm) deltaDownstr[k] = deltaDownstrRight[k];
3021  // Special case for the Helium tube that contains the target segments:
3022  // Only the dowstream measurements make sense
3023  if ((name == "TargetUpstrDownstrHeContainer") || (name == "Horn1TargetDownstrHeContainer")) {
3024 // if (std::abs(deltaUpstr[k]) > 2.0e-3*CLHEP::mm) {
3025 // std::cerr << " LBNEVolumePlacements::PlaceFinal The upstream section of the He Container is misaligned." << std::endl;
3026 // std::cerr << " This makes little sense from a mechanical point of view. " << std::endl;
3027 // std::cerr << " Suggested action: misaling the target canister instead. " << std::endl;
3028 // std::cerr << " Meanwhile, setting the deltaUpstream to 0. " << std::endl;
3029 // deltaUpstr[k] = 0.;
3030 // }
3031  }
3032  if (k != 2) {// Case by case for composite volumes..
3033  if (surveyedPtName == std::string("Horn1")) {
3034  const double aTotalLength = fHorn1TopUpstrLength + fHorn1TopDownstrLength;
3035 
3036  deltaSlopes[k] = (deltaDownstr[k] - deltaUpstr[k])/aTotalLength;
3037  if(name == G4String("Horn1TopLevelUpstr")) {
3038  info.fPosition[k] += deltaUpstr[k] + deltaSlopes[k]*(fHorn1TopUpstrLength/2.) ;
3039  } else if(name == G4String("Horn1TopLevelDownstr")) {
3040  info.fPosition[k] += deltaUpstr[k] + deltaSlopes[k]*
3041  (fHorn1TopUpstrLength + fHorn1TopDownstrLength/2.) ;
3042  }
3043  } else { //generic surveyed volume .
3044 // std::cerr << " Valgrind unhappy, LBNEVolumePlacements, line 2251, k " <<
3045 // k << " deltas " << deltaUpstr[k] << " " << deltaDownstr[k] << std::endl;
3046 // Valgrind too picky. Things are properly initialized in std::vector constructor.
3047  info.fPosition[k] += 0.5*(deltaUpstr[k] + deltaDownstr[k]);
3048  deltaSlopes[k] = (deltaDownstr[k] - deltaUpstr[k])/info.fParams[2];
3049  }
3050  }
3051  }
3052 // Valgrind too picky. Things are properly initialized in std::vector constructor.
3053  if ((std::abs(deltaSlopes[0]) > 2.0e-9) || (std::abs(deltaSlopes[1]) > 2.0e-9)) {
3054  info.fRotationIsUnitMatrix = false;
3055  info.fRotation.rotateY(-1.0*deltaSlopes[0]); // change sign??????
3056  info.fRotation.rotateX(deltaSlopes[1]); // rotation in the YZ plane, axis is then X Commutative for small angles..
3057  // Shift the volume longitudinally if a signficant slope exists.
3058  const double maxSlope = std::max(std::abs(deltaSlopes[0]), std::abs(deltaSlopes[1]));
3059  // assume they are tubes..for now, all surveyed points are assigned to tubes..Shift everything downstream
3060  // (an convention arbitrary convention!...)
3061  info.fParams[2] += std::sin(maxSlope)*info.fParams[1];
3062  // Note: position might have to revised as well.. On a case by case basis?
3063  }
3064  } // End of alignment.
3065  if (debugIsOn) std::cerr << " LBNEVolumePlacements::PlaceFinal, " << name << " half size "
3066  << info.fParams[2]/2. << " position X " << info.fPosition[0]
3067  << " Y " << info.fPosition[1] << " Z " << info.fPosition[2] << std::endl;
3069  fSubVolumes.find(lMother->GetName());
3070  if (itMother != fSubVolumes.end()) {
3071 // LBNEVolumePlacementData &infoMother=itMother->second;
3072 // std::cerr << " .... Params for mother ";
3073 // for (size_t k=0; k!= infoMother.fParams.size(); k++) std::cerr << " " << infoMother.fParams[k] << ",";
3074 // std::cerr << " . " << std::endl;
3075 
3076  }
3077  G4PVPlacement *placement=0;
3078  G4String vpName(name); vpName += G4String("_P");
3079  if (name == "Horn1IOTransCont") {
3080  std::cerr << " PlaceFinal, Z-offset for " << name << " is " << info.fPosition << std::endl;
3081  }
3082 // std::cerr << " PlaceFinal , " << info.fCurrent->GetName() << " Last Position "
3083 // << info.fPosition << " Length " << info.fParams[2] << std::endl;
3084  if (info.fRotationIsUnitMatrix)
3085  placement=new G4PVPlacement((G4RotationMatrix *) 0,
3086  info.fPosition, info.fCurrent, vpName, lMother, false, 0, fCheckVolumeOverLapWC);
3087  else {
3088  std::cerr << " Rotated element, slope X= " << info.fRotation.xz() << " Y "
3089  << info.fRotation.yz() << std::endl;
3090  placement=new G4PVPlacement(&info.fRotation, info.fPosition, info.fCurrent,
3091  vpName, lMother, false, 0, fCheckVolumeOverLapWC);
3092  }
3093 // std::cerr << " PlaceFinal, done for volume " << name << std::endl;
3094  info.fIsPlaced = true;
3095  // Optionally, we could test for overlap after installing each new volume here.
3096  return placement;
3097 }
static QCString name
Definition: declinfo.cpp:673
intermediate_table::iterator iterator
std::vector< LBNESurveyedPt >::const_iterator end() const
std::string string
Definition: nybbler.cc:12
intermediate_table::const_iterator const_iterator
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
T abs(T value)
std::vector< double > fParams
static LBNESurveyor * Instance()
G4VPhysicalVolume * fMother
size_t size() const
static int max(int a, int b)
if(!yymsg) yymsg
std::vector< LBNESurveyedPt >::const_iterator begin() const
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceFinalDecayPipeSnout ( G4PVPlacement *  mother)

Definition at line 1387 of file LBNEDownstrVolPlacements.cc.

1387  {
1388 
1389  // ref : Drawing number 2251-000-ME-487107 and phone converstion with Glenn Waver (MD/AD)
1390  const double in = 2.54*CLHEP::cm;
1391  G4PVPlacement* vTop = this->PlaceFinal(G4String("DecayPipeSnout"), tunnel);
1392  const LBNEVolumePlacementData *plInfoTop = this->Find(G4String("Snout"), G4String("DecayPipeSnout"),
1393  G4String("LBNEVolumePlacements::PlaceFinalDecayPipeSnout"));
1394  //
1395  // The window is tilted, true vertical. Pick the rotation. Create a rotated buffer volume
1396  //
1397  LBNERunManager *pRunManager=static_cast<LBNERunManager*> (LBNERunManager::GetRunManager());
1398  const LBNEDetectorConstruction *pDet =
1399  static_cast<const LBNEDetectorConstruction*> (pRunManager->GetUserDetectorConstruction());
1400  G4double angle = pDet->GetBeamlineAngle();
1401  G4RotationMatrix *beamAngleRot = new G4RotationMatrix;
1402  beamAngleRot->rotateX(-angle);
1403 // std::cerr << " Window angle, yz term " << beamAngleRot->yz() << " yy "
1404 // << beamAngleRot->yy() << " zz " << beamAngleRot->zz() << std::endl;
1405  double boxX = 50.0*in + 0.1*CLHEP::mm;
1406  double boxY = 48.0*in + 0.1*CLHEP::mm;
1407  double boxZ = 24.0*in + 0.1*CLHEP::mm;
1408  G4String boxCStr("DecayPipeUpstrWindowCont");
1409  G4Box* aBoxC = new G4Box(boxCStr, boxX/2., boxY/2., boxZ/2.);
1410  G4LogicalVolume *contL = new G4LogicalVolume(aBoxC, G4Material::GetMaterial("DecayPipeGas"), boxCStr);
1411  G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =0.;
1412  posTmp[2] = -plInfoTop->fParams[2]/2 + boxZ/2. + 0.5*CLHEP::cm; // approximate location, but accurate enough
1413  posTmp[2] += 25.0*in*std::abs( beamAngleRot->yz()); // inclined! Shift a bit upstream
1414 // std::cerr << " Position of the rotated container " << posTmp[2] << std::endl;
1415  G4PVPlacement *vCont = new G4PVPlacement(beamAngleRot, posTmp, contL, boxCStr + std::string("_P"),
1416  vTop->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1417 // if air, we stop here, the aluminum window and the window itself don't exist.
1418 // (3.5 million bugs saving, I am told..)
1419 
1420  if (fDecayPipeGas == G4String("Air")) return;
1421  boxX -= 0.1*CLHEP::mm;
1422  boxY -= 0.1*CLHEP::mm;
1423  boxZ -= 0.1*CLHEP::mm;
1424  G4String boxFStr("DecayPipeUpstrWindowFrame");
1425  G4Box* aBoxF = new G4Box(boxFStr, boxX/2., boxY/2., boxZ/2.);
1426  G4LogicalVolume *frameL = new G4LogicalVolume(aBoxF, G4Material::GetMaterial("Aluminum"), boxFStr);
1427  posTmp[0] =0.; posTmp[1] =0.; posTmp[2] =0.;
1428  G4PVPlacement *vFrame = new G4PVPlacement((G4RotationMatrix *) 0, posTmp,
1429  frameL, boxFStr + std::string("_P"),
1430  vCont->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1431 
1432  G4String holeFStr("DecayPipeUpstrWindowHole");
1433  double holeRadius= fDecayPipeWindowRadiusAlum + 0.01*CLHEP::mm;
1434  G4Tubs* holeR = new G4Tubs(holeFStr, 0., holeRadius, boxZ/2., 0., 360.0*CLHEP::degree);
1435  // The upstream part is Air..
1436  G4LogicalVolume *holeL = new G4LogicalVolume(holeR, G4Material::GetMaterial("Air"),holeFStr);
1437  G4PVPlacement *vHole = new G4PVPlacement((G4RotationMatrix *) 0, posTmp,
1438  holeL, holeFStr + std::string("_P"),
1439  vFrame->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1440 //
1441  G4String windAlumStr("DecayPipeUpstrWindowAlum");
1442  G4Tubs* windAlum = new G4Tubs(windAlumStr, fDecayPipeWindowRadiusBeryl,
1443  fDecayPipeWindowRadiusAlum , fDecayPipeWindowThickAlum/2., 0., 360.0*CLHEP::degree);
1444  // The upstream part is Air..
1445  G4LogicalVolume *windAlumL = new G4LogicalVolume(windAlum, G4Material::GetMaterial("Aluminum"), windAlumStr);
1446  posTmp[2] = -boxZ/2. + 17.1*in + 3.0*CLHEP::mm; // first number picked up from drawing. We place the Alum a bit behind..
1447  new G4PVPlacement((G4RotationMatrix *) 0, posTmp,
1448  windAlumL, windAlumStr + std::string("_P"),
1449  vHole->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1450 
1451  G4String windBerylStr("DecayPipeUpstrWindowBeryl");
1452  G4Tubs* windBeryl = new G4Tubs(windBerylStr, 0.,
1453  fDecayPipeWindowRadiusBeryl , fDecayPipeWindowThickBeryl/2., 0., 360.0*CLHEP::degree);
1454  // The upstream part is Air..
1455  G4LogicalVolume *windBerylL = new G4LogicalVolume(windBeryl, G4Material::GetMaterial("Beryllium"), windBerylStr);
1456  posTmp[2] = -boxZ/2. + 17.1*in + 1.0*CLHEP::mm; // first number picked up from drawing.
1457  new G4PVPlacement((G4RotationMatrix *) 0, posTmp,
1458  windBerylL, windBerylStr + std::string("_P"),
1459  vHole->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1460 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
T abs(T value)
std::vector< double > fParams
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
void LBNEVolumePlacements::PlaceFinalDownstrTarget ( G4PVPlacement *  mother)

Definition at line 46 of file LBNEDownstrVolPlacements.cc.

46  {
47 
48  if (fUse1p2MW) {
50  return;
51  }
52 
53  Create("Horn1TargetDownstrHeContainer");
54  G4PVPlacement *vMTop = PlaceFinal(std::string("Horn1TargetDownstrHeContainer"), mother);
55  LBNEVolumePlacementData *plDowstrHe = Create("Horn1TargetDownstrHelium");
56  G4PVPlacement *vMHe = PlaceFinal(std::string("Horn1TargetDownstrHelium"), vMTop);
57  // Deal with alignment ring located in the dowstream part of the target. We assume here that
58  // they have been already defined while dealing with the Upstream target portion
59  // First alignment ring, locate flush with the end plate (within 1 mm ) , left and right
60  std::map<G4String, LBNEVolumePlacementData>::iterator itTmpRLeft = fSubVolumes.find(G4String("TargetAlignmentRingLeft"));
61  LBNEVolumePlacementData &infoTmpRLeft = itTmpRLeft->second;
62  std::map<G4String, LBNEVolumePlacementData>::iterator itTmpRRight = fSubVolumes.find(G4String("TargetAlignmentRingRight"));
63  LBNEVolumePlacementData &infoTmpRRight = itTmpRRight->second;
64  std::map<G4String, LBNEVolumePlacementData>::iterator itM1 = fSubVolumes.find(G4String("TargetUpstrDownstrHelium"));
65  LBNEVolumePlacementData *plM1 = &itM1 ->second;
66  std::map<G4String, LBNEVolumePlacementData>::iterator itMother = fSubVolumes.find(G4String("Horn1TargetDownstrHelium"));
67  LBNEVolumePlacementData *plMother = &itMother ->second;
68  G4ThreeVector posTmp;
69  posTmp[0] = 0.; // The alignment rings are always centered..
70  posTmp[1] = 0.; // We start upstream to keep the separation among rings.
71  posTmp[2] = -1.0*plM1->fParams[2]/2.0 + infoTmpRLeft.fParams[2]/2. + 1.0*CLHEP::mm; // 1 mm spacing Left and right have the same thickness.
72  int copyNumber = 0;
73  int copyNumberHere = 0;
74  bool transitionDone = false;
75  while (true) {
76  if (!transitionDone) {
77  posTmp[2] += fTargetAlignRingSpacing;
78  copyNumber++;
79  if (posTmp[2] > plM1->fParams[2]/2.0) {
80  transitionDone = true;
81  const double offset = posTmp[2] - plM1->fParams[2]/2.0;
82  posTmp[2] = -1.0*plMother->fParams[2]/2.0 + infoTmpRLeft.fParams[2]/2. + offset ;
83  }
84  } else {
85  std::ostringstream cNumStrStr; cNumStrStr << "_P" << copyNumber;
86  if (copyNumber == (fMaxNumAlignRings -1)) {
87  // retract the last one a bit by 5 mm to place the return cooling pipe.
88  posTmp[2] -= 10.0*CLHEP::mm;
89  }
90  new G4PVPlacement((G4RotationMatrix *) 0,
91  posTmp, infoTmpRLeft.fCurrent, G4String("TargetAlignmentRingLeft")+cNumStrStr.str(),
92  vMHe->GetLogicalVolume(), false, copyNumberHere, fCheckVolumeOverLapWC);
93  new G4PVPlacement((G4RotationMatrix *) 0,
94  posTmp, infoTmpRRight.fCurrent, G4String("TargetAlignmentRingRight")+ cNumStrStr.str(),
95  vMHe->GetLogicalVolume(), false, copyNumberHere, fCheckVolumeOverLapWC);
96  posTmp[2] += fTargetAlignRingSpacing;
97  copyNumber++; copyNumberHere++;
98  if ( copyNumber == fMaxNumAlignRings) break;
99  }
100  }
101  // Deal with the first, split, target segment.
102  LBNEVolumePlacementData *infoTargSegFirst = 0;
103  if (fTargetFinLengthSplitDwnstr > 0.3*CLHEP::mm) {
104  infoTargSegFirst = Create("Horn1TargetSegmentFirst");
105  G4PVPlacement *vTargSegFirst = PlaceFinal("Horn1TargetSegmentFirst", vMHe);
106  Create("Horn1TargetFinVertFirst");
107  LBNEVolumePlacementData * plCoolingTubeFirst = Create("Horn1TargetCoolingTubeFirst");
108  Create("Horn1TargetCoolingTubeFirstWater");
109  posTmp[0] = 0.; posTmp[1] = fTargetFinHeight/2.; posTmp[2] = 0.;
110  G4PVPlacement *vTubeUp = new G4PVPlacement((G4RotationMatrix *) 0,
111  posTmp, plCoolingTubeFirst->fCurrent,
112  G4String("Horn1TargetSegmentCoolingTubeFirst_PTop"),
113  vTargSegFirst->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
114  posTmp[1] = -1.0*fTargetFinHeight/2.;
115  G4PVPlacement *vTubeDown = new G4PVPlacement((G4RotationMatrix *) 0,
116  posTmp, plCoolingTubeFirst->fCurrent,
117  G4String("Horn1TargetSegmentCoolingTubeFirst_PBottom"),
118  vTargSegFirst->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
119  PlaceFinal("Horn1TargetCoolingTubeFirstWater", vTubeDown);
120  PlaceFinal("Horn1TargetCoolingTubeFirstWater", vTubeUp);
121  PlaceFinal("Horn1TargetFinVertFirst", vTargSegFirst);
122 //
123 // Oct. 29 2013 : add the 4 corners as well (overzealous, too much complexity already.. but makes vis. complete..
124 //
125  LBNEVolumePlacementData *plTargetFinCorDFUpLeft =
126  Create(G4String("TargetFinVertCornerDownstrFirstUpLeft"));
127  LBNEVolumePlacementData *plTargetFinCorDFUpRight =
128  Create(G4String("TargetFinVertCornerDownstrFirstUpRight"));
129  LBNEVolumePlacementData *plTargetFinCorDFDwnLeft =
130  Create(G4String("TargetFinVertCornerDownstrFirstDwnLeft"));
131  LBNEVolumePlacementData *plTargetFinCorDFDwnRight =
132  Create(G4String("TargetFinVertCornerDownstrFirstDwnRight"));
133 
134  posTmp[0] = -fTargetFinWidth/4.;
135  posTmp[1] = fTargetFinHeight/2. - fTargetCTubeOuterRadius/2. + 0.125*CLHEP::mm;
136  posTmp[2] = 0.;
137  new G4PVPlacement((G4RotationMatrix *) 0,
138  posTmp, plTargetFinCorDFUpLeft->fCurrent,
139  G4String("Horn1TargetFinVertCornerDownstrFirstUpLeft_P"),
140  vTargSegFirst->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
141  posTmp[0] = fTargetFinWidth/4.; posTmp[1] = fTargetFinHeight/2. - fTargetCTubeOuterRadius/2. + 0.125*CLHEP::mm;
142  new G4PVPlacement((G4RotationMatrix *) 0,
143  posTmp, plTargetFinCorDFUpRight->fCurrent,
144  G4String("Horn1TargetFinVertCornerDownstrFirstUpRight_P"),
145  vTargSegFirst->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
146 
147  posTmp[0] = -fTargetFinWidth/4.; posTmp[1] = -1.0*(fTargetFinHeight/2. - fTargetCTubeOuterRadius/2. + 0.125*CLHEP::mm);
148  new G4PVPlacement((G4RotationMatrix *) 0,
149  posTmp, plTargetFinCorDFDwnLeft->fCurrent,
150  G4String("Horn1TargetFinVertCornerDownstrFirstDwnLeft_P"),
151  vTargSegFirst->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
152  posTmp[0] = fTargetFinWidth/4.; posTmp[1] = -1.0*(fTargetFinHeight/2. - fTargetCTubeOuterRadius/2. + 0.125*CLHEP::mm);
153  new G4PVPlacement((G4RotationMatrix *) 0,
154  posTmp, plTargetFinCorDFDwnRight->fCurrent,
155  G4String("Horn1TargetFinVertCornerDownstrFirstDwnRight_P"),
156  vTargSegFirst->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
157 
158  }
159  // Now place the previously defined standard target segment. Note: they already contain their cooling and
160  // real target.
161 // LBNEVolumePlacementData *plHorn1TargetSegment = Create("Horn1TargetSegment");
162  std::map<G4String, LBNEVolumePlacementData>::iterator itTargSeg = fSubVolumes.find(G4String("TargetUpstrDownstrSegment"));
163  LBNEVolumePlacementData *plTargetUpstrDownstrSegment= &itTargSeg->second;
164 
165  double zCoordTmp = (infoTargSegFirst == 0) ?
166  (-1.0*plDowstrHe->fParams[2]/2. + plTargetUpstrDownstrSegment->fParams[2]/2. + 0.005*CLHEP::mm) :
167  ( infoTargSegFirst->fPosition[2] + infoTargSegFirst->fParams[2]/2. +
168  plTargetUpstrDownstrSegment->fParams[2]/2. + 0.002*CLHEP::mm);
169  for (int iSeg=0; iSeg != fTargetNumFinsInHorn; iSeg++) { // Place with no misalignment
170  posTmp[0] = 0.; posTmp[1] = 0.;
171  posTmp[2] = zCoordTmp;
172 // std::cerr << " In Horn1, Positioning target segment " << iSeg << " at Z = zCoord " << zCoordTmp << std::endl;
173  std::ostringstream cNumStrStr; cNumStrStr << "_P" << iSeg;
174  new G4PVPlacement((G4RotationMatrix *) 0,
175  posTmp, plTargetUpstrDownstrSegment->fCurrent,
176  G4String("Horn1TargetSegment")+cNumStrStr.str(),
177  vMHe->GetLogicalVolume(), false, iSeg+100, fCheckVolumeOverLapWC);
178  zCoordTmp += (fTargetFinLength + fTargetFinSpacingLength);
179  }
180  // Now the end
181  LBNEVolumePlacementData *plCoolingTubeReturn = Create("Horn1TargetCoolingTubeDwnRetTit");
182  posTmp[0] = 0.; posTmp[1] = 0.;
183  posTmp[2] = plDowstrHe->fParams[2]/2 -
185  // Hopefully some roo to spare..
186  new G4PVPlacement(&plCoolingTubeReturn->fRotation,
187  posTmp, plCoolingTubeReturn->fCurrent,
188  G4String("Horn1TargetCoolingTubeDwnRetTit_PFront"),
189  vMHe->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
190  posTmp[2] = plDowstrHe->fParams[2]/2 - 0.5*fTargetCTubeReturnDownstrThickTitanium/2. - 1.3*CLHEP::mm;
191  new G4PVPlacement(&plCoolingTubeReturn->fRotation,
192  posTmp, plCoolingTubeReturn->fCurrent,
193  G4String("Horn1TargetCoolingTubeDwnRetTit_PBack"),
194  vMHe->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
195 
196  Create("Horn1TargetCoolingTubeDwnRetWater");
197  PlaceFinal("Horn1TargetCoolingTubeDwnRetWater", vMHe);
198 
199  Create("Horn1TargetDownstrHeContainerCap");
200  PlaceFinal("Horn1TargetDownstrHeContainerCap", vMHe);
201 }
intermediate_table::iterator iterator
void PlaceFinalDownstrTarget1p2MW(G4PVPlacement *mother)
std::string string
Definition: nybbler.cc:12
G4double fTargetCTubeReturnDownstrThickTitanium
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
std::vector< double > fParams
LBNEVolumePlacementData * Create(const G4String &name)
G4double fTargetCTubeReturnDownstrThickWater
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
void LBNEVolumePlacements::PlaceFinalDownstrTarget1p2MW ( G4PVPlacement *  mother)
private

Definition at line 749 of file LBNEVolumePlacementsAdd.cc.

749  {
750 
751  std::cerr << " LBNEVolumePlacements::PlaceFinalDownstrTarget1p2MW, Obsolete, do not use .. " << std::endl;
752  exit(2);
753  Create("Horn1TargetDownstrHeContainer");
754  G4PVPlacement *vMTop = PlaceFinal(std::string("Horn1TargetDownstrHeContainer"), mother);
755  LBNEVolumePlacementData *plDowstrHe = Create("Horn1TargetDownstrHelium");
756  G4PVPlacement *vMHe = PlaceFinal(std::string("Horn1TargetDownstrHelium"), vMTop);
757  // Skip the alignment ring for now..
758  // Deal with alignment ring located in the dowstream part of the target. We assume here that
759  // they have been already defined while dealing with the Upstream target portion
760  // First alignment ring, locate flush with the end plate (within 1 mm ) , left and right
761 // std::map<G4String, LBNEVolumePlacementData>::iterator itTmpRLeft = fSubVolumes.find(G4String("TargetAlignmentRingLeft"));
762 // LBNEVolumePlacementData &infoTmpRLeft = itTmpRLeft->second;
763 // std::map<G4String, LBNEVolumePlacementData>::iterator itTmpRRight = fSubVolumes.find(G4String("TargetAlignmentRingRight"));
764 // LBNEVolumePlacementData &infoTmpRRight = itTmpRRight->second;
765  std::map<G4String, LBNEVolumePlacementData>::iterator itMother = fSubVolumes.find(G4String("Horn1TargetDownstrHelium"));
766 // LBNEVolumePlacementData *plMother = &itMother ->second;
767 // if (fUseSimpleTargetCylinder) {
768 // PlaceFinalDownstrTargetSimpleCylinder(plMother, vMHe);
769 // return;
770 // }
771  LBNEVolumePlacementData *plTargetFinExtra = 0;
772  if (fTargetFinExtraWidth > 0.) {
773  std::map<G4String, LBNEVolumePlacementData>::iterator itM5 = fSubVolumes.find(G4String("TargetFinVertExtra"));
774  plTargetFinExtra = &itM5->second;
775  }
776 
777  G4ThreeVector posTmp(3, 0.);
778  LBNEVolumePlacementData *infoTargSegFirstLeft = 0;
779  G4String nameTgtUpDownSegFirst("Horn1TargetDownstrSegmentFirst");
780  if (fTargetFinLengthSplitDwnstr > 0.3*CLHEP::mm) {
781  LBNEVolumePlacementData *plTargetFinExtr2 = (fTargetFinExtraWidth > 0.) ?
782  Create(G4String("Horn1TargetFinVertExtraFirst")) : 0;
783  infoTargSegFirstLeft = Create("Horn1TargetSegmentFirstLeft");
784  LBNEVolumePlacementData *infoTargSegFirstRight = Create("Horn1TargetSegmentFirstRight");
785  G4PVPlacement *vTargSegFirst[2];
786  posTmp[0] = -0.5*fTargetFinContainerWidth - 0.023*CLHEP::mm; posTmp[1] = 0.;
787 
788  posTmp[2] = infoTargSegFirstLeft->fPosition[2];
789  vTargSegFirst[0] = new G4PVPlacement((G4RotationMatrix *) 0,
790  posTmp, infoTargSegFirstLeft->fCurrent,
791  G4String("TargetUpstrDowstrSegmentFirstLeft"),
792  vMHe->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
793  posTmp[0] *= -1.0;
794  vTargSegFirst[1] = new G4PVPlacement((G4RotationMatrix *) 0,
795  posTmp, infoTargSegFirstRight->fCurrent,
796  G4String("TargetUpstrDowstrSegmentFirstRight"),
797  vMHe->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
798  if (plTargetFinExtr2 != 0) {
799  posTmp[0] = -1.0*fTargetFinContainerWidth - 0.5*fTargetFinExtraWidth - 0.040*CLHEP::mm;
800  posTmp[1] = 0.; posTmp[2] = infoTargSegFirstLeft->fPosition[2];
801  new G4PVPlacement((G4RotationMatrix *) 0,
802  posTmp, plTargetFinExtr2->fCurrent,
803  nameTgtUpDownSegFirst + std::string("ExtraLeft"),
804  vMHe->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
805  posTmp[0] *= -1.0;
806  new G4PVPlacement((G4RotationMatrix *) 0,
807  posTmp, plTargetFinExtr2->fCurrent,
808  nameTgtUpDownSegFirst + std::string("ExtraRight"),
809  vMHe->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
810  }
811 
812 // LBNEVolumePlacementData *infoFinVert = Create("Horn1TargetFinVertFirst");
813  LBNEVolumePlacementData *plCoolingTubeFirst = Create("Horn1TargetCoolingTubeFirst");
814  LBNEVolumePlacementData *plCoolingTubeWaterFirst = Create("Horn1TargetCoolingTubeFirstWater");
815  LBNEVolumePlacementData *plTargetFinHeSide = (2.0*fTargetCTubeOuterRadius > fTargetFinWidth) ?
816  Create(G4String("Horn1TargetFinVertFirstHeliumSide")) : 0;
817  for (size_t kLeftRight=0; kLeftRight !=2; kLeftRight++) {
818 
819  posTmp[0] = 0.; posTmp[1] = fTargetFinHeight/2. + fTargetCTubeOuterRadius - 0.005*CLHEP::mm; posTmp[2] = 0.;
820  G4PVPlacement *vTubeUp = new G4PVPlacement((G4RotationMatrix *) 0,
821  posTmp, plCoolingTubeFirst->fCurrent,
822  G4String("Horn1TargetSegmentCoolingTubeFirst_PTop"),
823  vTargSegFirst[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
824  posTmp[1] *= -1.0;
825  G4PVPlacement *vTubeDown = new G4PVPlacement((G4RotationMatrix *) 0,
826  posTmp, plCoolingTubeFirst->fCurrent,
827  G4String("Horn1TargetSegmentCoolingTubeFirst_PBottom"),
828  vTargSegFirst[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
829  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
830  new G4PVPlacement((G4RotationMatrix *) 0,
831  posTmp, plCoolingTubeWaterFirst->fCurrent,
832  nameTgtUpDownSegFirst+G4String("CoolingTubeWater_PTop"),
833  vTubeUp->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
834  new G4PVPlacement((G4RotationMatrix *) 0,
835  posTmp, plCoolingTubeWaterFirst->fCurrent,
836  nameTgtUpDownSegFirst+G4String("CoolingTubeWater_PBottom"),
837  vTubeDown->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
838 
839 // posTmp[0] = (kLeftRight == 0) ? ( fTargetFinContainerWidth - fTargetFinWidth) :
840 // -1.0*( fTargetFinContainerWidth - fTargetFinWidth);
841 // posTmp[1]=0.; posTmp[2]=0.;
842 // new G4PVPlacement((G4RotationMatrix *) 0,
843 // posTmp, infoFinVert->fCurrent,
844 // G4String("Horn1TargetFinVertFirst_PLeft"),
845 // vTargSegFirst[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
846 //
847 //
848 // Put back some helium into the target segment, if target is thinner that the cooling tube diameter.
849 //
850  if (plTargetFinHeSide != 0) {
851  const double heThick = plTargetFinHeSide->fParams[0];
852  const double heThickShift = -0.5*fTargetFinContainerWidth + 0.5*heThick + 0.0175*CLHEP::mm;
853  posTmp[0] = (kLeftRight == 0) ? heThickShift : -1.0*heThickShift;
854  posTmp[1] = 0.;
855 // std::cerr << " Positioning helium side at X " << heThickShift << " width " << heThick << std::endl;
856  new G4PVPlacement((G4RotationMatrix *) 0,
857  posTmp, plTargetFinHeSide->fCurrent,
858  nameTgtUpDownSegFirst+G4String("TargetFinVertHeSide_P"),
859  vTargSegFirst[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
860  }
861  } // left/right part of the target.
862  }
863 
864  // Now place the previously defined standard target segment. Note: they already contain their cooling and
865  // real target.
866 // LBNEVolumePlacementData *plHorn1TargetSegment = Create("Horn1TargetSegment");
868  fSubVolumes.find(G4String("TargetUpstrDownstrSegmentLeft"));
870  fSubVolumes.find(G4String("TargetUpstrDownstrSegmentRight"));
871  LBNEVolumePlacementData *plTargetUpstrDownstrSegmentLeft= &itTargSegLeft->second;
872  LBNEVolumePlacementData *plTargetUpstrDownstrSegmentRight= &itTargSegRight->second;
873 
874  double zCoordTmp = (infoTargSegFirstLeft == 0) ?
875  (-1.0*plDowstrHe->fParams[2]/2. + plTargetUpstrDownstrSegmentLeft->fParams[2]/2. + 0.005*CLHEP::mm) :
876  ( infoTargSegFirstLeft->fPosition[2] + infoTargSegFirstLeft->fParams[2]/2. +
877  plTargetUpstrDownstrSegmentLeft->fParams[2]/2. + 0.002*CLHEP::mm);
878  int copyNumberT = 100;
879 // G4PVPlacement *vSeg[2];
880  std::string nameTgtUpDownSegLeft("Horn1TargetDownstrSegLeft");
881  std::string nameTgtUpDownSegRight("Horn1TargetDownstrSegRight");
882  if (fTargetFinExtraWidth > 0.) {
884  fSubVolumes.find(G4String("TargetFinVertExtra"));
885  plTargetFinExtra = &itExtraThin->second;
886  }
887  for (int iSeg=0; iSeg != fTargetNumFinsInHorn; iSeg++) { // Place with no misalignment
888  posTmp[0] = -0.5*fTargetFinContainerWidth - 0.023*CLHEP::mm;
889  posTmp[1] = 0.;
890  posTmp[2] = zCoordTmp;
891  std::ostringstream cNumStrStr; cNumStrStr << "_PDwnstr" << iSeg;
892  new G4PVPlacement((G4RotationMatrix *) 0,
893  posTmp, plTargetUpstrDownstrSegmentLeft->fCurrent,
894  nameTgtUpDownSegLeft+cNumStrStr.str(),
895  vMHe->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
896  copyNumberT ++;
897  posTmp[0] *= -1.0;
898  new G4PVPlacement((G4RotationMatrix *) 0,
899  posTmp, plTargetUpstrDownstrSegmentRight->fCurrent,
900  nameTgtUpDownSegRight+cNumStrStr.str(),
901  vMHe->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
902 
903  if (plTargetFinExtra != 0) {
904  posTmp[0] = -1.0*fTargetFinContainerWidth - 0.5*fTargetFinExtraWidth - 0.040*CLHEP::mm;
905  // to avoid false overlap errors.
906  new G4PVPlacement((G4RotationMatrix *) 0,
907  posTmp, plTargetFinExtra->fCurrent,
908  nameTgtUpDownSegLeft + std::string("Extra")+cNumStrStr.str(),
909  vMHe->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
910  posTmp[0] *= -1.0;
911  new G4PVPlacement((G4RotationMatrix *) 0,
912  posTmp, plTargetFinExtra->fCurrent,
913  nameTgtUpDownSegRight + std::string("Extra")+cNumStrStr.str(),
914  vMHe->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
915 
916  }
917  zCoordTmp += (fTargetFinLength + fTargetFinSpacingLength);
918  }
919 
920  // Now the end
921  LBNEVolumePlacementData *plCoolingTubeReturn = Create("Horn1TargetCoolingTubeDwnRetTit");
922  posTmp[0] = 0.; posTmp[1] = 0.;
923  posTmp[2] = plDowstrHe->fParams[2]/2 -
925  // Hopefully some roo to spare..
926  new G4PVPlacement(&plCoolingTubeReturn->fRotation,
927  posTmp, plCoolingTubeReturn->fCurrent,
928  G4String("Horn1TargetCoolingTubeDwnRetTit_PFront"),
929  vMHe->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
930  posTmp[2] = plDowstrHe->fParams[2]/2 - 0.5*fTargetCTubeReturnDownstrThickTitanium/2. - 1.3*CLHEP::mm;
931  new G4PVPlacement(&plCoolingTubeReturn->fRotation,
932  posTmp, plCoolingTubeReturn->fCurrent,
933  G4String("Horn1TargetCoolingTubeDwnRetTit_PBack"),
934  vMHe->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
935 
936  Create("Horn1TargetCoolingTubeDwnRetWater");
937  PlaceFinal("Horn1TargetCoolingTubeDwnRetWater", vMHe);
938 
939  Create("Horn1TargetDownstrHeContainerCap");
940  PlaceFinal("Horn1TargetDownstrHeContainerCap", vMHe);
941 }
intermediate_table::iterator iterator
std::string string
Definition: nybbler.cc:12
G4double fTargetCTubeReturnDownstrThickTitanium
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
std::vector< double > fParams
LBNEVolumePlacementData * Create(const G4String &name)
G4double fTargetCTubeReturnDownstrThickWater
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceFinalHorn1 ( G4PVPlacement *  mother,
G4PVPlacement *  motherDownstrTarget 
)
void LBNEVolumePlacements::PlaceFinalHorn2 ( G4PVPlacement *  mother)

Definition at line 1000 of file LBNEDownstrVolPlacements.cc.

1000  {
1001 
1002  const double in = 2.54*CLHEP::cm;
1003  LBNEVolumePlacementData *plInfoH2Top = this->Create("Horn2TopLevel");
1004  G4PVPlacement *vH2 = PlaceFinal("Horn2TopLevel", vH2Hall);
1005  std::string gasMaterial = fFillHornsWithArgon ? std::string("Argon") : std::string("Air");
1006 /* The Plug code */
1007  if(fConstructPlug){
1008  G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =0.;
1009  G4Tubs* plugTube = new G4Tubs("Plug", fPlugInnerRadius, fPlugOuterRadius, fPlugLength*.5, 0., 360.*CLHEP::deg);
1010  G4LogicalVolume *plugl = new G4LogicalVolume(plugTube, G4Material::GetMaterial(fPlugMaterial.c_str()), "Plug");
1011  posTmp[2] = (plInfoH2Top->fParams[2]-fPlugLength)*.5-fPlugZPosition;
1012  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, plugl, "Plug_P",
1013  vH2->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1014  }
1015  /* end of The Plug code */
1016  double zPosPart = -1.0*plInfoH2Top->fParams[2]/2 + fHorn2LengthMargin;
1017 
1018 
1019  const double zShiftDrawingIOTrans = fHorn2PartsLengths[0]/2 - fHorn2InnerIOTransLength;
1020  fHorn2DeltaZEntranceToZOrigin = zShiftDrawingIOTrans + fHorn2LengthMargin;
1021 
1022  double zStartDrawing = 0.; // definition of z=0
1023 // std::cerr << " Horn2 Placements, zPostPart " << zPosPart << " Length of Horn2 Top level " << plInfoH2Top->fParams[2]
1024 // << " zShiftDrawingIOTrans " << zShiftDrawingIOTrans << " 1rst part length " << fHorn2PartsLengths[0] << std::endl;
1025  double H2InnerRadius=fPlugOuterRadius;
1026  if(!fConstructPlug)H2InnerRadius=0.;
1027  fHorn2ZEqnChanges.clear();
1028  for (size_t kPart=0; kPart!= fHorn2PartsLengths.size(); kPart++) {
1029  std::ostringstream nStrStr; nStrStr << "Horn2Part" << kPart;
1030  G4String nStr(nStrStr.str());
1031  G4Tubs* tubsPart = new G4Tubs(nStr, H2InnerRadius, fHorn2PartsRadii[kPart],
1032  (fHorn2PartsLengths[kPart]/2 - 0.002*CLHEP::mm ), 0., 360.0*CLHEP::degree);
1033  G4LogicalVolume *tubsL = new G4LogicalVolume(tubsPart, G4Material::GetMaterial(gasMaterial.c_str()), nStr);
1034  G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =0.;
1035  zPosPart += fHorn2PartsLengths[kPart]/2;
1036  posTmp[2] = zPosPart;
1037  std::cerr << " At Horn2 big part " << kPart << "Radius " << fHorn2PartsRadii[kPart] << std::endl;
1038  G4PVPlacement *vPart = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsL, nStr + std::string("_P"),
1039  vH2->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1040  zPosPart += fHorn2PartsLengths[kPart]/2;
1041  // Sub volumes for each part.
1042  switch (kPart) {
1043  case 0: // The Inner Outer Transition piece
1044  {
1045  //The inner part.
1046  const double zEndDrawing = fHorn2InnerIOTransLength;
1047  fHorn2ZEqnChanges.push_back(zEndDrawing); // To be used in the magnetic field class.
1048  int numSubSect = GetNumberOfInnerHorn2SubSections(6, zStartDrawing,
1049  zEndDrawing, 10); // These Z position are from the start of the inner conductor.
1050  const double deltaZ = (zEndDrawing - zStartDrawing)/numSubSect;
1051 // std::cerr << " Number of subsection for the IO transition of Horn2 " << numSubSect
1052 // << " deltaz " << deltaZ << std::endl;
1053  for (int iSub = 0; iSub != numSubSect; iSub++) {
1054  const double zzBegin = zStartDrawing + iSub*deltaZ;
1055  const double zzEnd = zzBegin + deltaZ;
1056  std::ostringstream nameStrStr; nameStrStr << "Horn2InnerPartIOTransSub" << iSub;
1057  G4String nameStr(nameStrStr.str());
1058  fHorn2IC.push_back(nameStr);
1059  const double rMin1 = fHorn2Equations[6].GetVal(zzBegin); // Equation 1
1060  const double rMin2 = fHorn2Equations[6].GetVal(zzEnd);
1061  const double rMax1 = fHorn2Equations[10].GetVal(zzBegin) + fWaterLayerThickInHorns + 0.0025;
1062  const double rMax2 = fHorn2Equations[10].GetVal(zzEnd) + fWaterLayerThickInHorns + 0.0025;
1063  G4Cons *aCons = new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1064  (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::degree);
1065 
1066 
1067 
1068  G4LogicalVolume *pCurrent = new G4LogicalVolume(aCons, G4Material::GetMaterial(fHorn2InnerCondMat), nameStr);
1069  posTmp[0] = 0.; posTmp[1] = 0.;
1070  posTmp[2] = zzBegin + zShiftDrawingIOTrans + deltaZ/2.;
1071  G4PVPlacement *vSub = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1072  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1073 
1074  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1075  nameStrStr.str(""); nameStrStr.clear(); nameStrStr << "Horn2InnerPartIOTransSub" << iSub << "Water";
1076  nameStr = nameStrStr.str();
1077  G4Cons *aConsW2 = new G4Cons(nameStr, rMax1 - fWaterLayerThickInHorns, rMax1-0.001*CLHEP::mm,
1078  rMax2 - fWaterLayerThickInHorns, rMax2-0.001*CLHEP::mm,
1079  (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::degree);
1080  G4LogicalVolume *pCurrentW2 = new G4LogicalVolume(aConsW2, G4Material::GetMaterial(std::string("Water")), nameStr);
1081  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1082  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW2, nameStr + std::string("_P"),
1083  vSub->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1084  }
1085  } // on the number of sub section of the Inner Outer transition
1086  // Outer parts
1087  for (size_t kOut=0; kOut != fHorn2UpstrOuterIOTransLengths.size(); kOut++) {
1088  std::ostringstream nStrStrTR3; nStrStrTR3 << "Horn2IOTransOuterPart" << kOut;
1089  G4String nStrTR3(nStrStrTR3.str());
1090  G4Tubs* tubsPartTR3 = new G4Tubs(nStr, fHorn2UpstrOuterIOTransRadsOne[kOut],
1092  fHorn2UpstrOuterIOTransLengths[kOut]/2., 0., 360.0*CLHEP::degree);
1093  G4LogicalVolume *tubsLTR3 = new G4LogicalVolume(tubsPartTR3, G4Material::GetMaterial(fHorn2AllCondMat), nStr);
1094  posTmp[0] =0.; posTmp[1] =0.;
1095  posTmp[2] = - fHorn2PartsLengths[kPart]/2 + fHorn2UpstrOuterIOTransPositions[kOut];
1096  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLTR3, nStrTR3 + std::string("_P"),
1097  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1098  }
1099  // The weld at the end. Shift it a bit upstream such that it does not interfere
1100  {
1101  G4String nStrTW4("Horn2IOTransWeld");
1102  fHorn2IC.push_back(nStrTW4);
1103  const double weldLength = 0.386*in;
1104  const double zzEnd = fHorn2LongRescale*5.8610*in - weldLength - 0.050*CLHEP::mm;
1105  const double radius = fHorn2Equations[10].GetVal(zzEnd) + fWaterLayerThickInHorns + 0.0025;
1106  const double thick = 0.0775*in;
1107  G4Tubs* tubsPartTW4 = new G4Tubs(nStrTW4, radius, (radius+thick), weldLength/2., 0., 360.0*CLHEP::degree);
1108  G4LogicalVolume *tubsLTW4 = new G4LogicalVolume(tubsPartTW4, G4Material::GetMaterial(fHorn2InnerCondMat), nStr);
1109  posTmp[0] = 0.; posTmp[1] =0.;
1110  posTmp[2] = fHorn2PartsLengths[kPart]/2 - weldLength/2. - 0.025*CLHEP::mm;
1111  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLTW4, nStrTW4 + std::string("_P"),
1112  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1113  }
1114  zStartDrawing += fHorn2InnerIOTransLength; // for the next section
1115  } // End of Transition piece
1116  break;
1117  case 2: // The neck. Must subdivide further, radial equation keeps changing.
1118  // There will be 5 parts .. Drawing 8875.112-MD 363387
1119 
1120  {
1121  const double lengthNeck = fHorn2LongRescale*2.411*in - 0.020*CLHEP::mm; // approximate. Equation not available in usual form
1122  fHorn2NeckLength = lengthNeck; // to compute the magnetic field
1123  const double zPosNeck = fHorn2LongRescale*(39.8193 - 29.800)*in; // with respect to the start of the mother volume
1124  fHorn2NeckZPosition = zPosNeck;
1125  // We start by the neck
1126  {
1127  G4String nStrPN2("Horn2Part2Neck");
1128  const double radiusInner = fHorn2RadialRescale*3.071*in/2. + fHorn2RadialRescaleCst;
1129  const double radiusOuter = fHorn2RadialRescale*3.465*in/2. + fWaterLayerThickInHorns + 0.0025 + fHorn2RadialRescaleCst;
1131  fHorn2NeckInnerRadius = radiusInner;
1132  G4Tubs* tubsPartPN2 = new G4Tubs(nStrPN2, radiusInner, radiusOuter, lengthNeck/2., 0., 360.0*CLHEP::degree );
1133  G4LogicalVolume *tubsLPN2 = new G4LogicalVolume(tubsPartPN2, G4Material::GetMaterial(fHorn2InnerCondMat), nStr);
1134  posTmp[0] = 0.; posTmp[1] =0.;
1135  posTmp[2] = -1.0*fHorn2PartsLengths[kPart]/2 + zPosNeck;
1136  fHorn2IC.push_back(nStrPN2);
1137  G4PVPlacement *vNeck = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLPN2, nStrPN2 + std::string("_P"),
1138  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1139  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1140  G4String nameStrW5(nStr); nameStrW5 += std::string("Water");
1141  G4Tubs* tubsPartW5 = new G4Tubs(nameStrW5, radiusOuter -0.001*CLHEP::mm - fWaterLayerThickInHorns ,
1142  radiusOuter - 0.001*CLHEP::mm ,
1143  lengthNeck/2. - 0.002*CLHEP::mm, 0., 360.0*CLHEP::degree);
1144  G4LogicalVolume *pCurrentW5 = new G4LogicalVolume(tubsPartW5, G4Material::GetMaterial(std::string("Water")), nameStrW5);
1145  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1146  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW5, nameStrW5 + std::string("_P"),
1147  vNeck->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1148  }
1149  // std::cerr<< "Rescaled Horn2 Neck Radius is, outer " << fHorn2NeckOuterRadius << "Inner "<<fHorn2NeckInnerRadius<<std::endl;
1150 
1151  } // Neck part per se.
1152  {
1153  double zStartDrawingsSubP2[] = {29.800, 36.8888, 41.0248, 43.3660}; // Note the third number is compromise, corresponding
1154  // to the length of the neck going ~2 " to 2.41 "
1155  double zEndDrawingsSubP2[] = {36.8888, 38.6138, 43.3660, 49.820};
1156  size_t eqnInner[] = {6, 6, 7, 7};
1157  size_t eqnOuter[] = {0, 1, 2 ,3};
1158  // Now loop on these 4 subparts. (this gona a bit tedious...)
1159  for (size_t kSub=0; kSub!=4; kSub++) {
1160  const double zStartDrawingPP2 = fHorn2LongRescale*zStartDrawingsSubP2[kSub]*in;
1161  const double zEndDrawingPP2 = fHorn2LongRescale*zEndDrawingsSubP2[kSub]*in;
1162  fHorn2ZEqnChanges.push_back(zStartDrawingPP2);
1163  // Need to insert the neck one.. to get consistent set to compute the magnetic field.
1164  if (kSub == 1) fHorn2ZEqnChanges.push_back(zEndDrawingPP2);
1165  const double zShiftTmp = zStartDrawingPP2 - fHorn2LongRescale*zStartDrawingsSubP2[0]*in;
1166  int numSubSect = GetNumberOfInnerHorn2SubSections(eqnInner[kSub], zStartDrawingPP2, zEndDrawingPP2, 10);
1167  const double deltaZ = (zEndDrawingPP2 - zStartDrawingPP2)/numSubSect;
1168 // std::cerr << " Number of subsection for the middle part of Horn2 index " << kPart
1169 // << " Upstream of the neck, is " << numSubSect
1170 // << " deltaz " << deltaZ << std::endl;
1171  for (int iSub = 0; iSub != numSubSect; iSub++) {
1172  const double zzBegin = zStartDrawingPP2 + iSub*deltaZ;
1173  const double zzEnd = zzBegin + deltaZ;
1174  std::ostringstream nameStrStr;
1175  nameStrStr << "Horn2InnerPart" << kPart << "NeckkSub" << kSub << "iSub" << iSub;
1176  G4String nameStr(nameStrStr.str());
1177  fHorn2IC.push_back(nameStr);
1178  const double rMin1 = fHorn2Equations[eqnInner[kSub]].GetVal(zzBegin); // Equation 1
1179  const double rMin2 = fHorn2Equations[eqnInner[kSub]].GetVal(zzEnd);
1180  const double rMax1 = fHorn2Equations[eqnOuter[kSub]].GetVal(zzBegin) + fWaterLayerThickInHorns + 0.0025;
1181  const double rMax2 = fHorn2Equations[eqnOuter[kSub]].GetVal(zzEnd) + fWaterLayerThickInHorns + 0.0025;
1182 // std::cerr << " Pre/Post Neck, zzbegin " << zzBegin << " radii " <<
1183 // rMin1 << " / " << rMax1 << " / " << rMin2 <<" / " << rMax2 << std::endl;
1184  G4Cons *aCons = new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1185  (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::degree);
1186 
1187  G4LogicalVolume *pCurrent = new G4LogicalVolume(aCons, G4Material::GetMaterial(fHorn2InnerCondMat), nameStr);
1188  posTmp[0] = 0.; posTmp[1] = 0.;
1189  posTmp[2] = -fHorn2PartsLengths[kPart]/2 + iSub*deltaZ + deltaZ/2. + zShiftTmp;
1190  G4PVPlacement *vSub = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1191  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1192 
1193  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1194  G4String nameStrW6(nameStr); nameStrW6 += std::string("Water");
1195  G4Cons *aConsW6 = new G4Cons(nameStrW6, rMax1 - fWaterLayerThickInHorns, rMax1-0.001*CLHEP::mm,
1196  rMax2 - fWaterLayerThickInHorns, rMax2-0.001*CLHEP::mm,
1197  (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::degree);
1198  G4LogicalVolume *pCurrentW6 = new G4LogicalVolume(aConsW6, G4Material::GetMaterial(std::string("Water")), nameStrW6);
1199  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1200  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW6, nameStrW6 + std::string("_P"),
1201  vSub->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1202  }
1203  }
1204  } // Parts surrounding the neck.
1205  // Weld Only the downstream one. The upstream part is comprise in the previous volume
1206 // if (std::abs(fHorn2RadialRescaleCst) < 1.0e-10*CLHEP::mm) {
1207  {
1208  std::ostringstream nameStrStr; nameStrStr << "Horn2NeckPart" << kPart << "WeldDownstr";
1209  G4String nameStr(nameStrStr.str());
1210  fHorn2IC.push_back(nameStr);
1211  const double weldLength = 2.0 * 0.386*in; // double the length to include the part on the next volume
1212  const double zzEndForWeld = fHorn2LongRescale*zEndDrawingsSubP2[3]*in + 0.50*CLHEP::mm;
1213  const double radius = fHorn2Equations[3].GetVal(zzEndForWeld) + fWaterLayerThickInHorns + 0.025; // Using equation e8, drawing 363387
1214 // std::cerr << " Debugging bad Radial Cst.. zzEndForWeld " << zzEndForWeld << " radius " << radius
1215 // << " kPart " << kPart << " name " << nameStr << std::endl;
1216  const double thick = 0.0775*in;
1217  G4Tubs* tubsPartN2P2 = new G4Tubs(nameStr, radius, (radius+thick), weldLength/2., 0., 360.0*CLHEP::degree);
1218  G4LogicalVolume *tubsLN2P2 = new G4LogicalVolume(tubsPartN2P2, G4Material::GetMaterial(fHorn2InnerCondMat), nameStr);
1219  posTmp[0] = 0.; posTmp[1] =0.;
1220  posTmp[2] = fHorn2PartsLengths[kPart]/2 - weldLength - 0.025*CLHEP::mm;
1221  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLN2P2, nameStr + std::string("_P"),
1222  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1223  }
1224  zStartDrawing = fHorn2LongRescale*49.820*in;
1225  }
1226  break;
1227  } // end of case 2
1228  case 6: // the downstream end piece. simple tubes.
1229  {
1230  {
1231  G4String nameStr("Horn2DownstrPart6");
1232  const double length = fHorn2LongRescale*(21.054 - 1.25)*in - 0.020*CLHEP::mm;
1233  const double radInner = fHorn2RadialRescale*21.103*in/2. + fHorn2RadialRescaleCst;
1234  const double radOuter = fHorn2RadialRescale*21.853*in/2. + fHorn2RadialRescaleCst;
1235  G4Tubs* tubsDP6 = new G4Tubs(nameStr, radInner, radOuter, length/2., 0., 360.0*CLHEP::degree);
1236  G4LogicalVolume *tubsLDP6 = new G4LogicalVolume(tubsDP6, G4Material::GetMaterial(fHorn2InnerCondMat), nameStr);
1237  posTmp[0] = 0.; posTmp[1] =0.;
1238  posTmp[2] = -fHorn2PartsLengths[kPart]/2 + length/2. + 0.0125*CLHEP::mm;
1239  fHorn2IC.push_back(nameStr);
1240  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLDP6, nameStr + std::string("_P"),
1241  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1242  }
1243  // the flange/connector
1244 
1245  {
1246  G4String nameStr("Horn2DownstrPart6Flange");
1247  const double length = fHorn2LongRescale*(1.25)*in - 0.020*CLHEP::mm;
1248  const double radInner = fHorn2RadialRescale*21.103*in/2. + fHorn2RadialRescaleCst;
1249  const double radOuter = fHorn2RadialRescale*25.040*in/2. + fHorn2RadialRescaleCst;
1250  G4Tubs* tubsFL6 = new G4Tubs(nameStr, radInner, radOuter, length/2., 0., 360.0*CLHEP::degree);
1251  G4LogicalVolume *tubsLFL6 = new G4LogicalVolume(tubsFL6, G4Material::GetMaterial(fHorn2InnerCondMat), nameStr);
1252  posTmp[0] = 0.; posTmp[1] =0.;
1253  posTmp[2] = fHorn2PartsLengths[kPart]/2 - length/2. - 0.0125*CLHEP::mm;
1254  fHorn2IC.push_back(nameStr);
1255  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLFL6, nameStr + std::string("_P"),
1256  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1257 
1258  }
1259  break;
1260  }
1261  default:
1262  { // One set of conical sections. + weld at the end
1263  const double zEndDrawing = zStartDrawing + fHorn2PartsLengths[kPart];
1264  size_t eqnInner = 6; // kPart =1
1265  size_t eqnOuter = 0;
1266  if (kPart == 3 ) {
1267  eqnOuter = 3;
1268  fHorn2ZEqnChanges.push_back(zStartDrawing);
1269  eqnInner = 7;
1270  } else if (kPart == 4) {
1271  eqnOuter = 4;
1272  fHorn2ZEqnChanges.push_back(zStartDrawing);
1273  eqnInner = 8;
1274  } else if (kPart == 5) {
1275  eqnOuter = 5;
1276  fHorn2ZEqnChanges.push_back(zStartDrawing);
1277  eqnInner = 9;
1278  fHorn2ZEqnChanges.push_back(zEndDrawing);
1279  }
1280  int numSubSect = GetNumberOfInnerHorn2SubSections(eqnOuter, zStartDrawing,
1281  zEndDrawing, 10);
1282  const double deltaZ = (zEndDrawing - zStartDrawing)/numSubSect;
1283 // std::cerr << " Number of subsection for the generic part of Horn2 index " << kPart << " is " << numSubSect
1284 // << " deltaz " << deltaZ << std::endl;
1285  double zzEndForWeld = 0.;
1286  for (int iSub = 0; iSub != numSubSect; iSub++) {
1287  const double zzBegin = zStartDrawing + iSub*deltaZ;
1288  const double zzEnd = zzBegin + deltaZ;
1289  zzEndForWeld = zzEnd;
1290  std::ostringstream nameStrStr; nameStrStr << "Horn2InnerPart" << kPart << "Sub" << iSub;
1291  G4String nameStr(nameStrStr.str());
1292  fHorn2IC.push_back(nameStr);
1293  const double rMin1 = fHorn2Equations[eqnInner].GetVal(zzBegin); // Equation 1
1294  const double rMin2 = fHorn2Equations[eqnInner].GetVal(zzEnd);
1295  const double rMax1 = fHorn2Equations[eqnOuter].GetVal(zzBegin) + fWaterLayerThickInHorns + 0.0025;
1296  const double rMax2 = fHorn2Equations[eqnOuter].GetVal(zzEnd) + fWaterLayerThickInHorns + 0.0025;
1297  G4Cons *aCons = new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1298  (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::degree);
1299 
1300  G4LogicalVolume *pCurrent = new G4LogicalVolume(aCons,
1301  G4Material::GetMaterial(std::string(fHorn2InnerCondMat)), nameStr);
1302  posTmp[0] = 0.; posTmp[1] = 0.;
1303  posTmp[2] = -fHorn2PartsLengths[kPart]/2 + iSub*deltaZ + deltaZ/2.;
1304  G4PVPlacement *vSub = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1305  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1306 
1307  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1308  G4String nameStrW(nameStr); nameStrW += std::string("Water");
1309  G4Cons *aConsW7 = new G4Cons(nameStrW, rMax1 - fWaterLayerThickInHorns, rMax1-0.001*CLHEP::mm,
1310  rMax2 - fWaterLayerThickInHorns, rMax2-0.001*CLHEP::mm,
1311  (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::degree);
1312 
1313  G4LogicalVolume *pCurrentW7 = new G4LogicalVolume(aConsW7, G4Material::GetMaterial(std::string("Water")), nameStrW);
1314  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1315  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW7, nameStrW + std::string("_P"),
1316  vSub->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1317  }
1318 
1319  }
1320  // The weld at the end. Shift it a bit upstream such that it does not interfere
1321  {
1322  std::ostringstream nameStrStr; nameStrStr << "Horn2InnerPart" << kPart << "Weld";
1323  G4String nameStr(nameStrStr.str());
1324  fHorn2IC.push_back(nameStr);
1325  const double weldLength = 2.0 * 0.386*in; // double to include the next one.. Perhaps a bit oversized.
1326  if (kPart == 1) zzEndForWeld -= weldLength - 0.50*CLHEP::mm; // oversizing a bit by moving while computing the radius
1327  else zzEndForWeld += 0.50*CLHEP::mm;
1328  const double radius = fHorn2Equations[eqnOuter].GetVal(zzEndForWeld) + fWaterLayerThickInHorns + 0.0025;
1329  const double thick = 0.0775*in;
1330 // std::cerr << " Debugging bad Radial Cst.. zzEndForWeld " << zzEndForWeld << " radius " << radius
1331 // << " kPart " << kPart << " name " << nameStr << std::endl;
1332  G4Tubs* tubsPartWe7 = new G4Tubs(nameStr, radius, (radius+thick), weldLength/2., 0., 360.0*CLHEP::degree);
1333  G4LogicalVolume *tubsLWe7 = new G4LogicalVolume(tubsPartWe7, G4Material::GetMaterial(fHorn2InnerCondMat), nameStr);
1334  posTmp[0] = 0.; posTmp[1] =0.;
1335  posTmp[2] = fHorn2PartsLengths[kPart]/2 - weldLength/2. - 0.025*CLHEP::mm;
1336  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLWe7, nameStr + std::string("_P"),
1337  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1338  }
1339 
1340  zStartDrawing += fHorn2PartsLengths[kPart]; // for the next section
1341  }
1342  } //end of special cases.
1343  // Outer tube (not for k=0 )
1344  if (kPart != 0) {
1345  std::ostringstream nStrStrOU; nStrStrOU << "Horn2OuterConductor" << kPart;
1346  G4String nStrOU(nStrStrOU.str());
1347  const double leffOU = (fHorn2PartsLengths[kPart] - 0.040*CLHEP::mm);
1348  G4Tubs* tubsPartOU = new G4Tubs(nStrOU, fHorn2OuterTubeInnerRad, fHorn2OuterTubeOuterRad,
1349  leffOU/2.0, 0., 360.0*CLHEP::degree);
1350  G4LogicalVolume *tubsLOU = new G4LogicalVolume(tubsPartOU, G4Material::GetMaterial(fHorn2AllCondMat), nStrOU);
1351  posTmp[0] =0.; posTmp[1] =0.; posTmp[2] =0.;
1352  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLOU, nStrOU + std::string("_P"),
1353  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1354  } else {
1355 
1356  // April 2 2014: per careful observations by Seongtae Park
1357  // Talk delivered on March 27 2014.
1358  // The I/O transition outer conductor does not completly covers the range.
1359  std::ostringstream nStrStrOU2; nStrStrOU2 << "Horn2OuterConductor" << kPart << "Extra";
1360  G4String nStrOU2(nStrStr.str());
1361  const double leffOU2 = fHorn2LongRescale*96.5*CLHEP::mm;
1362  G4Tubs* tubsPartOU2 = new G4Tubs(nStrOU2, fHorn2OuterTubeInnerRad, fHorn2OuterTubeOuterRad,
1363  leffOU2/2.0, 0., 360.0*CLHEP::degree);
1364  G4LogicalVolume *tubsLOU2 = new G4LogicalVolume(tubsPartOU2, G4Material::GetMaterial(fHorn2AllCondMat), nStrOU2);
1365  posTmp[0] =0.; posTmp[1] =0.;
1366  posTmp[2] = fHorn2PartsLengths[0]/2.0 - leffOU2/2.0 - 0.010*CLHEP::mm;
1367  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsLOU2, nStrOU2 + std::string("_P"),
1368  vPart->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1369 
1370  }
1371  // Eventual Hangers. only one set
1372  if (kPart == 3) this->Horn2InstallSpiderHanger(nStr, vPart);
1373 
1374  // More
1375  } // Loop over the parts, daughters of top level.
1376  // Final flange downstream flange Approximate Drawing 363382-E1 Length is still a guess..
1377  G4String nStr("Horn2DownstrOuterFlange");
1378  G4Tubs* tubsOF1 = new G4Tubs(nStr, fHorn2OuterTubeOuterRad + 1.0*CLHEP::mm,
1379  fHorn2OuterTubeOuterRadMax-1.0*CLHEP::mm, 0.50*in, 0., 360.0*CLHEP::degree);
1380  G4LogicalVolume *tubsL = new G4LogicalVolume(tubsOF1, G4Material::GetMaterial(fHorn2AllCondMat), nStr);
1381  G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =0.;
1382  posTmp[2] = plInfoH2Top->fParams[2]/2 - fHorn2LongRescale*0.6*in; // approximate location
1383  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, tubsL, nStr + std::string("_P"),
1384  vH2->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1385 }
std::vector< G4double > fHorn2UpstrOuterIOTransRadsTwo
int GetNumberOfInnerHorn2SubSections(size_t eqn, double z1, double z2, int nMax) const
void Horn2InstallSpiderHanger(const G4String &name, G4PVPlacement *vMother)
std::string string
Definition: nybbler.cc:12
STL namespace.
std::vector< G4double > fHorn2UpstrOuterIOTransPositions
std::vector< G4double > fHorn2ZEqnChanges
std::vector< G4double > fHorn2PartsRadii
std::vector< G4String > fHorn2IC
std::vector< double > fParams
std::vector< LBNEHornRadialEquation > fHorn2Equations
std::vector< G4double > fHorn2PartsLengths
std::vector< G4double > fHorn2UpstrOuterIOTransLengths
LBNEVolumePlacementData * Create(const G4String &name)
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
std::vector< G4double > fHorn2UpstrOuterIOTransRadsOne
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceFinalLBNFConceptHornA ( )

Definition at line 46 of file LBNFConceptDesignHorns.cc.

46  {
47 
48  std::cerr << " LBNEVolumePlacements::PlaceFinalLBNFConceptHornA.. See Integration Drawing F10068454 " << std::endl;
49  std::cerr << " ........... start with upstream IO/layer. " <<std::endl;
51  fZCoordCDRevisedHornA.clear();
52 
53  const bool installOuterConductor = true;
54 // const bool installDownstreamOCFlange = true;
55  const bool installDownstreamIOTransition = true;
56  const bool installCurrentEqualizer = false;
57 
58  const double in = 25.4*CLHEP::mm;
59  const LBNEVolumePlacementData *plDatMother = this->Find(G4String("LBNFConceptHornA"), "Horn1PolyM1",
60  "LBNEVolumePlacements::PlaceFinalLBNFConceptHornA");
61  G4LogicalVolume *volMother = plDatMother->fCurrent;
62  const double lengthMother=plDatMother->fParams[2];
63  const double zShiftMotherCoords = -0.5*lengthMother + fZShiftConceptHornAStartIC + 1.505*CLHEP::mm;
64  std::cerr << " .....Mother Volume name " << volMother->GetName()
65  << " zShiftMother " << zShiftMotherCoords << " lengthMother " << lengthMother << std::endl;
66  const size_t nSegUpstrIO = 6;
67  const double zStartUpstrIOC = -0.5*lengthMother + 1.0*CLHEP::mm; // 0.5 mm clearance,
68  const double deltaPhiUpstrIO = M_PI/(2.0*nSegUpstrIO);
69  const double radInnerUpstIO = 25.0*CLHEP::mm; // Drawing F10068456
70  const double radOuterUpstIO = 50.0*CLHEP::mm; // Drawing F10068456
71  // Out is now dfefined by the most upstream surface segment of the IO .
72  const double radInnerInnerCyl = 43.0*CLHEP::mm;
73  const double thickInner = 2.5*CLHEP::mm;
74  fThickICDRevisedHornA = thickInner; // For the magnetic field map.
75  std::vector<double> zTmps(30, 0.); std::vector<double> rTmps(30, 0.); // more room for later
76  G4ThreeVector zeroC(0., 0., 0.);
77  G4Material *myAlumIC = G4Material::GetMaterial(fHorn1InnerCondMat.c_str());
78  G4Material *myAlumOC = G4Material::GetMaterial(fHorn1AllCondMat.c_str());
79 // G4Material *myAlumina = G4Material::GetMaterial("Alumina");
80 // if (fHorn1AllCondMat.find("Alum") != std::string::npos)
81 // myAlumina = G4Material::GetMaterial(fHorn1AllCondMat.c_str());
82  size_t nSegUpstrIOBy2 = nSegUpstrIO/2;
83  fZCoordCDRevisedHornA.resize(nSegUpstrIOBy2);
84  fRInCoordCDRevisedHornA.resize(nSegUpstrIOBy2);
85 
86 
87  for (size_t kPhi = 0; kPhi != nSegUpstrIO; kPhi++ ) {
88  std::ostringstream aNStrStr; aNStrStr << "LBNFConceptHornAUpstrIOSect" << kPhi;
89  std::string aNStr(aNStrStr.str());
90  const double phi0 = kPhi*deltaPhiUpstrIO + 1.0e-4;
91  const double phi1 = (kPhi+1)*deltaPhiUpstrIO - 1.0e-4;
92  zTmps[0] = zStartUpstrIOC + radOuterUpstIO - radOuterUpstIO*std::sin(phi1);
93  zTmps[1] = zStartUpstrIOC + radOuterUpstIO - radOuterUpstIO*std::sin(phi0);
94  zTmps[2] = zStartUpstrIOC + radOuterUpstIO - radInnerUpstIO*std::sin(phi0);
95  zTmps[3] = zStartUpstrIOC + radOuterUpstIO - radInnerUpstIO*std::sin(phi1);
96  rTmps[0] = radInnerInnerCyl + radOuterUpstIO - radOuterUpstIO*std::cos(phi1);
97  rTmps[1] = radInnerInnerCyl + radOuterUpstIO - radOuterUpstIO*std::cos(phi0);
98  rTmps[2] = radInnerInnerCyl + thickInner + radInnerUpstIO - radInnerUpstIO*std::cos(phi0);
99  rTmps[3] = radInnerInnerCyl + thickInner + radInnerUpstIO - radInnerUpstIO*std::cos(phi1);
100 // std::cerr << " At kPhi " << kPhi << " Phi0 " << phi0 << " Phi1 " << phi1 << " rZVector " << std::endl;
101 // for (size_t kk=0; kk != 4; kk++) std::cerr << " " << rTmps[kk] << " " <<
102 // zTmps[kk] << " " << std::endl;
103  if (kPhi == nSegUpstrIO-1) rTmps[3] =radInnerInnerCyl + 51.*CLHEP::mm - 0.25*CLHEP::mm;
104  G4GenericPolycone *aVolGP = new G4GenericPolycone(aNStr, 0.0, 360.0*CLHEP::degree, 4, &rTmps[0], &zTmps[0]);
105  G4LogicalVolume *aVolG = new G4LogicalVolume(aVolGP, myAlumIC, aNStr);
106  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolG, aNStr + std::string("_P"),
107  volMother, false, 1, true);
108  if (kPhi < nSegUpstrIO/2) {
109  fRInCoordCDRevisedHornA[nSegUpstrIOBy2 - 1 - kPhi] = rTmps[1];
110  fZCoordCDRevisedHornA[nSegUpstrIOBy2 - 1 - kPhi] = zTmps[1]; // with respect to start of the mother volume
111  }
112 
113  }
114  //
115  // For sake of completenes, althought it should not matter, install the thick (25. ) piece of the IC the connects
116  // to the upstream Current Equalizer section.
117  //
118  // ZP: Make it 1in thick (Cory's email Jan 2019)
119  G4String aNStrTmp0("LBNFConceptHornAICFlangeUpstr");
120  fHorn1IC.push_back(aNStrTmp0);
121  const double radOutOuterCondInner = 220.*CLHEP::mm ; // in reality, a bit smaller, but it does not matter
122  // Ustream of the target.
123  G4Tubs* aVolICBulk = new G4Tubs(aNStrTmp0,
124  radInnerInnerCyl + 51.*CLHEP::mm, radOutOuterCondInner - 1.0*CLHEP::mm ,
125  1.*in/2., 0.0, 360.0*CLHEP::degree);
126  G4LogicalVolume *aVolICBulkG = new G4LogicalVolume(aVolICBulk, myAlumIC, aNStrTmp0);
127  G4ThreeVector posTmp0(0., 0., zStartUpstrIOC + 0.5*in);
128  new G4PVPlacement((G4RotationMatrix *) 0, posTmp0, aVolICBulkG, aNStrTmp0 + std::string("_P"),
129  volMother, false, 1, true);
130  //
131  // The Inner cylindrical section around the target.
132  //
133  const double lengthICCyl = 1170*CLHEP::mm - 0.005*CLHEP::mm;
134  const double radInnerOuter = radInnerInnerCyl + thickInner;
135  G4String aNStrTmp("LBNFConceptHornAICCyl");
136  fHorn1IC.push_back(aNStrTmp);
137  const double zZeroLocalCoord = zStartUpstrIOC + radOuterUpstIO + 0.1*CLHEP::mm;
138 // std::cerr << " ............. zZeroLocalCoord " << zZeroLocalCoord << " zStartUpstrIOC " << zStartUpstrIOC << std::endl;
139  G4Tubs* aVolIC0GT = new G4Tubs(aNStrTmp,
140  radInnerInnerCyl, radInnerOuter, 0.5*lengthICCyl, 0.0, 360.0*CLHEP::degree);
141  G4LogicalVolume *aVolIC0G = new G4LogicalVolume(aVolIC0GT, myAlumIC, aNStrTmp);
142  G4ThreeVector posTmp(0., 0., zZeroLocalCoord + 0.5*lengthICCyl);
143  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolIC0G, aNStrTmp + std::string("_P"),
144  volMother, false, 1, true);
145  fZCoordCDRevisedHornA.push_back(posTmp[2] - 0.5*lengthICCyl);
146  fRInCoordCDRevisedHornA.push_back(radInnerInnerCyl);
147  //
148  // The Inner concical section around the target, so-called tapered section
149  //
150  //Update using Cory's drawing (email sent to Laura and Zarko, January 2019)
151  //split the tapered section into two parts, taper to thicker bell
152 
153  const double thickInnerIC1 = thickInner; // From measurement tool. Difference of Outer/Ineer radius.
154  zTmps[0] = zZeroLocalCoord + lengthICCyl + 0.002*CLHEP::mm;
155  rTmps[0] = radInnerInnerCyl;
156  //const double lengthTaperedIC1 = 992.3*CLHEP::mm; // Minor correction, August 12 2016.., from 56 to this
157  const double lengthTaperedIC1_1 = 992.3*CLHEP::mm-1.75*in; //remove last part of the cone and make new volume for this
158  rTmps[1] = 33*CLHEP::mm;
159  aNStrTmp = std::string("LBNFConceptHornAICTaper_1");
160  fHorn1IC.push_back(aNStrTmp);
161  G4Cons* aVolIC1GCon_1 =
162  new G4Cons(aNStrTmp, rTmps[0], rTmps[0]+thickInnerIC1,
163  rTmps[1], rTmps[1]+thickInnerIC1, 0.5*lengthTaperedIC1_1,
164  0.0, 360.0*CLHEP::degree);
165  G4LogicalVolume *aVolIC1G_1 = new G4LogicalVolume(aVolIC1GCon_1, myAlumIC, aNStrTmp);
166  posTmp[2] = zZeroLocalCoord + lengthICCyl + 0.5*lengthTaperedIC1_1 + 0.002*CLHEP::mm;
167  const double zEndICTapered_1 = posTmp[2] + 0.5*lengthTaperedIC1_1 + 0.002*CLHEP::mm;
168  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolIC1G_1, aNStrTmp + std::string("_P"),
169  volMother, false, 1, true);
170  fZCoordCDRevisedHornA.push_back(posTmp[2] - 0.5*lengthTaperedIC1_1);
171  fRInCoordCDRevisedHornA.push_back(rTmps[0]);
172 
173  //adding second segment (1.75in long)
174  const double thickInnerIC1_2 = 0.354*in; // Cory's drawing
175  zTmps[0] = zZeroLocalCoord + lengthICCyl + 0.002*CLHEP::mm+lengthTaperedIC1_1;
176  rTmps[0] = rTmps[1];
177  //const double lengthTaperedIC1 = 992.3*CLHEP::mm; // Minor correction, August 12 2016.., from 56 to this
178  const double lengthTaperedIC1_2 = 1.75*in; //remove last part of the cone and make new volume for this
179  rTmps[1] = rTmps[0];
180  aNStrTmp = std::string("LBNFConceptHornAICTaper_2");
181  fHorn1IC.push_back(aNStrTmp);
182  G4Cons* aVolIC1GCon_2 =
183  new G4Cons(aNStrTmp, rTmps[0], rTmps[0]+thickInnerIC1,
184  rTmps[1], rTmps[1]+thickInnerIC1_2, 0.5*lengthTaperedIC1_2,
185  0.0, 360.0*CLHEP::degree);
186  G4LogicalVolume *aVolIC1G_2 = new G4LogicalVolume(aVolIC1GCon_2, myAlumIC, aNStrTmp);
187  posTmp[2] = zZeroLocalCoord + lengthICCyl + lengthTaperedIC1_1 + 0.5*lengthTaperedIC1_2 + 0.002*CLHEP::mm;
188  const double zEndICTapered_2 = posTmp[2] + 0.5*lengthTaperedIC1_2 + 0.002*CLHEP::mm;
189  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolIC1G_2, aNStrTmp + std::string("_P"),
190  volMother, false, 1, true);
191  fZCoordCDRevisedHornA.push_back(posTmp[2] - 0.5*lengthTaperedIC1_2);
192  fRInCoordCDRevisedHornA.push_back(rTmps[0]);
193 
194 //
195 // A holding ring, presumably for the spider support. Spider support itself not included
196 //
197  const double lengthRingSpiderSuppIC = 20.0*CLHEP::mm;
198  const double radRingSpiderSuppICInner = radInnerInnerCyl + thickInner + 0.010*CLHEP::mm;
199  const double radRingSpiderSuppICOuter = 52.5; // drawing/part 10068382
200  aNStrTmp = std::string("LBNFConceptHornARingSuppIC0");
201  fHorn1IC.push_back(aNStrTmp);
202  G4Tubs* aVolIC0SGT = new G4Tubs(aNStrTmp, radRingSpiderSuppICInner,radRingSpiderSuppICOuter,
203  0.5*lengthRingSpiderSuppIC, 0.0, 360.0*CLHEP::degree);
204  G4LogicalVolume *aVolIC0SG = new G4LogicalVolume(aVolIC0SGT, myAlumIC, aNStrTmp);
205  posTmp[2] = zZeroLocalCoord + (1170. - 85.5)*CLHEP::mm; // taken with the measurement tool
206  const double zSpiderSupport = posTmp[2];
207  const double zEndOfWaterLayer = posTmp[2] - lengthRingSpiderSuppIC/2.0 - 1.0*CLHEP::mm;
208  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolIC0SG, aNStrTmp + std::string("_P"),
209  volMother, false, 1, true);
210 //
211 // The weldings...
212 //
213  const double lengthWeldIC0toIC1 = 23.3*CLHEP::mm; // Took 2/3 of the smooth transition.
214  const double radRingWeldIC0toICInner = radInnerInnerCyl + thickInner + 0.010*CLHEP::mm;
215  const double radRingWeldIC0toICOuter = radRingWeldIC0toICInner + 1.25*CLHEP::mm; // Approximate guess.
216  // We place the weld on top of the water layer.. Unphysical, evidently, but not a big mistake..
217  aNStrTmp = std::string("LBNFConceptHornAWeldIC0toIC1");
218  fHorn1IC.push_back(aNStrTmp);
219  G4Tubs* aVolIC0WGT = new G4Tubs(aNStrTmp, radRingWeldIC0toICInner, radRingWeldIC0toICOuter,
220  0.5*lengthWeldIC0toIC1, 0.0, 360.0*CLHEP::degree);
221  G4LogicalVolume *aVolIC0WG = new G4LogicalVolume(aVolIC0WGT, myAlumIC, aNStrTmp);
222  posTmp[2] = zZeroLocalCoord + (1170. - 30)*CLHEP::mm ; // Measurement tool
223  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolIC0WG, aNStrTmp + std::string("_P"),
224  volMother, false, 1, true);
225 //
226 // The I/O transition, downstream. same method as for the upstream.
227 //
228 /*
229  const double radInnerDownstrtIO = 81*CLHEP::mm; // arc 3 od Sketch_000
230  const double phiStartInnerDownstrtIO = 0.001*M_PI/180.; // Deduced from parameter p261 of Sketch_000
231  const double yCenterInnerDownstrtIO = (35*CLHEP::mm +
232  radInnerDownstrtIO*std::cos(phiStartInnerDownstrtIO))*CLHEP::mm;
233  const double radOuterDownstrtIO = 86.2*CLHEP::mm; // arc 4 od Sketch_000. Check with Measurement tool .
234  const double yCenterOuterDownstrtIO = (35*CLHEP::mm +
235  radOuterDownstrtIO*std::cos(phiStartInnerDownstrtIO))*CLHEP::mm;
236  const double zCenterDownstrtIO = zEndICTapered + 0.025*CLHEP::mm;
237 */
238  //Using Cory's drawings (email to Zarko & Laura January 2019)
239  const double radInnerDownstrtIO = (3.401-0.354)*in;
240  const double phiStartInnerDownstrtIO = 0.001*M_PI/180.;
241  const double yCenterDownstrtIO = 4.7*in;
242  const double radOuterDownstrtIO = 3.401*in;
243  const double zCenterDownstrtIO = zEndICTapered_2 + 0.025*CLHEP::mm;
244 
245  const size_t nSegDownstrIO = 20.;
246 // const size_t nSegDownstrIO = 5.;
247  const double deltaPhiDownstrIO = (M_PI - phiStartInnerDownstrtIO)/nSegDownstrIO;
248  // This section is physically bigger, and is much more exposed to pion than the upstream one, make it more
249  for (size_t kPhi = 0; kPhi != nSegDownstrIO; kPhi++ ) {
250  std::ostringstream aNStrStr; aNStrStr << "LBNFConceptHornADownstrIOSect" << kPhi;
251  std::string aNStr(aNStrStr.str());
252  fHorn1IC.push_back(aNStr);
253  const double phi0 = phiStartInnerDownstrtIO + kPhi*deltaPhiDownstrIO + 1.0e-5;
254  const double phi1 = phi0 + deltaPhiDownstrIO - 2.0e-5;
255  zTmps[0] = zCenterDownstrtIO + radInnerDownstrtIO*std::sin(phi0);
256  zTmps[1] = zCenterDownstrtIO + radOuterDownstrtIO*std::sin(phi0);
257  zTmps[2] = zCenterDownstrtIO + radOuterDownstrtIO*std::sin(phi1);
258  zTmps[3] = zCenterDownstrtIO + radInnerDownstrtIO*std::sin(phi1);
259  rTmps[0] = yCenterDownstrtIO - radInnerDownstrtIO*std::cos(phi0);
260  rTmps[1] = yCenterDownstrtIO - radOuterDownstrtIO*std::cos(phi0);
261  rTmps[2] = yCenterDownstrtIO - radOuterDownstrtIO*std::cos(phi1);
262  rTmps[3] = yCenterDownstrtIO - radInnerDownstrtIO*std::cos(phi1);
263 // std::cerr << " At kPhi " << kPhi << " Phi0 " << phi0 << " Phi1 " << phi1 << " rZVector " << std::endl;
264 // for (size_t kk=0; kk != 4; kk++) std::cerr << " " << rTmps[kk] << " " <<
265 // zTmps[kk] << " " << std::endl;
266  if (!installDownstreamIOTransition) continue;
267  G4GenericPolycone *aVolGP = new G4GenericPolycone(aNStr, 0.0, 360.0*CLHEP::degree, 4, &rTmps[0], &zTmps[0]);
268  G4LogicalVolume *aVolG = new G4LogicalVolume(aVolGP, myAlumIC, aNStr);
269  std::cerr << " Volume for volume " << aNStr << " is " << aVolG->GetSolid()->GetCubicVolume()
270  << " at Y = " << 0.25*(rTmps[0] + rTmps[1] + rTmps[2] + rTmps[3]) << std::endl;
271  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolG, aNStr + std::string("_P"),
272  volMother, false, 1, true);
273  if (kPhi < nSegDownstrIO/2) {
274  fRInCoordCDRevisedHornA.push_back(rTmps[1]);
275  fZCoordCDRevisedHornA.push_back(zTmps[0]); // with respect to the beginning of the mother volume.
276  }
277  }
278 //
279 // The flanges only downstream, We also skip the Current Equalizer sections located upstream of the start
280 // of the target.
281 //
282  if (installCurrentEqualizer) {
283  std::cerr
284  << " Located upstream of the start of the target, the Current qualizer sections are irrelevant" << std::endl;
285  std::cerr << " So., not implemented yet.. " << std::endl;
286  }
287  // This is the connecting flange, OC to IOC, part of OC
288  const double radOuterFlangesDownstr = 274.5*CLHEP::mm; // 254 on the drawing. But,
289  // discussion on Oct 13 beam meeting, it was suggest to enlarge the end, such that we
290  // make a small "tub" to facilitate the water flow, and move the tub drain to larger
291  // radius. To be revisited when we have the final design. //
292  const double radInnerFlangesDownstrU = (220.52 + 0.25) *CLHEP::mm; // with 250 micron clearance.
293  const double thickFlangesDownstrU = 34.0*CLHEP::mm;
294  posTmp[2] = zCenterDownstrtIO -58.0*CLHEP::mm + 0.5*thickFlangesDownstrU - 0.02*CLHEP::mm;
295  std::cerr << " Z Position LBNFConceptHornAFlangeDownstrU " << posTmp[2]
296  << " Thickness " << thickFlangesDownstrU << std::endl;
297  const double zCoordEndOCFlangeU = posTmp[2] + 0.5*thickFlangesDownstrU + 0.025*CLHEP::mm;
298  aNStrTmp = std::string("LBNFConceptHornAFlangeDwnstrU");
299  if (installDownstreamIOTransition) {
300  G4Tubs *aVolGPFDU = new G4Tubs(aNStrTmp, radInnerFlangesDownstrU, radOuterFlangesDownstr,
301  0.5*thickFlangesDownstrU, 0.0, 360.0*CLHEP::degree);
302  G4LogicalVolume *aVolGFDU = new G4LogicalVolume(aVolGPFDU, myAlumIC, aNStrTmp);
303  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolGFDU, aNStrTmp + std::string("_P"),
304  volMother, false, 1, true);
305  }
306  //Using Cory's drawings (email to Zarko & Laura January 2019)
307  // const double radInnerFlangesDownstrD = 35*CLHEP::mm + 2.0*radInnerDownstrtIO;
308  const double radInnerFlangesDownstrD = 4.7*in+radInnerDownstrtIO;
309 
310  const double thickFlangesDownstrD = (58.4 - 34.0 - 2.50)*CLHEP::mm; // 2500 micron clearance. With measurement tool
311  posTmp[2] = zCoordEndOCFlangeU + 0.5*thickFlangesDownstrD - 0.025*CLHEP::mm;
312  aNStrTmp = std::string("LBNFConceptHornAFlangeDwnstrD");
313  if (installDownstreamIOTransition) {
314  G4Tubs *aVolGPFDD = new G4Tubs(aNStrTmp, radInnerFlangesDownstrD, radOuterFlangesDownstr,
315  0.5*thickFlangesDownstrD, 0.0, 360.0*CLHEP::degree);
316  G4LogicalVolume *aVolGFDD = new G4LogicalVolume(aVolGPFDD, myAlumIC, aNStrTmp);
317  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolGFDD, aNStrTmp + std::string("_P"),
318  volMother, false, 1, true);
319  }
320 //
321 // We now install the Outer conductor. Start with it's upstream flange.
322 // Which we skip.. We just start the outer conductor flush with the upstream IOC
323 //
324 //
325 // The main body of OC
326 //
327 //ZP: change lenthOC and posTmp[2] so it goes over the IO region (Cory's email Jan 2019)
328 //add/subtract 2*in (geometry actually had a block 50mm thick)
329  const double lengthOC = (2104. - 0.5)*CLHEP::mm+50*CLHEP::mm; // with the measurement tool..
330  // From the Z = start of the IC down to the start of LBNFConceptHornAFlangeDwnstrU
331  const double radOuterOC = (220.5 + 16)*CLHEP::mm;
332  const double radInnerOC = 220.5*CLHEP::mm;
333  posTmp[2] = zZeroLocalCoord + 0.5*lengthOC + 0.1*CLHEP::mm-50*CLHEP::mm;
334  aNStrTmp = std::string("LBNFConceptHornAOC");
335  if (installOuterConductor) {
336  G4Tubs* aVolOCG = new G4Tubs(aNStrTmp, radInnerOC, radOuterOC,
337  0.5*lengthOC, 0.0, 360.0*CLHEP::degree);
338  G4LogicalVolume *aVolOCGL = new G4LogicalVolume(aVolOCG, myAlumOC, aNStrTmp);
339  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolOCGL, aNStrTmp + std::string("_P"),
340  volMother, false, 1, true);
341  }
342 //
343 // The downstream Flange.Donw above !.
344 //
345 //
346 // The spider support. Borrowed code from NuMI/LBNE, written 3 years ago or so..
347 //
348 // The ring is already defined above.
349 //The connecting piece ring to the hangers.. There are three of them, at 120 degrees from each other.
350 //
351 // Optiminally, skip the spider support for study of the phi symmetry breaking terms in the magnetic field
352 // This speider support is intrinsically phy asymmetric, so, we skip it to study poins/neutrino distribution
353 // due to the presence of magnetic defect.
354 //
355 // P.L. June 19 2017.
356 //
357  bool installSpiderSupport = true;
358  if (installSpiderSupport) {
359 
360  const std::string nameStrH("LBNFConceptHornASpSupp");
361  G4String nameStr2(nameStrH); nameStr2 += G4String("Riser");
362  const double heightRiser = 0.333*in - 0.020*CLHEP::mm;
363  const double widthH = 1.5*in; // See drawing 8875.112-MD 363115
364  const double thickH = 0.184*2*in;
365  G4Box *aBoxRiser = new G4Box(nameStr2, widthH/2., heightRiser/2.0, thickH/2.0);
366  G4LogicalVolume *pCurrentRiser =
367  new G4LogicalVolume(aBoxRiser, myAlumOC, nameStr2);
368 
369  G4String nameStr3(nameStrH); nameStr3 += G4String("Hanger");
370  const double heightH = radInnerOC - radRingSpiderSuppICOuter - 1.0*CLHEP::mm - heightRiser;
371  const double widthH2 = 1.0*in; // 363115 Note: we collapsed both hanger along the horizontal, transverse
372  // direction.
373  const double thickH2 = 0.031*in;
374  G4Box *aBoxHanger = new G4Box(nameStr3, widthH2/2., heightH/2.0, thickH2/2.0);
375  G4LogicalVolume *pCurrentHanger =
376  new G4LogicalVolume(aBoxHanger, myAlumOC, nameStr3);
377 
378  posTmp[2] = zSpiderSupport;
379 
380  for (int iRot=0; iRot != 3; iRot++) {
381  std::ostringstream rnStrStr; rnStrStr << "_" << (iRot+1);
382  G4String rnStr(rnStrStr.str());
383  // Same Z position as above...
384  G4RotationMatrix * rMatPr = 0;
385  if (iRot == 1) {
386  rMatPr = new G4RotationMatrix;
387  rMatPr->rotateZ(2.0*M_PI/3.);
388  } else if (iRot == 2) {
389  rMatPr = new G4RotationMatrix;
390  rMatPr->rotateZ(-2.0*M_PI/3.);
391  }
392 
393  const double dHRiser = radRingSpiderSuppICOuter + 0.010*CLHEP::mm + heightRiser/2.;
394  posTmp[0] = 0.; posTmp[1] = dHRiser;
395  if (iRot != 0) {
396  posTmp[0] = dHRiser*rMatPr->xy();
397  posTmp[1] = dHRiser*rMatPr->yy();
398  }
399  if (iRot == 0) {
400  new G4PVPlacement(rMatPr, posTmp, pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
401  volMother, false, iRot, fCheckVolumeOverLapWC);
402  } else {
403  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
404  volMother, false, iRot, true);
405  }
406 // Now the hanger it self
407 
408  const double dHHanger = radRingSpiderSuppICOuter + 0.010*CLHEP::mm + 0.5*CLHEP::mm + heightRiser + heightH/2.;
409  posTmp[0] = 0.; posTmp[1] = dHHanger;
410  if (iRot != 0) {
411  posTmp[0] = dHHanger*rMatPr->xy();
412  posTmp[1] = dHHanger*rMatPr->yy();
413  }
414  // Same Z position as above...
415  if (iRot == 0) {
416  new G4PVPlacement(rMatPr, posTmp, pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
417  volMother, false, iRot, fCheckVolumeOverLapWC);
418  } else {
419  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
420  volMother, false, iRot, true);
421  }
422  } // on the 120 degree symmetry point.
423 //
424 }
425  //
426  // Finally, the water layer..
427  //
428  if (fWaterLayerThickInHorns > 1.0e-6) {
429 
430  //
431  // On the Inner cylindrical section around the target.
432  //
433  G4Material *myWater = G4Material::GetMaterial("Water");
434 
435  const double lengthICCylW = zEndOfWaterLayer - zZeroLocalCoord;
436  const double radWaterInnerCyl = radInnerInnerCyl + thickInner + 0.025*CLHEP::mm;
437  const double radWaterOuter = radWaterInnerCyl + fWaterLayerThickInHorns;
438  G4String aNStrTmpW0("LBNFConceptHornAICCylWater");
439  G4Tubs* aVolIC0GWT = new G4Tubs(aNStrTmpW0,
440  radWaterInnerCyl, radWaterOuter, 0.5*lengthICCylW, 0.0, 360.0*CLHEP::degree);
441  G4LogicalVolume *aVolIC0GW = new G4LogicalVolume(aVolIC0GWT, myWater, aNStrTmpW0);
442  G4ThreeVector posTmpW(0., 0., zZeroLocalCoord + 0.5*lengthICCylW);
443  new G4PVPlacement((G4RotationMatrix *) 0, posTmpW, aVolIC0GW, aNStrTmpW0 + std::string("_P"),
444  volMother, false, 1, true);
445  //
446  // We neglect the small segment between the end of the cylindrical section and
447  // the start of the tapered section.
448  //
449  G4VisAttributes* visAttributes = new G4VisAttributes(G4Colour(0.0,0.0,0.9));
450  visAttributes->SetVisibility(true);
451  std::string aNStrTmpIC1W = G4String("LBNFConceptHornAICDTaperCL1Water");
452  zTmps[0] = zZeroLocalCoord + lengthICCyl + 0.002*CLHEP::mm;
453  rTmps[0] = radInnerInnerCyl + thickInner + 0.025*CLHEP::mm;
454  rTmps[1] = 33*CLHEP::mm + thickInner + 0.025*CLHEP::mm;
455  aNStrTmp = std::string("LBNFConceptHornAICTaperWater_1");
456  G4Cons* aVolIC1GConW_1 =
457  new G4Cons(aNStrTmp, rTmps[0], rTmps[0]+fWaterLayerThickInHorns,
458  rTmps[1], rTmps[1]+fWaterLayerThickInHorns, 0.5*lengthTaperedIC1_1,
459  0.0, 360.0*CLHEP::degree);
460  G4LogicalVolume *aVolIC1GW_1 = new G4LogicalVolume(aVolIC1GConW_1, myWater, aNStrTmp);
461  aVolIC1GW_1->SetVisAttributes(visAttributes);
462  G4ThreeVector posTmpW2_1 (0., 0.,
463  zZeroLocalCoord + lengthICCyl + 0.5*lengthTaperedIC1_1 + 0.002*CLHEP::mm);
464  new G4PVPlacement((G4RotationMatrix *) 0, posTmpW2_1, aVolIC1GW_1, aNStrTmp + std::string("_P"),
465  volMother, false, 1, true);
466 
467  //adding second water segment since we added an additional tapered cone
468  //see Cory's drawing (email to Zarko and Laura on Jan 2019)
469  zTmps[0] = zZeroLocalCoord + lengthICCyl + 0.002*CLHEP::mm+lengthTaperedIC1_1;
470  rTmps[0] = rTmps[1];
471  rTmps[1] = 33*CLHEP::mm + thickInnerIC1_2 + 0.025*CLHEP::mm;
472  aNStrTmp = std::string("LBNFConceptHornAICTaperWater_2");
473  G4Cons* aVolIC1GConW_2 =
474  new G4Cons(aNStrTmp, rTmps[0], rTmps[0]+fWaterLayerThickInHorns,
475  rTmps[1], rTmps[1]+fWaterLayerThickInHorns, 0.5*lengthTaperedIC1_2,
476  0.0, 360.0*CLHEP::degree);
477  G4LogicalVolume *aVolIC1GW_2 = new G4LogicalVolume(aVolIC1GConW_2, myWater, aNStrTmp);
478  aVolIC1GW_2->SetVisAttributes(visAttributes);
479  G4ThreeVector posTmpW2_2 (0., 0.,
480  zZeroLocalCoord + lengthICCyl + lengthTaperedIC1_1 + 0.5*lengthTaperedIC1_2 + 0.002*CLHEP::mm);
481  new G4PVPlacement((G4RotationMatrix *) 0, posTmpW2_2, aVolIC1GW_2, aNStrTmp + std::string("_P"),
482  volMother, false, 1, true);
483  }
484  //
485  // Check the exact R/Z coordinates...
486  //
487  for (size_t k=0; k != fZCoordCDRevisedHornA.size(); k++) fZCoordCDRevisedHornA[k] -= zShiftMotherCoords;
488  std::cerr << " Dump of the R/Z map, accurate, for the magnetic field " << std::endl;
489  for (size_t k=0; k != fZCoordCDRevisedHornA.size(); k++) {
490  std::cerr << " " << k << " " << fRInCoordCDRevisedHornA[k] << " " << fZCoordCDRevisedHornA[k] << std::endl;
491  }
492  std::cerr << "... Should be good to go... " <<std::endl;
493  return;
494 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
std::vector< double > fRInCoordCDRevisedHornA
std::vector< double > fParams
std::vector< double > fZCoordCDRevisedHornA
QTextStream & endl(QTextStream &s)
std::vector< G4String > fHorn1IC
void LBNEVolumePlacements::PlaceFinalLBNFConceptHornB ( )

Definition at line 545 of file LBNFConceptDesignHorns.cc.

545  {
546 
547  std::cerr
548  << " LBNEVolumePlacements::PlaceFinalLBNFConceptHornB..Rev 2 Drawing F10071359... Start with upstream IO/layer. "
549  << std::endl;
550  fZCoordCDRevisedHornB.clear();
551  fRInCoordCDRevisedHornB.clear();
552 
553  const double in = 25.4*CLHEP::mm;
554  const std::string header("LBNFConceptHornB");
555  const LBNEVolumePlacementData *plDatMother = this->Find(header, "LBNFSimpleHorn2Container",
556  "LBNEVolumePlacements::PlaceFinalLBNFConceptHornB");
557  G4LogicalVolume *volMother = plDatMother->fCurrent;
558  const double lengthMother=plDatMother->fParams[2];
559  const double zShiftMotherCoords = 0.005*CLHEP::mm; // We have little room in this case..
560  const size_t nSegUpstrIO = 20;
561  const double radInnerInner = 159.0*CLHEP::mm;
562  const double thickInner = 3.0*CLHEP::mm;
563  fThickICDRevisedHornB = thickInner; // for the magnetic field accurate definition of fiducials.
564  const double zStartUpstrIOC = -0.5*lengthMother + 0.025*CLHEP::mm; // small clearance,
565  const double deltaPhiUpstrIO = M_PI/nSegUpstrIO;
566  const double radOuterUpstIO = 0.5*(642. - radInnerInner) *CLHEP::mm; // Drawing F10071359.
567  const double radInnerUpstIO = 0.5*(2.0*radOuterUpstIO - 8.0*CLHEP::mm - thickInner); // Drawing F10060435
568  const double distUpstreamToBeginIC = radOuterUpstIO + 0.025 ; // 25 microns clearance..
569  const double zZeroLocalCoord = -0.5*lengthMother + distUpstreamToBeginIC;
570  const double radInnerOC = 634.0*CLHEP::mm;
571  std::cerr << " .....Mother Volume name " << volMother->GetName()
572  << " zShiftMother " << zShiftMotherCoords << " distUpstreamToBeginIC "
573  << distUpstreamToBeginIC << " zZeroLocalCoords " << zZeroLocalCoord << std::endl;
574 
575  std::vector<double> zTmps(20, 0.); std::vector<double> rTmps(20, 0.); // more room for later
576  G4ThreeVector zeroC(0., 0., 0.);
577  G4Material *myAlumina = G4Material::GetMaterial("Alumina");
578  G4Material *myAlumIC = G4Material::GetMaterial(fHorn2InnerCondMat.c_str());
579  G4Material *myAlumOC = G4Material::GetMaterial(fHorn2AllCondMat.c_str());
580  if (fHorn2AllCondMat.find("Alum") != std::string::npos)
581  myAlumina = G4Material::GetMaterial(fHorn2AllCondMat.c_str());
582  G4Material *myWater = 0;
583  if (fWaterLayerThickInHorns > 1.0e-6) myWater = G4Material::GetMaterial("Water");
584  size_t nSegUpstrIOBy2 = nSegUpstrIO/2;
585  fZCoordCDRevisedHornB.resize(nSegUpstrIOBy2);
586  fRInCoordCDRevisedHornB.resize(nSegUpstrIOBy2);
587 
588  for (size_t kPhi = 0; kPhi != nSegUpstrIO; kPhi++ ) {
589  std::ostringstream aNStrStr; aNStrStr << header << "UpstrIOSect" << kPhi;
590  std::string aNStr(aNStrStr.str());
591  fHorn2IC.push_back(aNStr);
592  const double phi0 = kPhi*deltaPhiUpstrIO + 1.0e-5;
593  const double phi1 = phi0 + deltaPhiUpstrIO - 2.0e-5;
594  zTmps[0] = zStartUpstrIOC + radOuterUpstIO - radOuterUpstIO*std::sin(phi1);
595  zTmps[1] = zStartUpstrIOC + radOuterUpstIO - radOuterUpstIO*std::sin(phi0);
596  zTmps[2] = zStartUpstrIOC + radOuterUpstIO - radInnerUpstIO*std::sin(phi0);
597  zTmps[3] = zStartUpstrIOC + radOuterUpstIO - radInnerUpstIO*std::sin(phi1);
598  rTmps[0] = radInnerInner + radOuterUpstIO - radOuterUpstIO*std::cos(phi1);
599  rTmps[1] = radInnerInner + radOuterUpstIO - radOuterUpstIO*std::cos(phi0);
600  rTmps[2] = radInnerInner + thickInner + radInnerUpstIO - radInnerUpstIO*std::cos(phi0);
601  rTmps[3] = radInnerInner + thickInner + radInnerUpstIO - radInnerUpstIO*std::cos(phi1);
602 // std::cerr << " At kPhi " << kPhi << " Phi0 " << phi0 << " Phi1 " << phi1 << " rZVector " << std::endl;
603 // for (size_t kk=0; kk != 4; kk++) std::cerr << " " << rTmps[kk] << " " <<
604 // zTmps[kk] << " " << std::endl;
605  G4GenericPolycone *aVolGP = new G4GenericPolycone(aNStr, 0.0, 360.0*CLHEP::degree, 4, &rTmps[0], &zTmps[0]);
606  G4LogicalVolume *aVolG = new G4LogicalVolume(aVolGP, myAlumIC, aNStr);
607  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolG, aNStr + std::string("_P"),
608  volMother, false, 1, true);
609 
610  if (kPhi < nSegUpstrIO/2) {
611  fRInCoordCDRevisedHornB[nSegUpstrIOBy2 - 1 - kPhi] = rTmps[1];
612  fZCoordCDRevisedHornB[nSegUpstrIOBy2 - 1 - kPhi] = zTmps[1] - zZeroLocalCoord; // with respect to zZero.
613  }
614  }
615  //
616  // The IC Upstream Out flange. We include a thin flange which is the transition between the
617  // IOC transition and the IC upstream outer flange.
618  //
619  {
620  const double thickUpstrICFlangeTr = 10.0;
621  const double radInnerICFl = 634.*CLHEP::mm;
622  const double radOuterICFlTr = radInnerICFl + 10.0*(1.0- M_PI/4.); // approximate. Exact shape is a cylinder - torus.
623  std::string aNStrTmp0(header); aNStrTmp0 += std::string("ICFlUtr");
624  fHorn1IC.push_back(aNStrTmp0);
625  G4Tubs* aVolICFlG0 = new G4Tubs(aNStrTmp0, radInnerICFl, radOuterICFlTr,
626  0.5*thickUpstrICFlangeTr, 0.0, 360.0*CLHEP::degree);
627  G4LogicalVolume *aVolICFlGL0 = new G4LogicalVolume(aVolICFlG0, myAlumIC, aNStrTmp0);
628 
629  G4ThreeVector posTmp0(0., 0.,
630  zZeroLocalCoord + 0.5*thickUpstrICFlangeTr + 0.05*CLHEP::mm);
631  new G4PVPlacement((G4RotationMatrix *) 0, posTmp0, aVolICFlGL0, aNStrTmp0 + std::string("_P"),
632  volMother, false, 1, true);
633 
634  const double thickUpstrICFlange = 29.8;
635  const double radOuterICFl = 691.5*CLHEP::mm;
636  std::string aNStrTmp(header); aNStrTmp += std::string("ICFlU");
637  G4Tubs* aVolICFlG = new G4Tubs(aNStrTmp, radInnerICFl, radOuterICFl,
638  0.5*thickUpstrICFlange, 0.0, 360.0*CLHEP::degree);
639  G4LogicalVolume *aVolICFlGL = new G4LogicalVolume(aVolICFlG, myAlumIC, aNStrTmp);
640 
641  G4ThreeVector posTmp(0., 0.,
642  zZeroLocalCoord + thickUpstrICFlangeTr + 0.5*thickUpstrICFlange + 0.1*CLHEP::mm);
643  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolICFlGL, aNStrTmp + std::string("_P"),
644  volMother, false, 1, true);
645  }
646  //
647  // A cylinder (G4tubs) for the first IC segment.
648  //
649  double zCoordLocalCurrent = zZeroLocalCoord;
650  fZCoordCDRevisedHornB.push_back(0.);
651  fRInCoordCDRevisedHornB.push_back(radInnerInner);
652  const double lengthFirstCylIC = 1089.*CLHEP::mm; // Downstream end, tight.
653  const double lengthFirstCylICWUp = lengthFirstCylIC - 126.*CLHEP::mm; // we subtract this to make room for the
654  // spider support. 2mm clearance...
655  const double lengthSpiderWebSupportOnIC = 27*CLHEP::mm;
656  std::vector<double> zPosSpiderWebSupportOnIC(3, 0.);
657  std::vector<double> radRingSpiderSuppICOuter(3, 0.);
658  {
659 
660  const double radInnerOuter = radInnerInner + thickInner;
661  std::string aNStrTmp(header); aNStrTmp += std::string("ICCyl0");
662  G4Tubs* aVolIC0GT = new G4Tubs(aNStrTmp,
663  radInnerInner, radInnerOuter, 0.5*lengthFirstCylIC, 0.0, 360.0*CLHEP::degree);
664  G4LogicalVolume *aVolIC0G = new G4LogicalVolume(aVolIC0GT, myAlumIC, aNStrTmp);
665  G4ThreeVector posTmp(0., 0., zZeroLocalCoord + 0.5*lengthFirstCylIC);
666  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolIC0G, aNStrTmp + std::string("_P"),
667  volMother, false, 1, true);
668  zCoordLocalCurrent += lengthFirstCylIC + 0.025*CLHEP::mm;
669  if (fWaterLayerThickInHorns > 1.0e-6) {
670  const double radInnerW = radInnerOuter + 0.010;
671  const double radOuterW = radInnerW + fWaterLayerThickInHorns;
672  std::string aNStrTmpWUp(aNStrTmp); aNStrTmpWUp += std::string("WaterUp");
673  G4Tubs* aVolIC0GTWUp = new G4Tubs(aNStrTmpWUp,
674  radInnerW, radOuterW, 0.5*lengthFirstCylICWUp, 0.0, 360.0*CLHEP::degree);
675  G4LogicalVolume *aVolIC0GWUp = new G4LogicalVolume(aVolIC0GTWUp, myWater, aNStrTmpWUp);
676  G4ThreeVector posTmpWUp(0., 0., zZeroLocalCoord + 0.5*lengthFirstCylICWUp);
677  new G4PVPlacement((G4RotationMatrix *) 0, posTmpWUp, aVolIC0GWUp, aNStrTmpWUp + std::string("_P"),
678  volMother, false, 1, true);
679  //
680  // The downstream end, past the spider web support.
681  const double lengthFirstCylICWDw = 92. *CLHEP::mm; // with ~ one mm clearance.
682  std::string aNStrTmpWDw(aNStrTmp); aNStrTmpWDw += std::string("WaterDw");
683  G4Tubs* aVolIC0GTWDw = new G4Tubs(aNStrTmpWDw,
684  radInnerW, radOuterW, 0.5*lengthFirstCylICWDw, 0.0, 360.0*CLHEP::degree);
685  G4LogicalVolume *aVolIC0GWDw = new G4LogicalVolume(aVolIC0GTWDw, myWater, aNStrTmpWDw);
686  G4ThreeVector posTmpWDw(0., 0.,
687  zZeroLocalCoord + lengthFirstCylIC - 0.5*lengthFirstCylICWDw);
688  new G4PVPlacement((G4RotationMatrix *) 0, posTmpWDw, aVolIC0GWDw, aNStrTmpWDw + std::string("_P"),
689  volMother, false, 1, true);
690 
691  }
692  //
693  // A weld.. At the downstream end..of this cylindre..
694  // Approximation: it is a smooth bulge, total length is 23 mm. We make it a bit shorter,
695  //
696  const double lengthFirstWeld = 16.0*CLHEP::mm; // we subtract 5 mm to make room for the weld.
697  double radInnerWeld = radInnerOuter + 0.010;
698  double radOuterWeld = radInnerWeld + 2.0; // top of the bulge at 165, 4.5 mm thick max.
699  // place this weld on top of the water layer.. for modeling simplicity.
700  if (fWaterLayerThickInHorns > 1.0e-6) {
701  radInnerWeld += 0.005*CLHEP::mm + fWaterLayerThickInHorns;
702  radOuterWeld += 0.005*CLHEP::mm + fWaterLayerThickInHorns;
703  }
704  std::string aNStrTmpWeld(aNStrTmp); aNStrTmpWeld += std::string("Weld");
705  G4Tubs* aVolIC0GTWe = new G4Tubs(aNStrTmpWeld,
706  radInnerWeld, radOuterWeld, 0.5*lengthFirstWeld, 0.0, 360.0*CLHEP::degree);
707  G4LogicalVolume *aVolIC0GWe = new G4LogicalVolume(aVolIC0GTWe, myAlumIC, aNStrTmpWeld);
708  G4ThreeVector posTmpWeld(0., 0., zZeroLocalCoord + lengthFirstCylIC - 36.); // approximate. Z location, few mm.
709  new G4PVPlacement((G4RotationMatrix *) 0, posTmpWeld, aVolIC0GWe, aNStrTmpWeld + std::string("_P"),
710  volMother, false, 1, true);
711  // Lastly, the attachment ring for the spider web support. (first one.)
712  //
713  std::string aNStrTmpSpd(aNStrTmp); aNStrTmpSpd += std::string("SPWS");
714  G4Tubs* aVolIC0GTSpd = new G4Tubs(aNStrTmpSpd,
715  radInnerOuter+0.010*CLHEP::mm,
716  radInnerOuter+7.5*CLHEP::mm, 0.5*lengthSpiderWebSupportOnIC, 0.0, 360.0*CLHEP::degree);
717  G4LogicalVolume *aVolIC0GSpd = new G4LogicalVolume(aVolIC0GTSpd, myAlumIC, aNStrTmpSpd);
718  G4ThreeVector posTmpSpd(0., 0., zZeroLocalCoord + lengthFirstCylIC - 110.*CLHEP::mm);
719  // approximate. Z location, few mm.
720  zPosSpiderWebSupportOnIC[0] = posTmpSpd[2];
721  radRingSpiderSuppICOuter[0] = radInnerOuter+7.5*CLHEP::mm + 0.025*CLHEP::mm;
722  new G4PVPlacement((G4RotationMatrix *) 0, posTmpSpd, aVolIC0GSpd, aNStrTmpSpd + std::string("_P"),
723  volMother, false, 1, true);
724 
725  }
726  //
727  // The upstream conical section..Implemented as a G4GenericPolygon.
728  //
729  const double radInnerInnerNeck = 81.0*CLHEP::mm;
730  {
731  std::string aNStrTmp(header); aNStrTmp += std::string("UpstrCone");
732  const double lengthUpstrConeSec1 = 18.23*CLHEP::mm;
733  const double lengthUpstrConeSec2 = 851.46*CLHEP::mm;
734  const double lengthUpstrConeSec3 = 8.98*CLHEP::mm;
735  const double lengthUpstrCone = (lengthUpstrConeSec1 + lengthUpstrConeSec2 + lengthUpstrConeSec3);
736  // three steps.. probably futzing around too much..
737  std::cerr << " Before defining upstream conical section, zCoordLocalCurrent "
738  << zCoordLocalCurrent << std::endl;
739  zTmps[0] = zCoordLocalCurrent;
740  rTmps[0] = radInnerInner;
741  zTmps[1] = zCoordLocalCurrent + lengthUpstrConeSec1;
742  rTmps[1] = 158.2*CLHEP::mm;
743  zTmps[2] = zTmps[1] + lengthUpstrConeSec2;
744  rTmps[2] = 81.42*CLHEP::mm;
745  zTmps[3] = zTmps[2] + lengthUpstrConeSec3;
746  rTmps[3] = radInnerInnerNeck;
747  for (size_t kk=0; kk != 4; kk++) {
748  zTmps[4+kk] = zTmps[4 - kk - 1];
749  rTmps[4+kk] = rTmps[4 - kk - 1] + thickInner;
750  }
751  for(size_t kk=0; kk != 4; kk++) {
752  fZCoordCDRevisedHornB.push_back(zTmps[kk] - zZeroLocalCoord);
753  fRInCoordCDRevisedHornB.push_back(rTmps[kk]);
754  }
755  G4GenericPolycone *aVolGPCU =
756  new G4GenericPolycone(aNStrTmp, 0.0, 360.0*CLHEP::degree, 8, &rTmps[0], &zTmps[0]);
757  G4LogicalVolume *aVolGCU = new G4LogicalVolume(aVolGPCU, myAlumIC, aNStrTmp);
758  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolGCU, aNStrTmp + std::string("_P"),
759  volMother, false, 1, true);
760 
761  if (fWaterLayerThickInHorns > 1.0e-6) {
762  // We implement two polycone, as we have a spider web support on the way, and the distance
763  // between the downstream edge and the end of section is not negligible.
764  std::vector<double> zTmpsW(zTmps);
765  std::vector<double> rTmpsW(rTmps); // Oversized.
766  for (size_t kk=0; kk != 2; kk++) rTmpsW[kk] += thickInner + .025*CLHEP::mm;
767  zTmpsW[2] = zTmpsW[1] + 686.*CLHEP::mm;
768  rTmpsW[2] = (0.5+99.27)*CLHEP::mm; // lift up, because of the margin, longitudinally
769  for (size_t kk=0; kk != 3; kk++) {
770  zTmpsW[3+kk] = zTmpsW[3 - kk - 1];
771  rTmpsW[3+kk] = rTmpsW[3 - kk - 1] + fWaterLayerThickInHorns;
772  }
773  std::cerr << " Last Z coord for water layer, upstream cone, upstr section " << zTmpsW[2] << std::endl;
774 
775  std::string aNStrTmpWUp(aNStrTmp); aNStrTmpWUp += std::string("WaterUp");
776  G4GenericPolycone* aVolUCGTWUp =
777  new G4GenericPolycone(aNStrTmpWUp, 0.0, 360.0*CLHEP::degree, 6, &rTmpsW[0], &zTmpsW[0]);
778  G4LogicalVolume *aVolUCGWUp = new G4LogicalVolume(aVolUCGTWUp, myWater, aNStrTmpWUp);
779  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolUCGWUp, aNStrTmpWUp + std::string("_P"),
780  volMother, false, 1, true);
781  const double lengthUpstrUpstrConeW = lengthUpstrConeSec1 + 686.*CLHEP::mm;
782  zTmpsW[0] = zCoordLocalCurrent + lengthUpstrUpstrConeW + lengthSpiderWebSupportOnIC + 0.5*CLHEP::mm;
783  rTmpsW[0] = (96.650 + 0.3)*CLHEP::mm;
784  zTmpsW[1] = zTmpsW[0] + 143.*CLHEP::mm; // approximate, few mm.
785  rTmpsW[1] = (radInnerInnerNeck + thickInner + 0.6)*CLHEP::mm; // lift up again, clash with IC
786  zTmpsW[2] = zTmpsW[1];
787  rTmpsW[2] = rTmpsW[1] + fWaterLayerThickInHorns;
788  zTmpsW[3] = zTmpsW[0];
789  rTmpsW[3] = rTmpsW[0] + fWaterLayerThickInHorns;
790  std::cerr << " Last zCoord for LBNFConceptHornBUpstrConeWaterDw "
791  << zTmpsW[1] << " lengthUpstrUpstrConeW " <<lengthUpstrUpstrConeW
792  << " zCoordLocalCurrent " << zCoordLocalCurrent << std::endl;
793  std::string aNStrTmpWDw(aNStrTmp); aNStrTmpWDw += std::string("WaterDw");
794  G4GenericPolycone* aVolUCGTWDw =
795  new G4GenericPolycone(aNStrTmpWDw, 0.0, 360.0*CLHEP::degree, 4, &rTmpsW[0], &zTmpsW[0]);
796  G4LogicalVolume *aVolUCGWDw = new G4LogicalVolume(aVolUCGTWDw, myWater, aNStrTmpWDw);
797  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolUCGWDw, aNStrTmpWDw + std::string("_P"),
798  volMother, false, 1, true);
799 
800  }
801  //
802  // Lastly, we place a Spider web support attachment ring
803  //
804  std::string aNStrTmpSpd(aNStrTmp); aNStrTmpSpd += std::string("SPWS");
805  G4Tubs* aVolICodGTSpd = new G4Tubs(aNStrTmpSpd,
806  99.20+0.030*CLHEP::mm,
807  99.23+7.5*CLHEP::mm, 0.5*lengthSpiderWebSupportOnIC, 0.0, 360.0*CLHEP::degree);
808  G4LogicalVolume *aVolICodGSpd = new G4LogicalVolume(aVolICodGTSpd, myAlumIC, aNStrTmpSpd);
809  G4ThreeVector posTmpSpd(0., 0.,
810  zCoordLocalCurrent + lengthUpstrCone - 173.2*CLHEP::mm + 0.5*lengthSpiderWebSupportOnIC ); // approximate. Z location, few mm.
811  zPosSpiderWebSupportOnIC[1] = posTmpSpd[2];
812  radRingSpiderSuppICOuter[1] = 99.23 + 7.5*CLHEP::mm + 0.025*CLHEP::mm;
813  new G4PVPlacement((G4RotationMatrix *) 0, posTmpSpd, aVolICodGSpd, aNStrTmpSpd + std::string("_P"),
814  volMother, false, 1, true);
815 
816  zCoordLocalCurrent += lengthUpstrCone + 0.025;
817  std::cerr << " Last Z coord for upstr. cone " << zCoordLocalCurrent << std::endl;
818  }
819  const double thickNeck = 3.0*CLHEP::mm;
820 
821  // The neck..
822  {
823 
824  const double lengthNeck = 62.4; // exact. ;
825  const double radInnerOuterNeck = radInnerInnerNeck + thickNeck;
826  std::string aNStrTmp(header); aNStrTmp += std::string("Neck");
827  G4Tubs* aVolNeckGT = new G4Tubs(aNStrTmp,
828  radInnerInnerNeck, radInnerOuterNeck, 0.5*lengthNeck, 0.0, 360.0*CLHEP::degree);
829  G4LogicalVolume *aVolNeckG = new G4LogicalVolume(aVolNeckGT, myAlumIC, aNStrTmp);
830  G4ThreeVector posTmp(0., 0., zCoordLocalCurrent + 0.5*lengthNeck);
831  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolNeckG, aNStrTmp + std::string("_P"),
832  volMother, false, 1, true);
833  if (fWaterLayerThickInHorns > 1.0e-6) {
834  const double lengthNeckW = lengthNeck - 0.010*CLHEP::mm; //Clearance, religious...
835  const double radInnerNeckW = radInnerOuterNeck + 0.010;
836  const double radOuterNeckW = radInnerNeckW + fWaterLayerThickInHorns;
837  std::string aNStrTmpW(aNStrTmp); aNStrTmpW += std::string("Water");
838  G4Tubs* aVolNeckGTW = new G4Tubs(aNStrTmpW,
839  radInnerNeckW, radOuterNeckW, 0.5*lengthNeckW, 0.0, 360.0*CLHEP::degree);
840  G4LogicalVolume *aVolNeckGW = new G4LogicalVolume(aVolNeckGTW, myWater, aNStrTmpW);
841  G4ThreeVector posTmpW(posTmp); posTmpW[2] -= 0.050*CLHEP::mm;
842  new G4PVPlacement((G4RotationMatrix *) 0, posTmpW, aVolNeckGW, aNStrTmpW + std::string("_P"),
843  volMother, false, 1, true);
844 
845  }
846  zCoordLocalCurrent += lengthNeck + 0.025*CLHEP::mm;
847  fZCoordCDRevisedHornB.push_back(zCoordLocalCurrent - zZeroLocalCoord);
848  fRInCoordCDRevisedHornB.push_back(radInnerInnerNeck);
849  std::cerr << " Last Z coord for upstr. cone and neck " << zCoordLocalCurrent << std::endl;
850  }
851  //
852  // The downstream cone.
853  //
854  {
855  std::string aNStrTmp(header); aNStrTmp += std::string("DwnstrCone");
856  zTmps[0] = zCoordLocalCurrent;
857  rTmps[0] = radInnerInnerNeck;
858  const double zDwnstCL1 = 22.3*CLHEP::mm;
859  zTmps[1] = zTmps[0] + zDwnstCL1;
860  rTmps[1] = 83.6*CLHEP::mm;
861  const double zDwnstCL2 = 595.75*CLHEP::mm;
862  zTmps[2] = zTmps[1] + zDwnstCL2;
863  rTmps[2] = 219.9*CLHEP::mm;
864  const double zDwnstCL3 = 44.63*CLHEP::mm;
865  zTmps[3] = zTmps[2] + zDwnstCL3;
866  rTmps[3] = 225.0*CLHEP::mm;
867  for (size_t kk=0; kk != 4; kk++) {
868  zTmps[4+kk] = zTmps[4 - kk - 1];
869  rTmps[4+kk] = rTmps[4 - kk - 1] + thickInner;
870  }
871 
872  G4GenericPolycone *aVolGPCD =
873  new G4GenericPolycone(aNStrTmp, 0.0, 360.0*CLHEP::degree, 8, &rTmps[0], &zTmps[0]);
874  G4LogicalVolume *aVolGCD = new G4LogicalVolume(aVolGPCD, myAlumIC, aNStrTmp);
875  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolGCD, aNStrTmp + std::string("_P"),
876  volMother, false, 1, true);
877  for(size_t kk=0; kk != 4; kk++) {
878  fZCoordCDRevisedHornB.push_back(zTmps[kk] - zZeroLocalCoord);
879  fRInCoordCDRevisedHornB.push_back(rTmps[kk]);
880  }
881  if (fWaterLayerThickInHorns > 1.0e-6) {
882  // No futz around.. No welds now spider support.
883  std::vector<double> rTmpsW(rTmps);
884  for (size_t kk=0; kk != 4; kk++) rTmps[kk] = rTmps[4+kk] + 0.025*CLHEP::mm;
885  for (size_t kk=0; kk != 4; kk++) rTmps[kk+4] = rTmps[4] + fWaterLayerThickInHorns;
886  std::vector<double> zTmpsW(zTmps);
887  std::string aNStrTmpW(aNStrTmp); aNStrTmpW += std::string("Water");
888  G4GenericPolycone* aVolDCGTW =
889  new G4GenericPolycone(aNStrTmpW, 0.0, 360.0*CLHEP::degree, 8, &rTmpsW[0], &zTmpsW[0]);
890  G4LogicalVolume *aVolDCGW = new G4LogicalVolume(aVolDCGTW, myWater, aNStrTmpW);
891  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolDCGW, aNStrTmpW + std::string("_P"),
892  volMother, false, 1, true);
893 
894  }
895  zCoordLocalCurrent += zDwnstCL1 + zDwnstCL2 + zDwnstCL3 + 0.025*CLHEP::mm;
896  std::cerr << " zCoordLocalCurrent, just before defining downstream cylinder " << zCoordLocalCurrent << std::endl;
897 
898  }
899  //
900  // The downstream cylinder.
901  //
902  const double lengthICDwnstrCyl = (1042.82 - 0.1)*CLHEP::mm; // as we have adding a bit of length each time,
903  // substract some..
904  const double radInnerInnerDw = 225.0*CLHEP::mm;
905  {
906 
907  const double radInnerOuterDw = radInnerInnerDw + thickInner;
908  std::string aNStrTmp(header); aNStrTmp += std::string("ICCyl1");
909  G4Tubs* aVolIC0GT = new G4Tubs(aNStrTmp,
910  radInnerInnerDw, radInnerOuterDw, 0.5*lengthICDwnstrCyl, 0.0, 360.0*CLHEP::degree);
911  G4LogicalVolume *aVolIC0G = new G4LogicalVolume(aVolIC0GT, myAlumIC, aNStrTmp);
912  G4ThreeVector posTmp(0., 0., zCoordLocalCurrent + 0.5*lengthICDwnstrCyl);
913  std::cerr << " Long. Position of downstream cylinder " << posTmp[2] << " length " << lengthICDwnstrCyl<< std::endl;
914  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolIC0G, aNStrTmp + std::string("_P"),
915  volMother, false, 1, true);
916  if (fWaterLayerThickInHorns > 1.0e-6) {
917  double lengthICDwnCylICWUp = 101.5*CLHEP::mm - 1.0*CLHEP::mm;
918  // First short section, upstream of the spider support. Includes the weld.
919  const double radInnerW = radInnerOuterDw + 0.010;
920  const double radOuterW = radInnerW + fWaterLayerThickInHorns;
921  std::string aNStrTmpWUp(aNStrTmp); aNStrTmpWUp += std::string("WaterUp");
922  G4Tubs* aVolIC0GTWUp = new G4Tubs(aNStrTmpWUp,
923  radInnerW, radOuterW, 0.5*lengthICDwnCylICWUp, 0.0, 360.0*CLHEP::degree);
924  G4LogicalVolume *aVolIC0GWUp = new G4LogicalVolume(aVolIC0GTWUp, myWater, aNStrTmpWUp);
925  G4ThreeVector posTmpWUp(0., 0., zCoordLocalCurrent + 0.5*lengthICDwnCylICWUp + 0.5*CLHEP::mm);
926 
927  std::cerr << " Long. Position of downstream cylinder water layer, upstream "
928  << posTmpWUp[2] << " Length " << lengthICDwnCylICWUp << std::endl;
929  new G4PVPlacement((G4RotationMatrix *) 0, posTmpWUp, aVolIC0GWUp, aNStrTmpWUp + std::string("_P"),
930  volMother, false, 1, true);
931  //
932  // The downstream end, past the spider web support.
933  const double lengthICDwnCylICWDw = lengthICDwnstrCyl -
934  lengthICDwnCylICWUp - lengthSpiderWebSupportOnIC - 1.0*CLHEP::mm; // with ~ one mm clearance.
935  std::string aNStrTmpWDw(aNStrTmp); aNStrTmpWDw += std::string("WaterDw");
936  G4Tubs* aVolIC0GTWDw = new G4Tubs(aNStrTmpWDw,
937  radInnerW, radOuterW, 0.5*lengthICDwnCylICWDw, 0.0, 360.0*CLHEP::degree);
938  G4LogicalVolume *aVolIC0GWDw = new G4LogicalVolume(aVolIC0GTWDw, myWater, aNStrTmpWDw);
939  G4ThreeVector posTmpWDw(0., 0.,
940  zCoordLocalCurrent + lengthICDwnCylICWUp +
941  lengthSpiderWebSupportOnIC + 0.5*lengthICDwnCylICWDw + 1.0*CLHEP::mm);
942  std::cerr << " Long. Position of downstream cylinder water layer, downsstream "
943  << posTmpWDw[2] << " Length " << lengthICDwnCylICWDw << std::endl;
944  new G4PVPlacement((G4RotationMatrix *) 0, posTmpWDw, aVolIC0GWDw, aNStrTmpWDw + std::string("_P"),
945  volMother, false, 1, true);
946 
947  }
948  //
949  // We place a weld on top of the water layer, if there.
950  //
951 
952  const double length2ndWeld = 16.0*CLHEP::mm; // we subtract 5 mm to make room for the weld.
953  double radInnerWeld = radInnerOuterDw + 0.010;
954  double radOuterWeld = radInnerWeld + 2.0; // top of the bulge at 165, 4.5 mm thick max.
955  // place this weld on top of the water layer.. for modeling simplicity.
956  if (fWaterLayerThickInHorns > 1.0e-6) {
957  radInnerWeld += 0.005*CLHEP::mm + fWaterLayerThickInHorns;
958  radOuterWeld += 0.005*CLHEP::mm + fWaterLayerThickInHorns;
959  }
960  std::string aNStrTmpWeld(aNStrTmp); aNStrTmpWeld += std::string("Weld");
961  G4Tubs* aVolIC0GTWe = new G4Tubs(aNStrTmpWeld,
962  radInnerWeld, radOuterWeld, 0.5*length2ndWeld, 0.0, 360.0*CLHEP::degree);
963  G4LogicalVolume *aVolIC0GWe = new G4LogicalVolume(aVolIC0GTWe, myAlumIC, aNStrTmpWeld);
964  G4ThreeVector posTmpWeld(0., 0., zCoordLocalCurrent + 48.5*CLHEP::mm + 0.5*length2ndWeld); // approximate. Z location, few mm.
965  new G4PVPlacement((G4RotationMatrix *) 0, posTmpWeld, aVolIC0GWe, aNStrTmpWeld + std::string("_P"),
966  volMother, false, 1, true);
967  //
968  // Lastly, we place a Spider web support attachment ring
969  //
970  std::string aNStrTmpSpd(aNStrTmp); aNStrTmpSpd += std::string("SPWS");
971  G4Tubs* aVolIC1GTSpd = new G4Tubs(aNStrTmpSpd,
972  radInnerOuterDw+0.010*CLHEP::mm,
973  radInnerOuterDw+7.5*CLHEP::mm, 0.5*lengthSpiderWebSupportOnIC, 0.0, 360.0*CLHEP::degree);
974  G4LogicalVolume *aVolIC1GSpd = new G4LogicalVolume(aVolIC1GTSpd, myAlumIC, aNStrTmpSpd);
975  G4ThreeVector posTmpSpd(0., 0.,
976  zCoordLocalCurrent + 101.5*CLHEP::mm + 0.5*lengthSpiderWebSupportOnIC ); // approximate. Z location, few mm.
977  zPosSpiderWebSupportOnIC[2] = posTmpSpd[2];
978  radRingSpiderSuppICOuter[2] = radInnerOuterDw + 7.5*CLHEP::mm + 0.025*CLHEP::mm;
979  std::cerr << " Long. Position of last spider web support ring "
980  << posTmpSpd[2] << " Length " << lengthSpiderWebSupportOnIC << std::endl;
981  new G4PVPlacement((G4RotationMatrix *) 0, posTmpSpd, aVolIC1GSpd, aNStrTmpSpd + std::string("_P"),
982  volMother, false, 1, true);
983 
984  zCoordLocalCurrent += lengthICDwnstrCyl + 0.025*CLHEP::mm;
985  fZCoordCDRevisedHornB.push_back(zCoordLocalCurrent - zZeroLocalCoord);
986  fRInCoordCDRevisedHornB.push_back(radInnerInnerDw);
987 
988  std::cerr << " Distance between the downstream end of IC and zZeroLocal Coord "
989  << zCoordLocalCurrent - zZeroLocalCoord << std::endl;
990 
991  } // Downstream IC cylinder.
992  //
993  // The spider web support themselves.
994  //
995  for (size_t iCs=0; iCs != 3; iCs++) {
996 
997  const double zSpiderSupport = zPosSpiderWebSupportOnIC[iCs];
998  //
999 // The spider support. almost same code as for HornA.
1000 // The connecting piece ring to the hangers.. There are three of them, at 120 degrees from each other.
1001 //
1002  std::string nameStrH(header); nameStrH+= std::string("Spider_");
1003  std::ostringstream osstrTmp; osstrTmp << iCs;
1004  nameStrH += osstrTmp.str() + std::string("_support");
1005  G4String nameStr2(nameStrH); nameStr2 += G4String("_Riser");
1006  const double heightRiser = 0.333*in - 0.020*CLHEP::mm;
1007  const double widthH = 1.5*in; // See drawing 8875.112-MD 363115
1008  const double thickH = 0.184*2*in;
1009  G4Box *aBoxRiser = new G4Box(nameStr2, widthH/2., heightRiser/2.0, thickH/2.0);
1010  G4LogicalVolume *pCurrentRiser =
1011  new G4LogicalVolume(aBoxRiser, myAlumIC, nameStr2);
1012 
1013  G4String nameStr3(nameStrH); nameStr3 += G4String("Hanger");
1014  const double heightH = radInnerOC - radRingSpiderSuppICOuter[iCs] - 1.0*CLHEP::mm - heightRiser;
1015  const double widthH2 = 1.0*in; // 363115 Note: we collapsed both hanger along the horizontal, transverse
1016  // direction.
1017  const double thickH2 = 0.031*in;
1018  G4Box *aBoxHanger = new G4Box(nameStr3, widthH2/2., heightH/2.0, thickH2/2.0);
1019  G4LogicalVolume *pCurrentHanger =
1020  new G4LogicalVolume(aBoxHanger, myAlumIC, nameStr3);
1021 
1022  G4ThreeVector posTmp(0., 0., zSpiderSupport);
1023 
1024  for (int iRot=0; iRot != 3; iRot++) {
1025  std::ostringstream rnStrStr; rnStrStr << "_" << (iRot+1);
1026  G4String rnStr(rnStrStr.str());
1027  // Same Z position as above...
1028  G4RotationMatrix * rMatPr = 0;
1029  if (iRot == 1) {
1030  rMatPr = new G4RotationMatrix;
1031  rMatPr->rotateZ(2.0*M_PI/3.);
1032  } else if (iRot == 2) {
1033  rMatPr = new G4RotationMatrix;
1034  rMatPr->rotateZ(-2.0*M_PI/3.);
1035  }
1036 
1037  const double dHRiser = radRingSpiderSuppICOuter[iCs] + 0.010*CLHEP::mm + heightRiser/2.;
1038  posTmp[0] = 0.; posTmp[1] = dHRiser;
1039  if (iRot != 0) {
1040  posTmp[0] = dHRiser*rMatPr->xy();
1041  posTmp[1] = dHRiser*rMatPr->yy();
1042  }
1043  if (iRot == 0) {
1044  new G4PVPlacement(rMatPr, posTmp, pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
1045  volMother, false, iRot, fCheckVolumeOverLapWC);
1046  } else {
1047  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
1048  volMother, false, iRot, true);
1049  }
1050 // Now the hanger it self
1051 
1052  const double dHHanger = radRingSpiderSuppICOuter[iCs] + 0.010*CLHEP::mm + 0.5*CLHEP::mm + heightRiser + heightH/2.;
1053  posTmp[0] = 0.; posTmp[1] = dHHanger;
1054  if (iRot != 0) {
1055  posTmp[0] = dHHanger*rMatPr->xy();
1056  posTmp[1] = dHHanger*rMatPr->yy();
1057  }
1058  // Same Z position as above...
1059  if (iRot == 0) {
1060  new G4PVPlacement(rMatPr, posTmp, pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
1061  volMother, false, iRot, fCheckVolumeOverLapWC);
1062  } else {
1063  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
1064  volMother, false, iRot, true);
1065  }
1066  } // on the 120 degree symmetry point.
1067  } // Spider support number.
1068  //
1069  // The downstream I/O section. Again, adapted from HornA.
1070  //
1071  double zEndICIOFl = 0.;
1072  {
1073  const double radOuterDownstrtIO = 0.5*(525. - radInnerInnerDw)*CLHEP::mm; // Drawing F10071312.
1074  const double radInnerDownstrtIO = 0.5*(2.0*radOuterDownstrtIO - 8.0*CLHEP::mm - thickInner); //
1075  const double phiStartInnerDownstrtIO = 0.;
1076  const double yCenterInnerDownstrtIO = radInnerInnerDw + thickInner + radInnerDownstrtIO;
1077  const double yCenterOuterDownstrtIO = radInnerInnerDw + radOuterDownstrtIO;
1078  const double zCenterDownstrtIO = zCoordLocalCurrent;
1079  std::cerr << " Check distance between start of the downstream IO section to zZeroLocalCoord "
1080  << zCenterDownstrtIO - zZeroLocalCoord << std::endl;
1081  const size_t nSegDownstrIO = 20.;
1082 // const size_t nSegDownstrIO = 5.;
1083  const double deltaPhiDownstrIO = (M_PI - phiStartInnerDownstrtIO)/nSegDownstrIO;
1084  // This section is physically bigger, and is much more exposed to pion than the upstream one, make it more
1085  for (size_t kPhi = 0; kPhi != nSegDownstrIO; kPhi++ ) {
1086  std::ostringstream aNStrStr; aNStrStr << header << "DownstrIOSect" << kPhi;
1087  std::string aNStr(aNStrStr.str());
1088  fHorn2IC.push_back(aNStr);
1089  const double phi0 = phiStartInnerDownstrtIO + kPhi*deltaPhiDownstrIO + 1.0e-5;
1090  const double phi1 = phi0 + deltaPhiDownstrIO - 2.0e-5;
1091  zTmps[0] = zCenterDownstrtIO + radInnerDownstrtIO*std::sin(phi0);
1092  zTmps[1] = zCenterDownstrtIO + radOuterDownstrtIO*std::sin(phi0);
1093  zTmps[2] = zCenterDownstrtIO + radOuterDownstrtIO*std::sin(phi1);
1094  zTmps[3] = zCenterDownstrtIO + radInnerDownstrtIO*std::sin(phi1);
1095  rTmps[0] = yCenterInnerDownstrtIO - radInnerDownstrtIO*std::cos(phi0);
1096  rTmps[1] = yCenterOuterDownstrtIO - radOuterDownstrtIO*std::cos(phi0);
1097  rTmps[2] = yCenterOuterDownstrtIO - radOuterDownstrtIO*std::cos(phi1);
1098  rTmps[3] = yCenterInnerDownstrtIO - radInnerDownstrtIO*std::cos(phi1);
1099 // std::cerr << " At kPhi " << kPhi << " Phi0 " << phi0 << " Phi1 " << phi1 << " rZVector " << std::endl;
1100 // for (size_t kk=0; kk != 4; kk++) std::cerr << " " << rTmps[kk] << " " <<
1101 // zTmps[kk] << " " << std::endl;
1102  G4GenericPolycone *aVolGP = new G4GenericPolycone(aNStr, 0.0, 360.0*CLHEP::degree, 4, &rTmps[0], &zTmps[0]);
1103  G4LogicalVolume *aVolG = new G4LogicalVolume(aVolGP, myAlumIC, aNStr);
1104  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolG, aNStr + std::string("_P"),
1105  volMother, false, 1, true);
1106  if (kPhi < nSegDownstrIO/2) {
1107  fRInCoordCDRevisedHornB.push_back(rTmps[1]);
1108  fZCoordCDRevisedHornB.push_back(zTmps[0] - zZeroLocalCoord); // with respect to zZero.
1109  }
1110  }
1111  } // Downstream IO section.
1112  //
1113  // The IC Downstream flange.
1114  //
1115  double zLocalDwnstrICFlange = 0.;
1116  {
1117  // First, the curved par of the IOC, leading to the flange. Make it a set of 4 pts polycone.
1118  // same algorithm as above, over 90 instead of 180 degree.
1119  const double radInnerFlDownstrtIO = 50.*CLHEP::mm; // Drawing F10071312.
1120  const double radOuterFlDownstrtIO = 24.5*CLHEP::mm; //
1121  const double phiStartInnerFlDownstrtIO = 0.083333; // eye-balled!!!
1122  const double phiStartOuterFlDownstrtIO = 0.0;
1123  const double yCenterOuterFlDownstrtIO = radOuterFlDownstrtIO + 525.0*CLHEP::mm;
1124  const double yCenterInnerFlDownstrtIO = radInnerFlDownstrtIO + 517.0*CLHEP::mm;
1125  const double zCenterFlDownstrtIO = zCoordLocalCurrent - 0.050*CLHEP::mm;
1126  const size_t nSegFlDownstrIO = 10;
1127  const double deltaPhiFlDownstrIOInner = (M_PI/2.0 - phiStartInnerFlDownstrtIO)/nSegFlDownstrIO;
1128  const double deltaPhiFlDownstrIOOuter = (M_PI/2.0 - phiStartOuterFlDownstrtIO)/nSegFlDownstrIO;
1129 // std::cerr << " Installing curved ICtoInsulator, set of polygons, zCenterFlDownstrtIO "
1130 // << zCenterFlDownstrtIO << " YcOuter " << yCenterOuterFlDownstrtIO
1131 // << " YcInner " << yCenterInnerFlDownstrtIO << std::endl;
1132  for (size_t kPhi = 0; kPhi != nSegFlDownstrIO; kPhi++ ) {
1133  std::ostringstream aNStrStr; aNStrStr << header << "DwnstrFlIOSect" << kPhi;
1134  std::string aNStr(aNStrStr.str());
1135  const double phi0Inner = phiStartInnerFlDownstrtIO + kPhi*deltaPhiFlDownstrIOInner + 1.0e-2;
1136  const double phi1Inner = phi0Inner + deltaPhiFlDownstrIOInner - 2.0e-2;
1137  const double phi0Outer = phiStartOuterFlDownstrtIO + kPhi*deltaPhiFlDownstrIOOuter + 1.0e-2;
1138  const double phi1Outer = phi0Outer + deltaPhiFlDownstrIOOuter - 2.0e-2;
1139  zTmps[0] = zCenterFlDownstrtIO - radOuterFlDownstrtIO*std::cos(phi0Outer);
1140  zTmps[1] = zCenterFlDownstrtIO - radOuterFlDownstrtIO*std::cos(phi1Outer);
1141  zTmps[2] = zCenterFlDownstrtIO - radInnerFlDownstrtIO*std::cos(phi1Inner);
1142  zTmps[3] = zCenterFlDownstrtIO - radInnerFlDownstrtIO*std::cos(phi0Inner);
1143  rTmps[0] = yCenterOuterFlDownstrtIO - radOuterFlDownstrtIO*std::sin(phi0Outer);
1144  rTmps[1] = yCenterOuterFlDownstrtIO - radOuterFlDownstrtIO*std::sin(phi1Outer);
1145  rTmps[2] = yCenterInnerFlDownstrtIO - radInnerFlDownstrtIO*std::sin(phi1Inner);
1146  rTmps[3] = yCenterInnerFlDownstrtIO - radInnerFlDownstrtIO*std::sin(phi0Inner);
1147 // std::cerr << " At kPhi " << kPhi << " Phi0 " << phi0 << " Phi1 " << phi1 << " rZVector " << std::endl;
1148 // for (size_t kk=0; kk != 4; kk++) std::cerr << " " << rTmps[kk] << " " <<
1149 // zTmps[kk] << " " << std::endl;
1150  G4GenericPolycone *aVolGP = new G4GenericPolycone(aNStr, 0.0, 360.0*CLHEP::degree, 4, &rTmps[0], &zTmps[0]);
1151  G4LogicalVolume *aVolG = new G4LogicalVolume(aVolGP, myAlumIC, aNStr);
1152  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolG, aNStr + std::string("_P"),
1153  volMother, false, 1, true);
1154  }
1155  // we now put the outer part of the flange, 25 mm thick
1156 
1157  zTmps[0] = zCenterFlDownstrtIO - radOuterFlDownstrtIO;
1158  rTmps[0] = 629.5*CLHEP::mm;
1159  zTmps[1] = zTmps[0];
1160  rTmps[1] = yCenterOuterFlDownstrtIO + 0.010*CLHEP::mm;
1161  zTmps[2] = zCenterFlDownstrtIO - radInnerFlDownstrtIO;;
1162  rTmps[2] = yCenterInnerFlDownstrtIO + 0.010*CLHEP::mm;;
1163  zTmps[3] = zTmps[2];
1164  rTmps[3] = rTmps[0];
1165  std::string aNStrTmpO(header); aNStrTmpO += std::string("ICDwnstrFlA");
1166  fHorn2IC.push_back(aNStrTmpO);
1167  G4GenericPolycone* aVolDwnstrFlA =
1168  new G4GenericPolycone(aNStrTmpO, 0.0, 360.0*CLHEP::degree, 4, &rTmps[0], &zTmps[0]);
1169  G4LogicalVolume *aVolDwnstrFlAG = new G4LogicalVolume(aVolDwnstrFlA, myAlumOC, aNStrTmpO);
1170  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolDwnstrFlAG, aNStrTmpO + std::string("_P"),
1171  volMother, false, 1, true);
1172  zEndICIOFl = zTmps[0];
1173 
1174  } // End of IC downstream flange
1175  //
1176  // the Outer conductor.
1177  //
1178  double zLocalDwnstrOCFlange = 0.; // to connect to the outer current equalizer section.
1179  double zLocalStartICEQ = 0.;
1180  double zLocalStartOCEQ = 0.;
1181  {
1182  const double thickUpstrFlange = (28.0 -1.5)*CLHEP::mm;
1183  const double spacerUstrFlange = 67.0*CLHEP::mm; // distance between the beginning of IC and the flange.
1184  const double lengthOC = (3149.2 - 0.05)*CLHEP::mm; //including the flanges. with 50 microns clearance
1185  const double radOuterOC = 650.*CLHEP::mm;
1186  std::string aNStrTmp(header); aNStrTmp += std::string("OC");
1187  G4Tubs* aVolOCG = new G4Tubs(aNStrTmp, radInnerOC, radOuterOC,
1188  0.5*lengthOC, 0.0, 360.0*CLHEP::degree);
1189  G4LogicalVolume *aVolOCGL = new G4LogicalVolume(aVolOCG, myAlumOC, aNStrTmp);
1190  G4ThreeVector posTmp(0., 0., zZeroLocalCoord + spacerUstrFlange + 0.5*lengthOC + 0.010*CLHEP::mm);
1191  std::cerr << " Position of Outer Conductor main cylinder " << posTmp[2] << " length "
1192  << lengthOC << std::endl;
1193  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolOCGL, aNStrTmp + std::string("_P"),
1194  volMother, false, 1, true);
1195 
1196  zLocalDwnstrOCFlange += posTmp[2] + 0.5*lengthOC + 0.010*CLHEP::mm;
1197  std::cerr << " Z position of the start of the OC " << posTmp[2] - 0.5*lengthOC << std::endl;
1198  std::cerr << " Z position of the start of the OC downstream flange and drain connect " <<
1199  zLocalDwnstrOCFlange << std::endl;
1200  //
1201  // The OC upstream flange
1202  //
1203  const double radInnerOCFl = 634*CLHEP::mm;
1204  const double radOuterOCFl = 688.*CLHEP::mm;
1205  std::string aNStrTmp2(header); aNStrTmp2 += std::string("OCFlU1");
1206  G4Tubs* aVolOCFlG = new G4Tubs(aNStrTmp2, radInnerOCFl, radOuterOCFl,
1207  0.5*thickUpstrFlange, 0.0, 360.0*CLHEP::degree);
1208  G4LogicalVolume *aVolOCFlGL = new G4LogicalVolume(aVolOCFlG, myAlumOC, aNStrTmp);
1209 
1210  G4ThreeVector posTmp2(0., 0., zZeroLocalCoord + 39.5*CLHEP::mm + 0.5*thickUpstrFlange + 0.5*CLHEP::mm);
1211  new G4PVPlacement((G4RotationMatrix *) 0, posTmp2, aVolOCFlGL, aNStrTmp2 + std::string("_P"),
1212  volMother, false, 1, true);
1213  } // End of Outer Conductor
1214  //
1215  // The OC Downstream flanges. They are now more complicated, as they include the outer belt in which the
1216  // holes for the water drain are cut. We do not implement these cut volumes, outside the beam aperture of the beam.
1217  //
1218  {
1219  // Again, a polycone.
1220  const double thickOC = 16.0*CLHEP::mm;
1221  zTmps[0] = zLocalDwnstrOCFlange;
1222  rTmps[0] = 634.0*CLHEP::mm;
1223  zTmps[1] = zTmps[0] + 108.76*CLHEP::mm;
1224  rTmps[1] = 702.2*CLHEP::mm;
1225  zTmps[2] = zTmps[0] + 138.2*CLHEP::mm;
1226  rTmps[2] = 707.5*CLHEP::mm;
1227  zTmps[3] = zTmps[0] + 297.4*CLHEP::mm;
1228  rTmps[3] = 691.*CLHEP::mm;
1229  zTmps[4] = zTmps[0] + 359.1*CLHEP::mm;
1230  rTmps[4] = 651.*CLHEP::mm;
1231  zTmps[5] = zTmps[0] + 376.*CLHEP::mm;
1232  rTmps[5] = 651.*CLHEP::mm;
1233  zTmps[6] = zTmps[0] + 404.*CLHEP::mm;
1234  rTmps[6] = 634.*CLHEP::mm;
1235  zTmps[7] = zTmps[0] + 404.*CLHEP::mm;
1236  rTmps[7] = 634.*CLHEP::mm;
1237  for (size_t kk=0; kk != 8; kk++) {
1238  zTmps[kk+8] = zTmps[7 - kk];
1239  rTmps[kk+8] = rTmps[7 - kk] + thickOC;
1240  }
1241  rTmps[8] = 697.*CLHEP::mm;
1242  rTmps[9] = 766.5*CLHEP::mm;
1243  rTmps[10] = 766.5*CLHEP::mm;
1244  std::string aNStrTmpO(header); aNStrTmpO += std::string("OCDwnstrFl");
1245  G4GenericPolycone* aVolDwnstrFlA =
1246  new G4GenericPolycone(aNStrTmpO, 0.0, 360.0*CLHEP::degree, 16, &rTmps[0], &zTmps[0]);
1247  G4LogicalVolume *aVolDwnstrFlAG = new G4LogicalVolume(aVolDwnstrFlA, myAlumOC, aNStrTmpO);
1248  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolDwnstrFlAG, aNStrTmpO + std::string("_P"),
1249  volMother, false, 1, true);
1250  zLocalStartOCEQ = zTmps[7];
1251  }
1252  //
1253  // The insulator ring Drawing/part F10060437
1254  //
1255  {
1256  const double thickInsulator = (70.0 - 0.050)*CLHEP::mm; // 50 microns clearance. Position of OC not that accurate.
1257  const double radInnerInsul = 634.0*CLHEP::mm;
1258  const double radOuterInsul = 694.0*CLHEP::mm;
1259  std::string aNStrTmp(header); aNStrTmp += std::string("Insul");
1260  G4Tubs* aVolOCInsulG = new G4Tubs(aNStrTmp, radInnerInsul, radOuterInsul,
1261  0.5*thickInsulator, 0.0, 360.0*CLHEP::degree);
1262  G4LogicalVolume *aVolOCInsulGL = new G4LogicalVolume(aVolOCInsulG, myAlumina, aNStrTmp);
1263  std::cerr << " Placing insulator ring, from zLocalStartICEQ " << zLocalStartICEQ << std::endl;
1264  //
1265  G4ThreeVector posTmp(0., 0., zLocalStartOCEQ + 0.5*thickInsulator + 0.025*CLHEP::mm);
1266  std::cerr << " .... zLocalStartICEQ after installation of the insulator ring .. " << zLocalStartICEQ << std::endl;
1267  // 0.025 mm is apprixomate..
1268  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolOCInsulGL, aNStrTmp + std::string("_P"),
1269  volMother, false, 1, true);
1270 
1271  zLocalStartICEQ = posTmp[2] + 0.5*thickInsulator + 0.050*CLHEP::mm; // for the insulator ring.
1272  }
1273  //
1274  // The IC EQ Connecting flanges. Two of them, although they are only one piece in drawing F10071385
1275  // This piece is holding together the Inner conductor to it's inner current equalizer section
1276  //
1277  {
1278  const double thickCon1 = 23.*CLHEP::mm;
1279  const double thickCon2 = (45. - thickCon1 - 0.050)*CLHEP::mm;
1280  const double radInnerCon1 = 630.1*CLHEP::mm;
1281  const double radOuterCon1 = 697.0*CLHEP::mm;
1282  const double radInnerCon2 = 570.0*CLHEP::mm;
1283  const double radOuterCon2 = radOuterCon1;
1284  std::string aNStrTmp1(header); aNStrTmp1 += std::string("Con1ICICEQ");
1285  G4Tubs* aVolOC1G = new G4Tubs(aNStrTmp1, radInnerCon1, radOuterCon1,
1286  0.5*thickCon1, 0.0, 360.0*CLHEP::degree);
1287  std::string aNStrTmp2(header); aNStrTmp2 += std::string("Con2ICICEQ");
1288  G4Tubs* aVolOC2G = new G4Tubs(aNStrTmp2, radInnerCon2, radOuterCon2,
1289  0.5*thickCon2, 0.0, 360.0*CLHEP::degree);
1290  G4LogicalVolume *aVolOC1GL = new G4LogicalVolume(aVolOC1G, myAlumOC, aNStrTmp1);
1291  G4LogicalVolume *aVolOC2GL = new G4LogicalVolume(aVolOC2G, myAlumOC, aNStrTmp2);
1292  //
1293  // We push this flange and IC EQ by 1.2 mm downstream, accumulated error of IC lengths..
1294  //
1295 // zLocalStartICEQ += 1.2*CLHEP::mm; not needed!.
1296 
1297  G4ThreeVector posTmp1(0., 0., zLocalStartICEQ + 0.5*thickCon1 + 0.05*CLHEP::mm);
1298  std::cerr << " Zstart of Inner IC connect Flange to EQ IC1 " << posTmp1[2] - 0.5*thickCon1
1299  << " Zend of of the downstream IC flange " << zEndICIOFl << std::endl;
1300  std::cerr << " Dist Zstart of Inner IC connect Flange to EQ IC1 " << posTmp1[2] - 0.5*thickCon1 - zZeroLocalCoord
1301  << " and dist Zend of of the downstream IC flange " << zEndICIOFl - zZeroLocalCoord << std::endl;
1302  //
1303  new G4PVPlacement((G4RotationMatrix *) 0, posTmp1, aVolOC1GL, aNStrTmp1 + std::string("_P"),
1304  volMother, false, 1, true);
1305  std::cerr << " Z position of the connecting flange, inner " << posTmp1[2] << std::endl;
1306  G4ThreeVector posTmp2(0., 0., posTmp1[2] + 0.5*thickCon1 + 0.5*thickCon2 + 0.015*CLHEP::mm);
1307  new G4PVPlacement((G4RotationMatrix *) 0, posTmp2, aVolOC2GL, aNStrTmp2 + std::string("_P"),
1308  volMother, false, 1, true);
1309  std::cerr << " Z position of the connecting flange, outer " << posTmp2[2] << std::endl;
1310  zLocalDwnstrICFlange = posTmp2[2] + 0.5*thickCon2 + 0.025*CLHEP::mm;
1311  // Add one more, esthetically pleasing..
1312  const double radInnerCon3 = radOuterCon1 + 0.015*CLHEP::mm;
1313  const double radOuterCon3 = 715.*CLHEP::mm;
1314  const double thickCon3 = 12.9*CLHEP::mm;
1315  std::string aNStrTmp3(header); aNStrTmp3 += std::string("Con3ICICEQ");
1316  G4Tubs* aVolOC3G = new G4Tubs(aNStrTmp3, radInnerCon3, radOuterCon3,
1317  0.5*thickCon3, 0.0, 360.0*CLHEP::degree);
1318  G4LogicalVolume *aVolOC3GL = new G4LogicalVolume(aVolOC3G, myAlumOC, aNStrTmp3);
1319  G4ThreeVector posTmp3(0., 0., zLocalDwnstrICFlange - 0.5*thickCon3 + 0.0125*CLHEP::mm); // not a typo in sign
1320  new G4PVPlacement((G4RotationMatrix *) 0, posTmp3, aVolOC3GL, aNStrTmp3 + std::string("_P"),
1321  volMother, false, 1, true);
1322 
1323  }
1324  //
1325  // The current equalizer sections, subsection that are include in the mother volume.
1326  // Start with the IC one.
1327 
1328  fLengthCurrEqICInMotherHorn2 = (922.5 - 0.050)*CLHEP::mm; //This does not include the connecting flange.
1329  // Could be used to compute correction to the magnetic field.
1330  std::cerr << " ... Installing the current equalizer section for IC , Starting at Z " <<
1331  zLocalDwnstrICFlange << " (In Horn2 coord sys.), " << std::endl
1332  << " ..... length of mother " << lengthMother <<
1333  " fLengthCurrEqICInMotherHorn2 = " << fLengthCurrEqICInMotherHorn2 << std::endl;
1334 
1335  {
1336  const double thickFlDWICICEQ = 27.31*CLHEP::mm;
1337  const double radInnerICICEQ = 707.*CLHEP::mm;
1338  const double radOuterICICEQ = 715.*CLHEP::mm;
1339  const double radInnerFlDWICICEQ = 707.0*CLHEP::mm;
1340  const double radOuterFlDWICICEQ = 730.0*CLHEP::mm;
1341  fRadInnerICCurrEqHorn2 = radInnerICICEQ;
1342  fRadOuterICCurrEqHorn2 = radOuterICICEQ;
1343  std::string aNStrTmp1(header); aNStrTmp1 += std::string("ICCurrEq");
1344  G4Tubs* aVolOC1G = new G4Tubs(aNStrTmp1, radInnerICICEQ, radOuterICICEQ,
1345  0.5*fLengthCurrEqICInMotherHorn2, 0.0, 360.0*CLHEP::degree);
1346  G4LogicalVolume *aVolOC1GL = new G4LogicalVolume(aVolOC1G, myAlumOC, aNStrTmp1);
1347 
1348  G4ThreeVector posTmp(0., 0., zLocalDwnstrICFlange + 0.5*fLengthCurrEqICInMotherHorn2 + 0.0125*CLHEP::mm); // ..
1349  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolOC1GL, aNStrTmp1 + std::string("_P"),
1350  volMother, false, 1, true);
1351  std::string aNStrTmp2(header); aNStrTmp2 += std::string("ICCurrEqFlo");
1352  G4Tubs* aVolOC2G = new G4Tubs(aNStrTmp2, radInnerFlDWICICEQ, radOuterFlDWICICEQ,
1353  0.5*thickFlDWICICEQ, 0.0, 360.0*CLHEP::degree);
1354  G4ThreeVector posTmp2(0., 0., posTmp[2] + 0.5*fLengthCurrEqICInMotherHorn2 +
1355  0.0125*CLHEP::mm + 0.5*thickFlDWICICEQ);
1356  G4LogicalVolume *aVolOC2GL = new G4LogicalVolume(aVolOC2G, myAlumOC, aNStrTmp2);
1357  new G4PVPlacement((G4RotationMatrix *) 0, posTmp2, aVolOC2GL, aNStrTmp2 + std::string("_P"),
1358  volMother, false, 1, true);
1359  fLengthCurrEqICInMotherHorn2 += thickFlDWICICEQ + 28.*CLHEP::mm; //
1360  //
1361  // for sake of completion, the 4 Strip-line connecting pads.
1362  //
1363  const double angleHalfWPad = 0.131; // in radians
1364  const double radOuterPaDWICICEQ = 760.0*CLHEP::mm;
1365  const double radInnerPaDWICICEQ = (730.0+0.015)*CLHEP::mm;
1366  const double thickPaDWICICEQ = thickFlDWICICEQ;
1367  std::string aNStrTmp3(header); aNStrTmp3 += std::string("ICCurrEqFlo");
1368  double angleHalfPad = M_PI/4.;
1369  for (size_t kk=0; kk !=4; kk++) {
1370  std::ostringstream aStrStrTmpK3; aStrStrTmpK3 << "_" << kk;
1371  std::string aNStrTmpK3(aNStrTmp3); aNStrTmpK3 += aStrStrTmpK3.str();
1372  G4Tubs* aVolOC3G = new G4Tubs(aNStrTmpK3, radInnerPaDWICICEQ, radOuterPaDWICICEQ,
1373  0.5*thickPaDWICICEQ, angleHalfPad-angleHalfWPad, 2.0*angleHalfWPad);
1374  G4LogicalVolume *aVolOC3GL = new G4LogicalVolume(aVolOC3G, myAlumOC, aNStrTmpK3);
1375 
1376  new G4PVPlacement((G4RotationMatrix *) 0, posTmp2, aVolOC3GL, aNStrTmpK3 + std::string("_P"),
1377  volMother, false, 1, true);
1378  angleHalfPad += M_PI/2.;
1379  }
1380  } // End of IC Current equalizer section.
1381  //
1382  // The outer current equalizer sections, subsection that are include in the mother volume.
1383  // Drawing F10071400.
1384  //
1385  fLengthCurrEqOCInMotherHorn2 = (973.2 - 32.5 - 0.050)*CLHEP::mm;
1386  std::cerr << " ... Installing the current equalizer section for oC , Starting at Z " <<
1387  zLocalStartOCEQ << " (In Horn2 coord sys.), " << std::endl
1388  << " ..... length of mother " << lengthMother <<
1389  " fLengthCurrEqOCInMotherHorn2 = " << fLengthCurrEqOCInMotherHorn2 << std::endl;
1390 
1391  {
1392  const double thickFl1 = 32.5*CLHEP::mm;
1393  const double lengthTube = fLengthCurrEqOCInMotherHorn2;
1394  const double radInnerFl1 = 714.*CLHEP::mm;
1395  const double radOuterFl1 = 766.5*CLHEP::mm;
1396  const double radInnerTube = 758.5*CLHEP::mm;
1397  const double radOuterTube = radOuterFl1;
1398  fRadInnerOCCurrEqHorn2 = radInnerTube;
1399  fRadOuterOCCurrEqHorn2 = radOuterTube; // Could be used for magnetic field correction.
1400  std::string aNStrTmp1(header); aNStrTmp1 += std::string("OCCurrEqFl");
1401  G4Tubs* aVolOC1G = new G4Tubs(aNStrTmp1, radInnerFl1, radOuterFl1,
1402  0.5*thickFl1, 0.0, 360.0*CLHEP::degree);
1403  G4LogicalVolume *aVolOC1GL = new G4LogicalVolume(aVolOC1G, myAlumOC, aNStrTmp1);
1404 
1405  G4ThreeVector posTmp(0., 0., zLocalStartOCEQ + 0.5*thickFl1 + 0.025*CLHEP::mm); // ..
1406  std::cerr << " ZStart of EQOC upstrs flange " << posTmp[2] - 0.5*thickFl1 << " length " << thickFl1 << std::endl;
1407  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolOC1GL, aNStrTmp1 + std::string("_P"),
1408  volMother, false, 1, true);
1409  std::string aNStrTmp2(header); aNStrTmp2 += std::string("OCCurrEq");
1410  G4Tubs* aVolOC2G = new G4Tubs(aNStrTmp2, radInnerTube, radOuterTube,
1411  0.5*lengthTube, 0.0, 360.0*CLHEP::degree);
1412  G4LogicalVolume *aVolOC2GL = new G4LogicalVolume(aVolOC2G, myAlumOC, aNStrTmp2);
1413  G4ThreeVector posTmp2(0., 0., posTmp[2] + 0.5*thickFl1 + 0.5*lengthTube + 0.0125*CLHEP::mm); // ..
1414  std::cerr << " ZStart of EQOC upstrs body " << posTmp2[2] - 0.5*lengthTube << " length " << lengthTube << std::endl;
1415  new G4PVPlacement((G4RotationMatrix *) 0, posTmp2, aVolOC2GL, aNStrTmp2 + std::string("_P"),
1416  volMother, false, 1, true);
1417 
1418  const double thickFl2 = 27.5*CLHEP::mm; // Why different from above ??
1419  const double radInnerFl2 = 766.5*CLHEP::mm;
1420  const double radOuterFl2 = 773.5*CLHEP::mm;
1421  std::string aNStrTmp3(header); aNStrTmp3 += std::string("OCCurrEqFld");
1422  G4Tubs* aVolOC3G = new G4Tubs(aNStrTmp3, radInnerFl2, radOuterFl2,
1423  0.5*thickFl2, 0.0, 360.0*CLHEP::degree);
1424  G4LogicalVolume *aVolOC3GL = new G4LogicalVolume(aVolOC3G, myAlumOC, aNStrTmp3);
1425  G4ThreeVector posTmp3(posTmp2);
1426  posTmp3[2] += 0.5*lengthTube + 0.5*thickFl2 + 0.050*CLHEP::mm;
1427  new G4PVPlacement((G4RotationMatrix *) 0, posTmp3, aVolOC3GL, aNStrTmp3 + std::string("_P"),
1428  volMother, false, 1, true);
1429  //
1430  // again, the downstream flange to connect the striplines, and the pad.
1431  //
1432  const double radOuterPaDWOCOCEQ = 811.5*CLHEP::mm;
1433  const double angleHalfWPad = (210.*CLHEP::mm)/radOuterPaDWOCOCEQ; // in radians
1434  const double radInnerPaDWOCOCEQ = (773.5+0.015)*CLHEP::mm;
1435  const double thickPaDWOCOCEQ = thickFl2;
1436  std::string aNStrTmp4(header); aNStrTmp4 += std::string("ICCurrEqFlo");
1437  double angleHalfPad = M_PI/4.;
1438  for (size_t kk=0; kk !=4; kk++) {
1439  std::ostringstream aStrStrTmpK4; aStrStrTmpK4 << "_" << kk;
1440  std::string aNStrTmpK4(aNStrTmp4); aNStrTmpK4 += aStrStrTmpK4.str();
1441  G4Tubs* aVolOC4G = new G4Tubs(aNStrTmpK4, radInnerPaDWOCOCEQ, radOuterPaDWOCOCEQ,
1442  0.5*thickPaDWOCOCEQ, angleHalfPad-angleHalfWPad, 2.0*angleHalfWPad);
1443  G4LogicalVolume *aVolOC4GL = new G4LogicalVolume(aVolOC4G, myAlumOC, aNStrTmpK4);
1444 
1445  new G4PVPlacement((G4RotationMatrix *) 0, posTmp3, aVolOC4GL, aNStrTmpK4 + std::string("_P"),
1446  volMother, false, 1, true);
1447  angleHalfPad += M_PI/2.;
1448  }
1449  fLengthCurrEqOCInMotherHorn2 += thickFl1 + thickFl2;
1450  }
1451  for (size_t k=0; k != fZCoordCDRevisedHornB.size(); k++) fZCoordCDRevisedHornB[k] += distUpstreamToBeginIC + 0.050*CLHEP::mm;
1452 
1453  //
1454  // Check the exact R/Z coordinates...
1455  //
1456  std::cerr << " Dump of the R/Z map, accurate, for the magnetic field " << std::endl;
1457  for (size_t k=0; k != fZCoordCDRevisedHornB.size(); k++) {
1458  std::cerr << " " << k << " " << fRInCoordCDRevisedHornB[k] << " " << fZCoordCDRevisedHornB[k] << std::endl;
1459  }
1460  return;
1461 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
std::vector< G4String > fHorn2IC
std::vector< double > fParams
std::vector< double > fRInCoordCDRevisedHornB
std::vector< double > fZCoordCDRevisedHornB
QTextStream & endl(QTextStream &s)
std::vector< G4String > fHorn1IC
void LBNEVolumePlacements::PlaceFinalLBNFConceptHornC ( )

Definition at line 1845 of file LBNFConceptDesignHorns.cc.

1845  {
1846 
1847  std::cerr << " LBNEVolumePlacements::PlaceFinalLBNFConceptHornC In progress...Drawing F10071767 " <<std::endl;
1848  fZCoordCDRevisedHornC.clear();
1849  fRInCoordCDRevisedHornC.clear();
1850  const double in = 25.4*CLHEP::mm;
1851  const std::string header("LBNFConceptHornC");
1852  const LBNEVolumePlacementData *plDatMother = this->Find(header, "LBNFSimpleHorn3Container",
1853  "LBNEVolumePlacements::PlaceFinalLBNFConceptHornC");
1854  G4LogicalVolume *volMother = plDatMother->fCurrent;
1855  const double lengthMother=plDatMother->fParams[2];
1856  const double zShiftMotherCoords = 0.005*CLHEP::mm; // We have little room in this case..
1857  const size_t nSegUpstrIO = 20;
1858  const double distUpstreamToBeginIC = (237.451 - 106.0479 + 0.025)*CLHEP::mm; // clone from the polygon used to defined
1859  const double distUpstrCurrEQToBeginIC = (926. + 0.025)*CLHEP::mm;
1860  // the mother volume.
1861  const double deltaPhiUpstrIO = M_PI/nSegUpstrIO;
1862  const double radOuterUpstIO = 131.254*CLHEP::mm; // Drawing F10071765 accurate to ~100 microns
1863  const double radInnerUpstIO = 125.25*CLHEP::mm; //
1864  const double radInnerInner = 284.0*CLHEP::mm;
1865  const double thickInner = 4.0*CLHEP::mm;
1866  fThickICDRevisedHornC = thickInner; // for the magnetic field accurate definition of fiducials.
1867  const double zZeroLocalCoord = -0.5*lengthMother + distUpstrCurrEQToBeginIC + 0.010*CLHEP::mm;
1868  const double zStartUpstrIOC = zZeroLocalCoord - radOuterUpstIO - 1.050*CLHEP::mm; // 1 mm from the clearance def. in mother volume
1869  const double radInnerOC = 634.0*CLHEP::mm;
1870  std::cerr << " .....Mother Volume name " << volMother->GetName()
1871  << " zShiftMother " << zShiftMotherCoords << " distUpstreamToBeginIC "
1872  << distUpstreamToBeginIC << " zZeroLocalCoords " << zZeroLocalCoord << std::endl;
1873 
1874  std::vector<double> zTmps(10, 0.); std::vector<double> rTmps(10, 0.); // more room for later
1875  G4ThreeVector zeroC(0., 0., 0.);
1876  G4Material *myAlumina = G4Material::GetMaterial("Alumina");
1877  G4Material *myAlumIC = G4Material::GetMaterial(fHorn3InnerCondMat.c_str());
1878  G4Material *myAlumOC = G4Material::GetMaterial(fHorn3AllCondMat.c_str());
1879  if (fHorn3AllCondMat.find("Alum") != std::string::npos)
1880  myAlumina = G4Material::GetMaterial(fHorn3AllCondMat.c_str());
1881  G4Material *myWater = 0;
1882  if (fWaterLayerThickInHorns > 1.0e-6) myWater = G4Material::GetMaterial("Water");
1883 
1884  size_t nSegUpstrIOBy2 = nSegUpstrIO/2;
1885  fZCoordCDRevisedHornC.resize(nSegUpstrIOBy2);
1886  fRInCoordCDRevisedHornC.resize(nSegUpstrIOBy2);
1887  for (size_t kPhi = 0; kPhi != nSegUpstrIO; kPhi++ ) {
1888  std::ostringstream aNStrStr; aNStrStr << header << "UpstrIOSect" << kPhi;
1889  std::string aNStr(aNStrStr.str());
1890  fHorn2IC.push_back(aNStr);
1891  const double phi0 = kPhi*deltaPhiUpstrIO + 1.0e-5;
1892  const double phi1 = phi0 + deltaPhiUpstrIO - 2.0e-5;
1893  zTmps[0] = zStartUpstrIOC + radOuterUpstIO - radOuterUpstIO*std::sin(phi1);
1894  zTmps[1] = zStartUpstrIOC + radOuterUpstIO - radOuterUpstIO*std::sin(phi0);
1895  zTmps[2] = zStartUpstrIOC + radOuterUpstIO - radInnerUpstIO*std::sin(phi0);
1896  zTmps[3] = zStartUpstrIOC + radOuterUpstIO - radInnerUpstIO*std::sin(phi1);
1897  rTmps[0] = radInnerInner + radOuterUpstIO - radOuterUpstIO*std::cos(phi1);
1898  rTmps[1] = radInnerInner + radOuterUpstIO - radOuterUpstIO*std::cos(phi0);
1899  rTmps[2] = radInnerInner + thickInner + radInnerUpstIO - radInnerUpstIO*std::cos(phi0);
1900  rTmps[3] = radInnerInner + thickInner + radInnerUpstIO - radInnerUpstIO*std::cos(phi1);
1901 // std::cerr << " At kPhi " << kPhi << " Phi0 " << phi0 << " Phi1 " << phi1 << " rZVector " << std::endl;
1902 // for (size_t kk=0; kk != 4; kk++) std::cerr << " " << rTmps[kk] << " " <<
1903 // zTmps[kk] << " " << std::endl;
1904  G4GenericPolycone *aVolGP = new G4GenericPolycone(aNStr, 0.0, 360.0*CLHEP::degree, 4, &rTmps[0], &zTmps[0]);
1905  G4LogicalVolume *aVolG = new G4LogicalVolume(aVolGP, myAlumIC, aNStr);
1906  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolG, aNStr + std::string("_P"),
1907  volMother, false, 1, true);
1908  if (kPhi < nSegUpstrIO/2) {
1909  fRInCoordCDRevisedHornC[nSegUpstrIOBy2 - 1 - kPhi] = rTmps[1];
1910  fZCoordCDRevisedHornC[nSegUpstrIOBy2 - 1 - kPhi] = zTmps[1] - zZeroLocalCoord; // with respect to zZero.
1911  // In local coordinate of the mother volume.
1912  }
1913  }
1914  //
1915  // The IC Upstream Out transition flange, nicely curved in the real model... We approximate
1916  // by a polycone.
1917  //
1918  const double radOuterICFlTr = 628.*CLHEP::mm;
1919  const double radInnerICFlTr = 538.5*CLHEP::mm;;
1920  {
1921  zTmps.resize(20); rTmps.resize(20);
1922  const double radInnerBig = 40.0*CLHEP::mm;
1923  const double radOuterSmall = 15.0 *CLHEP::mm;
1924  const size_t numPtsBig = 8;
1925  const size_t numPtsSmall = 4;
1926  const double phiStepBig = (M_PI/2)/numPtsBig;
1927  const double phiStepSmall = (M_PI/2)/numPtsSmall;
1928  for (size_t i=0; i!= numPtsBig+1; i++) {
1929  const double phiC = i*phiStepBig;
1930  zTmps[i] = radInnerBig*std::sin(phiC);
1931  rTmps[i] = radInnerICFlTr + radInnerBig - radInnerBig*std::cos(phiC);
1932  }
1933  zTmps[numPtsBig+1] = zTmps[numPtsBig];
1934  rTmps[numPtsBig+1] = radOuterICFlTr;
1935  zTmps[numPtsBig+2] = 15.0*CLHEP::mm;
1936  rTmps[numPtsBig+2] = radOuterICFlTr;
1937  for (size_t i=0; i != (numPtsSmall+1); i++) {
1938  const double phiC = i*phiStepSmall;
1939  zTmps[numPtsBig+3+i] = radOuterSmall*std::cos(phiC);
1940  rTmps[numPtsBig+3+i] = radInnerICFlTr + thickInner + radOuterSmall*(1.0 - std::sin(phiC));
1941  }
1942  for (size_t i=0; i != zTmps.size(); i++) zTmps[i] += zZeroLocalCoord + 0.050*CLHEP::mm; // possible collision with I/O section
1943  const size_t numPtsFinal = numPtsBig + 3 + numPtsSmall + 1;
1944  /*
1945  std::ofstream fOutTmp("./RZICUpstrFl.txt");
1946  std::cerr << " Dump of Polycon for IC Upstream Flange " << std::endl;
1947  fOutTmp << " i Z R " << std::endl;
1948  for(size_t i=0; i != numPtsFinal; i++) {
1949  fOutTmp << " " << i << " " << zTmps[i] << " " << rTmps[i] << std::endl;
1950  }
1951  std::cerr << " And Quit ... " << std::endl; exit(2);
1952  fOutTmp.close();
1953  */
1954  std::string aNStrTmp(header); aNStrTmp += std::string("ICFlUTr");
1955  G4GenericPolycone *aVolICFlG = new G4GenericPolycone(aNStrTmp, 0.0, 360.0*CLHEP::degree,
1956  numPtsFinal, &rTmps[0], &zTmps[0]);
1957  G4LogicalVolume *aVolICFlGL = new G4LogicalVolume(aVolICFlG, myAlumIC, aNStrTmp);
1958 
1959  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolICFlGL, aNStrTmp + std::string("_P"),
1960  volMother, false, 1, true);
1961  }
1962  //
1963  // The inner conductor per-se.
1964  // We differ from hornB here, implement the whole thing as a Polycone.
1965  //
1966  double zEndOfIC = 0.;
1967  {
1968  size_t numPtsRinThickZ = fHornsPolyListRinThickZVects[2].size();
1969  size_t numPtsIC = 2*(numPtsRinThickZ-5);
1970  // First point skipped, last 2 points are for the IOC transition, downstream.
1971  std::vector<double> zc(numPtsIC);
1972  std::vector<double> rc(numPtsIC);
1974  iRZPtr++; iRZPtr++; iRZPtr++;// Skip the first three.
1975  for (size_t iPt = 0; iPt != numPtsIC; iPt++) {
1976  if (iPt < numPtsIC/2) {
1977  zc[iPt] = -0.5*lengthMother + iRZPtr->z() + 0.025*CLHEP::mm; // small offset tune to avoid small overlap
1978  rc[iPt] = iRZPtr->x();
1979  fZCoordCDRevisedHornC.push_back(zc[iPt] - zZeroLocalCoord);
1980  fRInCoordCDRevisedHornC.push_back(rc[iPt]);
1981  } else {
1982  size_t iPtBack = numPtsIC - iPt -1;
1983  zc[iPt] = zc[iPtBack];
1984  rc[iPt] = rc[iPtBack] + thickInner;
1985  }
1986  iRZPtr++;
1987  }
1988  zEndOfIC = zc[numPtsIC/2 - 1];
1989  std::cerr << " Dump of the IC Polygon .... zEndOfIC " << zEndOfIC << " From start of IC " <<
1990  zEndOfIC - zZeroLocalCoord << std::endl;
1991  for (size_t k=0; k != rc.size(); k++) {
1992  std::cerr << " " << k << " " << zc[k] << " " << zc[k] - zZeroLocalCoord << " " << rc[k] << std::endl;
1993  }
1994  std::string aNStrTmp(header); aNStrTmp += std::string("ICPoly");
1995  G4GenericPolycone *aVolGP =
1996  new G4GenericPolycone(aNStrTmp, 0.0, 360.0*CLHEP::degree, numPtsIC, &rc[0], &zc[0]);
1997  G4LogicalVolume *aVolG = new G4LogicalVolume(aVolGP, myAlumIC, aNStrTmp);
1998  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolG, aNStrTmp + std::string("_P"),
1999  volMother, false, 1, true);
2000 
2001  }
2002  //
2003  // The water layers
2004  //
2005  if (fWaterLayerThickInHorns > 1.0e-6*CLHEP::mm) {
2006  const double radInnerUW1 = radInnerInner + thickInner + 0.025*CLHEP::mm;
2007  const double radOuterUW1 = radInnerUW1 + fWaterLayerThickInHorns;
2008  const double lengthUW1 = (286. - 0.100)*CLHEP::mm;
2009  std::string aNStrUW1(header); aNStrUW1 += std::string("ICU1Water");
2010  G4Tubs* aVolUW1 = new G4Tubs(aNStrUW1, radInnerUW1, radOuterUW1, 0.5*lengthUW1, 0., 360.0*CLHEP::degree);
2011  G4LogicalVolume *aVolUW1L = new G4LogicalVolume(aVolUW1, myWater, aNStrUW1);
2012  G4ThreeVector posUW1(0., 0., zZeroLocalCoord + 0.5*lengthUW1 + 0.025);
2013  new G4PVPlacement((G4RotationMatrix *) 0, posUW1, aVolUW1L, aNStrUW1 + std::string("_P"),
2014  volMother, false, 1, true);
2015  //
2016  // we skip over the first weld. Put a polycone over a section of IC polycone.
2017  // This goes up to the spider support.
2018  //
2019  size_t numPtsUW2SumTmp = 0;
2020  for (size_t kkk=1; kkk != 6; kkk++) numPtsUW2SumTmp += fLBNFOptimConceptDesignHornCNumStepIC[kkk];
2021  size_t numPtsUW2 = 2*(2+ numPtsUW2SumTmp +1 );
2022  // a bit dangerous, I am relying on the geometry coded up in
2023  // PreparePolyconForConceptHornC
2024  std::vector<double> zc(numPtsUW2);
2025  std::vector<double> rc(numPtsUW2);
2027  for (int i=0; i != 4; i++) iRZPtr++; // From the geometry of the IC... We skip one more, as we already have one layer.
2028  zc[0] = zZeroLocalCoord + (310. + 3.0)*CLHEP::mm;
2029  rc[0] = iRZPtr->x() + thickInner + 0.025*CLHEP::mm;
2030  for (size_t iPtUW2 = 1; iPtUW2 != numPtsUW2/2-1; iPtUW2++) {
2031  zc[iPtUW2] = -0.5*lengthMother + iRZPtr->z() + 0.025*CLHEP::mm;
2032  rc[iPtUW2] = iRZPtr->x() + thickInner + 0.025*CLHEP::mm;
2033  iRZPtr++;
2034  }
2035  std::vector<G4ThreeVector>::const_iterator iRZPtrBefDwnstrCone = iRZPtr;
2036  iRZPtrBefDwnstrCone--;
2037  std::cerr << " Last iRZ point, beginning of downnstream cone, Z " << iRZPtr->z()
2038  << " R " << iRZPtr->x() << std::endl;
2039  zc[numPtsUW2/2-1] = zZeroLocalCoord + (866. - 0.6)*CLHEP::mm; // up to spider support.
2040  rc[numPtsUW2/2-1] = (179.2558 + 0.1)*CLHEP::mm;
2041  for (size_t iPtUW2 = numPtsUW2/2; iPtUW2 != numPtsUW2; iPtUW2++) {
2042  size_t iPtUW2R = numPtsUW2 - iPtUW2 -1;
2043  zc[iPtUW2] = zc[iPtUW2R];
2044  rc[iPtUW2] = rc[iPtUW2R] + fWaterLayerThickInHorns ;
2045  }
2046  std::string aNStrUW2(header); aNStrUW2 += std::string("ICU2Water");
2047  std::cerr << " Dump of the upstream Water Polygon ICU2Water " << std::endl;
2048  for (size_t k=0; k != rc.size(); k++) {
2049  std::cerr << " " << k << " " << zc[k] << " " << zc[k] - zZeroLocalCoord << " " << rc[k] << std::endl;
2050  }
2051  G4GenericPolycone *aVolGPUW2 =
2052  new G4GenericPolycone(aNStrUW2, 0.0, 360.0*CLHEP::degree, numPtsUW2, &rc[0], &zc[0]);
2053  G4LogicalVolume *aVolGUW2L = new G4LogicalVolume(aVolGPUW2, myAlumIC, aNStrUW2);
2054  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolGUW2L , aNStrUW2 + std::string("_P"),
2055  volMother, false, 1, true);
2056  //
2057  // We skip the spider support, Put a ploycone over a section of IC polycone. Up to the downstream weld
2058  //
2059  size_t numPtsCW0 = 2*(1 + fLBNFOptimConceptDesignHornCNumStepIC[7] + 1);
2060  std::cerr << " Number of pst water layer, numPtsCW0 " << numPtsCW0 << std::endl;
2061  zc.resize(numPtsCW0);
2062  rc.resize(numPtsCW0);
2063  iRZPtr = iRZPtrBefDwnstrCone;
2064  iRZPtr++;// This should be the beginning of the last curve.
2065  // Again, if the IC description changes, this be must re-adjusted. (the 3 in the line above).
2066  zc[0] = zZeroLocalCoord + (893.8916 + 0.1)*CLHEP::mm;
2067  rc[0] = (187.9 + thickInner + 0.025)*CLHEP::mm;
2068  for (size_t iPtCW0 = 1; iPtCW0 != numPtsCW0/2-1; iPtCW0++) {
2069  zc[iPtCW0] = -0.5*lengthMother + iRZPtr->z() + 0.025*CLHEP::mm;
2070  rc[iPtCW0] = iRZPtr->x() + thickInner + 0.025*CLHEP::mm;
2071  iRZPtr++;
2072  }
2073  zc[numPtsCW0/2-1] = zZeroLocalCoord + (1525.9205 - 0.1)*CLHEP::mm;
2074  rc[numPtsCW0/2-1] = 366.0*CLHEP::mm + thickInner + 0.025*CLHEP::mm; // return back loop
2075  for (size_t iPtCW0 = numPtsCW0/2; iPtCW0 != numPtsCW0; iPtCW0++) {
2076  size_t iPtCW0R = numPtsCW0 - iPtCW0 -1;
2077  zc[iPtCW0] = zc[iPtCW0R];
2078  rc[iPtCW0] = rc[iPtCW0R] + fWaterLayerThickInHorns ;
2079  }
2080  std::cerr << " Dump of the upstream Water Polygon ICDw0Water " << std::endl;
2081  for (size_t k=0; k != rc.size(); k++) {
2082  std::cerr << " " << k << " " << zc[k] << " " << zc[k] - zZeroLocalCoord << " " << rc[k] << std::endl;
2083  }
2084  std::string aNStrCW0(header); aNStrCW0 += std::string("ICDw0Water");
2085  G4GenericPolycone *aVolGPCW0 =
2086  new G4GenericPolycone(aNStrCW0, 0.0, 360.0*CLHEP::degree, numPtsCW0, &rc[0], &zc[0]);
2087  G4LogicalVolume *aVolGCW0L = new G4LogicalVolume(aVolGPCW0, myAlumIC, aNStrCW0);
2088  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolGCW0L, aNStrCW0 + std::string("_P"),
2089  volMother, false, 1, true);
2090  //
2091  // Skip the weld again..
2092  //
2093  const double radInnerDW2 = 366.0*CLHEP::mm + 0.025*CLHEP::mm;
2094  const double radOuterDW2 = radInnerDW2 + fWaterLayerThickInHorns;
2095  const double lengthDW2 = (504.50 - 0.2)*CLHEP::mm;
2096  std::string aNStrDW2(header); aNStrDW2 += std::string("ICD1Water");
2097  G4Tubs* aVolDW2 = new G4Tubs(aNStrDW2, radInnerDW2, radOuterDW2, 0.5*lengthDW2, 0.0, 360.0*CLHEP::degree);
2098  G4LogicalVolume *aVolDW2L = new G4LogicalVolume(aVolDW2, myWater, aNStrDW2);
2099  G4ThreeVector posDW2(0., 0., zZeroLocalCoord + 1549.7 +
2100  0.5*lengthDW2 - 0.025*CLHEP::mm);
2101  new G4PVPlacement((G4RotationMatrix *) 0, posDW2, aVolDW2L, aNStrDW2 + std::string("_P"),
2102  volMother, false, 1, true);
2103  } // End of water layer.
2104  //
2105  // The welds, aluminum.
2106  //
2107  {
2108  const double lengthFirstWeld = 8.0*CLHEP::mm; // we subtract ~5 mm on both sides..
2109  const double radInnerWeld = radInnerInner + thickInner + 0.010;
2110  const double radOuterWeld = radInnerWeld + 4.0; // top of the bulge at 198.5, 4.5 mm thick max.
2111  // Approximate..
2112  std::string aNStrTmpWeld(header); aNStrTmpWeld += std::string("WeldUp");
2113  G4Tubs* aVolIC0GTWe = new G4Tubs(aNStrTmpWeld,
2114  radInnerWeld, radOuterWeld, 0.5*lengthFirstWeld, 0.0, 360.0*CLHEP::degree);
2115  G4LogicalVolume *aVolIC0GWe = new G4LogicalVolume(aVolIC0GTWe, myAlumIC, aNStrTmpWeld);
2116  G4ThreeVector posTmpWeld(0., 0., zZeroLocalCoord + 0.5*lengthFirstWeld + 288.5*CLHEP::mm); // added 1.5 mm from beginning..
2117  new G4PVPlacement((G4RotationMatrix *) 0, posTmpWeld, aVolIC0GWe, aNStrTmpWeld + std::string("_P"),
2118  volMother, false, 1, true);
2119  }
2120  {
2121  const double length2ndWeld = 8.0*CLHEP::mm; // we subtract 5 mm to make room for the weld.
2122  const double radInnerWeld = 366.0*CLHEP::mm + 0.010*CLHEP::mm;
2123  const double radOuterWeld = radInnerWeld + 4.0; // top of the bulge at 198.5, 4.5 mm thick max.
2124  std::string aNStrTmpWeld(header); aNStrTmpWeld += std::string("WeldDw");
2125  G4Tubs* aVolIC0GTWe = new G4Tubs(aNStrTmpWeld,
2126  radInnerWeld, radOuterWeld, 0.5*length2ndWeld, 0.0, 360.0*CLHEP::degree);
2127  G4LogicalVolume *aVolIC0GWe = new G4LogicalVolume(aVolIC0GTWe, myAlumIC, aNStrTmpWeld);
2128  G4ThreeVector posTmpWeld(0., 0., zZeroLocalCoord + 0.5*length2ndWeld + 1527.5*CLHEP::mm);
2129  // added 1.5 mm from beginning..
2130  new G4PVPlacement((G4RotationMatrix *) 0, posTmpWeld, aVolIC0GWe, aNStrTmpWeld + std::string("_P"),
2131  volMother, false, 1, true);
2132  }
2133  //
2134  // The spider support.. Again, this is HornC Mostly cloned from HornB, with
2135  // geometrical data updated. Fist a polygon
2136  //
2137  // double zCoordLocalCurrent = zZeroLocalCoord + (0.05 + 866.4702)*CLHEP::mm; // minor push of 0.05 ?
2138  double zCoordLocalCurrent = zZeroLocalCoord + (866.4702 - 1.0)*CLHEP::mm; // minor push of 0.05 ?
2139  {
2140  std::string aNStrTmpSp(header); aNStrTmpSp += std::string("SuppRing");
2141  std::vector<double> rTmpsSR(5, 0.);
2142  std::vector<double> zTmpsSR(5, zCoordLocalCurrent);
2143  rTmpsSR[0] = (179.35 + 0.050 )*CLHEP::mm;
2144  rTmpsSR[1] = (191.32 + 0.050)*CLHEP::mm;
2145  zTmpsSR[1] += 3.55*CLHEP::mm;
2146  rTmpsSR[2] = (191.32 + 0.050)*CLHEP::mm;
2147  zTmpsSR[2] += 20.*CLHEP::mm;
2148  rTmpsSR[3] = (186.0 + 0.050)*CLHEP::mm;
2149  zTmpsSR[3] += 22.*CLHEP::mm;
2150  rTmpsSR[4] = (rTmpsSR[0] - 0.0125)*CLHEP::mm;
2151  G4GenericPolycone *aVolGPCDSp =
2152  new G4GenericPolycone(aNStrTmpSp, 0.0, 360.0*CLHEP::degree, 5, &rTmpsSR[0], &zTmpsSR[0]);
2153  G4LogicalVolume *aVolGCDSp = new G4LogicalVolume(aVolGPCDSp, myAlumIC, aNStrTmpSp);
2154  G4ThreeVector posTmpCDZero(0., 0., 0.);
2155  new G4PVPlacement((G4RotationMatrix *) 0, posTmpCDZero, aVolGCDSp, aNStrTmpSp + std::string("_P"),
2156  volMother, false, 1, true);
2157  const double radRingSpiderSuppICOuter = rTmpsSR[2] + 0.025*CLHEP::mm;
2158  const double zSpiderSupport = 0.5*(zTmpsSR[1] + zTmpsSR[2]);
2159  //
2160 // The spider support. almost same code as for HornA & HornB
2161 // The connecting piece ring to the hangers.. There are three of them, at 120 degrees from each other.
2162 //
2163  std::string nameStrH(header); nameStrH+= std::string("Spider1Supp");
2164  G4String nameStr2(nameStrH); nameStr2 += G4String("Riser");
2165  const double heightRiser = 0.333*in - 0.020*CLHEP::mm;
2166  const double widthH = 1.5*in; // See drawing 8875.112-MD 363115
2167  const double thickH = 0.184*2*in;
2168  G4Box *aBoxRiser = new G4Box(nameStr2, widthH/2., heightRiser/2.0, thickH/2.0);
2169  G4LogicalVolume *pCurrentRiser =
2170  new G4LogicalVolume(aBoxRiser, myAlumIC, nameStr2);
2171 
2172  G4String nameStr3(nameStrH); nameStr3 += G4String("Hanger");
2173  const double heightH = radInnerOC - radRingSpiderSuppICOuter - 1.0*CLHEP::mm - heightRiser;
2174  const double widthH2 = 1.0*in; // 363115 Note: we collapsed both hanger along the horizontal, transverse
2175  // direction.
2176  const double thickH2 = 0.031*in;
2177  G4Box *aBoxHanger = new G4Box(nameStr3, widthH2/2., heightH/2.0, thickH2/2.0);
2178  G4LogicalVolume *pCurrentHanger =
2179  new G4LogicalVolume(aBoxHanger, myAlumIC, nameStr3);
2180 
2181  std::cerr << " ..... zSpiderSupport " << zSpiderSupport << std::endl;
2182  G4ThreeVector posTmp(0., 0., zSpiderSupport);
2183 
2184  for (int iRot=0; iRot != 3; iRot++) {
2185  std::ostringstream rnStrStr; rnStrStr << "_" << (iRot+1);
2186  G4String rnStr(rnStrStr.str());
2187  // Same Z position as above...
2188  G4RotationMatrix * rMatPr = 0;
2189  if (iRot == 1) {
2190  rMatPr = new G4RotationMatrix;
2191  rMatPr->rotateZ(2.0*M_PI/3.);
2192  } else if (iRot == 2) {
2193  rMatPr = new G4RotationMatrix;
2194  rMatPr->rotateZ(-2.0*M_PI/3.);
2195  }
2196 
2197  const double dHRiser = radRingSpiderSuppICOuter + 0.010*CLHEP::mm + heightRiser/2.;
2198  posTmp[0] = 0.; posTmp[1] = dHRiser;
2199  if (iRot != 0) {
2200  posTmp[0] = dHRiser*rMatPr->xy();
2201  posTmp[1] = dHRiser*rMatPr->yy();
2202  }
2203  if (iRot == 0) {
2204  new G4PVPlacement(rMatPr, posTmp, pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
2205  volMother, false, iRot, fCheckVolumeOverLapWC);
2206  } else {
2207  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentRiser, nameStr2 + std::string("_P") + rnStr,
2208  volMother, false, iRot, true);
2209  }
2210 // Now the hanger it self
2211 
2212  const double dHHanger = radRingSpiderSuppICOuter + 0.010*CLHEP::mm
2213  + 0.5*CLHEP::mm + heightRiser + heightH/2.;
2214  posTmp[0] = 0.; posTmp[1] = dHHanger;
2215  if (iRot != 0) {
2216  posTmp[0] = dHHanger*rMatPr->xy();
2217  posTmp[1] = dHHanger*rMatPr->yy();
2218  }
2219  // Same Z position as above...
2220  if (iRot == 0) {
2221  new G4PVPlacement(rMatPr, posTmp, pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
2222  volMother, false, iRot, fCheckVolumeOverLapWC);
2223  } else {
2224  new G4PVPlacement(G4Transform3D(*rMatPr, posTmp), pCurrentHanger, nameStr3 + std::string("_P") + rnStr,
2225  volMother, false, iRot, true);
2226  }
2227  } // on the 120 degree symmetry point.
2228 
2229  } // End of spider support
2230  //
2231  // The Inner Outer transition region, downstream..
2232  //
2233  {
2234  const double radInnerDownstrtIO = 122.1*CLHEP::mm; //Direct measurement on Drawing of IC, F10061161
2235  const double radOuterDownstrtIO = 128.1*CLHEP::mm;
2236  const double phiStartInnerDownstrtIO = 0.;
2237  const double yCenterInnerDownstrtIO = 362.0*CLHEP::mm + thickInner + radInnerDownstrtIO;
2238  const double yCenterOuterDownstrtIO = 362.0*CLHEP::mm + radOuterDownstrtIO;
2239  const double zCenterDownstrtIO = zEndOfIC + 0.5*CLHEP::mm; // a bit of clearance needed..
2240  const size_t nSegDownstrIO = 30.;
2241  const double deltaPhiDownstrIO = (M_PI - phiStartInnerDownstrtIO)/nSegDownstrIO;
2242  // This section is physically bigger, and is much more exposed to pion than the upstream one,
2243  // make it more accurate..
2244  for (size_t kPhi = 0; kPhi != nSegDownstrIO; kPhi++ ) {
2245  std::ostringstream aNStrStr; aNStrStr << header << "DownstrIOSect" << kPhi;
2246  std::string aNStr(aNStrStr.str());
2247  fHorn2IC.push_back(aNStr);
2248  const double phi0 = phiStartInnerDownstrtIO + kPhi*deltaPhiDownstrIO + 1.0e-5;
2249  const double phi1 = phi0 + deltaPhiDownstrIO - 2.0e-5;
2250  zTmps[0] = zCenterDownstrtIO + radInnerDownstrtIO*std::sin(phi0);
2251  zTmps[1] = zCenterDownstrtIO + radOuterDownstrtIO*std::sin(phi0);
2252  zTmps[2] = zCenterDownstrtIO + radOuterDownstrtIO*std::sin(phi1);
2253  zTmps[3] = zCenterDownstrtIO + radInnerDownstrtIO*std::sin(phi1);
2254  rTmps[0] = yCenterInnerDownstrtIO - radInnerDownstrtIO*std::cos(phi0);
2255  rTmps[1] = yCenterOuterDownstrtIO - radOuterDownstrtIO*std::cos(phi0);
2256  rTmps[2] = yCenterOuterDownstrtIO - radOuterDownstrtIO*std::cos(phi1);
2257  rTmps[3] = yCenterInnerDownstrtIO - radInnerDownstrtIO*std::cos(phi1);
2258 // std::cerr << " At kPhi " << kPhi << " Phi0 " << phi0 << " Phi1 " << phi1 << " rZVector " << std::endl;
2259 // for (size_t kk=0; kk != 4; kk++) std::cerr << " " << rTmps[kk] << " " <<
2260 // zTmps[kk] << " " << std::endl;
2261  G4GenericPolycone *aVolGP = new G4GenericPolycone(aNStr, 0.0, 360.0*CLHEP::degree,
2262  4, &rTmps[0], &zTmps[0]);
2263  G4LogicalVolume *aVolG = new G4LogicalVolume(aVolGP, myAlumIC, aNStr);
2264  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolG, aNStr + std::string("_P"),
2265  volMother, false, 1, true);
2266  if (kPhi < nSegDownstrIO/2.) {
2267  fZCoordCDRevisedHornC.push_back(zTmps[1] - zZeroLocalCoord);
2268  fRInCoordCDRevisedHornC.push_back(rTmps[1]);
2269  }
2270  }
2271  }
2272  //
2273  // IC IO Flange, downstream..
2274  //
2275  {
2276  const double radOuterICFlDwnTr = (671.1)*CLHEP::mm;
2277  const double radInnerICFlDwnTr = 614*CLHEP::mm; // Approximate. It is a bit polygonal.
2278  const double thickDwnICFlangeTr = 25.2*CLHEP::mm;
2279 
2280  std::string aNStrTmp(header); aNStrTmp += std::string("ICFlDTr");
2281  G4Tubs* aVolICFlTrG = new G4Tubs(aNStrTmp, radInnerICFlDwnTr, radOuterICFlDwnTr,
2282  0.5*thickDwnICFlangeTr, 0.0, 360.0*CLHEP::degree);
2283  G4LogicalVolume *aVolICFlTrGL = new G4LogicalVolume(aVolICFlTrG, myAlumIC, aNStrTmp);
2284 
2285  G4ThreeVector posTmp(0., 0., zEndOfIC - 0.5*thickDwnICFlangeTr - 0.050*CLHEP::mm);
2286  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolICFlTrGL, aNStrTmp + std::string("_P"),
2287  volMother, false, 1, true);
2288  }
2289  //
2290  // ------------ O.K., the IC and its content, and IO transitions are complete.
2291  // Moving to the Outer Conductor, 3 tubes. (body + two flanges)
2292  // + downstream polygonal, for dranage bulge + flange.
2293  //
2294  {
2295  const double radOuterOC = 650.*CLHEP::mm;
2296  const double lengthOCBody = 1682.606 - 0.250*CLHEP::mm; //Too much clearance ??
2297  // Exclude the downstream polygonal section for the water drainage.
2298  std::string aNStrTmpB(header); aNStrTmpB += std::string("OC");
2299  G4Tubs* aVolOCbG = new G4Tubs(aNStrTmpB, radInnerOC, radOuterOC,
2300  0.5*lengthOCBody, 0.0, 360.0*CLHEP::degree);
2301  G4LogicalVolume *aVolOCbGL = new G4LogicalVolume(aVolOCbG, myAlumOC, aNStrTmpB);
2302 
2303  G4ThreeVector posTmp(0., 0., zZeroLocalCoord + 0.5*lengthOCBody + 151*CLHEP::mm);
2304  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolOCbGL, aNStrTmpB + std::string("_P"),
2305  volMother, false, 1, true);
2306 
2307  const double radOuterOCFlU2 = 766.5*CLHEP::mm;
2308  const double radICOCFlU2 = radInnerOC; // Approximate. There is curvature.
2309  const double lengthOCFlU2 = (30.0 - 0.025)*CLHEP::mm; // needs clearance..
2310 
2311  std::string aNStrTmpFlU2(header); aNStrTmpFlU2 += std::string("OCFlU2");
2312  G4Tubs* aVolOCU2G = new G4Tubs(aNStrTmpFlU2, radICOCFlU2, radOuterOCFlU2,
2313  0.5*lengthOCFlU2, 0.0, 360.0*CLHEP::degree);
2314  G4LogicalVolume *aVolOCU2GL = new G4LogicalVolume(aVolOCU2G, myAlumOC, aNStrTmpFlU2);
2315 
2316  G4ThreeVector posTmpU2(0., 0., zZeroLocalCoord + 0.5*lengthOCFlU2 + (120.5 - 0.0125)*CLHEP::mm);
2317  new G4PVPlacement((G4RotationMatrix *) 0, posTmpU2, aVolOCU2GL, aNStrTmpFlU2 + std::string("_P"),
2318  volMother, false, 1, true);
2319 
2320  const double radOuterOCFlU1 = 697.*CLHEP::mm;
2321  const double radICOCFlU1 = radInnerOC;
2322  const double lengthOCFlU1 = (15.0 - 0.025)*CLHEP::mm; // needs clearance..
2323 
2324  std::string aNStrTmpFlU1(header); aNStrTmpFlU1 += std::string("OCFlU1");
2325  G4Tubs* aVolOCU1G = new G4Tubs(aNStrTmpFlU1, radICOCFlU1, radOuterOCFlU1,
2326  0.5*lengthOCFlU1, 0.0, 360.0*CLHEP::degree);
2327  G4LogicalVolume *aVolOCU1GL = new G4LogicalVolume(aVolOCU1G, myAlumOC, aNStrTmpFlU1);
2328 
2329  G4ThreeVector posTmpU1(0., 0., zZeroLocalCoord
2330  + 0.5*lengthOCFlU1 + (105.0 - 0.030)*CLHEP::mm);
2331  new G4PVPlacement((G4RotationMatrix *) 0, posTmpU1, aVolOCU1GL, aNStrTmpFlU1 + std::string("_P"),
2332  volMother, false, 1, true);
2333 
2334  // The downstream section, conical + flange, make it a polygon.
2335 
2336  std::vector<double> rOCTmps(13, -1.);
2337  std::vector<double> zOCTmps(13, zZeroLocalCoord + lengthOCBody + 151*CLHEP::mm + 0.050*CLHEP::mm);
2338  const double zOrigDwOCFl = 1727.34; // Absolute coord. in F10071767., start of this polygon.
2339  zOCTmps[1] += 1750.19*CLHEP::mm - zOrigDwOCFl;
2340  zOCTmps[2] += 1849.84*CLHEP::mm - zOrigDwOCFl;
2341  zOCTmps[3] += 1876.74*CLHEP::mm - zOrigDwOCFl;
2342  zOCTmps[4] += 1893.24*CLHEP::mm - zOrigDwOCFl;
2343  zOCTmps[5] += 1922.308*CLHEP::mm - zOrigDwOCFl - 0.6*CLHEP::mm; // subtract 700 microns,
2344  // clash with IC ..To be confirmed..if need be..
2345  zOCTmps[6] = zOCTmps[5]; zOCTmps[7] = zOCTmps[4] + 1.0*CLHEP::mm; zOCTmps[8] = zOCTmps[4];
2346  zOCTmps[9] = zOCTmps[3]; zOCTmps[10] = zOCTmps[2]; zOCTmps[11] = zOCTmps[1];
2347  zOCTmps[12] = zOCTmps[0];
2348  const double thickOCNom = radOuterOC - radInnerOC;
2349  rOCTmps[0] = radInnerOC; rOCTmps[1] = 632.02; rOCTmps[2] = 621.52;
2350  rOCTmps[3] = 634.9*CLHEP::mm - thickOCNom; rOCTmps[4] = rOCTmps[3] -2.0*CLHEP::mm;
2351  rOCTmps[5] = rOCTmps[4] -4.0*CLHEP::mm; rOCTmps[6] = 668.1*CLHEP::mm;
2352  rOCTmps[7] = rOCTmps[6];
2353  rOCTmps[8] = 0.5*(rOCTmps[7] + rOCTmps[4]); rOCTmps[9] = rOCTmps[3] + thickOCNom;
2354  rOCTmps[10] = rOCTmps[2] + thickOCNom; rOCTmps[11] = rOCTmps[1] + thickOCNom;
2355  rOCTmps[12] = rOCTmps[0] + thickOCNom;
2356  std::string aNStrOCDwnEndFl(header); aNStrOCDwnEndFl += std::string("OCDwnEndFl");
2357  /*
2358  std::ofstream fOutTmp("./RZOCDwnFl.txt");
2359  std::cerr << " Dump of Polycon for OC Flange " << std::endl;
2360  fOutTmp << " i Z R " << std::endl;
2361  for(size_t i=0; i != 13; i++) {
2362  fOutTmp << " " << i << " " << zOCTmps[i] << " " << rOCTmps[i] << std::endl;
2363  }
2364  std::cerr << " And Quit ... " << std::endl; exit(2);
2365  fOutTmp.close();
2366  */
2367  G4GenericPolycone *aVolGPDwnOCEnd = new G4GenericPolycone(aNStrOCDwnEndFl, 0.0, 360.0*CLHEP::degree,
2368  13, &rOCTmps[0], &zOCTmps[0]);
2369  G4LogicalVolume *aVolGDwnOCEnd = new G4LogicalVolume(aVolGPDwnOCEnd, myAlumIC, aNStrOCDwnEndFl);
2370  new G4PVPlacement((G4RotationMatrix *) 0, zeroC, aVolGDwnOCEnd, aNStrOCDwnEndFl + std::string("_P"),
2371  volMother, false, 1, true);
2372 
2373  }
2374  //
2375  // The Insulator ring (part F10071768 )
2376  //
2377  {
2378  const double radOuterIns = 694.*CLHEP::mm;
2379  const double radInnerIns = radInnerOC;
2380  const double thickIns = 67.0 - 0.060*CLHEP::mm; // cheat a tiny bit.. clearance.
2381 
2382  std::string aNStrTmp(header); aNStrTmp += std::string("InsulR");
2383  G4Tubs* aVolInsG = new G4Tubs(aNStrTmp,radInnerIns , radOuterIns,
2384  0.5*thickIns, 0.0, 360.0*CLHEP::degree);
2385  G4LogicalVolume *aVolInsGL = new G4LogicalVolume(aVolInsG, myAlumina, aNStrTmp);
2386 
2387  G4ThreeVector posTmp(0., 0., zZeroLocalCoord + 0.5*thickIns + (36. + 0.025)*CLHEP::mm);
2388  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, aVolInsGL, aNStrTmp + std::string("_P"),
2389  volMother, false, 1, true);
2390 
2391  }
2392  //
2393  // Connecting IC to OC flange... Included in the aVolGPDwnOCEnd polygon..
2394  //
2395  // The Current Equalizer sections. At least, the downstream section that fits into
2396  // the mother volume contain all of the above (in this method)
2397  // Implemented as 4 tubes. Starting from the most upstream, going downstream
2398  //
2399  {
2400  const double radOuterICEQ1 = 760.0*CLHEP::mm;
2401  const double radInnerICEQ1 = 715.025*CLHEP::mm;
2402  const double thickICEQ1 = (25.- 0.0125)*CLHEP::mm; // cheat a tiny bit.. clearance.
2403  // up to the upstream face of the HornC mother volume.
2404  std::string aNStrTmp1(header); aNStrTmp1 += std::string("ICEQFl1");
2405  G4Tubs* aVol1G = new G4Tubs(aNStrTmp1,radInnerICEQ1, radOuterICEQ1,
2406  0.5*thickICEQ1, 0.0, 360.0*CLHEP::degree);
2407  G4LogicalVolume *aVol1GL = new G4LogicalVolume(aVol1G, myAlumIC, aNStrTmp1);
2408 
2409  const double zZeroLocalICEQ = -0.5*lengthMother + 0.010*CLHEP::mm; // to be adjusted...
2410 // std::cerr << " Inner Conduct. Current Equal. Section, zZeroLocalICEQ " << zZeroLocalICEQ << std::endl;
2411  G4ThreeVector posTmp1(0., 0., zZeroLocalICEQ + 0.5*thickICEQ1 + 0.025*CLHEP::mm);
2412  new G4PVPlacement((G4RotationMatrix *) 0, posTmp1, aVol1GL, aNStrTmp1 + std::string("_P"),
2413  volMother, false, 1, true);
2414 
2415  const double radOuterICEQ2 = 715.;
2416  const double radInnerICEQ2 = 707.*CLHEP::mm;
2417  fRadOuterICCurrEqHornC = radOuterICEQ2;
2418  fRadInnerICCurrEqHornC = radInnerICEQ2;
2419  std::string aNStrTmp2(header); aNStrTmp2 += std::string("ICEQbodyUp");
2420  const double lengthICEQ2 = (907. - 0.050)*CLHEP::mm;
2421  G4Tubs* aVol2G = new G4Tubs(aNStrTmp2,radInnerICEQ2, radOuterICEQ2,
2422  0.5*lengthICEQ2, 0.0, 360.0*CLHEP::degree);
2423  G4LogicalVolume *aVol2GL = new G4LogicalVolume(aVol2G, myAlumIC, aNStrTmp2);
2424 
2425  G4ThreeVector posTmp2(0., 0., zZeroLocalICEQ + 0.5*lengthICEQ2 + 0.0125);
2426  new G4PVPlacement((G4RotationMatrix *) 0, posTmp2, aVol2GL, aNStrTmp2 + std::string("_P"),
2427  volMother, false, 1, true);
2428  fHorn3ICQLengthIntoHornMother = lengthICEQ2;
2429  //
2430  // The connecting flange. Install as three tubes.
2431  //
2432  const double radOuterICEQ3 = 715.*CLHEP::mm;
2433  const double radInnerICEQ3 = (570. - 0.10)*CLHEP::mm;
2434  const double thickICEQ3 = (13.- 0.0125)*CLHEP::mm; // cheat a tiny bit.. clearance.
2435  std::string aNStrTmp3(header); aNStrTmp3 += std::string("ICEQFl3");
2436  G4Tubs* aVol3G = new G4Tubs(aNStrTmp3,radInnerICEQ3, radOuterICEQ3,
2437  0.5*thickICEQ3, 0.0, 360.0*CLHEP::degree);
2438  G4LogicalVolume *aVol3GL = new G4LogicalVolume(aVol3G, myAlumIC, aNStrTmp3);
2439 
2440  G4ThreeVector posTmp3(0., 0., zZeroLocalICEQ + lengthICEQ2 + 0.5*thickICEQ3 + 0.0125*CLHEP::mm);
2441 // std::cerr << " Current Equl, vol " << aNStrTmp3 << " At Z = " << posTmp3[2] << std::endl;
2442  new G4PVPlacement((G4RotationMatrix *) 0, posTmp3, aVol3GL, aNStrTmp3 + std::string("_P"),
2443  volMother, false, 1, true);
2444 
2445  const double radOuterICEQ4 = 697.*CLHEP::mm;
2446  const double radInnerICEQ4 = (570. - 0.10)*CLHEP::mm;
2447  const double thickICEQ4 = (30. - 13. - 0.025)*CLHEP::mm;
2448  std::string aNStrTmp4(header); aNStrTmp4 += std::string("ICEQFl4");
2449  G4Tubs* aVol4G = new G4Tubs(aNStrTmp4,radInnerICEQ4, radOuterICEQ4,
2450  0.5*thickICEQ4, 0.0, 360.0*CLHEP::degree);
2451  G4LogicalVolume *aVol4GL = new G4LogicalVolume(aVol4G, myAlumIC, aNStrTmp4);
2452 
2453  G4ThreeVector posTmp4(0., 0., zZeroLocalICEQ + lengthICEQ2 + thickICEQ3 + 0.5*thickICEQ4 + 0.0125*CLHEP::mm);
2454 // std::cerr << " Current Equl, vol " << aNStrTmp4 << " At Z = " << posTmp4[2] << std::endl;
2455  new G4PVPlacement((G4RotationMatrix *) 0, posTmp4, aVol4GL, aNStrTmp4 + std::string("_P"),
2456  volMother, false, 1, true);
2457  const double radOuterICEQ5 = 697.*CLHEP::mm;
2458  const double radInnerICEQ5 = (628.5 - 0.250)*CLHEP::mm;
2459  const double thickICEQ5 = (55.0 - (thickICEQ4 + thickICEQ3) - 0.050 )*CLHEP::mm;
2460  std::string aNStrTmp5(header); aNStrTmp5 += std::string("ICEQFl5");
2461  G4Tubs* aVol5G = new G4Tubs(aNStrTmp5,radInnerICEQ5, radOuterICEQ5,
2462  0.5*thickICEQ5, 0.0, 360.0*CLHEP::degree);
2463  G4LogicalVolume *aVol5GL = new G4LogicalVolume(aVol5G, myAlumIC, aNStrTmp5);
2464 
2465  G4ThreeVector posTmp5(0., 0.,
2466  zZeroLocalICEQ + lengthICEQ2 + thickICEQ3 + thickICEQ4 + 0.5*thickICEQ5 + 0.075*CLHEP::mm);
2467  new G4PVPlacement((G4RotationMatrix *) 0, posTmp5, aVol5GL, aNStrTmp5 + std::string("_P"),
2468  volMother, false, 1, true);
2469  //
2470  // Same for the Outer Current Equalizer section. Part F10071771
2471  //
2472  const double radOuterOCEQ1 = 811.5*CLHEP::mm;
2473  const double radInnerOCEQ1 = (766.5 + 0.025)*CLHEP::mm;
2474  const double thickOCEQ1 = (25.- 0.0125)*CLHEP::mm; // cheat a tiny bit.. clearance.
2475  // up to the upstream face of the HornC mother volume.
2476  std::string aNStrTmp6(header); aNStrTmp6 += std::string("OCEQFlUp");
2477  G4Tubs* aVol6G = new G4Tubs(aNStrTmp6,radInnerOCEQ1, radOuterOCEQ1,
2478  0.5*thickOCEQ1, 0.0, 360.0*CLHEP::degree);
2479  G4LogicalVolume *aVol6GL = new G4LogicalVolume(aVol6G, myAlumOC, aNStrTmp6);
2480 
2481  const double zZeroLocalOCEQ = -0.5*lengthMother + (45.0 - 0.10)*CLHEP::mm; // to be adjusted...
2482  G4ThreeVector posTmp6(0., 0., zZeroLocalOCEQ + 0.5*thickOCEQ1);
2483  new G4PVPlacement((G4RotationMatrix *) 0, posTmp6, aVol6GL, aNStrTmp6 + std::string("_P"),
2484  volMother, false, 1, true);
2485 
2486  const double radInnerOCEQ2 = 758.5*CLHEP::mm;
2487  const double radOuterOCEQ2 = radInnerOCEQ1 - 0.050*CLHEP::mm;
2488  const double lengthOCEQ2 = (998.0 - 0.050)*CLHEP::mm;
2489  fRadInnerOCCurrEqHornC = radInnerOCEQ2;
2490  std::string aNStrTmp7(header); aNStrTmp7 += std::string("OCEQbody");
2491  G4Tubs* aVol7G = new G4Tubs(aNStrTmp7,radInnerOCEQ2, radOuterOCEQ2,
2492  0.5*lengthOCEQ2, 0.0, 360.0*CLHEP::degree);
2493  G4LogicalVolume *aVol7GL = new G4LogicalVolume(aVol7G, myAlumOC, aNStrTmp7);
2494 
2495  G4ThreeVector posTmp7(0., 0., zZeroLocalOCEQ + 0.5*lengthOCEQ2 + 0.020*CLHEP::mm);
2496  new G4PVPlacement((G4RotationMatrix *) 0, posTmp7, aVol7GL, aNStrTmp7 + std::string("_P"),
2497  volMother, false, 1, true);
2498  fHorn3OCQLengthIntoHornMother = lengthOCEQ2;
2499  //
2500  // One more ...
2501  //
2502  const double radOuterOCEQ3 = radInnerOCEQ2 - 0.050*CLHEP::mm;
2503  const double radInnerOCEQ3 = 714.0*CLHEP::mm;
2504  const double thickOCEQ3 = (25.- 0.0125)*CLHEP::mm; // cheat a tiny bit.. clearance.
2505  // up to the upstream face of the HornC mother volume.
2506  std::string aNStrTmp8(header); aNStrTmp8 += std::string("OCEQF3Dw");
2507  G4Tubs* aVol8G = new G4Tubs(aNStrTmp8,radInnerOCEQ3, radOuterOCEQ3,
2508  0.5*thickOCEQ3, 0.0, 360.0*CLHEP::degree);
2509  G4LogicalVolume *aVol8GL = new G4LogicalVolume(aVol8G, myAlumOC, aNStrTmp8);
2510 
2511  G4ThreeVector posTmp8(0., 0., zZeroLocalOCEQ + 973.0*CLHEP::mm + 0.5*thickOCEQ3);
2512  new G4PVPlacement((G4RotationMatrix *) 0, posTmp8, aVol8GL, aNStrTmp8 + std::string("_P"),
2513  volMother, false, 1, true);
2514 
2515  // Alumina insulators. skip for now.. They are at a radius of ~ 850 mm,
2516  // Not that much materials .
2517  //
2518 
2519  }
2520  for (size_t k=0; k != fZCoordCDRevisedHornC.size(); k++)
2521  fZCoordCDRevisedHornC[k] += distUpstrCurrEQToBeginIC+ 0.050*CLHEP::mm; // From the beginning of the mother volume.
2522  //
2523  // Check the exact R/Z coordinates...
2524  //
2525  std::cerr << " Dump of the R/Z map, accurate, for the magnetic field " << std::endl;
2526  for (size_t k=0; k != fZCoordCDRevisedHornC.size(); k++) {
2527  std::cerr << " " << k << " " << fRInCoordCDRevisedHornC[k] << " " << fZCoordCDRevisedHornC[k] << std::endl;
2528  }
2529  return;
2530 }
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::vector< double > fZCoordCDRevisedHornC
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
intermediate_table::const_iterator const_iterator
std::vector< double > fRInCoordCDRevisedHornC
std::vector< G4String > fHorn2IC
std::vector< double > fParams
size_t fLBNFOptimConceptDesignHornCNumStepIC[10]
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceFinalLBNFConceptStripLinesConnectHornB ( )

Definition at line 1462 of file LBNFConceptDesignHorns.cc.

1462  {
1463 
1464  if (fRadInnerICCurrEqHorn2 > 500.) {
1465 
1466  std::cerr << " Conceptual desing, October/November 2016, Skipping the installation of the strip lines, " <<
1467  " as they are no longer in the beam aperture. " << std::endl
1468  << " .... Also, we do not have the updated drawings yet. " << std::endl;
1469  return;
1470  }
1471 
1472  std::string header("LBNFConceptHornBStrpL");
1473  const LBNEVolumePlacementData *plDatMotherTunnel = this->Find(header, "Tunnel",
1474  "LBNEVolumePlacements::PlaceFinalLBNFConceptStripLinesConnectHornB");
1475  const LBNEVolumePlacementData *plDatMotherHorn2 = this->Find(header, "LBNFSimpleHorn2Container",
1476  "LBNEVolumePlacements::PlaceFinalLBNFConceptHornB");
1477 
1478  const double lengthHornB = plDatMotherHorn2->fParams[2];
1479  const double lengthStripZone = 870.25; // Drawing F10060435
1480  const double lengthStripZoneEff = lengthStripZone - fLengthCurrEqOCInMotherHorn2; // Already placed, see above.
1481  const double zPosStripZone = plDatMotherHorn2->fPosition[2] + 0.5*lengthHornB
1482  + 0.5*lengthStripZoneEff + 0.1*CLHEP::mm;
1483  G4Material *myAlum = G4Material::GetMaterial("Aluminum");
1484  G4Material *myAir = G4Material::GetMaterial("Air");
1485  // A mother volume for convenience of top/down declaration of the geometry.
1486  const double halfWidthZone = 561. + 47.5*CLHEP::mm; // Clearance of 45 + 2.5 mm , for the container box of rotate olumes
1487  const double halfHeightZone = 0.5*(1560. + 0.5*CLHEP::mm); // set by thetotal height of the strip line system.
1488  std::string aNStrTmp1(header); aNStrTmp1 += std::string("Mother");
1489  G4Box* aVolM = new G4Box(aNStrTmp1, halfWidthZone, halfHeightZone, 0.5*lengthStripZoneEff);
1490  G4LogicalVolume *volMotherLoc = new G4LogicalVolume(aVolM, myAir, aNStrTmp1);
1491  G4ThreeVector posTmpM(0., 0., zPosStripZone); // ..
1492  G4LogicalVolume *volMother = plDatMotherTunnel->fCurrent;
1493  new G4PVPlacement((G4RotationMatrix *) 0, posTmpM, volMotherLoc, aNStrTmp1 + std::string("_P"),
1494  volMother, false, 1, true);
1495  bool doInstallCurrEq = true;
1496  bool doInstallStrplConn = true;
1497  bool doInstallStrpl = true;
1498  //
1499  // The remaining of the current equalizer sections.
1500  //
1501  const double lengthCurrEqOC = 501.0*mm;
1502  const double lengthCurrEqOCHere = lengthCurrEqOC - fLengthCurrEqOCInMotherHorn2 - 0.050*CLHEP::mm;
1503  double zLocalCurrent = -0.5*lengthStripZoneEff + 0.025*CLHEP::mm;
1504  std::cerr << " .... zLocalCurrent Before placing Current eq "
1505  << zLocalCurrent << " lengthCurrEqOCHere " << lengthCurrEqOCHere << std::endl;
1506  if (doInstallCurrEq) {
1507  std::string aNStr1(header); aNStr1 += std::string("OCCurrEq");
1508  G4Tubs* aVolOC1G = new G4Tubs(aNStr1, fRadInnerOCCurrEqHorn2, fRadOuterOCCurrEqHorn2,
1509  0.5*lengthCurrEqOCHere, 0.0, 360.0*CLHEP::degree);
1510  G4LogicalVolume *aVolOC1GL = new G4LogicalVolume(aVolOC1G, myAlum, aNStr1);
1511  G4ThreeVector posTmp1(0., 0., zLocalCurrent+ 0.5*lengthCurrEqOCHere);
1512  new G4PVPlacement((G4RotationMatrix *) 0, posTmp1, aVolOC1GL, aNStr1 + std::string("_P"),
1513  volMotherLoc , false, 1, true);
1514 
1515  std::string aNStr2(header); aNStr2 += std::string("ICCurrEq");
1516  G4Tubs* aVolIC2G = new G4Tubs(aNStr2, fRadInnerICCurrEqHorn2, fRadOuterICCurrEqHorn2,
1517  0.5*lengthCurrEqOCHere, 0.0, 360.0*CLHEP::degree); // No typo, length are now the same
1518  G4LogicalVolume *aVolIC2GL = new G4LogicalVolume(aVolIC2G, myAlum, aNStr2);
1519  new G4PVPlacement((G4RotationMatrix *) 0, posTmp1, aVolIC2GL, aNStr2 + std::string("_P"),
1520  volMotherLoc , false, 1, true);
1521  zLocalCurrent = posTmp1[2] + 0.5*lengthCurrEqOCHere + 0.025*CLHEP::mm;
1522  std::cerr << " .... zLocalCurrent after placing Current eq " << zLocalCurrent << std::endl;
1523  //
1524  // Two flanges.
1525  //
1526  const double thickFlg = 25.0*CLHEP::mm;
1527  zLocalCurrent -= 0.5*thickFlg;
1528  std::string aNStr3(header); aNStr3 += std::string("OCCurrEqFl");
1529  G4Tubs* aVolOC3G = new G4Tubs(aNStr3, fRadOuterOCCurrEqHorn2+0.025*CLHEP::mm, 561.*CLHEP::mm,
1530  0.5*thickFlg, 0.0, 360.0*CLHEP::degree);
1531  G4LogicalVolume *aVolOC3GL = new G4LogicalVolume(aVolOC3G, myAlum, aNStr3);
1532  G4ThreeVector posTmp3(0., 0., zLocalCurrent);
1533  new G4PVPlacement((G4RotationMatrix *) 0, posTmp3, aVolOC3GL, aNStr3 + std::string("_P"),
1534  volMotherLoc , false, 1, true);
1535 
1536  std::string aNStr4(header); aNStr4 += std::string("ICCurrEqFl");
1537  G4Tubs* aVolIC4G = new G4Tubs(aNStr4, fRadOuterICCurrEqHorn2+0.025*CLHEP::mm, 388.*CLHEP::mm,
1538  0.5*thickFlg, 0.0, 360.0*CLHEP::degree); // No typo, length are now the same
1539  G4LogicalVolume *aVolIC4GL = new G4LogicalVolume(aVolIC4G, myAlum, aNStr4);
1540  new G4PVPlacement((G4RotationMatrix *) 0, posTmp3, aVolIC4GL, aNStr4 + std::string("_P"),
1541  volMotherLoc , false, 1, true);
1542  zLocalCurrent += 0.5*thickFlg + 0.025*CLHEP::mm;
1543  std::cerr << " After installing current equal downstream flanges , zLocalCurrent "
1544  << zLocalCurrent << std::endl;
1545  }
1546  //
1547  // The connection stripline to flange of current equalizer. Drawing F10061024
1548  //
1549  const double thickConnPlate = 9.52*CLHEP::mm;
1550  if (doInstallStrplConn) {
1551  //
1552  // We two kinds : the flat plate that terminate the sripline, flushed with the dowstream face
1553  // of the OC/IC flange, and, a 90 section of tube, curved section
1554  //
1555  // First, these flat plates. They have cut corners, which we neglect, however, the total volume is correct
1556  //
1557  const double widthConnPlate = 200.0*CLHEP::mm;
1558  const double heightConnPlateO = 56.875*CLHEP::mm; // the flull value is 58, but the surface
1559  const double heightConnPlateI = 48.75*CLHEP::mm; // the flull value is 50, but the surface
1560  // taken by the cut corner is 15 x 15 mm sq.
1561  std::string aNStr1OO(header); aNStr1OO += std::string("ConnFlatO");
1562  G4Box* aVol1OOG = new G4Box(aNStr1OO, 0.5*widthConnPlate, 0.5*heightConnPlateO, 0.5*thickConnPlate);
1563  G4LogicalVolume *aVol1OOGL = new G4LogicalVolume(aVol1OOG, myAlum, aNStr1OO);
1564  std::string aNStr1II(header); aNStr1II += std::string("ConnFlatI");
1565  G4Box* aVol1IIG = new G4Box(aNStr1II, 0.5*widthConnPlate, 0.5*heightConnPlateI, 0.5*thickConnPlate);
1566  G4LogicalVolume *aVol1IIGL = new G4LogicalVolume(aVol1IIG, myAlum, aNStr1II);
1567  const double radInnerCurveConnPlate = 45.0*CLHEP::mm;
1568  const double radOuterCurveConnPlate = radInnerCurveConnPlate + thickConnPlate + 0.025*CLHEP::mm;
1569 
1570  const double radLocConnPlateOC = 0.5*(1122. - heightConnPlateO)*CLHEP::mm;
1571  const double radLocConnPlateIC = 0.5*(662.3 + heightConnPlateI - 1.5)*CLHEP::mm; // a bit more room for the curved section
1572  // Trick to get the right dimensions..
1573  const double radLocConnCurvedOC = 0.5*(1005. - 0.050)*CLHEP::mm - 0.5*radOuterCurveConnPlate;
1574  const double radLocConnCurvedIC = 0.5*(871.42 - radOuterCurveConnPlate + 1.5)*CLHEP::mm; // tight fit, to be adjusted..
1575  zLocalCurrent += 0.5*thickConnPlate + 0.025*CLHEP::mm;
1576  std::cerr << " Before installing ConnFlat, zLocalCurrent " << zLocalCurrent << std::endl;
1577  for (int kPhi=0; kPhi != 4; kPhi++) {
1578  std::ostringstream phiOCStrStr; phiOCStrStr << (kPhi+1);
1579  std::ostringstream phiICStrStr; phiICStrStr << (kPhi+5);
1580  fRotHornBStrpLineConnFlatB[kPhi] = new G4RotationMatrix;
1581  const double anglePhiPlate = (kPhi+1)*M_PI/2. - M_PI/4.;
1582  fRotHornBStrpLineConnFlatB[kPhi]->rotateZ(anglePhiPlate);
1583  double xLocalPlateOC = radLocConnPlateOC*std::cos(anglePhiPlate);
1584  double yLocalPlateOC = radLocConnPlateOC*std::sin(anglePhiPlate);
1585  G4ThreeVector posTmp1OC(xLocalPlateOC, yLocalPlateOC, zLocalCurrent);
1586  new G4PVPlacement(fRotHornBStrpLineConnFlatB[kPhi], posTmp1OC,
1587  aVol1OOGL, aNStr1OO + phiOCStrStr.str() + std::string("_P"),
1588  volMotherLoc , false, kPhi+1, true);
1589  double xLocalPlateIC = radLocConnPlateIC*std::cos(anglePhiPlate);
1590  double yLocalPlateIC = radLocConnPlateIC*std::sin(anglePhiPlate);
1591  G4ThreeVector posTmp1IC(xLocalPlateIC, yLocalPlateIC, zLocalCurrent);
1592  new G4PVPlacement(fRotHornBStrpLineConnFlatB[kPhi], posTmp1IC,
1593  aVol1IIGL, aNStr1II + phiICStrStr.str() + std::string("_P"),
1594  volMotherLoc , false, kPhi+1, true);
1595  }
1596  //
1597  // Now the curved one. We install first a 1/4 (phi) tube section in a box, the tube is rotated in the box,
1598  // and then we place the box 2x2 times around. The rotations can not be combined, since the origin of
1599  // axis of rotation are spatially disctinct. We need to define the 1/4 tube in two distinct quadrant..
1600  //
1601 
1602  std::string aNStr2Q1(header); aNStr2Q1 += std::string("ConnCurvQ1");
1603  G4Tubs* aVolTQ1G = new G4Tubs(aNStr2Q1, radInnerCurveConnPlate,
1604  radInnerCurveConnPlate + thickConnPlate, 0.5*widthConnPlate, 180.*CLHEP::degree, 90.0*CLHEP::degree);
1605  G4LogicalVolume *aVolTQ1GL = new G4LogicalVolume(aVolTQ1G, myAlum, aNStr2Q1);
1606  std::string aNStr2Q1M(aNStr2Q1); aNStr2Q1M += std::string("M");
1607  G4Box* aVolTQ1MG = new G4Box(aNStr2Q1M,
1608  0.5*(widthConnPlate + 0.025*CLHEP::mm),
1609  0.5*(radOuterCurveConnPlate + 0.025*CLHEP::mm),
1610  0.5*(radOuterCurveConnPlate + 0.025*CLHEP::mm));
1611  G4LogicalVolume *aVolTQ1MGL = new G4LogicalVolume(aVolTQ1MG, myAir, aNStr2Q1M);
1612  G4ThreeVector posTmpQ1MOC(0., 0.5*(radOuterCurveConnPlate-0.0125*CLHEP::mm),
1613  0.5*(radOuterCurveConnPlate-0.0125*CLHEP::mm));
1614  fRotHornBStrpLineRotY = new G4RotationMatrix();
1615  fRotHornBStrpLineRotY->rotateY(M_PI/2.);
1616  new G4PVPlacement(fRotHornBStrpLineRotY, posTmpQ1MOC,
1617  aVolTQ1GL, aNStr2Q1 + std::string("_P"),
1618  aVolTQ1MGL , false, 1, true);
1619 //
1620 // 2nd quadrant.
1621 //
1622  std::string aNStr2Q2(header); aNStr2Q2 += std::string("ConnCurvQ2");
1623  G4Tubs* aVolTQ2G = new G4Tubs(aNStr2Q2, radInnerCurveConnPlate,
1624  radInnerCurveConnPlate + thickConnPlate, 0.5*widthConnPlate, 90.*CLHEP::degree, 90.0*CLHEP::degree);
1625  G4LogicalVolume *aVolTQ2GL = new G4LogicalVolume(aVolTQ2G, myAlum, aNStr2Q2);
1626  std::string aNStr2Q2M(aNStr2Q2); aNStr2Q2M += std::string("M");
1627  G4Box* aVolTQ2MG = new G4Box(aNStr2Q2M,
1628  0.5*(widthConnPlate + 0.025*CLHEP::mm),
1629  0.5*(radOuterCurveConnPlate + 0.025*CLHEP::mm),
1630  0.5*(radOuterCurveConnPlate + 0.025*CLHEP::mm));
1631  G4LogicalVolume *aVolTQ2MGL = new G4LogicalVolume(aVolTQ2MG, myAir, aNStr2Q2M);
1632  G4ThreeVector posTmpQ2MOC(0., -0.5*(radOuterCurveConnPlate-0.0125*CLHEP::mm),
1633  0.5*(radOuterCurveConnPlate-0.0125*CLHEP::mm));
1634  new G4PVPlacement(fRotHornBStrpLineRotY, posTmpQ2MOC,
1635  aVolTQ2GL, aNStr2Q1 + std::string("_P"),
1636  aVolTQ2MGL , false, 1, true);
1637 
1638 // zLocalCurrent += radInnerCurveConnPlate - thickConnPlate + 0.025*CLHEP::mm;
1639  zLocalCurrent += -0.5*thickConnPlate + 0.5*radOuterCurveConnPlate + 0.025*CLHEP::mm;
1640  std::cerr << " After installing ConnFlat, zLocalCurrent " << zLocalCurrent << std::endl;
1641  for (int kPhi=0; kPhi != 4; kPhi++) {
1642 
1643  std::ostringstream phiOCStrStr; phiOCStrStr << (kPhi+1);
1644  const double anglePhiCurve = (kPhi + 1)*M_PI/2. - M_PI/4.; // Oriented right (hopefully)
1645  double xLocalCurvedOC = radLocConnCurvedOC*std::cos(anglePhiCurve);
1646  double yLocalCurvedOC = radLocConnCurvedOC*std::sin(anglePhiCurve);
1647  G4ThreeVector posTmp1OC(xLocalCurvedOC, yLocalCurvedOC, zLocalCurrent);
1648  if ((kPhi == 0) || (kPhi ==2)) {
1649  new G4PVPlacement(fRotHornBStrpLineConnFlatB[kPhi], posTmp1OC,
1650  aVolTQ1MGL, aNStr2Q1M + phiOCStrStr.str() + std::string("_P"),
1651  volMotherLoc , false, kPhi + 1, true);
1652  } else {
1653 
1654  new G4PVPlacement(fRotHornBStrpLineConnFlatB[kPhi], posTmp1OC,
1655  aVolTQ2MGL, aNStr2Q2M + phiOCStrStr.str() + std::string("_P"),
1656  volMotherLoc , false, kPhi + 1, true);
1657 
1658  }
1659 
1660  }
1661 
1662  for (int kPhi=0; kPhi != 4; kPhi++) {
1663 
1664  std::ostringstream phiICStrStr; phiICStrStr << (kPhi+5);
1665  const double anglePhiCurve = (kPhi + 1)*M_PI/2. - M_PI/4.; // Oriented right (hopefully)
1666  double xLocalCurvedIC = radLocConnCurvedIC*std::cos(anglePhiCurve);
1667  double yLocalCurvedIC = radLocConnCurvedIC*std::sin(anglePhiCurve);
1668  G4ThreeVector posTmp1IC(xLocalCurvedIC, yLocalCurvedIC, zLocalCurrent);
1669  if ((kPhi == 0) || (kPhi ==2)) {
1670  new G4PVPlacement(fRotHornBStrpLineConnFlatB[kPhi], posTmp1IC,
1671  aVolTQ2MGL, aNStr2Q2M + phiICStrStr.str() + std::string("_P"),
1672  volMotherLoc , false, kPhi + 1, true);
1673  } else {
1674  new G4PVPlacement(fRotHornBStrpLineConnFlatB[kPhi], posTmp1IC,
1675  aVolTQ1MGL, aNStr2Q1M + phiICStrStr.str() + std::string("_P"),
1676  volMotherLoc , false, kPhi + 1, true);
1677  }
1678  }
1679  zLocalCurrent += 0.5*radOuterCurveConnPlate + 0.025*CLHEP::mm;
1680  }
1681 
1682  std::cerr << " Before installing 45 degree stripline plates, zLocalCurrent " << zLocalCurrent << std::endl;
1683  if (doInstallStrpl) {
1684  //
1685  // We start with the 45 (+- 90, +180) degree plate that are oriented along the beam direction.
1686  // Same roration matrices as the connector plates.
1687  //
1688  const double length45Deg = 275.0*CLHEP::mm;
1689  const double width45Deg = 200*CLHEP::mm;
1690  std::string aNStr45D(header); aNStr45D += std::string("45D");
1691  G4Box* aVol45DG = new G4Box(aNStr45D, 0.5*width45Deg, 0.5*thickConnPlate, 0.5*length45Deg);
1692  G4LogicalVolume *aVol45DGL = new G4LogicalVolume(aVol45DG, myAlum, aNStr45D);
1693  const double radLoc45DegOC = 0.5*896.82*CLHEP::mm + 0.5*thickConnPlate;
1694  const double radLoc45DegIC = 0.5*871.45*CLHEP::mm - 0.5*thickConnPlate;
1695  zLocalCurrent += 0.5*length45Deg + 0.025*CLHEP::mm;
1696  std::cerr << " Before installing 45 degree stripline section, 2nd check, zLocalCurrent " << zLocalCurrent << std::endl;
1697  for (int kPhi=0; kPhi != 4; kPhi++) {
1698  std::ostringstream phiOCStrStr; phiOCStrStr << (kPhi+1);
1699  std::ostringstream phiICStrStr; phiICStrStr << (kPhi+5);
1700  const double anglePhiPlate = (kPhi+1)*M_PI/2. - M_PI/4.;
1701  double xLocalPlateOC = radLoc45DegOC*std::cos(anglePhiPlate);
1702  double yLocalPlateOC = radLoc45DegOC*std::sin(anglePhiPlate);
1703  G4ThreeVector posTmp1OC(xLocalPlateOC, yLocalPlateOC, zLocalCurrent);
1704  new G4PVPlacement(fRotHornBStrpLineConnFlatB[kPhi], posTmp1OC,
1705  aVol45DGL, aNStr45D + phiOCStrStr.str() + std::string("_P"),
1706  volMotherLoc , false, 1, true);
1707  double xLocalPlateIC = radLoc45DegIC*std::cos(anglePhiPlate);
1708  double yLocalPlateIC = radLoc45DegIC*std::sin(anglePhiPlate);
1709  G4ThreeVector posTmp1IC(xLocalPlateIC, yLocalPlateIC, zLocalCurrent);
1710  new G4PVPlacement(fRotHornBStrpLineConnFlatB[kPhi], posTmp1IC,
1711  aVol45DGL, aNStr45D + phiICStrStr.str() + std::string("_P"),
1712  volMotherLoc , false, 1, true);
1713  }
1714  //
1715  // We move further downstream. This time, we simplify quite a bit. The 45/2 bends that are up down
1716  // neglected, instead, we just extend the flat part of the strip at bit longer, such that the mount of material
1717  // is almost conserved. No rotation.. Note: we are moving further radially...
1718  //
1719  const double lengthLateral = 200.0*CLHEP::mm;
1720  const double widthLateral = 195*CLHEP::mm; //Approximate... Total length including arcs is ~242,
1721  // but some of it will go to the vertical
1722  const double widthTopConn = 98.43*CLHEP::mm;
1723  std::string aNStrLat(header); aNStrLat += std::string("Lat");
1724  G4Box* aVolLatG = new G4Box(aNStrLat, 0.5*widthLateral, 0.5*thickConnPlate, 0.5*lengthLateral);
1725  G4LogicalVolume *aVolLatGL = new G4LogicalVolume(aVolLatG, myAlum, aNStrLat);
1726  const double xLocalLatOC = 0.5*widthTopConn + 0.5*widthLateral;
1727  const double yLocalLatOC = 0.5*814. + 0.5*thickConnPlate;
1728  G4ThreeVector posLatOC(xLocalLatOC, yLocalLatOC, zLocalCurrent);
1729  new G4PVPlacement((G4RotationMatrix*) 0, posLatOC,
1730  aVolLatGL, aNStrLat + std::string("OCTopR_P"),
1731  volMotherLoc , false, 1, true);
1732  posLatOC[0] *= -1.;
1733  new G4PVPlacement((G4RotationMatrix*) 0, posLatOC,
1734  aVolLatGL, aNStrLat + std::string("OCTopL_P"),
1735  volMotherLoc , false, 2, true);
1736  posLatOC[1] *= -1.;
1737  posLatOC[0] *= -1.;
1738  new G4PVPlacement((G4RotationMatrix*) 0, posLatOC,
1739  aVolLatGL, aNStrLat + std::string("OCBotL_P"),
1740  volMotherLoc , false, 3, true);
1741  posLatOC[0] *= -1.;
1742  new G4PVPlacement((G4RotationMatrix*) 0, posLatOC,
1743  aVolLatGL, aNStrLat + std::string("OCBotR_P"),
1744  volMotherLoc , false, 4, true);
1745 
1746  const double xLocalLatIC = 22.2*CLHEP::mm + 0.5*widthLateral;
1747  const double yLocalLatIC = 0.5*770.5 + 0.5*thickConnPlate;
1748  G4ThreeVector posLatIC(xLocalLatIC, yLocalLatIC, zLocalCurrent);
1749  new G4PVPlacement((G4RotationMatrix*) 0, posLatIC,
1750  aVolLatGL, aNStrLat + std::string("ICTopR_P"),
1751  volMotherLoc , false, 5, true);
1752  posLatIC[0] *= -1.;
1753  new G4PVPlacement((G4RotationMatrix*) 0, posLatIC,
1754  aVolLatGL, aNStrLat + std::string("ICTopL_P"),
1755  volMotherLoc , false, 6, true);
1756 
1757  posLatIC[0] *= -1.;
1758  posLatIC[1] *= -1.;
1759  new G4PVPlacement((G4RotationMatrix*) 0, posLatIC,
1760  aVolLatGL, aNStrLat + std::string("ICBotR_P"),
1761  volMotherLoc , false, 7, true);
1762  posLatIC[0] *= -1.;
1763  new G4PVPlacement((G4RotationMatrix*) 0, posLatIC,
1764  aVolLatGL, aNStrLat + std::string("ICBotL_P"),
1765  volMotherLoc , false, 8, true);
1766  //
1767  // 8 vertical slabs. All same height.
1768  //
1769  const double heightLateral = 230.*CLHEP::mm; //Approximate... Include some of the length above and
1770  // and below the top/bottom connector plates.
1771  std::string aNStrVert(header); aNStrVert += std::string("Vert");
1772  G4Box* aVolVertG = new G4Box(aNStrVert, 0.5*thickConnPlate, 0.5*heightLateral, 0.5*lengthLateral);
1773  G4LogicalVolume *aVolVertGL = new G4LogicalVolume(aVolVertG, myAlum, aNStrVert);
1774  const double xLocalVertOC = 0.5*98.425*CLHEP::mm - 0.5*thickConnPlate;
1775  const double xLocalVertIC = 0.5*54.*CLHEP::mm - 0.5*thickConnPlate;
1776  const double yLocalVertAll = 0.5*1282 - 0.5*heightLateral + 10.0*CLHEP::mm; //literally cutting corners a bit.
1777  G4ThreeVector posVertOC(xLocalVertOC, yLocalVertAll, zLocalCurrent);
1778  new G4PVPlacement((G4RotationMatrix*) 0, posVertOC,
1779  aVolVertGL, aNStrVert + std::string("OCTopR_P"),
1780  volMotherLoc , false, 1, true);
1781  posVertOC[0] *= -1.0;
1782  new G4PVPlacement((G4RotationMatrix*) 0, posVertOC,
1783  aVolVertGL, aNStrVert + std::string("OCTopL_P"),
1784  volMotherLoc , false, 2, true);
1785  posVertOC[1] *= -1.0;
1786  posVertOC[0] *= -1.0;
1787  new G4PVPlacement((G4RotationMatrix*) 0, posVertOC,
1788  aVolVertGL, aNStrVert + std::string("OCBotR_P"),
1789  volMotherLoc , false, 3, true);
1790  posVertOC[0] *= -1.0;
1791  new G4PVPlacement((G4RotationMatrix*) 0, posVertOC,
1792  aVolVertGL, aNStrVert + std::string("OCBotL_P"),
1793  volMotherLoc , false, 4, true);
1794 
1795  G4ThreeVector posVertIC(xLocalVertIC, yLocalVertAll, zLocalCurrent);
1796  new G4PVPlacement((G4RotationMatrix*) 0, posVertIC,
1797  aVolVertGL, aNStrVert + std::string("ICTopR_P"),
1798  volMotherLoc , false, 5, true);
1799  posVertIC[0] *= -1.0;
1800  new G4PVPlacement((G4RotationMatrix*) 0, posVertIC,
1801  aVolVertGL, aNStrVert + std::string("ICTopL_P"),
1802  volMotherLoc , false, 6, true);
1803  posVertIC[1] *= -1.0;
1804  posVertIC[0] *= -1.0;
1805  new G4PVPlacement((G4RotationMatrix*) 0, posVertIC,
1806  aVolVertGL, aNStrVert + std::string("ICBotR_P"),
1807  volMotherLoc , false, 7, true);
1808  posVertIC[0] *= -1.0;
1809  new G4PVPlacement((G4RotationMatrix*) 0, posVertIC,
1810  aVolVertGL, aNStrVert + std::string("ICBotL_P"),
1811  volMotherLoc , false, 8, true);
1812  //
1813  // The jumper block
1814  //
1815  const double widthJumpBlck = 98.5*CLHEP::mm;
1816  const double heightJumpBlck = 145.0*CLHEP::mm;
1817  const double lengthJumpBlck = 20.0*CLHEP::mm;
1818  const double yLocJumpBlck = 0.5*1215.0 - 0.5*heightJumpBlck;
1819  std::string aNStrJmp(header); aNStrJmp += std::string("JmpB");
1820  G4Box* aVolJmpG = new G4Box(aNStrJmp, 0.5*widthJumpBlck, 0.5*heightJumpBlck, 0.5*lengthJumpBlck);
1821  G4LogicalVolume *aVolJmpGL = new G4LogicalVolume(aVolJmpG, myAlum, aNStrJmp);
1822  const double offZJmp = 0.5*lengthLateral + 0.5*lengthJumpBlck + 5.0*CLHEP::mm;
1823  G4ThreeVector posJmpTopFr(0., yLocJumpBlck, zLocalCurrent - offZJmp);
1824  new G4PVPlacement((G4RotationMatrix*) 0, posJmpTopFr,
1825  aVolJmpGL, aNStrJmp + std::string("TopFr"),
1826  volMotherLoc , false, 1, true);
1827  G4ThreeVector posJmpTopBck(0., yLocJumpBlck, zLocalCurrent + offZJmp);
1828  new G4PVPlacement((G4RotationMatrix*) 0, posJmpTopBck,
1829  aVolJmpGL, aNStrJmp + std::string("TopBck"),
1830  volMotherLoc , false, 1, true);
1831  G4ThreeVector posJmpBotFr(0., -1.0*yLocJumpBlck, zLocalCurrent - offZJmp);
1832  new G4PVPlacement((G4RotationMatrix*) 0, posJmpBotFr,
1833  aVolJmpGL, aNStrJmp + std::string("BotFr"),
1834  volMotherLoc , false, 1, true);
1835  G4ThreeVector posJmpBotBck(0., -1.0*yLocJumpBlck, zLocalCurrent + offZJmp);
1836  new G4PVPlacement((G4RotationMatrix*) 0, posJmpBotBck,
1837  aVolJmpGL, aNStrJmp + std::string("BotBck"),
1838  volMotherLoc , false, 1, true);
1839  //
1840  // good enough for now..
1841  //
1842 
1843  }
1844 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
std::vector< double > fParams
G4RotationMatrix * fRotHornBStrpLineRotY
QTextStream & endl(QTextStream &s)
G4RotationMatrix * fRotHornBStrpLineConnFlatB[4]
void LBNEVolumePlacements::PlaceFinalLBNFConceptStripLinesConnectHornC ( )

Definition at line 2829 of file LBNFConceptDesignHorns.cc.

2829  {
2830 
2831 
2832  std::string header("LBNFConceptHornCStrpL");
2833  const LBNEVolumePlacementData *plDatMotherTunnel = this->Find(header, "Tunnel",
2834  "LBNEVolumePlacements::PlaceFinalLBNFConceptStripLinesConnectHornC");
2835  const LBNEVolumePlacementData *plDatMotherHorn3 = this->Find(header, "LBNFSimpleHorn3Container",
2836  "LBNEVolumePlacements::PlaceFinalLBNFConceptHornB");
2837 
2838  const double lengthHornC = plDatMotherHorn3->fParams[2];
2839  const double lengthStripZoneEff = 376.75*CLHEP::mm ; // part F10071884
2840  const double zPosStripZone = plDatMotherHorn3->fPosition[2] - 0.5*lengthHornC
2841  - 0.5*lengthStripZoneEff - 5.0*CLHEP::mm; // Such that we can study
2842  // misalignments.
2843  const double halfWidthZone = 820.0; // 5 cm clearance.
2844  G4Material *myAlum = G4Material::GetMaterial("Aluminum");
2845  G4Material *myAir = G4Material::GetMaterial("Air");
2846  // A mother volume for convenience of top/down declaration of the geometry.
2847  // model dependent..
2848  std::string aNStrTmp1(header); aNStrTmp1 += std::string("Mother");
2849  G4Box* aVolM = new G4Box(aNStrTmp1, halfWidthZone, halfWidthZone, 0.5*lengthStripZoneEff);
2850  G4LogicalVolume *volMotherLoc = new G4LogicalVolume(aVolM, myAir, aNStrTmp1);
2851  G4ThreeVector posTmpM(0., 0., zPosStripZone); // ..
2852  G4LogicalVolume *volMother = plDatMotherTunnel->fCurrent;
2853  new G4PVPlacement((G4RotationMatrix *) 0, posTmpM, volMotherLoc, aNStrTmp1 + std::string("_P"),
2854  volMother, false, 1, true);
2855  //
2856  // Crude installation, 4 x 3 volumes in all.
2857  //
2858  const double stripThick = 9.5250*CLHEP::mm;
2859  const double stripWidth = 200.0*CLHEP::mm;
2860  const double stripConnBlock = 100.0*CLHEP::mm;
2861  const double radLoc45DegIOC = 800.50*CLHEP::mm; // Correct to a few mm.
2862 
2863  //
2864  // The connection block, approximated as just one thick piece of Al.
2865  // Assume the longitudinal gap between the strip line is zero.
2866  //
2867  std::string aNStr45D(header); aNStr45D += std::string("Conn45D");
2868  G4Box* aVol45DG = new G4Box(aNStr45D, 0.5*stripWidth, 0.5*stripConnBlock, 2.0*0.5*stripThick); // 2 of them
2869  G4LogicalVolume *aVol45DGL = new G4LogicalVolume(aVol45DG, myAlum, aNStr45D);
2870  const double zLocalCurrent = 0.5*lengthStripZoneEff - stripThick - 0.010*CLHEP::mm;
2871  //
2872  // The sections that are parallel to the Z axis., rotated by 45 degrees.
2873  //
2874  const double lengthLong45D = (345.0 - 0.5)*CLHEP::mm;
2875  std::string aNStrLongD(header); aNStrLongD += std::string("Long45D");
2876  G4Box* aVol45LG = new G4Box(aNStrLongD, 0.5*stripWidth, 2.0*0.5*stripThick*1.10, 0.5*lengthLong45D );
2877  // The exta 1.05 is to take into account the curve. Good to ~ 5 to 10 % in material budget.
2878  G4LogicalVolume *aVol45LGL = new G4LogicalVolume(aVol45LG, myAlum, aNStrLongD);
2879 
2880  const double radLoc45LongIOC = (811.50 - 170.)*CLHEP::mm; // Correct to a few cm.
2881  for (int kPhi=0; kPhi != 4; kPhi++) {
2882  std::ostringstream phiIOCStrStr; phiIOCStrStr << "phi" << kPhi;
2883  const double anglePhiPlate = (kPhi+1)*M_PI/2. - M_PI/4.;
2884  fRotHornBStrpLineConnFlatC[kPhi] = new G4RotationMatrix;
2885  fRotHornBStrpLineConnFlatC[kPhi]->rotateZ(anglePhiPlate);
2886  double xLocalPlateIOC = radLoc45DegIOC*std::cos(anglePhiPlate);
2887  double yLocalPlateIOC = radLoc45DegIOC*std::sin(anglePhiPlate);
2888  G4ThreeVector posTmp1IOC(xLocalPlateIOC, yLocalPlateIOC, zLocalCurrent);
2889  new G4PVPlacement(fRotHornBStrpLineConnFlatC[kPhi], posTmp1IOC,
2890  aVol45DGL, aNStr45D + phiIOCStrStr.str() + std::string("_P"),
2891  volMotherLoc , false, 1, true);
2892  double xLocalPlateIOL = radLoc45LongIOC*std::cos(anglePhiPlate);
2893  double yLocalPlateIOL = radLoc45LongIOC*std::sin(anglePhiPlate);
2894  G4ThreeVector posTmp1IOL(xLocalPlateIOL, yLocalPlateIOL, -0.5*lengthStripZoneEff + 0.5*lengthLong45D + 0.01*CLHEP::mm);
2895 // std::cerr << " Position of long plate " << posTmp1IOL << std::endl;
2896  new G4PVPlacement(fRotHornBStrpLineConnFlatC[kPhi], posTmp1IOL,
2897  aVol45LGL, aNStrLongD + phiIOCStrStr.str() + std::string("_P"),
2898  volMotherLoc , false, 1, true);
2899  }
2900  //
2901  // The 4 vertical segments, slight covering the Outer-Inner conductor region.
2902  // So we put it in.
2903  //
2904  const double heightVertStrip = 329.0*CLHEP::mm; // Good to 5 cm. Ugly Nx9 measurement.
2905  const double widthVertStrip = 2.0*stripThick;
2906  const double depthVertStrip = stripWidth;
2907  const double xLocVertStrip = 537.0*CLHEP::mm;
2908  const double yLocVertStrip = 0.5*heightVertStrip + 5.0*CLHEP::mm;
2909  std::string aNStrVert(header); aNStrVert += std::string("Vert");
2910  G4Box* aVolVertLG = new G4Box(aNStrVert, 0.5*widthVertStrip, 0.5*heightVertStrip, 0.5*depthVertStrip);
2911  // The exta 1.05 is to take into account the curve. Good to ~ 5 to 10 % in material budget.
2912  G4LogicalVolume *aVolVertLGL = new G4LogicalVolume(aVolVertLG, myAlum, aNStrVert);
2913  G4ThreeVector posTmpIOV(0., 0., -0.5*lengthStripZoneEff + 0.5*depthVertStrip + 0.1*CLHEP::mm);
2914  std::string posXYStr;
2915  for (int kS=0; kS != 4; kS++) {
2916  switch (kS) {
2917  case 0:
2918  posTmpIOV[0] = xLocVertStrip; posTmpIOV[1] = yLocVertStrip;
2919  posXYStr = std::string("UpLeft");
2920  break;
2921  case 1:
2922  posTmpIOV[0] = xLocVertStrip; posTmpIOV[1] = -1.*yLocVertStrip;
2923  posXYStr = std::string("DwnLeft");
2924  break;
2925  case 2:
2926  posTmpIOV[0] = -1.0*xLocVertStrip; posTmpIOV[1] = yLocVertStrip;
2927  posXYStr = std::string("UpRight");
2928  break;
2929  case 3:
2930  posTmpIOV[0] = -1.0*xLocVertStrip; posTmpIOV[1] = -1.*yLocVertStrip;
2931  posXYStr = std::string("DwnRight");
2932  break;
2933  }
2934  new G4PVPlacement((G4RotationMatrix *) 0, posTmpIOV, aVolVertLGL,
2935  aNStrVert + posXYStr + std::string("_P"),
2936  volMotherLoc, false, 1, true);
2937  }
2938  //
2939  // Lastly, the horizontal segment and their support. Rough guess!.
2940  // Note that this volume will be located at radius greater than the outer Inner conductor region, mostly.
2941  // Very crude dimension. Could be reviewed at a later stage.
2942  //
2943  const double heightHorzStrip = 1.05*(5.0*stripThick); // 5% more the connector plates.
2944  // in front.
2945  const double widthHorzStrip = 162.0;
2946  const double depthHorzStrip = stripWidth*CLHEP::mm;
2947  const double xLocHorzStrip = 678.*CLHEP::mm; // also aproximate.
2948  std::string aNStrHorz(header); aNStrHorz += std::string("Horz");
2949  G4Box* aVolHorzLG = new G4Box(aNStrHorz, 0.5*widthHorzStrip, 0.5*heightHorzStrip, 0.5*depthHorzStrip);
2950  // The exta 1.05 is to take into account the curve. Good to ~ 5 to 10 % in material budget.
2951  G4LogicalVolume *aVolHorzLGL = new G4LogicalVolume(aVolHorzLG, myAlum, aNStrHorz);
2952  G4ThreeVector posTmpIOH(0., 0., -0.5*lengthStripZoneEff + 0.5*depthHorzStrip + 0.1*CLHEP::mm);
2953  for (int kS=0; kS != 2; kS++) {
2954  switch (kS) {
2955  case 0:
2956  posTmpIOH[0] = xLocHorzStrip;
2957  posXYStr = std::string("Left");
2958  break;
2959  case 1:
2960  posTmpIOH[0] = -1.0*xLocHorzStrip;
2961  posXYStr = std::string("Right");
2962  break;
2963  }
2964  new G4PVPlacement((G4RotationMatrix *) 0, posTmpIOH, aVolHorzLGL,
2965  aNStrHorz + posXYStr + std::string("_P"),
2966  volMotherLoc, false, 1, true);
2967  }
2968 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
std::vector< double > fParams
G4RotationMatrix * fRotHornBStrpLineConnFlatC[4]
void LBNEVolumePlacements::PlaceFinalLBNFConceptTgtSupport ( )

Definition at line 495 of file LBNFConceptDesignHorns.cc.

495  {
496 
497  if (!fInstallDownstTargetSupport) return;
498  if (fUse1p2MWSmallTgt) return; // In case we want to go back the target with small cooling pipe.
499  std::cerr << " LBNEVolumePlacements::PlaceFinalLBNFConceptTgtSupport " <<std::endl;
500  const LBNEVolumePlacementData *plDatMother = this->Find(G4String("LBNFConceptTgtSupport"),
501  "TargetHallAndHorn1",
502  "LBNEVolumePlacements::PlaceFinalLBNFConceptTgtSupport");
503  G4LogicalVolume *volMother = plDatMother->fCurrent;
504 //
505 // For now, only the 4 Titanium tubes brining cooled Helium.
506 //
507  const double lengthTitCTube = 275.0*CLHEP::mm;
508  const double outerRadiusTitCTube = 5.0*CLHEP::mm;
509  const double innerRadiusTitCTube = outerRadiusTitCTube - 0.5*CLHEP::mm;
510  fRotTgtTitCTubeVert.rotateX(M_PI/2.);
511  fRotTgtTitCTubeHor.rotateY(M_PI/2.);
512  // to get the spring to touch the end of the old (not yet adapted to this conceptual design) NuMI target.
513 // G4Material *myAlum = G4Material::GetMaterial("Aluminum");
514  G4Material *myTitanium = G4Material::GetMaterial("Titanium");
515 
516  std::string aNStrExtTubeTmp = std::string("LBNFConceptHornATgtSupTitCTube");
517  G4Tubs* aVolTgtSup1 = new G4Tubs(aNStrExtTubeTmp, innerRadiusTitCTube, outerRadiusTitCTube,
518  0.5*lengthTitCTube, 0.0, 360.0*CLHEP::degree);
519  G4LogicalVolume *aVolTgtSup1L = new G4LogicalVolume(aVolTgtSup1, myTitanium, aNStrExtTubeTmp);
520 
521  const LBNEVolumePlacementData *plDatMotherHorn = this->Find(G4String("LBNFConceptHornATgtSupport"), "Horn1PolyM1",
522  "LBNEVolumePlacements::PlaceFinalLBNFConceptHornA");
523  const double lengthHornTotal = plDatMotherHorn->fParams[2];
524  const double zPosTitCTube = lengthHornTotal + 0.1*CLHEP::mm - 360.0*CLHEP::mm;
525  // to be adjusted...Done with Geantino,
526  const double radTitCTubeCenter = 50.0*CLHEP::mm + 0.5*lengthTitCTube+0.25*CLHEP::mm;
527 
528  G4ThreeVector posTitCTubeTop(0., radTitCTubeCenter , zPosTitCTube);
529  new G4PVPlacement(&fRotTgtTitCTubeVert, posTitCTubeTop, aVolTgtSup1L, aNStrExtTubeTmp + std::string("_PTop"),
530  volMother, false, 1, true);
531 
532  G4ThreeVector posTitCTubeBottom(0., -radTitCTubeCenter , zPosTitCTube);
533  new G4PVPlacement(&fRotTgtTitCTubeVert, posTitCTubeBottom, aVolTgtSup1L, aNStrExtTubeTmp + std::string("_PBot"),
534  volMother, false, 1, true);
535 
536  G4ThreeVector posTitCTubeLeft(-radTitCTubeCenter , 0., zPosTitCTube);
537  new G4PVPlacement(&fRotTgtTitCTubeHor, posTitCTubeLeft, aVolTgtSup1L, aNStrExtTubeTmp + std::string("_PLeft"),
538  volMother, false, 1, true);
539 
540  G4ThreeVector posTitCTubeRight(radTitCTubeCenter, 0. , zPosTitCTube);
541  new G4PVPlacement(&fRotTgtTitCTubeHor, posTitCTubeRight, aVolTgtSup1L, aNStrExtTubeTmp + std::string("_PRight"),
542  volMother, false, 1, true);
543 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
std::vector< double > fParams
G4RotationMatrix fRotTgtTitCTubeHor
G4RotationMatrix fRotTgtTitCTubeVert
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceFinalMultiSphereTarget ( LBNEVolumePlacementData plHelium,
G4PVPlacement *  mother 
)

Definition at line 1055 of file LBNEVolumePlacementsAdd.cc.

1055  {
1056 //Quynh. real target . (8)
1057  LBNEVolumePlacementData* plInfo = this->Create(G4String("TargetMultiSphere"));
1058  G4ThreeVector posTmp;
1059 // const double zCoordTmp = -1.0*fParams[2]/2.+(fParams[2]-fTargetLengthOutsideHorn)+(fMultiSphereTargetRadius+0.005*CLHEP::mm);//Quynh.. the container is longer than target and need to be fixed. not sure how
1060  const double zCoordTmp = -plHelium->fParams[2]/2. + fMultiSphereTargetRadius + 0.005*CLHEP::mm ; // Simplify... P.L.
1061  posTmp[0] = 0.; posTmp[1] = 0.;
1062  for (int iSphere=0; iSphere !=fTargetNumSphere; iSphere++) {
1063  posTmp[2] = zCoordTmp + iSphere*(fMultiSphereTargetRadius*2+0.005*CLHEP::mm);
1064  std::ostringstream cNumStrStr; cNumStrStr << iSphere;
1065  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, plInfo->fCurrent,
1066  (G4String("TargetUsptreamMultiSphere_P") + cNumStrStr.str()),
1067  mother->GetLogicalVolume(), false, iSphere, fCheckVolumeOverLapWC); //copy Number = iSphere
1068 // std::cout<<"sphere: "<< iSphere<< std::endl;
1069  }
1070 
1071 }
std::vector< double > fParams
LBNEVolumePlacementData * Create(const G4String &name)
void LBNEVolumePlacements::PlaceFinalNoSplitHorn1 ( G4PVPlacement *  mother,
G4PVPlacement *  motherTop 
)

Definition at line 1072 of file LBNEVolumePlacementsAdd.cc.

1072  {
1073 
1074  std::cerr << " Entering LBNEVolumePlacements::PlaceFinalNoSplitHorn1, mother name " <<
1075  mother->GetLogicalVolume()->GetName() << std::endl;
1076 //
1077  if (fHorn1RadiusBigEnough) {
1078  std::cerr << " Obsolete data card /LBNE/det/TargetAndHorn1RadiusBigEnough used, quit here for good ! " << std::endl;
1079  G4Exception("LBNEVolumePlacements::PlaceFinalNoSplitHorn1", "InvalidSetup", FatalErrorInArgument, "Wrong data card");
1080  }
1081  const bool doCheckOverlapNoG4ConsBug = false; // in v4.9.6., this check is worthless.
1082 // const bool doCheckOverlapNoG4ConsBug = true;
1083  // in v4.9.6., bug corrected by Tatiana, Sept. 3 2014, if G4Cons source file added to this directory..
1084 
1085  //
1086  // New Plug Code. Based on what John LoSecco did. Adapted for the new geometry, August 31 2014.
1087  //
1089  G4ThreeVector posTmp; posTmp[0] =0.; posTmp[1] =0.;
1090  G4Tubs* plugTube = new G4Tubs("Plug", fPlugInnerRadius, fPlugOuterRadius, fPlugLength*.5, 0., 360.*CLHEP::deg);
1091  G4LogicalVolume *plugl = new G4LogicalVolume(plugTube, G4Material::GetMaterial(fPlugMaterial.c_str()), "PlugInHorn1");
1092  const LBNEVolumePlacementData *plMotherTop = Find(G4String("pluggingHorn1"), "TargetHallAndHorn1", G4String("Create"));
1093  const double posHorn1 = plMotherTop->fPosition[2]; // With respect to Z = 0 (MCZERO, drawing 36309x)
1094  posTmp[2] = -1.0*posHorn1 + fPlugZPosition;
1095  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, plugl, "PlugInHorn1_P",
1096  motherTop->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1097  }
1099  std::cerr << "LBNEVolumePlacements::PlaceFinalNoSplitHorn1, calling for Simple Horn PolyNumber 1 " << std::endl;
1100  PlaceFinalSimpleHornPolyNumber(0, mother);
1101  return;
1102  }
1103 //
1104 // Start with upstream Inner to Out transition.
1105 //
1106 {
1107  G4String nameHorn1IO("UpstrHorn1TransInnerOuter");
1108  G4String nameHorn1IOCont(nameHorn1IO + G4String("Cont"));
1109  Create(nameHorn1IOCont);
1110  G4PVPlacement *vHorn1IOCont = PlaceFinal(nameHorn1IOCont, mother);
1111  for (size_t iPartIO = 0; iPartIO != fTargetHorn1InnerRadsUpstr.size(); iPartIO++) {
1112  std::ostringstream nameStrStr; nameStrStr << nameHorn1IO << "Part" << iPartIO;
1113  G4String nameStr(nameStrStr.str());
1114  Create(nameStr);
1115  PlaceFinal(nameStr, vHorn1IOCont);
1116  }
1117  }
1118  const double in = 2.54*CLHEP::cm;
1119 // const double innerConductThicknessNeck = 4.0*CLHEP::mm; // only relevant if fHorn1RadiusBigEnough is true.
1120 // const double fHorn1RMinAllBG = fTargetHeContTubeInnerRadius + fTargetHeContTubeThickness + 1.25*CLHEP::mm; // Only 250 micron tolerance.
1121 //
1122 // std::cerr << " Start testing PlaceFinalHorn1, mother Logical volume name " << mother->GetLogicalVolume()->GetName() << std::endl;
1123  if ((std::abs(fHorn1LongRescale - 1.0) < 1.0e-5) && (std::abs(fHorn1RadialRescale - 1.0) < 1.0e-5))
1124  fHorn1Equations[0].test1(); // this supposed to work. But not if we rescale the Horn1,
1125  // since we compare with hardtyped data extracted from a blue print
1126 // std::cerr << " Test 1 passed " << std::endl;
1127 // fHorn1Equations[3].test1(); // This supposed to fail...
1128  LBNEVolumePlacementData *plTrUpst = this->Create("Horn1IOTransCont");
1129  G4PVPlacement *vTrUpst = this->PlaceFinal("Horn1IOTransCont", mother); //August 21, check longitudinal offsets here...
1130  //
1131  // These sub-volumes will be never misaligned with respect to each other, or the container volume
1132  // above. So skip the VolumePlacement utilities. Code bloat here instead in the Create method.. Oh well..
1133  //
1134  for (size_t k=0; k!=fHorn1UpstrLengths.size(); k++) {
1135  std::ostringstream nameStrStr; nameStrStr << "Horn1IOTransInnerPart" << k;
1136  G4String nameStr(nameStrStr.str());
1137  fHorn1IC.push_back(nameStr);
1138 
1139  G4Cons *aCons = new G4Cons(nameStr, fHorn1UpstrInnerRadsUpstr[k],fHorn1UpstrInnerRadsOuterUpstr[k],
1141  fHorn1UpstrLengths[k]/2., 0., 360.0*CLHEP::deg);
1142  G4LogicalVolume *pCurrent = new G4LogicalVolume(aCons, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1143  G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1144  posTmp[2] = -1.0*(plTrUpst->fParams[2])/2. + fHorn1UpstrZPositions[k];
1145  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1146  vTrUpst->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1147 // const G4PVPlacement *plHorn1IO = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1148 // vTrUpst->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1149 // Debugging misshaped volume, Oct 28 2013.
1150 // if (k == 3) {
1151 // this->CheckOverlaps(plHorn1IO, 10000, 1.0e-5, true);
1152 // std::cerr << " Placing IOTrans Sub elem " << k << " at z = " << fHorn1UpstrZPositions[k] << " (abs), rel " <<
1153 // posTmp[2] << " length " << fHorn1UpstrLengths[k] << std::endl;
1154 // std::cerr << " RIUps " << fHorn1UpstrInnerRadsUpstr[k] << " ROUps " << fHorn1UpstrInnerRadsOuterUpstr[k];
1155 // std::cerr << " RIDwn " << fHorn1UpstrInnerRadsDownstr[k] << " RODwn " << fHorn1UpstrInnerRadsOuterDownstr[k] << std::endl;
1156 // }
1157  }
1158 
1159  for (size_t k=0; k!= fHorn1UpstrOuterIOTransInnerRads.size(); k++) {
1160  std::ostringstream nameStrStr; nameStrStr << "Horn1IOTransOuterPart" << k;
1161  G4String nameStr(nameStrStr.str());
1162  G4Tubs *aTubs = new G4Tubs(nameStr, fHorn1UpstrOuterIOTransInnerRads[k],
1164  fHorn1UpstrOuterIOTransLengths[k]/2., 0., 360.0*CLHEP::deg);
1165  G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1166  posTmp[2] = -1.0*(plTrUpst->fParams[2])/2. + fHorn1UpstrOuterIOTransPositions[k];
1167  G4LogicalVolume *pCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(fHorn1AllCondMat), nameStr);
1168  new G4PVPlacement( (G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1169  vTrUpst->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1170  }
1171  //
1172  // We place more volumes in the mother volume
1173  //
1174  G4PVPlacement *vUpst = mother;
1175  const LBNEVolumePlacementData *plHUpst = Find(G4String("InnerConductors"), "Horn1PolyM1", G4String("Create"));
1176 
1177 // Start by checking possible radial overlap at the downstream end of the target.
1178 // The size and position of Horn1TopLevelUpstr and Horn1TargetDownstrHeContainer
1179 
1180  fZHorn1ACRNT1Shift = 3.316*in*fHorn1LongRescale; // Drawing 8875.112-MD-363097
1181  // Correct here for the new dimension of the "No split" mother volume.
1182 
1184 
1185  const double z21p088 = fHorn1LongRescale*21.088*in; //Equation change.
1186  const double zOffsetDrawingUpstrEdge = 5.752*in*fHorn1LongRescale; // On the inner conductor, excluding I/O trans. Drawing 363097
1187 
1188  double lengthInnerConductUpstr = z21p088 - (3.316*in*fHorn1LongRescale) - 0.010*CLHEP::mm; // Up to Z = 21.088, Drawing coordinate system.
1189 
1190  int numSubSect = GetNumberOfInnerHornSubSections(0, 0., lengthInnerConductUpstr, 10);
1191  // Fill with it one or more inner conductor conical section
1192  // We require a precision of 5 microns in the radius.
1193  double deltaZ = lengthInnerConductUpstr/numSubSect;
1194  for (int iSub=0; iSub != numSubSect; iSub++) {
1195  //
1196  const double zzBegin = fZHorn1ACRNT1Shift + (iSub*deltaZ); // from the
1197  const double zzEnd = zzBegin + deltaZ;
1198  std::ostringstream nameStrStr; nameStrStr << "Horn1UpstrSubSect" << iSub;
1199  G4String nameStr(nameStrStr.str());
1200  fHorn1IC.push_back(nameStr);
1201 // Smooth transition between equation 1 and 2
1202  const double rMin1Eqn1 = fHorn1Equations[0].GetVal(zzBegin); // Equation 1 or 0
1203  const double rMin2Eqn1 = fHorn1Equations[0].GetVal(zzEnd);
1204  const double rMin1Eqn2 = fHorn1Equations[1].GetVal(zzBegin); // Equation 1 or 0
1205  const double rMin2Eqn2 = fHorn1Equations[1].GetVal(zzEnd);
1206  const double ratio10vs1 = std::min(1.0, (zzBegin/(21.0888*in*fHorn1LongRescale)));
1207  double rMin1 = rMin1Eqn2*ratio10vs1 + (1.0-ratio10vs1)*rMin1Eqn1;
1208  const double ratio20vs1 = std::min(1.0, (zzEnd/(21.0888*in*fHorn1LongRescale)));
1209  double rMin2 = rMin2Eqn2*ratio20vs1 + (1.0-ratio20vs1)*rMin2Eqn1;
1210  double rMax1 = fHorn1Equations[5].GetVal(zzBegin) + fWaterLayerThickInHorns + 0.0025*CLHEP::mm;
1211  // Equation 6 (Drawing 8875.112-MD 363104)
1212  double rMax2 = fHorn1Equations[5].GetVal(zzEnd) + fWaterLayerThickInHorns + 0.0025*CLHEP::mm;
1213  std::cerr << " Inner radius for section " << nameStr << " At zzBegin " << zzBegin << " to " << zzEnd
1214  << " rMin1 " << rMin1 << " rMin2 " << rMin2
1215  << " rMax1 " << rMax1 << " rMax2 " << rMax2 << std::endl;
1216  G4Cons *aCons = new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1217  (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1218  G4LogicalVolume *pCurrent = new G4LogicalVolume(aCons, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1219  G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1220  // plHUpst constain part of the Inner Outer Transition. Shift downtream by it's length
1221  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zOffsetDrawingUpstrEdge + deltaZ/2. + iSub*deltaZ + 0.055*CLHEP::mm;
1222  std::cerr << " Placing section " << nameStr << " at z = " << posTmp[2] << std::endl;
1223  std::cerr << " Beginning of the volume with respect to upstre edge "
1224  << posTmp[2] + plHUpst->fParams[2]/2 - deltaZ/2. << " downstrEdge " <<
1225  posTmp[2] + plHUpst->fParams[2]/2 + deltaZ/2. << std::endl;
1226 // Shift in Z until no clash?????
1227 // posTmp[2] += 30*CLHEP::mm;
1228 // Unresolved clash here!!!
1229 //
1230  G4PVPlacement *vSub = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1231  vUpst->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1232 
1233  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1234  nameStrStr.str(""); nameStrStr.clear(); nameStrStr << "Horn1UpstrSubSect" << iSub << "Water";
1235  nameStr = nameStrStr.str();
1236  fHorn1IC.push_back(nameStr);
1237  G4Cons *aConsW = new G4Cons(nameStr, rMax1 - fWaterLayerThickInHorns, rMax1-0.001*CLHEP::mm,
1238  rMax2 - fWaterLayerThickInHorns, rMax2-0.001*CLHEP::mm,
1239  (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1240  G4LogicalVolume *pCurrentW = new G4LogicalVolume(aConsW, G4Material::GetMaterial(std::string("Water")), nameStr);
1241  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1242  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW, nameStr + std::string("_P"),
1243  vSub->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1244  }
1245  }
1246  // on the number of subsections for the inner conductor, for the upstream part of Horn1
1247  // Now add the welding joint between the most upstream part of the inner conductor and the Inner Outer transition section
1248  // Drawing Drawing 8875.112-MD 363104
1249  {
1250  G4String nameStr("Horn1UpstrSubSect0WeldUpstr");
1251  const double length = 12.0*CLHEP::mm; // Make it a bit shorter, it is rounded...
1252  double rTmp1 = fHorn1Equations[5].GetVal(3.2645*in)
1253  + 0.02*CLHEP::mm + fWaterLayerThickInHorns;
1254 
1255  // place it a little more detached..Also, the weld is on top of the layer of water.. Oh well..
1256  const double rTmp2 = rTmp1 + 1.8*CLHEP::mm; //
1257  G4Tubs *aTubs = new G4Tubs(nameStr, rTmp1, rTmp2,
1258  length/2. , 0., 360.0*CLHEP::deg);
1259  G4LogicalVolume *pCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1260  G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1261  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zOffsetDrawingUpstrEdge + length/2. + 1.0*CLHEP::mm; // extra space..
1262 
1263  std::cerr << " Placing section " << nameStr << " at z = " << posTmp[2] << " radii "
1264  << rTmp1 << " , " << rTmp2 << " length " << length << std::endl;
1265  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1266  vUpst->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1267 
1268  }
1269  // Now place the first support ring, and the spider hang
1270  const double lengthHangerRing = fHorn1LongRescale*0.750*in;
1271  std::cerr << " First Spider Hanger is in Horn1Upstr section " << std::endl;
1272 
1273  G4String nameStrFirstHanger("Horn1UpstrSpiderHanger");
1274  const double zPosCenterMotherVolume = -1.0*(plHUpst->fParams[2])/2. + 2.436*in + 0.5*CLHEP::mm +
1275  19.347*in*fHorn1LongRescale + lengthHangerRing/2. ; // Drawing 363093 and 363097
1276  const double zPosUpstrDrawingCoord = 19.347*in*fHorn1LongRescale;
1277 
1278  this->Horn1InstallSpiderHanger(nameStrFirstHanger, zPosUpstrDrawingCoord,
1279  zPosCenterMotherVolume, vUpst );
1280  // Outer tube
1281  const double zShiftDrawingDownstr = 2.436*in*fHorn1LongRescale;
1282  // from now, a better orgin is the upstram point on mother Horn1PolyM1
1283 
1284  G4String nameStr("Horn1OutrTube");
1285  const double lengthOutT = (127.550 - 1.510)*in*fHorn1LongRescale - 1.0*CLHEP::mm;
1286  // displace 100 microns to avoid clash with spider hanger.
1287  G4Tubs *aTubs = new G4Tubs(nameStr, fHorn1OuterTubeInnerRad + 0.1*CLHEP::mm,
1288  fHorn1OuterTubeOuterRad + 0.1*CLHEP::mm, lengthOutT/2. , 0., 360.0*CLHEP::deg);
1289  G4LogicalVolume *pCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(fHorn1AllCondMat), nameStr);
1290  G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.;
1291  const double zOffOut = 3.316*in*fHorn1LongRescale;
1292  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zShiftDrawingDownstr + zOffOut + lengthOutT/2. + 0.25*CLHEP::mm;
1293  std::cerr << " Installing Outer tube sptream at " << posTmp[2] << " lengthOutT " << lengthOutT << std::endl;
1294  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStr + std::string("_P"),
1295  vUpst->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1296 
1297  // Outer Tube Upstream flange. See drawing 363094
1298  G4String nameStrOutFlUpstr("Horn1UpstrOutrTubeFlange");
1299  const double lengthOutFlUpstr = 1.0*in*fHorn1LongRescale; //Not cleanly shown on drawing 363094
1300  const double rTmpOutFlUpstrInner = fHorn1OuterTubeOuterRad + 0.1*CLHEP::mm;
1301  const double rTmpOutFlUpstrOuter = rTmpOutFlUpstrInner + 2.5*in*fHorn1RadialRescale; // Still a guess.. Probably a bit oversized.
1302  aTubs = new G4Tubs(nameStrOutFlUpstr, rTmpOutFlUpstrInner, rTmpOutFlUpstrOuter, lengthOutFlUpstr/2.0, 0., 360.0*CLHEP::deg);
1303  pCurrent = new G4LogicalVolume(aTubs, G4Material::GetMaterial(fHorn1AllCondMat), nameStrOutFlUpstr);
1304  posTmp[0] = 0.; posTmp[1] = 0.;
1305  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zShiftDrawingDownstr + zOffOut + lengthOutFlUpstr + 0.055*CLHEP::mm;
1306  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrent, nameStrOutFlUpstr + std::string("_P"),
1307  vUpst->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1308  //
1309 
1310  double lengthToTheNeck = (30.3150 - 21.088)*in*fHorn1LongRescale; // Drawing 363105
1311 
1312  // Downstream of the neck, we install everything in Horn1PolyM1.. Simpler..
1313 
1314  // Let us call this the mid-section.. Historical notation.. It will install in the upstream section..
1315  //
1316  // Install the length of inner conductor, from downstream end of the target to Zdrawing 21.0888 inches
1317  //
1318 // std::cerr << " ... Length to the neck " << lengthToTheNeck << std::endl;
1319  {
1320  numSubSect = 4;
1321  deltaZ = lengthToTheNeck/numSubSect;
1322  const double zOffStart = 21.088*in*fHorn1LongRescale + 0.025*CLHEP::mm;
1323 // std::cerr << " ...... delta z to 21.0888 " << deltaZ << std::endl;
1324  for (int iSub = 0; iSub != numSubSect; iSub++) {
1325  const double zzBegin = z21p088 + iSub*deltaZ;
1326  const double zzEnd = zzBegin + deltaZ;
1327  std::ostringstream nameStrStr; nameStrStr << "Horn1ToNeckPartM0SubSect" << iSub;
1328  nameStr = nameStrStr.str();
1329  const double rMin1Eqn1 = fHorn1Equations[0].GetVal(zzBegin); // Equation 1 or 0
1330  const double rMin2Eqn1 = fHorn1Equations[0].GetVal(zzEnd);
1331  const double rMin1Eqn2 = fHorn1Equations[1].GetVal(zzBegin); // Equation 1 or 0
1332  const double rMin2Eqn2 = fHorn1Equations[1].GetVal(zzEnd);
1333  const double rMin1 = ((numSubSect - iSub -1)*rMin1Eqn1 + ((iSub+1)*rMin1Eqn2))/numSubSect;
1334  const double rMin2 = ((numSubSect - iSub -1)*rMin2Eqn1 + ((iSub+1)*rMin2Eqn2))/numSubSect;
1335  const double rMax1 = fHorn1Equations[5].GetVal(zzBegin) + fWaterLayerThickInHorns + 0.0025;
1336  // Equation 6 (Drawing 8875.112-MD 363104)
1337  const double rMax2 = fHorn1Equations[5].GetVal(zzEnd) + fWaterLayerThickInHorns + 0.0025;
1338  const double lengthTmp = deltaZ - 0.050*CLHEP::mm;
1339  G4Cons *aCons = new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2, lengthTmp/2., 0., 360.0*CLHEP::deg);
1340  G4LogicalVolume *pCurrentSu = new G4LogicalVolume(aCons, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1341  posTmp[0] = 0.; posTmp[1] = 0.;
1342  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zShiftDrawingDownstr + zOffStart + deltaZ/2. + iSub*deltaZ;
1343  std::cerr << " Installing mid section Horn1, length " << lengthTmp << " at Z = " << posTmp[2]
1344  << " Rads " << rMin1 << " , " << rMin2 << " max " << rMax1 << " " << rMax2 << std::endl;
1345  G4PVPlacement *vSub = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentSu, nameStr + std::string("_P"),
1346  vUpst->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1347 
1348  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1349  nameStrStr.str(""); nameStrStr.clear(); nameStrStr << "Horn1ToNeckPartM0SubSect" << iSub << "Water";
1350  nameStr=nameStrStr.str();
1351  G4Cons *aConsW = new G4Cons(nameStr, rMax1 - fWaterLayerThickInHorns, rMax1-0.001*CLHEP::mm,
1352  rMax2 - fWaterLayerThickInHorns, rMax2-0.001*CLHEP::mm,
1353  (lengthTmp - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1354  G4LogicalVolume *pCurrentW = new G4LogicalVolume(aConsW, G4Material::GetMaterial(std::string("Water")), nameStr);
1355  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1356  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW, nameStr + std::string("_P"),
1357  vSub->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1358  }
1359  } // of the number of subsections in the upstream part of the neck region (zDrawing = 21.0888 inches)
1360  }
1361  // The first weld for this section.
1362  {
1363  nameStr = std::string("Horn1UpstrSubSect1Weld0");
1364  posTmp[0] = 0.; posTmp[1] = 0.;
1365  double length = 24.0*CLHEP::mm; //Cover two real sections...
1366  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + z21p088 + length/2 + zShiftDrawingDownstr; // with respecto the upstr edge of Horn1TopLevelDownstr
1367  double rTmp1 = fHorn1Equations[5].GetVal(z21p088 - length - 1.0*CLHEP::mm)
1368  + 0.015*CLHEP::mm + fWaterLayerThickInHorns;
1369  // place it a little more detached..The radius is estimated on the upstream side, biggest radius.
1370  double rTmp2 = rTmp1 + 1.8*CLHEP::mm; //
1371  G4Tubs *aTubsW = new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::deg);
1372  std::cerr << " Installing the weld " << nameStr << " at Z " << posTmp[2] << std::endl;
1373  G4LogicalVolume *pCurrentW = new G4LogicalVolume(aTubsW, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1374  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW, nameStr + std::string("_P"),
1375  vUpst->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1376  }
1377  //
1378  // Now the dowstream section. We no longer create the mother volume for it. We will install it directly in
1379  // Horn1PolyM1.
1380  //
1381  //
1382  //
1383  // Now, the neck. Just a tube
1384  //
1385  {
1386  nameStr = G4String("Horn1Neck");
1387  fHorn1IC.push_back(nameStr);
1388  const double zNeckDrawing = fHorn1LongRescale*(30.3150)*in; //start of the neck..
1389  double rTmp1 = fHorn1RadialRescale*(0.709*in/2.); // Drawing 8875.112-MD 363105
1390  double rTmp2 = fHorn1RadialRescale*(1.063*in/2.) + fWaterLayerThickInHorns + 0.025*CLHEP::mm;
1391  // Drawing 8875.112-MD 363105
1392  fHorn1NeckInnerRadius = rTmp1; // For use in computing the magnetic field
1393 // fHorn1NeckOuterRadius = rTmp2; // For use in computing the magnetic field
1394 // Bug fix, September 2014 : there are no skin depth effect in water!...
1395  fHorn1NeckOuterRadius = rTmp2 - fWaterLayerThickInHorns - 0.025*CLHEP::mm; // For use in computing the magnetic field
1396  const double length = fHorn1LongRescale*1.5680*in - 0.050*CLHEP::mm; // last term to absord
1397  // small shifts in the upstream part..
1398  G4Tubs *aTubsNe1 = new G4Tubs(nameStr, rTmp1, rTmp2,
1399  length/2. , 0., 360.0*CLHEP::deg);
1400  G4LogicalVolume *pCurrentNe1 = new G4LogicalVolume(aTubsNe1, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1401  posTmp[0] = 0.; posTmp[1] = 0.;
1402  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zNeckDrawing + zShiftDrawingDownstr + length/2. + 0.025*CLHEP::mm;
1403 
1404  G4PVPlacement* vSub = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentNe1, nameStr + std::string("_P"),
1405  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1406  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1407  G4String nameStrW(nameStr); nameStrW += G4String("Water");
1408  G4Tubs *aTubsW = new G4Tubs(nameStrW, rTmp2-fWaterLayerThickInHorns-0.012*CLHEP::mm, rTmp2-0.012*CLHEP::mm,
1409  length/2. , 0., 360.0*CLHEP::deg);
1410  G4LogicalVolume *pCurrentW = new G4LogicalVolume(aTubsW,
1411  G4Material::GetMaterial(std::string("Water")), nameStrW);
1412  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1413  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentW, nameStrW + std::string("_P"),
1414  vSub->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1415  }
1416  }
1417  // The downstream part of the real section that has the neck.
1418  {
1419  const double zStartDrawing = fHorn1LongRescale*31.8827*in;
1420  const double zEndDrawing = fHorn1LongRescale*(41.0776)*in;
1421  fHorn1ZDEndNeckRegion = zEndDrawing;
1422  numSubSect = GetNumberOfInnerHornSubSections(3, zStartDrawing,
1423  zEndDrawing, 10); // These Z position are from the start of the inner conductor.
1424  deltaZ = (zEndDrawing - zStartDrawing)/numSubSect;
1425  for (int iSub = 0; iSub != numSubSect; iSub++) {
1426  const double zzBegin = zStartDrawing + iSub*deltaZ;
1427  const double zzEnd = zzBegin + deltaZ;
1428  std::ostringstream nameStrStr; nameStrStr << "Horn1DownstrPart1SubSect" << iSub;
1429  nameStr = nameStrStr.str();
1430  fHorn1IC.push_back(nameStr);
1431  double rMin1 = fHorn1Equations[3].GetVal(zzBegin);
1432  double rMin2 = fHorn1Equations[3].GetVal(zzEnd);
1433  double rMax1 = fHorn1Equations[7].GetVal(zzBegin) + fWaterLayerThickInHorns + 0.0025;
1434  // Equation 6 (Drawing 8875.112-MD 363104)
1435  double rMax2 = fHorn1Equations[7].GetVal(zzEnd) + fWaterLayerThickInHorns + 0.0025;
1436  G4Cons *aConsSuU = new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1437  (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1438  G4LogicalVolume *pCurrentSuU = new G4LogicalVolume(aConsSuU, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1439  posTmp[0] = 0.; posTmp[1] = 0.;
1440  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zzBegin + zShiftDrawingDownstr + deltaZ/2.;
1441  G4PVPlacement *vSub = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentSuU, nameStr + std::string("_P"),
1442  mother->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1443 
1444  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1445  nameStrStr.str(""); nameStrStr.clear(); nameStrStr << "Horn1DownstrPart1SubSect" << iSub << "Water";
1446  nameStr = nameStrStr.str();
1447  G4Cons *aConsWa = new G4Cons(nameStr, rMax1 - fWaterLayerThickInHorns, rMax1-0.001*CLHEP::mm,
1448  rMax2 - fWaterLayerThickInHorns, rMax2-0.001*CLHEP::mm,
1449  (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1450  G4LogicalVolume *pCurrentWa = new G4LogicalVolume(aConsWa, G4Material::GetMaterial(std::string("Water")), nameStr);
1451  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1452  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentWa, nameStr + std::string("_P"),
1453  vSub->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1454  }
1455  } // of the number of subsection to the neck
1456  // The weld at the end
1457  {
1458  nameStr = std::string("Horn1DownstrPart1Weld1");
1459  fHorn1IC.push_back(nameStr);
1460  const double zWW = fHorn1LongRescale*(41.0776)*in;;
1461  const double length = 24.0*CLHEP::mm; //Cover two real sections...
1462  const double rTmp1 = fHorn1Equations[7].GetVal(zWW + length) + 0.150*CLHEP::mm + fWaterLayerThickInHorns;
1463  // place it a little more detached..Also, the weld is on top of the layer of water.. Oh well..
1464  const double rTmp2 = rTmp1 + 1.8*CLHEP::mm; //
1465  G4Tubs *aTubsWW = new G4Tubs(nameStr, rTmp1, rTmp2,
1466  length/2. , 0., 360.0*CLHEP::deg);
1467  G4LogicalVolume *pCurrentWW = new G4LogicalVolume(aTubsWW, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1468  posTmp[0] = 0.; posTmp[1] = 0.;
1469  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zWW + zShiftDrawingDownstr + length/2.;
1470  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentWW, nameStr + std::string("_P"),
1471  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1472  }
1473  } // The downstream part horn1, starting downstream of the real section that has the neck
1474  // More Inner conductors, covering the drawings 8875.112-MD 363105 through 363109 included.
1475  // Radial equation 5 and 8 (indices 4 and 7 in our arrays)
1476  // From ZDrawing 41.0576 to 117.126
1477  {
1478  const double zStartDrawing = fHorn1LongRescale*41.108*in;
1479  const double zEndDrawing = fHorn1LongRescale*117.126*in;
1480  fHorn1ZEndIC = zEndDrawing; // For use in the Magnetic field class.
1481  numSubSect = GetNumberOfInnerHornSubSections(4, zStartDrawing,
1482  zEndDrawing, 10); // These Z position are from the start of the inner conductor.
1483  deltaZ = (zEndDrawing - zStartDrawing)/numSubSect;
1484 // std::cerr << " Number of subsection for the downstream half of Horn1 " << numSubSect
1485 // << " deltaz " << deltaZ << std::endl;
1486  for (int iSub = 0; iSub != numSubSect; iSub++) {
1487  const double zzBegin = zStartDrawing + iSub*deltaZ;
1488  const double zzEnd = zzBegin + deltaZ;
1489  std::ostringstream nameStrStr; nameStrStr << "Horn1DownstrPart1SubSect" << iSub;
1490  nameStr = nameStrStr.str();
1491  fHorn1IC.push_back(nameStr);
1492  const double rMin1 = fHorn1Equations[4].GetVal(zzBegin); // Equation 1
1493  const double rMin2 = fHorn1Equations[4].GetVal(zzEnd);
1494  const double rMax1 = fHorn1Equations[7].GetVal(zzBegin) + fWaterLayerThickInHorns + 0.0025;
1495  // Equation 6 (Drawing 8875.112-MD 363104)
1496  const double rMax2 = fHorn1Equations[7].GetVal(zzEnd) + fWaterLayerThickInHorns + 0.0025;
1497  G4Cons *aConsSu = new G4Cons(nameStr, rMin1, rMax1,rMin2, rMax2,
1498  (deltaZ - 0.005*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1499  G4LogicalVolume *pCurrentSu = new G4LogicalVolume(aConsSu, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1500  posTmp[0] = 0.; posTmp[1] = 0.;
1501  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zzBegin + zShiftDrawingDownstr + deltaZ/2.;
1502  G4PVPlacement *vSub = new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentSu, nameStr + std::string("_P"),
1503  mother->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1504 
1505  if (fWaterLayerThickInHorns > 0.002*CLHEP::mm) {
1506  nameStrStr.str(""); nameStrStr.clear(); nameStrStr << "Horn1DownstrPart1SubSect" << iSub << "Water";
1507  nameStr = nameStrStr.str();
1508  G4Cons *aConsWa = new G4Cons(nameStr, rMax1 - fWaterLayerThickInHorns, rMax1-0.001*CLHEP::mm,
1509  rMax2 - fWaterLayerThickInHorns, rMax2-0.001*CLHEP::mm,
1510  (deltaZ - 0.0075*CLHEP::mm)/2., 0., 360.0*CLHEP::deg);
1511  G4LogicalVolume *pCurrentWa = new G4LogicalVolume(aConsWa, G4Material::GetMaterial(std::string("Water")), nameStr);
1512  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] =0.;
1513  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentWa, nameStr + std::string("_P"),
1514  vSub->GetLogicalVolume(), false, 1, (fCheckVolumeOverLapWC && doCheckOverlapNoG4ConsBug));
1515  }
1516  } // of the number of subsection to the neck
1517  {
1518  // Now the Hangers. (two of them.. )
1519  {
1520  G4String nameStr2ndHanger("Horn1DownstrSecondSpiderHanger");
1521  double zLocDrawing = zStartDrawing + fHorn1LongRescale*1.416*in;
1522  double zLocPosM = -1.0*(plHUpst->fParams[2])/2. + zLocDrawing + zShiftDrawingDownstr + 0.375*in*fHorn1LongRescale; // with respect to the center of
1523  // of the mother volume.
1524  this->Horn1InstallSpiderHanger( nameStr2ndHanger, zLocDrawing, zLocPosM, mother);
1525 
1526  G4String nameStrSecondHanger("Horn1DownstrThirdSpiderHanger");
1527  zLocDrawing = fHorn1LongRescale*(80.9951 + 1.791)*in;
1528 // zLocPosM = -1.0*(plHUpst->fParams[2])/2. + -1.0*(plHUpst->fParams[2])/2. + zLocDrawing + zShiftDrawingDownstr + 0.375*in*fHorn1LongRescale;
1529 // Typo, unveiled looking at the HEPRep representation, by Laura F., Aug 4-5 2015.
1530  zLocPosM = -1.0*(plHUpst->fParams[2])/2. + zLocDrawing + zShiftDrawingDownstr + 0.375*in*fHorn1LongRescale;
1531  this->Horn1InstallSpiderHanger( nameStrSecondHanger, zLocDrawing, zLocPosM, mother);
1532  }
1533  // now a few welds..
1534  std::vector<double> zLocWelds(4,0.); // Drawing coordinate system
1535  zLocWelds[0] = fHorn1LongRescale*61.0464*in;
1536  zLocWelds[1] = fHorn1LongRescale*81.0151*in;
1537  zLocWelds[2] = fHorn1LongRescale*100.9839*in;
1538  zLocWelds[3] = fHorn1LongRescale*116.5*in; // Cheat a bit, place it upstream to make sure it does not overlap with the end
1539  // April 2 .. Zeongtae notice this cheat, it manifest itself as a visible gap of a bout 1/2 inch in Z
1540  // Let us fix this by re-adjusting the position of this weld, which, after checking the end and
1541  // beginning of the sub section number 5 and flange below, we now have:
1542  zLocWelds[3] = fHorn1LongRescale*117.1126*in - 12.0*CLHEP::mm;
1543  // final adjustment to avoid collision with the flange.. Wehereby substract 1/2 of the length., +
1544  for (size_t iW=0; iW !=zLocWelds.size(); iW++) {
1545  std::ostringstream nameStrStr; nameStrStr << "Horn1DownstrPart1Weld" << iW+2;
1546  nameStr = nameStrStr.str();
1547  fHorn1IC.push_back(nameStr);
1548  const double length = 24.0*CLHEP::mm; //Cover two real sections...
1549  const double zW = zLocWelds[iW];
1550  double rTmp1 = fHorn1Equations[7].GetVal(zW + length) + 0.015*CLHEP::mm + fWaterLayerThickInHorns;
1551  // To make it a bit nice on fancy plots.
1552  if (iW == 3) rTmp1 += 0.150*CLHEP::mm; // To be safe at the downstream end.
1553  const double rTmp2 = rTmp1 + 1.8*CLHEP::mm; //
1554  G4Tubs *aTubsWn = new G4Tubs(nameStr, rTmp1, rTmp2,
1555  length/2. , 0., 360.0*CLHEP::deg);
1556  std::cerr << " Horn1, Weld " << iW << " volume name " << nameStr << " rTmp1 "
1557  << rTmp1 << " rTmp2 " << rTmp2 << std::endl;
1558  G4LogicalVolume *pCurrentWn = new G4LogicalVolume(aTubsWn, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1559  posTmp[0] = 0.; posTmp[1] = 0.;
1560  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zW + zShiftDrawingDownstr + length/2.;
1561  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentWn, nameStr + std::string("_P"),
1562  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1563  }
1564  }
1565  {
1566  //Flange for the Inner Downstream, drawing 8875-112 363096 .. Two tubes
1567  // Upstream part
1568  nameStr = std::string("Horn1InnerDownstrFlangePart0");
1569  fHorn1IC.push_back(nameStr);
1570  const double rTmp1 = fHorn1RadialRescale*(7.750*in/2.0);
1571  const double rTmp2 = fHorn1RadialRescale*(8.50*in/2.0);; //
1572  const double length = fHorn1LongRescale*(12.244 - 1.10)*in - 12.5*CLHEP::mm;
1573  // Subtract the 1/2 the length weld to avoid collision with the Horn1DownstrPart1Weld
1574  G4Tubs *aTubsFl0 = new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::deg);
1575  G4LogicalVolume *pCurrentFl0 = new G4LogicalVolume(aTubsFl0, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1576  posTmp[0] = 0.; posTmp[1] = 0.;
1577  const double zDrawing = fHorn1LongRescale*(117.1126*in) + 12.5*CLHEP::mm; // small shift to handle collisions
1578  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zDrawing + zShiftDrawingDownstr + length/2.;
1579  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentFl0, nameStr + std::string("_P"),
1580  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1581  }
1582  {
1583  //Flange per-se drawing 8875-112 363096 ..
1584  nameStr = std::string("Horn1InnerDownstrFlangePart1");
1585  fHorn1IC.push_back(nameStr);
1586  const double rTmp1 = fHorn1RadialRescale*7.750*in/2.0 + 1.0*CLHEP::mm;
1587  const double rTmp2 = fHorn1RadialRescale*11.271*in/2.0 + 1.0*CLHEP::mm; //
1588  const double length = fHorn1LongRescale*(1.25)*in; // Add a bit for the connectors.
1589  G4Tubs *aTubsFl1 = new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::deg);
1590  G4LogicalVolume *pCurrentFl1 = new G4LogicalVolume(aTubsFl1, G4Material::GetMaterial(fHorn1InnerCondMat), nameStr);
1591  posTmp[0] = 0.; posTmp[1] = 0.;
1592  const double zDrawing = fHorn1LongRescale*117.1126*in + fHorn1LongRescale*((12.244 - 1.10)*in + 0.5*CLHEP::mm);
1593  posTmp[2] = -1.0*(plHUpst->fParams[2])/2. + zDrawing + zShiftDrawingDownstr + length/2.;
1594  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentFl1, nameStr + std::string("_P"),
1595  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1596  }
1597 
1598 
1599  } // The downstream part of the real section that has the neck.
1600 
1601  // The outer flange (downstream connector and bulk heads) Just a relatively thick tube.
1602  {
1603  nameStr = G4String("Horn1OuterTubeDowsntreamFlanges");
1604  const double rTmp1 = fHorn1OuterTubeOuterRad + 2.0*CLHEP::mm;
1605  const double rTmp2 = 23.5*in/2.; //
1606  const double length = 3.0*in;
1607  const double zDrawing = (117.1126 + 6.0)*in*fHorn1LongRescale; // 6" is still aproximate
1608  G4Tubs *aTubsFl = new G4Tubs(nameStr, rTmp1, rTmp2, length/2. , 0., 360.0*CLHEP::deg);
1609  G4LogicalVolume *pCurrentFl = new G4LogicalVolume(aTubsFl, G4Material::GetMaterial(fHorn1AllCondMat), nameStr);
1610  posTmp[0] = 0.; posTmp[1] = 0.;
1611  posTmp[2] =-1.0*(plHUpst->fParams[2])/2. + zDrawing + zShiftDrawingDownstr + length/2.; ;
1612  new G4PVPlacement((G4RotationMatrix *) 0, posTmp, pCurrentFl, nameStr + std::string("_P"),
1613  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1614  }
1615 
1616 
1617 }
int GetNumberOfInnerHornSubSections(size_t eqn, double z1, double z2, int nMax) const
std::vector< LBNEHornRadialEquation > fHorn1Equations
void Horn1InstallSpiderHanger(const G4String &name, double zFromStartInnerConduct, double zPos, G4PVPlacement *vMother)
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
std::string string
Definition: nybbler.cc:12
std::vector< G4double > fHorn1UpstrOuterIOTransPositions
std::vector< G4double > fHorn1UpstrOuterIOTransLengths
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::vector< G4double > fTargetHorn1InnerRadsUpstr
std::vector< G4double > fHorn1UpstrOuterIOTransInnerRads
T abs(T value)
std::vector< double > fParams
LBNEVolumePlacementData * Create(const G4String &name)
std::vector< G4double > fHorn1UpstrInnerRadsOuterUpstr
void PlaceFinalSimpleHornPolyNumber(size_t iHorn, G4PVPlacement *mother)
std::vector< G4double > fHorn1UpstrInnerRadsOuterDownstr
std::vector< G4double > fHorn1UpstrOuterIOTransThicks
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
std::vector< G4double > fHorn1UpstrInnerRadsDownstr
std::vector< G4double > fHorn1UpstrZPositions
std::vector< G4double > fHorn1UpstrInnerRadsUpstr
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
std::vector< G4double > fHorn1UpstrLengths
QTextStream & endl(QTextStream &s)
std::vector< G4String > fHorn1IC
void LBNEVolumePlacements::PlaceFinalRALTarget ( G4PVPlacement *  mother)
private

Definition at line 943 of file LBNEVolumePlacementsAdd.cc.

943  {
944 
945  std::vector<double> fParams(3,0.);
946 
947 
948 
949  fParams[1] = fRALTargetRadius;
950  fParams[2] = fRALSimpleTargetLength;
951 
953  fParams[2] = 1500*CLHEP::mm;}
954 
955  std::string volumeName("RAL-Target");
956 
957  G4Tubs* aTube = new G4Tubs(volumeName, fParams[0], fParams[1], fParams[2]/2., 0., 360.*CLHEP::deg);
958 
959  G4LogicalVolume* fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial("Target"), volumeName);
960 
961  G4ThreeVector posTmp; posTmp[1] = 0.; posTmp[1] = 0.;
962 
963  posTmp[2] = fParams[2]/2. - fTargetOutHeContTubeStraightLength/2.;
964  //std::cout<<"Placing RAL-Target "<<posTmp[2]*CLHEP::mm<<std::endl;
965  new G4PVPlacement((G4RotationMatrix *) 0,
966  posTmp, fCurrent,
967  G4String("TargetSimpleCylinder_P"),
968  mother->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
969 
970  }
std::string string
Definition: nybbler.cc:12
void LBNEVolumePlacements::PlaceFinalSimpleHornPolyNumber ( size_t  iHorn,
G4PVPlacement *  mother 
)

Definition at line 1873 of file LBNEVolumePlacementsAdd.cc.

1873  {
1874 
1875 // Place the inner conductor. A G4Polycone, fitting inside the mother G4Polycone, or the tube.
1876 // Note that we create a few temporary arrrays, first for the outer raddi of the inner conducter itself
1877 // second, for the water layer (inside the inner conductor, to make the volume tree logical hierachy more vertical)
1878 // The number of points on the inner C polygon (and the water layer ) is 2*(fMotherHornsAllRads.size() -2),
1879 // since we skip the outer conductor, but we install the nearly vertical flange.
1880 // Correction: we do not put a water layer on the vertical flange..
1881 //
1882  const bool debugIsOn = false;
1883  if (debugIsOn) std::cerr << " LBNEVolumePlacements::PlaceFinalSimpleHornPolyNumber " << iH << " num segments "
1884  << fMotherHornsAllRads[iH].size() << std::endl;
1885  std::vector<double> innerRads(fMotherHornsAllRads[iH].size()-2);
1886  std::vector<double> innerZs(fMotherHornsAllLengths[iH].size()-2);
1887  // Skip the outer conductor.
1888  if (debugIsOn) std::cerr << " ................. innerRads size " << innerRads.size() << std::endl;
1889  for (size_t k=1; k!= fMotherHornsAllRads[iH].size()-1; k++) {
1890  innerRads[k-1] = fMotherHornsAllRads[iH][k];
1891  innerZs[k-1] = fMotherHornsAllLengths[iH][k];
1892  }
1893  std::vector<double> allRads(innerRads); // not yet full size... Only 1/2 of it.
1894  std::vector<double> allZs(innerZs);
1895  std::vector<double> outerRads(innerRads.size(), 0.); // covering volume (rin + thick + water + epsil)
1896  const double epsil = 0.050*CLHEP::mm;
1897  double zMax = -1.0e23;
1898  double zMin = 1.0e23;
1899  for (size_t k=0; k != allZs.size(); k++) {
1900  allRads[k] += epsil;
1901  allZs[k] -= epsil;
1902  innerRads[k] += epsil;
1903  innerZs[k] -= epsil;
1904  zMax = std::max(zMax, innerZs[k]);
1905  zMin = std::min(zMin, innerZs[k]);
1906  outerRads[k] = innerRads[k] + fMotherHornsAllThick[iH][k];
1907  }
1908  // Futher at the edges.
1909  innerZs[0] += epsil;
1910  innerZs[innerZs.size()-1] -= epsil;
1911  allZs[0] += epsil;
1912  allZs[allZs.size()-1] -= epsil;
1913  //
1914  // Now we implement the return loop, downstream to upstream. We made two arrays, such that, if the "all" vector move in memory,
1915  // we are safe...
1916  //
1917  size_t nPtsHalf = innerZs.size();
1918  const double thickUsptream = fMotherHornsAllThick[iH][1]; // Index 1 : the first thicknes is the outer conductor...
1919  const double thickDownstream = (fMotherHornsAllThick[iH].size() < 2) ?
1920  thickUsptream : fMotherHornsAllThick[iH][fMotherHornsAllThick[iH].size()-2];
1921  if (debugIsOn) std::cerr << " Vertical Flange thicknesses, upstream "
1922  << thickUsptream << " downstream " << thickDownstream << std::endl;
1923  for (size_t k=0; k != nPtsHalf; k++) {
1924  size_t kk = nPtsHalf -1 - k;
1925  double zzLocal = innerZs[kk];
1926  if (k == 0) zzLocal -= thickDownstream;
1927  if (kk == 0) zzLocal += thickUsptream; // to avoid R-Z crossing for the vertical flange
1928  // only valid if the flange is vertical.. Hopefully, this is the case for all the Horns Laura F. is considering.
1929  if (k == 1) zzLocal -= thickDownstream;
1930  if (kk == 1) zzLocal += thickUsptream; // to avoid R-Z crossing for the vertical flange
1931  double radius = outerRads[kk];
1932  if (k == 0) radius = outerRads[kk] - thickDownstream; // Again, valid only if flange is nearly vertical.
1933  if (kk == 0) radius = outerRads[kk] - thickUsptream; // Again, valid only if flange is nearly vertical.
1934  allRads.push_back(radius);
1935  allZs.push_back(zzLocal);
1936  zMax = std::max(zMax, zzLocal);
1937  zMin = std::min(zMin, zzLocal);
1938  }
1939  //
1940  // We shift the Z position by half the length, such the relative definition is the same as for the other volumes.
1941  std::vector<double> zz(allZs);
1942  const double zMiddle = (zMax + zMin)/2.;
1943  if (debugIsOn) std::cerr << " .................. Zmin " << zMin << " max " << " zMax "
1944  << zMax << " zMiddle " << zMiddle << std::endl
1945  << " .................. InnerRads size " << innerRads.size() << std::endl;
1946  for (std::vector<double>::iterator il = zz.begin(); il != zz.end(); il++) *il -= zMiddle;
1947  if (debugIsOn) {
1948  std::ostringstream aNStrStr; aNStrStr << "./AllHornsPolyconeParametersHornInner_" << (iH+1) << ".txt";
1949  std::string aNStr(aNStrStr .str());
1950  std::ofstream fOut(aNStr.c_str());
1951  fOut << " ip Z R " << std::endl;
1952  for (size_t k=0; k != allZs.size(); k++) {
1953  fOut << " " << k << " " << zz[k] << " " << allRads[k] << " " << std::endl;
1954  }
1955  fOut.close();
1956  }
1957 
1958  std::ostringstream vNameInnerStr; vNameInnerStr << "Horn" << (iH+1) << "PolyInnerC";
1959  G4String vNameInner(vNameInnerStr.str());
1960  fHorn1IC.push_back(vNameInner);
1961  G4GenericPolycone* aPCon = new G4GenericPolycone(vNameInner, 0., 360.0*CLHEP::deg, static_cast<int>(zz.size()),
1962  &allRads[0], &zz[0]);
1963  G4ThreeVector posTmp; posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
1964  G4LogicalVolume *pCurrent = new G4LogicalVolume(aPCon,
1965  G4Material::GetMaterial(std::string(fHorn1InnerCondMat)), vNameInner);
1966  new G4PVPlacement((G4RotationMatrix *) 0,
1967  posTmp, pCurrent, vNameInner + std::string("_P"),
1968  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
1969 
1970  if (debugIsOn) std::cerr << " LBNEVolumePlacements::PlaceFinalSimpleHornPolyNumber ... Inner conductor placed " << std::endl;
1971  if (std::abs(fWaterLayerThickInHorns) > 0.00002*CLHEP::mm) {
1972  // We assume that there are no water on vertical flange...
1973  if (innerRads.size() < 2) {
1974  std::ostringstream mStrStr;
1975  mStrStr << " Horn " << (iH+1)
1976  << " has to few segments ( " << innerRads.size() <<" ) to support a water layer.. Review the geometry. ";
1977  std::string mStr(mStrStr.str());
1978  G4Exception("LBNEVolumePlacements::PlaceFinalSimpleHornPolyNumber",
1979  " ", JustWarning, mStr.c_str());
1980  } else {
1981  //
1982  // We skip the vertical flange..
1983  //
1984  std::vector<double> innerWaterRads((outerRads.size()-2), 0.); // Aluminum only. (rin + thick + water + epsil)
1985  std::vector<double> innerWaterZs(innerWaterRads.size(), 0.);
1986  for (size_t k=1; k != innerRads.size()-1; k++) {
1987  innerWaterRads[k-1] = outerRads[k] + 2.0*epsil; // to take possible edge effect away, for sharped angle sections (unphysical, anyways..)
1988  innerWaterZs[k-1] = zz[k]; // we take the shifted array, to ease debugging, and avoid volume overlap.
1989  if (k == 1) innerWaterZs[k-1] += 2.0*thickUsptream; // Chop the most upstream section, it clashes with vertical flange.
1990  else if (k == (innerRads.size()-2)) innerWaterZs[k-1] -= 2.0*thickDownstream; // same, assume symmetrical thickness.
1991  // assume it will fit, otherwise...
1992  }
1993  //
1994  // Now we implement again the same the return loop, downstream to upstream.
1995  size_t nPtsWHalf = innerWaterZs.size();
1996  std::vector<double> allWaterRads(innerWaterRads);
1997  std::vector<double> allWaterZs(innerWaterZs);
1998 // double zWMin = 1.0e23; double zWMax = -1.0e23;
1999  for (size_t k=0; k != nPtsWHalf; k++) {
2000  size_t kk = nPtsWHalf -1 - k;
2001  allWaterRads.push_back(allWaterRads[kk] + fWaterLayerThickInHorns);
2002  allWaterZs.push_back(innerWaterZs[kk]);
2003 // zWMin = std::min(innerWaterZs[kk], zWMin);
2004 // zWMax = std::max(innerWaterZs[kk], zWMax);
2005  }
2006  //
2007  // We do not shift, we are already in the correct frame with respect to the mother volume.
2008  // important if the thicknesses of the flange are asymmetric.
2009  //
2010  std::vector<double> zzWater(allWaterZs);
2011 // const double zWMiddle = (zWMax + zWMin)/2.;
2012 // if (debugIsOn) std::cerr << " .................. ZWmin " << zWMin << " max " << " zWMax "
2013 // << zWMax << " zWMiddle " << zWMiddle << std::endl;
2014 // for (std::vector<double>::iterator il = zzWater.begin(); il != zzWater.end(); il++) *il -= zWMiddle;
2015  if (debugIsOn) {
2016  std::cerr << ".......... ... Water layer placed, nPtsWHalf " << nPtsWHalf << std::endl;
2017  std::ostringstream aNStrStr; aNStrStr << "./AllHornsPolyconeParametersHornInnerWater_" << (iH+1) << ".txt";
2018  std::string aNStr(aNStrStr .str());
2019  std::ofstream fOut(aNStr.c_str());
2020  fOut << " ip Z R " << std::endl;
2021  for (size_t k=0; k != zzWater.size(); k++) {
2022  fOut << " " << k << " " << zzWater[k] << " " << allWaterRads[k] << " " << std::endl;
2023  }
2024  fOut.close();
2025  }
2026  std::ostringstream vNameInnerWStr; vNameInnerWStr << "Horn" << (iH+1) << "PolyInnerCWaterL";
2027  G4String vNameInnerW(vNameInnerWStr.str());
2028  G4GenericPolycone* aPConW5 = new G4GenericPolycone(vNameInnerW, 0.*CLHEP::deg, 360.0*CLHEP::deg, static_cast<int>(allWaterRads.size()),
2029  &allWaterRads[0], &zzWater[0]);
2030  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
2031  G4LogicalVolume *pCurrentW5 = new G4LogicalVolume(aPConW5,
2032  G4Material::GetMaterial(std::string("Water")), vNameInnerW);
2033  new G4PVPlacement((G4RotationMatrix *) 0,
2034  posTmp, pCurrentW5, vNameInnerW + std::string("_P"),
2035  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
2036  }
2037  }
2038  //
2039  // Now the outer Tube
2040  //
2041  const double rOuterInner = fHornsPolyOuterRadius[iH] - 0.250*25.4*CLHEP::mm - 0.1*CLHEP::mm;
2042  const double rOuterOuter = fHornsPolyOuterRadius[iH] - 0.1*CLHEP::mm;
2043  const double lengthOT = fHornsPolyListRinThickZVects[iH][fUseHornsPolyNumInnerPts[iH]-1][2] - 5.0*CLHEP::mm; // to fit inside the edges of IC
2044  std::ostringstream nameOTStr; nameOTStr << "Horn" << (iH+1) << "OuterC";
2045  G4String nameOT(nameOTStr.str());
2046  G4Tubs *aTubs = new G4Tubs(nameOT, rOuterInner, rOuterOuter, lengthOT/2., 0., 360.0*CLHEP::deg);
2047  G4LogicalVolume *pCurrentOT = new G4LogicalVolume(aTubs, G4Material::GetMaterial(fHorn1InnerCondMat), nameOT);
2048  new G4PVPlacement((G4RotationMatrix *) 0,
2049  posTmp, pCurrentOT, nameOT + std::string("_P"),
2050  mother->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
2051 
2052 }
intermediate_table::iterator iterator
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::string string
Definition: nybbler.cc:12
std::vector< double > fHornsPolyOuterRadius
std::vector< std::vector< double > > fMotherHornsAllRads
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
T abs(T value)
static int max(int a, int b)
std::vector< std::vector< double > > fMotherHornsAllThick
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
static QCString str
QTextStream & endl(QTextStream &s)
std::vector< std::vector< double > > fMotherHornsAllLengths
std::vector< G4String > fHorn1IC
void LBNEVolumePlacements::PlaceFinalSmallTarget1p2MW ( G4PVPlacement *  mother)
private

Definition at line 2261 of file LBNEVolumePlacementsAdd.cc.

2261  {
2262  //
2263  // Start with an ugly patch: restore the value of this bool, as it might have been overwritten
2264  // when the Horn1 is set to Optimized Polycone. The logical flow has been corrected in the DetectorConstruciton.
2265 
2266  fUse1p2MWSmallTgt = true;
2267 
2268 
2269  // Code to be picked up from Release v3r2p6, December 2016/ January 2017.
2270  const G4LogicalVolume *lVolMother = mother->GetLogicalVolume();
2271  std::cerr << " Installing the short (~ 1 m. long ) target, circa Feb. 2014 in mother "
2272  << lVolMother->GetName() << std::endl;
2273  const G4LogicalVolume *lVolMotherForTargetNoSPlitM1 = fTargetHorn1HallPhysPtr->GetLogicalVolume();
2274  std::cerr << " Installing TargetNoSplitM1 in "
2275  << lVolMotherForTargetNoSPlitM1->GetName() << std::endl;
2276  std::string targetTopStr("TargetUpstrMTop");
2277  // We us an overly deep volume hierarchy here... To be consistency with previous version
2278  // of this code. To be cleaned up at a later stage.
2279  Create(targetTopStr);
2280  G4PVPlacement *vMTop = PlaceFinal(targetTopStr, mother);
2281  std::string targetTopStrM0("TargetUpstrM0");
2282  LBNEVolumePlacementData *plM0 = Create(targetTopStrM0);
2283  G4PVPlacement *vM0 = PlaceFinal(targetTopStrM0, vMTop);
2284  std::cerr << " .. " << targetTopStr
2285  << " is now placed in.... " << lVolMother->GetName() << std::endl;
2286  G4String targetNSStr = std::string("TargetNoSplitM1");
2287  LBNEVolumePlacementData *plM1 = Create(targetNSStr);
2288  G4PVPlacement *vM1 = PlaceFinal(targetNSStr, fTargetHorn1HallPhysPtr);
2289  std::cerr << " .. " << targetNSStr
2290  << " is now placed in PlaceFinalUpstrTarget1p2MW...in fTargetHorn1HallPhysPtr " << std::endl;
2291 
2292 
2293 
2294 
2295 
2296  // ALL RELATED TO BAFFLE AND UPSTREAM TARGET ASSEMBLY!!!!!!!!!!!
2297 
2298 
2299 
2300  std::string tUpUp("TargetUpstrUpstr");
2301  Create(tUpUp + std::string("Plate"));
2302  Create(tUpUp + std::string("Can"));
2303  Create(tUpUp + std::string("CanEndPlate"));
2304  Create(tUpUp + std::string("DwstrFlange"));
2305  Create(tUpUp + std::string("CoolingTube"));
2306  Create(tUpUp + std::string("CoolingTubeWater"));
2307  Create(tUpUp + std::string("SupportBlockTopLeft"));
2308  Create(tUpUp + std::string("SupportBlockBottomLeft"));
2309  Create(tUpUp + std::string("SupportBlockRight"));
2310  Create(tUpUp + std::string("SupportSleeve"));
2311  // None of these are surveyable, position is fixed.
2312  PlaceFinal(tUpUp + std::string("Plate"), vM0);
2313  PlaceFinal(tUpUp + std::string("Can"), vM0);
2314  PlaceFinal(tUpUp + std::string("CanEndPlate"), vM0);
2315  PlaceFinal(tUpUp + std::string("DwstrFlange"), vM0);
2316  // Cooling tubes: two copies. This breaks the Placement data model. Never mind, assume here that misalignment
2317  // of these cooling tube has negligible effect on the physics.
2318 
2319 
2320 
2321  // ALL RELATED TO BAFFLE AND UPSTREAM TARGET ASSEMBLY!!!!!!!!!!!
2322 
2323 
2324 
2325 
2326  // Cooling tubes: two copies. This breaks the Placement data model. Never mind, assume here that misalignment
2327  // of these cooling tube has negligible effect on the physics.
2328 
2329  G4String nameTmp5(tUpUp + std::string("CoolingTube"));
2331  LBNEVolumePlacementData &infoTmp = itTmp->second;
2332  G4ThreeVector posTmp;
2333  posTmp[0] = 0.;
2334  posTmp[1] = 0.5*fTargetFinHeight;
2335  posTmp[2] = -1.0*plM0->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
2337  fTargetDownstrCanFlangeThick + fTargetFlangeThick - infoTmp.fParams[2]/2 - 1.0*CLHEP::mm;
2338 
2339 
2340  // Cooling tubes: two copies. This breaks the Placement data model. Never mind, assume here that misalignment
2341  // of these cooling tube has negligible effect on the physics.
2342 
2343 
2344  G4String vpNameTmp5(nameTmp5);
2345 // std::cerr << " Position for " << vpNameTmp5+G4String("_PTop") << " X = "
2346 // << posTmp[0] << " Y " << posTmp[1] << " Z " << posTmp[2] << std::endl;
2347  G4PVPlacement *vCoolingTubeTop = new G4PVPlacement((G4RotationMatrix *) 0,
2348  posTmp, infoTmp.fCurrent, vpNameTmp5+G4String("_PTop"),
2349  vM0->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC );
2350  posTmp[1] = -0.5*fTargetFinHeight;
2351  G4PVPlacement *vCoolingTubeBottom = new G4PVPlacement((G4RotationMatrix *) 0,
2352  posTmp, infoTmp.fCurrent, vpNameTmp5+std::string("_PBottom"),
2353  vM0->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
2354 
2355 
2356 
2357  // Cooling tubes: two copies. This breaks the Placement data model. Never mind, assume here that misalignment
2358  // of these cooling tube has negligible effect on the physics.
2359 
2360 
2361  PlaceFinal(tUpUp + std::string("CoolingTubeWater"), vCoolingTubeTop);
2362  PlaceFinal(tUpUp + std::string("CoolingTubeWater"), vCoolingTubeBottom);
2363  PlaceFinal(tUpUp + std::string("SupportBlockTopLeft"), vM0);
2364  PlaceFinal(tUpUp + std::string("SupportBlockBottomLeft"), vM0);
2365  PlaceFinal(tUpUp + std::string("SupportBlockRight"), vM0);
2366  PlaceFinal(tUpUp + std::string("SupportSleeve"), vM0);
2367  // We need three support/alignment rods. Identical volume, but at different locations.
2368  std::string nameTmp10(tUpUp + std::string("SupportRod"));
2369  Create(nameTmp10);
2370  itTmp = fSubVolumes.find(nameTmp10);
2371  infoTmp = itTmp->second;
2372  // Top Left alignment/support rod.
2373  posTmp[0] = -20.5*CLHEP::mm; // Again, accurate to +- 1 mm or so.
2374  posTmp[1] = 24.0*CLHEP::mm;
2375  posTmp[2] = -1.0*plM0->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
2377  fTargetDownstrCanFlangeThick - infoTmp.fParams[2]/2 - 1.0*CLHEP::mm;
2378  G4String vpNameTmp10(nameTmp10);
2379  new G4PVPlacement((G4RotationMatrix *) 0,
2380  posTmp, infoTmp.fCurrent, vpNameTmp10+std::string("_PTopLeft"),
2381  vM0->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2382  posTmp[0] = -15.5*CLHEP::mm; // Again, accurate to +- 1 mm or so.
2383  posTmp[1] = -36.0*CLHEP::mm;
2384  new G4PVPlacement((G4RotationMatrix *) 0,
2385  posTmp, infoTmp.fCurrent, vpNameTmp10+std::string("_PBottomLeft"),
2386  vM0->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
2387  posTmp[0] = 33.0*CLHEP::mm; // Again, accurate to +- 1 mm or so.
2388  posTmp[1] = 5.0*CLHEP::mm;
2389  new G4PVPlacement((G4RotationMatrix *) 0,
2390  posTmp, infoTmp.fCurrent, vpNameTmp10+std::string("_PRight"),
2391  vM0->GetLogicalVolume(), false, 2, fCheckVolumeOverLapWC);
2392 
2393 // Horizontal fin for beam alignment. Most important thing in the canister, in terms of material budget
2394 //
2395 // We have decided not to implement the horizontal fins.. But it was present in the
2396 // v3r2p6.
2397 //
2398 // std::string nameTmp11("TargetFinHorizontal");
2399 // Create(nameTmp11);
2400 // PlaceFinal(nameTmp11, vM0);
2401 
2402  // Done with the target canister..Now assemble the upstream part of the target it self. (Upstream of the horn1)
2403  // Or, since we use this in the context of noSplitHorn1, for the entire target, we have:
2404  std::string tUpDown("TargetNoSplit");
2405  Create(tUpDown + std::string("HeContainer"));
2406  G4PVPlacement *vHeTube = PlaceFinal(tUpDown + std::string("HeContainer"), vM1); // Surveyable
2407 // LBNEVolumePlacementData *plHelium = Create(tUpDown + std::string("Helium"));
2408  Create(tUpDown + std::string("Helium"));
2409  G4PVPlacement *vHelium = PlaceFinal(tUpDown + std::string("Helium"), vHeTube); // Fixed
2410 
2411  // First alignment ring, locate flush with the end plate (within 1 mm ) , left and right
2412  // Take them off, as in v3r2p6..
2413 // LBNEVolumePlacementData *infoTmpRLeft = Create(G4String("TargetAlignmentRingLeft"));
2414 // LBNEVolumePlacementData *infoTmpRRight = Create(G4String("TargetAlignmentRingRight"));
2415 // std::cerr << " Placing target alignment rings..... up to " << plM0->fParams[2]/2.0 << std::endl;
2416 // posTmp[0] = 0.; // The alignment rings are always centered..
2417 // posTmp[1] = 0.;
2418 // posTmp[2] = -1.0*plHelium->fParams[2]/2.0 + infoTmpRLeft->fParams[2]/2. + 1.0*CLHEP::mm; // 1 mm spacing Left and right have the same thickness.
2419 // int copyNumber = 0;
2420 // while (true) {
2421 // std::ostringstream cNumStrStr; cNumStrStr << "_P" << copyNumber;
2422 // new G4PVPlacement((G4RotationMatrix *) 0,
2423 // posTmp, infoTmpRLeft->fCurrent, G4String("TargetAlignmentRingLeft")+cNumStrStr.str(),
2424 // vHelium->GetLogicalVolume(), false, copyNumber, fCheckVolumeOverLapWC);
2425 // new G4PVPlacement((G4RotationMatrix *) 0,
2426 // posTmp, infoTmpRRight->fCurrent, G4String("TargetAlignmentRingRight")+ cNumStrStr.str(),
2427 // vHelium->GetLogicalVolume(), false, copyNumber, fCheckVolumeOverLapWC);
2428 // posTmp[2] += fTargetAlignRingSpacing;
2429 // copyNumber++;
2430 // std::cerr << " Placed target alignment ring at " << posTmp[2] << std::endl;
2431 // if ( posTmp[2] > (plM0->fParams[2]/2.0 - 1.0*CLHEP::mm)) break;
2432 // }
2433  //
2434  LBNEVolumePlacementData *plTargetCoolingTube = Create(G4String("TargetUpstrDownstrCoolingTube"));
2435  LBNEVolumePlacementData *plTargetCoolingTubeWater = Create(G4String("TargetUpstrDownstrCoolingTubeWater"));
2436 // LBNEVolumePlacementData *plTargetFin = Create(G4String("TargetFinVert"));
2437  G4String nameTgtUpDownSegLeft("TargetUpstrDownstrSegmentLeft");
2438  LBNEVolumePlacementData *plTargetUpstrDownstrSegmentLeft = Create(nameTgtUpDownSegLeft);
2439  G4String nameTgtUpDownSegRight("TargetUpstrDownstrSegmentRight");
2440  std::vector< std::string > namesSegment(2,"");
2441  namesSegment[0] = nameTgtUpDownSegLeft;
2442  namesSegment[1] = nameTgtUpDownSegRight;
2443  LBNEVolumePlacementData *plTargetUpstrDownstrSegmentRight = Create(nameTgtUpDownSegRight);
2444  std::cerr << "LBNEVolumePlacements::PlaceFinalSmallTarget1p2MW, fTargetFinExtraWidth "
2445  << fTargetFinExtraWidth << " central width " << fTargetFinWidth << std::endl;
2446  LBNEVolumePlacementData *plTargetFinExtra = (fTargetFinExtraWidth > 0.) ?
2447  Create(G4String("TargetFinVertExtra")) : 0;
2448  LBNEVolumePlacementData *plTargetFinHeSide = (fTargetFinExtraWidth < 0.) ?
2449  Create(G4String("TargetFinVertHeliumSide")) : 0;
2450  LBNEVolumePlacementData *plTargetRoundCornerUpstrLeft = (fUseRoundedTargetFins) ?
2451  Create(G4String("TargetFinVertHeliumRoundedUpstrLeft")) : 0;
2452  LBNEVolumePlacementData *plTargetRoundCornerUpstrRight = (fUseRoundedTargetFins) ?
2453  Create(G4String("TargetFinVertHeliumRoundedUpstrRight")) : 0;
2454  LBNEVolumePlacementData *plTargetRoundCornerDownstrLeft = (fUseRoundedTargetFins) ?
2455  Create(G4String("TargetFinVertHeliumRoundedDownstrLeft")) : 0;
2456  LBNEVolumePlacementData *plTargetRoundCornerDownstrRight = (fUseRoundedTargetFins) ?
2457  Create(G4String("TargetFinVertHeliumRoundedDownstrRight")) : 0;
2458  G4PVPlacement *vSeg[2];
2459  const double zCoordTmp = -1.0*plM1->fParams[2]/2.0 + 0.0075*CLHEP::mm;
2460  int copyNumberT = 0;
2461  for (int iSeg=0; iSeg != fTargetNumFins; iSeg++) { // Place with no misalignment, The last segment is placed below
2462  posTmp[0] = -0.5*fTargetFinContainerWidth - 0.023*CLHEP::mm; posTmp[1] = 0.;
2463  posTmp[2] = zCoordTmp
2464  + plTargetUpstrDownstrSegmentLeft->fParams[2]/2. + iSeg*(fTargetFinLength + fTargetFinSpacingLength);
2465 // std::cerr << " Placing target segments... At Z = " << posTmp[2] << std::endl;
2466  std::ostringstream cNumStrStrL; cNumStrStrL << "_PLeft" << iSeg;
2467  vSeg[0] = new G4PVPlacement((G4RotationMatrix *) 0,
2468  posTmp, plTargetUpstrDownstrSegmentLeft->fCurrent,
2469  nameTgtUpDownSegLeft+cNumStrStrL.str(),
2470  vHelium->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
2471  copyNumberT ++;
2472  posTmp[0] *= -1.0;
2473  std::ostringstream cNumStrStrR; cNumStrStrR << "_PRight" << iSeg;
2474  vSeg[1] = new G4PVPlacement((G4RotationMatrix *) 0,
2475  posTmp, plTargetUpstrDownstrSegmentRight->fCurrent,
2476  nameTgtUpDownSegRight+cNumStrStrR.str(),
2477  vHelium->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
2478 
2479  if (plTargetFinExtra != 0) {
2480  posTmp[0] = -1.0*fTargetFinContainerWidth - 0.5*fTargetFinExtraWidth -0.040*CLHEP::mm;
2481  new G4PVPlacement((G4RotationMatrix *) 0,
2482  posTmp, plTargetFinExtra->fCurrent,
2483  namesSegment[0] + std::string("Extra")+cNumStrStrL.str(),
2484  vHelium->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
2485  posTmp[0] *= -1.0;
2486  new G4PVPlacement((G4RotationMatrix *) 0,
2487  posTmp, plTargetFinExtra->fCurrent,
2488  namesSegment[1] + std::string("Extra")+cNumStrStrR.str(),
2489  vHelium->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
2490 
2491  }
2492 // std::cerr << " Placing target at Zs " << posTmp[2] << std::endl;
2493  }
2494 
2495  for (size_t kLeftRight=0; kLeftRight !=2; kLeftRight++) {
2496  posTmp[0] = 0.; posTmp[1] = fTargetFinHeight/2. + fTargetCTubeOuterRadius - 0.005*CLHEP::mm; posTmp[2] = 0.;
2497  std::cerr << " Height of the cooling tube Up... .. " << posTmp[1] <<std::endl;
2498  std::cerr << " Placing cooling tube in " << vSeg[kLeftRight]->GetLogicalVolume()->GetName() <<
2499  " Fin height " << fTargetFinHeight << " Outer tube radius " << fTargetCTubeOuterRadius
2500  << " pos H. " << posTmp[1] << std::endl;
2501 
2502  G4PVPlacement *vTubeUp = new G4PVPlacement((G4RotationMatrix *) 0,
2503  posTmp, plTargetCoolingTube->fCurrent,
2504  namesSegment[kLeftRight]+G4String("CoolingTubeUp_PTop"),
2505  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2506 
2507  posTmp[1] *= -1.0;
2508  std::cerr << " Height of the cooling tube Down... .. "<< posTmp[1] << std::endl;
2509  G4PVPlacement *vTubeDwn = new G4PVPlacement((G4RotationMatrix *) 0,
2510  posTmp, plTargetCoolingTube->fCurrent,
2511  namesSegment[kLeftRight]+ G4String("CoolingTubeUp_PBottom"),
2512  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2513  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
2514  new G4PVPlacement((G4RotationMatrix *) 0,
2515  posTmp, plTargetCoolingTubeWater->fCurrent,
2516  namesSegment[kLeftRight]+ G4String("CoolingTubeWater_PUp"),
2517  vTubeUp->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2518 
2519  new G4PVPlacement((G4RotationMatrix *) 0,
2520  posTmp, plTargetCoolingTubeWater->fCurrent,
2521  namesSegment[kLeftRight]+ G4String("CoolingTubeWater_PDwn"),
2522  vTubeDwn->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2523 
2524 //
2525 // This is no longer really needed, as we the container is graphite.. but keep it, for
2526 // debugging the geometry..
2527 // posTmp[0] = (kLeftRight == 0) ? -1.0*( fTargetFinContainerWidth - fTargetFinWidth)/2. -0.010:
2528 // ( fTargetFinContainerWidth - fTargetFinWidth)/2. + 0.010;
2529 // std::cerr << " TargetFin Horizontal shift " << posTmp[0]
2530 // << " Container width " << fTargetFinContainerWidth << " TargetFin Width " << fTargetFinWidth << std::endl;
2531 // posTmp[1] = 0.;
2532 // new G4PVPlacement((G4RotationMatrix *) 0,
2533 // posTmp, plTargetFin->fCurrent,
2534 // namesSegment[kLeftRight]+G4String("TargetFinVert_P"),
2535 // vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2536 //
2537 // Put back some helium into the container..
2538 //
2539  if (plTargetFinHeSide != 0) {
2540  const double heThick = plTargetFinHeSide->fParams[0];
2541  const double heThickShift = -0.5*fTargetFinContainerWidth + 0.5*heThick + 0.0175*CLHEP::mm;
2542  std::cerr << " Helium back fill.. width " << heThick
2543  << " Container width " << fTargetFinContainerWidth << " shift " << heThickShift << std::endl;
2544  posTmp[0] = (kLeftRight == 0) ? heThickShift : -1.0*heThickShift;
2545  posTmp[1] = 0.;
2546  new G4PVPlacement((G4RotationMatrix *) 0,
2547  posTmp, plTargetFinHeSide->fCurrent,
2548  namesSegment[kLeftRight]+G4String("TargetFinVertHeSide_P"),
2549  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2550  }
2551  if (fUseRoundedTargetFins) {
2552  posTmp[0] = 0.;
2553  posTmp[1] = 0.;
2554  if (kLeftRight == 0) {
2555  posTmp[2] = plTargetUpstrDownstrSegmentLeft->fParams[2]/2. - plTargetRoundCornerDownstrLeft->fParams[1]/2. - 0.001*CLHEP::mm;
2556  std::cerr << " Z shift for round cornres .. DownstrLeft " << posTmp[2] << " half length Target " <<
2557  plTargetUpstrDownstrSegmentLeft->fParams[2]/2. << " cuboid width " <<
2558  plTargetRoundCornerDownstrLeft->fParams[0]/2. << std::endl;
2559  new G4PVPlacement(&fRotVertical, posTmp,
2560  plTargetRoundCornerDownstrLeft->fCurrent,
2561  namesSegment[kLeftRight]+G4String("TargetFinVertRoundCornerDL_P"),
2562  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2563  posTmp[2] *= -1.0;
2564  new G4PVPlacement(&fRotVertical, posTmp,
2565  plTargetRoundCornerUpstrLeft->fCurrent,
2566  namesSegment[kLeftRight]+G4String("TargetFinVertRoundCornerUL_P"),
2567  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2568  } else {
2569  posTmp[2] = plTargetUpstrDownstrSegmentRight->fParams[2]/2. - plTargetRoundCornerDownstrRight->fParams[1]/2. - 0.001*CLHEP::mm;
2570  new G4PVPlacement(&fRotVertical, posTmp,
2571  plTargetRoundCornerDownstrRight->fCurrent,
2572  namesSegment[kLeftRight]+G4String("TargetFinVertRoundCornerDR_P"),
2573  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2574  posTmp[2] *= -1.0;
2575  new G4PVPlacement(&fRotVertical, posTmp,
2576  plTargetRoundCornerUpstrRight->fCurrent,
2577  namesSegment[kLeftRight]+G4String("TargetFinVertRoundCornerUR_P"),
2578  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2579  }
2580 
2581  }
2582 //
2583  }
2584  //
2585  // Repeat the last few mantra for the last segment ... But we skip the round corner..
2586  // And we skip this for the CDR Optimized case... February 2017..
2587  // We also skip this if the length of the target has been res-scaled.
2588  //
2589  if ((!fUseCDR2015Optimized) &&
2590  (fTargetFinLengthSplitUpstr > 0.3*CLHEP::mm) &&
2591  (std::abs(fTargetSLengthGraphite - 953.8) < 5.0*CLHEP::mm)) {
2592  std::cerr << " Installing the last target segment upstream of Horn1 .. " << std::endl;
2593  LBNEVolumePlacementData *plTargetCoolingTubeLast = Create(G4String("TargetUpstrDownstrCoolingTubeLast"));
2594  LBNEVolumePlacementData *plTargetCoolingTubeWaterLast = Create(G4String("TargetUpstrDownstrCoolingTubeLastWater"));
2595 // LBNEVolumePlacementData *plTargetFinLast = Create(G4String("TargetFinVertUpstrLast"));
2596  G4String nameTgtUpDownSegLastLeft("TargetUpstrDownstrSegmentLastLeft");
2597  LBNEVolumePlacementData *plTargetUpstrDownstrSegmentLastLeft = Create(nameTgtUpDownSegLastLeft);
2598  G4String nameTgtUpDownSegLastRight("TargetUpstrDownstrSegmentLastRight");
2599  LBNEVolumePlacementData *plTargetUpstrDownstrSegmentLastRight = Create(nameTgtUpDownSegLastRight);
2600  LBNEVolumePlacementData *plTargetFinExtraLast = (fTargetFinExtraWidth > 0.) ?
2601  Create(G4String("TargetFinVertExtraLast")) : 0;
2602  namesSegment[0] = nameTgtUpDownSegLastLeft;
2603  namesSegment[1] = nameTgtUpDownSegLastRight;
2604  LBNEVolumePlacementData *plTargetFinHeSideLast = (fTargetCTubeOuterRadius > fTargetFinWidth) ?
2605  Create(G4String("TargetFinVertLastHeliumSide")) : 0;
2606  posTmp[0] = -0.5*fTargetFinContainerWidth - 0.023*CLHEP::mm; posTmp[1] = 0.;
2607  posTmp[2] = zCoordTmp + plTargetUpstrDownstrSegmentLastLeft->fParams[2]/2. +
2609  vSeg[0] = new G4PVPlacement((G4RotationMatrix *) 0,
2610  posTmp, plTargetUpstrDownstrSegmentLastLeft->fCurrent,
2611  G4String("TargetUpstrDowstrSegmentLastLeft"),
2612  vHelium->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2613  posTmp[0] *= -1.0;
2614  vSeg[1] = new G4PVPlacement((G4RotationMatrix *) 0,
2615  posTmp, plTargetUpstrDownstrSegmentLastRight->fCurrent,
2616  G4String("TargetUpstrDowstrSegmentLastRight"),
2617  vHelium->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2618  if (plTargetFinExtraLast != 0) {
2619  posTmp[0] = -1.0*fTargetFinContainerWidth - 0.5*fTargetFinExtraWidth - 0.040*CLHEP::mm;
2620  new G4PVPlacement((G4RotationMatrix *) 0,
2621  posTmp, plTargetFinExtraLast->fCurrent,
2622  std::string("TargetUpstrDowstrSegmentLastExtraFinLeft"),
2623  vHelium->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
2624  posTmp[0] *= -1.0;
2625  new G4PVPlacement((G4RotationMatrix *) 0,
2626  posTmp, plTargetFinExtraLast->fCurrent,
2627  std::string("TargetUpstrDowstrSegmentLastExtraFinRight"),
2628  vHelium->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
2629 
2630  }
2631  for (size_t kLeftRight=0; kLeftRight !=2; kLeftRight++) {
2632  posTmp[0] = 0.; posTmp[1] = fTargetFinHeight/2. + fTargetCTubeOuterRadius - 0.005*CLHEP::mm; posTmp[2] = 0.;
2633  G4PVPlacement *vTubeUp = new G4PVPlacement((G4RotationMatrix *) 0,
2634  posTmp, plTargetCoolingTubeLast->fCurrent,
2635  G4String("TargetUpstrDownstrCoolingTubeUpLast_PTop"),
2636  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2637 
2638  posTmp[1] *= -1.0;
2639  G4PVPlacement *vTubeDwn = new G4PVPlacement((G4RotationMatrix *) 0,
2640  posTmp, plTargetCoolingTubeLast->fCurrent,
2641  G4String("TargetUpstrDownstrCoolingTubeUpLast_PBottom"),
2642  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2643  posTmp[0] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
2644  new G4PVPlacement((G4RotationMatrix *) 0,
2645  posTmp, plTargetCoolingTubeWaterLast->fCurrent,
2646  namesSegment[kLeftRight]+G4String("CoolingTubeWater_P"),
2647  vTubeUp->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2648  new G4PVPlacement((G4RotationMatrix *) 0,
2649  posTmp, plTargetCoolingTubeWaterLast->fCurrent,
2650  namesSegment[kLeftRight]+G4String("CoolingTubeWater_P"),
2651  vTubeDwn->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2652 
2653 // posTmp[0] = (kLeftRight == 0) ? -1.0*( fTargetFinContainerWidth - fTargetFinWidth)/2. -0.010:
2654 // ( fTargetFinContainerWidth - fTargetFinWidth)/2. + 0.010;
2655 // posTmp[1] = 0.;
2656 // new G4PVPlacement((G4RotationMatrix *) 0,
2657 // posTmp, plTargetFinLast->fCurrent, G4String("TargetFinVertLast_P"),
2658 // vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2659 //
2660 // Put back some helium into the container..
2661 //
2662  if (plTargetFinHeSideLast != 0) {
2663  const double heThick = plTargetFinHeSideLast->fParams[0];
2664  const double heThickShift = -0.5*fTargetFinContainerWidth + 0.5*heThick + 0.0175*CLHEP::mm;
2665  posTmp[0] = (kLeftRight == 0) ? heThickShift : -1.0*heThickShift;
2666  posTmp[1] = 0.;
2667  new G4PVPlacement((G4RotationMatrix *) 0,
2668  posTmp, plTargetFinHeSideLast->fCurrent,
2669  namesSegment[kLeftRight]+G4String("TargetFinVertHeSide_P"),
2670  vSeg[kLeftRight]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
2671  }
2672  } // Left right/segment of the dual fins (physically one one volume, split for reason of programming convenience. )
2673  }
2674 }
intermediate_table::iterator iterator
std::string string
Definition: nybbler.cc:12
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
T abs(T value)
std::vector< double > fParams
LBNEVolumePlacementData * Create(const G4String &name)
G4RotationMatrix fRotVertical
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
G4VPhysicalVolume * fTargetHorn1HallPhysPtr
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceFinalUpstrMultiSphereTarget ( LBNEVolumePlacementData plHelium,
G4PVPlacement *  mother 
)
private
void LBNEVolumePlacements::PlaceFinalUpstrTarget ( G4PVPlacement *  mother)

Definition at line 3102 of file LBNEVolumePlacements.cc.

3102  {
3103 //
3104 // We no longer support the 700 kW option, nor the implementation of the split target..
3105 // However, the type of NuMI target we have to use depends on its length...
3106 // The 2m. long target require larger diameter cooling tubes, taller fins => bigger Helium container
3107 // containment vessel.
3108 //
3109 
3110  if (!fUseRALTGTv1){
3112  std::cerr << " LBNEVolumePlacements::PlaceFinalUpstrTarget, small NuMI tgt selected " << std::endl;
3113  this->PlaceFinalSmallTarget1p2MW(mother);
3114  } else {
3115  std::cerr << " LBNEVolumePlacements::PlaceFinalUpstrTarget, NuMI target, 4mm cooling tube, November 2016. " << std::endl;
3116  this->PlaceFinalUpstrTarget1p2MW(mother);
3117  }
3118  }
3119  else {
3120  std::cerr << " LBNEVolumePlacements::PlaceFinalUpstrTarget, Simple target, 8mm radius rod, June 2017. " << std::endl;
3121  this->PlaceRALTGTv1(mother);}
3122 
3123 
3124 
3125 
3126 }
void PlaceFinalUpstrTarget1p2MW(G4PVPlacement *mother)
void PlaceFinalSmallTarget1p2MW(G4PVPlacement *mother)
void PlaceRALTGTv1(G4PVPlacement *mother)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceFinalUpstrTarget1p2MW ( G4PVPlacement *  mother)
private

Definition at line 250 of file LBNEVolumePlacementsAdd.cc.

250  {
251 
252  // Define in LBNEDetectorConstruction..
253  //Start by defining the top level of the target container volume, which includes the canister (TargetUpstrM0)
254  // and the target section which is outside Horn1 (TargetUpstrM1)
255 
256  //
257  // We leave all the volume that are upstream of the first graphite target segment identical..
258  // We have no mechanicl drawing for this part yet.
259  //
260  Create("TargetUpstrMTop");
261  G4PVPlacement *vMTop = PlaceFinal(std::string("TargetUpstrMTop"), mother); // Obsolete.. But keep for reference
263  G4Exception("LBNEVolumePlacements::PlaceFinalUpstrTarget1p2MW", "No target! ", JustWarning, "Target has been removed");
264  return;
265  }
266 
268  Create("TargetNoSplitM1");
269  G4PVPlacement *vMt1 = PlaceFinal(std::string("TargetNoSplitM1"), fTargetHorn1HallPhysPtr);
270 
271  Create("TargetNoSplitHeContainer");
272  G4PVPlacement *vMt2 = PlaceFinal(std::string("TargetNoSplitHeContainer"), vMt1);
273 
276  } else {
278  }
279  return;
280  }
281 
282 // std::cerr << " TargetUpstrMTop created and placed ... " << std::endl;
283  LBNEVolumePlacementData *plM0 = Create("TargetUpstrM0");
284 // std::cerr << " TargetUpstrM0 created ... " << std::endl;
285 // std::cerr << " TargetUpstrM1 created ... " << std::endl;
286  G4PVPlacement *vM0 = PlaceFinal(std::string("TargetUpstrM0"), vMTop);
287  std::cerr << " TargetUpstrM0 placed ... " << std::endl;
288 
289  // Place the target module, e.g. the spherical array target (SAT) setup
290  std::cout<<"fUseTargetModule = "<<(int)fUseTargetModule<<std::endl;
291  std::cout<<"fUseTarget2Module = "<<(int)fUseTarget2Module<<std::endl;
292  if (fUseTargetModule) {
295  return;
296  }
297 
298  G4String targetTopStr; LBNEVolumePlacementData *plM1; G4PVPlacement *vM1=0;
299  targetTopStr = std::string("TargetNoSplitM1");
300  plM1 = Create(targetTopStr);
301  vM1 = PlaceFinal(targetTopStr, fTargetHorn1HallPhysPtr);
302  std::cerr << " .. " << targetTopStr
303  << " is now placed in PlaceFinalUpstrTarget1p2MW...in fTargetHorn1HallPhysPtr " << std::endl;
304  std::string tUpUp("TargetUpstrUpstr");
305  Create(tUpUp + std::string("Plate"));
306  Create(tUpUp + std::string("Can"));
307  Create(tUpUp + std::string("CanEndPlate"));
308  Create(tUpUp + std::string("DwstrFlange"));
309  Create(tUpUp + std::string("CoolingTube"));
310  Create(tUpUp + std::string("CoolingTubeWater"));
311  Create(tUpUp + std::string("SupportBlockTopLeft"));
312  Create(tUpUp + std::string("SupportBlockBottomLeft"));
313  Create(tUpUp + std::string("SupportBlockRight"));
314  Create(tUpUp + std::string("SupportSleeve"));
315  // None of these are surveyable, position is fixed.
316  PlaceFinal(tUpUp + std::string("Plate"), vM0);
317  PlaceFinal(tUpUp + std::string("Can"), vM0);
318  PlaceFinal(tUpUp + std::string("CanEndPlate"), vM0);
319  PlaceFinal(tUpUp + std::string("DwstrFlange"), vM0);
320  // Cooling tubes: two copies. This breaks the Placement data model. Never mind, assume here that misalignment
321  // of these cooling tube has negligible effect on the physics.
322 
323  G4String nameTmp5(tUpUp + std::string("CoolingTube"));
325  LBNEVolumePlacementData &infoTmp = itTmp->second;
326  G4ThreeVector posTmp;
327  posTmp[0] = 0.;
328  posTmp[1] = 0.5*fTargetFinHeight;
329  posTmp[2] = -1.0*plM0->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
331  fTargetDownstrCanFlangeThick + fTargetFlangeThick - infoTmp.fParams[2]/2 - 1.0*CLHEP::mm;
332  G4String vpNameTmp5(nameTmp5);
333 // std::cerr << " Position for " << vpNameTmp5+G4String("_PTop") << " X = "
334 // << posTmp[0] << " Y " << posTmp[1] << " Z " << posTmp[2] << std::endl;
335  G4PVPlacement *vCoolingTubeTop = new G4PVPlacement((G4RotationMatrix *) 0,
336  posTmp, infoTmp.fCurrent, vpNameTmp5+G4String("_PTop"),
337  vM0->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC );
338  posTmp[1] = -0.5*fTargetFinHeight;
339  G4PVPlacement *vCoolingTubeBottom = new G4PVPlacement((G4RotationMatrix *) 0,
340  posTmp, infoTmp.fCurrent, vpNameTmp5+std::string("_PBottom"),
341  vM0->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
342 
343  PlaceFinal(tUpUp + std::string("CoolingTubeWater"), vCoolingTubeTop);
344  PlaceFinal(tUpUp + std::string("CoolingTubeWater"), vCoolingTubeBottom); // Those are the old tubes...
345  // Incorrect, as they are now double... To be fixed, it is deemed necessary.. (all these are upstream of the first segment. )
346  PlaceFinal(tUpUp + std::string("SupportBlockTopLeft"), vM0);
347  PlaceFinal(tUpUp + std::string("SupportBlockBottomLeft"), vM0);
348  PlaceFinal(tUpUp + std::string("SupportBlockRight"), vM0);
349  PlaceFinal(tUpUp + std::string("SupportSleeve"), vM0);
350  // We need three support/alignment rods. Identical volume, but at different locations.
351  std::string nameTmp10(tUpUp + std::string("SupportRod"));
352  Create(nameTmp10);
353  itTmp = fSubVolumes.find(nameTmp10);
354  infoTmp = itTmp->second;
355  // Top Left alignment/support rod.
356  posTmp[0] = -20.5*CLHEP::mm; // Again, accurate to +- 1 mm or so.
357  posTmp[1] = 24.0*CLHEP::mm;
358  posTmp[2] = -1.0*plM0->fParams[2]/2.0 + fTargetUpstrUpstrMargin +
360  fTargetDownstrCanFlangeThick - infoTmp.fParams[2]/2 - 1.0*CLHEP::mm;
361  G4String vpNameTmp10(nameTmp10);
362  new G4PVPlacement((G4RotationMatrix *) 0,
363  posTmp, infoTmp.fCurrent, vpNameTmp10+std::string("_PTopLeft"),
364  vM0->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
365  posTmp[0] = -15.5*CLHEP::mm; // Again, accurate to +- 1 mm or so.
366  posTmp[1] = -36.0*CLHEP::mm;
367  new G4PVPlacement((G4RotationMatrix *) 0,
368  posTmp, infoTmp.fCurrent, vpNameTmp10+std::string("_PBottomLeft"),
369  vM0->GetLogicalVolume(), false, 1, fCheckVolumeOverLapWC);
370  posTmp[0] = 33.0*CLHEP::mm; // Again, accurate to +- 1 mm or so.
371  posTmp[1] = 5.0*CLHEP::mm;
372  new G4PVPlacement((G4RotationMatrix *) 0,
373  posTmp, infoTmp.fCurrent, vpNameTmp10+std::string("_PRight"),
374  vM0->GetLogicalVolume(), false, 2, fCheckVolumeOverLapWC);
375 
376 // Horizontal fin for beam alignment. Most important thing in the canister, in terms of material budget
377 // August 1/2 2016 : Allow for the capability to remove the horizontal target, as it confuses the comparison of
378 // the neutrino flux, simple optimized horns vs (evolving) conceptual horns, circa May/June 2016.
379 //
381  std::string nameTmp11("TargetFinHorizontal");
382  Create(nameTmp11);
383  PlaceFinal(nameTmp11, vM0);
384  }
385  // Done with the target canister..Now assemble the upstream part of the target it self. (Upstream of the horn1)
386  std::string tUpDown("TargetUpstrDownstr"); // Obsolete if Conceptual Horn A.
387  tUpDown = std::string("TargetNoSplit");
388  Create(tUpDown + std::string("HeContainer"));
389  G4PVPlacement *vHeTube = PlaceFinal(tUpDown + std::string("HeContainer"), vM1); // Surveyable
390  LBNEVolumePlacementData *plHelium = Create(tUpDown + std::string("Helium"));
391  G4PVPlacement *vHelium = PlaceFinal(tUpDown + std::string("Helium"), vHeTube); // Fixed
392  if (fUseMultiSphereTarget) {
393  PlaceFinalMultiSphereTarget(plHelium, vHelium);
394  return;
395  }
396  //
397  // Define a container volume to avoid overloading the volume tree.
398  //
399  LBNEVolumePlacementData *plTargetSegmentBox = Create(G4String("TargetConceptHeliumBoxSegment"));
400  LBNEVolumePlacementData *plTargetSegmentTubWWings = Create(G4String("TargetConceptHeliumTubWWings"));
401  std::cerr << " Defined the container for target fin + section of cooling tube, name "
402  << plTargetSegmentBox->fCurrent->GetName() << std::endl;
403  std::cerr << " Defined the container for winged target fin + section of cooling tube, name "
404  << plTargetSegmentTubWWings->fCurrent->GetName() << std::endl;
405  G4String nameTgtUpDownSegLeft("");
406  G4String nameTgtUpDownSegRight("");
407  LBNEVolumePlacementData *plTargetCoolingTube = 0;
408  LBNEVolumePlacementData *plTargetCoolingTubeWater = 0;
409 // LBNEVolumePlacementData *plTargetGenSegmentLeft = 0;
410  plTargetCoolingTube = Create(G4String("TargetNormalCoolingTube"));
411  plTargetCoolingTubeWater = Create(G4String("TargetNormalCoolingTubeWater"));
412  LBNEVolumePlacementData *plTargetCoolingTubeWW = Create(G4String("TargetWWingsCoolingTube"));
413  LBNEVolumePlacementData *plTargetCoolingTubeWWWater = Create(G4String("TargetWWingsCoolingTubeWater"));
414 // nameTgtUpDownSegLeft = G4String("TargetNoSplitSegmentLeft");
415 // plTargetGenSegmentLeft = Create(nameTgtUpDownSegLeft);
416 // nameTgtUpDownSegRight = G4String("TargetNoSplitSegmentRight");
417 // LBNEVolumePlacementData *plTargetUpstrDownstrSegmentRight = Create(nameTgtUpDownSegRight);
418  std::vector< std::string > namesSegment(4,"");
419  namesSegment[0] = std::string("TargetFinVertTargetCutV2UpLeft");
420  namesSegment[1] = std::string("TargetFinVertTargetCutV2UpRight");
421  namesSegment[2] = std::string("TargetFinVertTargetCutV2DwnLeft");
422  namesSegment[3] = std::string("TargetFinVertTargetCutV2DwnRight");
423  std::cerr << "LBNEVolumePlacements::PlaceFinalUpstrTarget1p2MW, central width " << fTargetFinWidth << std::endl;
424  LBNEVolumePlacementData *plTargetTargetCutV2UpLeft = Create(namesSegment[0]);
425  LBNEVolumePlacementData *plTargetTargetCutV2UpRight = Create(namesSegment[1]);
426  LBNEVolumePlacementData *plTargetTargetCutV2DwnLeft = Create(namesSegment[2]);
427  LBNEVolumePlacementData *plTargetTargetCutV2DwnRight = Create(namesSegment[3]);
428  G4PVPlacement *vSegTgt[4];
429 // G4PVPlacement *vSegTgtWWing[4]; // might be needed if we cut cornors on the wings..
430  double zCoordTmp = -1.0*plM1->fParams[2]/2.0;
431  zCoordTmp += 0.050*CLHEP::mm;
432  int copyNumberT = 0;
433  int numSegHere = fTargetNumFins;
434  std::cerr << " LBNEVolumePlacements::PlaceFinalUpstrTarget1p2MW, numSegHere "
435  << numSegHere << " Number of segment with wings " << fTargetNumFinsWithWings << std::endl;
436  //
437  // Define the target fins with wings here
438  //
439  LBNEVolumePlacementData *plTargetTargetWWingUpLeft = 0;
440  LBNEVolumePlacementData *plTargetTargetWWingUpRight = 0;
441  LBNEVolumePlacementData *plTargetTargetWWingDwnLeft = 0;
442  LBNEVolumePlacementData *plTargetTargetWWingDwnRight = 0;
443  if (fTargetNumFinsWithWings != 0) { // fins with so-called wings.
444  G4ThreeVector zeroTmp(0., 0., 0.);
445  plTargetTargetWWingUpLeft = Create(G4String("TargetWWingCylinderUpLeft"));
446  std::cerr << " plTargetTargetWWingUpLeft.... defined ... name "
447  << plTargetTargetWWingUpLeft->fCurrent->GetName() << std::endl;
448  new G4PVPlacement((G4RotationMatrix *) 0,
449  zeroTmp, plTargetTargetWWingUpLeft->fCurrent,
450  std::string("TargetWWingCylinderUpLeft_P"),
451  plTargetSegmentTubWWings->fCurrent, false, copyNumberT, fCheckVolumeOverLapWC);
452  std::cerr << " plTargetTargetWWingUpLeft.... Placed ... name "
453  << plTargetTargetWWingUpLeft->fCurrent->GetName() << std::endl;
454  plTargetTargetWWingUpRight = Create(G4String("TargetWWingCylinderUpRight"));
455  new G4PVPlacement((G4RotationMatrix *) 0,
456  zeroTmp, plTargetTargetWWingUpRight->fCurrent,
457  std::string("TargetWWingCylinderUpRight_P"),
458  plTargetSegmentTubWWings->fCurrent, false, copyNumberT, fCheckVolumeOverLapWC);
459 
460  plTargetTargetWWingDwnLeft = Create(G4String("TargetWWingCylinderDwnLeft"));
461  new G4PVPlacement((G4RotationMatrix *) 0,
462  zeroTmp, plTargetTargetWWingDwnLeft->fCurrent,
463  std::string("TargetWWingCylinderDwnLeft_P"),
464  plTargetSegmentTubWWings->fCurrent, false, copyNumberT, fCheckVolumeOverLapWC);
465  plTargetTargetWWingDwnRight = Create(G4String("TargetWWingCylinderDwnRight"));
466  new G4PVPlacement((G4RotationMatrix *) 0,
467  zeroTmp, plTargetTargetWWingDwnRight->fCurrent,
468  std::string("TargetWWingCylinderDwnRight_P"),
469  plTargetSegmentTubWWings->fCurrent, false, copyNumberT, fCheckVolumeOverLapWC);
470 
471 
472  }
473  // normal fins. Thinner, to let the pions go out of the target.
474  {
475  posTmp[0] = -0.5*plTargetTargetCutV2UpLeft->fParams[0] - 0.003*CLHEP::mm;
476  posTmp[1] = 0.5*plTargetTargetCutV2UpLeft->fParams[1] + 0.003*CLHEP::mm;
477  posTmp[2] = 0.;
478  std::cerr << " Placing target segments, no wings ... in volume = " << plTargetSegmentBox->fCurrent->GetName() << std::endl;
479  vSegTgt[0] = new G4PVPlacement((G4RotationMatrix *) 0,
480  posTmp, plTargetTargetCutV2UpLeft->fCurrent,
481  plTargetTargetCutV2UpLeft->fCurrent->GetName()+std::string("_P"),
482  plTargetSegmentBox->fCurrent, false, copyNumberT, fCheckVolumeOverLapWC);
483  posTmp[0] *= -1.0;
484  vSegTgt[1] = new G4PVPlacement((G4RotationMatrix *) 0,
485  posTmp, plTargetTargetCutV2UpRight->fCurrent,
486  plTargetTargetCutV2UpRight->fCurrent->GetName()+std::string("_P"),
487  plTargetSegmentBox->fCurrent, false, copyNumberT, fCheckVolumeOverLapWC);
488  posTmp[0] = -0.5*plTargetTargetCutV2UpLeft->fParams[0] - 0.003*CLHEP::mm;
489  posTmp[1] = -0.5*plTargetTargetCutV2UpLeft->fParams[1] - 0.003*CLHEP::mm;
490  vSegTgt[2] = new G4PVPlacement((G4RotationMatrix *) 0,
491  posTmp, plTargetTargetCutV2DwnLeft->fCurrent,
492  plTargetTargetCutV2DwnLeft->fCurrent->GetName() +std::string("_P"),
493  plTargetSegmentBox->fCurrent, false, copyNumberT, fCheckVolumeOverLapWC);
494  posTmp[0] *= -1.0;
495  vSegTgt[3] = new G4PVPlacement((G4RotationMatrix *) 0,
496  posTmp, plTargetTargetCutV2DwnRight->fCurrent,
497  plTargetTargetCutV2DwnRight->fCurrent->GetName()+std::string("_P"),
498  plTargetSegmentBox->fCurrent, false, copyNumberT, fCheckVolumeOverLapWC);
499  }
500  G4LogicalVolume *motherForCoolingTube = 0; // default fins..
501  G4LogicalVolume *theCoolingTubeV = 0;
502 // Cooling tubes. For bith kind of fins (w/o wings)
503 
504  for (int kType=0; kType != 2; kType++) {
505  if ((fTargetNumFinsWithWings == 0) && (kType == 1)) break;
506  motherForCoolingTube = plTargetSegmentTubWWings->fCurrent;
507  switch (kType) {
508  case 0: // Normal fins..
509  motherForCoolingTube = plTargetSegmentBox->fCurrent;
510  theCoolingTubeV = plTargetCoolingTube->fCurrent;
511  break;
512  case 1:
513  motherForCoolingTube = plTargetSegmentTubWWings->fCurrent;
514  theCoolingTubeV = plTargetCoolingTubeWW->fCurrent;
515  break;
516  }
517  posTmp[0] = -fTargetCTubeOuterRadius - 0.575*CLHEP::mm;
518  // for brazing.
519  posTmp[1] = fTargetFinHeight + 0.050*CLHEP::mm;
520  posTmp[2] = 0.;
521  std::cerr << " Placing Cooling tube... At XYZ = " << posTmp[0]<< "/" << posTmp[1] << "/" << posTmp[2] << " name "
522  << theCoolingTubeV->GetName() << std::endl;
523  std::cerr << " In volume " << motherForCoolingTube->GetName()
524  << " placing " << theCoolingTubeV->GetName() << std::endl;
525  new G4PVPlacement((G4RotationMatrix *) 0,
526  posTmp, theCoolingTubeV,
527  theCoolingTubeV->GetName()+ std::string("UpLeft")+ std::string("_P"),
528  motherForCoolingTube, false, copyNumberT, fCheckVolumeOverLapWC);
529  posTmp[0] *= -1.0;
530  new G4PVPlacement((G4RotationMatrix *) 0,
531  posTmp, theCoolingTubeV,
532  theCoolingTubeV->GetName()+ std::string("UpRight") + std::string("_P"),
533  motherForCoolingTube, false, copyNumberT, fCheckVolumeOverLapWC);
534  posTmp[0] *= -1.;
535  posTmp[1] *=-1.;
536  new G4PVPlacement((G4RotationMatrix *) 0,
537  posTmp, theCoolingTubeV,
538  theCoolingTubeV->GetName()+ std::string("DwnLeft") + std::string("_P"),
539  motherForCoolingTube, false, copyNumberT, fCheckVolumeOverLapWC);
540  posTmp[0] *= -1.0;
541  new G4PVPlacement((G4RotationMatrix *) 0,
542  posTmp, theCoolingTubeV,
543  theCoolingTubeV->GetName()+ std::string("DwnRight") + std::string("_P"),
544  motherForCoolingTube, false, copyNumberT, fCheckVolumeOverLapWC);
545  } // on cooling tube type.
546 //
547 // Cooling tubes water. On placement should do it...for normal wings, not quite ready for prime time.
548 //
549  G4ThreeVector posTmpWater(0., 0., 0.);
550  new G4PVPlacement((G4RotationMatrix *) 0,
551  posTmpWater, plTargetCoolingTubeWater->fCurrent,
552  std::string("TargetFinCoolingTubeWater_P"),
553  plTargetCoolingTube->fCurrent , false, 0, fCheckVolumeOverLapWC);
554  if (fTargetNumFinsWithWings != 0) {
555  new G4PVPlacement((G4RotationMatrix *) 0,
556  posTmpWater, plTargetCoolingTubeWWWater->fCurrent,
557  std::string("TargetFinWWingsCoolingTubeWater_P"),
558  plTargetCoolingTubeWW->fCurrent , false, 0, fCheckVolumeOverLapWC);
559  }
560 //
561 // New Rounded fins. The curvature of the previous version was wrong, I suspect.
562 // Also, the cut is not strictly cylindical, probably. Just take a little piece off make it a box, to be made of helium,
563 // in the side of the
564 //
565  if (fUseRoundedTargetFins) {
566  const double widthCornerOff = fTargetFinWidth * std::sqrt(1.0 - M_PI/4); // See drawing from Cory, Nov 5.
567  double heightCornerOff = plTargetTargetCutV2UpLeft->fParams[1]- fTargetCTubeOuterRadius - 0.250*CLHEP::mm;
568  // Overly complicated... Not roubst against change on the target fin width.
569 // double ddRC = 0.;
570 // if (fTargetFinWidth < 2.0*fTargetCTubeOuterRadius) {
571 // const double ddRC1 = std::abs(0.575*CLHEP::mm + fTargetCTubeOuterRadius - fTargetFinWidth);
572 // const double ddRC2 = std::abs(0.575*CLHEP::mm + fTargetCTubeOuterRadius - fTargetFinWidth - widthCornerOff);
573 // ddRC = std::min(ddRC1, ddRC2);
574 // const double thetaddRC = std::asin(ddRC/fTargetCTubeOuterRadius);
575 //
576 // heightCornerOff -= fTargetCTubeOuterRadius*std::cos(thetaddRC);
577 // }
578  const double lengthCornerOff = widthCornerOff; // made up number... Need to check with Jim H.
579  std::cerr << " Dimensions for cut corners Width " << widthCornerOff
580  << " height " << heightCornerOff << std::endl;
581  std::string aNameCornerOff = std::string("TargetRoundOffCorner");
582  G4Box* aBoxCornerOff = new G4Box(aNameCornerOff,
583  0.5*widthCornerOff, 0.5*heightCornerOff, 0.5*lengthCornerOff);
584  G4LogicalVolume *aBoxCornerOffLV =
585  new G4LogicalVolume(aBoxCornerOff,
586  G4Material::GetMaterial(std::string("HeliumTarget")), aNameCornerOff);
587  // Adjust the size of these little cuts.
588  double xOffTmpUpR = 0.5*plTargetTargetCutV2UpLeft->fParams[0] - 0.5*widthCornerOff - 0.005*CLHEP::mm;
589  double yOffTmpUpR = -0.5*plTargetTargetCutV2UpLeft->fParams[1] + 0.5*heightCornerOff + 0.005*CLHEP::mm;
590  std::cerr << " .... Position of these in CutV2 volumes X = " << xOffTmpUpR << " Y = " << yOffTmpUpR << std::endl;
591  for (size_t kCorners=0; kCorners !=4; kCorners++) {
592  double xOffTmp = xOffTmpUpR; double yOffTmp = yOffTmpUpR;
593  switch (kCorners) {
594  case 0:
595  xOffTmp *=-1.;
596  break;
597  case 1:
598  break;
599  case 2:
600  xOffTmp *=-1.;
601  yOffTmp *=-1.;
602  break;
603  case 3:
604  yOffTmp *=-1.;
605  break;
606  }
607 
608  const double zOffTmp = plTargetTargetCutV2UpLeft->fParams[2]/2. - 0.5*lengthCornerOff - 0.002*CLHEP::mm;
609  G4ThreeVector posTmpOffC(xOffTmp, yOffTmp, -1.0*zOffTmp);
610  std::cerr << " ...locate cut corners Width X = " << xOffTmp << " Y " << yOffTmp << " Z " << zOffTmp << std::endl;
611  new G4PVPlacement((G4RotationMatrix *) 0,
612  posTmpOffC, aBoxCornerOffLV,
613  aNameCornerOff + std::string("_PUpst"),
614  vSegTgt[kCorners]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
615  posTmpOffC[2] *= -1.0;
616  new G4PVPlacement((G4RotationMatrix *) 0,
617  posTmpOffC, aBoxCornerOffLV,
618  aNameCornerOff + std::string("_PDwnst"),
619  vSegTgt[kCorners]->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
620  }
621  } // Rounding off corners.
622  //
623  // Now install these segment in the Helium
624  //
625  double zLastSegment = 0.;
626  std::cerr << "Using the container for target fin + section of cooling tube, name "
627  << plTargetSegmentBox->fCurrent->GetName() << std::endl;
628  for (unsigned int iSeg=0; iSeg != static_cast<unsigned int>(numSegHere); iSeg++, copyNumberT++) { //
629 
630  std::ostringstream cNumStrStr; cNumStrStr << "_Seg" << iSeg << "_P";
631  posTmp[0] = 0.;
632  posTmp[1] = 0.;
633  posTmp[2] = zCoordTmp
634  + plTargetSegmentBox->fParams[2]/2. + iSeg*(fTargetFinLength + fTargetFinSpacingLength);
635  zLastSegment = posTmp[2];
636  if (iSeg < fTargetNumFinsWithWings) {
637 // std::cerr << " Placing target with wings segments... At Z = " << posTmp[2] << std::endl;
638  new G4PVPlacement((G4RotationMatrix *) 0,
639  posTmp, plTargetSegmentTubWWings->fCurrent,
640  std::string("TargetWWingCylinder")+cNumStrStr.str(),
641  vHelium->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
642  std::cerr << " The cooling tube volume name is " << theCoolingTubeV->GetName() << std::endl;
643  } else {
644  //
645  // Place with no misalignment...If segments are misaligned with respecto each other,s
646  // Need to use the LBNEVolumePlacement class.
647  //
648 // std::cerr << " Placing target segments, no wings ... At Z = " << posTmp[2] << std::endl;
649  new G4PVPlacement((G4RotationMatrix *) 0,
650  posTmp, plTargetSegmentBox->fCurrent,
651  plTargetSegmentBox->fCurrent->GetName()+cNumStrStr.str(),
652  vHelium->GetLogicalVolume(), false, copyNumberT, fCheckVolumeOverLapWC);
653  }
654  } // on segments.
655 
656  {
657  // Now the end
658  LBNEVolumePlacementData *plCoolingTubeReturnLeft = Create("TargetCoolingTubeReturnLoopLeft");
659  LBNEVolumePlacementData *plCoolingTubeReturnRight = Create("TargetCoolingTubeReturnLoopRight");
660  LBNEVolumePlacementData *plCoolingTubeReturnLeftWater = Create("TargetCoolingTubeReturnLoopLeftWater");
661  LBNEVolumePlacementData *plCoolingTubeReturnRightWater = Create("TargetCoolingTubeReturnLoopRightWater");
662  G4ThreeVector zeroTmp(0., 0., 0.);
663  new G4PVPlacement((G4RotationMatrix *) 0,
664  zeroTmp, plCoolingTubeReturnLeftWater->fCurrent,
665  G4String("TargetCoolingTubeReturnLoopLeftWater_P"),
666  plCoolingTubeReturnLeft->fCurrent , false, 0, fCheckVolumeOverLapWC);
667 
668  new G4PVPlacement((G4RotationMatrix *) 0,
669  zeroTmp, plCoolingTubeReturnRightWater->fCurrent,
670  G4String("TargetCoolingTubeReturnLoopRightWater_P"),
671  plCoolingTubeReturnRight->fCurrent , false, 0, fCheckVolumeOverLapWC);
672 
673  posTmp[0] = -0.350*CLHEP::mm - fTargetCTubeOuterRadius; // extra 100 microns for (unimplemented) connection.
674  posTmp[1] = 0.;
675  posTmp[2] = plHelium->fParams[2]/2 -
677  posTmp[2] = zLastSegment + plCoolingTubeReturnLeft->fParams[2] + 0.1*fTargetFinLength; // 10% of fin length to avoid clash.
678  // fine details.. a bit arbitrary..
679  // Hopefully some roo to spare..Hummm not really.
680  std::cerr << " Placing TargetCoolingTubeReturnLoopLeft, front, length of helium " << plHelium->fParams[2]/2
681  << " at Z = " << posTmp[2] << std::endl;
682  new G4PVPlacement(&plCoolingTubeReturnLeft->fRotation,
683  posTmp, plCoolingTubeReturnLeft->fCurrent,
684  G4String("TargetCoolingTubeReturnLoopLeft_P"),
685  vHelium->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
686  posTmp[0] *= -1.0;
687  new G4PVPlacement(&plCoolingTubeReturnRight->fRotation,
688  posTmp, plCoolingTubeReturnRight->fCurrent,
689  G4String("TargetCoolingTubeReturnLoopRight_P"),
690  vHelium->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
691 
692 //
693 // Open ended.. Supported from the downstream end of Horn1.
694 //
696 
697  Create("Horn1TargetDownstrHeContainerCap");
698  PlaceFinal("Horn1TargetDownstrHeContainerCap", vHelium);
699 
700  }
701 
702  } // End of the target.
703  //
704  // Now need to place the holding rings.
705  //
706  //
708  //
709  // See drawing F10063951. We approximate to a simple ring, but use the same volume of alum, roughly
710  // at the same radius. we redo the arythmetic explictly here.
711  //
712  const double radHRingAll = 23.85*CLHEP::mm; // Not the real number on drawing, but it does not fit otherwise
713  const double radHoleLighter = 2.5*CLHEP::mm;
714  const double radCoolingTube = 3.9688*CLHEP::mm;
715  const double widthCentralPlate = 32.*CLHEP::mm;
716  const double heightCentralPlate = 26*CLHEP::mm;
717  const double StotRing = M_PI*radHRingAll*radHRingAll;
718  const double SRealRing = StotRing
719  - M_PI*(10.0*radHoleLighter*radHoleLighter + 2*radCoolingTube*radCoolingTube)
720  - widthCentralPlate*heightCentralPlate
721  + 4.0*CLHEP::mm*CLHEP::mm*(2.0*2.0)*(1.0-M_PI/4.);
722  // the last term is the rounded edges of the extruded plate.
723  const double radHRingInside = 21.75*CLHEP::mm; // to include the segment container volume.
724  const double SEffRing = StotRing - M_PI*(radHRingInside*radHRingInside);
725  const double lengthHRing = 6.0*CLHEP::mm * (SRealRing/SEffRing);
726  std::cerr << " Installation of holding ring. Check: SRealRing " << SRealRing
727  << " Seff " << SEffRing << " eff Length " << lengthHRing << std::endl;
728 
729  std::string aHRingName("TargetHoldingRing");
730  G4Tubs* aHRingTub = new G4Tubs(aHRingName, radHRingInside, radHRingAll,
731  0.5*lengthHRing, 0., 360.0*CLHEP::degree);
732  G4LogicalVolume *aHRingVolLG =
733  new G4LogicalVolume(aHRingTub, G4Material::GetMaterial(std::string("Aluminum")), aHRingName);
734  const unsigned int numHRing = 7;
735  const double zHRSpacing = (zLastSegment - zCoordTmp - 15*CLHEP::mm)/(numHRing-1); // 15 mm made up.
736  for (size_t kHR=0; kHR!= 7; kHR++) {
737  const double zzHR = zCoordTmp + kHR*zHRSpacing + 7.5*CLHEP::mm;
738  G4ThreeVector posHR(0., 0., zzHR);
739  new G4PVPlacement((G4RotationMatrix *) 0, posHR, aHRingVolLG,
740  aHRingName + std::string("_P"),
741  vHelium->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
742  }
743  // End for the segment of the target, 1.2 MW.
744  }
745 }
intermediate_table::iterator iterator
std::string string
Definition: nybbler.cc:12
G4double fTargetCTubeReturnDownstrThickTitanium
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
void PlaceTargetModule(int number=1)
void PlaceFinalUpstrTargetSimpleCylinder(G4PVPlacement *mother)
void PlaceFinalMultiSphereTarget(LBNEVolumePlacementData *plHelium, G4PVPlacement *mother)
std::vector< double > fParams
unsigned int fTargetNumFinsWithWings
LBNEVolumePlacementData * Create(const G4String &name)
void PlaceFinalUpstrTargetSimpleBox(G4PVPlacement *mother)
G4double fTargetCTubeReturnDownstrThickWater
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
G4VPhysicalVolume * fTargetHorn1HallPhysPtr
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceFinalUpstrTargetSimpleBox ( G4PVPlacement *  mother)
private

Definition at line 990 of file LBNEVolumePlacementsAdd.cc.

990  {
991 // std::cerr << " Entering LBNEVolumePlacements::PlaceFinalUpstrTargetSimpleCylinder ...radius "
992 // << fSimpleTargetRadius << std::endl;
993  //
994  // Straight G4 coding. No alignment needed. Simple is Simple
995  //
996 
997  std::vector<double> fParams(3,0.);
998  fParams[0] = fSimpleTargetWidth;
999  fParams[1] = fSimpleTargetHeight;
1000  fParams[2] = fSimpleTargetLength;
1001  std::string volumeName("TargetUsptreamSimpleBox");
1002  G4Box* aBox = new G4Box(volumeName, fParams[0]/2, fParams[1]/2, fParams[2]/2.);
1003  G4LogicalVolume* fCurrent = new G4LogicalVolume(aBox, G4Material::GetMaterial("Target"), volumeName);
1004  G4ThreeVector posTmp; posTmp[1] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
1005  new G4PVPlacement((G4RotationMatrix *) 0,
1006  posTmp, fCurrent,
1007  G4String("TargetUsptreamSimpleCylinder_P"),
1008  mother->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
1009 }
std::string string
Definition: nybbler.cc:12
void LBNEVolumePlacements::PlaceFinalUpstrTargetSimpleCylinder ( G4PVPlacement *  mother)
private

Definition at line 972 of file LBNEVolumePlacementsAdd.cc.

972  {
973 
974  //
975  // Straight G4 coding. No alignment needed. Simple is Simple
976  //
977  std::vector<double> fParams(3,0.);
978  fParams[1] = fSimpleTargetRadius;
979  fParams[2] = fSimpleTargetLength;
980  std::string volumeName("TargetUsptreamSimpleCylinder");
981  G4Tubs* aTube = new G4Tubs(volumeName, fParams[0], fParams[1], fParams[2]/2., 0., 360.*CLHEP::deg);
982  G4LogicalVolume* fCurrent = new G4LogicalVolume(aTube, G4Material::GetMaterial("Target"), volumeName);
983  G4ThreeVector posTmp; posTmp[1] = 0.; posTmp[1] = 0.; posTmp[2] = 0.;
984  new G4PVPlacement((G4RotationMatrix *) 0,
985  posTmp, fCurrent,
986  G4String("TargetUsptreamSimpleCylinder_P"),
987  mother->GetLogicalVolume(), false, 0, fCheckVolumeOverLapWC);
988 }
std::string string
Definition: nybbler.cc:12
void LBNEVolumePlacements::PlaceRALTGTv1 ( G4PVPlacement *  mother)
private

Definition at line 2108 of file LBNEVolumePlacementsAdd.cc.

2108  {
2109  fUseRALTGTv1 = true;
2110  fUse1p2MWSmallTgt = false;
2111  fUseSimpleTargetCylinder = true;
2112 
2113 
2114  const G4LogicalVolume *lVolMother = mother->GetLogicalVolume();
2115  std::cerr << " Installing the RAL target version 1 "
2116  << lVolMother->GetName() << std::endl;
2117 
2118 
2119 //Target Hall and Horn 1
2120  const G4LogicalVolume *lVolMotherForTargetNoSPlitM1 = fTargetHorn1HallPhysPtr->GetLogicalVolume();
2121  std::cerr << " Installing TargetNoSplitM1 in "
2122  << lVolMotherForTargetNoSPlitM1->GetName() << std::endl;
2123 
2124 
2125 //Target Upstream M Top ( just as a mother volume, it is not actually placed )
2126  std::string targetTopStr("TargetUpstrMTop");
2127  Create(targetTopStr);
2128 
2129 
2130 //Construction of the outer helium containment tube with the tapered region and the spherical endcap
2131 
2132  G4String targetNSStr = std::string("TargetNoSplitM1");
2133  Create(targetNSStr);
2134  G4PVPlacement *vMt2 = PlaceFinal(targetNSStr, fTargetHorn1HallPhysPtr);
2135  std::cerr << " .. " << targetNSStr
2136  << " is now placed in PlaceFinalUpstrTarget1p2MW...in fTargetHorn1HallPhysPtr " << std::endl;
2137 
2138 
2139 //Helium filling of the outer helium containment tube with the tapered region and the spherical endcap
2140 
2141  G4String targetNSHelium("TargetNoSplitM1Helium");
2142  Create(targetNSHelium);
2143  G4PVPlacement *TNSvmt1 = PlaceFinal(targetNSHelium, vMt2);
2144 
2145 
2146 //Construction of the inner helium containment simple cylinder that will house the target
2147 
2148  G4String targetNSHeCont("TargetNoSplitHeContainer");
2149  Create(targetNSHeCont);
2150  //PlaceFinal(targetNSHeCont, fTargetHorn1HallPhysPtr);
2151  PlaceFinal(targetNSHeCont, TNSvmt1);
2152 
2153 
2154 //Construction of the simple cylindrical graphite target
2155 
2156  PlaceFinalRALTarget(TNSvmt1);
2157 
2158 //Construction of the cylindrical helium containment tube that will house the bafflet
2159 
2160  G4String targetNSBaffletMoth("TargetNoSplitCoolingTubeFirstMoth");
2161  Create(targetNSBaffletMoth);
2162  G4PVPlacement* HeCont2 = PlaceFinal(targetNSBaffletMoth, fTargetHorn1HallPhysPtr);
2163 
2164 
2165 //Helium filling of the cylindrical helium containment tube that will house the bafflet
2166 
2167  G4String targetNSBaffletMothHe("TargetNoSplitCoolingTubeFirstHelium");
2168  Create(targetNSBaffletMothHe);
2169  G4PVPlacement *MothHelium = PlaceFinal(targetNSBaffletMothHe, HeCont2);
2170 
2171 
2172 //Construction of the bafflet and the downstream bafflet flanging section
2173 
2174 
2175  G4String targetNSBafflet("TargetNoSplitSimpleBafflet");
2176  Create(targetNSBafflet);
2177 if (!fRemoveRALBafflet){
2178 
2179  PlaceFinal(targetNSBafflet, MothHelium);
2180 }
2181 
2182  G4String targetNSBaffletFlangeOut("TargetNoSplitSimpleBaffletFlange");
2183  Create(targetNSBaffletFlangeOut);
2184 if (!fRemoveRALBafflet){
2185  PlaceFinal(targetNSBaffletFlangeOut, MothHelium);
2186 }
2187 
2188 //Construction of the curved cold helium tube that is connected to the bafflet containment tube
2189 
2190  G4String targetNSBaffletCold("TargetNoSplitBaffletCold");
2191  Create(targetNSBaffletCold);
2192  G4PVPlacement* HeCont1 = PlaceFinal(targetNSBaffletCold, fTargetHorn1HallPhysPtr);
2193 
2194 
2195 //Helium filling of the curved cold helium tube that is connected to the bafflet containment tube
2196 
2197  G4String targetNSBaffletColdHe("TargetNoSplitBaffletColdHe");
2198  Create(targetNSBaffletColdHe);
2199  PlaceFinal(targetNSBaffletColdHe, HeCont1);
2200 
2201 
2202 
2203 
2204 //Constructing the large conical section upstream of the helium cooling tube that houses the target (incomplete)
2205 
2206  G4String targetBaffletFlange("TargetNoSplitLargeCone");
2207  Create(targetBaffletFlange);
2208  G4PVPlacement* HeCont3 = PlaceFinal(targetBaffletFlange, fTargetHorn1HallPhysPtr);
2209 
2210 
2211 //Helium filling of the large conical section upstream of the helium cooling tube that houses the target (incomplete)
2212 
2213  G4String targetBaffletFlangeHe("TargetNoSplitLargeConeHe");
2214  Create(targetBaffletFlangeHe);
2215  G4PVPlacement* vmt3 = PlaceFinal(targetBaffletFlangeHe, HeCont3);
2216 
2217 //Construction of the ring that separates the target from the incoming helium flow
2218 
2219  G4String targetRingTube("TargetNoSplitRingTube");
2220  Create(targetRingTube);
2221  PlaceFinal(targetRingTube, vmt3);
2222 
2223 
2224 //Construction of the conical + cylindrical section between the target and bafflet
2225 
2226  G4String targetNSCTube("TargetNoSplitCoolingTubeLast");
2227  Create(targetNSCTube);
2228  PlaceFinal(targetNSCTube, vmt3);
2229 
2230 
2231 //Downstream spiked support (x pieces)
2232 
2234 
2235  G4String DSSupportConnection("TargetNoSplitDSSupportConnectionRing");
2236  Create(DSSupportConnection);
2237  PlaceFinal(DSSupportConnection, fTargetHorn1HallPhysPtr);
2238 
2239  G4String DSSupportAlRing("TargetNoSplitDSSupportAlRing");
2240  Create(DSSupportAlRing);
2241  PlaceFinal(DSSupportAlRing, fTargetHorn1HallPhysPtr);
2242 
2243  G4String DSSupportLargeCone1("TargetNoSplitDSSupportLargeCones");
2244  Create(DSSupportLargeCone1);
2245  G4PVPlacement *vmt4 = PlaceFinal(DSSupportLargeCone1, fTargetHorn1HallPhysPtr);
2246 
2247  G4String DSSupportHeliumLargeCone("TargetNoSplitDSSupportHeLargeCone");
2248  Create(DSSupportHeliumLargeCone);
2249  PlaceFinal(DSSupportHeliumLargeCone, vmt4);
2250 
2251  G4String DSSupportInnerRing("TargetNoSplitDSSupportInnerRing");
2252  Create(DSSupportInnerRing);
2253  PlaceFinal(DSSupportInnerRing, fTargetHorn1HallPhysPtr);
2254 
2255  }
2256 
2257 
2258 
2259 
2260 }
void PlaceFinalRALTarget(G4PVPlacement *mother)
std::string string
Definition: nybbler.cc:12
LBNEVolumePlacementData * Create(const G4String &name)
G4PVPlacement * PlaceFinal(const G4String &name, G4VPhysicalVolume *mother)
G4VPhysicalVolume * fTargetHorn1HallPhysPtr
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceTargetInnerCan ( int  number = 1)

Definition at line 370 of file LBNFTargetModule.cc.

370  {
371 
372  std::ostringstream cNumStrStr; cNumStrStr << number;
373  G4String numString = cNumStrStr.str();
374 
375  G4String innerCanName("Target");
376  innerCanName += numString; innerCanName += "InnerCan";
377 
378  G4String outerHeName("Target");
379  outerHeName += numString; outerHeName += "OuterHeGas";
380 
381  const LBNEVolumePlacementData* mother = Find(innerCanName, outerHeName, "");
382  if (!mother) {return;}
383 
384  // The inner canister volume
385  LBNEVolumePlacementData* canInfo = this->CreateTargetVol(innerCanName, number);
386 
387  double zShift = -0.5*fTargetCaseDiffL;
388  G4ThreeVector position(0.0, 0.0, zShift);
389 
390  new G4PVPlacement((G4RotationMatrix*) 0, position, canInfo->fCurrent,
391  (innerCanName + "_P"), mother->fCurrent, false, 0, fCheckVolumeOverLapWC);
392 
393  // The inner canister helium volume
394  G4String innerHeName("Target");
395  innerHeName += numString; innerHeName += "InnerHeGas";
396  LBNEVolumePlacementData* heInfo = this->CreateTargetVol(innerHeName, number);
397 
398  new G4PVPlacement((G4RotationMatrix*) 0, G4ThreeVector(0.0, 0.0, 0.0), heInfo->fCurrent,
399  (innerHeName + "_P"), canInfo->fCurrent, false, 0, fCheckVolumeOverLapWC);
400 
401 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
LBNEVolumePlacementData * CreateTargetVol(const G4String &volName, int number=1)
void LBNEVolumePlacements::PlaceTargetModule ( int  number = 1)

Definition at line 293 of file LBNFTargetModule.cc.

293  {
294 
295  std::cout << "Calling PlaceTargetModule" << number << std::endl;
296  // InitTargetModule should already be called by LBNEVolumePlacements::setEntireTargetDims()
297 
298  this->PlaceTargetOuterCan(number);
299  this->PlaceTargetInnerCan(number);
300  this->PlaceTargetSupport(number);
301  this->PlaceTargetObject(number);
302 
303 }
void PlaceTargetSupport(int number=1)
void PlaceTargetObject(int number=1)
void PlaceTargetOuterCan(int number=1)
void PlaceTargetInnerCan(int number=1)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PlaceTargetObject ( int  number = 1)

Definition at line 453 of file LBNFTargetModule.cc.

453  {
454 
455  // Retrieve the mother volume for the spheres, which is the inner He gas regions
456  std::ostringstream cNumStrStr; cNumStrStr << number;
457  G4String numString = cNumStrStr.str();
458 
459  G4String label("Target"); label += numString;
460  int targetModuleType = fTargetModuleType;
461  if (number == 2) {targetModuleType = fTarget2ModuleType;}
462 
463  if (targetModuleType == LBNEVolumePlacements::Cylinder) {
464  label += "Cylinder";
465  } else {
466  label += "Sphere";
467  }
468 
469  G4String innerHeName("Target");
470  innerHeName += numString; innerHeName += "InnerHeGas";
471  const LBNEVolumePlacementData *mother = Find(label, innerHeName, "");
472  if (!mother) {return;}
473 
474  LBNEVolumePlacementData* placeInfo = this->CreateTargetVol(label, number);
475 
476  G4ThreeVector position(0.0, 0.0, 0.0);
477 
478  double targetRadius = fTargetRadius;
479  double targetInCaseL = fTargetInCaseL;
480  int numTargetObjects = fNumTargetObjects;
481  if (number == 2) {
482  targetRadius = fTarget2Radius;
483  targetInCaseL = fTarget2InCaseL;
484  numTargetObjects = fNumTarget2Objects;
485  }
486 
487  // Spherical array target set-up
488  if (targetModuleType == LBNEVolumePlacements::SAT) {
489 
490  // The start of the first sphere
491  double z0 = -0.5*targetInCaseL + fTargetInCaseUpL + targetRadius;
492  position[2] = z0;
493 
494  double tolerance = 0.005*CLHEP::mm;
495 
496  int iSph(0);
497  // Loop over all spheres
498  for (iSph = 0; iSph < numTargetObjects; iSph++) {
499 
500  position[2] = z0 + iSph*(targetRadius*2.0 + tolerance);
501 
502  std::ostringstream sNumStrStr; sNumStrStr << iSph;
503  new G4PVPlacement((G4RotationMatrix*) 0, position, placeInfo->fCurrent,
504  (label + "_P" + sNumStrStr.str()),
505  mother->fCurrent, false, iSph, fCheckVolumeOverLapWC);
506 
507  }
508 
509  } else if (targetModuleType == LBNEVolumePlacements::Cylinder) {
510 
511  // Just place the cylinder in the middle of the inner He gas volume
512  new G4PVPlacement((G4RotationMatrix*) 0, position, placeInfo->fCurrent,
513  (label + "_P"), mother->fCurrent, false, 0, fCheckVolumeOverLapWC);
514 
515  }
516 
517 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
double const tolerance
LBNEVolumePlacementData * CreateTargetVol(const G4String &volName, int number=1)
void LBNEVolumePlacements::PlaceTargetOuterCan ( int  number = 1)

Definition at line 305 of file LBNFTargetModule.cc.

305  {
306 
307  // Similar to TargetNoSplitM1 (and also TargetNoSplitHeContainer)
308  std::ostringstream cNumStrStr; cNumStrStr << number;
309  G4String numString = cNumStrStr.str();
310 
311  // The target hall mother volume
312  G4String outerCanName("Target");
313  outerCanName += numString; outerCanName += "OuterCan";
314 
315  const LBNEVolumePlacementData *mother = Find(outerCanName.data(), "TargetHallAndHorn1", "");
316  if (!mother) {return;}
317  double hallLength = mother->fParams[2];
318 
319  // The horn1 volume
320  const LBNEVolumePlacementData* horn1 = Find(outerCanName.data(), "Horn1PolyM1", "");
321  if (!horn1) {return;}
322 
323  // The outer canister volume
324  LBNEVolumePlacementData* canInfo = this->CreateTargetVol(outerCanName, number);
325 
326  G4ThreeVector position(0.0, 0.0, 0.0);
327 
328  // Correction for the placement of the upstream end section of the horn
329  G4double horn1Length = horn1->fParams[2];
330 
331  // This positions the downstream end of the target module at the upstream edge of the first horn
332  // which may require an additional ad-hoc z-shift correction
333  double targetModuleTotL = fTargetModuleTotL;
334  if (number == 2) {targetModuleTotL = fTarget2ModuleTotL;}
335 
336  position[2] = 0.5*hallLength - horn1Length - 0.5*targetModuleTotL;
337  // Take into account how much of the target needs to be inside the horn
338  G4double targetInHorn = targetModuleTotL - fTargetLengthOutsideHorn;
339  position[2] += targetInHorn;
340 
341  // Specify the rotation matrix for what will become the mother volume of the target module.
342  // All other internal volumes will respect this rotation
343  G4RotationMatrix* rotMatrix = 0;
344  if (number == 2) {
345  position[2] += fZModuleShift;
346  rotMatrix = fMirrorRotation;
347  }
348 
349  // If using the conceptual design horn set-up LBNFConceptDesignHorns::PlaceFinalLBNFConceptHornA()
350  // then we need to shift the target module further upstream relative to the mother volume Horn1PolyM1,
351  // owing to the larger gap downstream between the target end and the remaining hall/horn1 space.
352  // This positions the start of the target module very close to z = 0 m
353  if (fUseLBNFOptimConceptDesignHornA) {position[2] -= 31.0*CLHEP::cm;}
354 
355  new G4PVPlacement(rotMatrix, position, canInfo->fCurrent,
356  (outerCanName + "_P"), mother->fCurrent, false, 0, fCheckVolumeOverLapWC);
357 
358  // The helium gas inside the outer canister
359  G4String heName("Target");
360  heName += numString; heName += "OuterHeGas";
361  LBNEVolumePlacementData* heInfo = this->CreateTargetVol(heName, number);
362 
363  // Simply place this helium region inside its mother volume, TargetOuterCan
364  new G4PVPlacement((G4RotationMatrix*) 0, G4ThreeVector(0.0, 0.0, 0.0), heInfo->fCurrent,
365  (heName + "_P"), canInfo->fCurrent, false, 0, fCheckVolumeOverLapWC);
366 
367 
368 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
LBNEVolumePlacementData * CreateTargetVol(const G4String &volName, int number=1)
std::vector< double > fParams
G4RotationMatrix * fMirrorRotation
void LBNEVolumePlacements::PlaceTargetSupport ( int  number = 1)

Definition at line 403 of file LBNFTargetModule.cc.

403  {
404 
405  // We do not need the internal support rods for the cylinder, but we still keep
406  // the fTargetSupportD gap to allow for the He gas flow
407  int targetModuleType = fTargetModuleType;
408  if (number == 2) {targetModuleType = fTarget2ModuleType;}
409  if (targetModuleType == LBNEVolumePlacements::Cylinder) {return;}
410 
411  std::ostringstream cNumStrStr; cNumStrStr << number;
412  G4String numString = cNumStrStr.str();
413 
414  G4String supportName("Target");
415  supportName += numString; supportName += "Support";
416 
417  G4String innerHeName("Target");
418  innerHeName += numString; innerHeName += "InnerHeGas";
419 
420  // The target support rods are placed inside the inner He gas region
421  const LBNEVolumePlacementData* mother = Find(supportName, innerHeName, "");
422  if (!mother) {return;}
423 
424  // The support rods; place 3 of these separated by 120 degrees in the x-y plane
425  LBNEVolumePlacementData* rodInfo = this->CreateTargetVol(supportName, number);
426 
427  G4double x0 = 0.0;
428  G4double y0 = fTargetRadius + 0.5*fTargetSupportD;
429  if (number == 2) {y0 = fTarget2Radius + 0.5*fTargetSupportD;}
430 
431  int i(0);
432  for (i = 0; i < 3; i++) {
433 
434  G4double phi = -M_PI*120.0*i/180.0;
435  G4double cPhi = cos(phi);
436  G4double sPhi = sin(phi);
437  G4double x = x0*cPhi - y0*sPhi;
438  G4double y = y0*cPhi + x0*sPhi;
439  G4double z = 0.0;
440 
441  //std::cout<<"Target support rod: phi = "<<phi*180.0/M_PI<<", x = "<<x<<", y = "<<y<<std::endl;
442  G4ThreeVector position(x, y, z);
443 
444  std::ostringstream sNumStrStr; sNumStrStr << i;
445  new G4PVPlacement((G4RotationMatrix*) 0, position, rodInfo->fCurrent,
446  (supportName + "_P" + sNumStrStr.str()),
447  mother->fCurrent, false, 0, fCheckVolumeOverLapWC);
448 
449  }
450 
451 }
const LBNEVolumePlacementData * Find(const G4String &name, const char *motherName, const char *method) const
double y
LBNEVolumePlacementData * CreateTargetVol(const G4String &volName, int number=1)
double z
list x
Definition: train.py:276
void LBNEVolumePlacements::PreparePolyconForConceptHornA ( )

Definition at line 2531 of file LBNFConceptDesignHorns.cc.

2531  {
2532 
2533  // So we simplify. We remove the bulge at the downstream end.
2534 //
2537  // Dimension are based on the NX tool .
2538  const double outRadMax = 220.52; // Drawing F10068454. The inner radius of the OC, some 47 mm from the start of the target.
2539  // The upstream out flange has an outer radius of 665. mm , 1 mm clearance
2540  const double outLengthMax = 2277. + 25.; // Drawing 10068454. Includes the Upstr and downstream Inner to Outer radius.
2541  // Nore we will have to shift the mother volume by ~50.00 mm, the distance between the most upstream point
2542  // of the I/O piece of the upstream I/O transition and the start of the inner conductor.
2543  // Also add ~2 mm for the Outer I/O transition. Approximate
2544  // for the geometry with the bulge for downstream I/O section.
2545  // Oct 13 2016
2546 
2547  G4ThreeVector v1(outRadMax, 1.2500, 0.00);
2549  SetHornsPolyInnerThreeVect(1, 0, v1);
2550  const double inRadMinCyl = 43.0; // Inner Inner radius. for the cylindrical pieces
2551  // Exact, Clearance of 150 microns or so in Horn1PolyM1
2552  // declaration... See Drawing F10068382
2553  //
2554  // Tracking difficulty, the HornPolyM1 volume is too close to the IC. we try to put more than 100 microns..
2555  // rare bug geomNav0003 problem.
2556  G4ThreeVector v2(inRadMinCyl -3.0, 2.000, 1.00);
2558  SetHornsPolyInnerThreeVect(1, 1, v2);
2559  const double endOfCylIC = 1170.5 + 25. + 25.; // include the thick piece of Al at a radius of 43 + 2 + 25.
2560 
2561  G4ThreeVector v3(inRadMinCyl - 3.0, 2.000, endOfCylIC ); // Inner Rad starts decreasing . 100 microns
2562  // This is the tapered version.
2564  SetHornsPolyInnerThreeVect(1, 2, v3);
2565  // Now the conical section.
2566  const double endOfIC = 2188. + 25.0 + 1.; // 25. to include the thickness of
2567  // the bulk cylinder upstr of IC, from R 43+50 to R ~220
2568  const double inRadMin = 33.0;
2569  G4ThreeVector v4(inRadMin - 3.0, 2.000, endOfIC); //
2571  SetHornsPolyInnerThreeVect(1, 3, v4);
2572  const double radOutIOC = 86.2;
2573  for (int kTheta = 1; kTheta != 6; kTheta++) {
2574  const double thetaIOC = kTheta*M_PI/10.;
2575 
2576  G4ThreeVector vkTH(inRadMin - 0.1 + radOutIOC*(1.0-std::cos(thetaIOC)),
2577  2. + 5.*std::sin(thetaIOC),
2578  endOfIC + radOutIOC*std::sin(thetaIOC) + 2.0*CLHEP::mm);
2579  // It has curvature... 2 mm clearance... Maintainance headache,
2580  // duplicate constants wit those in PlaceFinalLBNFConceptHornA
2581  SetHorn1PolyInnerThreeVect(3+kTheta, vkTH);
2582  SetHornsPolyInnerThreeVect(1, 3+kTheta, vkTH);
2583  }
2584  //
2585  G4ThreeVector v10(outRadMax, 0.020, outLengthMax+0.001 + 3.0*CLHEP::mm); // Thickness is virtual
2587  SetHornsPolyInnerThreeVect(1, 9, v10);
2588 
2589  //fix mag field
2590  SetHorn1PolyOuterRadius(outRadMax);
2591  SetHornsPolyOuterRadius(1, outRadMax);
2592 
2593 
2594 }
void SetHorn1PolyOuterRadius(double r)
void SetUseHorn1PolyNumInnerPts(int n)
void SetHornsPolyOuterRadius(size_t hornNumber, double r)
void SetUseHornsPolyNumInnerPts(size_t hornNumber, size_t nElem)
void SetHornsPolyInnerThreeVect(size_t hornNumber, size_t iP, G4ThreeVector vVal)
void SetHorn1PolyInnerThreeVect(size_t iP, G4ThreeVector vVal)
void LBNEVolumePlacements::PreparePolyconForConceptHornB ( )

Definition at line 2595 of file LBNFConceptDesignHorns.cc.

2595  {
2596 
2598  const double outRadMax = (811.5 + 2.0); // set by the Downstream OC current equalizer section connection pads
2599  // Includes the upstream and downstream Inner to Outer transition.
2600  // Also (the ~ 2 cm ) the thickness of the downstream flange, and the upstream few cm length of the
2601  // current transition sections. does not includes the downstream section of these.
2602  const double distUpstreamToBeginIC = 242.25;
2603  G4ThreeVector v1(outRadMax, 0.05, 0.00);
2604  SetHornsPolyInnerThreeVect(2, 0, v1);
2605  const double inRadMin = 159.0; // Inner Inner radius. Exact, Clearance of 150 microns or so in Horn1PolyM1
2606  // declaration... See Drawing F10071359
2607  G4ThreeVector v2(inRadMin, 3.000, 1.00);
2608  SetHornsPolyInnerThreeVect(2, 1, v2);
2609  double zzTmp = 1090. + distUpstreamToBeginIC; // We take the downstream edge.
2610  G4ThreeVector v3(inRadMin, 3.0, zzTmp); // Inner Rad starts increasing.
2611  SetHornsPolyInnerThreeVect(2, 2, v3);
2612  zzTmp += 878.67;
2613  G4ThreeVector v4(81.0, 2.000, zzTmp);
2614  SetHornsPolyInnerThreeVect(2, 3, v4);
2615  zzTmp += 62.368;
2616  G4ThreeVector v5(81.0, 3.0, zzTmp); //
2617  SetHornsPolyInnerThreeVect(2, 4, v5);
2618  zzTmp += 22.31;
2619  G4ThreeVector v6(83.6, 3.0, zzTmp); // This in reality a curve transition, but will be approximate as a straight cone.
2620  SetHornsPolyInnerThreeVect(2, 5, v6);
2621  zzTmp += 640.38 ;
2622  G4ThreeVector v7(223., 3.0, zzTmp); // Took the middle of a 2nd curve transtition, to the downstream cylindrical
2623  SetHornsPolyInnerThreeVect(2, 6, v7);
2624  zzTmp += 1042.8 + 0.5; // the end of the last IC cylindrical section. 500 microns added.
2625  G4ThreeVector v8(225., 3.0, zzTmp); // Also approximate. Not essential
2626  SetHornsPolyInnerThreeVect(2, 7, v8);
2627  // We add now the downstream Inner to Outer transition section,
2628  zzTmp += 150. + 1.0; // the end of the last of this transition
2629  G4ThreeVector v9(225., 3.0, zzTmp); // Also approximate. Not essential
2630  SetHornsPolyInnerThreeVect(2, 8, v9);
2631  zzTmp += 975. - 151.; // the end current equlizer section.
2632  G4ThreeVector v10(630., 3.0, zzTmp); // Also approximate. Not essential
2633  SetHornsPolyInnerThreeVect(2, 9, v10);
2634  zzTmp += 0.5; // clearance.. near the end.
2635  G4ThreeVector v11(outRadMax, 0.05, zzTmp);
2636  SetHornsPolyInnerThreeVect(2, 10, v11);
2637 
2638  SetHornsPolyOuterRadius(2, outRadMax);
2639  const double zStartHorn2Set = GetHornsPolyZStartPos(2);
2640  SetHornsPolyZStartPos(2, (zStartHorn2Set - 0.5*distUpstreamToBeginIC));
2641  //Place it such that the start of the effective field region is 1/2 way between the start of
2642  // of the upstream IO trnasition, and the beginning of the IC at the same location as
2643  std::cerr << " Shifting start of Horn2 magnetic field region from " << zStartHorn2Set
2644  << " by " << -1.*distUpstreamToBeginIC << " to take into account I/O transition. " << std::endl;
2645  // for simplified (idealistic) horn) . Accurate to a ~ cm
2646 
2647 
2648 }
void SetHornsPolyZStartPos(size_t hornNumber, double z)
double GetHornsPolyZStartPos(size_t iH) const
void SetHornsPolyOuterRadius(size_t hornNumber, double r)
void SetUseHornsPolyNumInnerPts(size_t hornNumber, size_t nElem)
void SetHornsPolyInnerThreeVect(size_t hornNumber, size_t iP, G4ThreeVector vVal)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PreparePolyconForConceptHornC ( )

Obtained by counting the number of instance of

Definition at line 2651 of file LBNFConceptDesignHorns.cc.

2651  {
2652 //
2653 // The current magnetic field map used the optimized, simple, polycone representation of the
2654 // inner conductor. We might as well doing it a bit more precisely than for Horn B, since the curved
2655 // section are a bit longer. If successul, we'll got back to HornB, at a later stage
2656 //
2657 // December 20-23: Revision 2, from drawing Nx9, F10071767, and related.
2658 //
2659  SetUseHornsPolyNumInnerPts(3, 33); /// Obtained by counting the number of instance of
2660  // SetUseHornsPolyNumInnerPts. A rather moronic way..
2661  const double outRadMax = (811.5 + 2.0); // Drawing F10071771. with 2 mm clearance
2662  // Driven by the upstream Current Equalizer section outer, upstream flange.
2663  // Includes the upstream and downstream Inner to Outer transition.
2664  // Also (the ~ 2 cm ) the thickness of the downstream flange, and the upstream few cm length of the
2665  // current transition sections. does not includes the downstream section of these.
2666  const double distUpstreamIOToBeginIC = (237.451 - 106.0479 + 0.025)*CLHEP::mm;
2667  const double distUpstrCurrEQToBeginIC = (926. + 0.025)*CLHEP::mm;
2668  G4ThreeVector v1(outRadMax, 0.05, 0.00);
2669  SetHornsPolyInnerThreeVect(3, 0, v1);
2670  const double inRadMinCurrEq = (707. -1.0)*CLHEP::mm;
2671  G4ThreeVector v2(inRadMinCurrEq, 4.000, 1.00);
2672  SetHornsPolyInnerThreeVect(3, 1, v2);
2673  const double inRadMin = 284.0; // Inner Inner radius. Exact, Clearance of 150 microns or so in Horn1PolyM1
2674  // declaration... See Drawing F10071765
2675  G4ThreeVector v2a(inRadMinCurrEq, 4.000, distUpstrCurrEQToBeginIC - 1.0*CLHEP::mm - distUpstreamIOToBeginIC );
2676  SetHornsPolyInnerThreeVect(3, 2, v2a);
2677 
2678  G4ThreeVector v2b(inRadMin, 4.000, distUpstrCurrEQToBeginIC - 1.0*CLHEP::mm );
2679  SetHornsPolyInnerThreeVect(3, 3, v2b);
2680 
2681  double zzTmp = 336.8430 + distUpstrCurrEQToBeginIC;
2682  G4ThreeVector v3(inRadMin, 4.0, zzTmp); // Inner Rad starts increasing.
2683  int iNumPt = 4;
2684  SetHornsPolyInnerThreeVect(3, iNumPt, v3);
2686  //
2687  // A radial curve., up to a distance off
2688  const double distZPtU1 = (398.2670 - 336.8430)*CLHEP::mm;
2689  const double deltaRU1 = inRadMin - 262.9119*CLHEP::mm;
2690  const double thetaArcU1 = std::atan(deltaRU1/(0.5*distZPtU1));
2691  const double outRadU1 = distZPtU1/std::sin(thetaArcU1);
2692  const int numStepU1 = 8; // should be fine enough
2693  const double thetaStepU1 = thetaArcU1/numStepU1;
2694  for (int iStepU1 = 0.; iStepU1 != numStepU1; iStepU1++) {
2695  const double thU1 = thetaStepU1*(iStepU1+1);
2696  const double rrU1 = inRadMin - outRadU1 * (1.0 - std::cos(thU1));
2697  const double dzU1 = outRadU1*std::sin(thU1);
2698  G4ThreeVector vTmpU1(rrU1, 4.0, zzTmp + dzU1);
2699  iNumPt++;
2700  SetHornsPolyInnerThreeVect(3, iNumPt, vTmpU1);
2701  }
2703 
2704  zzTmp = 553.1053 + distUpstrCurrEQToBeginIC; ; //Now we go straight to the next intersection.
2705  const double distZPtU2 = (586.2743 - 553.1053)*CLHEP::mm;
2706  const double inRadMinU2 = 142.3876;
2707  G4ThreeVector vU1ToU2(inRadMinU2, 4.000, zzTmp); iNumPt++;
2708  SetHornsPolyInnerThreeVect(3, iNumPt, vU1ToU2);
2710  const double innerRadNeck = 131.0*CLHEP::mm;
2711  const double deltaRadMinU32 = inRadMinU2 - innerRadNeck;
2712  const double distZPtU2byHalf = 0.5*distZPtU2;
2713  const double thetaArcU2 = std::atan(deltaRadMinU32/(distZPtU2byHalf));
2714  const int numStepU2 = 6; // should be fine enough
2715  const double thetaStepU2 = thetaArcU2/numStepU2;
2716  const double outRad2 = distZPtU2/std::sin(thetaArcU2);
2717  double thetaCurrU2 = thetaArcU2;
2718  for (int iStepU2 = 0.; iStepU2 != numStepU2; iStepU2++) {
2719  thetaCurrU2 -= thetaStepU2;
2720  const double drrU2 = outRad2*(1.0-std::cos(thetaCurrU2));
2721  const double dzU2 = outRad2*std::sin(thetaCurrU2);
2722  G4ThreeVector vTmpU2(innerRadNeck + drrU2, 4.0, zzTmp + distZPtU2 - dzU2);
2723  iNumPt++;
2724  SetHornsPolyInnerThreeVect(3, iNumPt, vTmpU2);
2725  }
2726  zzTmp += distZPtU2;
2728  //
2729  // Next we have the Neck.
2730  //
2731  zzTmp += 118.9697*CLHEP::mm;
2732  G4ThreeVector vNeckD(innerRadNeck, 4.000, zzTmp); iNumPt++;
2733  SetHornsPolyInnerThreeVect(3, iNumPt, vNeckD);
2735  //
2736  // Neck to downstream cone transition.
2737  const double distZPtD1 = (147.8974 - 118.9697)*CLHEP::mm;
2738  const double innerRadD1 = 135.4465*CLHEP::mm;
2739  const double deltaInnerRadD1 = innerRadD1 - innerRadNeck;
2740 // const double thetaArcD1 = std::atan(deltaInnerRadD1/distZPtD1byHalf);
2741  // theta is a bit bigger than the other case... refine
2742  const double outRad3 = (distZPtD1*distZPtD1 + deltaInnerRadD1*deltaInnerRadD1)/(2.0*deltaInnerRadD1);
2743  const double thetaArcD1 = std::asin(distZPtD1/outRad3);
2744  const int numStepD1 = 4;
2745  const double thetaStepD1 = thetaArcD1/numStepD1;
2746  double thetaCurrD1 = 0.;
2747  for (int iStepD1 = 0.; iStepD1 != numStepD1; iStepD1++) {
2748  thetaCurrD1 += thetaStepD1;
2749  const double drrD1 = outRad3*(1.0-std::cos(thetaCurrD1));
2750  const double dzD1 = outRad3*std::sin(thetaCurrD1);
2751  G4ThreeVector vTmpD1(innerRadNeck + drrD1, 4.0, zzTmp + dzD1);
2752  iNumPt++;
2753  SetHornsPolyInnerThreeVect(3, iNumPt, vTmpD1);
2754  }
2755  zzTmp += distZPtD1;
2757  //
2758  // The downstream cone.
2759  //
2760  const double innerRadD2 = 357.7245*CLHEP::mm;
2761  const double distZPtD2 = 735.5382*CLHEP::mm;
2762  zzTmp += distZPtD2;
2763  G4ThreeVector vTmpD2(innerRadD2, 4.0, zzTmp);
2764  iNumPt++;
2765  SetHornsPolyInnerThreeVect(3, iNumPt, vTmpD2);
2767  //
2768  // The last curve section.
2769  //
2770  const double distZPtD3 = 28.9277*CLHEP::mm;
2771  const double distZPtD3byHalf = 0.5*distZPtD3;
2772  const double innerRadD3 = 362*CLHEP::mm;
2773  const double deltaInnerRadD3 = innerRadD3 - innerRadD2;
2774  const double thetaArcD3 = std::atan(deltaInnerRadD3/distZPtD3byHalf);
2775  const int numStepD3 = 4;
2776  const double thetaStepD3 = thetaArcD3/numStepD3;
2777  const double outRad5 = distZPtD3/std::sin(thetaArcD3);
2778  double thetaCurrD3 = thetaArcD3;
2779  for (int iStepD3 = 0.; iStepD3 != numStepD3; iStepD3++) {
2780  thetaCurrD3 -= thetaStepD3;
2781  const double drrD3 = outRad5*(1.0-std::cos(thetaCurrD3));
2782  const double dzD3 = outRad5*std::sin(thetaCurrD3);
2783  G4ThreeVector vTmpD3(innerRadD3 - drrD3, 4.0, zzTmp + distZPtD3 - dzD3);
2784  iNumPt++;
2785  SetHornsPolyInnerThreeVect(3, iNumPt, vTmpD3);
2786  }
2787  zzTmp += distZPtD3;
2789  // The downstream tube..
2790  zzTmp += 554.3802*CLHEP::mm;
2791  G4ThreeVector vTmpD5(innerRadD3, 4.0, zzTmp);
2792  iNumPt++;
2793  SetHornsPolyInnerThreeVect(3, iNumPt, vTmpD5);
2794  // We add a 45 degree section for to the downstream torus
2795 
2796  zzTmp += 138.0*CLHEP::mm; // with 10 mm clearance...
2797  // The downstream tube..
2798  G4ThreeVector vTmpD6(innerRadD3, 4.0, zzTmp);
2799  iNumPt++;
2800  SetHornsPolyInnerThreeVect(3, iNumPt, vTmpD6);
2801  // Going up to the inner radius of the outer conductor
2802  zzTmp += 0.5*CLHEP::mm;
2803  G4ThreeVector vTmpD7(701.0*CLHEP::mm, 4.0, zzTmp);
2804  iNumPt++;
2805  SetHornsPolyInnerThreeVect(3, iNumPt, vTmpD7);
2807 
2808  SetHornsPolyOuterRadius(3, outRadMax);
2809  const double zStartHorn3SetUser = this->GetHornsPolyZStartPos(3);
2810  const double zStartHorn3Set = this->GetHornsPolyZStartPos(3) - distUpstrCurrEQToBeginIC + 0.5*131.254*CLHEP::mm;
2811  // last number is the radius of the upstream I/O transition.
2812  this->SetHornsPolyZStartPos(3, zStartHorn3Set);
2813  //Place it such that the start of the effective field region is 1/2 way between the start of
2814  // of the upstream IO trnasition, and the beginning of the IC at the same location as
2815  std::cerr << " Shifting start of Horn3 magnetic field region from " << zStartHorn3SetUser
2816  << " to " << zStartHorn3Set << " to take into account current Eq and I/O transition. " << std::endl;
2817  //
2818  // Now we print the result...
2819  //
2820 // std::ofstream fOut("./HornCRZ.txt");
2821 // fOut << " Z ZfIC R " << std::endl;
2822 // for(std::vector<G4ThreeVector>::const_iterator itD = fHornsPolyListRinThickZVects[2].begin();
2823 // itD != fHornsPolyListRinThickZVects[2].end(); itD++) {
2824 // fOut << " " << itD->z() << " " << itD->z() - distUpstrCurrEQToBeginIC << " " << itD->x() << std::endl;
2825 // }
2826 // fOut.close();
2827 // std::cerr << " And quit for now.... " << std::endl; exit(2);
2828 }
void SetHornsPolyZStartPos(size_t hornNumber, double z)
double GetHornsPolyZStartPos(size_t iH) const
size_t fLBNFOptimConceptDesignHornCNumStepIC[10]
void SetHornsPolyOuterRadius(size_t hornNumber, double r)
void SetUseHornsPolyNumInnerPts(size_t hornNumber, size_t nElem)
void SetHornsPolyInnerThreeVect(size_t hornNumber, size_t iP, G4ThreeVector vVal)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::PrintAll ( ) const

Definition at line 3128 of file LBNEVolumePlacements.cc.

3128  {
3129 
3130  std::cout << "======================================================================================" << std::endl;
3131  std::cout << " Dump of all the Placed Volumes " << std::endl;
3133  it++) {
3134 
3135  const LBNEVolumePlacementData &info = it->second;
3136  std::cout << " SubVolume " << it->first << " of type " << info.fTypeName;
3137  if (info.fMother == 0) std::cout << " has no assigned mother volume" << std::endl;
3138  else std::cout << " is in logical volume " << info.fMother->GetLogicalVolume()->GetName() << std::endl;
3139  std::cout << " .... Params Values ";
3140  for (std::vector<double>::const_iterator ip=info.fParams.begin(); ip!=info.fParams.end(); ip++)
3141  std::cout << " " << (*ip) << ", ";
3142  std::cout << std::endl;
3143  std::cout << " .... Position " << info.fPosition;
3144  std::cout << std::endl;
3145  if (!info.fRotationIsUnitMatrix) {
3146  std::cout << " .......... Has a rotation matrix ";
3147  info.fRotation.print(std::cout);
3148  }
3149  std::cout << "-----------------------------------------------------------------------------------" << std::endl;
3150 
3151  }
3152  std::cout << "======================================================================================" << std::endl;
3153 }
intermediate_table::const_iterator const_iterator
std::map< G4String, LBNEVolumePlacementData > fSubVolumes
std::vector< double > fParams
G4VPhysicalVolume * fMother
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::RescaleHorn1Lengthwise ( )

Definition at line 206 of file LBNEDownstrVolPlacements.cc.

206  {
207 
208  if (fHorn1LongRescaleCnt != 0) {
209  G4Exception("LBNEVolumePlacements::RescaleHorn1Lengthwise", "",
210  FatalErrorInArgument, " This method can only be called once per job ");
211  }
215 
216  for (size_t k=0; k != fHorn1UpstrLengths.size(); ++k)
218  for (size_t k=0; k != fHorn1UpstrZPositions.size(); ++k)
220 
221  for (size_t k=0; k != fHorn1UpstrOuterIOTransLengths.size(); ++k)
223 
224  for (size_t k=0; k != fHorn1UpstrOuterIOTransPositions.size(); ++k)
226 
227  for (size_t k=0; k != fTargetHorn1Lengths.size(); ++k)
229  for (size_t k=0; k != fTargetHorn1ZPositions.size(); ++k)
230  fTargetHorn1ZPositions[k] *= fHorn1LongRescale; // This will be approximate...
231 
234 
235  // Now we deal with the inner conductor radial equations.
237  it != fHorn1Equations.end(); it++) it->SetLongRescaleFactor(fHorn1LongRescale);
238 
241 
242 // for (size_t k=0; k != fHorn1SectionLengths.size(); ++k)
243 // fHorn1SectionLengths[k] *= fHorn1LongRescale;
244 // fHorn1OuterTubeInnerLength *= fHorn1LongRescale; // ??????????????///
247 // fHorn1InnerTopUpstrLength *= fHorn1LongRescale; // ??????????? Check that all the rescale is consistently...
248 // fHorn1InnerTopDownstrLength *= fHorn1LongRescale;
249 
250 //
251 // Aug 18 2014., for simplified geometry.
253  (*it) *= fHorn1LongRescale;
254 
255 }
std::vector< double > fMotherHorn1AllLengths
std::vector< LBNEHornRadialEquation > fHorn1Equations
intermediate_table::iterator iterator
std::vector< G4double > fTargetHorn1ZPositions
std::vector< G4double > fHorn1UpstrOuterIOTransPositions
std::vector< G4double > fHorn1UpstrOuterIOTransLengths
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::vector< G4double > fTargetHorn1Lengths
std::vector< G4double > fHorn1UpstrZPositions
std::vector< G4double > fHorn1UpstrLengths
void LBNEVolumePlacements::RescaleHorn1Radially ( )

Definition at line 257 of file LBNEDownstrVolPlacements.cc.

257  { // Note: not all variables are rescale here,
258  if (fHorn1RadialRescaleCnt != 0) {
259  G4Exception("LBNEVolumePlacements::RescaleHorn1Radially", "",
260  FatalErrorInArgument, " This method can only be called once per job ");
261  }
263  // Some of this work will be done via the LBNEHornRadialEquation
266 
267  for (size_t k=0; k != fHorn1UpstrOuterIOTransInnerRads.size(); ++k)
269  for (size_t k=0; k != fHorn1UpstrOuterIOTransThicks.size(); ++k)
271 
272  for (size_t k=0; k != fTargetHorn1InnerRadsUpstr.size(); ++k)
274  for (size_t k=0; k != fTargetHorn1InnerRadsDownstr.size(); ++k)
276  for (size_t k=0; k != fTargetHorn1TransThick.size(); ++k)
278 
279  for (size_t k=0; k != fHorn1UpstrInnerRadsUpstr.size(); ++k)
281  for (size_t k=0; k != fHorn1UpstrInnerRadsDownstr.size(); ++k)
283 
284  for (size_t k=0; k != fHorn1UpstrInnerRadsOuterUpstr.size(); ++k)
286  for (size_t k=0; k != fHorn1UpstrInnerRadsOuterDownstr.size(); ++k)
288 
289 // fHorn1TopUpstrInnerRad *= fHorn1RadialRescale; Recomputed in CreateHorn1TopLevelUpstr
290 
294 
296  // Now we deal with the inner conductor radial equations.
298  it != fHorn1Equations.end(); it++) it->SetRadialRescaleFactor(fHorn1RadialRescale);
299 
300 //
301 // Aug 18 2014., for simplified geometry.
302  for(std::vector<double>::iterator it = fMotherHorn1AllRads.begin(); it != fMotherHorn1AllRads.end(); it++)
303  (*it) *= fHorn1RadialRescale;
304 }
std::vector< LBNEHornRadialEquation > fHorn1Equations
intermediate_table::iterator iterator
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::vector< G4double > fTargetHorn1InnerRadsUpstr
std::vector< G4double > fHorn1UpstrOuterIOTransInnerRads
std::vector< G4double > fHorn1UpstrInnerRadsOuterUpstr
std::vector< G4double > fHorn1UpstrInnerRadsOuterDownstr
std::vector< G4double > fHorn1UpstrOuterIOTransThicks
std::vector< G4double > fHorn1UpstrInnerRadsDownstr
std::vector< G4double > fTargetHorn1TransThick
std::vector< G4double > fHorn1UpstrInnerRadsUpstr
std::vector< double > fMotherHorn1AllRads
std::vector< G4double > fTargetHorn1InnerRadsDownstr
void LBNEVolumePlacements::RescaleHorn2Lengthwise ( )

Definition at line 917 of file LBNEDownstrVolPlacements.cc.

917  {
918  if (fHorn2LongRescaleCnt != 0) {
919  G4Exception("LBNEVolumePlacements::RescaleHorn2Lengthwise", "",
920  FatalErrorInArgument, " This method can only be called once per job ");
921  }
923  for (size_t i=0; i!= fHorn2PartsLengths.size(); i++)
926  for (size_t i=0; i!= fHorn2UpstrOuterIOTransLengths.size(); i++)
928  for (size_t i=0; i!= fHorn2UpstrOuterIOTransPositions.size(); i++)
932  // Now we deal with the inner conductor radial equations.
934  it != fHorn2Equations.end(); it++) it->SetLongRescaleFactor(fHorn2LongRescale);
935 
938  // We also have to move the decay pipe snout, as Horn2 is longer..
940 
941 
942 }
intermediate_table::iterator iterator
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::vector< G4double > fHorn2UpstrOuterIOTransPositions
std::vector< LBNEHornRadialEquation > fHorn2Equations
std::vector< G4double > fHorn2PartsLengths
std::vector< G4double > fHorn2UpstrOuterIOTransLengths
void LBNEVolumePlacements::RescaleHorn2Radially ( )

Definition at line 944 of file LBNEDownstrVolPlacements.cc.

944  {
945 // If the user really want it call twice, so be it. Amit, Paul, March 27 2015...
946 // if (fHorn2RadialRescaleCnt != 0) {
947 // G4Exception("LBNEVolumePlacements::RescaleHorn2Radially", "",
948 // FatalErrorInArgument, " This method can only be called once per job ");
949 // }
951 // std::cerr << " LBNEVolumePlacements::RescaleHorn2Radially, fHorn2RadialRescale = " << fHorn2RadialRescale
952 // << "fHorn2RadialRescaleCst " << fHorn2RadialRescaleCst << std::endl;
953  for (size_t i=0; i!= fHorn2PartsRadii.size(); i++) {
955  }
959  for (size_t i=0; i!= fHorn2UpstrOuterIOTransRadsOne.size(); i++) {
961  }
962  for (size_t i=0; i!= fHorn2UpstrOuterIOTransRadsTwo.size(); i++) {
964  }
965 
966  // Now we deal with the inner conductor radial equations.
967 
968 
969 
971  it != fHorn2Equations.end(); it++) it->SetRadialRescaleFactor(fHorn2RadialRescale);
972 
973 }
std::vector< G4double > fHorn2UpstrOuterIOTransRadsTwo
intermediate_table::iterator iterator
std::vector< G4double > fHorn2PartsRadii
std::vector< LBNEHornRadialEquation > fHorn2Equations
std::vector< G4double > fHorn2UpstrOuterIOTransRadsOne
void LBNEVolumePlacements::SegmentRALTGTv1 ( )
void LBNEVolumePlacements::SegmentTarget ( )

Definition at line 482 of file LBNEVolumePlacements.cc.

482  {
483 
484  if (fUse1p2MWSmallTgt) return; // we should not do the segmentation again, random calls from G4UI call-backs
485  std::cerr << " LBNEVolumePlacements::SegmentTarget, NuMI style, long tgt, 1p2 MW " << std::endl;
486  const G4double in = 2.54*CLHEP::cm;
487  // simplify the geometry if we have a simple target. No front can, all target related dimensions, including He Comtainment vessel,
488  // have no materail to speak off ..
489  //
493  fTargetCTubeMaterial = std::string("HeliumTarget");
494  double effectiveRadius = fUseSimpleTargetCylinder ? fSimpleTargetRadius :
496  fTargetCTubeOuterRadius = effectiveRadius + 0.020*CLHEP::mm;
497  fTargetCTubeInnerRadius = effectiveRadius + 0.010*CLHEP::mm;
498  // We do not change the lengths, they won't create conflicts in the Russina-doll type of geometry we have..
499  fTargetHeContTubeThickness = 0.005*CLHEP::mm;
500  fTargetHeContTubeInnerRadius = effectiveRadius + 0.025*CLHEP::mm;
501  return;
502  }
503 
504  fTargetSLength = fTargetSLengthDownstrEnd + fTargetSLengthGraphite; // Russian drawing 7589-00-00-00
505  if (!fUsePseudoNova) {
507  } else {
510  }
511  fTargetFinSpacingLength = 0.3*CLHEP::mm; // Nominal value..
512  double targetNumFinsNominal = fTargetSLengthGraphite/(fTargetFinLength + fTargetFinSpacingLength);
513  fTargetNumFins = (int) (targetNumFinsNominal + 0.5);
514  double deltaNumFins = targetNumFinsNominal - (double) fTargetNumFins;
515  if (deltaNumFins > 0.5) fTargetNumFins++;
516  if (deltaNumFins < -0.5) fTargetNumFins--;
517 // std::cerr << " LBNEVolumePlacements::SegmentTarget, total number of segments " << fTargetNumFins <<
518 // " Delta Num fins " << deltaNumFins << std::endl;
519 // std::cerr << " fTargetSLength " << fTargetSLength << " fTargetLengthOutsideHorn " << fTargetLengthOutsideHorn << std::endl;
520 
521  if (fUsePseudoNova) fTargetNumFins++; // Add one to compensate for the fin that will be split..
523  const double oldLength = fTargetSLengthGraphite;
525  fTargetFinSpacingLength = (fTargetSLengthGraphite - fTargetNumFins*fTargetFinLength)/(fTargetNumFins - 1); //
526  if (std::abs(oldLength - fTargetSLengthGraphite) > 0.001*fTargetSLengthGraphite)
527  std::cout << " LBNEVolumePlacements::segmentTarget: Warning: re-adjust the target length from " <<
528  oldLength << " to " << fTargetSLengthGraphite << " to get an integer number of 2 cm long segments " << std::endl;
529  }
530  if (fUsePseudoNova) {
534  fTargetZ0Upstr = 0.;
535  fTargetZ0Downstr = 0. ;
536  } else {
537  // Compute the number of fins upstream and dowsntream of the break between target and horn1.
538 
539  double tempNFins = (fTargetLengthOutsideHorn - fTargetFinSpacingLength) /(fTargetFinLength + fTargetFinSpacingLength);
540  fTargetNumFinsUpstr = (int) tempNFins;
541  fTargetNumFinsInHorn = fTargetNumFins - fTargetNumFinsUpstr; //Note one fin will be split...
542 // std::cerr << " Num Fins Ups /Downstr " << fTargetNumFinsUpstr << " / " << fTargetNumFinsInHorn << std::endl;
543  fTargetFinLengthSplitUpstr = fTargetLengthOutsideHorn - fTargetFinSpacingLength -
544  fTargetNumFinsUpstr*(fTargetFinLength + fTargetFinSpacingLength);
546  if (( fTargetFinLengthSplitDwnstr < 0.) ||
547  ( fTargetFinLengthSplitDwnstr > (fTargetFinSpacingLength + fTargetFinLength)) ||
548  (fTargetFinLengthSplitUpstr < 0.) ||
549  (fTargetFinLengthSplitUpstr > (fTargetFinSpacingLength + fTargetFinLength))) {
550  // split occurs in a spacing. Set this length to 0., we will not install this target segment
551  std::ostringstream mStrStr;
552  mStrStr << " Odd length for the splitted fin ..." << fTargetFinLengthSplitUpstr << " Downstr " <<
553  fTargetFinLengthSplitDwnstr << " tempNFins = " << tempNFins << std::endl;
554  G4String mStr(mStrStr.str());
555  G4Exception("LBNEVolumePlacements::SegmentTarget", " ", JustWarning, mStr.c_str());
556  if (fTargetFinLengthSplitUpstr > fTargetFinLength) fTargetFinLengthSplitUpstr = fTargetFinLength;
557  if (fTargetFinLengthSplitDwnstr > fTargetFinLength) fTargetFinLengthSplitDwnstr = fTargetFinLength;
558  // if lengths are negative, skip the placement
559 
560  }
561 
562  // more deduced variables..
563 // fTargetHeContTubeLengthInHorn = fTargetLengthIntoHorn + fTargetSLengthDownstrEnd;
565  fTargetZ0Upstr = (-1.0* (fTargetSLength - fTargetLengthIntoHorn))/2. ; // Obsolete...
567  }
568  fTargetAlignRingSpacing *= fTargetSLengthGraphite/953.8*CLHEP::mm; // must fit 5 rings within the prescribed space.
569 // std::cerr << " Target after segmentation " << fTargetSLengthGraphite << std::endl;
572  // Approximate...
575  fTargetUpstrDwnstrMargin + fTargetDistFlangeToTargetStart + fTargetLengthOutsideHorn + 2.0*CLHEP::mm;
576  // NUMI Drawing 8875.000-ME-363028 with 2 mm margin of error.
577 
578 }
std::string string
Definition: nybbler.cc:12
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
T abs(T value)
static int max(int a, int b)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::SegmentTargetSmallTgt ( )

Definition at line 2056 of file LBNEVolumePlacementsAdd.cc.

2056  {
2057 
2058  const G4double in = 2.54*CLHEP::cm;
2059 
2060  fTargetSLength = fTargetSLengthDownstrEnd + fTargetSLengthGraphite; // Russian drawing 7589-00-00-00
2061  fTargetLengthOutsideHorn = fTargetSLength - fTargetLengthIntoHorn + fTargetFinLength; // why + one fin Transition fin...
2062  fTargetFinSpacingLength = 0.3*CLHEP::mm; // Nominal value..
2063  double targetNumFinsNominal = fTargetSLengthGraphite/(fTargetFinLength + fTargetFinSpacingLength);
2064  fTargetNumFins = (int) (targetNumFinsNominal + 0.5);
2065  double deltaNumFins = targetNumFinsNominal - (double) fTargetNumFins;
2066  if (deltaNumFins > 0.5) fTargetNumFins++;
2067  if (deltaNumFins < -0.5) fTargetNumFins--;
2068  std::cerr << " LBNEVolumePlacements::SegmentTargetSmallTgt, total number of segments " << fTargetNumFins <<
2069  " Delta Num fins " << deltaNumFins << std::endl;
2070  std::cerr << " fTargetSLength " << fTargetSLength
2071  << " fTargetLengthOutsideHorn " << fTargetLengthOutsideHorn << std::endl;
2072  const double oldLength = fTargetSLengthGraphite;
2073  fTargetSLengthGraphite = fTargetNumFins*fTargetFinLength + (fTargetNumFins-1)*fTargetFinSpacingLength;
2074  fTargetFinSpacingLength = (fTargetSLengthGraphite - fTargetNumFins*fTargetFinLength)/(fTargetNumFins - 1); //
2075  if (std::abs(oldLength - fTargetSLengthGraphite) > 0.001*fTargetSLengthGraphite)
2076  std::cout << " LBNEVolumePlacements::SegmentTargetSmallTgt: Warning: re-adjust the target length from " <<
2077  oldLength << " to " << fTargetSLengthGraphite << " to get an integer number of 2 cm long segments " << std::endl;
2078  // Compute the number of fins upstream and dowsntream of the break between target and horn1.
2079 
2080  double tempNFins = (fTargetLengthOutsideHorn - fTargetFinSpacingLength) /(fTargetFinLength + fTargetFinSpacingLength);
2081  fTargetNumFinsUpstr = (int) tempNFins; // Obsolete.. kept to confuse the chinese...
2082  // more deduced variables..
2083 // fTargetHeContTubeLengthInHorn = fTargetLengthIntoHorn + fTargetSLengthDownstrEnd;
2088  + fTargetDownstrCanFlangeThick + fTargetFlangeThick + 0.2*CLHEP::mm + 44.18*in +
2089  fTargetUpstrDwnstrMargin + fTargetDistFlangeToTargetStart + fTargetLengthOutsideHorn + 2.0*CLHEP::mm;
2090  // NUMI Drawing 8875.000-ME-363028 with 2 mm margin of error.
2093  fTargetAlignRingSpacing *= fTargetSLengthGraphite/953.8*CLHEP::mm; // must fit 5 rings within the prescribed space.
2094 // std::cerr << " Target after segmentation " << fTargetSLengthGraphite << std::endl;
2097  // Approximate...
2100  fTargetUpstrDwnstrMargin + fTargetDistFlangeToTargetStart + fTargetLengthOutsideHorn + 2.0*CLHEP::mm;
2101  // NUMI Drawing 8875.000-ME-363028 with 2 mm margin of error.
2102  std::cerr << " Lengths, fTargetUpstrDwnstrMargin " << fTargetUpstrDwnstrMargin
2103  << " fTargetDistFlangeToTargetStart " << fTargetDistFlangeToTargetStart
2104  << " fTargetSLength " << fTargetSLength << std::endl;
2105  std::cerr << " End of LBNEVolumePlacements::SegmentTargetSmallTgt " << std::endl;
2106 }
T abs(T value)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::SetAbsorberGDMLFilename ( G4String &  name)
inline

Definition at line 313 of file LBNEVolumePlacements.hh.

static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetBaffleInnerRadius ( double  r)
inline

Definition at line 220 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetBaffleLength ( double  l)
inline

Definition at line 219 of file LBNEVolumePlacements.hh.

219 { fBaffleLength = l;}
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetBaffleZPosition ( double  z)
inline

Definition at line 221 of file LBNEVolumePlacements.hh.

221 { fBaffleZPosition = z;}
double z
void LBNEVolumePlacements::SetConstructPlug ( bool  t)
inline

Definition at line 227 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetConstructPlugInHorn1 ( bool  t)
inline

Definition at line 228 of file LBNEVolumePlacements.hh.

228 { fConstructPlugInHorn1 = t;} // Added, August 31 2014.
void LBNEVolumePlacements::SetCurrentMilindWire ( double  r)
inline

Definition at line 1246 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetDecayPipeGas ( G4String &  name)
inline

Definition at line 209 of file LBNEVolumePlacements.hh.

209 {fDecayPipeGas = name;}
static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetDecayPipeLength ( double  l)
inline

Definition at line 202 of file LBNEVolumePlacements.hh.

202  {
203  const double lCorr = l + fDecayPipeLengthCorrection;
205  }
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetDecayPipeLongPosition ( double  l)
inline

Definition at line 207 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetDecayPipeRadius ( double  l)
inline

Definition at line 206 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetDecayPipeUpstrWindowThick ( double  l)
inline

Definition at line 208 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetDoInstallShield ( bool  v)
inline

Definition at line 338 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::setEntireTargetDims ( )
private

Definition at line 582 of file LBNEVolumePlacements.cc.

582  {
583 
584  const G4double in = 2.54*CLHEP::cm;
585  fTargetSLength = fTargetSLengthDownstrEnd + fTargetSLengthGraphite; // Russian drawing 7589-00-00-00
586 // if (!fUsePseudoNova) { // Oboslete, August 2014.
587 // fTargetLengthOutsideHorn = fTargetSLength - fTargetLengthIntoHorn + fTargetFinLength;
588 // } else {
589 // fTargetLengthOutsideExtra = fTargetLengthOutsideHorn - fTargetSLength;
590 // fTargetLengthOutsideHorn = fTargetSLength;
591 // }
592 // Nominal does not defines fTargetLengthOutsideHorn..Must do it here...
593  fTargetLengthOutsideExtra = 95.53*CLHEP::mm; // due to various offsets in the upstream target...
594 
595  fTargetFinSpacingLength = 0.3*CLHEP::mm; // Nominal value..
596  double targetNumFinsNominal = fTargetSLengthGraphite/(fTargetFinLength + fTargetFinSpacingLength);
597  fTargetNumFins = (int) (targetNumFinsNominal + 0.5);
598  double deltaNumFins = targetNumFinsNominal - (double) fTargetNumFins;
599  if (deltaNumFins > 0.5) fTargetNumFins++;
600 // std::cerr << " LBNEVolumePlacements::SetEntireTargetDims, total number of segments " << fTargetNumFins <<
601 // " Delta Num fins " << deltaNumFins << std::endl;
602 // std::cerr << " fTargetSLength " << fTargetSLength << " fTargetLengthOutsideHorn " << fTargetLengthOutsideHorn << std::endl;
603 
604  const double oldLength = fTargetSLengthGraphite;
606  fTargetFinSpacingLength = (fTargetSLengthGraphite - fTargetNumFins*fTargetFinLength)/(fTargetNumFins - 1); //
607  if (std::abs(oldLength - fTargetSLengthGraphite) > 0.001*fTargetSLengthGraphite)
608  std::cout << " LBNEVolumePlacements::setEntireTargetDims: Warning: re-adjust the target length from " <<
609  oldLength << " to " << fTargetSLengthGraphite << " to get an integer number of 2 cm long segments " << std::endl;
610  fTargetZ0Upstr = 0.; // ??? Possibly resurrect for Horn1Mother in one piece,/ Aug/Sept 2014.
611  fTargetZ0Downstr = 0. ;
612  // More deduced variables.
613  fTargetHeContTubeLength = fTargetSLengthDownstrEnd + fTargetSLengthGraphite + 0.025*CLHEP::mm; // To bechecked, August/Sept 2014.
614  fTargetAlignRingSpacing *= fTargetSLengthGraphite/953.8*CLHEP::mm; // must fit 5 rings within the prescribed space.
615 // std::cerr << " Target after segmentation " << fTargetSLengthGraphite << std::endl;
618  // Most likely obsolete variable..
619 
620 }
T abs(T value)
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::SetHorn1AllConductorMaterial ( G4String &  name)
inline

Definition at line 213 of file LBNEVolumePlacements.hh.

static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetHorn1HallPhysPtr ( G4PVPlacement *  p)
inline

Definition at line 1226 of file LBNEVolumePlacements.hh.

1226 { fHorn1HallPhysPtr = p;}
G4PVPlacement * fHorn1HallPhysPtr
p
Definition: test.py:223
void LBNEVolumePlacements::SetHorn1InnerConductorMaterial ( G4String &  name)
inline

Definition at line 210 of file LBNEVolumePlacements.hh.

static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetHorn1Length ( double  l)
inline

Definition at line 218 of file LBNEVolumePlacements.hh.

218 { fHorn1Length = l;}
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetHorn1LongRescale ( double  r)
inline

Definition at line 295 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetHorn1PolyInnerThreeVect ( size_t  iP,
G4ThreeVector  vVal 
)
inline

Definition at line 503 of file LBNEVolumePlacements.hh.

503  {
504  if (fHorn1PolyListRinThickZVects.size() < iP) {
505  size_t numMiss = iP - fHorn1PolyListRinThickZVects.size();
506  for (size_t ipp = 0; ipp != numMiss; ipp++) {
507  G4ThreeVector vNew; vNew[0] = 40.; vNew[1] = 2; vNew[2] = 400.;
508  fHorn1PolyListRinThickZVects.push_back(vNew);
509  }
510  }
511  for (size_t kv=0; kv != 3; kv++)
512  fHorn1PolyListRinThickZVects[iP][kv] = vVal[kv];
513  }
std::vector< G4ThreeVector > fHorn1PolyListRinThickZVects
void LBNEVolumePlacements::SetHorn1PolyOuterRadius ( double  r)
inline

Definition at line 514 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetHorn1RadialRescale ( double  r)
inline

Definition at line 297 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetHorn1RadialSafetyMargin ( double  t)
inline

Definition at line 287 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetHorn1RadiusBigEnough ( bool  t)
inline

Definition at line 289 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetHorn2AllConductorMaterial ( G4String &  name)
inline

Definition at line 214 of file LBNEVolumePlacements.hh.

static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetHorn2InnerConductorMaterial ( G4String &  name)
inline

Definition at line 211 of file LBNEVolumePlacements.hh.

static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetHorn2LongPosition ( double  l)
inline

Definition at line 304 of file LBNEVolumePlacements.hh.

304 { fHorn2LongPosition = l; }
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetHorn2LongRescale ( double  r)
inline

Definition at line 299 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetHorn2RadialRescale ( double  r)
inline

Definition at line 301 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetHorn2RadialRescaleCst ( double  r)
inline

Definition at line 302 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetHorn3AllConductorMaterial ( G4String &  name)
inline

Definition at line 215 of file LBNEVolumePlacements.hh.

static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetHorn3InnerConductorMaterial ( G4String &  name)
inline

Definition at line 212 of file LBNEVolumePlacements.hh.

static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetHornsPolyInnerThreeVect ( size_t  hornNumber,
size_t  iP,
G4ThreeVector  vVal 
)
inline

Definition at line 649 of file LBNEVolumePlacements.hh.

649  {
650  if (hornNumber > 5) {
651  G4Exception("SetUseHornsPolyInnerThreeVect", " ", FatalErrorInArgument, "Valid Number are 1, 2, 3, 4 or 5 ");
652  }
653  if (fHornsPolyListRinThickZVects[hornNumber-1].size() < iP) {
654  size_t numMiss = iP - fHornsPolyListRinThickZVects[hornNumber-1].size();
655  for (size_t ipp = 0; ipp != numMiss; ipp++) {
656  G4ThreeVector vNew; vNew[0] = 40.; vNew[1] = 2; vNew[2] = 400.;
657  fHornsPolyListRinThickZVects[hornNumber-1].push_back(vNew);
658  }
659  }
660  for (size_t kv=0; kv != 3; kv++)
661  fHornsPolyListRinThickZVects[hornNumber-1][iP][kv] = vVal[kv];
662  }
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
void LBNEVolumePlacements::SetHornsPolyOuterRadius ( size_t  hornNumber,
double  r 
)
inline

Definition at line 663 of file LBNEVolumePlacements.hh.

663  {
664  if (hornNumber > 5) {
665  G4Exception("SetUseHornsPolyOuterRadius", " ", FatalErrorInArgument, "Valid Number are 1, 2, 3, 4 or 5 ");
666  }
667  fHornsPolyOuterRadius[hornNumber-1] = r;
668  }
std::vector< double > fHornsPolyOuterRadius
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
void LBNEVolumePlacements::SetHornsPolyZStartPos ( size_t  hornNumber,
double  z 
)
inline

Definition at line 669 of file LBNEVolumePlacements.hh.

669  {
670  if (hornNumber > 5) {
671  G4Exception("SetUseHornsPolyZStartPos", " ", FatalErrorInArgument, "Valid Number are 1, 2, 3, 4 or 5 ");
672  }
673  if ((hornNumber == 1) && (std::abs(z) > 5.0*CLHEP::mm)) {
674  std::ostringstream mStrStr; mStrStr << " The Z start of the 1rst simple Horn must be at zero. Found value : " << z;
675  std::string mStr(mStrStr.str());
676  G4Exception("SetUseHornsPolyZStartPos", " ", FatalErrorInArgument, mStr.c_str());
677  }
678 
679  fHornsPolyZStartPos[hornNumber-1] = z;
680 
681  }
std::string string
Definition: nybbler.cc:12
std::vector< double > fHornsPolyZStartPos
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
T abs(T value)
double z
void LBNEVolumePlacements::SetInstallBaffle ( bool  f)
inline
void LBNEVolumePlacements::SetInstallDownstTargetSupport ( bool  t)
inline

Definition at line 1425 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetInstallRALShortTarget ( bool  f)
inline
void LBNEVolumePlacements::SetInstallUpstreamHorizontalTarget ( bool  f)
inline
void LBNEVolumePlacements::SetLengthOfRockDownstreamAlcove ( double  l)
inline

Definition at line 192 of file LBNEVolumePlacements.hh.

192  {
193  fLengthOfRockDownstr = 2.0*l; // Downstream and upstream, actually, the latter does not matter.
194  const double aRockLength = 2.0*(fDecayPipeLength + 160.*CLHEP::m ); // before digging the tunnel.
195  // Approximate.. 150 m. is for the target hall, Horn1 + horn2, and the Hadron absorber hall + muon alcove.
196  fTotalLength = aRockLength+fLengthOfRockDownstr;
197  }
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetMarsTargetHornsGDMLFilename ( G4String &  name)
inline

Definition at line 310 of file LBNEVolumePlacements.hh.

static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::setMotherVolumeForHorn1 ( )
private

Definition at line 436 of file LBNEDownstrVolPlacements.cc.

436  {
437  const double in = 2.54*CLHEP::cm;
438  fMotherHorn1AllRads.clear();
439  fMotherHorn1AllLengths.clear();
440  const double epsilR = 0.050*CLHEP::mm;
441  double zCurrent = 0.;
442  fMotherHorn1AllRads.push_back(fHorn1IOTransInnerRad - epsilR);
443  fMotherHorn1AllLengths.push_back(zCurrent);
444  fMotherHorn1AllRads.push_back(fHorn1IOTransInnerRad - epsilR);
445 // zCurrent += fHorn1IOTransLength; // Oversize ? ! Drawing 363092, 363097 says (2.436" + 3.2852" = 5.752 )
446  zCurrent += 5.752*in; ; // Correct...
447  fMotherHorn1AllLengths.push_back(zCurrent);
448  // Up to the neck, equation
449  const int numSectEq1 = 5;
450  const double lengthEq1 = 12.896*in/numSectEq1; // Drawin 363104
451  double zz1 = 3.316*in;
452  for(int iSect1 = 0; iSect1 != numSectEq1; iSect1++) {
453  zz1 += lengthEq1;
454  const double rr1 = fHorn1Equations[0].GetVal(zz1) - epsilR - 0.300*CLHEP::mm -0.050*CLHEP::mm*iSect1;// needs a bit more room here, these subsection are too straight..
455  zCurrent += lengthEq1;
456  fMotherHorn1AllRads.push_back(rr1);
457  fMotherHorn1AllLengths.push_back(zCurrent);
458 // std::cerr << " Polycone Mother, subsection 1 , zz1 " << zz1 << " zCurrent " << zCurrent << " rr1 " << rr1 << std::endl;
459  }
460  const int numSectEq2 = 8;
461  const double lengthEq2 = (4.9799*in + 9.2262*in)/numSectEq2; // Drawing 363104, 363105
462  for(int iSect2 = 0; iSect2 != numSectEq2; iSect2++) {
463  zz1 += lengthEq2;
464  const double rr2 = fHorn1Equations[1].GetVal(zz1) - epsilR - 0.8*CLHEP::mm - 0.1*CLHEP::mm*iSect2;// empirical, but it will need to be improved on for
465  // misalignment studies.
466  zCurrent += lengthEq2;
467  fMotherHorn1AllRads.push_back(rr2);
468  fMotherHorn1AllLengths.push_back(zCurrent);
469 // std::cerr << " Polycone Mother, subsection 2 , zz1 " << zz1 << " zCurrent " << zCurrent << " rr2 " << rr2 << std::endl;
470  }
471  // The neck + all the other sections, set to the neck.
472  const double neckRadius = 0.709*in/2.; // Drawing 363105
473  fMotherHorn1AllRads.push_back(neckRadius - epsilR);
474  fMotherHorn1AllLengths.push_back(zCurrent);
475  zCurrent += 1.568*in; zz1 += 1.568*in;
476  fMotherHorn1AllRads.push_back(neckRadius - epsilR);
477  fMotherHorn1AllLengths.push_back(zCurrent);
478 // std::cerr << " ... Just downstream of the neck, zz1 = " << zz1 << " zCurrent " << zCurrent << std::endl;
479  // Downstream of the neck.. Equation 4
480  const int numSectEq4 = 4;
481  const double lengthEq4 = (36.2709 - 31.8827)*in/numSectEq4; // Drawing 363105
482  for(int iSect4 = 0; iSect4 != numSectEq4; iSect4++) {
483  zz1 += lengthEq4;
484  double rr4 = fHorn1Equations[3].GetVal(zz1) - epsilR - 0.2*CLHEP::mm - 0.1*CLHEP::mm*iSect4;// empirical, but it will need to be improved on for
485  // misalignment studies.
486  if (iSect4 == 0) rr4 = (rr4 + neckRadius)/2.0; // take the average... Not really important, a realistic plug should nevr fit tightly.
487  zCurrent += lengthEq4;
488  fMotherHorn1AllRads.push_back(rr4);
489  fMotherHorn1AllLengths.push_back(zCurrent);
490 // std::cerr << " Polycone Mother, subsection 4 , zz1 " << zz1 << " zCurrent " << zCurrent << " rr4 " << rr4 << std::endl;
491  }
492  // Downstream of the neck.. Equation 5 Up to the downstream flange, drawing 363108, 363096
493  const int numSectEq5 = 20;
494  const double lengthEq5 = (117.126 - 36.27097)*in/numSectEq5; // Drawing 363105, 363108
495  double rLastParabolic = 0.;
496  for(int iSect5 = 0; iSect5 != numSectEq5; iSect5++) {
497  zz1 += lengthEq5;
498  const double rr5 = fHorn1Equations[4].GetVal(zz1) - epsilR - 1.0*CLHEP::mm - 0.1*CLHEP::mm*iSect5;// empirical, but it will need to be improved on for
499  // misalignment studies.
500  zCurrent += lengthEq5;
501  fMotherHorn1AllRads.push_back(rr5);
502  fMotherHorn1AllLengths.push_back(zCurrent);
503 // std::cerr << " Polycone Mother, subsection 5 , zz1 " << zz1 << " zCurrent " << zCurrent << " rr5 " << rr5 << std::endl;
504  rLastParabolic = rr5;
505  }
506  zCurrent += 14.244*in + 3.0*CLHEP::cm; // xx cm safe for misalignment Drawing 363093 and 363096
507  fMotherHorn1AllRads.push_back(rLastParabolic - epsilR);
508  fMotherHorn1AllLengths.push_back(zCurrent);
509  //
510  // Now the outer...
511  //
512  const double rOut = 16.25*in + 15.0*in + 2.5*CLHEP::cm;
513  fMotherHorn1AllRads.push_back(rOut);
514  fMotherHorn1AllLengths.push_back(zCurrent);
515  fMotherHorn1AllRads.push_back(rOut);
516  fMotherHorn1AllLengths.push_back(0.);
517  //
518  // dump this curve, so we can draw it.
519 // std::ofstream fileOutTmp("./RZCurve_1.txt");
520 // fileOutTmp << " Z R " << std::endl;
521 // for (size_t ii=0 ; ii != fMotherHorn1AllLengths.size(); ii++) {
522 // std::cerr << " Radius At at Z(StartHorn1) "<< fMotherHorn1AllLengths[ii]
523 // << " is " << fMotherHorn1AllRads[ii] << std::endl;
524 // fileOutTmp << " " << fMotherHorn1AllLengths[ii] << " " << fMotherHorn1AllRads[ii] << std::endl;
525 // }
526 // fileOutTmp.close();
527 // std::cerr << " And quit !!! ... " << std::endl; exit(2);
528 }
std::vector< double > fMotherHorn1AllLengths
std::vector< LBNEHornRadialEquation > fHorn1Equations
std::vector< double > fMotherHorn1AllRads
void LBNEVolumePlacements::SetMultiSphereTargetLength ( double  r)
inline

Definition at line 1233 of file LBNEVolumePlacements.hh.

1233 {fMultiSphereTargetLength = r;} //Quynh. real target.(2) - July 16 2014
void LBNEVolumePlacements::SetMultiSphereTargetRadius ( double  r)
inline

Definition at line 1234 of file LBNEVolumePlacements.hh.

1234 {fMultiSphereTargetRadius = r;} //Quynh, P.L., August 2014
void LBNEVolumePlacements::SetNumberOfHornsPolycone ( int  n)
inline

Definition at line 590 of file LBNEVolumePlacements.hh.

590  {
591  if ((n < 1) || (n > 5)) {
592  G4Exception("SetNumberOfHornsPolycone", " ", FatalErrorInArgument, "Valid Number are 1, 2, 3, 4 or 5 ");
593  }
594  G4String msg0(
595  " We hereby declaring the number of horns used in the simulation, either simple Polycone, or engineered \n");
596  std::cout << msg0 << std::endl;
597  std::cerr << msg0 << std::endl;
598  if (n == 1) {
599  G4String msg1(" We will be using one and only one Horn, Mother is Polycone style. \n ");
600  msg1 += std::string(" We assume it is the first horn. \n");
601  std::cout << msg1 << std::endl;
602  std::cerr << msg1 << std::endl;
603  }
604  fUseHorn1Polycone = false; // we will use the generic Placement even for Horn1, more consistent this way
605  fUseHornsPolycone = true; // not a typo, indicating new mode for defining the geometry.
606  // we support the idea to have one and only horn, simple Polycone.
608  fMotherHornsAllLengths.resize(n);
609  fMotherHornsAllRads.resize(n);
610  fUseHornsPolyNumInnerPts.resize(n);
611  fHornsPolyOuterRadius.resize(n);
613  fHornsLength.resize(n);
614  fHornsPolyZStartPos.resize(n);
615  fHornsPolyZStartPos[0] = 0.; // defining here the G4 world coordinate system with respect to the Horns
616  if (n > 1) {
617  for (size_t k=1; k != static_cast<size_t>(n); k++) {
618  fHornsPolyZStartPos[k] = -10000.*CLHEP::m; fHornsLength[k] = -1.;
619  }
620  } // used to check the initialization.
621  fHornsOuterTubeOuterRad.resize(n);
622  fPolyconeHornsAreParabolic.resize(n);
623  fMotherHornsAllThick.resize(n);
624  for (size_t k=0; k != static_cast<size_t>(n); k++) fPolyconeHornsAreParabolic[k] = false; //default is false..
625  fRemoveDecayPipeSnout = true;
626  }
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::string string
Definition: nybbler.cc:12
std::vector< double > fHornsPolyOuterRadius
std::vector< std::vector< double > > fMotherHornsAllRads
std::vector< double > fHornsPolyZStartPos
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::vector< double > fHornsOuterTubeOuterRad
std::vector< bool > fPolyconeHornsAreParabolic
std::vector< double > fHornsLength
std::vector< std::vector< double > > fMotherHornsAllThick
QTextStream & endl(QTextStream &s)
std::vector< std::vector< double > > fMotherHornsAllLengths
void LBNEVolumePlacements::SetPlugInnerRadius ( double  r)
inline

Definition at line 223 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetPlugLength ( double  l)
inline

Definition at line 222 of file LBNEVolumePlacements.hh.

222 { fPlugLength = l;}
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetPlugMaterial ( std::string  name)
inline

Definition at line 225 of file LBNEVolumePlacements.hh.

225 { fPlugMaterial = name;}
static QCString name
Definition: declinfo.cpp:673
void LBNEVolumePlacements::SetPlugOuterRadius ( double  r)
inline

Definition at line 224 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetPlugZPosition ( double  z)
inline

Definition at line 226 of file LBNEVolumePlacements.hh.

226 { fPlugZPosition = z;}
double z
void LBNEVolumePlacements::SetPolyconeHorn1Parabolic ( bool  t)
inline

Definition at line 637 of file LBNEVolumePlacements.hh.

637  {
639  }
void LBNEVolumePlacements::SetPolyconeHornParabolic ( size_t  hornNumber,
bool  t 
)
inline

Definition at line 627 of file LBNEVolumePlacements.hh.

627  {
628  if (hornNumber > 5) {
629  G4Exception("SetPolyconeHornParabolic", " ", FatalErrorInArgument, "Valid Number are 1, 2, 3, 4 or 5 ");
630  }
631  if (fUseNumberOfHornsPoly < static_cast<int>(hornNumber))
632  this->SetNumberOfHornsPolycone(hornNumber);
633  std::cerr << " Setting index " << hornNumber-1
634  << " Hornpara.., size " << fPolyconeHornsAreParabolic.size() << std::endl;
635  fPolyconeHornsAreParabolic[hornNumber-1] = t;
636  }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::vector< bool > fPolyconeHornsAreParabolic
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::SetRadiusMilindWire ( double  r)
inline

Definition at line 1244 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetRALSimpleTargetLength ( double  l)
inline

Definition at line 1434 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetRemoveDecayPipeSnout ( bool  t)
inline

Definition at line 1241 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetRemoveRALBafflet ( bool  f)
inline
void LBNEVolumePlacements::SetRemoveTargetAlltogether ( bool  t)
inline

Definition at line 250 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetSimpleTargetHeight ( double  r)
inline

Definition at line 236 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetSimpleTargetLength ( double  l)
inline

Definition at line 237 of file LBNEVolumePlacements.hh.

237 { fSimpleTargetLength = l;}
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetSimpleTargetRadius ( double  r)
inline

Definition at line 234 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetSimpleTargetWidth ( double  r)
inline

Definition at line 235 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetTarget2Density ( double  l)
inline

Definition at line 1383 of file LBNEVolumePlacements.hh.

1383 { fTarget2Density = l; }
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTarget2Length ( double  l)
inline

Definition at line 1308 of file LBNEVolumePlacements.hh.

1308 {fTarget2Length = l;}
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTarget2MaterialName ( G4String &  aName)
inline

Definition at line 1389 of file LBNEVolumePlacements.hh.

1389 { fTarget2MaterialName = aName; }
void LBNEVolumePlacements::SetTarget2ModuleType ( int  i)
inline
void LBNEVolumePlacements::SetTarget2NLambda ( double  N)
inline
void LBNEVolumePlacements::SetTarget2Radius ( double  r)
inline

Definition at line 1300 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetTarget2SpecificLambda ( double  l)
inline

Definition at line 1386 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetBerylDownstrWindowThick ( double  t)
inline

Definition at line 286 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetTargetDensity ( double  l)
inline

Definition at line 275 of file LBNEVolumePlacements.hh.

275 { fTargetDensity = l; }
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetFinWidth ( double  l)
inline

Definition at line 258 of file LBNEVolumePlacements.hh.

258  {
259  fTargetFinWidth = l;
260  if (fUse1p2MW) {
261  fTargetFinWidth /=2.; // since we will place two of them side by side
263  // October, November 2016.. Install the 1/2 fins as a subtracted volume,
264  // such the cooling pipe diameter (OD) can be larger than 1/2 fin width.
265 // if (fTargetFinWidth > fTargetCTubeOuterRadius) {
266 // fTargetFinExtraWidth = (fTargetFinWidth - 2.0*fTargetCTubeOuterRadius);
267 // fTargetFinWidth = fTargetCTubeOuterRadius - 0.001*CLHEP::mm;
268 // }
269 
270  }
271  }
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetFracOutHornL ( double  l)
inline

Definition at line 1357 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetHorn1HallPhysPtr ( G4VPhysicalVolume *  p)
inline

Definition at line 1225 of file LBNEVolumePlacements.hh.

p
Definition: test.py:223
G4VPhysicalVolume * fTargetHorn1HallPhysPtr
void LBNEVolumePlacements::SetTargetLength ( double  l)
inline

Definition at line 1305 of file LBNEVolumePlacements.hh.

1305 {fTargetLength = l;}
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetLengthIntoHorn ( double  l)
inline

Definition at line 283 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetLengthOutsideExtra ( double  l)
inline

Definition at line 1370 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetLengthOutsideHorn ( double  l)
inline

Definition at line 284 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetMaterialName ( G4String &  aName)
inline

Definition at line 281 of file LBNEVolumePlacements.hh.

281 { fTargetMaterialName = aName; }
void LBNEVolumePlacements::SetTargetModuleType ( int  i)
inline
void LBNEVolumePlacements::SetTargetNLambda ( double  N)
inline
void LBNEVolumePlacements::SetTargetNoSplitM1 ( G4VPhysicalVolume *  p)
inline

Definition at line 1224 of file LBNEVolumePlacements.hh.

1224 { fTargetNoSplitM1 = p;}
p
Definition: test.py:223
G4VPhysicalVolume * fTargetNoSplitM1
void LBNEVolumePlacements::SetTargetNumFinsWithWings ( unsigned int  n)
inline

Definition at line 273 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetTargetRadius ( double  r)
inline

Definition at line 1297 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetTargetSLengthGraphite ( double  l)
inline

Definition at line 256 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTargetSpecificLambda ( double  l)
inline

Definition at line 278 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTotalLength ( double  l)
inline

Definition at line 216 of file LBNEVolumePlacements.hh.

216 {fTotalLength=l;} // dangerous! Possible conflict with length of rock downstream
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetTotalLengthOfRock ( double  l)
inline

Definition at line 190 of file LBNEVolumePlacements.hh.

190 { fTotalLength = l;}
static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetUse1p2MW ( bool  t)
inline

Definition at line 414 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUse1p2MWSmallTgt ( bool  t)
inline

Definition at line 417 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUseCDR2015Optimized ( bool  f)
inline
void LBNEVolumePlacements::SetUseHorn1Polycone ( bool  t)
inline

Definition at line 479 of file LBNEVolumePlacements.hh.

479  {
480 
481  fUseHorn1Polycone = t;
482  if (!t) return;
483  fUseHornsPolycone = false; // not a typo, indicating new mode for defining the geometry.
484  // we support the idea to have one and only horn, simple Polycone.
486  fMotherHornsAllLengths.resize(1);
487  fMotherHornsAllRads.resize(1);
488  fUseHornsPolyNumInnerPts.resize(1);
489  fHornsPolyOuterRadius.resize(1);
492  fMotherHornsAllThick.resize(1);
493  fHornsLength.resize(1);
494  fHornsPolyZStartPos.resize(1);
495  fHornsPolyZStartPos[0] = 0.; // defining here the G4 world coordinate system with respect to the Horns
496  fHornsOuterTubeOuterRad.resize(1);
497  fRemoveDecayPipeSnout = true;
498  }
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::vector< double > fHornsPolyOuterRadius
std::vector< std::vector< double > > fMotherHornsAllRads
std::vector< double > fHornsPolyZStartPos
std::vector< int > fUseHornsPolyNumInnerPts
std::vector< double > fHornsOuterTubeOuterRad
std::vector< bool > fPolyconeHornsAreParabolic
std::vector< double > fHornsLength
std::vector< std::vector< double > > fMotherHornsAllThick
std::vector< std::vector< double > > fMotherHornsAllLengths
void LBNEVolumePlacements::SetUseHorn1PolyNumInnerPts ( int  n)
inline

Definition at line 499 of file LBNEVolumePlacements.hh.

499  {
501  fHorn1PolyListRinThickZVects.resize(static_cast<size_t>(n));
502  }
std::vector< G4ThreeVector > fHorn1PolyListRinThickZVects
void LBNEVolumePlacements::SetUseHornsPolyNumInnerPts ( size_t  hornNumber,
size_t  nElem 
)
inline

Definition at line 640 of file LBNEVolumePlacements.hh.

640  {
641  if (hornNumber > 5) {
642  G4Exception("SetUseHornsPolyNumInnerPts", " ", FatalErrorInArgument, "Valid Number are 1, 2, 3, 4 or 5 ");
643  }
644  fUseHornsPolyNumInnerPts[hornNumber-1] = nElem;
645  fHornsPolyListRinThickZVects[hornNumber-1].resize(nElem);
646  fMotherHornsAllLengths[hornNumber-1].resize(nElem);
647  fMotherHornsAllRads[hornNumber-1].resize(nElem);
648  }
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::vector< std::vector< double > > fMotherHornsAllRads
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
std::vector< std::vector< double > > fMotherHornsAllLengths
void LBNEVolumePlacements::SetUseLBNFOptimConceptDesignHornA ( bool  f)
inline
void LBNEVolumePlacements::SetUseLBNFOptimConceptDesignHornB ( bool  f)
inline
void LBNEVolumePlacements::SetUseLBNFOptimConceptDesignHornC ( bool  f)
inline
void LBNEVolumePlacements::SetUseMarsTargetHorns ( bool  v)
inline

Definition at line 307 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUseMultiSphereTarget ( bool  t)
inline

Definition at line 1232 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUsePseudoNova ( bool  t)
inline

Definition at line 1222 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUseRALTGTv1 ( bool  t)
inline

Definition at line 420 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUseRoundedTargetFins ( bool  t)
inline

Definition at line 424 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUseSimpleTargetBox ( bool  t)
inline

Definition at line 232 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUseSimpleTargetCylinder ( bool  t)
inline

Definition at line 233 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUseTarget2Module ( bool  t)
inline

Definition at line 1260 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetUseTargetModule ( bool  t)
inline

Definition at line 1257 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetWaterLayerThickInHorns ( double  l)
inline

Definition at line 217 of file LBNEVolumePlacements.hh.

static QStrList * l
Definition: config.cpp:1044
void LBNEVolumePlacements::SetWriteGDMLFile ( bool  t)
inline

Definition at line 1249 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::SetZHallHorn1ToHorn1PolyM1 ( double  d)
inline

Definition at line 1409 of file LBNEVolumePlacements.hh.

void LBNEVolumePlacements::ShiftHorn2Radially ( )

Definition at line 975 of file LBNEDownstrVolPlacements.cc.

975  {
976 
977 // std::cerr << " LBNEVolumePlacements::RescaleHorn2Radially, fHorn2RadialRescale = " << fHorn2RadialRescale
978 // << "fHorn2RadialRescaleCst " << fHorn2RadialRescaleCst << std::endl;
979  for (size_t i=0; i!= fHorn2PartsRadii.size(); i++) {
981 // std::cerr << " LBNEVolumePlacements::RescaleHorn2Radially Old Rad " << oldRad
982 // << " New " << fHorn2PartsRadii[i] << std::endl;
983  }
987  for (size_t i=0; i!= fHorn2UpstrOuterIOTransRadsOne.size(); i++) {
989  }
990  for (size_t i=0; i!= fHorn2UpstrOuterIOTransRadsTwo.size(); i++) {
992  }
993 
994  // Now we deal with the inner conductor radial equations.
995 
997  it != fHorn2Equations.end(); it++) it->SetRadialRescaleFactorCst(fHorn2RadialRescaleCst);
998 }
std::vector< G4double > fHorn2UpstrOuterIOTransRadsTwo
intermediate_table::iterator iterator
std::vector< G4double > fHorn2PartsRadii
std::vector< LBNEHornRadialEquation > fHorn2Equations
std::vector< G4double > fHorn2UpstrOuterIOTransRadsOne
void LBNEVolumePlacements::UpdateParamsForHorn1MotherPoly ( )

Definition at line 1623 of file LBNEVolumePlacementsAdd.cc.

1623  {
1624  //
1625  // Convert the array of 3-vector to the fMotherHorn1AllLengths, AllRads
1626  //
1627 
1628  fMotherHorn1AllLengths.clear();
1629  fMotherHorn1AllRads.clear();
1630  if (fHorn1PolyListRinThickZVects.size() != static_cast<size_t>(fUseHorn1PolyNumInnerPts)) {
1631  G4Exception("LBNEVolumePlacements::UpdateParamsForHorn1MotherPoly",
1632  " ", FatalErrorInArgument, "Inconsistency in sizing Hor1 Polycone ");
1633  }
1634  const double epsil = 0.050*CLHEP::mm;
1635  const double thickInnerAtZStart = fHorn1PolyListRinThickZVects[0][1];
1636  //
1637  // This "fMotherHornsAll" Lengths/Radiis is used to defined
1638  // The first point in these arrays is located on the external surface of the outer conductor, most upstream point
1639  // We set the point to be epsil away from the physical conductor. We add the thickness of the innerconductor
1640  // to avoid volume overlap when we will define the IC, and the water layer. This is clearly unphysical, but avoids
1641  // the complexity of having to define more volumes.
1642  // Note the water layer thickness is assumed to be uniform across the length of the device. Clearly wrong...
1643  // This is a more serious approximation...
1644  //
1645  const double rOut = fHorn1PolyOuterRadius + 2.5*CLHEP::cm + epsil + thickInnerAtZStart + fWaterLayerThickInHorns;
1646  fHorn1OuterTubeOuterRad = rOut;
1647  fMotherHorn1AllRads.push_back(rOut);
1648  fMotherHorn1AllLengths.push_back(0.);
1649  for(size_t k=0; k != fHorn1PolyListRinThickZVects.size(); k++) {
1650  const double r = fHorn1PolyListRinThickZVects[k][0] - epsil ;
1651  // Should be needed for k != 0, but easier this way. The location of the IC will be off by epsil,
1652  // no physics inplications..
1653  const double z = fHorn1PolyListRinThickZVects[k][2] + epsil;
1654  fMotherHorn1AllLengths.push_back(z);
1655  fMotherHorn1AllRads.push_back(r);
1656  }
1657  if (std::abs(fHorn1PolyListRinThickZVects[0][2]) > 1.0e-10) {
1658  G4Exception("LBNEVolumePlacements::UpdateParamsForHorn1MotherPoly",
1659  " ", FatalErrorInArgument, " The first point must be at Z =0., for consistency... ");
1660  }
1661  //
1662  // Now the outer...extended a bit (kind of arbitrary at this point in time.. )
1663  //
1664  const double zLast = fHorn1PolyListRinThickZVects[fHorn1PolyListRinThickZVects.size()-1][2] + 2.0*epsil;
1665  fMotherHorn1AllLengths.push_back(zLast);
1666  fMotherHorn1AllRads.push_back(rOut);
1667  fHorn1Length = zLast + 1.0*CLHEP::mm;
1668  std::cerr << " LBNEVolumePlacements::UpdateParamsForHorn1MotherPoly, total length of Horn1 " <<
1669  zLast << " Outer Radius " << rOut << std::endl;
1670 }
std::vector< double > fMotherHorn1AllLengths
std::vector< G4ThreeVector > fHorn1PolyListRinThickZVects
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
T abs(T value)
double z
std::vector< double > fMotherHorn1AllRads
QTextStream & endl(QTextStream &s)
void LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum ( size_t  iH)

Definition at line 1674 of file LBNEVolumePlacementsAdd.cc.

1674  {
1675  //
1676  // Convert the array of 3-vector to the fMotherHorn1AllLengths, AllRads
1677  //
1678  const bool debugIsOn = false;
1679  if (debugIsOn) std::cerr << " LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum, index " << iH << std::endl;
1680  if (fMotherHornsAllLengths.size() != static_cast<size_t>(fUseNumberOfHornsPoly)) {
1681  G4Exception("LBNEVolumePlacements::UpdateParamsForHornsMotherPoly",
1682  " ", FatalErrorInArgument, "Inconsistency in the number of simple Polycone Horns ");
1683  }
1684  if ((iH >= fMotherHornsAllLengths.size()) || (iH >= fMotherHornsAllRads.size())) {
1685  G4Exception("LBNEVolumePlacements::UpdateParamsForHornsMotherPoly",
1686  " ", FatalErrorInArgument, "Inconsistency in indexing simple Polycone Horns number");
1687  }
1688  fMotherHornsAllLengths[iH].clear();
1689  fMotherHornsAllRads[iH].clear();
1690  fMotherHornsAllThick[iH].clear();
1691 
1692  if (fHornsPolyListRinThickZVects[iH].size() != static_cast<size_t>(fUseHornsPolyNumInnerPts[iH])) {
1693  std::ostringstream message; message << " Inconsistency in sizing Horn Polycone " << iH;
1694  std::string messStr(message.str());
1695  G4Exception("LBNEVolumePlacements::UpdateParamsForHornsMotherPoly",
1696  " ", FatalErrorInArgument, messStr.c_str());
1697  }
1698  //
1699  // This "fMotherHornsAll" Lengths/Radiis is used to defined
1700  // The first point in these arrays is located on the external surface of the outer conductor, most upstream point
1701  // We set the point to be epsil away from the physical conductor. We add the thickness of the innerconductor
1702  // to avoid volume overlap when we will define the IC, and the water layer. This is clearly unphysical, but avoids
1703  // the complexity of having to define more volumes.
1704  // Note the water layer thickness is assumed to be uniform across the length of the device. Clearly wrong...
1705  // This is a more serious approximation...
1706  //
1707  const double epsil = 0.050*CLHEP::mm;
1708  const double thickInnerAtZStart = fHornsPolyListRinThickZVects[iH][0][1];
1709  const double rOut = fHorn1PolyOuterRadius + 2.5*CLHEP::cm + epsil + thickInnerAtZStart + fWaterLayerThickInHorns;
1710  fHorn1OuterTubeOuterRad = rOut;
1711  fMotherHornsAllRads[iH].push_back(rOut);
1712  fMotherHornsAllLengths[iH].push_back(0.);
1713  fMotherHornsAllThick[iH].push_back(0.25*25.4*CLHEP::mm);
1714  if (debugIsOn) std::cerr<< " LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum... for IH "
1715  << iH <<std::endl; /* for debugging */
1716  for(size_t k=0; k != fHornsPolyListRinThickZVects[iH].size(); k++) {
1717  const double r = fHornsPolyListRinThickZVects[iH][k][0] - epsil;
1718  const double z = fHornsPolyListRinThickZVects[iH][k][2] + epsil;
1719  const double thick = fHornsPolyListRinThickZVects[iH][k][1];
1720  if (debugIsOn) std::cerr<< " ..... at k "<< k << " z " << fHornsPolyListRinThickZVects[iH][k][2]
1721  << " r "<< fHornsPolyListRinThickZVects[iH][k][0]
1722  << " thick " << thick << std::endl; /* for debugging */
1723  // Not the last point
1724  if (fPolyconeHornsAreParabolic[iH]) {
1725  if(k+1!=fHornsPolyListRinThickZVects[iH].size()){
1726  // If the radius changes it could, should be a parabola
1727  if (debugIsOn) std::cerr<< " ..... Delta R at k "<< k << " to " << k+1 << " = " <<
1729  if(std::abs(fHornsPolyListRinThickZVects[iH][k][0] - fHornsPolyListRinThickZVects[iH][k+1][0]) > 1.5*mm){
1730  double a=(fHornsPolyListRinThickZVects[iH][k][2]-fHornsPolyListRinThickZVects[iH][k+1][2])/
1733  // z=a*r^2+c --> a=(z1-z2)/(r1^2-r2^2)
1734 // Check for a flange ... a flange is a very rapid change in r over small change in z
1735 // if(std::abs(a)<1.e-4)continue;
1736  if (debugIsOn) std::cerr<< " ....radial jump... at k "<< k << " a " << a << std::endl; /* for debugging */
1737  if(std::abs(a)<1.e-4){
1738  fMotherHornsAllLengths[iH].push_back(z);
1739  fMotherHornsAllRads[iH].push_back(r);
1740  fMotherHornsAllThick[iH].push_back(fHornsPolyListRinThickZVects[iH][k][1]);
1741  } else {
1742  double c= fHornsPolyListRinThickZVects[iH][k][2]
1744  // 1 mm radial spacing? Number of points
1745  int np=((int)std::abs(fHornsPolyListRinThickZVects[iH][k][0]-fHornsPolyListRinThickZVects[iH][k+1][0]))+1;
1746  double rstep=(fHornsPolyListRinThickZVects[iH][k][0]-fHornsPolyListRinThickZVects[iH][k+1][0])/(double)np;
1747  if (debugIsOn) std::cerr<< " ..... ..... Parabolic section intiated at k... "<< k << " a " << a << " c " << c <<
1748  " np " << np << " z "<< z << std::endl; /* for debugging */
1749  for(int numr=0; numr<np; numr++){
1750  double radTmp1=fHornsPolyListRinThickZVects[iH][k][0]-numr*rstep;
1751  double zl=a*(radTmp1*radTmp1)+c-epsil;
1752  double rl = (radTmp1 > epsil) ? (radTmp1 - epsil) : radTmp1;
1753  fMotherHornsAllLengths[iH].push_back(zl);
1754  fMotherHornsAllRads[iH].push_back(rl);
1755  fMotherHornsAllThick[iH].push_back(fHornsPolyListRinThickZVects[iH][k][1]);
1756  // std::cout<<"HornsPoly "<<zl<<" "<<rl<<std::endl; /* for debugging */
1757  }
1758  }
1759  } else { // If no change in radius just a pipe. Change z keep r fixed
1760  fMotherHornsAllLengths[iH].push_back(z);
1761  fMotherHornsAllRads[iH].push_back(r);
1762  fMotherHornsAllThick[iH].push_back(fHornsPolyListRinThickZVects[iH][k][1]);
1763  if (fPolyconeHornsAreParabolic[iH]) std::cerr << " ..... Keep linear profile at k " << k << std::endl;
1764  }
1765  } else { // the last point
1766  fMotherHornsAllLengths[iH].push_back(z);
1767  fMotherHornsAllRads[iH].push_back(r);
1768  fMotherHornsAllThick[iH].push_back(fHornsPolyListRinThickZVects[iH][k][1]);
1769  }
1770  } else { // linear horns..
1771  fMotherHornsAllLengths[iH].push_back(z);
1772  fMotherHornsAllRads[iH].push_back(r);
1773  fMotherHornsAllThick[iH].push_back(thick);
1774  }
1775  } // on number of segments.
1776 
1777  const G4ThreeVector dataRZT = fHornsPolyListRinThickZVects[iH][0];
1778  if (dataRZT[2] > 1.0e-10) {
1779  std::ostringstream message;
1780  message << " The first point must be at Z =0., for consistency.. Horn " << (iH +1)
1781  << " Z-begin " <<dataRZT[2];
1782  std::string messStr(message.str());
1783  G4Exception("LBNEVolumePlacements::UpdateParamsForHornMotherPoly",
1784  " ", FatalErrorInArgument, messStr.c_str());
1785  }
1786  const double zLast = fHornsPolyListRinThickZVects[iH][fHornsPolyListRinThickZVects[iH].size()-1][2] + 2.0*epsil;
1787  fMotherHornsAllLengths[iH].push_back(zLast);
1788  fMotherHornsAllRads[iH].push_back(rOut);
1789  fHornsLength[iH] = zLast + 2.0*epsil;
1790  fMotherHornsAllThick[iH].push_back(0.25*25.4*CLHEP::mm);
1791  if (debugIsOn) std::cerr << " LBNEVolumePlacements::UpdateParamsForHornMotherPoly, total length of Horn " << (iH + 1) <<
1792  " = " << zLast << " Length of thickneses " << fMotherHornsAllThick[iH].size() << std::endl;
1793  //
1794  // Check the consistency
1795  //
1796  for (size_t iHH = 0; iHH != static_cast<size_t>(fUseNumberOfHornsPoly); iHH++) {
1797 // std::cerr << " LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum, checks, at Horn " << (iHH+1)
1798 // << " ZStart " << fHornsPolyZStartPos[iHH] << std::endl;
1799  if (fHornsPolyZStartPos[iHH] < -5000.*CLHEP::m) continue; // Not declared yet.
1800  if ((iHH != 0) && (fHornsPolyZStartPos[iHH-1] > fHornsPolyZStartPos[iHH-1])) {
1801  std::ostringstream mStrStr; mStrStr
1802  << " The Polycones Horns must be declared in sequential order along the beam axis, \n "
1803  << " Upstream to downstream. Problem for Horn "
1804  << (iHH) << " to " << (iHH+1);
1805  std::string mStr(mStrStr.str());
1806  G4Exception("LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum",
1807  " ", FatalErrorInArgument, mStr.c_str());
1808 
1809  }
1810  double zPosPtLast = fMotherHornsAllLengths[iHH][fMotherHornsAllLengths[iHH].size()-1];
1811  double zCurr = fHornsPolyZStartPos[iHH] + zPosPtLast + 1.0*CLHEP::mm;
1812  bool badLength= false;
1813  std::ostringstream mblStrStr;
1814  if (iHH == static_cast<size_t>(fUseNumberOfHornsPoly-1)) {
1815  badLength = (zCurr > fDecayPipeLongPosition);
1816  if (badLength)
1817  mblStrStr << " Likely longitudinal overlap for Horn "
1818  << (iHH+1) << " Z End of this horn " << zCurr/CLHEP::m << " meters" << std::endl
1819  << " ZStart of this horn " << fHornsPolyZStartPos[iHH] << " length"
1820  << zPosPtLast << " Start of decay Pipe " << fDecayPipeLongPosition << std::endl;
1821  } else {
1822  badLength = ((zCurr + 1.0*CLHEP::mm) > fHornsPolyZStartPos[(iHH+1)]);
1823  if (badLength)
1824  mblStrStr << " Likely longitudinal overlap for Horn "
1825  << (iHH+1) << " Z End of this horn " << zCurr/CLHEP::m << " meters" << std::endl
1826  << " ZStart of this horn " << fHornsPolyZStartPos[iHH] << " length "
1827  << zPosPtLast << " Start ofNext horn " << fHornsPolyZStartPos[iHH+1] << std::endl;
1828  }
1829  if (badLength) {
1830  std::string mblStr(mblStrStr.str());
1831  G4Exception("LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum",
1832  " ", FatalErrorInArgument, mblStr.c_str());
1833  }
1834  const bool badOutRadius = (fHornsPolyOuterRadius[iH] > (fChaseWidthForLBNF - 152.4*CLHEP::mm));
1835  if (badOutRadius) {
1836 
1837  std::ostringstream mStrStr;
1838  mStrStr << " Horn " << (iHH+1)
1839  << " will not fit easily into the Chase, outer radius too big, " << fHornsPolyOuterRadius[iH] << " meters";
1840  std::string mStr(mStrStr.str());
1841  G4Exception("LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum",
1842  " ", FatalErrorInArgument, mStr.c_str());
1843 
1844  }
1845  }
1846  if (iH == 0) { // copy the parameters to the old (Sept. 2014 ) arrays for Horn1
1847  fMotherHorn1AllLengths = fMotherHornsAllLengths[iH];
1850  fHorn1Length = fMotherHornsAllLengths[iH][fMotherHornsAllLengths[iH].size()-1] + 1.0*CLHEP::mm;
1851  if (debugIsOn) std::cerr << " LBNEVolumePlacements::UpdateParamsForHornMotherPolyNum, setting Horn1 length to " <<
1853  }
1854  // make sure they are all defined...
1855  if (iH == fMotherHornsAllLengths.size()-1) this->DumpAllHornsPolyconeParameters();
1856 }
std::vector< double > fMotherHorn1AllLengths
std::vector< std::vector< G4ThreeVector > > fHornsPolyListRinThickZVects
std::string string
Definition: nybbler.cc:12
std::vector< double > fHornsPolyOuterRadius
std::vector< std::vector< double > > fMotherHornsAllRads
std::vector< double > fHornsPolyZStartPos
std::vector< int > fUseHornsPolyNumInnerPts
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:45
T abs(T value)
std::vector< bool > fPolyconeHornsAreParabolic
double z
std::vector< double > fMotherHorn1AllThick
std::vector< double > fHornsLength
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
std::vector< std::vector< double > > fMotherHornsAllThick
std::vector< double > fMotherHorn1AllRads
QTextStream & endl(QTextStream &s)
std::vector< std::vector< double > > fMotherHornsAllLengths

Member Data Documentation

G4String LBNEVolumePlacements::fAbsorberGDMLFilename
private

Definition at line 1120 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fAbsorberHallZ
private

Definition at line 708 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::fArbitraryOffsetHystericalOne
private

Definition at line 1139 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fBaffleInnerRadius
private

Definition at line 727 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fBaffleLength
private

Definition at line 729 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fBaffleOuterRadius
private

Definition at line 728 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fBaffleWindowThickness
private

Definition at line 730 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fBaffleZPosition
private

Definition at line 731 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fChaseWidthForLBNF
private

Definition at line 1079 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fCheckVolumeOverLapWC
private

Definition at line 1129 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fConstructPlug
private

Definition at line 889 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fConstructPlugInHorn1
private

Definition at line 890 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fCurrentMilindWire
private

Definition at line 1072 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayHallZ
private

Definition at line 709 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fDecayPipeGas
private

Definition at line 716 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeLength
private

Definition at line 710 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeLengthCorrection
private

Definition at line 711 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeLongPosition
private

Definition at line 715 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeRadius
private

Definition at line 712 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeUpstrWindowThick
private

Definition at line 713 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeWallThick
private

Definition at line 714 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeWindowRadiusAlum
private

Definition at line 1088 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeWindowRadiusBeryl
private

Definition at line 1089 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeWindowThickAlum
private

Definition at line 1091 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeWindowThickBeryl
private

Definition at line 1090 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDecayPipeWindowZLocation
private

Definition at line 1087 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fDistMCZeroToACTRN1Pts
private

Definition at line 725 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fDoInstallShield
private

Definition at line 1124 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fExtendChaseLength
private

Definition at line 1066 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fFillHornsWithArgon
private

Definition at line 912 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fHorn1AllCondMat
private

Definition at line 975 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1DownstreamPlateLength
private

Definition at line 723 of file LBNEVolumePlacements.hh.

std::vector<LBNEHornRadialEquation> LBNEVolumePlacements::fHorn1Equations
private

Definition at line 977 of file LBNEVolumePlacements.hh.

G4PVPlacement* LBNEVolumePlacements::fHorn1HallPhysPtr
private

Definition at line 983 of file LBNEVolumePlacements.hh.

std::vector<G4String> LBNEVolumePlacements::fHorn1IC
private

Definition at line 1154 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fHorn1InnerCondMat
private

Definition at line 974 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1InnerConnectorLength
private

Definition at line 971 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1InnerConnectorPosition
private

Definition at line 972 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1InnerConnectorRad
private

Definition at line 969 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1InnerConnectorThick
private

Definition at line 970 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1IOTransInnerRad
private

Definition at line 930 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1IOTransLength
private

Definition at line 929 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1IOTransOuterRad
private

Definition at line 931 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1Length
private

Definition at line 719 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1LongRescale
private

Definition at line 922 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fHorn1LongRescaleCnt
private

Definition at line 917 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fHorn1MotherIsPolycone
private

Definition at line 1138 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1NeckInnerRadius
private

Definition at line 954 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1NeckLength
private

Definition at line 952 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1NeckOuterRadius
private

Definition at line 953 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1NeckZPosition
private

Definition at line 956 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1OuterConnectorLength
private

Definition at line 966 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1OuterConnectorPosition
private

Definition at line 967 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1OuterConnectorRad
private

Definition at line 964 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1OuterConnectorThick
private

Definition at line 965 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1OuterTubeInnerRad
private

Definition at line 961 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1OuterTubeOuterRad
private

Definition at line 962 of file LBNEVolumePlacements.hh.

std::vector<G4ThreeVector> LBNEVolumePlacements::fHorn1PolyListRinThickZVects

Definition at line 359 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::fHorn1PolyOuterRadius

Definition at line 360 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1RadialRescale
private

Definition at line 921 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fHorn1RadialRescaleCnt
private

Definition at line 915 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1RadialSafetyMargin
private

Definition at line 923 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fHorn1RadiusBigEnough
private

Definition at line 926 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1RMaxAllBG
private

Definition at line 925 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1RMinAllBG
private

Definition at line 924 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1TopDownstrLength
private

Definition at line 950 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1TopDownstrOuterRad
private

Definition at line 951 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1TopUpstrInnerRad
private

Definition at line 946 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1TopUpstrLength
private

Definition at line 945 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1TopUpstrOuterRad
private

Definition at line 947 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrInnerRadsDownstr
private

Definition at line 934 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrInnerRadsOuterDownstr
private

Definition at line 936 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrInnerRadsOuterUpstr
private

Definition at line 935 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrInnerRadsUpstr
private

Definition at line 933 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrLengths
private

Definition at line 937 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrOuterIOTransInnerRads
private

Definition at line 940 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrOuterIOTransLengths
private

Definition at line 942 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrOuterIOTransPositions
private

Definition at line 943 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrOuterIOTransThicks
private

Definition at line 941 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn1UpstrZPositions
private

Definition at line 938 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1ZDEndNeckRegion
private

Definition at line 955 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn1ZEndIC
private

Definition at line 957 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fHorn2AllCondMat
private

Definition at line 1053 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2DeltaZEntranceToZOrigin
private

Definition at line 1050 of file LBNEVolumePlacements.hh.

std::vector<LBNEHornRadialEquation> LBNEVolumePlacements::fHorn2Equations
private

Definition at line 1024 of file LBNEVolumePlacements.hh.

std::vector<G4String> LBNEVolumePlacements::fHorn2IC
private

Definition at line 1155 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fHorn2InnerCondMat
private

Definition at line 1052 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2InnerIOTransLength
private

Definition at line 1022 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2Length
private

Definition at line 997 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2LengthMargin
private

Definition at line 1011 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2LengthNominal
private

Definition at line 998 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2LongPosition
private

Definition at line 995 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2LongRescale
private

Definition at line 994 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fHorn2LongRescaleCnt
private

Definition at line 991 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2NeckInnerRadius
private

Definition at line 1047 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2NeckLength
private

Definition at line 1045 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2NeckOuterRadius
private

Definition at line 1046 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2NeckZPosition
private

Definition at line 1048 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2OffsetIOTr1
private

Definition at line 1000 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2OuterTubeInnerRad
private

Definition at line 1028 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2OuterTubeOuterRad
private

Definition at line 1029 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2OuterTubeOuterRadMax
private

Definition at line 1030 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn2PartsLengths
private

Definition at line 1008 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn2PartsRadii
private

Definition at line 1009 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2RadialRescale
private

Definition at line 992 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fHorn2RadialRescaleCnt
private

Definition at line 989 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2RadialRescaleCst
private

Definition at line 993 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2Radius
private

Definition at line 999 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn2UpstrOuterIOTransLengths
private

Definition at line 1017 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn2UpstrOuterIOTransPositions
private

Definition at line 1018 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn2UpstrOuterIOTransRadsOne
private

Definition at line 1015 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn2UpstrOuterIOTransRadsTwo
private

Definition at line 1016 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn2ZEndIC
private

Definition at line 1049 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fHorn2ZEqnChanges
private

Definition at line 1044 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fHorn3AllCondMat
private

Definition at line 1055 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn3ICQLengthIntoHornMother
private

Definition at line 1056 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fHorn3InnerCondMat
private

Definition at line 1054 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fHorn3OCQLengthIntoHornMother
private

Definition at line 1057 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fHornsLength
private

Definition at line 720 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fHornsOuterTubeOuterRad
private

Definition at line 963 of file LBNEVolumePlacements.hh.

std::vector< std::vector<G4ThreeVector> > LBNEVolumePlacements::fHornsPolyListRinThickZVects

Definition at line 367 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fHornsPolyOuterRadius

Definition at line 368 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fHornsPolyZStartPos

Definition at line 369 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fInstallBaffle
private

Definition at line 1167 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fInstallDownstTargetSupport
private

Definition at line 1171 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fInstallRALShortTarget
private

Definition at line 1170 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fInstallUpstreamHorizontalTarget
private

Definition at line 1169 of file LBNEVolumePlacements.hh.

LBNEVolumePlacements * LBNEVolumePlacements::fInstance = 0
staticprivate

Definition at line 122 of file LBNEVolumePlacements.hh.

size_t LBNEVolumePlacements::fLBNFOptimConceptDesignHornCNumStepIC[10]
private

Definition at line 1172 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fLengthCurrEqICInMotherHorn2
private

Definition at line 1036 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fLengthCurrEqOCInMotherHorn2
private

Definition at line 1037 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fLengthOfRockDownstr
private

Definition at line 706 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fMarsTargetHornsGDMLFilename
private

Definition at line 1118 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fMaxNumAlignRings
private

Definition at line 819 of file LBNEVolumePlacements.hh.

G4RotationMatrix* LBNEVolumePlacements::fMirrorRotation

Definition at line 1392 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fMotherHorn1AllLengths
private

Definition at line 1141 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fMotherHorn1AllRads
private

Definition at line 1140 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fMotherHorn1AllThick
private

Definition at line 1142 of file LBNEVolumePlacements.hh.

std::vector< std::vector<double> > LBNEVolumePlacements::fMotherHornsAllLengths
private

Definition at line 1146 of file LBNEVolumePlacements.hh.

std::vector< std::vector<double> > LBNEVolumePlacements::fMotherHornsAllRads
private

Definition at line 1144 of file LBNEVolumePlacements.hh.

std::vector< std::vector<double> > LBNEVolumePlacements::fMotherHornsAllThick
private

Definition at line 1145 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fMultiSphereTargetLength
private

Definition at line 904 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fMultiSphereTargetRadius
private

Definition at line 905 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::fNumTarget2Objects

Definition at line 1330 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::fNumTargetObjects

Definition at line 1329 of file LBNEVolumePlacements.hh.

G4UImessenger* LBNEVolumePlacements::fPlacementMessenger
private

Definition at line 687 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fPlugInnerRadius
private

Definition at line 732 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fPlugLength
private

Definition at line 734 of file LBNEVolumePlacements.hh.

std::string LBNEVolumePlacements::fPlugMaterial
private

Definition at line 736 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fPlugOuterRadius
private

Definition at line 733 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fPlugZPosition
private

Definition at line 735 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fPolyconeHorn1IsParabolic

Definition at line 372 of file LBNEVolumePlacements.hh.

std::vector<bool> LBNEVolumePlacements::fPolyconeHornsAreParabolic

Definition at line 371 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadInnerICCurrEqHorn2
private

Definition at line 1036 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadInnerICCurrEqHornC
private

Definition at line 1061 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadInnerOCCurrEqHorn2
private

Definition at line 1037 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadInnerOCCurrEqHornC
private

Definition at line 1059 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadiusMilindWire
private

Definition at line 1071 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadOuterICCurrEqHorn2
private

Definition at line 1036 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadOuterICCurrEqHornC
private

Definition at line 1060 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadOuterOCCurrEqHorn2
private

Definition at line 1037 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRadOuterOCCurrEqHornC
private

Definition at line 1058 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRALSimpleTargetLength
private

Definition at line 834 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRALTargetRadius
private

Definition at line 895 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fRALTargetRing
private

Definition at line 894 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fRemoveDecayPipeSnout
private

Definition at line 1150 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fRemoveRALBafflet
private

Definition at line 1168 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fRemoveTargetAlltogether
private

Definition at line 908 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fRInCoordCDRevisedHornA

Definition at line 387 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fRInCoordCDRevisedHornB

Definition at line 390 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fRInCoordCDRevisedHornC

Definition at line 393 of file LBNEVolumePlacements.hh.

G4RotationMatrix* LBNEVolumePlacements::fRotHornBStrpLineConnFlatB[4]
private

Definition at line 1038 of file LBNEVolumePlacements.hh.

G4RotationMatrix* LBNEVolumePlacements::fRotHornBStrpLineConnFlatC[4]
private

Definition at line 1039 of file LBNEVolumePlacements.hh.

G4RotationMatrix* LBNEVolumePlacements::fRotHornBStrpLineRotY
private

Definition at line 1040 of file LBNEVolumePlacements.hh.

G4RotationMatrix LBNEVolumePlacements::fRotTgtTitCTubeHor
private

Definition at line 701 of file LBNEVolumePlacements.hh.

G4RotationMatrix LBNEVolumePlacements::fRotTgtTitCTubeVert
private

Definition at line 700 of file LBNEVolumePlacements.hh.

G4RotationMatrix LBNEVolumePlacements::fRotVertical
private

Definition at line 696 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fSimpleTargetHeight
private

Definition at line 898 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fSimpleTargetLength
private

Definition at line 892 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fSimpleTargetRadius
private

Definition at line 897 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fSimpleTargetRALLength
private

Definition at line 893 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fSimpleTargetWidth
private

Definition at line 899 of file LBNEVolumePlacements.hh.

std::map<G4String, LBNEVolumePlacementData> LBNEVolumePlacements::fSubVolumes
private

Definition at line 692 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2Density

Definition at line 1379 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2InCaseL

Definition at line 1334 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2Length

Definition at line 1307 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fTarget2MaterialName

Definition at line 1381 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2ModuleTotL

Definition at line 1352 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::fTarget2ModuleType

Definition at line 1269 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2NLambda

Definition at line 1364 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2OutCaseInnerR

Definition at line 1326 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2OutCaseL

Definition at line 1348 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2Radius

Definition at line 1299 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTarget2SpecificLambda

Definition at line 1380 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetAlignRingCutAngle
private

Definition at line 816 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetAlignRingInnerRadius
private

Definition at line 814 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fTargetAlignRingMaterial
private

Definition at line 817 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetAlignRingOuterRadius
private

Definition at line 815 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetAlignRingSpacing
private

Definition at line 818 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetAlignRingThick
private

Definition at line 813 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetAndBaffleLengthApprox
private

Definition at line 721 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetAndPlugLengthApprox
private

Definition at line 722 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetBaffletFlangeLength
private

Definition at line 842 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetBaffletLengthNoFlange
private

Definition at line 841 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetBaffletOutRadius
private

Definition at line 839 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetBerylDownstrWindowRadius
private

Definition at line 821 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetBerylDownstrWindowThick
private

Definition at line 820 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetBerylUpstrWindowRadius
private

Definition at line 823 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetBerylUpstrWindowThick
private

Definition at line 822 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCanInnerRadius
private

Definition at line 780 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCanLength
private

Definition at line 782 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fTargetCanMaterial
private

Definition at line 779 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCanOuterRadius
private

Definition at line 781 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCaseDiffL

Definition at line 1344 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCaseT

Definition at line 1321 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeInnerRadius
private

Definition at line 793 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeLength
private

Definition at line 829 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fTargetCTubeMaterial
private

Definition at line 791 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeOuterRadius
private

Definition at line 792 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnDownstrCutAngleSize
private

Definition at line 803 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnDownstrCutAngleStart
private

Definition at line 802 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnDownstrRadInner
private

Definition at line 804 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnDownstrRadOuter
private

Definition at line 805 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnDownstrThickTitanium
private

Definition at line 806 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnDownstrThickWater
private

Definition at line 807 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnHOffset
private

Definition at line 799 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnLengthDownstr
private

Definition at line 800 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnLengthUpstr
private

Definition at line 797 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnLengthUpstrEnd
private

Definition at line 810 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeReturnLengthUstr
private

Definition at line 809 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeUpstrLength
private

Definition at line 794 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fTargetCTubeUpstrNumSegCurve
private

Definition at line 798 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeUpstrOffset
private

Definition at line 795 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetCTubeUpstrRadCurve
private

Definition at line 796 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDensity
private

Definition at line 743 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDistFlangeToTargetStart
private

Definition at line 811 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDistToStartOfFlange
private

Definition at line 812 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDownstrCanFlangeInnerRadius
private

Definition at line 785 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fTargetDownstrCanFlangeMaterial
private

Definition at line 783 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDownstrCanFlangeOuterRadius
private

Definition at line 784 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDownstrCanFlangeThick
private

Definition at line 786 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportAlRingInnerRad
private

Definition at line 855 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportAlRingThickness
private

Definition at line 854 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportConnRing
private

Definition at line 840 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportLargeConeLargeInnerRad
private

Definition at line 864 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportLargeConeLargeOuterRad
private

Definition at line 865 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportLargeConeLength
private

Definition at line 857 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportLargeConeSmallInnerRad
private

Definition at line 862 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportLargeConeSmallOuterRad
private

Definition at line 863 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportOuterRingInnerRad
private

Definition at line 866 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportOuterRingLength
private

Definition at line 868 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportOuterRingOuterRad
private

Definition at line 867 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportSmallConeLargeInnerRad
private

Definition at line 860 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportSmallConeLargeOuterRad
private

Definition at line 861 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportSmallConeLength
private

Definition at line 856 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportSmallConeSmallInnerRad
private

Definition at line 858 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetDSSupportSmallConeSmallOuterRad
private

Definition at line 859 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinContainerWidth
private

Definition at line 760 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinExtraWidth
private

Definition at line 762 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinHeight
private

Definition at line 763 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinLength
private

Definition at line 764 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinLengthSplitDwnstr
private

Definition at line 771 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinLengthSplitUpstr
private

Definition at line 770 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinSpacingLength
private

Definition at line 772 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinWidth
private

Definition at line 755 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinWidthRequired
private

Definition at line 756 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFinWWingRadius
private

Definition at line 759 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFlangeInnerRadius
private

Definition at line 788 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fTargetFlangeMaterial
private

Definition at line 787 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFlangeOuterRadius
private

Definition at line 789 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFlangeThick
private

Definition at line 790 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetFracOutHornL

Definition at line 1356 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHallZ
private

Definition at line 707 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeBaffletLength
private

Definition at line 838 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeColdHeCurvature
private

Definition at line 843 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeInnerRadius
private

Definition at line 825 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeLargeConeInnerRad
private

Definition at line 835 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeLargeConeLength
private

Definition at line 837 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeLargeConeOuterRad
private

Definition at line 836 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeLength
private

Definition at line 852 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeLengthInHorn
private

Definition at line 851 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeLengthUpstr
private

Definition at line 850 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeOuterRadius
private

Definition at line 826 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeSmallConeInnerRad
private

Definition at line 832 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeSmallConeLength
private

Definition at line 830 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeSmallConeOuterRad
private

Definition at line 833 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeSmallCylLength
private

Definition at line 831 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeContTubeThickness
private

Definition at line 824 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetHeGap

Definition at line 1323 of file LBNEVolumePlacements.hh.

G4VPhysicalVolume* LBNEVolumePlacements::fTargetHorn1HallPhysPtr
private

Definition at line 982 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fTargetHorn1InnerRadsDownstr
private

Definition at line 880 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fTargetHorn1InnerRadsUpstr
private

Definition at line 879 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fTargetHorn1Lengths
private

Definition at line 882 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fTargetHorn1TransThick
private

Definition at line 881 of file LBNEVolumePlacements.hh.

std::vector<G4double> LBNEVolumePlacements::fTargetHorn1ZPositions
private

Definition at line 883 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetInCaseDnL

Definition at line 1340 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetInCaseL

Definition at line 1333 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetInCaseUpL

Definition at line 1337 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetLength

Definition at line 1304 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetLengthIntoHorn
private

Definition at line 746 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetLengthOutsideExtra
private

Definition at line 750 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetLengthOutsideHorn
private

Definition at line 749 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fTargetMaterialName
private

Definition at line 745 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetModuleTotL

Definition at line 1351 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::fTargetModuleType

Definition at line 1266 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetNLambda

Definition at line 1361 of file LBNEVolumePlacements.hh.

G4VPhysicalVolume* LBNEVolumePlacements::fTargetNoSplitM1
private

Definition at line 981 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fTargetNumFins
private

Definition at line 765 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fTargetNumFinsInHorn
private

Definition at line 767 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fTargetNumFinsUpstr
private

Definition at line 766 of file LBNEVolumePlacements.hh.

unsigned int LBNEVolumePlacements::fTargetNumFinsWithWings
private

Definition at line 758 of file LBNEVolumePlacements.hh.

G4int LBNEVolumePlacements::fTargetNumSphere
private

Definition at line 769 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutCaseInnerR

Definition at line 1325 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutCaseL

Definition at line 1347 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutHeContTubeInnerRadius
private

Definition at line 827 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutHeContTubeInnerRadiusTapered
private

Definition at line 844 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutHeContTubeInnerSphericalEndCap
private

Definition at line 849 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutHeContTubeOuterRadius
private

Definition at line 828 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutHeContTubeOuterRadiusTapered
private

Definition at line 845 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutHeContTubeOuterSphericalEndCap
private

Definition at line 848 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutHeContTubeStraightLength
private

Definition at line 847 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetOutHeContTubeTaperedLength
private

Definition at line 846 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetRadius

Definition at line 1296 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetSHeight
private

Definition at line 874 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetSLength
private

Definition at line 741 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetSLengthDownstrEnd
private

Definition at line 751 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetSLengthGraphite
private

Definition at line 742 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetSpecificLambda
private

Definition at line 744 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetSupportD

Definition at line 1315 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetSupportL

Definition at line 1318 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetSWidth
private

Definition at line 873 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetUpstrDwnstrMargin
private

Definition at line 774 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetUpstrPlateHoleRadius
private

Definition at line 776 of file LBNEVolumePlacements.hh.

G4String LBNEVolumePlacements::fTargetUpstrPlateMaterial
private

Definition at line 775 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetUpstrPlateOuterRadius
private

Definition at line 777 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetUpstrPlateThick
private

Definition at line 778 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetUpstrUpstrMargin
private

Definition at line 773 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetZ0
private

Definition at line 870 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetZ0Downstr
private

Definition at line 872 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetZ0Upstr
private

Definition at line 871 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTargetZOffsetStart
private

Definition at line 752 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::fThickICDRevisedHornA

Definition at line 388 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::fThickICDRevisedHornB

Definition at line 391 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::fThickICDRevisedHornC

Definition at line 394 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fThicknessBafflet
private

Definition at line 896 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fThicknessWall
private

Definition at line 853 of file LBNEVolumePlacements.hh.

const G4LogicalVolume* LBNEVolumePlacements::fTopLogicalVolume
private

Definition at line 1133 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTotalLength
private

Definition at line 705 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTotalLengthTargetAndHorn1Hall
private

Definition at line 901 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fTotalLengthUpstreamAssembly
private

Definition at line 900 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fUse1p2MW
private

Definition at line 1098 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fUse1p2MWSmallTgt
private

Definition at line 1099 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseCDR2015Optimized
private

Definition at line 1164 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseGDMLFile
private

Definition at line 1151 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseHorn1Polycone

Definition at line 356 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::fUseHorn1PolyNumInnerPts

Definition at line 358 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseHornsPolycone

Definition at line 357 of file LBNEVolumePlacements.hh.

std::vector<int> LBNEVolumePlacements::fUseHornsPolyNumInnerPts

Definition at line 366 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseLBNFOptimConceptDesignHornA
private

Definition at line 1161 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseLBNFOptimConceptDesignHornB
private

Definition at line 1162 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseLBNFOptimConceptDesignHornC
private

Definition at line 1163 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseMarsTargetHorns
private

Definition at line 1116 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fUseMultiSphereTarget
private

Definition at line 903 of file LBNEVolumePlacements.hh.

int LBNEVolumePlacements::fUseNumberOfHornsPoly

Definition at line 365 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fUsePseudoNova
private

Definition at line 1111 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fUseRALTGTv1
private

Definition at line 1100 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fUseRoundedTargetFins
private

Definition at line 1105 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fUseSimpleTargetBox
private

Definition at line 888 of file LBNEVolumePlacements.hh.

G4bool LBNEVolumePlacements::fUseSimpleTargetCylinder
private

Definition at line 891 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseTarget2Module

Definition at line 1259 of file LBNEVolumePlacements.hh.

bool LBNEVolumePlacements::fUseTargetModule

Definition at line 1256 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fWaterLayerThickInHorns
private

Definition at line 718 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fWriteGDMLFile
private

Definition at line 1074 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fZCoordCDRevisedHornA

Definition at line 386 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fZCoordCDRevisedHornB

Definition at line 389 of file LBNEVolumePlacements.hh.

std::vector<double> LBNEVolumePlacements::fZCoordCDRevisedHornC

Definition at line 392 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::fZHallHorn1ToHorn1PolyM1
private

Definition at line 1166 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fZHorn1ACRNT1Shift
private

Definition at line 948 of file LBNEVolumePlacements.hh.

G4double LBNEVolumePlacements::fZModuleShift

Definition at line 1394 of file LBNEVolumePlacements.hh.

double LBNEVolumePlacements::fZShiftConceptHornAStartIC
private

Definition at line 1165 of file LBNEVolumePlacements.hh.


The documentation for this class was generated from the following files: