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 | Static 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 beginRun (edm::Run const &, edm::EventSetup const &)
 
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
 

Static Private Member Functions

static int errMax ()
 

Private Attributes

double _EtaMax
 
double _EtaMin
 
std::string _HistName
 
bool _UseTFileService
 
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_l1extrajet
 
edm::InputTag m_l1extrajetc
 
edm::InputTag m_l1extrajetf
 
edm::InputTag m_l1extramet
 
edm::InputTag m_l1extramht
 
edm::InputTag m_l1extramu
 
edm::InputTag m_l1extrataujet
 
HLTMCtruth mct_analysis_
 
edm::InputTag mctruth_
 
edm::InputTag pileupInfo_
 
edm::InputTag simhits_
 
edm::InputTag VertexTagOffline0_
 
RECOVertex vrt_analysisOffline0_
 

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)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 35 of file HLTBitAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file HLTBitAnalyzer.cc.

References _HistName, _UseTFileService, gather_cfg::cout, errCnt, evt_header_, gctBitCounts_, gctRingSums_, genEventInfo_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gtObjectMap_, gtReadoutRecord_, hlt_analysis_, hltresults_, HltTree, l1extramc_, l1extramu_, edm::InputTag::label(), m_file, m_l1extraemi, m_l1extraemn, m_l1extrajet, m_l1extrajetc, m_l1extrajetf, m_l1extramet, m_l1extramht, m_l1extramu, m_l1extrataujet, TFileDirectory::make(), mct_analysis_, mctruth_, pileupInfo_, environment_file_cff::runParameters, RECOVertex::setup(), EventHeader::setup(), HLTMCtruth::setup(), HLTInfo::setup(), simhits_, VertexTagOffline0_, and vrt_analysisOffline0_.

28  {
29 
30  // If your module takes parameters, here is where you would define
31  // their names and types, and access them to initialize internal
32  // variables. Example as follows:
33  std::cout << " Beginning HLTBitAnalyzer Analysis " << std::endl;
34 
35  l1extramu_ = conf.getParameter<std::string> ("l1extramu");
37 
38  // read the L1Extra collection name, and add the instance names as needed
39  l1extramc_ = conf.getParameter<std::string> ("l1extramc");
40  m_l1extraemi = edm::InputTag(l1extramc_, "Isolated");
41  m_l1extraemn = edm::InputTag(l1extramc_, "NonIsolated");
44  m_l1extrajet = edm::InputTag("gctInternJetProducer","Internal","ANALYSIS");
48 
49  mctruth_ = conf.getParameter<edm::InputTag> ("mctruth");
50  genEventInfo_ = conf.getParameter<edm::InputTag> ("genEventInfo");
51  VertexTagOffline0_ = conf.getParameter<edm::InputTag> ("OfflinePrimaryVertices0");
52  simhits_ = conf.getParameter<edm::InputTag> ("simhits");
53 
54  hltresults_ = conf.getParameter<edm::InputTag> ("hltresults");
55  gtReadoutRecord_ = conf.getParameter<edm::InputTag> ("l1GtReadoutRecord");
56  gtObjectMap_ = conf.getParameter<edm::InputTag> ("l1GtObjectMapRecord");
57 
58  gctBitCounts_ = edm::InputTag( conf.getParameter<edm::InputTag>("l1GctHFBitCounts").label(), "" );
59  gctRingSums_ = edm::InputTag( conf.getParameter<edm::InputTag>("l1GctHFRingSums").label(), "" );
60 
61  pileupInfo_ = edm::InputTag("addPileupInfo");
62 
63  _UseTFileService = conf.getUntrackedParameter<bool>("UseTFileService",false);
64 
65  m_file = 0; // set to null
66  errCnt = 0;
67 
68  // read run parameters with a default value
69  edm::ParameterSet runParameters = conf.getParameter<edm::ParameterSet>("RunParameters");
70  _HistName = runParameters.getUntrackedParameter<std::string>("HistogramFile", "test.root");
71 
72  // open the tree file and initialize the tree
73  if(_UseTFileService){
75  HltTree = fs->make<TTree>("HltTree", "");
76  }else{
77  m_file = new TFile(_HistName.c_str(), "RECREATE");
78  if (m_file)
79  m_file->cd();
80  HltTree = new TTree("HltTree", "");
81  }
82 
83  // Setup the different analysis
88 }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag gctRingSums_
edm::InputTag VertexTagOffline0_
edm::InputTag m_l1extrajet
edm::InputTag m_l1extraemn
void setup(const edm::ParameterSet &pSet, TTree *tree)
Definition: HLTInfo.cc:55
edm::InputTag m_l1extrataujet
edm::InputTag m_l1extraemi
std::string l1extramc_
edm::InputTag gctBitCounts_
edm::InputTag hltresults_
edm::InputTag gtReadoutRecord_
edm::InputTag m_l1extramet
RECOVertex vrt_analysisOffline0_
edm::InputTag genEventInfo_
void setup(TTree *tree)
Definition: EventHeader.cc:26
void setup(const edm::ParameterSet &pSet, TTree *tree, std::string vertexType)
Definition: RECOVertex.cc:49
std::string l1extramu_
EventHeader evt_header_
Default analyses.
edm::InputTag m_l1extramu
tuple conf
Definition: dbtoconf.py:185
std::string _HistName
HLTMCtruth mct_analysis_
edm::InputTag m_l1extramht
edm::InputTag mctruth_
std::string const & label() const
Definition: InputTag.h:25
edm::InputTag m_l1extrajetf
edm::InputTag gtObjectMap_
edm::InputTag simhits_
T * make() const
make new ROOT object
void setup(const edm::ParameterSet &pSet, TTree *tree)
Definition: HLTMCtruth.cc:23
tuple cout
Definition: gather_cfg.py:121
edm::InputTag pileupInfo_
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 91 of file HLTBitAnalyzer.cc.

References RECOVertex::analyze(), EventHeader::analyze(), HLTMCtruth::analyze(), HLTInfo::analyze(), errCnt, errMax(), evt_header_, gctBitCounts_, gctRingSums_, genEventInfo_, getCollection(), gtObjectMap_, gtReadoutRecord_, hlt_analysis_, hltresults_, HltTree, edm::HandleBase::isValid(), kGenEventInfo, kHltresults, kL1extemi, kL1extemn, kL1extjet, kL1extjetc, kL1extjetf, kL1extmet, kL1extmht, kL1extmu, kL1exttaujet, kL1GctBitCounts, kL1GctRingSums, kL1GtOMRec, kL1GtRR, kMctruth, kPileupInfo, kRecoVerticesOffline0, kSimhit, m_file, m_l1extraemi, m_l1extraemn, m_l1extrajet, m_l1extrajetc, m_l1extrajetf, m_l1extramet, m_l1extramht, m_l1extramu, m_l1extrataujet, mct_analysis_, mctruth_, combine::missing, dbtoconf::out, pileupInfo_, simhits_, VertexTagOffline0_, and vrt_analysisOffline0_.

91  {
92 
96  edm::Handle<l1extra::L1JetParticleCollection> l1extjetc, l1extjetf, l1extjet, l1exttaujet;
103 
108  edm::Handle<reco::VertexCollection> recoVertexsOffline0;
110 
111  // extract the collections from the event, check their validity and log which are missing
112  std::vector<MissingCollectionInfo> missing;
113 
114  getCollection( iEvent, missing, hltresults, hltresults_, kHltresults );
115  getCollection( iEvent, missing, l1extemi, m_l1extraemi, kL1extemi );
116  getCollection( iEvent, missing, l1extemn, m_l1extraemn, kL1extemn );
117  getCollection( iEvent, missing, l1extmu, m_l1extramu, kL1extmu );
118  getCollection( iEvent, missing, l1extjetc, m_l1extrajetc, kL1extjetc );
119  getCollection( iEvent, missing, l1extjetf, m_l1extrajetf, kL1extjetf );
120  getCollection( iEvent, missing, l1extjet, m_l1extrajet, kL1extjet );
121  getCollection( iEvent, missing, l1exttaujet, m_l1extrataujet, kL1exttaujet );
122  getCollection( iEvent, missing, l1extmet, m_l1extramet, kL1extmet );
123  getCollection( iEvent, missing, l1extmht, m_l1extramht, kL1extmht );
124  getCollection( iEvent, missing, l1GtRR, gtReadoutRecord_, kL1GtRR );
125  getCollection( iEvent, missing, l1GtOMRec, gtObjectMap_, kL1GtOMRec );
126  getCollection( iEvent, missing, gctBitCounts, gctBitCounts_, kL1GctBitCounts );
127  getCollection( iEvent, missing, gctRingSums, gctRingSums_, kL1GctRingSums );
128 
129  getCollection( iEvent, missing, mctruth, mctruth_, kMctruth );
130  getCollection( iEvent, missing, simTracks, simhits_, kSimhit );
131  getCollection( iEvent, missing, simVertices, simhits_, kSimhit );
132  getCollection( iEvent, missing, genEventInfo, genEventInfo_, kGenEventInfo );
133  getCollection( iEvent, missing, pupInfo, pileupInfo_, kPileupInfo );
134 
135  getCollection( iEvent, missing, recoVertexsOffline0, VertexTagOffline0_, kRecoVerticesOffline0 );
136  double ptHat=-1.;
137  if (genEventInfo.isValid()) {ptHat=genEventInfo->qScale();}
138 
139  //edm::ESHandle<LumiCorrectionParam> lumicorrdatahandle; //get LumiCorrectionParam object from event setup
140  //iSetup.getData(lumicorrdatahandle);
141 
142  // print missing collections
143  if (not missing.empty() and (errCnt < errMax())) {
144  errCnt++;
145  std::stringstream out;
146  out << "OpenHLT analyser - missing collections:";
147  BOOST_FOREACH(const MissingCollectionInfo & entry, missing)
148  out << "\n\t" << entry.first << ": " << entry.second->encode();
149  edm::LogPrint("OpenHLT") << out.str() << std::endl;
150  if (errCnt == errMax())
151  edm::LogWarning("OpenHLT") << "Maximum error count reached -- No more messages will be printed.";
152  }
153 
154  // run the analysis, passing required event fragments
156  hltresults,
157  l1extemi,
158  l1extemn,
159  l1extmu,
160  l1extjetc,
161  l1extjetf,
162  l1extjet,
163  l1exttaujet,
164  l1extmet,
165  l1extmht,
166  l1GtRR,
167  gctBitCounts,
168  gctRingSums,
169  iSetup,
170  iEvent,
171  HltTree);
172 
173  //evt_header_.analyze(iEvent, lumicorrdatahandle, HltTree);
174  evt_header_.analyze(iEvent, HltTree);
175 
177  mctruth,
178  ptHat,
179  simTracks,
180  simVertices,
181  pupInfo,
182  HltTree);
183 
185  recoVertexsOffline0,
186  HltTree);
187 
188 
189  // std::cout << " Ending Event Analysis" << std::endl;
190  // After analysis, fill the variables tree
191  if (m_file)
192  m_file->cd();
193  HltTree->Fill();
194 }
const char * kL1extjet
Definition: HLTMessages.cc:40
dictionary missing
Definition: combine.py:4
edm::InputTag gctRingSums_
edm::InputTag VertexTagOffline0_
const char * kL1exttaujet
Definition: HLTMessages.cc:41
edm::InputTag m_l1extrajet
edm::InputTag m_l1extraemn
const char * kHltresults
Definition: HLTMessages.cc:34
edm::InputTag m_l1extrataujet
const char * kL1extmht
Definition: HLTMessages.cc:43
edm::InputTag m_l1extraemi
const char * kSimhit
Definition: HLTMessages.cc:49
edm::InputTag gctBitCounts_
edm::InputTag hltresults_
edm::InputTag gtReadoutRecord_
const char * kL1GctRingSums
Definition: HLTMessages.cc:47
const char * kL1extemi
Definition: HLTMessages.cc:35
const char * kL1extmet
Definition: HLTMessages.cc:42
edm::InputTag m_l1extramet
const char * kL1extemn
Definition: HLTMessages.cc:36
RECOVertex vrt_analysisOffline0_
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)
edm::InputTag genEventInfo_
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.
const char * kMctruth
Definition: HLTMessages.cc:48
static int errMax()
edm::InputTag m_l1extramu
bool first
Definition: L1TdeRCT.cc:94
bool isValid() const
Definition: HandleBase.h:76
std::pair< const char *, const edm::InputTag * > MissingCollectionInfo
Definition: HLTAnalyzer.cc:10
const char * kL1extmu
Definition: HLTMessages.cc:37
tuple out
Definition: dbtoconf.py:99
virtual void analyze(edm::Event const &e, edm::EventSetup const &iSetup)
HLTMCtruth mct_analysis_
const char * kL1extjetc
Definition: HLTMessages.cc:38
const char * kL1GtRR
Definition: HLTMessages.cc:44
const char * kL1GctBitCounts
Definition: HLTMessages.cc:46
edm::InputTag m_l1extramht
edm::InputTag mctruth_
const char * kRecoVerticesOffline0
Definition: HLTMessages.cc:127
edm::InputTag m_l1extrajetf
edm::InputTag gtObjectMap_
const char * kL1extjetf
Definition: HLTMessages.cc:39
const char * kGenEventInfo
Definition: HLTMessages.cc:50
edm::InputTag simhits_
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
const char * kL1GtOMRec
Definition: HLTMessages.cc:45
edm::InputTag pileupInfo_
HLTInfo hlt_analysis_
const char * kPileupInfo
Definition: HLTMessages.cc:136
edm::InputTag m_l1extrajetc
void HLTBitAnalyzer::beginRun ( edm::Run const &  run,
edm::EventSetup const &  es 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 198 of file HLTBitAnalyzer.cc.

References HLTInfo::beginRun(), and hlt_analysis_.

199 {
201 }
void beginRun(const edm::Run &, const edm::EventSetup &)
Definition: HLTInfo.cc:34
HLTInfo hlt_analysis_
void HLTBitAnalyzer::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 204 of file HLTBitAnalyzer.cc.

References _UseTFileService, HltTree, and m_file.

204  {
205 
206  if(!_UseTFileService){
207  if (m_file)
208  m_file->cd();
209 
210  HltTree->Write();
211  delete HltTree;
212  HltTree = 0;
213 
214  if (m_file) { // if there was a tree file...
215  m_file->Write(); // write out the branches
216  delete m_file; // close and delete the file
217  m_file = 0; // set to zero to clean up
218  }
219  }
220 }
static int HLTBitAnalyzer::errMax ( )
inlinestaticprivate

Definition at line 78 of file HLTBitAnalyzer.h.

Referenced by analyze().

78 { return 5; }

Member Data Documentation

double HLTBitAnalyzer::_EtaMax
private

Definition at line 81 of file HLTBitAnalyzer.h.

double HLTBitAnalyzer::_EtaMin
private

Definition at line 81 of file HLTBitAnalyzer.h.

std::string HLTBitAnalyzer::_HistName
private

Definition at line 80 of file HLTBitAnalyzer.h.

Referenced by HLTBitAnalyzer().

bool HLTBitAnalyzer::_UseTFileService
private

Definition at line 83 of file HLTBitAnalyzer.h.

Referenced by endJob(), and HLTBitAnalyzer().

int HLTBitAnalyzer::errCnt
private

Definition at line 77 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

EventHeader HLTBitAnalyzer::evt_header_
private

Default analyses.

Definition at line 52 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::gctBitCounts_
private

Definition at line 71 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::gctRingSums_
private

Definition at line 71 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::genEventInfo_
private

Definition at line 58 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::gtObjectMap_
private

Definition at line 70 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::gtReadoutRecord_
private

Definition at line 70 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

HLTInfo HLTBitAnalyzer::hlt_analysis_
private

Definition at line 53 of file HLTBitAnalyzer.h.

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

edm::InputTag HLTBitAnalyzer::hltresults_
private

Definition at line 58 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

TTree* HLTBitAnalyzer::HltTree

Definition at line 45 of file HLTBitAnalyzer.h.

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

std::string HLTBitAnalyzer::l1extramc_
private

Definition at line 59 of file HLTBitAnalyzer.h.

Referenced by HLTBitAnalyzer().

std::string HLTBitAnalyzer::l1extramu_
private

Definition at line 59 of file HLTBitAnalyzer.h.

Referenced by HLTBitAnalyzer().

TFile* HLTBitAnalyzer::m_file
private

Definition at line 82 of file HLTBitAnalyzer.h.

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

edm::InputTag HLTBitAnalyzer::m_l1extraemi
private

Definition at line 61 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extraemn
private

Definition at line 62 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extrajet
private

Definition at line 65 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extrajetc
private

Definition at line 63 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extrajetf
private

Definition at line 64 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extramet
private

Definition at line 67 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extramht
private

Definition at line 68 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extramu
private

Definition at line 60 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::m_l1extrataujet
private

Definition at line 66 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

HLTMCtruth HLTBitAnalyzer::mct_analysis_
private

Definition at line 55 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::mctruth_
private

Definition at line 73 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::pileupInfo_
private

Definition at line 75 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::simhits_
private

Definition at line 73 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

edm::InputTag HLTBitAnalyzer::VertexTagOffline0_
private

Definition at line 74 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().

RECOVertex HLTBitAnalyzer::vrt_analysisOffline0_
private

Definition at line 56 of file HLTBitAnalyzer.h.

Referenced by analyze(), and HLTBitAnalyzer().