CMS 3D CMS Logo

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

#include <EcalTestPulseAnalyzer.h>

Inheritance diagram for EcalTestPulseAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void beginJob () override
 
 EcalTestPulseAnalyzer (const edm::ParameterSet &iConfig)
 
void endJob () override
 
 ~EcalTestPulseAnalyzer () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

double _chi2max
 
std::string _ecalPart
 
int _fedid
 
unsigned int _firstsample
 
unsigned int _firstsamplePN
 
unsigned int _lastsample
 
unsigned int _lastsamplePN
 
unsigned int _niter
 
unsigned int _nsamples
 
unsigned int _nsamplesPN
 
unsigned int _presample
 
unsigned int _presamplePN
 
unsigned int _samplemax
 
unsigned int _samplemin
 
double _timeofmax
 
double adc [10]
 
double APD [6]
 
double apdAmpl
 
int apdGain
 
double apdTime
 
int channelID
 
int channelIteratorEE
 
std::map< int, int > channelMapEE
 
int dccID
 
std::vector< int > dccMEM
 
std::string digiCollection_
 
std::string digiPNCollection_
 
std::string digiProducer_
 
int eta
 
int event
 
std::string eventHeaderCollection_
 
std::string eventHeaderProducer_
 
int fedID
 
unsigned int firstChanMod [9]
 
int flag
 
int gain
 
int iChannelID [1700]
 
int idccID [1700]
 
int ieta
 
int iEta [1700]
 
int iEvent
 
unsigned int iModule [1700]
 
int iphi
 
int iPhi [1700]
 
unsigned int isFirstChanModFilled [9]
 
int iside [1700]
 
int iTowerID [1700]
 
int iZ
 
int moduleID
 
std::vector< int > modules
 
unsigned int nCrys
 
unsigned int nGainAPD
 
unsigned int nGainPN
 
unsigned int nMod
 
unsigned int nTT
 
TFile * outFile
 
int phi
 
double pn [50]
 
double PN [6]
 
double pnAmpl
 
double pnAmpl0
 
double pnAmpl1
 
int pnG
 
int pnGain
 
int pnID
 
std::string resdir_
 
std::string resfile
 
TFile * resFile
 
TTree * respntrees
 
TTree * restrees
 
double ret_data [20]
 
std::string rootfile
 
int runNum
 
int runType
 
int side
 
int towerID
 
int TPEvents
 
TTree * trees [1700]
 

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 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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Definition at line 35 of file EcalTestPulseAnalyzer.h.

Constructor & Destructor Documentation

◆ EcalTestPulseAnalyzer()

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

Definition at line 45 of file EcalTestPulseAnalyzer.cc.

47  : iEvent(0),
48 
49  // framework parameters with default values
50 
51  _nsamples(iConfig.getUntrackedParameter<unsigned int>("nSamples", 10)),
52  _presample(iConfig.getUntrackedParameter<unsigned int>("nPresamples", 3)),
53  _firstsample(iConfig.getUntrackedParameter<unsigned int>("firstSample", 1)),
54  _lastsample(iConfig.getUntrackedParameter<unsigned int>("lastSample", 2)),
55  _samplemin(iConfig.getUntrackedParameter<unsigned int>("sampleMin", 3)),
56  _samplemax(iConfig.getUntrackedParameter<unsigned int>("sampleMax", 9)),
57  _nsamplesPN(iConfig.getUntrackedParameter<unsigned int>("nSamplesPN", 50)),
58  _presamplePN(iConfig.getUntrackedParameter<unsigned int>("nPresamplesPN", 6)),
59  _firstsamplePN(iConfig.getUntrackedParameter<unsigned int>("firstSamplePN", 7)),
60  _lastsamplePN(iConfig.getUntrackedParameter<unsigned int>("lastSamplePN", 8)),
61  _niter(iConfig.getUntrackedParameter<unsigned int>("nIter", 3)),
62  _chi2max(iConfig.getUntrackedParameter<double>("chi2Max", 10.0)),
63  _timeofmax(iConfig.getUntrackedParameter<double>("timeOfMax", 4.5)),
64  _ecalPart(iConfig.getUntrackedParameter<std::string>("ecalPart", "EB")),
65  _fedid(iConfig.getUntrackedParameter<int>("fedID", -999)),
66  nCrys(NCRYSEB),
67  nTT(NTTEB),
68  nMod(NMODEB),
71  towerID(-1),
72  channelID(-1),
73  runType(-1),
74  runNum(0),
75  fedID(-1),
76  dccID(-1),
77  side(-1),
78  iZ(1),
79  phi(-1),
80  eta(-1),
81  event(0),
82  apdAmpl(0),
83  apdTime(0),
84  pnAmpl(0),
85  pnID(-1),
86  moduleID(-1),
88 
89 //========================================================================
90 
91 {
92  //now do what ever initialization is needed
93 
94  resdir_ = iConfig.getUntrackedParameter<std::string>("resDir");
95 
96  digiCollection_ = iConfig.getParameter<std::string>("digiCollection");
97  digiPNCollection_ = iConfig.getParameter<std::string>("digiPNCollection");
98  digiProducer_ = iConfig.getParameter<std::string>("digiProducer");
99 
100  eventHeaderCollection_ = iConfig.getParameter<std::string>("eventHeaderCollection");
101  eventHeaderProducer_ = iConfig.getParameter<std::string>("eventHeaderProducer");
102 
103  // Define geometrical constants
104 
105  if (_ecalPart == "EB") {
106  nCrys = NCRYSEB;
107  nTT = NTTEB;
108  } else {
109  nCrys = NCRYSEE;
110  nTT = NTTEE;
111  }
112 
113  iZ = 1;
114  if (_fedid <= 609)
115  iZ = -1;
116 
119  nMod = modules.size();
120 }

References _ecalPart, _fedid, dccMEM, digiCollection_, digiPNCollection_, digiProducer_, eventHeaderCollection_, eventHeaderProducer_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), iZ, ME::lmmodFromDcc(), ME::memFromDcc(), nCrys, NCRYSEB, NCRYSEE, nMod, nTT, NTTEB, NTTEE, resdir_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~EcalTestPulseAnalyzer()

EcalTestPulseAnalyzer::~EcalTestPulseAnalyzer ( )
override

Definition at line 123 of file EcalTestPulseAnalyzer.cc.

123  {
124  //========================================================================
125 
126  // do anything here that needs to be done at desctruction time
127  // (e.g. close files, deallocate resources etc.)
128 }

Member Function Documentation

◆ analyze()

void EcalTestPulseAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 204 of file EcalTestPulseAnalyzer.cc.

204  {
205  //========================================================================
206 
207  ++iEvent;
208 
209  // Retrieve DCC header
211  const EcalRawDataCollection* DCCHeader = nullptr;
212  try {
213  e.getByLabel(eventHeaderProducer_, eventHeaderCollection_, pDCCHeader);
214  DCCHeader = pDCCHeader.product();
215  } catch (std::exception& ex) {
216  std::cerr << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() << std::endl;
217  }
218 
219  // retrieving crystal EB data from Event
221  const EBDigiCollection* EBDigi = nullptr;
222 
223  // retrieving crystal EE data from Event
225  const EEDigiCollection* EEDigi = nullptr;
226 
227  if (_ecalPart == "EB") {
228  try {
229  e.getByLabel(digiProducer_, digiCollection_, pEBDigi);
230  EBDigi = pEBDigi.product();
231  } catch (std::exception& ex) {
232  std::cerr << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str() << std::endl;
233  }
234  } else {
235  try {
236  e.getByLabel(digiProducer_, digiCollection_, pEEDigi);
237  EEDigi = pEEDigi.product();
238  } catch (std::exception& ex) {
239  std::cerr << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str() << std::endl;
240  }
241  }
242 
243  // Retrieve crystal PN diodes from Event
245  const EcalPnDiodeDigiCollection* PNDigi = nullptr;
246  try {
247  e.getByLabel(digiProducer_, digiPNCollection_, pPNDigi);
248  PNDigi = pPNDigi.product();
249  } catch (std::exception& ex) {
250  std::cerr << "Error! can't get the product " << digiCollection_.c_str() << std::endl;
251  }
252 
253  // retrieving electronics mapping
255  const EcalElectronicsMapping* TheMapping = nullptr;
256  try {
257  c.get<EcalMappingRcd>().get(ecalmapping);
258  TheMapping = ecalmapping.product();
259  } catch (std::exception& ex) {
260  std::cerr << "Error! can't get the product EcalMappingRcd" << std::endl;
261  }
262 
263  // ====================================
264  // Decode Basic DCCHeader Information
265  // ====================================
266 
267  for (EcalRawDataCollection::const_iterator headerItr = DCCHeader->begin(); headerItr != DCCHeader->end();
268  ++headerItr) {
269  int fed = headerItr->fedId();
270 
271  if (fed != _fedid && _fedid != -999)
272  continue;
273 
274  runType = headerItr->getRunType();
275  runNum = headerItr->getRunNumber();
276  event = headerItr->getLV1();
277 
278  dccID = headerItr->getDccInTCCCommand();
279  fedID = headerItr->fedId();
280 
281  if (600 + dccID != fedID)
282  continue;
283 
284  // Cut on runType
285 
288  return;
289  }
290 
291  // Cut on fedID
292 
293  if (fedID != _fedid && _fedid != -999)
294  return;
295 
296  // Count TP events
297  TPEvents++;
298 
299  // ======================
300  // Decode PN Information
301  // ======================
302 
303  TPNFit* pnfit = new TPNFit();
305 
306  double chi2pn = 0;
307  double ypnrange[50];
308  double dsum = 0.;
309  double dsum1 = 0.;
310  double bl = 0.;
311  double val_max = 0.;
312  int samplemax = 0;
313  unsigned int k;
314  int pnG[50];
315  int pngain = 0;
316 
317  std::map<int, std::vector<double> > allPNAmpl;
318  std::map<int, std::vector<int> > allPNGain;
319 
320  for (EcalPnDiodeDigiCollection::const_iterator pnItr = PNDigi->begin(); pnItr != PNDigi->end();
321  ++pnItr) { // Loop on PNs
322 
323  EcalPnDiodeDetId pnDetId = EcalPnDiodeDetId((*pnItr).id());
324 
325  bool isMemRelevant = false;
326  for (unsigned int imem = 0; imem < dccMEM.size(); imem++) {
327  if (pnDetId.iDCCId() == dccMEM[imem]) {
328  isMemRelevant = true;
329  }
330  }
331 
332  // skip mem dcc without relevant data
333  if (!isMemRelevant)
334  continue;
335 
336  for (int samId = 0; samId < (*pnItr).size(); samId++) { // Loop on PN samples
337  pn[samId] = (*pnItr).sample(samId).adc();
338  pnG[samId] = (*pnItr).sample(samId).gainId();
339 
340  if (pnG[samId] != 1)
341  std::cout << "PN gain different from 1 for sample " << samId << std::endl;
342  if (samId == 0)
343  pngain = pnG[samId];
344  if (samId > 0)
345  pngain = TMath::Max(pnG[samId], pngain);
346  }
347 
348  for (dsum = 0., k = 0; k < _presamplePN; k++) {
349  dsum += pn[k];
350  }
351  bl = dsum / ((double)_presamplePN);
352 
353  for (val_max = 0., k = 0; k < _nsamplesPN; k++) {
354  ypnrange[k] = pn[k] - bl;
355 
356  if (ypnrange[k] > val_max) {
357  val_max = ypnrange[k];
358  samplemax = k;
359  }
360  }
361 
362  chi2pn = pnfit->doFit(samplemax, &ypnrange[0]);
363 
364  if (chi2pn == 101 || chi2pn == 102 || chi2pn == 103)
365  pnAmpl = 0.;
366  else
367  pnAmpl = pnfit->getAmpl();
368 
369  allPNAmpl[pnDetId.iDCCId()].push_back(pnAmpl);
370  allPNGain[pnDetId.iDCCId()].push_back(pngain);
371  }
372 
373  // ===========================
374  // Decode EBDigis Information
375  // ===========================
376 
377  TSFit* pstpfit = new TSFit(_nsamples, 650);
378  pstpfit->set_params(
380  pstpfit->init_errmat(10.);
381 
382  double chi2 = 0;
383  double yrange[10];
384  int adcgain = 0;
385  int adcG[10];
386 
387  if (EBDigi) {
388  for (EBDigiCollection::const_iterator digiItr = EBDigi->begin(); digiItr != EBDigi->end();
389  ++digiItr) { // Loop on EB crystals
390 
391  EBDetId id_crystal(digiItr->id());
392  EBDataFrame df(*digiItr);
393 
394  int etaG = id_crystal.ieta(); // global
395  int phiG = id_crystal.iphi(); // global
396 
397  int etaL; // local
398  int phiL; // local
399  std::pair<int, int> LocalCoord = MEEBGeom::localCoord(etaG, phiG);
400 
401  etaL = LocalCoord.first;
402  phiL = LocalCoord.second;
403 
404  eta = etaG;
405  phi = phiG;
406 
407  side = MEEBGeom::side(etaG, phiG);
408 
409  EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal);
410 
411  towerID = elecid_crystal.towerId();
412  int strip = elecid_crystal.stripId();
413  int xtal = elecid_crystal.xtalId();
414  channelID = 5 * (strip - 1) + xtal - 1; // FIXME
415 
416  int module = MEEBGeom::lmmod(etaG, phiG);
417  int iMod = module - 1;
418 
419  assert(module >= *min_element(modules.begin(), modules.end()) &&
420  module <= *max_element(modules.begin(), modules.end()));
421 
422  std::pair<int, int> pnpair = MEEBGeom::pn(module);
423  unsigned int MyPn0 = pnpair.first;
424  unsigned int MyPn1 = pnpair.second;
425 
426  unsigned int channel = MEEBGeom::electronic_channel(etaL, phiL);
427 
428  if (isFirstChanModFilled[iMod] == 0) {
429  firstChanMod[iMod] = channel;
430  isFirstChanModFilled[iMod] = 1;
431  }
432 
433  iEta[channel] = eta;
434  iPhi[channel] = phi;
435  iModule[channel] = module;
436  iTowerID[channel] = towerID;
437  iChannelID[channel] = channelID;
438  idccID[channel] = dccID;
439  iside[channel] = side;
440 
441  // get adc samples
442  //====================
443 
444  for (unsigned int i = 0; i < (*digiItr).size(); ++i) {
445  EcalMGPASample samp_crystal(df.sample(i));
446  adc[i] = samp_crystal.adc();
447  adcG[i] = samp_crystal.gainId();
448 
449  if (i == 0)
450  adcgain = adcG[i];
451  if (i > 0)
452  adcgain = TMath::Max(adcG[i], adcgain);
453  }
454  // Remove pedestal
455  //====================
456  for (dsum = 0., dsum1 = 0., k = 0; k < _presample; k++) {
457  dsum += adc[k];
458  if (k < _presample - 1)
459  dsum1 += adc[k];
460  }
461 
462  bl = dsum / ((double)_presample);
463 
464  for (val_max = 0., k = 0; k < _nsamples; k++) {
465  yrange[k] = adc[k] - bl;
466  if (yrange[k] > val_max) {
467  val_max = yrange[k];
468  samplemax = k;
469  }
470  }
471 
472  apdGain = adcgain;
473 
474  if (allPNAmpl[dccMEM[0]].size() > MyPn0)
475  pnAmpl0 = allPNAmpl[dccMEM[0]][MyPn0];
476  else
477  pnAmpl0 = 0;
478  if (allPNAmpl[dccMEM[0]].size() > MyPn1)
479  pnAmpl1 = allPNAmpl[dccMEM[0]][MyPn1];
480  else
481  pnAmpl1 = 0;
482 
483  if (allPNGain[dccMEM[0]].size() > MyPn0)
484  pnGain = allPNGain[dccMEM[0]][MyPn0];
485  else
486  pnGain = 0;
487 
488  // Perform the fit on apd samples
489  //================================
490 
491  chi2 = pstpfit->fit_third_degree_polynomial(&yrange[0], ret_data);
492 
493  //Retrieve APD amplitude from fit
494  //================================
495 
496  if (val_max > 100000. || chi2 < 0. || chi2 == 102) {
497  apdAmpl = 0;
498  apdTime = 0;
499 
500  } else {
501  apdAmpl = ret_data[0];
502  apdTime = ret_data[1];
503  }
504 
505  trees[channel]->Fill();
506  }
507 
508  } else {
509  for (EEDigiCollection::const_iterator digiItr = EEDigi->begin(); digiItr != EEDigi->end();
510  ++digiItr) { // Loop on EE crystals
511 
512  EEDetId id_crystal(digiItr->id());
513  EEDataFrame df(*digiItr);
514 
515  phi = id_crystal.ix();
516  eta = id_crystal.iy();
517 
518  int iX = (phi - 1) / 5 + 1;
519  int iY = (eta - 1) / 5 + 1;
520 
521  side = MEEEGeom::side(iX, iY, iZ);
522 
523  // Recover the TT id and the electronic crystal numbering from EcalElectronicsMapping
524 
525  EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal);
526 
527  towerID = elecid_crystal.towerId();
528  channelID = elecid_crystal.channelId() - 1;
529 
530  int module = MEEEGeom::lmmod(iX, iY);
531  if (module >= 18 && side == 1)
532  module += 2; // Trick to fix endcap specificity
533  int iMod = module - 1;
534 
535  assert(module >= *min_element(modules.begin(), modules.end()) &&
536  module <= *max_element(modules.begin(), modules.end()));
537 
538  std::pair<int, int> pnpair = MEEEGeom::pn(module, _fedid);
539 
540  unsigned int MyPn0 = pnpair.first;
541  unsigned int MyPn1 = pnpair.second;
542 
543  int hashedIndex = 100000 * eta + phi;
544 
545  if (channelMapEE.count(hashedIndex) == 0) {
548  }
549 
550  unsigned int channel = channelMapEE[hashedIndex];
551 
552  if (isFirstChanModFilled[iMod] == 0) {
553  firstChanMod[iMod] = channel;
554  isFirstChanModFilled[iMod] = 1;
555  }
556 
557  iEta[channel] = eta;
558  iPhi[channel] = phi;
559  iModule[channel] = module;
560  iTowerID[channel] = towerID;
561  iChannelID[channel] = channelID;
562  idccID[channel] = dccID;
563  iside[channel] = side;
564 
565  assert(channel < nCrys);
566 
567  // Get adc samples
568  //====================
569 
570  for (unsigned int i = 0; i < (*digiItr).size(); ++i) {
571  EcalMGPASample samp_crystal(df.sample(i));
572  adc[i] = samp_crystal.adc();
573  adcG[i] = samp_crystal.gainId();
574 
575  if (i == 0)
576  adcgain = adcG[i];
577  if (i > 0)
578  adcgain = TMath::Max(adcG[i], adcgain);
579  }
580 
581  // Remove pedestal
582  //====================
583  for (dsum = 0., dsum1 = 0., k = 0; k < _presample; k++) {
584  dsum += adc[k];
585  if (k < _presample - 1)
586  dsum1 += adc[k];
587  }
588 
589  bl = dsum / ((double)_presample);
590 
591  for (val_max = 0., k = 0; k < _nsamples; k++) {
592  yrange[k] = adc[k] - bl;
593  if (yrange[k] > val_max) {
594  val_max = yrange[k];
595  samplemax = k;
596  }
597  }
598  apdGain = adcgain;
599 
600  int dccMEMIndex = 0;
601  if (side == 1)
602  dccMEMIndex += 2; // Trick to fix endcap specificity
603 
604  if (allPNAmpl[dccMEM[dccMEMIndex]].size() > MyPn0)
605  pnAmpl0 = allPNAmpl[dccMEM[dccMEMIndex]][MyPn0];
606  else
607  pnAmpl0 = 0;
608  if (allPNAmpl[dccMEM[dccMEMIndex + 1]].size() > MyPn1)
609  pnAmpl1 = allPNAmpl[dccMEM[dccMEMIndex + 1]][MyPn1];
610  else
611  pnAmpl1 = 0;
612 
613  if (allPNGain[dccMEM[dccMEMIndex]].size() > MyPn0)
614  pnGain = allPNGain[dccMEM[dccMEMIndex]][MyPn0];
615  else
616  pnGain = 0;
617 
618  // Perform the fit on apd samples
619  //=================================
620 
621  chi2 = pstpfit->fit_third_degree_polynomial(&yrange[0], ret_data);
622 
623  //Retrieve APD amplitude from fit
624  //=================================
625 
626  if (val_max > 100000. || chi2 < 0. || chi2 == 102) {
627  apdAmpl = 0;
628  apdTime = 0;
629 
630  } else {
631  apdAmpl = ret_data[0];
632  apdTime = ret_data[1];
633  }
634 
635  trees[channel]->Fill();
636  }
637  }
638 
639 } // end of analyze

References _chi2max, _ecalPart, _fedid, _firstsample, _firstsamplePN, _lastsample, _lastsamplePN, _niter, _nsamples, _nsamplesPN, _presample, _presamplePN, _samplemax, _samplemin, _timeofmax, adc, apdAmpl, apdGain, apdTime, cms::cuda::assert(), edm::SortedCollection< T, SORT >::begin(), HltBtagPostValidation_cff::c, beam_dqm_sourceclient-live_cfg::cerr, EcalElectronicsId::channelId(), channelID, channelIteratorEE, channelMapEE, hltPixelTracks_cff::chi2, gather_cfg::cout, dccID, dccMEM, digiCollection_, digiPNCollection_, digiProducer_, TPNFit::doFit(), MillePedeFileConverter_cfg::e, CollectionTags_cfi::EBDigi, CollectionTags_cfi::EEDigi, MEEBGeom::electronic_channel(), edm::SortedCollection< T, SORT >::end(), eta, eventHeaderCollection_, eventHeaderProducer_, cppFunctionSkipper::exception, fedID, firstChanMod, TSFit::fit_third_degree_polynomial(), get, TPNFit::getAmpl(), EcalElectronicsMapping::getElectronicsId(), ecalpyutils::hashedIndex(), mps_fire::i, iChannelID, EcalPnDiodeDetId::iDCCId(), idccID, iEta, iEvent, iModule, TPNFit::init(), TSFit::init_errmat(), iPhi, isFirstChanModFilled, iside, iTowerID, iZ, dqmdumpme::k, MEEEGeom::lmmod(), MEEBGeom::lmmod(), MEEBGeom::localCoord(), Max(), nCrys, phi, MEEBGeom::pn(), MEEEGeom::pn(), pn, pnAmpl, pnAmpl0, pnAmpl1, pnG, PedestalClient_cfi::pngain, pnGain, edm::Handle< T >::product(), edm::ESHandle< T >::product(), ret_data, runNum, runType, TSFit::set_params(), MEEBGeom::side(), MEEEGeom::side(), side, findQualityFiles::size, digitizers_cfi::strip, EcalElectronicsId::stripId(), EcalDCCHeaderBlock::TESTPULSE_GAP, EcalDCCHeaderBlock::TESTPULSE_MGPA, EcalDCCHeaderBlock::TESTPULSE_SCAN_MEM, EcalElectronicsId::towerId(), towerID, TPEvents, trees, and EcalElectronicsId::xtalId().

◆ beginJob()

void EcalTestPulseAnalyzer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 131 of file EcalTestPulseAnalyzer.cc.

131  {
132  //========================================================================
133 
134  // Define temporary file
135 
136  rootfile = resdir_;
137  rootfile += "/TmpTreeTestPulseAnalyzer.root";
138 
139  outFile = new TFile(rootfile.c_str(), "RECREATE");
140 
141  for (unsigned int i = 0; i < nCrys; i++) {
142  std::stringstream name;
143  name << "Tree" << i;
144 
145  trees[i] = new TTree(name.str().c_str(), name.str().c_str());
146 
147  //List of branches
148 
149  trees[i]->Branch("iphi", &phi, "phi/I");
150  trees[i]->Branch("ieta", &eta, "eta/I");
151  trees[i]->Branch("side", &side, "side/I");
152  trees[i]->Branch("dccID", &dccID, "dccID/I");
153  trees[i]->Branch("towerID", &towerID, "towerID/I");
154  trees[i]->Branch("channelID", &channelID, "channelID/I");
155  trees[i]->Branch("event", &event, "event/I");
156  trees[i]->Branch("apdGain", &apdGain, "apdGain/I");
157  trees[i]->Branch("pnGain", &pnGain, "pnGain/I");
158  trees[i]->Branch("apdAmpl", &apdAmpl, "apdAmpl/D");
159  trees[i]->Branch("pnAmpl0", &pnAmpl0, "pnAmpl0/D");
160  trees[i]->Branch("pnAmpl1", &pnAmpl1, "pnAmpl1/D");
161 
162  trees[i]->SetBranchAddress("ieta", &eta);
163  trees[i]->SetBranchAddress("iphi", &phi);
164  trees[i]->SetBranchAddress("side", &side);
165  trees[i]->SetBranchAddress("dccID", &dccID);
166  trees[i]->SetBranchAddress("towerID", &towerID);
167  trees[i]->SetBranchAddress("channelID", &channelID);
168  trees[i]->SetBranchAddress("event", &event);
169  trees[i]->SetBranchAddress("apdGain", &apdGain);
170  trees[i]->SetBranchAddress("pnGain", &pnGain);
171  trees[i]->SetBranchAddress("apdAmpl", &apdAmpl);
172  trees[i]->SetBranchAddress("pnAmpl0", &pnAmpl0);
173  trees[i]->SetBranchAddress("pnAmpl1", &pnAmpl1);
174  }
175 
176  // Initializations
177 
178  for (unsigned int j = 0; j < nCrys; j++) {
179  iEta[j] = -1;
180  iPhi[j] = -1;
181  iModule[j] = 10;
182  iTowerID[j] = -1;
183  iChannelID[j] = -1;
184  idccID[j] = -1;
185  iside[j] = -1;
186  }
187 
188  for (unsigned int j = 0; j < nMod; j++) {
189  firstChanMod[j] = 0;
190  isFirstChanModFilled[j] = 0;
191  }
192 
193  // Define output results file name
194 
195  std::stringstream namefile;
196  namefile << resdir_ << "/APDPN_TESTPULSE.root";
197  resfile = namefile.str();
198 
199  // TP events counter
200  TPEvents = 0;
201 }

References apdAmpl, apdGain, channelID, dccID, eta, firstChanMod, mps_fire::i, iChannelID, idccID, iEta, iModule, iPhi, isFirstChanModFilled, iside, iTowerID, dqmiolumiharvest::j, Skims_PA_cff::name, nCrys, nMod, outFile, phi, pnAmpl0, pnAmpl1, pnGain, resdir_, resfile, rootfile, side, towerID, TPEvents, and trees.

◆ endJob()

void EcalTestPulseAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 642 of file EcalTestPulseAnalyzer.cc.

642  {
643  //========================================================================
644 
645  // Don't do anything if there is no events
646  if (TPEvents == 0) {
647  outFile->Close();
648 
649  // Remove temporary file
650 
651  std::stringstream del;
652  del << "rm " << rootfile;
653  system(del.str().c_str());
654 
655  std::cout << " No TP Events " << std::endl;
656  return;
657  }
658 
659  std::cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
660  std::cout << "\t+=+ Analyzing test pulse data: getting APD, PN +=+" << std::endl;
661 
662  // Create output ntuples:
663 
664  //std::cout<< "TP Test Name File "<< resfile.c_str() << std::endl;
665 
666  resFile = new TFile(resfile.c_str(), "RECREATE");
667 
668  restrees = new TTree("TPAPD", "TPAPD");
669  respntrees = new TTree("TPPN", "TPPN");
670 
671  restrees->Branch("iphi", &iphi, "iphi/I");
672  restrees->Branch("ieta", &ieta, "ieta/I");
673  restrees->Branch("dccID", &dccID, "dccID/I");
674  restrees->Branch("side", &side, "side/I");
675  restrees->Branch("towerID", &towerID, "towerID/I");
676  restrees->Branch("channelID", &channelID, "channelID/I");
677  restrees->Branch("moduleID", &moduleID, "moduleID/I");
678  restrees->Branch("flag", &flag, "flag/I");
679  restrees->Branch("gain", &gain, "gain/I");
680  restrees->Branch("APD", &APD, "APD[6]/D");
681 
682  respntrees->Branch("pnID", &pnID, "pnID/I");
683  respntrees->Branch("moduleID", &moduleID, "moduleID/I");
684  respntrees->Branch("gain", &gain, "gain/I");
685  respntrees->Branch("PN", &PN, "PN[6]/D");
686 
687  restrees->SetBranchAddress("iphi", &iphi);
688  restrees->SetBranchAddress("ieta", &ieta);
689  restrees->SetBranchAddress("dccID", &dccID);
690  restrees->SetBranchAddress("side", &side);
691  restrees->SetBranchAddress("towerID", &towerID);
692  restrees->SetBranchAddress("channelID", &channelID);
693  restrees->SetBranchAddress("moduleID", &moduleID);
694  restrees->SetBranchAddress("flag", &flag);
695  restrees->SetBranchAddress("gain", &gain);
696  restrees->SetBranchAddress("APD", APD);
697 
698  respntrees->SetBranchAddress("pnID", &pnID);
699  respntrees->SetBranchAddress("moduleID", &moduleID);
700  respntrees->SetBranchAddress("gain", &gain);
701  respntrees->SetBranchAddress("PN", PN);
702 
703  TMom* APDAnal[1700][10];
704  TMom* PNAnal[9][2][10];
705 
706  for (unsigned int iMod = 0; iMod < nMod; iMod++) {
707  for (unsigned int ich = 0; ich < 2; ich++) {
708  for (unsigned int ig = 0; ig < nGainPN; ig++) {
709  PNAnal[iMod][ich][ig] = new TMom();
710  }
711  }
712  }
713 
714  for (unsigned int iCry = 0; iCry < nCrys; iCry++) { // Loop on data trees (ie on cristals)
715 
716  for (unsigned int iG = 0; iG < nGainAPD; iG++) {
717  APDAnal[iCry][iG] = new TMom();
718  }
719 
720  // Define submodule and channel number inside the submodule (as Patrice)
721 
722  unsigned int iMod = iModule[iCry] - 1;
723 
724  moduleID = iMod + 1;
725  if (moduleID >= 20)
726  moduleID -= 2; // Trick to fix endcap specificity
727 
728  Long64_t nbytes = 0, nb = 0;
729  for (Long64_t jentry = 0; jentry < trees[iCry]->GetEntriesFast(); jentry++) {
730  nb = trees[iCry]->GetEntry(jentry);
731  nbytes += nb;
732 
733  // PN Means and RMS
734 
735  if (firstChanMod[iMod] == iCry) {
736  PNAnal[iMod][0][pnGain]->addEntry(pnAmpl0);
737  PNAnal[iMod][1][pnGain]->addEntry(pnAmpl1);
738  }
739 
740  // APD means and RMS
741 
742  APDAnal[iCry][apdGain]->addEntry(apdAmpl);
743  }
744 
745  if (trees[iCry]->GetEntries() < 10) {
746  flag = -1;
747  for (int j = 0; j < 6; j++) {
748  APD[j] = 0.0;
749  }
750  } else
751  flag = 1;
752 
753  iphi = iPhi[iCry];
754  ieta = iEta[iCry];
755  dccID = idccID[iCry];
756  side = iside[iCry];
757  towerID = iTowerID[iCry];
758  channelID = iChannelID[iCry];
759 
760  for (unsigned int ig = 0; ig < nGainAPD; ig++) {
761  APD[0] = APDAnal[iCry][ig]->getMean();
762  APD[1] = APDAnal[iCry][ig]->getRMS();
763  APD[2] = APDAnal[iCry][ig]->getM3();
764  APD[3] = APDAnal[iCry][ig]->getNevt();
765  APD[4] = APDAnal[iCry][ig]->getMin();
766  APD[5] = APDAnal[iCry][ig]->getMax();
767  gain = ig;
768 
769  // Fill APD tree
770 
771  restrees->Fill();
772  }
773  }
774 
775  // Get final results for PN and PN/PN
776 
777  for (unsigned int ig = 0; ig < nGainPN; ig++) {
778  for (unsigned int iMod = 0; iMod < nMod; iMod++) {
779  for (int ch = 0; ch < 2; ch++) {
780  pnID = ch;
781  moduleID = iMod;
782  if (moduleID >= 20)
783  moduleID -= 2; // Trick to fix endcap specificity
784 
785  PN[0] = PNAnal[iMod][ch][ig]->getMean();
786  PN[1] = PNAnal[iMod][ch][ig]->getRMS();
787  PN[2] = PNAnal[iMod][ch][ig]->getM3();
788  PN[3] = PNAnal[iMod][ch][ig]->getNevt();
789  PN[4] = PNAnal[iMod][ch][ig]->getMin();
790  PN[5] = PNAnal[iMod][ch][ig]->getMax();
791  gain = ig;
792 
793  // Fill PN tree
794  respntrees->Fill();
795  }
796  }
797  }
798 
799  outFile->Close();
800 
801  // Remove temporary file
802 
803  std::stringstream del;
804  del << "rm " << rootfile;
805  system(del.str().c_str());
806 
807  // Save final results
808 
809  restrees->Write();
810  respntrees->Write();
811  resFile->Close();
812 
813  std::cout << "\t+=+ ...................................... done +=+" << std::endl;
814  std::cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
815 }

References TMom::addEntry(), APD, apdAmpl, apdGain, channelID, gather_cfg::cout, dccID, firstChanMod, flag, gain, TMom::getM3(), TMom::getMax(), TMom::getMean(), TMom::getMin(), TMom::getNevt(), TMom::getRMS(), iChannelID, idccID, ieta, iEta, iModule, iphi, iPhi, iside, iTowerID, dqmiolumiharvest::j, moduleID, nCrys, nGainAPD, nGainPN, nMod, outFile, PN, pnAmpl0, pnAmpl1, pnGain, pnID, resfile, resFile, respntrees, restrees, rootfile, side, towerID, TPEvents, and trees.

Referenced by o2olib.O2ORunMgr::executeJob().

Member Data Documentation

◆ _chi2max

double EcalTestPulseAnalyzer::_chi2max
private

Definition at line 60 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _ecalPart

std::string EcalTestPulseAnalyzer::_ecalPart
private

Definition at line 62 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ _fedid

int EcalTestPulseAnalyzer::_fedid
private

Definition at line 63 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ _firstsample

unsigned int EcalTestPulseAnalyzer::_firstsample
private

Definition at line 51 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _firstsamplePN

unsigned int EcalTestPulseAnalyzer::_firstsamplePN
private

Definition at line 57 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _lastsample

unsigned int EcalTestPulseAnalyzer::_lastsample
private

Definition at line 52 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _lastsamplePN

unsigned int EcalTestPulseAnalyzer::_lastsamplePN
private

Definition at line 58 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _niter

unsigned int EcalTestPulseAnalyzer::_niter
private

Definition at line 59 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _nsamples

unsigned int EcalTestPulseAnalyzer::_nsamples
private

Definition at line 49 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _nsamplesPN

unsigned int EcalTestPulseAnalyzer::_nsamplesPN
private

Definition at line 55 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _presample

unsigned int EcalTestPulseAnalyzer::_presample
private

Definition at line 50 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _presamplePN

unsigned int EcalTestPulseAnalyzer::_presamplePN
private

Definition at line 56 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _samplemax

unsigned int EcalTestPulseAnalyzer::_samplemax
private

Definition at line 54 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _samplemin

unsigned int EcalTestPulseAnalyzer::_samplemin
private

Definition at line 53 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ _timeofmax

double EcalTestPulseAnalyzer::_timeofmax
private

Definition at line 61 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ adc

double EcalTestPulseAnalyzer::adc[10]
private

Definition at line 116 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ APD

double EcalTestPulseAnalyzer::APD[6]
private

Definition at line 142 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ apdAmpl

double EcalTestPulseAnalyzer::apdAmpl
private

Definition at line 122 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ apdGain

int EcalTestPulseAnalyzer::apdGain
private

Definition at line 119 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ apdTime

double EcalTestPulseAnalyzer::apdTime
private

Definition at line 123 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ channelID

int EcalTestPulseAnalyzer::channelID
private

Definition at line 92 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ channelIteratorEE

int EcalTestPulseAnalyzer::channelIteratorEE
private

Definition at line 141 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ channelMapEE

std::map<int, int> EcalTestPulseAnalyzer::channelMapEE
private

Definition at line 133 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ dccID

int EcalTestPulseAnalyzer::dccID
private

Definition at line 99 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ dccMEM

std::vector<int> EcalTestPulseAnalyzer::dccMEM
private

Definition at line 134 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ digiCollection_

std::string EcalTestPulseAnalyzer::digiCollection_
private

Definition at line 66 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ digiPNCollection_

std::string EcalTestPulseAnalyzer::digiPNCollection_
private

Definition at line 67 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ digiProducer_

std::string EcalTestPulseAnalyzer::digiProducer_
private

Definition at line 68 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ eta

int EcalTestPulseAnalyzer::eta
private

◆ event

int EcalTestPulseAnalyzer::event
private

◆ eventHeaderCollection_

std::string EcalTestPulseAnalyzer::eventHeaderCollection_
private

Definition at line 69 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ eventHeaderProducer_

std::string EcalTestPulseAnalyzer::eventHeaderProducer_
private

Definition at line 70 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ fedID

int EcalTestPulseAnalyzer::fedID
private

Definition at line 98 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ firstChanMod

unsigned int EcalTestPulseAnalyzer::firstChanMod[9]
private

Definition at line 148 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ flag

int EcalTestPulseAnalyzer::flag
private

Definition at line 139 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ gain

int EcalTestPulseAnalyzer::gain
private

Definition at line 139 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ iChannelID

int EcalTestPulseAnalyzer::iChannelID[1700]
private

Definition at line 146 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ idccID

int EcalTestPulseAnalyzer::idccID[1700]
private

Definition at line 146 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ ieta

int EcalTestPulseAnalyzer::ieta
private

Definition at line 139 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ iEta

int EcalTestPulseAnalyzer::iEta[1700]
private

Definition at line 144 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ iEvent

int EcalTestPulseAnalyzer::iEvent
private

Definition at line 45 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ iModule

unsigned int EcalTestPulseAnalyzer::iModule[1700]
private

Definition at line 145 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ iphi

int EcalTestPulseAnalyzer::iphi
private

Definition at line 139 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ iPhi

int EcalTestPulseAnalyzer::iPhi[1700]
private

Definition at line 144 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ isFirstChanModFilled

unsigned int EcalTestPulseAnalyzer::isFirstChanModFilled[9]
private

Definition at line 149 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ iside

int EcalTestPulseAnalyzer::iside[1700]
private

Definition at line 146 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ iTowerID

int EcalTestPulseAnalyzer::iTowerID[1700]
private

Definition at line 146 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ iZ

int EcalTestPulseAnalyzer::iZ
private

Definition at line 101 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), and EcalTestPulseAnalyzer().

◆ moduleID

int EcalTestPulseAnalyzer::moduleID
private

Definition at line 140 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ modules

std::vector<int> EcalTestPulseAnalyzer::modules
private

Definition at line 135 of file EcalTestPulseAnalyzer.h.

Referenced by SequenceVisitors.NodeVisitor::enter().

◆ nCrys

unsigned int EcalTestPulseAnalyzer::nCrys
private

Definition at line 80 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), EcalTestPulseAnalyzer(), and endJob().

◆ nGainAPD

unsigned int EcalTestPulseAnalyzer::nGainAPD
private

Definition at line 84 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ nGainPN

unsigned int EcalTestPulseAnalyzer::nGainPN
private

Definition at line 83 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ nMod

unsigned int EcalTestPulseAnalyzer::nMod
private

Definition at line 82 of file EcalTestPulseAnalyzer.h.

Referenced by beginJob(), EcalTestPulseAnalyzer(), and endJob().

◆ nTT

unsigned int EcalTestPulseAnalyzer::nTT
private

Definition at line 81 of file EcalTestPulseAnalyzer.h.

Referenced by EcalTestPulseAnalyzer().

◆ outFile

TFile* EcalTestPulseAnalyzer::outFile
private

◆ phi

int EcalTestPulseAnalyzer::phi
private

◆ pn

double EcalTestPulseAnalyzer::pn[50]
private

Definition at line 117 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ PN

double EcalTestPulseAnalyzer::PN[6]
private

Definition at line 142 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ pnAmpl

double EcalTestPulseAnalyzer::pnAmpl
private

Definition at line 126 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ pnAmpl0

double EcalTestPulseAnalyzer::pnAmpl0
private

Definition at line 124 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ pnAmpl1

double EcalTestPulseAnalyzer::pnAmpl1
private

Definition at line 125 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ pnG

int EcalTestPulseAnalyzer::pnG
private

Definition at line 121 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ pnGain

int EcalTestPulseAnalyzer::pnGain
private

Definition at line 120 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ pnID

int EcalTestPulseAnalyzer::pnID
private

Definition at line 140 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ resdir_

std::string EcalTestPulseAnalyzer::resdir_
private

Definition at line 65 of file EcalTestPulseAnalyzer.h.

Referenced by beginJob(), and EcalTestPulseAnalyzer().

◆ resfile

std::string EcalTestPulseAnalyzer::resfile
private

Definition at line 75 of file EcalTestPulseAnalyzer.h.

Referenced by beginJob(), and endJob().

◆ resFile

TFile* EcalTestPulseAnalyzer::resFile
private

Definition at line 106 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ respntrees

TTree* EcalTestPulseAnalyzer::respntrees
private

Definition at line 131 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ restrees

TTree* EcalTestPulseAnalyzer::restrees
private

Definition at line 130 of file EcalTestPulseAnalyzer.h.

Referenced by endJob().

◆ ret_data

double EcalTestPulseAnalyzer::ret_data[20]
private

Definition at line 89 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ rootfile

std::string EcalTestPulseAnalyzer::rootfile
private

◆ runNum

int EcalTestPulseAnalyzer::runNum
private

Definition at line 97 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ runType

int EcalTestPulseAnalyzer::runType
private

Definition at line 96 of file EcalTestPulseAnalyzer.h.

Referenced by analyze().

◆ side

int EcalTestPulseAnalyzer::side
private

Definition at line 100 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ towerID

int EcalTestPulseAnalyzer::towerID
private

Definition at line 91 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ TPEvents

int EcalTestPulseAnalyzer::TPEvents
private

Definition at line 87 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

◆ trees

TTree* EcalTestPulseAnalyzer::trees[1700]
private

Definition at line 110 of file EcalTestPulseAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
NMODEB
#define NMODEB
Definition: EcalLaserAnalyzer.h:37
EcalElectronicsMapping
Definition: EcalElectronicsMapping.h:28
EcalTestPulseAnalyzer::resdir_
std::string resdir_
Definition: EcalTestPulseAnalyzer.h:65
NCRYSEE
#define NCRYSEE
Definition: EcalABAnalyzer.h:33
TMom::addEntry
void addEntry(double val)
Definition: TMom.cc:88
EcalTestPulseAnalyzer::iZ
int iZ
Definition: EcalTestPulseAnalyzer.h:101
EcalTestPulseAnalyzer::pnAmpl
double pnAmpl
Definition: EcalTestPulseAnalyzer.h:126
EcalTestPulseAnalyzer::_fedid
int _fedid
Definition: EcalTestPulseAnalyzer.h:63
EcalTestPulseAnalyzer::pnAmpl1
double pnAmpl1
Definition: EcalTestPulseAnalyzer.h:125
mps_fire.i
i
Definition: mps_fire.py:355
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
EcalTestPulseAnalyzer::rootfile
std::string rootfile
Definition: EcalTestPulseAnalyzer.h:74
EcalTestPulseAnalyzer::nCrys
unsigned int nCrys
Definition: EcalTestPulseAnalyzer.h:80
EcalTestPulseAnalyzer::_firstsample
unsigned int _firstsample
Definition: EcalTestPulseAnalyzer.h:51
NTTEE
#define NTTEE
Definition: EcalPerEvtLaserAnalyzer.h:30
edm::Handle::product
T const * product() const
Definition: Handle.h:70
TPNFit
Definition: TPNFit.h:8
edm::DataFrameContainer::const_iterator
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
Definition: DataFrameContainer.h:61
EcalTestPulseAnalyzer::eta
int eta
Definition: EcalTestPulseAnalyzer.h:114
EcalTestPulseAnalyzer::TPEvents
int TPEvents
Definition: EcalTestPulseAnalyzer.h:87
MEEBGeom::electronic_channel
static int electronic_channel(EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:326
EcalTestPulseAnalyzer::digiCollection_
std::string digiCollection_
Definition: EcalTestPulseAnalyzer.h:66
EcalTestPulseAnalyzer::phi
int phi
Definition: EcalTestPulseAnalyzer.h:114
modules
Definition: ZHLTMatchFilter.cc:17
EcalTestPulseAnalyzer::iEvent
int iEvent
Definition: EcalTestPulseAnalyzer.h:45
EBDetId
Definition: EBDetId.h:17
NGAINPN
#define NGAINPN
Definition: EcalTestPulseAnalyzer.h:32
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
EBDataFrame
Definition: EBDataFrame.h:11
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalTestPulseAnalyzer::gain
int gain
Definition: EcalTestPulseAnalyzer.h:139
EcalTestPulseAnalyzer::nGainPN
unsigned int nGainPN
Definition: EcalTestPulseAnalyzer.h:83
TSFit
Definition: TSFit.h:15
EcalTestPulseAnalyzer::digiProducer_
std::string digiProducer_
Definition: EcalTestPulseAnalyzer.h:68
EcalDCCHeaderBlock::TESTPULSE_SCAN_MEM
Definition: EcalDCCHeaderBlock.h:29
CollectionTags_cfi.EBDigi
EBDigi
Definition: CollectionTags_cfi.py:27
cms::cuda::assert
assert(be >=bs)
edm::SortedCollection
Definition: SortedCollection.h:49
EcalTestPulseAnalyzer::_niter
unsigned int _niter
Definition: EcalTestPulseAnalyzer.h:59
EcalTestPulseAnalyzer::towerID
int towerID
Definition: EcalTestPulseAnalyzer.h:91
NTTEB
#define NTTEB
Definition: EcalPerEvtLaserAnalyzer.h:25
EcalTestPulseAnalyzer::_samplemin
unsigned int _samplemin
Definition: EcalTestPulseAnalyzer.h:53
EcalTestPulseAnalyzer::pnGain
int pnGain
Definition: EcalTestPulseAnalyzer.h:120
EcalTestPulseAnalyzer::iside
int iside[1700]
Definition: EcalTestPulseAnalyzer.h:146
NCRYSEB
#define NCRYSEB
Definition: EcalABAnalyzer.h:30
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EcalPnDiodeDetId
Definition: EcalPnDiodeDetId.h:22
EcalTestPulseAnalyzer::resFile
TFile * resFile
Definition: EcalTestPulseAnalyzer.h:106
EcalTestPulseAnalyzer::_lastsamplePN
unsigned int _lastsamplePN
Definition: EcalTestPulseAnalyzer.h:58
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
MEEBGeom::pn
static std::pair< int, int > pn(int ilmmod)
Definition: MEEBGeom.cc:447
edm::Handle
Definition: AssociativeIterator.h:50
ME::lmmodFromDcc
static std::vector< ME::LMMid > lmmodFromDcc(ME::DCCid idcc)
Definition: ME.cc:574
EcalTestPulseAnalyzer::apdGain
int apdGain
Definition: EcalTestPulseAnalyzer.h:119
EcalTestPulseAnalyzer::iChannelID
int iChannelID[1700]
Definition: EcalTestPulseAnalyzer.h:146
EcalTestPulseAnalyzer::restrees
TTree * restrees
Definition: EcalTestPulseAnalyzer.h:130
EcalElectronicsId::towerId
int towerId() const
get the tower id
Definition: EcalElectronicsId.h:33
EcalTestPulseAnalyzer::iphi
int iphi
Definition: EcalTestPulseAnalyzer.h:139
EcalTestPulseAnalyzer::pnID
int pnID
Definition: EcalTestPulseAnalyzer.h:140
EcalDCCHeaderBlock::TESTPULSE_GAP
Definition: EcalDCCHeaderBlock.h:43
EcalTestPulseAnalyzer::_nsamples
unsigned int _nsamples
Definition: EcalTestPulseAnalyzer.h:49
EcalTestPulseAnalyzer::nGainAPD
unsigned int nGainAPD
Definition: EcalTestPulseAnalyzer.h:84
NGAINAPD
#define NGAINAPD
Definition: EcalTestPulseAnalyzer.h:33
EcalTestPulseAnalyzer::nMod
unsigned int nMod
Definition: EcalTestPulseAnalyzer.h:82
MEEBGeom::side
static int side(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:105
EcalTestPulseAnalyzer::fedID
int fedID
Definition: EcalTestPulseAnalyzer.h:98
EcalTestPulseAnalyzer::eventHeaderCollection_
std::string eventHeaderCollection_
Definition: EcalTestPulseAnalyzer.h:69
EcalTestPulseAnalyzer::iModule
unsigned int iModule[1700]
Definition: EcalTestPulseAnalyzer.h:145
CollectionTags_cfi.EEDigi
EEDigi
Definition: CollectionTags_cfi.py:28
TSFit::fit_third_degree_polynomial
double fit_third_degree_polynomial(double *, double *)
Definition: TSFit.cc:255
EcalElectronicsId::channelId
int channelId() const
so far for EndCap only :
Definition: EcalElectronicsId.cc:71
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
edm::ESHandle< EcalElectronicsMapping >
EcalElectronicsMapping::getElectronicsId
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
Definition: EcalElectronicsMapping.cc:324
EcalTestPulseAnalyzer::apdTime
double apdTime
Definition: EcalTestPulseAnalyzer.h:123
EcalTestPulseAnalyzer::adc
double adc[10]
Definition: EcalTestPulseAnalyzer.h:116
EcalTestPulseAnalyzer::ret_data
double ret_data[20]
Definition: EcalTestPulseAnalyzer.h:89
EcalTestPulseAnalyzer::outFile
TFile * outFile
Definition: EcalTestPulseAnalyzer.h:105
dqmdumpme.k
k
Definition: dqmdumpme.py:60
EcalTestPulseAnalyzer::_chi2max
double _chi2max
Definition: EcalTestPulseAnalyzer.h:60
EcalTestPulseAnalyzer::trees
TTree * trees[1700]
Definition: EcalTestPulseAnalyzer.h:110
EcalDCCHeaderBlock::TESTPULSE_MGPA
Definition: EcalDCCHeaderBlock.h:30
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
MEEEGeom::pn
static std::pair< int, int > pn(int dee, int ilmod)
Definition: MEEEGeom.cc:574
EEDetId
Definition: EEDetId.h:14
EcalTestPulseAnalyzer::dccMEM
std::vector< int > dccMEM
Definition: EcalTestPulseAnalyzer.h:134
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTestPulseAnalyzer::ieta
int ieta
Definition: EcalTestPulseAnalyzer.h:139
EcalTestPulseAnalyzer::_lastsample
unsigned int _lastsample
Definition: EcalTestPulseAnalyzer.h:52
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
EcalTestPulseAnalyzer::_ecalPart
std::string _ecalPart
Definition: EcalTestPulseAnalyzer.h:62
EcalPnDiodeDetId::iDCCId
int iDCCId() const
get the DCCId
Definition: EcalPnDiodeDetId.h:44
TMom
Definition: TMom.h:7
EcalTestPulseAnalyzer::_samplemax
unsigned int _samplemax
Definition: EcalTestPulseAnalyzer.h:54
TSFit::init_errmat
void init_errmat(double)
Definition: TSFit.cc:87
EcalTestPulseAnalyzer::flag
int flag
Definition: EcalTestPulseAnalyzer.h:139
TPNFit::getAmpl
double getAmpl()
Definition: TPNFit.h:31
EcalTestPulseAnalyzer::idccID
int idccID[1700]
Definition: EcalTestPulseAnalyzer.h:146
EcalTestPulseAnalyzer::APD
double APD[6]
Definition: EcalTestPulseAnalyzer.h:142
EcalTestPulseAnalyzer::runNum
int runNum
Definition: EcalTestPulseAnalyzer.h:97
EcalTestPulseAnalyzer::event
int event
Definition: EcalTestPulseAnalyzer.h:115
EBDigiCollection
Definition: EcalDigiCollections.h:32
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
EcalTestPulseAnalyzer::resfile
std::string resfile
Definition: EcalTestPulseAnalyzer.h:75
EEDigiCollection
Definition: EcalDigiCollections.h:45
EcalTestPulseAnalyzer::pnG
int pnG
Definition: EcalTestPulseAnalyzer.h:121
EcalTestPulseAnalyzer::_firstsamplePN
unsigned int _firstsamplePN
Definition: EcalTestPulseAnalyzer.h:57
TMom::getM3
double getM3()
Definition: TMom.cc:156
EcalTestPulseAnalyzer::_timeofmax
double _timeofmax
Definition: EcalTestPulseAnalyzer.h:61
TMom::getNevt
int getNevt()
Definition: TMom.cc:144
EcalTestPulseAnalyzer::iEta
int iEta[1700]
Definition: EcalTestPulseAnalyzer.h:144
Max
T Max(T a, T b)
Definition: MathUtil.h:44
EcalTestPulseAnalyzer::pn
double pn[50]
Definition: EcalTestPulseAnalyzer.h:117
EcalTestPulseAnalyzer::digiPNCollection_
std::string digiPNCollection_
Definition: EcalTestPulseAnalyzer.h:67
EcalTestPulseAnalyzer::_presample
unsigned int _presample
Definition: EcalTestPulseAnalyzer.h:50
TPNFit::init
void init(int, int, int)
Definition: TPNFit.cc:24
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
EcalTestPulseAnalyzer::moduleID
int moduleID
Definition: EcalTestPulseAnalyzer.h:140
module
Definition: vlib.h:198
get
#define get
EcalTestPulseAnalyzer::channelID
int channelID
Definition: EcalTestPulseAnalyzer.h:92
TMom::getMean
double getMean()
Definition: TMom.cc:121
EcalMGPASample
Definition: EcalMGPASample.h:22
PedestalClient_cfi.pngain
pngain
Definition: PedestalClient_cfi.py:52
EcalTestPulseAnalyzer::eventHeaderProducer_
std::string eventHeaderProducer_
Definition: EcalTestPulseAnalyzer.h:70
EcalTestPulseAnalyzer::nTT
unsigned int nTT
Definition: EcalTestPulseAnalyzer.h:81
EcalTestPulseAnalyzer::apdAmpl
double apdAmpl
Definition: EcalTestPulseAnalyzer.h:122
MEEEGeom::lmmod
static int lmmod(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:112
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EcalTestPulseAnalyzer::isFirstChanModFilled
unsigned int isFirstChanModFilled[9]
Definition: EcalTestPulseAnalyzer.h:149
TPNFit::doFit
double doFit(int, double *)
Definition: TPNFit.cc:39
EcalTestPulseAnalyzer::firstChanMod
unsigned int firstChanMod[9]
Definition: EcalTestPulseAnalyzer.h:148
EcalTestPulseAnalyzer::dccID
int dccID
Definition: EcalTestPulseAnalyzer.h:99
EcalMappingRcd
Definition: EcalMappingRcd.h:15
EcalTestPulseAnalyzer::iTowerID
int iTowerID[1700]
Definition: EcalTestPulseAnalyzer.h:146
TMom::getMax
double getMax()
Definition: TMom.cc:170
MEEBGeom::lmmod
static int lmmod(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:90
EcalTestPulseAnalyzer::channelIteratorEE
int channelIteratorEE
Definition: EcalTestPulseAnalyzer.h:141
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EcalTestPulseAnalyzer::iPhi
int iPhi[1700]
Definition: EcalTestPulseAnalyzer.h:144
MEEBGeom::localCoord
static XYCoord localCoord(int icr)
Definition: MEEBGeom.cc:142
EcalTestPulseAnalyzer::pnAmpl0
double pnAmpl0
Definition: EcalTestPulseAnalyzer.h:124
EcalTestPulseAnalyzer::respntrees
TTree * respntrees
Definition: EcalTestPulseAnalyzer.h:131
EcalTestPulseAnalyzer::_nsamplesPN
unsigned int _nsamplesPN
Definition: EcalTestPulseAnalyzer.h:55
EcalTestPulseAnalyzer::runType
int runType
Definition: EcalTestPulseAnalyzer.h:96
MEEEGeom::side
static int side(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:1155
EcalElectronicsId::stripId
int stripId() const
get the tower id
Definition: EcalElectronicsId.h:35
EcalTestPulseAnalyzer::_presamplePN
unsigned int _presamplePN
Definition: EcalTestPulseAnalyzer.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
event
Definition: event.py:1
EEDataFrame
Definition: EEDataFrame.h:12
TMom::getRMS
double getRMS()
Definition: TMom.cc:146
TSFit::set_params
void set_params(int, int, int, int, int, double, double, int, int)
Definition: TSFit.cc:39
ME::memFromDcc
static std::vector< ME::DCCid > memFromDcc(ME::DCCid idcc)
Definition: ME.cc:561
EcalElectronicsId::xtalId
int xtalId() const
get the channel id
Definition: EcalElectronicsId.h:37
ecalpyutils::hashedIndex
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:38
EcalTestPulseAnalyzer::channelMapEE
std::map< int, int > channelMapEE
Definition: EcalTestPulseAnalyzer.h:133
EcalTestPulseAnalyzer::side
int side
Definition: EcalTestPulseAnalyzer.h:100
EcalTestPulseAnalyzer::PN
double PN[6]
Definition: EcalTestPulseAnalyzer.h:142
TMom::getMin
double getMin()
Definition: TMom.cc:169
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37