Corrected compilation errors on HP-UX (replaced pow with TMath::Power)
authorjbarbosa <jbarbosa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Jun 2000 15:47:12 +0000 (15:47 +0000)
committerjbarbosa <jbarbosa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Jun 2000 15:47:12 +0000 (15:47 +0000)
RICH/AliRICHDetect.cxx
RICH/AliRICHPatRec.cxx

index bdc4ff11c078c2a2a28564872105e1fd2e0cc0f5..5970cd1794d513b2515c81a8aa4868c93f019caf 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
   $Log$
+  Revision 1.3  2000/06/13 13:15:41  jbarbosa
+  Still some code cleanup done (variable names)
+
   Revision 1.2  2000/06/12 15:19:30  jbarbosa
   Cleaned up version.
 
@@ -196,14 +199,14 @@ void AliRICHDetect::Detect()
                //printf("Loaded digit %d with coordinates x:%f, y%f\n",dig,x,y);
                //cout<<"x="<<x<<" y="<<y<<endl;
                
-               if (sqrt(pow(x,2)+pow(y,2))<kHeight*tan(theta+kMaxOmega)*3/4)
+               if (sqrt(TMath::Power(x,2)+TMath::Power(y,2))<kHeight*tan(theta+kMaxOmega)*3/4)
                  {
                    
                    l=kHeight/cos(theta);
                    
                    aux1=-y*sin(phi)+x*cos(phi);
                    aux2=y*cos(phi)+x*sin(phi);
-                   aux3=( pow(aux1,2)+pow(cos(theta)*aux2 ,2))/pow(sin(theta)*aux2+l,2);
+                   aux3=( TMath::Power(aux1,2)+TMath::Power(cos(theta)*aux2 ,2))/TMath::Power(sin(theta)*aux2+l,2);
                    //cout<<"aux1="<<aux1<<" aux2="<<aux2<<" aux3="<<aux3;
                    
                    omega=atan(sqrt(aux3));
@@ -336,7 +339,7 @@ Float_t AliRICHDetect:: Area(Float_t theta,Float_t omega)
     Float_t area;
     const Float_t kHeight=9.25;                       //Distance from Radiator to Pads in pads
     
-    area=TMath::Pi()*pow(kHeight*tan(omega),2)/pow(pow(cos(theta),2)-pow(tan(omega)*sin(theta),2),3/2);
+    area=TMath::Pi()*TMath::Power(kHeight*tan(omega),2)/TMath::Power(TMath::Power(cos(theta),2)-TMath::Power(tan(omega)*sin(theta),2),3/2);
     
     return (area);
 }
@@ -394,9 +397,9 @@ return t;
   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=-TMath::Power(y*cos(alfa1)*cos(theta1),2)-TMath::Power(y*sin(alfa1),2)+TMath::Power(l*tan(omega1),2)+2*l*y*cos(alfa1)*sin(theta1)*TMath::Power(tan(omega1),2)+TMath::Power(y*cos(alfa1)*sin(theta1)*tan(omega1),2);
+  c1=2*y*cos(alfa1)*sin(alfa1)-2*y*cos(alfa1)*TMath::Power(cos(theta1),2)*sin(alfa1)+2*l*sin(alfa1)*sin(theta1)*TMath::Power(tan(omega1),2)+2*y*cos(alfa1)*sin(alfa1)*TMath::Power(sin(theta1),2)*TMath::Power(tan(omega1),2);
+  c2=-TMath::Power(cos(alfa1),2)-TMath::Power(cos(theta1)*sin(alfa1),2)+TMath::Power(sin(alfa1)*sin(theta1)*tan(omega1),2);
   //cout<<"Trial: y="<<y<<"c0="<<c0<<" c1="<<c1<<" c2="<<c2<<endl;
   }
   //Choose which side to go...
index c48db2b2574753f5b46743b333fcd2ee77f46440..c2d40339311883392544296ae2f54f454762e68e 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
   $Log$
+  Revision 1.2  2000/06/12 15:26:09  jbarbosa
+  Cleaned up version.
+
   Revision 1.1  2000/06/09 14:53:01  jbarbosa
   Bari's pattern recognition algorithm
 
@@ -159,7 +162,7 @@ void AliRICHPatRec::PatRec()
     pRICH->AddRecHit(ich,rechit);
     
     betaCer = BetaCerenkov(1.29,fThetaCerenkov);
-    gamma  = 1./sqrt(1.-pow(betaCer,2));
+    gamma  = 1./sqrt(1.-TMath::Power(betaCer,2));
     massCer = fTrackMom/(betaCer*gamma);
     //    printf(" mass %f \n",massCer);
     mass->Fill(massCer*1000,1.);
@@ -219,7 +222,7 @@ Int_t AliRICHPatRec::TrackParam(Int_t itr, Int_t &ich)
     pX = mHit->fMomX;
     pY = mHit->fMomY;
     pZ = mHit->fMomZ;
-    fTrackMom = sqrt(pow(pX,2)+pow(pY,2)+pow(pZ,2));
+    fTrackMom = sqrt(TMath::Power(pX,2)+TMath::Power(pY,2)+TMath::Power(pZ,2));
     thetatr = (180 - mHit->fTheta)*(Float_t)kDegrad;
     phitr = mHit->fPhi*(Float_t)kDegrad;
     iloss = mHit->fLoss;
@@ -267,12 +270,12 @@ Float_t AliRICHPatRec::EstimationAtLimits(Float_t lim, Float_t radius,
 
   Float_t apar = (fRw -fEmissPoint + fQw + fTgap)*tan(fTrackTheta);
   Float_t b1 = (fRw-fEmissPoint)*tan(lim);
-  Float_t b2 = fQw / sqrt(pow(nquartz,2)-pow(nfreon*sin(lim),2));
-  Float_t b3 = fTgap / sqrt(pow(ngas,2)-pow(nfreon*sin(lim),2));
+  Float_t b2 = fQw / sqrt(TMath::Power(nquartz,2)-TMath::Power(nfreon*sin(lim),2));
+  Float_t b3 = fTgap / sqrt(TMath::Power(ngas,2)-TMath::Power(nfreon*sin(lim),2));
   Float_t bpar = b1 + nfreon*sin(lim)*(b2+b3);
-  value = pow(radius,2)
-    -pow((apar*cos(fTrackPhi)-bpar*cos(phiphot)),2)
-    -pow((apar*sin(fTrackPhi)-bpar*sin(phiphot)),2);
+  value = TMath::Power(radius,2)
+    -TMath::Power((apar*cos(fTrackPhi)-bpar*cos(phiphot)),2)
+    -TMath::Power((apar*sin(fTrackPhi)-bpar*sin(phiphot)),2);
   return value;
 }
 
@@ -294,7 +297,7 @@ Float_t AliRICHPatRec::PhotonCerenkovAngle()
 
   //  printf("Calling PhotonCerenkovAngle\n");
 
-  radius = sqrt(pow(fTrackLoc[0]-fXpad,2)+pow(fTrackLoc[1]-fYpad,2));
+  radius = sqrt(TMath::Power(fTrackLoc[0]-fXpad,2)+TMath::Power(fTrackLoc[1]-fYpad,2));
   fEmissPoint = fRw/2.;  //Start value of EmissionPoint
   
   while(niterEmiss<=niterEmissMax) {
@@ -415,11 +418,11 @@ void AliRICHPatRec::BackgroundEstimation()
     etaStepMax = etaMinBkg + (Float_t)(i+1)*stepEta;    
     etaStepAvg = 0.5*(etaStepMax + etaStepMin);
     /*
-    funBkg = tan(etaStepAvg)*pow((1.+pow(tan(etaStepAvg),2)),
+    funBkg = tan(etaStepAvg)*TMath::Power((1.+TMath::Power(tan(etaStepAvg),2)),
                                  5.52)-7.803 + 22.02*tan(etaStepAvg);
     */
     thetaSig = asin(nfreon/ngas*sin(etaStepAvg));
-    funBkg = tan(thetaSig)*(1.+pow(tan(thetaSig),2))*nfreon
+    funBkg = tan(thetaSig)*(1.+TMath::Power(tan(thetaSig),2))*nfreon
        /ngas*cos(etaStepAvg)/cos(thetaSig);
     areaBkg += stepEta*funBkg;
   }
@@ -435,12 +438,12 @@ void AliRICHPatRec::BackgroundEstimation()
     etaStepMax = etaMinBkg + (Float_t)(i+1)*stepEta;    
     etaStepAvg = 0.5*(etaStepMax + etaStepMin);
     /*
-    funBkg = tan(etaStepAvg)*pow((1.+pow(tan(etaStepAvg),2)),
+    funBkg = tan(etaStepAvg)*TMath::Power((1.+TMath::Power(tan(etaStepAvg),2)),
                                  5.52)-7.803 + 22.02*tan(etaStepAvg);
     */
 
     thetaSig = asin(nfreon/ngas*sin(etaStepAvg));
-    funBkg = tan(thetaSig)*(1.+pow(tan(thetaSig),2))*nfreon
+    funBkg = tan(thetaSig)*(1.+TMath::Power(tan(thetaSig),2))*nfreon
        /ngas*cos(etaStepAvg)/cos(thetaSig);
 
     areaBkg = stepEta*funBkg;
@@ -539,10 +542,10 @@ Int_t AliRICHPatRec::PhotonInBand()
   
     nfreon[times]   = a+b*energy[times];
 
-    nquartz[times] = sqrt(1+(f1/(pow(e1,2)-pow(energy[times],2)))+
-                         (f2/(pow(e2,2)-pow(energy[times],2))));
+    nquartz[times] = sqrt(1+(f1/(TMath::Power(e1,2)-TMath::Power(energy[times],2)))+
+                         (f2/(TMath::Power(e2,2)-TMath::Power(energy[times],2))));
 
-    beta[times]  = imp[times]/sqrt(pow(imp[times],2)+pow(mass[times],2));
+    beta[times]  = imp[times]/sqrt(TMath::Power(imp[times],2)+TMath::Power(mass[times],2));
    
     thetacer[times] =  CherenkovAngle( nfreon[times], beta[times]);
 
@@ -553,7 +556,7 @@ Int_t AliRICHPatRec::PhotonInBand()
 
   bandradius[0] -= 1.6;
   bandradius[1] += 1.6;
-  padradius = sqrt(pow(fXpad,2)+pow(fYpad,2));
+  padradius = sqrt(TMath::Power(fXpad,2)+TMath::Power(fYpad,2));
   //  printf(" rmin %f r %f rmax %f \n",bandradius[0],padradius,bandradius[1]);
 
   if(padradius>=bandradius[0] && padradius<=bandradius[1]) return 1;
@@ -647,8 +650,8 @@ Float_t AliRICHPatRec::DistanceFromMip(Float_t nfreon, Float_t nquartz,
 
   fPhotocatExitPhot =  radExitPhot + quarExitPhot + gapExitPhot; 
 
-  distanceValue = sqrt(pow(fPhotocatExitPhot(0),2)
-                           +pow(fPhotocatExitPhot(1),2)); 
+  distanceValue = sqrt(TMath::Power(fPhotocatExitPhot(0),2)
+                           +TMath::Power(fPhotocatExitPhot(1),2)); 
   return  distanceValue ;
 }
 
@@ -887,8 +890,8 @@ Float_t AliRICHPatRec::CherenkovRingDrawing(Float_t fixedthetacer)
        aveEnerg =  (energy[0]+energy[1])/2.;
        
        nfreonave  = a+b*aveEnerg;
-       nquartzave = sqrt(1+(f1/(pow(e1,2)-pow(aveEnerg,2)))+
-                        (f2/(pow(e2,2)-pow(aveEnerg,2))));
+       nquartzave = sqrt(1+(f1/(TMath::Power(e1,2)-TMath::Power(aveEnerg,2)))+
+                        (f2/(TMath::Power(e2,2)-TMath::Power(aveEnerg,2))));
        
        thetacer =  fixedthetacer;