PandaRoot
PndOt.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
14 // PndOt header file
15 //
16 // Class for simulation of OT
17 //
18 // authors: Radoslaw Karabowicz, GSI, 2024
19 //
20 // modified from PndOt by Nafija Ibrišimović in 2023
22 
23 #ifndef PNDOT_H
24 #define PNDOT_H
25 
26 // from PandaRoot, this library
27 #include "PndGeoOtPar.h"
28 #include "PndOtMapCreator.h"
29 // from PandaRoot, pnddata
30 #include <PndOtPoint.h>
31 // from FairRoot
32 #include <FairDetector.h>
33 #include <FairRun.h>
34 // from ROOT
35 #include <TClonesArray.h>
36 #include <TLorentzVector.h>
37 #include <TVector3.h>
38 // standard
39 #include <string>
40 #include <sstream>
41 
42 class TClonesArray;
43 class FairVolume;
44 
45 class PndOt : public FairDetector {
46 
47  public:
49  PndOt();
50 
55  PndOt(const char *name, Bool_t active);
56 
58  virtual ~PndOt();
59 
67  virtual Bool_t ProcessHits(FairVolume *vol = 0) override;
68 
74  virtual void EndOfEvent() override;
75 
80  virtual void Register() override;
81 
83  virtual TClonesArray *GetCollection(Int_t iColl) const override;
84 
89  virtual void Print(Option_t * /*option*/ = "") const override;
90 
95  virtual void Reset() override;
96 
97  virtual void Initialize() override;
98 
106  virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset) override;
107 
112  virtual void ConstructGeometry() override;
113 
114  private:
117  Int_t fTrackID;
118  Int_t fVolumeID;
119  TLorentzVector fPos;
120  TLorentzVector fPosIn;
121  TLorentzVector fPosOut;
122  TLorentzVector fPosInLocal;
123  TLorentzVector fPosOutLocal;
124  TLorentzVector fMomIn;
125  TLorentzVector fMomOut;
126  Double_t fTime;
127  Double_t fLength;
128  Double_t fELoss;
129  Double_t fMass;
130  Bool_t fIsInitialized;
131 
132  Int_t fPosIndex;
133  TClonesArray *fOtCollection;
134  TLorentzVector fpostot; // global frame hit position (in)// da cancellare
135  TLorentzVector fpostotin; // global frame hit position (in)// da cancellare
136  TLorentzVector fpostotout; // global frame hit position (in)// da cancellare
137 
138  TObjArray *fPassNodes;
139  // geometry type
140  Bool_t valid;
141  Int_t fGeoType;
142 
143  PndOtMapCreator *fMapper;
144 
149  PndOtPoint *AddHit(Int_t trackID, Int_t detID, Int_t tubeID, Int_t chamberID, Int_t layerID, TVector3 pos, TVector3 posInLocal, TVector3 posOutLocal, TVector3 momIn,
150  TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, Double_t mass);
151 
152  std::string GetStringPart(std::string &aSrc, Int_t part, char aDelim);
153  bool Split(std::string &aDest, std::string &aSrc, char aDelim);
154 
159  void ResetParameters();
160 
166  float GetSquaredDistanceFromWire();
167 
168  PndOt(const PndOt &L);
169  PndOt &operator=(const PndOt &) { return *this; }
170 
171  ClassDef(PndOt, 1)
172 };
173 
174 inline void PndOt::ResetParameters()
175 {
176  fTrackID = fVolumeID = 0;
177  fPos.SetXYZM(0.0, 0.0, 0.0, 0.0);
178  fPosInLocal.SetXYZM(0.0, 0.0, 0.0, 0.0);
179  fPosOutLocal.SetXYZM(0.0, 0.0, 0.0, 0.0);
180  fMomIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
181  fMomOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
182  fTime = fLength = fELoss = 0;
183  fPosIndex = 0;
184  fpostot.SetXYZM(0.0, 0.0, 0.0, 0.0); // da cancellare
185  fpostotin.SetXYZM(0.0, 0.0, 0.0, 0.0); // da cancellare
186  fpostotout.SetXYZM(0.0, 0.0, 0.0, 0.0); // da cancellare
187  fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
188  fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
189  fMass = 0;
190  fIsInitialized = kFALSE;
191  valid = kFALSE;
192 }
193 
194 #endif // PNDOT_H
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset) override
virtual void Register() override
virtual ~PndOt()
virtual void ConstructGeometry() override
virtual void Reset() override
virtual void Print(Option_t *="") const override
virtual Bool_t ProcessHits(FairVolume *vol=0) override
virtual TClonesArray * GetCollection(Int_t iColl) const override
virtual void EndOfEvent() override
Definition: PndOt.h:45
virtual void Initialize() override