15 fileName_(ps.getUntrackedParameter<
std::
string>(
"fileName",
std::
string(
"ecalPedDigiDump"))),
16 barrelDigiCollection_(ps.getParameter<
edm::InputTag>(
"EBdigiCollection")),
17 endcapDigiCollection_(ps.getParameter<
edm::InputTag>(
"EEdigiCollection")),
18 headerProducer_(ps.getParameter<
edm::InputTag>(
"headerProducer")) {
33 if (!listEBs_.empty()) {
35 for (vector<string>::const_iterator itr = listEBs_.begin(); itr != listEBs_.end(); ++itr) {
54 for (vector<int>::const_iterator intIter =
listFEDs_.begin(); intIter !=
listFEDs_.end(); intIter++) {
55 if (((*intIter) < 601) || (654 < (*intIter))) {
56 cout <<
"[EcalPedHists] FED value: " << (*intIter) <<
" found in listFEDs. " 57 <<
" Valid range is 601-654. Returning." << endl;
65 vector<int> listDefaults = vector<int>();
67 for (
int i = 1;
i < 1701; ++
i) {
68 listDefaults.push_back(
i);
73 listDefaults.push_back(0);
74 listDefaults.push_back(1);
75 listDefaults.push_back(2);
79 vector<int>::iterator intIter;
94 if (((*intIter) < 1) || (10 < (*intIter))) {
95 cout <<
"[EcalPedHists] sample number: " << (*intIter) <<
" found in listSamples. " 96 <<
" Valid range is 1-10. Returning." << endl;
125 TDirectory* FEDdir = gDirectory->mkdir(dir.c_str());
136 TH1F*
hist =
nullptr;
138 string name1 =
"Cry";
139 name1.append(chnl +
"Gain1");
140 string name2 =
"Cry";
141 name2.append(chnl +
"Gain6");
142 string name3 =
"Cry";
143 name3.append(chnl +
"Gain12");
144 hist = mapHistos[name1];
146 if (hist !=
nullptr) {
147 string cryDirName =
"Cry_" + chnl;
148 TDirectory* cryDir = FEDdir->mkdir(cryDirName.c_str());
150 hist->SetDirectory(cryDir);
152 hist = mapHistos[name2];
153 hist->SetDirectory(cryDir);
155 hist = mapHistos[name3];
156 hist->SetDirectory(cryDir);
161 cerr <<
"EcalPedHists: Error: This shouldn't happen!" << endl;
189 int FEDid = 600 + headerItr->id();
203 bool barrelDigisFound =
true;
204 bool endcapDigisFound =
true;
213 barrelDigisFound =
false;
223 endcapDigisFound =
false;
226 if (barrelDigisFound)
228 if (endcapDigisFound)
230 if (!barrelDigisFound && !endcapDigisFound)
231 edm::LogError(
"EcalPedOffset") <<
"No digis found in the event!";
242 std::map<string, TH1F*> histMap;
249 string title1 =
"Gain1 ADC Counts for channel ";
251 string name1 =
"Cry";
252 name1.append(chnl +
"Gain1");
253 string title2 =
"Gain6 ADC Counts for channel ";
255 string name2 =
"Cry";
256 name2.append(chnl +
"Gain6");
257 string title3 =
"Gain12 ADC Counts for channel ";
259 string name3 =
"Cry";
260 name3.append(chnl +
"Gain12");
261 histMap.insert(make_pair(name1,
new TH1F(name1.c_str(), title1.c_str(), 75, 175.0, 250.0)));
262 histMap[name1]->SetDirectory(
nullptr);
263 histMap.insert(make_pair(name2,
new TH1F(name2.c_str(), title2.c_str(), 75, 175.0, 250.0)));
264 histMap[name2]->SetDirectory(
nullptr);
265 histMap.insert(make_pair(name3,
new TH1F(name3.c_str(), title3.c_str(), 75, 175.0, 250.0)));
266 histMap[name3]->SetDirectory(
nullptr);
281 int FEDid = 600 + elecId.
dccId();
282 int crystalId = detId.
ic();
293 vector<int>::iterator icIter;
304 string name1 =
"Cry";
305 name1.append(chnl +
"Gain1");
306 string name2 =
"Cry";
307 name2.append(chnl +
"Gain6");
308 string name3 =
"Cry";
309 name3.append(chnl +
"Gain12");
310 TH1F*
hist =
nullptr;
312 hist = mapHistos[name1];
314 hist = mapHistos[name2];
316 hist = mapHistos[name3];
320 cerr <<
"EcalPedHistDumper: Error: This shouldn't happen!" << endl;
335 int FEDid = 600 + elecId.
dccId();
336 int crystalId = 10000 * FEDid + 100 * elecId.towerId() + 5 * (elecId.stripId() - 1) + elecId.xtalId();
344 vector<int>::iterator icIter;
355 string name1 =
"Cry";
356 name1.append(chnl +
"Gain1");
357 string name2 =
"Cry";
358 name2.append(chnl +
"Gain6");
359 string name3 =
"Cry";
360 name3.append(chnl +
"Gain12");
361 TH1F*
hist =
nullptr;
363 hist = mapHistos[name1];
365 hist = mapHistos[name2];
367 hist = mapHistos[name3];
371 cerr <<
"EcalPedHistDumper: Error: This shouldn't happen!" << endl;
382 ostringstream myStream;
383 myStream << num << flush;
384 return (myStream.str());
std::vector< int > listFEDs_
T getUntrackedParameter(std::string const &, T const &) const
std::set< int > theRealFedSet_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::string intToString(int num)
int getFedFromSlice(std::string)
std::vector< T >::const_iterator const_iterator
std::map< int, stringHistMap > FEDsAndHistMaps_
const_iterator begin() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void endJob(void) override
std::string getSliceFromFed(int)
void beginRun(edm::Run const &, edm::EventSetup const &c) override
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
std::vector< std::string > listEBs_
edm::InputTag endcapDigiCollection_
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag headerProducer_
int ic() const
get ECAL/crystal number inside SM
void readEBdigis(edm::Handle< EBDigiCollection > digis)
const_iterator end() const
const EcalElectronicsMapping * ecalElectronicsMap_
std::vector< int > listChannels_
EcalPedHists(const edm::ParameterSet &ps)
const_iterator end() const
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
void analyze(const edm::Event &e, const edm::EventSetup &c) override
void readEEdigis(edm::Handle< EEDigiCollection > digis)
edm::InputTag barrelDigiCollection_
T const * product() const
const_iterator begin() const
std::vector< int > listSamples_