]>
Commit | Line | Data |
---|---|---|
d0cf54cd | 1 | #ifndef ALIANALYSISTASKMUONREFIT_H |
2 | #define ALIANALYSISTASKMUONREFIT_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
27de2dfb | 6 | /* $Id$ */ |
7 | ||
d0cf54cd | 8 | /// \ingroup muondep |
9 | /// \class AliAnalysisTaskMuonRefit | |
10 | /// \brief intermediate task for refitting | |
11 | //Author: Philippe Pillot - SUBATECH Nantes | |
12 | ||
13 | #include <TString.h> | |
d0cf54cd | 14 | #include "AliAnalysisTaskSE.h" |
15 | ||
16 | class AliMUONVCluster; | |
17 | class AliMUONGeometryTransformer; | |
18 | class AliMUONESDInterface; | |
19 | class AliMUONRefitter; | |
07f39716 | 20 | class AliMUONTriggerCircuit; |
21 | class AliMUONTrackHitPattern; | |
d0cf54cd | 22 | |
23 | class AliAnalysisTaskMuonRefit : public AliAnalysisTaskSE { | |
24 | public: | |
25 | ||
26 | AliAnalysisTaskMuonRefit(); | |
27 | AliAnalysisTaskMuonRefit(const char *name); | |
28 | virtual ~AliAnalysisTaskMuonRefit(); | |
29 | ||
30 | /// Set location of the default OCDB storage (if not set use "raw://") | |
31 | void SetDefaultStorage(const char* ocdbPath) { fDefaultStorage = ocdbPath; } | |
32 | ||
33 | // reset the cluster resolution (by default use the one set in the recoParam) | |
34 | void ResetClusterResolution(Int_t chId, Double_t valNB, Double_t valB); | |
35 | void ResetClusterResolution(Double_t valNB[10], Double_t valB[10]); | |
36 | ||
37 | /// Enable track improvement (clusters/tracks that do not pass the sigma cut will be removed) | |
38 | /// If sigmaCut < 0: use the one set in the recoParam | |
39 | /// By default the "improveTrack" flag and the sigma cut are taken from the recoParam | |
40 | void ImproveTracks(Bool_t flag = kTRUE, Double_t sigmaCut = -1.) {fImproveTracks = flag; fSigmaCut = sigmaCut;} | |
41 | ||
42 | /// Set the sigma cut for tracker/trigger track matching (by default use the one set in the recoParam) | |
43 | void SetSigmaCutForTrigger(Double_t val) {fSigmaCutForTrigger = val;} | |
44 | ||
07f39716 | 45 | // set the OCDB path to the alignment files to be used to realign the clusters before refitting |
d0cf54cd | 46 | void ReAlign(const char* oldAlignStorage = 0x0, const char* newAlignStorage = ""); |
47 | ||
07f39716 | 48 | // Set the magnetic field map to be used during refitting |
49 | void SetFieldPath(const char* field) { fField = field; } | |
50 | ||
51 | /// set the flag to remove mono-cathod clusters (either considering all the pads or only the ones directly below) | |
52 | void RemoveMonoCathodClusters(Bool_t flag = kTRUE, Bool_t checkAllPads = kTRUE) {fRemoveMonoCathCl = flag; fCheckAllPads = checkAllPads;} | |
53 | ||
54 | /// Tag the refitted tracks rejected by improvement (or no longer matched) instead of removing them (or the trigger part) | |
55 | /// Eventually keep the old track parameters if the refitted track no longer match the trigger | |
56 | void TagBadTracks(Bool_t tag = kTRUE, Bool_t keep = kTRUE) {fTagBadTracks = tag; fKeepOldParam = keep;} | |
57 | ||
d0cf54cd | 58 | virtual void UserCreateOutputObjects(); |
59 | virtual void UserExec(Option_t *); | |
60 | virtual void NotifyRun(); | |
61 | virtual void Terminate(Option_t *); | |
62 | ||
63 | private: | |
64 | ||
65 | /// Not implemented | |
66 | AliAnalysisTaskMuonRefit(const AliAnalysisTaskMuonRefit& rhs); | |
67 | /// Not implemented | |
68 | AliAnalysisTaskMuonRefit& operator = (const AliAnalysisTaskMuonRefit& rhs); | |
69 | ||
70 | void ModifyCluster(AliMUONVCluster& cl); | |
07f39716 | 71 | void CheckPads(AliMUONVCluster *cl, Bool_t &hasBending, Bool_t &hasNonBending) const; |
72 | void CheckPadsBelow(AliMUONVCluster *cl, Bool_t &hasBending, Bool_t &hasNonBending) const; | |
73 | Bool_t SetMagField() const; | |
d0cf54cd | 74 | |
75 | private: | |
76 | ||
77 | Double_t fClusterResNB[10]; ///< cluster resolution in non-bending direction | |
78 | Double_t fClusterResB[10]; ///< cluster resolution in bending direction | |
79 | ||
07f39716 | 80 | TString fDefaultStorage; ///< location of the default OCDB storage |
81 | Bool_t fImproveTracks; ///< enable track improvement | |
82 | Double_t fSigmaCut; ///< sigma cut for track improvement | |
83 | Double_t fSigmaCutForTrigger; ///< sigma cut for tracker/trigger track matching | |
84 | Bool_t fReAlign; ///< flag telling wether to re-align the spectrometer or not before refitting | |
85 | TString fOldAlignStorage; ///< location of the OCDB storage where to find old MUON/Align/Data (use the default one if empty) | |
86 | TString fNewAlignStorage; ///< location of the OCDB storage where to find new MUON/Align/Data (use the default one if empty) | |
87 | AliMUONGeometryTransformer *fOldGeoTransformer; //!< geometry transformer used to recontruct the present data | |
88 | AliMUONGeometryTransformer *fNewGeoTransformer; //!< new geometry transformer containing the new alignment to be applied | |
89 | TString fField; ///< magnetic field map to be used during refitting | |
90 | Bool_t fRemoveMonoCathCl; ///< remove or not the mono-cathod clusters | |
91 | Bool_t fCheckAllPads; ///< use all pads or only the ones directly below the cluster to look for mono-cathods | |
92 | Bool_t fTagBadTracks; ///< tag the bad tracks instead of removing them | |
93 | Bool_t fKeepOldParam; ///< keep old track parameters if the refitted track no longer match the trigger | |
94 | ||
95 | AliMUONTriggerCircuit *fTriggerCircuit; //!< trigger circuit | |
96 | AliMUONESDInterface *fESDInterface; //!< esd interface to recover muon objects | |
97 | AliMUONRefitter *fRefitter; //!< refitter object | |
98 | AliMUONTrackHitPattern *fTrackHitPattern; //!< object to perform the tracker/trigger track matching | |
d0cf54cd | 99 | |
07f39716 | 100 | ClassDef(AliAnalysisTaskMuonRefit, 2); // track refitter |
d0cf54cd | 101 | }; |
102 | ||
103 | //________________________________________________________________________ | |
104 | inline void AliAnalysisTaskMuonRefit::ResetClusterResolution(Int_t chId, Double_t valNB, Double_t valB) | |
105 | { | |
106 | /// set chamber non-bending and bending resolutions | |
09c18f72 | 107 | if (chId < 0 || chId >= 10) return; |
d0cf54cd | 108 | fClusterResNB[chId] = valNB; |
109 | fClusterResB[chId] = valB; | |
110 | } | |
111 | ||
112 | //________________________________________________________________________ | |
113 | inline void AliAnalysisTaskMuonRefit::ResetClusterResolution(Double_t valNB[10], Double_t valB[10]) | |
114 | { | |
115 | /// set chambers non-bending and bending resolutions | |
09c18f72 | 116 | for (Int_t i = 0; i < 10; i++) { |
d0cf54cd | 117 | fClusterResNB[i] = valNB[i]; |
118 | fClusterResB[i] = valB[i]; | |
119 | } | |
120 | } | |
121 | ||
122 | //________________________________________________________________________ | |
123 | inline void AliAnalysisTaskMuonRefit::ReAlign(const char* oldAlignStorage, const char* newAlignStorage) | |
124 | { | |
125 | /// Set the flag to activate the re-alignment and the specific storage where to find the old/new alignment data. | |
126 | /// If oldAlignStorage = 0x0 we assume the spectrometer was not aligned before (default geometry) | |
127 | /// If old(new)AlignStorage = "" we assume the old(new) alignment data are in the default storage | |
128 | if (oldAlignStorage) fOldAlignStorage = oldAlignStorage; | |
129 | else fOldAlignStorage = "none"; | |
130 | fNewAlignStorage = newAlignStorage; | |
131 | fReAlign = kTRUE; | |
132 | } | |
133 | ||
134 | #endif | |
135 |