]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONEventReconstructor.cxx
Comments updated
[u/mrichter/AliRoot.git] / MUON / AliMUONEventReconstructor.cxx
index d32bb059ef79c59b7a0de0c8cdf9f4518361bdeb..e00e585606c248768c131655af49a5346bf37345 100644 (file)
 
 /*
 $Log$
+Revision 1.16  2000/10/24 09:22:35  gosset
+Method AddHitsForRecFromRawClusters: real Z of raw cluster and not Z of chamber
+
+Revision 1.15  2000/10/12 15:17:30  gosset
+Sign of fSimpleBValue corrected: sign ox Bx and not Bz (thanks to Galina)
+
+Revision 1.14  2000/10/04 18:21:26  morsch
+Include stdlib.h
+
+Revision 1.13  2000/10/02 21:28:09  fca
+Removal of useless dependecies via forward declarations
+
+Revision 1.12  2000/10/02 16:58:29  egangler
+Cleaning of the code :
+-> coding conventions
+-> void Streamers
+-> some useless includes removed or replaced by "class" statement
+
+Revision 1.11  2000/09/22 09:16:33  hristov
+Casting needed on DEC
+
+Revision 1.10  2000/09/19 09:49:50  gosset
+AliMUONEventReconstructor package
+* track extrapolation independent from reco_muon.F, use of AliMagF...
+* possibility to use new magnetic field (automatic from generated root file)
+
 Revision 1.9  2000/07/20 12:45:27  gosset
 New "EventReconstructor..." structure,
        hopefully more adapted to tree/streamer.
@@ -84,9 +110,11 @@ Addition of files for track reconstruction in C++
 //__________________________________________________________________________
 
 #include <iostream.h>
+#include <stdlib.h>
 
 #include <TRandom.h>
 #include <TFile.h>
+#include <TTree.h>
 
 #include "AliMUONEventReconstructor.h"
 #include "AliMUON.h"
@@ -97,6 +125,7 @@ Addition of files for track reconstruction in C++
 #include "AliMUONTrack.h"
 #include "AliMUONChamber.h"
 #include "AliMUONTrackHit.h"
+#include "AliMagF.h"
 #include "AliRun.h"
 #include "TParticle.h"
 
@@ -146,11 +175,11 @@ AliMUONEventReconstructor::AliMUONEventReconstructor(void)
   fRecTrackHitsPtr = new TClonesArray("AliMUONTrack", 100);
   fNRecTrackHits = 0; // really needed or GetEntriesFast sufficient ????
 
-  // Sign of fSimpleBValue according to sign of value at (50,50,950).
+  // Sign of fSimpleBValue according to sign of Bx value at (50,50,950).
   Float_t b[3], x[3];
   x[0] = 50.; x[1] = 50.; x[2] = 950.;
   gAlice->Field()->Field(x, b);
-  fSimpleBValue = TMath::Sign(fSimpleBValue, b[2]);
+  fSimpleBValue = TMath::Sign(fSimpleBValue,(Double_t) b[0]);
   // See how to get fSimple(BValue, BLength, BPosition)
   // automatically calculated from the actual magnetic field ????
 
@@ -245,7 +274,7 @@ Double_t AliMUONEventReconstructor::GetImpactParamFromBendingMomentum(Double_t B
   // Returns impact parameter at vertex in bending plane (cm),
   // from the signed bending momentum "BendingMomentum" in bending plane (GeV/c),
   // using simple values for dipole magnetic field.
-  // The sign is the sign of the charge.
+  // The sign of "BendingMomentum" is the sign of the charge.
   return (-0.0003 * fSimpleBValue * fSimpleBLength * fSimpleBPosition /
          BendingMomentum);
 }
@@ -254,9 +283,9 @@ Double_t AliMUONEventReconstructor::GetImpactParamFromBendingMomentum(Double_t B
 Double_t AliMUONEventReconstructor::GetBendingMomentumFromImpactParam(Double_t ImpactParam)
 {
   // Returns signed bending momentum in bending plane (GeV/c),
+  // the sign being the sign of the charge for particles moving forward in Z,
   // from the impact parameter "ImpactParam" at vertex in bending plane (cm),
   // using simple values for dipole magnetic field.
-  // The sign is the sign of the charge.
   return (-0.0003 * fSimpleBValue * fSimpleBLength * fSimpleBPosition /
          ImpactParam);
 }
@@ -543,8 +572,8 @@ AliMUONHitForRec* AliMUONEventReconstructor::NewHitForRecFromGEANT(AliMUONHit* H
   // only if hit is efficient (keep track for checking ????)
   if (gRandom->Rndm() > fEfficiency) return NULL;
   // only if radius between RMin and RMax
-  bendCoor = Hit->fY;
-  nonBendCoor = Hit->fX;
+  bendCoor = Hit->Y();
+  nonBendCoor = Hit->X();
   radius = TMath::Sqrt((bendCoor * bendCoor) + (nonBendCoor * nonBendCoor));
   if ((radius < fRMin[chamber]) || (radius > fRMax[chamber])) return NULL;
   // new AliMUONHitForRec from GEANT hit and increment number of AliMUONHitForRec's
@@ -688,9 +717,8 @@ void AliMUONEventReconstructor::AddHitsForRecFromRawClusters(TTree* TR)
       //  original raw cluster
       hitForRec->SetChamberNumber(ch);
       hitForRec->SetHitNumber(iclus);
-      // Z coordinate of the chamber (cm)
-      // could (should) be more exact from chamber geometry ???? 
-      hitForRec->SetZ((&(pMUON->Chamber(ch)))->Z());
+      // Z coordinate of the raw cluster (cm)
+      hitForRec->SetZ(clus->fZ[0]);
       if (fPrintLevel >= 10) {
        cout << "chamber (0...): " << ch <<
          " raw cluster (0...): " << iclus << endl;
@@ -741,7 +769,7 @@ void AliMUONEventReconstructor::MakeSegmentsPerStation(Int_t Station)
   AliMUONSegment *segment;
   Bool_t last2st;
   Double_t bendingSlope, distBend, distNonBend, extBendCoor, extNonBendCoor,
-    impactParam, maxImpactParam;
+      impactParam = 0., maxImpactParam = 0.; // =0 to avoid compilation warnings.
   AliMUON *pMUON  = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
   if (fPrintLevel >= 1)
     cout << "enter MakeSegmentsPerStation (0...) " << Station << endl;
@@ -1011,7 +1039,8 @@ void AliMUONEventReconstructor::FollowTracks(void)
   AliMUONSegment *bestSegment, *extrapSegment, *segment;
   AliMUONTrack *track, *nextTrack;
   AliMUONTrackParam *trackParam1, trackParam[2], trackParamVertex;
-  Int_t ch, chInStation, chBestHit, iHit, iSegment, station, trackIndex;
+  // -1 to avoid compilation warnings
+  Int_t ch = -1, chInStation, chBestHit = -1, iHit, iSegment, station, trackIndex; 
   Double_t bestChi2, chi2, dZ1, dZ2, dZ3, maxSigma2Distance, mcsFactor;
   AliMUON *pMUON = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
   // local maxSigma2Distance, for easy increase in testing
@@ -1317,7 +1346,3 @@ void AliMUONEventReconstructor::EventDump(void)
   return;
 }
 
-void AliMUONEventReconstructor::Streamer(TBuffer &R__b)
-{
-    ;
-}