43 std::cout <<
"Initalizing HLTConfigProvider" << std::endl;
62 for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
63 iParam != parameterNames.end(); iParam++ ){
64 if ( (*iParam) ==
"Debug" )
_Debug = myHltParams.getParameter<
bool>( *iParam );
70 const int kMaxTrigFlag = 10000;
74 const int kMaxL1Flag = 10000;
75 l1flag =
new int[kMaxL1Flag];
81 const int kMaxHLTPart = 10000;
82 hltppt =
new float[kMaxHLTPart];
83 hltpeta =
new float[kMaxHLTPart];
84 const int kMaxL1ExtEmI = 10000;
89 const int kMaxL1ExtEmN = 10000;
94 const int kMaxL1ExtMu = 10000;
105 const int kMaxL1ExtJtC = 10000;
110 const int kMaxL1ExtJtF = 10000;
115 const int kMaxL1ExtJt = 10000;
120 const int kMaxL1ExtTau = 10000;
129 HltTree->Branch(
"NL1IsolEm",&
nl1extiem,
"NL1IsolEm/I");
130 HltTree->Branch(
"L1IsolEmEt",
l1extiemet,
"L1IsolEmEt[NL1IsolEm]/F");
131 HltTree->Branch(
"L1IsolEmE",
l1extieme,
"L1IsolEmE[NL1IsolEm]/F");
132 HltTree->Branch(
"L1IsolEmEta",
l1extiemeta,
"L1IsolEmEta[NL1IsolEm]/F");
133 HltTree->Branch(
"L1IsolEmPhi",
l1extiemphi,
"L1IsolEmPhi[NL1IsolEm]/F");
134 HltTree->Branch(
"NL1NIsolEm",&
nl1extnem,
"NL1NIsolEm/I");
135 HltTree->Branch(
"L1NIsolEmEt",
l1extnemet,
"L1NIsolEmEt[NL1NIsolEm]/F");
136 HltTree->Branch(
"L1NIsolEmE",
l1extneme,
"L1NIsolEmE[NL1NIsolEm]/F");
137 HltTree->Branch(
"L1NIsolEmEta",
l1extnemeta,
"L1NIsolEmEta[NL1NIsolEm]/F");
138 HltTree->Branch(
"L1NIsolEmPhi",
l1extnemphi,
"L1NIsolEmPhi[NL1NIsolEm]/F");
139 HltTree->Branch(
"NL1Mu",&
nl1extmu,
"NL1Mu/I");
140 HltTree->Branch(
"L1MuPt",
l1extmupt,
"L1MuPt[NL1Mu]/F");
141 HltTree->Branch(
"L1MuE",
l1extmue,
"L1MuE[NL1Mu]/F");
142 HltTree->Branch(
"L1MuEta",
l1extmueta,
"L1MuEta[NL1Mu]/F");
143 HltTree->Branch(
"L1MuPhi",
l1extmuphi,
"L1MuPhi[NL1Mu]/F");
144 HltTree->Branch(
"L1MuIsol",
l1extmuiso,
"L1MuIsol[NL1Mu]/I");
145 HltTree->Branch(
"L1MuMip",
l1extmumip,
"L1MuMip[NL1Mu]/I");
146 HltTree->Branch(
"L1MuFor",
l1extmufor,
"L1MuFor[NL1Mu]/I");
147 HltTree->Branch(
"L1MuRPC",
l1extmurpc,
"L1MuRPC[NL1Mu]/I");
148 HltTree->Branch(
"L1MuQal",
l1extmuqul,
"L1MuQal[NL1Mu]/I");
149 HltTree->Branch(
"L1MuChg",
l1extmuchg,
"L1MuChg[NL1Mu]/I");
150 HltTree->Branch(
"NL1CenJet",&
nl1extjetc,
"NL1CenJet/I");
151 HltTree->Branch(
"L1CenJetEt",
l1extjtcet,
"L1CenJetEt[NL1CenJet]/F");
152 HltTree->Branch(
"L1CenJetE",
l1extjtce,
"L1CenJetE[NL1CenJet]/F");
153 HltTree->Branch(
"L1CenJetEta",
l1extjtceta,
"L1CenJetEta[NL1CenJet]/F");
154 HltTree->Branch(
"L1CenJetPhi",
l1extjtcphi,
"L1CenJetPhi[NL1CenJet]/F");
155 HltTree->Branch(
"NL1ForJet",&
nl1extjetf,
"NL1ForJet/I");
156 HltTree->Branch(
"L1ForJetEt",
l1extjtfet,
"L1ForJetEt[NL1ForJet]/F");
157 HltTree->Branch(
"L1ForJetE",
l1extjtfe,
"L1ForJetE[NL1ForJet]/F");
158 HltTree->Branch(
"L1ForJetEta",
l1extjtfeta,
"L1ForJetEta[NL1ForJet]/F");
159 HltTree->Branch(
"L1ForJetPhi",
l1extjtfphi,
"L1ForJetPhi[NL1ForJet]/F");
167 HltTree->Branch(
"NL1Tau",&
nl1exttau,
"NL1Tau/I");
168 HltTree->Branch(
"L1TauEt",
l1exttauet,
"L1TauEt[NL1Tau]/F");
169 HltTree->Branch(
"L1TauE",
l1exttaue,
"L1TauE[NL1Tau]/F");
170 HltTree->Branch(
"L1TauEta",
l1exttaueta,
"L1TauEta[NL1Tau]/F");
171 HltTree->Branch(
"L1TauPhi",
l1exttauphi,
"L1TauPhi[NL1Tau]/F");
172 HltTree->Branch(
"L1Met",&
met,
"L1Met/F");
173 HltTree->Branch(
"L1MetPhi",&
metphi,
"L1MetPhi/F");
174 HltTree->Branch(
"L1EtTot",&
ettot,
"L1EtTot/F");
175 HltTree->Branch(
"L1Mht",&
mht,
"L1Mht/F");
176 HltTree->Branch(
"L1MhtPhi",&
mhtphi,
"L1MhtPhi/F");
177 HltTree->Branch(
"L1EtHad",&
ethad,
"L1EtHad/F");
213 int ntrigs = hltresults->size();
214 if (ntrigs==0){
std::cout <<
"%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;}
220 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
221 TString trigName = triggerNames.
triggerName(itrig);
222 HltTree->Branch(trigName,
trigflag+itrig,trigName+
"/I");
223 HltTree->Branch(trigName+
"_Prescl",
trigPrescl+itrig,trigName+
"_Prescl/I");
227 for (
unsigned int idum = 0; idum <
dummyBranches_.size(); ++idum) {
229 bool addThisBranch = 1;
230 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
231 TString realTrigName = triggerNames.
triggerName(itrig);
232 if(trigName == realTrigName) addThisBranch = 0;
235 HltTree->Branch(trigName,
trigflag+itdum,trigName+
"/I");
236 HltTree->Branch(trigName+
"_Prescl",
trigPrescl+itdum,trigName+
"_Prescl/I");
252 for (
int itrig = 0; itrig != ntrigs; ++itrig){
255 bool accept = hltresults->accept(itrig);
264 if (
_Debug)
std::cout <<
"%HLTInfo -- Number of HLT Triggers: " << ntrigs << std::endl;
265 std::cout <<
"%HLTInfo -- HLTTrigger(" << itrig <<
"): " << trigName <<
" = " << accept << std::endl;
269 else {
if (
_Debug)
std::cout <<
"%HLTInfo -- No Trigger Result" << std::endl;}
273 const int maxL1EmIsol = 4;
274 for (
int i=0;
i!=maxL1EmIsol; ++
i){
283 myl1iems = * L1ExtEmIsol;
286 for (l1extra::L1EmParticleCollection::const_iterator emItr = myl1iems.begin(); emItr != myl1iems.end(); ++emItr) {
296 if (
_Debug)
std::cout <<
"%HLTInfo -- No Isolated L1 EM object" << std::endl;
299 const int maxL1EmNIsol = 4;
300 for (
int i=0;
i!=maxL1EmNIsol; ++
i){
309 myl1nems = * L1ExtEmNIsol;
312 for (l1extra::L1EmParticleCollection::const_iterator emItr = myl1nems.begin(); emItr != myl1nems.end(); ++emItr) {
322 if (
_Debug)
std::cout <<
"%HLTInfo -- No Non-Isolated L1 EM object" << std::endl;
325 const int maxL1Mu = 4;
326 for (
int i=0;
i!=maxL1Mu; ++
i){
344 for (l1extra::L1MuonParticleCollection::const_iterator muItr = myl1mus.begin(); muItr != myl1mus.end(); ++muItr) {
346 l1extmue[il1exmu] = muItr->energy();
364 const int maxL1CenJet = 4;
365 for (
int i=0;
i!=maxL1CenJet; ++
i){
374 myl1jetsc = * L1ExtJetC;
377 for (l1extra::L1JetParticleCollection::const_iterator jtItr = myl1jetsc.begin(); jtItr != myl1jetsc.end(); ++jtItr) {
387 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Central JET object" << std::endl;
390 const int maxL1ForJet = 4;
391 for (
int i=0;
i!=maxL1ForJet; ++
i){
400 myl1jetsf = * L1ExtJetF;
403 for (l1extra::L1JetParticleCollection::const_iterator jtItr = myl1jetsf.begin(); jtItr != myl1jetsf.end(); ++jtItr) {
413 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Forward JET object" << std::endl;
416 const int maxL1Jet = 324;
417 for (
int i=0;
i!=maxL1Jet; ++
i){
424 if (
_Debug)
std::cout <<
"%HLTInfo -- Found L1 JET object" << std::endl;
427 myl1jets = * L1ExtJet;
430 for (l1extra::L1JetParticleCollection::const_iterator jtItr = myl1jets.begin(); jtItr != myl1jets.end(); ++jtItr) {
432 l1extjte[il1exjt] = jtItr->energy();
444 const int maxL1TauJet = 4;
445 for (
int i=0;
i!=maxL1TauJet; ++
i){
454 myl1taus = * L1ExtTau;
457 for (l1extra::L1JetParticleCollection::const_iterator tauItr = myl1taus.begin(); tauItr != myl1taus.end(); ++tauItr) {
471 met = L1ExtMet->begin()->etMiss();
472 metphi = L1ExtMet->begin()->phi();
473 ettot = L1ExtMet->begin()->etTotal();
480 mht = L1ExtMht->begin()->etMiss();
481 mhtphi = L1ExtMht->begin()->phi();
482 ethad = L1ExtMht->begin()->etTotal();
501 iEvent, trigCategory, iErrorCode);
502 if (iErrorCode == 0) {
503 if (
_Debug)
std::cout <<
"%Prescale set index: " << pfSetIndexAlgorithmTrigger << std::endl;
505 std::cout <<
"%Could not extract Prescale set index from event record. Error code: " << iErrorCode << std::endl;
512 const unsigned int numberTriggerBits(gtDecisionWord.size());
514 const unsigned int numberTechnicalTriggerBits(technicalTriggerWordBeforeMask.size());
529 if (pSet.
exists(
"UnpackBxInEvent")){
537 if (
_Debug)
std::cout <<
"Name: " << (algo->second).algoName() <<
" Alias: " << (algo->second).algoAlias() << std::endl;
538 int itrig = (algo->second).algoBitNumber();
540 algoBitToName[itrig] = TString( (algo->second).algoAlias() );
549 int itrig = (techTrig->second).algoBitNumber();
550 techBitToName[itrig] = TString( (techTrig->second).algoName() );
559 std::string triggerAlgTechTrig =
"PhysicsAlgorithms";
560 for (
unsigned int iBit = 0; iBit < numberTriggerBits; ++iBit) {
562 l1flag[iBit] = gtDecisionWord[iBit];
570 << gtDecisionWord[iBit]<<
" "
575 triggerAlgTechTrig =
"TechnicalTriggers";
576 for (
unsigned int iBit = 0; iBit < numberTechnicalTriggerBits; ++iBit) {
577 l1techflag[iBit] = (int) technicalTriggerWordBeforeMask.at(iBit);
593 std::vector<DecisionWord> m_gtDecisionWord5Bx;
594 std::vector<TechnicalTriggerWord> m_gtTechDecisionWord5Bx;
595 std::vector<int> m_ibxn;
597 const std::vector<L1GtFdlWord> &m_gtFdlWord(L1GTRR->gtFdlVector());
598 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
599 itBx != m_gtFdlWord.end(); ++itBx) {
601 m_gtDecisionWord5Bx.push_back((*itBx).gtDecisionWord());
602 m_gtTechDecisionWord5Bx.push_back((*itBx).gtTechnicalTriggerWord());
605 for (
unsigned int iBit = 0; iBit < numberTriggerBits; ++iBit) {
610 for (
unsigned int jbx=0; jbx<m_gtDecisionWord5Bx.size(); ++jbx) {
612 result += m_gtDecisionWord5Bx[jbx][iBit];
613 if (m_gtDecisionWord5Bx[jbx][iBit]>0) bitword |= 1 << jbx;
615 if (
_Debug && result>1) {
std::cout <<
"5BxOr=" << result <<
" Bitword= "<< bitword <<std::endl;
618 bool bitOn=bitword & (1 <<
i);
626 for (
unsigned int iBit = 0; iBit < m_gtTechDecisionWord5Bx[2].size(); ++iBit) {
631 for (
unsigned int jbx=0; jbx<m_gtTechDecisionWord5Bx.size(); ++jbx) {
633 result += m_gtTechDecisionWord5Bx[jbx][iBit];
634 if (m_gtTechDecisionWord5Bx[jbx][iBit]>0) bitword |= 1 << jbx;
636 if (
_Debug && result>1) {
std::cout <<
"5BxOr=" << result <<
" Bitword= "<< bitword << std::endl;
639 bool bitOn=bitword & (1 <<
i);
651 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 GT ReadoutRecord " << std::endl;
659 L1GctHFBitCountsCollection::const_iterator bitCountItr;
660 for (bitCountItr=gctBitCounts->begin(); bitCountItr!=gctBitCounts->end(); ++bitCountItr) {
661 if (bitCountItr->bx()==0){
669 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Gct HF BitCounts" << std::endl;
673 L1GctHFRingEtSumsCollection::const_iterator ringSumsItr;
674 for (ringSumsItr=gctRingSums->begin(); ringSumsItr!=gctRingSums->end(); ++ringSumsItr) {
675 if (ringSumsItr->bx()==0){
683 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Gct HF RingSums" << std::endl;
T getParameter(std::string const &) const
static const bool useL1EventSetup(true)
std::vector< std::string > dummyBranches_
T getUntrackedParameter(std::string const &, T const &) const
int l1hfTowerCountNegativeEtaRing2
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
void setup(const edm::ParameterSet &pSet, TTree *tree)
void analyze(const edm::Handle< edm::TriggerResults > &hltresults, const edm::Handle< l1extra::L1EmParticleCollection > &l1extemi, const edm::Handle< l1extra::L1EmParticleCollection > &l1extemn, const edm::Handle< l1extra::L1MuonParticleCollection > &l1extmu, const edm::Handle< l1extra::L1JetParticleCollection > &l1extjetc, const edm::Handle< l1extra::L1JetParticleCollection > &l1extjetf, const edm::Handle< l1extra::L1JetParticleCollection > &l1extjet, const edm::Handle< l1extra::L1JetParticleCollection > &l1exttaujet, const edm::Handle< l1extra::L1EtMissParticleCollection > &l1extmet, const edm::Handle< l1extra::L1EtMissParticleCollection > &l1extmht, const edm::Handle< L1GlobalTriggerReadoutRecord > &l1GTRR, const edm::Handle< L1GctHFBitCountsCollection > &gctBitCounts, const edm::Handle< L1GctHFRingEtSumsCollection > &gctRingSums, edm::EventSetup const &eventSetup, edm::Event const &iEvent, TTree *tree)
ParameterSet const & getParameterSet(ParameterSetID const &id)
int l1hfRing1EtSumNegativeEta
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
int l1hfRing2EtSumNegativeEta
ParameterSetID psetID() const
int l1hfTowerCountPositiveEtaRing2
int l1hfTowerCountPositiveEtaRing1
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
std::vector< bool > DecisionWord
typedefs
int l1hfTowerCountNegativeEtaRing1
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< std::string > getParameterNames() const
int l1hfRing2EtSumPositiveEta
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool, const edm::InputTag &)
get all the run-constant quantities for L1 trigger and cache them
unsigned int quality() const
get quality
std::string const & triggerName(unsigned int index) const
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
T const * product() const
HLTConfigProvider hltConfig_
static const bool useL1GtTriggerMenuLite(false)
const int prescaleFactorSetIndex(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode) const
char data[epos_bytes_allocation]
int l1hfRing1EtSumPositiveEta
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Provenance getProvenance(BranchID const &theID) const