本文整理汇总了C++中TGeoVolume::SetLineWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ TGeoVolume::SetLineWidth方法的具体用法?C++ TGeoVolume::SetLineWidth怎么用?C++ TGeoVolume::SetLineWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGeoVolume
的用法示例。
在下文中一共展示了TGeoVolume::SetLineWidth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeCopyVolume
virtual TGeoVolume* MakeCopyVolume(TGeoShape *newshape) {
// make a copy of this volume. build a volume with same name, shape and medium
TGeoVolume *vol = _copyVol(newshape);
vol->SetVisibility(IsVisible());
vol->SetLineColor(GetLineColor());
vol->SetLineStyle(GetLineStyle());
vol->SetLineWidth(GetLineWidth());
vol->SetFillColor(GetFillColor());
vol->SetFillStyle(GetFillStyle());
vol->SetField(fField);
if (fFinder)
vol->SetFinder(fFinder);
CloneNodesAndConnect(vol);
((TObject*) vol)->SetBit(kVolumeClone);
return vol;
}
示例2: CloneVolume
virtual TGeoVolume* CloneVolume() const {
TGeoVolume *vol = _copyVol(fShape);
Int_t i;
// copy volume attributes
vol->SetLineColor(GetLineColor());
vol->SetLineStyle(GetLineStyle());
vol->SetLineWidth(GetLineWidth());
vol->SetFillColor(GetFillColor());
vol->SetFillStyle(GetFillStyle());
// copy other attributes
Int_t nbits = 8 * sizeof(UInt_t);
for (i = 0; i < nbits; i++)
vol->SetAttBit(1 << i, TGeoAtt::TestAttBit(1 << i));
for (i = 14; i < 24; i++)
vol->SetBit(1 << i, this->TGeoVolume::TestBit(1 << i));
// copy field
vol->SetField(fField);
// Set bits
for (i = 0; i < nbits; i++)
vol->SetBit(1 << i, this->TGeoVolume::TestBit(1 << i));
vol->SetBit(kVolumeClone);
// copy nodes
// CloneNodesAndConnect(vol);
vol->MakeCopyNodes(this);
// if volume is divided, copy finder
vol->SetFinder(fFinder);
// copy voxels
if (fVoxels) {
TGeoVoxelFinder *voxels = new TGeoVoxelFinder(vol);
vol->SetVoxelFinder(voxels);
}
// copy option, uid
vol->SetOption(fOption);
vol->SetNumber(fNumber);
vol->SetNtotal(fNtotal);
return vol;
}
示例3: initializeTGeoDescription
/**
* Initialise ROOT geometry objects from GEAR objects
*
* @param geomName name of ROOT geometry object
* @param dumpRoot dump automatically generated ROOT geometry file for further inspection
*/
void EUTelGeometryTelescopeGeoDescription::initializeTGeoDescription( std::string const & geomName, bool dumpRoot = false ) {
if( _isGeoInitialized ) {
streamlog_out( WARNING3 ) << "EUTelGeometryTelescopeGeoDescription: Geometry already initialized, using old initialization" << std::endl;
return;
} else {
_geoManager = std::make_unique<TGeoManager>("Telescope", "v0.1");
_geoManager->SetBit(kCanDelete);
}
if( !_geoManager ) {
streamlog_out( ERROR3 ) << "Can't instantiate ROOT TGeoManager " << std::endl;
return;
}
// Create top world volume containing telescope geometry
// Create air mixture
// see http://pdg.lbl.gov/2013/AtomicNuclearProperties/HTML_PAGES/104.html
double air_density = 1.2e-3; // g/cm^3
double air_radlen = 36.62; // g/cm^2 //Must be -ve to use this value rather than internal one calculated.
TGeoMixture* pMatAir = new TGeoMixture("AIR",3,air_density);
pMatAir->DefineElement(0, 14.007, 7., 0.755267 ); //Nitrogen
pMatAir->DefineElement(1, 15.999, 8., 0.231781 ); //Oxygen
pMatAir->DefineElement(2, 39.948, 18., 0.012827 ); //Argon
pMatAir->DefineElement(3, 12.011, 6., 0.000124 ); //Carbon
pMatAir->SetRadLen( air_radlen );
// Medium: medium_World_AIR
TGeoMedium* pMedAir = new TGeoMedium("medium_World_AIR", 3, pMatAir );
// The World is the 10 x 10m x 10m box filled with air mixture
Double_t dx,dy,dz;
dx = 5000.000000; // [mm]
dy = 5000.000000; // [mm]
dz = 5000.000000; // [mm]
TGeoShape *pBoxWorld = new TGeoBBox("Box_World", dx,dy,dz);
// Volume: volume_World
TGeoVolume* pvolumeWorld = new TGeoVolume("volume_World",pBoxWorld, pMedAir);
pvolumeWorld->SetLineColor(4);
pvolumeWorld->SetLineWidth(3);
pvolumeWorld->SetVisLeaves(kTRUE);
// Set top volume of geometry
gGeoManager->SetTopVolume( pvolumeWorld );
IntVec::const_iterator itrPlaneId;
for ( itrPlaneId = _sensorIDVec.begin(); itrPlaneId != _sensorIDVec.end(); ++itrPlaneId ) {
translateSiPlane2TGeo(pvolumeWorld, *itrPlaneId );
}
_geoManager->CloseGeometry();
_isGeoInitialized = true;
// Dump ROOT TGeo object into file
if ( dumpRoot ) _geoManager->Export( geomName.c_str() );
for(auto& mapEntry: _planePath) {
auto pathName = mapEntry.second;
auto sensorID = mapEntry.first;
_geoManager->cd( pathName.c_str() );
_TGeoMatrixMap[sensorID] = _geoManager->GetCurrentNode()->GetMatrix();
}
return;
}
示例4: initializeTGeoDescription
/**
* Initialise ROOT geometry objects from GEAR objects
*
* @param geomName name of ROOT geometry object
* @param dumpRoot dump automatically generated ROOT geometry file for further inspection
*/
void EUTelGeometryTelescopeGeoDescription::initializeTGeoDescription( std::string& geomName, bool dumpRoot = false ) {
// #ifdef USE_TGEO
// get access to ROOT's geometry manager
if( _isGeoInitialized )
{
streamlog_out( WARNING3 ) << "EUTelGeometryTelescopeGeoDescription: Geometry already initialized, using old initialization" << std::endl;
return;
}
else
{
_geoManager = new TGeoManager("Telescope", "v0.1");
}
if( !_geoManager )
{
streamlog_out( ERROR3 ) << "Can't instantiate ROOT TGeoManager " << std::endl;
return;
}
// Create top world volume containing telescope/DUT geometry
// Create air mixture
// see http://pdg.lbl.gov/2013/AtomicNuclearProperties/HTML_PAGES/104.html
double air_density = 1.2e-3; // g/cm^3
double air_radlen = 36.62; // g/cm^2
TGeoMixture* pMatAir = new TGeoMixture("AIR",3,air_density);
pMatAir->DefineElement(0, 14.007, 7., 0.755267 ); //Nitrogen
pMatAir->DefineElement(1, 15.999, 8., 0.231781 ); //Oxygen
pMatAir->DefineElement(2, 39.948, 18., 0.012827 ); //Argon
pMatAir->DefineElement(3, 12.011, 6., 0.000124 ); //Carbon
pMatAir->SetRadLen( air_radlen );
// Medium: medium_World_AIR
TGeoMedium* pMedAir = new TGeoMedium("medium_World_AIR", 3, pMatAir );
// The World is the 10 x 10m x 10m box filled with air mixture
Double_t dx,dy,dz;
dx = 5000.000000; // [mm]
dy = 5000.000000; // [mm]
dz = 5000.000000; // [mm]
TGeoShape *pBoxWorld = new TGeoBBox("Box_World", dx,dy,dz);
// Volume: volume_World
TGeoVolume* pvolumeWorld = new TGeoVolume("volume_World",pBoxWorld, pMedAir);
pvolumeWorld->SetLineColor(4);
pvolumeWorld->SetLineWidth(3);
pvolumeWorld->SetVisLeaves(kTRUE);
// Set top volume of geometry
gGeoManager->SetTopVolume( pvolumeWorld );
// Iterate over registered GEAR objects and construct their TGeo representation
const Double_t PI = 3.141592653589793;
const Double_t DEG = 180./PI;
double xc, yc, zc; // volume center position
double alpha, beta, gamma;
IntVec::const_iterator itrPlaneId;
for ( itrPlaneId = _sensorIDVec.begin(); itrPlaneId != _sensorIDVec.end(); ++itrPlaneId ) {
std::stringstream strId;
strId << *itrPlaneId;
// Get sensor center position
xc = siPlaneXPosition( *itrPlaneId );
yc = siPlaneYPosition( *itrPlaneId );
zc = siPlaneZPosition( *itrPlaneId );
// Get sensor orientation
alpha = siPlaneXRotation( *itrPlaneId ); // [rad]
beta = siPlaneYRotation( *itrPlaneId ); // [rad]
gamma = siPlaneZRotation( *itrPlaneId ); // [rad]
// Spatial translations of the sensor center
string stTranslationName = "matrixTranslationSensor";
stTranslationName.append( strId.str() );
TGeoTranslation* pMatrixTrans = new TGeoTranslation( stTranslationName.c_str(), xc, yc, zc );
//ALL clsses deriving from TGeoMatrix are not owned by the ROOT geometry manager, invoking RegisterYourself() transfers
//ownership and thus ROOT will clean up
pMatrixTrans->RegisterYourself();
// Spatial rotation around sensor center
// TGeoRotation requires Euler angles in degrees
string stRotationName = "matrixRotationSensorX";
stRotationName.append( strId.str() );
TGeoRotation* pMatrixRotX = new TGeoRotation( stRotationName.c_str(), 0., alpha*DEG, 0.); // around X axis
stRotationName = "matrixRotationSensorY";
stRotationName.append( strId.str() );
TGeoRotation* pMatrixRotY = new TGeoRotation( stRotationName.c_str(), 90., beta*DEG, 0.); // around Y axis (combination of rotation around Z axis and new X axis)
//.........这里部分代码省略.........