SimDataFormats
DigiSimLinks
interface
DTDigiSimLink.h
Go to the documentation of this file.
1
#ifndef DigiSimLinks_DTDigiSimLink_h
2
#define DigiSimLinks_DTDigiSimLink_h
3
4
#include "
SimDataFormats/EncodedEventId/interface/EncodedEventId.h
"
5
6
class
DTDigiSimLink
{
7
public
:
8
typedef
uint32_t
ChannelType
;
9
10
// Construct from the wire number and the digi number (this identifies
11
// uniquely multiple digis on the same wire), the TDC counts, the SimTrack Id and the EncodedEvent Id.
12
// Base is related to the tdc unit (32 = Phase 1; 30 = Phase 2)
13
explicit
DTDigiSimLink
(
int
wireNr,
int
digiNr,
int
nTDC,
unsigned
int
trackId,
EncodedEventId
evId,
int
base
= 32);
14
15
// Construct from the wire number and the digi number (this identifies
16
// uniquely multiple digis on the same wire), the time (ns), the SimTrack Id and the EncodedEvent Id.
17
// time is converted in TDC counts (1 TDC = 25./32. ns)
18
explicit
DTDigiSimLink
(
19
int
wireNr,
int
digiNr,
double
tdrift,
unsigned
int
trackId,
EncodedEventId
evId,
int
base
= 32);
20
21
// Default constructor.
22
DTDigiSimLink
();
23
24
// The channel identifier and the digi number packed together
25
ChannelType
channel
()
const
;
26
27
// Return wire number
28
int
wire
()
const
;
29
30
// Identifies different digis within the same cell
31
int
number
()
const
;
32
33
// Get raw TDC count
34
uint32_t
countsTDC
()
const
;
35
36
// Get time in ns
37
double
time
()
const
;
38
39
// Return the SimTrack Id
40
unsigned
int
SimTrackId
()
const
;
41
42
// Return the Encoded Event Id
43
EncodedEventId
eventId
()
const
;
44
45
// Used to repack the channel number to an int
46
struct
ChannelPacking
{
47
uint16_t
wi
;
48
uint16_t
num
;
49
};
50
51
private
:
52
// The value of one TDC count in ns
53
static
const
double
reso
;
54
55
private
:
56
uint16_t
theWire
;
// wire number
57
uint8_t
theDigiNumber
;
// counter for digis in the same cell
58
uint8_t
theTDCBase
;
// TDC base (counts per BX; 32 in Ph1 or 30 in Ph2)
59
int32_t
theCounts
;
// TDC count, in units given by 1/theTDCBase
60
uint32_t
theSimTrackId
;
// identifier of the SimTrack that produced the digi
61
EncodedEventId
theEventId
;
62
};
63
64
#include <iostream>
65
#include <cstdint>
66
inline
std::ostream&
operator<<
(std::ostream&
o
,
const
DTDigiSimLink
& digisimlink) {
67
return
o
<<
"wire:"
<< digisimlink.
wire
() <<
" digi:"
<< digisimlink.
number
() <<
" time:"
<< digisimlink.
time
()
68
<<
" SimTrack:"
<< digisimlink.
SimTrackId
() <<
" eventId:"
<< digisimlink.
eventId
().
rawId
();
69
}
70
71
#endif
DTDigiSimLink::ChannelPacking::wi
uint16_t wi
Definition:
DTDigiSimLink.h:47
operator<<
std::ostream & operator<<(std::ostream &o, const DTDigiSimLink &digisimlink)
Definition:
DTDigiSimLink.h:66
DTDigiSimLink::eventId
EncodedEventId eventId() const
Definition:
DTDigiSimLink.cc:42
DTDigiSimLink::time
double time() const
Definition:
DTDigiSimLink.cc:38
DTDigiSimLink::DTDigiSimLink
DTDigiSimLink()
Definition:
DTDigiSimLink.cc:21
DTDigiSimLink::theSimTrackId
uint32_t theSimTrackId
Definition:
DTDigiSimLink.h:60
EcalTangentSkim_cfg.o
o
Definition:
EcalTangentSkim_cfg.py:36
EncodedEventId
Definition:
EncodedEventId.h:11
DTDigiSimLink
Definition:
DTDigiSimLink.h:6
DTDigiSimLink::SimTrackId
unsigned int SimTrackId() const
Definition:
DTDigiSimLink.cc:40
DTDigiSimLink::ChannelPacking
Definition:
DTDigiSimLink.h:46
DTDigiSimLink::channel
ChannelType channel() const
Definition:
DTDigiSimLink.cc:24
DTDigiSimLink::number
int number() const
Definition:
DTDigiSimLink.cc:34
DTDigiSimLink::wire
int wire() const
Definition:
DTDigiSimLink.cc:32
DTDigiSimLink::ChannelType
uint32_t ChannelType
Definition:
DTDigiSimLink.h:8
DTDigiSimLink::theEventId
EncodedEventId theEventId
Definition:
DTDigiSimLink.h:61
DTDigiSimLink::reso
static const double reso
Definition:
DTDigiSimLink.h:53
DTDigiSimLink::theWire
uint16_t theWire
Definition:
DTDigiSimLink.h:56
DTDigiSimLink::theTDCBase
uint8_t theTDCBase
Definition:
DTDigiSimLink.h:58
DTDigiSimLink::countsTDC
uint32_t countsTDC() const
Definition:
DTDigiSimLink.cc:36
DTDigiSimLink::theDigiNumber
uint8_t theDigiNumber
Definition:
DTDigiSimLink.h:57
DTDigiSimLink::ChannelPacking::num
uint16_t num
Definition:
DTDigiSimLink.h:48
DTDigiSimLink::theCounts
int32_t theCounts
Definition:
DTDigiSimLink.h:59
newFWLiteAna.base
base
Definition:
newFWLiteAna.py:92
EncodedEventId::rawId
uint32_t rawId() const
get the raw id
Definition:
EncodedEventId.h:33
EncodedEventId.h
Generated for CMSSW Reference Manual by
1.8.16