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 edm::EDConsumerBase

Public Member Functions

 L1TCSCTPG (const edm::ParameterSet &ps)
 
virtual ~L1TCSCTPG ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob (void)
 
void beginRun (edm::Run const &iRun, edm::EventSetup const &iSetup)
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

MonitorElementcsctpgbend
 
MonitorElementcsctpgbx
 
MonitorElementcsctpgpattern
 
MonitorElementcsctpgquality
 
edm::InputTag csctpgSource_
 
edm::EDGetTokenT
< CSCCorrelatedLCTDigiCollection
csctpgSource_token_
 
MonitorElementcsctpgstrip
 
MonitorElementcsctpgstriptype
 
MonitorElementcsctpgwg
 
DQMStoredbe
 
std::ofstream logFile_
 
bool monitorDaemon_
 
int nev_
 
std::string outputFile_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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 40 of file L1TCSCTPG.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file L1TCSCTPG.cc.

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

14  : csctpgSource_( ps.getParameter< InputTag >("csctpgSource") ),
15  csctpgSource_token_( consumes<CSCCorrelatedLCTDigiCollection>(ps.getParameter< InputTag >("csctpgSource") ))
16 {
17 
18  // verbosity switch
19  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
20 
21  if(verbose_) cout << "L1TCSCTPG: constructor...." << endl;
22 
23 
24  dbe = NULL;
25  if ( ps.getUntrackedParameter<bool>("DQMStore", false) )
26  {
28  dbe->setVerbose(0);
29  }
30 
31  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
32  if ( outputFile_.size() != 0 ) {
33  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
34  }
35 
36  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
37  if(disable){
38  outputFile_="";
39  }
40 
41 
42  if ( dbe !=NULL ) {
43  dbe->setCurrentFolder("L1T/L1TCSCTPG");
44  }
45 
46 
47 }
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:81
void setVerbose(unsigned level)
Definition: DQMStore.cc:619
DQMStore * dbe
Definition: L1TCSCTPG.h:66
bool verbose_
Definition: L1TCSCTPG.h:78
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > csctpgSource_token_
Definition: L1TCSCTPG.h:82
std::string outputFile_
Definition: L1TCSCTPG.h:77
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
L1TCSCTPG::~L1TCSCTPG ( )
virtual

Definition at line 49 of file L1TCSCTPG.cc.

50 {
51 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 102 of file L1TCSCTPG.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 53 of file L1TCSCTPG.cc.

References nev_.

54 {
55  nev_ = 0;
56 }
int nev_
Definition: L1TCSCTPG.h:76
void L1TCSCTPG::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 58 of file L1TCSCTPG.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 92 of file L1TCSCTPG.cc.

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

93 {
94  if(verbose_) cout << "L1TCSCTPG: end job...." << endl;
95  LogInfo("EndJob") << "analyzed " << nev_ << " events";
96 
97  if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_);
98 
99  return;
100 }
int nev_
Definition: L1TCSCTPG.h:76
DQMStore * dbe
Definition: L1TCSCTPG.h:66
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2485
bool verbose_
Definition: L1TCSCTPG.h:78
tuple cout
Definition: gather_cfg.py:121
std::string outputFile_
Definition: L1TCSCTPG.h:77

Member Data Documentation

MonitorElement* L1TCSCTPG::csctpgbend
private

Definition at line 73 of file L1TCSCTPG.h.

Referenced by analyze(), and beginRun().

MonitorElement* L1TCSCTPG::csctpgbx
private

Definition at line 74 of file L1TCSCTPG.h.

Referenced by analyze(), and beginRun().

MonitorElement* L1TCSCTPG::csctpgpattern
private

Definition at line 68 of file L1TCSCTPG.h.

Referenced by analyze(), and beginRun().

MonitorElement* L1TCSCTPG::csctpgquality
private

Definition at line 69 of file L1TCSCTPG.h.

Referenced by analyze(), and beginRun().

edm::InputTag L1TCSCTPG::csctpgSource_
private

Definition at line 81 of file L1TCSCTPG.h.

Referenced by analyze().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> L1TCSCTPG::csctpgSource_token_
private

Definition at line 82 of file L1TCSCTPG.h.

Referenced by analyze().

MonitorElement* L1TCSCTPG::csctpgstrip
private

Definition at line 71 of file L1TCSCTPG.h.

Referenced by analyze(), and beginRun().

MonitorElement* L1TCSCTPG::csctpgstriptype
private

Definition at line 72 of file L1TCSCTPG.h.

Referenced by analyze(), and beginRun().

MonitorElement* L1TCSCTPG::csctpgwg
private

Definition at line 70 of file L1TCSCTPG.h.

Referenced by analyze(), and beginRun().

DQMStore* L1TCSCTPG::dbe
private

Definition at line 66 of file L1TCSCTPG.h.

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

std::ofstream L1TCSCTPG::logFile_
private

Definition at line 80 of file L1TCSCTPG.h.

bool L1TCSCTPG::monitorDaemon_
private

Definition at line 79 of file L1TCSCTPG.h.

int L1TCSCTPG::nev_
private

Definition at line 76 of file L1TCSCTPG.h.

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

std::string L1TCSCTPG::outputFile_
private

Definition at line 77 of file L1TCSCTPG.h.

Referenced by endJob(), and L1TCSCTPG().

bool L1TCSCTPG::verbose_
private

Definition at line 78 of file L1TCSCTPG.h.

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