HighLAND
Public Member Functions | Protected Attributes | List of all members
tutorialCorrection Class Reference
Inheritance diagram for tutorialCorrection:
CorrectionBase

Public Member Functions

void Apply (AnaSpillC &spill)
 
- Public Member Functions inherited from CorrectionBase
 CorrectionBase (const CorrectionBase &corr)
 Copy constructor.
 
virtual ~CorrectionBase ()
 Everyone should have a destructor.
 
virtual const char * GetName () const
 Return the name of this correction. This overrides the TObject::GetName() interface.
 
const std::string & Name () const
 Return the name of this correction.
 
void SetName (const std::string &name)
 Set the name of this correction.
 
void Enable ()
 Enable the correction.
 
void Disable ()
 Disable the correction.
 
bool IsEnabled () const
 Is the correction enabled.
 
void SetAppliedInInput (bool ap)
 Set the correction as applied in the input file.
 
bool IsAppliedInInput () const
 Is the correction already applied in the input file ?
 
Int_t GetIndex () const
 Return the index of this correction.
 
void SetIndex (Int_t index)
 Set the index of this correction.
 
 ClassDef (CorrectionBase, 2)
 

Protected Attributes

UInt_t _nRunPeriods
 
Float_t _correction [NMAXRUNPERIODS]
 
- Protected Attributes inherited from CorrectionBase
std::string _name
 The name of this correction.
 
bool _enabled
 Is the correction enabled?
 
bool _appliedInInput
 Is the correction already applied in the input file ?
 
Int_t _index
 The index of the correction.
 

Detailed Description

Definition at line 8 of file tutorialCorrection.hxx.

Member Function Documentation

§ Apply()

void tutorialCorrection::Apply ( AnaSpillC spill)
virtual

This is the function that applies the correction to the input data. This MUST be overridden in the derived class.

Reimplemented from CorrectionBase.

Definition at line 54 of file tutorialCorrection.cxx.

54  {
55 //********************************************************************
56 
57  // cast to AnaSpill type because AnaSpillC does not have event info
58  AnaSpill& spill = *static_cast<AnaSpill*>(&spillC);
59 
60  // No correction for MC
61  if (spill.GetIsMC()) return;
62 
63  // Get the run period (from 0 to 6)
64  Int_t runPeriod = anaUtils::GetRunPeriod(spill.EventInfo->Run);
65 
66  // Need a valid runPeriod
67  if (runPeriod<0 && runPeriod>=(Int_t)_nRunPeriods) return;
68 
69  // Move both the start and end position of all global tracks in all bunches
70  for (UInt_t i = 0; i < spill.Bunches.size(); i++) {
71  AnaBunchB* bunch = static_cast<AnaBunchB*>(spill.Bunches[i]);
72  for (UInt_t j = 0; j < bunch->Particles.size(); j++) {
73  AnaTrack* track = static_cast<AnaTrack*>(bunch->Particles[j]);
74  track->PositionStart[2] += _correction[runPeriod];
75  track->PositionEnd[2] += _correction[runPeriod];
76  }
77  }
78 
79 }
Float_t PositionStart[4]
The reconstructed start position of the particle.
Representation of a global track.
std::vector< AnaBunchC * > Bunches
The reconstructed objects, split into timing bunches.
AnaEventInfoB * EventInfo
Run, sunrun, event, time stamp, etc.
int GetRunPeriod(int run, int subrun=-1)
Returns the run period (sequentially: 0,1,2,3,4,5 ...)
bool GetIsMC() const
Return whether this spill is from Monte Carlo or not.
std::vector< AnaParticleB * > Particles
Float_t PositionEnd[4]
The reconstructed end position of the particle.
Int_t Run
The ND280 run number.

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