// @(#)codeTDv2Final/CTDR_Interaction :$Name: $:$Id: CTDR_Interaction.h,v 2.0 2006/11/25 16:10:44 Benoit Exp $ // Author: Mathieu Benoit 24/11/06 ////////////////////////////////////////////////////////////////////////// // Source file : class CTDR_Interaction // // This class represent a cloud of charge element of a gamma // // CTDR_Interaction in CZT.It contains all the function to create // // and simulate the behavior of an carrier cloud generated by a // // gamma event. The cloud consiste of CTDR_Electron objects, // // wich all evolves in time from their generation to their collection. // // // // Constant to set in source before compilation // // "Nelec" represent the number of charge element (class CTDR_Electrons)// // used to reproduce the real charge cloud generated by a gamma // // CTDR_Interaction. The higher the number, he more accurately the // // behavior is simulated. However , higher number of charge element also// // mean longer computation time. CTDR_Fields and weighting potentials // // must be extracted from solution files obtained with poisson equation // // solvers for each charge at each time step. // // To simulate signals and to focus on one event or one multi-hit, // // a high number of charge is reccomended. But for simulation of a large// // number of events, for example to obtain scatter plots, a small number// // of charge works fine and give much more reasonable. As computer // // become faster, these type of simulation will gain much precision as // // they require a lot of brutal force.These simulation can be performed // // on a single-processor , but the time needed to obtain readable data // // is quite long,(days or weeks). These simulations can easily be // // performed in parallel on many processor.The average parallel // // computing facility these days could obtain good results quite fast // // for simulation with a high number of charge elements. This code // // can easily scale to the demand and to the ressource at your // // disposition to give good results in a maximum of situations. // // // // zmax is the maximum height of the CZT block */ // ////////////////////////////////////////////////////////////////////////// #ifndef CTDR_INTERACTION_H_DEF #define CTDR_INTERACTION_H_DEF #include "CTDR_Electron.h" using namespace std; class CTDR_Interaction : public TObject { private: double t; // Time CTDR_Electron charges[5000]; //A list of charge elements CTDR_Electron double rmsX; // RMS radius in X double rmsY; // RMS radius in Y double rmsZ; // RMS radius in Z double MoyZ; // centroid position in Z double Q0x,Q0y; // Integration constant for collected charge integral int Nmax; // Maximum number of time steps int N; // Number of charge elements double energie; // Energy of the interaction public: CTDR_Interaction(double x, double y, double z,double energie,double sigma,double t0); bool iteration(double dt,CTDR_Field &A); void ComputeRms(); double GetRmsX(); double GetRmsY(); double GetRmsZ(); double GetMoyZ(); double GetQx(); double GetQy(); void SetQx(double Q); void SetQy(double Q); int GetN(); CTDR_Electron GetCharge(int i); double Gett(); void WritePositions(ofstream &sortie); ClassDef(CTDR_Interaction,0) // An interaction }; #endif