]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONClusterReconstructor.cxx
Adding links to README pages
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterReconstructor.cxx
CommitLineData
52c9bc11 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
3dbff571 18/// \class AliMUONClusterReconstructor
19///
20/// This class is just a steering class to loop over detection elements of tracking chambers,
21/// extract the relevant digits, and pass them to the actual clusterizer class,
22/// which operate on a single detection element at a time.
23///
24/// \author C. Finck and L. Aphecetche, Subatech
25///
52c9bc11 26
52c9bc11 27#include "AliMUONClusterReconstructor.h"
cf464691 28
3dbff571 29#include "AliLog.h"
30#include "AliMUONCluster.h"
31#include "AliMUONGeometryTransformer.h"
52c9bc11 32#include "AliMUONRawCluster.h"
f9247068 33#include "AliMUONVClusterFinder.h"
3dbff571 34#include "AliMUONVClusterStore.h"
35#include "AliMUONVDigit.h"
36#include "AliMUONVDigitStore.h"
37#include "AliMpDEIterator.h"
66f4c572 38#include "AliMpDEManager.h"
f9247068 39#include "AliMpSegmentation.h"
3dbff571 40#include <Riostream.h>
cf464691 41
7945aae7 42/// \cond CLASSIMP
52c9bc11 43ClassImp(AliMUONClusterReconstructor) // Class implementation in ROOT context
7945aae7 44/// \endcond
dd20215d 45
52c9bc11 46//__________________________________________________________________________
3dbff571 47AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliMUONVClusterFinder* clusterFinder,
f9247068 48 const AliMUONGeometryTransformer* transformer)
dd20215d 49: TObject(),
f9247068 50 fClusterFinder(clusterFinder),
3dbff571 51 fTransformer(transformer),
52 fClusterStore(0x0)
52c9bc11 53{
3dbff571 54 /// Standard Constructor
f8028dc0 55 /// Note that we adopt clusterFinder
52c9bc11 56
f9247068 57 if (!transformer && clusterFinder)
58 {
59 AliFatal("I require a geometry transformer, otherwise I cannot compute "
60 "global coordinates of the clusters !");
61 }
3dbff571 62
63// fRecModel->SetGhostChi2Cut(10);
52c9bc11 64}
30178c30 65
52c9bc11 66//__________________________________________________________________________
67AliMUONClusterReconstructor::~AliMUONClusterReconstructor(void)
68{
3dbff571 69 /// Destructor
f8028dc0 70 delete fClusterFinder;
dd20215d 71}
7e4a628d 72
f9247068 73//______________________________________________________________________________
74void
3dbff571 75AliMUONClusterReconstructor::ClusterizeOneDE(Int_t detElemId,
76 const AliMUONVDigitStore& digitStore)
f9247068 77{
3dbff571 78 /// Clusterize one detection element, which digits are in digitStore
79
f8028dc0 80// AliDebug(1,Form("detElemId=%d, %d digits",detElemId,digitStore.GetSize()));
81
3dbff571 82 if ( digitStore.IsEmpty() ) return;
83
f9247068 84 const AliMpVSegmentation* seg[2] =
866c3232 85 { AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::kCath0),
86 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::kCath1)
f9247068 87 };
3dbff571 88
89 Bool_t ok = fClusterFinder->Prepare(seg,digitStore);
f9247068 90 if ( !ok )
91 {
92 AliWarning(Form("No hit pad for DE %d ?",detElemId));
93 }
94
95 AliMUONCluster* cluster;
3dbff571 96
f9247068 97 while ( ( cluster = fClusterFinder->NextCluster() ) )
98 {
f9247068 99 // Converts cluster objects into ones suitable for output
100 //
101 AliMUONRawCluster rawCluster;
102
103 rawCluster.SetDetElemId(detElemId);
104
105 for ( Int_t cathode = 0; cathode < 2; ++cathode )
106 {
107 rawCluster.SetMultiplicity(cathode,cluster->Multiplicity(cathode));
108 rawCluster.SetCharge(cathode,cluster->Charge()); // both cathode get the total cluster charge
109 Double_t xg, yg, zg;
110
111 fTransformer->Local2Global(detElemId,
112 cluster->Position().X(), cluster->Position().Y(),
113 0, xg, yg, zg);
114
115 if ( cathode == 0 )
116 {
117 AliDebug(1,Form("Adding RawCluster detElemId %4d mult %2d charge %e (xl,yl,zl)=(%e,%e,%e) (xg,yg,zg)=(%e,%e,%e)",
118 detElemId,cluster->Multiplicity(),cluster->Charge(),
119 cluster->Position().X(),cluster->Position().Y(),0.0,
120 xg,yg,zg));
121 }
122 rawCluster.SetX(cathode,xg);
123 rawCluster.SetY(cathode,yg);
124 rawCluster.SetZ(cathode,zg);
125 }
3dbff571 126 fClusterStore->Add(rawCluster);
dd20215d 127 }
52c9bc11 128}
dd20215d 129
52c9bc11 130//____________________________________________________________________
3dbff571 131void AliMUONClusterReconstructor::Digits2Clusters(const AliMUONVDigitStore& digitStore,
132 AliMUONVClusterStore& clusterStore)
a713db22 133{
3dbff571 134 /// Clusterize the digitStore to produce a clusterStore
a713db22 135
3dbff571 136 fClusterStore = &clusterStore;
137 fClusterStore->Clear();
dd20215d 138
3dbff571 139 AliMpDEIterator deIt;
dd20215d 140
3dbff571 141 deIt.First();
142
143 while (!deIt.IsDone())
dd20215d 144 {
3dbff571 145 AliMUONVDigitStore* deDigits = digitStore.Create();
dd20215d 146
3dbff571 147 Int_t currentDE = deIt.CurrentDEId();
148 AliMp::StationType stationType = AliMpDEManager::GetStationType(currentDE);
149 if (stationType!=AliMp::kStationTrigger)
dd20215d 150 {
3dbff571 151 TIter next(digitStore.CreateIterator(currentDE,currentDE));
152 AliMUONVDigit* digit;
153
154 while ( ( digit = static_cast<AliMUONVDigit*>(next()) ) )
dd20215d 155 {
3dbff571 156 if ( ! digit->Charge() > 0 ) continue; // skip void digits.
dd20215d 157
3dbff571 158 deDigits->Add(*digit,AliMUONVDigitStore::kIgnore);
159 }
160 ClusterizeOneDE(currentDE,*deDigits);
161 }
162 delete deDigits;
163 deIt.Next();
164 }
7e4a628d 165}