CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
EcalMipGraphs Class Reference

#include <EcalMipGraphs.h>

Inheritance diagram for EcalMipGraphs:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 EcalMipGraphs (const edm::ParameterSet &)
 
 ~EcalMipGraphs () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endJob () override
 
std::string floatToString (float num)
 
int getEEIndex (EcalElectronicsId elecId)
 
void initHists (int)
 
std::string intToString (int num)
 
TGraph * selectDigi (DetId det, int ievt)
 
void selectHits (edm::Handle< EcalRecHitCollection > hits, int ievt, edm::ESHandle< CaloTopology > caloTopo)
 
void writeGraphs ()
 

Private Attributes

int abscissa [10]
 
TH1F * allFedsTimingHist_
 
TTree * canvasNames_
 
std::map< int, float > crysAndAmplitudesMap_
 
edm::InputTag EBDigis_
 
edm::Handle< EBDigiCollectionEBdigisHandle
 
edm::InputTag EBRecHitCollection_
 
const EcalElectronicsMappingecalElectronicsMap_
 
edm::InputTag EEDigis_
 
edm::Handle< EEDigiCollectionEEdigisHandle
 
edm::InputTag EERecHitCollection_
 
EcalFedMapfedMap_
 
std::map< int, EcalDCCHeaderBlockFEDsAndDCCHeaders_
 
std::map< int, TH1F * > FEDsAndTimingHists_
 
TFile * file_
 
edm::InputTag headerProducer_
 
std::set< EBDetIdlistEBChannels
 
std::set< EEDetIdlistEEChannels
 
std::vector< int > maskedChannels_
 
std::vector< std::string > maskedEBs_
 
std::vector< int > maskedFEDs_
 
double minTimingAmp_
 
int naiveEvtNum_
 
std::vector< std::string > * names
 
int ordinate [10]
 
int runNum_
 
std::vector< int > seedCrys_
 
std::map< std::string, int > seedFrequencyMap_
 
int side_
 
double threshold_
 

Static Private Attributes

static edm::Service< TFileServicefileService
 
static float gainRatio [3] = {1., 2., 12.}
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 59 of file EcalMipGraphs.h.

Constructor & Destructor Documentation

◆ EcalMipGraphs()

EcalMipGraphs::EcalMipGraphs ( const edm::ParameterSet iConfig)
explicit

Definition at line 42 of file EcalMipGraphs.cc.

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")),
48  runNum_(-1),
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);
54 
55  maskedChannels_ = iConfig.getUntrackedParameter<vector<int> >("maskedChannels", listDefaults);
56  maskedFEDs_ = iConfig.getUntrackedParameter<vector<int> >("maskedFEDs", listDefaults);
57  seedCrys_ = iConfig.getUntrackedParameter<vector<int> >("seedCrys", vector<int>());
58 
59  vector<string> defaultMaskedEBs;
60  defaultMaskedEBs.push_back("none");
61  maskedEBs_ = iConfig.getUntrackedParameter<vector<string> >("maskedEBs", defaultMaskedEBs);
62 
63  fedMap_ = new EcalFedMap();
64 
65  string title1 = "Jitter for all FEDs";
66  string name1 = "JitterAllFEDs";
67  allFedsTimingHist_ = fileService->make<TH1F>(name1.c_str(), title1.c_str(), 150, -7, 7);
68 
69  // load up the maskedFED list with the proper FEDids
70  if (maskedFEDs_[0] == -1) {
71  //if "actual" EB id given, then convert to FEDid and put in listFEDs_
72  if (maskedEBs_[0] != "none") {
73  maskedFEDs_.clear();
74  for (vector<string>::const_iterator ebItr = maskedEBs_.begin(); ebItr != maskedEBs_.end(); ++ebItr) {
75  maskedFEDs_.push_back(fedMap_->getFedFromSlice(*ebItr));
76  }
77  }
78  }
79 
80  for (int i = 0; i < 10; i++)
81  abscissa[i] = i;
82 
83  naiveEvtNum_ = 0;
84 }

References abscissa, allFedsTimingHist_, fedMap_, fileService, EcalFedMap::getFedFromSlice(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, TFileService::make(), maskedChannels_, maskedEBs_, maskedFEDs_, naiveEvtNum_, and seedCrys_.

◆ ~EcalMipGraphs()

EcalMipGraphs::~EcalMipGraphs ( )
override

Definition at line 86 of file EcalMipGraphs.cc.

86 {}

Member Function Documentation

◆ analyze()

void EcalMipGraphs::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 93 of file EcalMipGraphs.cc.

93  {
94  // get the headers
95  // (one header for each supermodule)
97  iEvent.getByLabel(headerProducer_, DCCHeaders);
98 
99  for (EcalRawDataCollection::const_iterator headerItr = DCCHeaders->begin(); headerItr != DCCHeaders->end();
100  ++headerItr) {
101  FEDsAndDCCHeaders_[headerItr->id() + 600] = *headerItr;
102  }
103 
104  int ievt = iEvent.id().event();
105  naiveEvtNum_++;
106 
107  if (runNum_ == -1) {
108  runNum_ = iEvent.id().run();
109  canvasNames_ = fileService->make<TTree>("canvasNames", "Names of written canvases");
110  names = new std::vector<string>();
111  canvasNames_->Branch("names", "vector<string>", &names);
112  }
113 
114  //We only want the 3x3's for this event...
115  listEBChannels.clear();
116  listEEChannels.clear();
119  ESHandle<CaloTopology> caloTopo;
120  iSetup.get<CaloTopologyRecord>().get(caloTopo);
121  iEvent.getByLabel(EBRecHitCollection_, EBhits);
122  iEvent.getByLabel(EERecHitCollection_, EEhits);
123  // Now, retrieve the crystal digi from the event
124  iEvent.getByLabel(EBDigis_, EBdigisHandle);
125  iEvent.getByLabel(EEDigis_, EEdigisHandle);
126  //debug
127  //LogWarning("EcalMipGraphs") << "event " << ievt << " EBhits collection size " << EBhits->size();
128  //LogWarning("EcalMipGraphs") << "event " << ievt << " EEhits collection size " << EEhits->size();
129 
130  selectHits(EBhits, ievt, caloTopo);
131  selectHits(EEhits, ievt, caloTopo);
132 }

References edm::SortedCollection< T, SORT >::begin(), canvasNames_, EBDigis_, EBdigisHandle, EBRecHitCollection_, EEDigis_, EEdigisHandle, EERecHitCollection_, edm::SortedCollection< T, SORT >::end(), FEDsAndDCCHeaders_, fileService, edm::EventSetup::get(), get, headerProducer_, iEvent, listEBChannels, listEEChannels, TFileService::make(), naiveEvtNum_, names, runNum_, and selectHits().

◆ beginRun()

void EcalMipGraphs::beginRun ( edm::Run const &  ,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 330 of file EcalMipGraphs.cc.

330  {
332  c.get<EcalMappingRcd>().get(handle);
333  ecalElectronicsMap_ = handle.product();
334 }

References c, ecalElectronicsMap_, get, and patZpeak::handle.

◆ endJob()

void EcalMipGraphs::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 337 of file EcalMipGraphs.cc.

337  {
338  canvasNames_->Fill();
339 
340  string frequencies = "";
341  for (std::map<std::string, int>::const_iterator itr = seedFrequencyMap_.begin(); itr != seedFrequencyMap_.end();
342  ++itr) {
343  if (itr->second > 1) {
344  frequencies += itr->first;
345  frequencies += " Frequency: ";
346  frequencies += intToString(itr->second);
347  frequencies += "\n";
348  }
349  }
350  LogWarning("EcalMipGraphs") << "Found seeds with frequency > 1: "
351  << "\n\n"
352  << frequencies;
353 
355  for (std::vector<int>::const_iterator itr = maskedChannels_.begin(); itr != maskedChannels_.end(); ++itr) {
356  channels += intToString(*itr);
357  channels += ",";
358  }
359 
361  for (std::vector<int>::const_iterator itr = maskedFEDs_.begin(); itr != maskedFEDs_.end(); ++itr) {
362  feds += intToString(*itr);
363  feds += ",";
364  }
365 
366  LogWarning("EcalMipGraphs") << "Masked channels are: " << channels;
367  LogWarning("EcalMipGraphs") << "Masked FEDs are: " << feds << " and that is all!";
368 }

References canvasNames_, ewkTauDQM_cfi::channels, l1tstage2emulator_dqm_sourceclient-live_cfg::feds, intToString(), maskedChannels_, maskedFEDs_, seedFrequencyMap_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by o2olib.O2ORunMgr::executeJob().

◆ floatToString()

std::string EcalMipGraphs::floatToString ( float  num)
private

Definition at line 377 of file EcalMipGraphs.cc.

377  {
378  using namespace std;
379  ostringstream myStream;
380  myStream << num << flush;
381  return (myStream.str()); //returns the string form of the stringstream object
382 }

References EgammaValidation_cff::num.

Referenced by selectDigi().

◆ getEEIndex()

int EcalMipGraphs::getEEIndex ( EcalElectronicsId  elecId)
private

Definition at line 312 of file EcalMipGraphs.cc.

312  {
313  int FEDid = 600 + elecId.dccId();
314  return 10000 * FEDid + 100 * elecId.towerId() + 5 * (elecId.stripId() - 1) + elecId.xtalId();
315 }

References EcalElectronicsId::dccId(), EcalElectronicsId::stripId(), EcalElectronicsId::towerId(), and EcalElectronicsId::xtalId().

Referenced by selectDigi(), and selectHits().

◆ initHists()

void EcalMipGraphs::initHists ( int  FED)
private

Definition at line 318 of file EcalMipGraphs.cc.

318  {
319  using namespace std;
320 
321  string title1 = "Jitter for ";
322  title1.append(fedMap_->getSliceFromFed(FED));
323  string name1 = "JitterFED";
324  name1.append(intToString(FED));
325  TH1F* timingHist = fileService->make<TH1F>(name1.c_str(), title1.c_str(), 150, -7, 7);
326  FEDsAndTimingHists_[FED] = timingHist;
327 }

References fedMap_, FEDsAndTimingHists_, fileService, EcalFedMap::getSliceFromFed(), intToString(), and TFileService::make().

Referenced by selectHits().

◆ intToString()

std::string EcalMipGraphs::intToString ( int  num)
private

Definition at line 370 of file EcalMipGraphs.cc.

370  {
371  using namespace std;
372  ostringstream myStream;
373  myStream << num << flush;
374  return (myStream.str()); //returns the string form of the stringstream object
375 }

References EgammaValidation_cff::num.

Referenced by endJob(), initHists(), selectDigi(), and selectHits().

◆ selectDigi()

TGraph * EcalMipGraphs::selectDigi ( DetId  det,
int  ievt 
)
private

Definition at line 134 of file EcalMipGraphs.cc.

134  {
135  int emptyY[10];
136  for (int i = 0; i < 10; i++)
137  emptyY[i] = 0;
138  TGraph* emptyGraph = fileService->make<TGraph>(10, abscissa, emptyY);
139  emptyGraph->SetTitle("NOT ECAL");
140 
141  //If the DetId is not from Ecal, return
142  if (thisDet.det() != DetId::Ecal)
143  return emptyGraph;
144 
145  emptyGraph->SetTitle("NO DIGIS");
146  //find digi we need -- can't get find() to work; need DataFrame(DetId det) to work?
148  int FEDid = 600 + elecId.dccId();
149  bool isBarrel = true;
150  if (FEDid < 610 || FEDid > 645)
151  isBarrel = false;
152  int cryIndex = isBarrel ? ((EBDetId)thisDet).hashedIndex() : getEEIndex(elecId);
153  int ic = isBarrel ? ((EBDetId)thisDet).ic() : cryIndex;
154 
155  string sliceName = fedMap_->getSliceFromFed(FEDid);
157  if (isBarrel) {
159  while (digiItr != EBdigisHandle->end() && ((*digiItr).id() != (EBDetId)thisDet)) {
160  ++digiItr;
161  }
162  if (digiItr == EBdigisHandle->end()) {
163  //LogWarning("EcalMipGraphs") << "Cannot find digi for ic:" << ic
164  // << " FED:" << FEDid << " evt:" << naiveEvtNum_;
165  return emptyGraph;
166  } else
167  df = *digiItr;
168  } else {
170  while (digiItr != EEdigisHandle->end() && ((*digiItr).id() != (EEDetId)thisDet)) {
171  ++digiItr;
172  }
173  if (digiItr == EEdigisHandle->end()) {
174  //LogWarning("EcalMipGraphs") << "Cannot find digi for ic:" << ic
175  // << " FED:" << FEDid << " evt:" << naiveEvtNum_;
176  return emptyGraph;
177  } else
178  df = *digiItr;
179  }
180 
181  int gainId = FEDsAndDCCHeaders_[FEDid].getMgpaGain();
182  int gainHuman;
183  if (gainId == 1)
184  gainHuman = 12;
185  else if (gainId == 2)
186  gainHuman = 6;
187  else if (gainId == 3)
188  gainHuman = 1;
189  else
190  gainHuman = -1;
191 
192  double pedestal = 200;
193 
194  emptyGraph->SetTitle("FIRST TWO SAMPLES NOT GAIN12");
195  if (df.sample(0).gainId() != 1 || df.sample(1).gainId() != 1)
196  return emptyGraph; //goes to the next digi
197  else {
198  ordinate[0] = df.sample(0).adc();
199  ordinate[1] = df.sample(1).adc();
200  pedestal = (double)(ordinate[0] + ordinate[1]) / (double)2;
201  }
202 
203  for (int i = 0; i < df.size(); ++i) {
204  if (df.sample(i).gainId() != 0)
205  ordinate[i] = (int)(pedestal + (df.sample(i).adc() - pedestal) * gainRatio[df.sample(i).gainId() - 1]);
206  else
207  ordinate[i] = 49152; //Saturation of gain1
208  }
209 
210  TGraph* oneGraph = fileService->make<TGraph>(10, abscissa, ordinate);
211  string name = "Graph_ev" + intToString(naiveEvtNum_) + "_ic" + intToString(ic) + "_FED" + intToString(FEDid);
212  string gainString = (gainId == 1) ? "Free" : intToString(gainHuman);
213  string title = "Event" + intToString(naiveEvtNum_) + "_lv1a" + intToString(ievt) + "_ic" + intToString(ic) + "_" +
214  sliceName + "_gain" + gainString;
215 
216  float energy = 0;
217  map<int, float>::const_iterator itr;
218  itr = crysAndAmplitudesMap_.find(cryIndex);
219  if (itr != crysAndAmplitudesMap_.end()) {
220  //edm::LogWarning("EcalMipGraphs")<< "itr->second(ampli)="<< itr->second;
221  energy = (float)itr->second;
222  }
223  //else
224  //edm::LogWarning("EcalMipGraphs") << "cry " << ic << "not found in ampMap";
225 
226  title += "_Energy" + floatToString(round(energy * 1000));
227 
228  oneGraph->SetTitle(title.c_str());
229  oneGraph->SetName(name.c_str());
230  oneGraph->GetXaxis()->SetTitle("sample");
231  oneGraph->GetYaxis()->SetTitle("ADC");
232  return oneGraph;
233 }

References abscissa, edm::DataFrameContainer::begin(), crysAndAmplitudesMap_, EcalElectronicsId::dccId(), DetId::det(), hgcalPerformanceValidation::df, EBdigisHandle, DetId::Ecal, ecalElectronicsMap_, EEdigisHandle, edm::DataFrameContainer::end(), HCALHighEnergyHPDFilter_cfi::energy, fedMap_, FEDsAndDCCHeaders_, fileService, dqmMemoryStats::float, floatToString(), ecalLiteDTU::gainId(), gainRatio, getEEIndex(), EcalElectronicsMapping::getElectronicsId(), EcalFedMap::getSliceFromFed(), mps_fire::i, intToString(), PixelPluginsPhase0_cfi::isBarrel, TFileService::make(), naiveEvtNum_, Skims_PA_cff::name, ordinate, EcalCondDBWriter_cfi::pedestal, and runGCPTkAlMap::title.

Referenced by selectHits().

◆ selectHits()

void EcalMipGraphs::selectHits ( edm::Handle< EcalRecHitCollection hits,
int  ievt,
edm::ESHandle< CaloTopology caloTopo 
)
private

Definition at line 235 of file EcalMipGraphs.cc.

235  {
236  for (EcalRecHitCollection::const_iterator hitItr = hits->begin(); hitItr != hits->end(); ++hitItr) {
237  EcalRecHit hit = (*hitItr);
238  DetId det = hit.id();
240  int FEDid = 600 + elecId.dccId();
241  bool isBarrel = true;
242  if (FEDid < 610 || FEDid > 645)
243  isBarrel = false;
244  int cryIndex = isBarrel ? ((EBDetId)det).hashedIndex() : ((EEDetId)det).hashedIndex();
245  int ic = isBarrel ? ((EBDetId)det).ic() : getEEIndex(elecId);
246 
247  float ampli = hit.energy();
248 
249  vector<int>::iterator result;
250  result = find(maskedFEDs_.begin(), maskedFEDs_.end(), FEDid);
251  if (result != maskedFEDs_.end()) {
252  //LogWarning("EcalMipGraphs") << "skipping uncalRecHit for FED " << FEDid << " ; amplitude " << ampli;
253  continue;
254  }
255  result = find(maskedChannels_.begin(), maskedChannels_.end(), cryIndex);
256  if (result != maskedChannels_.end()) {
257  //LogWarning("EcalMipGraphs") << "skipping uncalRecHit for channel: " << cryIndex << " in fed: " << FEDid << " with amplitude " << ampli ;
258  continue;
259  }
260  bool cryIsInList = false;
261  result = find(seedCrys_.begin(), seedCrys_.end(), cryIndex);
262  if (result != seedCrys_.end())
263  cryIsInList = true;
264 
265  // Either we must have a user-requested cry (in which case there is no amplitude selection)
266  // Or we pick all crys that pass the amplitude cut (in which case there is no fixed crystal selection)
267  if (cryIsInList || (seedCrys_.empty() && ampli > threshold_)) {
268  // We have a winner!
269  crysAndAmplitudesMap_[cryIndex] = ampli;
270  string name = "Event" + intToString(naiveEvtNum_) + "_ic" + intToString(ic) + "_FED" + intToString(FEDid);
271  string title = "Digis";
272  string seed = "ic" + intToString(ic) + "_FED" + intToString(FEDid);
273  int freq = 1;
274  pair<map<string, int>::iterator, bool> pair = seedFrequencyMap_.insert(make_pair(seed, freq));
275  if (!pair.second) {
276  ++(pair.first->second);
277  }
278 
279  TCanvas can(name.c_str(), title.c_str(), 200, 50, 900, 900);
280  can.Divide(side_, side_);
281  TGraph* myGraph;
282  int canvasNum = 1;
283 
285  //Now put each graph in one by one
286  for (int j = side_ / 2; j >= -side_ / 2; --j) {
287  for (int i = -side_ / 2; i <= side_ / 2; ++i) {
288  cursor.home();
289  cursor.offsetBy(i, j);
290  can.cd(canvasNum);
291  myGraph = selectDigi(*cursor, ievt);
292  myGraph->Draw("A*");
293  canvasNum++;
294  }
295  }
296  can.Write();
297  names->push_back(name);
298  }
299 
300  TH1F* timingHist = FEDsAndTimingHists_[FEDid];
301  if (timingHist == nullptr) {
302  initHists(FEDid);
303  timingHist = FEDsAndTimingHists_[FEDid];
304  }
305  if (ampli > minTimingAmp_) {
306  timingHist->Fill(hit.time());
307  allFedsTimingHist_->Fill(hit.time());
308  }
309  }
310 }

References allFedsTimingHist_, timingPdfMaker::can, crysAndAmplitudesMap_, EcalElectronicsId::dccId(), ecalElectronicsMap_, FEDsAndTimingHists_, spr::find(), getEEIndex(), EcalElectronicsMapping::getElectronicsId(), CaloTopology::getSubdetectorTopology(), hfClusterShapes_cfi::hits, CaloNavigator< T, TOPO >::home(), mps_fire::i, hit::id, initHists(), intToString(), PixelPluginsPhase0_cfi::isBarrel, dqmiolumiharvest::j, maskedChannels_, maskedFEDs_, minTimingAmp_, naiveEvtNum_, Skims_PA_cff::name, names, CaloNavigator< T, TOPO >::offsetBy(), mps_fire::result, fileCollector::seed, seedCrys_, seedFrequencyMap_, selectDigi(), side_, threshold_, and runGCPTkAlMap::title.

Referenced by analyze().

◆ writeGraphs()

void EcalMipGraphs::writeGraphs ( )
private

Member Data Documentation

◆ abscissa

int EcalMipGraphs::abscissa[10]
private

Definition at line 95 of file EcalMipGraphs.h.

Referenced by EcalMipGraphs(), and selectDigi().

◆ allFedsTimingHist_

TH1F* EcalMipGraphs::allFedsTimingHist_
private

Definition at line 111 of file EcalMipGraphs.h.

Referenced by EcalMipGraphs(), and selectHits().

◆ canvasNames_

TTree* EcalMipGraphs::canvasNames_
private

Definition at line 114 of file EcalMipGraphs.h.

Referenced by analyze(), and endJob().

◆ crysAndAmplitudesMap_

std::map<int, float> EcalMipGraphs::crysAndAmplitudesMap_
private

Definition at line 107 of file EcalMipGraphs.h.

Referenced by selectDigi(), and selectHits().

◆ EBDigis_

edm::InputTag EcalMipGraphs::EBDigis_
private

Definition at line 80 of file EcalMipGraphs.h.

Referenced by analyze().

◆ EBdigisHandle

edm::Handle<EBDigiCollection> EcalMipGraphs::EBdigisHandle
private

Definition at line 84 of file EcalMipGraphs.h.

Referenced by analyze(), and selectDigi().

◆ EBRecHitCollection_

edm::InputTag EcalMipGraphs::EBRecHitCollection_
private

Definition at line 78 of file EcalMipGraphs.h.

Referenced by analyze().

◆ ecalElectronicsMap_

const EcalElectronicsMapping* EcalMipGraphs::ecalElectronicsMap_
private

Definition at line 116 of file EcalMipGraphs.h.

Referenced by beginRun(), selectDigi(), and selectHits().

◆ EEDigis_

edm::InputTag EcalMipGraphs::EEDigis_
private

Definition at line 81 of file EcalMipGraphs.h.

Referenced by analyze().

◆ EEdigisHandle

edm::Handle<EEDigiCollection> EcalMipGraphs::EEdigisHandle
private

Definition at line 85 of file EcalMipGraphs.h.

Referenced by analyze(), and selectDigi().

◆ EERecHitCollection_

edm::InputTag EcalMipGraphs::EERecHitCollection_
private

Definition at line 79 of file EcalMipGraphs.h.

Referenced by analyze().

◆ fedMap_

EcalFedMap* EcalMipGraphs::fedMap_
private

Definition at line 115 of file EcalMipGraphs.h.

Referenced by EcalMipGraphs(), initHists(), and selectDigi().

◆ FEDsAndDCCHeaders_

std::map<int, EcalDCCHeaderBlock> EcalMipGraphs::FEDsAndDCCHeaders_
private

Definition at line 108 of file EcalMipGraphs.h.

Referenced by analyze(), and selectDigi().

◆ FEDsAndTimingHists_

std::map<int, TH1F*> EcalMipGraphs::FEDsAndTimingHists_
private

Definition at line 106 of file EcalMipGraphs.h.

Referenced by initHists(), and selectHits().

◆ file_

TFile* EcalMipGraphs::file_
private

Definition at line 113 of file EcalMipGraphs.h.

◆ fileService

edm::Service< TFileService > EcalMipGraphs::fileService
staticprivate

Definition at line 99 of file EcalMipGraphs.h.

Referenced by analyze(), EcalMipGraphs(), initHists(), and selectDigi().

◆ gainRatio

float EcalMipGraphs::gainRatio = {1., 2., 12.}
staticprivate

Definition at line 98 of file EcalMipGraphs.h.

Referenced by selectDigi().

◆ headerProducer_

edm::InputTag EcalMipGraphs::headerProducer_
private

Definition at line 82 of file EcalMipGraphs.h.

Referenced by analyze().

◆ listEBChannels

std::set<EBDetId> EcalMipGraphs::listEBChannels
private

Definition at line 92 of file EcalMipGraphs.h.

Referenced by analyze().

◆ listEEChannels

std::set<EEDetId> EcalMipGraphs::listEEChannels
private

Definition at line 93 of file EcalMipGraphs.h.

Referenced by analyze().

◆ maskedChannels_

std::vector<int> EcalMipGraphs::maskedChannels_
private

Definition at line 102 of file EcalMipGraphs.h.

Referenced by EcalMipGraphs(), endJob(), and selectHits().

◆ maskedEBs_

std::vector<std::string> EcalMipGraphs::maskedEBs_
private

Definition at line 105 of file EcalMipGraphs.h.

Referenced by EcalMipGraphs().

◆ maskedFEDs_

std::vector<int> EcalMipGraphs::maskedFEDs_
private

Definition at line 103 of file EcalMipGraphs.h.

Referenced by EcalMipGraphs(), endJob(), and selectHits().

◆ minTimingAmp_

double EcalMipGraphs::minTimingAmp_
private

Definition at line 90 of file EcalMipGraphs.h.

Referenced by selectHits().

◆ naiveEvtNum_

int EcalMipGraphs::naiveEvtNum_
private

Definition at line 118 of file EcalMipGraphs.h.

Referenced by analyze(), EcalMipGraphs(), selectDigi(), and selectHits().

◆ names

std::vector<std::string>* EcalMipGraphs::names
private

Definition at line 101 of file EcalMipGraphs.h.

Referenced by analyze(), and selectHits().

◆ ordinate

int EcalMipGraphs::ordinate[10]
private

Definition at line 96 of file EcalMipGraphs.h.

Referenced by selectDigi().

◆ runNum_

int EcalMipGraphs::runNum_
private

Definition at line 87 of file EcalMipGraphs.h.

Referenced by analyze().

◆ seedCrys_

std::vector<int> EcalMipGraphs::seedCrys_
private

Definition at line 104 of file EcalMipGraphs.h.

Referenced by EcalMipGraphs(), and selectHits().

◆ seedFrequencyMap_

std::map<std::string, int> EcalMipGraphs::seedFrequencyMap_
private

Definition at line 109 of file EcalMipGraphs.h.

Referenced by endJob(), and selectHits().

◆ side_

int EcalMipGraphs::side_
private

Definition at line 88 of file EcalMipGraphs.h.

Referenced by selectHits().

◆ threshold_

double EcalMipGraphs::threshold_
private

Definition at line 89 of file EcalMipGraphs.h.

Referenced by selectHits().

EcalMipGraphs::allFedsTimingHist_
TH1F * allFedsTimingHist_
Definition: EcalMipGraphs.h:111
l1tstage2emulator_dqm_sourceclient-live_cfg.feds
feds
Definition: l1tstage2emulator_dqm_sourceclient-live_cfg.py:153
ecalLiteDTU::gainId
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
Definition: EcalLiteDTUSample.h:14
EcalRecHit
Definition: EcalRecHit.h:15
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
EcalMipGraphs::listEBChannels
std::set< EBDetId > listEBChannels
Definition: EcalMipGraphs.h:92
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
EcalMipGraphs::canvasNames_
TTree * canvasNames_
Definition: EcalMipGraphs.h:114
patZpeak.handle
handle
Definition: patZpeak.py:23
EcalMipGraphs::intToString
std::string intToString(int num)
Definition: EcalMipGraphs.cc:370
EBDetId
Definition: EBDetId.h:17
EcalMipGraphs::headerProducer_
edm::InputTag headerProducer_
Definition: EcalMipGraphs.h:82
EcalMipGraphs::EBRecHitCollection_
edm::InputTag EBRecHitCollection_
Definition: EcalMipGraphs.h:78
EcalMipGraphs::names
std::vector< std::string > * names
Definition: EcalMipGraphs.h:101
EcalMipGraphs::listEEChannels
std::set< EEDetId > listEEChannels
Definition: EcalMipGraphs.h:93
EcalMipGraphs::ecalElectronicsMap_
const EcalElectronicsMapping * ecalElectronicsMap_
Definition: EcalMipGraphs.h:116
EcalMipGraphs::EBdigisHandle
edm::Handle< EBDigiCollection > EBdigisHandle
Definition: EcalMipGraphs.h:84
EcalMipGraphs::seedFrequencyMap_
std::map< std::string, int > seedFrequencyMap_
Definition: EcalMipGraphs.h:109
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
EcalElectronicsId::dccId
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
Definition: EcalElectronicsId.h:31
EcalDataFrame
Definition: EcalDataFrame.h:16
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
EcalElectronicsId::towerId
int towerId() const
get the tower id
Definition: EcalElectronicsId.h:33
fileCollector.seed
seed
Definition: fileCollector.py:127
EcalMipGraphs::maskedFEDs_
std::vector< int > maskedFEDs_
Definition: EcalMipGraphs.h:103
EcalMipGraphs::EERecHitCollection_
edm::InputTag EERecHitCollection_
Definition: EcalMipGraphs.h:79
DetId
Definition: DetId.h:17
EcalMipGraphs::EEdigisHandle
edm::Handle< EEDigiCollection > EEdigisHandle
Definition: EcalMipGraphs.h:85
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
edm::ESHandle< CaloTopology >
EcalElectronicsMapping::getElectronicsId
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
Definition: EcalElectronicsMapping.cc:324
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
EEDetId
Definition: EEDetId.h:14
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
EcalMipGraphs::FEDsAndTimingHists_
std::map< int, TH1F * > FEDsAndTimingHists_
Definition: EcalMipGraphs.h:106
CaloNavigator::home
void home() const
move the navigator back to the starting point
Definition: CaloNavigator.h:96
EcalMipGraphs::maskedChannels_
std::vector< int > maskedChannels_
Definition: EcalMipGraphs.h:102
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
EcalMipGraphs::abscissa
int abscissa[10]
Definition: EcalMipGraphs.h:95
EcalMipGraphs::gainRatio
static float gainRatio[3]
Definition: EcalMipGraphs.h:98
EcalMipGraphs::runNum_
int runNum_
Definition: EcalMipGraphs.h:87
EcalMipGraphs::FEDsAndDCCHeaders_
std::map< int, EcalDCCHeaderBlock > FEDsAndDCCHeaders_
Definition: EcalMipGraphs.h:108
iEvent
int iEvent
Definition: GenABIO.cc:224
EcalFedMap::getSliceFromFed
std::string getSliceFromFed(int)
Definition: EcalFedMap.cc:86
edm::DataFrameContainer::begin
const_iterator begin() const
The iterator returned can not safely be used across threads.
Definition: DataFrameContainer.h:149
EcalMipGraphs::threshold_
double threshold_
Definition: EcalMipGraphs.h:89
EcalMipGraphs::fedMap_
EcalFedMap * fedMap_
Definition: EcalMipGraphs.h:115
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
DetId::Ecal
Definition: DetId.h:27
get
#define get
TFileService::make
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:33
EcalMipGraphs::side_
int side_
Definition: EcalMipGraphs.h:88
EcalMipGraphs::floatToString
std::string floatToString(float num)
Definition: EcalMipGraphs.cc:377
EcalMipGraphs::minTimingAmp_
double minTimingAmp_
Definition: EcalMipGraphs.h:90
EcalMipGraphs::selectHits
void selectHits(edm::Handle< EcalRecHitCollection > hits, int ievt, edm::ESHandle< CaloTopology > caloTopo)
Definition: EcalMipGraphs.cc:235
timingPdfMaker.can
can
Definition: timingPdfMaker.py:310
CaloNavigator
Definition: CaloNavigator.h:7
std
Definition: JetResolutionObject.h:76
EcalMappingRcd
Definition: EcalMappingRcd.h:15
EcalFedMap
Definition: EcalFedMap.h:7
EcalMipGraphs::ordinate
int ordinate[10]
Definition: EcalMipGraphs.h:96
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:733
EcalMipGraphs::initHists
void initHists(int)
Definition: EcalMipGraphs.cc:318
ewkTauDQM_cfi.channels
channels
Definition: ewkTauDQM_cfi.py:14
EcalMipGraphs::EEDigis_
edm::InputTag EEDigis_
Definition: EcalMipGraphs.h:81
EcalMipGraphs::EBDigis_
edm::InputTag EBDigis_
Definition: EcalMipGraphs.h:80
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalMipGraphs::naiveEvtNum_
int naiveEvtNum_
Definition: EcalMipGraphs.h:118
CaloNavigator::offsetBy
T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
Definition: CaloNavigator.h:66
EcalFedMap::getFedFromSlice
int getFedFromSlice(std::string)
Definition: EcalFedMap.cc:96
mps_fire.result
result
Definition: mps_fire.py:311
EcalElectronicsId::stripId
int stripId() const
get the tower id
Definition: EcalElectronicsId.h:35
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EcalMipGraphs::maskedEBs_
std::vector< std::string > maskedEBs_
Definition: EcalMipGraphs.h:105
EcalMipGraphs::crysAndAmplitudesMap_
std::map< int, float > crysAndAmplitudesMap_
Definition: EcalMipGraphs.h:107
EcalMipGraphs::selectDigi
TGraph * selectDigi(DetId det, int ievt)
Definition: EcalMipGraphs.cc:134
EcalElectronicsId::xtalId
int xtalId() const
get the channel id
Definition: EcalElectronicsId.h:37
EcalMipGraphs::fileService
static edm::Service< TFileService > fileService
Definition: EcalMipGraphs.h:99
EcalMipGraphs::getEEIndex
int getEEIndex(EcalElectronicsId elecId)
Definition: EcalMipGraphs.cc:312
edm::DataFrameContainer::end
const_iterator end() const
Definition: DataFrameContainer.h:152
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
EcalMipGraphs::seedCrys_
std::vector< int > seedCrys_
Definition: EcalMipGraphs.h:104