CMS 3D CMS Logo

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

#include <L1TECALTPG.h>

Inheritance diagram for L1TECALTPG:
edm::EDAnalyzer

Public Member Functions

 L1TECALTPG (const edm::ParameterSet &ps)
 
virtual ~L1TECALTPG ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob (void)
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

DQMStoredbe
 
MonitorElementecalTpEtEtaPhiB_
 
MonitorElementecalTpEtEtaPhiE_
 
edm::InputTag ecaltpgSourceB_
 
edm::InputTag ecaltpgSourceE_
 
MonitorElementecalTpOccEtaPhiB_
 
MonitorElementecalTpOccEtaPhiE_
 
MonitorElementecalTpRankB_
 
MonitorElementecalTpRankE_
 
bool enableEE_
 
ofstream logFile_
 
bool monitorDaemon_
 
int nev_
 
std::string outputFile_
 
bool verbose_
 

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)
 

Detailed Description

Definition at line 69 of file L1TECALTPG.h.

Constructor & Destructor Documentation

L1TECALTPG::L1TECALTPG ( const edm::ParameterSet ps)

Definition at line 94 of file L1TECALTPG.cc.

References gather_cfg::cout, dbe, enableEE_, edm::ParameterSet::getUntrackedParameter(), NULL, cmsCodeRules.cppFunctionSkipper::operator, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.

94  :
95  ecaltpgSourceB_(ps.getParameter<edm::InputTag>("ecaltpgSourceB")),
96  ecaltpgSourceE_(ps.getParameter<edm::InputTag>("ecaltpgSourceE"))
97 {
98 
99  // verbosity switch
100  verbose_ = ps.getUntrackedParameter < bool > ("verbose", false);
101 
102  // ecal endcap switch
103  enableEE_ = ps.getUntrackedParameter < bool > ("enableEE", false);
104 
105  if (verbose_)
106  std::cout << "L1TECALTPG: constructor...." << std::endl;
107 
108 
109  dbe = NULL;
110  if (ps.getUntrackedParameter < bool > ("DQMStore", false)) {
112  dbe->setVerbose(0);
113  }
114 
115  outputFile_ =
116  ps.getUntrackedParameter < std::string > ("outputFile", "");
117  if (outputFile_.size() != 0) {
118  std::cout << "L1T Monitoring histograms will be saved to "
119  << outputFile_ << std::endl;
120  }
121 
122  bool disable =
123  ps.getUntrackedParameter < bool > ("disableROOToutput", false);
124  if (disable) {
125  outputFile_ = "";
126  }
127 
128 
129  if (dbe != NULL) {
130  dbe->setCurrentFolder("L1T/L1TECALTPG");
131  }
132 
133 
134 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool verbose_
Definition: L1TECALTPG.h:104
#define NULL
Definition: scimark2.h:8
edm::InputTag ecaltpgSourceB_
Definition: L1TECALTPG.h:109
bool enableEE_
Definition: L1TECALTPG.h:105
void setVerbose(unsigned level)
Definition: DQMStore.cc:201
DQMStore * dbe
Definition: L1TECALTPG.h:91
std::string outputFile_
Definition: L1TECALTPG.h:103
tuple cout
Definition: gather_cfg.py:41
edm::InputTag ecaltpgSourceE_
Definition: L1TECALTPG.h:110
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
L1TECALTPG::~L1TECALTPG ( )
virtual

Definition at line 136 of file L1TECALTPG.cc.

137 {
138 }

Member Function Documentation

void L1TECALTPG::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 193 of file L1TECALTPG.cc.

References gather_cfg::cout, ecalTpEtEtaPhiB_, ecalTpEtEtaPhiE_, ecaltpgSourceB_, ecaltpgSourceE_, ecalTpOccEtaPhiB_, ecalTpOccEtaPhiE_, ecalTpRankB_, ecalTpRankE_, enableEE_, MonitorElement::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), edm::InputTag::label(), nev_, and verbose_.

194 {
195  nev_++;
196  if (verbose_) {
197  std::cout << "L1TECALTPG: analyze...." << std::endl;
198  }
199 
200  // Get the ECAL TPGs
203  // e.getByType(ebTP);
204  e.getByLabel(ecaltpgSourceB_,ebTP);
205  e.getByLabel(ecaltpgSourceE_,eeTP);
206 
207  if (!eeTP.isValid() && enableEE_)
208  {
209  edm::LogInfo("DataNotFound") << "can't find EcalTrigPrimCollection with "
210  " endcap label " << ecaltpgSourceE_.label() ;
211  return;
212  }
213  if (!ebTP.isValid())
214  {
215  edm::LogInfo("DataNotFound") << "can't find EcalTrigPrimCollection with "
216  " barrel label " << ecaltpgSourceB_.label() ;
217  return;
218  }
219 
220  // Fill the ECAL TPG histograms
221  if ( verbose_ ) {
222  std::cout << "L1TECALTPG: barrel size is " << ebTP->size() << std::endl;
223  std::cout << "L1TECALTPG: endcap size is " << eeTP->size() << std::endl;
224  }
225 
226  for (EcalTrigPrimDigiCollection::const_iterator iebTP = ebTP->begin();
227  iebTP != ebTP->end(); iebTP++) {
228  if ( verbose_ ) {
229  std::cout << "barrel: " << iebTP->id().iphi() << ", "
230  << iebTP->id().ieta()
231  << std::endl;
232  }
233  ecalTpEtEtaPhiB_->Fill(iebTP->id().iphi(), iebTP->id().ieta(),
234  iebTP->compressedEt());
235  ecalTpOccEtaPhiB_->Fill(iebTP->id().iphi(), iebTP->id().ieta());
236  ecalTpRankB_->Fill(iebTP->compressedEt());
237 
238  }
239 
240  if (enableEE_){
241  // endcap
242  for (EcalTrigPrimDigiCollection::const_iterator ieeTP = eeTP->begin();
243  ieeTP != eeTP->end(); ieeTP++) {
244  if ( verbose_ ) {
245  std::cout << "endcap: " << ieeTP->id().iphi() << ", "
246  << ieeTP->id().ieta()
247  << std::endl;
248  }
249  ecalTpEtEtaPhiE_->Fill(ieeTP->id().iphi(), ieeTP->id().ieta(),
250  ieeTP->compressedEt());
251  ecalTpOccEtaPhiE_->Fill(ieeTP->id().iphi(), ieeTP->id().ieta());
252  ecalTpRankE_->Fill(ieeTP->compressedEt());
253 
254  }
255  }
256 
257 }
MonitorElement * ecalTpEtEtaPhiB_
Definition: L1TECALTPG.h:94
MonitorElement * ecalTpEtEtaPhiE_
Definition: L1TECALTPG.h:98
bool verbose_
Definition: L1TECALTPG.h:104
std::vector< T >::const_iterator const_iterator
edm::InputTag ecaltpgSourceB_
Definition: L1TECALTPG.h:109
MonitorElement * ecalTpRankE_
Definition: L1TECALTPG.h:100
bool enableEE_
Definition: L1TECALTPG.h:105
void Fill(long long x)
MonitorElement * ecalTpRankB_
Definition: L1TECALTPG.h:96
MonitorElement * ecalTpOccEtaPhiB_
Definition: L1TECALTPG.h:95
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
std::string const & label() const
Definition: InputTag.h:25
MonitorElement * ecalTpOccEtaPhiE_
Definition: L1TECALTPG.h:99
tuple cout
Definition: gather_cfg.py:41
edm::InputTag ecaltpgSourceE_
Definition: L1TECALTPG.h:110
void L1TECALTPG::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 140 of file L1TECALTPG.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe, ecalTpEtEtaPhiB_, ecalTpEtEtaPhiE_, ecalTpOccEtaPhiB_, ecalTpOccEtaPhiE_, ecalTpRankB_, ecalTpRankE_, nev_, cmsCodeRules.cppFunctionSkipper::operator, DQMStore::rmdir(), RTPBINS, RTPMAX, RTPMIN, DQMStore::setCurrentFolder(), TPETABINS, TPETAMAX, TPETAMIN, TPPHIBINS, TPPHIMAX, and TPPHIMIN.

141 {
142 
143  nev_ = 0;
144 
145  // get hold of back-end interface
146  DQMStore *dbe = 0;
147  dbe = Service < DQMStore > ().operator->();
148 
149  if (dbe) {
150  dbe->setCurrentFolder("L1T/L1TECALTPG");
151  dbe->rmdir("L1T/L1TECALTPG");
152  }
153 
154 
155  if (dbe) {
156  dbe->setCurrentFolder("L1T/L1TECALTPG");
158  dbe->book2D("EcalTpEtEtaPhiB", "ECAL TP E_{T} Barrel", TPPHIBINS,
161  dbe->book2D("EcalTpOccEtaPhiB", "ECAL TP OCCUPANCY Barrel", TPPHIBINS,
163  ecalTpRankB_ =
164  dbe->book1D("EcalTpRankB", "ECAL TP RANK Barrel", RTPBINS, RTPMIN,
165  RTPMAX);
166 
168  dbe->book2D("EcalTpEtEtaPhiE", "ECAL TP E_{T} Endcap", TPPHIBINS,
171  dbe->book2D("EcalTpOccEtaPhiE", "ECAL TP OCCUPANCY Endcap", TPPHIBINS,
173  ecalTpRankE_ =
174  dbe->book1D("EcalTpRankE", "ECAL TP RANK Endcap", RTPBINS, RTPMIN,
175  RTPMAX);
176 
177  }
178 }
MonitorElement * ecalTpEtEtaPhiB_
Definition: L1TECALTPG.h:94
const unsigned int RTPBINS
Definition: L1TECALTPG.cc:81
MonitorElement * ecalTpEtEtaPhiE_
Definition: L1TECALTPG.h:98
const float TPETAMIN
Definition: L1TCompare.cc:111
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2296
const unsigned int TPPHIBINS
Definition: L1TCompare.cc:106
const float RTPMIN
Definition: L1TECALTPG.cc:82
MonitorElement * ecalTpRankE_
Definition: L1TECALTPG.h:100
const float TPETAMAX
Definition: L1TCompare.cc:112
const unsigned int TPETABINS
Definition: L1TCompare.cc:110
const float RTPMAX
Definition: L1TECALTPG.cc:83
MonitorElement * ecalTpRankB_
Definition: L1TECALTPG.h:96
MonitorElement * ecalTpOccEtaPhiB_
Definition: L1TECALTPG.h:95
const float TPPHIMIN
Definition: L1TCompare.cc:107
DQMStore * dbe
Definition: L1TECALTPG.h:91
const float TPPHIMAX
Definition: L1TCompare.cc:108
MonitorElement * ecalTpOccEtaPhiE_
Definition: L1TECALTPG.h:99
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:647
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void L1TECALTPG::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 181 of file L1TECALTPG.cc.

References gather_cfg::cout, dbe, nev_, outputFile_, DQMStore::save(), and verbose_.

182 {
183  if (verbose_)
184  std::cout << "L1TECALTPG: end job...." << std::endl;
185  LogInfo("EndJob") << "analyzed " << nev_ << " events";
186 
187  if (outputFile_.size() != 0 && dbe)
188  dbe->save(outputFile_);
189 
190  return;
191 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1883
bool verbose_
Definition: L1TECALTPG.h:104
DQMStore * dbe
Definition: L1TECALTPG.h:91
std::string outputFile_
Definition: L1TECALTPG.h:103
tuple cout
Definition: gather_cfg.py:41

Member Data Documentation

DQMStore* L1TECALTPG::dbe
private

Definition at line 91 of file L1TECALTPG.h.

Referenced by beginJob(), endJob(), and L1TECALTPG().

MonitorElement* L1TECALTPG::ecalTpEtEtaPhiB_
private

Definition at line 94 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TECALTPG::ecalTpEtEtaPhiE_
private

Definition at line 98 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

edm::InputTag L1TECALTPG::ecaltpgSourceB_
private

Definition at line 109 of file L1TECALTPG.h.

Referenced by analyze().

edm::InputTag L1TECALTPG::ecaltpgSourceE_
private

Definition at line 110 of file L1TECALTPG.h.

Referenced by analyze().

MonitorElement* L1TECALTPG::ecalTpOccEtaPhiB_
private

Definition at line 95 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TECALTPG::ecalTpOccEtaPhiE_
private

Definition at line 99 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TECALTPG::ecalTpRankB_
private

Definition at line 96 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TECALTPG::ecalTpRankE_
private

Definition at line 100 of file L1TECALTPG.h.

Referenced by analyze(), and beginJob().

bool L1TECALTPG::enableEE_
private

Definition at line 105 of file L1TECALTPG.h.

Referenced by analyze(), and L1TECALTPG().

ofstream L1TECALTPG::logFile_
private

Definition at line 107 of file L1TECALTPG.h.

bool L1TECALTPG::monitorDaemon_
private

Definition at line 106 of file L1TECALTPG.h.

int L1TECALTPG::nev_
private

Definition at line 102 of file L1TECALTPG.h.

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

std::string L1TECALTPG::outputFile_
private

Definition at line 103 of file L1TECALTPG.h.

Referenced by endJob(), and L1TECALTPG().

bool L1TECALTPG::verbose_
private

Definition at line 104 of file L1TECALTPG.h.

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