54 {
55
58 }
else if(
data.id()!=0 ) {
60 } else {
61 TRG_MSG_ERROR(
"Can not load CaloInfo which has no id or SMK specified");
62 throw runtime_error("Can not load CaloInfo, no SMK or Id specified");
63 }
64
65
66
67 try {
69
71
72 unique_ptr<coral::IQuery>
q(
m_session.nominalSchema().newQuery());
73 q->addToTableList(
"L1_CALO_INFO",
"L1CI" );
74 q->setRowCacheSize( 5 );
75
76
77 coral::AttributeList bindList;
78 bindList.extend<int>("Id");
79 std::string cond("");
81 q->addToTableList(
"SUPER_MASTER_TABLE",
"SMT" );
82 q->addToTableList(
"L1_MASTER_TABLE",
"L1M" );
83 cond = "SMT.SMT_ID = :Id";
84 cond += " AND SMT.SMT_L1_MASTER_TABLE_ID = L1M.L1MT_ID";
85 cond += " AND L1CI.L1CI_ID = L1M.L1MT_CALO_INFO_ID";
86 bindList[0].data<
int>() =
data.smk();
87 } else {
88 cond = "L1CI.L1CI_ID = :Id";
89 bindList[0].data<
int>() =
data.id();
90 }
91 q->setCondition( cond, bindList );
92
93
94 coral::AttributeList attList;
95 attList.extend<std::string>( "L1CI.L1CI_NAME" );
96 attList.extend<int>( "L1CI.L1CI_VERSION" );
98 attList.extend<std::string>( "L1CI.L1CI_GLOBAL_SCALE" );
99 } else {
100 attList.extend<float>( "L1CI.L1CI_GLOBAL_EM_SCALE" );
101 attList.extend<float>( "L1CI.L1CI_GLOBAL_JET_SCALE" );
102 }
104 attList.extend<int>( "L1CI.L1CI_XS_SIGMA_SCALE" );
105 attList.extend<int>( "L1CI.L1CI_XS_SIGMA_OFFSET" );
106 attList.extend<int>( "L1CI.L1CI_XS_XE_MIN" );
107 attList.extend<int>( "L1CI.L1CI_XS_XE_MAX" );
108 attList.extend<int>( "L1CI.L1CI_XS_TESQRT_MIN" );
109 attList.extend<int>( "L1CI.L1CI_XS_TESQRT_MAX" );
110 }
112 for(
unsigned int index = 1;
index <= 12 ;
index++) {
113 std::stringstream helpstring;
114 helpstring <<
"L1CI.L1CI_JET_WEIGHT" <<
index;
115 attList.extend<int>( helpstring.str() );
116 }
117 }
119 attList.extend<int>( "L1CI.L1CI_MIN_TOB_EM" );
120 attList.extend<int>( "L1CI.L1CI_MIN_TOB_TAU" );
121 attList.extend<int>( "L1CI.L1CI_MIN_TOB_JETS" );
122 attList.extend<int>( "L1CI.L1CI_MIN_TOB_JETL" );
123 attList.extend<int>( "L1CI.L1CI_ISO_HA_EM" );
124 attList.extend<int>( "L1CI.L1CI_ISO_EM_EM" );
125 attList.extend<int>( "L1CI.L1CI_ISO_EM_TAU" );
126 }
127
128
130
131 coral::ICursor&
cursor =
q->execute();
132
136 } else {
138 }
140 throw std::runtime_error( "CaloInfoLoader >> CaloInfo not available" );
141 }
142
143
144 const coral::AttributeList&
row =
cursor.currentRow();
148 if(schema <= 6)
150 else
152 } else {
153 data.setGlobalEmScale( row[
"L1CI.L1CI_GLOBAL_EM_SCALE"].
data<float>() );
154 data.setGlobalJetScale( row[
"L1CI.L1CI_GLOBAL_JET_SCALE"].
data<float>() );
155 }
157 for(
unsigned int index = 1;
index <= 12 ;
index++) {
158 std::stringstream helpstring;
159 helpstring <<
"L1CI.L1CI_JET_WEIGHT" <<
index;
160 data.addJetWeight(
static_cast<int>(row[helpstring.str()].data<
int>()) );
161 }
162 }
164 int XSSigmaScale =
row[
"L1CI.L1CI_XS_SIGMA_SCALE"].data<
int>();
165 int XSSigmaOffset =
row[
"L1CI.L1CI_XS_SIGMA_OFFSET"].data<
int>();
166 int XEmin =
row[
"L1CI.L1CI_XS_XE_MIN"].data<
int>();
167 int XEmax =
row[
"L1CI.L1CI_XS_XE_MAX"].data<
int>();
168 int TESqrtMin =
row[
"L1CI.L1CI_XS_TESQRT_MIN"].data<
int>();
169 int TESqrtMax =
row[
"L1CI.L1CI_XS_TESQRT_MAX"].data<
int>();
170 data.metSigParam().setValues( XSSigmaScale, XSSigmaOffset,
171 XEmin, XEmax, TESqrtMin, TESqrtMax);
172 }
173
174 vector<int> mintobIDs;
175 vector<int> isoparIDs;
177 mintobIDs.push_back(row[
"L1CI.L1CI_MIN_TOB_EM"].
data<int>());
178 mintobIDs.push_back(row[
"L1CI.L1CI_MIN_TOB_TAU"].
data<int>());
179 mintobIDs.push_back(row[
"L1CI.L1CI_MIN_TOB_JETS"].
data<int>());
180 mintobIDs.push_back(row[
"L1CI.L1CI_MIN_TOB_JETL"].
data<int>());
181 isoparIDs.push_back(row[
"L1CI.L1CI_ISO_HA_EM"].
data<int>());
182 isoparIDs.push_back(row[
"L1CI.L1CI_ISO_EM_EM"].
data<int>());
183 isoparIDs.push_back(row[
"L1CI.L1CI_ISO_EM_TAU"].
data<int>());
184 }
185
186
189 throw std::runtime_error( "Too many CaloInfo objects" );
190 }
191
195 }
196
198 }
199 catch( const coral::Exception& e ) {
202 throw;
203 }
204 return true;
205}
char data[hepevt_bytes_allocation_ATLAS]
void loadMinTobInfo(CaloInfo &data, const std::vector< int > &mintobIDs)
void loadIsolationInfo(CaloInfo &data, const std::vector< int > &isoparIDs)
void commitSession()
commit session if not already done
unsigned int triggerDBSchemaVersion()
void startSession()
start session if not already active
row
Appending html table to final .html summary file.
void fillQuery(coral::IQuery *q, coral::AttributeList &attList)