SND@LHC Software
Loading...
Searching...
No Matches
sndCluster.cxx
Go to the documentation of this file.
1
#include "
sndCluster.h
"
2
#include "FairRunSim.h"
3
4
// ----- Default constructor -------------------------------------------
5
sndCluster::sndCluster
()
6
: TObject(),
7
fType(0)
8
{
9
}
10
11
// ----- Standard constructor ------------------------------------------
12
sndCluster::sndCluster
(Int_t first, Int_t N,std::vector<sndScifiHit*> hitlist,
Scifi
* ScifiDet, Bool_t withQDC)
13
:TObject(),
14
fType(0),
15
fTime(999),
16
fFirst(first),
17
fN(N)
18
{
19
Double_t weight = 0;
20
TVector3 A(0,0,0);
21
TVector3 B(0,0,0);
22
// make clusterCentre:
23
for
(
int
k = 0;k<
fN
; ++k){
24
ScifiDet->
GetSiPMPosition
(k+
fFirst
, A, B);
25
Double_t w = 1.;
26
if
(withQDC) {w =
dynamic_cast<
sndScifiHit
*
>
(hitlist.at(k))->
GetEnergy
();}
27
Double_t t = 6.25 *
dynamic_cast<
sndScifiHit
*
>
(hitlist.at(k))->
GetTime
();
28
weight+=w;
29
fMeanPositionA
+=w*TVector3(A);
30
fMeanPositionB
+=w*TVector3(B);
31
if
(t<
fTime
){
fTime
= t;}
32
}
33
Double_t winv = 1./weight;
34
fMeanPositionA
= TVector3(
fMeanPositionA
)*winv;
35
fMeanPositionB
= TVector3(
fMeanPositionB
)*winv;
36
fEnergy
= weight;
37
}
38
39
sndCluster::sndCluster
(Int_t first, Int_t N,std::vector<MuFilterHit*> hitlist,
MuFilter
* MuDet, Bool_t withQDC)
40
:TObject(),
41
fType(1),
42
fTime(999),
43
fFirst(first),
44
fN(N)
45
{
46
// make clusterCentre:
47
Double_t weight = 0;
48
TVector3 A(0,0,0);
49
TVector3 B(0,0,0);
50
// make clusterCentre:
51
for
(
int
k = 0;k<
fN
; ++k){
52
MuDet->
GetPosition
((hitlist.at(k))->GetDetectorID(), A, B);
53
Double_t w = 1.;
54
if
(withQDC) {w =
dynamic_cast<
MuFilterHit
*
>
(hitlist.at(k))->
GetEnergy
();}
55
Double_t t = 6.25 *
dynamic_cast<
MuFilterHit
*
>
(hitlist.at(k))->
GetTime
();
56
weight+=w;
57
fMeanPositionA
+=w*TVector3(A);
58
fMeanPositionB
+=w*TVector3(B);
59
if
(t<
fTime
){
fTime
= t;}
60
}
61
Double_t winv = 1./weight;
62
fMeanPositionA
= TVector3(
fMeanPositionA
)*winv;
63
fMeanPositionB
= TVector3(
fMeanPositionB
)*winv;
64
fEnergy
= weight;
65
66
}
67
68
void
sndCluster::Print
()
const
69
{
70
std::cout <<
"-I- SND cluster "
<<
" first "
<<
fFirst
<<
" of "
<<
fN
<<
" hits"
<<std::endl;
71
fMeanPositionA
.Print();
72
fMeanPositionB
.Print();
73
std::cout << std::endl;
74
}
75
// ----- Destructor ----------------------------------------------------
76
sndCluster::~sndCluster
() { }
77
// -------------------------------------------------------------------------
78
79
ClassImp
(
sndCluster
)
MuFilterHit
Definition
MuFilterHit.h:11
MuFilter
Definition
MuFilter.h:26
MuFilter::GetPosition
void GetPosition(Int_t id, TVector3 &vLeft, TVector3 &vRight)
Definition
MuFilter.cxx:639
Scifi
Definition
Scifi.h:20
Scifi::GetSiPMPosition
void GetSiPMPosition(Int_t SiPMChan, TVector3 &A, TVector3 &B)
Definition
Scifi.cxx:625
sndCluster
Definition
sndCluster.h:24
sndCluster::fTime
Double_t fTime
total energy
Definition
sndCluster.h:77
sndCluster::~sndCluster
virtual ~sndCluster()
Definition
sndCluster.cxx:76
sndCluster::Print
void Print() const
Definition
sndCluster.cxx:68
sndCluster::fMeanPositionA
TVector3 fMeanPositionA
number of hits
Definition
sndCluster.h:74
sndCluster::fEnergy
Double_t fEnergy
mean position
Definition
sndCluster.h:76
sndCluster::fFirst
Int_t fFirst
Scifi or MuFilter.
Definition
sndCluster.h:72
sndCluster::GetEnergy
Double_t GetEnergy() const
Definition
sndCluster.h:44
sndCluster::fMeanPositionB
TVector3 fMeanPositionB
mean position
Definition
sndCluster.h:75
sndCluster::GetTime
Double_t GetTime() const
Definition
sndCluster.h:46
sndCluster::sndCluster
sndCluster()
Definition
sndCluster.cxx:5
sndCluster::fN
Int_t fN
first hit channel ID of cluster
Definition
sndCluster.h:73
sndScifiHit
Definition
sndScifiHit.h:10
ClassImp
ClassImp(ecalContFact) ecalContFact
Definition
ecalContFact.cxx:8
sndCluster.h
shipLHC
sndCluster.cxx
Generated by
1.9.8