PandaRoot
PndFtof.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 // ----- PndFtof header file -----
15 // ----- created by A. Sanchez -----
16 // -------------------------------------------------------------------------
17 
18 #ifndef PNDFTOF_H
19 #define PNDFTOF_H
20 
21 //#include "TClonesArray.h"
22 #include "TVector3.h"
23 #include "TLorentzVector.h"
24 #include "FairDetector.h"
25 #include "PndGeoFtofPar.h"
26 #include <string>
27 #include <vector>
28 
29 class TClonesArray;
30 class PndFtofPoint;
31 class FairVolume;
32 
33 class PndFtof : public FairDetector {
34 
35  public:
37  PndFtof();
38 
43  PndFtof(const char *name, Bool_t active);
44 
46  virtual ~PndFtof();
47 
51  virtual void Initialize();
52 
60  virtual Bool_t ProcessHits(FairVolume *vol = 0);
61 
67  virtual void EndOfEvent();
68 
69  virtual void BeginEvent();
74  virtual void Register();
75 
77  virtual TClonesArray *GetCollection(Int_t iColl) const;
78 
83  virtual void Print() const;
84 
89  virtual void Reset();
90 
98  virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset);
99 
103  virtual void ConstructGeometry();
104 
105  void ConstructASCIIGeometry();
106 
107  PndFtofPoint *AddHit(Int_t trackID, Int_t evtID, Int_t detID, TString detName, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout, Double_t tof, Double_t length,
108  Double_t eLoss, Double_t charge, Double_t mass, Int_t pdgCode, Double_t dist, Double_t PLin, Double_t PLout);
109 
110  private:
111  std::vector<std::string> fListOfSensitives;
112  bool CheckIfSensitive(std::string name);
113 
114  PndGeoFtofPar *par;
115  Int_t fTrackID; // track index
116  Int_t fVolumeID; // volume id
117  Int_t fEventID; // event id
118  TLorentzVector fPosIn; // position
119  TLorentzVector fMomIn; // momentum
120  TLorentzVector fPosOut; // position
121  TLorentzVector fMomOut; // momentum
122 
123  Double_t fPLout, fPLin; // total momentum
124 
125  Double32_t fTime; // time
126  Double32_t fLength; // length
127  Double32_t fELoss; // energy loss
128  Int_t fPosIndex; //
129  Int_t fpdgCode; // MC volume ID of MUO
130  Int_t SiId, CId, alId, beId, CpipeId;
131 
132  Double_t fcharge;
133  Double_t fmass, fdist;
134 
135  TClonesArray *fFtofCollection;
136 
137  // reset all parameters
138  void ResetParameters();
139 
140  ClassDef(PndFtof, 2)
141 };
142 
143 inline void PndFtof::ResetParameters()
144 {
145  fTrackID = fVolumeID = 0;
146  fEventID = -1;
147  fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
148  fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
149  fMomIn.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
150  fMomOut.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
151 
152  fTime = fLength = fELoss = 0;
153 };
154 
155 #endif
void ConstructASCIIGeometry()
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
virtual void BeginEvent()
virtual void Register()
virtual void ConstructGeometry()
virtual void Initialize()
virtual Bool_t ProcessHits(FairVolume *vol=0)
virtual void Print() const
virtual ~PndFtof()
virtual void Reset()
virtual void EndOfEvent()
PndFtofPoint * AddHit(Int_t trackID, Int_t evtID, Int_t detID, TString detName, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout, Double_t tof, Double_t length, Double_t eLoss, Double_t charge, Double_t mass, Int_t pdgCode, Double_t dist, Double_t PLin, Double_t PLout)
virtual TClonesArray * GetCollection(Int_t iColl) const