3 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>, Uli Frankenfeld <mailto:franken@fi.uib.no>
4 //*-- Copyright © ASV
5 // changes done by Constantin Loizides <mailto:loizides@ikf.physik.uni-frankfurt.de>
7 #include "AliL3StandardIncludes.h"
9 #include "AliL3Logging.h"
10 #include "AliL3Transform.h"
14 #include "AliTPCParamSR.h"
15 #include "AliTPCPRF2D.h"
16 #include "AliTPCRF1D.h"
20 /** \class AliL3Transform
22 //_____________________________________________________________
25 // Transformation class for ALICE TPC.
27 // Class which contains all detector specific parameters for the TPC,
28 // and different useful functions for coordinate transforms.
30 // The class is completely static, which means that no object needs
31 // to be instantiated. Function calls should then be done like, e.g.:
33 // Double_t eta = AliL3Transform::GetEta(xyz);
35 // IMPORTANT: If used as is, default detector parameters will be used,
36 // and you really have to make sure that these correspond to
37 // the AliROOT version you are currently working on!!
38 // You should therefore always initialize the parameters by
40 // AliL3Transform::Init(path);
42 // where path is a char*, giving the path to where file containing
43 // the detector parameter is located. This file should be called
44 // "l3transform.config", and can be created with the function MakeInitFile.
46 // You can also force reading the parameters from a AliTPCParam object
47 // by setting the flag;
49 // AliL3Transform::Init(filename,kTRUE);
51 // where filename is a char* providing the path to the rootfile which
52 // should be called digitfile.root. Note that in this case you have to
53 // compile with USEPACKAGE=ALIROOT set (see level3code/Makefile.conf).
57 ClassImp(AliL3Transform)
59 const Double_t AliL3Transform::fBFACT = 0.0029980;
60 Double_t AliL3Transform::fBField = 0.2;
61 Int_t AliL3Transform::fVersion = 0;
62 Int_t AliL3Transform::fNPatches = 6;
63 Int_t AliL3Transform::fBFieldFactor = 1 ;
64 Int_t AliL3Transform::fNTimeBins = 446 ;
65 Int_t AliL3Transform::fNRowLow = 63 ;
66 Int_t AliL3Transform::fNRowUp = 96 ;
67 Int_t AliL3Transform::fNRowUp1 = 64 ;
68 Int_t AliL3Transform::fNRowUp2 = 32 ;
69 Int_t AliL3Transform::fNSectorLow = 36 ;
70 Int_t AliL3Transform::fNSectorUp = 36 ;
71 Int_t AliL3Transform::fNSector = 72 ;
72 Double_t AliL3Transform::fAnodeWireSpacing = 0.25; //Taken from the TDR
73 Double_t AliL3Transform::fPadPitchWidthLow = 0.400000 ;
74 Double_t AliL3Transform::fPadPitchWidthUp = 0.600000 ;
75 Double_t AliL3Transform::fZWidth = 0.56599998474121093750 ;
76 Double_t AliL3Transform::fZSigma = 0.22880849748219134199 ;
77 Double_t AliL3Transform::fZLength = 250.00000000000000000000 ;
78 Double_t AliL3Transform::fZOffset = 0.68642549244657402596 ;
79 Double_t AliL3Transform::fDiffT = 0.02199999988079071045 ;
80 Double_t AliL3Transform::fDiffL = 0.02199999988079071045 ;
81 Double_t AliL3Transform::fInnerPadLength = 0.750000 ;
82 Double_t AliL3Transform::fOuter1PadLength = 1.000000 ;
83 Double_t AliL3Transform::fOuter2PadLength = 1.500000 ;
84 Double_t AliL3Transform::fInnerPRFSigma = 0.20381128787994384766 ;
85 Double_t AliL3Transform::fOuter1PRFSigma = 0.29932481050491333008 ;
86 Double_t AliL3Transform::fOuter2PRFSigma = 0.29932320117950439453 ;
87 Double_t AliL3Transform::fTimeSigma = 0.22880862653255462646 ;
88 Int_t AliL3Transform::fNSlice = 36 ;
89 Int_t AliL3Transform::fNRow = 159 ;
90 Double_t AliL3Transform::fNRotShift = 0.5 ;
91 Double_t AliL3Transform::fPi = 3.141592653589793 ;
92 Int_t AliL3Transform::fRows[6][2] = {{0,31},{32,62},{63,86},{87,110},{111,134},{135,158}}; //Defined by us
93 Int_t AliL3Transform::fNRows[6] = {32,31,24,24,24,24}; //Defined by us
94 Double_t AliL3Transform::fX[159] = {85.194999694824219,
255 Int_t AliL3Transform::fNPads[159] = {67,
418 void AliL3Transform::Init(Char_t* path,Bool_t UseAliTPCParam)
420 //Overwrite the parameters with values stored in file "l3transform.config" in path.
421 //If file does not exist, old default values will be used.
422 //If flag UseAliTPCParam is set, the parameters will be read from the the rootfile
423 //which then has to be called path/digitfile.root
426 LOG(AliL3Log::kWarning,"AliL3Transform::Init","Init values")
427 <<"You are initializing the parameters more than once; check your code please! "<<fVersion<<ENDLOG;
435 Char_t *pathname=new Char_t[1024];
436 strcpy(pathname,path);
437 strcat(pathname,"/l3transform.config");
439 FILE *fptr=fopen(pathname,"r");
441 LOG(AliL3Log::kWarning,"AliL3Transform::Init","File Open")
442 <<"Pointer to Config File \""<<pathname<<"\" 0x0!"<<ENDLOG;
446 Char_t d1[250], d2[100], d3[100];
451 fscanf(fptr,"%s",d1);
453 if(strcmp(d1,"fBFieldFactor")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fBFieldFactor=(Int_t)dummy;fBField=fBFieldFactor*0.2;}
454 else if(strcmp(d1,"fNTimeBins")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNTimeBins=(Int_t)dummy;}
455 else if(strcmp(d1,"fNRowLow")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRowLow=(Int_t)dummy;}
457 LOG(AliL3Log::kError,"AliL3Transform::Init","Overflow")
458 <<"Number of inner PadRows should be 63! Check and fgrep the code for 63 to see the consequences of this major change!"<<ENDLOG;
459 else if(strcmp(d1,"fNRowUp")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRowUp=(Int_t)dummy;}
460 else if(strcmp(d1,"fNRowUp1")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRowUp1=(Int_t)dummy;}
461 else if(strcmp(d1,"fNRowUp2")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRowUp2=(Int_t)dummy;}
462 else if(strcmp(d1,"fNSectorLow")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSectorLow=(Int_t)dummy;}
463 else if(strcmp(d1,"fNSectorUp")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSectorUp=(Int_t)dummy;}
464 else if(strcmp(d1,"fNSector")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSector=(Int_t)dummy;}
465 else if(strcmp(d1,"fPadPitchWidthLow")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fPadPitchWidthLow=(Double_t)ddummy;}
466 else if(strcmp(d1,"fPadPitchWidthUp")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fPadPitchWidthUp=(Double_t)ddummy;}
467 else if(strcmp(d1,"fZWidth")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZWidth=(Double_t)ddummy;}
468 else if(strcmp(d1,"fZSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZSigma=(Double_t)ddummy;}
469 else if(strcmp(d1,"fZLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZLength=(Double_t)ddummy;}
470 else if(strcmp(d1,"fZOffset")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fZOffset=(Double_t)ddummy;}
471 else if(strcmp(d1,"fNSlice")==0){fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNSlice=(Int_t)dummy;}
472 else if(strcmp(d1,"fDiffT")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fDiffT=(Double_t)ddummy;}
473 else if(strcmp(d1,"fDiffL")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fDiffL=(Double_t)ddummy;}
474 else if(strcmp(d1,"fInnerPadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fInnerPadLength=(Double_t)ddummy;}
475 else if(strcmp(d1,"fOuter1PadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOuter1PadLength=(Double_t)ddummy;}
476 else if(strcmp(d1,"fOuter2PadLength")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOuter2PadLength=(Double_t)ddummy;}
477 else if(strcmp(d1,"fInnerPRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fInnerPRFSigma=(Double_t)ddummy;}
478 else if(strcmp(d1,"fOuter1PRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOuter1PRFSigma=(Double_t)ddummy;}
479 else if(strcmp(d1,"fOuter2PRFSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fOuter2PRFSigma=(Double_t)ddummy;}
480 else if(strcmp(d1,"fTimeSigma")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fTimeSigma=(Double_t)ddummy;}
481 else if(strcmp(d1,"fNRow")==0){
482 fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNRow=(Int_t)dummy;
484 LOG(AliL3Log::kError,"AliL3Transform::Init","Overflow")<<"Number of PadRows should be 159! Check and fgrep the code for 159 to see the consequences of this major change!"<<ENDLOG;
487 else if(strcmp(d1,"fNRotShift")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fNRotShift=(Double_t)ddummy;}
488 else if(strcmp(d1,"fPi")==0){fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fPi=(Double_t)ddummy;}
489 else if(strcmp(d1,"fX[0]")==0){
490 fscanf(fptr,"%s %lf %s",d2,&ddummy,d3);fX[0]=(Double_t)ddummy;
491 for(Int_t i=1;i<fNRow;i++){fscanf(fptr,"%s %s %lf %s",d1,d2,&ddummy,d3);fX[i]=(Double_t)ddummy;}
493 else if(strcmp(d1,"fNPads[0]")==0){
494 fscanf(fptr,"%s %d %s",d2,&dummy,d3);fNPads[0]=(Int_t)dummy;
495 for(Int_t i=1;i<fNRow;i++){fscanf(fptr,"%s %s %d %s",d1,d2,&dummy,d3);fNPads[i]=(Int_t)dummy;}
501 fVersion++; //new version
503 void AliL3Transform::ReadInit(Char_t *path)
505 //Read all the parameters from a aliroot file, and store it in a temporary
506 //file which is read by Init. Use this if you want to read the parameters from
507 //the rootfile "every" time.
510 LOG(AliL3Log::kError,"AliL3Transform::ReadInit","Version")
511 <<"You have to compile with use_aliroot flag in order to read from AliROOT file"<<ENDLOG;
514 Char_t filename[1024];
515 sprintf(filename,"%s/digitfile.root",path);
516 MakeInitFile(filename,"/tmp/");
523 void AliL3Transform::MakeInitFile(Char_t *filename,Char_t *path)
525 //Get the parameters from rootfile, and store it on the file "l3transform.config"
526 //which is being read by Init.
529 LOG(AliL3Log::kError,"AliL3Transform::MakeInitFile","Version")
530 <<"You have to compile with use_aliroot flag in order to use this function"<<ENDLOG;
533 TFile *rootfile = TFile::Open(filename);
534 AliRun *gAlice = (AliRun*)rootfile->Get("gAlice");
537 LOG(AliL3Log::kError,"AliL3Transform::MakeInitFile","File")
538 <<"No gAlice in file: "<<filename<<ENDLOG;
541 AliTPCParamSR *param=(AliTPCParamSR*)rootfile->Get("75x40_100x60_150x60");
544 LOG(AliL3Log::kError,"AliL3Transform::MakeInitFile","File")
545 <<"No TPC parameters found"<<ENDLOG;
549 AliTPCPRF2D * prfinner = new AliTPCPRF2D;
550 AliTPCPRF2D * prfouter1 = new AliTPCPRF2D;
551 AliTPCPRF2D * prfouter2 = new AliTPCPRF2D;
552 AliTPCRF1D * rf = new AliTPCRF1D(kTRUE);
553 rf->SetGauss(param->GetZSigma(),param->GetZWidth(),1.);
554 rf->SetOffset(3*param->GetZSigma());
557 TDirectory *savedir=gDirectory;
558 TFile *prf_file = TFile::Open("$ALICE_ROOT/TPC/AliTPCprf2d.root");
559 if (!prf_file->IsOpen())
561 LOG(AliL3Log::kError,"AliL3Transform::MakeInitFile","File")
562 <<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !"<<ENDLOG;
565 prfinner->Read("prf_07504_Gati_056068_d02");
566 prfouter1->Read("prf_10006_Gati_047051_d03");
567 prfouter2->Read("prf_15006_Gati_047051_d03");
571 param->SetInnerPRF(prfinner);
572 param->SetOuter1PRF(prfouter1);
573 param->SetOuter2PRF(prfouter2);
574 param->SetTimeRF(rf);
576 Int_t nTimeBins = param->GetMaxTBin()+1;
577 Int_t nRowLow = param->GetNRowLow();
578 Int_t nRowUp = param->GetNRowUp();
579 Int_t nRowUp1 = param->GetNRowUp1();
580 Int_t nRowUp2 = param->GetNRowUp2();
581 Int_t nRow= fNRowLow + fNRowUp;
582 Int_t nSectorLow = param->GetNInnerSector();
583 Int_t nSectorUp = param->GetNOuterSector();
584 Int_t nSector = fNSectorLow + fNSectorUp;
587 sprintf(tofile,"%s/l3transform.config",path);
588 FILE *f = fopen(tofile,"w");
589 fprintf(f,"void AliL3Transform::Init(){\n");
591 fprintf(f," fBFieldFactor = %d ;\n",(Int_t)gAlice->Field()->Factor());
592 fprintf(f," //sector:\n");
593 fprintf(f," fNTimeBins = %d ;\n",nTimeBins);
594 fprintf(f," fNRowLow = %d ;\n",nRowLow);
595 fprintf(f," fNRowUp = %d ;\n",nRowUp);
596 fprintf(f," fNRowUp1 = %d ;\n",nRowUp1);
597 fprintf(f," fNRowUp2 = %d ;\n",nRowUp2);
598 fprintf(f," fNSectorLow = %d ;\n",nSectorLow);
599 fprintf(f," fNSectorUp = %d ;\n",nSectorUp);
600 fprintf(f," fNSector = %d ;\n",nSector);
601 fprintf(f," fPadPitchWidthLow = %f ;\n",param->GetInnerPadPitchWidth());
602 fprintf(f," fPadPitchWidthUp = %f ;\n",param->GetOuterPadPitchWidth());
603 fprintf(f," fZWidth = %.20f ;\n",param->GetZWidth());
604 fprintf(f," fZSigma = %.20f ;\n",param->GetZSigma());
605 fprintf(f," fZLength = %.20f ;\n",param->GetZLength());
606 fprintf(f," fZOffset = %.20f ;\n",param->GetZOffset());
607 fprintf(f," fDiffT = %.20f ;\n",param->GetDiffT());
608 fprintf(f," fDiffL = %.20f ;\n",param->GetDiffL());
609 fprintf(f," fInnerPadLength = %f ;\n",param->GetInnerPadLength());
610 fprintf(f," fOuter1PadLength = %f ;\n",param->GetOuter1PadLength());
611 fprintf(f," fOuter2PadLength = %f ;\n",param->GetOuter2PadLength());
612 fprintf(f," fInnerPRFSigma = %.20f ;\n",param->GetInnerPRF()->GetSigmaX());
613 fprintf(f," fOuter1PRFSigma = %.20f ;\n",param->GetOuter1PRF()->GetSigmaX());
614 fprintf(f," fOuter2PRFSigma = %.20f ;\n",param->GetOuter2PRF()->GetSigmaX());
616 fprintf(f," fTimeSigma = %.20f ;\n",param->GetTimeRF()->GetSigma());
618 fprintf(f,"\n //slices:\n");
619 fprintf(f," fNSlice = %d ;\n",nSectorLow);
620 fprintf(f," fNRow = %d ;\n",nRow);
622 //rotation shift put in by hand -> Constantin
623 fprintf(f," fNRotShift = 0.5 ;\n");
625 fprintf(f," fPi = %.15f ;\n",TMath::Pi());
627 for(Int_t i=0;i<nRow;i++){
629 if( i < nRowLow){sec =0;row =i;}
630 else{sec = nSectorLow;row =i-nRowLow;}
631 fprintf(f," fX[%d] = %3.15f ;\n",i,param->GetPadRowRadii(sec,row));
633 for(Int_t i=0;i<nRow;i++){
635 if( i < nRowLow){sec =0;row =i;}
636 else{sec = nSectorLow;row =i-nRowLow;}
637 fprintf(f," fNPads[%d] = %d ;\n",i,param->GetNPads(sec,row));
645 inline Double_t AliL3Transform::GetPadLength(Int_t padrow)
649 if(padrow < fNRowLow)
650 return fInnerPadLength;
651 if(padrow >= fNRowLow && padrow < fNRowLow + fNRowUp1 - 1)
652 return fOuter1PadLength;
653 if(padrow >= fNRowLow + fNRowUp1 - 1)
654 return fOuter2PadLength;
657 inline Double_t AliL3Transform::GetPRFSigma(Int_t padrow)
661 if(padrow < fNRowLow)
662 return fInnerPRFSigma;
663 if(padrow >= fNRowLow && padrow < fNRowLow + fNRowUp1 - 1)
664 return fOuter1PRFSigma;
665 if(padrow >= fNRowLow + fNRowUp1 - 1)
666 return fOuter2PRFSigma;
669 Double_t AliL3Transform::GetEta(Float_t *xyz)
671 Double_t r3 = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]);
672 Double_t eta = 0.5 * log((r3+xyz[2])/(r3-xyz[2]));
676 void AliL3Transform::XYZtoRPhiEta(Float_t *rpe, Float_t *xyz)
678 rpe[0] = sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]+xyz[2]*xyz[2]);
679 rpe[1] = atan2(xyz[1],xyz[0]);
680 rpe[2] = 0.5 * log((rpe[0]+xyz[2])/(rpe[0]-xyz[2]));
683 Double_t AliL3Transform::GetEta(Int_t padrow,Int_t pad,Int_t time)
687 Slice2Sector(0,padrow,sector,row);
688 Raw2Local(xyz,sector,row,pad,time);
693 Double_t AliL3Transform::GetPhi(Float_t *xyz)
695 Double_t phi = atan2(xyz[1],xyz[0]);
696 //if(phi<0) phi=phi+2*TMath::Pi();
700 Bool_t AliL3Transform::Slice2Sector(Int_t slice, Int_t slicerow, Int_t & sector, Int_t &row)
702 if(slicerow<0&&slicerow>=fNRow) return kFALSE;
703 if(slice<0||slice>=fNSlice) return kFALSE;
705 if(slicerow<fNRowLow){
710 sector = slice+fNSlice;
711 row = slicerow-fNRowLow;
716 Bool_t AliL3Transform::Sector2Slice(Int_t & slice, Int_t sector)
718 if(sector<0||sector>=fNSector) return kFALSE;
719 if(sector<fNSectorLow) slice = sector;
720 else slice = sector - fNSectorLow;
724 Bool_t AliL3Transform::Sector2Slice(Int_t & slice, Int_t & slicerow,Int_t sector, Int_t row)
726 if(sector<0||sector>=fNSector||row<0) return kFALSE;
727 if(sector<fNSectorLow){
728 if(row>=fNRowLow) return kFALSE;
733 if(row>=fNRowUp) return kFALSE;
734 slice = sector - fNSectorLow;
735 slicerow = row + fNRowLow;
740 Double_t AliL3Transform::Row2X(Int_t slicerow){
741 if(slicerow<0||slicerow>=fNRow) return 0;
745 void AliL3Transform::Local2Global(Float_t *xyz,Int_t slice)
747 //Transformation to global coordinate system
751 cs = cos( (2*fPi/18) * (slice+fNRotShift) );
752 sn = sin( (2*fPi/18) * (slice+fNRotShift) );
755 xyz[2]=xyz[2];//global z=local z
758 void AliL3Transform::Local2GlobalAngle(Float_t *angle,Int_t slice){
759 angle[0] = fmod(angle[0]+(slice+fNRotShift)*(2*fPi/18),2*fPi);
762 void AliL3Transform::Global2LocalAngle(Float_t *angle,Int_t slice){
763 angle[0] = angle[0]-(slice+fNRotShift)*(2*fPi/18);
764 if(angle[0]<0) angle[0]+=2*fPi;
767 void AliL3Transform::Raw2Local(Float_t *xyz,Int_t sector,Int_t row,Float_t pad,Float_t time)
769 //Transformation from rawdata to local coordinate system
771 Int_t slice,slicerow;
772 Sector2Slice(slice, slicerow, sector, row);
775 xyz[0]=Row2X(slicerow);
778 Int_t npads= fNPads[slicerow];
779 if(sector<fNSectorLow)
780 xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthLow;
782 xyz[1]=(pad-0.5*(npads-1))*fPadPitchWidthUp;
784 //Z-Value (remember PULSA Delay)
785 //xyz[2]=fZWidth*time-3.*fZSigma;
786 xyz[2]=fZWidth*time-fZOffset;
788 xyz[2]=fZLength-xyz[2];
790 xyz[2]=xyz[2]-fZLength;
794 void AliL3Transform::Local2Global(Float_t *xyz,Int_t sector,Int_t row)
796 //Transformation to global coordinate system
797 Int_t slice,slicerow;
798 Sector2Slice(slice, slicerow, sector, row);
799 Float_t r=Row2X(slicerow);
800 Float_t cs = cos( (2*fPi/18) * (slice+fNRotShift) );
801 Float_t sn = sin( (2*fPi/18) * (slice+fNRotShift) );
803 xyz[0]=r*cs-xyz[1]*sn;
804 xyz[1]=r*sn+xyz[1]*cs;
805 xyz[2]=xyz[2];//global z=local z
808 Double_t AliL3Transform::GetMaxY(Int_t slicerow)
811 if(slicerow < fNRowLow)
812 return fPadPitchWidthLow*fNPads[slicerow]/2;
815 return fPadPitchWidthUp*fNPads[slicerow]/2;
819 void AliL3Transform::Global2Local(Float_t *xyz,Int_t sector,Bool_t isSlice)
824 Sector2Slice(slice, sector);
827 Float_t cs = cos( (2*fPi/18) * (slice+fNRotShift) );
828 Float_t sn = sin( (2*fPi/18) * (slice+fNRotShift) );
829 Float_t x1 = xyz[0]*cs + xyz[1]*sn;
830 Float_t y1 = -xyz[0]*sn + xyz[1]*cs;
835 void AliL3Transform::Raw2Global(Float_t *xyz,Int_t sector,Int_t row,Float_t pad,Float_t time)
837 //Transformation from raw to global coordinates
839 Raw2Local(xyz,sector,row,pad,time);
840 Local2Global(xyz,sector,row);
843 void AliL3Transform::Local2Raw(Float_t *xyz,Int_t sector,Int_t row)
845 //Transformation from local coordinates to raw
847 Int_t slice,slicerow;
848 Sector2Slice(slice, slicerow, sector, row);
850 if(sector<fNSectorLow)
851 xyz[1]=xyz[1]/fPadPitchWidthLow+0.5*(fNPads[slicerow]-1);
853 xyz[1]=xyz[1]/fPadPitchWidthUp+0.5*(fNPads[slicerow]-1);
855 Int_t nis=fNSectorLow;
856 Int_t nos=fNSectorUp;
858 if ((sector<nis/2) || ((sector-nis)<nos/2)) sign=1;
859 xyz[2]=fZLength-sign*xyz[2];
860 xyz[2]=(xyz[2]+fZOffset)/fZWidth;
864 void AliL3Transform::Global2Raw(Float_t *xyz,Int_t sector,Int_t row)
866 //Transformation from global coordinates to raw.
868 Global2Local(xyz,sector);
869 Local2Raw(xyz,sector,row);