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 
62 }
63 
64 void L1TCSCTPG::analyze(const Event& e, const EventSetup& c)
65 {
66  nev_++;
67  if(verbose_) cout << "L1TCSCTPG: analyze...." << endl;
68 
69 
71  e.getByToken(csctpgSource_token_,pCSCTPGcorrlcts);
72 
73  if (!pCSCTPGcorrlcts.isValid()) {
74  edm::LogInfo("DataNotFound") << "can't find CSCCorrelatedLCTDigiCollection with label "
75  << csctpgSource_.label() ;
76  return;
77  }
78 
79 
80  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator cscItr1 = pCSCTPGcorrlcts->begin();
81  cscItr1 != pCSCTPGcorrlcts->end();
82  cscItr1++)
83  {
84  CSCCorrelatedLCTDigiCollection::Range range1 = pCSCTPGcorrlcts->get((*cscItr1).first);
85  for (CSCCorrelatedLCTDigiCollection::const_iterator lctItr1 = range1.first;
86  lctItr1 != range1.second;
87  lctItr1++)
88  {
89 
90 
91  csctpgpattern->Fill(lctItr1->getCLCTPattern());
92  if (verbose_)
93  {
94  std::cout << "CSC TPG CLCT pattern " << lctItr1->getCLCTPattern()
95  << std::endl;
96  }
97 
98  csctpgquality->Fill(lctItr1->getQuality());
99  if (verbose_)
100  {
101  std::cout << "CSC LCT quality " << lctItr1->getQuality()
102  << std::endl;
103  }
104 
105  csctpgwg->Fill(lctItr1->getKeyWG());
106  if (verbose_)
107  {
108  std::cout << "CSC LCT wire group " << lctItr1->getKeyWG()
109  << std::endl;
110  }
111 
112  csctpgstrip->Fill(lctItr1->getStrip());
113  if (verbose_)
114  {
115  std::cout << "CSC LCT strip " << lctItr1->getStrip()
116  << std::endl;
117  }
118 
119  csctpgstriptype->Fill(lctItr1->getStripType());
120  if (verbose_)
121  {
122  std::cout << "CSC LCT strip type" << lctItr1->getStripType()
123  << std::endl;
124  }
125 
126  csctpgbend->Fill(lctItr1->getBend());
127  if (verbose_)
128  {
129  std::cout << "CSC LCT bend " << lctItr1->getBend()
130  << std::endl;
131  }
132 
133  csctpgbx->Fill(lctItr1->getBX());
134  if (verbose_)
135  {
136  std::cout << "CSC LCT bx " << lctItr1->getBX()
137  << std::endl;
138  }
139 
140  }
141  }
142 
143 
144 
145 }
146 
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * csctpgwg
Definition: L1TCSCTPG.h:64
L1TCSCTPG(const edm::ParameterSet &ps)
Definition: L1TCSCTPG.cc:13
MonitorElement * csctpgstrip
Definition: L1TCSCTPG.h:65
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
~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:75
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * csctpgbend
Definition: L1TCSCTPG.h:67
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * csctpgbx
Definition: L1TCSCTPG.h:68
int nev_
Definition: L1TCSCTPG.h:70
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * csctpgquality
Definition: L1TCSCTPG.h:63
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:64
bool verbose_
Definition: L1TCSCTPG.h:72
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:76
MonitorElement * csctpgstriptype
Definition: L1TCSCTPG.h:66
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition: L1TCSCTPG.cc:61
std::string outputFile_
Definition: L1TCSCTPG.h:71
MonitorElement * csctpgpattern
Definition: L1TCSCTPG.h:62
Definition: Run.h:43