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 */
9 /// \class AliAnalysisTaskMuonRefit
10 /// \brief intermediate task for refitting
11 //Author: Philippe Pillot - SUBATECH Nantes
14 #include "AliAnalysisTaskSE.h"
16 class AliMUONVCluster;
17 class AliMUONGeometryTransformer;
18 class AliMUONESDInterface;
19 class AliMUONRefitter;
20 class AliMUONTriggerCircuit;
21 class AliMUONTrackHitPattern;
23 class AliAnalysisTaskMuonRefit : public AliAnalysisTaskSE {
26 AliAnalysisTaskMuonRefit();
27 AliAnalysisTaskMuonRefit(const char *name);
28 virtual ~AliAnalysisTaskMuonRefit();
30 /// Set location of the default OCDB storage (if not set use "raw://")
31 void SetDefaultStorage(const char* ocdbPath) { fDefaultStorage = ocdbPath; }
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]);
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;}
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;}
45 /// Set the OCDB path to the alignment file used in the reco (if not set use default storage)
46 void SetAlignStorage(const char* ocdbPath) { fOldAlignStorage = ocdbPath; }
48 // set the OCDB path to the alignment files to be used to realign the clusters before refitting
49 void ReAlign(const char* oldAlignStorage = 0x0, const char* newAlignStorage = "");
51 // Set the magnetic field map to be used during refitting
52 void SetFieldPath(const char* field) { fField = field; }
54 /// set the flag to remove mono-cathod clusters (either considering all the pads or only the ones directly below)
55 void RemoveMonoCathodClusters(Bool_t flag = kTRUE, Bool_t checkAllPads = kTRUE) {fRemoveMonoCathCl = flag; fCheckAllPads = checkAllPads;}
57 /// Tag the refitted tracks rejected by improvement (or no longer matched) instead of removing them (or the trigger part)
58 /// Eventually keep the old track parameters if the refitted track no longer match the trigger
59 void TagBadTracks(Bool_t tag = kTRUE, Bool_t keep = kTRUE) {fTagBadTracks = tag; fKeepOldParam = keep;}
61 virtual void UserCreateOutputObjects();
62 virtual void UserExec(Option_t *);
63 virtual void NotifyRun();
64 virtual void Terminate(Option_t *);
69 AliAnalysisTaskMuonRefit(const AliAnalysisTaskMuonRefit& rhs);
71 AliAnalysisTaskMuonRefit& operator = (const AliAnalysisTaskMuonRefit& rhs);
73 void ModifyCluster(AliMUONVCluster& cl);
74 void CheckPads(AliMUONVCluster *cl, Bool_t &hasBending, Bool_t &hasNonBending) const;
75 void CheckPadsBelow(AliMUONVCluster *cl, Bool_t &hasBending, Bool_t &hasNonBending) const;
76 Bool_t SetMagField() const;
80 Double_t fClusterResNB[10]; ///< cluster resolution in non-bending direction
81 Double_t fClusterResB[10]; ///< cluster resolution in bending direction
83 TString fDefaultStorage; ///< location of the default OCDB storage
84 Bool_t fImproveTracks; ///< enable track improvement
85 Double_t fSigmaCut; ///< sigma cut for track improvement
86 Double_t fSigmaCutForTrigger; ///< sigma cut for tracker/trigger track matching
87 Bool_t fReAlign; ///< flag telling wether to re-align the spectrometer or not before refitting
88 TString fOldAlignStorage; ///< location of the OCDB storage where to find old MUON/Align/Data (use the default one if empty)
89 TString fNewAlignStorage; ///< location of the OCDB storage where to find new MUON/Align/Data (use the default one if empty)
90 AliMUONGeometryTransformer *fOldGeoTransformer; //!< geometry transformer used to recontruct the present data
91 AliMUONGeometryTransformer *fNewGeoTransformer; //!< new geometry transformer containing the new alignment to be applied
92 TString fField; ///< magnetic field map to be used during refitting
93 Bool_t fRemoveMonoCathCl; ///< remove or not the mono-cathod clusters
94 Bool_t fCheckAllPads; ///< use all pads or only the ones directly below the cluster to look for mono-cathods
95 Bool_t fTagBadTracks; ///< tag the bad tracks instead of removing them
96 Bool_t fKeepOldParam; ///< keep old track parameters if the refitted track no longer match the trigger
98 AliMUONTriggerCircuit *fTriggerCircuit; //!< trigger circuit
99 AliMUONESDInterface *fESDInterface; //!< esd interface to recover muon objects
100 AliMUONRefitter *fRefitter; //!< refitter object
101 AliMUONTrackHitPattern *fTrackHitPattern; //!< object to perform the tracker/trigger track matching
103 ClassDef(AliAnalysisTaskMuonRefit, 2); // track refitter
106 //________________________________________________________________________
107 inline void AliAnalysisTaskMuonRefit::ResetClusterResolution(Int_t chId, Double_t valNB, Double_t valB)
109 /// set chamber non-bending and bending resolutions
110 if (chId < 0 || chId >= 10) return;
111 fClusterResNB[chId] = valNB;
112 fClusterResB[chId] = valB;
115 //________________________________________________________________________
116 inline void AliAnalysisTaskMuonRefit::ResetClusterResolution(Double_t valNB[10], Double_t valB[10])
118 /// set chambers non-bending and bending resolutions
119 for (Int_t i = 0; i < 10; i++) {
120 fClusterResNB[i] = valNB[i];
121 fClusterResB[i] = valB[i];
125 //________________________________________________________________________
126 inline void AliAnalysisTaskMuonRefit::ReAlign(const char* oldAlignStorage, const char* newAlignStorage)
128 /// Set the flag to activate the re-alignment and the specific storage where to find the old/new alignment data.
129 /// If oldAlignStorage = 0x0 we assume the spectrometer was not aligned before (default geometry)
130 /// If old(new)AlignStorage = "" we assume the old(new) alignment data are in the default storage
131 if (oldAlignStorage) fOldAlignStorage = oldAlignStorage;
132 else fOldAlignStorage = "none";
133 fNewAlignStorage = newAlignStorage;