X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=FMD%2FAliFMDStripIndex.h;h=b6d524cff9942f151dc52c480190394d2f1eca93;hb=f068fb74591476f47c1939f35664808887d70c6c;hp=cf9a3794f3f110290968c563e00c9cd99c96e697;hpb=a91c42d1687d97cd00f73ad60190f6ff764f4e82;p=u%2Fmrichter%2FAliRoot.git diff --git a/FMD/AliFMDStripIndex.h b/FMD/AliFMDStripIndex.h index cf9a3794f3f..b6d524cff99 100644 --- a/FMD/AliFMDStripIndex.h +++ b/FMD/AliFMDStripIndex.h @@ -1,3 +1,5 @@ +#ifndef ALIFMDSTRIPINDEX_H +#define ALIFMDSTRIPINDEX_H /************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * @@ -13,16 +15,39 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -//Struct to encode a strip address into one integer -//developed by Christian Holm Christensen (cholm@nbi.dk). -// The functions are static -// to ensure applicability from anywhere. This is needed to smoothly store -//strip addresses in track references. +// Struct to encode a strip address into one integer +// developed by Christian Holm Christensen (cholm@nbi.dk). +// +// The functions are static to ensure applicability from +// anywhere. This is needed to smoothly store strip addresses in track +// references. +// // Added by Hans H. Dalsgaard (hans.dalsgaard@cern.ch) -struct AliFMDStripIndex +class AliFMDStripIndex { +public: + /** + * Constructor + * + */ + AliFMDStripIndex() {} + /** + * Destructor + * + */ + virtual ~AliFMDStripIndex() {} + /** + * Pack an identifier from detector coordinates + * + * @param det Detector + * @param rng Ring + * @param sec Sector + * @param str Strip + * + * @return Packed identifier + */ static UInt_t Pack(UShort_t det, Char_t rng, UShort_t sec, UShort_t str) { UInt_t irg = (rng == 'I' || rng == 'i' ? 0 : 1); @@ -32,8 +57,17 @@ struct AliFMDStripIndex ((det & 0x003) << 17)); return id; } + /** + * Unpack an identifier to detector coordinates + * + * @param id Identifier to unpack + * @param det On return, the detector + * @param rng On return, the ring + * @param sec On return, the sector + * @param str On return, the strip + */ static void Unpack(UInt_t id, - UShort_t& det, Char_t& rng, UShort_t& sec, UShort_t& str) + UShort_t& det, Char_t& rng, UShort_t& sec, UShort_t& str) { str = ((id >> 0) & 0x1FF); sec = ((id >> 9) & 0x03F); @@ -41,5 +75,11 @@ struct AliFMDStripIndex det = ((id >> 17) & 0x003); } - ClassDef(AliFMDStripIndex,0) + ClassDef(AliFMDStripIndex,1) }; +#endif +// +// Local Variables: +// mode: C++ +// End: +//