X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFReconstructioner.cxx;h=26253d288b609a0249f41de015af4f70e3b4befb;hb=0f4a73742ac6d527b4373abce1eac8673a3a8be2;hp=39f36c0d140ce2d806ab662714ade055d604e2ec;hpb=d3507e34f7d20d17e6d059fec9f6c4c0c4fc2bcb;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFReconstructioner.cxx b/TOF/AliTOFReconstructioner.cxx index 39f36c0d140..26253d288b6 100644 --- a/TOF/AliTOFReconstructioner.cxx +++ b/TOF/AliTOFReconstructioner.cxx @@ -53,6 +53,7 @@ #include #include "AliConst.h" +#include "AliTOFGeometry.h" #include "AliDetector.h" #include "AliHeader.h" #include "AliLoader.h" @@ -60,7 +61,6 @@ #include "AliRun.h" #include "AliRunLoader.h" #include "AliTOF.h" -#include "AliTOFConstants.h" #include "AliTOFHitMap.h" #include "AliTOFPad.h" #include "AliTOFRecHit.h" @@ -384,21 +384,21 @@ void AliTOFReconstructioner::Exec(const char* datafile, Option_t *option) cout << "number of primary tracked tracks in current event " << ntracks << endl; // number of primary tracked tracks // array declaration and initialization // TOF arrays - // Int_t mapPixels[AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates][AliTOFConstants::fgkNStripC][AliTOFConstants::fgkNpadZ*AliTOFConstants::fgkNpadX]; + // Int_t mapPixels[AliTOFGeometry::NSectors()*AliTOFGeometry::NPlates()][AliTOFGeometry::NStripC()][AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX()]; - Int_t *** mapPixels = new Int_t**[AliTOFConstants::fgkNSectors*AliTOFConstants::fgkNPlates]; - for (Int_t i=0; i 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX(); eff[nActivatedPads-1] = effZ; res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ; // ns @@ -980,7 +980,7 @@ void AliTOFReconstructioner::BorderEffect(Float_t z0, Float_t x0, Float_t geantT if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX - 1; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() - 1; eff[nActivatedPads-1] = effX * effZ; (resZ 0) { + if(ix < AliTOFGeometry::NpadX() && dX > 0) { nActivatedPads++; nPlace[nActivatedPads-1] = nPlace[0] + 1; eff[nActivatedPads-1] = effX; @@ -1031,7 +1031,7 @@ void AliTOFReconstructioner::BorderEffect(Float_t z0, Float_t x0, Float_t geantT if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX + 1; + nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() + 1; eff[nActivatedPads - 1] = effX * effZ; (resZ 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX(); eff[nActivatedPads-1] = effZ; res[nActivatedPads-1] = 0.001 * TMath::Sqrt(10400 + resZ * resZ); // 10400=30^2+20^2+40^2+50^2+50^2+50^2 ns timeWalk[nActivatedPads-1] = 0.001 * timeWalkZ; // ns @@ -1261,7 +1261,7 @@ void AliTOFReconstructioner::BorderEffect(Float_t z0, Float_t x0, Float_t geantT if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX - 1; + nPlace[nActivatedPads-1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() - 1; eff[nActivatedPads-1] = effX * effZ; (resZ 0) { + if(ix < AliTOFGeometry::NpadX() && dX > 0) { nActivatedPads++; nPlace[nActivatedPads-1] = nPlace[0] + 1; eff[nActivatedPads-1] = effX; @@ -1309,7 +1309,7 @@ void AliTOFReconstructioner::BorderEffect(Float_t z0, Float_t x0, Float_t geantT if(z < k && z > 0) { if( (iz == 1 && dZ > 0) || (iz == 2 && dZ < 0) ) { nActivatedPads++; - nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFConstants::fgkNpadX + 1; + nPlace[nActivatedPads - 1] = nPlace[0] + (3 - 2 * iz) * AliTOFGeometry::NpadX() + 1; eff[nActivatedPads - 1] = effX * effZ; (resZRndm())+1; //the sector number + isector=(Int_t) (AliTOFGeometry::NSectors()*gRandom->Rndm())+1; //the sector number // non-flat z-distribution of additional hits Float_t zNoise=fZnoise->GetRandom(); @@ -1995,15 +1995,15 @@ void AliTOFReconstructioner::AddNoiseFromOuter(Option_t *option, Int_t ***MapPix // to be checked the holes case if(isector>12 && isector<16) { // sectors 13,14,15 - RICH do { - iplate=(Int_t) (AliTOFConstants::fgkNPlates*gRandom->Rndm())+1; + iplate=(Int_t) (AliTOFGeometry::NPlates()*gRandom->Rndm())+1; } while (iplate==2 || iplate==3 || iplate==4); // } else if(isector>11 && isector<17) { // sectors 12,13,14,15,16 - PHOS } else if(isector>2 && isector<8) { // sectors 3,4,5,6,7 - PHOS do { - iplate=(Int_t) (AliTOFConstants::fgkNPlates*gRandom->Rndm())+1; + iplate=(Int_t) (AliTOFGeometry::NPlates()*gRandom->Rndm())+1; } while (iplate==3); } else { - iplate=(Int_t) (AliTOFConstants::fgkNPlates*gRandom->Rndm())+1; + iplate=(Int_t) (AliTOFGeometry::NPlates()*gRandom->Rndm())+1; } } else { iplate=0; @@ -2028,12 +2028,12 @@ void AliTOFReconstructioner::AddNoiseFromOuter(Option_t *option, Int_t ***MapPix istrip=(Int_t)((zNoise-zLen[iplate-1])/((zLen[iplate]-zLen[iplate-1])/zStrips[iplate-1])); //the strip number in the plate istrip++; - ipadAlongX = (Int_t)(AliTOFConstants::fgkNpadX*gRandom->Rndm())+1; - ipadAlongZ = (Int_t)(AliTOFConstants::fgkNpadZ*gRandom->Rndm())+1; - ipad=(Int_t)(ipadAlongZ-1)*AliTOFConstants::fgkNpadX+ipadAlongX; //the pad number + ipadAlongX = (Int_t)(AliTOFGeometry::NpadX()*gRandom->Rndm())+1; + ipadAlongZ = (Int_t)(AliTOFGeometry::NpadZ()*gRandom->Rndm())+1; + ipad=(Int_t)(ipadAlongZ-1)*AliTOFGeometry::NpadX()+ipadAlongX; //the pad number - Float_t xStrip=(ipadAlongX-1)*AliTOFConstants::fgkXPad+AliTOFConstants::fgkXPad*gRandom->Rndm()-0.5*AliTOFConstants::fgkNpadX*AliTOFConstants::fgkXPad;//x-coor.in the strip frame - Float_t zStrip=(ipadAlongZ-1)*AliTOFConstants::fgkZPad+AliTOFConstants::fgkZPad*gRandom->Rndm()-0.5*AliTOFConstants::fgkNpadZ*AliTOFConstants::fgkZPad;//z-coor.in the strip frame + Float_t xStrip=(ipadAlongX-1)*AliTOFGeometry::XPad()+AliTOFGeometry::XPad()*gRandom->Rndm()-0.5*AliTOFGeometry::NpadX()*AliTOFGeometry::XPad();//x-coor.in the strip frame + Float_t zStrip=(ipadAlongZ-1)*AliTOFGeometry::ZPad()+AliTOFGeometry::ZPad()*gRandom->Rndm()-0.5*AliTOFGeometry::NpadZ()*AliTOFGeometry::ZPad();//z-coor.in the strip frame Int_t nPlace[4]={0,0,0,0}; nPlace[0]=ipad; @@ -2062,12 +2062,12 @@ void AliTOFReconstructioner::AddNoiseFromOuter(Option_t *option, Int_t ***MapPix ipad = nPlace[indexOfPad]; - Int_t iMapValue=MapPixels[AliTOFConstants::fgkNSectors*(iplate-1)+isector-1][istrip-1][ipad-1]; + Int_t iMapValue=MapPixels[AliTOFGeometry::NSectors()*(iplate-1)+isector-1][istrip-1][ipad-1]; if(iMapValue==0) { ipixel++; if(indexOfPad) nPixEdge++; - MapPixels[AliTOFConstants::fgkNSectors*(iplate-1)+isector-1][istrip-1][ipad-1]=ipixel; + MapPixels[AliTOFGeometry::NSectors()*(iplate-1)+isector-1][istrip-1][ipad-1]=ipixel; pixelArray[ipixel-1].SetGeom(isector,iplate,istrip,ipad); pixelArray[ipixel-1].AddState(1); pixelArray[ipixel-1].SetRealTime(tofAfterSimul[indexOfPad]); @@ -2116,7 +2116,7 @@ void AliTOFReconstructioner::AddNoiseFromOuter(Option_t *option, Int_t ***MapPix Float_t occupancy; // numberOfPads for AliTOFV4 (Full coverage) // - to be upgraded checking the used TOF version - - Float_t numberOfPads=AliTOFConstants::fgkPadXSector*AliTOFConstants::fgkNSectors; + Float_t numberOfPads=AliTOFGeometry::NPadXSector()*AliTOFGeometry::NSectors(); occupancy=100.*ipixel/numberOfPads; // percentage of fired pads printf(" Overall TOF occupancy (percentage of fired pads after adding noise) = %f\n",occupancy); delete [] zLen; @@ -2607,7 +2607,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit coslam=gpt/gp; sinlam=gpz/gp; // helixRadius=100.*gpt/TMath::Abs(0.299792458*chargeField); - helixRadius=100.*gpt/TMath::Abs(AliTOFConstants::fgkSpeedOfLight*chargeField); + helixRadius=100.*gpt/TMath::Abs(AliTOFGeometry::SpeedOfLight()*chargeField); xHelixCenter=x-helixRadius*TMath::Cos(phi0); yHelixCenter=y-helixRadius*TMath::Sin(phi0); zHelixCenter=z; @@ -2616,7 +2616,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit // Solves the equation f(s)=r(s)-RTOFINNER=0 by the Newton's method: // snew=s-f/f' istep=0; - s=AliTOFConstants::fgkrmin-TMath::Sqrt(x*x+y*y);; + s=AliTOFGeometry::Rmin()-TMath::Sqrt(x*x+y*y);; do { istep++; xRespectToHelixCenter=helixRadius*TMath::Cos(phi0+s*helixFactor); @@ -2624,7 +2624,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit gx=xHelixCenter+xRespectToHelixCenter; gy=yHelixCenter+yRespectToHelixCenter; gr=TMath::Sqrt(gx*gx+gy*gy); - deltaRadius=gr-AliTOFConstants::fgkrmin; + deltaRadius=gr-AliTOFGeometry::Rmin(); xp=-helixFactor*yRespectToHelixCenter; yp= helixFactor*xRespectToHelixCenter; fp=(gx*xp+gy*yp)/gr; @@ -2679,7 +2679,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit if(cosAngl<0) printf(" cosAngl<0: gx=%f,gy=%f, gxLast=%f,gyLast=%f,gzLast=%f\n",gx,gy,gxLast,gyLast,gzLast); area /= cosAngl; - TestTracks=(Int_t) (2*area/(AliTOFConstants::fgkXPad * AliTOFConstants::fgkZPad)); + TestTracks=(Int_t) (2*area/(AliTOFGeometry::XPad() * AliTOFGeometry::ZPad())); if(TestTracks<12) TestTracks=12; @@ -2706,9 +2706,9 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit iwork2=npixel[1]; iwork3=npixel[2]; // iwork4=npixel[3]; - iwork4=(npixel[3]-1)*AliTOFConstants::fgkNpadX+npixel[4]; + iwork4=(npixel[3]-1)*AliTOFGeometry::NpadX()+npixel[4]; - Int_t ifirstindex=AliTOFConstants::fgkNSectors*(npixel[1]-1)+npixel[0]; + Int_t ifirstindex=AliTOFGeometry::NSectors()*(npixel[1]-1)+npixel[0]; iMapValue=mapPixels[ifirstindex-1][iwork3-1][iwork4-1]; if(iMapValue==0) { ipixel++; @@ -2763,7 +2763,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit gyLast=gy; gzLast=gz; - } while(rho0) { @@ -2772,7 +2772,7 @@ void AliTOFReconstructioner::Matching(AliTOFTrack* trackArray, AliTOFRecHit* hit istep=-3; // holes in TOF } } else { - if(TMath::Abs(gz)