67 bool isBadRun(
const unsigned int)
const;
84 std::vector<std::pair<unsigned int, unsigned int> >
m_badruns;
107 _l1tscollectionToken(
110 m_ignoreDB(iConfig.getUntrackedParameter<
bool>(
"ignoreDB",
false)),
111 m_rcdLabel(iConfig.getUntrackedParameter<
std::
string>(
"recordLabel",
"apvphaseoffsets")),
112 _defpartnames(iConfig.getParameter<
std::vector<
std::
string> >(
"defaultPartitionNames")),
113 _defphases(iConfig.getParameter<
std::vector<
int> >(
"defaultPhases")),
114 _useEC0(iConfig.getUntrackedParameter<
bool>(
"useEC0",
false)),
115 _magicOffset(iConfig.getUntrackedParameter<
int>(
"magicOffset", 8)),
117 _forceSCAL(iConfig.getParameter<
bool>(
"forceSCAL")),
122 _lastEventCounter0(-1),
123 _lastOrbitCounter0(-1),
124 _lastTestEnable(-1) {
125 std::stringstream
ss;
129 produces<APVCyclePhaseCollection, edm::InEvent>();
131 m_badruns.push_back(std::pair<unsigned int, unsigned int>(0, 131767));
132 m_badruns.push_back(std::pair<unsigned int, unsigned int>(193150, 193733));
163 _defpartnames = confObj->
get<std::vector<std::string> >(
"defaultPartitionNames");
164 _defphases = confObj->
get<std::vector<int> >(
"defaultPhases");
169 std::stringstream
ss;
175 LogDebug(
"UnreliableMissingL1TriggerScalers") <<
"In this run L1TriggerScalers is missing or unreliable for phase "
176 "determination: invlid phase will be returned";
196 const auto* tcdsRecord = useTCDS ? tcds_pIn.
product() :
nullptr;
199 long long orbitoffset = 0;
201 if (useTCDS &&
iEvent.eventAuxiliary().isRealData()) {
203 if (tcdsRecord->getLastResync() != 0) {
228 if (
_lastStart != tcdsRecord->getLastStart()) {
234 phasechange = ((
long long)(orbitoffset * 3564)) % 70;
236 for (
unsigned int ipart = 0; ipart <
phases.size(); ++ipart) {
242 if (!l1ts->empty()) {
243 if ((*l1ts)[0].lastResync() != 0) {
273 phasechange = ((
long long)(orbitoffset * 3564)) % 70;
275 for (
unsigned int ipart = 0; ipart <
phases.size(); ++ipart) {
282 if (
phases.size() < partnames.size()) {
285 <<
" Inconsistent phases/partitions vector sizes: " <<
phases.size() <<
" " << partnames.size();
288 for (
unsigned int ipart = 0; ipart < partnames.size(); ++ipart) {
291 apvphases->get()[partnames[ipart]] =
phases[ipart];
300 for (std::vector<std::pair<unsigned int, unsigned int> >::const_iterator runpair =
m_badruns.begin();
303 if (
run >= runpair->first && run <= runpair->
second)
322 ss <<
" use ECO: " <<
_useEC0 << std::endl;