99 _l1abccollection(iConfig.getParameter<edm::InputTag>(
"l1ABCCollection")),
100 _defpartnames(iConfig.getParameter<std::vector<std::
string> >(
"defaultPartitionNames")),
101 _defphases(iConfig.getParameter<std::vector<int> >(
"defaultPhases")),
102 _orbitoffsetSOR(iConfig.getParameter<int>(
"StartOfRunOrbitOffset")),
103 _wantHistos(iConfig.getUntrackedParameter<bool>(
"wantHistos",
false)),
105 _hbx(0),_hdbx(0),_hdorbit(0),_firstgoodrun(110878),
106 _offsets(), _curroffset(0), _curroffevent(0)
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;
281 iEvent.
put(apvphases);
std::map< unsigned int, long long > _offsets
EventNumber_t event() const
RunHistogramManager m_rhm
const std::vector< std::string > _defpartnames
APVCyclePhaseProducerFromL1ABC(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
const edm::InputTag _l1abccollection
int bunchCrossing() const
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const unsigned int _firstgoodrun
unsigned int offset(bool)
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int _curroffevent
void beginRun(const edm::Run &iRun)
const int _orbitoffsetSOR
const std::vector< int > _defphases
~APVCyclePhaseProducerFromL1ABC()