Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hcana
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
Show more breadcrumbs
jlab
hallc
analyzer_software
hcana
Commits
48a67276
Commit
48a67276
authored
12 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Move Compare method from THcHodoscopeHit to ThcRawHit since it should
work for any derived class.
parent
9b720776
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/THcHodoscopeHit.cxx
+2
-0
2 additions, 0 deletions
src/THcHodoscopeHit.cxx
src/THcHodoscopeHit.h
+2
-2
2 additions, 2 deletions
src/THcHodoscopeHit.h
src/THcRawHit.cxx
+21
-0
21 additions, 0 deletions
src/THcRawHit.cxx
src/THcRawHit.h
+4
-2
4 additions, 2 deletions
src/THcRawHit.h
with
29 additions
and
4 deletions
src/THcHodoscopeHit.cxx
+
2
−
0
View file @
48a67276
...
...
@@ -38,6 +38,7 @@ Int_t THcHodoscopeHit::GetData(Int_t signal) {
return
(
-
1
);
// Actually should throw exception
}
#if 0
Int_t THcHodoscopeHit::Compare(const TObject* obj) const
{
// Compare to sort by plane and counter
...
...
@@ -57,6 +58,7 @@ Int_t THcHodoscopeHit::Compare(const TObject* obj) const
else return 1;
}
}
#endif
//_____________________________________________________________________________
THcHodoscopeHit
&
THcHodoscopeHit
::
operator
=
(
const
THcHodoscopeHit
&
rhs
)
{
...
...
This diff is collapsed.
Click to expand it.
src/THcHodoscopeHit.h
+
2
−
2
View file @
48a67276
...
...
@@ -20,8 +20,8 @@ class THcHodoscopeHit : public THcRawHit {
void
SetData
(
Int_t
signal
,
Int_t
data
);
Int_t
GetData
(
Int_t
signal
);
virtual
Bool_t
IsSortable
()
const
{
return
kTRUE
;
}
virtual
Int_t
Compare
(
const
TObject
*
obj
)
const
;
//
virtual Bool_t IsSortable () const {return kTRUE; }
//
virtual Int_t Compare(const TObject* obj) const;
Int_t
fADC_pos
;
Int_t
fADC_neg
;
...
...
This diff is collapsed.
Click to expand it.
src/THcRawHit.cxx
+
21
−
0
View file @
48a67276
...
...
@@ -13,6 +13,27 @@
//THcRawHit::~THcRawHit()
//{}
Int_t
THcRawHit
::
Compare
(
const
TObject
*
obj
)
const
{
// Compare to sort by plane and counter
const
THcRawHit
*
hit
=
dynamic_cast
<
const
THcRawHit
*>
(
obj
);
if
(
!
hit
)
return
-
1
;
Int_t
p1
=
fPlane
;
Int_t
p2
=
hit
->
fPlane
;
if
(
p1
<
p2
)
return
-
1
;
else
if
(
p1
>
p2
)
return
1
;
else
{
Int_t
c1
=
fCounter
;
Int_t
c2
=
hit
->
fCounter
;
if
(
c1
<
c2
)
return
-
1
;
else
if
(
c1
==
c2
)
return
0
;
else
return
1
;
}
}
ClassImp
(
THcRawHit
)
//_____________________________________________________________________________
This diff is collapsed.
Click to expand it.
src/THcRawHit.h
+
4
−
2
View file @
48a67276
...
...
@@ -29,8 +29,10 @@ public:
virtual
Int_t
GetData
(
Int_t
signal
)
{
return
0
;};
// Derived objects must be sortable and supply Compare method
virtual
Bool_t
IsSortable
()
const
{
return
kFALSE
;
}
virtual
Int_t
Compare
(
const
TObject
*
obj
)
const
{
return
0
;}
// virtual Bool_t IsSortable () const {return kFALSE; }
// virtual Int_t Compare(const TObject* obj) const {return 0;}
virtual
Bool_t
IsSortable
()
const
{
return
kTRUE
;
}
virtual
Int_t
Compare
(
const
TObject
*
obj
)
const
;
Int_t
fPlane
;
Int_t
fCounter
;
...
...
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