REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorReadoutChannel.cxx
1/*************************************************************************
2 * This file is part of the REST software framework. *
3 * *
4 * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5 * For more information see http://gifna.unizar.es/trex *
6 * *
7 * REST is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * REST is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have a copy of the GNU General Public License along with *
18 * REST in $REST_PATH/LICENSE. *
19 * If not, see http://www.gnu.org/licenses/. *
20 * For the list of contributors see $REST_PATH/CREDITS. *
21 *************************************************************************/
22
43
44#include "TRestDetectorReadoutChannel.h"
45
46using namespace std;
47
53
58
63
68Int_t TRestDetectorReadoutChannel::isInside(Double_t x, Double_t y) {
69 for (unsigned int i = 0; i < fReadoutPixel.size(); i++)
70 if (fReadoutPixel[i].isInside(x, y)) return true;
71 return false;
72}
73
79 if (DetailLevel >= 0) {
80 RESTMetadata << "++++ Channel : " << GetChannelId() << " Daq channel : " << GetDaqID() << RESTendl;
81
82 string typestr;
83 if (GetType() == Channel_NoType)
84 typestr = "NoType";
85 else if (GetType() == Channel_Pixel)
86 typestr = "Pixel";
87 else if (GetType() == Channel_X)
88 typestr = "X";
89 else if (GetType() == Channel_Y)
90 typestr = "Y";
91 else if (GetType() == Channel_U)
92 typestr = "U";
93 else if (GetType() == Channel_V)
94 typestr = "V";
95 else if (GetType() == Channel_W)
96 typestr = "W";
97
98 RESTMetadata << " Total pixels : " << GetNumberOfPixels() << " Channel type : " << typestr
99 << RESTendl;
100 RESTMetadata << "+++++++++++++++++++++++++++++++++++++++++++++++++" << RESTendl;
101
102 if (DetailLevel - 1 >= 0)
103 for (int n = 0; n < GetNumberOfPixels(); n++) {
104 fReadoutPixel[n].Print();
105 }
106 }
107}
std::vector< TRestDetectorReadoutPixel > fReadoutPixel
TRestDetectorReadoutChannel()
TRestDetectorReadoutChannel default constructor.
void Initialize()
Initializes the channel members.
Int_t GetChannelId() const
Returns the corresponding channel id.
Int_t GetDaqID() const
Returns the corresponding daq channel id.
void Print(int DetailLevel=0)
Prints the details of the readout channel including pixel coordinates.
Int_t GetNumberOfPixels()
Returns the total number of pixels inside the readout channel.
Int_t isInside(Double_t x, Double_t y)
Determines if (x,y) referenced to module coordinates is inside the channel.
virtual ~TRestDetectorReadoutChannel()
TRestDetectorReadoutChannel default destructor.