/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/tools/SteerDesc.cpp

Go to the documentation of this file.
00001 /* @version $Revision: 1703 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2012-05-03 10:11:12 +0200 (Thu, 03 May 2012) $ */
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   //monitoringDif = 0;
00029 } // SteerDesc
00030 
00031 //----------------------------//
00032 SteerDesc::~SteerDesc() {
00033 }
00034 
00035 //---------------------------- fillDifByChamberId ----------------------
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  //---------------------------- fillDifByChamberId ----------------------
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  //---------------------------- fillDifByChamberId ----------------------
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 //---------------------------- isValid ----------------------
00056 bool SteerDesc::isValid(void) const
00057 {
00058   return true;
00059 }
00060 
00061 //---------------------------- setRun ----------------------
00062 bool SteerDesc::setRun(Run &cible)
00063 {
00064   if ( this->isValid())
00065   {
00066     // set run
00067         //      cout << "setRun with date[" << date <<  "]"  << endl;
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    //FILE_LOG(logDEBUG) << date << endl;
00096    //FILE_LOG(logDEBUG) << slowControl << endl;
00097 
00098 
00099    for ( int index = 0; index < inputFiles.size() ; index++)
00100    {
00101   //FILE_LOG(logDEBUG) << inputFiles[index].path << " , type: ";
00102   //FILE_LOG(logDEBUG) << inputFiles[index].type << endl;
00103    }
00104    //FILE_LOG(logDEBUG) << outputFile << endl;;
00105    //FILE_LOG(logDEBUG) << detectorName << endl;;
00106 
00107    for ( int index = 0; index < chambers.size() ; index++)
00108    {
00109   //FILE_LOG(logDEBUG) << chambers[index].type << endl;
00110   //FILE_LOG(logDEBUG) << chambers[index].xPos << endl;
00111   //FILE_LOG(logDEBUG) << chambers[index].yPos << endl;
00112   //FILE_LOG(logDEBUG) << chambers[index].zPos << endl;
00113   //FILE_LOG(logDEBUG) << chambers[index].id << endl;
00114    }
00115 }
00116 

Generated on Mon Jun 11 16:55:46 2012 for MicromegasFramework by  doxygen 1.4.7