SND@LHC Software
Loading...
Searching...
No Matches
SndlhcHit.h
Go to the documentation of this file.
1#ifndef SNDLHCHIT_H
2#define SNDLHCHIT_H 1
3
4#include "TObject.h" //
5
6#include "Rtypes.h" // for Double_t, Int_t, Double32_t, etc
7#include "TVector3.h"
8#include "TArrayF.h"
9#include <unordered_map>
10
11#ifndef __CINT__
12#include <boost/serialization/access.hpp>
13#include <boost/serialization/base_object.hpp>
14#endif //__CINT__
15
19class SndlhcHit : public TObject
20{
21
22 public:
23
25 SndlhcHit();
26
27
29 SndlhcHit(Int_t detID,Int_t nSiPMs=1,Int_t nSides=0);
30
32 virtual ~SndlhcHit();
33
34
36 Int_t GetDetectorID() const { return fDetectorID; };
37 Float_t GetSignal(Int_t nChannel=0);
38 Float_t GetTime(Int_t nChannel=0);
39 Int_t GetnSiPMs() const { return nSiPMs; };
40 Int_t GetnSides() const { return nSides; };
42 void SetDigi(Float_t s, Float_t t,Int_t i=0) { signals[i]=trunc(100*s)/100;times[i]=trunc(1000*t)/1000.; }
43 void SetDetectorID(Int_t detID) { fDetectorID = detID; }
44 void SetDaqID(Int_t i, Int_t k, Int_t board_id, Int_t tofpet_id, Int_t tofpet_channel) { fDaqID[i] = k*100000 + board_id * 1000 + tofpet_id * 100 + tofpet_channel; }
45 Int_t GetBoardID(Int_t i) { return int((fDaqID[i]%100000)/1000);}
46 Int_t GetTofpetID(Int_t i) { return int((fDaqID[i]%1000)/100);}
47 Int_t Getchannel(Int_t i) { return fDaqID[i]%100;}
48 Int_t GetRawHitIndex(Int_t i=0) { return int(fDaqID[i]/100000);}
49
50// to be implemented by the subdetector
51
52 /*** Output to screen */
53 virtual void Print(const Option_t* opt ="") const {;}
54 /*** Get position */
55 virtual void GetPosition(TVector3 L,TVector3 R) const {;}
56 /*** Get energy */
57 // virtual Float_t GetEnergy(); // causes problems, don't know why: cling::DynamicLibraryManager::loadLibrary(): lib/libShipData.so.0.0.0: undefined symbol: _ZN9SndlhcHit9GetEnergyEv
58
59 template<class Archive>
60 void serialize(Archive& ar, const unsigned int version)
61 {
62 ar& boost::serialization::base_object<TObject>(*this);
63 ar& fDetectorID;
64 ar& nSiPMs;
65 ar& nSides;
66 }
67
68 protected:
69#ifndef __CINT__ // for BOOST serialization
71#endif // for BOOST serialization
73 Int_t nSiPMs;
74 Int_t nSides;
75 Float_t signals[16];
76 Float_t times[16];
77 Int_t fDaqID[16];
78
80};
81
82#endif
Int_t nSiPMs
Definition SndlhcHit.h:73
Float_t times[16]
SiPM signal.
Definition SndlhcHit.h:76
Int_t GetTofpetID(Int_t i)
Definition SndlhcHit.h:46
virtual void GetPosition(TVector3 L, TVector3 R) const
Definition SndlhcHit.h:55
Float_t GetSignal(Int_t nChannel=0)
Definition SndlhcHit.cxx:28
void SetDetectorID(Int_t detID)
Definition SndlhcHit.h:43
ClassDef(SndlhcHit, 2)
encodes rawhitindex*100000+(board_id * 1000) + (tofpet_id * 100) + tofpet_channel
Int_t GetDetectorID() const
Definition SndlhcHit.h:36
Int_t Getchannel(Int_t i)
Definition SndlhcHit.h:47
Int_t GetBoardID(Int_t i)
Definition SndlhcHit.h:45
Int_t GetnSides() const
Definition SndlhcHit.h:40
Int_t fDetectorID
Detector unique identifier.
Definition SndlhcHit.h:72
Int_t fDaqID[16]
SiPM time.
Definition SndlhcHit.h:77
Float_t GetTime(Int_t nChannel=0)
Definition SndlhcHit.cxx:32
Int_t nSides
number of SiPMs per side
Definition SndlhcHit.h:74
void SetDaqID(Int_t i, Int_t k, Int_t board_id, Int_t tofpet_id, Int_t tofpet_channel)
Definition SndlhcHit.h:44
Float_t signals[16]
number of sides
Definition SndlhcHit.h:75
void SetDigi(Float_t s, Float_t t, Int_t i=0)
Definition SndlhcHit.h:42
void serialize(Archive &ar, const unsigned int version)
Definition SndlhcHit.h:60
virtual ~SndlhcHit()
Definition SndlhcHit.cxx:40
friend class boost::serialization::access
Definition SndlhcHit.h:70
Int_t GetnSiPMs() const
Definition SndlhcHit.h:39
Int_t GetRawHitIndex(Int_t i=0)
Definition SndlhcHit.h:48
virtual void Print(const Option_t *opt="") const
Definition SndlhcHit.h:53