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::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

enum  VarCol { iBlue, iRed, nColor }
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase 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::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const double _alpha
 
const double _beta
 
const double _chi2cut
 
const int _debug
 
const bool _docorpn
 
const std::string _ecalPart
 
const int _fedid
 
const unsigned int _firstsample
 
const unsigned int _firstsamplePN
 
bool _fitab
 
const unsigned int _lastsample
 
const unsigned int _lastsamplePN
 
const unsigned int _nevtmax
 
const unsigned int _niter
 
const double _noise
 
const unsigned int _nsamples
 
const unsigned int _nsamplesPN
 
unsigned int _presample
 
const double _presamplecut
 
const unsigned int _presamplePN
 
const double _qualpercent
 
const double _ratiomaxcutlow
 
const double _ratiomincuthigh
 
const double _ratiomincutlow
 
const bool _saveallevents
 
const unsigned int _timingcuthigh
 
const unsigned int _timingcutlow
 
const unsigned int _timingqualhigh
 
const 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
 
const std::string digiCollection_
 
const std::string digiPNCollection_
 
const std::string digiProducer_
 
bool doesABTreeExist
 
edm::EDGetTokenT< EBDigiCollectionebDigiToken_
 
edm::EDGetTokenT< EEDigiCollectioneeDigiToken_
 
int eta
 
int event
 
const std::string eventHeaderCollection_
 
const 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
 
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdmappingToken_
 
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]
 
const std::string pncorfile_
 
TPNCorpnCorrector
 
const edm::EDGetTokenT< EcalPnDiodeDigiCollectionpnDiodeDigiToken_
 
TPNPNFirstAnal [22][2][nColor]
 
int pnG [50]
 
int pnID
 
double * pnNoPed
 
double PNoPN [6]
 
double PNoPNA [6]
 
double PNoPNB [6]
 
TPNPulsePNPulse
 
const edm::EDGetTokenT< EcalRawDataCollectionrawDataToken_
 
TTree * RefAPDtrees [2][22]
 
const 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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 54 of file EcalLaserAnalyzer.h.

Member Enumeration Documentation

◆ VarCol

Enumerator
iBlue 
iRed 
nColor 

Definition at line 67 of file EcalLaserAnalyzer.h.

Constructor & Destructor Documentation

◆ EcalLaserAnalyzer()

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

Definition at line 46 of file EcalLaserAnalyzer.cc.

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

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

◆ ~EcalLaserAnalyzer()

EcalLaserAnalyzer::~EcalLaserAnalyzer ( )
override

Definition at line 191 of file EcalLaserAnalyzer.cc.

191  {
192  //========================================================================
193 
194  // do anything here that needs to be done at destruction time
195  // (e.g. close files, deallocate resources etc.)
196 }

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 307 of file EcalLaserAnalyzer.cc.

References _debug, _docorpn, _ecalPart, _fedid, _firstsamplePN, _fitab, _lastsamplePN, _nevtmax, _nsamplesPN, adc, adcG, ADCtrees, TMom::addEntry(), APDPulse, MEEBGeom::apdRefTower(), MEEEGeom::apdRefTower(), cms::cuda::assert(), edm::SortedCollection< T, SORT >::begin(), HltBtagPostValidation_cff::c, EcalElectronicsId::channelId(), channelID, channelIteratorEE, channelMapEE, color, alignCSCRings::corr, dccID, MEEEGeom::dee(), Delta01, Delta12, hgcalPerformanceValidation::df, digiCollection_, digiPNCollection_, doesABTreeExist, TPNFit::doFit(), MillePedeFileConverter_cfg::e, CollectionTags_cfi::EBDigi, ebDigiToken_, CollectionTags_cfi::EEDigi, eeDigiToken_, MEEBGeom::electronic_channel(), edm::SortedCollection< T, SORT >::end(), eta, eventHeaderCollection_, eventHeaderProducer_, fedID, spr::find(), TPNPulse::getAdcWithoutPedestal(), TPNFit::getAmpl(), TAPDPulse::getDelta(), TPNPulse::getMaxSample(), TPNCor::getPNCorrectionFactor(), ecalpyutils::hashedIndex(), mps_fire::i, EcalPnDiodeDetId::iDCCId(), iEvent, TPNFit::init(), createfilelist::int, EcalPnDiodeDetId::iPnId(), TMem::isMemRelevant(), TAPDPulse::isPulseOK(), TAPDPulse::isTimingQualOK(), edm::HandleBase::isValid(), 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(), mappingToken_, METSkim_cff::Max, TMem::Mem(), Mem, nCrys, nevtAB, nEvtBadGain, nEvtBadTiming, nEvtTot, phi, MEEBGeom::pn(), MEEEGeom::pn(), pn, pn0, pn1, pnAmpl, pnCorrector, pnDiodeDigiToken_, pnG, pnNoPed, PNPulse, edm::Handle< T >::product(), TShapeAnalysis::putAllVals(), rawDataToken_, runNum, runType, setGeomEB(), setGeomEE(), TPNPulse::setPulse(), TAPDPulse::setPulse(), shapana, side, findQualityFiles::size, nano_mu_digi_cff::strip, EcalElectronicsId::stripId(), l1tHGCalTowerProducer_cfi::tower, EcalElectronicsId::towerId(), towerID, EcalDCCHeaderBlock::EcalDCCEventSettings::wavelength, and EcalElectronicsId::xtalId().

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

◆ beginJob()

void EcalLaserAnalyzer::beginJob ( )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 199 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.

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

◆ endJob()

void EcalLaserAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 709 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(), simBeamSpotPI::alpha, alphafile, alphainitfile, APD, apdAmpl, apdAmplA, apdAmplB, APDAnal, APDfile, APDFile, APDFirstAnal, APDoAPDA, APDoAPDB, APDoPN, APDoPNA, APDoPNB, APDPulse, apdRefMap, apdTime, APDtrees, cms::cuda::assert(), HLT_2024v14_cff::beta, channelID, channelMapEE, nano_mu_local_reco_cff::chi2, color, colorref, TShapeAnalysis::computeShape(), TkAlMuonSelectors_cfi::cut, dccID, Delta01, l1tGTMenu_lepSeeds_cff::delta12, 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, hcalRecHitTable_cff::ieta, iEta, iModule, PulseFitWithFunction::init(), createfilelist::int, hcalRecHitTable_cff::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().

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

◆ setGeomEB()

void EcalLaserAnalyzer::setGeomEB ( int  etaG,
int  phiG,
int  module,
int  tower,
int  strip,
int  xtal,
int  apdRefTT,
int  channel,
int  lmr 
)

Definition at line 1336 of file EcalLaserAnalyzer.cc.

References ME::apdRefChannels(), apdRefMap, cms::cuda::assert(), channelID, submitPVResolutionJobs::count, dccID, eta, firstChanMod, iChannelID, idccID, iEta, iModule, iPhi, isFirstChanModFilled, iside, iTowerID, callgraph::module, nRefChan, phi, MEEBGeom::side(), side, nano_mu_digi_cff::strip, l1tHGCalTowerProducer_cfi::tower, and towerID.

Referenced by analyze().

1337  {
1338  side = MEEBGeom::side(etaG, phiG);
1339 
1340  assert(module >= *min_element(modules.begin(), modules.end()) &&
1341  module <= *max_element(modules.begin(), modules.end()));
1342 
1343  eta = etaG;
1344  phi = phiG;
1345  channelID = 5 * (strip - 1) + xtal - 1;
1346  towerID = tower;
1347 
1348  std::vector<int> apdRefChan = ME::apdRefChannels(module, lmr);
1349  for (unsigned int iref = 0; iref < nRefChan; iref++) {
1350  if (channelID == apdRefChan[iref] && towerID == apdRefTT && apdRefMap[iref].count(module) == 0) {
1351  apdRefMap[iref][module] = channel;
1352  }
1353  }
1354 
1355  if (isFirstChanModFilled[module - 1] == 0) {
1356  firstChanMod[module - 1] = channel;
1357  isFirstChanModFilled[module - 1] = 1;
1358  }
1359 
1360  iEta[channel] = eta;
1361  iPhi[channel] = phi;
1362  iModule[channel] = module;
1363  iTowerID[channel] = towerID;
1364  iChannelID[channel] = channelID;
1365  idccID[channel] = dccID;
1366  iside[channel] = side;
1367 }
std::map< int, unsigned int > apdRefMap[2]
assert(be >=bs)
unsigned int firstChanMod[22]
unsigned int isFirstChanModFilled[22]
unsigned int iModule[1700]
static int side(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:105
static std::vector< int > apdRefChannels(ME::LMMid ilmmod, ME::LMRid ilmr)
Definition: ME.cc:545

◆ setGeomEE()

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 1369 of file EcalLaserAnalyzer.cc.

References ME::apdRefChannels(), apdRefMap, cms::cuda::assert(), channelID, submitPVResolutionJobs::count, dccID, eta, firstChanMod, iChannelID, idccID, iEta, iModule, iPhi, isFirstChanModFilled, iside, iTowerID, iZ, callgraph::module, nRefChan, phi, MEEEGeom::side(), side, l1tHGCalTowerProducer_cfi::tower, and towerID.

Referenced by analyze().

1370  {
1371  side = MEEEGeom::side(iX, iY, iZ);
1372 
1373  assert(module >= *min_element(modules.begin(), modules.end()) &&
1374  module <= *max_element(modules.begin(), modules.end()));
1375 
1376  eta = etaG;
1377  phi = phiG;
1378  channelID = ch;
1379  towerID = tower;
1380 
1381  std::vector<int> apdRefChan = ME::apdRefChannels(module, lmr);
1382  for (unsigned int iref = 0; iref < nRefChan; iref++) {
1383  if (channelID == apdRefChan[iref] && towerID == apdRefTT && apdRefMap[iref].count(module) == 0) {
1384  apdRefMap[iref][module] = channel;
1385  }
1386  }
1387 
1388  if (isFirstChanModFilled[module - 1] == 0) {
1389  firstChanMod[module - 1] = channel;
1390  isFirstChanModFilled[module - 1] = 1;
1391  }
1392 
1393  iEta[channel] = eta;
1394  iPhi[channel] = phi;
1395  iModule[channel] = module;
1396  iTowerID[channel] = towerID;
1397  iChannelID[channel] = channelID;
1398  idccID[channel] = dccID;
1399  iside[channel] = side;
1400 }
std::map< int, unsigned int > apdRefMap[2]
static int side(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:1155
assert(be >=bs)
unsigned int firstChanMod[22]
unsigned int isFirstChanModFilled[22]
unsigned int iModule[1700]
static std::vector< int > apdRefChannels(ME::LMMid ilmmod, ME::LMRid ilmr)
Definition: ME.cc:545

Member Data Documentation

◆ _alpha

const double EcalLaserAnalyzer::_alpha
private

Definition at line 104 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

◆ _beta

const double EcalLaserAnalyzer::_beta
private

Definition at line 105 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

◆ _chi2cut

const double EcalLaserAnalyzer::_chi2cut
private

Definition at line 108 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

◆ _debug

const int EcalLaserAnalyzer::_debug
private

◆ _docorpn

const bool EcalLaserAnalyzer::_docorpn
private

Definition at line 110 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ _ecalPart

const std::string EcalLaserAnalyzer::_ecalPart
private

Definition at line 109 of file EcalLaserAnalyzer.h.

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

◆ _fedid

const int EcalLaserAnalyzer::_fedid
private

Definition at line 111 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

◆ _firstsample

const unsigned int EcalLaserAnalyzer::_firstsample
private

Definition at line 88 of file EcalLaserAnalyzer.h.

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

◆ _firstsamplePN

const unsigned int EcalLaserAnalyzer::_firstsamplePN
private

Definition at line 92 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ _fitab

bool EcalLaserAnalyzer::_fitab
private

Definition at line 103 of file EcalLaserAnalyzer.h.

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

◆ _lastsample

const unsigned int EcalLaserAnalyzer::_lastsample
private

Definition at line 89 of file EcalLaserAnalyzer.h.

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

◆ _lastsamplePN

const unsigned int EcalLaserAnalyzer::_lastsamplePN
private

Definition at line 93 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ _nevtmax

const unsigned int EcalLaserAnalyzer::_nevtmax
private

Definition at line 106 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ _niter

const unsigned int EcalLaserAnalyzer::_niter
private

Definition at line 102 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ _noise

const double EcalLaserAnalyzer::_noise
private

Definition at line 107 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

◆ _nsamples

const unsigned int EcalLaserAnalyzer::_nsamples
private

Definition at line 86 of file EcalLaserAnalyzer.h.

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

◆ _nsamplesPN

const unsigned int EcalLaserAnalyzer::_nsamplesPN
private

Definition at line 90 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

◆ _presample

unsigned int EcalLaserAnalyzer::_presample
private

Definition at line 87 of file EcalLaserAnalyzer.h.

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

◆ _presamplecut

const double EcalLaserAnalyzer::_presamplecut
private

Definition at line 101 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ _presamplePN

const unsigned int EcalLaserAnalyzer::_presamplePN
private

Definition at line 91 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ _qualpercent

const double EcalLaserAnalyzer::_qualpercent
private

Definition at line 113 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ _ratiomaxcutlow

const double EcalLaserAnalyzer::_ratiomaxcutlow
private

Definition at line 100 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ _ratiomincuthigh

const double EcalLaserAnalyzer::_ratiomincuthigh
private

Definition at line 99 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ _ratiomincutlow

const double EcalLaserAnalyzer::_ratiomincutlow
private

Definition at line 98 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ _saveallevents

const bool EcalLaserAnalyzer::_saveallevents
private

Definition at line 112 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ _timingcuthigh

const unsigned int EcalLaserAnalyzer::_timingcuthigh
private

Definition at line 95 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ _timingcutlow

const unsigned int EcalLaserAnalyzer::_timingcutlow
private

Definition at line 94 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ _timingqualhigh

const unsigned int EcalLaserAnalyzer::_timingqualhigh
private

Definition at line 97 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ _timingquallow

const unsigned int EcalLaserAnalyzer::_timingquallow
private

Definition at line 96 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ adc

double EcalLaserAnalyzer::adc[10]
private

Definition at line 192 of file EcalLaserAnalyzer.h.

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

◆ ADCfile

std::string EcalLaserAnalyzer::ADCfile
private

Definition at line 131 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

◆ ADCFile

TFile* EcalLaserAnalyzer::ADCFile
private

Definition at line 171 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

◆ adcG

int EcalLaserAnalyzer::adcG[10]
private

Definition at line 193 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ adcNoPed

double* EcalLaserAnalyzer::adcNoPed
private

Definition at line 206 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ ADCtrees

TTree* EcalLaserAnalyzer::ADCtrees[1700]
private

Definition at line 172 of file EcalLaserAnalyzer.h.

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

◆ alphafile

std::string EcalLaserAnalyzer::alphafile
private

Definition at line 129 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

◆ alphainitfile

std::string EcalLaserAnalyzer::alphainitfile
private

Definition at line 130 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

◆ APD

double EcalLaserAnalyzer::APD[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ apdAmpl

double EcalLaserAnalyzer::apdAmpl
private

Definition at line 197 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ apdAmplA

double EcalLaserAnalyzer::apdAmplA
private

Definition at line 198 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ apdAmplB

double EcalLaserAnalyzer::apdAmplB
private

Definition at line 199 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDAnal

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

Definition at line 215 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDfile

std::string EcalLaserAnalyzer::APDfile
private

Definition at line 132 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

◆ APDFile

TFile* EcalLaserAnalyzer::APDFile
private

Definition at line 174 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDFirstAnal

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

Definition at line 214 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDoAPDA

double EcalLaserAnalyzer::APDoAPDA[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDoAPDB

double EcalLaserAnalyzer::APDoAPDB[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDoPN

double EcalLaserAnalyzer::APDoPN[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDoPNA

double EcalLaserAnalyzer::APDoPNA[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDoPNB

double EcalLaserAnalyzer::APDoPNB[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDPulse

TAPDPulse* EcalLaserAnalyzer::APDPulse
private

Definition at line 116 of file EcalLaserAnalyzer.h.

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

◆ apdRefMap

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

Definition at line 185 of file EcalLaserAnalyzer.h.

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

◆ apdTime

double EcalLaserAnalyzer::apdTime
private

Definition at line 200 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ APDtrees

TTree* EcalLaserAnalyzer::APDtrees[1700]
private

Definition at line 175 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ channelID

int EcalLaserAnalyzer::channelID
private

Definition at line 155 of file EcalLaserAnalyzer.h.

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

◆ channelIteratorEE

int EcalLaserAnalyzer::channelIteratorEE
private

Definition at line 222 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ channelMapEE

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

Definition at line 183 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and endJob().

◆ color

int EcalLaserAnalyzer::color
private

◆ colorref

int EcalLaserAnalyzer::colorref
private

Definition at line 204 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ colors

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

Definition at line 182 of file EcalLaserAnalyzer.h.

◆ dccID

int EcalLaserAnalyzer::dccID
private

Definition at line 157 of file EcalLaserAnalyzer.h.

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

◆ Delta01

TMom* EcalLaserAnalyzer::Delta01
private

Definition at line 119 of file EcalLaserAnalyzer.h.

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

◆ Delta12

TMom* EcalLaserAnalyzer::Delta12
private

Definition at line 120 of file EcalLaserAnalyzer.h.

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

◆ digiCollection_

const std::string EcalLaserAnalyzer::digiCollection_
private

Definition at line 74 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

◆ digiPNCollection_

const std::string EcalLaserAnalyzer::digiPNCollection_
private

Definition at line 76 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ digiProducer_

const std::string EcalLaserAnalyzer::digiProducer_
private

Definition at line 75 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ doesABTreeExist

bool EcalLaserAnalyzer::doesABTreeExist
private

Definition at line 122 of file EcalLaserAnalyzer.h.

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

◆ ebDigiToken_

edm::EDGetTokenT<EBDigiCollection> EcalLaserAnalyzer::ebDigiToken_
private

Definition at line 79 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

◆ eeDigiToken_

edm::EDGetTokenT<EEDigiCollection> EcalLaserAnalyzer::eeDigiToken_
private

Definition at line 80 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

◆ eta

int EcalLaserAnalyzer::eta
private

◆ event

int EcalLaserAnalyzer::event
private

◆ eventHeaderCollection_

const std::string EcalLaserAnalyzer::eventHeaderCollection_
private

Definition at line 72 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ eventHeaderProducer_

const std::string EcalLaserAnalyzer::eventHeaderProducer_
private

Definition at line 73 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ eventref

int EcalLaserAnalyzer::eventref
private

Definition at line 203 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ fedID

int EcalLaserAnalyzer::fedID
private

Definition at line 156 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ firstChanMod

unsigned int EcalLaserAnalyzer::firstChanMod[22]
private

Definition at line 233 of file EcalLaserAnalyzer.h.

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

◆ flag

int EcalLaserAnalyzer::flag
private

Definition at line 221 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ flagAB

int EcalLaserAnalyzer::flagAB
private

Definition at line 221 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ iChannelID

int EcalLaserAnalyzer::iChannelID[1700]
private

Definition at line 232 of file EcalLaserAnalyzer.h.

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

◆ idccID

int EcalLaserAnalyzer::idccID[1700]
private

Definition at line 232 of file EcalLaserAnalyzer.h.

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

◆ iEta

int EcalLaserAnalyzer::iEta[1700]
private

Definition at line 230 of file EcalLaserAnalyzer.h.

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

◆ iEvent

int EcalLaserAnalyzer::iEvent
private

Definition at line 70 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ iModule

unsigned int EcalLaserAnalyzer::iModule[1700]
private

Definition at line 231 of file EcalLaserAnalyzer.h.

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

◆ iPhi

int EcalLaserAnalyzer::iPhi[1700]
private

Definition at line 230 of file EcalLaserAnalyzer.h.

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

◆ isFirstChanModFilled

unsigned int EcalLaserAnalyzer::isFirstChanModFilled[22]
private

Definition at line 234 of file EcalLaserAnalyzer.h.

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

◆ isGainOK

bool EcalLaserAnalyzer::isGainOK
private

Definition at line 246 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().

◆ iside

int EcalLaserAnalyzer::iside[1700]
private

Definition at line 232 of file EcalLaserAnalyzer.h.

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

◆ IsThereDataADC

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

Definition at line 217 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ isTimingOK

bool EcalLaserAnalyzer::isTimingOK
private

Definition at line 247 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().

◆ iTowerID

int EcalLaserAnalyzer::iTowerID[1700]
private

Definition at line 232 of file EcalLaserAnalyzer.h.

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

◆ iZ

int EcalLaserAnalyzer::iZ
private

Definition at line 160 of file EcalLaserAnalyzer.h.

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

◆ laserEvents

int EcalLaserAnalyzer::laserEvents
private

Definition at line 163 of file EcalLaserAnalyzer.h.

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

◆ lightside

int EcalLaserAnalyzer::lightside
private

Definition at line 159 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ mappingToken_

const edm::ESGetToken<EcalElectronicsMapping, EcalMappingRcd> EcalLaserAnalyzer::mappingToken_
private

Definition at line 82 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ Mem

TMem* EcalLaserAnalyzer::Mem
private

Definition at line 118 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

◆ moduleID

int EcalLaserAnalyzer::moduleID
private

◆ modules

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

◆ nCrys

unsigned int EcalLaserAnalyzer::nCrys
private

Definition at line 140 of file EcalLaserAnalyzer.h.

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

◆ nevtAB

unsigned int EcalLaserAnalyzer::nevtAB[1700]
private

Definition at line 136 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ nEvtBadGain

int EcalLaserAnalyzer::nEvtBadGain[1700]
private

Definition at line 238 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and endJob().

◆ nEvtBadTiming

int EcalLaserAnalyzer::nEvtBadTiming[1700]
private

Definition at line 239 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and endJob().

◆ nEvtTot

int EcalLaserAnalyzer::nEvtTot[1700]
private

Definition at line 240 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and endJob().

◆ nMod

unsigned int EcalLaserAnalyzer::nMod
private

Definition at line 144 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().

◆ nPNPerMod

unsigned int EcalLaserAnalyzer::nPNPerMod
private

Definition at line 141 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ nRefChan

unsigned int EcalLaserAnalyzer::nRefChan
private

Definition at line 142 of file EcalLaserAnalyzer.h.

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

◆ nRefTrees

unsigned int EcalLaserAnalyzer::nRefTrees
private

Definition at line 143 of file EcalLaserAnalyzer.h.

◆ nSides

unsigned int EcalLaserAnalyzer::nSides
private

Definition at line 145 of file EcalLaserAnalyzer.h.

◆ phi

int EcalLaserAnalyzer::phi
private

◆ pn

double EcalLaserAnalyzer::pn[50]
private

Definition at line 195 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ PN

double EcalLaserAnalyzer::PN[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ pn0

double EcalLaserAnalyzer::pn0
private

Definition at line 194 of file EcalLaserAnalyzer.h.

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

◆ pn1

double EcalLaserAnalyzer::pn1
private

Definition at line 194 of file EcalLaserAnalyzer.h.

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

◆ pnAmpl

double EcalLaserAnalyzer::pnAmpl
private

Definition at line 201 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ PNAnal

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

Definition at line 211 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ pncorfile_

const std::string EcalLaserAnalyzer::pncorfile_
private

Definition at line 125 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer().

◆ pnCorrector

TPNCor* EcalLaserAnalyzer::pnCorrector
private

Definition at line 167 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

◆ pnDiodeDigiToken_

const edm::EDGetTokenT<EcalPnDiodeDigiCollection> EcalLaserAnalyzer::pnDiodeDigiToken_
private

Definition at line 81 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ PNFirstAnal

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

Definition at line 210 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ pnG

int EcalLaserAnalyzer::pnG[50]
private

Definition at line 196 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ pnID

int EcalLaserAnalyzer::pnID
private

Definition at line 221 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ pnNoPed

double* EcalLaserAnalyzer::pnNoPed
private

Definition at line 207 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ PNoPN

double EcalLaserAnalyzer::PNoPN[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ PNoPNA

double EcalLaserAnalyzer::PNoPNA[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ PNoPNB

double EcalLaserAnalyzer::PNoPNB[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ PNPulse

TPNPulse* EcalLaserAnalyzer::PNPulse
private

Definition at line 117 of file EcalLaserAnalyzer.h.

Referenced by analyze(), and EcalLaserAnalyzer().

◆ rawDataToken_

const edm::EDGetTokenT<EcalRawDataCollection> EcalLaserAnalyzer::rawDataToken_
private

Definition at line 78 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ RefAPDtrees

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

Definition at line 176 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ resdir_

const std::string EcalLaserAnalyzer::resdir_
private

Definition at line 124 of file EcalLaserAnalyzer.h.

Referenced by beginJob().

◆ resfile

std::string EcalLaserAnalyzer::resfile
private

Definition at line 133 of file EcalLaserAnalyzer.h.

Referenced by beginJob(), and endJob().

◆ resFile

TFile* EcalLaserAnalyzer::resFile
private

Definition at line 178 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ respntrees

TTree* EcalLaserAnalyzer::respntrees[nColor]
private

Definition at line 180 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ restrees

TTree* EcalLaserAnalyzer::restrees[nColor]
private

Definition at line 179 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ runNum

int EcalLaserAnalyzer::runNum
private

Definition at line 150 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ runType

int EcalLaserAnalyzer::runType
private

Definition at line 149 of file EcalLaserAnalyzer.h.

Referenced by analyze().

◆ shapana

TShapeAnalysis* EcalLaserAnalyzer::shapana
private

Definition at line 135 of file EcalLaserAnalyzer.h.

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

◆ side

int EcalLaserAnalyzer::side
private

Definition at line 158 of file EcalLaserAnalyzer.h.

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

◆ Time

double EcalLaserAnalyzer::Time[6]
private

Definition at line 224 of file EcalLaserAnalyzer.h.

Referenced by endJob().

◆ towerID

int EcalLaserAnalyzer::towerID
private

Definition at line 154 of file EcalLaserAnalyzer.h.

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

◆ wasABCalcOK

bool EcalLaserAnalyzer::wasABCalcOK[1700]
private

Definition at line 244 of file EcalLaserAnalyzer.h.

◆ wasGainOK

bool EcalLaserAnalyzer::wasGainOK[1700]
private

Definition at line 242 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().

◆ wasTimingOK

bool EcalLaserAnalyzer::wasTimingOK[1700]
private

Definition at line 243 of file EcalLaserAnalyzer.h.

Referenced by EcalLaserAnalyzer(), and endJob().