//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Distortion Source with Gaussian profile // // // Environment: // Software developed for a real experiment // // Author List: // Felix Boehmer (original author) // Physik Department E18, TUM // //----------------------------------------------------------- #include "TpcMMLocalGaussSource.h" #include "TMath.h" TpcMMLocalGaussSource::TpcMMLocalGaussSource() : fMag(0.), fPos(0.,0.,0.), fSigma(0.) {;} TpcMMLocalGaussSource::TpcMMLocalGaussSource(double sig, double mag, const TVector3& pos) : fMag(mag), fPos(pos), fSigma(sig) {;} void TpcMMLocalGaussSource::distort(const std::vector& cls) { //loop over clusters: for(unsigned int icl=0; iclpos(); TVector3 diff = pos-fPos; //skip everything farther away than 3sig if(diff.Mag()>3*fSigma) continue; //magnitude at pos: double norm = TMath::Gaus(diff.Mag(),0,fSigma); diff.SetMag(fMag); diff*=norm; pos+=diff; cls[icl]->SetPos(pos); //TODO: check if we need to remove clusters that "leave" //the detector volume } //end loop over cluster }