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());
528 if (pSet.
exists(
"UnpackBxInEvent")){
536 if (
_Debug)
std::cout <<
"Name: " << (
algo->second).algoName() <<
" Alias: " << (
algo->second).algoAlias() << std::endl;
537 int itrig = (
algo->second).algoBitNumber();
548 int itrig = (techTrig->second).algoBitNumber();
549 techBitToName[itrig] = TString( (techTrig->second).algoName() );
558 std::string triggerAlgTechTrig =
"PhysicsAlgorithms";
559 for (
unsigned int iBit = 0; iBit < numberTriggerBits; ++iBit) {
561 l1flag[iBit] = gtDecisionWord[iBit];
569 << gtDecisionWord[iBit]<<
" "
574 triggerAlgTechTrig =
"TechnicalTriggers";
575 for (
unsigned int iBit = 0; iBit < numberTechnicalTriggerBits; ++iBit) {
576 l1techflag[iBit] = (int) technicalTriggerWordBeforeMask.at(iBit);
592 std::vector<DecisionWord> m_gtDecisionWord5Bx;
593 std::vector<TechnicalTriggerWord> m_gtTechDecisionWord5Bx;
594 std::vector<int> m_ibxn;
596 const std::vector<L1GtFdlWord> &m_gtFdlWord(L1GTRR->gtFdlVector());
597 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
598 itBx != m_gtFdlWord.end(); ++itBx) {
600 m_gtDecisionWord5Bx.push_back((*itBx).gtDecisionWord());
601 m_gtTechDecisionWord5Bx.push_back((*itBx).gtTechnicalTriggerWord());
604 for (
unsigned int iBit = 0; iBit < numberTriggerBits; ++iBit) {
609 for (
unsigned int jbx=0; jbx<m_gtDecisionWord5Bx.size(); ++jbx) {
611 result += m_gtDecisionWord5Bx[jbx][iBit];
612 if (m_gtDecisionWord5Bx[jbx][iBit]>0) bitword |= 1 << jbx;
614 if (
_Debug && result>1) {
std::cout <<
"5BxOr=" << result <<
" Bitword= "<< bitword <<std::endl;
617 bool bitOn=bitword & (1 <<
i);
625 for (
unsigned int iBit = 0; iBit < m_gtTechDecisionWord5Bx[2].size(); ++iBit) {
630 for (
unsigned int jbx=0; jbx<m_gtTechDecisionWord5Bx.size(); ++jbx) {
632 result += m_gtTechDecisionWord5Bx[jbx][iBit];
633 if (m_gtTechDecisionWord5Bx[jbx][iBit]>0) bitword |= 1 << jbx;
635 if (
_Debug && result>1) {
std::cout <<
"5BxOr=" << result <<
" Bitword= "<< bitword << std::endl;
638 bool bitOn=bitword & (1 <<
i);
650 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 GT ReadoutRecord " << std::endl;
658 L1GctHFBitCountsCollection::const_iterator bitCountItr;
659 for (bitCountItr=gctBitCounts->begin(); bitCountItr!=gctBitCounts->end(); ++bitCountItr) {
660 if (bitCountItr->bx()==0){
668 if (
_Debug)
std::cout <<
"%HLTInfo -- No L1 Gct HF BitCounts" << std::endl;
672 L1GctHFRingEtSumsCollection::const_iterator ringSumsItr;
673 for (ringSumsItr=gctRingSums->begin(); ringSumsItr!=gctRingSums->end(); ++ringSumsItr) {
674 if (ringSumsItr->bx()==0){
682 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)
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
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
ParameterSet const & parameterSet(Provenance const &provenance)