41 std::cout <<
"Initalizing HLTConfigProvider" << std::endl;
60 for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
61 iParam != parameterNames.end(); iParam++ ){
62 if ( (*iParam) ==
"Debug" )
_Debug = myHltParams.getParameter<
bool>( *iParam );
68 const int kMaxTrigFlag = 10000;
72 const int kMaxL1Flag = 10000;
73 l1flag =
new int[kMaxL1Flag];
79 const int kMaxHLTPart = 10000;
80 hltppt =
new float[kMaxHLTPart];
81 hltpeta =
new float[kMaxHLTPart];
82 const int kMaxL1ExtEmI = 10000;
87 const int kMaxL1ExtEmN = 10000;
92 const int kMaxL1ExtMu = 10000;
103 const int kMaxL1ExtJtC = 10000;
108 const int kMaxL1ExtJtF = 10000;
113 const int kMaxL1ExtJt = 10000;
118 const int kMaxL1ExtTau = 10000;
127 HltTree->Branch(
"NL1IsolEm",&
nl1extiem,
"NL1IsolEm/I");
128 HltTree->Branch(
"L1IsolEmEt",
l1extiemet,
"L1IsolEmEt[NL1IsolEm]/F");
129 HltTree->Branch(
"L1IsolEmE",
l1extieme,
"L1IsolEmE[NL1IsolEm]/F");
130 HltTree->Branch(
"L1IsolEmEta",
l1extiemeta,
"L1IsolEmEta[NL1IsolEm]/F");
131 HltTree->Branch(
"L1IsolEmPhi",
l1extiemphi,
"L1IsolEmPhi[NL1IsolEm]/F");
132 HltTree->Branch(
"NL1NIsolEm",&
nl1extnem,
"NL1NIsolEm/I");
133 HltTree->Branch(
"L1NIsolEmEt",
l1extnemet,
"L1NIsolEmEt[NL1NIsolEm]/F");
134 HltTree->Branch(
"L1NIsolEmE",
l1extneme,
"L1NIsolEmE[NL1NIsolEm]/F");
135 HltTree->Branch(
"L1NIsolEmEta",
l1extnemeta,
"L1NIsolEmEta[NL1NIsolEm]/F");
136 HltTree->Branch(
"L1NIsolEmPhi",
l1extnemphi,
"L1NIsolEmPhi[NL1NIsolEm]/F");
137 HltTree->Branch(
"NL1Mu",&
nl1extmu,
"NL1Mu/I");
138 HltTree->Branch(
"L1MuPt",
l1extmupt,
"L1MuPt[NL1Mu]/F");
139 HltTree->Branch(
"L1MuE",
l1extmue,
"L1MuE[NL1Mu]/F");
140 HltTree->Branch(
"L1MuEta",
l1extmueta,
"L1MuEta[NL1Mu]/F");
141 HltTree->Branch(
"L1MuPhi",
l1extmuphi,
"L1MuPhi[NL1Mu]/F");
142 HltTree->Branch(
"L1MuIsol",
l1extmuiso,
"L1MuIsol[NL1Mu]/I");
143 HltTree->Branch(
"L1MuMip",
l1extmumip,
"L1MuMip[NL1Mu]/I");
144 HltTree->Branch(
"L1MuFor",
l1extmufor,
"L1MuFor[NL1Mu]/I");
145 HltTree->Branch(
"L1MuRPC",
l1extmurpc,
"L1MuRPC[NL1Mu]/I");
146 HltTree->Branch(
"L1MuQal",
l1extmuqul,
"L1MuQal[NL1Mu]/I");
147 HltTree->Branch(
"L1MuChg",
l1extmuchg,
"L1MuChg[NL1Mu]/I");
148 HltTree->Branch(
"NL1CenJet",&
nl1extjetc,
"NL1CenJet/I");
149 HltTree->Branch(
"L1CenJetEt",
l1extjtcet,
"L1CenJetEt[NL1CenJet]/F");
150 HltTree->Branch(
"L1CenJetE",
l1extjtce,
"L1CenJetE[NL1CenJet]/F");
151 HltTree->Branch(
"L1CenJetEta",
l1extjtceta,
"L1CenJetEta[NL1CenJet]/F");
152 HltTree->Branch(
"L1CenJetPhi",
l1extjtcphi,
"L1CenJetPhi[NL1CenJet]/F");
153 HltTree->Branch(
"NL1ForJet",&
nl1extjetf,
"NL1ForJet/I");
154 HltTree->Branch(
"L1ForJetEt",
l1extjtfet,
"L1ForJetEt[NL1ForJet]/F");
155 HltTree->Branch(
"L1ForJetE",
l1extjtfe,
"L1ForJetE[NL1ForJet]/F");
156 HltTree->Branch(
"L1ForJetEta",
l1extjtfeta,
"L1ForJetEta[NL1ForJet]/F");
157 HltTree->Branch(
"L1ForJetPhi",
l1extjtfphi,
"L1ForJetPhi[NL1ForJet]/F");
165 HltTree->Branch(
"NL1Tau",&
nl1exttau,
"NL1Tau/I");
166 HltTree->Branch(
"L1TauEt",
l1exttauet,
"L1TauEt[NL1Tau]/F");
167 HltTree->Branch(
"L1TauE",
l1exttaue,
"L1TauE[NL1Tau]/F");
168 HltTree->Branch(
"L1TauEta",
l1exttaueta,
"L1TauEta[NL1Tau]/F");
169 HltTree->Branch(
"L1TauPhi",
l1exttauphi,
"L1TauPhi[NL1Tau]/F");
170 HltTree->Branch(
"L1Met",&
met,
"L1Met/F");
171 HltTree->Branch(
"L1MetPhi",&
metphi,
"L1MetPhi/F");
172 HltTree->Branch(
"L1EtTot",&
ettot,
"L1EtTot/F");
173 HltTree->Branch(
"L1Mht",&
mht,
"L1Mht/F");
174 HltTree->Branch(
"L1MhtPhi",&
mhtphi,
"L1MhtPhi/F");
175 HltTree->Branch(
"L1EtHad",&
ethad,
"L1EtHad/F");
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){
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){
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){
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){
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){
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){
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){
452 myl1taus = * L1ExtTau;
453 std::sort(myl1taus.begin(),myl1taus.end(),
EtGreater());
455 for (l1extra::L1JetParticleCollection::const_iterator tauItr = myl1taus.begin(); tauItr != myl1taus.end(); ++tauItr) {
469 met = L1ExtMet->begin()->etMiss();
470 metphi = L1ExtMet->begin()->phi();
471 ettot = L1ExtMet->begin()->etTotal();
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;
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_
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)
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)
void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< std::string > getParameterNames() const
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
Provenance getProvenance(BranchID const &theID) const
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