]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONClusterReconstructor.cxx
Dummy implementation of Alarms
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterReconstructor.cxx
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$ */
17
18 ////////////////////////////////////
19 //
20 // MUON cluster reconstructor for MUON
21 //
22 // Should implement a virtual class ClusterFinder to chose between VS and AZ method
23 ////////////////////////////////////
24
25 #include "AliMUONClusterReconstructor.h"
26 #include "AliRun.h" // for gAlice
27 #include "AliRunLoader.h"
28 #include "AliLoader.h"
29
30 #include "AliMUONDigit.h"
31 #include "AliMUONConstants.h"
32 #include "AliMUONData.h"
33 #include "AliMUONClusterFinderVS.h"
34 #include "AliMUONClusterInput.h"
35 #include "AliMUONRawCluster.h"
36 #include "AliRawReader.h" // for raw data
37 #include "AliLog.h"
38
39
40 const Int_t AliMUONClusterReconstructor::fgkDefaultPrintLevel = 0;
41
42 ClassImp(AliMUONClusterReconstructor) // Class implementation in ROOT context
43
44 //__________________________________________________________________________
45 AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliLoader* loader)
46   : TObject(),
47     fMUONData(0),
48     fPrintLevel(fgkDefaultPrintLevel),
49     fDebug(0)
50 {
51   // Standard Constructor
52
53   // initialize loader's
54   fLoader = loader;
55
56   // initialize container
57   fMUONData  = new AliMUONData(fLoader,"MUON","MUON");
58
59   // reconstruction model
60   fRecModel = new AliMUONClusterFinderVS();
61   //fRecModel = new AliMUONClusterFinderAZ();
62
63 }
64
65 //__________________________________________________________________________
66 AliMUONClusterReconstructor::AliMUONClusterReconstructor()
67   : TObject(),
68     fMUONData(0),
69     fPrintLevel(fgkDefaultPrintLevel),
70     fDebug(0),
71     fLoader(0)
72 {
73   // Default Constructor
74 }
75
76 //_______________________________________________________________________
77 AliMUONClusterReconstructor::AliMUONClusterReconstructor (const AliMUONClusterReconstructor& rhs)
78   : TObject(rhs)
79 {
80 // Protected copy constructor
81
82   AliFatal("Not implemented.");
83 }
84
85 //_______________________________________________________________________
86 AliMUONClusterReconstructor & 
87 AliMUONClusterReconstructor::operator=(const AliMUONClusterReconstructor& rhs)
88 {
89 // Protected assignement operator
90
91   if (this == &rhs) return *this;
92
93   AliFatal("Not implemented.");
94     
95   return *this;  
96 }
97
98 //__________________________________________________________________________
99 AliMUONClusterReconstructor::~AliMUONClusterReconstructor(void)
100 {
101
102   if (fMUONData)
103     delete fMUONData;
104
105   return;
106 }
107 //____________________________________________________________________
108 void AliMUONClusterReconstructor::Digits2Clusters()
109 {
110 //
111 //  Perform cluster finding
112 //
113     TClonesArray *dig1, *dig2;
114     Int_t ndig, k;
115     dig1 = new TClonesArray("AliMUONDigit",1000);
116     dig2 = new TClonesArray("AliMUONDigit",1000);
117     AliMUONDigit *digit;
118
119 // Loop on chambers and on cathode planes     
120     TClonesArray * muonDigits;
121
122     for (Int_t ich = 0; ich < 10; ich++) {
123
124         fMUONData->ResetDigits();
125         fMUONData->GetCathode(0);
126         //TClonesArray *
127         muonDigits = fMUONData->Digits(ich); 
128         ndig=muonDigits->GetEntriesFast();
129         AliDebug(1,Form("1 Found %d digits in %p chamber %d", ndig, (void*)muonDigits,ich));
130         TClonesArray &lhits1 = *dig1;
131         Int_t n = 0;
132         for (k = 0; k < ndig; k++) {
133             digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
134             if (fRecModel->TestTrack(digit->Track(0)))
135               new(lhits1[n++]) AliMUONDigit(*digit);
136         }
137         fMUONData->ResetDigits();
138         fMUONData->GetCathode(1);
139         muonDigits =  fMUONData->Digits(ich);  
140         ndig=muonDigits->GetEntriesFast();
141         AliDebug(1,Form("2 Found %d digits in %p %d", ndig, (void*)muonDigits, ich));
142         TClonesArray &lhits2 = *dig2;
143         n=0;
144         
145         for (k=0; k<ndig; k++) {
146             digit= (AliMUONDigit*) muonDigits->UncheckedAt(k);
147             if (fRecModel->TestTrack(digit->Track(0)))
148               new(lhits2[n++]) AliMUONDigit(*digit);
149         }
150
151         if (fRecModel) {         
152             AliMUONClusterInput::Instance()->SetDigits(ich, dig1, dig2);
153             fRecModel->FindRawClusters();
154         }
155         // copy into the container
156         TClonesArray* tmp = fRecModel->GetRawClusters();
157         for (Int_t id = 0; id < tmp->GetEntriesFast(); id++) {
158           AliMUONRawCluster* pClus = (AliMUONRawCluster*) tmp->At(id);
159           fMUONData->AddRawCluster(ich, *pClus);
160         }
161         dig1->Delete();
162         dig2->Delete();
163     } // for ich
164     delete dig1;
165     delete dig2;
166 }
167
168 //____________________________________________________________________
169 void AliMUONClusterReconstructor::Digits2Clusters(AliRawReader* /*rawReader*/)
170 {
171
172 //  Perform cluster finding form raw data
173
174    AliFatal("clusterization not implemented for raw data input");
175 }
176 //_______________________________________________________________________
177 void AliMUONClusterReconstructor::Trigger2Trigger() 
178 {
179 // copy trigger from TreeD to TreeR
180
181   fMUONData->SetTreeAddress("GLT");
182   fMUONData->GetTriggerD();
183 }
184 //_______________________________________________________________________
185 void AliMUONClusterReconstructor::Trigger2Trigger(AliRawReader* /*rawReader*/) 
186 {
187 // call the Trigger Algorithm from raw data and fill TreeR 
188
189    AliFatal("Trigger not implemented for raw data input");
190
191 }