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(
111 _tcdsRecordToken(consumes<
TCDSRecord>(iConfig.getParameter<edm::
InputTag>(
"tcdsRecordLabel"))),
112 _confObjectToken((!m_ignoreDB)
113 ? decltype(_confObjectToken){esConsumes<edm::Transition::BeginRun>(
edm::ESInputTag{
131 std::stringstream
ss;
133 edm::LogInfo(
"ConfigurationAtConstruction") << ss.str();
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));
163 LogDebug(
"SiStripConfObjectSummary") << summary.str();
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";
197 bool useTCDS(tcds_pIn.isValid() && !
_forceSCAL);
198 const auto* tcdsRecord = useTCDS ? tcds_pIn.product() :
nullptr;
201 long long orbitoffset = 0;
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)
318 ss <<
_defphases.size() <<
" default phases: ";
324 ss <<
" use ECO: " <<
_useEC0 << std::endl;
325 ss <<
" bad run: " <<
m_badRun << std::endl;
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< TCDSRecord > _tcdsRecordToken
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< std::string > _defpartnames
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
long long _lastOrbitCounter0
EventAuxiliary const & eventAuxiliary() const override
Class to contain information from TCDS FED.
edm::ESWatcher< SiStripConfObjectRcd > m_eswatcher
void beginRun(const edm::Run &, const edm::EventSetup &) override
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
void printConfiguration(std::stringstream &ss) const
~APVCyclePhaseProducerFromL1TS() override
bool isBadRun(const unsigned int) const
Log< level::Info, false > LogInfo
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< int > phases
long long _lastTestEnable
T getParameter(std::string const &) 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