Commit 1f205f5f authored by Morfouace's avatar Morfouace
Browse files

Adding PISTA detector to NPTool

parent 4dd00f5b
......@@ -44,12 +44,40 @@ TPISTAData::~TPISTAData() {
//////////////////////////////////////////////////////////////////////
void TPISTAData::Clear() {
// Energy
fPISTA_E_DetectorNbr.clear();
fPISTA_Energy.clear();
// Time
fPISTA_T_DetectorNbr.clear();
fPISTA_Time.clear();
// Energy X
fFirstStage_XE_DetectorNbr.clear();
fFirstStage_XE_StripNbr.clear();
fFirstStage_XE_Energy.clear();
// Energy Y
fFirstStage_YE_DetectorNbr.clear();
fFirstStage_YE_StripNbr.clear();
fFirstStage_YE_Energy.clear();
// Time X
fFirstStage_XT_DetectorNbr.clear();
fFirstStage_XT_StripNbr.clear();
fFirstStage_XT_Time.clear();
// Time Y
fFirstStage_YT_DetectorNbr.clear();
fFirstStage_YT_StripNbr.clear();
fFirstStage_YT_Time.clear();
// Energy X
fSecondStage_XE_DetectorNbr.clear();
fSecondStage_XE_StripNbr.clear();
fSecondStage_XE_Energy.clear();
// Energy Y
fSecondStage_YE_DetectorNbr.clear();
fSecondStage_YE_StripNbr.clear();
fSecondStage_YE_Energy.clear();
// Time X
fSecondStage_XT_DetectorNbr.clear();
fSecondStage_XT_StripNbr.clear();
fSecondStage_XT_Time.clear();
// Time Y
fSecondStage_YT_DetectorNbr.clear();
fSecondStage_YT_StripNbr.clear();
fSecondStage_YT_Time.clear();
}
......@@ -60,20 +88,20 @@ void TPISTAData::Dump() const {
cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event [TPISTAData::Dump()] XXXXXXXXXXXXXXXXX" << endl;
// Energy
size_t mysize = fPISTA_E_DetectorNbr.size();
cout << "PISTA_E_Mult: " << mysize << endl;
size_t mysize = fFirstStage_XE_DetectorNbr.size();
cout << "First Stage PISTA_XE_Mult: " << mysize << endl;
for (size_t i = 0 ; i < mysize ; i++){
cout << "DetNbr: " << fPISTA_E_DetectorNbr[i]
<< " Energy: " << fPISTA_Energy[i];
cout << "X-DetNbr: " << fFirstStage_XE_DetectorNbr[i]
<< " X-Energy: " << fFirstStage_XE_Energy[i];
}
// Time
mysize = fPISTA_T_DetectorNbr.size();
cout << "PISTA_T_Mult: " << mysize << endl;
mysize = fFirstStage_XT_DetectorNbr.size();
cout << "First Stage PISTA_XT_Mult: " << mysize << endl;
for (size_t i = 0 ; i < mysize ; i++){
cout << "DetNbr: " << fPISTA_T_DetectorNbr[i]
<< " Time: " << fPISTA_Time[i];
cout << "X-DetNbr: " << fFirstStage_XT_DetectorNbr[i]
<< " X-Time: " << fFirstStage_XT_Time[i];
}
}
......@@ -34,13 +34,39 @@ class TPISTAData : public TObject {
// data members are hold into vectors in order
// to allow multiplicity treatment
private:
// Energy
vector<UShort_t> fPISTA_E_DetectorNbr;
vector<Double_t> fPISTA_Energy;
// Time
vector<UShort_t> fPISTA_T_DetectorNbr;
vector<Double_t> fPISTA_Time;
// First Stage Front Energy
vector<unsigned short> fFirstStage_XE_DetectorNbr;
vector<unsigned short> fFirstStage_XE_StripNbr;
vector<double> fFirstStage_XE_Energy;
// First Stage Front Time
vector<unsigned short> fFirstStage_XT_DetectorNbr;
vector<unsigned short> fFirstStage_XT_StripNbr;
vector<double> fFirstStage_XT_Time;
// First Stage Back Energy
vector<unsigned short> fFirstStage_YE_DetectorNbr;
vector<unsigned short> fFirstStage_YE_StripNbr;
vector<double> fFirstStage_YE_Energy;
// First Stage Back Time
vector<unsigned short> fFirstStage_YT_DetectorNbr;
vector<unsigned short> fFirstStage_YT_StripNbr;
vector<double> fFirstStage_YT_Time;
// Second Stage Front Energy
vector<unsigned short> fSecondStage_XE_DetectorNbr;
vector<unsigned short> fSecondStage_XE_StripNbr;
vector<double> fSecondStage_XE_Energy;
// Second Stage Front Time
vector<unsigned short> fSecondStage_XT_DetectorNbr;
vector<unsigned short> fSecondStage_XT_StripNbr;
vector<double> fSecondStage_XT_Time;
// Second Stage Back Energy
vector<unsigned short> fSecondStage_YE_DetectorNbr;
vector<unsigned short> fSecondStage_YE_StripNbr;
vector<double> fSecondStage_YE_Energy;
// Second Stage Back Time
vector<unsigned short> fSecondStage_YT_DetectorNbr;
vector<unsigned short> fSecondStage_YT_StripNbr;
vector<double> fSecondStage_YT_Time;
//////////////////////////////////////////////////////////////
......@@ -65,35 +91,132 @@ class TPISTAData : public TObject {
// add //! to avoid ROOT creating dictionnary for the methods
public:
////////////////////// SETTERS ////////////////////////
// Energy
inline void SetEnergy(const UShort_t& DetNbr,const Double_t& Energy){
fPISTA_E_DetectorNbr.push_back(DetNbr);
fPISTA_Energy.push_back(Energy);
// First Stage Energy Front
inline void SetFirstStageXE(const UShort_t& DetNbr, const UShort_t& StripNbr, const Double_t& Energy){
fFirstStage_XE_DetectorNbr.push_back(DetNbr);
fFirstStage_XE_StripNbr.push_back(StripNbr);
fFirstStage_XE_Energy.push_back(Energy);
};//!
// Time
inline void SetTime(const UShort_t& DetNbr,const Double_t& Time) {
fPISTA_T_DetectorNbr.push_back(DetNbr);
fPISTA_Time.push_back(Time);
// First Stage Energy Back
inline void SetFirstStageYE(const UShort_t& DetNbr, const UShort_t& StripNbr, const Double_t& Energy){
fFirstStage_YE_DetectorNbr.push_back(DetNbr);
fFirstStage_YE_StripNbr.push_back(StripNbr);
fFirstStage_YE_Energy.push_back(Energy);
};//!
// First Stage Time Front
inline void SetFirstStageXT(const UShort_t& DetNbr, const UShort_t StripNbr, const Double_t& Time) {
fFirstStage_XT_DetectorNbr.push_back(DetNbr);
fFirstStage_XT_StripNbr.push_back(StripNbr);
fFirstStage_XT_Time.push_back(Time);
};//!
// First Stage Time Back
inline void SetFirstStageYT(const UShort_t& DetNbr, const UShort_t StripNbr, const Double_t& Time) {
fFirstStage_YT_DetectorNbr.push_back(DetNbr);
fFirstStage_YT_StripNbr.push_back(StripNbr);
fFirstStage_YT_Time.push_back(Time);
};//!
//////
// Second Stage Energy Front
inline void SetSecondStageXE(const UShort_t& DetNbr, const UShort_t& StripNbr, const Double_t& Energy){
fSecondStage_XE_DetectorNbr.push_back(DetNbr);
fSecondStage_XE_StripNbr.push_back(StripNbr);
fSecondStage_XE_Energy.push_back(Energy);
};//!
// Second Stage Energy Back
inline void SetSecondStageYE(const UShort_t& DetNbr, const UShort_t& StripNbr, const Double_t& Energy){
fSecondStage_YE_DetectorNbr.push_back(DetNbr);
fSecondStage_YE_StripNbr.push_back(StripNbr);
fSecondStage_YE_Energy.push_back(Energy);
};//!
// Second Stage Time Front
inline void SetSecondStageXT(const UShort_t& DetNbr, const UShort_t StripNbr, const Double_t& Time) {
fSecondStage_XT_DetectorNbr.push_back(DetNbr);
fSecondStage_XT_StripNbr.push_back(StripNbr);
fSecondStage_XT_Time.push_back(Time);
};//!
// Second Stage Time Back
inline void SetSecondStageYT(const UShort_t& DetNbr, const UShort_t StripNbr, const Double_t& Time) {
fSecondStage_YT_DetectorNbr.push_back(DetNbr);
fSecondStage_YT_StripNbr.push_back(StripNbr);
fSecondStage_YT_Time.push_back(Time);
};//!
////////////////////// GETTERS ////////////////////////
// Energy
inline UShort_t GetMultEnergy() const
{return fPISTA_E_DetectorNbr.size();}
inline UShort_t GetE_DetectorNbr(const unsigned int &i) const
{return fPISTA_E_DetectorNbr[i];}//!
inline Double_t Get_Energy(const unsigned int &i) const
{return fPISTA_Energy[i];}//!
// Time
inline UShort_t GetMultTime() const
{return fPISTA_T_DetectorNbr.size();}
inline UShort_t GetT_DetectorNbr(const unsigned int &i) const
{return fPISTA_T_DetectorNbr[i];}//!
inline Double_t Get_Time(const unsigned int &i) const
{return fPISTA_Time[i];}//!
// First Stage Energy X
inline UShort_t GetFirstStageMultXEnergy() const
{return fFirstStage_XE_DetectorNbr.size();}
inline UShort_t GetFirstStage_XE_DetectorNbr(const unsigned int &i) const
{return fFirstStage_XE_DetectorNbr[i];}//!
inline UShort_t GetFirstStage_XE_StripNbr(const unsigned int &i) const
{return fFirstStage_XE_StripNbr[i];}//!
inline Double_t GetFirstStage_XE_Energy(const unsigned int &i) const
{return fFirstStage_XE_Energy[i];}//!
// First Stage Energy Y
inline UShort_t GetFirstStageMultYEnergy() const
{return fFirstStage_YE_DetectorNbr.size();}
inline UShort_t GetFirstStage_YE_DetectorNbr(const unsigned int &i) const
{return fFirstStage_YE_DetectorNbr[i];}//!
inline UShort_t GetFirstStage_YE_StripNbr(const unsigned int &i) const
{return fFirstStage_YE_StripNbr[i];}//!
inline Double_t GetFirstStage_YE_Energy(const unsigned int &i) const
{return fFirstStage_YE_Energy[i];}//!
// First Stage Time X
inline UShort_t GetFirstStageMultXTime() const
{return fFirstStage_XT_DetectorNbr.size();}
inline UShort_t GetFirstStage_XT_DetectorNbr(const unsigned int &i) const
{return fFirstStage_XT_DetectorNbr[i];}//!
inline UShort_t GetFirstStage_XT_StripNbr(const unsigned int &i) const
{return fFirstStage_XT_StripNbr[i];}//!
inline Double_t GetFirstStage_XT_Time(const unsigned int &i) const
{return fFirstStage_XT_Time[i];}//!
// First Stage Time Y
inline UShort_t GetFirstStageMultYTime() const
{return fFirstStage_YT_DetectorNbr.size();}
inline UShort_t GetFirstStage_YT_DetectorNbr(const unsigned int &i) const
{return fFirstStage_YT_DetectorNbr[i];}//!
inline UShort_t GetFirstStage_YT_StripNbr(const unsigned int &i) const
{return fFirstStage_YT_StripNbr[i];}//!
inline Double_t GetFirstStage_YT_Time(const unsigned int &i) const
{return fFirstStage_YT_Time[i];}//!
//////
// Second Stage Energy X
inline UShort_t GetSecondStageMultXEnergy() const
{return fSecondStage_XE_DetectorNbr.size();}
inline UShort_t GetSecondStage_XE_DetectorNbr(const unsigned int &i) const
{return fSecondStage_XE_DetectorNbr[i];}//!
inline UShort_t GetSecondStage_XE_StripNbr(const unsigned int &i) const
{return fSecondStage_XE_StripNbr[i];}//!
inline Double_t GetSecondStage_XE_Energy(const unsigned int &i) const
{return fSecondStage_XE_Energy[i];}//!
// Second Stage Energy Y
inline UShort_t GetSecondStageMultYEnergy() const
{return fSecondStage_YE_DetectorNbr.size();}
inline UShort_t GetSecondStage_YE_DetectorNbr(const unsigned int &i) const
{return fSecondStage_YE_DetectorNbr[i];}//!
inline UShort_t GetSecondStage_YE_StripNbr(const unsigned int &i) const
{return fSecondStage_YE_StripNbr[i];}//!
inline Double_t GetSecondStage_YE_Energy(const unsigned int &i) const
{return fSecondStage_YE_Energy[i];}//!
// Second Stage Time X
inline UShort_t GetSecondStageMultXTime() const
{return fSecondStage_XT_DetectorNbr.size();}
inline UShort_t GetSecondStage_XT_DetectorNbr(const unsigned int &i) const
{return fSecondStage_XT_DetectorNbr[i];}//!
inline UShort_t GetSecondStage_XT_StripNbr(const unsigned int &i) const
{return fSecondStage_XT_StripNbr[i];}//!
inline Double_t GetSecondStage_XT_Time(const unsigned int &i) const
{return fSecondStage_XT_Time[i];}//!
// Second Stage Time Y
inline UShort_t GetSecondStageMultYTime() const
{return fSecondStage_YT_DetectorNbr.size();}
inline UShort_t GetSecondStage_YT_DetectorNbr(const unsigned int &i) const
{return fSecondStage_YT_DetectorNbr[i];}//!
inline UShort_t GetSecondStage_YT_StripNbr(const unsigned int &i) const
{return fSecondStage_YT_StripNbr[i];}//!
inline Double_t GetSecondStage_YT_Time(const unsigned int &i) const
{return fSecondStage_YT_Time[i];}//!
//////////////////////////////////////////////////////////////
......
......@@ -40,22 +40,23 @@ using namespace std;
#include "TChain.h"
ClassImp(TPISTAPhysics)
///////////////////////////////////////////////////////////////////////////
TPISTAPhysics::TPISTAPhysics()
: m_EventData(new TPISTAData),
m_PreTreatedData(new TPISTAData),
m_EventPhysics(this),
m_Spectra(0),
m_E_RAW_Threshold(0), // adc channels
m_E_Threshold(0), // MeV
m_NumberOfDetectors(0) {
}
///////////////////////////////////////////////////////////////////////////
TPISTAPhysics::TPISTAPhysics(){
EventMultiplicity = 0;
m_EventData = new TPISTAData;
m_PreTreatedData = new TPISTAData;
m_EventPhysics = this;
m_Spectra = NULL;
m_E_RAW_Threshold = 0; // adc channels
m_E_Threshold = 0; // MeV
m_NumberOfDetectors = 0;
m_MaximumStripMultiplicityAllowed = 10;
m_StripEnergyMatching = 0.050;
}
///////////////////////////////////////////////////////////////////////////
/// A usefull method to bundle all operation to add a detector
void TPISTAPhysics::AddDetector(TVector3 , string ){
void TPISTAPhysics::AddDetector(TVector3){
// In That simple case nothing is done
// Typically for more complex detector one would calculate the relevant
// positions (stripped silicon) or angles (gamma array)
......@@ -63,13 +64,106 @@ void TPISTAPhysics::AddDetector(TVector3 , string ){
}
///////////////////////////////////////////////////////////////////////////
void TPISTAPhysics::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 TPISTAPhysics::AddDetector(double R, double Theta, double Phi){
m_NumberOfDetectors++;
// Vector U on detector face (parallel to Y strips) Y strips are along X axis
TVector3 U;
// Vector V on detector face (parallel to X strips)
TVector3 V;
// Vector W normal to detector face (pointing to the back)
TVector3 W;
// Vector C position of detector face center
TVector3 C;
C = TVector3(R*sin(Theta)*cos(Phi),
R*sin(Theta)*sin(Phi),
R*cos(Theta));
TVector3 P = TVector3(cos(Theta)*cos(Phi),
cos(Theta)*sin(Phi),
-sin(Theta));
W = C.Unit();
U = W.Cross(P);
V = W.Cross(U);
U = U.Unit();
V = V.Unit();
double Height = 118; // mm
double Base = 95; // mm
double NumberOfStrips = 128;
double StripPitchHeight = Height / NumberOfStrips; // mm
double StripPitchBase = Base / NumberOfStrips; // mm
vector<double> lineX;
vector<double> lineY;
vector<double> lineZ;
vector<vector<double>> OneDetectorStripPositionX;
vector<vector<double>> OneDetectorStripPositionY;
vector<vector<double>> OneDetectorStripPositionZ;
double X, Y, Z;
// Moving C to the 1.1 Corner;
TVector3 Strip_1_1;
Strip_1_1 = C - (0.5*Base*U + 0.5*Height*V) + U*(StripPitchBase / 2.) + V*(StripPitchHeight / 2.);
TVector3 StripPos;
for(int i=0; i<NumberOfStrips; i++){
lineX.clear();
lineY.clear();
lineZ.clear();
for(int j=0; j<NumberOfStrips; j++){
StripPos = Strip_1_1 + i*U*StripPitchBase + j*V*StripPitchHeight;
lineX.push_back(StripPos.X());
lineY.push_back(StripPos.Y());
lineZ.push_back(StripPos.Z());
}
OneDetectorStripPositionX.push_back(lineX);
OneDetectorStripPositionY.push_back(lineY);
OneDetectorStripPositionZ.push_back(lineZ);
}
m_StripPositionX.push_back(OneDetectorStripPositionX);
m_StripPositionY.push_back(OneDetectorStripPositionY);
m_StripPositionZ.push_back(OneDetectorStripPositionZ);
}
///////////////////////////////////////////////////////////////////////////
TVector3 TPISTAPhysics::GetPositionOfInteraction(const int i){
TVector3 Position = TVector3(GetStripPositionX(DetectorNumber[i], StripX[i], StripY[i]),
GetStripPositionY(DetectorNumber[i], StripX[i], StripY[i]),
GetStripPositionZ(DetectorNumber[i], StripX[i], StripY[i]));
return Position;
}
///////////////////////////////////////////////////////////////////////////
TVector3 TPISTAPhysics::GetDetectorNormal(const int i){
TVector3 U = TVector3(GetStripPositionX(DetectorNumber[i],128,1),
GetStripPositionY(DetectorNumber[i],128,1),
GetStripPositionZ(DetectorNumber[i],128,1))
-TVector3(GetStripPositionX(DetectorNumber[i],1,1),
GetStripPositionY(DetectorNumber[i],1,1),
GetStripPositionZ(DetectorNumber[i],1,1));
TVector3 V = TVector3(GetStripPositionX(DetectorNumber[i],128,128),
GetStripPositionY(DetectorNumber[i],128,128),
GetStripPositionZ(DetectorNumber[i],128,128))
-TVector3(GetStripPositionX(DetectorNumber[i],128,1),
GetStripPositionY(DetectorNumber[i],128,1),
GetStripPositionZ(DetectorNumber[i],128,1));
TVector3 Normal = U.Cross(V);
return (Normal.Unit());
}
///////////////////////////////////////////////////////////////////////////
void TPISTAPhysics::BuildSimplePhysicalEvent() {
BuildPhysicalEvent();
......@@ -82,20 +176,88 @@ void TPISTAPhysics::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));
if(1 /*CheckEvent() == 1*/){
vector<TVector2> couple = Match_X_Y();
EventMultiplicity = couple.size();
for(unsigned int i=0; i<couple.size(); i++){
int N = m_PreTreatedData->GetFirstStage_XE_DetectorNbr(couple[i].X());
int X = m_PreTreatedData->GetFirstStage_XE_StripNbr(couple[i].X());
int Y = m_PreTreatedData->GetFirstStage_YE_StripNbr(couple[i].Y());
double XE = m_PreTreatedData->GetFirstStage_XE_Energy(couple[i].X());
double YE = m_PreTreatedData->GetFirstStage_YE_Energy(couple[i].Y());
DetectorNumber.push_back(N);
StripX.push_back(X);
StripY.push_back(Y);
DE.push_back(XE);
PosX.push_back(GetPositionOfInteraction(i).x());
PosY.push_back(GetPositionOfInteraction(i).y());
PosZ.push_back(GetPositionOfInteraction(i).z());
int SecondStageMult = m_PreTreatedData->GetSecondStageMultXEnergy();
for(unsigned int j=0; j<SecondStageMult; j++){
if(m_PreTreatedData->GetSecondStage_XE_DetectorNbr(j)==N){
double XDE = m_PreTreatedData->GetSecondStage_XE_Energy(j);
double YDE = m_PreTreatedData->GetSecondStage_YE_Energy(j);
E.push_back(XDE);
}
}
}
}
}
///////////////////////////////////////////////////////////////////////////
vector<TVector2> TPISTAPhysics::Match_X_Y(){
vector<TVector2> ArrayOfGoodCouple;
static unsigned int m_XEMult, m_YEMult;
m_XEMult = m_PreTreatedData->GetFirstStageMultXEnergy();
m_YEMult = m_PreTreatedData->GetFirstStageMultYEnergy();
if(m_XEMult>m_MaximumStripMultiplicityAllowed || m_YEMult>m_MaximumStripMultiplicityAllowed){
return ArrayOfGoodCouple;
}
for(unsigned int i=0; i<m_XEMult; i++){
for(unsigned int j=0; j<m_YEMult; j++){
// Declaration of variable for clarity
int XDetNbr = m_PreTreatedData->GetFirstStage_XE_DetectorNbr(i);
int YDetNbr = m_PreTreatedData->GetFirstStage_YE_DetectorNbr(j);
// if same detector check energy
if(XDetNbr == YDetNbr){
// Declaration of variable for clarity
double XE = m_PreTreatedData->GetFirstStage_XE_Energy(i);
double YE = m_PreTreatedData->GetFirstStage_YE_Energy(i);
double XStripNbr = m_PreTreatedData->GetFirstStage_XE_StripNbr(i);
double YStripNbr = m_PreTreatedData->GetFirstStage_YE_StripNbr(i);
// look if energy matches
if(abs(XE-YE)/2.<m_StripEnergyMatching){
ArrayOfGoodCouple.push_back(TVector2(i,j));
}
}
}
}
return ArrayOfGoodCouple;
}
///////////////////////////////////////////////////////////////////////////
int TPISTAPhysics::CheckEvent(){
// Check the size of the different elements
if(m_PreTreatedData->GetFirstStageMultXEnergy() == m_PreTreatedData->GetFirstStageMultYEnergy() )
return 1;
else
return -1;
}
///////////////////////////////////////////////////////////////////////////
void TPISTAPhysics::PreTreat() {
// This method typically applies thresholds and calibrations
......@@ -107,23 +269,58 @@ void TPISTAPhysics::PreTreat() {
// 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("PISTA/ENERGY"+NPL::itoa(m_EventData->GetE_DetectorNbr(i)),m_EventData->Get_Energy(i));
//////
// First Stage Energy
unsigned int sizeFront = m_EventData->GetFirstStageMultXEnergy();
for (UShort_t i = 0; i < sizeFront ; ++i) {
if (m_EventData->GetFirstStage_XE_Energy(i) > m_E_RAW_Threshold) {
Double_t Energy = m_EventData->GetFirstStage_XE_Energy(i);
//Double_t Energy = Cal->ApplyCalibration("PISTA/ENERGY"+NPL::itoa(m_EventData->GetFirstStage_XE_DetectorNbr(i)),m_EventData->GetFirstStage_XE_Energy(i));
if (Energy > m_E_Threshold) {
m_PreTreatedData->SetEnergy(m_EventData->GetE_DetectorNbr(i), Energy);
m_PreTreatedData->SetFirstStageXE(m_EventData->GetFirstStage_XE_DetectorNbr(i), m_EventData->GetFirstStage_XE_StripNbr(i), Energy);
}
}
}
// Time
mysize = m_EventData->GetMultTime();
unsigned int sizeBack = m_EventData->GetFirstStageMultXEnergy();
for (UShort_t i = 0; i < sizeBack ; ++i) {
if (m_EventData->GetFirstStage_YE_Energy(i) > m_E_RAW_Threshold) {
Double_t Energy = m_EventData->GetFirstStage_YE_Energy(i);
//Double_t Energy = Cal->ApplyCalibration("PISTA/ENERGY"+NPL::itoa(m_EventData->GetFirstStage_YE_DetectorNbr(i)),m_EventData->GetFirstStage_YE_Energy(i));
if (Energy > m_E_Threshold) {
m_PreTreatedData->SetFirstStageYE(m_EventData->GetFirstStage_YE_DetectorNbr(i), m_EventData->GetFirstStage_YE_StripNbr(i), Energy);
}
}
}
// First Stage Time
unsigned int mysize = m_EventData->GetFirstStageMultXTime();
for (UShort_t i = 0; i < mysize; ++i) {
Double_t Time= Cal->ApplyCalibration("PISTA/TIME"+NPL::itoa(m_EventData->GetT_DetectorNbr(i)),m_EventData->Get_Time(i));
m_PreTreatedData->SetTime(m_EventData->GetT_DetectorNbr(i), Time);
Double_t Time= Cal->ApplyCalibration("PISTA/TIME"+NPL::itoa(m_EventData->GetFirstStage_XT_DetectorNbr(i)),m_EventData->GetFirstStage_XT_Time(i));
m_PreTreatedData->SetFirstStageXT(m_EventData->GetFirstStage_XT_DetectorNbr(i), m_EventData->GetFirstStage_XT_StripNbr(i), Time);
}
//////
// Second Stage Energy
sizeFront = m_EventData->GetSecondStageMultXEnergy();
for (UShort_t i = 0; i < sizeFront ; ++i) {
if (m_EventData->GetSecondStage_XE_Energy(i) > m_E_RAW_Threshold) {
Double_t Energy = m_EventData->GetSecondStage_XE_Energy(i);
//Double_t Energy = Cal->ApplyCalibration("PISTA/ENERGY"+NPL::itoa(m_EventData->GetSecondStage_XE_DetectorNbr(i)),m_EventData->GetSecondStage_XE_Energy(i));
if (Energy > m_E_Threshold) {
m_PreTreatedData->SetSecondStageXE(m_EventData->GetSecondStage_XE_DetectorNbr(i), m_EventData->GetSecondStage_XE_StripNbr(i), Energy);
}
}
}
sizeBack = m_EventData->GetSecondStageMultXEnergy();
for (UShort_t i = 0; i < sizeBack ; ++i) {
if (m_EventData->GetSecondStage_YE_Energy(i) > m_E_RAW_Threshold) {
Double_t Energy = m_EventData->GetSecondStage_YE_Energy(i);
//Double_t Energy = Cal->ApplyCalibration("PISTA/ENERGY"+NPL::itoa(m_EventData->GetSecondStage_YE_DetectorNbr(i)),m_EventData->GetSecondStage_YE_Energy(i));
if (Energy > m_E_Threshold) {
m_PreTreatedData->SetSecondStageYE(m_EventData->GetSecondS