CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
HLTBitAnalyzer Class Reference

#include <HLTBitAnalyzer.h>

Inheritance diagram for HLTBitAnalyzer:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (edm::Event const &e, edm::EventSetup const &iSetup)
 
virtual void endJob ()
 
 HLTBitAnalyzer (edm::ParameterSet const &conf)
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Public Attributes

TTree * HltTree
 

Private Member Functions

const int errMax ()
 

Private Attributes

double _EtaMax
 
double _EtaMin
 
std::string _HistName
 
int errCnt
 
EventHeader evt_header_
 Default analyses. More...
 
edm::InputTag gctBitCounts_
 
edm::InputTag gctRingSums_
 
edm::InputTag genEventInfo_
 
edm::InputTag gtObjectMap_
 
edm::InputTag gtReadoutRecord_
 
HLTInfo hlt_analysis_
 
edm::InputTag hltresults_
 
std::string l1extramc_
 
std::string l1extramu_
 
TFile * m_file
 
edm::InputTag m_l1extraemi
 
edm::InputTag m_l1extraemn
 
edm::InputTag m_l1extrajetc
 
edm::InputTag m_l1extrajetf
 
edm::InputTag m_l1extramet
 
edm::InputTag m_l1extramht
 
edm::InputTag m_l1extramu
 
edm::InputTag m_l1extrataujet
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

$Date: November 2006 $Revision:

Author
P. Bargassa - Rice U.

Definition at line 32 of file HLTBitAnalyzer.h.

Constructor & Destructor Documentation

HLTBitAnalyzer::HLTBitAnalyzer ( edm::ParameterSet const &  conf)
explicit

Definition at line 26 of file HLTBitAnalyzer.cc.

References _HistName, gather_cfg::cout, errCnt, evt_header_, gctBitCounts_, gctRingSums_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gtObjectMap_, gtReadoutRecord_, hlt_analysis_, hltresults_, HltTree, l1extramc_, l1extramu_, edm::InputTag::label(), m_file, m_l1extraemi, m_l1extraemn, m_l1extrajetc, m_l1extrajetf, m_l1extramet, m_l1extramht, m_l1extramu, m_l1extrataujet, EventHeader::setup(), and HLTInfo::setup().

26  {
27 
28  // If your module takes parameters, here is where you would define
29  // their names and types, and access them to initialize internal
30  // variables. Example as follows:
31  std::cout << " Beginning HLTBitAnalyzer Analysis " << std::endl;
32 
33  l1extramu_ = conf.getParameter<std::string> ("l1extramu");
35 
36  // read the L1Extra collection name, and add the instance names as needed
37  l1extramc_ = conf.getParameter<std::string> ("l1extramc");
38  m_l1extraemi = edm::InputTag(l1extramc_, "Isolated");
39  m_l1extraemn = edm::InputTag(l1extramc_, "NonIsolated");
45 
46  hltresults_ = conf.getParameter<edm::InputTag> ("hltresults");
47  gtReadoutRecord_ = conf.getParameter<edm::InputTag> ("l1GtReadoutRecord");
48  gtObjectMap_ = conf.getParameter<edm::InputTag> ("l1GtObjectMapRecord");
49 
50  gctBitCounts_ = edm::InputTag( conf.getParameter<edm::InputTag>("l1GctHFBitCounts").label(), "" );
51  gctRingSums_ = edm::InputTag( conf.getParameter<edm::InputTag>("l1GctHFRingSums").label(), "" );
52 
53  m_file = 0; // set to null
54  errCnt = 0;
55 
56  // read run parameters with a default value
57  edm::ParameterSet runParameters = conf.getParameter<edm::ParameterSet>("RunParameters");
58  _HistName = runParameters.getUntrackedParameter<std::string>("HistogramFile", "test.root");
59 
60  // open the tree file
61  m_file = new TFile(_HistName.c_str(), "RECREATE");
62  if (m_file)
63  m_file->cd();
64 
65  // Initialize the tree
66  HltTree = new TTree("HltTree", "");
67 
68  // Setup the different analysis
71 }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag gctRingSums_
edm::InputTag m_l1extraemn
void setup(const edm::ParameterSet &pSet, TTree *tree)
Definition: HLTInfo.cc:53
edm::InputTag m_l1extrataujet
edm::InputTag m_l1extraemi
std::string l1extramc_
edm::InputTag gctBitCounts_
edm::InputTag hltresults_
edm::InputTag gtReadoutRecord_
edm::InputTag m_l1extramet
void setup(TTree *tree)
Definition: EventHeader.cc:22
std::string l1extramu_
EventHeader evt_header_
Default analyses.
edm::InputTag m_l1extramu
tuple conf
Definition: dbtoconf.py:185
std::string _HistName
edm::InputTag m_l1extramht
std::string const & label() const
Definition: InputTag.h:25
edm::InputTag m_l1extrajetf
edm::InputTag gtObjectMap_
tuple cout
Definition: gather_cfg.py:41
HLTInfo hlt_analysis_
edm::InputTag m_l1extrajetc

Member Function Documentation

void HLTBitAnalyzer::analyze ( edm::Event const &  e,
edm::EventSetup const &  iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 74 of file HLTBitAnalyzer.cc.

References EventHeader::analyze(), HLTInfo::analyze(), errCnt, errMax(), evt_header_, gctBitCounts_, gctRingSums_, getCollection(), gtObjectMap_, gtReadoutRecord_, hlt_analysis_, hltresults_, HltTree, kHltresults, kL1extemi, kL1extemn, kL1extjetc, kL1extjetf, kL1extmet, kL1extmht, kL1extmu, kL1exttaujet, kL1GctBitCounts, kL1GctRingSums, kL1GtOMRec, kL1GtRR, m_file, m_l1extraemi, m_l1extraemn, m_l1extrajetc, m_l1extrajetf, m_l1extramet, m_l1extramht, m_l1extramu, m_l1extrataujet, combine::missing, and dbtoconf::out.

74  {
75 
79  edm::Handle<l1extra::L1JetParticleCollection> l1extjetc, l1extjetf, l1exttaujet;
86 
87  // extract the collections from the event, check their validity and log which are missing
88  std::vector<MissingCollectionInfo> missing;
89 
90  getCollection( iEvent, missing, hltresults, hltresults_, kHltresults );
91  getCollection( iEvent, missing, l1extemi, m_l1extraemi, kL1extemi );
92  getCollection( iEvent, missing, l1extemn, m_l1extraemn, kL1extemn );
93  getCollection( iEvent, missing, l1extmu, m_l1extramu, kL1extmu );
94  getCollection( iEvent, missing, l1extjetc, m_l1extrajetc, kL1extjetc );
95  getCollection( iEvent, missing, l1extjetf, m_l1extrajetf, kL1extjetf );
96  getCollection( iEvent, missing, l1exttaujet, m_l1extrataujet, kL1exttaujet );
97  getCollection( iEvent, missing, l1extmet, m_l1extramet, kL1extmet );
98  getCollection( iEvent, missing, l1extmht, m_l1extramht, kL1extmht );
99  getCollection( iEvent, missing, l1GtRR, gtReadoutRecord_, kL1GtRR );
100  getCollection( iEvent, missing, l1GtOMRec, gtObjectMap_, kL1GtOMRec );
101  getCollection( iEvent, missing, gctBitCounts, gctBitCounts_, kL1GctBitCounts );
102  getCollection( iEvent, missing, gctRingSums, gctRingSums_, kL1GctRingSums );
103 
104 
105  // print missing collections
106  if (not missing.empty() and (errCnt < errMax())) {
107  errCnt++;
108  std::stringstream out;
109  out << "OpenHLT analyser - missing collections:";
110  BOOST_FOREACH(const MissingCollectionInfo & entry, missing)
111  out << "\n\t" << entry.first << ": " << entry.second->encode();
112  edm::LogPrint("OpenHLT") << out.str() << std::endl;
113  if (errCnt == errMax())
114  edm::LogWarning("OpenHLT") << "Maximum error count reached -- No more messages will be printed.";
115  }
116 
117  // run the analysis, passing required event fragments
119  hltresults,
120  l1extemi,
121  l1extemn,
122  l1extmu,
123  l1extjetc,
124  l1extjetf,
125  l1exttaujet,
126  l1extmet,
127  l1extmht,
128  l1GtRR,
129  gctBitCounts,
130  gctRingSums,
131  iSetup,
132  iEvent,
133  HltTree);
134 
135  evt_header_.analyze(iEvent, HltTree);
136 
137  // std::cout << " Ending Event Analysis" << std::endl;
138  // After analysis, fill the variables tree
139  if (m_file)
140  m_file->cd();
141  HltTree->Fill();
142 }
dictionary missing
Definition: combine.py:4
edm::InputTag gctRingSums_
const char * kL1exttaujet
Definition: HLTMessages.cc:30
edm::InputTag m_l1extraemn
const char * kHltresults
Definition: HLTMessages.cc:24
edm::InputTag m_l1extrataujet
const char * kL1extmht
Definition: HLTMessages.cc:32
edm::InputTag m_l1extraemi
edm::InputTag gctBitCounts_
edm::InputTag hltresults_
edm::InputTag gtReadoutRecord_
const char * kL1GctRingSums
Definition: HLTMessages.cc:36
const char * kL1extemi
Definition: HLTMessages.cc:25
const char * kL1extmet
Definition: HLTMessages.cc:31
edm::InputTag m_l1extramet
const char * kL1extemn
Definition: HLTMessages.cc:26
U second(std::pair< T, U > const &p)
static bool getCollection(const edm::Event &event, std::vector< MissingCollectionInfo > &missing, edm::Handle< T > &handle, const edm::InputTag &name, const char *description)
int iEvent
Definition: GenABIO.cc:243
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
EventHeader evt_header_
Default analyses.
edm::InputTag m_l1extramu
bool first
Definition: L1TdeRCT.cc:79
std::pair< const char *, const edm::InputTag * > MissingCollectionInfo
Definition: HLTAnalyzer.cc:10
const char * kL1extmu
Definition: HLTMessages.cc:27
tuple out
Definition: dbtoconf.py:99
virtual void analyze(edm::Event const &e, edm::EventSetup const &iSetup)
const char * kL1extjetc
Definition: HLTMessages.cc:28
const char * kL1GtRR
Definition: HLTMessages.cc:33
const char * kL1GctBitCounts
Definition: HLTMessages.cc:35
edm::InputTag m_l1extramht
edm::InputTag m_l1extrajetf
edm::InputTag gtObjectMap_
const char * kL1extjetf
Definition: HLTMessages.cc:29
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
const char * kL1GtOMRec
Definition: HLTMessages.cc:34
HLTInfo hlt_analysis_
const int errMax()
edm::InputTag m_l1extrajetc
void HLTBitAnalyzer::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 145 of file HLTBitAnalyzer.cc.

References HltTree, and m_file.

145  {
146 
147  if (m_file)
148  m_file->cd();
149 
150  HltTree->Write();
151  delete HltTree;
152  HltTree = 0;
153 
154  if (m_file) { // if there was a tree file...
155  m_file->Write(); // write out the branches
156  delete m_file; // close and delete the file
157  m_file = 0; // set to zero to clean up
158  }
159 
160 }
const int HLTBitAnalyzer::errMax ( )
inlineprivate

Definition at line 66 of file HLTBitAnalyzer.h.

Referenced by analyze().

66 {return 100;}

Member Data Documentation

double HLTBitAnalyzer::_EtaMax
private

Definition at line 69 of file HLTBitAnalyzer.h.

double HLTBitAnalyzer::_EtaMin
private

Definition at line 69 of file HLTBitAnalyzer.h.

std::string HLTBitAnalyzer::_HistName
private

Definition at line 68 of file HLTBitAnalyzer.h.

Referenced by HLTBitAnalyzer().

int HLTBitAnalyzer::errCnt
private

Definition at line 65 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

EventHeader HLTBitAnalyzer::evt_header_
private

Default analyses.

Definition at line 48 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::gctBitCounts_
private

Definition at line 63 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::gctRingSums_
private

Definition at line 63 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::genEventInfo_
private

Definition at line 51 of file HLTBitAnalyzer.h.

edm::InputTag HLTBitAnalyzer::gtObjectMap_
private

Definition at line 62 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::gtReadoutRecord_
private

Definition at line 62 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

HLTInfo HLTBitAnalyzer::hlt_analysis_
private

Definition at line 49 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::hltresults_
private

Definition at line 51 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

TTree* HLTBitAnalyzer::HltTree

Definition at line 41 of file HLTBitAnalyzer.h.

Referenced by analyze(), endJob(), and HLTBitAnalyzer().

std::string HLTBitAnalyzer::l1extramc_
private

Definition at line 52 of file HLTBitAnalyzer.h.

Referenced by HLTBitAnalyzer().

std::string HLTBitAnalyzer::l1extramu_
private

Definition at line 52 of file HLTBitAnalyzer.h.

Referenced by HLTBitAnalyzer().

TFile* HLTBitAnalyzer::m_file
private

Definition at line 70 of file HLTBitAnalyzer.h.

Referenced by analyze(), endJob(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extraemi
private

Definition at line 54 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extraemn
private

Definition at line 55 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extrajetc
private

Definition at line 56 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extrajetf
private

Definition at line 57 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extramet
private

Definition at line 59 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extramht
private

Definition at line 60 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extramu
private

Definition at line 53 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extrataujet
private

Definition at line 58 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().