]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONEventReconstructor.cxx
Config.C for EMCAL production.
[u/mrichter/AliRoot.git] / MUON / AliMUONEventReconstructor.cxx
index 831373aaadac65b9e058c2e092a072fb5ccdd31f..5bbc513ca9feedfabc6639f74ad6e11858d77605 100644 (file)
 
 /*
 $Log$
+Revision 1.27  2001/07/27 13:03:12  hristov
+Default Branch split level set to 99
+
+Revision 1.26  2001/05/03 08:11:31  hristov
+stdlib.h included to define exit()
+
+Revision 1.25  2001/04/25 14:50:42  gosset
+Corrections to violations of coding conventions
+
+Revision 1.24  2001/03/30 09:37:58  gosset
+Initialisations of pointers... for GEANT background events in the constructor
+
+Revision 1.23  2001/01/26 21:44:45  morsch
+Use access functions to AliMUONDigit, ...   member data.
+
+Revision 1.22  2001/01/26 20:00:53  hristov
+Major upgrade of AliRoot code
 Revision 1.20  2001/01/08 11:01:02  gosset
 Modifications used for addendum to Dimuon TDR (JP Cussonneau):
 *. MaxBendingMomentum to make both a segment and a track (default 500)
@@ -123,7 +140,7 @@ Revision 1.1.2.1  2000/06/07 14:44:53  gosset
 Addition of files for track reconstruction in C++
 */
 
-//__________________________________________________________________________
+////////////////////////////////////
 //
 // MUON event reconstructor in ALICE
 //
@@ -137,28 +154,25 @@ Addition of files for track reconstruction in C++
 // * MakeEventToBeReconstructed to build the array of hits to be reconstructed
 // * MakeSegments to build the segments
 // * MakeTracks to build the tracks
-//__________________________________________________________________________
+//
+////////////////////////////////////
 
-#include <iostream.h>
-#include <stdlib.h>
+#include <iostream.h> // for cout
+#include <stdlib.h> // for exit()
 
-#include <TRandom.h>
-#include <TFile.h>
 #include <TTree.h>
 
-#include "AliMUONEventReconstructor.h"
 #include "AliMUON.h"
+#include "AliMUONChamber.h"
+#include "AliMUONEventReconstructor.h"
 #include "AliMUONHitForRec.h"
-#include "AliMUONSegment.h"
-#include "AliMUONHit.h"
 #include "AliMUONRawCluster.h"
+#include "AliMUONRecoEvent.h"
+#include "AliMUONSegment.h"
 #include "AliMUONTrack.h"
-#include "AliMUONChamber.h"
 #include "AliMUONTrackHit.h"
 #include "AliMagF.h"
-#include "AliRun.h"
-#include "TParticle.h"
-#include "AliMUONRecoEvent.h"
+#include "AliRun.h" // for gAlice
 
 //************* Defaults parameters for reconstruction
 static const Double_t kDefaultMinBendingMomentum = 3.0;
@@ -223,6 +237,14 @@ AliMUONEventReconstructor::AliMUONEventReconstructor(void)
     cout << endl;
   }
   
+  // Initializions for GEANT background events
+  fBkgGeantFile = 0;
+  fBkgGeantTK = 0;
+  fBkgGeantParticles = 0;
+  fBkgGeantTH = 0;
+  fBkgGeantHits = 0;
+  fBkgGeantEventNumber = -1;
+  
   // Initialize to 0 pointers to RecoEvent, tree and tree file
   fRecoEvent = 0;
   fEventTree = 0;
@@ -318,7 +340,7 @@ void AliMUONEventReconstructor::SetReconstructionParametersToDefaults(void)
 }
 
 //__________________________________________________________________________
-Double_t AliMUONEventReconstructor::GetImpactParamFromBendingMomentum(Double_t BendingMomentum)
+Double_t AliMUONEventReconstructor::GetImpactParamFromBendingMomentum(Double_t BendingMomentum) const
 {
   // Returns impact parameter at vertex in bending plane (cm),
   // from the signed bending momentum "BendingMomentum" in bending plane (GeV/c),
@@ -329,7 +351,7 @@ Double_t AliMUONEventReconstructor::GetImpactParamFromBendingMomentum(Double_t B
 }
 
 //__________________________________________________________________________
-Double_t AliMUONEventReconstructor::GetBendingMomentumFromImpactParam(Double_t ImpactParam)
+Double_t AliMUONEventReconstructor::GetBendingMomentumFromImpactParam(Double_t ImpactParam) const
 {
   // Returns signed bending momentum in bending plane (GeV/c),
   // the sign being the sign of the charge for particles moving forward in Z,
@@ -615,7 +637,7 @@ AliMUONHitForRec* AliMUONEventReconstructor::NewHitForRecFromGEANT(AliMUONHit* H
   // like in Fortran TRACKF_STAT.
   AliMUONHitForRec* hitForRec;
   Double_t bendCoor, nonBendCoor, radius;
-  Int_t chamber = Hit->fChamber - 1; // chamber(0...)
+  Int_t chamber = Hit->Chamber() - 1; // chamber(0...)
   // only in tracking chambers (fChamber starts at 1)
   if (chamber >= kMaxMuonTrackingChambers) return NULL;
   // only if hit is efficient (keep track for checking ????)
@@ -739,11 +761,20 @@ void AliMUONEventReconstructor::AddHitsForRecFromRawClusters(TTree* TR)
   // on the radius between RMin and RMax.
   AliMUONHitForRec *hitForRec;
   AliMUONRawCluster *clus;
-  Int_t iclus, nclus;
+  Int_t iclus, nclus, nTRentries;
   TClonesArray *rawclusters;
   if (fPrintLevel >= 1) cout << "enter AddHitsForRecFromRawClusters" << endl;
   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"
+        << endl;
+    cout << "nTRentries = " << nTRentries << " not equal to 1" << endl;
+    exit(0);
+  }
+  TR->GetEvent(0); // only one entry
   // Loop over tracking chambers
   for (Int_t ch = 0; ch < kMaxMuonTrackingChambers; ch++) {
     // number of HitsForRec to 0 for the chamber
@@ -752,8 +783,8 @@ void AliMUONEventReconstructor::AddHitsForRecFromRawClusters(TTree* TR)
     if (ch == 0) fIndexOfFirstHitForRecPerChamber[ch] = 0;
     else fIndexOfFirstHitForRecPerChamber[ch] = fNHitsForRec;
     rawclusters = pMUON->RawClustAddress(ch);
-    pMUON->ResetRawClusters();
-    TR->GetEvent((Int_t) (TR->GetEntries()) - 1); // to be checked ????
+//     pMUON->ResetRawClusters();
+//     TR->GetEvent((Int_t) (TR->GetEntries()) - 1); // to be checked ????
     nclus = (Int_t) (rawclusters->GetEntries());
     // Loop over (cathode correlated) raw clusters
     for (iclus = 0; iclus < nclus; iclus++) {
@@ -1490,7 +1521,7 @@ void AliMUONEventReconstructor::FillEvent()
    if (fRecoEvent->MakeDumpTracks(fRecTracksPtr)) {
       if (fPrintLevel > 1) fRecoEvent->EventInfo();
       TBranch *branch = fEventTree->GetBranch("Event");
-      if (!branch) branch = fEventTree->Branch("Event", "AliMUONRecoEvent", &fRecoEvent, 64000,1);
+      if (!branch) branch = fEventTree->Branch("Event", "AliMUONRecoEvent", &fRecoEvent, 64000);
       branch->SetAutoDelete();
       fTreeFile->cd();
       fEventTree->Fill();