GRUTinizer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TDetectorEnv.h
Go to the documentation of this file.
1 #ifndef _TDETECTORENV_H_
2 #define _TDETECTORENV_H_
3 
4 #include "TNamed.h"
5 
6 #include "TGRUTTypes.h"
7 
8 class TRawEvent;
9 
10 class TDetectorEnv : public TNamed {
11 public:
12  static TDetectorEnv& Get(const char* name = "");
13 
14  static bool Caesar() { return Get().source_ids[kDetectorSystems::CAESAR].size(); }
15  static bool Gretina() { return Get().source_ids[kDetectorSystems::GRETINA].size(); }
16  static bool Bank29() { return Get().source_ids[kDetectorSystems::BANK29].size(); }
17  static bool Mode3() { return Get().source_ids[kDetectorSystems::MODE3].size(); }
18  static bool Janus() { return Get().source_ids[kDetectorSystems::JANUS].size(); }
19  static bool Phoswall() { return Get().source_ids[kDetectorSystems::PHOSWALL].size(); }
20  static bool S800() { return Get().source_ids[kDetectorSystems::S800].size(); }
21  static bool S800Scaler() { return Get().source_ids[kDetectorSystems::S800SCALER].size(); }
22  static bool Sega() { return Get().source_ids[kDetectorSystems::SEGA].size(); }
23 
24  static const std::vector<int>& CaesarIDs() { return Get().source_ids[kDetectorSystems::CAESAR]; }
25  static const std::vector<int>& SegaIDs() { return Get().source_ids[kDetectorSystems::SEGA]; }
26  static const std::vector<int>& S800IDs() { return Get().source_ids[kDetectorSystems::S800]; }
27  static const std::vector<int>& S800ScalerIDs() { return Get().source_ids[kDetectorSystems::S800SCALER]; }
28  static const std::vector<int>& PhoswallIDs() { return Get().source_ids[kDetectorSystems::PHOSWALL]; }
29  static const std::vector<int>& JANUSIDs() { return Get().source_ids[kDetectorSystems::JANUS]; }
30  static const std::vector<int>& GretinaIDs() { return Get().source_ids[kDetectorSystems::GRETINA]; }
31  static const std::vector<int>& Mode3IDs() { return Get().source_ids[kDetectorSystems::MODE3]; }
32  static const std::vector<int>& Bank29IDs() { return Get().source_ids[kDetectorSystems::BANK29]; }
33 
34  kDetectorSystems DetermineSystem(int source_id) const;
36 
37  Int_t ReadFile(const std::string& filename);
38  Int_t ParseInputData(const char* inputdata);
39  void Print(Option_t* opt = "") const;
40  void Clear(Option_t* opt = "");
41 
42 //private:
43  static TDetectorEnv* env;
44 
46 
47  std::map<kDetectorSystems, std::vector<int> > source_ids;
48  std::string filename;
49 
51 };
52 
53 void trim(std::string *, const std::string & trimChars = " \f\n\r\t\v");
54 
55 #endif /* _TDETECTORENV_H_ */