Commit 6cf8e9d8 authored by Guillaume Unal's avatar Guillaume Unal Committed by Graeme Stewart
Browse files

fix application of phi_safety for inverted parity construction to avoid small...

fix application of phi_safety for inverted parity construction to avoid small clashes (LArGeoBarrel-00-01-10)
parent 256c91a3
# Packages needed to compile this one:
PACKAGES := DetectorDescription/GeoModel/GeoModelKernel
PACKAGES += LArCalorimeter/LArGeoModel/LArGeoCode
# Standardized compilation commands.
include $(MAKEPACKAGE)
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// BarrelConstruction
// Insert the LAr Barrel into a pre-defined mother volume.
// Author: Gaston Parrour translated to GeoModel by G.Unal
#ifndef __BarrelConstruction_H__
#define __BarrelConstruction_H__
#include "LArGeoCode/VDetectorParameters.h"
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "CLHEP/GenericFunctions/FunctionNoop.hh"
namespace LArGeo {
class BarrelConstruction
{
public:
// Constructor;
BarrelConstruction(bool fullGeo);
// Destructor:
virtual ~BarrelConstruction();
// Get the envelope containing this detector.
GeoFullPhysVol* GetPositiveEnvelope();
GeoFullPhysVol* GetNegativeEnvelope();
// Set parameters for the barrel.
void setBarrelSagging(bool flag) {A_SAGGING = flag;}
void setBarrelCellVisLimit(int maxCell) {NVISLIM = maxCell;}
void printParams();
private:
void MakeEnvelope();
// It is illegal to copy a BarrelConstruction:
BarrelConstruction (const BarrelConstruction &);
// It is illegal to assign a BarrelConstruction:
BarrelConstruction & operator= (const BarrelConstruction &);
// Three auxiliary functions:------------------------------------//
// //
Genfun::FunctionNoop Fx( double r, //
Genfun::GENFUNCTION G, //
const double Cenx[], //
const double Ceny[] ) const; //
// //
Genfun::FunctionNoop Fy( double r, //
Genfun::GENFUNCTION G, //
const double Cenx[], //
const double Ceny[] ) const; //
// //
Genfun::FunctionNoop Dely(Genfun::GENFUNCTION G ) const; //
Genfun::FunctionNoop Del1(Genfun::GENFUNCTION G ) const; //
Genfun::FunctionNoop Del2(Genfun::GENFUNCTION G ) const; //
//-------------------------------------------------------------//
// Atan2 for Generic Functions..:------------------------------//
Genfun::FunctionNoop ATan2(Genfun::GENFUNCTION y, //
Genfun::GENFUNCTION x) const; //
//-------------------------------------------------------------//
// Detector parameters ACCG, ACCA, ACMB, ACCO
LArGeo::VDetectorParameters* m_parameters;
bool A_SAGGING;
int NVISLIM;
// volumes that are private member variables:
GeoFullPhysVol* m_ecamPhysicalPos;
GeoFullPhysVol* m_ecamPhysicalNeg;
bool m_fullGeo; // true->FULL, false->RECO
};
} // namespace LArGeo
#endif // __BarrelConstruction_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
* @file BarrelCryostatConstruction.h
*
* @brief Declaration of BarrelCryostatConstruction class
*
* $Id: BarrelCryostatConstruction.h,v 1.12 2009-02-10 16:49:47 tsulaia Exp $
*/
#ifndef __BarrelCryostatConstruction_H__
#define __BarrelCryostatConstruction_H__
#include "GeoModelKernel/GeoFullPhysVol.h"
class StoreGateSvc;
namespace LArGeo {
/** @class LArGeo::BarrelCryostatConstruction
@brief Builds GeoModel description of the LAr Electromagnetic Barrel.
Descriptions of the presampler and dad material in the crack region are
implemented in separate classes
*/
class BarrelCryostatConstruction
{
public:
BarrelCryostatConstruction(bool fullGeo);
virtual ~BarrelCryostatConstruction();
// Get the envelope containing this detector.
virtual GeoFullPhysVol* GetEnvelope();
void setBarrelSagging(bool flag) {_barrelSagging = flag;}
void setBarrelCellVisLimit(int maxCell) {_barrelVisLimit = maxCell;}
private:
bool _barrelSagging;
int _barrelVisLimit;
GeoFullPhysVol *cryoMotherPhysical;
bool m_fullGeo; // true->FULL, false->RECO
};
} // namespace LArGeo
#endif // __BarrelCryostatConstruction_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
* @file BarrelDMConstruction.h
*
* @brief Declaration of BarrelDMConstruction class
*
* $Id: BarrelDMConstruction.h,v 1.3 2007-07-08 18:50:15 tsulaia Exp $
*/
#ifndef __BarrelDMConstruction_H__
#define __BarrelDMConstruction_H__
// Forward declarations
class GeoFullPhysVol;
namespace LArGeo {
/** @class LArGeo::BarrelDMConstruction
@brief GeoModel description of dead material in the crack region
*/
class BarrelDMConstruction
{
public:
// Constructor;
BarrelDMConstruction();
// Destructor:
virtual ~BarrelDMConstruction();
// Add passive materials to the barrel envelope
void create(GeoFullPhysVol* envelope);
private:
// It is illegal to copy a BarrelDMConstruction:
BarrelDMConstruction (const BarrelDMConstruction &);
// It is illegal to assign a BarrelDMConstruction:
BarrelDMConstruction & operator= (const BarrelDMConstruction &);
};
} // namespace LArGeo
#endif // __BarrelDMConstruction_H__
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
* @file BarrelPresamplerConstruction.h
*
* @brief Declaration of BarrelPresamplerConstruction class
*
* $Id: BarrelPresamplerConstruction.h,v 1.4 2009-02-10 16:49:47 tsulaia Exp $
*/
#ifndef __BarrelPresamplerConstruction_H__
#define __BarrelPresamplerConstruction_H__
#include "LArGeoCode/VDetectorParameters.h"
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "CLHEP/GenericFunctions/FunctionNoop.hh"
// Forward declarations
namespace LArGeo {
/** @class LArGeo::BarrelPresamplerConstruction
@brief GeoModel description of the LAr Barrel Presampler
*/
class BarrelPresamplerConstruction
{
public:
// Constructor;
BarrelPresamplerConstruction(bool fullGeo, int itb=0);
// Destructor:
virtual ~BarrelPresamplerConstruction();
// Get the envelope containing this detector.
GeoFullPhysVol* GetPositiveEnvelope();
GeoFullPhysVol* GetNegativeEnvelope();
private:
void MakeEnvelope();
// It is illegal to copy a BarrelPresamplerConstruction:
BarrelPresamplerConstruction (const BarrelPresamplerConstruction &);
// It is illegal to assign a BarrelPresamplerConstruction:
BarrelPresamplerConstruction & operator= (const BarrelPresamplerConstruction &);
// Detector parameters ACCG, ACCA, ACMB, ACCO
LArGeo::VDetectorParameters* m_parameters;
// volumes that are private member variables:
GeoFullPhysVol* m_psPhysicalPos;
GeoFullPhysVol* m_psPhysicalNeg;
bool m_fullGeo; // true->FULL, false->RECO
};
} // namespace LArGeo
#endif // __BarrelPresamplerConstruction_H__
package LArGeoBarrel
author Gaston Parrour <gaston.parrour@cern.ch>
author William Seligman <seligman@nevis.columbia.edu>
author Mikhail Leltchouk <lelchuk@nevis.columbia.edu>
# This package defines the geometry for the ATLAS liquid-argon barrel
# cryostat, pre-sampler, and calorimeter.
use AtlasPolicy AtlasPolicy-*
use LArGeoCode LArGeoCode-* LArCalorimeter/LArGeoModel
use AtlasCLHEP AtlasCLHEP-* External
use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel
# Build the library (and export the headers)
library LArGeoBarrel *.cxx
apply_pattern installed_library
private
use StoreGate StoreGate-* Control
use GaudiInterface GaudiInterface-* External
use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL
use LArReadoutGeometry LArReadoutGeometry-* LArCalorimeter/LArGeoModel
use GeoModelUtilities GeoModelUtilities-* DetectorDescription/GeoModel
use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel
\ No newline at end of file
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/**
@mainpage
LArGeoBarrel package builds GeoModel description of the LAr Electromagnetic
Barrel. This description also includes dead material description in
the crack region.
--------------------------------
REQUIREMENTS
--------------------------------
@include requirements
@htmlinclude used_packages.html
*/
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "LArGeoBarrel/BarrelPresamplerConstruction.h"
#include "LArGeoCode/VDetectorParameters.h"
#include "GeoModelKernel/GeoElement.h"
#include "GeoModelKernel/GeoMaterial.h"
#include "GeoModelKernel/GeoFullPhysVol.h"
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoVPhysVol.h"
#include "GeoModelKernel/GeoLogVol.h"
#include "GeoModelKernel/GeoTransform.h"
#include "GeoModelKernel/GeoAlignableTransform.h"
#include "GeoModelKernel/GeoIdentifierTag.h"
#include "GeoModelKernel/GeoNameTag.h"
#include "GeoModelKernel/GeoSerialIdentifier.h"
#include "GeoModelKernel/GeoSerialTransformer.h"
#include "GeoModelKernel/GeoXF.h"
// volumes used: Pcon, Tubs, Cons, Box, Trap
#include "GeoModelKernel/GeoPcon.h"
#include "GeoModelKernel/GeoTubs.h"
#include "GeoModelKernel/GeoCons.h"
#include "GeoModelKernel/GeoBox.h"
#include "GeoModelKernel/GeoTrap.h"
#include "GeoModelKernel/GeoTrd.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/DataHandle.h"
#include "GeoModelInterfaces/AbsMaterialManager.h"
#include "GeoModelInterfaces/StoredMaterialManager.h"
// For transforms:
#include "CLHEP/Geometry/Transform3D.h"
#include "CLHEP/Vector/Rotation.h"
// For units:
#include "CLHEP/Units/PhysicalConstants.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/Bootstrap.h"
// For Functions:
// For functions:
#include "CLHEP/GenericFunctions/Abs.hh"
#include "CLHEP/GenericFunctions/Sin.hh"
#include "CLHEP/GenericFunctions/Cos.hh"
#include "CLHEP/GenericFunctions/Sqrt.hh"
#include "CLHEP/GenericFunctions/ATan.hh"
#include "CLHEP/GenericFunctions/Rectangular.hh"
#include "CLHEP/GenericFunctions/Mod.hh"
#include "CLHEP/GenericFunctions/Variable.hh"
#include "CLHEP/GenericFunctions/FixedConstant.hh"
// Constructor;
LArGeo::BarrelPresamplerConstruction ::BarrelPresamplerConstruction(bool fullGeo, int itb):
m_parameters(LArGeo::VDetectorParameters::GetInstance()),
m_psPhysicalPos(NULL),
m_psPhysicalNeg(NULL),
m_fullGeo(fullGeo)
{
ISvcLocator *svcLocator = Gaudi::svcLocator();
IMessageSvc * msgSvc;
if (svcLocator->service("MessageSvc", msgSvc, true )==StatusCode::FAILURE) {
throw std::runtime_error("Error in BarrelPresamplerConstruction, cannot access MessageSvc");
}
MsgStream log(msgSvc, "BarrelPresamplerConstruction");
log << MSG::INFO;
log << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
log << "+ +" << std::endl;
log << "+ Start of Barrel PS GeoModel definition +" << std::endl;
log << "+ +" << std::endl;
log << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
StoreGateSvc *detStore;
if (svcLocator->service("DetectorStore", detStore, false )==StatusCode::FAILURE) {
throw std::runtime_error("Error in LArDetectorFactory, cannot access DetectorStore");
}
DataHandle<StoredMaterialManager> materialManager;
if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) {
throw std::runtime_error("Error in BarrelPresamplerConstruction, stored MaterialManager is not found.");
}
GeoMaterial *Copper = materialManager->getMaterial("std::Copper");
if (!Copper) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Copper is not found.");
GeoMaterial *Iron = materialManager->getMaterial("std::Iron");
if (!Iron) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Iron is not found.");
GeoMaterial *Lead = materialManager->getMaterial("std::Lead");
if (!Lead) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Lead is not found.");
GeoMaterial *LAr = materialManager->getMaterial("std::LiquidArgon");
if (!LAr) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::LiquidArgon is not found.");
GeoMaterial *Air = materialManager->getMaterial("std::Air");
if (!Air) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Air is not found.");
GeoMaterial *Kapton = materialManager->getMaterial("std::Kapton");
if (!Kapton) throw std::runtime_error("Error in BarrelPresamplerConstruction, std::Kapton is not found.");
GeoMaterial *Glue = materialManager->getMaterial("LAr::Glue");
if (!Glue) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::Glue is not found.");
GeoMaterial *G10 = materialManager->getMaterial("LAr::G10");
if (!G10) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::G10 is not found.");
GeoMaterial *FR4 = materialManager->getMaterial("LAr::FR4");
if (!FR4) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::FR4 is not found.");
GeoMaterial *MBMat = materialManager->getMaterial("LAr::MBMat");
if (!MBMat) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::MBMat is not found.");
GeoMaterial *AnodeMat = materialManager->getMaterial("LAr::AnodeMat");
if (!AnodeMat) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::AnodeMat is not found.");
GeoMaterial *CathodeMat = materialManager->getMaterial("LAr::CathodeMat");
if (!CathodeMat) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::CathodeMat is not found.");
GeoMaterial *ConnecMat = materialManager->getMaterial("LAr::ConnecMat");
if (!ConnecMat) throw std::runtime_error("Error in BarrelPresamplerConstruction, LAr::ConnecMat is not found.");
// double rMinPresamplerMother =1385*CLHEP::mm;
double rMinPresamplerMother =1410*CLHEP::mm;
double rMaxPresamplerMother =1447*CLHEP::mm-0.001*CLHEP::mm;
double presamplerMother_length=1549*CLHEP::mm;
double Phi_min=0.*CLHEP::deg;
double Phi_span=360.*CLHEP::deg;
int nbsectors=32;
if (itb==1) {
Phi_min=-0.5*CLHEP::deg;
Phi_span=23.5*CLHEP::deg;
nbsectors=2;
}
double mod[8][6];
mod[0][0] = 286.4;
mod[0][1] = 56;
mod[0][2] = 56;
mod[0][3] = -25.;
mod[0][4] = 4.987;
mod[0][5] = 4.2;
mod[1][0] = 295.74;
mod[1][1] = 64;
mod[1][2] = 64;
mod[1][3] = -12.;
mod[1][4] = 4.621;
mod[1][5] = 0.3;
mod[2][0] = 321.1;
mod[2][1] = 72;
mod[2][2] = 72;
mod[2][3] = 0;
mod[2][4] = 4.46;
mod[2][5] = 0.9;
mod[3][0] = 356.8;
mod[3][1] = 80;
mod[3][2] = 80;
mod[3][3] = 0;
mod[3][4] = 4.46;
mod[3][5] = 0.9;
mod[4][0] = 404.8;
mod[4][1] = 88;
mod[4][2] = 88;
mod[4][3] = 0;
mod[4][4] = 4.6;
mod[4][5] = 0.9;
mod[5][0] = 478.4;
mod[5][1] = 104;
mod[5][2] = 104;
mod[5][3] = 0;
mod[5][4] = 4.6;
mod[5][5] = 0.95;
mod[6][0] = 563.2;
mod[6][1] = 128;
mod[6][2] = 128;
mod[6][3] = 0;
mod[6][4] = 4.4;
mod[6][5] = 1.05;
mod[7][0] = 380.6;
mod[7][1] = 86;
mod[7][2] = 87;
mod[7][3] = 0;
mod[7][4] = 4.4;
mod[7][5] = 0.95;
// Make a presampler:
std::string basename = "LAr::Barrel::Presampler";
{
GeoTubs *tubs = new GeoTubs(rMinPresamplerMother, rMaxPresamplerMother, presamplerMother_length,Phi_min, Phi_span);
GeoLogVol* logVol = new GeoLogVol(basename,tubs,LAr);
m_psPhysicalPos = new GeoFullPhysVol(logVol);
m_psPhysicalNeg = new GeoFullPhysVol(logVol);
m_psPhysicalPos->ref();
m_psPhysicalNeg->ref();
}
// Make a presampler sector:
if(m_fullGeo){
// ?
double epsil = 0.007*CLHEP::mm;
// contraction factor
double cmm = (1-0.0026)*CLHEP::mm;
double mod_leng[8];
for(int ii=0; ii<8; ii++ ) mod_leng[ii]=mod[ii][0]*cmm+2*epsil;
double mod_heig[8];
double larheight = 13*CLHEP::mm;
double prep1_th = 1.*CLHEP::mm; // bottom prepreg layer
double prep2_th = 4.5*CLHEP::mm;
double smallLength = 275.6*CLHEP::mm;
double bigLength = 277.5;
double prep1_height = (smallLength/2+1.)*cmm;
double larheight2 = larheight*cos(-mod[1][3]*CLHEP::deg)*CLHEP::mm;
mod_heig[0]= (larheight+prep1_th+prep2_th)*cmm+4*epsil;
mod_heig[1]= (larheight2+prep1_th+prep2_th)*cmm+5.*epsil;
for(int i=2; i<8; i++ ) mod_heig[i] = mod_heig[0];
double shell_th = 0.4*CLHEP::mm;
double rail_th = 8.6*CLHEP::mm;
double mech_clear = 0.5*CLHEP::mm;
double mb_length = 3100.3;
double sector_length = mb_length*cmm +9.*epsil;
double sector_height = mod_heig[0]+(shell_th+rail_th)*cmm+mech_clear*CLHEP::mm+3*epsil;
unsigned int nsectors=32;
double mod_xm = prep1_height+epsil;
double mod_xp = (bigLength/2+1.+prep2_th*tan((360./(2*nsectors))*CLHEP::deg))*cmm;
double sect_xm = mod_xm+epsil;
double sect_xp = sect_xm+sector_height*tan((360./(2*nsectors))*CLHEP::deg);
double rpres = 1426.*CLHEP::mm;
double zpres = -presamplerMother_length+sector_length/2+epsil;
GeoTrd *trd = new GeoTrd(sect_xm, sect_xp, sector_length/2, sector_length/2, sector_height/2);
GeoLogVol *logVol = new GeoLogVol (basena