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";
201 long long orbitoffset = 0;
203 if (useTCDS &&
iEvent.eventAuxiliary().isRealData()) {
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;
edm::EDGetTokenT< TCDSRecord > _tcdsRecordToken
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::vector< std::string > _defpartnames
T const * product() const
long long _lastOrbitCounter0
Class to contain information from TCDS FED.
edm::ESWatcher< SiStripConfObjectRcd > m_eswatcher
void beginRun(const edm::Run &, const edm::EventSetup &) override
T getUntrackedParameter(std::string const &, T const &) const
U second(std::pair< T, U > const &p)
#define DEFINE_FWK_MODULE(type)
~APVCyclePhaseProducerFromL1TS() override
bool isBadRun(const unsigned int) const
Log< level::Info, false > LogInfo
void produce(edm::Event &, const edm::EventSetup &) override
long long _lastTestEnable
void printConfiguration(std::stringstream &ss) const
std::vector< Level1TriggerScalers > Level1TriggerScalersCollection
bool check(const edm::EventSetup &iSetup)
std::vector< std::pair< unsigned int, unsigned int > > m_badruns
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > _tTopoToken
long long _lastEventCounter0
APVCyclePhaseProducerFromL1TS(const edm::ParameterSet &)
std::vector< int > _defphases
edm::ESGetToken< SiStripConfObject, SiStripConfObjectRcd > _confObjectToken
edm::EDGetTokenT< Level1TriggerScalersCollection > _l1tscollectionToken