53 for (
int i = 0;
i < 18;
i++) {
100 for (
int i = 0;
i < 18;
i++) {
143 std::stringstream LedN, LN;
156 for (
int i = 0;
i < 18;
i++) {
158 meShapeMapL1_[
i] =
dqmStore_->
bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096.,
"s");
164 name =
"EELDT amplitude " +
Numbers::sEE(i+1) +
" " + LN.str();
165 meAmplMapL1_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12.,
"s");
171 name =
"EELDT timing " +
Numbers::sEE(i+1) +
" " + LN.str();
172 meTimeMapL1_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 250, 0., 10.,
"s");
178 name =
"EELDT amplitude over PN " +
Numbers::sEE(i+1) +
" " + LN.str();
179 meAmplPNMapL1_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12.,
"s");
189 for (
int i = 0;
i < 18;
i++) {
190 name =
"EELDT PNs amplitude " +
Numbers::sEE(
i+1) +
" G01 " + LN.str();
196 name =
"EELDT PNs pedestal " +
Numbers::sEE(i+1) +
" G01 " + LN.str();
205 for (
int i = 0;
i < 18;
i++) {
206 name =
"EELDT PNs amplitude " +
Numbers::sEE(
i+1) +
" G16 " + LN.str();
212 name =
"EELDT PNs pedestal " +
Numbers::sEE(i+1) +
" G16 " + LN.str();
229 for (
int i = 0;
i < 18;
i++) {
231 meShapeMapL2_[
i] =
dqmStore_->
bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096.,
"s");
237 name =
"EELDT amplitude " +
Numbers::sEE(i+1) +
" " + LN.str();
238 meAmplMapL2_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12.,
"s");
244 name =
"EELDT timing " +
Numbers::sEE(i+1) +
" " + LN.str();
245 meTimeMapL2_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 250, 0., 10.,
"s");
251 name =
"EELDT amplitude over PN " +
Numbers::sEE(i+1) +
" " + LN.str();
252 meAmplPNMapL2_[
i] =
dqmStore_->
bookProfile2D(name, name, 50,
Numbers::ix0EE(i+1)+0.,
Numbers::ix0EE(i+1)+50., 50,
Numbers::iy0EE(i+1)+0.,
Numbers::iy0EE(i+1)+50., 4096, 0., 4096.*12.,
"s");
262 for (
int i = 0;
i < 18;
i++) {
263 name =
"EELDT PNs amplitude " +
Numbers::sEE(
i+1) +
" G01 " + LN.str();
269 name =
"EELDT PNs pedestal " +
Numbers::sEE(i+1) +
" G01 " + LN.str();
278 for (
int i = 0;
i < 18;
i++) {
279 name =
"EELDT PNs amplitude " +
Numbers::sEE(
i+1) +
" G16 " + LN.str();
285 name =
"EELDT PNs pedestal " +
Numbers::sEE(i+1) +
" G16 " + LN.str();
300 if ( !
init_ )
return;
308 for (
int i = 0;
i < 18;
i++) {
324 for (
int i = 0;
i < 18;
i++) {
342 for (
int i = 0;
i < 18;
i++) {
350 for (
int i = 0;
i < 18;
i++) {
364 for (
int i = 0;
i < 18;
i++) {
372 for (
int i = 0;
i < 18;
i++) {
399 for (
int i=0;
i<18;
i++) runType[
i] = -1;
401 for (
int i=0;
i<18;
i++) rtHalf[
i] = -1;
403 for (
int i=0;
i<18;
i++) waveLength[
i] = -1;
415 runType[ism-1] = dcchItr->getRunType();
416 rtHalf[ism-1] = dcchItr->getRtHalf();
417 waveLength[ism-1] = dcchItr->getEventSettings().wavelength;
430 if ( ! enable )
return;
438 for (
int i = 0;
i < 80;
i++ ) {
443 std::vector<int> PNs;
451 for(
int i(0);
i < 10;
i++)
473 for (
int i = 0;
i < 10;
i++) {
482 if(iMax >= 0 && max - min > 20.)
489 for(
int i(0);
i < 10;
i++){
490 if(maxpos[
i] > threshold){
498 int need = digis->size();
499 LogDebug(
"EELedTask") <<
"event " <<
ievt_ <<
" digi collection size " << need;
520 for (
int i = 0;
i < 10;
i++) {
528 if ( waveLength[ism-1] == 0 ) meShapeMap =
meShapeMapL1_[ism-1];
529 if ( waveLength[ism-1] == 2 ) meShapeMap =
meShapeMapL2_[ism-1];
537 float xval = float(adc);
539 if ( meShapeMap ) meShapeMap->
Fill(ic - 0.5,
i + 0.5, xval);
545 for (
unsigned int i=0;
i<PNs.size();
i++) {
547 if ( ipn >= 0 && ipn < 80 ) numPN[ipn] =
true;
562 int nep = pns->size();
563 LogDebug(
"EELedTask") <<
"event " <<
ievt_ <<
" pns collection size " << nep;
571 int num = pnItr->id().iPnId();
578 if ( ipn >= 0 && ipn < 80 && numPN[ipn] ==
false )
continue;
582 for (
int i = 0;
i < 4;
i++) {
584 int adc = pnItr->sample(
i).adc();
588 if ( pnItr->sample(
i).gainId() == 0 ) {
592 if ( pnItr->sample(
i).gainId() == 1 ) {
597 float xval = float(adc);
599 if ( mePNPed ) mePNPed->
Fill(num - 0.5, xval);
601 xvalped = xvalped + xval;
605 xvalped = xvalped / 4;
611 for (
int i = 0;
i < 50;
i++) {
613 int adc = pnItr->sample(
i).adc();
615 float xval = float(adc);
617 if ( xval >= xvalmax ) xvalmax = xval;
621 xvalmax = xvalmax - xvalped;
623 if ( pnItr->sample(0).gainId() == 0 ) {
627 if ( pnItr->sample(0).gainId() == 1 ) {
632 if ( mePN ) mePN->
Fill(num - 0.5, xvalmax);
634 if ( ipn >= 0 && ipn < 80 ) adcPN[ipn] = xvalmax;
640 edm::LogWarning(
"EELedTask") <<
"EcalPnDiodeDigiCollection not available";
648 int neh = hits->size();
649 LogDebug(
"EELedTask") <<
"event " <<
ievt_ <<
" hits collection size " << neh;
660 if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
662 float xix = ix - 0.5;
663 float xiy = iy - 0.5;
676 if(waveLength[ism - 1] == 0){
680 if(tower == 1 || tower == 2 || tower == 3 || tower == 4 || tower == 5 || tower == 6 || tower == 9 || tower == 15)
continue;
685 if(tower == 3 || tower == 4 || tower == 10 || tower == 11 || tower == 12 || tower == 18 || tower == 19 || tower == 25)
continue;
691 if ( waveLength[ism-1] == 0 ) {
696 if ( waveLength[ism-1] == 2 ) {
708 float xval = hitItr->amplitude();
709 if ( xval <= 0. ) xval = 0.0;
710 float yval = hitItr->jitter() + 6.0;
711 if ( yval <= 0. ) yval = 0.0;
712 float zval = hitItr->pedestal();
713 if ( zval <= 0. ) zval = 0.0;
715 if ( meAmplMap ) meAmplMap->
Fill(xix, xiy, xval);
718 if ( meTimeMap ) meTimeMap->
Fill(xix, xiy, yval);
725 if ( PNs.size() > 0 ) {
727 if ( ipn >= 0 && ipn < 80 ) {
728 if ( adcPN[ipn] != 0. ) wval = xval / adcPN[ipn];
732 if ( meAmplPNMap ) meAmplPNMap->
Fill(xix, xiy, wval);
738 edm::LogWarning(
"EELedTask") <<
"EcalUncalibratedRecHitCollection not available";
int adc(sample_type sample)
get the ADC sample (12 bits)
Some "id" conversions.
T getParameter(std::string const &) const
edm::EDGetTokenT< EcalUncalibratedRecHitCollection > EcalUncalibratedRecHitCollection_
T getUntrackedParameter(std::string const &, T const &) const
static std::string sEE(const unsigned ism)
static int ipnEE(const int ism, const int ipnid)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * mePnPedMapG01L2_[18]
static unsigned icEE(const unsigned ism, const unsigned ix, const unsigned iy)
void rmdir(const std::string &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Some "id" conversions.
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
EcalMGPASample sample(int i) const
MonitorElement * meAmplPNMapL2_[18]
MonitorElement * mePnAmplMapG01L2_[18]
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
int towerId() const
get the tower id
MonitorElement * meAmplPNMapL1_[18]
static int ix0EE(const unsigned ism)
static const EcalElectronicsMapping * getElectronicsMapping()
edm::EDGetTokenT< EEDigiCollection > EEDigiCollection_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void beginJob(void)
BeginJob.
static int iy0EE(const unsigned ism)
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
void tag(MonitorElement *me, unsigned int myTag)
MonitorElement * mePnPedMapG01L1_[18]
MonitorElement * meTimeMapL1_[18]
edm::EDGetTokenT< EcalPnDiodeDigiCollection > EcalPnDiodeDigiCollection_
const T & max(const T &a, const T &b)
std::vector< int > ledWavelengths_
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void removeElement(const std::string &name)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
MonitorElement * meAmplMapL1_[18]
MonitorElement * meShapeMapL1_[18]
MonitorElement * mePnAmplMapG16L1_[18]
void cleanup(void)
Cleanup.
MonitorElement * meTimeMapL2_[18]
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
MonitorElement * meShapeMapL2_[18]
MonitorElement * mePnPedMapG16L2_[18]
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
MonitorElement * meAmplMapL2_[18]
MonitorElement * mePnAmplMapG01L1_[18]
static void getPNs(const int ism, const int ix, const int iy, std::vector< int > &PNsInLM)
static unsigned RtHalf(const EBDetId &id)
static EcalSubdetector subDet(const EBDetId &id)
EELedTask(const edm::ParameterSet &ps)
Constructor.
int ism(int ieta, int iphi)
virtual ~EELedTask()
Destructor.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
int adc() const
get the ADC sample (12 bits)
MonitorElement * mePnPedMapG16L1_[18]
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
MonitorElement * mePnAmplMapG16L2_[18]