当前位置: 首页>>代码示例>>C++>>正文


C++ KVDetector::SetName方法代码示例

本文整理汇总了C++中KVDetector::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ KVDetector::SetName方法的具体用法?C++ KVDetector::SetName怎么用?C++ KVDetector::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KVDetector的用法示例。


在下文中一共展示了KVDetector::SetName方法的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;
}
开发者ID:pwigg,项目名称:kaliveda,代码行数:57,代码来源:KVGeoImport.cpp


注:本文中的KVDetector::SetName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。