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
5abb3b07
Commit
5abb3b07
authored
Oct 05, 2020
by
Adrien Matta
☠
Browse files
Merge branch 'NPTool.2.dev' of gitlab.in2p3.fr:np/nptool into NPTool.2.dev
parents
c0bafd0d
e397d977
Pipeline
#85822
passed with stages
in 55 minutes and 31 seconds
Changes
29
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
2468 additions
and
1102 deletions
+2468
-1102
Examples/Example4/Analysis.cxx
Examples/Example4/Analysis.cxx
+10
-6
Examples/Example4/configs/ConfigActar.dat
Examples/Example4/configs/ConfigActar.dat
+4
-4
Examples/Example4/macro/CheckReco.C
Examples/Example4/macro/CheckReco.C
+1
-1
Examples/Example4/macro/ShowResult.C
Examples/Example4/macro/ShowResult.C
+1
-1
NPLib/Detectors/Actar/TActarPhysics.cxx
NPLib/Detectors/Actar/TActarPhysics.cxx
+452
-452
NPLib/Detectors/FissionChamber/CMakeLists.txt
NPLib/Detectors/FissionChamber/CMakeLists.txt
+6
-0
NPLib/Detectors/FissionChamber/TFissionChamberData.cxx
NPLib/Detectors/FissionChamber/TFissionChamberData.cxx
+79
-0
NPLib/Detectors/FissionChamber/TFissionChamberData.h
NPLib/Detectors/FissionChamber/TFissionChamberData.h
+104
-0
NPLib/Detectors/FissionChamber/TFissionChamberPhysics.cxx
NPLib/Detectors/FissionChamber/TFissionChamberPhysics.cxx
+344
-0
NPLib/Detectors/FissionChamber/TFissionChamberPhysics.h
NPLib/Detectors/FissionChamber/TFissionChamberPhysics.h
+180
-0
NPLib/Detectors/FissionChamber/TFissionChamberSpectra.cxx
NPLib/Detectors/FissionChamber/TFissionChamberSpectra.cxx
+174
-0
NPLib/Detectors/FissionChamber/TFissionChamberSpectra.h
NPLib/Detectors/FissionChamber/TFissionChamberSpectra.h
+62
-0
NPLib/TrackReconstruction/NPCluster.cxx
NPLib/TrackReconstruction/NPCluster.cxx
+445
-442
NPSimulation/Core/MaterialManager.cc
NPSimulation/Core/MaterialManager.cc
+11
-0
NPSimulation/Detectors/Actar/Actar.cc
NPSimulation/Detectors/Actar/Actar.cc
+9
-4
NPSimulation/Detectors/ChiNu/ChiNu.cc
NPSimulation/Detectors/ChiNu/ChiNu.cc
+2
-187
NPSimulation/Detectors/ChiNu/ChiNu.hh
NPSimulation/Detectors/ChiNu/ChiNu.hh
+0
-5
NPSimulation/Detectors/FissionChamber/CMakeLists.txt
NPSimulation/Detectors/FissionChamber/CMakeLists.txt
+2
-0
NPSimulation/Detectors/FissionChamber/FissionChamber.cc
NPSimulation/Detectors/FissionChamber/FissionChamber.cc
+457
-0
NPSimulation/Detectors/FissionChamber/FissionChamber.hh
NPSimulation/Detectors/FissionChamber/FissionChamber.hh
+125
-0
No files found.
Examples/Example4/Analysis.cxx
View file @
5abb3b07
...
@@ -78,7 +78,6 @@ void Analysis::TreatEvent(){
...
@@ -78,7 +78,6 @@ void Analysis::TreatEvent(){
TVector3
vX
=
TVector3
(
1
,
0
,
0
);
TVector3
vX
=
TVector3
(
1
,
0
,
0
);
TVector3
aTrack
,
vB
;
TVector3
aTrack
,
vB
;
if
(
TrackMult
>
1
){
if
(
TrackMult
>
1
){
vTrack
=
Actar
->
GetTracks
();
vTrack
=
Actar
->
GetTracks
();
double
scalarproduct
=
0
;
double
scalarproduct
=
0
;
...
@@ -106,7 +105,8 @@ void Analysis::TreatEvent(){
...
@@ -106,7 +105,8 @@ void Analysis::TreatEvent(){
double
ZBeamPoint
=
vTrack
[
BeamTrack
].
GetZh
();
double
ZBeamPoint
=
vTrack
[
BeamTrack
].
GetZh
();
TVector3
vBeamPos
=
TVector3
(
XBeamPoint
,
YBeamPoint
,
ZBeamPoint
);
TVector3
vBeamPos
=
TVector3
(
XBeamPoint
,
YBeamPoint
,
ZBeamPoint
);
vB
=
TVector3
(
XBeam
*
PadSizeX
,
YBeam
*
PadSizeY
,
ZBeam
*
DriftVelocity
);
//vB = TVector3(XBeam*PadSizeX, YBeam*PadSizeY,ZBeam*DriftVelocity);
vB
=
TVector3
(
XBeam
*
PadSizeX
,
YBeam
*
PadSizeY
,
ZBeam
);
BeamAngle
=
(
vX
.
Angle
(
vB
))
*
180
/
TMath
::
Pi
();
BeamAngle
=
(
vX
.
Angle
(
vB
))
*
180
/
TMath
::
Pi
();
for
(
unsigned
int
i
=
0
;
i
<
TrackMult
;
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
TrackMult
;
i
++
){
...
@@ -117,9 +117,11 @@ void Analysis::TreatEvent(){
...
@@ -117,9 +117,11 @@ void Analysis::TreatEvent(){
double
vertex_x
=
vTrack
[
i
].
GetVertexPostion
(
vBeam
,
vBeamPos
).
X
()
*
PadSizeX
;
double
vertex_x
=
vTrack
[
i
].
GetVertexPostion
(
vBeam
,
vBeamPos
).
X
()
*
PadSizeX
;
double
vertex_y
=
vTrack
[
i
].
GetVertexPostion
(
vBeam
,
vBeamPos
).
Y
()
*
PadSizeY
;
double
vertex_y
=
vTrack
[
i
].
GetVertexPostion
(
vBeam
,
vBeamPos
).
Y
()
*
PadSizeY
;
double
vertex_z
=
vTrack
[
i
].
GetVertexPostion
(
vBeam
,
vBeamPos
).
Z
()
*
DriftVelocity
;
//double vertex_z = vTrack[i].GetVertexPostion(vBeam,vBeamPos).Z()*DriftVelocity;
double
vertex_z
=
vTrack
[
i
].
GetVertexPostion
(
vBeam
,
vBeamPos
).
Z
();
aTrack
=
TVector3
(
Xdir
*
PadSizeX
,
Ydir
*
PadSizeY
,
Zdir
*
DriftVelocity
);
//aTrack = TVector3(Xdir*PadSizeX, Ydir*PadSizeY, Zdir*DriftVelocity);
aTrack
=
TVector3
(
Xdir
*
PadSizeX
,
Ydir
*
PadSizeY
,
Zdir
);
double
angle
=
vX
.
Angle
(
aTrack
)
*
180
/
TMath
::
Pi
();
double
angle
=
vX
.
Angle
(
aTrack
)
*
180
/
TMath
::
Pi
();
//double angle = vB.Angle(aTrack)*180/TMath::Pi();
//double angle = vB.Angle(aTrack)*180/TMath::Pi();
if
(
angle
>
90
)
angle
=
180
-
angle
;
if
(
angle
>
90
)
angle
=
180
-
angle
;
...
@@ -130,8 +132,10 @@ void Analysis::TreatEvent(){
...
@@ -130,8 +132,10 @@ void Analysis::TreatEvent(){
double
y2
=
vTrack
[
i
].
GetYh
()
*
PadSizeY
-
0.5
*
NumberOfPadsY
*
PadSizeY
;
double
y2
=
vTrack
[
i
].
GetYh
()
*
PadSizeY
-
0.5
*
NumberOfPadsY
*
PadSizeY
;
//double z1 = -(vTrack[i].GetZm()-256)*DriftVelocity;
//double z1 = -(vTrack[i].GetZm()-256)*DriftVelocity;
//double z2 = -(vTrack[i].GetZh()-256)*DriftVelocity;
//double z2 = -(vTrack[i].GetZh()-256)*DriftVelocity;
double
z1
=
vTrack
[
i
].
GetZm
()
*
DriftVelocity
;
//double z1 = vTrack[i].GetZm()*DriftVelocity;
double
z2
=
vTrack
[
i
].
GetZh
()
*
DriftVelocity
;
double
z1
=
vTrack
[
i
].
GetZm
();
//double z2 = vTrack[i].GetZh()*DriftVelocity;
double
z2
=
vTrack
[
i
].
GetZh
();
if
(
vertex_x
>
0
&&
vertex_x
<
256
){
if
(
vertex_x
>
0
&&
vertex_x
<
256
){
...
...
Examples/Example4/configs/ConfigActar.dat
View file @
5abb3b07
ConfigActar
ConfigActar
RecoRansac=
0
RecoRansac=
1
RecoCluster=
1
RecoCluster=
0
RecoVisu=
0
RecoVisu=
1
HIT_THRESHOLD= 2
HIT_THRESHOLD= 2
Q_THRESHOLD= 0
Q_THRESHOLD= 0
T_THRESHOLD= 0
T_THRESHOLD= 0
...
@@ -17,4 +17,4 @@ Gas= iC4H10
...
@@ -17,4 +17,4 @@ Gas= iC4H10
%Gas= D2
%Gas= D2
%Pressure in mbar
%Pressure in mbar
Pressure= 100
Pressure= 100
DriftVelocity=
2.66
DriftVelocity=
0.8e-2
Examples/Example4/macro/CheckReco.C
View file @
5abb3b07
...
@@ -17,7 +17,7 @@ void LoadCut()
...
@@ -17,7 +17,7 @@ void LoadCut()
void
LoadChain
()
void
LoadChain
()
{
{
chain
=
new
TChain
(
"PhysicsTree"
);
chain
=
new
TChain
(
"PhysicsTree"
);
chain
->
Add
(
"../../Outputs/Analysis/Example4.root"
);
chain
->
Add
(
"../../
../
Outputs/Analysis/Example4.root"
);
}
}
////////////////////////////////////////////////
////////////////////////////////////////////////
...
...
Examples/Example4/macro/ShowResult.C
View file @
5abb3b07
...
@@ -18,7 +18,7 @@ void LoadCut()
...
@@ -18,7 +18,7 @@ void LoadCut()
void
LoadChain
()
void
LoadChain
()
{
{
chain
=
new
TChain
(
"PhysicsTree"
);
chain
=
new
TChain
(
"PhysicsTree"
);
chain
->
Add
(
"../../Outputs/Analysis/Example4.root"
);
chain
->
Add
(
"../../
../
Outputs/Analysis/Example4.root"
);
}
}
////////////////////////////////////////////////
////////////////////////////////////////////////
...
...
NPLib/Detectors/Actar/TActarPhysics.cxx
View file @
5abb3b07
This diff is collapsed.
Click to expand it.
NPLib/Detectors/FissionChamber/CMakeLists.txt
0 → 100644
View file @
5abb3b07
add_custom_command
(
OUTPUT TFissionChamberPhysicsDict.cxx COMMAND ../../scripts/build_dict.sh TFissionChamberPhysics.h TFissionChamberPhysicsDict.cxx TFissionChamberPhysics.rootmap libNPFissionChamber.dylib DEPENDS TFissionChamberPhysics.h
)
add_custom_command
(
OUTPUT TFissionChamberDataDict.cxx COMMAND ../../scripts/build_dict.sh TFissionChamberData.h TFissionChamberDataDict.cxx TFissionChamberData.rootmap libNPFissionChamber.dylib DEPENDS TFissionChamberData.h
)
add_library
(
NPFissionChamber SHARED TFissionChamberSpectra.cxx TFissionChamberData.cxx TFissionChamberPhysics.cxx TFissionChamberDataDict.cxx TFissionChamberPhysicsDict.cxx
)
target_link_libraries
(
NPFissionChamber
${
ROOT_LIBRARIES
}
NPCore
)
install
(
FILES TFissionChamberData.h TFissionChamberPhysics.h TFissionChamberSpectra.h DESTINATION
${
CMAKE_INCLUDE_OUTPUT_DIRECTORY
}
)
NPLib/Detectors/FissionChamber/TFissionChamberData.cxx
0 → 100644
View file @
5abb3b07
/*****************************************************************************
* Copyright (C) 2009-2020 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr *
* *
* Creation Date : September 2020 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold FissionChamber Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TFissionChamberData.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using
namespace
std
;
ClassImp
(
TFissionChamberData
)
//////////////////////////////////////////////////////////////////////
TFissionChamberData
::
TFissionChamberData
()
{
}
//////////////////////////////////////////////////////////////////////
TFissionChamberData
::~
TFissionChamberData
()
{
}
//////////////////////////////////////////////////////////////////////
void
TFissionChamberData
::
Clear
()
{
// Energy
fFissionChamber_E_DetectorNbr
.
clear
();
fFissionChamber_Energy
.
clear
();
// Time
fFissionChamber_T_DetectorNbr
.
clear
();
fFissionChamber_Time
.
clear
();
}
//////////////////////////////////////////////////////////////////////
void
TFissionChamberData
::
Dump
()
const
{
// This method is very useful for debuging and worth the dev.
cout
<<
"XXXXXXXXXXXXXXXXXXXXXXXX New Event [TFissionChamberData::Dump()] XXXXXXXXXXXXXXXXX"
<<
endl
;
// Energy
size_t
mysize
=
fFissionChamber_E_DetectorNbr
.
size
();
cout
<<
"FissionChamber_E_Mult: "
<<
mysize
<<
endl
;
for
(
size_t
i
=
0
;
i
<
mysize
;
i
++
){
cout
<<
"DetNbr: "
<<
fFissionChamber_E_DetectorNbr
[
i
]
<<
" Energy: "
<<
fFissionChamber_Energy
[
i
];
}
// Time
mysize
=
fFissionChamber_T_DetectorNbr
.
size
();
cout
<<
"FissionChamber_T_Mult: "
<<
mysize
<<
endl
;
for
(
size_t
i
=
0
;
i
<
mysize
;
i
++
){
cout
<<
"DetNbr: "
<<
fFissionChamber_T_DetectorNbr
[
i
]
<<
" Time: "
<<
fFissionChamber_Time
[
i
];
}
}
NPLib/Detectors/FissionChamber/TFissionChamberData.h
0 → 100644
View file @
5abb3b07
#ifndef __FissionChamberDATA__
#define __FissionChamberDATA__
/*****************************************************************************
* Copyright (C) 2009-2020 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr *
* *
* Creation Date : September 2020 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold FissionChamber Raw data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
// STL
#include <vector>
using
namespace
std
;
// ROOT
#include "TObject.h"
class
TFissionChamberData
:
public
TObject
{
//////////////////////////////////////////////////////////////
// data members are hold into vectors in order
// to allow multiplicity treatment
private:
// Energy
vector
<
UShort_t
>
fFissionChamber_E_DetectorNbr
;
vector
<
Double_t
>
fFissionChamber_Energy
;
// Time
vector
<
UShort_t
>
fFissionChamber_T_DetectorNbr
;
vector
<
Double_t
>
fFissionChamber_Time
;
//////////////////////////////////////////////////////////////
// Constructor and destructor
public:
TFissionChamberData
();
~
TFissionChamberData
();
//////////////////////////////////////////////////////////////
// Inherited from TObject and overriden to avoid warnings
public:
void
Clear
();
void
Clear
(
const
Option_t
*
)
{};
void
Dump
()
const
;
//////////////////////////////////////////////////////////////
// Getters and Setters
// Prefer inline declaration to avoid unnecessary called of
// frequently used methods
// add //! to avoid ROOT creating dictionnary for the methods
public:
////////////////////// SETTERS ////////////////////////
// Energy
inline
void
SetEnergy
(
const
UShort_t
&
DetNbr
,
const
Double_t
&
Energy
){
fFissionChamber_E_DetectorNbr
.
push_back
(
DetNbr
);
fFissionChamber_Energy
.
push_back
(
Energy
);
};
//!
// Time
inline
void
SetTime
(
const
UShort_t
&
DetNbr
,
const
Double_t
&
Time
)
{
fFissionChamber_T_DetectorNbr
.
push_back
(
DetNbr
);
fFissionChamber_Time
.
push_back
(
Time
);
};
//!
////////////////////// GETTERS ////////////////////////
// Energy
inline
UShort_t
GetMultEnergy
()
const
{
return
fFissionChamber_E_DetectorNbr
.
size
();}
inline
UShort_t
GetE_DetectorNbr
(
const
unsigned
int
&
i
)
const
{
return
fFissionChamber_E_DetectorNbr
[
i
];}
//!
inline
Double_t
Get_Energy
(
const
unsigned
int
&
i
)
const
{
return
fFissionChamber_Energy
[
i
];}
//!
// Time
inline
UShort_t
GetMultTime
()
const
{
return
fFissionChamber_T_DetectorNbr
.
size
();}
inline
UShort_t
GetT_DetectorNbr
(
const
unsigned
int
&
i
)
const
{
return
fFissionChamber_T_DetectorNbr
[
i
];}
//!
inline
Double_t
Get_Time
(
const
unsigned
int
&
i
)
const
{
return
fFissionChamber_Time
[
i
];}
//!
//////////////////////////////////////////////////////////////
// Required for ROOT dictionnary
ClassDef
(
TFissionChamberData
,
1
)
// FissionChamberData structure
};
#endif
NPLib/Detectors/FissionChamber/TFissionChamberPhysics.cxx
0 → 100644
View file @
5abb3b07
/*****************************************************************************
* Copyright (C) 2009-2020 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Pierre Morfouace contact address: pierre.morfouace2@cea.fr *
* *
* Creation Date : September 2020 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class hold FissionChamber Treated data *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "TFissionChamberPhysics.h"
// STL
#include <sstream>
#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <limits>
using
namespace
std
;
// NPL
#include "RootInput.h"
#include "RootOutput.h"
#include "NPDetectorFactory.h"
#include "NPOptionManager.h"
// ROOT
#include "TChain.h"
ClassImp
(
TFissionChamberPhysics
)
///////////////////////////////////////////////////////////////////////////
TFissionChamberPhysics
::
TFissionChamberPhysics
()
:
m_EventData
(
new
TFissionChamberData
),
m_PreTreatedData
(
new
TFissionChamberData
),
m_EventPhysics
(
this
),
m_Spectra
(
0
),
m_E_RAW_Threshold
(
0
),
// adc channels
m_E_Threshold
(
0
),
// MeV
m_NumberOfDetectors
(
0
)
{
}
///////////////////////////////////////////////////////////////////////////
/// A usefull method to bundle all operation to add a detector
void
TFissionChamberPhysics
::
AddDetector
(
TVector3
,
string
){
// In That simple case nothing is done
// Typically for more complex detector one would calculate the relevant
// positions (stripped silicon) or angles (gamma array)
m_NumberOfDetectors
++
;
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
AddDetector
(
double
R
,
double
Theta
,
double
Phi
,
string
shape
){
// Compute the TVector3 corresponding
TVector3
Pos
(
R
*
sin
(
Theta
)
*
cos
(
Phi
),
R
*
sin
(
Theta
)
*
sin
(
Phi
),
R
*
cos
(
Theta
));
// Call the cartesian method
AddDetector
(
Pos
,
shape
);
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
BuildSimplePhysicalEvent
()
{
BuildPhysicalEvent
();
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
BuildPhysicalEvent
()
{
// apply thresholds and calibration
PreTreat
();
// match energy and time together
unsigned
int
mysizeE
=
m_PreTreatedData
->
GetMultEnergy
();
unsigned
int
mysizeT
=
m_PreTreatedData
->
GetMultTime
();
for
(
UShort_t
e
=
0
;
e
<
mysizeE
;
e
++
)
{
for
(
UShort_t
t
=
0
;
t
<
mysizeT
;
t
++
)
{
if
(
m_PreTreatedData
->
GetE_DetectorNbr
(
e
)
==
m_PreTreatedData
->
GetT_DetectorNbr
(
t
))
{
DetectorNumber
.
push_back
(
m_PreTreatedData
->
GetE_DetectorNbr
(
e
));
Energy
.
push_back
(
m_PreTreatedData
->
Get_Energy
(
e
));
Time
.
push_back
(
m_PreTreatedData
->
Get_Time
(
t
));
}
}
}
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
PreTreat
()
{
// This method typically applies thresholds and calibrations
// Might test for disabled channels for more complex detector
// clear pre-treated object
ClearPreTreatedData
();
// instantiate CalibrationManager
static
CalibrationManager
*
Cal
=
CalibrationManager
::
getInstance
();
// Energy
unsigned
int
mysize
=
m_EventData
->
GetMultEnergy
();
for
(
UShort_t
i
=
0
;
i
<
mysize
;
++
i
)
{
if
(
m_EventData
->
Get_Energy
(
i
)
>
m_E_RAW_Threshold
)
{
Double_t
Energy
=
Cal
->
ApplyCalibration
(
"FissionChamber/ENERGY"
+
NPL
::
itoa
(
m_EventData
->
GetE_DetectorNbr
(
i
)),
m_EventData
->
Get_Energy
(
i
));
if
(
Energy
>
m_E_Threshold
)
{
m_PreTreatedData
->
SetEnergy
(
m_EventData
->
GetE_DetectorNbr
(
i
),
Energy
);
}
}
}
// Time
mysize
=
m_EventData
->
GetMultTime
();
for
(
UShort_t
i
=
0
;
i
<
mysize
;
++
i
)
{
Double_t
Time
=
Cal
->
ApplyCalibration
(
"FissionChamber/TIME"
+
NPL
::
itoa
(
m_EventData
->
GetT_DetectorNbr
(
i
)),
m_EventData
->
Get_Time
(
i
));
m_PreTreatedData
->
SetTime
(
m_EventData
->
GetT_DetectorNbr
(
i
),
Time
);
}
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
ReadAnalysisConfig
()
{
bool
ReadingStatus
=
false
;
// path to file
string
FileName
=
"./configs/ConfigFissionChamber.dat"
;
// open analysis config file
ifstream
AnalysisConfigFile
;
AnalysisConfigFile
.
open
(
FileName
.
c_str
());
if
(
!
AnalysisConfigFile
.
is_open
())
{
cout
<<
" No ConfigFissionChamber.dat found: Default parameter loaded for Analayis "
<<
FileName
<<
endl
;
return
;
}
cout
<<
" Loading user parameter for Analysis from ConfigFissionChamber.dat "
<<
endl
;
// Save it in a TAsciiFile
TAsciiFile
*
asciiConfig
=
RootOutput
::
getInstance
()
->
GetAsciiFileAnalysisConfig
();
asciiConfig
->
AppendLine
(
"%%% ConfigFissionChamber.dat %%%"
);
asciiConfig
->
Append
(
FileName
.
c_str
());
asciiConfig
->
AppendLine
(
""
);
// read analysis config file
string
LineBuffer
,
DataBuffer
,
whatToDo
;
while
(
!
AnalysisConfigFile
.
eof
())
{
// Pick-up next line
getline
(
AnalysisConfigFile
,
LineBuffer
);
// search for "header"
string
name
=
"ConfigFissionChamber"
;
if
(
LineBuffer
.
compare
(
0
,
name
.
length
(),
name
)
==
0
)
ReadingStatus
=
true
;
// loop on tokens and data
while
(
ReadingStatus
)
{
whatToDo
=
""
;
AnalysisConfigFile
>>
whatToDo
;
// Search for comment symbol (%)
if
(
whatToDo
.
compare
(
0
,
1
,
"%"
)
==
0
)
{
AnalysisConfigFile
.
ignore
(
numeric_limits
<
streamsize
>::
max
(),
'\n'
);
}
else
if
(
whatToDo
==
"E_RAW_THRESHOLD"
)
{
AnalysisConfigFile
>>
DataBuffer
;
m_E_RAW_Threshold
=
atof
(
DataBuffer
.
c_str
());
cout
<<
whatToDo
<<
" "
<<
m_E_RAW_Threshold
<<
endl
;
}
else
if
(
whatToDo
==
"E_THRESHOLD"
)
{
AnalysisConfigFile
>>
DataBuffer
;
m_E_Threshold
=
atof
(
DataBuffer
.
c_str
());
cout
<<
whatToDo
<<
" "
<<
m_E_Threshold
<<
endl
;
}
else
{
ReadingStatus
=
false
;
}
}
}
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
Clear
()
{
DetectorNumber
.
clear
();
Energy
.
clear
();
Time
.
clear
();
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
ReadConfiguration
(
NPL
::
InputParser
parser
)
{
vector
<
NPL
::
InputBlock
*>
blocks
=
parser
.
GetAllBlocksWithToken
(
"FissionChamber"
);
if
(
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
())
cout
<<
"//// "
<<
blocks
.
size
()
<<
" detectors found "
<<
endl
;
vector
<
string
>
cart
=
{
"POS"
,
"Shape"
};
vector
<
string
>
sphe
=
{
"R"
,
"Theta"
,
"Phi"
,
"Shape"
};
for
(
unsigned
int
i
=
0
;
i
<
blocks
.
size
()
;
i
++
){
if
(
blocks
[
i
]
->
HasTokenList
(
cart
)){
if
(
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
())
cout
<<
endl
<<
"//// FissionChamber "
<<
i
+
1
<<
endl
;
TVector3
Pos
=
blocks
[
i
]
->
GetTVector3
(
"POS"
,
"mm"
);
string
Shape
=
blocks
[
i
]
->
GetString
(
"Shape"
);
AddDetector
(
Pos
,
Shape
);
}
else
if
(
blocks
[
i
]
->
HasTokenList
(
sphe
)){
if
(
NPOptionManager
::
getInstance
()
->
GetVerboseLevel
())
cout
<<
endl
<<
"//// FissionChamber "
<<
i
+
1
<<
endl
;
double
R
=
blocks
[
i
]
->
GetDouble
(
"R"
,
"mm"
);
double
Theta
=
blocks
[
i
]
->
GetDouble
(
"Theta"
,
"deg"
);
double
Phi
=
blocks
[
i
]
->
GetDouble
(
"Phi"
,
"deg"
);
string
Shape
=
blocks
[
i
]
->
GetString
(
"Shape"
);
AddDetector
(
R
,
Theta
,
Phi
,
Shape
);
}
else
{
cout
<<
"ERROR: check your input file formatting "
<<
endl
;
exit
(
1
);
}
}
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
InitSpectra
()
{
m_Spectra
=
new
TFissionChamberSpectra
(
m_NumberOfDetectors
);
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
FillSpectra
()
{
m_Spectra
->
FillRawSpectra
(
m_EventData
);
m_Spectra
->
FillPreTreatedSpectra
(
m_PreTreatedData
);
m_Spectra
->
FillPhysicsSpectra
(
m_EventPhysics
);
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
CheckSpectra
()
{
m_Spectra
->
CheckSpectra
();
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
ClearSpectra
()
{
// To be done
}
///////////////////////////////////////////////////////////////////////////
map
<
string
,
TH1
*>
TFissionChamberPhysics
::
GetSpectra
()
{
if
(
m_Spectra
)
return
m_Spectra
->
GetMapHisto
();
else
{
map
<
string
,
TH1
*>
empty
;
return
empty
;
}
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
WriteSpectra
()
{
m_Spectra
->
WriteSpectra
();
}
///////////////////////////////////////////////////////////////////////////
void
TFissionChamberPhysics
::
AddParameterToCalibrationManager
()
{