CMS 3D CMS Logo

HcalQLPlotAnal.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalQLPlotAnal
4 // Class: HcalQLPlotAnal
5 //
13 //
14 // Original Author: Phillip R. Dudero
15 // Created: Tue Jan 16 21:11:37 CST 2007
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
35 #include <string>
36 //
37 // class declaration
38 //
39 
41 public:
42  explicit HcalQLPlotAnal(const edm::ParameterSet&);
43  ~HcalQLPlotAnal() override;
44 
45 private:
46  void analyze(const edm::Event&, const edm::EventSetup&) override;
47  void endJob() override;
48 
49  // ----------member data ---------------------------
59  bool doCalib_;
60  double calibFC2GeV_;
62 };
63 
64 //
65 // constants, enums and typedefs
66 //
67 
68 //
69 // static data member definitions
70 //
71 
72 //
73 // constructors and destructor
74 //
76  : hcalDigiLabel_(iConfig.getUntrackedParameter<edm::InputTag>("hcalDigiTag")),
77  doCalib_(iConfig.getUntrackedParameter<bool>("doCalib", false)),
78  calibFC2GeV_(iConfig.getUntrackedParameter<double>("calibFC2GeV", 0.2)) {
79  algo_ = new HcalQLPlotAnalAlgos(iConfig.getUntrackedParameter<std::string>("outputFilename").c_str(),
80  iConfig.getParameter<edm::ParameterSet>("HistoParameters"));
81 
82  tok_hbherec_ = consumes<HBHERecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("hbheRHtag"));
83  tok_horec_ = consumes<HORecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("hoRHtag"));
84  tok_hfrec_ = consumes<HFRecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("hfRHtag"));
85  tok_hbhe_ = consumes<HBHEDigiCollection>(hcalDigiLabel_);
86  tok_ho_ = consumes<HODigiCollection>(hcalDigiLabel_);
87  tok_hf_ = consumes<HFDigiCollection>(hcalDigiLabel_);
88  tok_calib_ = consumes<HcalCalibDigiCollection>(hcalDigiLabel_);
89  tok_tb_ = consumes<HcalTBTriggerData>(iConfig.getUntrackedParameter<edm::InputTag>("hcalTrigTag"));
90 }
91 
93  // do anything here that needs to be done at destruction time
94  // (e.g. close files, deallocate resources etc.)
95 }
96 
97 //
98 // member functions
99 //
100 
101 // ------------ method called to for each event ------------
103  // Step A/C: Get Inputs and process (repeatedly)
105  iEvent.getByToken(tok_tb_, trig);
106  if (!trig.isValid()) {
107  edm::LogError("HcalQLPlotAnal::analyze") << "No Trigger Data found, skip event";
108  return;
109  } else {
111  }
113  iEvent.getByToken(tok_hbhe_, hbhedg);
114  if (!hbhedg.isValid()) {
115  edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HBHE Digis/RecHits not found";
116  } else {
117  algo_->processDigi(*hbhedg);
118  }
120  iEvent.getByToken(tok_hbherec_, hbherh);
121  if (!hbherh.isValid()) {
122  edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HBHE Digis/RecHits not found";
123  } else {
124  algo_->processRH(*hbherh, *hbhedg);
125  }
126 
128  iEvent.getByToken(tok_ho_, hodg);
129  if (!hodg.isValid()) {
130  // can't find it!
131  edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HO Digis/RecHits not found";
132  } else {
133  algo_->processDigi(*hodg);
134  }
136  iEvent.getByToken(tok_horec_, horh);
137  if (!horh.isValid()) {
138  // can't find it!
139  edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HO Digis/RecHits not found";
140  } else {
141  algo_->processRH(*horh, *hodg);
142  }
143 
145  iEvent.getByToken(tok_hf_, hfdg);
146 
147  if (!hfdg.isValid()) {
148  // can't find it!
149  edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HF Digis/RecHits not found";
150  } else {
151  algo_->processDigi(*hfdg);
152  }
153 
155  iEvent.getByToken(tok_hfrec_, hfrh);
156  if (!hfrh.isValid()) {
157  // can't find it!
158  edm::LogWarning("HcalQLPlotAnal::analyze") << "One of HF Digis/RecHits not found";
159  } else {
160  algo_->processRH(*hfrh, *hfdg);
161  }
162 
163  if (doCalib_) {
164  // No rechits as of yet...
166  iEvent.getByToken(tok_calib_, calibdg);
167  if (!calibdg.isValid()) {
168  edm::LogWarning("HcalQLPlotAnal::analyze") << "Hcal Calib Digis not found";
169  } else {
170  algo_->processDigi(*calibdg, calibFC2GeV_);
171  }
172  }
173 }
174 
175 // ------------ method called once each job just after ending the event loop ------------
177 
178 //define this as a plug-in
HcalQLPlotAnal::tok_tb_
edm::EDGetTokenT< HcalTBTriggerData > tok_tb_
Definition: HcalQLPlotAnal.cc:58
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:393
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
ESHandle.h
edm::EDGetTokenT
Definition: EDGetToken.h:33
HcalQLPlotAnal::~HcalQLPlotAnal
~HcalQLPlotAnal() override
Definition: HcalQLPlotAnal.cc:92
edm
HLT enums.
Definition: AlignableModifier.h:19
HcalQLPlotAnal::algo_
HcalQLPlotAnalAlgos * algo_
Definition: HcalQLPlotAnal.cc:61
HcalQLPlotAnal::tok_hf_
edm::EDGetTokenT< HFDigiCollection > tok_hf_
Definition: HcalQLPlotAnal.cc:56
HcalTBTriggerData.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
HcalQLPlotAnal::tok_horec_
edm::EDGetTokenT< HORecHitCollection > tok_horec_
Definition: HcalQLPlotAnal.cc:52
HcalQLPlotAnalAlgos::processDigi
void processDigi(const HBHEDigiCollection &hbhedigic)
Definition: HcalQLPlotAnalAlgos.cc:151
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EDAnalyzer.h
HcalQLPlotAnal::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: HcalQLPlotAnal.cc:102
HcalQLPlotAnalAlgos::SetEventType
void SetEventType(const HcalTBTriggerData &trigd)
Definition: HcalQLPlotAnalAlgos.cc:55
HcalQLPlotAnalAlgos::end
void end(void)
Definition: HcalQLPlotAnalAlgos.cc:53
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HcalQLPlotAnal::HcalQLPlotAnal
HcalQLPlotAnal(const edm::ParameterSet &)
Definition: HcalQLPlotAnal.cc:75
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
HcalQLPlotAnal::hcalDigiLabel_
edm::InputTag hcalDigiLabel_
Definition: HcalQLPlotAnal.cc:50
HcalQLPlotAnal::endJob
void endJob() override
Definition: HcalQLPlotAnal.cc:176
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HcalQLPlotAnal::tok_ho_
edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: HcalQLPlotAnal.cc:55
HcalDigiCollections.h
HcalQLPlotAnalAlgos
Definition: HcalQLPlotAnalAlgos.h:17
HcalQLPlotAnal::tok_hbhe_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
Definition: HcalQLPlotAnal.cc:54
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
HcalQLPlotAnal::calibFC2GeV_
double calibFC2GeV_
Definition: HcalQLPlotAnal.cc:60
iEvent
int iEvent
Definition: GenABIO.cc:224
HcalQLPlotAnal::tok_hfrec_
edm::EDGetTokenT< HFRecHitCollection > tok_hfrec_
Definition: HcalQLPlotAnal.cc:53
edm::EventSetup
Definition: EventSetup.h:57
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalQLPlotAnal
Definition: HcalQLPlotAnal.cc:40
ClusterTask_cfi.trig
trig
Definition: ClusterTask_cfi.py:398
HcalQLPlotAnal::tok_hbherec_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbherec_
Definition: HcalQLPlotAnal.cc:51
HcalQLPlotAnalAlgos.h
HcalQLPlotAnal::tok_calib_
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
Definition: HcalQLPlotAnal.cc:57
Frameworkfwd.h
HcalQLPlotAnal::doCalib_
bool doCalib_
Definition: HcalQLPlotAnal.cc:59
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HcalRecHitCollections.h
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
HcalQLPlotAnalAlgos::processRH
void processRH(const HBHERecHitCollection &hbherhc, const HBHEDigiCollection &hbhedgc)
Definition: HcalQLPlotAnalAlgos.cc:73