From bd95bae7ee07c469e0c7310d918f83fc85c7820e Mon Sep 17 00:00:00 2001 From: cvetan Date: Thu, 8 May 2008 15:24:44 +0000 Subject: [PATCH] Implementation of the ACORDE reconstructor and ACORDE ESD object. The ACORDE digits should be revised, because the information they contain does not fully correspond to the raw-data contents (Mario and Cvetan) --- ACORDE/ACORDErecLinkDef.h | 2 + ACORDE/AliACORDEReconstructor.cxx | 148 ++++++++++++++++++++++++++++++ ACORDE/AliACORDEReconstructor.h | 56 +++++++++++ ACORDE/libACORDErec.pkg | 5 +- STEER/AliESD.cxx | 8 ++ STEER/AliESD.h | 7 +- STEER/AliESDACORDE.cxx | 55 +++++++++++ STEER/AliESDACORDE.h | 32 +++++++ STEER/AliESDEvent.cxx | 24 ++++- STEER/AliESDEvent.h | 9 +- STEER/ESDLinkDef.h | 2 + STEER/libESD.pkg | 3 +- 12 files changed, 342 insertions(+), 9 deletions(-) create mode 100644 ACORDE/AliACORDEReconstructor.cxx create mode 100644 ACORDE/AliACORDEReconstructor.h create mode 100644 STEER/AliESDACORDE.cxx create mode 100644 STEER/AliESDACORDE.h diff --git a/ACORDE/ACORDErecLinkDef.h b/ACORDE/ACORDErecLinkDef.h index c97b68740b7..c730030db56 100644 --- a/ACORDE/ACORDErecLinkDef.h +++ b/ACORDE/ACORDErecLinkDef.h @@ -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 index 00000000000..de3b85e89a1 --- /dev/null +++ b/ACORDE/AliACORDEReconstructor.cxx @@ -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; dAt(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 index 00000000000..d2577bb3e44 --- /dev/null +++ b/ACORDE/AliACORDEReconstructor.h @@ -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 diff --git a/ACORDE/libACORDErec.pkg b/ACORDE/libACORDErec.pkg index df254192560..8b85da0187d 100644 --- a/ACORDE/libACORDErec.pkg +++ b/ACORDE/libACORDErec.pkg @@ -1,6 +1,5 @@ -#-*-Mode: Makefile-*- - -SRCS = AliACORDERawStream.cxx +SRCS = AliACORDERawStream.cxx \ + AliACORDEReconstructor.cxx HDRS:= $(SRCS:.cxx=.h) diff --git a/STEER/AliESD.cxx b/STEER/AliESD.cxx index faef82c3e70..93d82bda354 100644 --- a/STEER/AliESD.cxx +++ b/STEER/AliESD.cxx @@ -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(); } diff --git a/STEER/AliESD.h b/STEER/AliESD.h index 18a87d526a4..c92aa446e98 100644 --- a/STEER/AliESD.h +++ b/STEER/AliESD.h @@ -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 index 00000000000..a0c3b8cf7fb --- /dev/null +++ b/STEER/AliESDACORDE.cxx @@ -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 index 00000000000..4da5136feb8 --- /dev/null +++ b/STEER/AliESDACORDE.h @@ -0,0 +1,32 @@ +#ifndef AliESDACORDE_H +#define AliESDACORDE_H + +#include + +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 diff --git a/STEER/AliESDEvent.cxx b/STEER/AliESDEvent.cxx index 6819d9eaff4..0de296ea9b3 100644 --- a/STEER/AliESDEvent.cxx +++ b/STEER/AliESDEvent.cxx @@ -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... diff --git a/STEER/AliESDEvent.h b/STEER/AliESDEvent.h index 50f10b53357..56d0558e7a2 100644 --- a/STEER/AliESDEvent.h +++ b/STEER/AliESDEvent.h @@ -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 diff --git a/STEER/ESDLinkDef.h b/STEER/ESDLinkDef.h index 45360bf5409..6d2b8134ec3 100644 --- a/STEER/ESDLinkDef.h +++ b/STEER/ESDLinkDef.h @@ -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+; diff --git a/STEER/libESD.pkg b/STEER/libESD.pkg index 3311fd72791..0cd408cd0e9 100644 --- a/STEER/libESD.pkg +++ b/STEER/libESD.pkg @@ -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) -- 2.39.3