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

#include <PndPosCorrectorTask.h>

Inheritance diagram for PndPosCorrectorTask:

Public Member Functions

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

Protected Member Functions

 PndPosCorrectorTask (const PndPosCorrectorTask &)
 
PndPosCorrectorTaskoperator= (const PndPosCorrectorTask &)
 
 ClassDef (PndPosCorrectorTask, 1)
 

Protected Attributes

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

Detailed Description

Definition at line 26 of file PndPosCorrectorTask.h.

Constructor & Destructor Documentation

PndPosCorrectorTask::PndPosCorrectorTask ( )
inline

Default constructor

Definition at line 31 of file PndPosCorrectorTask.h.

References SetVerbose().

31  :
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  }
TClonesArray * fOutputArray
drchit SetVerbose(iVerbose)
TClonesArray * fInputArray
PndPosCorrectorTask::PndPosCorrectorTask ( const char *  name)
inline

Named constructor

Definition at line 45 of file PndPosCorrectorTask.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  }
TString name
TClonesArray * fOutputArray
drchit SetVerbose(iVerbose)
TClonesArray * fInputArray
PndPosCorrectorTask::PndPosCorrectorTask ( TString  inputBranch,
TString  outputBranch,
TString  folderName 
)
inline

Definition at line 58 of file PndPosCorrectorTask.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 * fOutputArray
drchit SetVerbose(iVerbose)
TClonesArray * fInputArray
virtual PndPosCorrectorTask::~PndPosCorrectorTask ( )
inlinevirtual

Destructor

Definition at line 72 of file PndPosCorrectorTask.h.

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

Member Function Documentation

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

Virtual method Exec

Definition at line 55 of file PndPosCorrectorTask.cxx.

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

56 {
57 
58 // fInputArray = (FairRootManager::Instance()->GetTClonesArray(fInputBranch);
59  if (fVerbose > 1 && ++fEntryNr % 1000 == 0) {
60  std::cout << "-I- PndPosCorrectorTask: 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->SetX(myData->GetX() - fPosCorrectionMap[myData->GetSensorID()].first);
66  myData->SetY(myData->GetY() - fPosCorrectionMap[myData->GetSensorID()].second);
67 
68  (*fOutputArray)[fOutputArray->GetEntries()] = myData->Clone();
69  // delete(myData);
70  }
71  //fOutputArray->Sort();
72 }
int fVerbose
Definition: poormantracks.C:24
Int_t i
Definition: run_full.C:25
Double_t
std::map< Int_t, std::pair< Double_t, Double_t > > fPosCorrectionMap
TClonesArray * fOutputArray
Int_t GetSensorID() const
Definition: PndSdsHit.h:90
TClonesArray * fInputArray
void PndPosCorrectorTask::FinishEvent ( )
virtual

Definition at line 76 of file PndPosCorrectorTask.cxx.

References fOutputArray.

77 {
78  fOutputArray->Delete();
79 }
TClonesArray * fOutputArray
void PndPosCorrectorTask::FinishTask ( )
virtual

Definition at line 81 of file PndPosCorrectorTask.cxx.

82 {
83 }
Bool_t PndPosCorrectorTask::GetPersistance ( )
inline

Definition at line 91 of file PndPosCorrectorTask.h.

References fPersistance.

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

Virtual method Init

Definition at line 33 of file PndPosCorrectorTask.cxx.

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

34 {
35 
36  FairRootManager* ioman = FairRootManager::Instance();
37  if ( ! ioman ) {
38  std::cout << "-E- PndPosCorrectorTaskT::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 * fOutputArray
TClonesArray * fInputArray
PndPosCorrectorTask& PndPosCorrectorTask::operator= ( const PndPosCorrectorTask )
protected
InitStatus PndPosCorrectorTask::ReInit ( )
virtual

Definition at line 27 of file PndPosCorrectorTask.cxx.

28 {
29  return kSUCCESS;
30 }
void PndPosCorrectorTask::SetCorrectionValue ( Int_t  sensorId,
Double_t  xvalue,
Double_t  yvalue 
)
inline

Definition at line 84 of file PndPosCorrectorTask.h.

References fPosCorrectionMap.

84  {
85  fPosCorrectionMap[sensorId] = std::make_pair(xvalue, yvalue);
86  }
std::map< Int_t, std::pair< Double_t, Double_t > > fPosCorrectionMap
virtual void PndPosCorrectorTask::SetParContainers ( )
inlinevirtual

Definition at line 88 of file PndPosCorrectorTask.h.

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

Definition at line 90 of file PndPosCorrectorTask.h.

References fPersistance, and p.

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

Member Data Documentation

Int_t PndPosCorrectorTask::fEntryNr
protected

Definition at line 105 of file PndPosCorrectorTask.h.

Referenced by Exec().

TString PndPosCorrectorTask::fFolder
protected

Definition at line 103 of file PndPosCorrectorTask.h.

Referenced by Init().

TClonesArray* PndPosCorrectorTask::fInputArray
protected

Definition at line 100 of file PndPosCorrectorTask.h.

Referenced by Exec(), and Init().

TString PndPosCorrectorTask::fInputBranch
protected

Input array of PndSdsPixelDigis

Definition at line 99 of file PndPosCorrectorTask.h.

Referenced by Init().

TClonesArray* PndPosCorrectorTask::fOutputArray
protected

Definition at line 104 of file PndPosCorrectorTask.h.

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

TString PndPosCorrectorTask::fOutputBranch
protected

Output array of sorted PndSdsDigis

Definition at line 102 of file PndPosCorrectorTask.h.

Referenced by Init().

Bool_t PndPosCorrectorTask::fPersistance
protected

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

Definition at line 91 of file PndPosCorrectorTask.h.

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

std::map<Int_t, std::pair<Double_t, Double_t> > PndPosCorrectorTask::fPosCorrectionMap
protected

Definition at line 106 of file PndPosCorrectorTask.h.

Referenced by Exec(), and SetCorrectionValue().


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