/************************************************************************** * 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. * **************************************************************************/ /* $Log$ Revision 1.6 1999/10/08 06:27:59 fca Defaults updated Revision 1.5 1999/10/05 17:18:27 fca Correct GetWire check on even/odd fnWires Revision 1.4 1999/09/29 09:24:34 fca Introduction of the Copyright and cvs Log */ /////////////////////////////////////////////////////////////////////// // Manager and of geomety classes for set: TPC // // // // !sectors are numbered from 0 // // !pad rows are numbered from 0 // // // 12.6. changed z relative // Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk // // // /////////////////////////////////////////////////////////////////////// #include #include #include #include "AliTPCSecGeo.h" #include ClassImp(AliTPCParam) const static Int_t kMaxRows=600; // default values const static Int_t kMaxTBin =512; const static Float_t kInnerRadiusLow = 83.9; const static Float_t kOuterRadiusLow = 146.9; const static Float_t kInnerRadiusUp = 141.3; const static Float_t kOuterRadiusUp = 249.4; const static Float_t kInnerAngle = 0.34906585; // 20 degrees const static Float_t kInnerAngleShift = 0; const static Float_t kOuterAngle = 0.34906585; // 20 degrees const static Float_t kOuterAngleShift = 0; const static Float_t kPadPitchLength = 2.05; const static Float_t kPadPitchWidth = 0.35; const static Float_t kPadLength = 2.05; const static Float_t kPadWidth = 0.35; // Number of wires per pad and wire-wire pitch const static Int_t knWires = 5; const static Float_t kDiffT = 2.2e-2; const static Float_t kDiffL = 2.2e-2; const static Float_t kDriftV =2.85e6; const static Float_t kOmegaTau = 0.145; const static Float_t kAttCoef = 250.; const static Float_t kOxyCont = 5.e-6; const static Float_t kChipGain = 12; const static Float_t kGasGain = 2e4; const static Float_t kTSample = 2.e-7; //TSAMPLE const static Float_t kTFWHM = 2.5e-7; //fwhm of charge distribution const static Float_t kNoise = 1000; //default noise = 1000 el const static Int_t kZeroSup=5; const static Float_t kPadCoupling=0.5; // const static Float_t kEdgeSectorSpace = 1.15; const static Float_t kDegtoRad = 0.01745329251994; const static Float_t kRadtoDeg = 57.29577951309; //___________________________________________ AliTPCParam::AliTPCParam() { //constructor set the default parameters SetDefault(); } void AliTPCParam::SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle, Float_t outershift, Bool_t inDegree) { // // set opening angles fInnerAngle = innerangle; //opening angle of Inner sector fInnerAngleShift = innershift; //shift of first inner sector center to the 0 fOuterAngle = outerangle; //opening angle of outer sector fOuterAngleShift = outershift; //shift of first sector center to the 0 if (inDegree==kTRUE){ fInnerAngle *=kDegtoRad; fInnerAngleShift *=kDegtoRad; fOuterAngle *=kDegtoRad; fOuterAngleShift *=kDegtoRad; } } void AliTPCParam::CRXYZtoXYZ(Float_t *xyz, const Int_t §or, const Int_t & padrow, Int_t option) const { //transform relative coordinates to absolute Bool_t rel = ( (option&2)!=0); Float_t row_first; row_first = (sector<=fNInnerSector) ? fPadRowLow[0] : fPadRowUp[0]; if (rel==kTRUE) //if the position is relative to pad row { xyz[0]+=row_first; xyz[0]+=(Int_t) padrow*fPadPitchLength; } xyz[2]=z_end-xyz[2]; if (sector=(fNInnerSector>>1)) xyz[2]*=-1.; } else { if ( (sector-fNInnerSector) >= (fNOuterSector>>1) ) xyz[2]*=-1; } Float_t x1=xyz[0]; Float_t y1=xyz[1]; Float_t cos,sin; AdjustAngles(sector,cos,sin); xyz[0]= x1*cos - y1*sin; xyz[1]= x1*sin + y1*cos; } void AliTPCParam::XYZtoCRXYZ(Float_t *xyz, Int_t §or, Int_t & padrow, Int_t option) { //transform global position to the position relative to the sector padrow //if option=0 X calculate absolute calculate sector //if option=1 X absolute use input sector //if option=2 X relative to pad row calculate sector //if option=3 X relative use input sector //!!!!!!!!! WE start to calculate rows from row = 0 Bool_t rel = ( (option&2)!=0); //option 0 and 2 means that we don't have information about sector //we calculate sector if ((option&1)==0){ Float_t angle; Float_t r = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]); if ((xyz[0]==0)&&(xyz[1]==0)) angle = 0; else { angle =TMath::ASin(xyz[1]/r); if (xyz[0]<0) angle=TMath::Pi()-angle; if ( (xyz[0]>0) && (xyz[1]<0) ) angle=2*TMath::Pi()+angle; } //transform global position to the position relative to the sector padrow //fistly calculate xyz[0] radius for lover sector //bacause in this moment we dont know in which sector we are sector=Int_t((angle-fInnerAngleShift)/fInnerAngle); Float_t x1; Float_t y1; //firstly we suppose that we are in inner sector Float_t cos,sin; AdjustAngles(sector,cos,sin); x1=xyz[0]*cos + xyz[1]*sin; y1=-xyz[0]*sin + xyz[1]*cos; if (x1>fOuterRadiusLow) { sector=Int_t((angle-fOuterAngleShift)/fOuterAngle)+fNInnerSector; AdjustAngles(sector,cos,sin); x1=xyz[0]*cos + xyz[1]*sin; y1=-xyz[0]*sin + xyz[1]*cos; if (xyz[2]<0) sector+=(fNOuterSector>>1); } else if (xyz[2]<0) sector+=(fNInnerSector>>1); if (x1fNtRows)) return kFALSE; Int_t outindex = fNInnerSector*fnRowLow; if (index=GetNRow(isec))) return -1; else return row; } void AliTPCParam::SetDefault() { //set default TPC param fbStatus = kFALSE; //set sector parameters fInnerRadiusLow = kInnerRadiusLow; fOuterRadiusLow = kOuterRadiusLow; fInnerRadiusUp = kInnerRadiusUp; fOuterRadiusUp = kOuterRadiusUp; SetSectorAngles(kInnerAngle,kInnerAngleShift, kOuterAngle, kOuterAngleShift,kFALSE); // set default pad size and shape fPadPitchLength = kPadPitchLength; fPadPitchWidth = kPadPitchWidth; fPadLength = kPadLength; fPadWidth = kPadWidth; // fnWires = knWires; fWWPitch= kPadPitchLength/Float_t(knWires); fDiffT = kDiffT; fDiffL = kDiffL; fOmegaTau = kOmegaTau; fOxyCont = kOxyCont; fAttCoef = kAttCoef; fNoise = kNoise; fChipGain = kChipGain; fGasGain = kGasGain; fZeroSup= kZeroSup; fPadCoupling= kPadCoupling; fTSample =kTSample; fTSigma =kTFWHM/2.35; fDriftV=kDriftV; fMaxTBin = kMaxTBin; fbStatus = Update(); } void AliTPCParam::AdjustAngles(Int_t isec, Float_t &cos, Float_t &sin) const { // //set cosinus and sinus of rotation angles for sector isec // cos=fRotAngle[isec*2]; sin=fRotAngle[isec*2+1]; } Bool_t AliTPCParam::Update() { // // update some calculated parameter which must be updated after changing "base" // parameters // for example we can change size of pads and according this recalculate number // of pad rows, number of of pads in given row .... // fbStatus = kFALSE; Int_t i,j; //loop variables because HP //-----------------Sector section------------------------------------------ //calclulate number of sectors fNInnerSector = Int_t(4*TMath::Pi()/fInnerAngle+0.2); // number of inner sectors - factor 0.2 to don't //be influnced by inprecision if (fNInnerSector%2) return kFALSE; fNOuterSector = Int_t(4*TMath::Pi()/fOuterAngle+0.2); if (fNOuterSector%2) return kFALSE; fNSector = fNInnerSector+fNOuterSector; //calculate sin and cosine of rotations angle //sectors angles numbering from 0 j=fNInnerSector; Float_t angle = fInnerAngleShift; for (i=0; ifPadPitchLength){ cout<<"ERROR !!! Small pad pitch length \n"<fnRowUp) return kFALSE; fnRowLow = Int_t((0.01+fInnerRadiusUp-fInnerRadiusLow)/fPadPitchLength)+1; if ( kMaxRowsfnRowLow) return kFALSE; // adjust upper sectors pad row positions and pad numbers for (i = 0;i> fInnerRadiusLow; R__b >> fInnerRadiusUp; R__b >> fOuterRadiusLow; R__b >> fOuterRadiusUp; R__b >> fInnerAngle; R__b >> fInnerAngleShift; R__b >> fOuterAngle; R__b >> fOuterAngleShift; //pad parameters R__b >> fPadPitchLength; R__b >> fPadPitchWidth; R__b >> fPadLength; R__b >> fPadWidth; R__b >> fnWires; //gas parameters R__b >>fDiffT; R__b >>fDiffL; R__b >>fGasGain; R__b >>fDriftV; R__b >>fOmegaTau; R__b >>fOxyCont; R__b >>fAttCoef; R__b >>fPadCoupling; R__b >>fZeroSup; R__b >>fNoise; R__b >>fChipGain; R__b >>fTSample; R__b >>fTSigma; // Update(); } else { R__b.WriteVersion(AliTPCParam::IsA()); TObject::Streamer(R__b); R__b << fInnerRadiusLow; R__b << fInnerRadiusUp; R__b << fOuterRadiusLow; R__b << fOuterRadiusUp; R__b << fInnerAngle; R__b << fInnerAngleShift; R__b << fOuterAngle; R__b << fOuterAngleShift; R__b << fPadPitchLength; R__b << fPadPitchWidth; R__b << fPadLength; R__b << fPadWidth; R__b << fnWires; R__b <