Commit 73b3f26e authored by Vratislav Chudoba's avatar Vratislav Chudoba

Source for libraries upload.

parent b50c7064
This diff is collapsed.
#pragma once
#include <TObject.h>
#include <TFile.h>
#include <TTree.h>
#include <TH1I.h>
#include <TPolyMarker.h>
#include <TF1.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TCanvas.h>
#include <TMath.h>
#include <TGraph.h>
#include <TObjArray.h>
#include <TRandom3.h>
#include <THStack.h>
#include <TString.h>
#include <TSpectrum.h>
#include "AculRaw.h" //potreba zaridit nezavislost na teto tride
#include <iostream>
#include <fstream>
#include <iomanip>
#include <sstream>
#define DEFAULTNOPEAKS 20
#define BLOCKSNUMBER 24
#define ADDRESSNUMBER 16
using std::cout;
using std::endl;
using std::setw;
using std::setprecision;
using std::stringstream;
using std::ostringstream;
class AculCalibration : public TObject
{
public:
//smysl jako verejne globalni promenne maji:
//fNOSpectra - pocet zkalibrovanych spekter
//???? - pocet spravne zkalibrovanych spekter
//???? - pocet nespravne zkalibrovanych spekter
//fEnergy[4] - tabulka s energiemi piku, nacita se zvenci
//private:
// TObjArray *fHRawList; //list of raw histograms, list is set to owner
TObjArray fHRawList; //list of raw histograms, list is set to owner
TObjArray fHAnalyzedList; //list of fitted and analyzed histograms, list is set to owner
TObjArray fHEnergyList; //list of calibrated histograms, list is set to owner
THStack fHEnergyStack; //some stack
THStack *fCurrentHStack;
//dodelat current histograms
TObjArray fCurrentHistList;
// TRandom3 *fRanGen;
// static TRandom3 fRanGen; //!
// THStack *fHStack;
//parameters to be read from file
Int_t kRaNOPEAKS;
Double_t fEnergy[DEFAULTNOPEAKS];
Double_t fLowerPeakRelativeHight; //pouziva se, private
Double_t fUpperPeakRelativeHight; //pouziva se, private, nastavit nenulovou prednastavenou hodnotu
Double_t fPeakPositionTolerance; //pouziva se, private
Width_t fFitFuncLineWidth; //private
Double_t fFitMinSigma; //pouziva se, private
Double_t fFitPeakThreshold; //pouziva se, private, prozkoumat, k cemu vlastne slouzi ve fci ShowPeaks, popremyslet o vhodnem prednastaveni v konstruktoru
//tyto promenne jsou smyslem tridy, mely by tedy byt snad jako jedine verejne
Double_t fA[BLOCKSNUMBER][ADDRESSNUMBER]; //kalibracni parametry, f(x) = fA*x + fB
Double_t fB[BLOCKSNUMBER][ADDRESSNUMBER]; //kalibracni parametry, f(x) = fA*x + fB
Double_t fC[BLOCKSNUMBER][ADDRESSNUMBER]; //treti kalibracni parametr, jine zavislosti nez pol1
Double_t fD[BLOCKSNUMBER][ADDRESSNUMBER]; //ctvrty kalibracni parametr
//smysl je velmi pochybny
TFile *fCalInformation;
// AculCalibratedData *fCalData;
//private:
Double_t fPeak[DEFAULTNOPEAKS]; //v teto promenne je ulozena momentalni hodnota piku v kanalech, zejmena v jedne fci, mozno udelat ji jako lokalni, bude navratovou hodnotou fce PeaksFitting, predelat delku pole
public:
AculCalibration(); //
AculCalibration(const char* parfile); //
virtual ~AculCalibration();
ClassDef(AculCalibration, 1);
//public
Bool_t SetInputParameters(const char* inputparfile = "parforcal.par");
Bool_t SetCalibrationParameters(const char* calparfile);
//public
void PrintInputParameters();
void PrintCalibrationParameters(const Int_t blockmin = 1, const Int_t blockmax = BLOCKSNUMBER - 1);
//public
Bool_t CalculateCalibParameters(const char* inputfilename, const Int_t block, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t lowersubaddress = 0, Int_t uppersubaddress = 15); //calculate calibration parameters for given block in given file
Bool_t CalculateCalibParameters(const char* inputfile, const char* block, const Int_t address, const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t lowersubaddress = 0, Int_t uppersubaddress = 15); //calculate calibration parameters for given block in given file
Int_t CalibrateBlock(const Char_t* inputfilename, const Int_t block, const Char_t* outputfilename, Int_t lowersubaddress = 0, Int_t uppersubaddress = 15); //vysvetlit, co je to outputfile
Int_t PeaksFitting(TH1I* hSpectrum, Option_t* option = "", Double_t sigmamin = 2); //possible options: "V", "Q", ""
Int_t SearchPeaks(const TH1 *hin, Double_t sigma = 2, Option_t *option = "", Double_t threshold = 0.05, const Int_t searchedpeaks = 100);
void FillRawSpectraFile(const char* rawdatafile, const char* block, const char* treename, TCanvas* rawCanvas = NULL, Option_t *option = "", Int_t xaxismin = 0, Int_t xaxismax = 4096);
void ShowRawSpectra(const char* filename, const Int_t block, TCanvas* rawCanvas = NULL, Int_t xaxismin = 0, Int_t xaxismax = 4096, /*TObjArray* histList = NULL,*/ const Int_t subaddress = 16);
void ShowSpectra(const char* filename, TCanvas* rawCanvas = NULL, Option_t *option = "", Int_t xaxismin = 0, Int_t xaxismax = 4096, /*TObjArray* histList = NULL,*/ const Int_t subaddress = 16);
void ShowAnalyzedSpectra(const char* filename, TCanvas* fittedRawCanvas = NULL, Int_t xaxismin = 0, Int_t xaxismax = 4096, Int_t subaddress = 16);
void ShowEnergySpectra(const char *filename, TCanvas* energyCanvas = NULL, const Int_t subaddress = 16, Option_t* option = "", Double_t xaxismin = 0., Double_t xaxismax = 10.); //option: "sum", "c", "+",
// void
//dodelat funkce TTree* Get...(...) pro raw, anal i E spectra
Bool_t AddCalFileToList(const char* calfilelist = "CalFileList.log");
void ClearHistograms(Option_t* option = "");
void DeleteStacks(Option_t* option = "");
void MakeCalibrationFile(Char_t* calibrationfile, Char_t* calfilelist);
void Reset();
//private:
};
This diff is collapsed.
////////////////////////////////////////////////////////////////////////
//// ////
//// Class with functions converting the ACCULINNA raw format ////
//// to ROOT raw format (class AculRaw). Functions converting ////
//// particular file, particular folder and series of folders ////
//// are available. ////
//// ////
////////////////////////////////////////////////////////////////////////
#pragma once
//#include "DllExport.h"
#include "AculRaw.h"
#include <TObject.h>
#include <TFile.h>
#include <TTree.h>
#include <TString.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#define ENDOFEVENT 0xf0 //identifier of the end of one event
#define PERMPARNUMBER 10 //number of the permanent parameters in one event according to file protocol
using std::cout;
using std::endl;
using std::setw;
class /*DllExport*/ AculConvert
{
private:
AculRaw *fRawEvent;
ofstream fOutFaultFile; //file for error output
UInt_t fMaskC3[BLOCKSNUMBER];
//functions
Int_t ReadFileProtocol(const char* protocolname); //read file protocol and save mask values
public:
AculConvert();
virtual ~AculConvert();
ClassDef(AculConvert, 1);
//functions
Int_t ConvertRun(const char* runname, const Int_t nofirstfolder, const Int_t nolastfolder/*, const Char_t* runaddress = ""*/); //convert more folders
Int_t ConvertFolder(const char* foldername); //convert whole folder
Int_t ConvertFile(const char* datafile, TFile* rootRawFile = NULL); //convert one file, zmenit vnitrni vypisy
};
################################################################################
# AculData input with some variables
################################################################################
ACULDATALIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMathCore -lGpad -lGraf
# Add inputs and outputs from these tool invocations to the build variables
ACULDATA_HEADERS += \
$(ACULDATA)/AculCalibration.h \
$(ACULDATA)/AculConvert.h \
$(ACULDATA)/AculRaw.h \
$(ACULDATA)/ConfigDictionary.h \
$(ACULDATA)/linkdef.h
ACULDATACPP_SRCS += \
$(ACULDATA)/AculCalibration.cpp \
$(ACULDATA)/AculConvert.cpp \
$(ACULDATA)/AculRaw.cpp \
$(ACULDATA)/ConfigDictionary.cpp \
$(ACULDATA)/AculDataCint.cpp
ACULDATAOBJS += \
$(ACULDATA)/AculCalibration.o \
$(ACULDATA)/AculConvert.o \
$(ACULDATA)/AculRaw.o \
$(ACULDATA)/ConfigDictionary.o \
$(ACULDATA)/AculDataCint.o
ACULDATACPP_DEPS += \
$(ACULDATA)/AculCalibration.d \
$(ACULDATA)/AculConvert.d \
$(ACULDATA)/AculRaw.d \
$(ACULDATA)/ConfigDictionary.d
\ No newline at end of file
#include "AculRaw.h"
ClassImp(AculRaw);
AculRaw::AculRaw() // it is possible to replace whole text in the constructor by use of the Reset() function
{
trigger = 0;
for (Int_t i = 0; i < 4; i++) {
mwpcReg[i] = 0;
}
for (Int_t i = 0; i < BLOCKSNUMBER; i++) {
for (Int_t j = 0; j < ADDRESSNUMBER; j++) {
C3[i][j] = 0;
}
}
};
AculRaw::~AculRaw()
{
}
Int_t AculRaw::Reset()
{
trigger = 0;
for (Int_t i = 0; i < 4; i++) {
mwpcReg[i] = 0;
}
for (Int_t i = 0; i < BLOCKSNUMBER; i++) {
for (Int_t j = 0; j < ADDRESSNUMBER; j++) {
C3[i][j] = 0;
}
}
return 0;
}
////////////////////////////////////////////////////////////////
//// ////
//// Class with structure of the TTree for immediate ////
//// translation of the ACCULINNA raw data format to ////
//// ROOT format. This class correspond to the DAQ ////
//// structure. ////
//// ////
////////////////////////////////////////////////////////////////
#pragma once
//#include "DllExport.h"
#include <TObject.h>
#define BLOCKSNUMBER 24
#define ADDRESSNUMBER 16
class AculRaw : public TObject
{
public:
Int_t mwpcReg[4]; //information about MWPCx plane in the register format
Int_t C3[BLOCKSNUMBER][ADDRESSNUMBER]; //information from crate C3
Int_t trigger;
AculRaw();
virtual ~AculRaw();
ClassDef(AculRaw, 1);
//functions
Int_t Reset(); //reseting of the read values
};
#include "ConfigDictionary.h"
ClassImp(ConfigDictionary);
//////////////////////////////////////////////////////////////////////////////
// BEGIN_HTML
// <p><font size="4"><b>Config(uration)Dictionary class</b></font></p>
// <br>
// <i>Author: Bartlomiej Hnatio 2012-08-06</i>
// <br><br>
// This is very useful class to convert strings containing pairs "key"="value"
// into fast dictionaries. This strings are often read from external files.
// From dictionary created in such way one can easily
// extract values in few supported formats (integer, double, boolean, string)
// It can also be used in opposite direction: when dictionary is created with
// given values and keys, one can create config string, which is most
// convenient to write in external files.
// <br><br><br>
// <u>Most simple example of usage:</u>
// <br><br>Suppose you have two variables fD and fI:
// <pre>-------------------
// Double_t fD;
// Int_t fI;
//
//fD = 3.14;
//fI = 2012;
//-----------------------</pre>
// To save its parameters into file you can create ConfigDictionary class
// instance and use <b>SetDouble</b> and <b>SetInt</b> functions to
// insert parameters values with arbitrarly defined keys (let them be
// really long and descriptive in this example):
// <pre>---------------------
//ConfigDictionary CD;
//CD.SetDouble("Most important variable D",fD);
//CD.SetInt("Equally important integer I",fI);
//---------------------</pre>
// Now configuration string saved in <b>ConfigDictionary</b> CD
// can be obtained with <b>ToString</b> method and should look like:
//<pre>
//"Most important variable D"="3.14" "Equally important integer I"="2012"
//</pre>
// <br> It can be easily saved to a file using simplest <i>fstream</i>
// methods. And the advantage is that as a key one can use any string,
// so configuration file created in such way is very self-explanatory.
// <br>
// <br>
// Now lets suppose the opposite action - loading config from file.
// Imagine, that you have 1000 objects of A class, which config was saved
// to file - one object per line:
// <pre>-----------------
//"Most important variable D"="3.14" "Equally important integer I"="2012"
//"Equally important integer I"="1011" "Most important variable D"="8.15"
//"Most important variable D"="13.16" "Equally important integer I"="10"
//(...)
//----------------</pre>
// Please notice that order in which pairs of keys and values are placed
// in file doesn't make any difference to the ConfigDictionary class.
// To recreate objects, you just read each line containing single
// config string and then create with it ConfigDictionary object
// using special constructor with string as argument,
// or using <b>FromString</b> method. After this, you can
// extract parameters (using <b>GetDouble</b> and <b>GetInt</b> methods)
// with using same keys as were used for saving, and ConfigDictionary
// will return their values:
// <pre>----------------------
//string line;//This line you read from file
//ConfigDictionary CD(line);
//fD = CD.GetDouble("Most important variable D");
//fI = CD.GetInt("Equally important integer I");
//--------------------</pre>
//<br>
// And last but not least: what happens, if key requested by user doesn't
// exist in dictionary? (This can be caused by many reasons, mostly errors on
// user side, but not always).
// When you try to extract non-existent key using <b>Get</b> functions,
// an exception is risen. In normal program it should end execution and print
// some information about where program stopped working.
// But lets say that you don't want that, i.e. program may use default
// configs instead of those from files, or not all keys were that important.
// You can surround all uses of <b>Get</b> methods with try/catch clause.
// So when exception is risen, you will catch it, and decide, if you want
// the program to stop running, or anything else. Simple example is
// shown below:
//<pre>-------------------
//ConfigDictionary CD(some_string);
//try{//try to read important variables:
// double d = CD.GetDouble("crucial var");
// bool b = CD.GetBool("most important b");
// int i = CD.GetInt("unique ID");
// //...and so on
//}catch(std::string & e){//catch any kind of exception
// Error("Some crucial variable wasn't read, ending program!");
// return SOME_REALLY_BAD_ERROR_CODE;
//}
//try{//now less important, or optional:
// string name = CD.GetString("least important variable");
// double p = CD.GetDouble("optional parameter");
// //...and so on
//}catch(std::string & f){
// Info("Some optional variables wasn't read!");
//}
//--------------------</pre>
// END_HTML
//////////////////////////////////////////////////////////////////////////////
//_____________________________________________________________________________
ConfigDictionary::ConfigDictionary(){
//just empty map...
}
//_____________________________________________________________________________
ConfigDictionary::ConfigDictionary(std::string params){
//Just creates dictionary using FromString method
FromString(params);
}
//_____________________________________________________________________________
std::string ConfigDictionary::ToString(){
//Builds string that can be easily saved to file.
//Same format that can be read from files or from QtGui
//This should work same way for all uses
std::map<std::string,std::string>::iterator it;//Iterator to map elements
std::stringstream ss;//stream helpful with adding strings
//iterate whole dictionary:
for (it=configMap.begin();it!=configMap.end();++it){
//insert pairs "key"="value":
ss<<"\""<<it->first<<"\""<<"="<<"\""<<it->second<<"\""<<" ";
}
return ss.str();
}
//_____________________________________________________________________________
void ConfigDictionary::FromString(std::string params){
//params - TString containing list of key=value pairs
//
//Changes string formatted:
//"key1"="value1" "key2"="value with spaces 2" ...
//into map with keys and values
//Useful in lots of I/O functions,
//when we want to have a nice, readable format of data
std::stringstream loading(params);
std::string k,v;
while(!loading.fail()){
getline(loading,k,'\"');//removes everything to first "
getline(loading,k,'\"');//All chars between first two "" are the key
getline(loading,v,'\"');//removes all until third "
getline(loading,v,'\"');//All between another pair of "" is the value
if (!loading.fail())
configMap[k]=v;
}
}
//_____________________________________________________________________________
std::string ConfigDictionary::GetString(std::string key)throw(std::string){
//Extracts string from given key
//(if it exist, otherwise raises exception)
if (configMap.find(key) == configMap.end()){
Error("ConfigDictionary::GetString",
"Couldn't find the key: %s!",key.c_str());
throw(key);
}
return configMap[key];
}
//_____________________________________________________________________________
int ConfigDictionary::GetInt(std::string key)throw(std::string){
//Extracts integer from given key
//(if it exist, otherwise raises exception)
if (configMap.find(key) == configMap.end()){
Error("ConfigDictionary::GetInt",
"Couldn't find the key: %s!",key.c_str());
throw(key);
}
int returned=0;
//Convert string to int:
std::stringstream ss(configMap[key]);
ss>>returned;
return returned;
}
//_____________________________________________________________________________
double ConfigDictionary::GetDouble(std::string key)throw(std::string){
//Extracts integer from given key
//(if it exist, otherwise raises exception)
if (configMap.find(key) == configMap.end()){
Error("ConfigDictionary::GetDouble",
"Couldn't find the key: %s!",key.c_str());
throw(key);
}
double returned=0.0;
//Convert string to double:
std::stringstream ss(configMap[key]);
ss>>returned;
return returned;
}
//_____________________________________________________________________________
bool ConfigDictionary::GetBool(std::string key)throw(std::string){
//Extracts boolean from given key
//(if it exist, otherwise raises exception)
if (configMap.find(key) == configMap.end()){
Error("ConfigDictionary::GetBool",
"Couldn't find the key: %s!",key.c_str());
throw(key);
}
//Convert string to bool:
if (configMap[key].compare("true") == 0)
return true;
else return false;
}
//_____________________________________________________________________________
void ConfigDictionary::SetString(std::string key,std::string value){
//Sets value to key, no comments needed here...
configMap[key] = value;
}
//_____________________________________________________________________________
void ConfigDictionary::SetDouble(std::string key,double value){
//Sets value to key, converts double to string first
std::stringstream ss;
ss<<value;
configMap[key] = ss.str();
}
//_____________________________________________________________________________
void ConfigDictionary::SetInt(std::string key,int value){
//Sets value to key, converts int to string first
std::stringstream ss;
ss<<value;
configMap[key] = ss.str();
}
//_____________________________________________________________________________
void ConfigDictionary::SetBool(std::string key,bool value){
//Sets value to key, converts bool to string first
if (value == true) configMap[key] = "true";
else configMap[key] = "false";
}
#ifndef CONFIGDICTIONARY_H
#define CONFIGDICTIONARY_H
#include "TObject.h"
#include "ReturnCodes.h"
#include "TStopwatch.h"
#include "TROOT.h"
#include <string>
#include <map>
#include <sstream>
#include "TLorentzVector.h"
#include <iostream>
#include "TMath.h"
#include "TString.h"
#include "TTree.h"
class ConfigDictionary{
public:
typedef std::map<std::string,std::string>::iterator CDIter;
ConfigDictionary();
ConfigDictionary(std::string);
virtual ~ConfigDictionary(){};//empty virtual destructor
ClassDef(ConfigDictionary,1);
std::string ToString();
void FromString(std::string);
//These throw errors if couldn't find key:
std::string GetString(std::string)throw(std::string);
int GetInt(std::string)throw(std::string);
double GetDouble(std::string)throw(std::string);
bool GetBool(std::string)throw(std::string);
//These will always set 'something' into map:
void SetString(std::string,std::string);
void SetDouble(std::string,double);
void SetInt(std::string,int);
void SetBool(std::string,bool);
CDIter Begin(){return configMap.begin();};
CDIter End(){return configMap.end();};
private:
std::map<std::string,std::string> configMap;
};
#endif
#ifndef RETURN_CODES_H
#define RETURN_CODES_H
//Some useful return codes
const static int SUCCESS = 0;
const static int IOEXCEPTION = -1;
const static int NOTFOUND = -2;
const static int NULLPOINTER = -3;
const static int UNKNOWN = -4;
const static int FAILURE = -5;
const static int CDEXCEPTION = -6;
const static int EMPTYCONTAINER = -7;
const static int NOTDEFINED = -8;
const static int EXCEPTION = -11;
#endif
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AculRaw;
#pragma link C++ class AculConvert;
#pragma link C++ class AculCalibration;
#pragma link C++ class ConfigDictionary;
#endif
################################################################################
# Be input with some variables
################################################################################
BELIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMathCore -lGpad -lGraf -lPhysics -lGeom #-lAculData -lDetectors -lTELoss
# Add inputs and outputs from these tool invocations to the build variables
BE_HEADERS += \
$(BE)/BeEvent.h \
$(BE)/BePureEvent.h \
$(BE)/BeReaction.h \
$(BE)/BeWork.h \
$(BE)/BinaryReaction.h \
$(BE)/linkdef.h
BECPP_SRCS += \
$(BE)/BeCint.cpp \
$(BE)/BeEvent.cpp \
$(BE)/BePureEvent.cpp \
$(BE)/BeReaction.cpp \
$(BE)/BeWork.cpp \
$(BE)/BinaryReaction.cpp
BEOBJS += \
$(BE)/BeCint.o \
$(BE)/BeEvent.o \
$(BE)/BePureEvent.o \
$(BE)/BeReaction.o \
$(BE)/BeWork.o \
$(BE)/BinaryReaction.o
BECPP_DEPS += \
$(BE)/BeCint.d \
$(BE)/BeEvent.d \
$(BE)/BePureEvent.d \
$(BE)/BeReaction.d \
$(BE)/BeWork.d \
$(BE)/BinaryReaction.d
This diff is collapsed.
This diff is collapsed.
/*
* BePureEvent.cpp
*
* Created on: 6.6.2011
* Author: vratik
*/
#include "BePureEvent.h"
ClassImp(BePureEvent);
BePureEvent::BePureEvent() {
}
BePureEvent::~BePureEvent() {
}
void BePureEvent::FillEvent(BeEvent *expevent) {
// fn[NOESEC]; //doubtful
// fCalCorr[NOESEC]; //doubtful
for (Int_t i = 0; i < NOTEL; i++) {
//time information from Tx2
for (Int_t k = 0; k < NOESEC; k++) {
fTau[i][k] = expevent->fTau[i][k];
}//for k NOESEC
//hits
fNOHits[i] = expevent->fNOHits[i];
fNOaHits[i] = expevent->fNOaHits[i];
fNOpHits[i] = expevent->fNOpHits[i];
fNOtHits[i] = expevent->fNOtHits[i];
for (Int_t j = 0; j < NOSELHITS; j++) {
fSN[i][j] = expevent->fSN[i][j];
fTauSN[i][j] = expevent->fTauSN[i][j];
fRN[i][j] = expevent->fRN[i][j];
fE1Sec[i][j] = expevent->fE1Sec[i][j];
fE1Ring[i][j] = expevent->fE1Ring[i][j];
fE2Sec[i][j] = expevent->fE2Sec[i][j];
fE3Sec[i][j] = expevent->fE3Sec[i][j];
fTheta[i][j] = expevent->fTheta[i][j];
fPhi[i][j] = expevent->fPhi[i][j];
fhTau[i][j] = expevent->fhTau[i][j];
fT[i][j] = expevent->fT[i][j];
fP[i][j] = expevent->fP[i][j];
fID[i][j] = expevent->fID[i][j];
}//for j NOHITS
}//for i NOTEL
for (Int_t i = 0; i < 2*NOSELHITS; i++) {
fPM[i] = expevent->fPM[i];
}
fNOA = expevent->fNOA;
fNOP = expevent->fNOP;
//laboratory system
//6Be
fBeLab = expevent->f6BeLab;
fBeThetaLab = expevent->f6BeThetaLab;
fBePhiLab = expevent->f6BePhiLab;
fBePcLab = expevent->f6BePcLab;
fBeIM = expevent->f6BeIM;
//neutron
fNLab = expevent->fNLab;
fNThetaLab = expevent->fNThetaLab;
fNPhiLab = expevent->fNPhiLab;
fNPcLab = expevent->fNPcLab;
//proton1
fP1Lab = expevent->fP1Lab;
fP1ThetaLab = expevent->fP1ThetaLab;
fP1PhiLab = expevent->fP1PhiLab;
fP1PcLab = expevent->fP1PcLab;
//proton2
fP2Lab = expevent->fP2Lab;
fP2ThetaLab = expevent->fP2ThetaLab;
fP2PhiLab = expevent->fP2PhiLab;
fP2PcLab = expevent->fP2PcLab;
//alpha
fALab = expevent->fALab;
fAThetaLab = expevent->fAThetaLab;
fAPhiLab = expevent->fAPhiLab;
fAPcLab = expevent->fAPcLab;
//protons relative kinetic energy
fPPTrel = expevent->fPPTrel;
//CM system 6Li-p
//6Be
fBeCM1 = expevent->f6BeCM1;
fBeThetaCM1 = expevent->f6BeThetaCM1;
fBePhiCM1 = expevent->f6BePhiCM1;
fBePcCM1 = expevent->f6BePcCM1;
//CM system 6Be
//6Be
fBeCM = expevent->f6BeCM;
fBeThetaCM = expevent->f6BeThetaCM;
fBePhiCM = expevent->f6BePhiCM;
fBePcCM = expevent->f6BePcCM;
//neutron
fNCM = expevent->fNCM;
fNThetaCM = expevent->fNThetaCM;
fNPhiCM = expevent->fNPhiCM;
fNPcCM = expevent->fNPcCM;
//proton1
fP1CM = expevent->fP1CM;
fP1ThetaCM = expevent->fP1ThetaCM;
fP1PhiCM = expevent->fP1PhiCM;
fP1PcCM = expevent->fP1PcCM;
//proton2
fP2CM = expevent->fP2CM;
fP2ThetaCM = expevent->fP2ThetaCM;
fP2PhiCM = expevent->fP2PhiCM;
fP2PcCM = expevent->fP2PcCM;
//alpha
fACM = expevent->fACM;
fAThetaCM = expevent->fAThetaCM;
fAPhiCM = expevent->fAPhiCM;
fAPcCM = expevent->fAPcCM;
//general information
fQLiP = expevent->fQLiP;
fTpp = expevent->fTpp;
fTapp = expevent->fTapp;
fCosThetaTk = expevent->fCosThetaTk;
fTap = expevent->fTap;
fTpap = expevent->fTpap;
fCosThetaYk = expevent->fCosThetaYk;
return;
}
void BePureEvent::Reset() {
//temporarily useless
return;
}
/*
* BePureEvent.h
*
* Created on: 6.6.2011
* Author: vratik
*/
#ifndef BEPUREEVENT_H_
#define BEPUREEVENT_H_
#pragma once
#include <TObject.h>
#include <TLorentzVector.h>
#include "BeEvent.h"
#define NOESEC 16 //number of sectors carrying full dE-E information
#define NOSELHITS 6 //maximal number of hits //navrhuji 8 nebo 3 (zapisujeme pouze udalosti s Be)
#define NOTEL 2 //number of telescopes
class BePureEvent {
public:
// Int_t fTrigger;
// Int_t fn[NOESEC]; //doubtful
// Double_t fCalCorr[NOESEC]; //doubtful
//time information from Tx2
Double_t fTau[NOTEL][NOESEC]; //doubtful //time in ns
//hits
Int_t fNOHits[NOTEL]; //general number of hits searched by energy with dE-E, phi and theta information
Int_t fNOaHits[NOTEL]; //hits searched by energy
Int_t fNOpHits[NOTEL]; //hits searched by energy
Int_t fNOtHits[NOTEL]; //hits searched by time
Int_t fSN[NOTEL][NOSELHITS]; //doubtful
Int_t fTauSN[NOTEL][NOSELHITS]; //doubtful
Int_t fRN[NOTEL][NOSELHITS]; //doubtful
Double_t fE1Sec[NOTEL][NOSELHITS]; //hit energy in 1st layer (sectors) of particular telescope
Double_t fE1Ring[NOTEL][NOSELHITS]; //hit energy in 1st layer (rings) of particular telescope
Double_t fE2Sec[NOTEL][NOSELHITS]; //hit energy in 2nd layer of particular telescope
Double_t fE3Sec[NOTEL][NOSELHITS]; //hit energy in 3rd layer of particular telescope
Double_t fTheta[NOTEL][NOSELHITS];
Double_t fPhi[NOTEL][NOSELHITS];
Double_t fhTau[NOTEL][NOSELHITS]; //hit time
Double_t fT[NOTEL][NOSELHITS]; //hit energy
Double_t fP[NOTEL][NOSELHITS]; //hit impulse
Int_t fID[NOTEL][NOSELHITS]; //particle identificator = ZA; proton==11, alpha==24
Int_t fPM[2*NOSELHITS]; //particle markers
// //6Be information
Int_t fNOA; //number of detected alphas related to triple coincidence Be decay
Int_t fNOP; //number of detected protons related to triple coincidence Be decay
//laboratory system
//6Be
TLorentzVector fBeLab;
Double_t fBeThetaLab; //Theta_lab in rad
Double_t fBePhiLab; //Phi_lab in rad
Double_t fBePcLab; //abs(pc) in MeV
Double_t fBeIM; //invariant mass in MeV
//neutron
TLorentzVector fNLab;
Double_t fNThetaLab; //Theta_lab in rad
Double_t fNPhiLab; //Phi_lab in rad
Double_t fNPcLab; //invariant mass in MeV
//proton1
TLorentzVector fP1Lab;
Double_t fP1ThetaLab; //Theta_lab in rad
Double_t fP1PhiLab; //Phi_lab in rad
Double_t fP1PcLab; //invariant mass in MeV
//proton2
TLorentzVector fP2Lab;
Double_t fP2ThetaLab; //Theta_lab in rad
Double_t fP2PhiLab; //Phi_lab in rad
Double_t fP2PcLab; //invariant mass in MeV
//alpha
TLorentzVector fALab;
Double_t fAThetaLab; //Theta_lab in rad
Double_t fAPhiLab; //Phi_lab in rad
Double_t fAPcLab; //invariant mass in MeV
//protons relative kinetic energy
Double_t fPPTrel;
//CM system 6Li-p
//6Be
TLorentzVector fBeCM1;
Double_t fBeThetaCM1; //Theta_cm in rad
Double_t fBePhiCM1; //Phi_lab in rad
Double_t fBePcCM1; //abs(pc) in MeV
//CM system 6Be
//6Be
TLorentzVector fBeCM;
Double_t fBeThetaCM; //Theta_cm in rad
Double_t fBePhiCM; //Phi_lab in rad
Double_t fBePcCM; //abs(pc) in MeV
//neutron
TLorentzVector fNCM;
Double_t fNThetaCM; //Theta_cm in rad
Double_t fNPhiCM; //Phi_lab in rad
Double_t fNPcCM; //abs(pc) in MeV
//proton1
TLorentzVector fP1CM;
Double_t fP1ThetaCM; //Theta_cm in rad
Double_t fP1PhiCM; //Phi_lab in rad
Double_t fP1PcCM; //abs(pc) in MeV
//proton2
TLorentzVector fP2CM;
Double_t fP2ThetaCM; //Theta_cm in rad
Double_t fP2PhiCM; //Phi_lab in rad
Double_t fP2PcCM; //abs(pc) in MeV
//alpha
TLorentzVector fACM;
Double_t fAThetaCM; //Theta_cm in rad
Double_t fAPhiCM; //Phi_lab in rad
Double_t fAPcCM; //abs(pc) in MeV
//general information
Double_t fQLiP; //Q of the reaction 6Li+p-->6Be+n
Double_t fTpp; //"T" system
Double_t fTapp; //"T" system
Double_t fCosThetaTk; //"T" system
Double_t fTap; //"Y" system
Double_t fTpap; //"Y" system
Double_t fCosThetaYk; //"Y" system
BePureEvent();
virtual ~BePureEvent();
ClassDef(BePureEvent, 1);
void FillEvent(BeEvent *expevent);
void Reset();
};
#endif /* BEPUREEVENT_H_ */
This diff is collapsed.
/*
* BeReaction.h
*
* Created on: 24.5.2010
* Author: Vratislav
*/
//#ifndef BEREACTION_H_
//#define BEREACTION_H_
#pragma once
//#include "DllExport.h"
#include <TObject.h>
#include <TROOT.h>
#include <TRandom3.h>
#include <TF1.h>
#include <TString.h>
#include <TMath.h>
#include <TVector3.h>
#include <TLorentzVector.h>
#include <TLorentzRotation.h>
#include <iostream> //k nicemu
#include <fstream> //k nicemu
#include <iomanip> //k nicemu
#include <sstream> //k nicemu
//#include <string>
#include "BinaryReaction.h"
//#define PARAMETERFILE "sim.par"
using std::cout;
using std::endl;
//using std::string;
//using std::getline;
class BeReaction {
//private:
public:
//1 + 2 --> a + b
BinaryReaction fLip; //6Li + p --> 6Be + n
BinaryReaction fBeDecay; //6Be --> 2p + 4He
BinaryReaction fDipDecay; //2p --> p + p
Int_t fcorrect;
//neni dobre, ze jsou static
static Double_t LipM[4]; //! {E_6Li; E_proton; E_6Be; E_neutron}
static Double_t BeDecayM[4]; //! {E_6Be_g.s.; 0; E_diproton; E_4He}
static Double_t BeStateEnergy[6]; //! {E_g.s. = 0; Gamma_g.s.; E_e.s.; Gamma_e.s.; population ratio; 4He2p threshold}
static Double_t DipDecayM[4]; //! {E_diproton; 0; proton; proton}
// static TRandom3 ranTheta;
static TRandom3 ranMass; //!
static TRandom3 ranTheta; //!
static TF1 theta; //!
static TF1 thetaUniform; //!
static TF1 dipEnergy; //! phase volume
public:
BeReaction();
virtual ~BeReaction();
ClassDef(BeReaction, 1);
void FillProcess(Double_t _LiT, Double_t _LiThetaIn, Double_t _LiPhi);
//using generator
void FillProcess(Double_t _LiT, Double_t _LiThetaIn, Double_t _LiPhi,
Double_t *_p_alpha, Double_t *_p_p1, Double_t *_p_p2,
Double_t _thetaCM);
void FillProcess(Double_t _LiT, Double_t _LiThetaIn, Double_t _LiPhi,
Double_t *_p_alpha, Double_t *_p_p1, Double_t *_p_p2,
Double_t _thetaCMmin, Double_t _thetaCMmax);
// void ReadParameters();
void ReadParameters(const char *parameterfile = "sim.par");
void PrintParameters();
void Reset();
Double_t ThetaCMdistr(Double_t tmin, Double_t tmax) const;
Double_t ThetaCMdistrUniform(Double_t tmin, Double_t tmax) const;
Double_t ThetaCMdistrDiscrete() const;
void SetLipMasses(Double_t _lpm[]);
void SetLipMasses_uniformBeMass(Double_t _lpm[]);
void SetLipMasses_discreteBeMass(Double_t _lpm[]);
void SetBeDecayMasses(Double_t _bdm[]);
void SetDipDecayMasses(Double_t _2pm[]);
//getters in laboratory system
//alpha
Double_t GetAlphaT() const { return fBeDecay.GetTb(); };
Double_t GetAlphaTheta() const { return fBeDecay.GetThetaB(); };
Double_t GetAlphaPhi() const { return fBeDecay.GetPhiB(); };
// TVector3* GetAlphaP();
TVector3 GetAlphaP();
TLorentzVector GetAlpha();
//first proton (higher T)
Double_t GetP1T() const { return (fDipDecay.GetTa() >= fDipDecay.GetTb()) ? fDipDecay.GetTa() : fDipDecay.GetTb(); };
Double_t GetP1Theta() const { return (fDipDecay.GetTa() >= fDipDecay.GetTb()) ? fDipDecay.GetThetaA() : fDipDecay.GetThetaB(); };
Double_t GetP1Phi() const { return (fDipDecay.GetTa() >= fDipDecay.GetTb()) ? fDipDecay.GetPhiA() : fDipDecay.GetPhiB(); };
TVector3 GetP1P();
TLorentzVector GetP1();
//second proton (lower T)
Double_t GetP2T() const { return (fDipDecay.GetTa() <= fDipDecay.GetTb()) ? fDipDecay.GetTa() : fDipDecay.GetTb(); };
Double_t GetP2Theta() const { return (fDipDecay.GetTa() <= fDipDecay.GetTb()) ? fDipDecay.GetThetaA() : fDipDecay.GetThetaB(); };
Double_t GetP2Phi() const { return (fDipDecay.GetTa() <= fDipDecay.GetTb()) ? fDipDecay.GetPhiA() : fDipDecay.GetPhiB(); };
TVector3 GetP2P();
TLorentzVector GetP2();
//neutron
Double_t GetNeutronT() const { return fLip.GetTb(); };
Double_t GetNeutronTheta() const { return fLip.GetThetaB(); };
Double_t GetNeutronPhi() const { return fLip.GetPhiB(); };
// TVector3* GetNeutronP();
TVector3 GetNeutronP();
TLorentzVector GetNeutron();
//6Be
Double_t GetBeT() const { return fLip.GetTa(); };
Double_t GetBeTheta() const { return fLip.GetThetaA(); };
Double_t GetBePhi() const { return fLip.GetPhiA(); };
TVector3 GetBeP();
TLorentzVector GetBe();
//getters
BinaryReaction* GetLip() { return &fLip; };
BinaryReaction* GetBeDecay() { return &fBeDecay; };
BinaryReaction* GetDipDecay() { return &fDipDecay; };
//diagnostics
UInt_t GetMSeed() const { return ranMass.GetSeed(); };
// UInt_t GetTSeed() const { return ranTheta.GetSeed(); };
UInt_t GetLipPhiSeed() const { return fLip.GetPSeed(); };
UInt_t GetBePhiSeed() const { return fBeDecay.GetPSeed(); };
UInt_t GetDipPhiSeed() const { return fDipDecay.GetPSeed(); };
//physics
Double_t T(Double_t pc2, Double_t mc2); //v podstate taktez
Double_t E(Double_t pc2, Double_t mc2); //v podstate taktez
};
//#endif /* BEREACTION_H_ */
This diff is collapsed.
/*
* BeWork.h
*
* Created on: 2.2.2010
* Author: Vratislav
*/
//#ifndef BEWORK_H_
//#define BEWORK_H_
#pragma once
#include <TObject.h>
#include <TString.h>
#include <TFile.h>
#include <TTree.h>
#include <TChain.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoBBox.h>
#include <TGeoTube.h>
#include <TGeoTrd1.h>
#include <TGeoBoolNode.h>
#include <TGeoCompositeShape.h>
#include <TLorentzVector.h>
#include <TUnixSystem.h>
//#include <TMemFile.h>
#include "BeEvent.h"
#include "BeReaction.h"
#include "BePureEvent.h"
#include "../AculData/AculCalibration.h"
#include "../AculData/ConfigDictionary.h"
#include "../TELoss/TELoss.h"
#ifndef __CINT__
#endif /* __CINT __ */
#include <stdarg.h>
using std::flush;
class BeWork {
private:
//public:
// TELosses:
TELoss *fSiAlpha; //!
TELoss *fSiP; //!
TELoss *fCsIAlpha; //!
TELoss *fCsIP; //!
TELoss *fTargetAlpha; //!
TELoss *fTargetP; //!
TELoss *fTargetLi; //!
TELoss *fTargetWinAlpha; //!
TELoss *fTargetWinP; //!
TELoss *fTargetWinLi; //!
//configuration and parameter files
TString fConfigFile; //!
TString fWorkDir; //!
TString fRawFilePath; //!
// TString fCutFile; //!
Bool_t fBeOnly;
//parameter used for choice of generator
Double_t fsRatioMin; //!
Double_t fsRatioMax; //!
//parameters
//detectors resolution used in simulation
Double_t fSiRes; //! in MeV, sigma in Si detectors
Double_t fCsIResP; //! in %, FWHM in CsI for protons
Double_t fCsIBestResP; //! in MeV, the best absolute resolution in CsI for protons
Double_t fCsIResA; //! in %, FWHM in CsI for alphas
Double_t fCsIBestResA; //! in MeV, the best absolute resolution in CsI for alphas
//beam characteristics, used in MC
Double_t fTBeamMC; //! in AMeV //where is it? in the centre? on the target window?
Double_t fTBeamResMC; //! in MeV, sigma for gaus
Double_t fBeamX_MC; //! in cm, x position of beam at target
Double_t fBeamY_MC; //! in cm, x position of beam at target
Double_t fBeamX_sigma_MC; //! in cm; x position sigma of beam at target
Double_t fBeamY_sigma_MC; //! in cm; x position sigma of beam at target
Double_t fT1SimPosition; //! position of the first telescope in cm; used in MC
Double_t fT2SimPosition; //! position of the second telescope in cm; used in MC
//detector thicknesses in mcm
Double_t fX11_FD; //!
Double_t fX11; //!
Double_t fX11_BD; //!
Double_t fX12_FD; //!
Double_t fX12; //!
Double_t fX12_BD; //!
//#define XD13F 14. //fixme original value probably in Si equivalent
Double_t fX13_FD; //!
Double_t fX21_FD; //!
Double_t fX21; //!
Double_t fX21_BD; //!
Double_t fX22_FD; //!
Double_t fX22; //!
Double_t fX22_BD; //!
//#define XD23F 14. //fixme original value probably in Si equivalent
Double_t fX23_FD; //!
private:
// static TRandom3 ranPosition;
static void printProgBar(Int_t percent);
static void printProgBar(Int_t i, Int_t inputs);
void CreateTELosses();
void SetWorkDir();
public:
BeWork();
BeWork(const char* configfile);
BeWork(BeWork &);
virtual ~BeWork();
ClassDef(BeWork, 1);
void ReadConfigFile();
const char* GetWorkDir();
//experimental data analysis
// Int_t FillExpRun();
Int_t FillExpFile(const char* inputrawfile, const char* outputfile,
Long64_t noevents = 0, Option_t *opt = ""); //experimental data processing
Int_t FillBeExpFile(const char *inputfile, const char* outputfile, Long64_t noevents = 0);
//simulations
void FillSimFile(const char* outputfile, const Int_t noevents,
const char* generator = "", Option_t *opt = "CREATE",
Double_t beThetaMin = 0., Double_t beThetaMax = TMath::Pi(),
UInt_t gseed = 0/*, const char* cutfile = ""*/); //simulation of measured variables using BinaryReaction class
Int_t FillBeSimFile(const char *inputfile, const char* outputfile, Long64_t noevents = 0);
static void MixSimBeFiles(const Int_t infiles, const char* treename, ...);
TGeoManager* BuildGeometry(); //using cm size unit
static TGeoVolume* MakeAnnularDetector(Int_t nosec, Int_t norings,
Double_t siThickness, Double_t frontdl, Double_t backdl);
static TGeoVolume* MakeCsIDetector();
static TGeoVolume* MakeCsIDetectorMS(TString name);
static TGeoVolume* MakeTarget();
void ParticleTracking(const TLorentzVector *particle, const Int_t pID,
TGeoManager *geom, BeEvent *event = 0, TRandom3 *detres = 0,
Double_t beamX = 0., Double_t beamY = 0., Double_t beamZ = 0.);
void MonteCarloState(const Int_t noevents, const char* generator,
TTree *writetree, BeEvent *besimevent, TGeoManager *geometry,
TTree* beampos, Double_t reactionAngleMin,
Double_t reactionAngleMax, UInt_t gseed);
//could be one function, just using the switch between the sources of simulated events
//fill the file with kinematical information only by simulated events
void FillSimKinFile(Int_t INPUTS = 0,
Double_t beamtheta = 0., Double_t beamphi = 0.,
const char* outputfile = "collision.root",
Option_t *opt = "CREATE"); //simulation of kinematic variables using BinaryReaction class; opt: file access option
void FillSimKinFile(const char* generator, Int_t INPUTS = 0,
Double_t beamtheta = 0., Double_t beamphi = 0.,
const char* outputfile = "collision_g.root",
Option_t *opt = "CREATE"); //simulation of kinematic variables using G. generator; opt: file access option
//general functions
Int_t FillBeFile(const char* inputfile, Long64_t noevents,
const char* rtree, const char* rbranch, const char* outputfile,
const char* wtree, const char* wbranch, Option_t *opt = ""); //file with Be event only data processing
static TTree* OpenTree(const char* inputfile, const char* treename,
const Color_t col = 1, const char* friendtreename = "");
static TChain* OpenChain(const char* inputfile, int first, int last,
const char* treename, const Color_t color = 1, const char* friendtreename = "", Option_t* option = "");
static Double_t CmToMic() { return 10000.; };
static Double_t MicToCm() { return 0.0001; };
static Int_t CountLines(const char* file, Int_t maxlinelength = 1000);
};
//#endif /* BEWORK_H_ */
/*
* BinaryReaction.cpp
*
* Created on: 24.5.2010
* Author: Vratislav
*/
#include "BinaryReaction.h"
BinaryReaction::BinaryReaction() {
}
BinaryReaction::~BinaryReaction() {
}
ClassImp(BinaryReaction);
//TRandom3 *ranpokus = new TRandom3(1);
TRandom3 BinaryReaction::ranPhi(1);
Int_t BinaryReaction::FillReaction(Double_t _fThetaIn, Double_t _fT1, Double_t _fM[], Double_t _fThetaCM, Double_t _fPhiIn)
{
//_fThetaIn in rad
//_fT1 in MeV
//_fM[] in MeV
//_fThetaCM in rad
//_fPhiIn in rad
fThetaIn = _fThetaIn;
fT1 = _fT1;
for (Int_t i = 0; i < 4; i++) {
fM[i] = _fM[i];
}
fThetaCM = _fThetaCM;
fPhiIn = _fPhiIn;
if (FlatCalculate() != 1) { return -1; }
SetPhi();
//SetOrientation();
SetOrientationV();
return 1;
}
Int_t BinaryReaction::FlatCalculate()
{
const Double_t p1 = Sqrt(Power(fT1, 2) + 2*fT1*fM[0]); //in MeV
const Double_t E = fT1 + fM[0] + fM[1]; //in MeV
//beta and gamma for Lor. trans.
const Double_t beta = p1/E;
const Double_t gamma = 1/Sqrt(1 - Power(beta, 2));
//calculating of T3cm and T4cm
//T3cm = ( Tcm^2 + 2*Tcm*m4*c^2 )/(2*( Tcm + m4*c^2 + m3*c^2 )), where Tcm = T3cm + T4cm
//Ecm = Tcm + m3*c^2 + m4*c^2
//Ecm^2 = E^2 - (p1*c)^2, where E = T1 + m1*c^2 + m2*c^2 and (p1*c)^2 = T1^2 + 2T1*m1*c^2
Double_t Ecm = 0.; //energy in CMS, MeV
Double_t Tcm = 0.; //summary kinetic energy in CMS, MeV
Double_t TaCM = 0., TbCM = 0.;
Double_t pcm = 0.; //impuls in CMS, MeV
Ecm = Sqrt( Power(E, 2) - Power(p1, 2) );
// Tcm = Sqrt( Power(fM[0]+fM[1], 2) + 2*fT1*fM[1] ) - fM[2] - fM[3];
// cout << Tcm << endl;
Tcm = Ecm - fM[2] - fM[3];
// cout << Tcm << endl;
static Int_t counter = 0;
// cout << Tcm << endl;
if (Tcm < 0) {
counter++;
//cout << "\nThere is no solution, Tcm is smaller than threshold energy\n";
Warning("FlatCalculate", "%s: No solution, Tcm is smaller than threshold E", GetName());
cout << "Tcm is " << Tcm << endl
<< "Ecm is " << Ecm << endl
<< "fTa is " << fTa << endl
<< "fTb is " << fTb << endl
<< "fM[0] is " << fM[0] << endl
<< "m_dp is " << 2*fM[2] << endl
<< "fT1 is " << fT1 << endl
<< "E is " << E << endl;
printf("\n\n!!!!!!!!!\t%d\t!!!!!!!!!!!\n\n", counter);
return -1;
}
TaCM = ( Power(Tcm, 2) + 2*Tcm*fM[3] )/( 2*(Tcm + fM[3] + fM[2]) );
TbCM = ( Power(Tcm, 2) + 2*Tcm*fM[2] )/( 2*(Tcm + fM[3] + fM[2]) );
//p3cm = -p4cm ==> |p3cm| = |p4cm| = pcm, (pcm*c)^2 = T3cm^2 + 2*T3cm*m3*c^2
pcm = Sqrt( Power(TaCM, 2) + 2*TaCM*fM[2] );
//Lorentz transformation of impuls from CMS to Lab:
Double_t pax, pay, pbx, pby; //in MeV
Double_t EaCM, EbCM; //in MeV
Double_t paq = 0., pbq = 0.; //in MeV
//evaluate of T3
EaCM = TaCM + fM[2];
pay = pcm*Sin(fThetaCM);
pax = gamma*(pcm*Cos(fThetaCM) + beta*EaCM);
paq = Power(pax, 2) + Power(pay, 2);
fTa = Sqrt( Power(fM[2], 2) + paq ) - fM[2];
//evaluate of T4
EbCM = TbCM + fM[3];
pby = pcm*Sin(fThetaCM + TMath::Pi());
pbx = gamma*(pcm*Cos(fThetaCM + TMath::Pi()) + beta*EbCM);
pbq = Power(pbx, 2) + Power(pby, 2);
fTb = Sqrt( Power(fM[3], 2) + pbq ) - fM[3];
//calculating of theta3 and theta4
//cotg(theta3) = 0 ==> theta3 = pi/2, cotg(alfa) = 1/tg(alfa)
//tg(theta3) = ( pcm*sin(thetacm) )/( gamma*(pcm*cos(thetacm) + beta*Ecm/c) );
if ( ( pcm*Sin(fThetaCM) )/( gamma*(pcm*Cos(fThetaCM) + beta*Sqrt(Power(pcm, 2) + Power(fM[2], 2))) ) > 10000000 ) { //the upper member of the cotg(theta)
fThetaA = TMath::Pi()/2;
}
else {
fThetaA = ATan( (pcm*Sin(fThetaCM))/(gamma*(pcm*Cos(fThetaCM) + beta*Sqrt(Power(pcm, 2) + Power(fM[2], 2)))) );
if (fThetaA < 0) {
fThetaA = fThetaA + TMath::Pi();
}
}
if ( ( pcm*Sin(TMath::Pi() - fThetaCM) )/( gamma*(pcm*Cos(TMath::Pi() - fThetaCM) + beta*Sqrt(Power(pcm, 2) + Power(fM[3], 2))) ) > 10000000 ) { //the upper member of the cotg(theta)
fThetaB = TMath::Pi()/2;
}
else {
fThetaB = ATan( (pcm*Sin(TMath::Pi() - fThetaCM))/(gamma*(pcm*Cos(TMath::Pi() - fThetaCM) + beta*Sqrt(Power(pcm, 2) + Power(fM[3], 2)))) );
if (fThetaB < 0) {
fThetaB = fThetaB + TMath::Pi();
}
}
return 1;
}
void BinaryReaction::SetPhi()
{
//PhiA and PhiB assignment
//fPhiA = ranpokus->Uniform(0., 2.*TMath::Pi());
/*fPhiA = ranPhi.Uniform(0., 2.*TMath::Pi());
if ( fPhiA < TMath::Pi() ) { fPhiB = fPhiA + TMath::Pi(); }
else { fPhiB = fPhiA - TMath::Pi(); }*/
fPhiA = ranPhi.Uniform(0., 2.*TMath::Pi());
fPhiB = fPhiA - TMath::Pi();
}
void BinaryReaction::SetOrientation()
{
if (fThetaA + fThetaIn <= TMath::Pi()) {
fThetaA = fThetaA + fThetaIn;
}
else {
fThetaA = 2*TMath::Pi() - fThetaA + fThetaIn;
if ( fPhiA < TMath::Pi() ) { fPhiA = fPhiA + TMath::Pi(); }
else { fPhiA = fPhiA - TMath::Pi(); }
}
if (fPhiA + fPhiIn > 2*TMath::Pi()) { fPhiA = fPhiA + fPhiIn - 2*TMath::Pi(); }
else { fPhiA = fPhiA + fPhiIn; }
if (fThetaB - fThetaIn >= 0) {
fThetaB = fThetaB - fThetaIn;
}
else {
fThetaB = -1*(fThetaB - fThetaIn);
if ( fPhiB < TMath::Pi() ) { fPhiB = fPhiB + TMath::Pi(); }
else { fPhiB = fPhiB - TMath::Pi(); }
}
if (fPhiB + fPhiIn > 2*TMath::Pi()) { fPhiB = fPhiB + fPhiIn - 2*TMath::Pi(); }
else { fPhiB = fPhiB + fPhiIn; }
}
void BinaryReaction::SetOrientationV()
{
//z' parallel to rdirection; x' is in theta_rdirection plane; y' perpendicular
TVector3 rdirection(0,0,1);
rdirection.SetTheta(fThetaIn);
rdirection.SetPhi(fPhiIn);
//rdirection.SetMag(1.);
TVector3 a(1);
a.SetTheta(fThetaA);
a.SetPhi(fPhiA);
//a.SetMag(1.);
TVector3 b(1);
b.SetTheta(fThetaB);
b.SetPhi(fPhiB);
//b.SetMag(1.);
a.RotateUz(rdirection);
b.RotateUz(rdirection);
fThetaA = a.Theta();
fPhiA = a.Phi();
fThetaB = b.Theta();
fPhiB = b.Phi();
}
void BinaryReaction::Reset()
{
for (Int_t i = 0; i <= 3; i++) {
fM[i] = 0.;
}
fThetaIn = 0.;
fPhiIn = 0.;
fT1 = 0.;
fThetaCM = 0.;
fTa = 0.;
fTb = 0.;
fThetaA = 0.;
fThetaB = 0.;
fPhiA = 0.;
fPhiB = 0.;
return;
}
Double_t BinaryReaction::GetXa(Double_t z)
{
//univerzalni cast
TVector3 v(1., 1., 1.);
v.SetPhi(fPhiA);
v.SetTheta(fThetaA);
// pokud je Theta == pi/2 ==> nejaky jiny vystup
if (v.CosTheta()*z <= 0) { return 0.; }
v.SetMag(TMath::Abs(z/v.CosTheta()));
return v.X();
}
Double_t BinaryReaction::GetYa(Double_t z)
{
//univerzalni cast
TVector3 v(1., 1., 1.);
v.SetPhi(fPhiA);
v.SetTheta(fThetaA);
// pokud je Theta == pi/2 ==> nejaky jiny vystup
if (v.CosTheta()*z <= 0) { return 0.; }
v.SetMag(TMath::Abs(z/v.CosTheta()));
return v.Y();
}
Double_t BinaryReaction::GetXb(Double_t z)
{
//univerzalni cast
TVector3 v(1., 1., 1.);
v.SetPhi(fPhiB);
v.SetTheta(fThetaB);
// pokud je Theta == pi/2 ==> nejaky jiny vystup
if (v.CosTheta()*z <= 0) { return 0.; }
v.SetMag(TMath::Abs(z/v.CosTheta()));
return v.X();
}
Double_t BinaryReaction::GetYb(Double_t z)
{
//univerzalni cast
TVector3 v(1., 1., 1.);
v.SetPhi(fPhiB);
v.SetTheta(fThetaB);
// pokud je Theta == pi/2 ==> nejaky jiny vystup
if (v.CosTheta()*z <= 0) { return 0.; }
v.SetMag(TMath::Abs(z/v.CosTheta()));
return v.Y();
}
/*
* BinaryReaction.h
*
* Created on: 24.5.2010
* Author: Vratislav
*/
//#ifndef BEBINARYREACTION_H_
//#define BEBINARYREACTION_H_
#pragma once
//#include "DllExport.h"
#include <iostream>
#include <TObject.h>
#include <TNamed.h>
#include <TROOT.h>
#include <TMath.h>
#include <TRandom3.h>
#include <TVector3.h>
using std::cout;
using std::endl;
using TMath::Sqrt;
using TMath::Power;
using TMath::Sin;
using TMath::Cos;
using TMath::ATan;
class BinaryReaction : public TNamed {
private:
Double_t fM[4]; //in MeV
//in laboratory system
Double_t fThetaIn; //in rad
Double_t fPhiIn; //in rad
Double_t fT1; //in MeV
//in CM system
Double_t fThetaCM; //in rad
//in laboratory system
Double_t fTa; //in MeV
Double_t fTb; //in MeV
Double_t fThetaA; //in rad
Double_t fThetaB; //in rad
Double_t fPhiA; //in rad
Double_t fPhiB; //in rad
static TRandom3 ranPhi; //!
public:
BinaryReaction();
virtual ~BinaryReaction();
ClassDef(BinaryReaction, 1);
Double_t GetThetaCM() const { return fThetaCM; };
Double_t GetThetaA() const { return fThetaA; };
Double_t GetPhiA() const { return fPhiA; };
Double_t GetTa() const { return fTa; };
Double_t GetMa() const { return fM[2]; };
Double_t GetThetaB() const { return fThetaB; };
Double_t GetPhiB() const { return fPhiB; };
Double_t GetTb() const { return fTb; };
Double_t GetMb() const { return fM[3]; };
Double_t GetXa(Double_t z); //get X projection in focal plane XY + z
Double_t GetXb(Double_t z); //get X projection in focal plane XY + z
Double_t GetYa(Double_t z); //get Y projection in focal plane XY + z
Double_t GetYb(Double_t z); //get Y projection in focal plane XY + z
Int_t FillReaction(Double_t _fThetaIn, Double_t _fT1, Double_t _fM[], Double_t _fThetaCM, Double_t _fPhi);
//osetrit zadavani parametru, ktere maji fyzikalni smysl
//vsude hlidat signum energie
//void FillInput(Double_t _fThetaIn, Double_t _fT1, Double_t _fM[], Double_t _fThetaCM, Double_t fPhi);
Int_t FlatCalculate(); //calculate theta A and B for phi = 0 in reaction frame //predelat pomoci vektoru, pravdepodobne velmi pomala fce
void SetPhi(); //random choice of phi in reaction frame
void SetOrientation(); //does not work properly
void SetOrientationV(); //transform thetas and phis from reaction frame into laboratory frame
//taking into account the projectile flying direction
void SetPhiA(Double_t phia) { fPhiA = phia; }
void SetPhiB(Double_t phib) { fPhiB = phib; }
void SetThetaA(Double_t thetaa) { fThetaA = thetaa; }
void SetThetaB(Double_t thetab) { fThetaB = thetab; }
void SetTa(Double_t ta) { fTa = ta; }
void SetTb(Double_t tb) { fTb = tb; }
void SetM(Int_t i, Double_t m) { fM[i] = m; }
void Reset();
//diagnostics
UInt_t GetPSeed() const { return ranPhi.GetSeed(); };
};
//#endif /* BEBINARYREACTION_H_ */
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class BeEvent;
#pragma link C++ class BeWork;
#pragma link C++ class BinaryReaction;
#pragma link C++ class BeReaction;
#pragma link C++ class BePureEvent;
#endif
//////////////////////////////////////////////////////////
// //
// AnnularDetector //
// //
//
//Some description of this very useful class,
//its properties and a short example how to
//use it. This text may be partly used in
//PhD thesis.
//
//Description of the detector itself.
//
// //
//////////////////////////////////////////////////////////
#include "AnnularDetector.h"
ClassImp(AnnularDetector);
TRandom3 AnnularDetector::ranTheta(1);
TRandom3 AnnularDetector::ranPhi(1);
AnnularDetector::AnnularDetector()
{
}
AnnularDetector::~AnnularDetector()
{
}
Int_t AnnularDetector::GetChMultiplicity(Bool_t sec)
{
//Calculate the number of strips which detected signal in one event
Int_t mult = 0;
if (sec == 1) {
for (Int_t i = 0; i < 32; i++) {
if (fChSec[i] != 0) { mult++; }
}
}
else {
for (Int_t i = 0; i < 32; i++) {
if (fChRing[i] != 0) { mult++; }
}
}
return mult;
}
Int_t AnnularDetector::GetEMultiplicity(Bool_t sec)
{
//Calculate the number of strips which detected signal over particular energy threshold in one event
Int_t mult = 0;
if (sec == 1) {
for (Int_t i = 0; i < 32; i++) {
if (fESec[i] > 0) { mult++; }
}
}
else {
for (Int_t i = 0; i < 32; i++) {
if (fERing[i] > 0) { mult++; }
}
}
return mult;
}
Int_t AnnularDetector::Reset()
{
//Reset variables with energy and angle information
for (Int_t i = 0; i < 32; i++) {
fChRing[i] = 0;
fChSec[i] = 0;
fERing[i] = 0.;
fESec[i] = 0.;
}
fMultChRing = 0;
fMultChSec = 0;
fMultERing = 0;
fMultESec = 0;
return 0;
}
Int_t AnnularDetector::FindSec()
{
//Find first sector where E != 0
Int_t i = 0;
for (i = 0; i < fSecNumber; i++) {
if (fESec[i] > 0.) { break; }
}
if (i == fSecNumber) {
return (-1);
}
return i;
}
Int_t AnnularDetector::FindRing()
{
//Find first ring where E != 0
if (fDSD == kFALSE) { Warning("FindRing", "May not be used for this detector (SSD)"); }
Int_t i = 0;
for (i = 0; i < fRingsNumber; i++) {
if (fERing[i] > 0.) { break; }
}
if (i == fRingsNumber) {
return -1;
}
return i;
}
Double_t AnnularDetector::GetTheta(Int_t ring)
{
//Get the angle theta in radians which was measured in the ring.
if (ring >= fRingsNumber) {
Warning("GetTheta", "Number of rings in this detector is equal to %d.", fRingsNumber);
return 0.; //zamyslet se
}
if (ring < 0) {
Warning("GetTheta", "You cannot input negative ring number.");
return 0.; //zamyslet se
}
Double_t theta;
theta = TMath::ATan(( fInnerR + ( ring+ranTheta.Uniform(1) )*(fOuterR - fInnerR)/fRingsNumber )/fZ);
return theta;
}
Double_t AnnularDetector::GetPhi(Int_t sec)
{
//Get the angle phi in radians which was measured in the sector sec.
if (sec >= fSecNumber) {
Warning("GetPhi", "Number of sectors in this detector is equal to %d.", fRingsNumber);
return -1.; //zamyslet se
}
if (sec < 0) {
Warning("GetPhi", "You cannot input negative sector number.");
return -1.; //zamyslet se
}
// Double_t theta;
// theta = TMath::ATan(( fInnerR + ( ring+ranTheta.Uniform(1) )*(fOuterR - fInnerR)/fRingsNumber )/fZ);
return (2*TMath::Pi()/fSecNumber)*( sec + ranTheta.Uniform(1) );
}
Double_t AnnularDetector::GetX(Int_t ring, Int_t sec) {
TVector2 flat; //vector in detector plane
Double_t r = fInnerR + ( ring+ranTheta.Uniform(1) )*(fOuterR - fInnerR)/fRingsNumber;
// Double_t phi = 2 * TMath::Pi()
// - (2*TMath::Pi()/fSecNumber)*( sec + ranTheta.Uniform(1) )
// - TMath::Pi() / 2.;
Double_t phi = //2 * TMath::Pi()
- (2 * TMath::Pi() / fSecNumber) * (sec + ranTheta.Uniform(1))
+ TMath::Pi() / 2.;
// printf("sec: %d\tphi: %3.2f\n", sec, phi);
flat.SetMagPhi(r, phi);
// printf("sec: %d\tphi: %3.2f\tphiV: %3.2f\t\t", sec, phi*TMath::RadToDeg(), flat.Phi()*TMath::RadToDeg());
return flat.X();
}
Double_t AnnularDetector::GetY(Int_t ring, Int_t sec) {
TVector2 flat; //vector in detector plane
Double_t r = fInnerR + ( ring+ranTheta.Uniform(1) )*(fOuterR - fInnerR)/fRingsNumber;
Double_t phi = //2 * TMath::Pi()
- (2*TMath::Pi()/fSecNumber)*( sec + ranTheta.Uniform(1) )
+ TMath::Pi() / 2.;
flat.SetMagPhi(r, phi);
return flat.Y();
}
void AnnularDetector::InitDetector(Bool_t dsd, Int_t nosecs, Int_t norings,
Double_t innerr, Double_t outerr, Double_t thick,
Double_t deadthick, Double_t z)
{
//dsd = 1 for DSSD; dsd = 0 for SSSD
//nosecs - number of sectors
//norings - number of rings
//innerr - inner radius in mm
//outerr - outer radius in mm
//thick - thickness of the detector in microns
//deadthick - thickness of the dead layer in microns
//z - distance of the detector from the target
SetDSD(dsd);
SetSecNumber(nosecs);
if (fDSD == 1) { SetRingsNumber(norings); }
SetInnerR(innerr);
SetOuterR(outerr);
SetThickness(thick);
SetDeadLayerThickness(deadthick);
SetZ(z);
return;
}
/*
* AnnularDetector.h
*
* Created on: 8.12.2009
* Author: Vratislav
*/
#pragma once
#include <TObject.h>
#include <TMath.h>
#include <TRandom3.h>
#include <TVector2.h>
//docasne
#include<iostream>
using std::cout;
using std::endl;
class AnnularDetector /*: public TObject*/ {
private:
/////vsechno se bude zadavat ze souboru
Bool_t fDSD; //!
Int_t fRingsNumber; //!
Int_t fSecNumber; //!
Double_t fInnerR; //! //mm, sensitive region
Double_t fOuterR; //! //mm, sensitive region
Double_t fThickness; //! //mcm
Double_t fDeadLayerThickness; //! //mcm,
Double_t fZ; //! //mm
// Double_t fPhi[32]; //
static TRandom3 ranTheta;
static TRandom3 ranPhi;
public: //docasne verejne
Int_t fChSec[32];
Int_t fChRing[32];
Double_t fESec[32];
Double_t fERing[32];
public:
Int_t fMultChSec;
Int_t fMultChRing;
Int_t fMultESec;
Int_t fMultERing;
public:
AnnularDetector();
virtual ~AnnularDetector();
void SetDSD(Bool_t dsd) { fDSD = dsd; } //prakticky vsechny settery
void SetRingsNumber(Int_t norings) { fRingsNumber = norings; } //jsou v rootu virtual
void SetSecNumber(Int_t nosec) { fSecNumber = nosec; }
void SetInnerR(Double_t r1) { fInnerR = r1; }
void SetOuterR(Double_t r2) { fOuterR = r2; }
void SetThickness(Double_t x) { fThickness = x; }
void SetDeadLayerThickness(Double_t dx) { fDeadLayerThickness = dx; }
void SetZ(Double_t z) { fZ = z; }
void InitDetector(Bool_t dsd, Int_t nosecs, Int_t norings,
Double_t innerr, Double_t outerr, Double_t thick,
Double_t deadthick, Double_t z); //dsd, nor, nos, ir(mm), or(mm), x(mcm), xdead(mcm), z(mm)
Int_t GetSecNumber() { return fSecNumber; }
Int_t GetRingsNumber() { return fRingsNumber; }
Double_t GetThickness() { return fThickness; }
Double_t GetDeadLayerThickness() { return fDeadLayerThickness; }
Double_t GetZPosition() { return fZ; }
Int_t GetChMultiplicity(Bool_t sec = 1);
Int_t GetEMultiplicity(Bool_t sec = 1);
Int_t Reset(); //reset information relating to particular event
Int_t FindSec(); //returns first sector where E != 0, returns -1 if E == 0 for all sectors
Int_t FindRing(); //returns first ring where E != 0, returns -1 if E == 0 for all rings
Double_t GetTheta(Int_t ring);
Double_t GetPhi(Int_t sec);
Double_t GetX(Int_t ring, Int_t sec);
Double_t GetY(Int_t ring, Int_t sec);
ClassDef(AnnularDetector, 1);
};
################################################################################
# Detectors input with some variables
################################################################################
DETECTORSLIBS := -lCint -lCore -lMathCore
# Add inputs and outputs from these tool invocations to the build variables
DETECTORS_HEADERS += \
$(DETECTORS)/AnnularDetector.h \
$(DETECTORS)/linkdef.h
DETECTORSCPP_SRCS += \
$(DETECTORS)/AnnularDetector.cpp \
$(DETECTORS)/DetectorsCint.cpp
DETECTORSOBJS += \
$(DETECTORS)/AnnularDetector.o \
$(DETECTORS)/DetectorsCint.o
DETECTORSCPP_DEPS += \
$(DETECTORS)/AnnularDetector.d \
$(DETECTORS)/DetectorsCint.d
################################################################################
# Detectors input with some variables
################################################################################
DETECTORSLIBS := -lCint -lCore -lMathCore
# Add inputs and outputs from these tool invocations to the build variables
DETECTORSCPP_SRCS += \
./AnnularDetector.cpp \
./DetectorsCint.cpp
DETECTORSOBJS += \
./AnnularDetector.o \
./DetectorsCint.o
DETECTORSCPP_DEPS += \
./AnnularDetector.d \
./DetectorsCint.d
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AnnularDetector;
#endif
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AnnularDetector;
//#pragma link C++ class AculConvert;
//#pragma link C++ class AculCalibration;
//#pragma link C++ class AculCalibratedEvent;
#endif
This diff is collapsed.
This diff is collapsed.
#pragma once
#include <TROOT.h>
#include <TObject.h>
#include <TSpline.h>
#include <TArrayD.h>
#include <TMath.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using std::cout;
using std::endl;
class TELoss : public TObject
{
private:
int mel;
int nel;
TArrayD zel, ael, wel;
double den;
double zp,ap;
int ne;
TArrayD etab, rtab, detab; //tables: energy, range, deltaE
double zw,aw;
double a, b; //linear interpolation coeficients, y = a*x + b
int bsearch(int ntab, double *xtab, double x);
double aitken(int ntab, double *xtab, double *ytab, double x);
double aitken3(int ntab, double *xtab, double *ytab, double x);
Double_t linear(int ntab, Double_t *xtab, Double_t *ytab, double x);
Double_t linear(int ntab, Double_t *xtab, Double_t *ytab, Int_t i0, double x);
public:
TELoss(void);
TELoss(int _mel, double _den);
TELoss(TELoss &);
virtual ~TELoss(void);
void SetEL(int _mel, double _den);
void SetDen(double _den) {den = _den;}
int AddEL(double _zel, double _ael, double _wel=1.);
void SetZP(double _zp, double _ap);
void SetEtab(int _ne, double e2); //from 0 MeV to e2 MeV, _ne elements
void SetDeltaEtab(double r); //pro kazdou tlostku bude zvlastni tabulka, nebo taky ne
double GetZ() { return zp; };
double GetA() { return ap; };
double GetE(double e0, double r);
double GetE0dE(double de, double r); //de in MeV, r in microns
double GetE0dE(double de); //de in MeV
double GetE0(double e, double r);
double GetEold(double e0, double r);
double GetE0old(double e, double r);
double GetR(double e0, double e);
double GetRold(double e0, double e);
void PrintRE();
void PrintdEE();
void PrintREtoFile();
void PrintdEEtoFile(const char* outfile = "outputdEE.txt");
ClassDef(TELoss, 1)
};
################################################################################
# TELoss input with some variables
################################################################################
TELOSSLIBS := -lCore -lCint -lMathCore -lMatrix -lHist -lgfortran
# Add inputs and outputs from these tool invocations to the build variables
TELOSSCPP_SRCS += \
$(TELOSS)/TELoss.cpp \
$(TELOSS)/TELossCint.cpp
TELOSSOBJS += \
$(TELOSS)/ELOSS.o \
$(TELOSS)/TELoss.o \
$(TELOSS)/TELossCint.o
TELOSSCPP_DEPS += \
$(TELOSS)/TELoss.d \
$(TELOSS)/TELossCint.d
{
gSystem->Load("/media/commondata/work/Eclipse/TELoss/Debug/libTELoss.so");
// TELoss target;
TELoss mSi;
TELoss mSi3;
// target.SetEL(1, 0.0014625);
// target.AddEL(1., 3., 1.);
// target.SetZP(1., 1.);
// target.SetEtab(1000, 0., 50.);
mSi.SetEL(1, 2.321);
mSi.AddEL(14., 28.086, 1);
// mSi.SetZP(1., 1.); //protony
mSi.SetZP(2., 4.); //alfy
mSi.SetEtab(100000, 200.); //deltaE
mSi.SetDeltaEtab(300);
mSi3.SetEL(1, 2.321);
mSi3.AddEL(14., 28.086, 1);
// mSi3.SetZP(1., 1.); //protony
mSi3.SetZP(2., 3.); //3He
mSi3.SetEtab(100000, 200.); //deltaE
mSi3.SetDeltaEtab(300);
// TCanvas *c1 = new TCanvas("jmeno", "titulek", 617, 0, 1058, 972);
// mSi.PrintdEEtoFile("out.txt");
// TGraph *gr1 = new TGraph("out.txt");
// gr1->Draw("A*");
//
// mSi3.PrintdEEtoFile("out3.txt");
// TGraph *gr2 = new TGraph("out3.txt");
// gr2->SetMarkerColor(2);
// gr2->Draw("*");
// mSi.PrintREtoFile();
// TGraph *gr2 = new TGraph("outputRE.txt");
// gr2->Draw("A*");
// char out[20], gr[10];
// TObjArray glist(0);
// TMultiGraph *mg = new TMultiGraph();
// TGraph *g;
// for (Int_t i = 0; i < 30; i++) {
// sprintf(out, "output%d.txt", i);
// cout << out << endl;
// mSi.SetDeltaEtab(300+i);
// mSi.PrintdEEtoFile(out);
// g = new TGraph(out);
// glist.Add(g);
// cout << out << endl;
// }
// cout << mSi.GetE(7.686, 10) << endl;
// cout << mSi.GetE(7.686, 1) << endl;
// Double_t finalEnergy = -1.;
// Double_t Energy = steelwin.GetE0(finalEnergy, 30.);
// Energy = target.GetE0(Energy, 2000.);
// printf("%f\n", Energy);
}
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class TELoss;
#endif
\ No newline at end of file
This diff is collapsed.
{
gSystem->Load("/home/chudoba/work/makefilesBe/libAculData.so");
gSystem->Load("/home/chudoba/work/makefilesBe/libDetectors.so");
gSystem->Load("/home/chudoba/work/makefilesBe/libTELoss.so");
gSystem->Load("/home/chudoba/work/makefilesBe/libBe.so");
}
{
// gSystem->Load("/media/commondata/work/makefiles/libAculData.so");
gSystem->Load("/home/w2/work/makefiles/libTELoss.so");
// gSystem->Load("/media/commondata/work/makefiles/libAculData.so");
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment