PandaRoot
PndTSCorrectorTask.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 PndTSCorrectorTask_H
26 #define PndTSCorrectorTask_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 PndTSCorrectorTask : public FairTask {
39  public:
42  : FairTask("SorterTask"), fPersistance(kTRUE), fInputBranch("MVDHitsPixel"), fInputArray(nullptr), fOutputBranch("MVDHitsPixelCorrected"), fFolder(), fOutputArray(nullptr),
43  fEntryNr(0)
44  {
45  SetVerbose(2);
46  }
47 
49  PndTSCorrectorTask(const char *name) : FairTask(name), fPersistance(kTRUE), fInputBranch(), fInputArray(nullptr), fOutputBranch(), fFolder(), fOutputArray(nullptr), fEntryNr(0)
50  {
51  SetVerbose(2);
52  }
53 
54  PndTSCorrectorTask(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 ~PndTSCorrectorTask() {}
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, Int_t value) { fTSCorrectionMap[sensorId] = value; }
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, Int_t> fTSCorrectionMap; //< first value is sensor ID, second parameter is correction value which is added to the time stamps
94 
96 };
97 
98 #endif
virtual void FinishEvent()
TClonesArray * fInputArray
virtual void SetParContainers()
ClassDef(PndTSCorrectorTask, 2)
void SetPersistance(Bool_t p=kTRUE)
PndTSCorrectorTask(const char *name)
PndTSCorrectorTask & operator=(const PndTSCorrectorTask &)
virtual void Exec(Option_t *opt)
std::map< Int_t, Int_t > fTSCorrectionMap
virtual InitStatus Init()
PndTSCorrectorTask(TString inputBranch, TString outputBranch, TString folderName)
TClonesArray * fOutputArray
virtual InitStatus ReInit()
void SetCorrectionValue(Int_t sensorId, Int_t value)
virtual void FinishTask()