Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Michael Duehrssen-Debling
athena
Commits
19c270c2
Commit
19c270c2
authored
6 years ago
by
John Chapman
Browse files
Options
Downloads
Patches
Plain Diff
Drop calls which change the internal state of TRTHitIdHelper after initialization
parent
d7b18364
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h
+19
-19
19 additions, 19 deletions
InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h
InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx
+33
-43
33 additions, 43 deletions
InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx
with
52 additions
and
62 deletions
InnerDetector/InDetSimEvent/InDetSimEvent/TRTHitIdHelper.h
+
19
−
19
View file @
19c270c2
/*
Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-201
8
CERN for the benefit of the ATLAS collaboration
*/
#ifndef INDETSIMEVENT_TRTHITIDHELPER
#define INDETSIMEVENT_TRTHITIDHELPER
//
// This is a helper class to build an identifing integer used by
// This is a helper class to build an identifing integer used by
// the simulation. It inherits from HitIdHelper, in order to get
// all the packing and shifting for free.
// The class is a singleton and a static GetHelper() is provided
// the constructor calls the Initialize() method which sets all the
// all the packing and shifting for free.
// The class is a singleton and a static GetHelper() is provided
// the constructor calls the Initialize() method which sets all the
// field dimensions
// Methods are provided to get access to the TRT Geometry
// description
...
...
@@ -26,39 +26,39 @@ class TRTHitIdHelper : HitIdHelper {
public:
//
// Access to the helper
static
TRTHitIdHelper
*
GetHelper
();
static
TRTHitIdHelper
*
GetHelper
();
//
// Info retrieval:
// Barrel or Endcap
bool
isBarrel
(
const
int
&
hid
);
bool
isEndcap
(
const
int
&
hid
);
bool
isBarrel
(
const
int
&
hid
)
const
;
bool
isEndcap
(
const
int
&
hid
)
const
;
//
// Positive or negative side
bool
isPositive
(
const
int
&
hid
);
bool
isNegative
(
const
int
&
hid
);
// Positive or negative side
bool
isPositive
(
const
int
&
hid
)
const
;
bool
isNegative
(
const
int
&
hid
)
const
;
// Ring or Wheel
int
getRingWheel
(
const
int
&
hid
);
int
getRingWheel
(
const
int
&
hid
)
const
;
// PhiSector
int
getPhiSector
(
const
int
&
hid
);
int
getPhiSector
(
const
int
&
hid
)
const
;
// Layer Plane
int
getLayerPlane
(
const
int
&
hid
);
int
getLayerPlane
(
const
int
&
hid
)
const
;
// straw
int
getStraw
(
const
int
&
hid
);
int
getStraw
(
const
int
&
hid
)
const
;
//
// Info packing:
int
buildHitId
(
const
int
,
const
int
,
const
int
,
const
int
,
const
int
,
const
int
);
int
buildHitId
(
const
int
,
const
int
,
const
int
,
const
int
,
const
int
,
const
int
)
const
;
private:
//
// private constructor to have a singleton
TRTHitIdHelper
();
TRTHitIdHelper
();
//
// Initialize the helper, only called by the constructor
void
Initialize
();
void
Initialize
();
};
#endif // INDETSIMEVENT_TRTHITIDHELPER
This diff is collapsed.
Click to expand it.
InnerDetector/InDetSimEvent/src/TRTHitIdHelper.cxx
+
33
−
43
View file @
19c270c2
/*
Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-201
8
CERN for the benefit of the ATLAS collaboration
*/
#include
"InDetSimEvent/TRTHitIdHelper.h"
//
//
// private constructor
TRTHitIdHelper
::
TRTHitIdHelper
()
:
HitIdHelper
()
{
Initialize
();
...
...
@@ -22,75 +22,65 @@ void TRTHitIdHelper::Initialize() {
InitializeField
(
"RingWheel"
,
0
,
31
);
InitializeField
(
"PositiveNegative"
,
0
,
1
);
InitializeField
(
"BarrelEndcap"
,
0
,
1
);
}
}
// Info retrieval:
// Barrel or Endcap
bool
TRTHitIdHelper
::
isBarrel
(
const
int
&
hid
){
this
->
SetID
(
hid
);
int
ps
=
this
->
GetFieldValue
(
"BarrelEndcap"
);
bool
TRTHitIdHelper
::
isBarrel
(
const
int
&
hid
)
const
{
int
ps
=
this
->
GetFieldValue
(
"BarrelEndcap"
,
hid
);
if
(
ps
==
0
)
return
true
;
else
return
false
;
}
bool
TRTHitIdHelper
::
isEndcap
(
const
int
&
hid
){
this
->
SetID
(
hid
);
int
ps
=
this
->
GetFieldValue
(
"BarrelEndcap"
);
bool
TRTHitIdHelper
::
isEndcap
(
const
int
&
hid
)
const
{
int
ps
=
this
->
GetFieldValue
(
"BarrelEndcap"
,
hid
);
if
(
ps
==
0
)
return
false
;
else
return
true
;
}
}
// Positive or Negative
bool
TRTHitIdHelper
::
isPositive
(
const
int
&
hid
){
this
->
SetID
(
hid
);
int
ps
=
this
->
GetFieldValue
(
"PositiveNegative"
);
bool
TRTHitIdHelper
::
isPositive
(
const
int
&
hid
)
const
{
int
ps
=
this
->
GetFieldValue
(
"PositiveNegative"
,
hid
);
if
(
ps
==
0
)
return
true
;
else
return
false
;
}
bool
TRTHitIdHelper
::
isNegative
(
const
int
&
hid
){
this
->
SetID
(
hid
);
int
ps
=
this
->
GetFieldValue
(
"PositiveNegative"
);
}
bool
TRTHitIdHelper
::
isNegative
(
const
int
&
hid
)
const
{
int
ps
=
this
->
GetFieldValue
(
"PositiveNegative"
,
hid
);
if
(
ps
==
0
)
return
false
;
else
return
true
;
}
}
// Ring/Wheel
int
TRTHitIdHelper
::
getRingWheel
(
const
int
&
hid
)
{
this
->
SetID
(
hid
);
return
this
->
GetFieldValue
(
"RingWheel"
);
}
int
TRTHitIdHelper
::
getRingWheel
(
const
int
&
hid
)
const
{
return
this
->
GetFieldValue
(
"RingWheel"
,
hid
);
}
// Phi Sector
int
TRTHitIdHelper
::
getPhiSector
(
const
int
&
hid
)
{
this
->
SetID
(
hid
);
return
this
->
GetFieldValue
(
"PhiSector"
);
int
TRTHitIdHelper
::
getPhiSector
(
const
int
&
hid
)
const
{
return
this
->
GetFieldValue
(
"PhiSector"
,
hid
);
}
// layer/plane
int
TRTHitIdHelper
::
getLayerPlane
(
const
int
&
hid
)
{
this
->
SetID
(
hid
);
return
this
->
GetFieldValue
(
"LayerPlane"
);
int
TRTHitIdHelper
::
getLayerPlane
(
const
int
&
hid
)
const
{
return
this
->
GetFieldValue
(
"LayerPlane"
,
hid
);
}
// straw
int
TRTHitIdHelper
::
getStraw
(
const
int
&
hid
)
{
this
->
SetID
(
hid
);
return
this
->
GetFieldValue
(
"Straw"
);
int
TRTHitIdHelper
::
getStraw
(
const
int
&
hid
)
const
{
return
this
->
GetFieldValue
(
"Straw"
,
hid
);
}
//
// Info packing:
int
TRTHitIdHelper
::
buildHitId
(
const
int
BrlECap
,
const
int
PosNeg
,
const
int
RingWheel
,
const
int
PhiS
,
const
int
LayerPlane
,
const
int
Straw
)
{
this
->
Set
ID
(
0
);
this
->
SetFieldValue
(
"BarrelEndcap"
,
BrlECap
);
this
->
SetFieldValue
(
"PositiveNegative"
,
PosNeg
);
this
->
SetFieldValue
(
"RingWheel"
,
RingWheel
);
this
->
SetFieldValue
(
"PhiSector"
,
PhiS
);
this
->
SetFieldValue
(
"LayerPlane"
,
LayerPlane
);
this
->
SetFieldValue
(
"Straw"
,
Straw
);
return
th
is
->
GetID
()
;
const
int
PhiS
,
const
int
LayerPlane
,
const
int
Straw
)
const
{
int
the
ID
(
0
);
this
->
SetFieldValue
(
"BarrelEndcap"
,
BrlECap
,
theID
);
this
->
SetFieldValue
(
"PositiveNegative"
,
PosNeg
,
theID
);
this
->
SetFieldValue
(
"RingWheel"
,
RingWheel
,
theID
);
this
->
SetFieldValue
(
"PhiSector"
,
PhiS
,
theID
);
this
->
SetFieldValue
(
"LayerPlane"
,
LayerPlane
,
theID
);
this
->
SetFieldValue
(
"Straw"
,
Straw
,
theID
);
return
th
eID
;
}
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