1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /* $Id: AliACORDEReconstructor.cxx 20956 2007-09-26 14:22:18Z mrodrigu $ */
17 //////////////////////////////////////////////////////////////////////////////
19 // Class for ACORDE reconstruction //
20 //////////////////////////////////////////////////////////////////////////////
22 #include "AliRawReader.h"
24 #include "AliACORDEReconstructor.h"
25 #include "AliACORDERawStream.h"
26 #include "AliESDEvent.h"
27 #include "AliACORDEdigit.h"
29 ClassImp(AliACORDEReconstructor)
31 AliACORDEReconstructor:: AliACORDEReconstructor():
36 // Default constructor
37 // Get calibration data
39 fCalibData = GetCalibData();
42 //FALTA IMPLEMENTAR_______________________________________________________________________
43 AliACORDECalibData *AliACORDEReconstructor::GetCalibData() const
45 // TO BE IMPLEMENTED !!
48 //_____________________________________________________________________________
49 AliACORDEReconstructor& AliACORDEReconstructor::operator =
50 (const AliACORDEReconstructor& /*reconstructor*/)
52 // assignment operator
54 Fatal("operator =", "assignment operator not implemented");
58 //_____________________________________________________________________________
59 AliACORDEReconstructor::~AliACORDEReconstructor()
62 //NECESITAS esta clase
66 //_____________________________________________________________________________
67 void AliACORDEReconstructor::Init()
70 //NECESITAS esta clase
71 fESDACORDE = new AliESDACORDE;
74 void AliACORDEReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
78 AliError("No digits tree!");
82 TClonesArray* digitsArray = new TClonesArray("AliACORDEdigit");
83 digitsTree->Branch("ACORDEdigit", &digitsArray);
86 AliACORDERawStream rawStream(rawReader);
87 if (rawStream.Next()) {
88 for(Int_t iChannel = 0; iChannel < 60; iChannel++) {
89 Int_t index = iChannel / 30;
90 Int_t bit = iChannel % 30;
91 if (rawStream.GetWord(index) & (1 << bit))
92 new ((*digitsArray)[digitsArray->GetEntriesFast()]) AliACORDEdigit(iChannel+1,0);
100 void AliACORDEReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const
103 // fills ESD with ACORDE Digits
107 AliError("No digits tree!");
111 TClonesArray* digitsArray = NULL;
112 TBranch* digitBranch = digitsTree->GetBranch("ACORDEdigit");
114 AliError("No ACORDE digits branch found!");
117 digitBranch->SetAddress(&digitsArray);
119 digitsTree->GetEvent(0);
121 Bool_t AcoADCSingle[60],AcoADCMulti[60];
122 for(Int_t i = 0; i < 60; i++) { AcoADCSingle[i] = AcoADCMulti[i] = kFALSE; }
124 Int_t nDigits = digitsArray->GetEntriesFast();
126 for (Int_t d=0; d<nDigits; d++) {
127 AliACORDEdigit* digit = (AliACORDEdigit*)digitsArray->At(d);
128 Int_t module = digit->GetModule();
130 AcoADCSingle[module-1] = kTRUE;
131 AcoADCMulti[module-1] = kTRUE;
134 fESDACORDE->SetACORDESingleMuon(AcoADCSingle);
135 fESDACORDE->SetACORDEMultiMuon(AcoADCMulti);
139 AliDebug(1, Form("Writing ACORDE data to ESD Tree"));
140 esd->SetACORDEData(fESDACORDE);