]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Implementation of the ACORDE reconstructor and ACORDE ESD object. The ACORDE digits...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 May 2008 15:24:44 +0000 (15:24 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 May 2008 15:24:44 +0000 (15:24 +0000)
12 files changed:
ACORDE/ACORDErecLinkDef.h
ACORDE/AliACORDEReconstructor.cxx [new file with mode: 0644]
ACORDE/AliACORDEReconstructor.h [new file with mode: 0644]
ACORDE/libACORDErec.pkg
STEER/AliESD.cxx
STEER/AliESD.h
STEER/AliESDACORDE.cxx [new file with mode: 0644]
STEER/AliESDACORDE.h [new file with mode: 0644]
STEER/AliESDEvent.cxx
STEER/AliESDEvent.h
STEER/ESDLinkDef.h
STEER/libESD.pkg

index c97b68740b7ddf6c28ee03db2a31e8f04a79526f..c730030db56e5d236f0a847ef161484dd0e4f354 100644 (file)
@@ -9,6 +9,8 @@
 #pragma link off all functions;
  
 #pragma link C++ class  AliACORDERawStream+;
+#pragma link C++ class  AliACORDEReconstructor+;
+
  
 #endif
 
diff --git a/ACORDE/AliACORDEReconstructor.cxx b/ACORDE/AliACORDEReconstructor.cxx
new file mode 100644 (file)
index 0000000..de3b85e
--- /dev/null
@@ -0,0 +1,148 @@
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+
+/* $Id: AliACORDEReconstructor.cxx 20956 2007-09-26 14:22:18Z mrodrigu $ */
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  Class for ACORDE reconstruction                                         //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliRawReader.h"
+
+#include "AliACORDEReconstructor.h"
+#include "AliACORDERawStream.h"
+#include "AliESDEvent.h"
+#include "AliACORDEdigit.h"
+
+ClassImp(AliACORDEReconstructor)
+
+AliACORDEReconstructor:: AliACORDEReconstructor():
+  AliReconstructor(),
+  fESDACORDE(0x0),
+  fCalibData(0x0)
+{
+  // Default constructor  
+  // Get calibration data
+
+  fCalibData = GetCalibData(); 
+}
+
+//FALTA IMPLEMENTAR_______________________________________________________________________
+AliACORDECalibData *AliACORDEReconstructor::GetCalibData() const
+{
+  // TO BE IMPLEMENTED !!
+  return 0x0;
+}
+//_____________________________________________________________________________
+AliACORDEReconstructor& AliACORDEReconstructor::operator = 
+  (const AliACORDEReconstructor& /*reconstructor*/)
+{
+// assignment operator
+
+  Fatal("operator =", "assignment operator not implemented");
+  return *this;
+}
+
+//_____________________________________________________________________________
+AliACORDEReconstructor::~AliACORDEReconstructor()
+{
+// destructor
+//NECESITAS esta clase
+  delete fESDACORDE; 
+}
+
+//_____________________________________________________________________________
+void AliACORDEReconstructor::Init()
+{
+// initializer
+//NECESITAS esta clase
+    fESDACORDE  = new AliESDACORDE;
+}
+
+void AliACORDEReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
+{
+
+  if (!digitsTree) {
+    AliError("No digits tree!");
+    return;
+  }
+
+  TClonesArray* digitsArray = new TClonesArray("AliACORDEdigit");
+  digitsTree->Branch("ACORDEdigit", &digitsArray);
+
+  rawReader->Reset();
+  AliACORDERawStream rawStream(rawReader);
+  if (rawStream.Next()) {
+    for(Int_t iChannel = 0; iChannel < 60; iChannel++) {
+      Int_t  index = iChannel / 30;
+      Int_t  bit   = iChannel % 30;
+      if (rawStream.GetWord(index) & (1 << bit))
+        new ((*digitsArray)[digitsArray->GetEntriesFast()]) AliACORDEdigit(iChannel+1,0);
+      // separate digits for single and multi muon signals !!!
+      // TO BE DONE!!
+      // if (GetWord(index+1) & (1 << bit))
+      // new ((*digitsArray)[digitsArray->GetEntriesFast()]) AliACORDEdigit(iChannel+1,0); // multi-muon digit
+    }
+  }
+
+  digitsTree->Fill();
+                       
+}
+
+void AliACORDEReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const
+{
+
+  // fills ESD with ACORDE Digits
+
+  if (!digitsTree)
+    {
+      AliError("No digits tree!");
+      return;
+    }
+
+  TClonesArray* digitsArray = NULL;
+  TBranch* digitBranch = digitsTree->GetBranch("ACORDEdigit");
+  if (!digitBranch) {
+    AliError("No ACORDE digits branch found!");
+    return;
+  }
+  digitBranch->SetAddress(&digitsArray);
+
+  digitsTree->GetEvent(0);
+
+  Bool_t AcoADCSingle[60],AcoADCMulti[60];
+  for(Int_t i = 0; i < 60; i++) { AcoADCSingle[i] = AcoADCMulti[i] = kFALSE; }
+
+  Int_t nDigits = digitsArray->GetEntriesFast();
+    
+  for (Int_t d=0; d<nDigits; d++) {    
+    AliACORDEdigit* digit = (AliACORDEdigit*)digitsArray->At(d);
+    Int_t module = digit->GetModule();
+
+    AcoADCSingle[module-1] = kTRUE;
+    AcoADCMulti[module-1] = kTRUE;
+  }
+       
+  fESDACORDE->SetACORDESingleMuon(AcoADCSingle);
+  fESDACORDE->SetACORDEMultiMuon(AcoADCMulti);
+
+  if (esd)
+    {
+      AliDebug(1, Form("Writing ACORDE data to ESD Tree"));
+      esd->SetACORDEData(fESDACORDE);
+    }  
+}
+
+
diff --git a/ACORDE/AliACORDEReconstructor.h b/ACORDE/AliACORDEReconstructor.h
new file mode 100644 (file)
index 0000000..d2577bb
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef ALIACORDERECONSTRUCTOR_H
+#define ALIACORDERECONSTRUCTOR_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved.*/
+/* See cxx source for full Copyright notice                              */
+/* $Id: AliACORDEReconstructor.h 20956 2007-09-26 14:22:18Z cvetan $  */
+
+///////////////////////////////////////////////////////////////////////////
+///                                                                      //
+/// class for ACORDE reconstruction                                       //
+///                                                                      //
+///////////////////////////////////////////////////////////////////////////
+
+#include "AliReconstructor.h"
+#include "AliLog.h"
+
+class AliACORDECalibData;
+class AliESDACORDE;
+class AliESDEvent;
+
+class AliACORDEReconstructor: public AliReconstructor {
+public:
+  AliACORDEReconstructor();
+  virtual ~AliACORDEReconstructor();
+  virtual void   Init();
+  
+  virtual void   Reconstruct(AliRawReader* /*rawReader*/, 
+                            TTree* /*clustersTree*/) const {
+    AliError("Method not implemented"); return;};
+  virtual void   Reconstruct(TTree*, TTree*) const {return;};
+  
+  virtual void   FillESD(TTree* digitsTree, TTree* /*clustersTree*/, 
+                        AliESDEvent* esd) const;
+
+  virtual void   FillESD(AliRawReader* /*rawReader*/, TTree* /*clustersTree*/, 
+                        AliESDEvent* /*esd*/) const { 
+    AliError("Method not implemented"); return;};
+  
+  virtual Bool_t HasDigitConversion() const { return kTRUE; }
+  virtual void ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const;
+
+  AliACORDECalibData *GetCalibData() const; 
+
+protected:
+//NO PODEMOS USARLOS X Q NO EXISTEN
+  AliESDACORDE*        fESDACORDE;      // ACORDE ESD object  
+  
+private:
+  AliACORDEReconstructor(const AliACORDEReconstructor& reconstructor);
+  AliACORDEReconstructor& operator = (const AliACORDEReconstructor& reconstructor);
+  
+  AliACORDECalibData* fCalibData;      //! calibration data
+  ClassDef(AliACORDEReconstructor, 0)  // class for the ACORDE reconstruction
+};
+
+#endif
index df2541925607e2da0f27e0c2ed1bc85bffc6f1d3..8b85da0187dff545026465eca1b42a5307bdeca5 100644 (file)
@@ -1,6 +1,5 @@
-#-*-Mode: Makefile-*-
-
-SRCS = AliACORDERawStream.cxx
+SRCS = AliACORDERawStream.cxx \
+       AliACORDEReconstructor.cxx
                                                                                
 HDRS:= $(SRCS:.cxx=.h)
 
index faef82c3e709bb145b58a8bf685ef18598d2abd5..93d82bda35470660a3b02ee423bba47f9761d6ce 100644 (file)
@@ -71,6 +71,7 @@ AliESD::AliESD():
   fPHOSTriggerAmplitudes(0x0),
   fESDFMD(0x0),
   fESDVZERO(0x0),
+  fESDACORDE(0x0),
   fErrorLogs("AliRawDataErrorLog",5)
 {
   // 
@@ -130,6 +131,7 @@ AliESD::AliESD(const AliESD& esd):
   fPHOSTriggerAmplitudes(esd.fPHOSTriggerAmplitudes),
   fESDFMD(esd.fESDFMD),
   fESDVZERO(esd.fESDVZERO),
+  fESDACORDE(esd.fESDACORDE),
   fErrorLogs(*((TClonesArray*)esd.fErrorLogs.Clone()))
 {
   // 
@@ -165,6 +167,7 @@ AliESD::~AliESD()
   delete fEMCALTriggerAmplitudes;
   delete fPHOSTriggerPosition;
   delete fPHOSTriggerAmplitudes;
+  delete fESDACORDE;
 
   fErrorLogs.Delete();
 
@@ -239,6 +242,11 @@ void AliESD::Reset()
       fESDVZERO->~AliESDVZERO();
       new (fESDVZERO) AliESDVZERO();
   } 
+//
+  if (fESDACORDE){
+      fESDACORDE->~AliESDACORDE();
+      new (fESDACORDE) AliESDACORDE(); 
+  }
 //
   fErrorLogs.Delete();
 }
index 18a87d526a4bf7ebf7717f0efb848f91cc91a2ba..c92aa446e98077b7bfd4d6d5bf5f2682bc0fe051 100644 (file)
@@ -32,6 +32,7 @@
 #include "AliESDVZERO.h"
 #include "AliMultiplicity.h"
 #include "AliRawDataErrorLog.h"
+#include "AliESDACORDE.h"
 
 class AliESDfriend;
 
@@ -229,7 +230,8 @@ public:
    
   void SetVZEROData(AliESDVZERO * obj) { fESDVZERO = new AliESDVZERO(*obj); }
   AliESDVZERO *GetVZEROData(){ return fESDVZERO; }
-
+  void SetACORDEData(AliESDACORDE * obj){ fESDACORDE = new AliESDACORDE(*obj); } 
+  AliESDACORDE *GetACORDEDAta(){ return fESDACORDE; }
   AliRawDataErrorLog *GetErrorLog(Int_t i) const {
     return (AliRawDataErrorLog *)fErrorLogs.UncheckedAt(i);
   }
@@ -295,10 +297,11 @@ protected:
 
   AliESDFMD   *fESDFMD;   // FMD object containing rough multiplicity
   AliESDVZERO *fESDVZERO; // VZERO object containing rough multiplicity
+  AliESDACORDE *fESDACORDE; // ACORDE ESD object containing bit pattern
 
   TClonesArray fErrorLogs;        // Raw-data reading error messages
 
-  ClassDef(AliESD,21)  //ESD class 
+  ClassDef(AliESD,22)  //ESD class 
 };
 #endif 
 
diff --git a/STEER/AliESDACORDE.cxx b/STEER/AliESDACORDE.cxx
new file mode 100644 (file)
index 0000000..a0c3b8c
--- /dev/null
@@ -0,0 +1,55 @@
+#include "AliESDACORDE.h"
+
+ClassImp(AliESDACORDE)
+
+AliESDACORDE::AliESDACORDE():TObject()
+{
+ //Default constructor
+       for(Int_t i=0;i<60;i++)
+       {
+               fACORDESingleMuon[i] = fACORDEMultiMuon[i] = 0;
+       }
+}
+
+
+AliESDACORDE::AliESDACORDE(const AliESDACORDE &o)
+  :TObject(o)
+
+{      
+       //Default constructor
+       for(Int_t i=0;i<60;i++)
+       {
+               fACORDESingleMuon[i] = o.fACORDESingleMuon[i];
+               fACORDEMultiMuon[i] = o.fACORDEMultiMuon[i];
+       }
+}
+
+
+AliESDACORDE::AliESDACORDE(Int_t* MACORDESingleMuon, Int_t* MACORDEMultiMuon):TObject()
+{
+
+       //Constructor
+
+       for(Int_t i=0;i<60;i++)
+       {
+               fACORDESingleMuon[i] = MACORDESingleMuon[i];
+               fACORDEMultiMuon[i] = MACORDEMultiMuon[i];
+       }
+}
+
+AliESDACORDE& AliESDACORDE::operator=(const AliESDACORDE& o)
+{
+       if(this==&o)return *this;
+       TObject::operator=(o);
+
+       // Assignment operator
+       for(Int_t i=0; i<60; i++)
+       {
+               fACORDESingleMuon[i] = o.fACORDESingleMuon[i];
+               fACORDEMultiMuon[i] = o.fACORDEMultiMuon[i];
+       }
+       
+       return *this;
+}
+
+
diff --git a/STEER/AliESDACORDE.h b/STEER/AliESDACORDE.h
new file mode 100644 (file)
index 0000000..4da5136
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef AliESDACORDE_H
+#define AliESDACORDE_H
+
+#include <TObject.h>
+
+class AliESDACORDE : public TObject
+{
+
+       public:
+               AliESDACORDE();
+               AliESDACORDE(const AliESDACORDE&);
+                AliESDACORDE(Int_t *ACORDESingleMuon,Int_t *ACORDEMultiMuon); 
+               virtual ~AliESDACORDE() {};
+       
+               void SetACORDEMultiMuon(Bool_t ACORDEMultiMuon[60]){for(Int_t i=0;i<60;i++){fACORDEMultiMuon[i]=ACORDEMultiMuon[i];}}
+
+               void SetACORDESingleMuon(Bool_t ACORDESingleMuon[60]){for(Int_t i=0;i<60;i++){fACORDESingleMuon[i]=ACORDESingleMuon[i];}} 
+
+       
+               AliESDACORDE &operator=(const AliESDACORDE& source);
+
+       protected:
+
+       Bool_t  fACORDESingleMuon[60];  // array with the Single Muon hits in the 60 Acorde's Modules 
+       Bool_t  fACORDEMultiMuon[60];   // array with the Multi Muon hits in the 60 Acorde's Modules
+
+
+       ClassDef(AliESDACORDE,2)
+
+};
+
+#endif
index 6819d9eaff4e135e27eec35af0150d8ba1293f21..0de296ea9b33f2514dae9a41c3c1683231fa6c3d 100644 (file)
@@ -61,7 +61,7 @@
 #include "AliMultiplicity.h"
 #include "AliRawDataErrorLog.h"
 #include "AliLog.h"
-
+#include "AliESDACORDE.h"
 ClassImp(AliESDEvent)
 
 
@@ -90,7 +90,9 @@ ClassImp(AliESDEvent)
                                                       "CaloClusters",
                                                      "EMCALCells",
                                                      "PHOSCells",
-                                                      "AliRawDataErrorLogs"};
+                                                      "AliRawDataErrorLogs",
+                                                      "AliESDACORDE"};
+
 //______________________________________________________________________________
 AliESDEvent::AliESDEvent():
   AliVEvent(),
@@ -107,6 +109,7 @@ AliESDEvent::AliESDEvent():
   fSPDMult(0),
   fPHOSTrigger(0),
   fEMCALTrigger(0),
+  fESDACORDE(0),
   fTracks(0),
   fMuonTracks(0),
   fPmdTracks(0),
@@ -142,6 +145,7 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   fSPDMult(new AliMultiplicity(*esd.fSPDMult)),
   fPHOSTrigger(new AliESDCaloTrigger(*esd.fPHOSTrigger)),
   fEMCALTrigger(new AliESDCaloTrigger(*esd.fEMCALTrigger)),
+  fESDACORDE(new AliESDACORDE(*esd.fESDACORDE)),
   fTracks(new TClonesArray(*esd.fTracks)),
   fMuonTracks(new TClonesArray(*esd.fMuonTracks)),
   fPmdTracks(new TClonesArray(*esd.fPmdTracks)),
@@ -186,6 +190,7 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   AddObject(fEMCALCells);
   AddObject(fPHOSCells);
   AddObject(fErrorLogs);
+  AddObject(fESDACORDE);
 
   GetStdContent();
 
@@ -222,6 +227,7 @@ AliESDEvent & AliESDEvent::operator=(const AliESDEvent& source) {
   fEMCALCells = new AliESDCaloCells(*source.fEMCALCells);
   fPHOSCells = new AliESDCaloCells(*source.fPHOSCells);
   fErrorLogs = new TClonesArray(*source.fErrorLogs);
+  fESDACORDE = new AliESDACORDE(*source.fESDACORDE);
   fESDOld       = new AliESD(*source.fESDOld);
   fESDFriendOld = new AliESDfriend(*source.fESDFriendOld);
   // CKB this way?? or 
@@ -251,6 +257,7 @@ AliESDEvent & AliESDEvent::operator=(const AliESDEvent& source) {
   AddObject(fEMCALCells);
   AddObject(fPHOSCells);
   AddObject(fErrorLogs);
+  AddObject(fESDACORDE);
 
   fConnected = source.fConnected;
   fEMCALClusters = source.fEMCALClusters;
@@ -324,6 +331,10 @@ void AliESDEvent::ResetStdContent()
     fESDVZERO->~AliESDVZERO();
     new (fESDVZERO) AliESDVZERO();
   }  
+  if(fESDACORDE){
+    fESDACORDE->~AliESDACORDE();
+    new (fESDACORDE) AliESDACORDE();   
+  } 
   if(fESDTZERO) fESDTZERO->Reset(); 
   // CKB no clear/reset implemented
   if(fTPCVertex){
@@ -845,6 +856,13 @@ void AliESDEvent::SetVZEROData(AliESDVZERO * obj)
     *fESDVZERO = *obj;
 }
 
+void AliESDEvent::SetACORDEData(AliESDACORDE * obj)
+{
+  if(fESDACORDE)
+    *fESDACORDE = *obj;
+}
+
+
 void AliESDEvent::GetESDfriend(AliESDfriend *ev) const 
 {
   //
@@ -903,6 +921,7 @@ void AliESDEvent::GetStdContent()
   fEMCALCells = (AliESDCaloCells*)fESDObjects->FindObject(fgkESDListName[kEMCALCells]);
   fPHOSCells = (AliESDCaloCells*)fESDObjects->FindObject(fgkESDListName[kPHOSCells]);
   fErrorLogs = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kErrorLogs]);
+  fESDACORDE = (AliESDACORDE*)fESDObjects->FindObject(fgkESDListName[kESDACORDE]);
 
 }
 
@@ -953,6 +972,7 @@ void AliESDEvent::CreateStdContent()
   AddObject(new AliESDCaloCells());
   AddObject(new AliESDCaloCells());
   AddObject(new TClonesArray("AliRawDataErrorLog",0));
+  AddObject(new AliESDACORDE()); 
 
   // check the order of the indices against enum...
 
index 50f10b53357a234a71f19e34b7e528be52f1453a..56d0558e7a2972ee49754b7b6694e2480f652181 100644 (file)
@@ -29,6 +29,7 @@ class TList;
 #include "AliESDHeader.h"
 #include "AliESDTZERO.h"
 #include "AliESDZDC.h"
+#include "AliESDACORDE.h"
 
 // AliESDtrack has to be included so that the compiler 
 // knows its inheritance tree (= that it is a AliVParticle).
@@ -52,6 +53,7 @@ class AliESDMuonTrack;
 class AliESD;
 class AliESDcascade;
 class TRefArray;
+class AliESDACORDE;
 
 class AliESDEvent : public AliVEvent {
 public:
@@ -80,6 +82,7 @@ public:
                       kEMCALCells,
                       kPHOSCells,
                       kErrorLogs,
+                       kESDACORDE,
                       kESDListN
   };
 
@@ -167,6 +170,9 @@ public:
   AliESDVZERO *GetVZEROData() const { return fESDVZERO; }
   void SetVZEROData(AliESDVZERO * obj);
 
+ // ACORDE
+  AliESDACORDE *GetACORDEData() const { return fESDACORDE;}
+  void SetACORDEData(AliESDACORDE * obj);
 
   void SetESDfriend(const AliESDfriend *f) const;
   void GetESDfriend(AliESDfriend *f) const;
@@ -354,6 +360,7 @@ protected:
   AliMultiplicity *fSPDMult;          //! SPD tracklet multiplicity
   AliESDCaloTrigger* fPHOSTrigger;     //! PHOS Trigger information
   AliESDCaloTrigger* fEMCALTrigger;    //! PHOS Trigger information
+  AliESDACORDE    *fESDACORDE;        //! ACORDE ESD object caontaining bit pattern
 
   TClonesArray *fTracks;           //! ESD tracks 
   TClonesArray *fMuonTracks;       //! MUON ESD tracks
@@ -382,7 +389,7 @@ protected:
   Int_t        fPHOSClusters;     // Number of PHOS clusters (subset of caloclusters)
   Int_t        fFirstPHOSCluster; // First PHOS cluster in the fCaloClusters list 
 
-  ClassDef(AliESDEvent,7)  //ESDEvent class 
+  ClassDef(AliESDEvent,8)  //ESDEvent class 
 };
 #endif 
 
index 45360bf540918047036e79950d5c5c14b3eac920..6d2b8134ec35d627593bf11b56aff92fa70dd104 100644 (file)
@@ -59,6 +59,8 @@
 
 #pragma link C++ class  AliESDVZERO+;
 #pragma link C++ class  AliESDTZERO+;
+#pragma link C++ class  AliESDACORDE+;
+
 
 #pragma link C++ class  AliESDMultITS+;
 #pragma link C++ class  AliMultiplicity+;
index 3311fd72791f860ef11ead557b9a577113db5bce..0cd408cd0e9f5603655d8a682f7e3f5ceec01aa1 100644 (file)
@@ -24,7 +24,8 @@ SRCS = AliESDEvent.cxx AliESDInputHandler.cxx AliESDInputHandlerRP.cxx AliESDfri
        AliESDCaloTrigger.cxx \
        AliRawDataErrorLog.cxx \
        AliMeanVertex.cxx \
-       AliESDCaloCells.cxx
+       AliESDCaloCells.cxx \
+       AliESDACORDE.cxx
 
 HDRS:= $(SRCS:.cxx=.h)