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")),
39 for (vector<string>::const_iterator itr =
listEBs_.begin(); itr !=
listEBs_.end(); ++itr) {
58 for (vector<int>::const_iterator intIter =
listFEDs_.begin(); intIter !=
listFEDs_.end(); intIter++) {
59 if (((*intIter) < 601) || (654 < (*intIter))) {
60 cout <<
"[EcalPedHists] FED value: " << (*intIter) <<
" found in listFEDs. " 61 <<
" Valid range is 601-654. Returning." << endl;
69 vector<int> listDefaults = vector<int>();
71 for (
int i = 1;
i < 1701; ++
i) {
72 listDefaults.push_back(
i);
77 listDefaults.push_back(0);
78 listDefaults.push_back(1);
79 listDefaults.push_back(2);
83 vector<int>::iterator intIter;
98 if (((*intIter) < 1) || (10 < (*intIter))) {
99 cout <<
"[EcalPedHists] sample number: " << (*intIter) <<
" found in listSamples. " 100 <<
" Valid range is 1-10. Returning." << endl;
129 TDirectory* FEDdir = gDirectory->mkdir(
dir.c_str());
140 TH1F*
hist =
nullptr;
142 string name1 =
"Cry";
143 name1.append(chnl +
"Gain1");
144 string name2 =
"Cry";
145 name2.append(chnl +
"Gain6");
146 string name3 =
"Cry";
147 name3.append(chnl +
"Gain12");
148 hist = mapHistos[name1];
150 if (
hist !=
nullptr) {
151 string cryDirName =
"Cry_" + chnl;
152 TDirectory* cryDir = FEDdir->mkdir(cryDirName.c_str());
154 hist->SetDirectory(cryDir);
157 hist->SetDirectory(cryDir);
159 hist = mapHistos[name3];
160 hist->SetDirectory(cryDir);
165 cerr <<
"EcalPedHists: Error: This shouldn't happen!" << endl;
192 int FEDid = 600 + headerItr->id();
206 bool barrelDigisFound =
true;
207 bool endcapDigisFound =
true;
215 barrelDigisFound =
false;
224 endcapDigisFound =
false;
227 if (barrelDigisFound)
229 if (endcapDigisFound)
231 if (!barrelDigisFound && !endcapDigisFound)
232 edm::LogError(
"EcalPedOffset") <<
"No digis found in the event!";
243 std::map<string, TH1F*> histMap;
250 string title1 =
"Gain1 ADC Counts for channel ";
252 string name1 =
"Cry";
253 name1.append(chnl +
"Gain1");
254 string title2 =
"Gain6 ADC Counts for channel ";
256 string name2 =
"Cry";
257 name2.append(chnl +
"Gain6");
258 string title3 =
"Gain12 ADC Counts for channel ";
260 string name3 =
"Cry";
261 name3.append(chnl +
"Gain12");
262 histMap.insert(make_pair(name1,
new TH1F(name1.c_str(), title1.c_str(), 75, 175.0, 250.0)));
263 histMap[name1]->SetDirectory(
nullptr);
264 histMap.insert(make_pair(
name2,
new TH1F(
name2.c_str(), title2.c_str(), 75, 175.0, 250.0)));
265 histMap[
name2]->SetDirectory(
nullptr);
266 histMap.insert(make_pair(name3,
new TH1F(name3.c_str(), title3.c_str(), 75, 175.0, 250.0)));
267 histMap[name3]->SetDirectory(
nullptr);
282 int FEDid = 600 + elecId.
dccId();
283 int crystalId = detId.
ic();
294 vector<int>::iterator icIter;
305 string name1 =
"Cry";
306 name1.append(chnl +
"Gain1");
307 string name2 =
"Cry";
308 name2.append(chnl +
"Gain6");
309 string name3 =
"Cry";
310 name3.append(chnl +
"Gain12");
311 TH1F*
hist =
nullptr;
313 hist = mapHistos[name1];
317 hist = mapHistos[name3];
321 cerr <<
"EcalPedHistDumper: Error: This shouldn't happen!" << endl;
336 int FEDid = 600 + elecId.
dccId();
337 int crystalId = 10000 * FEDid + 100 * elecId.towerId() + 5 * (elecId.stripId() - 1) + elecId.xtalId();
345 vector<int>::iterator icIter;
356 string name1 =
"Cry";
357 name1.append(chnl +
"Gain1");
358 string name2 =
"Cry";
359 name2.append(chnl +
"Gain6");
360 string name3 =
"Cry";
361 name3.append(chnl +
"Gain12");
362 TH1F*
hist =
nullptr;
364 hist = mapHistos[name1];
368 hist = mapHistos[name3];
372 cerr <<
"EcalPedHistDumper: Error: This shouldn't happen!" << endl;
383 ostringstream myStream;
384 myStream <<
num << flush;
385 return (myStream.str());
std::vector< int > listFEDs_
std::set< int > theRealFedSet_
const edm::EDGetTokenT< EEDigiCollection > eeDigiToken_
const edm::InputTag headerProducer_
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)
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
std::vector< T >::const_iterator const_iterator
std::map< int, stringHistMap > FEDsAndHistMaps_
Log< level::Error, false > LogError
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)
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(edm::Run const &, edm::EventSetup const &c) override
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalMappingToken_
std::vector< std::string > listEBs_
int ic() const
get ECAL/crystal number inside SM
const_iterator begin() const
const edm::EDGetTokenT< EBDigiCollection > ebDigiToken_
void readEBdigis(edm::Handle< EBDigiCollection > digis)
const_iterator end() const
const_iterator end() const
const EcalElectronicsMapping * ecalElectronicsMap_
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
const edm::InputTag barrelDigiCollection_
const_iterator begin() const
The iterator returned can not safely be used across threads.
std::vector< int > listChannels_
EcalPedHists(const edm::ParameterSet &ps)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
void analyze(const edm::Event &e, const edm::EventSetup &c) override
const edm::EDGetTokenT< EcalRawDataCollection > rawDataToken_
void endRun(edm::Run const &, edm::EventSetup const &c) override
void readEEdigis(edm::Handle< EEDigiCollection > digis)
const edm::InputTag endcapDigiCollection_
uint16_t *__restrict__ uint16_t const *__restrict__ adc
std::vector< int > listSamples_