Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
np
nptool
Commits
e6cdd725
Commit
e6cdd725
authored
Dec 11, 2020
by
Adrien Matta
☠
Browse files
* progress on FDC2
parent
8e24293a
Pipeline
#95203
passed with stages
in 12 minutes and 52 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
65 additions
and
72 deletions
+65
-72
NPLib/Detectors/Samurai/SamuraiDCIndex.h
NPLib/Detectors/Samurai/SamuraiDCIndex.h
+6
-4
NPLib/Detectors/Samurai/TSamuraiFDC0Data.h
NPLib/Detectors/Samurai/TSamuraiFDC0Data.h
+1
-0
NPLib/Detectors/Samurai/TSamuraiFDC0Physics.cxx
NPLib/Detectors/Samurai/TSamuraiFDC0Physics.cxx
+10
-8
NPLib/Detectors/Samurai/TSamuraiFDC0Physics.h
NPLib/Detectors/Samurai/TSamuraiFDC0Physics.h
+15
-15
NPLib/Detectors/Samurai/TSamuraiFDC2Data.h
NPLib/Detectors/Samurai/TSamuraiFDC2Data.h
+1
-0
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.cxx
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.cxx
+12
-8
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.h
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.h
+16
-17
NPLib/TrackReconstruction/NPDCReconstructionMT.cxx
NPLib/TrackReconstruction/NPDCReconstructionMT.cxx
+0
-2
NPLib/TrackReconstruction/NPDCReconstructionMT.h
NPLib/TrackReconstruction/NPDCReconstructionMT.h
+3
-5
NPSimulation/Process/BeamReaction.cc
NPSimulation/Process/BeamReaction.cc
+1
-0
Projects/MUGAST_LISE/DetectorConfiguration/MUGAST_LISE.detector
...ts/MUGAST_LISE/DetectorConfiguration/MUGAST_LISE.detector
+0
-13
No files found.
NPLib/Detectors/Samurai/SamuraiDCIndex.h
View file @
e6cdd725
...
...
@@ -36,12 +36,14 @@ class SamuraiDCIndex{
m_norme
=
Norme
();
};
unsigned
int
m_det
;
unsigned
int
m_layer
;
unsigned
int
m_wire
;
unsigned
int
m_norme
;
private:
unsigned
int
m_det
;
unsigned
int
m_layer
;
unsigned
int
m_wire
;
unsigned
int
m_norme
;
inline
int
Norme
()
const
{
return
(
m_det
*
1000000000
+
m_layer
*
1000000
+
m_wire
);}
;
bool
operator
<
(
const
SamuraiDCIndex
i2
){
return
this
->
Norme
()
<
i2
.
Norme
();
}
...
...
NPLib/Detectors/Samurai/TSamuraiFDC0Data.h
View file @
e6cdd725
...
...
@@ -2,6 +2,7 @@
#define TSamuraiFDC0Data_H
#include "TObject.h"
#include <vector>
class
TSamuraiFDC0Data
:
public
TObject
{
public:
TSamuraiFDC0Data
();
...
...
NPLib/Detectors/Samurai/TSamuraiFDC0Physics.cxx
View file @
e6cdd725
...
...
@@ -26,6 +26,7 @@
#include <cmath>
#include <stdlib.h>
#include <limits>
using
namespace
std
;
// NPL
#include "RootInput.h"
...
...
@@ -50,14 +51,6 @@ ClassImp(TSamuraiFDC0Physics)
DriftLowThreshold
=
0.1
;
DriftUpThreshold
=
2.4
;
PowerThreshold
=
5
;
#if __cplusplus > 199711L && NPMULTITHREADING
// one thread for each plan X,Y = 2
// ! more than that this will not help !
m_reconstruction
.
SetNumberOfThread
(
2
);
m_reconstruction
.
InitThreadPool
();
#endif
}
///////////////////////////////////////////////////////////////////////////
...
...
@@ -350,6 +343,15 @@ void TSamuraiFDC0Physics::ReadConfiguration(NPL::InputParser parser){
xml
.
LoadFile
(
xmlpath
);
AddDC
(
"SAMURAIFDC0"
,
xml
);
}
#if __cplusplus > 199711L && NPMULTITHREADING
if
(
blocks
.
size
()){
// if a detector is found, init the thread pool
// one thread for each plan X,Y = 2
// ! more than that this will not help !
m_reconstruction
.
SetNumberOfThread
(
2
);
m_reconstruction
.
InitThreadPool
();
#endif
}
}
///////////////////////////////////////////////////////////////////////////
...
...
NPLib/Detectors/Samurai/TSamuraiFDC0Physics.h
View file @
e6cdd725
...
...
@@ -25,6 +25,7 @@
// STL
#include <vector>
#include <map>
#include <string>
// NPL
#include "TSamuraiFDC0Data.h"
...
...
@@ -48,7 +49,6 @@
//class TSamuraiFDC0Spectra;
using
namespace
std
;
class
TSamuraiFDC0Physics
:
public
TObject
,
public
NPL
::
VDetector
{
public:
...
...
@@ -61,16 +61,16 @@ class TSamuraiFDC0Physics : public TObject, public NPL::VDetector{
public:
// Provide Physical Multiplicity
vector
<
double
>
DriftLength
;
vector
<
int
>
Detector
;
vector
<
int
>
Layer
;
vector
<
int
>
Wire
;
vector
<
double
>
Time
;
vector
<
double
>
ToT
;
vector
<
bool
>
Matched
;
std
::
vector
<
double
>
DriftLength
;
std
::
vector
<
int
>
Detector
;
std
::
vector
<
int
>
Layer
;
std
::
vector
<
int
>
Wire
;
std
::
vector
<
double
>
Time
;
std
::
vector
<
double
>
ToT
;
std
::
vector
<
bool
>
Matched
;
// Computed variable
vector
<
TVector3
>
ParticleDirection
;
vector
<
TVector3
>
MiddlePosition
;
std
::
vector
<
TVector3
>
ParticleDirection
;
std
::
vector
<
TVector3
>
MiddlePosition
;
double
PosX
;
double
PosY
;
...
...
@@ -87,10 +87,10 @@ class TSamuraiFDC0Physics : public TObject, public NPL::VDetector{
TVector3
ProjectedPosition
(
double
Z
);
private:
// Charateristic of the DC
void
AddDC
(
string
name
,
NPL
::
XmlParser
&
);
//! take the XML file and fill in Wire_X and Layer_Angle
map
<
SamuraiDCIndex
,
double
>
Wire_X
;
//! X position of the wires
map
<
SamuraiDCIndex
,
double
>
Wire_Z
;
//! Z position of the wires
map
<
SamuraiDCIndex
,
double
>
Wire_Angle
;
//! Wire Angle (0 for X, 90 for Y, U and V are typically at +/-30)
void
AddDC
(
std
::
string
name
,
NPL
::
XmlParser
&
);
//! take the XML file and fill in Wire_X and Layer_Angle
std
::
map
<
SamuraiDCIndex
,
double
>
Wire_X
;
//! X position of the wires
std
::
map
<
SamuraiDCIndex
,
double
>
Wire_Z
;
//! Z position of the wires
std
::
map
<
SamuraiDCIndex
,
double
>
Wire_Angle
;
//! Wire Angle (0 for X, 90 for Y, U and V are typically at +/-30)
private:
// Analysis
double
ToTThreshold_H
;
//! a ToT Low threshold to remove noise
...
...
@@ -186,7 +186,7 @@ class TSamuraiFDC0Physics : public TObject, public NPL::VDetector{
// TSamuraiFDC0Spectra* m_Spectra; // !
public:
// Spectra Getter
map
<
string
,
TH1
*>
GetSpectra
();
std
::
map
<
std
::
string
,
TH1
*>
GetSpectra
();
public:
// Static constructor to be passed to the Detector Factory
static
NPL
::
VDetector
*
Construct
();
...
...
NPLib/Detectors/Samurai/TSamuraiFDC2Data.h
View file @
e6cdd725
...
...
@@ -2,6 +2,7 @@
#define TSamuraiFDC2Data_H
#include "TObject.h"
#include <vector>
class
TSamuraiFDC2Data
:
public
TObject
{
public:
TSamuraiFDC2Data
();
...
...
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.cxx
View file @
e6cdd725
...
...
@@ -26,11 +26,11 @@
#include <cmath>
#include <stdlib.h>
#include <limits>
using
namespace
std
;
// NPL
#include "RootInput.h"
#include "RootOutput.h"
#include "TAsciiFile.h"
#include "NPOptionManager.h"
#include "NPDetectorFactory.h"
#include "NPSystemOfUnits.h"
...
...
@@ -50,13 +50,6 @@ ClassImp(TSamuraiFDC2Physics)
DriftLowThreshold
=
0.4
;
DriftUpThreshold
=
9.3
;
PowerThreshold
=
5
;
#if __cplusplus > 199711L && NPMULTITHREADING
// one thread for each plan X,U,V = 3
// ! more than this will not help !
m_reconstruction
.
SetNumberOfThread
(
3
);
m_reconstruction
.
InitThreadPool
();
#endif
}
///////////////////////////////////////////////////////////////////////////
...
...
@@ -349,6 +342,17 @@ void TSamuraiFDC2Physics::ReadConfiguration(NPL::InputParser parser){
xml
.
LoadFile
(
xmlpath
);
AddDC
(
"SAMURAIFDC2"
,
xml
);
}
#if __cplusplus > 199711L && NPMULTITHREADING
if
(
blocks
.
size
()){
// one thread for each plan X,U,V = 3
// ! more than this will not help !
m_reconstruction
.
SetNumberOfThread
(
3
);
m_reconstruction
.
InitThreadPool
();
}
#endif
}
///////////////////////////////////////////////////////////////////////////
...
...
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.h
View file @
e6cdd725
...
...
@@ -48,7 +48,6 @@
using
namespace
std
;
class
TSamuraiFDC2Physics
:
public
TObject
,
public
NPL
::
VDetector
{
public:
TSamuraiFDC2Physics
();
...
...
@@ -60,16 +59,16 @@ class TSamuraiFDC2Physics : public TObject, public NPL::VDetector{
public:
// Provide Physical Multiplicity
vector
<
double
>
DriftLength
;
vector
<
int
>
Detector
;
vector
<
int
>
Layer
;
vector
<
int
>
Wire
;
vector
<
double
>
Time
;
vector
<
double
>
ToT
;
vector
<
bool
>
Matched
;
std
::
vector
<
double
>
DriftLength
;
std
::
vector
<
int
>
Detector
;
std
::
vector
<
int
>
Layer
;
std
::
vector
<
int
>
Wire
;
std
::
vector
<
double
>
Time
;
std
::
vector
<
double
>
ToT
;
std
::
vector
<
bool
>
Matched
;
// Computed variable
vector
<
TVector3
>
ParticleDirection
;
vector
<
TVector3
>
MiddlePosition
;
std
::
vector
<
TVector3
>
ParticleDirection
;
std
::
vector
<
TVector3
>
MiddlePosition
;
double
PosX
;
double
PosY
;
...
...
@@ -86,10 +85,10 @@ class TSamuraiFDC2Physics : public TObject, public NPL::VDetector{
TVector3
ProjectedPosition
(
double
Z
);
private:
// Charateristic of the DC
void
AddDC
(
string
name
,
NPL
::
XmlParser
&
);
//! take the XML file and fill in Wire_X and Layer_Angle
map
<
SamuraiDCIndex
,
double
>
Wire_X
;
//! X position of the wires
map
<
SamuraiDCIndex
,
double
>
Wire_Z
;
//! Z position of the wires
map
<
SamuraiDCIndex
,
double
>
Wire_Angle
;
//! Wire Angle (0 for X, 90 for Y, U and V are typically at +/-30)
void
AddDC
(
std
::
string
name
,
NPL
::
XmlParser
&
);
//! take the XML file and fill in Wire_X and Layer_Angle
std
::
map
<
SamuraiDCIndex
,
double
>
Wire_X
;
//! X position of the wires
std
::
map
<
SamuraiDCIndex
,
double
>
Wire_Z
;
//! Z position of the wires
std
::
map
<
SamuraiDCIndex
,
double
>
Wire_Angle
;
//! Wire Angle (0 for X, 90 for Y, U and V are typically at +/-30)
private:
// Analysis
double
ToTThreshold_H
;
//! a ToT Low threshold to remove noise
...
...
@@ -98,7 +97,7 @@ class TSamuraiFDC2Physics : public TObject, public NPL::VDetector{
double
DriftLowThreshold
;
//! Minimum Drift length to keep the hit
double
DriftUpThreshold
;
//! Maximum Drift length to keep the hit
double
PowerThreshold
;
//! Maximum P2 minimisation value to keep the track
void
RemoveNoise
();
void
RemoveNoise
();
//!
// Construct the 2D track and ref position at Z=0 and Z=100 based on X,Z and Radius provided
// Object use to perform the DC reconstruction
...
...
@@ -163,7 +162,7 @@ class TSamuraiFDC2Physics : public TObject, public NPL::VDetector{
void
ClearPreTreatedData
()
{
m_PreTreatedData
->
Clear
();}
// Remove bad channel, calibrate the data and apply threshold
void
PreTreat
();
void
PreTreat
();
//!
// Retrieve raw and pre-treated data
TSamuraiFDC2Data
*
GetRawData
()
const
{
return
m_EventData
;}
...
...
@@ -186,7 +185,7 @@ class TSamuraiFDC2Physics : public TObject, public NPL::VDetector{
// TSamuraiFDC2Spectra* m_Spectra; // !
public:
// Spectra Getter
map
<
string
,
TH1
*>
GetSpectra
();
std
::
map
<
std
::
string
,
TH1
*>
GetSpectra
();
public:
// Static constructor to be passed to the Detector Factory
static
NPL
::
VDetector
*
Construct
();
...
...
NPLib/TrackReconstruction/NPDCReconstructionMT.cxx
View file @
e6cdd725
...
...
@@ -188,11 +188,9 @@ void NPL::DCReconstructionMT::InitThreadPool(){
for
(
unsigned
int
i
=
0
;
i
<
m_nbr_thread
;
i
++
)
{
//Create the minimiser (deleted by the thread)
ROOT
::
Math
::
Minimizer
*
mini
=
ROOT
::
Math
::
Factory
::
CreateMinimizer
(
"Minuit2"
,
"Migrad"
);
// Register minimiser for futur deletion
m_ThreadPool
.
push_back
(
std
::
thread
(
&
NPL
::
DCReconstructionMT
::
StartThread
,
this
,
mini
,
i
)
);
}
m_stop
=
false
;
for
(
auto
&
th
:
m_ThreadPool
){
th
.
detach
();
...
...
NPLib/TrackReconstruction/NPDCReconstructionMT.h
View file @
e6cdd725
...
...
@@ -70,13 +70,11 @@ namespace NPL{
// Function used by the minimizer in BuildTrack2D
double
SumD
(
const
double
*
parameter
);
// For debugging/optimisation
// Scan Sumd versus parameter a or b (tovary =0 for a, 1 for b)
// return a TGraph for display
TGraph
*
Scan
(
double
a
,
double
b
,
int
tovary
,
double
minV
,
double
maxV
);
private:
// private member used by SumD
// data to minize index by thread ID
std
::
map
<
unsigned
int
,
unsigned
int
>
sizeX
;
...
...
@@ -98,12 +96,12 @@ namespace NPL{
bool
m_stop
;
public:
// Init the Thread Pool
void
StopThread
();
void
StartThread
(
ROOT
::
Math
::
Minimizer
*
,
unsigned
int
);
void
InitThreadPool
();
void
StartThread
(
ROOT
::
Math
::
Minimizer
*
,
unsigned
int
);
void
StopThread
();
bool
IsDone
();
// used by SumD
// used by resolve plane
long
double
av
,
bv
,
au
,
bu
;
...
...
NPSimulation/Process/BeamReaction.cc
View file @
e6cdd725
...
...
@@ -23,6 +23,7 @@
#include "BeamReaction.hh"
#include "G4Electron.hh"
#include "G4IonTable.hh"
#include "G4Gamma.hh"
#include "G4SystemOfUnits.hh"
#include "G4EmCalculator.hh"
...
...
Projects/MUGAST_LISE/DetectorConfiguration/MUGAST_LISE.detector
View file @
e6cdd725
...
...
@@ -8,19 +8,6 @@ Target
X= 0 mm
Y= 0 mm
Z= 0 mm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AnnularS1
Z= -100
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GaspardTracker Trapezoid
R= -90 mm
THETA= 90 deg
PHI= 90 deg
BETA= 0 0 0 deg
FIRSTSTAGE= 1
SECONDSTAGE= 0
THIRDSTAGE= 0
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GaspardTracker Trapezoid
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment