#ifndef _PlugStrip_HH_ #define _PlugStrip_HH_ /** \class PlugStrip Container for a single, corrected plug strip. These are stored in a PlugStripColl and are thus the equivalent to a PESE bank from Run I \author Benn Tannenbaum benn@physics.ucla.edu \date 5 August 2000 This class doesn't do much. It holds things and writes them to disk and reads them back. I don't have much of a clue what the rest of it does... it's copied from other classes. The address of a give strip is packed into a single int.
bit  content
0     plug (0 = west, 1 = east)
1     octant (0-7)
2     octant
3     octant
4     layer (0 = u, 1 = v in west, opposite in east; see below for details)
5     strip (0-199)
6     strip
7     strip
8     strip
9     strip 
10    strip
11    strip
12    strip 
13    status
14    status
15    status
Note on the layer number: the layer number refers to the slope of the layer. Layer 0 is parallel to the high phi side of an octant, and layer 1 is parallel to the low phi side of an octant. This is not what is said in the current (17 October 2001) version of CDF4152. I've asked the author to change that. This means that in the west plug layer 0 is closer to the IP than layer 1, and in the east plug layer 1 is closer to the IP than is layer 0. \date 15 Sep 2002 Erik Brubaker: Added status bits as above. The status has so far the following two possibilities, I think: 0 - normal 1 - dead */ //---------------------- // Base Class Headers -- //---------------------- #include "Edm/StreamableObject.hh" //----------------- // Other Headers -- //----------------- #include #include "Rtypes.h" class PlugStrip : public StreamableObject { public: // Default Constructor PlugStrip(); // Copy Constructor PlugStrip( const PlugStrip& ); // Custom Constructor PlugStrip(int plug, int octant, int layer, int strip, float energy); PlugStrip(int address, int count, float energy); PlugStrip(int plug, int octant, int layer, int strip, int status, int counts, float energy); virtual ~PlugStrip(){} PlugStrip& operator = (const PlugStrip&); bool operator == (const PlugStrip&) const; bool operator != (const PlugStrip&) const; virtual void print( std::ostream& = std::cout) const; /*=========================================================================*\ * StreamableObject requirements \*=========================================================================*/ 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;} /** returns the full "location," including status information.*/ inline int PesLocation() const {return theLocation;} /** returns the address, which is the part of theLocation _without_ the status information.*/ inline int PesAddress() const {return (theLocation & 8191);} /** returns the plug. 1 = east, 0 = west*/ inline int PesPlug() const {return (theLocation & 1);} /** returns octant number*/ inline int PesOctant() const {return ((theLocation >> 1) & 7);} /** returns the layer*/ inline int PesLayer() const {return ((theLocation >> 4) & 1);} /** returns the strip*/ inline int PesStrip() const { int strip = ((theLocation >> 5) & 255); if (strip >= 200) { std::cerr << "SERIOUS ERROR: attempt to call strip number " << strip << ".\n"; strip = 0; } return strip; } /** returns the strip status */ inline int PesStatus() const {return ((theLocation >> 13) & 7);} /**returns the energy*/ inline float PesEnergy() const {return theEnergy;} /** returns the ADC counts */ inline int PesCounts() const {return theCounts;} private: void clear(); int theLocation; float theEnergy; int theCounts; // EDM VERSION : static const Version_t _VERSION; }; inline std::ostream& operator << (std::ostream& os, const PlugStrip& inter) { inter.print(os); return os; } #endif // !_PlugStrip_HH_