ROOT Version: 6.32.12
Platform: wsl2 Ubuntu 24.04.1
Hi. I am a physics undergrad, and I am learning Garfield++ as part of my Summer Project. I am building a proportional counter and I would like to “visualize” the electric fields in my detector and maybe simulate some events of electron multiplication.
In the code: I am seeing the field lines from front (XY) which is okay.. but when i change it to XZ, I can see the field lines change their orientation but my detector body remains in XY view.
#include <TApplication.h>
#include <TAxis.h>
#include <TCanvas.h>
#include <TGraph.h>
#include <vector>
#include "Garfield/ComponentAnalyticField.hh"
#include "Garfield/MediumMagboltz.hh"
#include "Garfield/Plotting.hh"
#include "Garfield/ViewCell.hh"
#include "Garfield/ViewField.hh"
using namespace Garfield;
int main(int argc, char* argv[])
{
TApplication app("app", &argc, argv);
plottingEngine.SetDefaultStyle();
MediumMagboltz gas("ar", 100.);
ComponentAnalyticField cmp;
cmp.SetMedium(&gas);
const double dWire = 70.e-4;
const double lWire = 30.;
const double rTube = 1.;
cmp.AddWire(0., 0., dWire, 1000., "s", lWire);
cmp.AddTube(rTube, 0., 0., "t");
cmp.PrintCell();
ViewField fieldView(&cmp);
fieldView.SetArea(-2., -2., 2., 2.);
fieldView.SetPlaneXY(); //change view
TCanvas c1("c1", "", 600, 600);
fieldView.SetCanvas(&c1);
fieldView.PlotContour();
ViewCell cellView(&cmp);
cellView.SetCanvas(fieldView.GetCanvas());
cellView.SetArea(-2., -2., 2., 2.);
cellView.Plot2d();
app.Run(true);
}
Am I doing something wrong? Is there any other class which might help me?
Also for the electron multiplication part, which classes should I use?
Thanks in Advance!!