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