41 : EBRecHitCollection_(iConfig.getParameter<edm::
InputTag>(
"EcalRecHitCollectionEB")),
42 EERecHitCollection_(iConfig.getParameter<edm::
InputTag>(
"EcalRecHitCollectionEE")),
43 EBDigis_(iConfig.getParameter<edm::
InputTag>(
"EBDigiCollection")),
44 EEDigis_(iConfig.getParameter<edm::
InputTag>(
"EEDigiCollection")),
45 headerProducer_(iConfig.getParameter<edm::
InputTag>(
"headerProducer")),
54 side_(iConfig.getUntrackedParameter<int>(
"side", 3)),
55 threshold_(iConfig.getUntrackedParameter<double>(
"amplitudeThreshold", 12.0)),
56 minTimingAmp_(iConfig.getUntrackedParameter<double>(
"minimumTimingAmplitude", 0.100)) {
57 vector<int> listDefaults;
58 listDefaults.push_back(-1);
64 vector<string> defaultMaskedEBs;
65 defaultMaskedEBs.push_back(
"none");
70 string title1 =
"Jitter for all FEDs";
71 string name1 =
"JitterAllFEDs";
75 if (maskedFEDs_[0] == -1) {
79 for (vector<string>::const_iterator ebItr =
maskedEBs_.begin(); ebItr !=
maskedEBs_.end(); ++ebItr) {
80 maskedFEDs_.push_back(fedMap_->getFedFromSlice(*ebItr));
85 for (
int i = 0;
i < 10;
i++)
109 int ievt = iEvent.
id().
event();
115 names =
new std::vector<string>();
116 canvasNames_->Branch(
"names",
"vector<string>", &names);
138 for (
int i = 0;
i < 10;
i++)
141 emptyGraph->SetTitle(
"NOT ECAL");
147 emptyGraph->SetTitle(
"NO DIGIS");
150 int FEDid = 600 + elecId.
dccId();
152 if (FEDid < 610 || FEDid > 645)
155 int ic = isBarrel ? ((
EBDetId)thisDet).ic() : cryIndex;
187 else if (gainId == 2)
189 else if (gainId == 3)
196 emptyGraph->SetTitle(
"FIRST TWO SAMPLES NOT GAIN12");
205 for (
int i = 0;
i < df.
size(); ++
i) {
214 string gainString = (gainId == 1) ?
"Free" :
intToString(gainHuman);
216 sliceName +
"_gain" + gainString;
219 map<int, float>::const_iterator itr;
223 energy = (float)itr->second;
230 oneGraph->SetTitle(title.c_str());
231 oneGraph->SetName(name.c_str());
232 oneGraph->GetXaxis()->SetTitle(
"sample");
233 oneGraph->GetYaxis()->SetTitle(
"ADC");
242 int FEDid = 600 + elecId.
dccId();
244 if (FEDid < 610 || FEDid > 645)
246 int cryIndex = isBarrel ? ((
EBDetId)det).hashedIndex() : ((
EEDetId)det).hashedIndex();
249 float ampli = hit.
energy();
251 vector<int>::iterator
result;
262 bool cryIsInList =
false;
273 string title =
"Digis";
276 pair<map<string, int>::iterator,
bool> pair =
seedFrequencyMap_.insert(make_pair(seed, freq));
278 ++(pair.first->second);
281 TCanvas
can(name.c_str(), title.c_str(), 200, 50, 900, 900);
299 names->push_back(name);
303 if (timingHist ==
nullptr) {
308 timingHist->Fill(hit.
time());
315 int FEDid = 600 + elecId.
dccId();
323 string title1 =
"Jitter for ";
325 string name1 =
"JitterFED";
327 TH1F* timingHist =
fileService->
make<TH1F>(name1.c_str(), title1.c_str(), 150, -7, 7);
342 string frequencies =
"";
345 if (itr->second > 1) {
346 frequencies += itr->first;
347 frequencies +=
" Frequency: ";
352 LogWarning(
"EcalMipGraphs") <<
"Found seeds with frequency > 1: "
368 LogWarning(
"EcalMipGraphs") <<
"Masked channels are: " << channels;
369 LogWarning(
"EcalMipGraphs") <<
"Masked FEDs are: " << feds <<
" and that is all!";
374 ostringstream myStream;
375 myStream << num << flush;
376 return (myStream.str());
381 ostringstream myStream;
382 myStream << num << flush;
383 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)
const edm::EventSetup & c
std::vector< int > maskedFEDs_
int xtalId() const
get the channel id
int getEEIndex(EcalElectronicsId elecId)
const edm::EDGetTokenT< EEDigiCollection > eeDigiToken_
int stripId() const
get the tower id
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
void selectHits(edm::Handle< EcalRecHitCollection > hits, int ievt)
std::vector< T >::const_iterator const_iterator
std::string intToString(int num)
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 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_
void endRun(edm::Run const &, edm::EventSetup const &) override
std::set< EEDetId > listEEChannels
std::map< int, EcalDCCHeaderBlock > FEDsAndDCCHeaders_
std::string getSliceFromFed(int)
const edm::EDGetTokenT< EcalRawDataCollection > rawDataToken_
bool getData(T &iHolder) const
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.
std::map< int, float > crysAndAmplitudesMap_
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalMappingToken_
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
TGraph * selectDigi(DetId det, int ievt)
const CaloTopology * caloTopo_
side_(iConfig.getUntrackedParameter< int >("side", 3))
void home() const
move the navigator back to the starting point
std::vector< int > seedCrys_
const edm::EDGetTokenT< EcalRecHitCollection > ebRecHitToken_
std::vector< int > maskedChannels_
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
DetId id() const
get the id
edm::Handle< EEDigiCollection > EEdigisHandle
std::vector< std::string > * names
const edm::EDGetTokenT< EBDigiCollection > ebDigiToken_
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 edm::ESGetToken< CaloTopology, CaloTopologyRecord > topologyToken_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
const edm::EDGetTokenT< EcalRecHitCollection > eeRecHitToken_
std::map< int, TH1F * > FEDsAndTimingHists_
Log< level::Warning, false > LogWarning
~EcalMipGraphs() override
static float gainRatio[3]
const double minTimingAmp_
TH1F * allFedsTimingHist_
edm::Handle< EBDigiCollection > EBdigisHandle
int adc() const
get the ADC sample (12 bits)
constexpr Detector det() const
get the detector field from this detid