diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSHistoLateralShapeParametrization.h b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSHistoLateralShapeParametrization.h index 22533c147ce2a8df256d41e47cd8f298862bc6d5..e7c96829bc327e389ca701700f62074c66559fe5 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSHistoLateralShapeParametrization.h +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/ISF_FastCaloSimEvent/TFCSHistoLateralShapeParametrization.h @@ -15,6 +15,15 @@ public: TFCSHistoLateralShapeParametrization(const char* name=nullptr, const char* title=nullptr); ~TFCSHistoLateralShapeParametrization(); + ///Status bit for FCS needs + enum FCSStatusBits { + k_phi_symmetric = BIT(15) ///< Set this bit to simulate phi symmetric histograms + }; + + bool is_phi_symmetric() const {return TestBit(k_phi_symmetric);}; + virtual void set_phi_symmetric() {SetBit(k_phi_symmetric);}; + virtual void reset_phi_symmetric() {ResetBit(k_phi_symmetric);}; + /// set the integral of the histogram to the desired number of hits void set_number_of_hits(float nhits); diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSHistoLateralShapeParametrization.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSHistoLateralShapeParametrization.cxx index 750c3f997fb4355c43d4bd698f1bc66ee354f6e4..44e7119aa3d9e2c951f815e56b165baead60d7b4 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSHistoLateralShapeParametrization.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSHistoLateralShapeParametrization.cxx @@ -20,6 +20,7 @@ TFCSHistoLateralShapeParametrization::TFCSHistoLateralShapeParametrization(const char* name, const char* title) : TFCSLateralShapeParametrizationHitBase(name,title),m_nhits(0) { + reset_phi_symmetric(); } TFCSHistoLateralShapeParametrization::~TFCSHistoLateralShapeParametrization() @@ -49,7 +50,19 @@ void TFCSHistoLateralShapeParametrization::simulate_hit(Hit& hit,TFCSSimulationS //CLHEP should generate random numbers in (0,1), so this fudge is no longer needed after migrating to CLHEP random numbers rnd1=1-gRandom->Rndm(); rnd2=1-gRandom->Rndm(); - m_hist.rnd_to_fct(alpha,r,rnd1,rnd2); + if(is_phi_symmetric()) { + if(rnd2>=0.5) { //Fill negative phi half of shape + rnd2-=0.5; + rnd2*=2; + m_hist.rnd_to_fct(alpha,r,rnd1,rnd2); + alpha=-alpha; + } else { //Fill positive phi half of shape + rnd2*=2; + m_hist.rnd_to_fct(alpha,r,rnd1,rnd2); + } + } else { + m_hist.rnd_to_fct(alpha,r,rnd1,rnd2); + } if(TMath::IsNaN(alpha) || TMath::IsNaN(r)) { ATH_MSG_ERROR(" Histogram: "<<m_hist.get_HistoBordersx().size()-1<<"*"<<m_hist.get_HistoBordersy().size()-1<<" bins, #hits="<<m_nhits<<" alpha="<<alpha<<" r="<<r<<" rnd1="<<rnd1<<" rnd2="<<rnd2); alpha=0; @@ -108,5 +121,11 @@ void TFCSHistoLateralShapeParametrization::Print(Option_t *option) const TString optprint=opt;optprint.ReplaceAll("short",""); TFCSLateralShapeParametrizationHitBase::Print(option); - if(longprint) ATH_MSG_INFO(optprint <<" Histo: "<<m_hist.get_HistoBordersx().size()-1<<"*"<<m_hist.get_HistoBordersy().size()-1<<" bins, #hits="<<m_nhits); + if(longprint) { + if(is_phi_symmetric()) { + ATH_MSG_INFO(optprint <<" Histo: "<<m_hist.get_HistoBordersx().size()-1<<"*"<<m_hist.get_HistoBordersy().size()-1<<" bins, #hits="<<m_nhits<<" (phi symmetric)"); + } else { + ATH_MSG_INFO(optprint <<" Histo: "<<m_hist.get_HistoBordersx().size()-1<<"*"<<m_hist.get_HistoBordersy().size()-1<<" bins, #hits="<<m_nhits<<" (not phi symmetric)"); + } + } } diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationEkinSelectChain.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationEkinSelectChain.cxx index 08f1758f05a9aa2e5a37d242aa4b9513926fe8cf..cd01c674d62c0af960051315d9ef999cf2b0c7ce 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationEkinSelectChain.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSParametrizationEkinSelectChain.cxx @@ -100,6 +100,9 @@ const std::string TFCSParametrizationEkinSelectChain::get_bin_text(int bin) cons { if(bin==-1 || bin>=(int)get_number_of_bins()) { return std::string(Form("bin=%d not in [%1.1f<=Ekin<%1.1f)",bin,m_bin_low_edge[0],m_bin_low_edge[get_number_of_bins()])); + } + if(DoRandomInterpolation()) { + return std::string(Form("bin=%d, %1.1f<=Ekin(+random)<%1.1f",bin,m_bin_low_edge[bin],m_bin_low_edge[bin+1])); } return std::string(Form("bin=%d, %1.1f<=Ekin<%1.1f",bin,m_bin_low_edge[bin],m_bin_low_edge[bin+1])); }