test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DigiAnalyzer.cc
Go to the documentation of this file.
1 
12 
14 
16 
17  eventNumber = 0;
18 
19  wd_token = consumes<CSCWireDigiCollection>( conf.getParameter<edm::InputTag>("wireDigiTag") );
20  sd_token = consumes<CSCStripDigiCollection>( conf.getParameter<edm::InputTag>("stripDigiTag") );
21  cd_token = consumes<CSCComparatorDigiCollection>( conf.getParameter<edm::InputTag>("compDigiTag") );
22  al_token = consumes<CSCALCTDigiCollection>( conf.getParameter<edm::InputTag>("alctDigiTag") );
23  cl_token = consumes<CSCCLCTDigiCollection>( conf.getParameter<edm::InputTag>("clctDigiTag") );
24  rd_token = consumes<CSCRPCDigiCollection>( conf.getParameter<edm::InputTag>("rpcDigiTag") );
25  co_token = consumes<CSCCorrelatedLCTDigiCollection>( conf.getParameter<edm::InputTag>("corrlctDigiTag") );
26  dd_token = consumes<CSCDDUStatusDigiCollection>( conf.getParameter<edm::InputTag>("ddusDigiTag") );
27  dc_token = consumes<CSCDCCFormatStatusDigiCollection>( conf.getParameter<edm::InputTag>("dccfDigiTag") );
28 
29 }
30 
31 void DigiAnalyzer::analyze(edm::Event const& e, edm::EventSetup const& iSetup) {
32 
42 
43  e.getByToken( dd_token, dduStatusDigi );
44  e.getByToken( wd_token, wires );
45  e.getByToken( sd_token, strips );
46  e.getByToken( cd_token, comparators );
47  e.getByToken( al_token, alcts );
48  e.getByToken( cl_token, clcts );
49  e.getByToken( rd_token, rpcs );
50  e.getByToken( co_token, correlatedlcts );
51  e.getByToken( dc_token, formatStatusDigi );
52 
53  for (CSCDCCFormatStatusDigiCollection::DigiRangeIterator j=formatStatusDigi->begin(); j!=formatStatusDigi->end(); j++) {
54  std::vector<CSCDCCFormatStatusDigi>::const_iterator digiItr = (*j).second.first;
55  std::vector<CSCDCCFormatStatusDigi>::const_iterator last = (*j).second.second;
56  for( ; digiItr != last; ++digiItr) {
57  digiItr->print();
58  }
59  }
60 
61 
62  for (CSCDDUStatusDigiCollection::DigiRangeIterator j=dduStatusDigi->begin(); j!=dduStatusDigi->end(); j++) {
63  std::vector<CSCDDUStatusDigi>::const_iterator digiItr = (*j).second.first;
64  std::vector<CSCDDUStatusDigi>::const_iterator last = (*j).second.second;
65  for( ; digiItr != last; ++digiItr) {
66  CSCDDUHeader header(*digiItr);
67  std::cout <<"L1 number = " << header.lvl1num() << std::endl;
68  std::cout <<"DDU number = " << header.source_id() << std::endl;
69  }
70  }
71 
72  for (CSCStripDigiCollection::DigiRangeIterator j=strips->begin(); j!=strips->end(); j++) {
73  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
74  CSCDetId const cscDetId=(*j).first;
75  std::cout<<cscDetId<<std::endl;
76  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
77  for( ; digiItr != last; ++digiItr) {
78  digiItr->print();
79  }
80  }
81 
82  for (CSCWireDigiCollection::DigiRangeIterator j=wires->begin(); j!=wires->end(); j++) {
83  CSCDetId const cscDetId=(*j).first;
84  std::cout<<cscDetId<<std::endl;
85  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
86  std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
87  for( ; digiItr != last; ++digiItr) {
88  digiItr->print();
89  }
90  }
91 
92  for (CSCComparatorDigiCollection::DigiRangeIterator j=comparators->begin(); j!=comparators->end(); j++) {
93 
94  std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first;
95  std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second;
96  for( ; digiItr != last; ++digiItr) {
97  digiItr->print();
98  }
99  }
100 
101  for (CSCALCTDigiCollection::DigiRangeIterator j=alcts->begin(); j!=alcts->end(); j++) {
102 
103  std::vector<CSCALCTDigi>::const_iterator digiItr = (*j).second.first;
104  std::vector<CSCALCTDigi>::const_iterator last = (*j).second.second;
105  for( ; digiItr != last; ++digiItr) {
106  digiItr->print();
107  }
108  }
109 
110  for (CSCCLCTDigiCollection::DigiRangeIterator j=clcts->begin(); j!=clcts->end(); j++) {
111 
112  std::vector<CSCCLCTDigi>::const_iterator digiItr = (*j).second.first;
113  std::vector<CSCCLCTDigi>::const_iterator last = (*j).second.second;
114  for( ; digiItr != last; ++digiItr) {
115  digiItr->print();
116  }
117  }
118 
119  for (CSCRPCDigiCollection::DigiRangeIterator j=rpcs->begin(); j!=rpcs->end(); j++) {
120 
121  std::vector<CSCRPCDigi>::const_iterator digiItr = (*j).second.first;
122  std::vector<CSCRPCDigi>::const_iterator last = (*j).second.second;
123  for( ; digiItr != last; ++digiItr) {
124  digiItr->print();
125  }
126  }
127 
128  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j=correlatedlcts->begin(); j!=correlatedlcts->end(); j++) {
129 
130  std::vector<CSCCorrelatedLCTDigi>::const_iterator digiItr = (*j).second.first;
131  std::vector<CSCCorrelatedLCTDigi>::const_iterator last = (*j).second.second;
132  for( ; digiItr != last; ++digiItr) {
133  digiItr->print();
134  }
135  }
136 
137  eventNumber++;
138  edm::LogInfo ("DigiAnalyzer") << "end of event number " << eventNumber;
139 
140 }
141 
142 
143 
144 
145 
T getParameter(std::string const &) const
int lvl1num() const
Definition: CSCDDUHeader.h:25
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< CSCDCCFormatStatusDigiCollection > dc_token
Definition: DigiAnalyzer.h:44
virtual void analyze(edm::Event const &e, edm::EventSetup const &iSetup)
Definition: DigiAnalyzer.cc:31
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
Definition: DigiAnalyzer.h:38
edm::EDGetTokenT< CSCDDUStatusDigiCollection > dd_token
Definition: DigiAnalyzer.h:43
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
Definition: DigiAnalyzer.h:36
int j
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< CSCRPCDigiCollection > rd_token
Definition: DigiAnalyzer.h:41
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
Definition: DigiAnalyzer.h:42
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
Definition: DigiAnalyzer.h:40
DigiAnalyzer(edm::ParameterSet const &conf)
Definition: DigiAnalyzer.cc:15
tuple cout
Definition: gather_cfg.py:145
int source_id() const
Definition: CSCDDUHeader.h:23
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
Definition: DigiAnalyzer.h:37
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
Definition: DigiAnalyzer.h:39