Skip to content

Commit

Permalink
Merge pull request #13542 from Martin-Grunewald/L1TGlobalSummaryL1TGl…
Browse files Browse the repository at this point in the history
…obalUtils

 L1TGlobalSummary and update of L1TGlobalUtils
  • Loading branch information
cmsbuild committed Mar 2, 2016
2 parents cad854b + cc82549 commit 3e6fdb0
Show file tree
Hide file tree
Showing 5 changed files with 385 additions and 58 deletions.
95 changes: 95 additions & 0 deletions L1Trigger/L1TCommon/python/customiseDemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,98 @@ def L1TBasicDemo(process):
process.schedule.append(process.l1tBasicDemoPath)
return process

def L1THLTDemo(process):
print "L1T INFO: adding HLT demo module to the process."
#
# BEGIN HLT UNPACKER SEQUENCE FOR STAGE 2
#

process.hltGtStage2Digis = cms.EDProducer(
"L1TRawToDigi",
Setup = cms.string("stage2::GTSetup"),
FedIds = cms.vint32( 1404 ),
)

process.hltCaloStage2Digis = cms.EDProducer(
"L1TRawToDigi",
Setup = cms.string("stage2::CaloSetup"),
FedIds = cms.vint32( 1360, 1366 ),
)

process.hltGmtStage2Digis = cms.EDProducer(
"L1TRawToDigi",
Setup = cms.string("stage2::GMTSetup"),
FedIds = cms.vint32(1402),
)

process.hltGtStage2ObjectMap = cms.EDProducer(
"L1TGlobalProducer",
GmtInputTag = cms.InputTag("hltGmtStage2Digis"),
ExtInputTag = cms.InputTag("hltGtStage2Digis"), # (external conditions are not emulated, use unpacked)
CaloInputTag = cms.InputTag("hltCaloStage2Digis"),
AlgorithmTriggersUnprescaled = cms.bool(True),
AlgorithmTriggersUnmasked = cms.bool(True),
)

# keeping same sequence name as for legacy system:
process.HLTL1UnpackerSequence = cms.Sequence(
process.hltGtStage2Digis +
process.hltCaloStage2Digis +
process.hltGmtStage2Digis +
process.hltGtStage2ObjectMap
)

#
# END HLT UNPACKER SEQUENCE FOR STAGE 2
#

#
# BEGIN L1T SEEDS EXAMPLE FOR STAGE 2
#
process.hltL1TSeed = cms.EDFilter(
"HLTL1TSeed",
L1SeedsLogicalExpression = cms.string( "L1_SingleS1Jet36 AND L1_SingleEG10" ),
SaveTags = cms.bool( True ),
L1ObjectMapInputTag = cms.InputTag("hltGtStage2ObjectMap"),
L1GlobalInputTag = cms.InputTag("hltGtStage2Digis"),
L1MuonInputTag = cms.InputTag("hltGmtStage2Digis"),
L1EGammaInputTag = cms.InputTag("hltCaloStage2Digis"),
L1JetInputTag = cms.InputTag("hltCaloStage2Digis"),
L1TauInputTag = cms.InputTag("hltCaloStage2Digis"),
L1EtSumInputTag = cms.InputTag("hltCaloStage2Digis"),
)

# HLT Seed sequence
process.HLTL1TSeedSequence = cms.Sequence(
process.hltL1TSeed
)

#
# END L1T SEEDS EXAMPLE FOR STAGE 2
#

print "L1T INFO: will dump a summary of Stage2 content as unpacked by HLT to screen."
process.load('L1Trigger.L1TCommon.l1tSummaryStage2HltDigis_cfi')

# gt analyzer
process.l1tGlobalSummary = cms.EDAnalyzer(
'L1TGlobalSummary',
AlgInputTag = cms.InputTag("hltGtStage2ObjectMap"),
ExtInputTag = cms.InputTag("hltGtStage2ObjectMap"),
# DumpTrigResults = cms.bool(True), # per event dump of trig results
DumpTrigSummary = cms.bool(True), # job summary... not yet implemented...
)

process.HLTL1TDebugSequence = cms.Sequence(process.l1tSummaryStage2HltDigis + process.l1tGlobalSummary)



print "L1T Input: HLTL1UnpackerSequence: "
print process.HLTL1UnpackerSequence
print "L1T Input: HLTL1TSeedSequence: "
print process.HLTL1TSeedSequence
print "L1T Input: HLTL1TDebugSequence: "
print process.HLTL1TDebugSequence
process.l1tHLTDemoPath = cms.Path(process.HLTL1UnpackerSequence + process.HLTL1TSeedSequence + process.HLTL1TDebugSequence)
process.schedule.append(process.l1tHLTDemoPath)
return process
50 changes: 20 additions & 30 deletions L1Trigger/L1TGlobal/interface/L1TGlobalUtil.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
// L1TGlobalUtil: Utility class for parsing the L1 Trigger Menu

#ifndef L1TGlobalUtil_h
#define L1TGlobalUtil_h

/**
* \class L1TGlobalUtil
*
*
* Description: Accessor Class for uGT Result
*
* Implementation:
* <TODO: enter implementation details>
*
*/

// system include files
#include <vector>

#include "L1Trigger/L1TGlobal/interface/TriggerMenu.h"
#include "CondFormats/L1TObjects/interface/L1TUtmTriggerMenu.h"

// Objects to produce for the output record.
#include "DataFormats/L1TGlobal/interface/GlobalAlgBlk.h"
Expand All @@ -35,30 +26,27 @@

namespace l1t {

class L1TGlobalUtil
{

public:
class L1TGlobalUtil{

// constructors
L1TGlobalUtil(std::string preScaleFileName, unsigned int psColumn);
public:
L1TGlobalUtil();
~L1TGlobalUtil();

// destructor
virtual ~L1TGlobalUtil();

public:
// OverridePrescalesAndMasks
// The ability to override the prescale/mask file will not be part of the permanent interface of this class.
// It is provided only until prescales and masks are available as CondFormats...
// Most users should simply ignore this method and use the default ctor only!
// Will look for prescale csv file in L1Trigger/L1TGlobal/data/Luminosity/startup/<filename>
void OverridePrescalesAndMasks(std::string filename, unsigned int psColumn=1);

/// initialize the class (mainly reserve)
void retrieveL1(const edm::Event& iEvent, const edm::EventSetup& evSetup,
edm::EDGetToken gtAlgToken);


public:

inline void setVerbosity(const int verbosity) {
m_verbosity = verbosity;
}


inline bool getFinalOR() {return m_finalOR;}

Expand Down Expand Up @@ -110,7 +98,12 @@ class L1TGlobalUtil
// Access Masks (see note) above
inline const std::vector<std::pair<std::string, bool> >& masks() { return m_masks; }
inline const std::vector<std::pair<std::string, bool> >& vetoMasks() { return m_vetoMasks; }


// Menu names
inline const std::string& gtTriggerMenuName() const {return m_l1GtMenu->getName();}
inline const std::string& gtTriggerMenuVersion() const {return m_l1GtMenu->getVersion();}
inline const std::string& gtTriggerMenuComment() const {return m_l1GtMenu->getComment();}

private:

/// clear decision vectors on a menu change
Expand All @@ -120,7 +113,7 @@ class L1TGlobalUtil
void loadPrescalesAndMasks();

// trigger menu
const TriggerMenu* m_l1GtMenu;
const L1TUtmTriggerMenu* m_l1GtMenu;
unsigned long long m_l1GtMenuCacheID;

// prescales and masks
Expand All @@ -130,8 +123,6 @@ class L1TGlobalUtil
//const AlgorithmMap* m_algorithmMap;
const std::map<std::string, L1TUtmAlgorithm>* m_algorithmMap;

private:

// Number of physics triggers
unsigned int m_numberPhysTriggers;

Expand Down Expand Up @@ -163,7 +154,6 @@ class L1TGlobalUtil
/// verbosity level
int m_verbosity;


};

}
Expand Down
6 changes: 2 additions & 4 deletions L1Trigger/L1TGlobal/plugins/GtRecordDump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,8 @@ namespace l1t {

std::string preScaleFileName = iConfig.getParameter<std::string>("psFileName");
unsigned int preScColumn = iConfig.getParameter<int>("psColumn");

edm::FileInPath f1("L1Trigger/L1TGlobal/data/Luminosity/startup/" + preScaleFileName);

m_gtUtil = new L1TGlobalUtil(f1.fullPath(),preScColumn);
m_gtUtil = new L1TGlobalUtil();
m_gtUtil->OverridePrescalesAndMasks(preScaleFileName,preScColumn);
}

// loop over events
Expand Down
Loading

0 comments on commit 3e6fdb0

Please sign in to comment.