//----------------------------------------------------------- // File and Version Information: // $Id$ // // Description: // Distortion with fixed direction and Gaussian profile // // // Environment: // Software developed for a real experiment // // Author List: // Felix Boehmer (original author) // Physik Department E18, TUM // //----------------------------------------------------------- #include "TpcMMLocalGaussDistortion.h" #include "TMath.h" TpcMMLocalGaussDistortion::TpcMMLocalGaussDistortion() : fDirection(0.,0.,0.), fPos(0.,0.,0.), fSigma(0.) {;} TpcMMLocalGaussDistortion::TpcMMLocalGaussDistortion(double sig, const TVector3& dir, const TVector3& pos) : fDirection(dir), fPos(pos), fSigma(sig) {;} void TpcMMLocalGaussDistortion::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); TVector3 shift = fDirection*norm; pos+=shift; cls[icl]->SetPos(pos); //TODO: check if we need to remove clusters that "leave" //the detector volume } //end loop over cluster }