Skip to content
Snippets Groups Projects
Commit af74a31d authored by nicolas's avatar nicolas
Browse files

* Add last version of Chateau de Cristal

   This is the version used during the 
   e611 experiment
parent a0bf7ba8
No related branches found
No related tags found
No related merge requests found
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeneralTarget
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Thickness in micrometer
% Radius in mm
% Temperature in K, Pressure in bar
Target
THICKNESS= 2.92
RADIUS= 24
MATERIAL= CD2
ANGLE= 0
X= 0
Y= 0
Z= 0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CATSArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% Cats 1 %%%%%%%%%%%
CATSDetector
X1_Y1= -34.36 -34.96 -1787
X28_Y1= 36.76 -34.96 -1787
X1_Y28= -34.36 36.16 -1787
X28_Y28= 36.76 36.16 -1787
%%%%%%%%%%%%% Cats 2 %%%%%%%%%%%
CATSDetector
X1_Y1= 34.26 -35.46 -1155
X28_Y1= -36.86 -35.46 -1155
X1_Y28= 34.26 35.66 -1155
X28_Y28= -36.86 35.66 -1155
%%%%%%%%%%%%%%%%%%%
ChateauCristal
%%%%%%%%%%%%%%%%%%%
ANGLES_FILE= BaF_geometry.geo.nicolas
%%%%%%%%%%%%%%%%%%%%
CDArray
%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Detector 1 %%%%%%%%
%%%%%%%%% Detector 2 %%%%%%%%
%%%%%%%%% Detector 3 %%%%%%%%
%%%%%%%%% Detector 4 %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LiseArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IonisationChamber
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Chio
A= -30. -30. 600.
B= 30. -30. 600.
C= -30. 30. 600.
D= 30. 30. 600.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ScintillatorPlastic
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% all parameters need to be there for routine to exit
Plastic
THETA= 0
PHI= 0
R= 0
X= 0
Y= 0
Z= 800
Thickness= 20
Shape= Square
Height= 30
Width= 30
Radius= 0
Scintillator= BC400
LeadThickness= 0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...@@ -37,10 +37,14 @@ using namespace ChateauCristal_LOCAL; ...@@ -37,10 +37,14 @@ using namespace ChateauCristal_LOCAL;
// ROOT // ROOT
#include "TChain.h" #include "TChain.h"
#include "TRandom.h"
// transform an integer to a string // transform an integer to a string
string itoa(int value) string itoa(int value)
{ {
/* char buffer [33];
sprintf(buffer,"%d",value);
return buffer;
*/
std::ostringstream o; std::ostringstream o;
if (!(o << value)) if (!(o << value))
return "" ; return "" ;
...@@ -51,24 +55,35 @@ ClassImp(TChateauCristalPhysics) ...@@ -51,24 +55,35 @@ ClassImp(TChateauCristalPhysics)
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
TChateauCristalPhysics::TChateauCristalPhysics() TChateauCristalPhysics::TChateauCristalPhysics()
: m_NumberOfDetectors(0),
m_EventData(new TChateauCristalData),
m_PreTreatedData(new TChateauCristalData),
m_EventPhysics(this),
m_E_Threshold(0),
m_Pedestal_Threshold(0),
m_beta(0)
{ {
NumberOfDetectors = 0; // cout << "***************** constructeur CCPhys" << endl;
EventData = new TChateauCristalData; // cout << "pointeur m_EventData " << m_EventData << endl;
PreTreatedData = new TChateauCristalData; ReadAddbackConfFile((char *)"/home/e611/ganacq_manip/e611/GRU_e611/calibrations/BaFnear.txt");
EventPhysics = this;
E_Threshold = 0.;
Pedestal_Threshold = 0;
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
TChateauCristalPhysics::~TChateauCristalPhysics() TChateauCristalPhysics::~TChateauCristalPhysics()
{} {}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void TChateauCristalPhysics::Clear() void TChateauCristalPhysics::Clear()
{ {
f_Energy_addback.clear();
f_Time_addback.clear();
DetectorNumber .clear() ; DetectorNumber .clear() ;
Energy .clear() ; Energy .clear() ;
EnergyDCgeom .clear() ;
EnergyDCreal .clear() ;
Time .clear() ; Time .clear() ;
} }
...@@ -93,7 +108,7 @@ void TChateauCristalPhysics::ReadConfiguration(string Path) ...@@ -93,7 +108,7 @@ void TChateauCristalPhysics::ReadConfiguration(string Path)
//if (LineBuffer.compare(0, 4, "BAF2") == 0) //individual detector //if (LineBuffer.compare(0, 4, "BAF2") == 0) //individual detector
{ {
cout << "Chateau de Cristal found: " << endl ; cout << "Chateau de Cristal found: " << endl ;
// NumberOfDetectors=64;//simplify matters to read whole array at once sf // m_NumberOfDetectors=64;//simplify matters to read whole array at once sf
ReadingStatus = true ; ReadingStatus = true ;
} }
...@@ -151,9 +166,9 @@ void TChateauCristalPhysics::AddParameterToCalibrationManager() ...@@ -151,9 +166,9 @@ void TChateauCristalPhysics::AddParameterToCalibrationManager()
{ {
CalibrationManager* Cal = CalibrationManager::getInstance(); CalibrationManager* Cal = CalibrationManager::getInstance();
for(int i = 0 ; i < NumberOfDetectors ; ++i){ for(int i = 0 ; i < m_NumberOfDetectors ; ++i){
Cal->AddParameter("ChateauCristal", "Detector"+itoa(i+1)+"_E","ChateauCristal_DETECTOR_"+itoa(i+1)+"_E") ; Cal->AddParameter("ChateauCristal", "Detector"+itoa(i)+"_E","ChateauCristal_DETECTOR_"+itoa(i)+"_E") ;
Cal->AddParameter("ChateauCristal", "Detector"+itoa(i+1)+"_T","ChateauCristal_DETECTOR_"+itoa(i+1)+"_T") ; Cal->AddParameter("ChateauCristal", "Detector"+itoa(i)+"_T","ChateauCristal_DETECTOR_"+itoa(i)+"_T") ;
} }
} }
...@@ -163,7 +178,7 @@ void TChateauCristalPhysics::InitializeRootInputRaw() ...@@ -163,7 +178,7 @@ void TChateauCristalPhysics::InitializeRootInputRaw()
TChain* inputChain = RootInput::getInstance()->GetChain(); TChain* inputChain = RootInput::getInstance()->GetChain();
inputChain->SetBranchStatus ( "ChateauCristal" , true ); inputChain->SetBranchStatus ( "ChateauCristal" , true );
inputChain->SetBranchStatus ( "fChateauCristal_*" , true ); inputChain->SetBranchStatus ( "fChateauCristal_*" , true );
inputChain->SetBranchAddress( "ChateauCristal" , &EventData ); inputChain->SetBranchAddress( "ChateauCristal" , &m_EventData );
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -174,67 +189,87 @@ void TChateauCristalPhysics::InitializeRootInputPhysics() ...@@ -174,67 +189,87 @@ void TChateauCristalPhysics::InitializeRootInputPhysics()
inputChain->SetBranchStatus ( "DetectorNumber", true ); inputChain->SetBranchStatus ( "DetectorNumber", true );
inputChain->SetBranchStatus ( "Energy" , true ); inputChain->SetBranchStatus ( "Energy" , true );
inputChain->SetBranchStatus ( "Time" , true ); inputChain->SetBranchStatus ( "Time" , true );
inputChain->SetBranchAddress( "ChateauCristal" , &EventPhysics ); inputChain->SetBranchAddress( "ChateauCristal" , &m_EventPhysics );
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void TChateauCristalPhysics::InitializeRootOutput() void TChateauCristalPhysics::InitializeRootOutput()
{ {
TTree* outputTree = RootOutput::getInstance()->GetTree() ; TTree* outputTree = RootOutput::getInstance()->GetTree() ;
outputTree->Branch( "ChateauCristal" , "TChateauCristalPhysics" , &EventPhysics ) ; outputTree->Branch( "ChateauCristal" , "TChateauCristalPhysics" , &m_EventPhysics ) ;
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void TChateauCristalPhysics::BuildPhysicalEvent() void TChateauCristalPhysics::BuildPhysicalEvent()
{ {
BuildSimplePhysicalEvent() ; BuildSimplePhysicalEvent() ;
if( f_addback_possible) CalculateAddback();
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void TChateauCristalPhysics::BuildSimplePhysicalEvent() void TChateauCristalPhysics::BuildSimplePhysicalEvent()
{ {
// cout << "TCCPhys : BuildSimplePHysicalEvent" << endl;
PreTreat(); PreTreat();
for(unsigned int i = 0 ; i < PreTreatedData->GetChateauCristalEnergyMult() ; ++i) for(unsigned int i = 0 ; i < m_PreTreatedData->GetChateauCristalEnergyMult() ; ++i)
{ {
DetectorNumber .push_back( PreTreatedData->GetChateauCristalEDetectorNbr(i) ) ; UShort_t det = m_PreTreatedData->GetChateauCristalEDetectorNbr(i);
Energy .push_back( PreTreatedData->GetChateauCristalEnergy(i) ) ; Double_t ener = m_PreTreatedData->GetChateauCristalEnergy(i);
if (ener > 0) {
DetectorNumber.push_back(det);
Energy .push_back(ener);
// DetectorNumber.push_back(m_PreTreatedData->GetChateauCristalEDetectorNbr(i));
// Energy .push_back(m_PreTreatedData->GetChateauCristalEnergy(i));
// Doppler correction
// Double_t EDCgeom = DopplerCorrection(Energy.at(i), m_DetectorAngleGeom(DetectorNumber.at(i)));
Double_t EDCgeom = DopplerCorrection(ener, m_DetectorAngleGeom[det]);
Double_t EDCreal = DopplerCorrection(ener, m_DetectorAngleReal[det]);
// cout << det << "\t" << ener << "\t" << m_beta << "\t" << m_DetectorAngleGeom[det] << "\t" << EDCgeom << "\t" << m_DetectorAngleReal[det] << "\t" << EDCreal << endl;
EnergyDCgeom.push_back(EDCgeom);
EnergyDCreal.push_back(EDCreal);
}
// Look for associated time // Look for associated time
for(unsigned int j = 0 ; j < PreTreatedData->GetChateauCristalTimeMult() ; ++j ) for(unsigned int j = 0 ; j < m_PreTreatedData->GetChateauCristalTimeMult() ; ++j )
{ {
if(PreTreatedData->GetChateauCristalEDetectorNbr(i) == PreTreatedData->GetChateauCristalTDetectorNbr(j)) if(m_PreTreatedData->GetChateauCristalEDetectorNbr(i) == m_PreTreatedData->GetChateauCristalTDetectorNbr(j))
Time.push_back(PreTreatedData->GetChateauCristalTime(j)); Time.push_back(m_PreTreatedData->GetChateauCristalTime(j));
} }
} }
return;
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void TChateauCristalPhysics::PreTreat() void TChateauCristalPhysics::PreTreat()
{ {
// cout << "TCCPhys : PreTreat" << endl;
ClearPreTreatedData(); ClearPreTreatedData();
// E // E
for(int i = 0 ; i < EventData->GetChateauCristalEnergyMult() ; ++i) // cout << "mult = " << m_EventData->GetChateauCristalEnergyMult() << "\t" << m_EventData << endl;
for(int i = 0 ; i < m_EventData->GetChateauCristalEnergyMult() ; ++i)
{ {
if(EventData->GetChateauCristalEnergy(i) > Pedestal_Threshold && ChannelStatus[EventData->GetChateauCristalEDetectorNbr(i)-1])
if(m_EventData->GetChateauCristalEnergy(i) > m_Pedestal_Threshold && ChannelStatus[m_EventData->GetChateauCristalEDetectorNbr(i)-1])
{ {
double E = fChateauCristal_E(EventData , i); double E = fChateauCristal_E(m_EventData , i);
if( E > E_Threshold ) if( E > m_E_Threshold )
{ {
PreTreatedData->SetChateauCristalEDetectorNbr( EventData->GetChateauCristalEDetectorNbr(i) ) ; m_PreTreatedData->SetChateauCristalEDetectorNbr( m_EventData->GetChateauCristalEDetectorNbr(i) ) ;
PreTreatedData->SetChateauCristalEnergy( E ) ; m_PreTreatedData->SetChateauCristalEnergy( E ) ;
} }
} }
} }
// T // T
for(int i = 0 ; i < EventData->GetChateauCristalTimeMult() ; ++i) for(int i = 0 ; i < m_EventData->GetChateauCristalTimeMult() ; ++i)
{ {
if(ChannelStatus[EventData->GetChateauCristalTDetectorNbr(i)-1]) if(ChannelStatus[m_EventData->GetChateauCristalTDetectorNbr(i)-1])
{ {
PreTreatedData->SetChateauCristalTDetectorNbr( EventData->GetChateauCristalTDetectorNbr(i) ) ; m_PreTreatedData->SetChateauCristalTDetectorNbr( m_EventData->GetChateauCristalTDetectorNbr(i) ) ;
PreTreatedData->SetChateauCristalTime( fChateauCristal_T(EventData , i) ) ; m_PreTreatedData->SetChateauCristalTime( fChateauCristal_T(m_EventData , i) ) ;
} }
} }
} }
...@@ -246,7 +281,7 @@ void TChateauCristalPhysics::InitializeStandardParameter() ...@@ -246,7 +281,7 @@ void TChateauCristalPhysics::InitializeStandardParameter()
bool TempChannelStatus; bool TempChannelStatus;
ChannelStatus.clear(); ChannelStatus.clear();
TempChannelStatus=true; TempChannelStatus=true;
for(int i = 0 ; i < NumberOfDetectors ; ++i) for(int i = 0 ; i < m_NumberOfDetectors ; ++i)
ChannelStatus[i] = TempChannelStatus; ChannelStatus[i] = TempChannelStatus;
} }
...@@ -256,8 +291,7 @@ void TChateauCristalPhysics::ReadAnalysisConfig() ...@@ -256,8 +291,7 @@ void TChateauCristalPhysics::ReadAnalysisConfig()
bool ReadingStatus = false; bool ReadingStatus = false;
// path to file // path to file
string FileName = string(getenv("E611")) + string("/configs/ConfigChateauCristal.dat"); string FileName = "./configs/ConfigChateauCristal.dat";
//string FileName = "./configs/ConfigChateauCristal.dat";
// open analysis config file // open analysis config file
ifstream AnalysisConfigFile; ifstream AnalysisConfigFile;
...@@ -282,7 +316,7 @@ void TChateauCristalPhysics::ReadAnalysisConfig() ...@@ -282,7 +316,7 @@ void TChateauCristalPhysics::ReadAnalysisConfig()
getline(AnalysisConfigFile, LineBuffer); getline(AnalysisConfigFile, LineBuffer);
// search for "header" // search for "header"
if (LineBuffer.compare(0, 9, "ConfigChateauCristal") == 0) ReadingStatus = true; if (LineBuffer.compare(0, 20, "ConfigChateauCristal") == 0) ReadingStatus = true;
// loop on tokens and data // loop on tokens and data
while (ReadingStatus) { while (ReadingStatus) {
...@@ -297,14 +331,26 @@ void TChateauCristalPhysics::ReadAnalysisConfig() ...@@ -297,14 +331,26 @@ void TChateauCristalPhysics::ReadAnalysisConfig()
else if (whatToDo=="PEDESTAL_THRESHOLD") { else if (whatToDo=="PEDESTAL_THRESHOLD") {
AnalysisConfigFile >> DataBuffer; AnalysisConfigFile >> DataBuffer;
Pedestal_Threshold = atoi(DataBuffer.c_str() ); m_Pedestal_Threshold = atof(DataBuffer.c_str() );
cout << "PEDESTAL THRESHOLD " << Pedestal_Threshold << endl; cout << "PEDESTAL THRESHOLD " << m_Pedestal_Threshold << endl;
}
else if (whatToDo=="ENERGY_THRESHOLD") {
AnalysisConfigFile >> DataBuffer;
m_E_Threshold = atof(DataBuffer.c_str() );
cout << "ENERGY THRESHOLD " << m_E_Threshold << endl;
}
else if (whatToDo=="BETA") {
AnalysisConfigFile >> DataBuffer;
m_beta = atof(DataBuffer.c_str() );
cout << "BETA " << m_beta << endl;
} }
else if (whatToDo=="DISABLE") { else if (whatToDo=="DISABLE") {
AnalysisConfigFile >> DataBuffer; AnalysisConfigFile >> DataBuffer;
cout << whatToDo << " " << DataBuffer << endl; int Detector = atoi(DataBuffer.substr(5).c_str());
int Detector = atoi(DataBuffer.substr(2,1).c_str()); cout << whatToDo << "\t" << DataBuffer << "\t" << Detector << endl;
bool ChannelStatusBuffer; bool ChannelStatusBuffer;
ChannelStatusBuffer=false; ChannelStatusBuffer=false;
ChannelStatus[Detector-1] = ChannelStatusBuffer; ChannelStatus[Detector-1] = ChannelStatusBuffer;
...@@ -322,32 +368,112 @@ void TChateauCristalPhysics::ReadAnalysisConfig() ...@@ -322,32 +368,112 @@ void TChateauCristalPhysics::ReadAnalysisConfig()
void TChateauCristalPhysics::AddModule(string AngleFile) void TChateauCristalPhysics::AddModule(string AngleFile)
{ {
ifstream file; ifstream file;
// TString filename = Form("posBaptiste/angles_exogam_clover%d.txt",NumberOfClover);
// TString filename = Form("posz42_simu50mm/angles_exogam_clover%d.txt",NumberOfClover);
// TString filename = Form("posz42_exp_stat_demiring/angles_exogam_clover%d.txt",NumberOfClover);
string path = "posz42_exp_stat_demiring/"; string path = "/home/e611/ganacq_manip/e611/GRU_e611/calibrations/";
TString filename = path + AngleFile; TString filename = path + AngleFile;
cout << filename << endl;
file.open(filename); file.open(filename);
if (!file) cout << filename << " was not opened" << endl; if (!file) cout << filename << " was not opened" << endl;
map<int, double> mapDetectorAngleCorrec, mapDetectorAngleGeo; Double_t angle_correc, angle_geo;
double angle_correc, angle_geo;
string buffer; string buffer;
int det; UShort_t det, dummy;
while (!file.eof()) { while (file >> buffer >> det >> angle_correc >> angle_geo >> dummy) {
file >> buffer >> det >> angle_correc >> angle_geo; cout << buffer << "\t" << det << "\t" << angle_correc << "\t" << angle_geo << "\t" << dummy << endl;
mapDetectorAngleCorrec[det] = angle_correc; m_DetectorAngleReal[det] = angle_correc;
mapDetectorAngleGeo[det] = angle_geo; m_DetectorAngleGeom[det] = angle_geo;
NumberOfDetectors++; m_NumberOfDetectors++;
} }
file.close(); file.close();
// cout << mapDetectorAngleCorrec[2] << "\t" << mapDetectorAngleGeo[2] << endl;
}
int TChateauCristalPhysics::ReadAddbackConfFile(char *file_name)
{
ifstream in_f(file_name);
if (!in_f){
cout<<"\n No addback configuration found^\n";
f_addback_possible= false;
return -1;
}
cout<<"\n File "<<file_name<<" opened! Reading CdC detector configuration";
string line;
Short_t i=0,j=0,det,det_nr;
vector<UShort_t> det_cor;
det_cor.resize(6);
while(!in_f.eof()){
stringstream line_st;
getline(in_f,line);
line_st<<line;
line_st>>det_nr;
cout<<"\n Det "<< det_nr<<" has around ";
for(i=0;i<6;i++){
line_st>>det;
det_cor[i]=det;
cout<<det_cor[i]<<"\t";
}
f_CdC_nearDet[j++]= det_cor;
}
f_addback_possible=true;
return 0;
}
void TChateauCristalPhysics::CalculateAddback()
{
UShort_t i,j,k,l;
UShort_t index=-1;
Double_t ene,ene2,ene_s=0,t1=-100,t2=-2000;
for(i=0;i<DetectorNumber.size();i++){
ene=Energy[i];
for(j=0;j<Time.size();j++)
if( DetectorNumber[i]==m_EventData->GetChateauCristalTDetectorNbr(j))
t1=m_EventData->GetChateauCristalTime(j);
ene_s=ene;
if( ene< 400.) {
f_Energy_addback.push_back(0.);
f_Time_addback.push_back(0.);
}
else{
for(j=0;j<6;j++){
if(ene==0) break;
// cout<<"\nbefore mat ene="<<ene<<" ene_s= "<<ene_s<<"index= "<<index<<"\n";
index=*(f_CdC_nearDet[DetectorNumber[i]].begin()+j);
//cout<<"\nafter mat\n";
ene2=0.;
for(k=0;k<DetectorNumber.size();k++){
if(index==DetectorNumber[k]) {
for(l=0;l<Time.size();l++)
if( DetectorNumber[k]==m_EventData->GetChateauCristalTDetectorNbr(l))
t2=m_EventData->GetChateauCristalTime(l);
if(abs(t1-t2)<2.) ene2=Energy[k];
// cout<<"\nene2="<<ene2;
if(ene2>ene) {
ene_s=0.;
ene=0.;
ene2=0.;
break;
}
if( ene2> 400 ){
ene_s+=ene2;
ene2=0.;
}
// cout<<"\n k= "<<k<<" max size = "<< DetectorNumber.size()<<"\n";
}
}
}
// cout<<"\nbefore addback i= "<<i<<" size max "<<f_Energy_addback.size()<<"ene_s "<<ene_s<<"\n";
f_Energy_addback.push_back(ene_s);
f_Time_addback.push_back(t1);
// cout<<"index "<<i<<" energy "<<Energy[i]<<"addback = "<<f_Energy_addback[i]<<"ene2 "<<ene2<<endl;
//cout<<"\nafter addback\n";
}
}
} }
...@@ -357,26 +483,23 @@ double TChateauCristalPhysics::DopplerCorrection(double E, double Theta) ...@@ -357,26 +483,23 @@ double TChateauCristalPhysics::DopplerCorrection(double E, double Theta)
double Pi = 3.141592654 ; double Pi = 3.141592654 ;
double E_corr = 0; double E_corr = 0;
//double beta = 0.197; // baptiste value double gamma = 1./ sqrt(1 - m_beta*m_beta);
double beta = 0.23; E_corr = gamma * E * (1 - m_beta * cos(Theta*Pi/180.));
double gamma = 1./ sqrt(1-beta*beta);
E_corr = gamma * E * ( 1. - beta * cos(Theta*Pi/180.));
return E_corr; return E_corr;
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
double ChateauCristal_LOCAL::fChateauCristal_E( const TChateauCristalData* EventData , const int i ) double ChateauCristal_LOCAL::fChateauCristal_E( const TChateauCristalData* m_EventData , const int i )
{ {
return CalibrationManager::getInstance()->ApplyCalibration("ChateauCristal/Detector" + itoa( EventData->GetChateauCristalEDetectorNbr(i) ) +"_E", return CalibrationManager::getInstance()->ApplyCalibration("ChateauCristal/Detector" + itoa( m_EventData->GetChateauCristalEDetectorNbr(i) ) +"_E",
EventData->GetChateauCristalEnergy(i) ); m_EventData->GetChateauCristalEnergy(i)+gRandom->Uniform()-0.5 );
} }
double ChateauCristal_LOCAL::fChateauCristal_T( const TChateauCristalData* EventData , const int i ) double ChateauCristal_LOCAL::fChateauCristal_T( const TChateauCristalData* m_EventData , const int i )
{ {
return CalibrationManager::getInstance()->ApplyCalibration("ChateauCristal/Detector" + itoa( EventData->GetChateauCristalTDetectorNbr(i) ) +"_T", return CalibrationManager::getInstance()->ApplyCalibration("ChateauCristal/Detector" + itoa( m_EventData->GetChateauCristalTDetectorNbr(i) ) +"_T",
EventData->GetChateauCristalTime(i) ); m_EventData->GetChateauCristalTime(i) +gRandom->Uniform()-0.5);
} }
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
// STL // STL
#include <vector> #include <vector>
#include <map>
#include <string>
using namespace std ; using namespace std ;
// ROOT // ROOT
#include "TObject.h" #include "TObject.h"
...@@ -41,11 +43,10 @@ class TChateauCristalPhysics : public TObject, public NPA::VDetector ...@@ -41,11 +43,10 @@ class TChateauCristalPhysics : public TObject, public NPA::VDetector
public: // Calibrated Data public: // Calibrated Data
vector<UShort_t> DetectorNumber; vector<UShort_t> DetectorNumber;
vector<Double_t> Energy; vector<Double_t> Energy;
vector<Double_t> EnergyDCgeom;
vector<Double_t> EnergyDCreal;
vector<Double_t> Time; vector<Double_t> Time;
map<Int_t, Double_t> mapDetectorAngleCorrec; //!
map<Int_t, Double_t> mapDetectorAngleGeo; //!
public: // inherited from VDetector public: // inherited from VDetector
// Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token // Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token
void ReadConfiguration(string); void ReadConfiguration(string);
...@@ -77,11 +78,11 @@ class TChateauCristalPhysics : public TObject, public NPA::VDetector ...@@ -77,11 +78,11 @@ class TChateauCristalPhysics : public TObject, public NPA::VDetector
// Those two method all to clear the Event Physics or Data // Those two method all to clear the Event Physics or Data
void ClearEventPhysics() {Clear();} void ClearEventPhysics() {Clear();}
void ClearEventData() {EventData->Clear();} void ClearEventData() {m_EventData->Clear();}
public: // Specific to ChateauCristal public: // Specific to ChateauCristal
// Clear The PreTeated object // Clear The PreTeated object
void ClearPreTreatedData() {PreTreatedData->Clear();} void ClearPreTreatedData() {m_PreTreatedData->Clear();}
// Remove bad channel, calibrate the data and apply threshold // Remove bad channel, calibrate the data and apply threshold
void PreTreat(); void PreTreat();
...@@ -94,33 +95,46 @@ class TChateauCristalPhysics : public TObject, public NPA::VDetector ...@@ -94,33 +95,46 @@ class TChateauCristalPhysics : public TObject, public NPA::VDetector
void ReadAnalysisConfig(); void ReadAnalysisConfig();
// Give an external TChateauCristalData object to TChateauCristalPhysics, needed for online analysis // Give an external TChateauCristalData object to TChateauCristalPhysics, needed for online analysis
void SetRawDataPointer(TChateauCristalData* rawDataPointer) {EventData = rawDataPointer;} void SetRawDataPointer(TChateauCristalData* rawDataPointer) {m_EventData = rawDataPointer;}
// Retrieve pre-treated data // Retrieve pre-treated data
TChateauCristalData* GetPreTreatedData() const {return PreTreatedData;} TChateauCristalData* GetPreTreatedData() const {return m_PreTreatedData;}
protected:
double DopplerCorrection(double Energy, double Theta); double DopplerCorrection(double Energy, double Theta);
protected:
// Add a BaF2 module // Add a BaF2 module
void AddModule(string AngleFile); void AddModule(string AngleFile);
private: // Data not written in the tree private: // Data not written in the tree
int NumberOfDetectors;//! int m_NumberOfDetectors;//!
TChateauCristalData* EventData;//! TChateauCristalData* m_EventData;//!
TChateauCristalData* PreTreatedData;//! TChateauCristalData* m_PreTreatedData;//!
TChateauCristalPhysics* EventPhysics;//! TChateauCristalPhysics* m_EventPhysics;//!
double E_Threshold;//!
double Pedestal_Threshold;//! double m_E_Threshold; //!
double m_Pedestal_Threshold; //!
double m_beta; //!
private: // Map of activated Channel private: // Map of activated Channel
map< int, bool > ChannelStatus;//! map< int, bool > ChannelStatus;//!
public: public:
map<UShort_t, Double_t> m_DetectorAngleReal; //!
map<UShort_t, Double_t> m_DetectorAngleGeom; //!
map < UShort_t,vector<UShort_t> > f_CdC_nearDet;
vector <Double_t> f_Energy_addback;
vector <Double_t> f_Time_addback;
bool f_addback_possible;
int ReadAddbackConfFile(char *file_name);
void CalculateAddback();
void Clear(); void Clear();
void Clear(const Option_t*) {}; void Clear(const Option_t*) {};
ClassDef(TChateauCristalPhysics,1) // ChateauCristalPhysics structure ClassDef(TChateauCristalPhysics,1) // ChateauCristalPhysics structure
}; };
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "TSSSDPhysics.h" #include "TSSSDPhysics.h"
#include "TPlasticPhysics.h" #include "TPlasticPhysics.h"
#include "TTrifoilPhysics.h" #include "TTrifoilPhysics.h"
#include "TChateauCristalPhysics.h"
#include "GaspardTracker.h" #include "GaspardTracker.h"
#include "HydeTracker.h" #include "HydeTracker.h"
#include "Paris.h" #include "Paris.h"
...@@ -58,6 +59,7 @@ void DetectorManager::ReadConfigurationFile(string Path) ...@@ -58,6 +59,7 @@ void DetectorManager::ReadConfigurationFile(string Path)
Bool_t MUST2 = false; Bool_t MUST2 = false;
Bool_t CATS = false; Bool_t CATS = false;
Bool_t SSSD = false; Bool_t SSSD = false;
Bool_t ChateauCristal = false;
Bool_t Exogam = false; Bool_t Exogam = false;
Bool_t ScintillatorPlastic = false; Bool_t ScintillatorPlastic = false;
Bool_t IonisationChamber = false; Bool_t IonisationChamber = false;
...@@ -223,7 +225,29 @@ void DetectorManager::ReadConfigurationFile(string Path) ...@@ -223,7 +225,29 @@ void DetectorManager::ReadConfigurationFile(string Path)
AddDetector("CATS", myDetector); AddDetector("CATS", myDetector);
#endif #endif
} }
////////////////////////////////////////////////////
//////// Search for Chateau de Cristal ////////
////////////////////////////////////////////////////
else if (LineBuffer.compare(0, 9, "ChateauCristal") == 14 && ChateauCristal == false) {
#ifdef INC_CHATEAUCRISTAL
ChateauCristal = true;
cout << "//////// Chateau de Cristal Array ////////" << endl << endl;
// Instantiate the new array as a VDetector Object
VDetector* myDetector = new TChateauCristalPhysics();
// Read Position of Telescope
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
// Add array to the VDetector Vector
AddDetector("ChateauCristal", myDetector);
#endif
}
//////////////////////////////////////////// ////////////////////////////////////////////
////////// Search for W1 (Micron) ///////// ////////// Search for W1 (Micron) /////////
//////////////////////////////////////////// ////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment