67 bool isBadRun(
const unsigned int)
const;
85 std::vector<std::pair<unsigned int, unsigned int> >
m_badruns;
107 : m_ignoreDB(iConfig.getUntrackedParameter<
bool>(
"ignoreDB",
false)),
109 _l1tscollectionToken(
112 _confObjectToken((!m_ignoreDB)
113 ? decltype(_confObjectToken){esConsumes<edm::Transition::BeginRun>(
edm::ESInputTag{
115 : decltype(_confObjectToken){}),
116 _tTopoToken((!m_ignoreDB) ? decltype(_tTopoToken){esConsumes<edm::Transition::BeginRun>()}
117 : decltype(_tTopoToken){}),
118 _defpartnames(iConfig.getParameter<std::vector<std::string> >(
"defaultPartitionNames")),
119 _defphases(iConfig.getParameter<std::vector<int> >(
"defaultPhases")),
120 _useEC0(iConfig.getUntrackedParameter<
bool>(
"useEC0",
false)),
121 _magicOffset(iConfig.getUntrackedParameter<
int>(
"magicOffset", 8)),
123 _forceSCAL(iConfig.getParameter<
bool>(
"forceSCAL")),
128 _lastEventCounter0(-1),
129 _lastOrbitCounter0(-1),
130 _lastTestEnable(-1) {
131 std::stringstream
ss;
132 printConfiguration(
ss);
135 produces<APVCyclePhaseCollection, edm::InEvent>();
137 m_badruns.push_back(std::pair<unsigned int, unsigned int>(0, 131767));
138 m_badruns.push_back(std::pair<unsigned int, unsigned int>(193150, 193733));
165 _defpartnames = confObj.get<std::vector<std::string> >(
"defaultPartitionNames");
166 _defphases = confObj.get<std::vector<int> >(
"defaultPhases");
167 _useEC0 = confObj.get<
bool>(
"useEC0");
168 m_badRun = confObj.get<
bool>(
"badRun");
171 std::stringstream
ss;
177 LogDebug(
"UnreliableMissingL1TriggerScalers") <<
"In this run L1TriggerScalers is missing or unreliable for phase "
178 "determination: invlid phase will be returned";
198 const auto* tcdsRecord = useTCDS ? tcds_pIn.
product() :
nullptr;
201 long long orbitoffset = 0;
203 if (useTCDS &&
iEvent.eventAuxiliary().isRealData()) {
205 if (tcdsRecord->getLastResync() != 0) {
230 if (
_lastStart != tcdsRecord->getLastStart()) {
236 phasechange = ((
long long)(orbitoffset * 3564)) % 70;
238 for (
unsigned int ipart = 0; ipart <
phases.size(); ++ipart) {
244 if (!l1ts->empty()) {
245 if ((*l1ts)[0].lastResync() != 0) {
275 phasechange = ((
long long)(orbitoffset * 3564)) % 70;
277 for (
unsigned int ipart = 0; ipart <
phases.size(); ++ipart) {
284 if (
phases.size() < partnames.size()) {
287 <<
" Inconsistent phases/partitions vector sizes: " <<
phases.size() <<
" " << partnames.size();
290 for (
unsigned int ipart = 0; ipart < partnames.size(); ++ipart) {
293 apvphases->get()[partnames[ipart]] =
phases[ipart];
302 for (
std::vector<std::pair<unsigned int, unsigned int> >::const_iterator runpair =
m_badruns.begin();
305 if (
run >= runpair->first && run <= runpair->
second)
324 ss <<
" use ECO: " <<
_useEC0 << std::endl;