Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:09:43

0001 #ifndef Analysis_Triggers_Primitive_Calorimeter_H
0002 #define Analysis_Triggers_Primitive_Calorimeter_H
0003 
0004 #include "AddOns/Analysis/Triggers/Primitive_Detector.H"
0005 #include "ATOOLS/Phys/Particle_List.H"
0006 #include "ATOOLS/Math/Vector.H"
0007 #include "ATOOLS/Org/Message.H"
0008 
0009 namespace ATOOLS { class Particle_Qualifier_Base; }
0010 
0011 namespace ANALYSIS {
0012   class Primitive_Calorimeter : public Primitive_Detector_Element {
0013   private:
0014     double m_mineta, m_maxeta, m_delta_eta, m_delta_phi;
0015     double *  p_costheta, *  p_sintheta, *  p_cosphi, *  p_sinphi;
0016     ATOOLS::Particle_Qualifier_Base *p_qualifier;
0017 
0018     void   SmearEnergy(const ATOOLS::Flavour &, double &);
0019     void   Reset();
0020   public:
0021     Primitive_Calorimeter(int,int,std::string) { abort(); }
0022     Primitive_Calorimeter(const double mineta=-2.5,const double maxeta=2.5,
0023               const int neta=50, const int nphi=40,
0024               const std::string qualifier="NotLepton");
0025     ~Primitive_Calorimeter();
0026     void Fill(const ATOOLS::Particle_List *);
0027     void Extract(ATOOLS::Particle_List *);
0028     void Print(std::ostream & =std::cout);
0029 
0030     double PseudoRapidityNAzimuthalAngle(const ATOOLS::Vec4D & p, double & phi);
0031     void   GetDimensions(int & neta,int & nphi,
0032              double & mineta, double & maxeta); 
0033     void   GetCosSinTheta(const int i,double & costheta,double & sintheta);  
0034     void   GetCosSinPhi(const int i,double & cosphi,double & sinphi);  
0035     Primitive_Detector_Element * Copy() const ;
0036   };
0037 
0038 
0039   inline void Primitive_Calorimeter::GetDimensions(int & neta,int & nphi,
0040                            double & mineta, double & maxeta) { 
0041     neta     = m_nx;       nphi     = m_ny;
0042     mineta   = m_mineta;   maxeta   = m_maxeta;
0043   }
0044   inline void Primitive_Calorimeter::GetCosSinTheta(const int i,
0045                             double & costheta,double & sintheta) {
0046     if (i>-1&&i<m_nx) { costheta = p_costheta[i]; sintheta = p_sintheta[i]; return; }
0047     msg_Error()<<"Error in Primitive_Calorimeter::GetCosSinTheta("
0048                <<i<<") : "<<std::endl
0049                <<"   Out of bounds ("<<m_nx<<"), will return zeroes."<<std::endl;
0050     costheta = sintheta = 0.;
0051   }  
0052   inline void Primitive_Calorimeter::GetCosSinPhi(const int i,
0053                           double & cosphi,double & sinphi) {
0054     if (i>-1&&i<m_ny) { cosphi = p_cosphi[i]; sinphi = p_sinphi[i]; return; }
0055     msg_Error()<<"Error in Primitive_Calorimeter::GetCosSinPhi("
0056                <<i<<") : "<<std::endl
0057                <<"   Out of bounds ("<<m_ny<<"), will return zeroes."<<std::endl;
0058     cosphi = sinphi = 0.;
0059   }
0060 }
0061 
0062 #endif