CMS 3D CMS Logo

DigiAnalyzer.cc
Go to the documentation of this file.
1 
8 #include <iostream>
9 
18 
28 
32 
33 class DigiAnalyzer : public edm::EDAnalyzer {
34 public:
35  explicit DigiAnalyzer(edm::ParameterSet const& conf);
36  void analyze(edm::Event const& e, edm::EventSetup const& iSetup) override;
37 
38 private:
40 
50 };
51 
53  eventNumber = 0;
54 
55  wd_token = consumes<CSCWireDigiCollection>(conf.getParameter<edm::InputTag>("wireDigiTag"));
56  sd_token = consumes<CSCStripDigiCollection>(conf.getParameter<edm::InputTag>("stripDigiTag"));
57  cd_token = consumes<CSCComparatorDigiCollection>(conf.getParameter<edm::InputTag>("compDigiTag"));
58  al_token = consumes<CSCALCTDigiCollection>(conf.getParameter<edm::InputTag>("alctDigiTag"));
59  cl_token = consumes<CSCCLCTDigiCollection>(conf.getParameter<edm::InputTag>("clctDigiTag"));
60  rd_token = consumes<CSCRPCDigiCollection>(conf.getParameter<edm::InputTag>("rpcDigiTag"));
61  co_token = consumes<CSCCorrelatedLCTDigiCollection>(conf.getParameter<edm::InputTag>("corrlctDigiTag"));
62  dd_token = consumes<CSCDDUStatusDigiCollection>(conf.getParameter<edm::InputTag>("ddusDigiTag"));
63  dc_token = consumes<CSCDCCFormatStatusDigiCollection>(conf.getParameter<edm::InputTag>("dccfDigiTag"));
64 }
65 
66 void DigiAnalyzer::analyze(edm::Event const& e, edm::EventSetup const& iSetup) {
76 
77  e.getByToken(dd_token, dduStatusDigi);
78  e.getByToken(wd_token, wires);
79  e.getByToken(sd_token, strips);
80  e.getByToken(cd_token, comparators);
81  e.getByToken(al_token, alcts);
82  e.getByToken(cl_token, clcts);
83  e.getByToken(rd_token, rpcs);
84  e.getByToken(co_token, correlatedlcts);
85  e.getByToken(dc_token, formatStatusDigi);
86 
87  for (CSCDCCFormatStatusDigiCollection::DigiRangeIterator j = formatStatusDigi->begin(); j != formatStatusDigi->end();
88  j++) {
89  std::vector<CSCDCCFormatStatusDigi>::const_iterator digiItr = (*j).second.first;
90  std::vector<CSCDCCFormatStatusDigi>::const_iterator last = (*j).second.second;
91  for (; digiItr != last; ++digiItr) {
92  digiItr->print();
93  }
94  }
95 
96  for (CSCDDUStatusDigiCollection::DigiRangeIterator j = dduStatusDigi->begin(); j != dduStatusDigi->end(); j++) {
97  std::vector<CSCDDUStatusDigi>::const_iterator digiItr = (*j).second.first;
98  std::vector<CSCDDUStatusDigi>::const_iterator last = (*j).second.second;
99  for (; digiItr != last; ++digiItr) {
100  CSCDDUHeader header(*digiItr);
101  std::cout << "L1 number = " << header.lvl1num() << std::endl;
102  std::cout << "DDU number = " << header.source_id() << std::endl;
103  }
104  }
105 
106  for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); j++) {
107  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
108  CSCDetId const cscDetId = (*j).first;
109  std::cout << cscDetId << std::endl;
110  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
111  for (; digiItr != last; ++digiItr) {
112  digiItr->print();
113  }
114  }
115 
116  for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); j++) {
117  CSCDetId const cscDetId = (*j).first;
118  std::cout << cscDetId << std::endl;
119  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
120  std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
121  for (; digiItr != last; ++digiItr) {
122  digiItr->print();
123  }
124  }
125 
126  for (CSCComparatorDigiCollection::DigiRangeIterator j = comparators->begin(); j != comparators->end(); j++) {
127  std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first;
128  std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second;
129  for (; digiItr != last; ++digiItr) {
130  digiItr->print();
131  }
132  }
133 
134  for (CSCALCTDigiCollection::DigiRangeIterator j = alcts->begin(); j != alcts->end(); j++) {
135  std::vector<CSCALCTDigi>::const_iterator digiItr = (*j).second.first;
136  std::vector<CSCALCTDigi>::const_iterator last = (*j).second.second;
137  for (; digiItr != last; ++digiItr) {
138  digiItr->print();
139  }
140  }
141 
142  for (CSCCLCTDigiCollection::DigiRangeIterator j = clcts->begin(); j != clcts->end(); j++) {
143  std::vector<CSCCLCTDigi>::const_iterator digiItr = (*j).second.first;
144  std::vector<CSCCLCTDigi>::const_iterator last = (*j).second.second;
145  for (; digiItr != last; ++digiItr) {
146  digiItr->print();
147  }
148  }
149 
150  for (CSCRPCDigiCollection::DigiRangeIterator j = rpcs->begin(); j != rpcs->end(); j++) {
151  std::vector<CSCRPCDigi>::const_iterator digiItr = (*j).second.first;
152  std::vector<CSCRPCDigi>::const_iterator last = (*j).second.second;
153  for (; digiItr != last; ++digiItr) {
154  digiItr->print();
155  }
156  }
157 
158  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j = correlatedlcts->begin(); j != correlatedlcts->end(); j++) {
159  std::vector<CSCCorrelatedLCTDigi>::const_iterator digiItr = (*j).second.first;
160  std::vector<CSCCorrelatedLCTDigi>::const_iterator last = (*j).second.second;
161  for (; digiItr != last; ++digiItr) {
162  digiItr->print();
163  }
164  }
165 
166  eventNumber++;
167  edm::LogInfo("DigiAnalyzer") << "end of event number " << eventNumber;
168 }
169 
DigiAnalyzer::wd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
Definition: DigiAnalyzer.cc:41
DigiAnalyzer::sd_token
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
Definition: DigiAnalyzer.cc:42
DigiAnalyzer::analyze
void analyze(edm::Event const &e, edm::EventSetup const &iSetup) override
Definition: DigiAnalyzer.cc:66
CSCDDUHeader.h
Handle.h
CSCCorrelatedLCTDigiCollection.h
DigiAnalyzer::rd_token
edm::EDGetTokenT< CSCRPCDigiCollection > rd_token
Definition: DigiAnalyzer.cc:46
DigiAnalyzer::eventNumber
int eventNumber
Definition: DigiAnalyzer.cc:39
MessageLogger.h
ESHandle.h
CSCDDUHeader
Definition: CSCDDUHeader.h:11
edm::EDGetTokenT< CSCWireDigiCollection >
CSCStripDigi.h
CSCWireDigi.h
DigiDM_cff.wires
wires
Definition: DigiDM_cff.py:33
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EDAnalyzer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< CSCWireDigiCollection >
DigiAnalyzer
Definition: DigiAnalyzer.cc:33
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
MakerMacros.h
dqmdumpme.last
last
Definition: dqmdumpme.py:56
CSCRPCDigiCollection.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
DigiAnalyzer::cl_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
Definition: DigiAnalyzer.cc:45
DigiAnalyzer::al_token
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
Definition: DigiAnalyzer.cc:44
DigiAnalyzer::co_token
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
Definition: DigiAnalyzer.cc:47
edm::ParameterSet
Definition: ParameterSet.h:47
DigiAnalyzer::dc_token
edm::EDGetTokenT< CSCDCCFormatStatusDigiCollection > dc_token
Definition: DigiAnalyzer.cc:49
Event.h
CSCDetId
Definition: CSCDetId.h:26
DigiAnalyzer::cd_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
Definition: DigiAnalyzer.cc:43
CSCStripDigiCollection.h
edm::EventSetup
Definition: EventSetup.h:58
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCComparatorDigiCollection.h
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:291
CSCWireDigiCollection.h
CSCALCTDigiCollection.h
ConsumesCollector.h
ParameterSet.h
DigiAnalyzer::dd_token
edm::EDGetTokenT< CSCDDUStatusDigiCollection > dd_token
Definition: DigiAnalyzer.cc:48
CSCCLCTDigiCollection.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CSCDDUStatusDigiCollection.h
DigiContainerIterator
Definition: MuonDigiCollection.h:30
edm::Event
Definition: Event.h:73
DigiAnalyzer::DigiAnalyzer
DigiAnalyzer(edm::ParameterSet const &conf)
Definition: DigiAnalyzer.cc:52
edm::InputTag
Definition: InputTag.h:15
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CSCDCCFormatStatusDigiCollection.h