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"))
38 for(vector<string>::const_iterator itr =
listEBs_.begin(); itr !=
listEBs_.end(); ++itr)
63 for (vector<int>::const_iterator intIter =
listFEDs_.begin(); intIter !=
listFEDs_.end(); intIter++)
65 if ( ((*intIter) < 601)||(654 < (*intIter)) )
67 cout <<
"[EcalPedHists] FED value: " << (*intIter) <<
" found in listFEDs. "
68 <<
" Valid range is 601-654. Returning." << endl;
77 vector<int> listDefaults = vector<int>();
79 for(
int i=1;
i<1701; ++
i)
81 listDefaults.push_back(
i);
86 listDefaults.push_back(0);
87 listDefaults.push_back(1);
88 listDefaults.push_back(2);
92 vector<int>::iterator intIter;
109 if ( ((*intIter) < 1)||(10 < (*intIter)) )
111 cout <<
"[EcalPedHists] sample number: " << (*intIter) <<
" found in listSamples. "
112 <<
" Valid range is 1-10. Returning." << endl;
148 TDirectory* FEDdir = gDirectory->mkdir(dir.c_str());
162 string name1 =
"Cry";
163 name1.append(chnl+
"Gain1");
164 string name2 =
"Cry";
165 name2.append(chnl+
"Gain6");
166 string name3 =
"Cry";
167 name3.append(chnl+
"Gain12");
168 hist = mapHistos[name1];
172 string cryDirName =
"Cry_"+chnl;
173 TDirectory* cryDir = FEDdir->mkdir(cryDirName.c_str());
175 hist->SetDirectory(cryDir);
177 hist = mapHistos[name2];
178 hist->SetDirectory(cryDir);
180 hist = mapHistos[name3];
181 hist->SetDirectory(cryDir);
188 cerr <<
"EcalPedHists: Error: This shouldn't happen!" << endl;
212 edm::LogError (
"EcalPedHists") <<
"Error! can't get the product "
218 headerItr != DCCHeaders->end ();
221 int FEDid = 600+headerItr->id();
236 bool barrelDigisFound =
true;
237 bool endcapDigisFound =
true;
246 edm::LogError (
"EcalPedOffset") <<
"Error! can't get the product "
248 barrelDigisFound =
false;
258 edm::LogError (
"EcalPedOffset") <<
"Error! can't get the product "
260 endcapDigisFound =
false;
267 if(!barrelDigisFound && !endcapDigisFound)
268 edm::LogError (
"EcalPedOffset") <<
"No digis found in the event!";
280 std::map<string,TH1F*> histMap;
288 string title1 =
"Gain1 ADC Counts for channel ";
290 string name1 =
"Cry";
291 name1.append(chnl+
"Gain1");
292 string title2 =
"Gain6 ADC Counts for channel ";
294 string name2 =
"Cry";
295 name2.append(chnl+
"Gain6");
296 string title3 =
"Gain12 ADC Counts for channel ";
298 string name3 =
"Cry";
299 name3.append(chnl+
"Gain12");
300 histMap.insert(make_pair(name1,
new TH1F(name1.c_str(),title1.c_str(),75,175.0,250.0)));
301 histMap[name1]->SetDirectory(0);
302 histMap.insert(make_pair(name2,
new TH1F(name2.c_str(),title2.c_str(),75,175.0,250.0)));
303 histMap[name2]->SetDirectory(0);
304 histMap.insert(make_pair(name3,
new TH1F(name3.c_str(),title3.c_str(),75,175.0,250.0)));
305 histMap[name3]->SetDirectory(0);
323 int FEDid = 600+elecId.dccId();
324 int crystalId = detId.
ic();
335 vector<int>::iterator icIter;
347 string name1 =
"Cry";
348 name1.append(chnl+
"Gain1");
349 string name2 =
"Cry";
350 name2.append(chnl+
"Gain6");
351 string name3 =
"Cry";
352 name3.append(chnl+
"Gain12");
355 hist = mapHistos[name1];
357 hist = mapHistos[name2];
359 hist = mapHistos[name3];
363 cerr <<
"EcalPedHistDumper: Error: This shouldn't happen!" << endl;
381 int FEDid = 600+elecId.dccId();
382 int crystalId = 10000*FEDid+100*elecId.towerId()+5*(elecId.stripId()-1)+elecId.xtalId();
390 vector<int>::iterator icIter;
402 string name1 =
"Cry";
403 name1.append(chnl+
"Gain1");
404 string name2 =
"Cry";
405 name2.append(chnl+
"Gain6");
406 string name3 =
"Cry";
407 name3.append(chnl+
"Gain12");
410 hist = mapHistos[name1];
412 hist = mapHistos[name2];
414 hist = mapHistos[name3];
418 cerr <<
"EcalPedHistDumper: Error: This shouldn't happen!" << endl;
431 ostringstream myStream;
432 myStream << num << flush;
433 return(myStream.str());
int adc(sample_type sample)
get the ADC sample (12 bits)
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
int gainId(sample_type sample)
get the gainId (2 bits)
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::map< int, stringHistMap > FEDsAndHistMaps_
std::string getSliceFromFed(int)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
std::vector< std::string > listEBs_
edm::InputTag endcapDigiCollection_
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 EcalElectronicsMapping * ecalElectronicsMap_
std::vector< int > listChannels_
T const * product() const
EcalPedHists(const edm::ParameterSet &ps)
void analyze(const edm::Event &e, const edm::EventSetup &c)
void beginRun(edm::Run const &, edm::EventSetup const &c)
void readEEdigis(edm::Handle< EEDigiCollection > digis)
edm::InputTag barrelDigiCollection_
std::vector< int > listSamples_