本文整理汇总了C++中KVDetector::SetType方法的典型用法代码示例。如果您正苦于以下问题:C++ KVDetector::SetType方法的具体用法?C++ KVDetector::SetType怎么用?C++ KVDetector::SetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KVDetector
的用法示例。
在下文中一共展示了KVDetector::SetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddLayer
KVDetector *KVGeoImport::BuildDetector(TString det_name, TGeoVolume* det_vol)
{
// Create a KVDetector with given name for the given volume
//
// Detector definition in geometry
// ===============================
// 1.) All detector volumes & nodes must have names which begin with "DET_"
//
// 2.) They must be made of materials which are known by the range table fRangeTable.
//
// 3.) For multi-layer detectors, the "active" layer volume/node must have a name beginning with "ACTIVE_"
//
// 4.) The "thickness" of the detector or any layer inside a multilayer detector
// will be taken as the size of the volume's shape along its Z-axis
// (so make sure that you define your detector volumes in this way).
//
// 5.) It is assumed that the natural length units of the geometry are centimetres.
//
// 6.) The name of the KVDetector object created and added to the array will be taken
// from the unique full path of the node corresponding to the geometrical positioning
// of the detector, see KVGeoNavigator::ExtractDetectorNameFromPath
//
// 7.) The 'type' of the detector will be set to the name of the material
// in the detector's active layer i.e. if active layer material name is "Si",
// detector type will be 'Si'
//
// 8.) Default class for all detectors is KVDetector
// if you want to use an other class
// you need to defined it using SetDetectorPlugin method and put the
// associated line in your .kvrootrc configuration file. This plugin
// has to be loaded by your KVMultiDetArray object
KVDetector* d = 0;
TPluginHandler *ph=NULL;
if ( fDetectorPlugin=="" || !(ph = LoadPlugin("KVDetector",fDetectorPlugin)) ){
d = new KVDetector;
}
else{
d = (KVDetector* )ph->ExecPlugin(0);
}
d->SetName(det_name);
Int_t nlayer = det_vol->GetNdaughters();
if(nlayer){
for(int i=0;i<nlayer;i++){
AddLayer(d, det_vol->GetNode(i)->GetVolume());
}
}
else
AddLayer(d, det_vol);
TString type = d->GetActiveLayer()->GetName();
//type.ToUpper();
d->SetType( type );
return d;
}