CondFormats
CSCObjects
src
CSCChannelTranslator.cc
Go to the documentation of this file.
1
#include "
CondFormats/CSCObjects/interface/CSCChannelTranslator.h
"
2
3
int
CSCChannelTranslator::rawStripChannel
(
const
CSCDetId
&
id
,
int
igeo)
const
{
4
// Translate a geometry-oriented strip channel in range 1-80, igeo,
5
// into corresponding raw channel.
6
7
int
iraw = igeo;
8
9
bool
zplus
= (
id
.endcap() == 1);
10
11
bool
me1a = (
id
.station() == 1) && (
id
.
ring
() == 4);
12
bool
me1b = (
id
.station() == 1) && (
id
.
ring
() == 1);
13
14
if
(me1a &&
zplus
) {
15
iraw = 17 - iraw;
16
}
// 1-16 -> 16-1
17
if
(me1b && !
zplus
) {
18
iraw = 65 - iraw;
19
}
// 1-64 -> 64-1
20
if
(me1a) {
21
iraw += 64;
22
}
// set 1-16 to 65-80
23
24
return
iraw;
25
}
26
27
int
CSCChannelTranslator::geomStripChannel
(
const
CSCDetId
&
id
,
int
iraw)
const
{
28
// Translate a raw strip channel in range 1-80, iraw, into
29
// corresponding geometry-oriented channel in which increasing
30
// channel number <-> strip number increasing with +ve local x.
31
32
int
igeo = iraw;
33
34
bool
zplus
= (
id
.endcap() == 1);
35
bool
me11 = (
id
.station() == 1) && (
id
.
ring
() == 1);
36
bool
me1a = me11 && (iraw > 64);
37
bool
me1b = me11 && (iraw <= 64);
38
39
if
(me1a)
40
igeo -= 64;
// 65-80 -> 1-16
41
//if ( me1a ) igeo %= 64; // 65-80 -> 1-16
42
if
(me1a &&
zplus
) {
43
igeo = 17 - igeo;
44
}
// 65-80 -> 16-1
45
if
(me1b && !
zplus
) {
46
igeo = 65 - igeo;
47
}
// 1-64 -> 64-1
48
49
return
igeo;
50
}
51
52
int
CSCChannelTranslator::channelFromStrip
(
const
CSCDetId
&
id
,
int
strip
)
const
{
53
// This just returns the electronics channel label to which a given strip is connected
54
// In all chambers but ME1A this is just a direct 1-1 correspondence.
55
// In ME1A the 48 strips are ganged into 16 channels: 1+17+33->1, 2+18+34->2, ... 16+32+48->16.
56
int
ichan =
strip
;
57
bool
me1a = (
id
.station() == 1) && (
id
.
ring
() == 4);
58
if
(me1a &&
strip
> 16)
59
ichan = (
strip
- 1) % 16 + 1;
// gang the 48 to 16
60
return
ichan;
61
}
62
63
CSCDetId
CSCChannelTranslator::rawCSCDetId
(
const
CSCDetId
&
id
)
const
{
64
// Return the effective online CSCDetId for given offline CSCDetId
65
// That means the same one except for ME1A, which online is part of ME11 (channels 65-80)
66
CSCDetId
idraw(
id
);
67
bool
me1a = (
id
.station() == 1) && (
id
.
ring
() == 4);
68
if
(me1a)
69
idraw =
CSCDetId
(
id
.
endcap
(),
id
.
station
(), 1,
id
.
chamber
(),
id
.layer());
70
return
idraw;
71
}
CSCChannelTranslator::rawStripChannel
int rawStripChannel(const CSCDetId &id, int igeom) const
Return raw strip channel number for input geometrical channel number.
Definition:
CSCChannelTranslator.cc:3
relativeConstraints.station
station
Definition:
relativeConstraints.py:67
digitizers_cfi.strip
strip
Definition:
digitizers_cfi.py:19
CSCChannelTranslator::channelFromStrip
int channelFromStrip(const CSCDetId &id, int strip) const
Definition:
CSCChannelTranslator.cc:52
CSCChannelTranslator::rawCSCDetId
CSCDetId rawCSCDetId(const CSCDetId &id) const
Definition:
CSCChannelTranslator.cc:63
makeMuonMisalignmentScenario.endcap
endcap
Definition:
makeMuonMisalignmentScenario.py:320
CSCChannelTranslator::geomStripChannel
int geomStripChannel(const CSCDetId &id, int iraw) const
Return geometrical strip channel number for input raw channel number.
Definition:
CSCChannelTranslator.cc:27
CSCChannelTranslator.h
CSCDetId
Definition:
CSCDetId.h:26
SurfaceOrientation::zplus
Definition:
Surface.h:19
relativeConstraints.ring
ring
Definition:
relativeConstraints.py:68
relativeConstraints.chamber
chamber
Definition:
relativeConstraints.py:53
Generated for CMSSW Reference Manual by
1.8.16