]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONDataInterface.h
Add a protection to avoid array boundary error in IntSpecGeant
[u/mrichter/AliRoot.git] / MUON / AliMUONDataInterface.h
index 3a1a074bcdfaff987596d8944afb6a560e7d3888..936a63e1cde028ca1cdb3fea5f7000ae8a955c62 100644 (file)
@@ -8,33 +8,63 @@
 //
 /// \ingroup evaluation
 /// \class AliMUONDataInterface
-/// \brief An easy to use interface to data in the MUON module
+/// \brief An easy to use interface to MUON data
 
 // Author: Artur Szostak
 //  email: artur@alice.phy.uct.ac.za
+//
+// Updated to MUON module w/o MUONData by Laurent Aphecetche, Subatech
+//
 
 #include <TObject.h>
 #include <TString.h>
 
-#include "AliMUONRecData.h"
-#include "AliMUONSimData.h"
-
-class TParticle;
-
-class AliRunLoader;
 class AliLoader;
-class AliMUONRawCluster;
-class AliMUONLocalTrigger;
-class AliMUONHit;
+class AliMUONVClusterStore;
+class AliMUONVDigitStore;
+class AliMUONVStore;
+class AliMUONVTrackStore;
+class AliMUONVTriggerStore;
+class AliMUONVTriggerTrackStore;
+
+// >>LA should not needed (once we remove deprecated methods)
+class AliMUONHit; 
 class AliMUONDigit;
+class AliMUONLocalTrigger;
+class AliMUONGlobalTrigger;
+class AliMUONRawCluster;
 class AliMUONTrack;
+class TParticle;
+// <<LA
 
 class AliMUONDataInterface : public TObject
 {
  public:
   
-  AliMUONDataInterface();
-  ~AliMUONDataInterface();
+  AliMUONDataInterface(const char* filename="galice.root");
+  virtual ~AliMUONDataInterface();
+  
+  Bool_t IsValid() const;
+
+  void Open(const char* filename);
+
+  Int_t NumberOfEvents() const;
+
+  AliMUONVDigitStore* DigitStore(Int_t event);  
+  AliMUONVClusterStore* ClusterStore(Int_t event);
+  AliMUONVTrackStore* TrackStore(Int_t event);
+  AliMUONVTriggerStore* TriggerStore(Int_t event, const char* treeLetter="R");
+  AliMUONVTriggerTrackStore* TriggerTrackStore(Int_t event);
+
+  /// Dump the clusters for a given event, sorted if so required
+  void DumpClusters(Int_t event, Bool_t sorted=kTRUE)  { return DumpRecPoints(event,sorted); }
+  void DumpRecPoints(Int_t event, Bool_t sorted=kTRUE);
+  void DumpDigits(Int_t event, Bool_t sorted=kTRUE);
+  void DumpTracks(Int_t event, Bool_t sorted=kFALSE);  
+  void DumpTrigger(Int_t event, const char* treeLetter="R");  
+  void DumpTriggerTracks(Int_t event, Bool_t sorted=kFALSE);
+  
+  // all the methods below are deprecated.
   
   // Sets all internal pointers to NULL without releasing the current runloader.
   void Reset();
@@ -65,8 +95,6 @@ class AliMUONDataInterface : public TObject
   Bool_t SetFile(TString filename = "galice.root", TString foldername = "MUONFolder");
   Bool_t GetEvent(Int_t event = 0);
   
-  Int_t NumberOfEvents();
-  
   Int_t NumberOfParticles();
   TParticle* Particle(Int_t particle);
   
@@ -94,66 +122,51 @@ class AliMUONDataInterface : public TObject
   AliMUONTrack* RecTrack(Int_t rectrack);
   
   /// Returns the file name from which we are fetching data
-  TString CurrentFile() const    { return fFilename;    };
+  TString CurrentFile() const { return ""; }
   
   /// Returns the name of the currently selected folder.
-  TString CurrentFolder() const   { return fFoldername;  };
+  TString CurrentFolder() const { return ""; }
   
   /// Returns the number of the currently selected event.
-  Int_t   CurrentEvent() const    { return fEventnumber; };
+  Int_t   CurrentEvent() const { return 0; }
   
   /// Returns the currently selected track.
-  Int_t   CurrentTrack() const    { return fTrack;       };
+  Int_t   CurrentTrack() const { return 0; }
   
   /// Returns the currently selected cathode in TreeS.
-  Int_t   CurrentSCathode() const { return fSCathode;    };
+  Int_t   CurrentSCathode() const { return 0; }
   
   /// Returns the currently selected cathode in TreeD.
-  Int_t   CurrentDCathode() const { return fCathode;     };
+  Int_t   CurrentDCathode() const { return 0; }
   
  private:
+    
+  void DumpSorted(const AliMUONVStore& store) const;
+
+  Int_t LoadEvent(Int_t event);
+
+  void NtupleTrigger(const char* treeLetter);
+  
   /// Not implemented
   AliMUONDataInterface(const AliMUONDataInterface& rhs);
   /// Not implemented
   AliMUONDataInterface& operator=(const AliMUONDataInterface& rhs);
+
+private:
+  
+  AliLoader* fLoader; //!< Tree accessor
+  AliMUONVDigitStore* fDigitStore; //!< current digit store (owner)
+  AliMUONVTriggerStore* fTriggerStore; //!< current trigger store (owner)
+  AliMUONVClusterStore* fClusterStore; //!< current cluster store (owner)
+  AliMUONVTrackStore* fTrackStore; //!< current track store (owner)
+  AliMUONVTriggerTrackStore* fTriggerTrackStore; //!< current trigger track store (owner)
+  Int_t fCurrentEvent; //!< Current event we've read in
+  Bool_t fIsValid; //!< whether we were initialized properly or not
+  
+  static Int_t fgInstanceCounter; //!< To build unique folder name for each instance
   
-  Bool_t FetchMuonLoader(TString filename);
-  Bool_t LoadLoaders(TString filename);
-  Bool_t FetchLoaders(TString filename);
-  Bool_t FetchEvent(Int_t event);
-  Bool_t FetchTreeK();
-  Bool_t FetchTreeH();
-  Bool_t FetchTreeS();
-  Bool_t FetchTreeD();
-  Bool_t FetchTreeR();
-  Bool_t FetchTreeT();
-  
-  Bool_t fCreatedRunLoader;   //!< If this object created the fRunloader then this flag is set.        
-  Bool_t fCreatedRunLoaderSim;//!< If this object created the fRunloader then this flag is set.        
-  
-  Bool_t fHitAddressSet;     //!< Flag specifying if the TTree address for the hit tree was set.
-  Bool_t fSDigitAddressSet;  //!< Flag specifying if the TTree address for the s-digit tree was set.
-  Bool_t fDigitAddressSet;   //!< Flag specifying if the TTree address for the digit tree was set.
-  Bool_t fClusterAddressSet; //!< Flag specifying if the TTree address for the cluster tree was set.
-  Bool_t fTriggerAddressSet; //!< Flag specifying if the TTree address for the trigger tree was set.
-  Bool_t fRecTracksAddressSet; //!< Flag specifying if the TTree address for the rec tracks tree was set.
-  
-  AliRunLoader* fRunloader;  //!< Pointer to the runloader object used.
-  AliRunLoader* fRunloaderSim; //!< Pointer to the runloader object used.
-  AliLoader* fRecLoader;    //!< Pointer to the muon loader object used.
-  AliLoader* fSimLoader;    //!< Pointer to the muon loader object used.
-  AliMUONRecData fRecData;  //!< Pointer to the muon raw data interface.
-  AliMUONSimData fSimData;  //!< Pointer to the muon raw data interface.
-  TString fFilename;         //!< The file name from which we are fetching data.
-  TString fFoldername;       //!< The folder name from which we are fetching data.
-  TString fFoldernameSim;    //!< The folder name from which we are fetching data.
-  Int_t fEventnumber;        //!< The currently selected event.
-  Int_t fTrack;              //!< The currently selected track.
-  Int_t fSCathode;           //!< The currently selected cathode in TreeS.
-  Int_t fCathode;            //!< The currently selected cathode in TreeD.
-  
-  ClassDef(AliMUONDataInterface, 0)  // A easy to use interface to data in the MUON module.
-    };
+  ClassDef(AliMUONDataInterface, 0)  // An easy to use interface to MUON data
+};
     
 
 #endif // ALI_MUON_DATA_INTERFACE_H