70 if (forceGlobalParameters) {
73 if (doGlobalAutoSelection) {
74 if (CatMu.getParameter<
bool>(
"monitor")) {
79 if (CatEG.getParameter<
bool>(
"monitor")) {
84 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
89 if (CatJet.getParameter<
bool>(
"monitor")) {
94 if (CatCenJet.getParameter<
bool>(
"monitor")) {
99 if (CatForJet.getParameter<
bool>(
"monitor")) {
104 if (CatTauJet.getParameter<
bool>(
"monitor")) {
109 if (CatETM.getParameter<
bool>(
"monitor")) {
114 if (CatETT.getParameter<
bool>(
"monitor")) {
119 if (CatHTM.getParameter<
bool>(
"monitor")) {
124 if (CatHTT.getParameter<
bool>(
"monitor")) {
145 if (CatMu.getParameter<
bool>(
"monitor")) {
148 if (CatEG.getParameter<
bool>(
"monitor")) {
151 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
154 if (CatJet.getParameter<
bool>(
"monitor")) {
157 if (CatCenJet.getParameter<
bool>(
"monitor")) {
160 if (CatForJet.getParameter<
bool>(
"monitor")) {
163 if (CatTauJet.getParameter<
bool>(
"monitor")) {
166 if (CatETM.getParameter<
bool>(
"monitor")) {
169 if (CatETT.getParameter<
bool>(
"monitor")) {
172 if (CatHTM.getParameter<
bool>(
"monitor")) {
175 if (CatHTT.getParameter<
bool>(
"monitor")) {
182 if (CatBPTX.getParameter<
bool>(
"monitor")) {
186 if (CatMu.getParameter<
bool>(
"monitor")) {
195 if (CatEG.getParameter<
bool>(
"monitor")) {
204 if (CatIsoEG.getParameter<
bool>(
"monitor")) {
213 if (CatJet.getParameter<
bool>(
"monitor")) {
222 if (CatCenJet.getParameter<
bool>(
"monitor")) {
223 m_algoAutoSelect[
"CenJet"] = CatCenJet.getParameter<
bool>(
"doAutoSelection");
231 if (CatForJet.getParameter<
bool>(
"monitor")) {
232 m_algoAutoSelect[
"CatForJet"] = CatForJet.getParameter<
bool>(
"doAutoSelection");
240 if (CatTauJet.getParameter<
bool>(
"monitor")) {
241 m_algoAutoSelect[
"TauJet"] = CatTauJet.getParameter<
bool>(
"doAutoSelection");
249 if (CatETM.getParameter<
bool>(
"monitor")) {
258 if (CatETT.getParameter<
bool>(
"monitor")) {
267 if (CatHTM.getParameter<
bool>(
"monitor")) {
276 if (CatHTT.getParameter<
bool>(
"monitor")) {
307 cout <<
"[L1TSync] Called beginRun." << endl;
355 "WARNING_DB_INCORRECT_NBUNCHES");
362 string tCategory = (*i).first;
363 string tTrigger = (*i).second;
372 tCategory,
"min #Delta(" + tTrigger +
",Bunch)", maxNbins, -0.5,
double(maxNbins) - 0.5, 5, -2.5, 2.5);
377 ibooker.
book1D(tCategory,
"fraction of in sync: " + tTrigger, maxNbins, -0.5,
double(maxNbins) - 0.5);
387 cout <<
"[L1TSync] Called beginLuminosityBlock." << endl;
394 cout <<
"[L1TSync] None consecutive: doFractionInSync() - LAST=" <<
m_currentLS 405 string theTriggerAlias = (*i).second;
422 cout <<
"[L1TSync] Called endLuminosityBlock." << endl;
432 string theTriggerAlias = (*i).second;
439 cout <<
"[L1TSync] Regular call: doFractionInSync()" << endl;
450 string theTriggerAlias = (*i).second;
469 string theTriggerAlias = (*i).second;
476 cout <<
"[L1TSync] Error call: doFractionInSync()" << endl;
484 cout <<
"[L1TSync] Called analyze." << endl;
498 if (gtEvmReadoutRecord.
isValid()) {
500 unsigned int lhcBeamMode = gtfeEvmWord.
beamMode();
507 if (lhcBeamMode !=
STABLE) {
530 if (gtReadoutRecordData.
isValid()) {
531 const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->
gtFdlVector();
535 string tTrigger = (*i).second;
538 if (tTrigger !=
"Undefined" && tTrigger !=
"Undefined (Wrong Name)") {
539 bool beamSingleConfig =
false;
540 bool firedAlgo =
false;
544 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
546 if (gtFdlVectorData[
a].bxInEvent() == 0) {
547 eventBx = gtFdlVectorData[
a].localBxNr();
548 if (gtFdlVectorData[
a].gtDecisionWord()[
m_algoBit[tTrigger]]) {
556 beamSingleConfig =
true;
559 beamSingleConfig =
true;
566 if (firedAlgo && !beamSingleConfig) {
567 int DifAlgoVsBunchStructure = 9999;
569 for (
unsigned int a = 0;
a < gtFdlVectorData.size();
a++) {
570 int bxFDL = gtFdlVectorData[
a].localBxNr();
571 int bxInEvent = gtFdlVectorData[
a].bxInEvent();
574 DifAlgoVsBunchStructure = -1 * bxInEvent;
603 myOMDSHelper.connect(oracleDB, pathCondDB, conError);
607 cout <<
"[L1TSync] Connected to DB with no error." << endl;
615 cout <<
"[L1TSync] Retriving LHC Bunch Structure: NO_ERROR" << endl;
621 cout <<
"[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_CONN_FAILED" << endl;
629 cout <<
"[L1TSync] Retriving LHC Bunch Structure: WARNING_DB_QUERY_FAILED" << endl;
637 cout <<
"[L1TSync] Retriving LHC Bunch Structure: UNKNOWN" << endl;
648 cout <<
"[L1TSync] Connect to DB: WARNING_DB_CONN_FAILED" << endl;
656 cout <<
"[L1TSync] Connect to DB: UNKNOWN" << endl;
677 string theCategory = (*i).first;
678 string theTriggerAlias = (*i).second;
685 bool triggerAlias_isValid = theTriggerAlias !=
"Undefined" && theTriggerAlias !=
"Undefined (Wrong Name)";
686 bool lsBlock_exists = !(fLS == 0 && lLS == 0);
687 bool lsBlock_isValid = fLS <= lLS && fLS > 0 && lLS > 0;
689 if (triggerAlias_isValid && lsBlock_exists && lsBlock_isValid) {
691 if (iForce && iBad) {
700 double CountSync = 0;
704 for (
unsigned int ls = fLS;
ls <= lLS;
ls++) {
706 for (
int a = 1;
a < 6;
a++) {
712 cout <<
"Alias = " << theTriggerAlias <<
" InitLS=" << fLS <<
" EndLS=" << lLS <<
" Events=" << CountAll;
719 cout <<
" <--------------- Enough Statistics: ";
725 fraction = CountSync / CountAll;
748 if (!triggerAlias_isValid) {
758 if (lsBlock_exists && !lsBlock_isValid) {
783 for (
int ls = binInit;
ls <= binEnd;
ls++) {
LuminosityBlockID id() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< TString, int > m_algoBit
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
void doFractionInSync(bool iForce=false, bool iBad=false)
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
const std::vector< L1GtFdlWord > gtFdlVector() const
get the vector of L1GtFdlWord
L1TSync(const edm::ParameterSet &ps)
void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
BeamConfiguration m_beamConfig
std::map< TString, MonitorElement * > m_algoVsBunchStructure
void certifyLSBlock(std::string iTrigger, int iInitLs, int iEndLs, float iValue)
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
Abs< T >::type abs(const T &t)
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
std::map< TString, unsigned int > m_certFirstLS
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDataDaqInputTag
std::map< std::string, bool > m_algoAutoSelect
const cms_uint32_t lhcFillNumber() const
edm::ParameterSet m_parameters
LuminosityBlockNumber_t luminosityBlock() const
void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c) override
std::map< TString, MonitorElement * > m_algoCertification
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::map< TString, unsigned int > m_certLastLS
std::vector< bool > beam2
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * m_ErrorMonitor
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmSource
std::vector< bool > beam1
const cms_uint16_t beamMode() const
T const * product() const
std::map< std::string, std::string > m_selectedTriggers
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
BeginRun.