00001
00008 #ifndef _QDBDETECTOR_HH
00009 #define _QDBDETECTOR_HH
00010
00011 #include <time.h>
00012 #include <vector>
00013 #include <list>
00014 #include <map>
00015 #include "QCuore.hh"
00016 #include <string>
00017
00018 namespace Cuore {class QVector;}
00019 namespace Cuore {class QTime;}
00020
00021
00022 namespace QDbDetector{
00023
00024 class RootLoad {
00025 public:
00026 virtual ~RootLoad() {}
00027 ClassDef(QDbDetector::RootLoad,0);
00028 };
00030 enum RunType {
00031 RT_UNKNOWN,
00032 RT_BACKGROUND,
00033 RT_CALIBRATION,
00034 RT_NPULSES,
00035 RT_TEST,
00036 RT_SIMULATION
00037 };
00038
00040 enum DetectorName {
00041 DN_CUORICINO = 0,
00042 DN_THREETOWERS = 1,
00043 DN_CUORE0 = 2,
00044 DN_CUORE = 3,
00045 DN_HALLC = 5,
00046 DN_HALLC_CUORE = 6,
00047 DN_UNKNOWN = 9,
00048 };
00053 RunType GetRunType(int run);
00055 RunType String2RunType(const std::string& s);
00057 std::string RunType2String(QDbDetector::RunType runType);
00059 std::string DetectorName2String(QDbDetector::DetectorName detectorId);
00064 DetectorName GetDetectorName(int run);
00065
00067 unsigned int GetCurrentRunNumber();
00068
00070 unsigned int SettingsBasket(const unsigned int run);
00071
00081 void GetListOfChannels(unsigned int run,
00082 std::list<unsigned short>& chList);
00083
00092 void GetListOfPulsers(unsigned int run,
00093 std::map<unsigned short,std::list<unsigned short> >& pulsers);
00094
00100 int NRun(time_t time);
00101
00107 int NRun(const Cuore::QTime& time);
00108
00113 int ProfileId(int run);
00114
00120 int BoloId(const int run, const int ch);
00121
00127 int Channel(const int run, const int boloId);
00128
00134 std::map<unsigned short, unsigned short> GetDaqCrates(const int run);
00135
00140 std::vector<int> FloorList(int run);
00141
00146 std::vector<int> BoloList(int run);
00147
00152 std::vector<int> ActiveBoloList(int run);
00153
00158 bool IsActiveBolo(int run, int id);
00159
00164 std::vector<int> ActiveChannelList(const int run);
00165
00170 std::vector<int> ThermList(int run);
00171
00175 std::map<int,int> TrgThresholdList(int run);
00176
00181 std::vector<int> GetRelativeChannels(int run, int channel, const std::string& fileName);
00182
00184 int GetPulserId(int run, int boloId, const std::string& filename);
00185
00191 Cuore::QVector Position (int channel);
00192
00198 int BoloFloor(int channel);
00199
00205 std::vector<int> BolometersOnFloor(int floor);
00206
00211 std::map<int,int> ChannelFloor(int run);
00212
00217 std::multimap<int,int> FloorChannel(int run);
00218
00224 std::string BoloName(int channel);
00225
00231 double SamplingFrequency(int run, int chan);
00232
00239 std::vector<double> ADCRange(int run, int chan);
00244 int GetThermometerChannel(int run);
00249 std::vector<int> GetMuonQDCChannels(int);
00254 std::vector<int> GetMuonTDCChannels(int);
00260 std::string GetScintillatorNameFromQDCCh(int channel, int run);
00266 double GetScintillatorThickness(std::string name, int run);
00267
00268
00269 };
00270 #endif