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
9b720776
Commit
9b720776
authored
12 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
New raw hit class for drift chambers
parent
32d761ae
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/THcDCHit.cxx
+78
-0
78 additions, 0 deletions
src/THcDCHit.cxx
src/THcDCHit.h
+37
-0
37 additions, 0 deletions
src/THcDCHit.h
with
115 additions
and
0 deletions
src/THcDCHit.cxx
0 → 100644
+
78
−
0
View file @
9b720776
///////////////////////////////////////////////////////////////////////////////
// //
// THcDCHit //
// //
// Class representing for drift chamber wire (or other device with //
// a single multihit TDC channel per detector element //
// //
///////////////////////////////////////////////////////////////////////////////
#include
"THcDCHit.h"
using
namespace
std
;
void
THcDCHit
::
SetData
(
Int_t
signal
,
Int_t
data
)
{
fTDC
[
fNHits
++
]
=
data
;
}
// Return just the first hit
Int_t
THcDCHit
::
GetData
(
Int_t
signal
)
{
if
(
fNHits
>
0
)
{
return
(
fTDC
[
0
]);
}
else
{
return
(
-
1
);
}
}
// Return a requested hit
Int_t
THcDCHit
::
GetData
(
Int_t
signal
,
Int_t
ihit
)
{
if
(
ihit
>=
0
&&
ihit
<
fNHits
)
{
return
(
fTDC
[
ihit
]);
}
else
{
return
(
-
1
);
}
}
Int_t
THcDCHit
::
Compare
(
const
TObject
*
obj
)
const
{
// Compare to sort by plane and counter
// Should we be able to move this into THcRawHit
const
THcDCHit
*
hit
=
dynamic_cast
<
const
THcDCHit
*>
(
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
;
}
}
//_____________________________________________________________________________
THcDCHit
&
THcDCHit
::
operator
=
(
const
THcDCHit
&
rhs
)
{
// Assignment operator.
THcRawHit
::
operator
=
(
rhs
);
if
(
this
!=
&
rhs
)
{
fPlane
=
rhs
.
fPlane
;
fCounter
=
rhs
.
fCounter
;
fNHits
=
rhs
.
fNHits
;
for
(
Int_t
ihit
=
0
;
ihit
<
fNHits
;
ihit
++
)
{
fTDC
[
ihit
]
=
rhs
.
fTDC
[
ihit
];
}
}
return
*
this
;
}
//////////////////////////////////////////////////////////////////////////
ClassImp
(
THcDCHit
)
This diff is collapsed.
Click to expand it.
src/THcDCHit.h
0 → 100644
+
37
−
0
View file @
9b720776
#ifndef ROOT_THcDCHit
#define ROOT_THcDCHit
#include
"THcRawHit.h"
#define MAXHITS 16
class
THcDCHit
:
public
THcRawHit
{
public:
THcDCHit
(
Int_t
plane
=
0
,
Int_t
counter
=
0
)
:
THcRawHit
(
plane
,
counter
),
fNHits
(
0
)
{
}
THcDCHit
&
operator
=
(
const
THcDCHit
&
);
virtual
~
THcDCHit
()
{}
virtual
void
Clear
(
Option_t
*
opt
=
""
)
{
fNHits
=
0
;
}
void
SetData
(
Int_t
signal
,
Int_t
data
);
Int_t
GetData
(
Int_t
signal
);
Int_t
GetData
(
Int_t
signal
,
Int_t
ihit
);
virtual
Bool_t
IsSortable
()
const
{
return
kTRUE
;
}
virtual
Int_t
Compare
(
const
TObject
*
obj
)
const
;
Int_t
fNHits
;
Int_t
fTDC
[
MAXHITS
];
protected
:
private
:
ClassDef
(
THcDCHit
,
0
);
// DC hit class
};
#endif
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