From: jbarbosa Date: Tue, 13 Jun 2000 13:15:41 +0000 (+0000) Subject: Still some code cleanup done (variable names) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=3a3df9e3a632108f47deef77c26c568dfdbf910a;p=u%2Fmrichter%2FAliRoot.git Still some code cleanup done (variable names) --- diff --git a/RICH/AliRICHDetect.cxx b/RICH/AliRICHDetect.cxx index 2a44456e3d1..bdc4ff11c07 100644 --- a/RICH/AliRICHDetect.cxx +++ b/RICH/AliRICHDetect.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.2 2000/06/12 15:19:30 jbarbosa + Cleaned up version. + Revision 1.1 2000/04/19 13:05:14 morsch J. Barbosa's spot reconstruction algorithm. @@ -67,35 +70,35 @@ void AliRICHDetect::Detect() //printf("Detection started!\n"); - Float_t OMEGA,steptheta,stepphi,x,y,cx,cy,l,aux1,aux2,aux3,maxi,maxj,maxk,max; + Float_t omega,steptheta,stepphi,x,y,cx,cy,l,aux1,aux2,aux3,maxi,maxj,maxk,max; //Float_t theta,phi,realomega,realtheta; Int_t i,j,k; //const Float_t Noise_Level=0; //Noise Level in percentage of mesh points //const Float_t t=0.6; //Softening of Noise Correction (factor) - const Float_t Pii=3.1415927; + const Float_t kPi=3.1415927; - const Float_t h=10; //Distance from Radiator to Pads in pads + const Float_t kHeight=10; //Distance from Radiator to Pads in pads - const Int_t dimensiontheta=100; //Matrix dimension for angle Detection - const Int_t dimensionphi=100; - const Int_t dimensionOMEGA=100; + const Int_t kDimensionTheta=100; //Matrix dimension for angle Detection + const Int_t kDimensionPhi=100; + const Int_t kDimensionOmega=100; //const Float_t SPOTp=.2; //Percentage of spot action //const Int_t np=500; //Number of points to reconstruct elipse - const Float_t maxOMEGA=65*Pii/180; //Maximum Cherenkov angle to identify + const Float_t kMaxOmega=65*kPi/180; //Maximum Cherenkov angle to identify - Int_t Point[dimensiontheta][dimensionphi][dimensionOMEGA]; - //Int_t Point1[dimensiontheta][dimensionphi][dimensionOMEGA]; + Int_t point[kDimensionTheta][kDimensionPhi][kDimensionOmega]; + //Int_t point1[kDimensionTheta][kDimensionPhi][kDimensionOmega]; - steptheta=Pii/dimensiontheta; - stepphi=Pii/dimensionphi; + steptheta=kPi/kDimensionTheta; + stepphi=kPi/kDimensionPhi; AliRICHChamber* iChamber; - AliRICH *RICH = (AliRICH*)gAlice->GetDetector("RICH"); + AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH"); Int_t ntracks = (Int_t)gAlice->TreeH()->GetEntries(); //Int_t ntrks = gAlice->GetNtrack(); @@ -115,9 +118,9 @@ void AliRICHDetect::Detect() for (Int_t track=0; trackResetHits(); gAlice->TreeH()->GetEvent(track); - TClonesArray *Hits = RICH->Hits(); - if (Hits == 0) return; - Int_t nhits = Hits->GetEntriesFast(); + TClonesArray *pHits = pRICH->Hits(); + if (pHits == 0) return; + Int_t nhits = pHits->GetEntriesFast(); if (nhits == 0) continue; Int_t nent=(Int_t)gAlice->TreeD()->GetEntries(); gAlice->TreeD()->GetEvent(nent-1); @@ -127,22 +130,22 @@ void AliRICHDetect::Detect() Int_t counter=0; //Initialization - for(i=0;iUncheckedAt(0); + mHit = (AliRICHHit*) pHits->UncheckedAt(0); //printf("Aqui vou eu\n"); Int_t nch = mHit->fChamber; //printf("Aqui fui eu\n"); @@ -157,59 +160,59 @@ void AliRICHDetect::Detect() //printf("Chamber processed:%d\n",nch); printf("Center processed: %3.1f %3.1f %3.1f\n",trackglob[0],trackglob[1],trackglob[2]); - iChamber = &(RICH->Chamber(nch-1)); + iChamber = &(pRICH->Chamber(nch-1)); //printf("Nch:%d\n",nch); iChamber->GlobaltoLocal(trackglob,trackloc); - printf("Transformation 1: %3.1f %3.1f %3.1f\n",trackloc[0],trackloc[1],trackloc[2]); + //printf("Transformation 1: %3.1f %3.1f %3.1f\n",trackloc[0],trackloc[1],trackloc[2]); iChamber->LocaltoGlobal(trackloc,trackglob); - printf("Transformation 2: %3.1f %3.1f %3.1f\n",trackglob[0],trackglob[1],trackglob[2]); + //printf("Transformation 2: %3.1f %3.1f %3.1f\n",trackglob[0],trackglob[1],trackglob[2]); - TClonesArray *Digits = RICH->DigitsAddress(nch-1); - Int_t ndigits = Digits->GetEntriesFast(); + TClonesArray *pDigits = pRICH->DigitsAddress(nch-1); + Int_t ndigits = pDigits->GetEntriesFast(); //printf("Got %d digits\n",ndigits); //printf("Starting calculations\n"); - for(Float_t theta=0;thetaUncheckedAt(dig); + points=(AliRICHDigit*) pDigits->UncheckedAt(dig); x=points->fPadX-cx; y=points->fPadY-cy; //printf("Loaded digit %d with coordinates x:%f, y%f\n",dig,x,y); //cout<<"x="<>lixo;} //SPOT algorithm - for(i=1;iPoint[i-1][k][j])&&(Point[i][k][j]>Point[i+1][k][j])&& - (Point[i][k][j]>Point[i][k-1][j])&&(Point[i][k][j]>Point[i][k+1][j])&& - (Point[i][k][j]>Point[i][k][j-1])&&(Point[i][k][j]>Point[i][k][j+1])) + if((point[i][k][j]>point[i-1][k][j])&&(point[i][k][j]>point[i+1][k][j])&& + (point[i][k][j]>point[i][k-1][j])&&(point[i][k][j]>point[i][k+1][j])&& + (point[i][k][j]>point[i][k][j-1])&&(point[i][k][j]>point[i][k][j+1])) { //cout<<"SPOT"<max) + for(i=1;imax) { - //cout<<"maxi="<AddRecHit(nch-1,rechit); + pRICH->AddRecHit(nch-1,rechit); } //printf("\n\n\n\n"); gAlice->TreeR()->Fill(); @@ -311,19 +314,19 @@ void AliRICHDetect::Detect() //Stat_t ndig=TR->GetEntries(); TClonesArray *fRec; for (i=0;iRecHitsAddress(i); + fRec=pRICH->RecHitsAddress(i); int ndig=fRec->GetEntriesFast(); printf ("Chamber %d, rings %d\n",i,ndig); } //printf("Number of rec. hits: %d",ndig); - RICH->ResetRecHits(); + pRICH->ResetRecHits(); //char hname[30]; //sprintf(hname,"TreeR%d",track); //gAlice->TreeR()->Write(hname); } -Float_t AliRICHDetect:: Area(Float_t theta,Float_t OMEGA) +Float_t AliRICHDetect:: Area(Float_t theta,Float_t omega) { // @@ -331,9 +334,9 @@ Float_t AliRICHDetect:: Area(Float_t theta,Float_t OMEGA) Float_t area; - const Float_t h=9.25; //Distance from Radiator to Pads in pads + const Float_t kHeight=9.25; //Distance from Radiator to Pads in pads - area=TMath::Pi()*pow(h*tan(OMEGA),2)/pow(pow(cos(theta),2)-pow(tan(OMEGA)*sin(theta),2),3/2); + area=TMath::Pi()*pow(kHeight*tan(omega),2)/pow(pow(cos(theta),2)-pow(tan(omega)*sin(theta),2),3/2); return (area); } @@ -373,10 +376,10 @@ for(j=ncl+1;j<=nch;j++) t[i][j]=t[i][j-1]+ndep; return t; }*/ -/*void Pointpp(Float_t alfa,Float_t theta,Float_t OMEGA,Float_t cx,Float_t cy) +/*void pointpp(Float_t alfa,Float_t theta,Float_t omega,Float_t cx,Float_t cy) { Int_t s; - Float_t fiducial=h*tan((OMEGA+theta)*Pii/180),l=h/cos(theta*Pii/180),xtrial,y,c0,c1,c2; + Float_t fiducial=h*tan((omega+theta)*kPi/180),l=h/cos(theta*kPi/180),xtrial,y,c0,c1,c2; //cout<<"fiducial="<.5) s=1; else s=-1; //Trial a y y=s*aleat(fiducial); - Float_t alfa1=alfa*Pii/180; - Float_t theta1=theta*Pii/180; - Float_t OMEGA1=OMEGA*Pii/180; + Float_t alfa1=alfa*kPi/180; + Float_t theta1=theta*kPi/180; + Float_t omega1=omega*kPi/180; //Solve the eq for a trial x - c0=-pow(y*cos(alfa1)*cos(theta1),2)-pow(y*sin(alfa1),2)+pow(l*tan(OMEGA1),2)+2*l*y*cos(alfa1)*sin(theta1)*pow(tan(OMEGA1),2)+pow(y*cos(alfa1)*sin(theta1)*tan(OMEGA1),2); - c1=2*y*cos(alfa1)*sin(alfa1)-2*y*cos(alfa1)*pow(cos(theta1),2)*sin(alfa1)+2*l*sin(alfa1)*sin(theta1)*pow(tan(OMEGA1),2)+2*y*cos(alfa1)*sin(alfa1)*pow(sin(theta1),2)*pow(tan(OMEGA1),2); - c2=-pow(cos(alfa1),2)-pow(cos(theta1)*sin(alfa1),2)+pow(sin(alfa1)*sin(theta1)*tan(OMEGA1),2); + c0=-pow(y*cos(alfa1)*cos(theta1),2)-pow(y*sin(alfa1),2)+pow(l*tan(omega1),2)+2*l*y*cos(alfa1)*sin(theta1)*pow(tan(omega1),2)+pow(y*cos(alfa1)*sin(theta1)*tan(omega1),2); + c1=2*y*cos(alfa1)*sin(alfa1)-2*y*cos(alfa1)*pow(cos(theta1),2)*sin(alfa1)+2*l*sin(alfa1)*sin(theta1)*pow(tan(omega1),2)+2*y*cos(alfa1)*sin(alfa1)*pow(sin(theta1),2)*pow(tan(omega1),2); + c2=-pow(cos(alfa1),2)-pow(cos(theta1)*sin(alfa1),2)+pow(sin(alfa1)*sin(theta1)*tan(omega1),2); //cout<<"Trial: y="<