43 : EBRecHitCollection_(iConfig.getParameter<
edm::
InputTag>(
"EcalRecHitCollectionEB")),
44 EERecHitCollection_(iConfig.getParameter<
edm::
InputTag>(
"EcalRecHitCollectionEE")),
45 EBDigis_(iConfig.getParameter<
edm::
InputTag>(
"EBDigiCollection")),
46 EEDigis_(iConfig.getParameter<
edm::
InputTag>(
"EEDigiCollection")),
47 headerProducer_(iConfig.getParameter<
edm::
InputTag>(
"headerProducer")),
49 side_(iConfig.getUntrackedParameter<
int>(
"side", 3)),
50 threshold_(iConfig.getUntrackedParameter<double>(
"amplitudeThreshold", 12.0)),
51 minTimingAmp_(iConfig.getUntrackedParameter<double>(
"minimumTimingAmplitude", 0.100)) {
52 vector<int> listDefaults;
53 listDefaults.push_back(-1);
59 vector<string> defaultMaskedEBs;
60 defaultMaskedEBs.push_back(
"none");
65 string title1 =
"Jitter for all FEDs";
66 string name1 =
"JitterAllFEDs";
70 if (maskedFEDs_[0] == -1) {
74 for (vector<string>::const_iterator ebItr =
maskedEBs_.begin(); ebItr !=
maskedEBs_.end(); ++ebItr) {
75 maskedFEDs_.push_back(fedMap_->getFedFromSlice(*ebItr));
80 for (
int i = 0;
i < 10;
i++)
104 int ievt = iEvent.
id().
event();
110 names =
new std::vector<string>();
111 canvasNames_->Branch(
"names",
"vector<string>", &names);
136 for (
int i = 0;
i < 10;
i++)
139 emptyGraph->SetTitle(
"NOT ECAL");
145 emptyGraph->SetTitle(
"NO DIGIS");
148 int FEDid = 600 + elecId.
dccId();
150 if (FEDid < 610 || FEDid > 645)
153 int ic = isBarrel ? ((
EBDetId)thisDet).ic() : cryIndex;
185 else if (gainId == 2)
187 else if (gainId == 3)
194 emptyGraph->SetTitle(
"FIRST TWO SAMPLES NOT GAIN12");
203 for (
int i = 0;
i < df.
size(); ++
i) {
212 string gainString = (gainId == 1) ?
"Free" :
intToString(gainHuman);
214 sliceName +
"_gain" + gainString;
217 map<int, float>::const_iterator itr;
221 energy = (
float)itr->second;
228 oneGraph->SetTitle(title.c_str());
229 oneGraph->SetName(name.c_str());
230 oneGraph->GetXaxis()->SetTitle(
"sample");
231 oneGraph->GetYaxis()->SetTitle(
"ADC");
240 int FEDid = 600 + elecId.
dccId();
242 if (FEDid < 610 || FEDid > 645)
244 int cryIndex = isBarrel ? ((
EBDetId)det).hashedIndex() : ((
EEDetId)det).hashedIndex();
247 float ampli = hit.
energy();
249 vector<int>::iterator
result;
260 bool cryIsInList =
false;
271 string title =
"Digis";
274 pair<map<string, int>::iterator,
bool> pair =
seedFrequencyMap_.insert(make_pair(seed, freq));
276 ++(pair.first->second);
279 TCanvas can(name.c_str(), title.c_str(), 200, 50, 900, 900);
286 for (
int j =
side_ / 2; j >= -
side_ / 2; --j) {
297 names->push_back(name);
301 if (timingHist ==
nullptr) {
306 timingHist->Fill(hit.
time());
313 int FEDid = 600 + elecId.
dccId();
321 string title1 =
"Jitter for ";
323 string name1 =
"JitterFED";
325 TH1F* timingHist =
fileService->
make<TH1F>(name1.c_str(), title1.c_str(), 150, -7, 7);
340 string frequencies =
"";
343 if (itr->second > 1) {
344 frequencies += itr->first;
345 frequencies +=
" Frequency: ";
350 LogWarning(
"EcalMipGraphs") <<
"Found seeds with frequency > 1: " 366 LogWarning(
"EcalMipGraphs") <<
"Masked channels are: " << channels;
367 LogWarning(
"EcalMipGraphs") <<
"Masked FEDs are: " << feds <<
" and that is all!";
372 ostringstream myStream;
373 myStream << num << flush;
374 return (myStream.str());
379 ostringstream myStream;
380 myStream << num << flush;
381 return (myStream.str());
EventNumber_t event() const
void analyze(edm::Event const &, edm::EventSetup const &) override
T getUntrackedParameter(std::string const &, T const &) const
std::string floatToString(float num)
std::vector< int > maskedFEDs_
int xtalId() const
get the channel id
int getEEIndex(EcalElectronicsId elecId)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
edm::InputTag headerProducer_
int stripId() const
get the tower id
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
bool isBarrel(GeomDetEnumerators::SubDetector m)
std::vector< T >::const_iterator const_iterator
std::string intToString(int num)
edm::InputTag EERecHitCollection_
std::vector< std::string > maskedEBs_
EcalMGPASample sample(int i) const
int towerId() const
get the tower id
T * make(const Args &...args) const
make new ROOT object
const_iterator begin() const
const EcalElectronicsMapping * ecalElectronicsMap_
static edm::Service< TFileService > fileService
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
int gainId() const
get the gainId (2 bits)
std::map< std::string, int > seedFrequencyMap_
std::set< EEDetId > listEEChannels
std::map< int, EcalDCCHeaderBlock > FEDsAndDCCHeaders_
std::string getSliceFromFed(int)
EcalMipGraphs(const edm::ParameterSet &)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
std::set< EBDetId > listEBChannels
T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
void selectHits(edm::Handle< EcalRecHitCollection > hits, int ievt, edm::ESHandle< CaloTopology > caloTopo)
std::map< int, float > crysAndAmplitudesMap_
edm::InputTag EBRecHitCollection_
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
TGraph * selectDigi(DetId det, int ievt)
const_iterator end() const
void home() const
move the navigator back to the starting point
std::vector< int > seedCrys_
std::vector< int > maskedChannels_
DetId id() const
get the id
edm::Handle< EEDigiCollection > EEdigisHandle
std::vector< std::string > * names
void beginRun(edm::Run const &, edm::EventSetup const &) override
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
const_iterator end() const
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
std::map< int, TH1F * > FEDsAndTimingHists_
~EcalMipGraphs() override
static float gainRatio[3]
T const * product() const
TH1F * allFedsTimingHist_
edm::Handle< EBDigiCollection > EBdigisHandle
const_iterator begin() const
int adc() const
get the ADC sample (12 bits)
constexpr Detector det() const
get the detector field from this detid