er  dev
ERBeamDetPID.h
1 /********************************************************************************
2  * Copyright (C) Joint Institute for Nuclear Research *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 #ifndef ERBeamDetPID_H
10 #define ERBeamDetPID_H
11 
12 #include "TClonesArray.h"
13 #include "TParticlePDG.h"
14 
15 #include "FairIon.h"
16 
17 #include "ERTask.h"
18 #include "ERBeamDetTrack.h"
19 #include "ERBeamDetParticle.h"
20 #include "ERBeamDetSetup.h"
21 
33 class ERBeamDetPID : public ERTask {
34 public:
36  ERBeamDetPID();
39  ERBeamDetPID(Int_t verbose);
41  ~ERBeamDetPID() = default;
44  virtual InitStatus Init();
52  virtual void Exec(Option_t* opt);
54  virtual void Reset();
58  void SetPID(Int_t pdg) {fPID = pdg;}
64  void SetBoxPID(Double_t tof1, Double_t tof2, Double_t dE1, Double_t dE2);
67  void SetOffsetToF(Double_t offsetToF) {fOffsetToF = offsetToF;}
70  void SetIonMass(Double_t mass) {fIonMass = mass;}
73  void SetProbabilityThreshold(Double_t probabilityThreshold) {
74  fProbabilityThreshold = probabilityThreshold;
75  }
78  void SetIonMassNumber(Int_t a);
81  void SetIonMass(Float_t mass){fIonMass = mass;}
82 protected:
83  std::pair<float, float> CalcEkinAndTimeOnTarget(ERBeamDetTrack& track, int pid, float mom,
84  float mass, float time_on_tof5);
85  //Paramaters
87  //Input arrays
88  TClonesArray* fBeamDetToFDigi1 = nullptr;
89  TClonesArray* fBeamDetToFDigi2 = nullptr;
90  TClonesArray* fBeamDetTrack = nullptr;
91  Int_t fPID = -1;
92  Double_t fToF1 = 0., fToF2 = 0.;
93  Double_t fdE1 = 0., fdE2 = 0.;
94  Double_t fOffsetToF = 0.;
95  Double_t fIonMass = 0.;
96  Double_t fProbabilityThreshold = 0.;
97  TParticlePDG* fIon = nullptr;
98  //Output arrays
99  TClonesArray* fProjectile = nullptr;
100 private:
102  ERBeamDetParticle* AddParticle(Int_t pid, TLorentzVector tofState,
103  TLorentzVector targetState, float time_on_target,
104  float probability);
105  ClassDef(ERBeamDetPID,1)
106 };
107 #endif
virtual void Reset()
Resets all output data.
Double_t fdE2
ToF summary energy deposit boundaries.
Definition: ERBeamDetPID.h:93
ERBeamDetParticle * AddParticle(Int_t pid, TLorentzVector tofState, TLorentzVector targetState, float time_on_target, float probability)
Adds a ERBeamDetParticle to the output Collection.
void SetIonMass(Double_t mass)
Sets ion mass.
Definition: ERBeamDetPID.h:70
TClonesArray * fBeamDetTrack
input collection of tracks
Definition: ERBeamDetPID.h:90
ERBeamDetSetup * fBeamDetSetup
access to ERBeamDetSetup class instance
Definition: ERBeamDetPID.h:86
Double_t fIonMass
ion mass
Definition: ERBeamDetPID.h:95
TClonesArray * fBeamDetToFDigi1
input collection of ToF first plastic points
Definition: ERBeamDetPID.h:88
Double_t fProbabilityThreshold
probability threshold
Definition: ERBeamDetPID.h:96
void SetIonMassNumber(Int_t a)
Sets ion mass number.
Int_t fPID
ion PDG
Definition: ERBeamDetPID.h:91
~ERBeamDetPID()=default
Destructor.
TClonesArray * fProjectile
output projectile collection
Definition: ERBeamDetPID.h:99
virtual InitStatus Init()
Defines all input and output object colletions participate in particle identification.
void SetProbabilityThreshold(Double_t probabilityThreshold)
Sets probability threshold.
Definition: ERBeamDetPID.h:73
Class for particle identification.
Definition: ERBeamDetPID.h:33
void SetPID(Int_t pdg)
Sets ion PDG.
Definition: ERBeamDetPID.h:58
Double_t fOffsetToF
ToF calibration parameter.
Definition: ERBeamDetPID.h:94
Base abstract class for all tasks in er.
Definition: ERTask.h:27
Double_t fToF2
ToF selection boundaries.
Definition: ERBeamDetPID.h:92
ERBeamDetPID()
Default constructor.
TClonesArray * fBeamDetToFDigi2
input collection of ToF second plastic points
Definition: ERBeamDetPID.h:89
void SetIonMass(Float_t mass)
Sets ion mass.
Definition: ERBeamDetPID.h:81
void SetOffsetToF(Double_t offsetToF)
Sets calibration parameter for ToF selection.
Definition: ERBeamDetPID.h:67
void SetBoxPID(Double_t tof1, Double_t tof2, Double_t dE1, Double_t dE2)
Sets selection box area on the ToF/dE scatter plot.
virtual void Exec(Option_t *opt)
Defines selection and calculetion of parameters for each event: Four-vector is determined by equati...