HighLAND
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FlipKinematicsCorrection Class Reference

#include <FlipKinematicsCorrection.hxx>

Inheritance diagram for FlipKinematicsCorrection:
CorrectionBase

Public Member Functions

 FlipKinematicsCorrection (SubDetId::SubDetEnum det=SubDetId::kFGD)
 
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 Member Functions

bool IsRelevantTrack (const AnaTrackB &track) const
 

Protected Attributes

SubDetId::SubDetEnum _det
 
- 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

Each track that has a TPC component present together with a segment in other detector should have an "alternate" re-fit with a reversed charge and direction Sometimes it happens that this reverse fit fails on oaRecon level, hence the info is not available, this correction "fixes" the problem by taking the closest (to the end point) TPC momentum and applying a "reversed" dEdX correction up to the end point

Definition at line 17 of file FlipKinematicsCorrection.hxx.

Member Function Documentation

§ Apply()

void FlipKinematicsCorrection::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 19 of file FlipKinematicsCorrection.cxx.

19  {
20 //********************************************************************
21 
22 
23  AnaSpill& spill = *static_cast<AnaSpill*>(&spillC);
24 
25  for (UInt_t i = 0; i < spill.Bunches.size(); i++) {
26  AnaBunch* bunch = static_cast<AnaBunch*>(spill.Bunches[i]);
27  for (UInt_t j = 0; j < bunch->Particles.size(); j++) {
28 
29  AnaTrack* track = static_cast<AnaTrack*>(bunch->Particles[j]);
30 
31  if (!track) continue;
32 
33  // Check whether a track is relevant to apply the correction
34  if (!IsRelevantTrack(*track)) continue;
35 
37 
38  if (!tpcTrack) continue;
39 
40  if (!cutUtils::TPCTrackQualityCut(*tpcTrack)) continue;
41 
42 #ifdef UseRecPack
43  track->MomentumFlip = -999.;
44  double momentum_tmp = tpcTrack->MomentumEnd;
45  if (ND::tman().CorrectEnergyLossLinear(tpcTrack->PositionEnd, track->PositionEnd, momentum_tmp,
46  ParticleId::GetParticle(track->ReconPDG), AnaRecPackManager::kBwd)) // from closest TPC endpoint and to track end backwards
47  track->MomentumFlip = momentum_tmp;
48 
49 
50 #else
51  std::cout << " WARNING! FlipKinematicsCorrection is run w/o highlandRecPack usage. \n"
52  " It is highly recommended to use RecPack to restore possible fit failures of the \n"
53  " global recon re-fits with opposite track sense hypotheis assumes (end to start) " << std::endl;
54 
55 #endif
56 
57  }
58  }
59 }
Representation of a global track.
std::vector< AnaBunchC * > Bunches
The reconstructed objects, split into timing bunches.
Float_t MomentumFlip
Momentum for the main PID hypothesis and reverse sense.
Float_t MomentumEnd
The reconstructed momentum of the particle, at the end position.
std::vector< AnaParticleB * > Particles
Representation of a TPC segment of a global track.
AnaParticleB * GetSegmentWithMostNodesInClosestTpc(const AnaTrackB &track)
Combined function to address NuMu selection needs as efficiently as possible - gets the TPC segment w...
Int_t ReconPDG
PDG of the most probable particle hypothesis used at reconstruction level.
Float_t PositionEnd[4]
The reconstructed end position of the particle.
bool IsRelevantTrack(const AnaTrackB &track) const

§ IsRelevantTrack()

bool FlipKinematicsCorrection::IsRelevantTrack ( const AnaTrackB track) const
protected

A correction is supposed to be relevant for the tracks that have a potential to be reversed (should have a TOF) and for which B field + eloss momentum estimation is crucial: TPC should be present

Definition at line 62 of file FlipKinematicsCorrection.cxx.

62  {
63  //********************************************************************
64 
65  if (!SubDetId::GetDetectorUsed(track.Detector, _det)) return false;
66 
67  if (!SubDetId::GetDetectorUsed(track.Detector, SubDetId::kTPC)) return false;
68 
69 
70  if (ToFSenseCorrector::GetToFTopology(track) == ToFSenseCorrector::kToFInvalid) return false;
71 
72  return true;
73 
74 }
unsigned long Detector
static bool GetDetectorUsed(unsigned long BitField, SubDetId::SubDetEnum det)
Method to see if a certain subdetector or subdetector system is used.
Definition: SubDetId.cxx:40
static ToFTopology GetToFTopology(const AnaTrackB &track)

Member Data Documentation

§ _det

SubDetId::SubDetEnum FlipKinematicsCorrection::_det
protected

A detector bit that defines which ToFs should be present to consider the object for correction

Definition at line 35 of file FlipKinematicsCorrection.hxx.


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