Commit e066a96a authored by Adrien Matta's avatar Adrien Matta
Browse files

* Progress on Nebula analysis

parent 730b814f
Pipeline #120369 passed with stages
in 7 minutes and 1 second
......@@ -107,6 +107,15 @@ bool CalibrationManager::AddParameter(std::string DetectorName , std::string Par
fCalibrationCoeff[ParameterPath] = def;
return true;
}
//////////////////////////////////////////////////////////////////
bool CalibrationManager::AddParameter(std::string Token, std::vector<double> def ){
fToken[Token] = Token;
// Case where a default value is given
if(def.size()!=0)
fCalibrationCoeff[Token] = def;
return true;
}
/////////////////////////////////////////////////////////////////
void CalibrationManager::ClearCalibration(){
......
......@@ -53,6 +53,7 @@ class CalibrationManager{
// call like : myCalibrationManager->AddParameter( "MUST2" ,"Telescope5_Si_X38_E", "T5_Si_X38_E" )
// return false if the token is not found in the file list
bool AddParameter(std::string DetectorName , std::string ParameterName , std::string Token,std::vector<double> def=std::vector<double>()) ;
bool AddParameter(std::string Token,std::vector<double> def=std::vector<double>()) ;
// call like : myCalibrationManager->ApplyCalibration( "MUST2/Telescope5_Si_X38_E" , RawEnergy )
// return the Calibrated value
......
......@@ -50,26 +50,15 @@ TNebulaPhysics::TNebulaPhysics()
m_Spectra(0),
m_E_RAW_Threshold(0), // adc channels
m_E_Threshold(0), // MeV
m_NumberOfDetectors(0) {
m_NumberOfBars(0) {
}
///////////////////////////////////////////////////////////////////////////
/// A usefull method to bundle all operation to add a detector
void TNebulaPhysics::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 TNebulaPhysics::ReadXML(NPL::XmlParser xml){
m_NumberOfBars++;
}
///////////////////////////////////////////////////////////////////////////
void TNebulaPhysics::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 TNebulaPhysics::BuildSimplePhysicalEvent() {
BuildPhysicalEvent();
......@@ -204,41 +193,33 @@ void TNebulaPhysics::Clear() {
///////////////////////////////////////////////////////////////////////////
void TNebulaPhysics::ReadConfiguration(NPL::InputParser parser) {
vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("Nebula");
vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("NEBULA");
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << "//// " << blocks.size() << " detectors found " << endl;
cout << "//// " << blocks.size() << " detector(s) found " << endl;
vector<string> cart = {"POS","Shape"};
vector<string> sphe = {"R","Theta","Phi","Shape"};
vector<string> token= {"XML","Offset","InvertX","InvertY"};
for(unsigned int i = 0 ; i < blocks.size() ; i++){
if(blocks[i]->HasTokenList(cart)){
if(NPOptionManager::getInstance()->GetVerboseLevel())
cout << endl << "//// Nebula " << 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 << "//// Nebula " << 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);
if(blocks[i]->HasTokenList(token)){
cout << endl << "//// Nebula (" << i+1 << ")" << endl;
unsigned int det = std::atoi(blocks[i]->GetMainValue().c_str());
string xmlpath = blocks[i]->GetString("XML");
NPL::XmlParser xml;
xml.LoadFile(xmlpath);
ReadXML(xml);
TVector3 offset = blocks[i]->GetTVector3("Offset","mm");
bool invertX = blocks[i]->GetInt("InvertX");
bool invertY = blocks[i]->GetInt("InvertY");
m_offset[det] = offset;
m_invertX[det] = invertX;
m_invertY[det] = invertY;
}
}
}
///////////////////////////////////////////////////////////////////////////
void TNebulaPhysics::InitSpectra() {
m_Spectra = new TNebulaSpectra(m_NumberOfDetectors);
m_Spectra = new TNebulaSpectra(m_NumberOfBars);
}
......@@ -286,9 +267,9 @@ void TNebulaPhysics::WriteSpectra() {
///////////////////////////////////////////////////////////////////////////
void TNebulaPhysics::AddParameterToCalibrationManager() {
CalibrationManager* Cal = CalibrationManager::getInstance();
for (int i = 0; i < m_NumberOfDetectors; ++i) {
Cal->AddParameter("Nebula", "D"+ NPL::itoa(i+1)+"_ENERGY","Nebula_D"+ NPL::itoa(i+1)+"_ENERGY");
Cal->AddParameter("Nebula", "D"+ NPL::itoa(i+1)+"_TIME","Nebula_D"+ NPL::itoa(i+1)+"_TIME");
for (int i = 0; i < m_NumberOfBars; ++i) {
Cal->AddParameter("NEBULA_ID"+ NPL::itoa(i+1)+"_T");
Cal->AddParameter("NEBULA_ID"+ NPL::itoa(i+1)+"_Y");
}
}
......
......@@ -38,6 +38,7 @@ using namespace std;
#include "NPCalibrationManager.h"
#include "NPVDetector.h"
#include "NPInputParser.h"
#include "NPXmlParser.h"
// forward declaration
class TNebulaSpectra;
......@@ -67,8 +68,7 @@ class TNebulaPhysics : public TObject, public NPL::VDetector {
vector<double> Time;
/// A usefull method to bundle all operation to add a detector
void AddDetector(TVector3 POS, string shape);
void AddDetector(double R, double Theta, double Phi, string shape);
void ReadXML(NPL::XmlParser);
//////////////////////////////////////////////////////////////
// methods inherited from the VDetector ABC class
......@@ -161,7 +161,13 @@ class TNebulaPhysics : public TObject, public NPL::VDetector {
// number of detectors
private:
int m_NumberOfDetectors; //!
int m_NumberOfBars; //!
private: // offset and inversion
std::map<unsigned int, TVector3> m_offset;//!
std::map<unsigned int, bool> m_invertX;//!
std::map<unsigned int, bool> m_invertY;//!
// spectra class
private:
......
ID Delta V
1 19.2852
2 19.2846
3 19.4056
4 19.1069
5 19.4713
6 19.2863
7 19.2007
8 19.3881
9 19.1476
10 19.0105
11 19.1384
12 19.1565
13 18.9115
14 19.0286
15 19.4379
16 18.9817
17 18.8992
18 18.6782
19 19.0459
20 18.8453
21 18.7874
22 18.9267
23 18.6575
24 18.8422
25 19.072
26 19.5044
27 19.4049
28 19.0738
29 19.3946
30 19.4726
31 19.121
32 19.1251
33 19.2008
34 18.9232
35 18.8517
36 18.9349
37 19.2574
38 18.7397
39 19.0286
40 18.5307
41 19.006
42 18.634
43 19.2158
44 18.8532
45 18.8342
46 18.9721
47 18.968
48 19.1271
49 18.816
50 18.952
51 18.9897
52 19.0074
53 19.2299
54 19.0185
55 19.2308
56 19.0939
57 19.3677
58 19.5316
59 19.8612
60 19.6356
61 18.6837
62 18.6049
63 20.3056
64 19.1702
65 19.3322
66 19.6835
67 19.0867
68 18.6978
69 17.9037
70 18.9826
71 18.6267
72 18.2024
73 19.0313
74 18.8189
75 18.6591
76 19.3614
77 19.2587
78 18.1176
79 18.7292
80 19.3139
81 18.8809
82 17.6727
83 19.1507
84 18.8959
85 18.0162
86 19.2333
87 18.5977
88 17.6151
89 19.0762
90 18.4975
91 19.0267
92 19.0031
93 19.0938
94 18.7937
95 19.1556
96 19.1339
97 19.3789
98 18.9279
99 19.3174
100 19.3137
101 19.0579
102 18.775
103 19.3587
104 18.874
105 19.4789
106 19.4282
107 19.1013
108 18.9991
109 19.0751
110 18.0316
111 18.9544
112 19.4328
113 18.7139
114 19.893
115 18.3269
116 18.545
117 20.0339
118 18.9662
119 20.0821
120 19.4934
NEBULA_ID1_T 19.2852
NEBULA_ID2_T 19.2846
NEBULA_ID3_T 19.4056
NEBULA_ID4_T 19.1069
NEBULA_ID5_T 19.4713
NEBULA_ID6_T 19.2863
NEBULA_ID7_T 19.2007
NEBULA_ID8_T 19.3881
NEBULA_ID9_T 19.1476
NEBULA_ID10_T 19.0105
NEBULA_ID11_T 19.1384
NEBULA_ID12_T 19.1565
NEBULA_ID13_T 18.9115
NEBULA_ID14_T 19.0286
NEBULA_ID15_T 19.4379
NEBULA_ID16_T 18.9817
NEBULA_ID17_T 18.8992
NEBULA_ID18_T 18.6782
NEBULA_ID19_T 19.0459
NEBULA_ID20_T 18.8453
NEBULA_ID21_T 18.7874
NEBULA_ID22_T 18.9267
NEBULA_ID23_T 18.6575
NEBULA_ID24_T 18.8422
NEBULA_ID25_T 19.072
NEBULA_ID26_T 19.5044
NEBULA_ID27_T 19.4049
NEBULA_ID28_T 19.0738
NEBULA_ID29_T 19.3946
NEBULA_ID30_T 19.4726
NEBULA_ID31_T 19.121
NEBULA_ID32_T 19.1251
NEBULA_ID33_T 19.2008
NEBULA_ID34_T 18.9232
NEBULA_ID35_T 18.8517
NEBULA_ID36_T 18.9349
NEBULA_ID37_T 19.2574
NEBULA_ID38_T 18.7397
NEBULA_ID39_T 19.0286
NEBULA_ID40_T 18.5307
NEBULA_ID41_T 19.006
NEBULA_ID42_T 18.634
NEBULA_ID43_T 19.2158
NEBULA_ID44_T 18.8532
NEBULA_ID45_T 18.8342
NEBULA_ID46_T 18.9721
NEBULA_ID47_T 18.968
NEBULA_ID48_T 19.1271
NEBULA_ID49_T 18.816
NEBULA_ID50_T 18.952
NEBULA_ID51_T 18.9897
NEBULA_ID52_T 19.0074
NEBULA_ID53_T 19.2299
NEBULA_ID54_T 19.0185
NEBULA_ID55_T 19.2308
NEBULA_ID56_T 19.0939
NEBULA_ID57_T 19.3677
NEBULA_ID58_T 19.5316
NEBULA_ID59_T 19.8612
NEBULA_ID60_T 19.6356
NEBULA_ID61_T 18.6837
NEBULA_ID62_T 18.6049
NEBULA_ID63_T 20.3056
NEBULA_ID64_T 19.1702
NEBULA_ID65_T 19.3322
NEBULA_ID66_T 19.6835
NEBULA_ID67_T 19.0867
NEBULA_ID68_T 18.6978
NEBULA_ID69_T 17.9037
NEBULA_ID70_T 18.9826
NEBULA_ID71_T 18.6267
NEBULA_ID72_T 18.2024
NEBULA_ID73_T 19.0313
NEBULA_ID74_T 18.8189
NEBULA_ID75_T 18.6591
NEBULA_ID76_T 19.3614
NEBULA_ID77_T 19.2587
NEBULA_ID78_T 18.1176
NEBULA_ID79_T 18.7292
NEBULA_ID80_T 19.3139
NEBULA_ID81_T 18.8809
NEBULA_ID82_T 17.6727
NEBULA_ID83_T 19.1507
NEBULA_ID84_T 18.8959
NEBULA_ID85_T 18.0162
NEBULA_ID86_T 19.2333
NEBULA_ID87_T 18.5977
NEBULA_ID88_T 17.6151
NEBULA_ID89_T 19.0762
NEBULA_ID90_T 18.4975
NEBULA_ID91_T 19.0267
NEBULA_ID92_T 19.0031
NEBULA_ID93_T 19.0938
NEBULA_ID94_T 18.7937
NEBULA_ID95_T 19.1556
NEBULA_ID96_T 19.1339
NEBULA_ID97_T 19.3789
NEBULA_ID98_T 18.9279
NEBULA_ID99_T 19.3174
NEBULA_ID100_T 19.3137
NEBULA_ID101_T 19.0579
NEBULA_ID102_T 18.775
NEBULA_ID103_T 19.3587
NEBULA_ID104_T 18.874
NEBULA_ID105_T 19.4789
NEBULA_ID106_T 19.4282
NEBULA_ID107_T 19.1013
NEBULA_ID108_T 18.9991
NEBULA_ID109_T 19.0751
NEBULA_ID110_T 18.0316
NEBULA_ID111_T 18.9544
NEBULA_ID112_T 19.4328
NEBULA_ID113_T 18.7139
NEBULA_ID114_T 19.893
NEBULA_ID115_T 18.3269
NEBULA_ID116_T 18.545
NEBULA_ID117_T 20.0339
NEBULA_ID118_T 18.9662
NEBULA_ID119_T 20.0821
NEBULA_ID120_T 19.4934
NEBULA_ID1_Y 1.38638
NEBULA_ID2_Y -3.8305
NEBULA_ID3_Y 3.07288
NEBULA_ID4_Y -4.23115
NEBULA_ID5_Y -2.90823
NEBULA_ID6_Y 2.06144
NEBULA_ID7_Y -6.14942
NEBULA_ID8_Y -4.20327
NEBULA_ID9_Y 13.9879
NEBULA_ID10_Y -3.06973
NEBULA_ID11_Y -1.99039
NEBULA_ID12_Y -4.86424
NEBULA_ID13_Y 5.29633
NEBULA_ID14_Y -0.662125
NEBULA_ID15_Y 3.04338
NEBULA_ID16_Y -4.29256
NEBULA_ID17_Y -2.30441
NEBULA_ID18_Y 0.160267
NEBULA_ID19_Y -9.17392
NEBULA_ID20_Y 7.05093
NEBULA_ID21_Y 2.09011
NEBULA_ID22_Y -6.41303
NEBULA_ID23_Y 0.530808
NEBULA_ID24_Y 4.12012
NEBULA_ID25_Y 0.363813
NEBULA_ID26_Y -4.18461
NEBULA_ID27_Y -4.88908
NEBULA_ID28_Y 1.10303
NEBULA_ID29_Y 6.93376
NEBULA_ID30_Y -0.585477
NEBULA_ID31_Y 3.24728
NEBULA_ID32_Y -0.673857
NEBULA_ID33_Y -0.00853288
NEBULA_ID34_Y 0.436468
NEBULA_ID35_Y 2.1838
NEBULA_ID36_Y 1.45213
NEBULA_ID37_Y 3.2373
NEBULA_ID38_Y -2.325
NEBULA_ID39_Y -3.20755
NEBULA_ID40_Y -1.26772
NEBULA_ID41_Y 0.887659
NEBULA_ID42_Y 2.37744
NEBULA_ID43_Y -1.16329
NEBULA_ID44_Y -3.6847
NEBULA_ID45_Y 3.10103
NEBULA_ID46_Y 2.02808
NEBULA_ID47_Y -0.509373
NEBULA_ID48_Y 6.99985
NEBULA_ID49_Y -1.29247
NEBULA_ID50_Y -0.304723
NEBULA_ID51_Y 3.23443
NEBULA_ID52_Y -5.04529
NEBULA_ID53_Y -1.669
NEBULA_ID54_Y 4.07673
NEBULA_ID55_Y -2.16088
NEBULA_ID56_Y 4.10968
NEBULA_ID57_Y -5.66633
NEBULA_ID58_Y 5.72757
NEBULA_ID59_Y -0.284415
NEBULA_ID60_Y 4.61204
NEBULA_ID61_Y -11.215
NEBULA_ID62_Y 2.20483
NEBULA_ID63_Y 3.65855
NEBULA_ID64_Y -6.00011
NEBULA_ID65_Y -4.83289
NEBULA_ID66_Y 4.86074
NEBULA_ID67_Y -5.8572
NEBULA_ID68_Y 4.79375
NEBULA_ID69_Y -4.77623
NEBULA_ID70_Y -2.30597
NEBULA_ID71_Y -5.44358
NEBULA_ID72_Y 5.76698
NEBULA_ID73_Y -4.52093
NEBULA_ID74_Y 0.669192
NEBULA_ID75_Y 5.2536
NEBULA_ID76_Y -3.06509
NEBULA_ID77_Y -4.24188
NEBULA_ID78_Y 2.02627
NEBULA_ID79_Y -4.03842
NEBULA_ID80_Y 3.1809
NEBULA_ID81_Y -5.90454
NEBULA_ID82_Y 1.81077
NEBULA_ID83_Y -5.46129
NEBULA_ID84_Y -1.16729
NEBULA_ID85_Y 2.94024
NEBULA_ID86_Y -3.34849
NEBULA_ID87_Y -8.60917
NEBULA_ID88_Y -1.84303
NEBULA_ID89_Y 1.29457
NEBULA_ID90_Y -1.06823
NEBULA_ID91_Y 5.69821
NEBULA_ID92_Y -5.7119
NEBULA_ID93_Y 7.594
NEBULA_ID94_Y 4.47444
NEBULA_ID95_Y 3.8241
NEBULA_ID96_Y -10.6418
NEBULA_ID97_Y 14.1286
NEBULA_ID98_Y -5.54334
NEBULA_ID99_Y 5.50645
NEBULA_ID100_Y -5.75486
NEBULA_ID101_Y -3.05549
NEBULA_ID102_Y 7.65411
NEBULA_ID103_Y 0.353753
NEBULA_ID104_Y -5.75768
NEBULA_ID105_Y 4.14771
NEBULA_ID106_Y -0.914708
NEBULA_ID107_Y 3.08513
NEBULA_ID108_Y 0.902261
NEBULA_ID109_Y -0.553475
NEBULA_ID110_Y 5.95105
NEBULA_ID111_Y -2.47195
NEBULA_ID112_Y -5.24212
NEBULA_ID113_Y 13.0663
NEBULA_ID114_Y -2.03506
NEBULA_ID115_Y 5.80118
NEBULA_ID116_Y -2.23628
NEBULA_ID117_Y 6.53639
NEBULA_ID118_Y 2.23348
NEBULA_ID119_Y -6.16759
NEBULA_ID120_Y 0.972052
ID DeltaY
1 1.38638
2 -3.8305
3 3.07288
4 -4.23115
5 -2.90823
6 2.06144
7 -6.14942
8 -4.20327
9 13.9879
10 -3.06973
11 -1.99039
12 -4.86424
13 5.29633
14 -0.662125
15 3.04338
16 -4.29256
17 -2.30441
18 0.160267
19 -9.17392
20 7.05093
21 2.09011
22 -6.41303
23 0.530808
24 4.12012
25 0.363813
26 -4.18461
27 -4.88908
28 1.10303
29 6.93376
30 -0.585477
31 3.24728
32 -0.673857
33 -0.00853288
34 0.436468
35 2.1838
36 1.45213
37 3.2373
38 -2.325
39 -3.20755
40 -1.26772
41 0.887659
42 2.37744
43 -1.16329
44 -3.6847
45 3.10103
46 2.02808
47 -0.509373
48 6.99985
49 -1.29247
50 -0.304723
51 3.23443
52 -5.04529
53 -1.669
54 4.07673
55 -2.16088
56 4.10968
57 -5.66633
58 5.72757
59 -0.284415
60 4.61204
61 -11.215
62 2.20483
63 3.65855
64 -6.00011
65 -4.83289
66 4.86074
67 -5.8572
68 4.79375
69 -4.77623
70 -2.30597
71 -5.44358
72 5.76698
73 -4.52093
74 0.669192
75 5.2536
76 -3.06509
77 -4.24188
78 2.02627
79 -4.03842
80 3.1809
81 -5.90454
82 1.81077
83 -5.46129
84 -1.16729
85 2.94024
86 -3.34849
87 -8.60917
88 -1.84303
89 1.29457
90 -1.06823
91 5.69821
92 -5.7119
93 7.594
94 4.47444
95 3.8241
96 -10.6418
97 14.1286