@@ -34,93 +34,100 @@ R.Ofierzynski - 2.Oct. 2007
34
34
35
35
using namespace std ;
36
36
37
- namespace edmtest
38
- {
39
- class HcalCalibrationsAnalyzer : public edm ::one::EDAnalyzer<>
40
- {
37
+ namespace edmtest {
38
+ class HcalCalibrationsAnalyzer : public edm ::one::EDAnalyzer<> {
41
39
public:
42
- explicit HcalCalibrationsAnalyzer (edm::ParameterSet const & p);
43
- ~ HcalCalibrationsAnalyzer() override = default ;
40
+ explicit HcalCalibrationsAnalyzer (edm::ParameterSet const & p);
41
+ ~HcalCalibrationsAnalyzer () override = default ;
44
42
virtual void analyze (const edm::Event& e, const edm::EventSetup& c);
43
+
45
44
private:
46
45
const edm::ESGetToken<HcalPedestalWidths, HcalPedestalWidthsRcd> tok_pPedWs_;
47
46
const edm::ESGetToken<HcalGains, HcalGainsRcd> tok_pGains_;
48
47
const edm::ESGetToken<HcalGainWidths, HcalGainWidthsRcd> tok_pGainWs_;
49
48
const edm::ESGetToken<HcalPedestals, HcalPedestalsRcd> tok_pPeds_;
50
49
};
51
-
52
50
53
- HcalCalibrationsAnalyzer::HcalCalibrationsAnalyzer (edm::ParameterSet const &) :
54
- // tok_pPedsW_(esConsumes<HcalPedestalWidths, HcalPedestalWisthssRcd>()),
55
- // tok_pGains_(esConsumes<HcalGains, HcalGainsRcd>()),
56
- // tok_pGainWs_(esConsumes<HcalGainWidths, HcalGainWidthsRcd>()),
57
- tok_pPeds_ (esConsumes<HcalPedestals, HcalPedestalsRcd>()) {}
51
+ HcalCalibrationsAnalyzer::HcalCalibrationsAnalyzer (edm::ParameterSet const &)
52
+ : // tok_pPedsW_(esConsumes<HcalPedestalWidths, HcalPedestalWisthssRcd>()),
53
+ // tok_pGains_(esConsumes<HcalGains, HcalGainsRcd>()),
54
+ // tok_pGainWs_(esConsumes<HcalGainWidths, HcalGainWidthsRcd>()),
55
+ tok_pPeds_ (esConsumes<HcalPedestals, HcalPedestalsRcd>()) {}
58
56
59
- void
60
- HcalCalibrationsAnalyzer::analyze (const edm::Event& e, const edm::EventSetup& context)
61
- {
57
+ void HcalCalibrationsAnalyzer::analyze (const edm::Event& e, const edm::EventSetup& context) {
62
58
using namespace edm ::eventsetup;
63
59
// Context is not used.
64
- std::cout <<" HcalCalibrationsAnalyzer::analyze-> I AM IN RUN NUMBER " << e.id ().run () <<std::endl;
65
- std::cout <<" HcalCalibrationsAnalyzer::analyze-> ---EVENT NUMBER " << e.id ().run () <<std::endl;
60
+ std::cout << " HcalCalibrationsAnalyzer::analyze-> I AM IN RUN NUMBER " << e.id ().run () << std::endl;
61
+ std::cout << " HcalCalibrationsAnalyzer::analyze-> ---EVENT NUMBER " << e.id ().run () << std::endl;
66
62
const auto & pPeds = context.getHandle (tok_pPeds_);
67
- // const auto& pPedWs = context.getHandle(tok_pPedWs_);
68
- // const auto& pGains = context.getHandle(tok_pGains_);
69
- // const auto& pGainWs = context.getHandle(tok_pGainWs_);
63
+ // const auto& pPedWs = context.getHandle(tok_pPedWs_);
64
+ // const auto& pGains = context.getHandle(tok_pGains_);
65
+ // const auto& pGainWs = context.getHandle(tok_pGainWs_);
70
66
// call tracker code
71
67
//
72
68
73
69
const HcalPedestals* myped = pPeds.product ();
74
70
std::vector<DetId> mychannels = myped->getAllChannels ();
75
71
// int cnt=0;
76
- for (std::vector<DetId>::const_iterator it=mychannels.begin (); it!=mychannels.end (); it++)
77
- {
78
- HcalDetId mydetid (*it);
79
- int eta = mydetid.ieta ();
80
- int phi = mydetid.iphi ();
81
- int depth = mydetid.depth ();
82
- int subdet = mydetid.subdet ();
83
- char id;
84
- int rawid = mydetid.rawId ();
85
- switch (subdet)
86
- {
87
- case 1 : id = ' B' ; break ;
88
- case 2 : id = ' E' ; break ;
89
- case 3 : id = ' O' ; break ;
90
- case 4 : id = ' F' ; break ;
91
- }
92
-
93
- // std::cout << eta << " " << phi << " " << depth << " " << subdet << " H" << id << " " << rawid;
94
- const float * values = (myped->getValues (mydetid))->getValues ();
95
- // if (values) std::cout << ", pedestals: "
96
- // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
97
-
98
- printf (" %d %d %d H%c %f %f %f %f %X\n " , eta, phi, depth, id, values [0 ], values [1 ], values [2 ], values [3 ], rawid);
99
-
100
-
72
+ for (std::vector<DetId>::const_iterator it = mychannels.begin (); it != mychannels.end (); it++) {
73
+ HcalDetId mydetid (*it);
74
+ int eta = mydetid.ieta ();
75
+ int phi = mydetid.iphi ();
76
+ int depth = mydetid.depth ();
77
+ int subdet = mydetid.subdet ();
78
+ char id;
79
+ int rawid = mydetid.rawId ();
80
+ switch (subdet) {
81
+ case 1 :
82
+ id = ' B' ;
83
+ break ;
84
+ case 2 :
85
+ id = ' E' ;
86
+ break ;
87
+ case 3 :
88
+ id = ' O' ;
89
+ break ;
90
+ case 4 :
91
+ id = ' F' ;
92
+ break ;
101
93
}
102
94
103
-
104
-
105
- // std::cout <<" Hcal peds for channel HB eta=15, phi=5, depth=2 "<<std::endl;
106
- // int channelID = HcalDetId (HcalBarrel, 15, 5, 2).rawId();
107
- // const HcalPedestals* myped=pPeds.product();
108
- // const HcalPedestalWidths* mypedW=pPedWs.product();
109
- // const HcalGains* mygain=pGains.product();
110
- // const HcalGainWidths* mygainW=pGainWs.product();
111
- //
112
- // const float* values = myped->getValues (channelID);
113
- // if (values) std::cout << "pedestals for channel " << channelID << ": "
114
- // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
115
- // values = mypedW->getValues (channelID);
116
- // if (values) std::cout << "pedestal widths for channel " << channelID << ": "
117
- // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
118
- // values = mygain->getValues (channelID);
119
- // if (values) std::cout << "gains for channel " << channelID << ": "
120
- // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
121
- // values = mygainW->getValues (channelID);
122
- // if (values) std::cout << "gain widts for channel " << channelID << ": "
123
- // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
95
+ // std::cout << eta << " " << phi << " " << depth << " " << subdet << " H" << id << " " << rawid;
96
+ const float * values = (myped->getValues (mydetid))->getValues ();
97
+ // if (values) std::cout << ", pedestals: "
98
+ // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
99
+
100
+ printf (" %d %d %d H%c %f %f %f %f %X\n " ,
101
+ eta,
102
+ phi,
103
+ depth,
104
+ id,
105
+ values[0 ],
106
+ values[1 ],
107
+ values[2 ],
108
+ values[3 ],
109
+ rawid);
110
+ }
111
+
112
+ // std::cout <<" Hcal peds for channel HB eta=15, phi=5, depth=2 "<<std::endl;
113
+ // int channelID = HcalDetId (HcalBarrel, 15, 5, 2).rawId();
114
+ // const HcalPedestals* myped=pPeds.product();
115
+ // const HcalPedestalWidths* mypedW=pPedWs.product();
116
+ // const HcalGains* mygain=pGains.product();
117
+ // const HcalGainWidths* mygainW=pGainWs.product();
118
+ //
119
+ // const float* values = myped->getValues (channelID);
120
+ // if (values) std::cout << "pedestals for channel " << channelID << ": "
121
+ // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
122
+ // values = mypedW->getValues (channelID);
123
+ // if (values) std::cout << "pedestal widths for channel " << channelID << ": "
124
+ // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
125
+ // values = mygain->getValues (channelID);
126
+ // if (values) std::cout << "gains for channel " << channelID << ": "
127
+ // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
128
+ // values = mygainW->getValues (channelID);
129
+ // if (values) std::cout << "gain widts for channel " << channelID << ": "
130
+ // << values [0] << '/' << values [1] << '/' << values [2] << '/' << values [3] << std::endl;
124
131
}
125
132
DEFINE_FWK_MODULE (HcalCalibrationsAnalyzer);
126
- }
133
+ } // namespace edmtest
0 commit comments