Skip to content
Snippets Groups Projects
Commit 6f65eace authored by adrien-matta's avatar adrien-matta
Browse files

* Adding Riken data file to NPL

parent 091c5e99
No related branches found
No related tags found
No related merge requests found
...@@ -201,8 +201,24 @@ bool OpenASCIIorROOTFile(string filename, ifstream &ASCII , TFile &ROOT){ ...@@ -201,8 +201,24 @@ bool OpenASCIIorROOTFile(string filename, ifstream &ASCII , TFile &ROOT){
} }
else { else {
ROOT.Open(filename.c_str(),"READ"); if(ROOT.Open(filename.c_str(),"READ")){
return false; return false;
}
else{
cout << 1 << endl;
if(ROOT.Open(StandardPath.c_str(),"READ")){
cout << 2 << endl;
return false;
}
else{
cout << 3 << endl;
cout << "Error, file " << StandardPath << " not found " << endl ;
exit(1);
}
}
} }
} }
......
...@@ -210,8 +210,21 @@ double Reaction::ShootRandomThetaCM(){ ...@@ -210,8 +210,21 @@ double Reaction::ShootRandomThetaCM(){
if(fDoubleDifferentialCrossSectionHist){ if(fDoubleDifferentialCrossSectionHist){
// Take a slice in energy // Take a slice in energy
TAxis* Y = fDoubleDifferentialCrossSectionHist->GetYaxis(); TAxis* Y = fDoubleDifferentialCrossSectionHist->GetYaxis();
TH1D* Proj = fDoubleDifferentialCrossSectionHist int binY;
->ProjectionY("proj",Y->FindBin(fBeamEnergy),Y->FindBin(fBeamEnergy));
// Those test are there for the tail event of the energy distribution
// In case the energy is outside the range of the 2D histo we take the
// closest availabile CS
if(Y->FindBin(fBeamEnergy) > Y->GetLast())
binY = Y->GetLast()-1;
else if(Y->FindBin(fBeamEnergy) < Y->GetFirst())
binY = Y->GetFirst();
else
binY = Y->FindBin(fBeamEnergy);
TH1D* Proj = fDoubleDifferentialCrossSectionHist->ProjectionX("proj",binY,binY);
SetThetaCM( theta=Proj->GetRandom()*deg ); SetThetaCM( theta=Proj->GetRandom()*deg );
} }
else else
......
include ../Makefile.arch
#------------------------------------------------------------------------------
SHARELIB = libRIPSData.so
all: $(SHARELIB)
#------------------------------------------------------------------------------
############### Detector ##############
## RIPS ##
libRIPSData.so: TRIPSData.o TRIPSDataDict.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
TRIPSDataDict.cxx: TRIPSData.h
rootcint -f $@ -c $^
#libRIPSPhysics.so: TRIPSPhysics.o TRIPSPhysicsDict.o
# $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
#TRIPSPhysicsDict.cxx: TRIPSPhysics.h
# rootcint -f $@ -c $^
# dependances
TRIPSData.o: TRIPSData.cxx TRIPSData.h
#TRIPSPhysics.o: TRIPSPhysics.cxx TRIPSPhysics.h
#######################################
############# Clean and More ##########
clean:
@rm -f core *~ *.o *Dict*
distclean:
make clean; rm -f *.so
.SUFFIXES: .$(SrcSuf)
###
.$(SrcSuf).$(ObjSuf):
$(CXX) $(CXXFLAGS) $(INCLUDE) -c $<
#include <iostream>
#include "TRIPSData.h"
ClassImp(TRIPSData)
TRIPSData::TRIPSData()
{
}
TRIPSData::~TRIPSData()
{
}
void TRIPSData::Clear()
{
RunNumber = -1 ;
EventNumber = -1;
fRIPS_PPAC_N.clear();
fRIPS_PPAC_X.clear();
fRIPS_PPAC_Y.clear();
fRIPS_PPAC_T.clear();
fRIPS_Plastic_N.clear();
fRIPS_Plastic_E.clear();
fRIPS_Plastic_EL.clear();
fRIPS_Plastic_ER.clear();
fRIPS_Plastic_TL.clear();
fRIPS_Plastic_TR.clear();
fRIPS_RF_N.clear();
fRIPS_RF_T.clear();
}
void TRIPSData::Dump() const
{
cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event XXXXXXXXXXXXXXXXX" << endl;
}
#ifndef __RIPSDATA__
#define __RIPSDATA__
#include <vector>
#include <iostream>
#include "TObject.h"
using namespace std ;
class TRIPSData : public TObject {
private:
// PPAC
int RunNumber;
int EventNumber;
vector<int> fRIPS_PPAC_N;
vector<double> fRIPS_PPAC_X;
vector<double> fRIPS_PPAC_Y;
vector<double> fRIPS_PPAC_T;
// Plastic
vector<int> fRIPS_Plastic_N;
vector<double> fRIPS_Plastic_E;
vector<double> fRIPS_Plastic_EL;
vector<double> fRIPS_Plastic_ER;
vector<double> fRIPS_Plastic_TL;
vector<double> fRIPS_Plastic_TR;
// RF
vector<int> fRIPS_RF_N;
vector<double> fRIPS_RF_T;
public:
TRIPSData();
virtual ~TRIPSData();
void Clear();
void Clear(const Option_t*) {};
void Dump() const;
///////////////////// GETTERS ////////////////////////
int GetRunNumber() {return RunNumber;}
int GetEventNumber() {return EventNumber;}
// PPAC
int GetMultPPAC() {return fRIPS_PPAC_N.size();}
int GetPPACN(int i) {return fRIPS_PPAC_N[i];}
double GetPPACX(int i) {return fRIPS_PPAC_X[i];}
double GetPPACY(int i) {return fRIPS_PPAC_Y[i];}
double GetPPACT(int i) {return fRIPS_PPAC_T[i];}
// Plastic
int GetMultPlastic() {return fRIPS_Plastic_N.size();}
int GetPlasticN(int i) {return fRIPS_Plastic_N[i];}
double GetPlasticE(int i) {return fRIPS_Plastic_E[i];}
double GetPlasticER(int i) {return fRIPS_Plastic_ER[i];}
double GetPlasticEL(int i) {return fRIPS_Plastic_EL[i];}
double GetPlasticTL(int i) {return fRIPS_Plastic_TL[i];}
double GetPlasticTR(int i) {return fRIPS_Plastic_TR[i];}
// RF
int GetMultRF() {return fRIPS_RF_N.size();}
double GetRFN(int i) {return fRIPS_RF_N[i];}
double GetRFT(int i) {return fRIPS_RF_T[i];}
///////////////////// SETTERS ////////////////////////
void SetRunNumber(int value) {RunNumber=value;}
void SetEventNumber(int value) {EventNumber=value;}
// PPAC
void SetPPACN(int value) {fRIPS_PPAC_N.push_back(value);}
void SetPPACX(double value) {fRIPS_PPAC_X.push_back(value);}
void SetPPACY(double value) {fRIPS_PPAC_Y.push_back(value);}
void SetPPACT(double value) {fRIPS_PPAC_T.push_back(value);}
// Plastic
void SetPlasticN(int value) {fRIPS_Plastic_N.push_back(value);}
void SetPlasticE(double value) {fRIPS_Plastic_E.push_back(value);}
void SetPlasticER(double value) {fRIPS_Plastic_ER.push_back(value);}
void SetPlasticEL(double value) {fRIPS_Plastic_EL.push_back(value);}
void SetPlasticTL(double value) {fRIPS_Plastic_TL.push_back(value);}
void SetPlasticTR(double value) {fRIPS_Plastic_TR.push_back(value);}
// RF
void SetRFN(int value) {fRIPS_RF_N.push_back(value);}
void SetRFT(double value) {fRIPS_RF_T.push_back(value);}
//
ClassDef(TRIPSData,1) // PlasticData structure
};
#endif
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