CMS 3D CMS Logo

L1TCSCTPG.cc
Go to the documentation of this file.
1 /*
2  * \file L1TCSCTPG.cc
3  *
4  * \author J. Berryhill
5  *
6  */
7 
9 
10 using namespace std;
11 using namespace edm;
12 
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  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
24  if ( !outputFile_.empty() ) {
25  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
26  }
27 
28  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
29  if(disable){
30  outputFile_="";
31  }
32 }
33 
35 {}
36 
37 void L1TCSCTPG::bookHistograms(DQMStore::IBooker &ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup)
38 {
39  nev_ = 0;
40  ibooker.setCurrentFolder("L1T/L1TCSCTPG");
41 
42  csctpgpattern = ibooker.book1D("CSC TPG hit pattern",
43  "CSC TPG hit pattern", 8, -0.5, 7.5 ) ;
44  csctpgquality = ibooker.book1D("CSC TPG quality",
45  "CSC TPG quality", 16, 0.5, 16.5 ) ;
46  csctpgwg = ibooker.book1D("CSC TPG wire group",
47  "CSC TPG wire group", 116, -0.5, 115.5 ) ;
48  csctpgstrip = ibooker.book1D("CSC TPG strip",
49  "CSC TPG strip", 160, -0.5, 159.5 ) ;
50  csctpgstriptype = ibooker.book1D("CSC TPG strip type",
51  "CSC TPG strip type", 2, 0.5, 1.5 ) ;
52  csctpgbend = ibooker.book1D("CSC TPG bend",
53  "CSC TPG bend", 3, 0.5, 2.5 ) ;
54  csctpgbx = ibooker.book1D("CSC TPG bx",
55  "CSC TPG bx", 20, -0.5, 19.5 ) ;
56 }
57 
59 }
60 
61 
62 void L1TCSCTPG::analyze(const Event& e, const EventSetup& c)
63 {
64  nev_++;
65  if(verbose_) cout << "L1TCSCTPG: analyze...." << endl;
66 
67 
69  e.getByToken(csctpgSource_token_,pCSCTPGcorrlcts);
70 
71  if (!pCSCTPGcorrlcts.isValid()) {
72  edm::LogInfo("DataNotFound") << "can't find CSCCorrelatedLCTDigiCollection with label "
73  << csctpgSource_.label() ;
74  return;
75  }
76 
77 
78  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator cscItr1 = pCSCTPGcorrlcts->begin();
79  cscItr1 != pCSCTPGcorrlcts->end();
80  cscItr1++)
81  {
82  CSCCorrelatedLCTDigiCollection::Range range1 = pCSCTPGcorrlcts->get((*cscItr1).first);
83  for (CSCCorrelatedLCTDigiCollection::const_iterator lctItr1 = range1.first;
84  lctItr1 != range1.second;
85  lctItr1++)
86  {
87 
88 
89  csctpgpattern->Fill(lctItr1->getCLCTPattern());
90  if (verbose_)
91  {
92  std::cout << "CSC TPG CLCT pattern " << lctItr1->getCLCTPattern()
93  << std::endl;
94  }
95 
96  csctpgquality->Fill(lctItr1->getQuality());
97  if (verbose_)
98  {
99  std::cout << "CSC LCT quality " << lctItr1->getQuality()
100  << std::endl;
101  }
102 
103  csctpgwg->Fill(lctItr1->getKeyWG());
104  if (verbose_)
105  {
106  std::cout << "CSC LCT wire group " << lctItr1->getKeyWG()
107  << std::endl;
108  }
109 
110  csctpgstrip->Fill(lctItr1->getStrip());
111  if (verbose_)
112  {
113  std::cout << "CSC LCT strip " << lctItr1->getStrip()
114  << std::endl;
115  }
116 
117  csctpgstriptype->Fill(lctItr1->getStripType());
118  if (verbose_)
119  {
120  std::cout << "CSC LCT strip type" << lctItr1->getStripType()
121  << std::endl;
122  }
123 
124  csctpgbend->Fill(lctItr1->getBend());
125  if (verbose_)
126  {
127  std::cout << "CSC LCT bend " << lctItr1->getBend()
128  << std::endl;
129  }
130 
131  csctpgbx->Fill(lctItr1->getBX());
132  if (verbose_)
133  {
134  std::cout << "CSC LCT bx " << lctItr1->getBX()
135  << std::endl;
136  }
137 
138  }
139  }
140 
141 
142 
143 }
144 
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * csctpgwg
Definition: L1TCSCTPG.h:63
L1TCSCTPG(const edm::ParameterSet &ps)
Definition: L1TCSCTPG.cc:13
MonitorElement * csctpgstrip
Definition: L1TCSCTPG.h:64
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
~L1TCSCTPG() override
Definition: L1TCSCTPG.cc:34
void Fill(long long x)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Definition: L1TCSCTPG.cc:58
edm::InputTag csctpgSource_
Definition: L1TCSCTPG.h:74
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * csctpgbend
Definition: L1TCSCTPG.h:66
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * csctpgbx
Definition: L1TCSCTPG.h:67
int nev_
Definition: L1TCSCTPG.h:69
MonitorElement * csctpgquality
Definition: L1TCSCTPG.h:62
std::vector< CSCCorrelatedLCTDigi >::const_iterator const_iterator
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: L1TCSCTPG.cc:62
bool verbose_
Definition: L1TCSCTPG.h:71
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TCSCTPG.cc:37
std::pair< const_iterator, const_iterator > Range
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > csctpgSource_token_
Definition: L1TCSCTPG.h:75
MonitorElement * csctpgstriptype
Definition: L1TCSCTPG.h:65
std::string outputFile_
Definition: L1TCSCTPG.h:70
MonitorElement * csctpgpattern
Definition: L1TCSCTPG.h:61
Definition: Run.h:44