-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathCalSingleChamberStatus.cxx
More file actions
154 lines (134 loc) · 3.73 KB
/
CalSingleChamberStatus.cxx
File metadata and controls
154 lines (134 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///////////////////////////////////////////////////////////////////////////////
// //
// Calibration base class for a single ROC //
// Contains one char value per pad //
// //
///////////////////////////////////////////////////////////////////////////////
#include "TRDBase/CalSingleChamberStatus.h"
using namespace o2::trd;
//_____________________________________________________________________________
CalSingleChamberStatus::CalSingleChamberStatus() = default;
//_____________________________________________________________________________
CalSingleChamberStatus::CalSingleChamberStatus(Int_t p, Int_t c, Int_t cols)
: mPla(p), mCha(c), mNcols(cols)
{
//
// Constructor that initializes a given pad plane type
//
//
// The pad plane parameter
//
switch (p) {
case 0:
if (c == 2) {
// L0C0 type
mNrows = 12;
} else {
// L0C1 type
mNrows = 16;
}
break;
case 1:
if (c == 2) {
// L1C0 type
mNrows = 12;
} else {
// L1C1 type
mNrows = 16;
}
break;
case 2:
if (c == 2) {
// L2C0 type
mNrows = 12;
} else {
// L2C1 type
mNrows = 16;
}
break;
case 3:
if (c == 2) {
// L3C0 type
mNrows = 12;
} else {
// L3C1 type
mNrows = 16;
}
break;
case 4:
if (c == 2) {
// L4C0 type
mNrows = 12;
} else {
// L4C1 type
mNrows = 16;
}
break;
case 5:
if (c == 2) {
// L5C0 type
mNrows = 12;
} else {
// L5C1 type
mNrows = 16;
}
break;
};
mNchannels = mNrows * mNcols;
if (mNchannels != 0) {
mData.resize(mNchannels);
}
memset(&mData[0], 0, sizeof(mData[0]) * mData.size());
}
//_____________________________________________________________________________
CalSingleChamberStatus::CalSingleChamberStatus(const CalSingleChamberStatus& c)
: mPla(c.mPla), mCha(c.mCha), mNrows(c.mNrows), mNcols(c.mNcols), mNchannels(c.mNchannels)
{
//
// CalSingleChamberStatus copy constructor
//
mData = c.mData;
}
//_____________________________________________________________________________
CalSingleChamberStatus::~CalSingleChamberStatus() = default;
//_____________________________________________________________________________
CalSingleChamberStatus& CalSingleChamberStatus::operator=(const CalSingleChamberStatus& c)
{
//
// Assignment operator
//
if (this == &c) {
return *this;
}
mPla = c.mPla;
mCha = c.mCha;
mNrows = c.mNrows;
mNcols = c.mNcols;
mNchannels = c.mNchannels;
mData = c.mData;
return *this;
}
//_____________________________________________________________________________
void CalSingleChamberStatus::Copy(CalSingleChamberStatus& c) const
{
//
// Copy function
//
Int_t iBin = 0;
c.mPla = mPla;
c.mCha = mCha;
c.mNrows = mNrows;
c.mNcols = mNcols;
c.mNchannels = mNchannels;
c.mData = mData;
}