]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONRecoDisplay.cxx
Bug on error calculations (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONRecoDisplay.cxx
index 610372888b46c6622f674867c46d0b0c74f49750..41a4ff94436d37245a171d27576d1d9651a55b95 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.7  2001/05/16 14:57:17  alibrary
-New files for folders and Stack
-
-Revision 1.6  2001/01/26 21:50:43  morsch
-Use access functions to AliMUONHit member data.
-
-Revision 1.5  2001/01/26 20:00:53  hristov
-Major upgrade of AliRoot code
-
-Revision 1.4  2000/12/21 22:14:38  morsch
-Clean-up of coding rule violations.
-
-Revision 1.3  2000/12/21 17:51:54  morsch
-RN3 violations corrected
-
-Revision 1.2  2000/11/23 10:09:39  gosset
-Bug correction in AliMUONRecoDisplay.
-Copyright, $Log$
-Copyright, Revision 1.7  2001/05/16 14:57:17  alibrary
-Copyright, New files for folders and Stack
-Copyright,
-Copyright, Revision 1.6  2001/01/26 21:50:43  morsch
-Copyright, Use access functions to AliMUONHit member data.
-Copyright,
-Copyright, Revision 1.5  2001/01/26 20:00:53  hristov
-Copyright, Major upgrade of AliRoot code
-Copyright,
-Copyright, Revision 1.4  2000/12/21 22:14:38  morsch
-Copyright, Clean-up of coding rule violations.
-Copyright,
-Copyright, Revision 1.3  2000/12/21 17:51:54  morsch
-Copyright, RN3 violations corrected
-Copyright,, $Id$, comments at the right place for automatic documentation,
-in AliMUONRecoEvent and AliMUONRecoDisplay
-
-*/
+/* $Id$ */
 
 //Authors: Mihaela Gheata, Andrei Gheata 09/10/00
 //////////////////////////////////////////////////////////////////////
@@ -81,23 +44,40 @@ in AliMUONRecoEvent and AliMUONRecoDisplay
 //                                                                  //
 //////////////////////////////////////////////////////////////////////
 
-#include <Riostream.h>
-#include <AliRun.h>
-#include <TClonesArray.h>
-#include "AliMUONRecoEvent.h"
-#include "AliMUONRecoDisplay.h"
-#include "AliHeader.h"
 #include <TROOT.h>
-#include <AliPoints.h>
+#include <TApplication.h>
+#include <TFile.h>
+#include <TPolyLine3D.h>
+#include <TParticle.h>
+#include <TTree.h>
+#include <TH1.h>
+#include <TH2.h>
+#include <TCanvas.h>
+#include <TProfile.h>
+#include <TFolder.h>
+#include <TClonesArray.h>
 #include <TSlider.h>
-#include <TView.h>
 #include <TGeometry.h>
+#include <TView.h>
+#include <Riostream.h>
+
+#include "AliRun.h"
+#include "AliDetector.h"
+#include "AliConfig.h"
+#include "AliHeader.h"
+#include "AliPoints.h"
+#include "AliMC.h"
+
+#include "AliMUONRecoDisplay.h"
+#include "AliMUONRecoEvent.h"
+#include "AliMUONRecoTrack.h"
+#include "AliMUONHit.h"
 
 ClassImp(AliMUONRecoDisplay)
 
 //-------------------------------------------------------------------
 AliMUONRecoDisplay::AliMUONRecoDisplay(Int_t nevent)
-                  :AliDisplay(750)
+  AliDisplay(750)
 {
 //************ Constructor of the reco. event display**********
    // get reconstructed event from file
@@ -139,6 +119,15 @@ AliMUONRecoDisplay::AliMUONRecoDisplay(Int_t nevent)
    MapEvent(nevent);
 }
 
+//-------------------------------------------------------------------
+AliMUONRecoDisplay::AliMUONRecoDisplay(const AliMUONRecoDisplay& rhs)
+  : AliDisplay(rhs)
+{
+// Protected copy constructor
+
+  Fatal("AliMUONRecoDisplay", "Not implemented.");
+}
+
 //-------------------------------------------------------------------
 AliMUONRecoDisplay::~AliMUONRecoDisplay()
 {
@@ -153,6 +142,20 @@ AliMUONRecoDisplay::~AliMUONRecoDisplay()
    }
    delete fEvGen;
 }
+
+//-------------------------------------------------------------------
+AliMUONRecoDisplay&  
+AliMUONRecoDisplay::operator=(const AliMUONRecoDisplay& rhs)
+{
+// Protected assignement operator
+
+  if (this == &rhs) return *this;
+
+  Fatal("operator=", "Not implemented.");
+    
+  return *this;  
+}    
+          
 //-------------------------------------------------------------------
 Bool_t AliMUONRecoDisplay::Event(Int_t nevent)
 {
@@ -204,7 +207,7 @@ void AliMUONRecoDisplay::MapEvent(Int_t nevent)
       gApplication->Terminate(0);
    }
    // get the number of generated tracks
-   Int_t ntracks = (Int_t)gAlice->TreeH()->GetEntries();
+   Int_t ntracks = (Int_t)pMUON->TreeH()->GetEntries();
    // Fill the fEvGen object
    AliMUONRecoTrack *gtrack = 0;
    AliMUONHit *hit = 0;
@@ -214,7 +217,7 @@ void AliMUONRecoDisplay::MapEvent(Int_t nevent)
    for (Int_t track=0; track<ntracks; track++) {
       hit = (AliMUONHit *) pMUON->FirstHit(track);
       if (!hit) continue;
-      particle = gAlice->Particle(hit->Track());
+      particle = gAlice->GetMCApp()->Particle(hit->Track());
       if (IsReconstructible(track) && TMath::Abs(particle->GetPdgCode())==13) {
          gtrack = fEvGen->AddEmptyTrack();
         gtrack->SetSign(TMath::Sign((Int_t)1, -particle->GetPdgCode()));
@@ -441,7 +444,29 @@ void AliMUONRecoDisplay::ShowNextEvent(Int_t delta)
       if (newEvent<0 || newEvent>(gAlice->TreeE()->GetEntries() - 1)) return;
       Int_t nparticles = gAlice->GetEvent(newEvent);
       cout << "Event : " << newEvent << " with " << nparticles << " particles\n";
-      if (!gAlice->TreeH()) return;
+
+/******************************************************************/
+      AliConfig* config = AliConfig::Instance();
+      TFolder* topfold = (TFolder*)config->GetTopFolder();
+      if (topfold == 0x0)
+       {
+         Error("Exec","Can not get Alice top folder");
+         return; 
+       }
+      TString fmdfoldname(config->GetDataFolderName()+"/"+"MUON");
+      TFolder* fmdfold = (TFolder*)topfold->FindObject(fmdfoldname);
+      if (fmdfold == 0x0)
+       {
+         Error("Exec","Can not get MUON folder");
+         return; 
+       }
+      TTree* treeH = dynamic_cast<TTree*>(fmdfold->FindObject("TreeH"));
+      if (treeH == 0x0)
+       {
+         Error("Exec","Can not get TreeH");
+         return;
+       }
+/******************************************************************/     
       MapEvent(newEvent);
       fHighlited = -1;
    }
@@ -451,7 +476,7 @@ void AliMUONRecoDisplay::ShowNextEvent(Int_t delta)
    if (gROOT->GetListOfCanvases()->FindObject("xy")) XYPlot();
 }
 //-------------------------------------------------------------------
-Bool_t AliMUONRecoDisplay::IsReconstructible(Int_t track)
+Bool_t AliMUONRecoDisplay::IsReconstructible(Int_t track) const
 {
 // true if at least three hits in first 2 stations, 3 in last 2 stations
 // and one in station 3
@@ -800,5 +825,3 @@ void AliMUONRecoDisplay::PolyLineInfo(TClonesArray *line3Dlist)
       }
    }
 }
-
-