CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FillInfoPopConSourceHandler Class Reference

#include <FillInfoPopConSourceHandler.h>

Inheritance diagram for FillInfoPopConSourceHandler:
popcon::PopConSourceHandler< FillInfo >

Public Member Functions

 FillInfoPopConSourceHandler (const edm::ParameterSet &pset)
 
void getNewObjects () override
 
std::string id () const override
 
 ~FillInfoPopConSourceHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< FillInfo >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

std::string m_authpath
 
std::string m_connectionString
 
bool m_debug
 
std::string m_dipSchema
 
unsigned short m_firstFill
 
unsigned short m_lastFill
 
std::string m_name
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< FillInfo >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< FillInfo *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< FillInfoself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef FillInfo value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< FillInfo >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< FillInfo >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 10 of file FillInfoPopConSourceHandler.h.

Constructor & Destructor Documentation

◆ FillInfoPopConSourceHandler()

FillInfoPopConSourceHandler::FillInfoPopConSourceHandler ( const edm::ParameterSet pset)

Definition at line 20 of file FillInfoPopConSourceHandler.cc.

21  : m_debug(pset.getUntrackedParameter<bool>("debug", false)),
22  m_firstFill((unsigned short)pset.getUntrackedParameter<unsigned int>("firstFill", 1)),
23  m_lastFill((unsigned short)pset.getUntrackedParameter<unsigned int>("lastFill", m_firstFill)),
24  m_name(pset.getUntrackedParameter<std::string>("name", "FillInfoPopConSourceHandler")),
25  m_connectionString(pset.getUntrackedParameter<std::string>("connectionString", "")),
26  m_dipSchema(pset.getUntrackedParameter<std::string>("DIPSchema", "")),
27  m_authpath(pset.getUntrackedParameter<std::string>("authenticationPath", "")) {}

◆ ~FillInfoPopConSourceHandler()

FillInfoPopConSourceHandler::~FillInfoPopConSourceHandler ( )
override

Definition at line 29 of file FillInfoPopConSourceHandler.cc.

29 {}

Member Function Documentation

◆ getNewObjects()

void FillInfoPopConSourceHandler::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< FillInfo >.

Definition at line 31 of file FillInfoPopConSourceHandler.cc.

31  {
32  //reference to the last payload in the tag
33  Ref previousFill;
34 
35  //if a new tag is created, transfer fake fill from 1 to the first fill for the first time
36  if (tagInfo().size == 0) {
37  edm::LogInfo(m_name) << "New tag " << tagInfo().name << "; from " << m_name << "::getNewObjects";
38  } else {
39  //check what is already inside the database
40  edm::LogInfo(m_name) << "got info for tag " << tagInfo().name << ": size " << tagInfo().size
41  << ", last object valid since " << tagInfo().lastInterval.since << " ( "
42  << boost::posix_time::to_iso_extended_string(
43  cond::time::to_boost(tagInfo().lastInterval.since))
44  << " ); from " << m_name << "::getNewObjects";
45  //retrieve the last payload...
46  previousFill = this->lastPayload();
47  //checking its content
48  edm::LogInfo(m_name) << "The last payload in tag " << tagInfo().name << " valid since "
49  << tagInfo().lastInterval.since << " has token " << tagInfo().lastInterval.payloadId
50  << " and values:\n"
51  << *previousFill << "from " << m_name << "::getNewObjects";
52  if (m_firstFill <= previousFill->fillNumber()) {
53  //either we are trying to put the same value, or we want to put an older fill:
54  //the first fill will become the previous one plus one
55  std::ostringstream es;
56  es << "Trying to insert fill number " << m_firstFill
57  << ((m_firstFill < previousFill->fillNumber()) ? ", which is an older fill than "
58  : ", which is the same fill as ")
59  << "the last one in the destination tag " << previousFill->fillNumber()
60  << ": the first fill to be looked for will become " << previousFill->fillNumber() + 1;
61  edm::LogWarning(m_name) << es.str() << "; from " << m_name << "::getNewObjects";
62  m_firstFill = previousFill->fillNumber() + 1;
63  }
64  }
65 
66  //if the last fill to be looked for is smaller than the first one send error message and return
67  //this check cannot be done before, as we should find which is the first fill to query
68  if (m_firstFill > m_lastFill) {
69  edm::LogError(m_name) << "WRONG CONFIGURATION! The first fill " << m_firstFill
70  << " cannot be larger than the last one " << m_lastFill << " EXITING. from " << m_name
71  << "::getNewObjects";
72  return;
73  }
74 
75  //retrieve the data from the relational database source
77  //configure the connection
78  if (m_debug) {
80  } else {
82  }
84  connection.configure();
85  //create a sessiom
87  //run the first query against the schema logging fill information
88  coral::ISchema &runTimeLoggerSchema = session.nominalSchema();
89  //start the transaction against the fill logging schema
90  session.transaction().start(true);
91  //prepare the query:
92  std::unique_ptr<coral::IQuery> fillDataQuery(runTimeLoggerSchema.newQuery());
93  //FROM clause
94  fillDataQuery->addToTableList(std::string("RUNTIME_SUMMARY"));
95  //SELECT clause
96  fillDataQuery->addToOutputList(std::string("LHCFILL"));
97  fillDataQuery->addToOutputList(std::string("NBUNCHESBEAM1"));
98  fillDataQuery->addToOutputList(std::string("NBUNCHESBEAM2"));
99  fillDataQuery->addToOutputList(std::string("NCOLLIDINGBUNCHES"));
100  fillDataQuery->addToOutputList(std::string("NTARGETBUNCHES"));
101  fillDataQuery->addToOutputList(std::string("RUNTIME_TYPE_ID"));
102  fillDataQuery->addToOutputList(std::string("PARTY1"));
103  fillDataQuery->addToOutputList(std::string("PARTY2"));
104  fillDataQuery->addToOutputList(std::string("CROSSINGANGLE"));
105  fillDataQuery->addToOutputList(std::string("BETASTAR"));
106  fillDataQuery->addToOutputList(std::string("INTENSITYBEAM1"));
107  fillDataQuery->addToOutputList(std::string("INTENSITYBEAM2"));
108  fillDataQuery->addToOutputList(std::string("ENERGY"));
109  fillDataQuery->addToOutputList(std::string("CREATETIME"));
110  fillDataQuery->addToOutputList(std::string("BEGINTIME"));
111  fillDataQuery->addToOutputList(std::string("ENDTIME"));
112  fillDataQuery->addToOutputList(std::string("INJECTIONSCHEME"));
113  //WHERE clause
114  coral::AttributeList fillDataBindVariables;
115  fillDataBindVariables.extend(std::string("firstFillNumber"), typeid(unsigned short));
116  fillDataBindVariables[std::string("firstFillNumber")].data<unsigned short>() = m_firstFill;
117  fillDataBindVariables.extend(std::string("lastFillNumber"), typeid(unsigned short));
118  fillDataBindVariables[std::string("lastFillNumber")].data<unsigned short>() = m_lastFill;
119  //by imposing BEGINTIME IS NOT NULL, we remove fills which never went into stable beams,
120  //or the most recent one, just declared but not yet in stable beams
121  std::string conditionStr("BEGINTIME IS NOT NULL AND LHCFILL BETWEEN :firstFillNumber AND :lastFillNumber");
122  fillDataQuery->setCondition(conditionStr, fillDataBindVariables);
123  //ORDER BY clause
124  fillDataQuery->addToOrderList(std::string("LHCFILL"));
125  //define query output
126  coral::AttributeList fillDataOutput;
127  fillDataOutput.extend<unsigned short>(std::string("LHCFILL"));
128  fillDataOutput.extend<unsigned short>(std::string("NBUNCHESBEAM1"));
129  fillDataOutput.extend<unsigned short>(std::string("NBUNCHESBEAM2"));
130  fillDataOutput.extend<unsigned short>(std::string("NCOLLIDINGBUNCHES"));
131  fillDataOutput.extend<unsigned short>(std::string("NTARGETBUNCHES"));
132  fillDataOutput.extend<int>(std::string("RUNTIME_TYPE_ID"));
133  fillDataOutput.extend<int>(std::string("PARTY1"));
134  fillDataOutput.extend<int>(std::string("PARTY2"));
135  fillDataOutput.extend<float>(std::string("CROSSINGANGLE"));
136  fillDataOutput.extend<float>(std::string("BETASTAR"));
137  fillDataOutput.extend<float>(std::string("INTENSITYBEAM1"));
138  fillDataOutput.extend<float>(std::string("INTENSITYBEAM2"));
139  fillDataOutput.extend<float>(std::string("ENERGY"));
140  fillDataOutput.extend<coral::TimeStamp>(std::string("CREATETIME"));
141  fillDataOutput.extend<coral::TimeStamp>(std::string("BEGINTIME"));
142  fillDataOutput.extend<coral::TimeStamp>(std::string("ENDTIME"));
143  fillDataOutput.extend<std::string>(std::string("INJECTIONSCHEME"));
144  fillDataQuery->defineOutput(fillDataOutput);
145  //execute the query
146  coral::ICursor &fillDataCursor = fillDataQuery->execute();
147  //initialize loop variables
148  unsigned short previousFillNumber = 1, currentFill = m_firstFill;
149  cond::Time_t previousFillEndTime = 0ULL, afterPreviousFillEndTime = 0ULL, beforeStableBeamStartTime = 0ULL;
150  if (tagInfo().size > 0) {
151  previousFillNumber = previousFill->fillNumber();
152  previousFillEndTime = previousFill->endTime();
153  }
154  unsigned short bunches1 = 0, bunches2 = 0, collidingBunches = 0, targetBunches = 0;
156  FillInfo::ParticleTypeId particleType1 = FillInfo::NONE, particleType2 = FillInfo::NONE;
157  float crossingAngle = 0., betastar = 0., intensityBeam1 = 0., intensityBeam2 = 0., energy = 0.;
158  coral::TimeStamp stableBeamStartTimeStamp, beamDumpTimeStamp;
159  cond::Time_t creationTime = 0ULL, stableBeamStartTime = 0ULL, beamDumpTime = 0ULL;
160  std::string injectionScheme("None");
161  std::ostringstream ss;
162  //loop over the cursor where the result of the query were fetched
163  while (fillDataCursor.next()) {
164  if (m_debug) {
165  std::ostringstream qs;
166  fillDataCursor.currentRow().toOutputStream(qs);
167  edm::LogInfo(m_name) << qs.str() << "\nfrom " << m_name << "::getNewObjects";
168  }
169  currentFill = fillDataCursor.currentRow()[std::string("LHCFILL")].data<unsigned short>();
170  coral::Attribute const &bunches1Attribute = fillDataCursor.currentRow()[std::string("NBUNCHESBEAM1")];
171  if (bunches1Attribute.isNull()) {
172  bunches1 = 0;
173  } else {
174  bunches1 = bunches1Attribute.data<unsigned short>();
175  }
176  coral::Attribute const &bunches2Attribute = fillDataCursor.currentRow()[std::string("NBUNCHESBEAM2")];
177  if (bunches2Attribute.isNull()) {
178  bunches2 = 0;
179  } else {
180  bunches2 = bunches2Attribute.data<unsigned short>();
181  }
182  coral::Attribute const &collidingBunchesAttribute = fillDataCursor.currentRow()[std::string("NCOLLIDINGBUNCHES")];
183  if (collidingBunchesAttribute.isNull()) {
184  collidingBunches = 0;
185  } else {
186  collidingBunches = collidingBunchesAttribute.data<unsigned short>();
187  }
188  coral::Attribute const &targetBunchesAttribute = fillDataCursor.currentRow()[std::string("NTARGETBUNCHES")];
189  if (targetBunchesAttribute.isNull()) {
190  targetBunches = 0;
191  } else {
192  targetBunches = targetBunchesAttribute.data<unsigned short>();
193  }
194  //RUNTIME_TYPE_ID IS NOT NULL
195  fillType =
196  static_cast<FillInfo::FillTypeId>(fillDataCursor.currentRow()[std::string("RUNTIME_TYPE_ID")].data<int>());
197  coral::Attribute const &particleType1Attribute = fillDataCursor.currentRow()[std::string("PARTY1")];
198  if (particleType1Attribute.isNull()) {
199  particleType1 = FillInfo::NONE;
200  } else {
201  particleType1 = static_cast<FillInfo::ParticleTypeId>(particleType1Attribute.data<int>());
202  }
203  coral::Attribute const &particleType2Attribute = fillDataCursor.currentRow()[std::string("PARTY2")];
204  if (particleType2Attribute.isNull()) {
205  particleType2 = FillInfo::NONE;
206  } else {
207  particleType2 = static_cast<FillInfo::ParticleTypeId>(particleType2Attribute.data<int>());
208  }
209  coral::Attribute const &crossingAngleAttribute = fillDataCursor.currentRow()[std::string("CROSSINGANGLE")];
210  if (crossingAngleAttribute.isNull()) {
211  crossingAngle = 0.;
212  } else {
213  crossingAngle = crossingAngleAttribute.data<float>();
214  }
215  coral::Attribute const &betastarAttribute = fillDataCursor.currentRow()[std::string("BETASTAR")];
216  if (betastarAttribute.isNull()) {
217  betastar = 0.;
218  } else {
219  betastar = betastarAttribute.data<float>();
220  }
221  coral::Attribute const &intensityBeam1Attribute = fillDataCursor.currentRow()[std::string("INTENSITYBEAM1")];
222  if (intensityBeam1Attribute.isNull()) {
223  intensityBeam1 = 0.;
224  } else {
225  intensityBeam1 = intensityBeam1Attribute.data<float>();
226  }
227  coral::Attribute const &intensityBeam2Attribute = fillDataCursor.currentRow()[std::string("INTENSITYBEAM2")];
228  if (intensityBeam2Attribute.isNull()) {
229  intensityBeam2 = 0.;
230  } else {
231  intensityBeam2 = intensityBeam2Attribute.data<float>();
232  }
233  coral::Attribute const &energyAttribute = fillDataCursor.currentRow()[std::string("ENERGY")];
234  if (energyAttribute.isNull()) {
235  energy = 0.;
236  } else {
237  energy = energyAttribute.data<float>();
238  }
239  //CREATETIME IS NOT NULL
240  creationTime =
241  cond::time::from_boost(fillDataCursor.currentRow()[std::string("CREATETIME")].data<coral::TimeStamp>().time());
242  //BEGINTIME is imposed to be NOT NULL in the WHERE clause
243  stableBeamStartTimeStamp = fillDataCursor.currentRow()[std::string("BEGINTIME")].data<coral::TimeStamp>();
244  stableBeamStartTime = cond::time::from_boost(stableBeamStartTimeStamp.time());
245  coral::Attribute const &beamDumpTimeAttribute = fillDataCursor.currentRow()[std::string("ENDTIME")];
246  if (beamDumpTimeAttribute.isNull()) {
247  beamDumpTime = 0;
248  } else {
249  beamDumpTimeStamp = beamDumpTimeAttribute.data<coral::TimeStamp>();
250  beamDumpTime = cond::time::from_boost(beamDumpTimeStamp.time());
251  }
252  coral::Attribute const &injectionSchemeAttribute = fillDataCursor.currentRow()[std::string("INJECTIONSCHEME")];
253  if (injectionSchemeAttribute.isNull()) {
254  injectionScheme = std::string("None");
255  } else {
256  injectionScheme = injectionSchemeAttribute.data<std::string>();
257  }
258  //fix an inconsistency in RunTimeLogger: if the fill type is defined, the particle type should reflect it!
259  if (fillType != FillInfo::UNKNOWN && (particleType1 == FillInfo::NONE || particleType2 == FillInfo::NONE)) {
260  switch (fillType) {
261  case FillInfo::PROTONS:
262  particleType1 = FillInfo::PROTON;
263  particleType2 = FillInfo::PROTON;
264  break;
265  case FillInfo::IONS:
266  particleType1 = FillInfo::PB82;
267  particleType2 = FillInfo::PB82;
268  break;
269  case FillInfo::UNKNOWN:
270  case FillInfo::COSMICS:
271  case FillInfo::GAP:
272  break;
273  }
274  }
275  //if the end time of the fill is 0 (i.e. timestamp null), it is still ongoing: do not store!
276  if (beamDumpTime == 0) {
277  edm::LogWarning(m_name) << "NO TRANSFER NEEDED: the fill number " << currentFill << " is still ongoing"
278  << "; from " << m_name << "::getNewObjects";
279  continue;
280  }
281  //run the second and third query against the schema hosting detailed DIP information
282  coral::ISchema &beamCondSchema = session.coralSession().schema(m_dipSchema);
283  //start the transaction against the DIP "deep" database backend schema
284  session.transaction().start(true);
285  //prepare the WHERE clause for both queries
286  coral::AttributeList bunchConfBindVariables;
287  bunchConfBindVariables.extend<coral::TimeStamp>(std::string("stableBeamStartTimeStamp"));
288  bunchConfBindVariables[std::string("stableBeamStartTimeStamp")].data<coral::TimeStamp>() = stableBeamStartTimeStamp;
289  conditionStr = std::string("DIPTIME <= :stableBeamStartTimeStamp");
290  //define the output types for both queries
291  coral::AttributeList bunchConfOutput;
292  bunchConfOutput.extend<coral::TimeStamp>(std::string("DIPTIME"));
293  bunchConfOutput.extend<unsigned short>(std::string("BUCKET"));
294  //execute query for Beam 1
295  std::unique_ptr<coral::IQuery> bunchConf1Query(beamCondSchema.newQuery());
296  bunchConf1Query->addToTableList(std::string("LHC_CIRCBUNCHCONFIG_BEAM1"),
297  std::string("BEAMCONF\", TABLE( BEAMCONF.VALUE ) \"BUCKETS"));
298  bunchConf1Query->addToOutputList(std::string("BEAMCONF.DIPTIME"), std::string("DIPTIME"));
299  bunchConf1Query->addToOutputList(std::string("BUCKETS.COLUMN_VALUE"), std::string("BUCKET"));
300  bunchConf1Query->setCondition(conditionStr, bunchConfBindVariables);
301  bunchConf1Query->addToOrderList(std::string("DIPTIME DESC"));
302  bunchConf1Query->limitReturnedRows(FillInfo::availableBunchSlots); //maximum number of filled bunches
303  bunchConf1Query->defineOutput(bunchConfOutput);
304  coral::ICursor &bunchConf1Cursor = bunchConf1Query->execute();
305  std::bitset<FillInfo::bunchSlots + 1> bunchConfiguration1(0ULL);
306  while (bunchConf1Cursor.next()) {
307  if (m_debug) {
308  std::ostringstream b1s;
309  fillDataCursor.currentRow().toOutputStream(b1s);
310  edm::LogInfo(m_name) << b1s.str() << "\nfrom " << m_name << "::getNewObjects";
311  }
312  //bunchConf1Cursor.currentRow().toOutputStream( std::cout ) << std::endl;
313  if (bunchConf1Cursor.currentRow()[std::string("BUCKET")].data<unsigned short>() != 0) {
314  unsigned short slot =
315  (bunchConf1Cursor.currentRow()[std::string("BUCKET")].data<unsigned short>() - 1) / 10 + 1;
316  bunchConfiguration1[slot] = true;
317  }
318  }
319  //execute query for Beam 2
320  std::unique_ptr<coral::IQuery> bunchConf2Query(beamCondSchema.newQuery());
321  bunchConf2Query->addToTableList(std::string("LHC_CIRCBUNCHCONFIG_BEAM2"),
322  std::string("BEAMCONF\", TABLE( BEAMCONF.VALUE ) \"BUCKETS"));
323  bunchConf2Query->addToOutputList(std::string("BEAMCONF.DIPTIME"), std::string("DIPTIME"));
324  bunchConf2Query->addToOutputList(std::string("BUCKETS.COLUMN_VALUE"), std::string("BUCKET"));
325  bunchConf2Query->setCondition(conditionStr, bunchConfBindVariables);
326  bunchConf2Query->addToOrderList(std::string("DIPTIME DESC"));
327  bunchConf2Query->limitReturnedRows(FillInfo::availableBunchSlots); //maximum number of filled bunches
328  bunchConf2Query->defineOutput(bunchConfOutput);
329  coral::ICursor &bunchConf2Cursor = bunchConf2Query->execute();
330  std::bitset<FillInfo::bunchSlots + 1> bunchConfiguration2(0ULL);
331  while (bunchConf2Cursor.next()) {
332  if (m_debug) {
333  std::ostringstream b2s;
334  fillDataCursor.currentRow().toOutputStream(b2s);
335  edm::LogInfo(m_name) << b2s.str() << "\nfrom " << m_name << "::getNewObjects";
336  }
337  if (bunchConf2Cursor.currentRow()[std::string("BUCKET")].data<unsigned short>() != 0) {
338  unsigned short slot =
339  (bunchConf2Cursor.currentRow()[std::string("BUCKET")].data<unsigned short>() - 1) / 10 + 1;
340  bunchConfiguration2[slot] = true;
341  }
342  }
343  //commit the transaction against the DIP "deep" database backend schema
344  session.transaction().commit();
345 
346  //store dummy fill information if empty fills are found beetween the two last ones in stable beams
347  afterPreviousFillEndTime = cond::time::pack(std::make_pair(cond::time::unpack(previousFillEndTime).first,
348  cond::time::unpack(previousFillEndTime).second + 1));
349  beforeStableBeamStartTime = cond::time::pack(std::make_pair(cond::time::unpack(stableBeamStartTime).first,
350  cond::time::unpack(stableBeamStartTime).second - 1));
351  if (afterPreviousFillEndTime < stableBeamStartTime) {
352  edm::LogInfo(m_name) << "Entering fake fill between fill number " << previousFillNumber
353  << " and current fill number " << currentFill << ", from " << afterPreviousFillEndTime
354  << " ( "
355  << boost::posix_time::to_iso_extended_string(cond::time::to_boost(afterPreviousFillEndTime))
356  << " ) to " << beforeStableBeamStartTime << " ( "
357  << boost::posix_time::to_iso_extended_string(cond::time::to_boost(beforeStableBeamStartTime))
358  << " ); from " << m_name << "::getNewObjects";
359  m_to_transfer.push_back(std::make_pair(new FillInfo(), afterPreviousFillEndTime));
360  } else {
361  //the current fill cannot start before the previous one!
362  edm::LogError(m_name) << "WRONG DATA! In the previous fill number " << previousFillNumber
363  << " beams were dumped at timestamp "
364  << boost::posix_time::to_iso_extended_string(cond::time::to_boost(previousFillEndTime))
365  << ", which is not before the timestamp "
366  << boost::posix_time::to_iso_extended_string(cond::time::to_boost(stableBeamStartTime))
367  << " when current fill number " << currentFill << " entered stable beams. EXITING. from "
368  << m_name << "::getNewObjects";
369  return;
370  }
371  //construct an instance of FillInfo and set its values
372  FillInfo *fillInfo = new FillInfo(currentFill);
373  fillInfo->setBeamInfo(const_cast<unsigned short const &>(bunches1),
374  const_cast<unsigned short const &>(bunches2),
375  const_cast<unsigned short const &>(collidingBunches),
376  const_cast<unsigned short const &>(targetBunches),
377  const_cast<FillInfo::FillTypeId const &>(fillType),
378  const_cast<FillInfo::ParticleTypeId const &>(particleType1),
379  const_cast<FillInfo::ParticleTypeId const &>(particleType2),
380  const_cast<float const &>(crossingAngle),
381  const_cast<float const &>(betastar),
382  const_cast<float const &>(intensityBeam1),
383  const_cast<float const &>(intensityBeam2),
384  const_cast<float const &>(energy),
385  const_cast<cond::Time_t const &>(creationTime),
386  const_cast<cond::Time_t const &>(stableBeamStartTime),
387  const_cast<cond::Time_t const &>(beamDumpTime),
388  const_cast<std::string const &>(injectionScheme),
389  const_cast<std::bitset<FillInfo::bunchSlots + 1> const &>(bunchConfiguration1),
390  const_cast<std::bitset<FillInfo::bunchSlots + 1> const &>(bunchConfiguration2));
391  //store this payload
392  m_to_transfer.push_back(std::make_pair((FillInfo *)fillInfo, stableBeamStartTime));
393  edm::LogInfo(m_name) << "The new payload to be inserted into tag " << tagInfo().name << " with validity "
394  << stableBeamStartTime << " ( "
395  << boost::posix_time::to_iso_extended_string(cond::time::to_boost(stableBeamStartTime))
396  << " ) has values:\n"
397  << *fillInfo << "from " << m_name << "::getNewObjects";
398  //add log information
399  ss << " fill = " << currentFill << ";\tinjection scheme: " << injectionScheme
400  << ";\tstart time: " << boost::posix_time::to_iso_extended_string(stableBeamStartTimeStamp.time())
401  << ";\tend time: " << boost::posix_time::to_iso_extended_string(beamDumpTimeStamp.time()) << "." << std::endl;
402  //prepare variables for next iteration
403  previousFillNumber = currentFill;
404  previousFillEndTime = beamDumpTime;
405  }
406  //commit the transaction against the fill logging schema
407  session.transaction().commit();
408  //close the session
409  session.close();
410  //store log information
411  m_userTextLog = ss.str();
412  edm::LogInfo(m_name) << "Transferring " << m_to_transfer.size() << " payload(s); from " << m_name
413  << "::getNewObjects";
414 }

References FillInfo::availableBunchSlots, cond::persistency::Session::close(), cond::persistency::Transaction::commit(), cond::persistency::ConnectionPool::configure(), cond::persistency::Session::coralSession(), FillInfo::COSMICS, cond::persistency::ConnectionPool::createSession(), BeamSpotPI::creationTime, Debug, HCALHighEnergyHPDFilter_cfi::energy, first, cond::time::from_boost(), FillInfo::GAP, FillInfo::IONS, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< FillInfo >::lastPayload(), m_authpath, m_connectionString, m_debug, m_dipSchema, m_firstFill, m_lastFill, m_name, popcon::PopConSourceHandler< FillInfo >::m_to_transfer, popcon::PopConSourceHandler< FillInfo >::m_userTextLog, cond::TagInfo_t::name, cond::persistency::Session::nominalSchema(), FillInfo::NONE, cond::time::pack(), cond::Iov_t::payloadId, FillInfo::PB82, FillInfo::PROTON, FillInfo::PROTONS, edm::second(), cond::persistency::ConnectionPool::setAuthenticationPath(), FillInfo::setBeamInfo(), cond::persistency::ConnectionPool::setMessageVerbosity(), cond::Iov_t::since, cond::TagInfo_t::size, findQualityFiles::size, contentValuesCheck::ss, cond::persistency::Transaction::start(), AlCaHLTBitMon_QueryRunRegistry::string, popcon::PopConSourceHandler< FillInfo >::tagInfo(), protons_cff::time, cond::time::to_boost(), cond::persistency::Session::transaction(), FillInfo::UNKNOWN, and cond::time::unpack().

◆ id()

std::string FillInfoPopConSourceHandler::id ( ) const
overridevirtual

Implements popcon::PopConSourceHandler< FillInfo >.

Definition at line 416 of file FillInfoPopConSourceHandler.cc.

416 { return m_name; }

References m_name.

Member Data Documentation

◆ m_authpath

std::string FillInfoPopConSourceHandler::m_authpath
private

Definition at line 22 of file FillInfoPopConSourceHandler.h.

Referenced by getNewObjects().

◆ m_connectionString

std::string FillInfoPopConSourceHandler::m_connectionString
private

Definition at line 22 of file FillInfoPopConSourceHandler.h.

Referenced by getNewObjects().

◆ m_debug

bool FillInfoPopConSourceHandler::m_debug
private

Definition at line 18 of file FillInfoPopConSourceHandler.h.

Referenced by getNewObjects().

◆ m_dipSchema

std::string FillInfoPopConSourceHandler::m_dipSchema
private

Definition at line 22 of file FillInfoPopConSourceHandler.h.

Referenced by getNewObjects().

◆ m_firstFill

unsigned short FillInfoPopConSourceHandler::m_firstFill
private

Definition at line 19 of file FillInfoPopConSourceHandler.h.

Referenced by getNewObjects().

◆ m_lastFill

unsigned short FillInfoPopConSourceHandler::m_lastFill
private

Definition at line 19 of file FillInfoPopConSourceHandler.h.

Referenced by getNewObjects().

◆ m_name

std::string FillInfoPopConSourceHandler::m_name
private

Definition at line 20 of file FillInfoPopConSourceHandler.h.

Referenced by getNewObjects(), and id().

popcon::PopConSourceHandler< FillInfo >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
FillInfoPopConSourceHandler::m_firstFill
unsigned short m_firstFill
Definition: FillInfoPopConSourceHandler.h:19
cond::time::to_boost
boost::posix_time::ptime to_boost(Time_t iValue)
Definition: TimeConversions.h:39
FillInfo
Definition: FillInfo.h:13
protons_cff.time
time
Definition: protons_cff.py:35
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
FillInfoPopConSourceHandler::m_dipSchema
std::string m_dipSchema
Definition: FillInfoPopConSourceHandler.h:22
FillInfo::COSMICS
Definition: FillInfo.h:15
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
cond::persistency::Session::close
void close()
Definition: Session.cc:50
cond::persistency::ConnectionPool::createSession
Session createSession(const std::string &connectionString, bool writeCapable=false)
Definition: ConnectionPool.cc:174
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
FillInfoPopConSourceHandler::m_debug
bool m_debug
Definition: FillInfoPopConSourceHandler.h:18
cond::TagInfo_t::name
std::string name
Definition: Types.h:72
FillInfo::availableBunchSlots
static const size_t availableBunchSlots
Definition: FillInfo.h:27
FillInfo::NONE
Definition: FillInfo.h:16
cond::time::pack
cond::Time_t pack(cond::UnpackedTime iValue)
Definition: TimeConversions.h:26
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
Debug
const bool Debug
Definition: CosmicMuonParameters.h:12
FillInfo::setBeamInfo
void setBeamInfo(unsigned short const &bunches1, unsigned short const &bunches2, unsigned short const &collidingBunches, unsigned short const &targetBunches, FillTypeId const &fillType, ParticleTypeId const &particleType1, ParticleTypeId const &particleType2, float const &angle, float const &beta, float const &intensity1, float const &intensity2, float const &energy, cond::Time_t const &createTime, cond::Time_t const &beginTime, cond::Time_t const &endTime, std::string const &scheme, std::bitset< bunchSlots+1 > const &bunchConf1, std::bitset< bunchSlots+1 > const &bunchConf2)
Definition: FillInfo.cc:238
cond::persistency::ConnectionPool
Definition: ConnectionPool.h:35
FillInfo::IONS
Definition: FillInfo.h:15
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
FillInfoPopConSourceHandler::m_connectionString
std::string m_connectionString
Definition: FillInfoPopConSourceHandler.h:22
cond::persistency::ConnectionPool::setMessageVerbosity
void setMessageVerbosity(coral::MsgLevel level)
Definition: ConnectionPool.cc:188
FillInfoPopConSourceHandler::m_lastFill
unsigned short m_lastFill
Definition: FillInfoPopConSourceHandler.h:19
popcon::PopConSourceHandler< FillInfo >::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition: PopConSourceHandler.h:78
cond::Iov_t::payloadId
Hash payloadId
Definition: Types.h:55
cond::time::from_boost
Time_t from_boost(boost::posix_time::ptime bt)
Definition: TimeConversions.h:43
cond::persistency::Session::nominalSchema
coral::ISchema & nominalSchema()
Definition: Session.cc:224
cond::persistency::Session
Definition: Session.h:63
cond::Iov_t::since
Time_t since
Definition: Types.h:53
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
FillInfo::PROTON
Definition: FillInfo.h:16
leef::Error
edm::ErrorSummaryEntry Error
Definition: LogErrorEventFilter.cc:29
cond::persistency::Transaction::commit
void commit()
Definition: Session.cc:23
cond::persistency::Session::coralSession
coral::ISessionProxy & coralSession()
Definition: Session.cc:218
cond::persistency::ConnectionPool::setAuthenticationPath
void setAuthenticationPath(const std::string &p)
Definition: ConnectionPool.cc:35
BeamSpotPI::creationTime
Definition: BeamSpotPayloadInspectorHelper.h:44
cond::persistency::ConnectionPool::configure
void configure()
Definition: ConnectionPool.cc:129
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
FillInfo::UNKNOWN
Definition: FillInfo.h:15
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
cond::persistency::Session::transaction
Transaction & transaction()
Definition: Session.cc:52
FillInfo::FillType
FillType
Definition: FillInfo.h:15
cond::persistency::Transaction::start
void start(bool readOnly=true)
Definition: Session.cc:18
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition: JetExtendedAssociation.h:32
FillInfoPopConSourceHandler::m_name
std::string m_name
Definition: FillInfoPopConSourceHandler.h:20
popcon::PopConSourceHandler< FillInfo >::lastPayload
Ref lastPayload() const
Definition: PopConSourceHandler.h:81
FillInfo::PB82
Definition: FillInfo.h:16
FillInfo::GAP
Definition: FillInfo.h:15
cond::time::unpack
cond::UnpackedTime unpack(cond::Time_t iValue)
Definition: TimeConversions.h:22
FillInfoPopConSourceHandler::m_authpath
std::string m_authpath
Definition: FillInfoPopConSourceHandler.h:22
popcon::PopConSourceHandler< FillInfo >::m_userTextLog
std::string m_userTextLog
Definition: PopConSourceHandler.h:168
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
FillInfo::PROTONS
Definition: FillInfo.h:15
cond::TagInfo_t::size
size_t size
Definition: Types.h:74
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
FillInfo::ParticleType
ParticleType
Definition: FillInfo.h:16