1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
/*----------------------------------------------------------------------
Toy EDProducers and EDProducts for testing purposes only.
----------------------------------------------------------------------*/
#include <string>
#include <iostream>
#include <map>
#include <vector>
#include "FWCore/Framework/interface/global/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CondFormats/CSCObjects/interface/CSCChamberIndex.h"
#include "CondFormats/DataRecord/interface/CSCChamberIndexRcd.h"
#include "CondFormats/CSCObjects/interface/CSCMapItem.h"
using namespace std;
namespace edmtest {
class CSCReadChamberIndexValuesAnalyzer : public edm::global::EDAnalyzer<> {
public:
explicit CSCReadChamberIndexValuesAnalyzer(edm::ParameterSet const& p) : token_{esConsumes()} {}
~CSCReadChamberIndexValuesAnalyzer() override {}
void analyze(edm::StreamID, const edm::Event& e, const edm::EventSetup& c) const override;
private:
edm::ESGetToken<CSCChamberIndex, CSCChamberIndexRcd> token_;
};
void CSCReadChamberIndexValuesAnalyzer::analyze(edm::StreamID,
const edm::Event& e,
const edm::EventSetup& context) const {
using namespace edm::eventsetup;
edm::LogSystem log("CSCChamberIndex");
log << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
log << " ---EVENT NUMBER " << e.id().event() << std::endl;
const CSCChamberIndex* myChIndex = &context.getData(token_);
std::vector<CSCMapItem::MapItem>::const_iterator it;
int count = 0;
for (it = myChIndex->ch_index.begin(); it != myChIndex->ch_index.end(); ++it) {
count++;
log << count << ") ";
log << it->chamberLabel << " ";
log << it->chamberId << " ";
log << it->endcap << " ";
log << it->station << " ";
log << it->ring << " ";
log << it->chamber << " ";
log << it->cscIndex << " ";
log << it->layerIndex << " ";
log << it->stripIndex << " ";
log << it->anodeIndex << " ";
log << it->strips << " ";
log << it->anodes << " ";
log << it->crateLabel << " ";
log << it->crateid << " ";
log << it->sector << " ";
log << it->trig_sector << " ";
log << it->dmb << " ";
log << it->cscid << " ";
log << it->ddu << " ";
log << it->ddu_input << " ";
log << it->slink << " ";
log << it->fed_crate << " "
<< " ";
log << it->ddu_slot << " "
<< " ";
log << it->dcc_fifo << " "
<< " ";
log << it->fiber_crate << " "
<< " ";
log << it->fiber_pos << " "
<< " ";
log << it->fiber_socket << " " << std::endl;
}
}
DEFINE_FWK_MODULE(CSCReadChamberIndexValuesAnalyzer);
} // namespace edmtest
|