/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id$ */ #include #include #include "AliITSetfSDD.h" //////////////////////////////////////////////////////////////////////// // Version: 0 // Written by Piergiorgio Cerello // November 23 1999 // Revised to comply with coding conventions: Nov, 21 2003 m.m. //_____________________________________________________________________________ using std::endl; using std::cout; ClassImp(AliITSetfSDD) const Int_t AliITSetfSDD::AliITSetfSDDparam::fgkMaxNofPoles = 5; const Int_t AliITSetfSDD::AliITSetfSDDparam::fgkMaxNofSamples = 1024; AliITSetfSDD::AliITSetfSDD(): fTimeDelay(0), fSamplingTime(0), fT0(0), fDf(0.), fA0(0.) , fZeroM(0), fZeroR(0), fZeroI(0), fPoleM(0), fPoleR(0), fPoleI(0), fTfR(0), fTfI(0), fWR(0), fWI(0){ // Default constructor } AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif): fTimeDelay(0), fSamplingTime(0), fT0(0), fDf(0.), fA0(0.) , fZeroM(0), fZeroR(0), fZeroI(0), fPoleM(0), fPoleR(0), fPoleI(0), fTfR(0), fTfI(0), fWR(0), fWI(0) { // Standard constructor. sampling time in ns /* cout<<"Number of poles: "<= pigr) vVA -= (2.*pigr); if(vVA <= -pigr) vVA += (2.*pigr); //cout << "vVM: " << vVM << ", VA: " << vVA << endl; } } if(fPoleM[k]) { Double_t vVPR = -fPoleR[k]; Double_t vVPI = frequency - fPoleI[k]; Double_t vVPM = TMath::Sqrt(vVPR*vVPR+vVPI*vVPI); Double_t vVPA = TMath::ATan2(vVPI,vVPR); //cout << "VPM: " << vVPM << ", VPA: " << vVPA << endl; //cout << "VPR: " << vVPR << ", VPI: " << vVPI << endl; for(j=1; j<= (Int_t) fPoleM[k]; j++) { vVM /= vVPM; vVA -= vVPA; if(vVA >= pigr) vVA -= (2.*pigr); if(vVA <= -pigr) vVA += (2.*pigr); //cout << "VM: " << vVM << ", vVA: " << vVA << endl; } } Double_t vVR = vVM*cos(vVA); Double_t vVI = vVM*sin(vVA); //cout << "VM: " << vVM << ", VA: " << vVA << endl; //cout << "VR: " << vVR << ", VI: " << vVI << endl; fTfR[i] = vVR*xGiga; fTfI[i] = vVI*xGiga; //cout << "fTfR[" << i << "] = " << fTfR[i] << endl; //cout << "fTfI[" << i << "] = " << fTfI[i] << endl; if(i) { fTfR[AliITSetfSDDparam::NumberOfSamples()-i] = fTfR[i]; fTfI[AliITSetfSDDparam::NumberOfSamples()-i] = -fTfI[i]; } } } // Compute Fourier Weights for(i=0; i<=AliITSetfSDDparam::NumberOfSamples()/2; i++) { fWR[i] = cos(-2.*pigr*i/AliITSetfSDDparam::NumberOfSamples()); fWI[i] = sin(-2.*pigr*i/AliITSetfSDDparam::NumberOfSamples()); if(i) { fWR[AliITSetfSDDparam::NumberOfSamples()-i] = fWR[i]; fWI[AliITSetfSDDparam::NumberOfSamples()-i] = -fWI[i]; } } } AliITSetfSDD::~AliITSetfSDD(){ // Destructor if(fZeroM) delete []fZeroM; if(fZeroR) delete []fZeroR; if(fZeroI) delete []fZeroI; if(fPoleM) delete []fPoleM; if(fPoleR) delete []fPoleR; if(fPoleI) delete []fPoleI; if(fTfR) delete []fTfR; if(fTfI) delete []fTfI; if(fWR) delete []fWR; if(fWI) delete []fWI; } void AliITSetfSDD::PrintElectronics() const { // Printout of the parameters defining the f.e. electronics cout << "Time Delay " << fTimeDelay << endl; cout << "Sampling Time " << fSamplingTime << endl; cout << "Number of Time Samples " << AliITSetfSDDparam::NumberOfSamples() << endl; cout << "fT0 " << fT0 << endl; cout << "fDf " << fDf << endl; cout << "fA0 " << fA0 << endl; cout << "Zero's and Pole's" << endl; cout << "fZeroM " << endl; Int_t i; for(i=0; i