er  dev
ERBeamDetTrackFinder.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 ERBeamDetTrackFinder_H
10 #define ERBeamDetTrackFinder_H
11 
12 #include "TClonesArray.h"
13 #include "TRandom3.h"
14 
15 #include "ERTask.h"
16 #include "ERBeamDetTrack.h"
17 #include "ERBeamDetSetup.h"
18 
34 class ERBeamDetTrackFinder : public ERTask {
35 public:
40  ERBeamDetTrackFinder(Int_t verbose);
42  ~ERBeamDetTrackFinder() = default;
43  /* Modifiers */
48  void SetInteractionPosition(const TString& volume_name, float depth_ratio = 0.5) {
49  interaction_volume_name_ = volume_name; depth_ratio_ = depth_ratio;
50  }
51  void SetTargetVolume(const TString& volume_name) { interaction_volume_name_ = volume_name; }
52 public:
55  virtual InitStatus Init();
58  virtual void Exec(Option_t* opt);
60  virtual void Reset();
61 protected:
62  //Paramaters
64  //Input arrays
65  TClonesArray* fBeamDetMWPCDigiX1 = nullptr;
66  TClonesArray* fBeamDetMWPCDigiX2 = nullptr;
67  TClonesArray* fBeamDetMWPCDigiY1 = nullptr;
68  TClonesArray* fBeamDetMWPCDigiY2 = nullptr;
69  //Output arrays
70  TClonesArray* fBeamDetTrack = nullptr;
71  Int_t fMultipicityMWPCX1 = -1;
72  Int_t fMultipicityMWPCY1 = -1;
73  Int_t fMultipicityMWPCX2 = -1;
74  Int_t fMultipicityMWPCY2 = -1;
75  TRandom3* fRand = nullptr;
76  TString interaction_volume_name_ = "target";
77  float depth_ratio_ = 0.5;
78 private:
80  ERBeamDetTrack* AddTrack(Double_t xt, Double_t yt, Double_t zt, TVector3 v);
83  Bool_t IsCluster(TClonesArray* digiArray);
87  Double_t CalcCoordinateAvg(const TString& digi_branch_name, const TClonesArray* digiArray,
88  char coordType);
89  ClassDef(ERBeamDetTrackFinder,1)
90 };
91 #endif
virtual void Exec(Option_t *opt)
Defines the transformation actions for all input data (MWPCDigi) to output data (Track) for each even...
Double_t CalcCoordinateAvg(const TString &digi_branch_name, const TClonesArray *digiArray, char coordType)
Calculates an arithmetic average value in array of consequent wires.
virtual InitStatus Init()
Defines all input and output object colletions participates in track finding.
Class for reconsruction ion's coordinate and momentum direction on target.
ERBeamDetSetup * fBeamDetSetup
access to ERBeamDetSetup class instance
ERBeamDetTrackFinder()
Default constructor.
void SetInteractionPosition(const TString &volume_name, float depth_ratio=0.5)
Defines position of interaction - final position of beamdet track.
TClonesArray * fBeamDetMWPCDigiY2
input collection of MWPC Digi
Bool_t IsCluster(TClonesArray *digiArray)
Checks if the collection of digies contatains only neigbour wires.
virtual void Reset()
Resets all output data.
ERBeamDetTrack * AddTrack(Double_t xt, Double_t yt, Double_t zt, TVector3 v)
Adds a ERBeamDetTrack to the output Collection.
TClonesArray * fBeamDetTrack
output collection of tracks
Base abstract class for all tasks in er.
Definition: ERTask.h:27
~ERBeamDetTrackFinder()=default
Destructor.