PandaRoot
PndPosCorrectorTask.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /********************************************************************************
14  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
15  * *
16  * This software is distributed under the terms of the *
17  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
18  * copied verbatim in the file "LICENSE" *
19  ********************************************************************************/
20 
25 #ifndef PndPosCorrectorTask_H
26 #define PndPosCorrectorTask_H
27 
28 #include "FairTask.h" // for FairTask, InitStatus
29 
30 #include "PndMapSorter.h"
31 
32 #include "Rtypes.h" // for Bool_t, Int_t, kTRUE, etc
33 #include "TString.h" // for TString
34 
35 class FairTimeStamp;
36 class TClonesArray;
37 
38 class PndPosCorrectorTask : public FairTask {
39  public:
42  : FairTask("SorterTask"), fPersistance(kTRUE), fInputBranch("MVDHitsPixelCorrectedSorted_event"), fInputArray(nullptr), fOutputBranch("MVDHitsPixelPosCorrected"), fFolder(),
43  fOutputArray(nullptr), fEntryNr(0)
44  {
45  SetVerbose(2);
46  }
47 
49  PndPosCorrectorTask(const char *name) : FairTask(name), fPersistance(kTRUE), fInputBranch(), fInputArray(nullptr), fOutputBranch(), fFolder(), fOutputArray(nullptr), fEntryNr(0)
50  {
51  SetVerbose(2);
52  }
53 
54  PndPosCorrectorTask(TString inputBranch, TString outputBranch, TString folderName)
55  : FairTask("Corrector"), fPersistance(kTRUE), fInputBranch(inputBranch), fInputArray(nullptr), fOutputBranch(outputBranch), fFolder(folderName), fOutputArray(nullptr),
56  fEntryNr(0)
57  {
58  SetVerbose(2);
59  }
60 
62  virtual ~PndPosCorrectorTask() {}
63 
65  virtual InitStatus Init();
66  virtual InitStatus ReInit();
67 
69  virtual void Exec(Option_t *opt);
70  virtual void FinishEvent();
71  virtual void FinishTask();
72 
73  void SetCorrectionValue(Int_t sensorId, Double_t xvalue, Double_t yvalue) { fPosCorrectionMap[sensorId] = std::make_pair(xvalue, yvalue); }
74 
75  virtual void SetParContainers(){};
76 
77  void SetPersistance(Bool_t p = kTRUE) { fPersistance = p; };
78  Bool_t GetPersistance() { return fPersistance; };
79 
80  protected:
82  Bool_t fPersistance;
84  TString fInputBranch;
85  TClonesArray *fInputArray;
87  TString fOutputBranch;
88  TString fFolder;
89  TClonesArray *fOutputArray;
90  Int_t fEntryNr;
91  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
94 
96 };
97 
98 #endif
virtual void SetParContainers()
virtual void FinishTask()
PndPosCorrectorTask & operator=(const PndPosCorrectorTask &)
virtual void FinishEvent()
ClassDef(PndPosCorrectorTask, 1)
virtual InitStatus ReInit()
virtual void Exec(Option_t *opt)
PndPosCorrectorTask(TString inputBranch, TString outputBranch, TString folderName)
PndPosCorrectorTask(const char *name)
void SetCorrectionValue(Int_t sensorId, Double_t xvalue, Double_t yvalue)
std::map< Int_t, std::pair< Double_t, Double_t > > fPosCorrectionMap
virtual InitStatus Init()
TClonesArray * fOutputArray
void SetPersistance(Bool_t p=kTRUE)
TClonesArray * fInputArray