本文整理汇总了C++中Sensor::SetArea方法的典型用法代码示例。如果您正苦于以下问题:C++ Sensor::SetArea方法的具体用法?C++ Sensor::SetArea怎么用?C++ Sensor::SetArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sensor
的用法示例。
在下文中一共展示了Sensor::SetArea方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char * argv[]) {
TStopwatch watch;
gRandom = new TRandom3(0); // set random seed
gROOT->ProcessLine(".L loader.c+"); // Initialize struct objects (see dictionaries)
// Gas setup
TString gasmixt[6] = { "C5H12", "CF4", "", "60", "40", "" };
TString output = gasmixt[0] + "-" + gasmixt[1] + "-" + gasmixt[2] + "-" + gasmixt[3] + "-" + gasmixt[4] + "-" + gasmixt[5];
std::string workingdir = "includes/";
workingdir.append("GEM5"); // Name of the working directory which contains the GEM files
workingdir.append("/");
std::string particleType = "mu";
Double_t particleEnergy = 100.e9;
bool debug = true;
Int_t it = 100;
// Load GEM dimensions
GEMconfig g;
loadGEMconfig(workingdir, g);
// Load the field map
ComponentAnsys123* fm = new ComponentAnsys123();
std::string efile = workingdir + "ELIST.lis";
std::string nfile = workingdir + "NLIST.lis";
std::string mfile = workingdir + "MPLIST.lis";
std::string sfile = workingdir + "PRNSOL.lis";
std::string wfile = workingdir + "WSOL.lis";
std::string dfile = workingdir + "WSOLD.lis";
if(!fm->Initialise(efile, nfile, mfile, sfile, "mm")) {
std::cout << "Error while loading the ANSYS field map files." << std::endl;
}
fm->EnableMirrorPeriodicityX();
fm->EnableMirrorPeriodicityY();
if(debug) {
fm->PrintRange();
}
fm->SetWeightingField(wfile, "readout");
fm->SetWeightingField(dfile, "ions");
// Gas setup
MediumMagboltz* gas = new MediumMagboltz();
gas->SetComposition((std::string)gasmixt[0], atof(gasmixt[3]), (std::string)gasmixt[1], atof(gasmixt[4]), (std::string)gasmixt[2], atof(gasmixt[5]));
gas->SetTemperature(293.15);
gas->SetPressure(760.0);
//gas->SetMaxElectronEnergy(200.);
gas->EnableDebugging();
gas->Initialise();
gas->DisableDebugging();
//const double rPenning = 0.57;
//const double lambdaPenning = 0.;
//gas->EnablePenningTransfer(rPenning, lambdaPenning, "ar");
gas->LoadIonMobility(GARFIELD + "Data/IonMobility_Ar+_Ar.txt");
//gas->LoadIonMobility(GARFIELD + "Data/IonMobility_CO2+_CO2");
//Associate the gas with the corresponding field map material.
const int nMaterials = fm->GetNumberOfMaterials();
for(int i=0; i<nMaterials; ++i) {
const double eps = fm->GetPermittivity(i);
if(fabs(eps - 1.) < 1.e-3) fm->SetMedium(i, gas);
}
if(debug) {
fm->PrintMaterials();
}
// Sensor setup
Sensor* sensor = new Sensor();
sensor->AddComponent(fm);
sensor->SetArea(-5.*(g.pitch), -5.*(g.pitch), 0.0, 5.*(g.pitch), 5.*(g.pitch), g.totalT);
// Setup HEED
TrackHeed* heed = new TrackHeed();
heed->SetSensor(sensor);
//heed->DisableDeltaElectronTransport();
heed->SetParticle(particleType);
heed->SetMomentum(particleEnergy);
if(debug) {
heed->EnableDebugging();
}
// Setup electron transport
AvalancheMicroscopic* aval = new AvalancheMicroscopic();
aval->SetSensor(sensor);
//aval->EnableAvalancheSizeLimit(1000);
sensor->AddElectrode(fm, "readout");
sensor->AddElectrode(fm, "ions");
const double tMin = 0.;
const double tMax = 75.;
const double tStep = 0.2;
const int nTimeBins = int((tMax - tMin)/tStep);
sensor->SetTimeWindow(0., tStep, nTimeBins);
aval->EnableSignalCalculation();
ViewSignal* signalView = new ViewSignal();
signalView->SetSensor(sensor);
TH1D* h; // tmp storage of timing histogram
//.........这里部分代码省略.........
示例2: main
int main(int argc, char * argv[]) {
TApplication app("app", &argc, argv);
plottingEngine.SetDefaultStyle();
const bool debug = true;
// Load the field map.
ComponentAnsys123* fm = new ComponentAnsys123();
const std::string efile = "ELIST.lis";
const std::string nfile = "NLIST.lis";
const std::string mfile = "MPLIST.lis";
const std::string sfile = "PRNSOL.lis";
fm->Initialise(efile, nfile, mfile, sfile, "mm");
fm->EnableMirrorPeriodicityX();
fm->EnableMirrorPeriodicityY();
fm->PrintRange();
// Dimensions of the GEM
const double pitch = 0.014;
const double kapton = 50.e-4;
const double metal = 5.e-4;
const double outdia = 70.e-4;
const double middia = 50.e-4;
const bool plotField = false;
if (plotField) {
ViewField* fieldView = new ViewField();
fieldView->SetComponent(fm);
fieldView->SetPlane(0., -1., 0., 0., 0., 0.);
fieldView->SetArea(-pitch / 2., -0.02, pitch / 2., 0.02);
fieldView->SetVoltageRange(-160., 160.);
TCanvas* cF = new TCanvas();
fieldView->SetCanvas(cF);
fieldView->PlotContour();
}
// Setup the gas.
MediumMagboltz* gas = new MediumMagboltz();
gas->SetComposition("ar", 70., "co2", 30.);
gas->SetTemperature(293.15);
gas->SetPressure(760.);
gas->EnableDebugging();
gas->Initialise();
gas->DisableDebugging();
// Set the Penning transfer efficiency.
const double rPenning = 0.57;
const double lambdaPenning = 0.;
gas->EnablePenningTransfer(rPenning, lambdaPenning, "ar");
// Load the ion mobilities.
gas->LoadIonMobility("IonMobility_Ar+_Ar.txt");
// Associate the gas with the corresponding field map material.
const int nMaterials = fm->GetNumberOfMaterials();
for (int i = 0; i < nMaterials; ++i) {
const double eps = fm->GetPermittivity(i);
if (fabs(eps - 1.) < 1.e-3) fm->SetMedium(i, gas);
}
fm->PrintMaterials();
// Create the sensor.
Sensor* sensor = new Sensor();
sensor->AddComponent(fm);
sensor->SetArea(-5 * pitch, -5 * pitch, -0.03,
5 * pitch, 5 * pitch, 0.03);
AvalancheMicroscopic* aval = new AvalancheMicroscopic();
aval->SetSensor(sensor);
AvalancheMC* drift = new AvalancheMC();
drift->SetSensor(sensor);
drift->SetDistanceSteps(2.e-4);
const bool plotDrift = true;
ViewDrift* driftView = new ViewDrift();
if (plotDrift) {
driftView->SetArea(-2 * pitch, -2 * pitch, -0.02,
2 * pitch, 2 * pitch, 0.02);
// Plot every 10 collisions (in microscopic tracking).
aval->SetCollisionSteps(10);
aval->EnablePlotting(driftView);
drift->EnablePlotting(driftView);
}
// Histograms
int nBinsGain = 100;
double gmin = 0.;
double gmax = 100.;
TH1F* hElectrons = new TH1F("hElectrons", "Number of electrons",
nBinsGain, gmin, gmax);
TH1F* hIons = new TH1F("hIons", "Number of ions",
nBinsGain, gmin, gmax);
int nBinsChrg = 100;
TH1F* hChrgE = new TH1F("hChrgE", "Electrons on plastic",
nBinsChrg, -0.5e4 * kapton, 0.5e4 * kapton);
TH1F* hChrgI = new TH1F("hChrgI", "Ions on plastic",
nBinsChrg, -0.5e4 * kapton, 0.5e4 * kapton);
double sumIonsTotal = 0.;
//.........这里部分代码省略.........