FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PndTSCorrectorTask Class Reference

#include <PndTSCorrectorTask.h>

Inheritance diagram for PndTSCorrectorTask:

Public Member Functions

 PndTSCorrectorTask ()
 
 PndTSCorrectorTask (const char *name)
 
 PndTSCorrectorTask (TString inputBranch, TString outputBranch, TString folderName)
 
virtual ~PndTSCorrectorTask ()
 
virtual InitStatus Init ()
 
virtual InitStatus ReInit ()
 
virtual void Exec (Option_t *opt)
 
virtual void FinishEvent ()
 
virtual void FinishTask ()
 
void SetCorrectionValue (Int_t sensorId, Int_t value)
 
virtual void SetParContainers ()
 
void SetPersistance (Bool_t p=kTRUE)
 
Bool_t GetPersistance ()
 

Protected Member Functions

 PndTSCorrectorTask (const PndTSCorrectorTask &)
 
PndTSCorrectorTaskoperator= (const PndTSCorrectorTask &)
 
 ClassDef (PndTSCorrectorTask, 2)
 

Protected Attributes

Bool_t fPersistance
 
TString fInputBranch
 
TClonesArray * fInputArray
 
TString fOutputBranch
 
TString fFolder
 
TClonesArray * fOutputArray
 
Int_t fEntryNr
 
std::map< Int_t, Int_t > fTSCorrectionMap
 

Detailed Description

Definition at line 26 of file PndTSCorrectorTask.h.

Constructor & Destructor Documentation

PndTSCorrectorTask::PndTSCorrectorTask ( )
inline

Default constructor

Definition at line 31 of file PndTSCorrectorTask.h.

References SetVerbose().

31  :
32  FairTask("SorterTask"),
33  fPersistance(kTRUE),
34  fInputBranch("MVDHitsPixel"),
35  fInputArray(0),
36  fOutputBranch("MVDHitsPixelCorrected"),
37  fFolder(),
38  fOutputArray(0),
39  fEntryNr(0)
40  {
41  SetVerbose(2);
42  }
TClonesArray * fInputArray
TClonesArray * fOutputArray
drchit SetVerbose(iVerbose)
PndTSCorrectorTask::PndTSCorrectorTask ( const char *  name)
inline

Named constructor

Definition at line 45 of file PndTSCorrectorTask.h.

References SetVerbose().

45  :
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  }
TClonesArray * fInputArray
TString name
TClonesArray * fOutputArray
drchit SetVerbose(iVerbose)
PndTSCorrectorTask::PndTSCorrectorTask ( TString  inputBranch,
TString  outputBranch,
TString  folderName 
)
inline

Definition at line 58 of file PndTSCorrectorTask.h.

References SetVerbose().

58  :
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  }
TClonesArray * fInputArray
TClonesArray * fOutputArray
drchit SetVerbose(iVerbose)
virtual PndTSCorrectorTask::~PndTSCorrectorTask ( )
inlinevirtual

Destructor

Definition at line 72 of file PndTSCorrectorTask.h.

72  {
73  }
PndTSCorrectorTask::PndTSCorrectorTask ( const PndTSCorrectorTask )
protected

Member Function Documentation

PndTSCorrectorTask::ClassDef ( PndTSCorrectorTask  ,
 
)
protected
void PndTSCorrectorTask::Exec ( Option_t *  opt)
virtual

Virtual method Exec

Definition at line 55 of file PndTSCorrectorTask.cxx.

References Double_t, fEntryNr, fInputArray, fOutputArray, fTSCorrectionMap, fVerbose, PndSdsHit::GetSensorID(), and i.

56 {
57 
58 // fInputArray = (FairRootManager::Instance()->GetTClonesArray(fInputBranch);
59  if (fVerbose > 1 && ++fEntryNr % 1000 == 0) {
60  std::cout << "-I- PndTSCorrectorTask: Event " << fEntryNr << " Size PixelArray: " << fInputArray->GetEntriesFast() << std::endl;
61  }
62  Double_t timeOfLast = 0;
63  for (int i = 0; i < fInputArray->GetEntriesFast(); i++) {
64  PndSdsHit* myData = (PndSdsHit*)fInputArray->At(i);
65  myData->SetTimeStamp(myData->GetTimeStamp() + fTSCorrectionMap[myData->GetSensorID()]);
66  (*fOutputArray)[fOutputArray->GetEntries()] = myData->Clone();
67  // delete(myData);
68  }
69  fOutputArray->Sort();
70 }
int fVerbose
Definition: poormantracks.C:24
TClonesArray * fInputArray
Int_t i
Definition: run_full.C:25
std::map< Int_t, Int_t > fTSCorrectionMap
Double_t
TClonesArray * fOutputArray
Int_t GetSensorID() const
Definition: PndSdsHit.h:90
void PndTSCorrectorTask::FinishEvent ( )
virtual

Definition at line 74 of file PndTSCorrectorTask.cxx.

References fOutputArray.

75 {
76  fOutputArray->Delete();
77 }
TClonesArray * fOutputArray
void PndTSCorrectorTask::FinishTask ( )
virtual

Definition at line 79 of file PndTSCorrectorTask.cxx.

80 {
81 }
Bool_t PndTSCorrectorTask::GetPersistance ( )
inline

Definition at line 91 of file PndTSCorrectorTask.h.

References fPersistance.

91 {return fPersistance;};
InitStatus PndTSCorrectorTask::Init ( )
virtual

Virtual method Init

Definition at line 33 of file PndTSCorrectorTask.cxx.

References fFolder, fInputArray, fInputBranch, fOutputArray, fOutputBranch, fPersistance, and fVerbose.

34 {
35 
36  FairRootManager* ioman = FairRootManager::Instance();
37  if ( ! ioman ) {
38  std::cout << "-E- PndTSCorrectorTaskT::Init: "
39  << "RootManager not instantiated!" << std::endl;
40  return kFATAL;
41  }
42 
43  // Create and register output array
44  fInputArray = (TClonesArray*)FairRootManager::Instance()->GetObject(fInputBranch);
45 
46  if(fVerbose>1) { Info("Init","Registering this branch: %s/%s",fFolder.Data(),fOutputBranch.Data()); }
47  fOutputArray = ioman->Register(fOutputBranch, fInputArray->GetClass()->GetName(), fFolder, fPersistance);
48 
49 
50  return kSUCCESS;
51 }
int fVerbose
Definition: poormantracks.C:24
TClonesArray * fInputArray
TClonesArray * fOutputArray
PndTSCorrectorTask& PndTSCorrectorTask::operator= ( const PndTSCorrectorTask )
protected
InitStatus PndTSCorrectorTask::ReInit ( )
virtual

Definition at line 27 of file PndTSCorrectorTask.cxx.

28 {
29  return kSUCCESS;
30 }
void PndTSCorrectorTask::SetCorrectionValue ( Int_t  sensorId,
Int_t  value 
)
inline

Definition at line 84 of file PndTSCorrectorTask.h.

References fTSCorrectionMap.

84  {
85  fTSCorrectionMap[sensorId] = value;
86  }
std::map< Int_t, Int_t > fTSCorrectionMap
virtual void PndTSCorrectorTask::SetParContainers ( )
inlinevirtual

Definition at line 88 of file PndTSCorrectorTask.h.

88 {};
void PndTSCorrectorTask::SetPersistance ( Bool_t  p = kTRUE)
inline

Definition at line 90 of file PndTSCorrectorTask.h.

References fPersistance, and p.

90 {fPersistance=p;};
Double_t p
Definition: anasim.C:58

Member Data Documentation

Int_t PndTSCorrectorTask::fEntryNr
protected

Definition at line 105 of file PndTSCorrectorTask.h.

Referenced by Exec().

TString PndTSCorrectorTask::fFolder
protected

Definition at line 103 of file PndTSCorrectorTask.h.

Referenced by Init().

TClonesArray* PndTSCorrectorTask::fInputArray
protected

Definition at line 100 of file PndTSCorrectorTask.h.

Referenced by Exec(), and Init().

TString PndTSCorrectorTask::fInputBranch
protected

Input array of PndSdsPixelDigis

Definition at line 99 of file PndTSCorrectorTask.h.

Referenced by Init().

TClonesArray* PndTSCorrectorTask::fOutputArray
protected

Definition at line 104 of file PndTSCorrectorTask.h.

Referenced by Exec(), FinishEvent(), and Init().

TString PndTSCorrectorTask::fOutputBranch
protected

Output array of sorted PndSdsDigis

Definition at line 102 of file PndTSCorrectorTask.h.

Referenced by Init().

Bool_t PndTSCorrectorTask::fPersistance
protected

switch to turn on/off storing the arrays to a file

Definition at line 91 of file PndTSCorrectorTask.h.

Referenced by GetPersistance(), Init(), and SetPersistance().

std::map<Int_t, Int_t> PndTSCorrectorTask::fTSCorrectionMap
protected

Definition at line 106 of file PndTSCorrectorTask.h.

Referenced by Exec(), and SetCorrectionValue().


The documentation for this class was generated from the following files: