SND@LHC Software
Loading...
Searching...
No Matches
sndCluster Class Reference

#include <sndCluster.h>

Inheritance diagram for sndCluster:
Collaboration diagram for sndCluster:

Public Member Functions

 sndCluster ()
 
 sndCluster (Int_t first, Int_t N, std::vector< sndScifiHit * > hitlist, Scifi *ScifiDet, Bool_t withQDC=kFALSE)
 
 sndCluster (Int_t first, Int_t N, std::vector< MuFilterHit * > hitlist, MuFilter *MuDet, Bool_t withQDC=kFALSE)
 
virtual ~sndCluster ()
 
Int_t GetType () const
 
Int_t GetFirst () const
 
Int_t GetN () const
 
Double_t GetEnergy () const
 
Double_t GetTime () const
 
virtual void GetPosition (TVector3 &L, TVector3 &R)
 
void Print () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Member Functions

 ClassDef (sndCluster, 2)
 Time from fastest hit TDC.
 

Protected Attributes

Int_t fType
 
Int_t fFirst
 Scifi or MuFilter.
 
Int_t fN
 first hit channel ID of cluster
 
TVector3 fMeanPositionA
 number of hits
 
TVector3 fMeanPositionB
 mean position
 
Double_t fEnergy
 mean position
 
Double_t fTime
 total energy
 

Friends

class boost::serialization::access
 

Detailed Description

class for scifi and muFilter clusters made of Hit objects

Definition at line 23 of file sndCluster.h.

Constructor & Destructor Documentation

◆ sndCluster() [1/3]

sndCluster::sndCluster ( )

Default constructor

Definition at line 5 of file sndCluster.cxx.

6: TObject(),
7 fType(0)
8{
9}
Int_t fType
Definition sndCluster.h:71

◆ sndCluster() [2/3]

sndCluster::sndCluster ( Int_t  first,
Int_t  N,
std::vector< sndScifiHit * >  hitlist,
Scifi ScifiDet,
Bool_t  withQDC = kFALSE 
)

Constructor with list of hits

Definition at line 12 of file sndCluster.cxx.

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}
void GetSiPMPosition(Int_t SiPMChan, TVector3 &A, TVector3 &B)
Definition Scifi.cxx:625
Double_t fTime
total energy
Definition sndCluster.h:77
TVector3 fMeanPositionA
number of hits
Definition sndCluster.h:74
Double_t fEnergy
mean position
Definition sndCluster.h:76
Int_t fFirst
Scifi or MuFilter.
Definition sndCluster.h:72
Double_t GetEnergy() const
Definition sndCluster.h:44
TVector3 fMeanPositionB
mean position
Definition sndCluster.h:75
Double_t GetTime() const
Definition sndCluster.h:46
Int_t fN
first hit channel ID of cluster
Definition sndCluster.h:73

◆ sndCluster() [3/3]

sndCluster::sndCluster ( Int_t  first,
Int_t  N,
std::vector< MuFilterHit * >  hitlist,
MuFilter MuDet,
Bool_t  withQDC = kFALSE 
)

Definition at line 39 of file sndCluster.cxx.

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}
void GetPosition(Int_t id, TVector3 &vLeft, TVector3 &vRight)
Definition MuFilter.cxx:639

◆ ~sndCluster()

sndCluster::~sndCluster ( )
virtual

Destructor

Definition at line 76 of file sndCluster.cxx.

76{ }

Member Function Documentation

◆ ClassDef()

sndCluster::ClassDef ( sndCluster  ,
 
)
protected

Time from fastest hit TDC.

◆ GetEnergy()

Double_t sndCluster::GetEnergy ( ) const
inline

Definition at line 44 of file sndCluster.h.

44{ return fEnergy; };

◆ GetFirst()

Int_t sndCluster::GetFirst ( ) const
inline

Definition at line 41 of file sndCluster.h.

41{ return fFirst; };

◆ GetN()

Int_t sndCluster::GetN ( ) const
inline

Definition at line 42 of file sndCluster.h.

42{ return fN; };

◆ GetPosition()

virtual void sndCluster::GetPosition ( TVector3 &  L,
TVector3 &  R 
)
inlinevirtual

◆ GetTime()

Double_t sndCluster::GetTime ( ) const
inline

Definition at line 46 of file sndCluster.h.

46{ return fTime; };

◆ GetType()

Int_t sndCluster::GetType ( ) const
inline

Accessors

Definition at line 40 of file sndCluster.h.

40{ return fType; };

◆ Print()

void sndCluster::Print ( ) const

Definition at line 68 of file sndCluster.cxx.

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}

◆ serialize()

template<class Archive >
void sndCluster::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Definition at line 57 of file sndCluster.h.

58 {
59 ar& boost::serialization::base_object<TObject>(*this);
60 ar& fFirst;
61 ar& fN;
62 ar& fEnergy;
65 }

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 69 of file sndCluster.h.

Member Data Documentation

◆ fEnergy

Double_t sndCluster::fEnergy
protected

mean position

Definition at line 76 of file sndCluster.h.

◆ fFirst

Int_t sndCluster::fFirst
protected

Scifi or MuFilter.

Definition at line 72 of file sndCluster.h.

◆ fMeanPositionA

TVector3 sndCluster::fMeanPositionA
protected

number of hits

Definition at line 74 of file sndCluster.h.

◆ fMeanPositionB

TVector3 sndCluster::fMeanPositionB
protected

mean position

Definition at line 75 of file sndCluster.h.

◆ fN

Int_t sndCluster::fN
protected

first hit channel ID of cluster

Definition at line 73 of file sndCluster.h.

◆ fTime

Double_t sndCluster::fTime
protected

total energy

Definition at line 77 of file sndCluster.h.

◆ fType

Int_t sndCluster::fType
protected

Definition at line 71 of file sndCluster.h.


The documentation for this class was generated from the following files: