#include #include #include #include #include #include #include #include "Garfield/ViewCell.hh" #include "Garfield/ViewDrift.hh" #include "Garfield/ViewSignal.hh" #include "Garfield/ComponentAnalyticField.hh" #include "Garfield/MediumMagboltz.hh" #include "Garfield/Sensor.hh" #include "Garfield/DriftLineRKF.hh" #include "Garfield/TrackHeed.hh" using namespace Garfield; using namespace std; //double transfer(double t) { //constexpr double tau = 25.; //return (t / tau) * exp(1 - t / tau); } int main(int argc, char * argv[]) { TApplication app("app", &argc, argv); // Make a gas medium. MediumMagboltz gas; gas.LoadGasFile("./gascard/ar_96_co2_4_2200v_0224.gas"); const std::string path = std::getenv("GARFIELD_INSTALL"); gas.LoadIonMobility(path + "/share/Garfield/Data/IonMobility_Ar+_Ar.txt"); // Make a component with analytic electric field. ComponentAnalyticField cmp; cmp.SetMedium(&gas); // Wire radius [cm] const double rWire = 25.e-4; //const double rWire = 20.e-4; // Outer radius of the tube [cm] const double rTube = 1.46; //const double rTube = 2.46; // Voltages const double vWire = 2950.; const double vTube = 0.; // Add the wire in the centre. cmp.AddWire(0, 0, 2 * rWire, vWire, "s"); // Add the tube. cmp.AddTube(rTube, vTube, 0, "t"); // Request calculation of the weighting field. cmp.AddReadout("s"); // Make a sensor. Sensor sensor; sensor.AddComponent(&cmp); sensor.AddElectrode(&cmp, "s"); // Set the signal time window. const double tstep = 0.5; const double tmin = -0.5 * tstep; const unsigned int nbins = 5000; sensor.SetTimeWindow(tmin, tstep, nbins); // Set the delta reponse function. sensor.ClearSignal(); //sensor.SetTransferFunction(transfer); // Set up Heed. TrackHeed track; track.SetParticle("muon"); track.SetEnergy(3.e9); track.SetSensor(&sensor); // RKF integration. DriftLineRKF drift; drift.SetSensor(&sensor); drift.SetGainFluctuationsPolya(0., 20000.); //drift.EnableIonTail(); int loop; string filename; string filename1="distance_"; string filename2=".txt"; for(loop=0;loop<14;loop++) { cout<