64 virtual void endJob()
override ;
80 std::map<edm::EventNumber_t, long long>
_offsets;
109 produces<APVCyclePhaseCollection,edm::InEvent>();
145 edm::LogInfo(
"AbsoluteBXOffsetReset") <<
"Absolute BX offset map reset";
153 (*_hbx)->GetXaxis()->SetTitle(
"BX"); (*_hbx)->GetYaxis()->SetTitle(
"Events");
157 (*_hdbx)->GetXaxis()->SetTitle(
"#DeltaBX"); (*_hdbx)->GetYaxis()->SetTitle(
"Events");
161 (*_hdorbit)->GetXaxis()->SetTitle(
"#Deltaorbit"); (*_hdorbit)->GetYaxis()->SetTitle(
"Events");
167 edm::LogInfo(
"UnreliableMissingL1AcceptBunchCrossingCollection") <<
168 "In this run L1AcceptBunchCrossingCollection is missing or unreliable: default phases will be used";
178 edm::LogInfo(
"L1AcceptBunchCrossingAbsoluteBXOffsetSummary") <<
"Absolute BX offset summary:";
211 for(L1AcceptBunchCrossingCollection::const_iterator l1abc=pIn->begin();l1abc!=pIn->end();++l1abc) {
212 if(l1abc->l1AcceptOffset()==0) {
213 if(l1abc->eventType()!=0) {
214 orbitoffset = (
long long)iEvent.
orbitNumber() - (
long long)l1abc->orbitNumber() ;
218 if(
_hbx && *
_hbx) (*_hbx)->Fill(l1abc->bunchCrossing());
224 edm::LogWarning(
"L1AcceptBunchCrossingNoType") <<
"L1AcceptBunchCrossing with no type found: ";
225 for(L1AcceptBunchCrossingCollection::const_iterator debu=pIn->begin();debu!=pIn->end();++debu) {
232 long long absbxoffset = orbitoffset*3564 + bxoffset;
234 if(orbitoffset !=
_orbitoffsetSOR) phasechange = (orbitoffset*3564)%70;
245 edm::LogInfo(
"L1AcceptBunchCrossingAbsoluteBXOffsetChanged") <<
"Absolute BX offset changed from " 247 << absbxoffset <<
" at orbit " 250 for(L1AcceptBunchCrossingCollection::const_iterator l1abc=pIn->begin();l1abc!=pIn->end();++l1abc) {
266 if(phases.size() < partnames.size() ) {
268 throw cms::Exception(
"InvalidAPVCyclePhases") <<
" Inconsistent phases/partitions vector sizes: " 269 << phases.size() <<
" " 273 for(
unsigned int ipart=0;ipart<partnames.size();++ipart) {
274 if(phases[ipart]>=0) {
275 apvphases->get()[partnames[ipart]] = (phases[ipart]+phasechange)%70;
EventNumber_t event() const
std::map< edm::EventNumber_t, long long > _offsets
RunHistogramManager m_rhm
const std::vector< std::string > _defpartnames
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
APVCyclePhaseProducerFromL1ABC(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void produce(edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
int bunchCrossing() const
unsigned long long EventNumber_t
virtual void endJob() override
edm::EDGetTokenT< L1AcceptBunchCrossingCollection > _l1abccollectionToken
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
virtual void endRun(const edm::Run &, const edm::EventSetup &) override
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const unsigned int _firstgoodrun
std::vector< L1AcceptBunchCrossing > L1AcceptBunchCrossingCollection
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
std::vector< int > phases
void beginRun(const edm::Run &iRun)
virtual void beginJob() override
const int _orbitoffsetSOR
edm::EventNumber_t _curroffevent
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
const std::vector< int > _defphases
~APVCyclePhaseProducerFromL1ABC()