#include <stdio.h>
#include <iostream>
#include "db/DBInit.h"
#include "configObjects/LdaConfiguration.h"
#include "configObjects/DccConfiguration.h"
#include "configObjects/DifConfiguration.h"
#include "configObjects/AsicConfiguration.h"
#include "configObjects/State.h"
#include "configObjects/Setup.h"
#include "daq/RunInfo.h"
#include <boost/date_time/posix_time/posix_time_types.hpp>
Include dependency graph for ilcConfDb.cc:
Go to the source code of this file.
Namespaces | |
namespace | oracle::occi |
Functions | |
int | main (ub4 argc, char *argv[]) |
int main | ( | ub4 | argc, | |
char * | argv[] | |||
) |
The main function
Definition at line 19 of file ilcConfDb.cc.
00020 { 00021 try{ 00022 00023 unsigned int runId = 0 ; 00024 if ( argc != 2 ) { cout << "Usage: oracle runId" << endl; exit(-1); } 00025 else { runId = atoi(argv[1]); } 00026 cout << "Run Id[" << runId << "]" << endl; 00027 DBInit::init(); 00028 00029 00030 // Setup * setup = Setup::getSetup(setupName); 00031 Setup * setup = Setup::getSetupFromRun(runId); 00032 if ( setup == NULL ) { cout << "Usage: not setup for this runId" << endl; exit(-1); } 00033 00034 vector<State *> states = setup->getStates(); 00035 for ( vector<State*>::const_iterator it = states.begin(); it != states.end() ; it++ ) 00036 { 00037 State * state = *it; 00038 cout << "State name: " << state->getName()<< endl; 00039 00040 00041 // Dif 00042 /* 00043 DifConfiguration *dif_conf = state->getDifConfiguration(); 00044 vector<ConfigObject*> difs = dif_conf->getVector(); 00045 for ( unsigned int i = 0 ; i < difs.size() ; i++ ) 00046 { 00047 int foo = difs[i]->getInt("FOO"); 00048 } 00049 */ 00050 // CC 00051 DccConfiguration *dcc_conf = state->getDccConfiguration(); 00052 vector<ConfigObject*> dccs = dcc_conf->getVector(); 00053 00054 AsicConfiguration *asic_conf = state->getAsicConfiguration() ; 00055 vector<ConfigObject*> asics = asic_conf->getVector(); 00056 cout<<"\t"<<asics.size()<<" asic"<<endl; 00057 for ( unsigned int i = 0 ; i < asics.size() ; i++ ) 00058 { 00059 // cout<<" Recuperation des seuils sur les ASIC :"<<endl; 00060 string type = asics[i]->getString("ASIC_TYPE"); 00061 string mask0 = asics[i]->getString("MASK0"); 00062 string mask1 = asics[i]->getString("MASK1"); 00063 string mask2 = asics[i]->getString("MASK2"); 00064 cout << "mask0[" << mask0 << "]" << endl; 00065 int chipId = asics[i]->getInt("HEADER"); 00066 int difId = asics[i]->getInt("DIF_ID"); 00067 int dac0 = asics[i]->getInt("BB0"); 00068 int dac1 = asics[i]->getInt("BB1"); 00069 int dac2 = asics[i]->getInt("BB2"); 00070 int shaperLg = asics[i]->getInt("SWLG"); 00071 int shaperHg = asics[i]->getInt("SWHG"); 00072 vector<int> pedestal_offset = asics[i]->getIntVector("B0B3"); 00073 for ( unsigned int index = 0; index < pedestal_offset.size() ; index++) 00074 { 00075 cout << "pedestal_offset[" << index << "] = [" << pedestal_offset[index] << "]" << endl; 00076 } 00077 string stimulate = asics[i]->getString("CTEST"); 00078 cout << "CTEST: [" << stimulate << "]" << endl ; 00079 00080 // int foo = asics[i]->getInt("foo"); 00081 // cout << "Asic type:" << type << endl; 00082 // cout<<" Seuils de l'asic en position "<<position<<" sur la dif "<<dif_id<<" : "<<b0<<" "<<b1<<" "<<b2<<endl; 00083 } 00084 } 00085 00086 delete (setup); 00087 00088 } 00089 catch(Exception e){ 00090 cout<<"ERROR: " << e.getMessage()<<endl; 00091 } 00092 DBInit::terminate(); 00093 }