/************************************************************************** * 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.16 2002/10/14 14:57:42 hristov Merging the VirtualMC branch to the main development branch (HEAD) Revision 1.13.4.1 2002/06/10 15:26:11 hristov Merged with v3-08-02 Revision 1.15 2002/05/07 17:24:02 kowal2 Updated wires positions Revision 1.14 2002/03/29 06:57:45 kowal2 Restored backward compatibility to use the hits from Dec. 2000 production. Revision 1.13 2002/03/18 17:59:13 kowal2 Chnges in the pad geometry - 3 pad lengths introduced. Revision 1.12 2002/02/05 09:12:26 hristov Small mods for gcc 3.02 Revision 1.11 2000/11/02 07:33:48 kowal2 Automatic streamer generation. Revision 1.10 2000/07/10 20:57:39 hristov Update of TPC code and macros by M.Kowalski Revision 1.9 2000/06/30 12:07:50 kowal2 Updated from the TPC-PreRelease branch Revision 1.8.4.4 2000/06/26 07:39:42 kowal2 Changes to obey the coding rules Revision 1.8.4.3 2000/06/25 08:38:41 kowal2 Splitted from AliTPCtracking Revision 1.8.4.2 2000/06/14 16:48:24 kowal2 Parameter setting improved. Removed compiler warnings Revision 1.8.4.1 2000/06/09 07:12:21 kowal2 Updated defaults Revision 1.8 2000/04/17 09:37:33 kowal2 removed obsolete AliTPCDigitsDisplay.C Revision 1.7.8.2 2000/04/10 08:44:51 kowal2 New transformations added Different pad and pad-rows geometries for different sectors Revision 1.7.8.1 2000/04/10 07:56:53 kowal2 Not used anymore - removed Revision 1.7 1999/10/08 13:10:35 fca Values in SetDefault are in radiants 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 #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((angle-fInnerAngleShift)/fInnerAngle); Float_t cos,sin; AdjustCosSin(sector,cos,sin); x1=xyz[0]*cos + xyz[1]*sin; if (x1>fOuterRadiusLow) { sector=Int_t((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) { // //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