Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JZCaPA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Riccardo Longo
JZCaPA
Commits
b31696bb
Commit
b31696bb
authored
6 years ago
by
clantz
Browse files
Options
Downloads
Patches
Plain Diff
Constructor fills sorted vector. Added method to resize the sorted vector
parent
c66e66fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Analysis/src/RPD.cpp
+27
-8
27 additions, 8 deletions
Analysis/src/RPD.cpp
with
27 additions
and
8 deletions
Analysis/src/RPD.cpp
+
27
−
8
View file @
b31696bb
...
...
@@ -17,7 +17,7 @@
/** @brief Default Constructor for RPD.
*/
RPD
::
RPD
(
){
}
/** @brief Constructor that takes the whole vector of channels readout and selects and stores only the RPD ones
...
...
@@ -25,9 +25,8 @@ RPD::RPD( ){
RPD
::
RPD
(
std
::
vector
<
Channel
*
>
_readOut
){
m_
SortedElements
.
resize
(
nRows
);
Resize
SortedElements
(
);
for
(
int
row
=
0
;
row
<
nRows
;
row
++
){
m_SortedElements
[
row
].
resize
(
nColumns
);
for
(
int
column
;
column
<
nColumns
;
column
++
){
m_SortedElements
[
row
][
column
]
=
GetElement
(
row
,
column
);
}
...
...
@@ -51,13 +50,13 @@ RPD::~RPD( ){
* If the requested element is not found, return a warning message and a NULL pointer.
*
*/
Channel
*
Detector
::
GetElement
(
int
row
,
int
column
){
Channel
*
RPD
::
GetElement
(
int
row
,
int
column
){
if
((
int
)
m_SortedElements
.
size
()
==
nElements
){
return
m_SortedElements
[
row
][
column
];
}
else
{
for
(
int
i
=
0
;
i
<
(
int
)
m_Element
.
size
();
i
++
){
if
(
row
==
m_Element
[
i
]
->
mapping_row
&&
column
==
m_Element
[
i
]
->
mapping_column
){
return
m_Element
[
i
]
;
for
(
int
i
=
0
;
i
<
(
int
)
GetChannelsVector
()
->
size
();
i
++
){
if
(
row
==
GetChannelsVector
()
->
at
(
i
)
->
mapping_row
&&
column
==
GetChannelsVector
()
->
at
(
i
)
->
mapping_column
){
return
GetChannelsVector
()
->
at
(
i
)
;
}
}
}
...
...
@@ -66,7 +65,6 @@ Channel* Detector::GetElement(int row, int column){
}
/** @brief Prints a map of the RPD to the terminal
*
* Prints the map of a 4x4 RPD.
...
...
@@ -92,3 +90,24 @@ void RPD::PrintMap(){
}
//End of the loop over columns
}
//End of the loop over rows
}
/** @brief Resizes m_SortedElements
*
* Uses nRows and nColumns to resize m_SortedElements
* 2D vectors must have columns sized individually.
*
*/
void
RPD
::
ResizeSortedElements
(){
m_SortedElements
.
resize
(
nRows
);
for
(
int
row
=
0
;
row
<
nRows
;
row
++
){
m_SortedElements
.
resize
(
nColumns
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment