67 bool isBadRun(
const unsigned int)
const;
82 std::vector<std::pair<unsigned int, unsigned int> >
m_badruns;
109 m_ignoreDB(iConfig.getUntrackedParameter<bool>(
"ignoreDB",
false)),
110 m_rcdLabel(iConfig.getUntrackedParameter<std::
string>(
"recordLabel",
"apvphaseoffsets")),
111 _defpartnames(iConfig.getParameter<std::vector<std::
string> >(
"defaultPartitionNames")),
112 _defphases(iConfig.getParameter<std::vector<int> >(
"defaultPhases")),
113 _useEC0(iConfig.getUntrackedParameter<bool>(
"useEC0",
false)),
114 _magicOffset(iConfig.getUntrackedParameter<int>(
"magicOffset",8)),
117 _lastResync(-1),_lastHardReset(-1),_lastStart(-1),
118 _lastEventCounter0(-1),_lastOrbitCounter0(-1),_lastTestEnable(-1)
121 std::stringstream
ss;
123 edm::LogInfo(
"ConfigurationAtConstruction") << ss.str();
126 produces<APVCyclePhaseCollection,edm::InEvent>();
128 m_badruns.push_back(std::pair<unsigned int, unsigned int>(0,131767));
129 m_badruns.push_back(std::pair<unsigned int, unsigned int>(193150,193733));
162 confObj->printDebug(summary);
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;
179 LogDebug(
"UnreliableMissingL1TriggerScalers") <<
180 "In this run L1TriggerScalers is missing or unreliable for phase determination: invlid phase will be returned";
206 long long orbitoffset = 0;
210 if((*l1ts)[0].lastResync()!=0) {
240 phasechange = ((
long long)(orbitoffset*3564))%70;
242 for(
unsigned int ipart=0;ipart<phases.size();++ipart) {
243 phases[ipart] = (
_defphases[ipart]+phasechange)%70;
250 if(phases.size() < partnames.size() ) {
252 throw cms::Exception(
"InvalidAPVCyclePhases") <<
" Inconsistent phases/partitions vector sizes: "
253 << phases.size() <<
" "
257 for(
unsigned int ipart=0;ipart<partnames.size();++ipart) {
260 apvphases->get()[partnames[ipart]] = phases[ipart];
266 iEvent.
put(apvphases);
273 for(std::vector<std::pair<unsigned int, unsigned int> >::const_iterator runpair =
m_badruns.begin();runpair!=
m_badruns.end();++runpair) {
274 if( run >= runpair->first && run <= runpair->
second)
return true;
289 ss <<
_defphases.size() <<
" default phases: ";
290 for(std::vector<int>::const_iterator phase=
_defphases.begin();phase!=
_defphases.end();++phase) {
295 ss <<
" use ECO: " <<
_useEC0 << std::endl;
296 ss <<
" bad run: " <<
m_badRun << std::endl;
std::vector< std::string > _defpartnames
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
long long _lastOrbitCounter0
edm::ESWatcher< SiStripConfObjectRcd > m_eswatcher
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
U second(std::pair< T, U > const &p)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void printConfiguration(std::stringstream &ss) const
bool isBadRun(const unsigned int) const
virtual void produce(edm::Event &, const edm::EventSetup &) override
long long _lastTestEnable
std::vector< Level1TriggerScalers > Level1TriggerScalersCollection
bool check(const edm::EventSetup &iSetup)
std::vector< std::pair< unsigned int, unsigned int > > m_badruns
const std::string m_rcdLabel
long long _lastEventCounter0
APVCyclePhaseProducerFromL1TS(const edm::ParameterSet &)
std::vector< int > _defphases
volatile std::atomic< bool > shutdown_flag false
~APVCyclePhaseProducerFromL1TS()
edm::EDGetTokenT< Level1TriggerScalersCollection > _l1tscollectionToken