/** \class PesCluster \author Dave Waters Concrete class for plug shower max objects. Derived from ShowerMaxCluster Revision History: \date 02-Mar-2000 Dave Waters Initial creation. A lot of the structure has been copied from Bob Wagner's CesCluster and the PesCluster class nested in PlugStripClusterModule. This class is Streamable through the base class ShowerMaxCluster and is not just a wrappered Link to a PESS_StorableBank. \date 10-May-2000 Bob Wagner Change return type of region() to Detector which is enumeration in CalConstants.hh \date 01-Jun-2000 Dave Waters Add version information. \date 15-Mar-2002 David Goldstein Add accessor named pesProfileRatio5by9. For the default 9-strip fixed width clustering, this returns the ratio:[sum of energy in central 5 strips] divided by [total energy in cluster]. The intended use of the variable is for electron i.d. \date 19 Mar-2002 Benn Tannenbaum: modified streamer (now version 2) so the 5/9 profile ratio is stored with the event. \date 26 Apr-2002 Erik Brubaker: Add/unclobber function to return vector of strips for this cluster. \date 06 Nov-2004 Brian Mohr: Add event vertex information to cluster. \date 06 Nov-2004 Brian Mohr: Add tentative quality variable to cluster. */ #ifndef PESCLUSTER_HH_ #define PESCLUSTER_HH_ #include #include //--------------- // C++ Headers -- //--------------- #include "CalorObjects/ShowerMaxCluster.hh" #include "Rtypes.h" //---------------------------------- // Forward Declaration of Classes -- //---------------------------------- class PlugStrip; //***************************************************************************** // Class Declaration //***************************************************************************** class PesCluster : public ShowerMaxCluster { //=========================================================================== // Minimal functions for good class definition //=========================================================================== public: PesCluster(); // default constructor PesCluster(const PesCluster&); // copy constructor PesCluster(float energy, float centroid, float width, int numStrips, int lastStrip, int seed, float fiveOverNineRatio,std::vector qEnergy, float chisq); PesCluster(float energy, float centroid, float width, int numStrips, int lastStrip, int seed, float fiveOverNineRatio,std::vector qEnergy, float chisq, unsigned int quality); virtual ~PesCluster(){} //=========================================================================== // Accessor functions required by base class //=========================================================================== /** This used to be called just "width" in the old nested class PesCluster. It is the width in strips, not centimeters (see PesCluster.icc) :*/ virtual float clusterWidth() const; virtual Detector region() const; virtual float energy() const; virtual float localCoord() const; virtual float globalCoord() const; virtual int module() const; virtual int side() const; /** for this class the view is the layer: 0 = u, 1 = v. in west, opposite in east. See the note in PlugStrip for further details. */ virtual int view() const; //=========================================================================== // PesCluster specific accessor functions : //=========================================================================== /** Returns the Octant of the PesCluster*/ int octant() const; /** Centroid position in strips, not centimeters (see PesCluster.icc) note that this number runs from 0 to 199, i.e. it is continuous.*/ float centroid() const; /** the number of strips in the cluster*/ int numStrips() const; /** the ID of the last strip involved in the cluster*/ int lastStrip() const; /** the number of the seedStrip*/ int seedStrip() const; /** Cluster centroid position and width in centimeters (see PesCluster.icc) note that this number is 1-170 for low eta strips and 1-30 for high eta strips.*/ float centroidCM() const; /** width of the cluster in centimeters*/ float widthCM() const; /**legacy; not used.*/ float lineSlope() const; /**legacy; not used.*/ float lineIntercept() const; /**legacy; not used.*/ float lineInterceptErr() const; /** the z position of the cluster (i.e. what plug and layer)*/ float clusterZ() const; /** which eta region. 0 = low, 1 = high.*/ bool etaRegion() const; // double qEnergyStrip(int i) const; int qEnergySize() const; float chisq() const; int Version() const; // /** accessor for pes ratio `quality' variable. with default 9-strip fixed width clustering, this is [sum energy in central 5 strips]/[total cluster energy]. */ float pesProfileRatio5by9() const; /** accessor for pes cluster quality variable -- takes into account dead strips and/or strips with poorly defined gain and/or strips on edge of wedge **/ unsigned int quality() const {return _quality;} /** returns a std::vector of strips in the cluster. If num is set to any non-neg value, it will return seed +/- num strips. If print is set to true, it will also print each strip.*/ std::vector strips(int num = -1, bool print = false) const; //=========================================================================== // Set methods : //=========================================================================== void makeLine(int iphi, int layer, int i_ew); void setClusterWidth(double clWidth); void setRegion(Detector region); void setEnergy(double energy); void setLocalCoord(double localCoord); void setModule(int module); void setSide(int side); void setView(int view); void setOctant(int octant); void setCentroid(float centroid); void setNumStrips(int numStrips); void setLastStrip(int lastStrip); void setSeedStrip(int seedStrip); void setCentroidCM(float centroidCM); void setWidthCM(float widthCM); void setLineSlope(float lineSlope); void setLineIntercept(float lineIntercept); void setLineInterceptErr(float lineInterceptErr); void setClusterZ(float clusterZ); //=========================================================================== // Additional functions required by base class //=========================================================================== //=========================================================================== // Operator overloads //=========================================================================== PesCluster& operator = (const PesCluster&); bool operator == (const PesCluster&) const; bool operator != (const PesCluster&) const; virtual void print( std::ostream& = std::cout) const; //--------------------------------------------------------------------------- // Input/Output Requirements: // Child classes should call base class methods, then treat own data members //--------------------------------------------------------------------------- virtual void Streamer(TBuffer& iobuffer) ; virtual bool postread( EventRecord* p_record) ; virtual bool prewrite( EventRecord* p_record) ; // VERSION INFORMATION : static Version_t class_version(){return _VERSION;} private: //=========================================================================== // Data members of class //=========================================================================== int _view,_octant; float _clEnergy, _clCentroid, _clWidth; int _clNumStrips, _clLastStrip, _clSeedStrip; float _clCentroidCM, _clWidthCM; float _lineSlope,_lineIntercept, _lineInterceptErr; float _clusterZ; float _fiveOverNineRatio; std::vector _qEnergy; float _chisq; unsigned int _quality; // EDM VERSION : static const Version_t _VERSION; Version_t version; }; //=========================================================================== // Inline functions //=========================================================================== inline std::ostream& operator << (std::ostream& os, const PesCluster& inter) { inter.print(os); return os; } #include "CalorObjects/PesCluster.icc" #endif // !PESCLUSTER_HH_