Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
analysis_tree
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
Container Registry
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
pwg-c2f
data
analysis_tree
Commits
1775616a
Commit
1775616a
authored
5 years ago
by
Viktor Klochkov
Browse files
Options
Downloads
Patches
Plain Diff
add matching config
parent
6fe4ae2a
No related branches found
Branches containing commit
No related tags found
1 merge request
!9
Template way
Pipeline
#3031
canceled
5 years ago
Stage: build
Stage: test
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
src/BranchConfig.h
+3
-3
3 additions, 3 deletions
src/BranchConfig.h
src/Configuration.h
+21
-4
21 additions, 4 deletions
src/Configuration.h
src/EventHeader.h
+3
-0
3 additions, 0 deletions
src/EventHeader.h
src/Matching.h
+10
-5
10 additions, 5 deletions
src/Matching.h
with
38 additions
and
13 deletions
CMakeLists.txt
+
1
−
1
View file @
1775616a
...
...
@@ -22,7 +22,7 @@ if (CMAKE_BUILD_TYPE MATCHES DEBUG)
set
(
CMAKE_VERBOSE_MAKEFILE ON
)
endif
()
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -ggdb -DDEBUG -D__DEBUG -Wall -Wextra"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -ggdb
-g
-DDEBUG -D__DEBUG -Wall -Wextra"
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"
${
CMAKE_CXX_FLAGS_RELEASE
}
-ggdb"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -march=native -ftree-vectorize -ffast-math -DNODEBUG"
)
message
(
STATUS
"Using CXX flags for
${
CMAKE_BUILD_TYPE
}
:
${
CMAKE_CXX_FLAGS_
${
CMAKE_BUILD_TYPE
}}
"
)
...
...
This diff is collapsed.
Click to expand it.
src/BranchConfig.h
+
3
−
3
View file @
1775616a
...
...
@@ -79,19 +79,19 @@ class BranchConfig{
if
(
sField
==
"eta"
)
return
TrackFields
::
kEta
;
if
(
sField
==
"p"
)
return
TrackFields
::
kP
;
}
if
(
type_
==
kHit
)
else
if
(
type_
==
kHit
)
{
if
(
sField
==
"x"
)
return
HitFields
::
kX
;
if
(
sField
==
"y"
)
return
HitFields
::
kY
;
if
(
sField
==
"z"
)
return
HitFields
::
kZ
;
if
(
sField
==
"phi"
)
return
HitFields
::
kPhi
;
}
if
(
type_
==
kModule
)
else
if
(
type_
==
kModule
)
{
if
(
sField
==
"id"
)
return
ModuleFields
::
kId
;
if
(
sField
==
"signal"
)
return
ModuleFields
::
kSignal
;
}
if
(
type_
==
kEventHeader
)
else
if
(
type_
==
kEventHeader
)
{
if
(
sField
==
"vtx_x"
)
return
EventHeaderFields
::
kVertexX
;
if
(
sField
==
"vtx_y"
)
return
EventHeaderFields
::
kVertexY
;
...
...
This diff is collapsed.
Click to expand it.
src/Configuration.h
+
21
−
4
View file @
1775616a
...
...
@@ -30,7 +30,7 @@ class Configuration : public TObject{
branches_
.
push_back
(
branch
);
}
void
AddBranchConfig
(
const
std
::
string
name
,
ShortInt_t
type
)
void
AddBranchConfig
(
const
std
::
string
&
name
,
ShortInt_t
type
)
{
BranchConfig
branch
(
name
);
branch
.
SetType
(
type
);
...
...
@@ -55,19 +55,36 @@ class Configuration : public TObject{
{
std
::
cout
<<
"This is a "
<<
name_
<<
std
::
endl
;
std
::
cout
<<
"The Tree has the following branches:"
<<
std
::
endl
;
for
(
const
auto
branch
:
branches_
)
for
(
const
auto
&
branch
:
branches_
)
{
std
::
cout
<<
std
::
endl
;
branch
.
Print
();
}
}
const
std
::
string
&
GetMatchName
(
const
std
::
string
&
br1
,
const
std
::
string
&
br2
)
const
{
auto
search
=
matches_
.
find
(
std
::
pair
(
br1
,
br2
));
if
(
search
!=
matches_
.
end
())
{
return
search
->
second
;
}
else
{
std
::
cout
<<
"Configuration::GetMatchName - Not found
\n
"
;
exit
(
1
);
}
}
void
AddMatch
(
const
std
::
string
&
br1
,
const
std
::
string
&
br2
,
const
std
::
string
&
name
)
{
matches_
.
insert
(
std
::
pair
(
std
::
make_pair
(
br1
,
br2
),
name
)
);
}
uint
GetLastId
()
const
{
return
branches_
.
back
().
GetId
();
}
protected
:
std
::
string
name_
{
""
};
std
::
vector
<
BranchConfig
>
branches_
{};
std
::
map
<
std
::
pair
<
std
::
string
,
std
::
string
>
,
std
::
string
>
matches_
{};
std
::
map
<
std
::
pair
<
int
,
int
>
,
std
::
string
>
matches_id_
{};
ClassDef
(
AnalysisTree
::
Configuration
,
1
)
};
...
...
This diff is collapsed.
Click to expand it.
src/EventHeader.h
+
3
−
0
View file @
1775616a
...
...
@@ -63,6 +63,9 @@ class EventHeader : public Container {
EventHeader
::
vtx_pos_
[
Exyz
::
kZ
]
=
z
;
}
static
constexpr
int
GetNumberOfChannels
()
{
return
1
;
}
// needed in order to have EventHeader similar to Detector
const
EventHeader
&
GetChannel
(
int
)
const
{
return
*
this
;
}
// needed in order to have EventHeader similar to Detector
protected
:
std
::
array
<
Floating_t
,
3
>
vtx_pos_
{
{
UndefValueFloat
,
UndefValueFloat
,
UndefValueFloat
}
};
...
...
This diff is collapsed.
Click to expand it.
src/Matching.h
+
10
−
5
View file @
1775616a
...
...
@@ -2,6 +2,7 @@
#define ANALYSISTREE_MATCHING_H
#include
<map>
#include
<iostream>
#include
"Constants.h"
...
...
@@ -17,18 +18,18 @@ public:
Matching
(
ShortInt_t
id1
,
ShortInt_t
id2
)
:
branch1_id_
(
id1
),
branch2_id_
(
id2
)
{};
virtual
~
Matching
()
=
default
;
void
AddMat
h
ch
(
ShortInt_t
id1
,
ShortInt_t
id2
)
void
AddMatch
(
ShortInt_t
id1
,
ShortInt_t
id2
)
{
match_
.
insert
(
std
::
pair
<
ShortInt_t
,
ShortInt_t
>
(
id1
,
id2
)
);
match_inverted_
.
insert
(
std
::
pair
<
ShortInt_t
,
ShortInt_t
>
(
id2
,
id1
)
);
}
ShortInt_t
GetMatch
(
ShortInt_t
id
)
const
{
ShortInt_t
GetMatch
Direct
(
ShortInt_t
id
)
const
{
auto
search
=
match_
.
find
(
id
);
if
(
search
!=
match_
.
end
()){
return
search
->
second
;
}
else
{
//
std::cout << "Matching::GetMatch - Not found\n";
std
::
cout
<<
"Matching::GetMatch
Direct
- Not found
\n
"
;
return
UndefValueShort
;
}
}
...
...
@@ -38,11 +39,15 @@ public:
if
(
search
!=
match_inverted_
.
end
()){
return
search
->
second
;
}
else
{
//
std::cout << "Matching::GetMatchInverted - Not found\n";
std
::
cout
<<
"Matching::GetMatchInverted - Not found
\n
"
;
return
UndefValueShort
;
}
}
ShortInt_t
GetMatch
(
ShortInt_t
id
,
bool
is_inverted
)
const
{
return
is_inverted
?
GetMatchInverted
(
id
)
:
GetMatchDirect
(
id
);
}
void
Clear
(){
match_
.
clear
();
match_inverted_
.
clear
();
...
...
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