64 verbosity(pSet.getUntrackedParameter<unsigned int>(
"verbosity", 1))
74 findingRecord<RPMeasuredAlignmentRecord>();
75 findingRecord<RPRealAlignmentRecord>();
76 findingRecord<RPMisalignedAlignmentRecord>();
90 map< TimeValue_t, vector< pair<bool, const RPAlignmentCorrectionsData*> > > bounds;
92 for (vector<RPAlignmentCorrectionsDataSequence>::const_iterator fit = files.begin(); fit != files.end(); ++fit)
94 for (RPAlignmentCorrectionsDataSequence::const_iterator iit = fit->begin(); iit != fit->end(); ++iit)
99 bounds[tvi.
first].push_back( pair<bool, const RPAlignmentCorrectionsData*>(
true, corr) );
102 bounds[tvi.
last +
delta].push_back( pair<bool, const RPAlignmentCorrectionsData*>(
false, corr) );
107 set<const RPAlignmentCorrectionsData*> accumulator;
110 for (map<
TimeValue_t, vector< pair<bool, const RPAlignmentCorrectionsData*> > >::const_iterator tit = bounds.begin(); tit != bounds.end(); ++tit)
112 for (vector< pair<bool, const RPAlignmentCorrectionsData*> >::const_iterator cit = tit->second.begin(); cit != tit->second.end(); ++cit)
114 bool add = cit->first;
118 accumulator.insert(corr);
120 accumulator.erase(corr);
123 map< TimeValue_t, vector< pair<bool, const RPAlignmentCorrectionsData*> > >::const_iterator tit_next = tit;
125 if (tit_next == bounds.end())
133 printf(
"\tfirst=%10s, last=%10s: alignment blocks=%li\n",
140 for (set<const RPAlignmentCorrectionsData*>::iterator sit = accumulator.begin(); sit != accumulator.end(); ++sit)
141 result[tvi].AddCorrections(*(*sit));
152 printf(
">> TotemRPIncludeAlignments::PrepareSequence(%s)\n", label.c_str());
154 vector<RPAlignmentCorrectionsDataSequence> sequences;
155 for (
unsigned int i = 0;
i < files.size();
i++)
158 seq =
Merge(sequences);
192 printf(
">> TotemRPIncludeAlignments::setIntervalFor(%s)\n", key.
name());
195 strftime(timeStr, 50,
"%F %T", localtime(&unixTime));
196 printf(
"\trun=%u, event=%llu, UNIX timestamp=%lu (%s)\n", iosv.
eventID().
run(), iosv.
eventID().
event(), unixTime, timeStr);
203 if (strcmp(key.
name(),
"RPMeasuredAlignmentRecord") == 0)
209 if (strcmp(key.
name(),
"RPRealAlignmentRecord") == 0)
215 if (strcmp(key.
name(),
"RPMisalignedAlignmentRecord") == 0)
222 throw cms::Exception(
"TotemRPIncludeAlignments::setIntervalFor") <<
"Unknown record " << key.
name();
225 bool next_exists =
false;
228 for (RPAlignmentCorrectionsDataSequence::iterator it = seq->begin(); it != seq->end(); ++it)
230 if (it->first.first <= t && it->first.last >= t)
237 printf(
"\tsetting validity interval [%s, %s]\n",
246 if (t <= it->
first.first)
249 next_start =
min(next_start, it->first.first);
263 printf(
"\tsetting validity interval [%s, %s]\n",
TotemRPIncludeAlignments(const edm::ParameterSet &p)
T getParameter(std::string const &) const
EventNumber_t event() const
virtual ~TotemRPIncludeAlignments()
Time sequence of alignment corrections.
RPAlignmentCorrectionsDataSequence Merge(const std::vector< RPAlignmentCorrectionsDataSequence >) const
merges an array of sequences to one
const EventID & eventID() const
Validity interval in timestamps.
RPAlignmentCorrectionsData acMisaligned
static const IOVSyncValue & endOfTime()
std::auto_ptr< RPAlignmentCorrectionsData > produceReal(const RPRealAlignmentRecord &)
A class adding (mis)alignments to geometry (both real and misaligned).
std::pair< Time_t, Time_t > ValidityInterval
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
RPAlignmentCorrectionsDataSequence acsReal
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
RPAlignmentCorrectionsDataSequence acsMeasured
const IOVSyncValue & last() const
RPAlignmentCorrectionsData acReal
void PrepareSequence(const std::string &label, RPAlignmentCorrectionsDataSequence &seq, const std::vector< std::string > &files) const
builds a sequence of corrections from provided sources and runs a few checks
RPAlignmentCorrectionsData acMeasured
const char * name() const
static std::string ValueToUNIXString(const edm::TimeValue_t &v)
unsigned int unixTime() const
Time in seconds since January 1, 1970.
std::auto_ptr< RPAlignmentCorrectionsData > produceMeasured(const RPMeasuredAlignmentRecord &)
RPAlignmentCorrectionsDataSequence acsMisaligned
unsigned long long TimeValue_t
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
edm::TimeValue_t first
the boundaries (included) of the interval expressed as UNIX timestamps
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Container for RP alignment corrections. The corrections are stored on two levels - RP and sensor...
std::auto_ptr< RPAlignmentCorrectionsData > produceMisaligned(const RPMisalignedAlignmentRecord &)
const Timestamp & time() const
const IOVSyncValue & first() const
static const edm::TimeValue_t EndOfTime()
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
TimeValue_t value() const