Line data Source code
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 : /// \class AliMUONLegacyClusterServer
19 : ///
20 : /// Special implementation of AliMUONVClusterServer, which will only return
21 : /// clusters from a pre-defined cluster store.
22 : ///
23 : /// Made to recover the old (i.e. before introduction of VClusterServer) behavior
24 : /// of the MUON recontruction where rec points were always written to TreeR,
25 : /// and then the tracking picked them from that tree, in order to have the
26 : /// possibility to save full rec points (for debugging the spectro, mainly, should
27 : /// not be an option used during final production).
28 : ///
29 : /// \author Laurent Aphecetche, Subatech
30 : ///
31 :
32 : #include "AliMUONLegacyClusterServer.h"
33 :
34 : #include "AliCodeTimer.h"
35 : #include "AliLog.h"
36 : #include "AliMUONGeometryTransformer.h"
37 : #include "AliMUONTriggerTrackToTrackerClusters.h"
38 : #include "AliMUONVCluster.h"
39 : #include "AliMUONVClusterStore.h"
40 : #include "AliMUONRecoParam.h"
41 : #include "AliMpArea.h"
42 : #include <TCollection.h>
43 :
44 : /// \cond CLASSIMP
45 18 : ClassImp(AliMUONLegacyClusterServer)
46 : /// \endcond
47 :
48 : //_____________________________________________________________________________
49 : AliMUONLegacyClusterServer::AliMUONLegacyClusterServer(const AliMUONGeometryTransformer& transformer,
50 : AliMUONVClusterStore* store,
51 : Bool_t bypassSt4, Bool_t bypassSt5)
52 4 : : AliMUONVClusterServer(), fkTransformer(transformer), fClusterStore(store), fTriggerTrackStore(0x0),
53 2 : fBypass(0x0),
54 2 : fBypassSt4(bypassSt4),
55 2 : fBypassSt5(bypassSt5)
56 6 : {
57 : /// ctor. Mode Read : we'll only server clusters from existing store
58 4 : }
59 :
60 : //_____________________________________________________________________________
61 : AliMUONLegacyClusterServer::~AliMUONLegacyClusterServer()
62 12 : {
63 : /// dtor
64 2 : delete fBypass;
65 6 : }
66 :
67 : //_____________________________________________________________________________
68 : Int_t
69 : AliMUONLegacyClusterServer::Clusterize(Int_t chamberId,
70 : AliMUONVClusterStore& clusterStore,
71 : const AliMpArea& /*area*/,
72 : const AliMUONRecoParam* /*recoParam*/)
73 : {
74 : /// Fills clusterStore with clusters in given chamber
75 : ///
76 : /// Return the number of clusters added to clusterStore
77 :
78 160 : AliCodeTimerAuto(Form("Chamber %d",chamberId),0);
79 :
80 80 : if ( fBypassSt4 && ( chamberId == 6 || chamberId == 7 ) )
81 : {
82 0 : return fBypass->GenerateClusters(chamberId,clusterStore);
83 : }
84 :
85 80 : if ( fBypassSt5 && ( chamberId == 8 || chamberId == 9 ) )
86 : {
87 0 : return fBypass->GenerateClusters(chamberId,clusterStore);
88 : }
89 :
90 400 : AliDebug(1,Form("chamberId=%d fClusterStore(%p).GetSize()=%d clusterStore(%p).GetSize()=%d",
91 : chamberId,
92 : fClusterStore,fClusterStore->GetSize(),
93 : &clusterStore,clusterStore.GetSize()));
94 :
95 160 : TIter next(fClusterStore->CreateChamberIterator(chamberId,chamberId));
96 : AliMUONVCluster* cluster;
97 : Int_t n(0);
98 80 : TObjArray a;
99 :
100 652 : while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
101 : {
102 164 : clusterStore.Add(*cluster);
103 164 : a.Add(cluster);
104 164 : ++n;
105 : }
106 :
107 80 : TIter remove(&a);
108 488 : while ( ( cluster = static_cast<AliMUONVCluster*>(remove()) ) )
109 : {
110 164 : fClusterStore->Remove(*cluster);
111 : }
112 :
113 400 : AliDebug(1,Form("n=%d remaining clusters=%d",n,fClusterStore->GetSize()));
114 :
115 : return n;
116 160 : }
117 :
118 : //_____________________________________________________________________________
119 : Bool_t
120 : AliMUONLegacyClusterServer::UseTriggerTrackStore(AliMUONVTriggerTrackStore* trackStore)
121 : {
122 : /// Tells us to use trigger track store, and thus to bypass St4 and/or 5 clusters
123 0 : fTriggerTrackStore = trackStore; // not owner
124 0 : delete fBypass;
125 0 : fBypass = new AliMUONTriggerTrackToTrackerClusters(fkTransformer,fTriggerTrackStore);
126 0 : return kTRUE;
127 0 : }
128 :
129 : //_____________________________________________________________________________
130 : void
131 : AliMUONLegacyClusterServer::UseDigits(TIter&, AliMUONVDigitStore*)
132 : {
133 : /// Give the iterator to our delegate if we have one, of issue and error
134 :
135 0 : AliError("Not implemented for this class, as we're not writing clusters, but reading them instead !");
136 0 : }
137 :
|