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
L1TCSCTPG Class Reference

#include <L1TCSCTPG.h>

Inheritance diagram for L1TCSCTPG:
edm::EDAnalyzer

Public Member Functions

 L1TCSCTPG (const edm::ParameterSet &ps)
 
virtual ~L1TCSCTPG ()
 
- 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

MonitorElementcsctpgbend
 
MonitorElementcsctpgbx
 
MonitorElementcsctpgpattern
 
MonitorElementcsctpgquality
 
edm::InputTag csctpgSource_
 
MonitorElementcsctpgstrip
 
MonitorElementcsctpgstriptype
 
MonitorElementcsctpgwg
 
DQMStoredbe
 
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)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 42 of file L1TCSCTPG.h.

Constructor & Destructor Documentation

L1TCSCTPG::L1TCSCTPG ( const edm::ParameterSet ps)

Definition at line 16 of file L1TCSCTPG.cc.

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

17  : csctpgSource_( ps.getParameter< InputTag >("csctpgSource") )
18 {
19 
20  // verbosity switch
21  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
22 
23  if(verbose_) cout << "L1TCSCTPG: constructor...." << endl;
24 
25 
26  dbe = NULL;
27  if ( ps.getUntrackedParameter<bool>("DQMStore", false) )
28  {
30  dbe->setVerbose(0);
31  }
32 
33  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
34  if ( outputFile_.size() != 0 ) {
35  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
36  }
37 
38  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
39  if(disable){
40  outputFile_="";
41  }
42 
43 
44  if ( dbe !=NULL ) {
45  dbe->setCurrentFolder("L1T/L1TCSCTPG");
46  }
47 
48 
49 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define NULL
Definition: scimark2.h:8
edm::InputTag csctpgSource_
Definition: L1TCSCTPG.h:79
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
DQMStore * dbe
Definition: L1TCSCTPG.h:64
bool verbose_
Definition: L1TCSCTPG.h:76
tuple cout
Definition: gather_cfg.py:121
std::string outputFile_
Definition: L1TCSCTPG.h:75
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
L1TCSCTPG::~L1TCSCTPG ( )
virtual

Definition at line 51 of file L1TCSCTPG.cc.

52 {
53 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 104 of file L1TCSCTPG.cc.

References gather_cfg::cout, csctpgbend, csctpgbx, csctpgpattern, csctpgquality, csctpgSource_, csctpgstrip, csctpgstriptype, csctpgwg, MonitorElement::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), edm::InputTag::label(), nev_, and verbose_.

105 {
106  nev_++;
107  if(verbose_) cout << "L1TCSCTPG: analyze...." << endl;
108 
109 
111  e.getByLabel(csctpgSource_,pCSCTPGcorrlcts);
112 
113  if (!pCSCTPGcorrlcts.isValid()) {
114  edm::LogInfo("DataNotFound") << "can't find CSCCorrelatedLCTDigiCollection with label "
115  << csctpgSource_.label() ;
116  return;
117  }
118 
119 
120  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator cscItr1 = pCSCTPGcorrlcts->begin();
121  cscItr1 != pCSCTPGcorrlcts->end();
122  cscItr1++)
123  {
124  CSCCorrelatedLCTDigiCollection::Range range1 = pCSCTPGcorrlcts->get((*cscItr1).first);
125  for (CSCCorrelatedLCTDigiCollection::const_iterator lctItr1 = range1.first;
126  lctItr1 != range1.second;
127  lctItr1++)
128  {
129 
130 
131  csctpgpattern->Fill(lctItr1->getCLCTPattern());
132  if (verbose_)
133  {
134  std::cout << "CSC TPG CLCT pattern " << lctItr1->getCLCTPattern()
135  << std::endl;
136  }
137 
138  csctpgquality->Fill(lctItr1->getQuality());
139  if (verbose_)
140  {
141  std::cout << "CSC LCT quality " << lctItr1->getQuality()
142  << std::endl;
143  }
144 
145  csctpgwg->Fill(lctItr1->getKeyWG());
146  if (verbose_)
147  {
148  std::cout << "CSC LCT wire group " << lctItr1->getKeyWG()
149  << std::endl;
150  }
151 
152  csctpgstrip->Fill(lctItr1->getStrip());
153  if (verbose_)
154  {
155  std::cout << "CSC LCT strip " << lctItr1->getStrip()
156  << std::endl;
157  }
158 
159  csctpgstriptype->Fill(lctItr1->getStripType());
160  if (verbose_)
161  {
162  std::cout << "CSC LCT strip type" << lctItr1->getStripType()
163  << std::endl;
164  }
165 
166  csctpgbend->Fill(lctItr1->getBend());
167  if (verbose_)
168  {
169  std::cout << "CSC LCT bend " << lctItr1->getBend()
170  << std::endl;
171  }
172 
173  csctpgbx->Fill(lctItr1->getBX());
174  if (verbose_)
175  {
176  std::cout << "CSC LCT bx " << lctItr1->getBX()
177  << std::endl;
178  }
179 
180  }
181  }
182 
183 
184 
185 }
MonitorElement * csctpgwg
Definition: L1TCSCTPG.h:68
MonitorElement * csctpgstrip
Definition: L1TCSCTPG.h:69
void Fill(long long x)
edm::InputTag csctpgSource_
Definition: L1TCSCTPG.h:79
MonitorElement * csctpgbend
Definition: L1TCSCTPG.h:71
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * csctpgbx
Definition: L1TCSCTPG.h:72
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
int nev_
Definition: L1TCSCTPG.h:74
MonitorElement * csctpgquality
Definition: L1TCSCTPG.h:67
std::vector< DigiType >::const_iterator const_iterator
std::string const & label() const
Definition: InputTag.h:25
bool verbose_
Definition: L1TCSCTPG.h:76
std::pair< const_iterator, const_iterator > Range
tuple cout
Definition: gather_cfg.py:121
MonitorElement * csctpgstriptype
Definition: L1TCSCTPG.h:70
MonitorElement * csctpgpattern
Definition: L1TCSCTPG.h:66
void L1TCSCTPG::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file L1TCSCTPG.cc.

References DQMStore::book1D(), csctpgbend, csctpgbx, csctpgpattern, csctpgquality, csctpgstrip, csctpgstriptype, csctpgwg, dbe, nev_, cppFunctionSkipper::operator, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

56 {
57 
58  nev_ = 0;
59 
60  // get hold of back-end interface
61  DQMStore* dbe = 0;
62  dbe = Service<DQMStore>().operator->();
63 
64  if ( dbe ) {
65  dbe->setCurrentFolder("L1T/L1TCSCTPG");
66  dbe->rmdir("L1T/L1TCSCTPG");
67  }
68 
69 
70  if ( dbe )
71  {
72  dbe->setCurrentFolder("L1T/L1TCSCTPG");
73 
74  csctpgpattern = dbe->book1D("CSC TPG hit pattern",
75  "CSC TPG hit pattern", 8, -0.5, 7.5 ) ;
76  csctpgquality = dbe->book1D("CSC TPG quality",
77  "CSC TPG quality", 16, 0.5, 16.5 ) ;
78  csctpgwg = dbe->book1D("CSC TPG wire group",
79  "CSC TPG wire group", 116, -0.5, 115.5 ) ;
80  csctpgstrip = dbe->book1D("CSC TPG strip",
81  "CSC TPG strip", 160, -0.5, 159.5 ) ;
82  csctpgstriptype = dbe->book1D("CSC TPG strip type",
83  "CSC TPG strip type", 2, 0.5, 1.5 ) ;
84  csctpgbend = dbe->book1D("CSC TPG bend",
85  "CSC TPG bend", 3, 0.5, 2.5 ) ;
86  csctpgbx = dbe->book1D("CSC TPG bx",
87  "CSC TPG bx", 20, -0.5, 19.5 ) ;
88 
89 
90  }
91 }
MonitorElement * csctpgwg
Definition: L1TCSCTPG.h:68
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2530
MonitorElement * csctpgstrip
Definition: L1TCSCTPG.h:69
MonitorElement * csctpgbend
Definition: L1TCSCTPG.h:71
MonitorElement * csctpgbx
Definition: L1TCSCTPG.h:72
int nev_
Definition: L1TCSCTPG.h:74
DQMStore * dbe
Definition: L1TCSCTPG.h:64
MonitorElement * csctpgquality
Definition: L1TCSCTPG.h:67
MonitorElement * csctpgstriptype
Definition: L1TCSCTPG.h:70
MonitorElement * csctpgpattern
Definition: L1TCSCTPG.h:66
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void L1TCSCTPG::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 94 of file L1TCSCTPG.cc.

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

95 {
96  if(verbose_) cout << "L1TCSCTPG: end job...." << endl;
97  LogInfo("EndJob") << "analyzed " << nev_ << " events";
98 
99  if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_);
100 
101  return;
102 }
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:2113
int nev_
Definition: L1TCSCTPG.h:74
DQMStore * dbe
Definition: L1TCSCTPG.h:64
bool verbose_
Definition: L1TCSCTPG.h:76
tuple cout
Definition: gather_cfg.py:121
std::string outputFile_
Definition: L1TCSCTPG.h:75

Member Data Documentation

MonitorElement* L1TCSCTPG::csctpgbend
private

Definition at line 71 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTPG::csctpgbx
private

Definition at line 72 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTPG::csctpgpattern
private

Definition at line 66 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTPG::csctpgquality
private

Definition at line 67 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

edm::InputTag L1TCSCTPG::csctpgSource_
private

Definition at line 79 of file L1TCSCTPG.h.

Referenced by analyze().

MonitorElement* L1TCSCTPG::csctpgstrip
private

Definition at line 69 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTPG::csctpgstriptype
private

Definition at line 70 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

MonitorElement* L1TCSCTPG::csctpgwg
private

Definition at line 68 of file L1TCSCTPG.h.

Referenced by analyze(), and beginJob().

DQMStore* L1TCSCTPG::dbe
private

Definition at line 64 of file L1TCSCTPG.h.

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

ofstream L1TCSCTPG::logFile_
private

Definition at line 78 of file L1TCSCTPG.h.

bool L1TCSCTPG::monitorDaemon_
private

Definition at line 77 of file L1TCSCTPG.h.

int L1TCSCTPG::nev_
private

Definition at line 74 of file L1TCSCTPG.h.

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

std::string L1TCSCTPG::outputFile_
private

Definition at line 75 of file L1TCSCTPG.h.

Referenced by endJob(), and L1TCSCTPG().

bool L1TCSCTPG::verbose_
private

Definition at line 76 of file L1TCSCTPG.h.

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