/************************************************************************** * 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$ */ /////////////////////////////////////////////////////////////////////// // 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 #include ClassImp(AliTPCParam) //___________________________________________ AliTPCParam::AliTPCParam() { // //constructor sets the default parameters // 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; } 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; } sector=Int_t(TMath::Nint((angle-fInnerAngleShift)/fInnerAngle)); 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; } 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) { // // set opening angles const static 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 fInnerAngle *=kDegtoRad; fInnerAngleShift *=kDegtoRad; fOuterAngle *=kDegtoRad; fOuterAngleShift *=kDegtoRad; } Float_t AliTPCParam::GetInnerAngle() const { //return angle return fInnerAngle; } Float_t AliTPCParam::GetInnerAngleShift() const { //return angle return fInnerAngleShift; } Float_t AliTPCParam::GetOuterAngle() const { //return angle return fOuterAngle; } Float_t AliTPCParam::GetOuterAngleShift() const { //return angle return fOuterAngleShift; } Int_t AliTPCParam::GetIndex(Int_t sector, Int_t row) const { // //give index of the given sector and pad row //no control if the sectors and rows are reasonable !!! // if (sectorfNtRows)) return kFALSE; Int_t outindex = fNInnerSector*fNRowLow; if (index(kResponseThreshold)); } 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 .... // 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 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*2; Float_t angle = fInnerAngleShift; for (i=0; j