]>
Commit | Line | Data |
---|---|---|
5e319bd5 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | /* $Id: AliADReconstructor.cxx 20956 2007-09-26 14:22:18Z mrodrigu $ */ | |
17 | ////////////////////////////////////////////////////////////////////////////// | |
18 | // // | |
19 | // Class for AD reconstruction // | |
20 | ////////////////////////////////////////////////////////////////////////////// | |
21 | ||
22 | #include "AliRawReader.h" | |
23 | ||
24 | #include "AliADReconstructor.h" | |
25 | #include "AliESDEvent.h" | |
26 | #include "AliADdigit.h" | |
7b752923 | 27 | #include "AliESDAD.h" |
5e319bd5 | 28 | |
29 | ClassImp(AliADReconstructor) | |
30 | ||
31 | AliADReconstructor:: AliADReconstructor(): | |
32 | AliReconstructor(), | |
33 | fESDAD(0x0), | |
34 | fDigitsArray(0) | |
35 | { | |
36 | // Default constructor | |
37 | // Get calibration data | |
38 | ||
39 | } | |
40 | ||
41 | //_____________________________________________________________________________ | |
42 | AliADReconstructor& AliADReconstructor::operator = | |
43 | (const AliADReconstructor& /*reconstructor*/) | |
44 | { | |
45 | // assignment operator | |
46 | ||
47 | Fatal("operator =", "assignment operator not implemented"); | |
48 | return *this; | |
49 | } | |
50 | ||
51 | //_____________________________________________________________________________ | |
52 | AliADReconstructor::~AliADReconstructor() | |
53 | { | |
54 | // destructor | |
55 | delete fESDAD; | |
56 | delete fDigitsArray; | |
57 | } | |
58 | ||
59 | //_____________________________________________________________________________ | |
60 | void AliADReconstructor::Init() | |
61 | { | |
62 | // initializer | |
63 | fESDAD = new AliESDAD; | |
64 | } | |
65 | ||
56c4d692 | 66 | void AliADReconstructor::ConvertDigits(AliRawReader* /*rawReader*/, TTree* /*digitsTree*/) const |
5e319bd5 | 67 | { |
68 | ||
69 | printf("Converting digits for AD .. not implemented \n"); | |
70 | } | |
71 | ||
72 | void AliADReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const | |
73 | { | |
74 | ||
75 | printf("Running AD Reconstruction \n"); | |
76 | ||
77 | // fills ESD with AD Digits | |
78 | ||
79 | if (!digitsTree) | |
80 | { | |
81 | AliError("No digits tree!"); | |
82 | return; | |
83 | } | |
84 | ||
85 | TBranch* digitBranch = digitsTree->GetBranch("ADdigit"); | |
86 | if (!digitBranch) { | |
87 | AliError("No AD digits branch found!"); | |
88 | return; | |
89 | } | |
90 | digitBranch->SetAddress(&fDigitsArray); | |
91 | ||
92 | digitsTree->GetEvent(0); | |
93 | ||
94 | Bool_t ADHits[16]; | |
95 | for(Int_t i = 0; i < 16; i++) { ADHits[i] = kFALSE; } | |
96 | ||
97 | Int_t nDigits = fDigitsArray->GetEntriesFast(); | |
98 | ||
99 | for (Int_t d=0; d<nDigits; d++) { | |
100 | AliADdigit* digit = (AliADdigit*) fDigitsArray->At(d); | |
101 | Int_t module = digit->GetCell(); | |
102 | // printf("AD Module: %d\n",module); | |
103 | ADHits[module] = kTRUE; | |
104 | } | |
105 | if (!esd) { | |
106 | AliError("NO AD ESD branch found!"); | |
107 | return; | |
108 | } | |
109 | fESDAD->SetADBitCell(ADHits); | |
110 | ||
111 | if (esd) | |
112 | { | |
113 | AliDebug(1, Form("Writing AD data to ESD Tree")); | |
114 | esd->SetADData(fESDAD); | |
115 | } | |
116 | ||
117 | fDigitsArray->Clear(); | |
118 | } | |
119 | ||
120 |