CMS 3D CMS Logo

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

#include <EcalLaserAnalyzer.h>

Inheritance diagram for EcalLaserAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

enum  VarCol { iBlue, iRed, nColor }
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void beginJob () override
 
 EcalLaserAnalyzer (const edm::ParameterSet &iConfig)
 
void endJob () override
 
void setGeomEB (int etaG, int phiG, int module, int tower, int strip, int xtal, int apdRefTT, int channel, int lmr)
 
void setGeomEE (int etaG, int phiG, int iX, int iY, int iZ, int module, int tower, int ch, int apdRefTT, int channel, int lmr)
 
 ~EcalLaserAnalyzer () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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 _alpha
 
double _beta
 
double _chi2cut
 
int _debug
 
bool _docorpn
 
std::string _ecalPart
 
int _fedid
 
unsigned int _firstsample
 
unsigned int _firstsamplePN
 
bool _fitab
 
unsigned int _lastsample
 
unsigned int _lastsamplePN
 
unsigned int _nevtmax
 
unsigned int _niter
 
double _noise
 
unsigned int _nsamples
 
unsigned int _nsamplesPN
 
unsigned int _presample
 
double _presamplecut
 
unsigned int _presamplePN
 
double _qualpercent
 
double _ratiomaxcutlow
 
double _ratiomincuthigh
 
double _ratiomincutlow
 
bool _saveallevents
 
unsigned int _timingcuthigh
 
unsigned int _timingcutlow
 
unsigned int _timingqualhigh
 
unsigned int _timingquallow
 
double adc [10]
 
std::string ADCfile
 
TFile * ADCFile
 
int adcG [10]
 
double * adcNoPed
 
TTree * ADCtrees [1700]
 
std::string alphafile
 
std::string alphainitfile
 
double APD [6]
 
double apdAmpl
 
double apdAmplA
 
double apdAmplB
 
TAPDAPDAnal [1700][nColor]
 
std::string APDfile
 
TFile * APDFile
 
TAPDAPDFirstAnal [1700][nColor]
 
double APDoAPDA [6]
 
double APDoAPDB [6]
 
double APDoPN [6]
 
double APDoPNA [6]
 
double APDoPNB [6]
 
TAPDPulseAPDPulse
 
std::map< int, unsigned int > apdRefMap [2]
 
double apdTime
 
TTree * APDtrees [1700]
 
int channelID
 
int channelIteratorEE
 
std::map< unsigned int, unsigned int > channelMapEE
 
int color
 
int colorref
 
std::vector< int > colors
 
int dccID
 
TMomDelta01
 
TMomDelta12
 
std::string digiCollection_
 
std::string digiPNCollection_
 
std::string digiProducer_
 
bool doesABTreeExist
 
int eta
 
int event
 
std::string eventHeaderCollection_
 
std::string eventHeaderProducer_
 
int eventref
 
int fedID
 
unsigned int firstChanMod [22]
 
int flag
 
int flagAB
 
int iChannelID [1700]
 
int idccID [1700]
 
int iEta [1700]
 
int iEvent
 
unsigned int iModule [1700]
 
int iPhi [1700]
 
unsigned int isFirstChanModFilled [22]
 
bool isGainOK
 
int iside [1700]
 
int IsThereDataADC [1700][nColor]
 
bool isTimingOK
 
int iTowerID [1700]
 
int iZ
 
int laserEvents
 
int lightside
 
TMemMem
 
int moduleID
 
std::vector< int > modules
 
unsigned int nCrys
 
unsigned int nevtAB [1700]
 
int nEvtBadGain [1700]
 
int nEvtBadTiming [1700]
 
int nEvtTot [1700]
 
unsigned int nMod
 
unsigned int nPNPerMod
 
unsigned int nRefChan
 
unsigned int nRefTrees
 
unsigned int nSides
 
int phi
 
double pn [50]
 
double PN [6]
 
double pn0
 
double pn1
 
double pnAmpl
 
TPNPNAnal [22][2][nColor]
 
std::string pncorfile_
 
TPNCorpnCorrector
 
TPNPNFirstAnal [22][2][nColor]
 
int pnG [50]
 
int pnID
 
double * pnNoPed
 
double PNoPN [6]
 
double PNoPNA [6]
 
double PNoPNB [6]
 
TPNPulsePNPulse
 
TTree * RefAPDtrees [2][22]
 
std::string resdir_
 
std::string resfile
 
TFile * resFile
 
TTree * respntrees [nColor]
 
TTree * restrees [nColor]
 
int runNum
 
int runType
 
TShapeAnalysisshapana
 
int side
 
double Time [6]
 
int towerID
 
bool wasABCalcOK [1700]
 
bool wasGainOK [1700]
 
bool wasTimingOK [1700]
 

Additional Inherited Members

- 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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 47 of file EcalLaserAnalyzer.h.

Member Enumeration Documentation

Enumerator
iBlue 
iRed 
nColor 

Definition at line 60 of file EcalLaserAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 56 of file EcalLaserAnalyzer.cc.

References _ecalPart, _fedid, _firstsample, _lastsample, _nsamples, _nsamplesPN, _presample, _presamplePN, _ratiomaxcutlow, _ratiomincuthigh, _ratiomincutlow, _timingcuthigh, _timingcutlow, _timingqualhigh, _timingquallow, APDPulse, Delta01, Delta12, digiCollection_, digiPNCollection_, digiProducer_, eventHeaderCollection_, eventHeaderProducer_, firstChanMod, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), iChannelID, idccID, iEta, cuy::ii, iModule, iPhi, isFirstChanModFilled, isGainOK, iside, isTimingOK, iTowerID, iZ, dqmiolumiharvest::j, ME::lmmodFromDcc(), Mem, nCrys, NCRYSEB, NCRYSEE, nMod, NREFCHAN, nRefChan, pncorfile_, pnCorrector, PNPulse, resdir_, AlCaHLTBitMon_QueryRunRegistry::string, wasGainOK, and wasTimingOK.

58  : iEvent(0),
59 
60  // Framework parameters with default values
61 
62  _nsamples(iConfig.getUntrackedParameter<unsigned int>("nSamples", 10)),
63  _presample(iConfig.getUntrackedParameter<unsigned int>("nPresamples", 2)),
64  _firstsample(iConfig.getUntrackedParameter<unsigned int>("firstSample", 1)),
65  _lastsample(iConfig.getUntrackedParameter<unsigned int>("lastSample", 2)),
66  _nsamplesPN(iConfig.getUntrackedParameter<unsigned int>("nSamplesPN", 50)),
67  _presamplePN(iConfig.getUntrackedParameter<unsigned int>("nPresamplesPN", 6)),
68  _firstsamplePN(iConfig.getUntrackedParameter<unsigned int>("firstSamplePN", 7)),
69  _lastsamplePN(iConfig.getUntrackedParameter<unsigned int>("lastSamplePN", 8)),
70  _timingcutlow(iConfig.getUntrackedParameter<unsigned int>("timingCutLow", 2)),
71  _timingcuthigh(iConfig.getUntrackedParameter<unsigned int>("timingCutHigh", 9)),
72  _timingquallow(iConfig.getUntrackedParameter<unsigned int>("timingQualLow", 3)),
73  _timingqualhigh(iConfig.getUntrackedParameter<unsigned int>("timingQualHigh", 8)),
74  _ratiomincutlow(iConfig.getUntrackedParameter<double>("ratioMinCutLow", 0.4)),
75  _ratiomincuthigh(iConfig.getUntrackedParameter<double>("ratioMinCutHigh", 0.95)),
76  _ratiomaxcutlow(iConfig.getUntrackedParameter<double>("ratioMaxCutLow", 0.8)),
77  _presamplecut(iConfig.getUntrackedParameter<double>("presampleCut", 5.0)),
78  _niter(iConfig.getUntrackedParameter<unsigned int>("nIter", 3)),
79  _fitab(iConfig.getUntrackedParameter<bool>("fitAB", false)),
80  _alpha(iConfig.getUntrackedParameter<double>("alpha", 1.5076494)),
81  _beta(iConfig.getUntrackedParameter<double>("beta", 1.5136036)),
82  _nevtmax(iConfig.getUntrackedParameter<unsigned int>("nEvtMax", 200)),
83  _noise(iConfig.getUntrackedParameter<double>("noise", 2.0)),
84  _chi2cut(iConfig.getUntrackedParameter<double>("chi2cut", 10.0)),
85  _ecalPart(iConfig.getUntrackedParameter<std::string>("ecalPart", "EB")),
86  _docorpn(iConfig.getUntrackedParameter<bool>("doCorPN", false)),
87  _fedid(iConfig.getUntrackedParameter<int>("fedID", -999)),
88  _saveallevents(iConfig.getUntrackedParameter<bool>("saveAllEvents", false)),
89  _qualpercent(iConfig.getUntrackedParameter<double>("qualPercent", 0.2)),
90  _debug(iConfig.getUntrackedParameter<int>("debug", 0)),
91  nCrys(NCRYSEB),
93  nMod(NMODEE),
94  nSides(NSIDES),
95  runType(-1),
96  runNum(0),
97  fedID(-1),
98  dccID(-1),
99  side(2),
100  lightside(2),
101  iZ(1),
102  phi(-1),
103  eta(-1),
104  event(0),
105  color(-1),
106  pn0(0),
107  pn1(0),
108  apdAmpl(0),
109  apdAmplA(0),
110  apdAmplB(0),
111  apdTime(0),
112  pnAmpl(0),
113  pnID(-1),
114  moduleID(-1),
116 
117 //========================================================================
118 
119 {
120  // Initialization from cfg file
121 
122  resdir_ = iConfig.getUntrackedParameter<std::string>("resDir");
123  pncorfile_ = iConfig.getUntrackedParameter<std::string>("pnCorFile");
124 
125  digiCollection_ = iConfig.getParameter<std::string>("digiCollection");
126  digiPNCollection_ = iConfig.getParameter<std::string>("digiPNCollection");
127  digiProducer_ = iConfig.getParameter<std::string>("digiProducer");
128 
129  eventHeaderCollection_ = iConfig.getParameter<std::string>("eventHeaderCollection");
130  eventHeaderProducer_ = iConfig.getParameter<std::string>("eventHeaderProducer");
131 
132  // Geometrical constants initialization
133 
134  if (_ecalPart == "EB") {
135  nCrys = NCRYSEB;
136  } else {
137  nCrys = NCRYSEE;
138  }
139  iZ = 1;
140  if (_fedid <= 609)
141  iZ = -1;
143  nMod = modules.size();
144  nRefChan = NREFCHAN;
145 
146  for (unsigned int j = 0; j < nCrys; j++) {
147  iEta[j] = -1;
148  iPhi[j] = -1;
149  iModule[j] = 10;
150  iTowerID[j] = -1;
151  iChannelID[j] = -1;
152  idccID[j] = -1;
153  iside[j] = -1;
154  wasTimingOK[j] = true;
155  wasGainOK[j] = true;
156  }
157 
158  for (unsigned int j = 0; j < nMod; j++) {
159  int ii = modules[j];
160  firstChanMod[ii - 1] = 0;
161  isFirstChanModFilled[ii - 1] = 0;
162  }
163 
164  // Quality check flags
165 
166  isGainOK = true;
167  isTimingOK = true;
168 
169  // PN linearity corrector
170 
171  pnCorrector = new TPNCor(pncorfile_);
172 
173  // Objects dealing with pulses
174 
176  _presample,
177  _firstsample,
178  _lastsample,
187 
188  // Object dealing with MEM numbering
189 
190  Mem = new TMem(_fedid);
191 
192  // Objects needed for npresample calculation
193 
194  Delta01 = new TMom();
195  Delta12 = new TMom();
196 }
unsigned int _firstsamplePN
unsigned int _nsamples
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define NMODEE
#define NSIDES
std::string digiPNCollection_
#define NCRYSEE
unsigned int _timingcuthigh
unsigned int _nevtmax
unsigned int _nsamplesPN
unsigned int _timingcutlow
Definition: TMom.h:7
unsigned int _timingquallow
std::string digiProducer_
Definition: TMem.h:7
unsigned int firstChanMod[22]
std::string digiCollection_
#define NCRYSEB
unsigned int isFirstChanModFilled[22]
unsigned int _lastsamplePN
std::string eventHeaderProducer_
unsigned int _firstsample
#define NREFCHAN
std::string eventHeaderCollection_
unsigned int _presample
ii
Definition: cuy.py:590
unsigned int iModule[1700]
unsigned int nPNPerMod
#define NPNPERMOD
unsigned int _timingqualhigh
unsigned int _lastsample
Definition: TPNCor.h:7
unsigned int _presamplePN
static std::vector< ME::LMMid > lmmodFromDcc(ME::DCCid idcc)
Definition: ME.cc:574
EcalLaserAnalyzer::~EcalLaserAnalyzer ( )
override

Definition at line 199 of file EcalLaserAnalyzer.cc.

199  {
200  //========================================================================
201 
202  // do anything here that needs to be done at destruction time
203  // (e.g. close files, deallocate resources etc.)
204 }

Member Function Documentation

void EcalLaserAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 315 of file EcalLaserAnalyzer.cc.

References _debug, _docorpn, _ecalPart, _fedid, _firstsamplePN, _fitab, _lastsamplePN, _nevtmax, _nsamplesPN, adc, adcG, ADCtrees, TMom::addEntry(), APDPulse, MEEBGeom::apdRefTower(), MEEEGeom::apdRefTower(), edm::SortedCollection< T, SORT >::begin(), edm::DataFrameContainer::begin(), beam_dqm_sourceclient-live_cfg::cerr, EcalElectronicsId::channelId(), channelID, channelIteratorEE, channelMapEE, color, corr, gather_cfg::cout, dccID, MEEEGeom::dee(), Delta01, Delta12, digiCollection_, digiPNCollection_, digiProducer_, doesABTreeExist, TPNFit::doFit(), CollectionTags_cfi::EBDigi, CollectionTags_cfi::EEDigi, MEEBGeom::electronic_channel(), edm::SortedCollection< T, SORT >::end(), edm::DataFrameContainer::end(), eta, eventHeaderCollection_, eventHeaderProducer_, cppFunctionSkipper::exception, fedID, spr::find(), edm::EventSetup::get(), TPNPulse::getAdcWithoutPedestal(), TPNFit::getAmpl(), edm::Event::getByLabel(), TAPDPulse::getDelta(), EcalElectronicsMapping::getElectronicsId(), TPNPulse::getMaxSample(), TPNCor::getPNCorrectionFactor(), ecalpyutils::hashedIndex(), mps_fire::i, EcalPnDiodeDetId::iDCCId(), iEvent, TPNFit::init(), createfilelist::int, EcalPnDiodeDetId::iPnId(), TMem::isMemRelevant(), TAPDPulse::isPulseOK(), TAPDPulse::isTimingQualOK(), iZ, EcalDCCHeaderBlock::LASER_DELAY_SCAN, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_POWER_SCAN, EcalDCCHeaderBlock::LASER_STD, laserEvents, lightside, MEEEGeom::lmmod(), MEEBGeom::lmmod(), MEEBGeom::lmr(), MEEEGeom::lmr(), MEEBGeom::localCoord(), Max(), TMem::Mem(), Mem, nCrys, nevtAB, nEvtBadGain, nEvtBadTiming, nEvtTot, phi, MEEBGeom::pn(), MEEEGeom::pn(), pn, pn0, pn1, pnAmpl, pnCorrector, pnG, pnNoPed, PNPulse, edm::Handle< T >::product(), edm::ESHandle< T >::product(), TShapeAnalysis::putAllVals(), runNum, runType, setGeomEB(), setGeomEE(), TPNPulse::setPulse(), TAPDPulse::setPulse(), shapana, side, findQualityFiles::size, digitizers_cfi::strip, EcalElectronicsId::stripId(), hgcalTowerProducer_cfi::tower, EcalElectronicsId::towerId(), towerID, EcalDCCHeaderBlock::EcalDCCEventSettings::wavelength, and EcalElectronicsId::xtalId().

315  {
316  //========================================================================
317 
318  ++iEvent;
319 
320  // retrieving DCC header
321 
323  const EcalRawDataCollection* DCCHeader = nullptr;
324  try {
326  DCCHeader = pDCCHeader.product();
327  } catch (std::exception& ex) {
328  std::cerr << "Error! can't get the product retrieving DCC header" << eventHeaderCollection_.c_str() << " "
329  << eventHeaderProducer_.c_str() << std::endl;
330  }
331 
332  //retrieving crystal data from Event
333 
335  const EBDigiCollection* EBDigi = nullptr;
337  const EEDigiCollection* EEDigi = nullptr;
338 
339  if (_ecalPart == "EB") {
340  try {
342  EBDigi = pEBDigi.product();
343  } catch (std::exception& ex) {
344  std::cerr << "Error! can't get the product retrieving EB crystal data " << digiCollection_.c_str() << std::endl;
345  }
346  } else if (_ecalPart == "EE") {
347  try {
349  EEDigi = pEEDigi.product();
350  } catch (std::exception& ex) {
351  std::cerr << "Error! can't get the product retrieving EE crystal data " << digiCollection_.c_str() << std::endl;
352  }
353  } else {
354  std::cout << " Wrong ecalPart in cfg file " << std::endl;
355  return;
356  }
357 
358  // retrieving crystal PN diodes from Event
359 
361  const EcalPnDiodeDigiCollection* PNDigi = nullptr;
362  try {
363  e.getByLabel(digiProducer_, pPNDigi);
364  PNDigi = pPNDigi.product();
365  } catch (std::exception& ex) {
366  std::cerr << "Error! can't get the product " << digiPNCollection_.c_str() << std::endl;
367  }
368 
369  // retrieving electronics mapping
370 
372  const EcalElectronicsMapping* TheMapping = nullptr;
373  try {
374  c.get<EcalMappingRcd>().get(ecalmapping);
375  TheMapping = ecalmapping.product();
376  } catch (std::exception& ex) {
377  std::cerr << "Error! can't get the product EcalMappingRcd" << std::endl;
378  }
379 
380  // ============================
381  // Decode DCCHeader Information
382  // ============================
383 
384  for (EcalRawDataCollection::const_iterator headerItr = DCCHeader->begin(); headerItr != DCCHeader->end();
385  ++headerItr) {
386  // Get run type and run number
387 
388  int fed = headerItr->fedId();
389  if (fed != _fedid && _fedid != -999)
390  continue;
391 
392  runType = headerItr->getRunType();
393  runNum = headerItr->getRunNumber();
394  event = headerItr->getLV1();
395 
396  dccID = headerItr->getDccInTCCCommand();
397  fedID = headerItr->fedId();
398  lightside = headerItr->getRtHalf();
399 
400  // Check fed corresponds to the DCC in TCC
401 
402  if (600 + dccID != fedID)
403  continue;
404 
405  // Cut on runType
406 
409  return;
410 
411  // Retrieve laser color and event number
412 
413  EcalDCCHeaderBlock::EcalDCCEventSettings settings = headerItr->getEventSettings();
414  color = settings.wavelength;
415  if (color < 0)
416  return;
417 
418  std::vector<int>::iterator iter = find(colors.begin(), colors.end(), color);
419  if (iter == colors.end()) {
420  colors.push_back(color);
421  std::cout << " new color found " << color << " " << colors.size() << std::endl;
422  }
423  }
424 
425  // Cut on fedID
426 
427  if (fedID != _fedid && _fedid != -999)
428  return;
429 
430  // Count laser events
431 
432  laserEvents++;
433 
434  // ======================
435  // Decode PN Information
436  // ======================
437 
438  TPNFit* pnfit = new TPNFit();
440 
441  double chi2pn = 0;
442  unsigned int samplemax = 0;
443  int pnGain = 0;
444 
445  std::map<int, std::vector<double> > allPNAmpl;
446  std::map<int, std::vector<double> > allPNGain;
447 
448  // Loop on PNs digis
449 
450  for (EcalPnDiodeDigiCollection::const_iterator pnItr = PNDigi->begin(); pnItr != PNDigi->end(); ++pnItr) {
451  EcalPnDiodeDetId pnDetId = EcalPnDiodeDetId((*pnItr).id());
452 
453  if (_debug == 1)
454  std::cout << "-- debug -- Inside PNDigi - pnID=" << pnDetId.iPnId() << ", dccID=" << pnDetId.iDCCId()
455  << std::endl;
456 
457  // Skip MEM DCC without relevant data
458 
459  bool isMemRelevant = Mem->isMemRelevant(pnDetId.iDCCId());
460  if (!isMemRelevant)
461  continue;
462 
463  // Loop on PN samples
464 
465  for (int samId = 0; samId < (*pnItr).size(); samId++) {
466  pn[samId] = (*pnItr).sample(samId).adc();
467  pnG[samId] = (*pnItr).sample(samId).gainId();
468  if (samId == 0)
469  pnGain = pnG[samId];
470  if (samId > 0)
471  pnGain = int(TMath::Max(pnG[samId], pnGain));
472  }
473 
474  if (pnGain != 1)
475  std::cout << "PN gain different from 1" << std::endl;
476 
477  // Calculate amplitude from pulse
478 
479  PNPulse->setPulse(pn);
481  samplemax = PNPulse->getMaxSample();
482  chi2pn = pnfit->doFit(samplemax, &pnNoPed[0]);
483  if (chi2pn == 101 || chi2pn == 102 || chi2pn == 103)
484  pnAmpl = 0.;
485  else
486  pnAmpl = pnfit->getAmpl();
487 
488  // Apply linearity correction
489 
490  double corr = 1.0;
491  if (_docorpn)
492  corr = pnCorrector->getPNCorrectionFactor(pnAmpl, pnGain);
493  pnAmpl *= corr;
494 
495  // Fill PN ampl vector
496 
497  allPNAmpl[pnDetId.iDCCId()].push_back(pnAmpl);
498 
499  if (_debug == 1)
500  std::cout << "-- debug -- Inside PNDigi - PNampl=" << pnAmpl << ", PNgain=" << pnGain << std::endl;
501  }
502 
503  // ===========================
504  // Decode EBDigis Information
505  // ===========================
506 
507  int adcGain = 0;
508 
509  if (EBDigi) {
510  // Loop on crystals
511  //===================
512 
513  for (EBDigiCollection::const_iterator digiItr = EBDigi->begin(); digiItr != EBDigi->end(); ++digiItr) {
514  // Retrieve geometry
515  //===================
516 
517  EBDetId id_crystal(digiItr->id());
518  EBDataFrame df(*digiItr);
519  EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal);
520 
521  int etaG = id_crystal.ieta(); // global
522  int phiG = id_crystal.iphi(); // global
523 
524  std::pair<int, int> LocalCoord = MEEBGeom::localCoord(etaG, phiG);
525 
526  int etaL = LocalCoord.first; // local
527  int phiL = LocalCoord.second; // local
528 
529  int strip = elecid_crystal.stripId();
530  int xtal = elecid_crystal.xtalId();
531 
532  int module = MEEBGeom::lmmod(etaG, phiG);
533  int tower = elecid_crystal.towerId();
534 
535  int apdRefTT = MEEBGeom::apdRefTower(module);
536 
537  std::pair<int, int> pnpair = MEEBGeom::pn(module);
538  unsigned int MyPn0 = pnpair.first;
539  unsigned int MyPn1 = pnpair.second;
540 
541  int lmr = MEEBGeom::lmr(etaG, phiG);
542  unsigned int channel = MEEBGeom::electronic_channel(etaL, phiL);
543  assert(channel < nCrys);
544 
545  setGeomEB(etaG, phiG, module, tower, strip, xtal, apdRefTT, channel, lmr);
546 
547  if (_debug == 1)
548  std::cout << "-- debug -- Inside EBDigi - towerID:" << towerID << " channelID:" << channelID
549  << " module:" << module << " modules:" << modules.size() << std::endl;
550 
551  // APD Pulse
552  //===========
553 
554  // Loop on adc samples
555 
556  for (unsigned int i = 0; i < (*digiItr).size(); ++i) {
557  EcalMGPASample samp_crystal(df.sample(i));
558  adc[i] = samp_crystal.adc();
559  adcG[i] = samp_crystal.gainId();
560  adc[i] *= adcG[i];
561  if (i == 0)
562  adcGain = adcG[i];
563  if (i > 0)
564  adcGain = TMath::Max(adcG[i], adcGain);
565  }
566 
567  APDPulse->setPulse(adc);
568 
569  // Quality checks
570  //================
571 
572  if (adcGain != 1)
573  nEvtBadGain[channel]++;
574  if (!APDPulse->isTimingQualOK())
575  nEvtBadTiming[channel]++;
576  nEvtTot[channel]++;
577 
578  // Associate PN ampl
579  //===================
580 
581  int mem0 = Mem->Mem(lmr, 0);
582  int mem1 = Mem->Mem(lmr, 1);
583 
584  if (allPNAmpl[mem0].size() > MyPn0)
585  pn0 = allPNAmpl[mem0][MyPn0];
586  else
587  pn0 = 0;
588  if (allPNAmpl[mem1].size() > MyPn1)
589  pn1 = allPNAmpl[mem1][MyPn1];
590  else
591  pn1 = 0;
592 
593  // Fill if Pulse is fine
594  //=======================
595 
596  if (APDPulse->isPulseOK() && lightside == side) {
597  ADCtrees[channel]->Fill();
598 
601 
602  if (nevtAB[channel] < _nevtmax && _fitab) {
603  if (doesABTreeExist)
604  shapana->putAllVals(channel, adc, eta, phi);
605  else
606  shapana->putAllVals(channel, adc, eta, phi, dccID, side, towerID, channelID);
607  nevtAB[channel]++;
608  }
609  }
610  }
611 
612  } else if (EEDigi) {
613  // Loop on crystals
614  //===================
615 
616  for (EEDigiCollection::const_iterator digiItr = EEDigi->begin(); digiItr != EEDigi->end(); ++digiItr) {
617  // Retrieve geometry
618  //===================
619 
620  EEDetId id_crystal(digiItr->id());
621  EEDataFrame df(*digiItr);
622  EcalElectronicsId elecid_crystal = TheMapping->getElectronicsId(id_crystal);
623 
624  int etaG = id_crystal.iy();
625  int phiG = id_crystal.ix();
626 
627  int iX = (phiG - 1) / 5 + 1;
628  int iY = (etaG - 1) / 5 + 1;
629 
630  int tower = elecid_crystal.towerId();
631  int ch = elecid_crystal.channelId() - 1;
632 
633  int module = MEEEGeom::lmmod(iX, iY);
634  if (module >= 18 && side == 1)
635  module += 2;
636  int lmr = MEEEGeom::lmr(iX, iY, iZ);
637  int dee = MEEEGeom::dee(lmr);
638  int apdRefTT = MEEEGeom::apdRefTower(lmr, module);
639 
640  std::pair<int, int> pnpair = MEEEGeom::pn(dee, module);
641  unsigned int MyPn0 = pnpair.first;
642  unsigned int MyPn1 = pnpair.second;
643 
644  int hashedIndex = 100000 * eta + phi;
645  if (channelMapEE.count(hashedIndex) == 0) {
648  }
649  unsigned int channel = channelMapEE[hashedIndex];
650  assert(channel < nCrys);
651 
652  setGeomEE(etaG, phiG, iX, iY, iZ, module, tower, ch, apdRefTT, channel, lmr);
653 
654  if (_debug == 1)
655  std::cout << "-- debug -- Inside EEDigi - towerID:" << towerID << " channelID:" << channelID
656  << " module:" << module << " modules:" << modules.size() << std::endl;
657 
658  // APD Pulse
659  //===========
660 
661  if ((*digiItr).size() > 10)
662  std::cout << "SAMPLES SIZE > 10!" << (*digiItr).size() << std::endl;
663 
664  // Loop on adc samples
665 
666  for (unsigned int i = 0; i < (*digiItr).size(); ++i) {
667  EcalMGPASample samp_crystal(df.sample(i));
668  adc[i] = samp_crystal.adc();
669  adcG[i] = samp_crystal.gainId();
670  adc[i] *= adcG[i];
671 
672  if (i == 0)
673  adcGain = adcG[i];
674  if (i > 0)
675  adcGain = TMath::Max(adcG[i], adcGain);
676  }
677 
678  APDPulse->setPulse(adc);
679 
680  // Quality checks
681  //================
682 
683  if (adcGain != 1)
684  nEvtBadGain[channel]++;
685  if (!APDPulse->isTimingQualOK())
686  nEvtBadTiming[channel]++;
687  nEvtTot[channel]++;
688 
689  // Associate PN ampl
690  //===================
691 
692  int mem0 = Mem->Mem(lmr, 0);
693  int mem1 = Mem->Mem(lmr, 1);
694 
695  if (allPNAmpl[mem0].size() > MyPn0)
696  pn0 = allPNAmpl[mem0][MyPn0];
697  else
698  pn0 = 0;
699  if (allPNAmpl[mem1].size() > MyPn1)
700  pn1 = allPNAmpl[mem1][MyPn1];
701  else
702  pn1 = 0;
703 
704  // Fill if Pulse is fine
705  //=======================
706 
707  if (APDPulse->isPulseOK() && lightside == side) {
708  ADCtrees[channel]->Fill();
709 
712 
713  if (nevtAB[channel] < _nevtmax && _fitab) {
714  if (doesABTreeExist)
715  shapana->putAllVals(channel, adc, eta, phi);
716  else
717  shapana->putAllVals(channel, adc, eta, phi, dccID, side, towerID, channelID);
718  nevtAB[channel]++;
719  }
720  }
721  }
722  }
723 }
size
Write out results.
unsigned int _firstsamplePN
void addEntry(double val)
Definition: TMom.cc:88
static XYCoord localCoord(int icr)
Definition: MEEBGeom.cc:142
static int lmmod(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:112
int xtalId() const
get the channel id
static int apdRefTower(int ilmr, int ilmmod)
Definition: MEEEGeom.cc:1208
int stripId() const
get the tower id
std::string digiPNCollection_
double getDelta(int, int)
Definition: TAPDPulse.cc:116
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
bool setPulse(double *)
Definition: TAPDPulse.cc:86
double getPNCorrectionFactor(double val0, int gain)
Definition: TPNCor.cc:64
std::vector< T >::const_iterator const_iterator
unsigned int _nevtmax
void init(int, int, int)
Definition: TPNFit.cc:24
int towerId() const
get the tower id
unsigned int _nsamplesPN
double * getAdcWithoutPedestal()
Definition: TPNPulse.cc:89
const_iterator begin() const
void putAllVals(int, double *, int, int)
static int lmr(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:110
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
bool setPulse(double *)
Definition: TPNPulse.cc:45
static std::pair< int, int > pn(int ilmmod)
Definition: MEEBGeom.cc:447
std::string digiProducer_
int iPnId() const
get the PnId
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:38
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
static std::pair< int, int > pn(int dee, int ilmod)
Definition: MEEEGeom.cc:574
int Mem(int, int)
Definition: TMem.cc:41
static int electronic_channel(EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:326
std::string digiCollection_
double getAmpl()
Definition: TPNFit.h:31
unsigned int _lastsamplePN
std::string eventHeaderProducer_
static int apdRefTower(int ilmmod)
Definition: MEEBGeom.cc:490
std::string eventHeaderCollection_
int iDCCId() const
get the DCCId
static int lmmod(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:90
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
JetCorrectorParameters corr
Definition: classes.h:5
std::map< unsigned int, unsigned int > channelMapEE
const_iterator end() const
T Max(T a, T b)
Definition: MathUtil.h:44
TShapeAnalysis * shapana
bool isTimingQualOK()
Definition: TAPDPulse.cc:145
T const * product() const
Definition: Handle.h:69
void setGeomEB(int etaG, int phiG, int module, int tower, int strip, int xtal, int apdRefTT, int channel, int lmr)
void setGeomEE(int etaG, int phiG, int iX, int iY, int iZ, int module, int tower, int ch, int apdRefTT, int channel, int lmr)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
const_iterator end() const
bool isPulseOK()
Definition: TAPDPulse.cc:162
Definition: colors.py:1
T get() const
Definition: EventSetup.h:73
Definition: TPNFit.h:8
static int dee(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:292
bool isMemRelevant(int)
Definition: TMem.cc:30
unsigned int nevtAB[1700]
TTree * ADCtrees[1700]
int getMaxSample()
Definition: TPNPulse.cc:70
double doFit(int, double *)
Definition: TPNFit.cc:39
T const * product() const
Definition: ESHandle.h:86
Definition: vlib.h:198
static int lmr(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:254
int channelId() const
so far for EndCap only :
const_iterator begin() const
int adc() const
get the ADC sample (12 bits)
void EcalLaserAnalyzer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 207 of file EcalLaserAnalyzer.cc.

References _alpha, _beta, _chi2cut, _firstsample, _fitab, _lastsample, _nevtmax, _noise, _nsamples, _presample, adc, ADCfile, ADCFile, ADCtrees, alphafile, alphainitfile, APDfile, channelID, color, dccID, doesABTreeExist, eta, mps_fire::i, laserEvents, Skims_PA_cff::name, nCrys, nevtAB, phi, pn0, pn1, resdir_, resfile, TShapeAnalysis::set_const(), shapana, side, ctpps_dqm_sourceclient-live_cfg::test, and towerID.

207  {
208  //========================================================================
209 
210  // Create temporary files and trees to save adc samples
211  //======================================================
212 
213  ADCfile = resdir_;
214  ADCfile += "/APDSamplesLaser.root";
215 
216  APDfile = resdir_;
217  APDfile += "/APDPNLaserAllEvents.root";
218 
219  ADCFile = new TFile(ADCfile.c_str(), "RECREATE");
220 
221  for (unsigned int i = 0; i < nCrys; i++) {
222  std::stringstream name;
223  name << "ADCTree" << i + 1;
224  ADCtrees[i] = new TTree(name.str().c_str(), name.str().c_str());
225 
226  ADCtrees[i]->Branch("ieta", &eta, "eta/I");
227  ADCtrees[i]->Branch("iphi", &phi, "phi/I");
228  ADCtrees[i]->Branch("side", &side, "side/I");
229  ADCtrees[i]->Branch("dccID", &dccID, "dccID/I");
230  ADCtrees[i]->Branch("towerID", &towerID, "towerID/I");
231  ADCtrees[i]->Branch("channelID", &channelID, "channelID/I");
232  ADCtrees[i]->Branch("event", &event, "event/I");
233  ADCtrees[i]->Branch("color", &color, "color/I");
234  ADCtrees[i]->Branch("adc", &adc, "adc[10]/D");
235  ADCtrees[i]->Branch("pn0", &pn0, "pn0/D");
236  ADCtrees[i]->Branch("pn1", &pn1, "pn1/D");
237 
238  ADCtrees[i]->SetBranchAddress("ieta", &eta);
239  ADCtrees[i]->SetBranchAddress("iphi", &phi);
240  ADCtrees[i]->SetBranchAddress("side", &side);
241  ADCtrees[i]->SetBranchAddress("dccID", &dccID);
242  ADCtrees[i]->SetBranchAddress("towerID", &towerID);
243  ADCtrees[i]->SetBranchAddress("channelID", &channelID);
244  ADCtrees[i]->SetBranchAddress("event", &event);
245  ADCtrees[i]->SetBranchAddress("color", &color);
246  ADCtrees[i]->SetBranchAddress("adc", adc);
247  ADCtrees[i]->SetBranchAddress("pn0", &pn0);
248  ADCtrees[i]->SetBranchAddress("pn1", &pn1);
249 
250  nevtAB[i] = 0;
251  }
252 
253  // Define output results filenames and shape analyzer object (alpha,beta)
254  //=====================================================================
255 
256  // 1) AlphaBeta files
257 
258  doesABTreeExist = true;
259 
260  std::stringstream nameabinitfile;
261  nameabinitfile << resdir_ << "/ABInit.root";
262  alphainitfile = nameabinitfile.str();
263 
264  std::stringstream nameabfile;
265  nameabfile << resdir_ << "/AB.root";
266  alphafile = nameabfile.str();
267 
268  FILE* test;
269  if (_fitab)
270  test = fopen(alphainitfile.c_str(), "r");
271  else
272  test = fopen(alphafile.c_str(), "r");
273  if (test == nullptr) {
274  doesABTreeExist = false;
275  _fitab = true;
276  };
277  delete test;
278 
279  TFile* fAB = nullptr;
280  TTree* ABInit = nullptr;
281  if (doesABTreeExist) {
282  fAB = new TFile(nameabinitfile.str().c_str());
283  }
284  if (doesABTreeExist && fAB) {
285  ABInit = (TTree*)fAB->Get("ABCol0");
286  }
287 
288  // 2) Shape analyzer
289 
290  if (doesABTreeExist && fAB && ABInit && ABInit->GetEntries() != 0) {
291  shapana = new TShapeAnalysis(ABInit, _alpha, _beta, 5.5, 1.0);
292  doesABTreeExist = true;
293  } else {
294  shapana = new TShapeAnalysis(_alpha, _beta, 5.5, 1.0);
295  doesABTreeExist = false;
296  _fitab = true;
297  }
299 
300  if (doesABTreeExist && fAB)
301  fAB->Close();
302 
303  // 2) APD file
304 
305  std::stringstream nameapdfile;
306  nameapdfile << resdir_ << "/APDPN_LASER.root";
307  resfile = nameapdfile.str();
308 
309  // Laser events counter
310 
311  laserEvents = 0;
312 }
unsigned int _nsamples
unsigned int _nevtmax
unsigned int _firstsample
unsigned int _presample
std::string alphainitfile
TShapeAnalysis * shapana
void set_const(int, int, int, int, int, double, double)
unsigned int _lastsample
unsigned int nevtAB[1700]
TTree * ADCtrees[1700]
Definition: event.py:1
void EcalLaserAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 727 of file EcalLaserAnalyzer.cc.

References _debug, _ecalPart, _firstsample, _fitab, _lastsample, _niter, _nsamples, _presample, _presamplecut, _qualpercent, _saveallevents, adc, ADCfile, ADCFile, adcNoPed, ADCtrees, TAPD::addEntry(), TPN::addEntry(), zMuMuMuonUserData::alpha, alphafile, alphainitfile, APD, apdAmpl, apdAmplA, apdAmplB, APDAnal, APDfile, APDFile, APDFirstAnal, APDoAPDA, APDoAPDB, APDoPN, APDoPNA, APDoPNB, APDPulse, apdRefMap, apdTime, APDtrees, zMuMuMuonUserData::beta, channelID, channelMapEE, hltPixelTracks_cff::chi2, color, colorref, TShapeAnalysis::computeShape(), gather_cfg::cout, TkAlMuonSelectors_cfi::cut, dccID, Delta01, Delta12, doesABTreeExist, PulseFitWithFunction::doFit(), event, eventref, firstChanMod, flag, flagAB, TAPDPulse::getAdcWithoutPedestal(), PulseFitWithFunction::getAmpl(), TAPD::getAPD(), TAPD::getAPDoAPD0(), TAPD::getAPDoAPD1(), TAPD::getAPDoPN(), TAPD::getAPDoPN0(), TAPD::getAPDoPN1(), TMom::getMean(), TPN::getPN(), TPN::getPNoPN(), TPN::getPNoPN0(), TPN::getPNoPN1(), PulseFitWithFunction::getTime(), TAPD::getTime(), edmStreamStallGrapher::getTime(), TShapeAnalysis::getVals(), mps_fire::i, iChannelID, idccID, LEDCalibrationChannels::ieta, iEta, iModule, PulseFitWithFunction::init(), createfilelist::int, LEDCalibrationChannels::iphi, iPhi, isGainOK, iside, TAPDPulse::isPulseOK(), IsThereDataADC, isTimingOK, iTowerID, laserEvents, moduleID, Skims_PA_cff::name, nColor, nCrys, nEvtBadGain, nEvtBadTiming, nEvtTot, nMod, nPNPerMod, nRefChan, PN, pn0, pn1, PNAnal, PNFirstAnal, pnID, PNoPN, PNoPNA, PNoPNB, RefAPDtrees, resfile, resFile, respntrees, restrees, TAPD::set2DAPDoAPD0Cut(), TAPD::set2DAPDoAPD1Cut(), TShapeAnalysis::set_nch(), TShapeAnalysis::set_presample(), TAPD::setAPDCut(), TAPD::setAPDoPN0Cut(), TAPD::setAPDoPN1Cut(), TAPD::setAPDoPNCut(), TPN::setPNCut(), TAPDPulse::setPresamples(), TAPDPulse::setPulse(), TAPD::setTimeCut(), shapana, side, Time, towerID, wasGainOK, and wasTimingOK.

Referenced by o2olib.O2ORunMgr::executeJob().

727  {
728  //========================================================================
729 
730  // Adjust channel numbers for EE
731  //===============================
732 
733  if (_ecalPart == "EE") {
734  nCrys = channelMapEE.size();
736  }
737 
738  // Set presamples number
739  //======================
740 
741  double delta01 = Delta01->getMean();
742  double delta12 = Delta12->getMean();
743  if (delta12 > _presamplecut) {
744  _presample = 2;
745  if (delta01 > _presamplecut)
746  _presample = 1;
747  }
748 
751 
752  // Get alpha and beta
753  //======================
754 
755  if (_fitab) {
756  std::cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
757  std::cout << "\t+=+ Analyzing data: getting (alpha, beta) +=+" << std::endl;
758  TFile* fAB = nullptr;
759  TTree* ABInit = nullptr;
760  if (doesABTreeExist) {
761  fAB = new TFile(alphainitfile.c_str());
762  }
763  if (doesABTreeExist && fAB) {
764  ABInit = (TTree*)fAB->Get("ABCol0");
765  }
766  shapana->computeShape(alphafile, ABInit);
767  std::cout << "\t+=+ .................................... done +=+" << std::endl;
768  std::cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
769  }
770 
771  // Don't do anything if there is no events
772  //=========================================
773 
774  if (laserEvents == 0) {
775  ADCFile->Close();
776  std::stringstream del;
777  del << "rm " << ADCfile;
778  system(del.str().c_str());
779  std::cout << " No Laser Events " << std::endl;
780  return;
781  }
782 
783  // Set quality flags for gains and timing
784  //=========================================
785 
786  double BadGainEvtPercentage = 0.0;
787  double BadTimingEvtPercentage = 0.0;
788 
789  int nChanBadGain = 0;
790  int nChanBadTiming = 0;
791 
792  for (unsigned int i = 0; i < nCrys; i++) {
793  if (nEvtTot[i] != 0) {
794  BadGainEvtPercentage = double(nEvtBadGain[i]) / double(nEvtTot[i]);
795  BadTimingEvtPercentage = double(nEvtBadTiming[i]) / double(nEvtTot[i]);
796  }
797  if (BadGainEvtPercentage > _qualpercent) {
798  wasGainOK[i] = false;
799  nChanBadGain++;
800  }
801  if (BadTimingEvtPercentage > _qualpercent) {
802  wasTimingOK[i] = false;
803  nChanBadTiming++;
804  }
805  }
806 
807  double BadGainChanPercentage = double(nChanBadGain) / double(nCrys);
808  double BadTimingChanPercentage = double(nChanBadTiming) / double(nCrys);
809 
810  if (BadGainChanPercentage > _qualpercent)
811  isGainOK = false;
812  if (BadTimingChanPercentage > _qualpercent)
813  isTimingOK = false;
814 
815  // Analyze adc samples to get amplitudes
816  //=======================================
817 
818  std::cout << "\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
819  std::cout << "\t+=+ Analyzing laser data: getting APD, PN, APD/PN, PN/PN +=+" << std::endl;
820 
821  if (!isGainOK)
822  std::cout << "\t+=+ ............................ WARNING! APD GAIN WAS NOT 1 +=+" << std::endl;
823  if (!isTimingOK)
824  std::cout << "\t+=+ ............................ WARNING! TIMING WAS BAD +=+" << std::endl;
825 
826  APDFile = new TFile(APDfile.c_str(), "RECREATE");
827 
828  int ieta, iphi, channelID, towerID, flag;
829 
830  for (unsigned int i = 0; i < nCrys; i++) {
831  std::stringstream name;
832  name << "APDTree" << i + 1;
833 
834  APDtrees[i] = new TTree(name.str().c_str(), name.str().c_str());
835 
836  //List of branches
837 
838  APDtrees[i]->Branch("event", &event, "event/I");
839  APDtrees[i]->Branch("color", &color, "color/I");
840  APDtrees[i]->Branch("iphi", &iphi, "iphi/I");
841  APDtrees[i]->Branch("ieta", &ieta, "ieta/I");
842  APDtrees[i]->Branch("side", &side, "side/I");
843  APDtrees[i]->Branch("dccID", &dccID, "dccID/I");
844  APDtrees[i]->Branch("towerID", &towerID, "towerID/I");
845  APDtrees[i]->Branch("channelID", &channelID, "channelID/I");
846  APDtrees[i]->Branch("apdAmpl", &apdAmpl, "apdAmpl/D");
847  APDtrees[i]->Branch("apdTime", &apdTime, "apdTime/D");
848  if (_saveallevents)
849  APDtrees[i]->Branch("adc", &adc, "adc[10]/D");
850  APDtrees[i]->Branch("flag", &flag, "flag/I");
851  APDtrees[i]->Branch("flagAB", &flagAB, "flagAB/I");
852  APDtrees[i]->Branch("pn0", &pn0, "pn0/D");
853  APDtrees[i]->Branch("pn1", &pn1, "pn1/D");
854 
855  APDtrees[i]->SetBranchAddress("event", &event);
856  APDtrees[i]->SetBranchAddress("color", &color);
857  APDtrees[i]->SetBranchAddress("iphi", &iphi);
858  APDtrees[i]->SetBranchAddress("ieta", &ieta);
859  APDtrees[i]->SetBranchAddress("side", &side);
860  APDtrees[i]->SetBranchAddress("dccID", &dccID);
861  APDtrees[i]->SetBranchAddress("towerID", &towerID);
862  APDtrees[i]->SetBranchAddress("channelID", &channelID);
863  APDtrees[i]->SetBranchAddress("apdAmpl", &apdAmpl);
864  APDtrees[i]->SetBranchAddress("apdTime", &apdTime);
865  if (_saveallevents)
866  APDtrees[i]->SetBranchAddress("adc", adc);
867  APDtrees[i]->SetBranchAddress("flag", &flag);
868  APDtrees[i]->SetBranchAddress("flagAB", &flagAB);
869  APDtrees[i]->SetBranchAddress("pn0", &pn0);
870  APDtrees[i]->SetBranchAddress("pn1", &pn1);
871  }
872 
873  for (unsigned int iref = 0; iref < nRefChan; iref++) {
874  for (unsigned int imod = 0; imod < nMod; imod++) {
875  int jmod = modules[imod];
876 
877  std::stringstream nameref;
878  nameref << "refAPDTree" << imod << "_" << iref;
879 
880  RefAPDtrees[iref][jmod] = new TTree(nameref.str().c_str(), nameref.str().c_str());
881 
882  RefAPDtrees[iref][jmod]->Branch("eventref", &eventref, "eventref/I");
883  RefAPDtrees[iref][jmod]->Branch("colorref", &colorref, "colorref/I");
884  if (iref == 0)
885  RefAPDtrees[iref][jmod]->Branch("apdAmplA", &apdAmplA, "apdAmplA/D");
886  if (iref == 1)
887  RefAPDtrees[iref][jmod]->Branch("apdAmplB", &apdAmplB, "apdAmplB/D");
888 
889  RefAPDtrees[iref][jmod]->SetBranchAddress("eventref", &eventref);
890  RefAPDtrees[iref][jmod]->SetBranchAddress("colorref", &colorref);
891  if (iref == 0)
892  RefAPDtrees[iref][jmod]->SetBranchAddress("apdAmplA", &apdAmplA);
893  if (iref == 1)
894  RefAPDtrees[iref][jmod]->SetBranchAddress("apdAmplB", &apdAmplB);
895  }
896  }
897 
898  assert(colors.size() <= nColor);
899  unsigned int nCol = colors.size();
900 
901  // Declare PN stuff
902  //===================
903 
904  for (unsigned int iM = 0; iM < nMod; iM++) {
905  unsigned int iMod = modules[iM] - 1;
906 
907  for (unsigned int ich = 0; ich < nPNPerMod; ich++) {
908  for (unsigned int icol = 0; icol < nCol; icol++) {
909  PNFirstAnal[iMod][ich][icol] = new TPN(ich);
910  PNAnal[iMod][ich][icol] = new TPN(ich);
911  }
912  }
913  }
914 
915  // Declare function for APD ampl fit
916  //===================================
917 
919  double chi2;
920 
921  for (unsigned int iCry = 0; iCry < nCrys; iCry++) {
922  for (unsigned int icol = 0; icol < nCol; icol++) {
923  // Declare APD stuff
924  //===================
925 
926  APDFirstAnal[iCry][icol] = new TAPD();
927  IsThereDataADC[iCry][icol] = 1;
928  std::stringstream cut;
929  cut << "color==" << colors[icol];
930  if (ADCtrees[iCry]->GetEntries(cut.str().c_str()) < 10)
931  IsThereDataADC[iCry][icol] = 0;
932  }
933 
934  unsigned int iMod = iModule[iCry] - 1;
935  double alpha, beta;
936 
937  // Loop on events
938  //================
939 
940  Long64_t nbytes = 0, nb = 0;
941  for (Long64_t jentry = 0; jentry < ADCtrees[iCry]->GetEntriesFast(); jentry++) {
942  nb = ADCtrees[iCry]->GetEntry(jentry);
943  nbytes += nb;
944 
945  // Get back color
946 
947  unsigned int iCol = 0;
948  for (unsigned int i = 0; i < nCol; i++) {
949  if (color == colors[i]) {
950  iCol = i;
951  i = colors.size();
952  }
953  }
954 
955  // Retreive alpha and beta
956 
957  std::vector<double> abvals = shapana->getVals(iCry);
958  alpha = abvals[0];
959  beta = abvals[1];
960  flagAB = int(abvals[4]);
961  iphi = iPhi[iCry];
962  ieta = iEta[iCry];
963  towerID = iTowerID[iCry];
964  channelID = iChannelID[iCry];
965 
966  // Amplitude calculation
967 
970 
971  apdAmpl = 0;
972  apdAmplA = 0;
973  apdAmplB = 0;
974  apdTime = 0;
975 
976  if (APDPulse->isPulseOK()) {
977  pslsfit->init(_nsamples, _firstsample, _lastsample, _niter, alpha, beta);
978  chi2 = pslsfit->doFit(&adcNoPed[0]);
979 
980  if (chi2 < 0. || chi2 == 102 || chi2 == 101) {
981  apdAmpl = 0;
982  apdTime = 0;
983  flag = 0;
984  } else {
985  apdAmpl = pslsfit->getAmpl();
986  apdTime = pslsfit->getTime();
987  flag = 1;
988  }
989  } else {
990  apdAmpl = 0;
991  apdTime = 0;
992  flag = 0;
993  }
994 
995  if (_debug == 1)
996  std::cout << "-- debug test -- apdAmpl=" << apdAmpl << ", apdTime=" << apdTime << std::endl;
997  double pnmean;
998  if (pn0 < 10 && pn1 > 10) {
999  pnmean = pn1;
1000  } else if (pn1 < 10 && pn0 > 10) {
1001  pnmean = pn0;
1002  } else
1003  pnmean = 0.5 * (pn0 + pn1);
1004 
1005  if (_debug == 1)
1006  std::cout << "-- debug test -- pn0=" << pn0 << ", pn1=" << pn1 << std::endl;
1007 
1008  // Fill PN stuff
1009  //===============
1010 
1011  if (firstChanMod[iMod] == iCry && IsThereDataADC[iCry][iCol] == 1) {
1012  for (unsigned int ichan = 0; ichan < nPNPerMod; ichan++) {
1013  PNFirstAnal[iMod][ichan][iCol]->addEntry(pnmean, pn0, pn1);
1014  }
1015  }
1016 
1017  // Fill APD stuff
1018  //================
1019 
1020  if (APDPulse->isPulseOK()) {
1021  APDFirstAnal[iCry][iCol]->addEntry(apdAmpl, pnmean, pn0, pn1, apdTime);
1022  APDtrees[iCry]->Fill();
1023 
1024  // Fill reference trees
1025  //=====================
1026 
1027  if (apdRefMap[0][iMod + 1] == iCry || apdRefMap[1][iMod + 1] == iCry) {
1028  apdAmplA = 0.0;
1029  apdAmplB = 0.0;
1030  eventref = event;
1031  colorref = color;
1032 
1033  for (unsigned int ir = 0; ir < nRefChan; ir++) {
1034  if (apdRefMap[ir][iMod + 1] == iCry) {
1035  if (ir == 0)
1036  apdAmplA = apdAmpl;
1037  else if (ir == 1)
1038  apdAmplB = apdAmpl;
1039  RefAPDtrees[ir][iMod + 1]->Fill();
1040  }
1041  }
1042  }
1043  }
1044  }
1045  }
1046 
1047  delete pslsfit;
1048 
1049  ADCFile->Close();
1050 
1051  // Remove temporary file
1052  //=======================
1053  std::stringstream del;
1054  del << "rm " << ADCfile;
1055  system(del.str().c_str());
1056 
1057  // Create output trees
1058  //=====================
1059 
1060  resFile = new TFile(resfile.c_str(), "RECREATE");
1061 
1062  for (unsigned int iColor = 0; iColor < nCol; iColor++) {
1063  std::stringstream nametree;
1064  nametree << "APDCol" << colors[iColor];
1065  std::stringstream nametree2;
1066  nametree2 << "PNCol" << colors[iColor];
1067 
1068  restrees[iColor] = new TTree(nametree.str().c_str(), nametree.str().c_str());
1069  respntrees[iColor] = new TTree(nametree2.str().c_str(), nametree2.str().c_str());
1070 
1071  restrees[iColor]->Branch("iphi", &iphi, "iphi/I");
1072  restrees[iColor]->Branch("ieta", &ieta, "ieta/I");
1073  restrees[iColor]->Branch("side", &side, "side/I");
1074  restrees[iColor]->Branch("dccID", &dccID, "dccID/I");
1075  restrees[iColor]->Branch("moduleID", &moduleID, "moduleID/I");
1076  restrees[iColor]->Branch("towerID", &towerID, "towerID/I");
1077  restrees[iColor]->Branch("channelID", &channelID, "channelID/I");
1078  restrees[iColor]->Branch("APD", &APD, "APD[6]/D");
1079  restrees[iColor]->Branch("Time", &Time, "Time[6]/D");
1080  restrees[iColor]->Branch("APDoPN", &APDoPN, "APDoPN[6]/D");
1081  restrees[iColor]->Branch("APDoPNA", &APDoPNA, "APDoPNA[6]/D");
1082  restrees[iColor]->Branch("APDoPNB", &APDoPNB, "APDoPNB[6]/D");
1083  restrees[iColor]->Branch("APDoAPDA", &APDoAPDA, "APDoAPDA[6]/D");
1084  restrees[iColor]->Branch("APDoAPDB", &APDoAPDB, "APDoAPDB[6]/D");
1085  restrees[iColor]->Branch("flag", &flag, "flag/I");
1086 
1087  respntrees[iColor]->Branch("side", &side, "side/I");
1088  respntrees[iColor]->Branch("moduleID", &moduleID, "moduleID/I");
1089  respntrees[iColor]->Branch("pnID", &pnID, "pnID/I");
1090  respntrees[iColor]->Branch("PN", &PN, "PN[6]/D");
1091  respntrees[iColor]->Branch("PNoPN", &PNoPN, "PNoPN[6]/D");
1092  respntrees[iColor]->Branch("PNoPNA", &PNoPNA, "PNoPNA[6]/D");
1093  respntrees[iColor]->Branch("PNoPNB", &PNoPNB, "PNoPNB[6]/D");
1094 
1095  restrees[iColor]->SetBranchAddress("iphi", &iphi);
1096  restrees[iColor]->SetBranchAddress("ieta", &ieta);
1097  restrees[iColor]->SetBranchAddress("side", &side);
1098  restrees[iColor]->SetBranchAddress("dccID", &dccID);
1099  restrees[iColor]->SetBranchAddress("moduleID", &moduleID);
1100  restrees[iColor]->SetBranchAddress("towerID", &towerID);
1101  restrees[iColor]->SetBranchAddress("channelID", &channelID);
1102  restrees[iColor]->SetBranchAddress("APD", APD);
1103  restrees[iColor]->SetBranchAddress("Time", Time);
1104  restrees[iColor]->SetBranchAddress("APDoPN", APDoPN);
1105  restrees[iColor]->SetBranchAddress("APDoPNA", APDoPNA);
1106  restrees[iColor]->SetBranchAddress("APDoPNB", APDoPNB);
1107  restrees[iColor]->SetBranchAddress("APDoAPDA", APDoAPDA);
1108  restrees[iColor]->SetBranchAddress("APDoAPDB", APDoAPDB);
1109  restrees[iColor]->SetBranchAddress("flag", &flag);
1110 
1111  respntrees[iColor]->SetBranchAddress("side", &side);
1112  respntrees[iColor]->SetBranchAddress("moduleID", &moduleID);
1113  respntrees[iColor]->SetBranchAddress("pnID", &pnID);
1114  respntrees[iColor]->SetBranchAddress("PN", PN);
1115  respntrees[iColor]->SetBranchAddress("PNoPN", PNoPN);
1116  respntrees[iColor]->SetBranchAddress("PNoPNA", PNoPNA);
1117  respntrees[iColor]->SetBranchAddress("PNoPNB", PNoPNB);
1118  }
1119 
1120  // Set Cuts for PN stuff
1121  //=======================
1122 
1123  for (unsigned int iM = 0; iM < nMod; iM++) {
1124  unsigned int iMod = modules[iM] - 1;
1125 
1126  for (unsigned int ich = 0; ich < nPNPerMod; ich++) {
1127  for (unsigned int icol = 0; icol < nCol; icol++) {
1128  PNAnal[iMod][ich][icol]->setPNCut(PNFirstAnal[iMod][ich][icol]->getPN().at(0),
1129  PNFirstAnal[iMod][ich][icol]->getPN().at(1));
1130  }
1131  }
1132  }
1133 
1134  // Build ref trees indexes
1135  //========================
1136  for (unsigned int imod = 0; imod < nMod; imod++) {
1137  int jmod = modules[imod];
1138  if (RefAPDtrees[0][jmod]->GetEntries() != 0 && RefAPDtrees[1][jmod]->GetEntries() != 0) {
1139  RefAPDtrees[0][jmod]->BuildIndex("eventref");
1140  RefAPDtrees[1][jmod]->BuildIndex("eventref");
1141  }
1142  }
1143 
1144  // Final loop on crystals
1145  //=======================
1146 
1147  for (unsigned int iCry = 0; iCry < nCrys; iCry++) {
1148  unsigned int iMod = iModule[iCry] - 1;
1149 
1150  // Set cuts on APD stuff
1151  //=======================
1152 
1153  for (unsigned int iCol = 0; iCol < nCol; iCol++) {
1154  std::vector<double> lowcut;
1155  std::vector<double> highcut;
1156  double cutMin;
1157  double cutMax;
1158 
1159  cutMin = APDFirstAnal[iCry][iCol]->getAPD().at(0) - 2.0 * APDFirstAnal[iCry][iCol]->getAPD().at(1);
1160  if (cutMin < 0)
1161  cutMin = 0;
1162  cutMax = APDFirstAnal[iCry][iCol]->getAPD().at(0) + 2.0 * APDFirstAnal[iCry][iCol]->getAPD().at(1);
1163 
1164  lowcut.push_back(cutMin);
1165  highcut.push_back(cutMax);
1166 
1167  cutMin = APDFirstAnal[iCry][iCol]->getTime().at(0) - 2.0 * APDFirstAnal[iCry][iCol]->getTime().at(1);
1168  cutMax = APDFirstAnal[iCry][iCol]->getTime().at(0) + 2.0 * APDFirstAnal[iCry][iCol]->getTime().at(1);
1169  lowcut.push_back(cutMin);
1170  highcut.push_back(cutMax);
1171 
1172  APDAnal[iCry][iCol] = new TAPD();
1173  APDAnal[iCry][iCol]->setAPDCut(APDFirstAnal[iCry][iCol]->getAPD().at(0),
1174  APDFirstAnal[iCry][iCol]->getAPD().at(1));
1175  APDAnal[iCry][iCol]->setAPDoPNCut(APDFirstAnal[iCry][iCol]->getAPDoPN().at(0),
1176  APDFirstAnal[iCry][iCol]->getAPDoPN().at(1));
1177  APDAnal[iCry][iCol]->setAPDoPN0Cut(APDFirstAnal[iCry][iCol]->getAPDoPN0().at(0),
1178  APDFirstAnal[iCry][iCol]->getAPDoPN0().at(1));
1179  APDAnal[iCry][iCol]->setAPDoPN1Cut(APDFirstAnal[iCry][iCol]->getAPDoPN1().at(0),
1180  APDFirstAnal[iCry][iCol]->getAPDoPN1().at(1));
1181  APDAnal[iCry][iCol]->setTimeCut(APDFirstAnal[iCry][iCol]->getTime().at(0),
1182  APDFirstAnal[iCry][iCol]->getTime().at(1));
1183  APDAnal[iCry][iCol]->set2DAPDoAPD0Cut(lowcut, highcut);
1184  APDAnal[iCry][iCol]->set2DAPDoAPD1Cut(lowcut, highcut);
1185  }
1186 
1187  // Final loop on events
1188  //=======================
1189 
1190  Long64_t nbytes = 0, nb = 0;
1191  for (Long64_t jentry = 0; jentry < APDtrees[iCry]->GetEntriesFast(); jentry++) {
1192  nb = APDtrees[iCry]->GetEntry(jentry);
1193  nbytes += nb;
1194 
1195  double pnmean;
1196  if (pn0 < 10 && pn1 > 10) {
1197  pnmean = pn1;
1198  } else if (pn1 < 10 && pn0 > 10) {
1199  pnmean = pn0;
1200  } else
1201  pnmean = 0.5 * (pn0 + pn1);
1202 
1203  // Get back color
1204  //================
1205 
1206  unsigned int iCol = 0;
1207  for (unsigned int i = 0; i < nCol; i++) {
1208  if (color == colors[i]) {
1209  iCol = i;
1210  i = colors.size();
1211  }
1212  }
1213 
1214  // Fill PN stuff
1215  //===============
1216 
1217  if (firstChanMod[iMod] == iCry && IsThereDataADC[iCry][iCol] == 1) {
1218  for (unsigned int ichan = 0; ichan < nPNPerMod; ichan++) {
1219  PNAnal[iMod][ichan][iCol]->addEntry(pnmean, pn0, pn1);
1220  }
1221  }
1222 
1223  // Get ref amplitudes
1224  //===================
1225 
1226  if (_debug == 1)
1227  std::cout << "-- debug test -- Last Loop event:" << event << " apdAmpl:" << apdAmpl << std::endl;
1228  apdAmplA = 0.0;
1229  apdAmplB = 0.0;
1230 
1231  for (unsigned int iRef = 0; iRef < nRefChan; iRef++) {
1232  RefAPDtrees[iRef][iMod + 1]->GetEntryWithIndex(event);
1233  }
1234 
1235  if (_debug == 1)
1236  std::cout << "-- debug test -- Last Loop apdAmplA:" << apdAmplA << " apdAmplB:" << apdAmplB
1237  << ", event:" << event << ", eventref:" << eventref << std::endl;
1238 
1239  // Fill APD stuff
1240  //===============
1241 
1242  APDAnal[iCry][iCol]->addEntry(apdAmpl, pnmean, pn0, pn1, apdTime, apdAmplA, apdAmplB);
1243  }
1244 
1245  moduleID = iMod + 1;
1246 
1247  if (moduleID >= 20)
1248  moduleID -= 2; // Trick to fix endcap specificity
1249 
1250  // Get final results for APD
1251  //===========================
1252 
1253  for (unsigned int iColor = 0; iColor < nCol; iColor++) {
1254  std::vector<double> apdvec = APDAnal[iCry][iColor]->getAPD();
1255  std::vector<double> apdpnvec = APDAnal[iCry][iColor]->getAPDoPN();
1256  std::vector<double> apdpn0vec = APDAnal[iCry][iColor]->getAPDoPN0();
1257  std::vector<double> apdpn1vec = APDAnal[iCry][iColor]->getAPDoPN1();
1258  std::vector<double> timevec = APDAnal[iCry][iColor]->getTime();
1259  std::vector<double> apdapd0vec = APDAnal[iCry][iColor]->getAPDoAPD0();
1260  std::vector<double> apdapd1vec = APDAnal[iCry][iColor]->getAPDoAPD1();
1261 
1262  for (unsigned int i = 0; i < apdvec.size(); i++) {
1263  APD[i] = apdvec.at(i);
1264  APDoPN[i] = apdpnvec.at(i);
1265  APDoPNA[i] = apdpn0vec.at(i);
1266  APDoPNB[i] = apdpn1vec.at(i);
1267  APDoAPDA[i] = apdapd0vec.at(i);
1268  APDoAPDB[i] = apdapd1vec.at(i);
1269  Time[i] = timevec.at(i);
1270  }
1271 
1272  // Fill APD results trees
1273  //========================
1274 
1275  iphi = iPhi[iCry];
1276  ieta = iEta[iCry];
1277  dccID = idccID[iCry];
1278  side = iside[iCry];
1279  towerID = iTowerID[iCry];
1280  channelID = iChannelID[iCry];
1281 
1282  if (!wasGainOK[iCry] || !wasTimingOK[iCry] || IsThereDataADC[iCry][iColor] == 0) {
1283  flag = 0;
1284  } else
1285  flag = 1;
1286 
1287  restrees[iColor]->Fill();
1288  }
1289  }
1290 
1291  // Get final results for PN
1292  //==========================
1293 
1294  for (unsigned int iM = 0; iM < nMod; iM++) {
1295  unsigned int iMod = modules[iM] - 1;
1296 
1297  side = iside[firstChanMod[iMod]];
1298 
1299  for (unsigned int ch = 0; ch < nPNPerMod; ch++) {
1300  pnID = ch;
1301  moduleID = iMod + 1;
1302 
1303  if (moduleID >= 20)
1304  moduleID -= 2; // Trick to fix endcap specificity
1305 
1306  for (unsigned int iColor = 0; iColor < nCol; iColor++) {
1307  std::vector<double> pnvec = PNAnal[iMod][ch][iColor]->getPN();
1308  std::vector<double> pnopnvec = PNAnal[iMod][ch][iColor]->getPNoPN();
1309  std::vector<double> pnopn0vec = PNAnal[iMod][ch][iColor]->getPNoPN0();
1310  std::vector<double> pnopn1vec = PNAnal[iMod][ch][iColor]->getPNoPN1();
1311 
1312  for (unsigned int i = 0; i < pnvec.size(); i++) {
1313  PN[i] = pnvec.at(i);
1314  PNoPN[i] = pnopnvec.at(i);
1315  PNoPNA[i] = pnopn0vec.at(i);
1316  PNoPNB[i] = pnopn1vec.at(i);
1317  }
1318 
1319  // Fill PN results trees
1320  //========================
1321 
1322  respntrees[iColor]->Fill();
1323  }
1324  }
1325  }
1326 
1327  // Remove temporary files
1328  //========================
1329  if (!_saveallevents) {
1330  APDFile->Close();
1331  std::stringstream del2;
1332  del2 << "rm " << APDfile;
1333  system(del2.str().c_str());
1334 
1335  } else {
1336  APDFile->cd();
1337  APDtrees[0]->Write();
1338 
1339  APDFile->Close();
1340  resFile->cd();
1341  }
1342 
1343  // Save results
1344  //===============
1345 
1346  for (unsigned int i = 0; i < nCol; i++) {
1347  restrees[i]->Write();
1348  respntrees[i]->Write();
1349  }
1350 
1351  resFile->Close();
1352 
1353  std::cout << "\t+=+ .................................................. done +=+" << std::endl;
1354  std::cout << "\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
1355 }
unsigned int _nsamples
TAPD * APDAnal[1700][nColor]
Definition: TPN.h:8
void setAPDCut(double, double)
Definition: TAPD.cc:141
TPN * PNFirstAnal[22][2][nColor]
std::vector< double > getPN()
Definition: TPN.cc:90
Definition: TAPD.h:8
void addEntry(double, double, double)
Definition: TPN.cc:33
std::map< int, unsigned int > apdRefMap[2]
std::vector< double > getPNoPN1()
Definition: TPN.cc:102
bool setPulse(double *)
Definition: TAPDPulse.cc:86
void setPNCut(double, double)
Definition: TPN.cc:70
void addEntry(double, double, double, double, double, double, double)
Definition: TAPD.cc:42
void computeShape(std::string namefile, TTree *)
TPN * PNAnal[22][2][nColor]
std::vector< double > getAPDoPN0()
Definition: TAPD.cc:224
void setTimeCut(double, double)
Definition: TAPD.cc:145
TTree * RefAPDtrees[2][22]
void set2DAPDoAPD1Cut(const std::vector< double > &, const std::vector< double > &)
Definition: TAPD.cc:181
void setAPDoPN0Cut(double, double)
Definition: TAPD.cc:143
std::vector< double > getPNoPN0()
Definition: TPN.cc:98
std::vector< double > getAPDoPN1()
Definition: TAPD.cc:228
std::vector< double > getAPDoAPD0()
Definition: TAPD.cc:236
void set2DAPDoAPD0Cut(const std::vector< double > &, const std::vector< double > &)
Definition: TAPD.cc:173
TAPD * APDFirstAnal[1700][nColor]
unsigned int firstChanMod[22]
double * getAdcWithoutPedestal()
Definition: TAPDPulse.cc:237
unsigned int _firstsample
unsigned int _presample
std::vector< double > getAPDoAPD1()
Definition: TAPD.cc:241
virtual void init(int, int, int, int, double, double)
std::vector< double > getAPD()
Definition: TAPD.cc:216
std::map< unsigned int, unsigned int > channelMapEE
unsigned int iModule[1700]
std::string alphainitfile
TShapeAnalysis * shapana
TTree * restrees[nColor]
TTree * APDtrees[1700]
virtual double doFit(double *)
unsigned int nPNPerMod
int IsThereDataADC[1700][nColor]
std::vector< double > getVals(int)
unsigned int _lastsample
void setPresamples(int)
Definition: TAPDPulse.cc:251
bool isPulseOK()
Definition: TAPDPulse.cc:162
Definition: colors.py:1
void set_presample(int)
std::vector< double > getPNoPN()
Definition: TPN.cc:94
TTree * ADCtrees[1700]
alpha
zGenParticlesMatch = cms.InputTag(""),
std::vector< double > getAPDoPN()
Definition: TAPD.cc:220
TTree * respntrees[nColor]
std::vector< double > getTime()
Definition: TAPD.cc:232
double getMean()
Definition: TMom.cc:121
void setAPDoPNCut(double, double)
Definition: TAPD.cc:142
Definition: event.py:1
void setAPDoPN1Cut(double, double)
Definition: TAPD.cc:144
void EcalLaserAnalyzer::setGeomEB ( int  etaG,
int  phiG,
int  module,
int  tower,
int  strip,
int  xtal,
int  apdRefTT,
int  channel,
int  lmr 
)

Definition at line 1357 of file EcalLaserAnalyzer.cc.

References ME::apdRefChannels(), apdRefMap, channelID, KineDebug3::count(), dccID, eta, firstChanMod, iChannelID, idccID, iEta, iModule, iPhi, isFirstChanModFilled, iside, iTowerID, nRefChan, phi, MEEBGeom::side(), side, hgcalTowerProducer_cfi::tower, and towerID.

Referenced by analyze().

1358  {
1359  side = MEEBGeom::side(etaG, phiG);
1360 
1361  assert(module >= *min_element(modules.begin(), modules.end()) &&
1362  module <= *max_element(modules.begin(), modules.end()));
1363 
1364  eta = etaG;
1365  phi = phiG;
1366  channelID = 5 * (strip - 1) + xtal - 1;
1367  towerID = tower;
1368 
1369  std::vector<int> apdRefChan = ME::apdRefChannels(module, lmr);
1370  for (unsigned int iref = 0; iref < nRefChan; iref++) {
1371  if (channelID == apdRefChan[iref] && towerID == apdRefTT && apdRefMap[iref].count(module) == 0) {
1372  apdRefMap[iref][module] = channel;
1373  }
1374  }
1375 
1376  if (isFirstChanModFilled[module - 1] == 0) {
1377  firstChanMod[module - 1] = channel;
1378  isFirstChanModFilled[module - 1] = 1;
1379  }
1380 
1381  iEta[channel] = eta;
1382  iPhi[channel] = phi;
1383  iModule[channel] = module;
1384  iTowerID[channel] = towerID;
1385  iChannelID[channel] = channelID;
1386  idccID[channel] = dccID;
1387  iside[channel] = side;
1388 }
std::map< int, unsigned int > apdRefMap[2]
unsigned int firstChanMod[22]
unsigned int isFirstChanModFilled[22]
unsigned int iModule[1700]
static int side(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:105
Definition: vlib.h:198
static std::vector< int > apdRefChannels(ME::LMMid ilmmod, ME::LMRid ilmr)
Definition: ME.cc:545
void EcalLaserAnalyzer::setGeomEE ( int  etaG,
int  phiG,
int  iX,
int  iY,
int  iZ,
int  module,
int  tower,
int  ch,
int  apdRefTT,
int  channel,
int  lmr 
)

Definition at line 1390 of file EcalLaserAnalyzer.cc.

References ME::apdRefChannels(), apdRefMap, channelID, KineDebug3::count(), dccID, DEFINE_FWK_MODULE, eta, firstChanMod, iChannelID, idccID, iEta, iModule, iPhi, isFirstChanModFilled, iside, iTowerID, nRefChan, phi, MEEEGeom::side(), side, hgcalTowerProducer_cfi::tower, and towerID.

Referenced by analyze().

1391  {
1392  side = MEEEGeom::side(iX, iY, iZ);
1393 
1394  assert(module >= *min_element(modules.begin(), modules.end()) &&
1395  module <= *max_element(modules.begin(), modules.end()));
1396 
1397  eta = etaG;
1398  phi = phiG;
1399  channelID = ch;
1400  towerID = tower;
1401 
1402  std::vector<int> apdRefChan = ME::apdRefChannels(module, lmr);
1403  for (unsigned int iref = 0; iref < nRefChan; iref++) {
1404  if (channelID == apdRefChan[iref] && towerID == apdRefTT && apdRefMap[iref].count(module) == 0) {
1405  apdRefMap[iref][module] = channel;
1406  }
1407  }
1408 
1409  if (isFirstChanModFilled[module - 1] == 0) {
1410  firstChanMod[module - 1] = channel;
1411  isFirstChanModFilled[module - 1] = 1;
1412  }
1413 
1414  iEta[channel] = eta;
1415  iPhi[channel] = phi;
1416  iModule[channel] = module;
1417  iTowerID[channel] = towerID;
1418  iChannelID[channel] = channelID;
1419  idccID[channel] = dccID;
1420  iside[channel] = side;
1421 }
std::map< int, unsigned int > apdRefMap[2]
static int side(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:1155
unsigned int firstChanMod[22]
unsigned int isFirstChanModFilled[22]
unsigned int iModule[1700]
Definition: vlib.h:198
static std::vector< int > apdRefChannels(ME::LMMid ilmmod, ME::LMRid ilmr)
Definition: ME.cc:545

Member Data Documentation

double EcalLaserAnalyzer::_alpha
private

Definition at line 85 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

double EcalLaserAnalyzer::_beta
private

Definition at line 86 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

double EcalLaserAnalyzer::_chi2cut
private

Definition at line 89 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

int EcalLaserAnalyzer::_debug
private
bool EcalLaserAnalyzer::_docorpn
private

Definition at line 91 of file EcalLaserAnalyzer.h.

Referenced by analyze().

std::string EcalLaserAnalyzer::_ecalPart
private

Definition at line 90 of file EcalLaserAnalyzer.h.

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

int EcalLaserAnalyzer::_fedid
private

Definition at line 92 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

unsigned int EcalLaserAnalyzer::_firstsample
private

Definition at line 69 of file EcalLaserAnalyzer.h.

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

unsigned int EcalLaserAnalyzer::_firstsamplePN
private

Definition at line 73 of file EcalLaserAnalyzer.h.

Referenced by analyze().

bool EcalLaserAnalyzer::_fitab
private

Definition at line 84 of file EcalLaserAnalyzer.h.

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

unsigned int EcalLaserAnalyzer::_lastsample
private

Definition at line 70 of file EcalLaserAnalyzer.h.

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

unsigned int EcalLaserAnalyzer::_lastsamplePN
private

Definition at line 74 of file EcalLaserAnalyzer.h.

Referenced by analyze().

unsigned int EcalLaserAnalyzer::_nevtmax
private

Definition at line 87 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and beginJob().

unsigned int EcalLaserAnalyzer::_niter
private

Definition at line 83 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::_noise
private

Definition at line 88 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

unsigned int EcalLaserAnalyzer::_nsamples
private

Definition at line 67 of file EcalLaserAnalyzer.h.

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

unsigned int EcalLaserAnalyzer::_nsamplesPN
private

Definition at line 71 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

unsigned int EcalLaserAnalyzer::_presample
private

Definition at line 68 of file EcalLaserAnalyzer.h.

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

double EcalLaserAnalyzer::_presamplecut
private

Definition at line 82 of file EcalLaserAnalyzer.h.

Referenced by endJob().

unsigned int EcalLaserAnalyzer::_presamplePN
private

Definition at line 72 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

double EcalLaserAnalyzer::_qualpercent
private

Definition at line 94 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::_ratiomaxcutlow
private

Definition at line 81 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

double EcalLaserAnalyzer::_ratiomincuthigh
private

Definition at line 80 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

double EcalLaserAnalyzer::_ratiomincutlow
private

Definition at line 79 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

bool EcalLaserAnalyzer::_saveallevents
private

Definition at line 93 of file EcalLaserAnalyzer.h.

Referenced by endJob().

unsigned int EcalLaserAnalyzer::_timingcuthigh
private

Definition at line 76 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

unsigned int EcalLaserAnalyzer::_timingcutlow
private

Definition at line 75 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

unsigned int EcalLaserAnalyzer::_timingqualhigh
private

Definition at line 78 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

unsigned int EcalLaserAnalyzer::_timingquallow
private

Definition at line 77 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

double EcalLaserAnalyzer::adc[10]
private

Definition at line 178 of file EcalLaserAnalyzer.h.

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

std::string EcalLaserAnalyzer::ADCfile
private

Definition at line 117 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

TFile* EcalLaserAnalyzer::ADCFile
private

Definition at line 157 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

int EcalLaserAnalyzer::adcG[10]
private

Definition at line 179 of file EcalLaserAnalyzer.h.

Referenced by analyze().

double* EcalLaserAnalyzer::adcNoPed
private

Definition at line 192 of file EcalLaserAnalyzer.h.

Referenced by endJob().

TTree* EcalLaserAnalyzer::ADCtrees[1700]
private

Definition at line 158 of file EcalLaserAnalyzer.h.

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

std::string EcalLaserAnalyzer::alphafile
private

Definition at line 115 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

std::string EcalLaserAnalyzer::alphainitfile
private

Definition at line 116 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

double EcalLaserAnalyzer::APD[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::apdAmpl
private

Definition at line 183 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::apdAmplA
private

Definition at line 184 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::apdAmplB
private

Definition at line 185 of file EcalLaserAnalyzer.h.

Referenced by endJob().

TAPD* EcalLaserAnalyzer::APDAnal[1700][nColor]
private

Definition at line 201 of file EcalLaserAnalyzer.h.

Referenced by endJob().

std::string EcalLaserAnalyzer::APDfile
private

Definition at line 118 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

TFile* EcalLaserAnalyzer::APDFile
private

Definition at line 160 of file EcalLaserAnalyzer.h.

Referenced by endJob().

TAPD* EcalLaserAnalyzer::APDFirstAnal[1700][nColor]
private

Definition at line 200 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::APDoAPDA[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::APDoAPDB[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::APDoPN[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::APDoPNA[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::APDoPNB[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

TAPDPulse* EcalLaserAnalyzer::APDPulse
private

Definition at line 97 of file EcalLaserAnalyzer.h.

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

std::map<int, unsigned int> EcalLaserAnalyzer::apdRefMap[2]
private

Definition at line 171 of file EcalLaserAnalyzer.h.

Referenced by endJob(), setGeomEB(), and setGeomEE().

double EcalLaserAnalyzer::apdTime
private

Definition at line 186 of file EcalLaserAnalyzer.h.

Referenced by endJob().

TTree* EcalLaserAnalyzer::APDtrees[1700]
private

Definition at line 161 of file EcalLaserAnalyzer.h.

Referenced by endJob().

int EcalLaserAnalyzer::channelID
private

Definition at line 141 of file EcalLaserAnalyzer.h.

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

int EcalLaserAnalyzer::channelIteratorEE
private

Definition at line 208 of file EcalLaserAnalyzer.h.

Referenced by analyze().

std::map<unsigned int, unsigned int> EcalLaserAnalyzer::channelMapEE
private

Definition at line 169 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and endJob().

int EcalLaserAnalyzer::color
private
int EcalLaserAnalyzer::colorref
private

Definition at line 190 of file EcalLaserAnalyzer.h.

Referenced by endJob().

std::vector<int> EcalLaserAnalyzer::colors
private

Definition at line 168 of file EcalLaserAnalyzer.h.

int EcalLaserAnalyzer::dccID
private

Definition at line 143 of file EcalLaserAnalyzer.h.

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

TMom* EcalLaserAnalyzer::Delta01
private

Definition at line 100 of file EcalLaserAnalyzer.h.

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

TMom* EcalLaserAnalyzer::Delta12
private

Definition at line 101 of file EcalLaserAnalyzer.h.

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

std::string EcalLaserAnalyzer::digiCollection_
private

Definition at line 107 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

std::string EcalLaserAnalyzer::digiPNCollection_
private

Definition at line 108 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

std::string EcalLaserAnalyzer::digiProducer_
private

Definition at line 109 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

bool EcalLaserAnalyzer::doesABTreeExist
private

Definition at line 103 of file EcalLaserAnalyzer.h.

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

int EcalLaserAnalyzer::eta
private
int EcalLaserAnalyzer::event
private
std::string EcalLaserAnalyzer::eventHeaderCollection_
private

Definition at line 110 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

std::string EcalLaserAnalyzer::eventHeaderProducer_
private

Definition at line 111 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

int EcalLaserAnalyzer::eventref
private

Definition at line 189 of file EcalLaserAnalyzer.h.

Referenced by endJob().

int EcalLaserAnalyzer::fedID
private

Definition at line 142 of file EcalLaserAnalyzer.h.

Referenced by analyze().

unsigned int EcalLaserAnalyzer::firstChanMod[22]
private

Definition at line 219 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

int EcalLaserAnalyzer::flag
private

Definition at line 207 of file EcalLaserAnalyzer.h.

Referenced by endJob().

int EcalLaserAnalyzer::flagAB
private

Definition at line 207 of file EcalLaserAnalyzer.h.

Referenced by endJob().

int EcalLaserAnalyzer::iChannelID[1700]
private

Definition at line 218 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

int EcalLaserAnalyzer::idccID[1700]
private

Definition at line 218 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

int EcalLaserAnalyzer::iEta[1700]
private

Definition at line 216 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

int EcalLaserAnalyzer::iEvent
private

Definition at line 63 of file EcalLaserAnalyzer.h.

Referenced by analyze().

unsigned int EcalLaserAnalyzer::iModule[1700]
private

Definition at line 217 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

int EcalLaserAnalyzer::iPhi[1700]
private

Definition at line 216 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

unsigned int EcalLaserAnalyzer::isFirstChanModFilled[22]
private

Definition at line 220 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), setGeomEB(), and setGeomEE().

bool EcalLaserAnalyzer::isGainOK
private

Definition at line 232 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().

int EcalLaserAnalyzer::iside[1700]
private

Definition at line 218 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

int EcalLaserAnalyzer::IsThereDataADC[1700][nColor]
private

Definition at line 203 of file EcalLaserAnalyzer.h.

Referenced by endJob().

bool EcalLaserAnalyzer::isTimingOK
private

Definition at line 233 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().

int EcalLaserAnalyzer::iTowerID[1700]
private

Definition at line 218 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

int EcalLaserAnalyzer::iZ
private

Definition at line 146 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

int EcalLaserAnalyzer::laserEvents
private

Definition at line 149 of file EcalLaserAnalyzer.h.

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

int EcalLaserAnalyzer::lightside
private

Definition at line 145 of file EcalLaserAnalyzer.h.

Referenced by analyze().

TMem* EcalLaserAnalyzer::Mem
private

Definition at line 99 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

int EcalLaserAnalyzer::moduleID
private

Definition at line 207 of file EcalLaserAnalyzer.h.

Referenced by endJob().

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

Definition at line 170 of file EcalLaserAnalyzer.h.

unsigned int EcalLaserAnalyzer::nCrys
private

Definition at line 126 of file EcalLaserAnalyzer.h.

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

unsigned int EcalLaserAnalyzer::nevtAB[1700]
private

Definition at line 122 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and beginJob().

int EcalLaserAnalyzer::nEvtBadGain[1700]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and endJob().

int EcalLaserAnalyzer::nEvtBadTiming[1700]
private

Definition at line 225 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and endJob().

int EcalLaserAnalyzer::nEvtTot[1700]
private

Definition at line 226 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and endJob().

unsigned int EcalLaserAnalyzer::nMod
private

Definition at line 130 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().

unsigned int EcalLaserAnalyzer::nPNPerMod
private

Definition at line 127 of file EcalLaserAnalyzer.h.

Referenced by endJob().

unsigned int EcalLaserAnalyzer::nRefChan
private

Definition at line 128 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), endJob(), setGeomEB(), and setGeomEE().

unsigned int EcalLaserAnalyzer::nRefTrees
private

Definition at line 129 of file EcalLaserAnalyzer.h.

unsigned int EcalLaserAnalyzer::nSides
private

Definition at line 131 of file EcalLaserAnalyzer.h.

int EcalLaserAnalyzer::phi
private
double EcalLaserAnalyzer::pn[50]
private

Definition at line 181 of file EcalLaserAnalyzer.h.

Referenced by analyze().

double EcalLaserAnalyzer::PN[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::pn0
private

Definition at line 180 of file EcalLaserAnalyzer.h.

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

double EcalLaserAnalyzer::pn1
private

Definition at line 180 of file EcalLaserAnalyzer.h.

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

double EcalLaserAnalyzer::pnAmpl
private

Definition at line 187 of file EcalLaserAnalyzer.h.

Referenced by analyze().

TPN* EcalLaserAnalyzer::PNAnal[22][2][nColor]
private

Definition at line 197 of file EcalLaserAnalyzer.h.

Referenced by endJob().

std::string EcalLaserAnalyzer::pncorfile_
private

Definition at line 106 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

TPNCor* EcalLaserAnalyzer::pnCorrector
private

Definition at line 153 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

TPN* EcalLaserAnalyzer::PNFirstAnal[22][2][nColor]
private

Definition at line 196 of file EcalLaserAnalyzer.h.

Referenced by endJob().

int EcalLaserAnalyzer::pnG[50]
private

Definition at line 182 of file EcalLaserAnalyzer.h.

Referenced by analyze().

int EcalLaserAnalyzer::pnID
private

Definition at line 207 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double* EcalLaserAnalyzer::pnNoPed
private

Definition at line 193 of file EcalLaserAnalyzer.h.

Referenced by analyze().

double EcalLaserAnalyzer::PNoPN[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::PNoPNA[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

double EcalLaserAnalyzer::PNoPNB[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

TPNPulse* EcalLaserAnalyzer::PNPulse
private

Definition at line 98 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

TTree* EcalLaserAnalyzer::RefAPDtrees[2][22]
private

Definition at line 162 of file EcalLaserAnalyzer.h.

Referenced by endJob().

std::string EcalLaserAnalyzer::resdir_
private

Definition at line 105 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and EcalLaserAnalyzer().

std::string EcalLaserAnalyzer::resfile
private

Definition at line 119 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

TFile* EcalLaserAnalyzer::resFile
private

Definition at line 164 of file EcalLaserAnalyzer.h.

Referenced by endJob().

TTree* EcalLaserAnalyzer::respntrees[nColor]
private

Definition at line 166 of file EcalLaserAnalyzer.h.

Referenced by endJob().

TTree* EcalLaserAnalyzer::restrees[nColor]
private

Definition at line 165 of file EcalLaserAnalyzer.h.

Referenced by endJob().

int EcalLaserAnalyzer::runNum
private

Definition at line 136 of file EcalLaserAnalyzer.h.

Referenced by analyze().

int EcalLaserAnalyzer::runType
private

Definition at line 135 of file EcalLaserAnalyzer.h.

Referenced by analyze().

TShapeAnalysis* EcalLaserAnalyzer::shapana
private

Definition at line 121 of file EcalLaserAnalyzer.h.

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

int EcalLaserAnalyzer::side
private

Definition at line 144 of file EcalLaserAnalyzer.h.

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

double EcalLaserAnalyzer::Time[6]
private

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

int EcalLaserAnalyzer::towerID
private

Definition at line 140 of file EcalLaserAnalyzer.h.

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

bool EcalLaserAnalyzer::wasABCalcOK[1700]
private

Definition at line 230 of file EcalLaserAnalyzer.h.

bool EcalLaserAnalyzer::wasGainOK[1700]
private

Definition at line 228 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().

bool EcalLaserAnalyzer::wasTimingOK[1700]
private

Definition at line 229 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().