46 {
47 TRG_MSG_DEBUG(
"TriggerThresholdValueLoader loading thresholdvalue with ID = " << ttvTarget.id());
48 L1DataDef def;
49
55 int phimin = 0;
56 int phimax = 0;
58 int etamax = 0;
59 string emisolation = "";
60 string hadisolation = "";
61 string hadveto = "";
62 int window = 0;
63
64 try {
65
66
68
69 coral::ITable&
table =
m_session.nominalSchema().tableHandle(
"L1_TRIGGER_THRESHOLD_VALUE");
71 query->setRowCacheSize( 5 );
72
73
74 coral::AttributeList bindList;
75 bindList.extend<long>("ttvId");
76 std::string cond= "L1TTV_ID = :ttvId";
77 bindList[0].data<long>() = ttvTarget.id();
78 query->setCondition( cond, bindList );
79
80
81 coral::AttributeList attList;
82 attList.extend<std::string>( "L1TTV_NAME" );
83 attList.extend<int>( "L1TTV_VERSION" );
84 attList.extend<std::string>( "L1TTV_TYPE" );
85 attList.extend<std::string>( "L1TTV_PT_CUT" );
86 attList.extend<int>( "L1TTV_ETA_MIN" );
87 attList.extend<int>( "L1TTV_ETA_MAX" );
88 attList.extend<int>( "L1TTV_PHI_MIN" );
89 attList.extend<int>( "L1TTV_PHI_MAX" );
90 attList.extend<std::string>( "L1TTV_EM_ISOLATION" );
91 attList.extend<std::string>( "L1TTV_HAD_ISOLATION" );
92 attList.extend<std::string>( "L1TTV_HAD_VETO" );
93 attList.extend<int>( "L1TTV_WINDOW" );
94 attList.extend<std::string>( "L1TTV_PRIORITY" );
95 query->defineOutput(attList);
96 query->addToOutputList(
"L1TTV_NAME" );
97 query->addToOutputList(
"L1TTV_VERSION" );
98 query->addToOutputList(
"L1TTV_TYPE" );
99 query->addToOutputList(
"L1TTV_PT_CUT" );
100 query->addToOutputList(
"L1TTV_ETA_MIN" );
101 query->addToOutputList(
"L1TTV_ETA_MAX" );
102 query->addToOutputList(
"L1TTV_PHI_MIN" );
103 query->addToOutputList(
"L1TTV_PHI_MAX" );
104 query->addToOutputList(
"L1TTV_EM_ISOLATION" );
105 query->addToOutputList(
"L1TTV_HAD_ISOLATION" );
106 query->addToOutputList(
"L1TTV_HAD_VETO" );
107 query->addToOutputList(
"L1TTV_WINDOW" );
108 query->addToOutputList(
"L1TTV_PRIORITY" );
109
112 msg() <<
"TriggerThresholdValueLoader >> No such TriggerThresholdValue exists "
113 << ttvTarget.id() << std::endl;
116 throw std::runtime_error( "TriggerThresholdValueLoader >> TriggerThresholdValue not available" );
117 }
118
119 const coral::AttributeList&
row =
cursor.currentRow();
120
121 name =
row[
"L1TTV_NAME"].data<std::string>();
123 type =
row[
"L1TTV_TYPE"].data<std::string>();
125 etamin =
row[
"L1TTV_ETA_MIN"].data<
int>();
126 etamax =
row[
"L1TTV_ETA_MAX"].data<
int>();
127 phimin =
row[
"L1TTV_PHI_MIN"].data<
int>();
128 phimax =
row[
"L1TTV_PHI_MAX"].data<
int>();
129 window =
row[
"L1TTV_WINDOW"].data<
int>();
131 emisolation =
row[
"L1TTV_EM_ISOLATION"].data<std::string>();
132 hadisolation =
row[
"L1TTV_HAD_ISOLATION"].data<std::string>();
133 hadveto =
row[
"L1TTV_HAD_VETO"].data<std::string>();
134
135
137 msg() <<
"TriggerThresholdValueLoader >> More than one TriggerThresholdValue exists "
138 << ttvTarget.id() << std::endl;
141 throw std::runtime_error( "TriggerThresholdValueLoader >> TriggerThresholdValue not available" );
142 }
143
144
145 ttvTarget.setName( name );
146 ttvTarget.setVersion( version );
147 ttvTarget.setType( type );
148 ttvTarget.setPtcut( ptcut );
149 ttvTarget.setPriority(priority);
152
153
154 }
155 catch( const coral::Exception& e ) {
157 throw;
158 }
159 catch( const std::exception& e ) {
161 throw;
162 }
163
164 try {
165 ClusterThresholdValue& ctvTarget = dynamic_cast<ClusterThresholdValue&>(ttvTarget);
167 msg() <<
"TriggerThresholdValueLoader >> No type match for ttv_id = "
168 << ctvTarget.id() <<
" " <<
type << std::endl;
169 throw std::runtime_error( "TriggerThresholdValueLoader >> ClusterThresholdValue not available" );
170 }
171
172 cout << "ISO " << emisolation << " " << hadisolation << " " << hadveto << endl;
173
174 if(hadveto=="USEISOBITS" || std::stoi(hadveto)==99 ) {
176 ctvTarget.setUseIsolationMask();
177 } else {
178 ctvTarget.setEmIsolation( std::stof(emisolation) );
179 ctvTarget.setHadIsolation( std::stof(hadisolation) );
180 ctvTarget.setHadVeto( std::stof(hadveto) );
181 ctvTarget.setUseIsolationMask( false );
182 }
183
184
185 ctvTarget.setPhiMin( phimin);
186 ctvTarget.setPhiMax( phimax);
187 ctvTarget.setEtaMin( etamin );
188 ctvTarget.setEtaMax( etamax );
189 } catch (std::bad_cast& ex) { }
190
191
192 try {
193 JetThresholdValue& jtvTarget = dynamic_cast<JetThresholdValue&>(ttvTarget);
194
198 msg() <<
"TriggerThresholdValueLoader >> No type match for ttv_id = "
199 << jtvTarget.id() <<
type << std::endl;
200 throw std::runtime_error( "TriggerThresholdValueLoader >> TriggerThresholdValue not available" );
201 }
202 jtvTarget.setPhiMin( phimin );
203 jtvTarget.setPhiMax( phimax );
204 jtvTarget.setEtaMin( etamin );
205 jtvTarget.setEtaMax( etamax );
206 jtvTarget.setWindow( window );
207 } catch (std::bad_cast& ex) {}
208
209 return true;
210}
char data[hepevt_bytes_allocation_ATLAS]
static std::string & typeAsString(TriggerType tt)
void commitSession()
commit session if not already done
void startSession()
start session if not already active
MsgStreamTC & msg() const
The standard message stream.
row
Appending html table to final .html summary file.
uint32_t bin2uint(const std::string &binary)