]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONEventReconstructor.cxx
Reconstruction for new coordenate system of alice. fSegmentMaxDistBending>0
[u/mrichter/AliRoot.git] / MUON / AliMUONEventReconstructor.cxx
index 7b213e8e0f1043d33b031a72e978a46d9351bfc3..f0a365fdb77eb4bdef3daa6c9378115ceb96901a 100644 (file)
@@ -197,16 +197,16 @@ void AliMUONEventReconstructor::SetReconstructionParametersToDefaults(void)
   // Maximum distance in bending plane:
   // values from TRACKF_STAT, corresponding to (J psi 20cm),
   // scaled to the real distance between chambers in a station
-  fSegmentMaxDistBending[0] = 1.5 *
-    ((&(pMUON->Chamber(1)))->Z() - (&(pMUON->Chamber(0)))->Z()) / 20.0;
-  fSegmentMaxDistBending[1] = 1.5 *
-    ((&(pMUON->Chamber(3)))->Z() - (&(pMUON->Chamber(2)))->Z()) / 20.0;
-  fSegmentMaxDistBending[2] = 3.0 *
-    ((&(pMUON->Chamber(5)))->Z() - (&(pMUON->Chamber(4)))->Z()) / 20.0;
-  fSegmentMaxDistBending[3] = 6.0 *
-    ((&(pMUON->Chamber(7)))->Z() - (&(pMUON->Chamber(6)))->Z()) / 20.0;
-  fSegmentMaxDistBending[4] = 6.0 *
-    ((&(pMUON->Chamber(9)))->Z() - (&(pMUON->Chamber(8)))->Z()) / 20.0;
+  fSegmentMaxDistBending[0] = TMath::Abs( 1.5 *
+    ((&(pMUON->Chamber(1)))->Z() - (&(pMUON->Chamber(0)))->Z()) / 20.0);
+  fSegmentMaxDistBending[1] =  TMath::Abs( 1.5 *
+    ((&(pMUON->Chamber(3)))->Z() - (&(pMUON->Chamber(2)))->Z()) / 20.0);
+  fSegmentMaxDistBending[2] =  TMath::Abs( 3.0 *
+    ((&(pMUON->Chamber(5)))->Z() - (&(pMUON->Chamber(4)))->Z()) / 20.0);
+  fSegmentMaxDistBending[3] =  TMath::Abs( 6.0 *
+    ((&(pMUON->Chamber(7)))->Z() - (&(pMUON->Chamber(6)))->Z()) / 20.0);
+  fSegmentMaxDistBending[4] =  TMath::Abs( 6.0 *
+    ((&(pMUON->Chamber(9)))->Z() - (&(pMUON->Chamber(8)))->Z()) / 20.0);
   
   fBendingResolution = kDefaultBendingResolution;
   fNonBendingResolution = kDefaultNonBendingResolution;
@@ -489,6 +489,7 @@ void AliMUONEventReconstructor::AddHitsForRecFromGEANT(TTree *TH)
     cout << "enter AddHitsForRecFromGEANT with TH: " << TH << endl;
   if (TH == NULL) return;
   AliMUON *pMUON  = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
+  AliMUONData * muondata = pMUON->GetMUONData();
   // Security on MUON ????
   // See whether it could be the same for signal and background ????
   // Loop over tracks in tree
@@ -497,23 +498,26 @@ void AliMUONEventReconstructor::AddHitsForRecFromGEANT(TTree *TH)
     cout << "ntracks: " << ntracks << endl;
   fMuons = 0; //AZ
   for (Int_t track = 0; track < ntracks; track++) {
-    gAlice->ResetHits();
+    muondata->ResetHits();
     TH->GetEvent(track);
     // Loop over hits
     Int_t hit = 0;
     hitBits = 0; // AZ
     chamBits = 0; // AZ
     Int_t itrack = track; //AZ
-    for (AliMUONHit* mHit = (AliMUONHit*) pMUON->FirstHit(-1); 
-        mHit;
-        mHit = (AliMUONHit*) pMUON->NextHit(), hit++) {
-      Int_t ipart = TMath::Abs ((Int_t) mHit->Particle()); //AZ
-      //itrack = mHit->Track(); //AZ
-      //AZNewHitForRecFromGEANT(mHit,track, hit, 1);
-      if (NewHitForRecFromGEANT(mHit,track, hit, 1) && ipart == 13
-      //if (NewHitForRecFromGEANT(mHit,itrack-1, hit, 1) && ipart == 13 
-          && itrack <= 2) chamBits |= BIT(mHit->Chamber()-1); //AZ - set bit
-    } // end of hit loop
+
+    Int_t ihit, nhits=0;
+      nhits = (Int_t) muondata->Hits()->GetEntriesFast();
+      AliMUONHit* mHit=0x0;
+
+      for(ihit=0; ihit<nhits; ihit++) {
+       mHit = static_cast<AliMUONHit*>(muondata->Hits()->At(ihit));
+       Int_t ipart = TMath::Abs ((Int_t) mHit->Particle()); //AZ
+       if (NewHitForRecFromGEANT(mHit,track, hit, 1) && ipart == 13
+           //if (NewHitForRecFromGEANT(mHit,itrack-1, hit, 1) && ipart == 13 
+           && itrack <= 2 && !BIT(mHit->Chamber()-1)  ) chamBits |= BIT(mHit->Chamber()-1); //AZ - set bit
+      }
+
     if (chamBits&3 && chamBits>>2&3 && chamBits>>4&3 && chamBits>>6&3 && 
         chamBits>>8&3 && ((chamBits>>6&3)==3 || (chamBits>>8&3)==3)) 
       fMuons += 1; //AZ
@@ -715,9 +719,6 @@ void AliMUONEventReconstructor::AddHitsForRecFromRawClusters(TTree* TR)
   // Loading MUON subsystem
   AliMUON * pMUON = (AliMUON *) gAlice->GetDetector("MUON");
 
-  //  AliMUON *pMUON  = (AliMUON*) gAlice->GetModule("MUON"); // necessary ????
-  // Security on MUON ????
-  //pMUON->ResetRawClusters();
   nTRentries = Int_t(TR->GetEntries());
   if (nTRentries != 1) {
     cout << "Error in AliMUONEventReconstructor::AddHitsForRecFromRawClusters"
@@ -733,7 +734,7 @@ void AliMUONEventReconstructor::AddHitsForRecFromRawClusters(TTree* TR)
     // index of first HitForRec for the chamber
     if (ch == 0) fIndexOfFirstHitForRecPerChamber[ch] = 0;
     else fIndexOfFirstHitForRecPerChamber[ch] = fNHitsForRec;
-    rawclusters = pMUON->RawClustAddress(ch);
+    rawclusters = pMUON->GetMUONData()->RawClusters(ch);
 //     pMUON->ResetRawClusters();
 //     TR->GetEvent((Int_t) (TR->GetEntries()) - 1); // to be checked ????
     nclus = (Int_t) (rawclusters->GetEntries());