PandaRoot
PndStt.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 
13 // -------------------------------------------------------------------------
14 // ----- PndStt header file -----
15 // ----- Created 25/03/06 by R. Castelijns -----
16 // ----- Based on CbmTof -----
17 // -------------------------------------------------------------------------
18 
26 #ifndef PNDSTT_H
27 #define PNDSTT_H
28 
29 #include "TClonesArray.h"
30 #include "TLorentzVector.h"
31 #include "TVector3.h"
32 #include "FairDetector.h"
33 #include "PndGeoSttPar.h"
34 #include "FairRun.h"
35 
36 #include <string>
37 #include <sstream>
38 
39 class TClonesArray;
40 class PndSttPoint;
41 class FairVolume;
42 
43 class PndStt : public FairDetector {
44 
45  public:
47  PndStt();
48 
53  PndStt(const char *name, Bool_t active);
54 
56  virtual ~PndStt();
57 
58  virtual void Initialize();
59 
67  virtual Bool_t ProcessHits(FairVolume *vol = 0);
68 
74  virtual void EndOfEvent();
75 
80  virtual void Register();
81 
83  virtual TClonesArray *GetCollection(Int_t iColl) const;
84 
89  virtual void Print() const;
90 
95  virtual void Reset();
96 
104  virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset);
105 
110  virtual void ConstructGeometry();
111  void SetDefaultSensorNames();
112 
113  protected:
114  std::vector<std::string> fListOfSensitives;
115  bool CheckIfSensitive(std::string name);
116 
117  private:
120  Int_t fTrackID;
121  Int_t fVolumeID;
122  TVector3 fPosInLocal;
123  TVector3 fPosOutLocal;
124  TVector3 fMomIn;
125  TVector3 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 *fSttCollection;
134  TVector3 fpostot; // global frame hit position (in)// da cancellare
135  TVector3 fpostotin; // global frame hit position (in)// da cancellare
136  TVector3 fpostotout; // global frame hit position (in)// da cancellare
137 
138  TObjArray *fPassNodes;
139 
140  // geometry type
141  Int_t fGeoType;
142 
143  // flag to tell if a track entered the tube
144  Bool_t fInFlag;
145 
150  PndSttPoint *AddHit(Int_t trackID, Int_t detID, Int_t tubeID, TVector3 pos, TVector3 posInLocal, TVector3 posOutLocal, TVector3 momIn, TVector3 momOut, Double_t time,
151  Double_t length, Double_t eLoss, Double_t mass);
152 
153  std::string GetStringPart(std::string &aSrc, Int_t part, char aDelim);
154  bool Split(std::string &aDest, std::string &aSrc, char aDelim);
155 
160  void ResetParameters();
161 
167  float GetSquaredDistanceFromWire();
168 
169  PndStt(const PndStt &L);
170  PndStt &operator=(const PndStt &) { return *this; };
171 
172  ClassDef(PndStt, 3)
173 };
174 
175 inline void PndStt::ResetParameters()
176 {
177  fTrackID = fVolumeID = 0;
178  fPosInLocal.SetXYZ(0.0, 0.0, 0.0);
179  fPosOutLocal.SetXYZ(0.0, 0.0, 0.0);
180  fMomIn.SetXYZ(0.0, 0.0, 0.0);
181  fMomOut.SetXYZ(0.0, 0.0, 0.0);
182  fTime = fLength = fELoss = 0;
183  fPosIndex = 0;
184  fpostot.SetXYZ(0.0, 0.0, 0.0); // da cancellare
185  fpostotin.SetXYZ(0.0, 0.0, 0.0); // da cancellare
186  fpostotout.SetXYZ(0.0, 0.0, 0.0); // da cancellare
187  fMass = 0;
188 }
189 
190 #endif
virtual TClonesArray * GetCollection(Int_t iColl) const
virtual void Reset()
virtual void EndOfEvent()
void SetDefaultSensorNames()
virtual void Register()
std::vector< std::string > fListOfSensitives
Definition: PndStt.h:114
virtual void Print() const
virtual ~PndStt()
bool CheckIfSensitive(std::string name)
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Definition: PndStt.h:43
virtual Bool_t ProcessHits(FairVolume *vol=0)
virtual void ConstructGeometry()
virtual void Initialize()