00001
00002
00003 #include "geometry/Detector.hh"
00004 #include "geometry/GassiplexChamber1.hh"
00005 #include "geometry/GassiplexChamber4.hh"
00006 #include "geometry/Hardroc1Chamber.hh"
00007
00008 #include "tools/SteerDesc.hh"
00009 #include "tools/Log.hh"
00010
00011 #include <algorithm>
00012
00013 #include <iostream>
00014
00015 using namespace std;
00016
00017
00018 SteerDesc::SteerDesc() {
00019 chamberInfo = NULL;
00020 inputInfo = NULL;
00021 boardInfo = NULL;
00022 difInfo = NULL;
00023 chipInfo = NULL;
00024 slowControlInfo = NULL;
00025 lastChamberId = -1;
00026 lastDifId = -1;
00027 lastBoardId = -1;
00028
00029 }
00030
00031
00032 SteerDesc::~SteerDesc() {
00033 }
00034
00035
00036 size_t SteerDesc::fillDifByChamberId(std::vector<DifInfo_t>& result, i32 chamberId) const
00037 {
00038 std::remove_copy_if(difs.begin() , difs.end() , std::back_inserter(result) , std::bind2nd(filterByChamberId<DifInfo_t>(), chamberId));
00039 return result.size();
00040 }
00041
00042 size_t SteerDesc::fillBoardByChamberId(std::vector<BoardInfo_t>& result, i32 chamberId) const
00043 {
00044 std::remove_copy_if(boards.begin() , boards.end() , std::back_inserter(result) , std::bind2nd(filterByChamberId<BoardInfo_t>(), chamberId));
00045 return result.size();
00046 }
00047
00048 size_t SteerDesc::fillChipByChamberId(std::vector<ChipInfo_t>& result, i32 chamberId) const
00049 {
00050 std::remove_copy_if(chips.begin() , chips.end() , std::back_inserter(result) , std::bind2nd(filterByChamberId<ChipInfo_t>(), chamberId));
00051 return result.size();
00052 }
00053
00054
00055
00056 bool SteerDesc::isValid(void) const
00057 {
00058 return true;
00059 }
00060
00061
00062 bool SteerDesc::setRun(Run &cible)
00063 {
00064 if ( this->isValid())
00065 {
00066
00067
00068 FILE_LOG(logINFO) << "setRun with date[" << date << "]" << endl;
00069
00070 cible.setDate(date);
00071 cible.getDetector().setDescription(detectorDescription);
00072 cible.getDetector().setName(detectorName);
00073 return true;
00074 }
00075 else
00076 {
00077 return false;
00078 }
00079 }
00080
00081
00082
00083
00084
00085 string SteerDesc::getSlowControlPath()
00086 {
00087 return slowControl;
00088 }
00089
00090
00091
00092
00093 void SteerDesc::print(void) const
00094 {
00095
00096
00097
00098
00099 for ( int index = 0; index < inputFiles.size() ; index++)
00100 {
00101
00102
00103 }
00104
00105
00106
00107 for ( int index = 0; index < chambers.size() ; index++)
00108 {
00109
00110
00111
00112
00113
00114 }
00115 }
00116