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
a0e0b496
Commit
a0e0b496
authored
12 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Create the Scintillator planes in Hodoscope
parent
4359d3f9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/THcHodoscope.cxx
+49
-17
49 additions, 17 deletions
src/THcHodoscope.cxx
src/THcHodoscope.h
+4
-1
4 additions, 1 deletion
src/THcHodoscope.h
src/THcScintillatorPlane.cxx
+19
-0
19 additions, 0 deletions
src/THcScintillatorPlane.cxx
src/THcScintillatorPlane.h
+6
-4
6 additions, 4 deletions
src/THcScintillatorPlane.h
with
78 additions
and
22 deletions
src/THcHodoscope.cxx
+
49
−
17
View file @
a0e0b496
...
@@ -37,7 +37,52 @@ THcHodoscope::THcHodoscope( const char* name, const char* description,
...
@@ -37,7 +37,52 @@ THcHodoscope::THcHodoscope( const char* name, const char* description,
{
{
// Constructor
// Constructor
fTrackProj
=
new
TClonesArray
(
"THaTrackProj"
,
5
);
//fTrackProj = new TClonesArray( "THaTrackProj", 5 );
// Construct the planes
Setup
(
name
,
description
);
}
//_____________________________________________________________________________
void
THcHodoscope
::
Setup
(
const
char
*
name
,
const
char
*
description
)
{
static
const
char
*
const
here
=
"Setup()"
;
static
const
char
*
const
message
=
"Must construct %s detector with valid name! Object construction failed."
;
// Base class constructor failed?
if
(
IsZombie
())
return
;
fNPlanes
=
4
;
// Eventually get # planes and plane names from a DB
fPlaneNames
=
new
char
*
[
fNPlanes
];
for
(
Int_t
i
=
0
;
i
<
fNPlanes
;
i
++
)
{
fPlaneNames
[
i
]
=
new
char
[
3
];}
strcpy
(
fPlaneNames
[
0
],
"1x"
);
strcpy
(
fPlaneNames
[
1
],
"1y"
);
strcpy
(
fPlaneNames
[
2
],
"2x"
);
strcpy
(
fPlaneNames
[
3
],
"2y"
);
size_t
nlen
=
strlen
(
name
);
size_t
slen
=
0
;
for
(
Int_t
i
=
0
;
i
<
fNPlanes
;
i
++
)
{
slen
=
TMath
::
Max
(
slen
,
strlen
(
fPlaneNames
[
i
]));}
size_t
len
=
nlen
+
slen
+
1
;
// Probably shouldn't assume that description is defined
char
*
desc
=
new
char
[
strlen
(
description
)
+
50
+
slen
];
char
*
subname
=
new
char
[
len
+
1
];
fPlanes
=
new
THcScintillatorPlane
*
[
fNPlanes
];
for
(
Int_t
i
=
0
;
i
<
fNPlanes
;
i
++
)
{
strcpy
(
subname
,
name
);
strcat
(
subname
,
"."
);
strcat
(
subname
,
fPlaneNames
[
i
]);
strcpy
(
desc
,
description
);
strcpy
(
desc
,
" Hodoscope Plane "
);
strcpy
(
desc
,
fPlaneNames
[
i
]);
fPlanes
[
i
]
=
new
THcScintillatorPlane
(
subname
,
desc
);
}
}
}
//_____________________________________________________________________________
//_____________________________________________________________________________
...
@@ -55,19 +100,6 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date )
...
@@ -55,19 +100,6 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date )
if
(
THaNonTrackingDetector
::
Init
(
date
)
)
if
(
THaNonTrackingDetector
::
Init
(
date
)
)
return
fStatus
;
return
fStatus
;
// Construct the planes
fPlane
=
new
THcScintillatorPlane
*
[
fNPlanes
];
for
(
Int_t
ip
=
0
;
ip
<
fNPlanes
;
ip
++
)
{
// Create a name and description
// Is it going to be a problem that I create these object in init?
// I could actually do it in the constructor, since the parameters
// will already have been read. Then I don't have to manually call
// ReadDatabase for each plane
GetTitle
()
fPlane
[
ip
]
=
THcScintillatorPlane
(
name
,
description
);
}
// Replace with what we need for Hall C
// Replace with what we need for Hall C
// const DataDest tmp[NDEST] = {
// const DataDest tmp[NDEST] = {
// { &fRTNhit, &fRANhit, fRT, fRT_c, fRA, fRA_p, fRA_c, fROff, fRPed, fRGain },
// { &fRTNhit, &fRANhit, fRT, fRT_c, fRA, fRA_p, fRA_c, fROff, fRPed, fRGain },
...
@@ -131,20 +163,20 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
...
@@ -131,20 +163,20 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
fNPlanes
=
4
;
// Hardwire for now
fNPlanes
=
4
;
// Hardwire for now
fNPaddle
=
new
Int_t
[
4
];
fNPaddle
=
new
Int_t
[
fNPlanes
];
fNPaddle
[
0
]
=
*
(
Int_t
*
)
gHcParms
->
Find
(
"hscin_1x_nr"
)
->
GetValuePointer
();
fNPaddle
[
0
]
=
*
(
Int_t
*
)
gHcParms
->
Find
(
"hscin_1x_nr"
)
->
GetValuePointer
();
fNPaddle
[
1
]
=
*
(
Int_t
*
)
gHcParms
->
Find
(
"hscin_1y_nr"
)
->
GetValuePointer
();
fNPaddle
[
1
]
=
*
(
Int_t
*
)
gHcParms
->
Find
(
"hscin_1y_nr"
)
->
GetValuePointer
();
fNPaddle
[
2
]
=
*
(
Int_t
*
)
gHcParms
->
Find
(
"hscin_2x_nr"
)
->
GetValuePointer
();
fNPaddle
[
2
]
=
*
(
Int_t
*
)
gHcParms
->
Find
(
"hscin_2x_nr"
)
->
GetValuePointer
();
fNPaddle
[
3
]
=
*
(
Int_t
*
)
gHcParms
->
Find
(
"hscin_2y_nr"
)
->
GetValuePointer
();
fNPaddle
[
3
]
=
*
(
Int_t
*
)
gHcParms
->
Find
(
"hscin_2y_nr"
)
->
GetValuePointer
();
fSpacing
=
new
Double_t
[
4
];
fSpacing
=
new
Double_t
[
fNPlanes
];
fSpacing
[
0
]
=
gHcParms
->
Find
(
"hscin_1x_spacing"
)
->
GetValue
(
0
);
fSpacing
[
0
]
=
gHcParms
->
Find
(
"hscin_1x_spacing"
)
->
GetValue
(
0
);
fSpacing
[
1
]
=
gHcParms
->
Find
(
"hscin_1y_spacing"
)
->
GetValue
(
0
);
fSpacing
[
1
]
=
gHcParms
->
Find
(
"hscin_1y_spacing"
)
->
GetValue
(
0
);
fSpacing
[
2
]
=
gHcParms
->
Find
(
"hscin_2x_spacing"
)
->
GetValue
(
0
);
fSpacing
[
2
]
=
gHcParms
->
Find
(
"hscin_2x_spacing"
)
->
GetValue
(
0
);
fSpacing
[
3
]
=
gHcParms
->
Find
(
"hscin_2y_spacing"
)
->
GetValue
(
0
);
fSpacing
[
3
]
=
gHcParms
->
Find
(
"hscin_2y_spacing"
)
->
GetValue
(
0
);
fCenter
=
new
Double_t
*
[
4
];
fCenter
=
new
Double_t
*
[
fNPlanes
];
Double_t
*
p
;
Double_t
*
p
;
Int_t
iplane
;
Int_t
iplane
;
...
...
This diff is collapsed.
Click to expand it.
src/THcHodoscope.h
+
4
−
1
View file @
a0e0b496
...
@@ -46,11 +46,12 @@ protected:
...
@@ -46,11 +46,12 @@ protected:
// Potential Hall C parameters. Mostly here for demonstration
// Potential Hall C parameters. Mostly here for demonstration
Int_t
fNPlanes
;
Int_t
fNPlanes
;
char
**
fPlaneNames
;
Int_t
*
fNPaddle
;
// Number of paddles per plane
Int_t
*
fNPaddle
;
// Number of paddles per plane
Double_t
*
fSpacing
;
// Paddle spacing in cm
Double_t
*
fSpacing
;
// Paddle spacing in cm
Double_t
**
fCenter
;
// Center position of each paddle
Double_t
**
fCenter
;
// Center position of each paddle
THcScintillatorPlane
**
fPlane
;
// List of plane objects
THcScintillatorPlane
**
fPlane
s
;
// List of plane objects
TClonesArray
*
fTrackProj
;
// projection of track onto scintillator plane
TClonesArray
*
fTrackProj
;
// projection of track onto scintillator plane
// and estimated match to TOF paddle
// and estimated match to TOF paddle
...
@@ -81,6 +82,8 @@ protected:
...
@@ -81,6 +82,8 @@ protected:
virtual
Double_t
TimeWalkCorrection
(
const
Int_t
&
paddle
,
virtual
Double_t
TimeWalkCorrection
(
const
Int_t
&
paddle
,
const
ESide
side
);
const
ESide
side
);
void
Setup
(
const
char
*
name
,
const
char
*
description
);
ClassDef
(
THcHodoscope
,
0
)
// Generic hodoscope class
ClassDef
(
THcHodoscope
,
0
)
// Generic hodoscope class
};
};
...
...
This diff is collapsed.
Click to expand it.
src/THcScintillatorPlane.cxx
+
19
−
0
View file @
a0e0b496
...
@@ -26,3 +26,22 @@ THcScintillatorPlane::~THcScintillatorPlane()
...
@@ -26,3 +26,22 @@ THcScintillatorPlane::~THcScintillatorPlane()
// Destructor
// Destructor
}
}
//_____________________________________________________________________________
Int_t
THcScintillatorPlane
::
Decode
(
const
THaEvData
&
evdata
)
{
return
0
;
}
//_____________________________________________________________________________
Int_t
THcScintillatorPlane
::
CoarseProcess
(
TClonesArray
&
tracks
)
{
// HitCount();
return
0
;
}
//_____________________________________________________________________________
Int_t
THcScintillatorPlane
::
FineProcess
(
TClonesArray
&
tracks
)
{
return
0
;
}
This diff is collapsed.
Click to expand it.
src/THcScintillatorPlane.h
+
6
−
4
View file @
a0e0b496
...
@@ -17,13 +17,15 @@
...
@@ -17,13 +17,15 @@
class
THcScintillatorPlane
:
public
THaNonTrackingDetector
{
class
THcScintillatorPlane
:
public
THaNonTrackingDetector
{
public:
public:
virtual
~
THcScintillatorPlane
();
THcScintillatorPlane
(
const
char
*
name
,
const
char
*
description
,
THcScintillatorPlane
(
const
char
*
name
,
const
char
*
description
,
THaApparatus
*
a
=
NULL
);
THaApparatus
*
a
=
NULL
);
virtual
~
THcScintillatorPlane
();
virtual
Int_t
Decode
(
const
THaEvData
&
);
virtual
Int_t
CoarseProcess
(
TClonesArray
&
tracks
)
=
0
;
virtual
Int_t
CoarseProcess
(
TClonesArray
&
tracks
);
virtual
Int_t
FineProcess
(
TClonesArray
&
tracks
)
=
0
;
virtual
Int_t
FineProcess
(
TClonesArray
&
tracks
);
Bool_t
IsTracking
()
{
return
kFALSE
;
}
Bool_t
IsTracking
()
{
return
kFALSE
;
}
virtual
Bool_t
IsPid
()
{
return
kFALSE
;
}
virtual
Bool_t
IsPid
()
{
return
kFALSE
;
}
...
...
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