211 int ntrigs = hltresults->size();
212 if (ntrigs==0){
std::cout <<
"%HLTInfo -- No trigger name given in TriggerResults of the input " << std::endl;}
218 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
219 TString trigName = triggerNames.
triggerName(itrig);
220 HltTree->Branch(trigName,
trigflag+itrig,trigName+
"/I");
221 HltTree->Branch(trigName+
"_Prescl",
trigPrescl+itrig,trigName+
"_Prescl/I");
225 for (
unsigned int idum = 0; idum <
dummyBranches_.size(); ++idum) {
227 bool addThisBranch = 1;
228 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
229 TString realTrigName = triggerNames.
triggerName(itrig);
230 if(trigName == realTrigName) addThisBranch = 0;
233 HltTree->Branch(trigName,
trigflag+itdum,trigName+
"/I");
234 HltTree->Branch(trigName+
"_Prescl",
trigPrescl+itdum,trigName+
"_Prescl/I");
250 for (
int itrig = 0; itrig != ntrigs; ++itrig){
253 bool accept = hltresults->accept(itrig);
262 if (
_Debug)
std::cout <<
"%HLTInfo -- Number of HLT Triggers: " << ntrigs << std::endl;
263 std::cout <<
"%HLTInfo -- HLTTrigger(" << itrig <<
"): " << trigName <<
" = " << accept << std::endl;
267 else {
if (
_Debug)
std::cout <<
"%HLTInfo -- No Trigger Result" << std::endl;}
271 const int maxL1EmIsol = 4;
272 for (
int i=0;
i!=maxL1EmIsol; ++
i){
278 if (L1ExtEmIsol.isValid()) {
281 myl1iems = * L1ExtEmIsol;
282 std::sort(myl1iems.begin(),myl1iems.end(),
EtGreater());
284 for (l1extra::L1EmParticleCollection::const_iterator emItr = myl1iems.begin(); emItr != myl1iems.end(); ++emItr) {
294 if (
_Debug)
std::cout <<
"%HLTInfo -- No Isolated L1 EM object" << std::endl;
297 const int maxL1EmNIsol = 4;
298 for (
int i=0;
i!=maxL1EmNIsol; ++
i){
304 if (L1ExtEmNIsol.isValid()) {
307 myl1nems = * L1ExtEmNIsol;
308 std::sort(myl1nems.begin(),myl1nems.end(),
EtGreater());
310 for (l1extra::L1EmParticleCollection::const_iterator emItr = myl1nems.begin(); emItr != myl1nems.end(); ++emItr) {
320 if (
_Debug)
std::cout <<
"%HLTInfo -- No Non-Isolated L1 EM object" << std::endl;
323 const int maxL1Mu = 4;
324 for (
int i=0;
i!=maxL1Mu; ++
i){
336 if (L1ExtMu.isValid()) {
340 std::sort(myl1mus.begin(),myl1mus.end(),
PtGreater());
342 for (l1extra::L1MuonParticleCollection::const_iterator muItr = myl1mus.begin(); muItr != myl1mus.end(); ++muItr) {
344 l1extmue[il1exmu] = muItr->energy();
362 const int maxL1CenJet = 4;
363 for (
int i=0;
i!=maxL1CenJet; ++
i){
369 if (L1ExtJetC.isValid()) {
372 myl1jetsc = * L1ExtJetC;
373 std::sort(myl1jetsc.begin(),myl1jetsc.end(),
EtGreater());
375 for (l1extra::L1JetParticleCollection::const_iterator jtItr = myl1jetsc.begin(); jtItr != myl1jetsc.end(); ++jtItr) {
385 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Central JET object" << std::endl;
388 const int maxL1ForJet = 4;
389 for (
int i=0;
i!=maxL1ForJet; ++
i){
395 if (L1ExtJetF.isValid()) {
398 myl1jetsf = * L1ExtJetF;
399 std::sort(myl1jetsf.begin(),myl1jetsf.end(),
EtGreater());
401 for (l1extra::L1JetParticleCollection::const_iterator jtItr = myl1jetsf.begin(); jtItr != myl1jetsf.end(); ++jtItr) {
411 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Forward JET object" << std::endl;
414 const int maxL1Jet = 324;
415 for (
int i=0;
i!=maxL1Jet; ++
i){
421 if (L1ExtJet.isValid()) {
422 if (
_Debug)
std::cout <<
"%HLTInfo -- Found L1 JET object" << std::endl;
425 myl1jets = * L1ExtJet;
426 std::sort(myl1jets.begin(),myl1jets.end(),
EtGreater());
428 for (l1extra::L1JetParticleCollection::const_iterator jtItr = myl1jets.begin(); jtItr != myl1jets.end(); ++jtItr) {
430 l1extjte[il1exjt] = jtItr->energy();
442 const int maxL1TauJet = 4;
443 for (
int i=0;
i!=maxL1TauJet; ++
i){
449 if (L1ExtTau.isValid()) {
452 myl1taus = * L1ExtTau;
453 std::sort(myl1taus.begin(),myl1taus.end(),
EtGreater());
455 for (l1extra::L1JetParticleCollection::const_iterator tauItr = myl1taus.begin(); tauItr != myl1taus.end(); ++tauItr) {
468 if (L1ExtMet.isValid()) {
469 met = L1ExtMet->begin()->etMiss();
470 metphi = L1ExtMet->begin()->phi();
471 ettot = L1ExtMet->begin()->etTotal();
477 if (L1ExtMht.isValid()) {
478 mht = L1ExtMht->begin()->etMiss();
479 mhtphi = L1ExtMht->begin()->phi();
480 ethad = L1ExtMht->begin()->etTotal();
498 iEvent, trigCategory, iErrorCode);
499 if (iErrorCode == 0) {
500 if (
_Debug)
std::cout <<
"%Prescale set index: " << pfSetIndexAlgorithmTrigger << std::endl;
502 std::cout <<
"%Could not extract Prescale set index from event record. Error code: " << iErrorCode << std::endl;
506 if (L1GTRR.isValid()) {
509 const unsigned int numberTriggerBits(gtDecisionWord.size());
511 const unsigned int numberTechnicalTriggerBits(technicalTriggerWordBeforeMask.size());
525 if (pSet.
exists(
"UnpackBxInEvent")){
533 if (
_Debug)
std::cout <<
"Name: " << (
algo->second).algoName() <<
" Alias: " << (
algo->second).algoAlias() << std::endl;
534 int itrig = (
algo->second).algoBitNumber();
545 int itrig = (techTrig->second).algoBitNumber();
546 techBitToName[itrig] = TString( (techTrig->second).algoName() );
555 std::string triggerAlgTechTrig =
"PhysicsAlgorithms";
556 for (
unsigned int iBit = 0; iBit < numberTriggerBits; ++iBit) {
558 l1flag[iBit] = gtDecisionWord[iBit];
566 << gtDecisionWord[iBit]<<
" "
571 triggerAlgTechTrig =
"TechnicalTriggers";
572 for (
unsigned int iBit = 0; iBit < numberTechnicalTriggerBits; ++iBit) {
573 l1techflag[iBit] = (int) technicalTriggerWordBeforeMask.at(iBit);
589 std::vector<DecisionWord> m_gtDecisionWord5Bx;
590 std::vector<TechnicalTriggerWord> m_gtTechDecisionWord5Bx;
591 std::vector<int> m_ibxn;
593 const std::vector<L1GtFdlWord> &m_gtFdlWord(L1GTRR->gtFdlVector());
594 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
595 itBx != m_gtFdlWord.end(); ++itBx) {
597 m_gtDecisionWord5Bx.push_back((*itBx).gtDecisionWord());
598 m_gtTechDecisionWord5Bx.push_back((*itBx).gtTechnicalTriggerWord());
601 for (
unsigned int iBit = 0; iBit < numberTriggerBits; ++iBit) {
606 for (
unsigned int jbx=0; jbx<m_gtDecisionWord5Bx.size(); ++jbx) {
608 result += m_gtDecisionWord5Bx[jbx][iBit];
609 if (m_gtDecisionWord5Bx[jbx][iBit]>0) bitword |= 1 << jbx;
611 if (
_Debug && result>1) {
std::cout <<
"5BxOr=" << result <<
" Bitword= "<< bitword <<std::endl;
614 bool bitOn=bitword & (1 <<
i);
622 for (
unsigned int iBit = 0; iBit < m_gtTechDecisionWord5Bx[2].size(); ++iBit) {
627 for (
unsigned int jbx=0; jbx<m_gtTechDecisionWord5Bx.size(); ++jbx) {
629 result += m_gtTechDecisionWord5Bx[jbx][iBit];
630 if (m_gtTechDecisionWord5Bx[jbx][iBit]>0) bitword |= 1 << jbx;
632 if (
_Debug && result>1) {
std::cout <<
"5BxOr=" << result <<
" Bitword= "<< bitword << std::endl;
635 bool bitOn=bitword & (1 <<
i);
647 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 GT ReadoutRecord " << std::endl;
655 L1GctHFBitCountsCollection::const_iterator bitCountItr;
656 for (bitCountItr=gctBitCounts->begin(); bitCountItr!=gctBitCounts->end(); ++bitCountItr) {
657 if (bitCountItr->bx()==0){
665 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Gct HF BitCounts" << std::endl;
669 L1GctHFRingEtSumsCollection::const_iterator ringSumsItr;
670 for (ringSumsItr=gctRingSums->begin(); ringSumsItr!=gctRingSums->end(); ++ringSumsItr) {
671 if (ringSumsItr->bx()==0){
679 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Gct HF RingSums" << std::endl;
T getParameter(std::string const &) const
std::vector< std::string > dummyBranches_
int l1hfTowerCountNegativeEtaRing2
const int prescaleFactorSetIndex(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode) const
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
int l1hfTowerCountPositiveEtaRing2
int l1hfTowerCountPositiveEtaRing1
std::vector< bool > DecisionWord
typedefs
int l1hfTowerCountNegativeEtaRing1
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
int l1hfRing2EtSumPositiveEta
unsigned int quality() const
get quality
std::string const & triggerName(unsigned int index) const
T const * product() const
char data[epos_bytes_allocation]
int l1hfRing1EtSumPositiveEta
ParameterSet const & parameterSet(Provenance const &provenance)
std::unique_ptr< HLTPrescaleProvider > hltPrescaleProvider_
const int prescaleFactor(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger