#ifndef TDriftManager_hxx_seen #define TDriftManager_hxx_seen #include "IElectronCloud.hxx" //#include "TVector3.h" #include //For pair #include /// \brief TPC drift electrons /// \author Christian Hansen, hansen@ific.uv.es namespace COMET { class IDriftManager; }; class COMET::IDriftManager { public: IDriftManager(); virtual ~IDriftManager(); /// *** DRIFT /// The drift is a forth order Runge-Kutta, with adaptive step size and using the /// nominal B-field and a macroscopic theory for the transportation (equation 12): /// http://www.pd.infn.it/gruppi/g1/2002Vavra_student_lecture.pdf /// Drifts the electron cloud as long as abs(x) < abs(xLim) /// If it returns true the cloud hit the readout board (i.e. the +-x wall) /// If it returns false the cloud took too many steps bool DriftUntilXLim(IElectronCloud& cloud, double xLim); /// Drifts the electron cloud as long as the dt < tLim /// If it return true the cloint main(int argc, char *argv[]) {ud drifted until the time limit /// If it return false the cloud took too many steps bool DriftUntilTLim(IElectronCloud& cloud, double tLim); /// This function does the actual drift bool Drift(double xLim, bool driftUntilXLim, IElectronCloud& cloud, int& nbrSteps, int& nbrStepCalls, int& nbrVCalls, double& hMin); void InitializeFromDB(bool UseAdaptiveStepSize, double MaxDriftStepTime, double MinDriftStepTime, int MaxNbrDriftSteps, double ErrorTol, double InitialDriftStepTime, double OmegaTau, double Mu,double DriftVelocity=0.0785); void InitializeFromDB(double InitialDriftStepTime, double OmegaTau, double Mu,double DriftVelocity=0.0785); TLorentzVector Step(const TLorentzVector& x, double charge, double driftTime, bool useFirstKs); private: //TLorentzVector Step(const TLorentzVector& x, double charge, double driftTime, bool useFirstKs); //The velocity www.pd.infn.it/gruppi/g1/2002Vavra_student_lecture.pdf double vx(double charge, TVector3 E, TVector3 B); double vy(double charge, TVector3 E, TVector3 B); double vz(double charge, TVector3 E, TVector3 B); //COMET::IOAMagneticField* fMag; //For the RK4 step function double fOmegaTau; double fMu; double fK1x; double fK1y; double fK1z; double fDriftVelocity; //For the adaptive step size drifting int fUseAdaptiveStepSize; double fInitialDriftStepTime; double fMaxDriftStepTime; double fMinDriftStepTime; double fErrorTol; int fMaxNbrDriftSteps; /// Counters int fNbrStepCalls; int fNbrVxCalls; int fNbrSteps; double fMinUsedH; bool fInitialized; double fCathode; }; #endif