20 #include "boost/lexical_cast.hpp" 
   24 #include <CoralBase/Attribute.h> 
   25 #include <CoralBase/AttributeList.h> 
   27 #include "RelationalAccess/SchemaException.h" 
   28 #include "RelationalAccess/ITransaction.h" 
   29 #include "RelationalAccess/ITable.h" 
   30 #include "RelationalAccess/ISchema.h" 
   31 #include "RelationalAccess/ICursor.h" 
   32 #include "RelationalAccess/IQuery.h" 
   49    TRG_MSG_DEBUG(
"TriggerThresholdValueLoader loading thresholdvalue with ID = " << ttvTarget.
id());
 
   61    string emisolation = 
"";
 
   62    string hadisolation = 
"";
 
   71       coral::ITable& 
table = m_session.nominalSchema().tableHandle( 
"L1_TRIGGER_THRESHOLD_VALUE");
 
   73       query->setRowCacheSize( 5 );
 
   77       bindList.extend<
long>(
"ttvId");
 
   78       std::string cond= 
"L1TTV_ID = :ttvId";
 
   79       bindList[0].data<
long>() = ttvTarget.
id();    
 
   80       query->setCondition( cond, bindList );
 
   84       attList.extend<std::string>( 
"L1TTV_NAME" );
 
   85       attList.extend<
int>( 
"L1TTV_VERSION" );
 
   86       attList.extend<std::string>( 
"L1TTV_TYPE" );
 
   87       attList.extend<std::string>( 
"L1TTV_PT_CUT" );
 
   88       attList.extend<
int>( 
"L1TTV_ETA_MIN" );
 
   89       attList.extend<
int>( 
"L1TTV_ETA_MAX" );
 
   90       attList.extend<
int>( 
"L1TTV_PHI_MIN" );
 
   91       attList.extend<
int>( 
"L1TTV_PHI_MAX" );
 
   92       attList.extend<std::string>( 
"L1TTV_EM_ISOLATION" );
 
   93       attList.extend<std::string>( 
"L1TTV_HAD_ISOLATION" );
 
   94       attList.extend<std::string>( 
"L1TTV_HAD_VETO" );
 
   95       attList.extend<
int>( 
"L1TTV_WINDOW" );
 
   96       attList.extend<std::string>( 
"L1TTV_PRIORITY" );
 
   97       query->defineOutput(attList);
 
   98       query->addToOutputList( 
"L1TTV_NAME" );
 
   99       query->addToOutputList( 
"L1TTV_VERSION" ); 
 
  100       query->addToOutputList( 
"L1TTV_TYPE" ); 
 
  101       query->addToOutputList( 
"L1TTV_PT_CUT" ); 
 
  102       query->addToOutputList( 
"L1TTV_ETA_MIN" ); 
 
  103       query->addToOutputList( 
"L1TTV_ETA_MAX" );
 
  104       query->addToOutputList( 
"L1TTV_PHI_MIN" );
 
  105       query->addToOutputList( 
"L1TTV_PHI_MAX" );
 
  106       query->addToOutputList( 
"L1TTV_EM_ISOLATION" ); 
 
  107       query->addToOutputList( 
"L1TTV_HAD_ISOLATION" ); 
 
  108       query->addToOutputList( 
"L1TTV_HAD_VETO" ); 
 
  109       query->addToOutputList( 
"L1TTV_WINDOW" ); 
 
  110       query->addToOutputList( 
"L1TTV_PRIORITY" ); 
 
  114          msg() << 
"TriggerThresholdValueLoader >> No such TriggerThresholdValue exists "  
  115                << ttvTarget.
id() << std::endl;
 
  118          throw std::runtime_error( 
"TriggerThresholdValueLoader >> TriggerThresholdValue not available" );
 
  123       name = 
row[
"L1TTV_NAME"].data<std::string>();
 
  125       type = 
row[
"L1TTV_TYPE"].data<std::string>();
 
  126       ptcut = boost::lexical_cast<float,std::string>(
row[
"L1TTV_PT_CUT"].data<std::string>());
 
  127       etamin = 
row[
"L1TTV_ETA_MIN"].data<
int>();
 
  128       etamax = 
row[
"L1TTV_ETA_MAX"].data<
int>();
 
  129       phimin = 
row[
"L1TTV_PHI_MIN"].data<
int>();
 
  130       phimax = 
row[
"L1TTV_PHI_MAX"].data<
int>();
 
  131       window = 
row[
"L1TTV_WINDOW"].data<
int>();
 
  132       priority = boost::lexical_cast<float,std::string>(
row[
"L1TTV_PRIORITY"].data<std::string>());
 
  133       emisolation = 
row[
"L1TTV_EM_ISOLATION"].data<std::string>();
 
  134       hadisolation = 
row[
"L1TTV_HAD_ISOLATION"].data<std::string>();
 
  135       hadveto = 
row[
"L1TTV_HAD_VETO"].data<std::string>();
 
  139          msg() << 
"TriggerThresholdValueLoader >> More than one TriggerThresholdValue exists "  
  140                << ttvTarget.
id() << std::endl;
 
  143          throw std::runtime_error( 
"TriggerThresholdValueLoader >> TriggerThresholdValue not available" );
 
  157    catch( 
const coral::Exception& 
e ) {
 
  169          msg() << 
"TriggerThresholdValueLoader >> No type match for ttv_id = "  
  170                << ctvTarget.
id() << 
" " << 
type << std::endl;
 
  171          throw std::runtime_error( 
"TriggerThresholdValueLoader >> ClusterThresholdValue not available" );
 
  174       cout << 
"ISO " << emisolation << 
"   " << hadisolation << 
"   " << hadveto << endl;
 
  176       if(hadveto==
"USEISOBITS" || boost::lexical_cast<int,std::string>(hadveto)==99 ) {
 
  180          ctvTarget.
setEmIsolation( boost::lexical_cast<float,std::string>(emisolation) );
 
  181          ctvTarget.
setHadIsolation( boost::lexical_cast<float,std::string>(hadisolation) );
 
  182          ctvTarget.
setHadVeto( boost::lexical_cast<float,std::string>(hadveto) );
 
  191    } 
catch (std::bad_cast& ex) {  }
 
  200          msg() << 
"TriggerThresholdValueLoader >> No type match for ttv_id = "  
  201                << jtvTarget.
id() << 
type << std::endl;
 
  202          throw std::runtime_error( 
"TriggerThresholdValueLoader >> TriggerThresholdValue not available" );
 
  209    } 
catch (std::bad_cast& ex) {}