Go to the documentation of this file.00001 #ifndef RECOTRACKER_RINGS_H
00002 #define RECOTRACKER_RINGS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <vector>
00020 #include <map>
00021 #include <utility>
00022 #include <string>
00023 #include <fstream>
00024
00025 #include "RecoTracker/RingRecord/interface/Ring.h"
00026
00027 class Rings {
00028
00029 public:
00030
00031 typedef std::multimap<double,Ring> RingMap;
00032 typedef RingMap::iterator iterator;
00033 typedef RingMap::const_iterator const_iterator;
00034
00035 Rings();
00036 Rings(std::string ascii_file);
00037
00038 ~Rings();
00039
00040 inline void insert(double z, Ring &ring) { ringMap_.insert(std::make_pair(z,ring)); }
00041
00042 inline iterator begin() { return ringMap_.begin(); }
00043 inline iterator end() { return ringMap_.end(); }
00044 inline const_iterator begin() const { return ringMap_.begin(); }
00045 inline const_iterator end() const { return ringMap_.end(); }
00046 inline iterator lower_bound(double z) { return ringMap_.lower_bound(z); }
00047 inline iterator upper_bound(double z) { return ringMap_.upper_bound(z); }
00048 inline const_iterator lower_bound(double z) const { return ringMap_.lower_bound(z); }
00049 inline const_iterator upper_bound(double z) const { return ringMap_.upper_bound(z); }
00050
00051 void dump(std::string ascii_filename = "rings.dat") const;
00052 void dumpHeader(std::ofstream &stream) const;
00053
00054 void readInFromAsciiFile(std::string ascii_file);
00055
00056 const Ring* getRing(DetId id, double phi = 999999., double z = 999999.) const;
00057 const Ring* getRing(unsigned int ringIndex, double z = 999999.) const;
00058 const Ring* getTIBRing(unsigned int layer,
00059 unsigned int fw_bw,
00060 unsigned int ext_int,
00061 unsigned int detector) const;
00062 const Ring* getTOBRing(unsigned int layer,
00063 unsigned int rod_fw_bw,
00064 unsigned int detector) const;
00065 const Ring* getTIDRing(unsigned int fw_bw,
00066 unsigned int wheel,
00067 unsigned int ring) const;
00068 const Ring* getTECRing(unsigned int fw_bw,
00069 unsigned int wheel,
00070 unsigned int ring) const;
00071 const Ring* getPXBRing(unsigned int layer,
00072 unsigned int detector) const;
00073 const Ring* getPXFRing(unsigned int fw_bw,
00074 unsigned int disk,
00075 unsigned int panel,
00076 unsigned int module) const;
00077
00078 private:
00079
00080 RingMap ringMap_;
00081
00082 };
00083
00084 #endif