/* * BeWork.h * * Created on: 2.2.2010 * Author: Vratislav */ //#ifndef BEWORK_H_ //#define BEWORK_H_ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #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 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_ */