#ifndef __LumiFast_H #define __LumiFast_H #define STRIP_WIDTH 0.8 //start of fiducial volume wrt the inner side of calorimeter //fiducial volume starts 1 strip away #define YFIDUCIAL_OFFSET 0.5+1.*STRIP_WIDTH // c/c++ includes #include #include // ROOT includes #include "TF1.h" #include "TRandom.h" // My includes #include "GenGamma.h" extern TRandom *gRandom; // a class to provide fast simmulation of the spectrometer // Author: Miroslav Helbich // Date: Sept. 30 2001 class LumiFast { // data members private: // geometrical setup float fBdl; // Integral BdL float fysep; // separation of to calorimeters float fyoffset; // offset of the spectrometer float fxoffset; // offset of the spectrometer int fnxstrips; // number of fiducial x strips int fnystrips_up; // number of fiducial y strips up int fnystrips_dn; // number of fiducial y strips dn float fxmax; // assume symmetric and same for both detectors float fzmagnet; // z-position of magnet float fzspectro; // z-position of spectrometer //physics flags int fIsScattering; // switch on/off the scattering int fIsEnergyLoss; // switch on/off the energy loss in the window //Energy Window float fEwindowMin; float fEwindowMax; // resolutions float fEnergy_res; // Energy resolution float fPos_res; // Position resolution // energy scales float fEscale_up; // relative energy scale (e.g. 1.=true energy) float fEscale_dn; // generated event float fEnergy_e; // electron energy float fEnergy_p; // positron energy float fxpos_gam; // photon hit position float fypos_gam; // reconstructed event float fEnergy_up; float fEnergy_dn; float fypos_up; float fxpos_up; float fypos_dn; float fxpos_dn; // distribution functions TF1 *fThetaDist; // event generator GenGamma *fGenerator; GenGamma *fGenInternal; // default generator // methods protected: //energy resolution function float Eres(float energy) { return fEnergy_res*sqrt(energy);} float abs(float a) {return a<0. ? -1.*a : a;}; public: // constructors LumiFast(); // destructor ~LumiFast(); // Getters for the data // detector geometry float GetYMinUp() {return fyoffset+fysep/2.+YFIDUCIAL_OFFSET;}; float GetYMaxUp() {return fyoffset+fysep/2.+YFIDUCIAL_OFFSET+fnystrips_up*STRIP_WIDTH;}; float GetYMinDn() {return fyoffset-fysep/2.-YFIDUCIAL_OFFSET-fnystrips_dn*STRIP_WIDTH;}; float GetYMaxDn() {return fyoffset-fysep/2.-YFIDUCIAL_OFFSET;}; float GetXMax() {return fxoffset+fnxstrips*STRIP_WIDTH/2.;}; float GetXMin() {return fxoffset-fnxstrips*STRIP_WIDTH/2.;}; float GetYOffset() {return fyoffset;}; float GetXOffset() {return fxoffset;}; // beam line setup float GetBdl() {return fBdl;}; float GetZMagnet() {return fzmagnet;}; float GetZSpectro() {return fzspectro;}; float GetBeta() {return 0.3* GetBdl()*(GetZSpectro()-GetZMagnet());}; void SetBeta(float beta) {SetBdl(beta/0.3/(GetZSpectro() - GetZMagnet()));}; // detector parameters float GetERes() {return fEnergy_res;}; float GetPosRes() {return fPos_res;}; float GetEScaleUp() {return fEscale_up;}; float GetEScaleDn() {return fEscale_dn;}; // true event float GetEnergyTrueUp() {return fEnergy_e;}; //includes radiation float GetEnergyTrueDn() {return fEnergy_p;}; //includes radiation float GetEnergyGamTrue() {return GetGenerator()->GetEnergy();} float GetXPosGamTrue() {return GetGenerator()->GetXPos();}; float GetYPosGamTrue() {return GetGenerator()->GetYPos();}; float GetZTrue() {return GetGenerator()->GetZ();}; // reconstructed event float GetEnergyUp() {return fEnergy_up;}; float GetEnergyDn() {return fEnergy_dn;}; float GetYPosUp() {return fypos_up;}; float GetXPosUp() {return fxpos_up;}; float GetYPosDn() {return fypos_dn;}; float GetXPosDn() {return fxpos_dn;}; float GetZ() {return (GetEnergyDn()+GetEnergyUp())!=0. ? GetEnergyUp()/(GetEnergyDn()+GetEnergyUp()) : 0.001;}; float GetXPosGam() {return (GetXPosUp()+GetXPosDn())/2.;}; float GetYPosGam() {return (GetEnergyDn()+GetEnergyUp())!=0. ? (GetEnergyUp()*GetYPosUp()+GetEnergyDn()*GetYPosDn())/(GetEnergyUp()+GetEnergyDn()) : 0.001;}; float GetEnergyGam() {return GetEnergyUp()+GetEnergyDn();}; // energy window definition float GetEWindowMin() {return fEwindowMin;}; float GetEWindowMax() {return fEwindowMax;}; // advanced getters GenGamma *GetGenerator() {return fGenerator;}; TF1* GetThetaDist() {return fThetaDist;}; // Setters for data (some only are accesible) void SetBdl(float new_bdl) {fBdl = new_bdl;}; void SetEScaleUp(float new_escale) {fEscale_up = new_escale;}; void SetEScaleDn(float new_escale) {fEscale_dn = new_escale;}; void SetEWindowMin(float Emin) {fEwindowMin=Emin;}; void SetEWindowMax(float Emax) {fEwindowMin=Emax;}; void SetEWindow(float Emin,float Emax) {fEwindowMin=Emin;fEwindowMin=Emax;}; void SetScattering(int iscat) {fIsScattering=iscat;}; void SetEnergyLoss(int isloss) {fIsEnergyLoss=isloss;}; void SetPosRes(float newres) {fPos_res = newres;}; void SetEnergyRes(float neweres) {fEnergy_res=neweres;}; void SetYOffset(float new_offset) {fyoffset = new_offset;}; void SetXOffset(float new_offset) {fxoffset = new_offset;}; void SetNyStripsUp(int nstrips) {fnystrips_up = nstrips;}; void SetNyStripsDn(int nstrips) {fnystrips_dn = nstrips;}; // advanced setters void SetGenerator(GenGamma *generator) {fGenerator = generator;} // Methods that do something void NewEvent(); // call generator to get new event void ProcessEvent(); // process event without calling generator int IsCoincidence(); // was it a coincidence? int IsHitUp(); // was there a hit in the upper detector? int IsHitDn(); // was there a hit in the lower detector? void Show(); //show event }; #endif