37 EBUncalibratedRecHitCollection_ (iConfig.getParameter<
edm::
InputTag>(
"EBUncalibratedRecHitCollection")),
38 EEUncalibratedRecHitCollection_ (iConfig.getParameter<
edm::
InputTag>(
"EEUncalibratedRecHitCollection")),
40 histRangeMax_ (iConfig.getUntrackedParameter<double>(
"histogramMaxRange",200.0)),
41 histRangeMin_ (iConfig.getUntrackedParameter<double>(
"histogramMinRange",-10.0)),
42 fileName_ (iConfig.getUntrackedParameter<
std::
string>(
"fileName",
std::
string(
"ecalURechHitHists")))
44 vector<int> listDefaults;
45 listDefaults.push_back(-1);
50 vector<string> defaultMaskedEBs;
51 defaultMaskedEBs.push_back(
"none");
55 string title1 =
"Uncalib Rec Hits (ADC counts)";
56 string name1 =
"URecHitsAllFEDs";
59 title1 =
"Jitter for all FEDs";
60 name1 =
"JitterAllFEDs";
64 if(maskedFEDs_[0]==-1)
70 for(vector<string>::const_iterator ebItr =
maskedEBs_.begin(); ebItr !=
maskedEBs_.end(); ++ebItr)
72 maskedFEDs_.push_back(fedMap_->getFedFromSlice(*ebItr));
97 LogDebug(
"EcalURecHitHists") <<
"event " << ievt <<
" hits collection size " << EBhits->
size();
100 LogDebug(
"EcalURecHitHists") <<
"event " << ievt <<
" hits collection size " << EEhits->
size();
109 int FEDid = 600+elecId.
dccId();
112 vector<int>::iterator
result;
116 LogWarning(
"EcalURecHitHists") <<
"skipping uncalRecHit for FED " << FEDid <<
" ; amplitude " << ampli;
123 LogWarning(
"EcalURecHitHists") <<
"skipping uncalRecHit for channel: " << ic <<
" with amplitude " << ampli ;
130 if(uRecHist==
nullptr)
137 uRecHist->Fill(ampli);
139 timingHist->Fill(hit.
jitter());
151 int FEDid = 600+elecId.
dccId();
154 vector<int>::iterator
result;
158 LogWarning(
"EcalURecHitHists") <<
"skipping uncalRecHit for FED " << FEDid <<
" ; amplitude " << ampli;
165 LogWarning(
"EcalURecHitHists") <<
"skipping uncalRecHit for channel: " << ic <<
" with amplitude " << ampli ;
172 if(uRecHist==
nullptr)
179 uRecHist->Fill(ampli);
181 timingHist->Fill(hit.
jitter());
198 string title1 =
"Uncalib Rec Hits (ADC counts) for ";
200 string name1 =
"URecHitsFED";
205 FEDsAndHists_[FED]->SetDirectory(
nullptr);
207 title1 =
"Jitter for ";
211 TH1F* timingHist =
new TH1F(name1.c_str(),title1.c_str(),14,-7,7);
213 FEDsAndTimingHists_[FED]->SetDirectory(
nullptr);
232 TFile root_file_(
fileName_.c_str() ,
"RECREATE");
234 for(map<int,TH1F*>::const_iterator itr =
FEDsAndHists_.begin();
238 TDirectory* FEDdir = gDirectory->mkdir(dir.c_str());
241 TH1F*
hist = itr->second;
246 cerr <<
"EcalPedHists: Error: This shouldn't happen!" << endl;
254 cerr <<
"EcalPedHists: Error: This shouldn't happen!" << endl;
270 LogWarning(
"EcalMipGraphs") <<
"Masked channels are: " << channels <<
" and that is all!";
277 ostringstream myStream;
278 myStream << num << flush;
279 return(myStream.str());
const EcalElectronicsMapping * ecalElectronicsMap_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
TH1F * allFedsTimingHist_
int hashedIndex() const
get a compact index for arrays
edm::InputTag EBUncalibratedRecHitCollection_
void beginRun(edm::Run const &, edm::EventSetup const &) override
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
edm::InputTag EEUncalibratedRecHitCollection_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::string getSliceFromFed(int)
int hashedIndex(int ieta, int iphi)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
void analyze(edm::Event const &, edm::EventSetup const &) override
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int ic() const
get ECAL/crystal number inside SM
std::map< int, TH1F * > FEDsAndHists_
Namespace of DDCMS conversion namespace.
const_iterator end() const
EcalURecHitHists(const edm::ParameterSet &)
std::vector< int > maskedChannels_
std::map< int, TH1F * > FEDsAndTimingHists_
std::vector< std::string > maskedEBs_
std::vector< int > maskedFEDs_
~EcalURecHitHists() override
std::string intToString(int num)
T const * product() const
const_iterator begin() const