FairRoot/PandaRoot
PndPosCorrectorTask.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
13 #ifndef PndPosCorrectorTask_H
14 #define PndPosCorrectorTask_H
15 
16 #include "FairTask.h" // for FairTask, InitStatus
17 
18 #include "PndMapSorter.h"
19 
20 #include "Rtypes.h" // for Bool_t, Int_t, kTRUE, etc
21 #include "TString.h" // for TString
22 
23 class FairTimeStamp;
24 class TClonesArray;
25 
26 class PndPosCorrectorTask : public FairTask
27 {
28  public:
29 
32  FairTask("SorterTask"),
33  fPersistance(kTRUE),
34  fInputBranch("MVDHitsPixelCorrectedSorted_event"),
35  fInputArray(0),
36  fOutputBranch("MVDHitsPixelPosCorrected"),
37  fFolder(),
38  fOutputArray(0),
39  fEntryNr(0)
40  {
41  SetVerbose(2);
42  }
43 
45  PndPosCorrectorTask(const char* name):
46  FairTask(name),
47  fPersistance(kTRUE),
48  fInputBranch(),
49  fInputArray(0),
50  fOutputBranch(),
51  fFolder(),
52  fOutputArray(0),
53  fEntryNr(0)
54  {
55  SetVerbose(2);
56  }
57 
58  PndPosCorrectorTask(TString inputBranch, TString outputBranch, TString folderName):
59  FairTask("Corrector"),
60  fPersistance(kTRUE),
61  fInputBranch(inputBranch),
62  fInputArray(0),
63  fOutputBranch(outputBranch),
64  fFolder(folderName),
65  fOutputArray(0),
66  fEntryNr(0)
67  {
68  SetVerbose(2);
69  }
70 
73  }
74 
76  virtual InitStatus Init();
77  virtual InitStatus ReInit();
78 
80  virtual void Exec(Option_t* opt);
81  virtual void FinishEvent();
82  virtual void FinishTask();
83 
84  void SetCorrectionValue(Int_t sensorId, Double_t xvalue, Double_t yvalue){
85  fPosCorrectionMap[sensorId] = std::make_pair(xvalue, yvalue);
86  }
87 
88  virtual void SetParContainers() {};
89 
90  void SetPersistance(Bool_t p = kTRUE) {fPersistance=p;};
92 
93 
94  protected:
95 
100  TClonesArray* fInputArray;
104  TClonesArray* fOutputArray;
105  Int_t fEntryNr;
106  std::map<Int_t, std::pair<Double_t, Double_t>> fPosCorrectionMap; //< first value is sensor ID, second parameter is correction values for x and y
109 
111 
112 };
113 
114 #endif
Double_t p
Definition: anasim.C:58
virtual void SetParContainers()
PndPosCorrectorTask & operator=(const PndPosCorrectorTask &)
ClassDef(PndPosCorrectorTask, 1)
PndPosCorrectorTask(TString inputBranch, TString outputBranch, TString folderName)
PndPosCorrectorTask(const char *name)
virtual void Exec(Option_t *opt)
Double_t
void SetCorrectionValue(Int_t sensorId, Double_t xvalue, Double_t yvalue)
std::map< Int_t, std::pair< Double_t, Double_t > > fPosCorrectionMap
TString name
TClonesArray * fOutputArray
virtual InitStatus Init()
void SetPersistance(Bool_t p=kTRUE)
drchit SetVerbose(iVerbose)
TClonesArray * fInputArray
virtual InitStatus ReInit()