QDbDetector.hh

Go to the documentation of this file.
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     // trick for rlibmap
00024     class RootLoad {
00025         public:
00026             virtual ~RootLoad() {}
00027             ClassDef(QDbDetector::RootLoad,0);
00028     };
00029     
00034    enum RunType {
00035       RT_UNKNOWN,     
00036       RT_BACKGROUND,  
00037       RT_CALIBRATION, 
00038       RT_NPULSES,     
00039       RT_TEST,        
00040       RT_SIMULATION,  
00041       RT_REPROCESS,   
00042     };
00043 
00048     enum DetectorName {
00049        DN_CUORICINO = 0,   
00050        DN_THREETOWERS = 1, 
00051        DN_CUORE0 = 2,      
00052        DN_CUORE = 3,       
00053        DN_HALLA = 4,       
00054        DN_HALLC = 5,       
00055        DN_HALLC_CUORE = 6, 
00056        DN_UNKNOWN = 9,     
00057     };
00058     
00063     RunType GetRunType(int run);
00064 
00069    RunType GetRunTypeFromBasket(int basket);
00070 
00072     RunType String2RunType(const std::string& s);
00073     
00075     std::string RunType2String(QDbDetector::RunType runType);
00076 
00078    int GetMinAllowedRunNumber(DetectorName detector);
00079 
00081    int GetMaxAllowedRunNumber(DetectorName detector);
00082     
00084     std::string DetectorName2String(QDbDetector::DetectorName detectorId);
00085     
00090     DetectorName GetDetectorName(int run);
00091 
00093     unsigned int GetCurrentRunNumber();
00094 
00096     unsigned int SettingsBasket(const unsigned int run);
00097 
00107    void GetListOfChannels(unsigned int run, 
00108                           std::list<unsigned int>& chList);
00109 
00118    void GetListOfPulsers(unsigned int run,
00119                          std::map<unsigned int,std::list<unsigned int> >& pulsers);
00120 
00127     int NRun(time_t time);
00128 
00135     int NRun(const Cuore::QTime& time);
00136 
00141     int ProfileId(int run);
00142 
00149     int BoloId(const int run, const int ch);
00150     
00156     int Channel(const int run, const int boloId);
00157     
00163    std::map<unsigned int, unsigned int> GetDaqCrates(int basket);
00164 
00169     std::vector<int> FloorList(int run);
00170 
00176     std::vector<int> BoloList(int run);
00177 
00183     std::vector<int> ActiveBoloList(int run);
00184 
00185     // AB: this function should be updated to work with either the old
00186     // CUORICINO style using flag_act or the new Apollo style using maps
00191     bool IsActiveBolo(int run, int id);
00192     
00197     std::vector<int> ActiveChannelList(const int run);
00198     
00203     std::vector<int> ThermList(int run);
00204     
00208     std::map<int,int> TrgThresholdList(int run);
00209 
00214     std::vector<int> GetRelativeChannels(
00215         int run, int channel,
00216         const std::string fileName = "DB"
00217     );
00218 
00220     int GetPulserId(int run, int boloId, const std::string filename = "DB");
00221 
00226     Cuore::QVector Position (int run, int channel);
00227 
00231     int BoloFloor(const int run, const int channel);
00232   
00237     std::vector<int> BolometersOnFloor(const int run, const int floor);
00238 
00243     std::map<int,int> ChannelFloor(int run);
00244 
00249     std::multimap<int,int> FloorChannel(int run);
00250     
00254     int BoloTower(const int run, const int channel);
00255     
00260     int BoloPosition(const int run, const int channel);
00261     
00267     std::string BoloName(const int run, const int channel);
00268 
00274     double SamplingFrequency(int run, int chan);
00275 
00282     std::vector<double> ADCRange(int run, int chan);
00283     
00284     // AB: usually there is more than one thermometer channel --
00285     //     should this function return a vector?
00290     int GetThermometerChannel(int run);
00291     
00296     std::vector<int> GetMuonQDCChannels(int);
00297     
00302     std::vector<int> GetMuonTDCChannels(int);
00303     
00309     std::string GetScintillatorNameFromQDCCh(int channel, int run);
00310     
00316     double GetScintillatorThickness(std::string name, int run);
00317     
00327     std::vector<int> GetBolometerChannels(const int run);
00328          
00329          
00335          double GetMass(int run, int channel);
00336          
00342          double GetMass130Te(int run, int channel);
00343      
00344 };
00345 #endif

Generated on Tue Nov 16 10:49:56 2010 for CUORE Software by  doxygen 1.5.6