otsdaq  v2_00_00
Geometry.h
1 /****************************************************************************
2 ** Authors: Dario Menasce, Stefano Terzo
3 **
4 ** I.N.F.N. Milan-Bicocca
5 ** Piazza della Scienza 3, Edificio U2
6 ** Milano, 20126
7 **
8 ****************************************************************************/
9 
10 #ifndef GEOMETRY_H
11 #define GEOMETRY_H
12 
13 #include <list>
14 #include <map>
15 #include <string>
16 #include <sstream>
17 #include <vector>
18 #include <TObject.h>
19 
20 #include "Detector.h"
21 
22 #define CONVF 1000
23 
24 namespace monicelli
25 {
26 
27 class Geometry : public TObject
28 {
29  public:
30 
31  Geometry(void);
32  ~Geometry(void);
33 
34  Detector * addDetector (std::string plaqID,
35  bool isDUT = false );
36 
37  void clear (void ) {detectorsMap_.clear() ;}
38  bool empty (void ) {return detectorsMap_.empty();}
39 
40  Detector * getDetector (std::string plaqID );
41  Detector * getDetector (int station,
42  int plaq );
43  std::vector<Detector*> getDUTs (void );
44  std::string getDetectorID (int Station, int Plaq );
45  unsigned int getDetectorsNumber (bool excludeDUT = false);
46  std::string getGeometryFileName (void ) {return geometryFileName_ ;}
47  double getMaxDetectorsLength (void );
48  unsigned int getMaxRowsNum (void );
49  unsigned int getMaxColsNum (void );
50  bool calibrationDone (void ){return calibrationDone_ ;}
51 
52  void setDUTnumbers (unsigned int dutNumbers ) {dutNumbers_ = dutNumbers ;}
53  void setGeometryFileName (std::string fileName ) ;
54  void setCalibrationDone (bool done ) {calibrationDone_ = done ;}
55 
56  void dump (void );
57 
58  typedef std::map< std::string , Detector* >::iterator iterator;
59  iterator begin() {return detectorsMap_.begin() ;}
60  iterator end() {return detectorsMap_.end() ;}
61 
62  private:
63 
64  typedef std::map< std::string , Detector* > detectorsMapDef;
65 
66  bool compare_zPosition (std::string first, std::string second);
67 
68  detectorsMapDef detectorsMap_ ;
69  std::vector<int> runNumbers_ ;
70  unsigned int dutNumbers_ ;
71  std::string geometryFileName_ ;
72  bool calibrationDone_ ;
73 
74  //std::stringstream ss_ ;//! temporary state value
75 
76  ClassDef(Geometry,5)
77 
78 } ;
79 }
80 
81 #endif // GEOMETRY_H