49 for (
int i = 0;
i < 36;
i++) {
123 for (
int i = 0;
i < 36;
i++) {
197 std::stringstream LaserN, LN;
205 LaserN <<
"Laser" << 1;
210 for (
int i = 0;
i < 36;
i++) {
212 meShapeMapL1_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
217 name =
"EBLT amplitude " +
Numbers::sEB(i+1) +
" " + LN.str();
218 meAmplMapL1_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
222 name =
"EBLT timing " +
Numbers::sEB(i+1) +
" " + LN.str();
223 meTimeMapL1_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 250, 0., 10.,
"s");
227 name =
"EBLT amplitude over PN " +
Numbers::sEB(i+1) +
" " + LN.str();
228 meAmplPNMapL1_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
234 name =
"EBLT amplitude map " + LN.str();
242 for (
int i = 0;
i < 36;
i++) {
243 name =
"EBLT PNs amplitude " +
Numbers::sEB(
i+1) +
" G01 " + LN.str();
249 name =
"EBLT PNs pedestal " +
Numbers::sEB(i+1) +
" G01 " + LN.str();
257 for (
int i = 0;
i < 36;
i++) {
258 name =
"EBLT PNs amplitude " +
Numbers::sEB(
i+1) +
" G16 " + LN.str(),
264 name =
"EBLT PNs pedestal " +
Numbers::sEB(i+1) +
" G16 " + LN.str();
277 LaserN <<
"Laser" << 2;
282 for (
int i = 0;
i < 36;
i++) {
284 meShapeMapL2_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
289 name =
"EBLT amplitude " +
Numbers::sEB(i+1) +
" " + LN.str();
290 meAmplMapL2_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
294 name =
"EBLT timing " +
Numbers::sEB(i+1) +
" " + LN.str();
295 meTimeMapL2_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 250, 0., 10.,
"s");
299 name =
"EBLT amplitude over PN " +
Numbers::sEB(i+1) +
" " + LN.str();
300 meAmplPNMapL2_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
306 name =
"EBLT amplitude map " + LN.str();
314 for (
int i = 0;
i < 36;
i++) {
315 name =
"EBLT PNs amplitude " +
Numbers::sEB(
i+1) +
" G01 " + LN.str();
321 name =
"EBLT PNs pedestal " +
Numbers::sEB(i+1) +
" G01 " + LN.str();
329 for (
int i = 0;
i < 36;
i++) {
330 name =
"EBLT PNs amplitude " +
Numbers::sEB(
i+1) +
" G16 " + LN.str(),
336 name =
"EBLT PNs pedestal " +
Numbers::sEB(i+1) +
" G16 " + LN.str();
349 LaserN <<
"Laser" << 3;
354 for (
int i = 0;
i < 36;
i++) {
356 meShapeMapL3_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
361 name =
"EBLT amplitude " +
Numbers::sEB(i+1) +
" " + LN.str();
362 meAmplMapL3_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
366 name =
"EBLT timing " +
Numbers::sEB(i+1) +
" " + LN.str();
367 meTimeMapL3_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 250, 0., 10.,
"s");
371 name =
"EBLT amplitude over PN " +
Numbers::sEB(i+1) +
" " + LN.str();
372 meAmplPNMapL3_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
378 name =
"EBLT amplitude map " + LN.str();
386 for (
int i = 0;
i < 36;
i++) {
387 name =
"EBLT PNs amplitude " +
Numbers::sEB(
i+1) +
" G01 " + LN.str();
393 name =
"EBLT PNs pedestal " +
Numbers::sEB(i+1) +
" G01 " + LN.str();
401 for (
int i = 0;
i < 36;
i++) {
402 name =
"EBLT PNs amplitude " +
Numbers::sEB(
i+1) +
" G16 " + LN.str(),
408 name =
"EBLT PNs pedestal " +
Numbers::sEB(i+1) +
" G16 " + LN.str();
420 LaserN <<
"Laser" << 4;
425 for (
int i = 0;
i < 36;
i++) {
427 meShapeMapL4_[
i] =
dqmStore_->
bookProfile2D(name, name, 1700, 0., 1700., 10, 0., 10., 4096, 0., 4096.,
"s");
432 name =
"EBLT amplitude " +
Numbers::sEB(i+1) +
" " + LN.str();
433 meAmplMapL4_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
437 name =
"EBLT timing " +
Numbers::sEB(i+1) +
" " + LN.str();
438 meTimeMapL4_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 250, 0., 10.,
"s");
442 name =
"EBLT amplitude over PN " +
Numbers::sEB(i+1) +
" " + LN.str();
443 meAmplPNMapL4_[
i] =
dqmStore_->
bookProfile2D(name, name, 85, 0., 85., 20, 0., 20., 4096, 0., 4096.*12.,
"s");
449 name =
"EBLT amplitude map " + LN.str();
457 for (
int i = 0;
i < 36;
i++) {
458 name =
"EBLT PNs amplitude " +
Numbers::sEB(
i+1) +
" G01 " + LN.str();
464 name =
"EBLT PNs pedestal " +
Numbers::sEB(i+1) +
" G01 " + LN.str();
472 for (
int i = 0;
i < 36;
i++) {
473 name =
"EBLT PNs amplitude " +
Numbers::sEB(
i+1) +
" G16 " + LN.str(),
479 name =
"EBLT PNs pedestal " +
Numbers::sEB(i+1) +
" G16 " + LN.str();
494 if ( !
init_ )
return;
501 for (
int i = 0;
i < 36;
i++) {
517 for (
int i = 0;
i < 36;
i++) {
533 for (
int i = 0;
i < 36;
i++) {
549 for (
int i = 0;
i < 36;
i++) {
567 for (
int i = 0;
i < 36;
i++) {
575 for (
int i = 0;
i < 36;
i++) {
587 for (
int i = 0;
i < 36;
i++) {
595 for (
int i = 0;
i < 36;
i++) {
607 for (
int i = 0;
i < 36;
i++) {
615 for (
int i = 0;
i < 36;
i++) {
627 for (
int i = 0;
i < 36;
i++) {
635 for (
int i = 0;
i < 36;
i++) {
662 for (
int i=0;
i<36;
i++) runType[
i] = -1;
664 for (
int i=0;
i<36;
i++) rtHalf[
i] = -1;
666 for (
int i=0;
i<36;
i++) waveLength[
i] = -1;
678 runType[ism-1] = dcchItr->getRunType();
679 rtHalf[ism-1] = dcchItr->getRtHalf();
680 waveLength[ism-1] = dcchItr->getEventSettings().wavelength;
689 edm::LogWarning(
"EBLaserTask") <<
"EcalRawDataCollection not available";
693 if ( ! enable )
return;
704 for(
int i(0);
i < 10;
i++)
727 for (
int i = 0;
i < 10;
i++) {
736 if(iMax >= 0 && max - min > 20.)
743 for(
int i(0);
i < 10;
i++){
744 if(maxpos[
i] > threshold){
752 int nebd = digis->size();
753 LogDebug(
"EBLaserTask") <<
"event " <<
ievt_ <<
" digi collection size " << nebd;
770 for (
int i = 0;
i < 10;
i++) {
776 if ( rtHalf[ism-1] == 0 || rtHalf[ism-1] == 1 ) {
778 if ( waveLength[ism-1] == 0 ) meShapeMap =
meShapeMapL1_[ism-1];
779 if ( waveLength[ism-1] == 1 ) meShapeMap =
meShapeMapL2_[ism-1];
780 if ( waveLength[ism-1] == 2 ) meShapeMap =
meShapeMapL3_[ism-1];
781 if ( waveLength[ism-1] == 3 ) meShapeMap =
meShapeMapL4_[ism-1];
789 float xval = float(adc);
791 if ( meShapeMap ) meShapeMap->
Fill(ic - 0.5,
i + 0.5, xval);
806 for (
int i = 0;
i < 36;
i++ ) {
815 int nep = pns->size();
816 LogDebug(
"EBLaserTask") <<
"event " <<
ievt_ <<
" pns collection size " << nep;
824 int num = pnItr->id().iPnId();
831 for (
int i = 0;
i < 4;
i++) {
833 int adc = pnItr->sample(
i).adc();
837 if ( pnItr->sample(
i).gainId() == 0 ) {
843 if ( pnItr->sample(
i).gainId() == 1 ) {
850 float xval = float(adc);
852 if ( mePNPed ) mePNPed->
Fill(num - 0.5, xval);
854 xvalped = xvalped + xval;
858 xvalped = xvalped / 4;
864 for (
int i = 0;
i < 50;
i++) {
866 int adc = pnItr->sample(
i).adc();
868 float xval = float(adc);
870 if ( xval >= xvalmax ) xvalmax = xval;
874 xvalmax = xvalmax - xvalped;
876 if ( pnItr->sample(0).gainId() == 0 ) {
882 if ( pnItr->sample(0).gainId() == 1 ) {
889 if ( mePN ) mePN->
Fill(num - 0.5, xvalmax);
891 if ( num == 1 ) adcA[ism-1] = xvalmax;
892 if ( num == 6 ) adcB[ism-1] = xvalmax;
898 edm::LogWarning(
"EBLaserTask") <<
"EcalPnDiodeDigiCollection not available";
906 int neh = hits->size();
907 LogDebug(
"EBLaserTask") <<
"event " <<
ievt_ <<
" hits collection size " << neh;
914 int ie = (ic-1)/20 + 1;
915 int ip = (ic-1)%20 + 1;
919 float xie = ie - 0.5;
920 float xip = ip - 0.5;
932 if ( rtHalf[ism-1] == 0 || rtHalf[ism-1] == 1 ) {
934 if ( waveLength[ism-1] == 0 ) {
940 if ( waveLength[ism-1] == 1 ) {
946 if ( waveLength[ism-1] == 2 ) {
952 if ( waveLength[ism-1] == 3 ) {
965 float xval = hitItr->amplitude();
966 if ( xval <= 0. ) xval = 0.0;
967 float yval = hitItr->jitter() + 5.0;
968 if ( yval <= 0. ) yval = 0.0;
969 float zval = hitItr->pedestal();
970 if ( zval <= 0. ) zval = 0.0;
972 if ( meAmplMap ) meAmplMap->
Fill(xie, xip, xval);
975 if ( meTimeMap ) meTimeMap->
Fill(xie, xip, yval);
980 if ( rtHalf[ism-1] == 0 ) {
982 if ( adcA[ism-1] != 0. ) wval = xval / adcA[ism-1];
984 }
else if ( rtHalf[ism-1] == 1 ) {
986 if ( adcB[ism-1] != 0. ) wval = xval / adcB[ism-1];
994 if ( meAmplPNMap ) meAmplPNMap->
Fill(xie, xip, wval);
996 float xjp =
id.iphi() - 0.5;
997 float xje =
id.ieta() - 0.5 *
id.zside();
999 if( meAmplSummaryMap ) meAmplSummaryMap->
Fill(xjp, xje, xval);
1005 edm::LogWarning(
"EBLaserTask") <<
"EcalUncalibratedRecHitCollection not available";
int adc(sample_type sample)
get the ADC sample (12 bits)
MonitorElement * mePnAmplMapG16L3_[36]
MonitorElement * meTimeMapL4_[36]
MonitorElement * meShapeMapL3_[36]
T getParameter(std::string const &) const
edm::EDGetTokenT< EcalUncalibratedRecHitCollection > EcalUncalibratedRecHitCollection_
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
MonitorElement * meTimeMapL2_[36]
MonitorElement * meAmplSummaryMapL4_
void cleanup(void)
Cleanup.
MonitorElement * meAmplSummaryMapL1_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * mePnPedMapG16L3_[36]
void beginJob(void)
BeginJob.
void rmdir(const std::string &fullpath)
MonitorElement * meAmplMapL2_[36]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Some "id" conversions.
static std::string sEB(const unsigned ism)
std::vector< int > laserWavelengths_
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
EcalMGPASample sample(int i) const
MonitorElement * meAmplPNMapL4_[36]
virtual ~EBLaserTask()
Destructor.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
MonitorElement * meTimeMapL1_[36]
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
MonitorElement * mePnAmplMapG01L2_[36]
EBLaserTask(const edm::ParameterSet &ps)
Constructor.
void tag(MonitorElement *me, unsigned int myTag)
MonitorElement * mePnPedMapG16L2_[36]
MonitorElement * meTimeMapL3_[36]
const T & max(const T &a, const T &b)
MonitorElement * mePnAmplMapG01L4_[36]
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
MonitorElement * meAmplMapL4_[36]
void removeElement(const std::string &name)
MonitorElement * mePnPedMapG01L3_[36]
MonitorElement * mePnAmplMapG16L2_[36]
MonitorElement * meAmplSummaryMapL2_
MonitorElement * meShapeMapL4_[36]
MonitorElement * meAmplPNMapL1_[36]
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 * mePnPedMapG01L1_[36]
MonitorElement * mePnAmplMapG16L4_[36]
int ic() const
get ECAL/crystal number inside SM
MonitorElement * meAmplPNMapL2_[36]
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
MonitorElement * meAmplMapL1_[36]
edm::EDGetTokenT< EcalRawDataCollection > EcalRawDataCollection_
MonitorElement * meShapeMapL2_[36]
MonitorElement * meShapeMapL1_[36]
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
edm::EDGetTokenT< EBDigiCollection > EBDigiCollection_
MonitorElement * mePnAmplMapG01L3_[36]
static unsigned RtHalf(const EBDetId &id)
MonitorElement * mePnAmplMapG16L1_[36]
static EcalSubdetector subDet(const EBDetId &id)
MonitorElement * mePnAmplMapG01L1_[36]
MonitorElement * mePnPedMapG01L4_[36]
MonitorElement * mePnPedMapG16L1_[36]
edm::EDGetTokenT< EcalPnDiodeDigiCollection > EcalPnDiodeDigiCollection_
int ism(int ieta, int iphi)
MonitorElement * meAmplMapL3_[36]
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)
MonitorElement * meAmplPNMapL3_[36]
MonitorElement * mePnPedMapG16L4_[36]
void setCurrentFolder(const std::string &fullpath)
MonitorElement * mePnPedMapG01L2_[36]
int adc() const
get the ADC sample (12 bits)
MonitorElement * meAmplSummaryMapL3_
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")