Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:19

0001 #ifndef RadialInterval_H
0002 #define RadialInterval_H
0003 
0004 //  Created 1/11/04. F. Beaudette (CERN)
0005 //  This class is used to ease the lateral development with
0006 // different spot fractions in FamosShower.
0007 
0008 #include <vector>
0009 
0010 class RandomEngineAndDistribution;
0011 
0012 class RadialInterval {
0013 public:
0014   /// Standard constructor Rc: mean Radius
0015   RadialInterval(double RC, unsigned nSpots, double energy, const RandomEngineAndDistribution* engine);
0016   ~RadialInterval() { ; }
0017 
0018   /// Add an interval : first argument is the radius, the second is the
0019   /// fraction of spots in this interval R>10 <-> infinity
0020   void addInterval(double, double);
0021   /// Most of the calculation are made in addInterval
0022   /// but the normal number of spots has to be set
0023   void compute();
0024   /// Number of intervals
0025   inline unsigned nIntervals() const { return nInter; }
0026   /// Spot energy in a given interval
0027   inline double getSpotEnergy(unsigned i) const {
0028     //    std::cout << " getSpotEnergy " << i << " " << spotE.size() << std::endl;
0029     return spotE[i];
0030   }
0031   /// Number of spots in a given interval
0032   inline unsigned getNumberOfSpots(unsigned i) const {
0033     //    std::cout << " getNumberOfSpots " << i << " " << nspots.size() << std::endl;
0034     return nspots[i];
0035   }
0036   /// Lower limit of the argument in the radius generator
0037   inline double getUmin(unsigned i) const {
0038     //    std::cout << " getUmin " << i << " " << uMin.size() << std::endl;
0039     return uMin[i];
0040   }
0041   /// Upper limit of the argument in the radius generator
0042   inline double getUmax(unsigned i) const {
0043     //    std::cout << " getUmax " << i << " " << uMax.size() << std::endl;
0044     return uMax[i];
0045   }
0046 
0047 private:
0048   double currentRad;
0049   double currentEnergyFraction;
0050   double currentUlim;
0051   double theR;
0052   unsigned theNumberOfSpots;
0053   double theSpotEnergy;
0054   unsigned nInter;
0055 
0056   std::vector<double> uMin;
0057   std::vector<double> uMax;
0058   std::vector<unsigned> nspots;
0059   std::vector<double> spotE;
0060   std::vector<double> dspotsunscaled;
0061   std::vector<double> spotfraction;
0062 
0063 private:
0064   // Fraction of the energy in rm Moliere radius
0065   double energyFractionInRadius(double rm);
0066 
0067   // Famos Random Engine
0068   const RandomEngineAndDistribution* random;
0069 };
0070 #endif