X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCParam.cxx;h=4418efb52ce646e78456df18b02300c02e829fd3;hb=110d52b004223c4e331e8c4c5ca40c57a7d86b99;hp=1032a4549b5c022838245b649323a523f8428c46;hpb=ae4cbe705374fc875c207b2efacb562a4b5b537d;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCParam.cxx b/TPC/AliTPCParam.cxx index 1032a4549b5..4418efb52ce 100644 --- a/TPC/AliTPCParam.cxx +++ b/TPC/AliTPCParam.cxx @@ -13,12 +13,7 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.4 1999/09/29 09:24:34 fca -Introduction of the Copyright and cvs Log - -*/ +/* $Id$ */ /////////////////////////////////////////////////////////////////////// // Manager and of geomety classes for set: TPC // @@ -31,334 +26,402 @@ Introduction of the Copyright and cvs Log // // /////////////////////////////////////////////////////////////////////// +// -#include +#include #include #include -#include "AliTPCSecGeo.h" +#include #include + + ClassImp(AliTPCParam) -const static Int_t kMaxRows=600; +//___________________________________________ +AliTPCParam::AliTPCParam() +{ + // + //constructor sets the default parameters + // -// default values -const static Int_t kMaxTBin =512; + fResponseBin = 0; + fResponseWeight = 0; + fRotAngle = 0; + SetTitle("75x40_100x60_150x60"); + SetDefault(); +} + +AliTPCParam::~AliTPCParam() +{ + // + //destructor deletes some dynamicaly alocated variables + // + if (fResponseBin!=0) delete [] fResponseBin; + if (fResponseWeight!=0) delete [] fResponseWeight; + if (fRotAngle !=0) delete [] fRotAngle; -const static Float_t kInnerRadiusLow = 89.45; -const static Float_t kOuterRadiusLow = 143.725; -const static Float_t kInnerRadiusUp = 134.55; -const static Float_t kOuterRadiusUp = 248.275; +} -const static Float_t kInnerAngle = 0.523598775; // 30 degrees -const static Float_t kInnerAngleShift = 0; -const static Float_t kOuterAngle = 0.261799387; // 15 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; +Int_t AliTPCParam::Transform0to1(Float_t *xyz, Int_t * index) const +{ + // + // calculates sector number (index[1], undefined on input) + // xyz intact + // + Float_t angle,x1; + Int_t sector; + 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; + } -const static Float_t kChipGain = 24; -const static Float_t kGasGain = 1e4; -const static Float_t kTSample = 2.e-7; //TSAMPLE -const static Float_t kTFWHM = 2.5e-7; //fwhm of charge distribution + sector=Int_t(TMath::Nint((angle-fInnerAngleShift)/fInnerAngle)); -const static Float_t kNoise = 500; //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; + Float_t cos,sin; + AdjustCosSin(sector,cos,sin); + x1=xyz[0]*cos + xyz[1]*sin; + if (x1>fOuterRadiusLow) + { + sector=Int_t(TMath::Nint((angle-fOuterAngleShift)/fOuterAngle))+fNInnerSector; + if (xyz[2]<0) sector+=(fNOuterSector>>1); + } + else + if (xyz[2]<0) sector+=(fNInnerSector>>1); + index[1]=sector; // calculated sector number + index[0]=1; // indicates system after transformation + return sector; +} +Bool_t AliTPCParam::Transform(Float_t */*xyz*/, Int_t *index, Int_t* /*oindex*/) +{ + //transformation from input coodination system to output coordination system + switch (index[0]){ + case 0: + break; + }; + return kFALSE; -//___________________________________________ -AliTPCParam::AliTPCParam() -{ - //constructor set the default parameters - SetDefault(); } +Int_t AliTPCParam::GetPadRow(Float_t *xyz, Int_t *index) const +{ + // + //calculates pad row of point xyz - transformation to system 8 (digit system) + // + Int_t system = index[0]; + if (0==system) { + Transform0to1(xyz,index); + system=1; + } + if (1==system) { + Transform1to2(xyz,index); + system=2; + } + + if (fGeometryType==0){ //straight row + if (2==system) { + Transform2to3(xyz,index); + system=3; + } + if (3==system) { + Transform3to4(xyz,index); + system=4; + } + if (4==system) { + Transform4to8(xyz,index); + system=8; + } + if (8==system) { + index[0]=8; + return index[2]; + } + } + + if (fGeometryType==1){ //cylindrical geometry + if (2==system) { + Transform2to5(xyz,index); + system=5; + } + if (5==system) { + Transform2to3(xyz,index); + system=6; + } + if (6==system) { + Transform3to4(xyz,index); + system=7; + } + if (8==system) { + index[0]=8; + return index[2]; + } + } + index[0]=system; + return -1; //if no reasonable system +} void AliTPCParam::SetSectorAngles(Float_t innerangle, Float_t innershift, Float_t outerangle, - Float_t outershift, Bool_t inDegree) + Float_t outershift) { // // set opening angles + static const Float_t kDegtoRad = 0.01745329251994; 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; + fInnerAngle *=kDegtoRad; + fInnerAngleShift *=kDegtoRad; + fOuterAngle *=kDegtoRad; + fOuterAngleShift *=kDegtoRad; } -void AliTPCParam::XYZtoCRXYZ(Float_t *xyz, - Int_t §or, Int_t & padrow, Int_t option) +Float_t AliTPCParam::GetInnerAngle() const { - //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); + //return angle + return fInnerAngle; - if (x1fNtRows)) return kFALSE; - Int_t outindex = fNInnerSector*fnRowLow; + Int_t outindex = fNInnerSector*fNRowLow; if (index=GetNRow(isec))) return -1; - else return row; -} - -void AliTPCParam::SetDefault() -{ - //set default TPC param + //const static Int_t kMaxRows=600; + // + //sector default parameters + // + static const Float_t kInnerRadiusLow = 82.97; + static const Float_t kInnerRadiusUp = 133.17; + static const Float_t kOuterRadiusLow = 133.58; + static const Float_t kOuterRadiusUp = 247.78; + static const Float_t kInnerAngle = 20; // 20 degrees + static const Float_t kInnerAngleShift = 10; + static const Float_t kOuterAngle = 20; // 20 degrees + static const Float_t kOuterAngleShift = 10; + static const Float_t kInnerFrameSpace = 1.5; + static const Float_t kOuterFrameSpace = 1.5; + static const Float_t kInnerWireMount = 1.370825926; + static const Float_t kOuterWireMount = 1.370825926; + static const Float_t kZLength =250.; + static const Int_t kGeometryType = 0; //straight rows + static const Int_t kNRowLow = 63; + static const Int_t kNRowUp1 = 64; + static const Int_t kNRowUp2 = 32; + static const Int_t kNRowUp = 96; + // + //wires default parameters + // + static const Int_t kNInnerWiresPerPad = 3; + static const Int_t kInnerDummyWire = 2; + static const Float_t kInnerWWPitch = 0.25; + static const Float_t kRInnerFirstWire = 84.445; + static const Float_t kRInnerLastWire = 132.445; + static const Float_t kInnerOffWire = 0.5; + static const Int_t kNOuter1WiresPerPad = 4; + static const Int_t kNOuter2WiresPerPad = 6; + static const Float_t kOuterWWPitch = 0.25; + static const Float_t kROuterFirstWire = 134.305; + static const Float_t kROuterLastWire = 247.055; + static const Int_t kOuterDummyWire = 2; + static const Float_t kOuterOffWire = 0.5; + // + //pad default parameters + // + static const Float_t kInnerPadPitchLength = 0.75; + static const Float_t kInnerPadPitchWidth = 0.40; + static const Float_t kInnerPadLength = 0.75; + static const Float_t kInnerPadWidth = 0.40; + static const Float_t kOuter1PadPitchLength = 1.0; + static const Float_t kOuterPadPitchWidth = 0.6; + static const Float_t kOuter1PadLength = 1.0; + static const Float_t kOuterPadWidth = 0.6; + static const Float_t kOuter2PadPitchLength = 1.5; + static const Float_t kOuter2PadLength = 1.5; + + static const Bool_t kBMWPCReadout = kTRUE; //MWPC readout - another possibility GEM + static const Int_t kNCrossRows = 1; //number of rows to cross-talk + + // + //gas default parameters + // + static const Float_t kDiffT = 2.2e-2; + static const Float_t kDiffL = 2.2e-2; + static const Float_t kGasGain = 2.e4; + static const Float_t kDriftV =2.83e6; + static const Float_t kOmegaTau = 0.145; + static const Float_t kAttCoef = 250.; + static const Float_t kOxyCont = 5.e-6; + // + //electronic default parameters + // + static const Float_t kPadCoupling=0.5; + static const Int_t kZeroSup=2; + static const Float_t kNoise = 1000; + static const Float_t kChipGain = 12; + static const Float_t kChipNorm = 0.4; + static const Float_t kTSample = 2.e-7; + static const Float_t kTFWHM = 1.9e-7; //fwhm of charge distribution + static const Int_t kMaxTBin =445; + static const Int_t kADCSat =1024; + static const Float_t kADCDynRange =2000.; + // + // + // + static const Float_t kBField =0.2; + static const Float_t kNPrimLoss =10.9; + static const Float_t kNTotalLoss =39.9; + // + //response constants + // + static const Int_t kNResponseMax=100; + static const Float_t kResponseThreshold=0.01; fbStatus = kFALSE; - //set sector parameters - fInnerRadiusLow = kInnerRadiusLow; - fOuterRadiusLow = kOuterRadiusLow; - fInnerRadiusUp = kInnerRadiusUp; - fOuterRadiusUp = kOuterRadiusUp; - SetSectorAngles(kInnerAngle,kInnerAngleShift, kOuterAngle, kOuterAngleShift); - // 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 + //set sector parameters + // + SetInnerRadiusLow(kInnerRadiusLow); + SetOuterRadiusLow(kOuterRadiusLow); + SetInnerRadiusUp(kInnerRadiusUp); + SetOuterRadiusUp(kOuterRadiusUp); + SetInnerFrameSpace(kInnerFrameSpace); + SetOuterFrameSpace(kOuterFrameSpace); + SetInnerWireMount(kInnerWireMount); + SetOuterWireMount(kOuterWireMount); + SetSectorAngles(kInnerAngle,kInnerAngleShift,kOuterAngle,kOuterAngleShift); + SetZLength(kZLength); + SetGeometryType(kGeometryType); + SetRowNLow(kNRowLow); + SetRowNUp1 (kNRowUp1); + SetRowNUp2(kNRowUp2); + SetRowNUp(kNRowUp); + // + //set wire parameters + // + SetInnerNWires(kNInnerWiresPerPad); + SetInnerDummyWire(kInnerDummyWire); + SetInnerOffWire(kInnerOffWire); + SetOuter1NWires(kNOuter1WiresPerPad); + SetOuter2NWire(kNOuter2WiresPerPad); + SetOuterDummyWire(kOuterDummyWire); + SetOuterOffWire(kOuterOffWire); + SetInnerWWPitch(kInnerWWPitch); + SetRInnerFirstWire(kRInnerFirstWire); + SetRInnerLastWire(kRInnerLastWire); + SetOuterWWPitch(kOuterWWPitch); + SetROuterFirstWire(kROuterFirstWire); + SetROuterLastWire(kROuterLastWire); + // + //set pad parameter + // + SetInnerPadPitchLength(kInnerPadPitchLength); + SetInnerPadPitchWidth(kInnerPadPitchWidth); + SetInnerPadLength(kInnerPadLength); + SetInnerPadWidth(kInnerPadWidth); + SetOuter1PadPitchLength(kOuter1PadPitchLength); + SetOuter2PadPitchLength(kOuter2PadPitchLength); + SetOuterPadPitchWidth(kOuterPadPitchWidth); + SetOuter1PadLength(kOuter1PadLength); + SetOuter2PadLength(kOuter2PadLength); + SetOuterPadWidth(kOuterPadWidth); + SetMWPCReadout(kBMWPCReadout); + SetNCrossRows(kNCrossRows); + // + //set gas paremeters // - cos=fRotAngle[isec*2]; - sin=fRotAngle[isec*2+1]; + SetDiffT(kDiffT); + SetDiffL(kDiffL); + SetGasGain(kGasGain); + SetDriftV(kDriftV); + SetOmegaTau(kOmegaTau); + SetAttCoef(kAttCoef); + SetOxyCont(kOxyCont); + // + //set electronivc parameters + // + SetPadCoupling(kPadCoupling); + SetZeroSup(kZeroSup); + SetNoise(kNoise); + SetChipGain(kChipGain); + SetChipNorm(kChipNorm); + SetTSample(kTSample); + SetTFWHM(kTFWHM); + SetMaxTBin(kMaxTBin); + SetADCSat(kADCSat); + SetADCDynRange(kADCDynRange); + //set magnetic field + SetBField(kBField); + SetNPrimLoss(kNPrimLoss); + SetNTotalLoss(kNTotalLoss); + // + //set response parameters + // + SetNResponseMax(kNResponseMax); + SetResponseThreshold(static_cast(kResponseThreshold)); } + Bool_t AliTPCParam::Update() { @@ -368,82 +431,72 @@ Bool_t AliTPCParam::Update() // for example we can change size of pads and according this recalculate number // of pad rows, number of of pads in given row .... // + const Float_t kQel = 1.602e-19; // elementary charge 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 + 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; + + if (fRotAngle!=0) delete [] fRotAngle; + fRotAngle = new Float_t[4*fNSector]; //calculate sin and cosine of rotations angle //sectors angles numbering from 0 - j=fNInnerSector; + + j=fNInnerSector*2; 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 <