]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Implementation of the structure for rawdata reader (Christian)
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Aug 2004 07:55:23 +0000 (07:55 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Aug 2004 07:55:23 +0000 (07:55 +0000)
MUON/AliMUONClusterReconstructor.cxx
MUON/AliMUONClusterReconstructor.h
MUON/AliMUONRawStream.cxx [new file with mode: 0644]
MUON/AliMUONRawStream.h [new file with mode: 0644]
MUON/AliMUONReconstructor.cxx
MUON/AliMUONReconstructor.h
MUON/MUONLinkDef.h
MUON/libMUON.pkg

index 4bbc81e57baccfe11727451c0b4b10c715a649f2..9395478341cf92c10776717bb1093253ba4e6a63 100644 (file)
 
 ////////////////////////////////////
 //
-// MUON event reconstructor in ALICE
-//
-// This class contains as data:
-// * the parameters for the event reconstruction
-// * a pointer to the array of hits to be reconstructed (the event)
-// * a pointer to the array of segments made with these hits inside each station
-// * a pointer to the array of reconstructed tracks
-//
-// It contains as methods, among others:
-// * MakeEventToBeReconstructed to build the array of hits to be reconstructed
-// * MakeSegments to build the segments
-// * MakeTracks to build the tracks
+// MUON cluster reconstructor for MUON
 //
+// Should implement a virtual class ClusterFinder to chose between VS and AZ method
 ////////////////////////////////////
 
 #include "AliMUONClusterReconstructor.h"
+#include "AliRun.h" // for gAlice
+#include "AliRunLoader.h"
+#include "AliLoader.h"
+
 #include "AliMUON.h"
 #include "AliMUONDigit.h"
 #include "AliMUONConstants.h"
@@ -40,9 +34,8 @@
 #include "AliMUONClusterFinderVS.h"
 #include "AliMUONClusterInput.h"
 #include "AliMUONRawCluster.h"
-#include "AliRun.h" // for gAlice
-#include "AliRunLoader.h"
-#include "AliLoader.h"
+#include "AliRawReader.h" // for raw data
+
 
 const Int_t AliMUONClusterReconstructor::fgkDefaultPrintLevel = 0;
 
@@ -205,3 +198,12 @@ void AliMUONClusterReconstructor::Digits2Clusters()
     delete dig1;
     delete dig2;
 }
+
+//____________________________________________________________________
+void AliMUONClusterReconstructor::Digits2Clusters(AliRawReader* /*rawReader*/)
+{
+
+//  Perform cluster finding form raw data
+
+   Fatal("Digits2Clusters","clusterization not implemented for raw data input");
+}
index 7f29adc591a7813235c317d80e2f8dccef17b9be..08818a3d3a390e3a5bee9cb4d57d540f78f85e64 100644 (file)
@@ -18,7 +18,7 @@ class AliMUONChamber;
 class AliMUONRawCluster;
 class AliMUONClusterFinderVS;
 class AliMUONData;
-
+class AliRawReader;
 
 class AliMUONClusterReconstructor : public TObject 
 {
@@ -31,6 +31,7 @@ class AliMUONClusterReconstructor : public TObject
     
   // Cluster Finding & Trigger
   virtual void   Digits2Clusters();
+  virtual void   Digits2Clusters(AliRawReader* rawReader);
 
 
   // void EventDump(void);  // dump reconstructed event
diff --git a/MUON/AliMUONRawStream.cxx b/MUON/AliMUONRawStream.cxx
new file mode 100644 (file)
index 0000000..3bc7e81
--- /dev/null
@@ -0,0 +1,81 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+///////////////////////////////////////////////////////////////////////////////
+///
+/// This class provides access to MUON digits in raw data.
+///
+/// It loops over all MUON digits in the raw data given by the AliRawReader.
+/// The Next method goes to the next digit. If there are no digits left
+/// it returns kFALSE.
+/// 
+/// First version implement only the structure for the moment
+///
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliMUONRawStream.h"
+
+#include "AliRawReader.h"
+
+
+ClassImp(AliMUONRawStream)
+
+
+AliMUONRawStream::AliMUONRawStream(AliRawReader* rawReader)
+{
+// create an object to read MUON raw digits
+
+  fRawReader = rawReader;
+  fRawReader->Select(0);
+  fData = new UShort_t[fgkDataMax];
+  fDataSize = fPosition = 0;
+  fCount = 0;
+
+}
+
+AliMUONRawStream::AliMUONRawStream(const AliMUONRawStream& stream) :
+  TObject(stream)
+{
+  Fatal("AliMUONRawStream", "copy constructor not implemented");
+}
+
+AliMUONRawStream& AliMUONRawStream::operator = (const AliMUONRawStream& 
+                                             /* stream */)
+{
+  Fatal("operator =", "assignment operator not implemented");
+  return *this;
+}
+
+AliMUONRawStream::~AliMUONRawStream()
+{
+// clean up
+
+  delete[] fData;
+}
+
+
+Bool_t AliMUONRawStream::Next()
+{
+// read the next raw digit
+// returns kFALSE if there is no digit left
+
+  Fatal("Next","method not implemented for raw data input");
+
+
+  return kFALSE;
+}
+
+
diff --git a/MUON/AliMUONRawStream.h b/MUON/AliMUONRawStream.h
new file mode 100644 (file)
index 0000000..2fcaccc
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef ALIMUONRAWSTREAM_H
+#define ALITMUONAWSTREAM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+///////////////////////////////////////////////////////////////////////////////
+///
+/// This class provides access to TPC digits in raw data.
+///
+///////////////////////////////////////////////////////////////////////////////
+
+#include <TObject.h>
+
+class AliRawReader;
+
+
+class AliMUONRawStream: public TObject {
+  public :
+    AliMUONRawStream(AliRawReader* rawReader);
+    AliMUONRawStream(const AliMUONRawStream& stream);
+    AliMUONRawStream& operator = (const AliMUONRawStream& stream);
+    virtual ~AliMUONRawStream();
+
+    virtual Bool_t   Next();
+
+
+  protected :
+
+    AliRawReader*    fRawReader;    // object for reading the raw data
+
+    static const Int_t fgkDataMax = 10000000; // size of array for uncompressed raw data
+    UShort_t*        fData;         // uncompressed raw data
+    Int_t            fDataSize;     // actual size of the uncompressed raw data
+    Int_t            fPosition;     // current position in fData
+    Int_t            fCount;        // counter of words to be read for current trailer
+
+
+    ClassDef(AliMUONRawStream, 0)    // base class for reading MUON raw digits
+};
+
+#endif
index c467ebf1cebec2973ce48f96460c4c78342c785c..88ff13fc703b9aeeb87d7755010fcf8d699410f9 100644 (file)
@@ -27,6 +27,7 @@
 #include "AliHeader.h"
 #include "AliGenEventHeader.h"
 #include "AliESD.h"
+#include "AliMUONReconstructor.h"
 
 #include "AliMUONData.h"
 #include "AliMUONEventReconstructor.h"
@@ -37,7 +38,7 @@
 #include "AliMUONTrackParam.h"
 #include "AliMUONTriggerTrack.h"
 #include "AliESDMuonTrack.h"
-#include "AliMUONReconstructor.h"
+#include "AliRawReader.h"
 
 ClassImp(AliMUONReconstructor)
 //_____________________________________________________________________________
@@ -136,6 +137,96 @@ void AliMUONReconstructor::Reconstruct(AliRunLoader* runLoader) const
   delete recoEvent;
   delete trigDec;
 }
+
+//_____________________________________________________________________________
+void AliMUONReconstructor::Reconstruct(AliRunLoader* runLoader, AliRawReader* rawReader) const
+{
+//  AliLoader
+  AliLoader* loader = runLoader->GetLoader("MUONLoader");
+
+// used local container for each method
+// passing fLoader as argument, could be avoided ???
+  AliMUONEventReconstructor* recoEvent = new AliMUONEventReconstructor(loader);
+  AliMUONData* dataEvent = recoEvent->GetMUONData();
+
+  AliMUONClusterReconstructor* recoCluster = new AliMUONClusterReconstructor(loader);
+  AliMUONData* dataCluster = recoCluster->GetMUONData();
+
+  AliMUONTriggerDecision* trigDec = new AliMUONTriggerDecision(loader,0,dataCluster);
+  //  AliMUONData* dataTrig = trigDec->GetMUONData();
+
+
+  for (Int_t i = 0; i < 10; i++) {
+    AliMUONClusterFinderVS *recModel = new AliMUONClusterFinderVS();
+    recModel->SetGhostChi2Cut(10);
+    recoCluster->SetReconstructionModel(i,recModel);
+  } 
+
+  loader->LoadDigits("READ");
+  loader->LoadRecPoints("RECREATE");
+  loader->LoadTracks("RECREATE");
+  
+  //   Loop over events  
+ Int_t iEvent = 0;
+            
+ while (rawReader->NextEvent()) {
+    printf("Event %d\n",iEvent);
+    runLoader->GetEvent(iEvent++);
+
+    //----------------------- digit2cluster & Digits2Trigger -------------------
+    if (!loader->TreeR()) loader->MakeRecPointsContainer();
+     
+    // tracking branch
+    dataCluster->MakeBranch("RC");
+    dataCluster->SetTreeAddress("D,RC");
+    recoCluster->Digits2Clusters(rawReader); 
+    dataCluster->Fill("RC"); 
+
+    // trigger branch
+    dataCluster->MakeBranch("TC");
+    dataCluster->SetTreeAddress("TC");
+    trigDec->Trigger2Trigger(); 
+    dataCluster->Fill("TC");
+
+    loader->WriteRecPoints("OVERWRITE");
+
+    //---------------------------- Track & TriggerTrack ---------------------
+    if (!loader->TreeT()) loader->MakeTracksContainer();
+
+    // trigger branch
+    dataEvent->MakeBranch("RL"); //trigger track
+    dataEvent->SetTreeAddress("RL");
+    recoEvent->EventReconstructTrigger();
+    dataEvent->Fill("RL");
+
+    // tracking branch
+    dataEvent->MakeBranch("RT"); //track
+    dataEvent->SetTreeAddress("RT");
+    recoEvent->EventReconstruct();
+    dataEvent->Fill("RT");
+
+    loader->WriteTracks("OVERWRITE");  
+  
+    //--------------------------- Resetting branches -----------------------
+    dataCluster->ResetDigits();
+    dataCluster->ResetRawClusters();
+    dataCluster->ResetTrigger();
+
+    dataEvent->ResetRawClusters();
+    dataEvent->ResetTrigger();
+    dataEvent->ResetRecTracks();
+    dataEvent->ResetRecTriggerTracks();
+  
+  }
+  loader->UnloadDigits();
+  loader->UnloadRecPoints();
+  loader->UnloadTracks();
+
+  delete recoCluster;
+  delete recoEvent;
+  delete trigDec;
+}
+
 //_____________________________________________________________________________
 void AliMUONReconstructor::FillESD(AliRunLoader* runLoader, AliESD* esd) const
 {
index a7772fc3020c8d26e252794b8e9cad9b19eaa28c..f4dcf6cf2f1ddb3f271a45cad79bff14c97982ff 100644 (file)
@@ -15,6 +15,9 @@ class AliMUONReconstructor: public AliReconstructor
     virtual ~AliMUONReconstructor();
 
     virtual void         Reconstruct(AliRunLoader* runLoader) const;
+    virtual void         Reconstruct(AliRunLoader* runLoader,
+                                  AliRawReader* rawReader) const;
+
     virtual void         FillESD(AliRunLoader* runLoader, AliESD* esd) const;
  
   ClassDef(AliMUONReconstructor, 0)   // class for the MUON reconstruction
index 7a72eac2c85044f5dc6056c5e3b94d6f2235bfa8..615a9d9f0cae6d5b967ebfd92055a225c08eb052 100644 (file)
@@ -54,6 +54,7 @@
 #pragma link C++ class  AliMUONSubEventTracker+;
 #pragma link C++ class  AliMUONSubEventTrigger+;
 #pragma link C++ class  AliMUONRawData+;
+#pragma link C++ class  AliMUONRawStream+;
 #pragma link C++ class  AliMUONReconstructor+;
 #pragma link C++ class  AliMUONSegmentationSlatModule+;
 #pragma link C++ class  AliMUONSegmentationSlatModuleN+;
index c9f016bc4334c6ab027936374cc6cfe3de3d2258..e194ffdde182f776b572d492478878f976a4cabe 100644 (file)
@@ -8,7 +8,8 @@ SRCS         = AliMUONChamber.cxx AliMUONChamberTrigger.cxx \
               AliMUONSegmentationTrigger.cxx  AliMUONResponseTrigger.cxx\
                AliMUONResponseTriggerV1.cxx\
               AliMUONSegmentationTriggerX.cxx AliMUONSegmentationTriggerY.cxx \
-               AliMUONSegmentationDetectionElement.cxx AliMUONSegmentIndex.cxx AliMUONSegmentManuIndex.cxx AliMUONSegmentPosition.cxx\
+               AliMUONSegmentationDetectionElement.cxx AliMUONSegmentIndex.cxx \
+               AliMUONSegmentManuIndex.cxx AliMUONSegmentPosition.cxx\
                AliMUON.cxx AliMUONv0.cxx AliMUONv1.cxx AliMUONv3.cxx \
                AliMUONChamberGeometry.cxx AliMUONGeometryConstituent.cxx AliMUONGeometryEnvelope.cxx \
                AliMUONVGeometryBuilder.cxx AliMUONSt1GeometryBuilder.cxx AliMUONSt1GeometryBuilderV2.cxx \
@@ -33,12 +34,12 @@ SRCS         = AliMUONChamber.cxx AliMUONChamberTrigger.cxx \
               AliMUONSegmentationSlatModule.cxx AliMUONSegmentationSlatModuleN.cxx \
               AliMUONSegmentationSlat.cxx AliMUONSegmentationSlatN.cxx \
               AliMUONRecoEvent.cxx AliMUONRecoTrack.cxx AliMUONRecoDisplay.cxx \
-               AliMUONMerger.cxx AliMUONFactory.cxx AliMUONDigitizer.cxx AliMUONDigitizerv1.cxx AliMUONDigitizerv2.cxx \
-               AliMUONSDigitizerv1.cxx \
+               AliMUONMerger.cxx AliMUONFactory.cxx AliMUONDigitizer.cxx \
+               AliMUONDigitizerv1.cxx AliMUONDigitizerv2.cxx AliMUONSDigitizerv1.cxx \
                AliMUONTrackK.cxx AliMUONClusterFinderAZ.cxx AliMUONPixel.cxx \
                AliMUONLoader.cxx AliMUONData.cxx  AliMUONDataInterface.cxx \
                AliMUONDDLTrigger.cxx AliMUONSubEventTrigger.cxx AliMUONDDLTracker.cxx \
-               AliMUONRawData.cxx AliMUONSubEventTracker.cxx 
+               AliMUONRawData.cxx AliMUONSubEventTracker.cxx AliMUONRawStream.cxx
 
 
 SRCS     += AliMUONSt1Segmentation.cxx AliMUONSt1Response.cxx \