21 #ifdef WITH_ECAL_COND_DB
185 sprintf(histo,
"EETPT test pulse quality G01 %s",
Numbers::sEE(ism).c_str());
193 sprintf(histo,
"EETPT test pulse quality G06 %s",
Numbers::sEE(ism).c_str());
201 sprintf(histo,
"EETPT test pulse quality G12 %s",
Numbers::sEE(ism).c_str());
210 sprintf(histo,
"EETPT test pulse quality PNs G01 %s",
Numbers::sEE(ism).c_str());
217 sprintf(histo,
"EETPT test pulse quality PNs G16 %s",
Numbers::sEE(ism).c_str());
225 sprintf(histo,
"EETPT test pulse amplitude G01 %s",
Numbers::sEE(ism).c_str());
232 sprintf(histo,
"EETPT test pulse amplitude G06 %s",
Numbers::sEE(ism).c_str());
239 sprintf(histo,
"EETPT test pulse amplitude G12 %s",
Numbers::sEE(ism).c_str());
247 sprintf(histo,
"EETPT PNs pedestal rms %s G01",
Numbers::sEE(ism).c_str());
253 sprintf(histo,
"EETPT PNs pedestal rms %s G16",
Numbers::sEE(ism).c_str());
260 sprintf(histo,
"EETPT test pulse shape G01 %s",
Numbers::sEE(ism).c_str());
267 sprintf(histo,
"EETPT test pulse shape G06 %s",
Numbers::sEE(ism).c_str());
274 sprintf(histo,
"EETPT test pulse shape G12 %s",
Numbers::sEE(ism).c_str());
293 for (
int ix = 1; ix <= 50; ix++ ) {
294 for (
int iy = 1; iy <= 50; iy++ ) {
303 if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
314 for (
int i = 1;
i <= 10;
i++ ) {
320 if ( (ism >= 3 && ism <= 4) || (ism >= 7 && ism <= 9) )
continue;
321 if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) )
continue;
360 if (
i01_[ism-1] )
delete i01_[ism-1];
361 if (
i02_[ism-1] )
delete i02_[ism-1];
362 if (
i03_[ism-1] )
delete i03_[ism-1];
363 if (
i04_[ism-1] )
delete i04_[ism-1];
422 #ifdef WITH_ECAL_COND_DB
430 std::map<EcalLogicID, MonTestPulseDat> dataset1;
432 std::map<EcalLogicID, MonPulseShapeDat> dataset2;
452 for (
int ix = 1; ix <= 50; ix++ ) {
453 for (
int iy = 1; iy <= 50; iy++ ) {
458 if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
466 float num01, num02, num03;
467 float mean01, mean02, mean03;
468 float rms01, rms02, rms03;
474 if ( update01 || update02 || update03 ) {
511 std::vector<float> sample01, sample02, sample03;
518 for (
int i = 1;
i <= 10;
i++ ) {
519 sample01.push_back(
int(
me_hs01_[ism-1]->getBinContent(
i)));
522 for (
int i = 1;
i <= 10;
i++ ) { sample01.push_back(-1.); }
526 for (
int i = 1;
i <= 10;
i++ ) {
527 sample02.push_back(
int(
me_hs02_[ism-1]->getBinContent(
i)));
530 for (
int i = 1;
i <= 10;
i++ ) { sample02.push_back(-1.); }
534 for (
int i = 1;
i <= 10;
i++ ) {
535 sample03.push_back(
int(
me_hs03_[ism-1]->getBinContent(
i)));
538 for (
int i = 1;
i <= 10;
i++ ) { sample03.push_back(-1.); }
542 std::cout <<
"sample01 = " << std::flush;
543 for (
unsigned int i = 0;
i < sample01.size();
i++ ) {
544 std::cout << sample01[
i] <<
" " << std::flush;
548 std::cout <<
"sample02 = " << std::flush;
549 for (
unsigned int i = 0;
i < sample02.size();
i++ ) {
550 std::cout << sample02[
i] <<
" " << std::flush;
554 std::cout <<
"sample03 = " << std::flush;
555 for (
unsigned int i = 0;
i < sample03.size();
i++ ) {
556 std::cout << sample03[
i] <<
" " << std::flush;
571 if ( ic == -1 )
continue;
575 dataset1[ecid] =
adc;
576 if (
Numbers::icEE(ism, jx, jy) == 1 ) dataset2[ecid] = shape;
590 if ( dataset2.size() != 0 ) econn->
insertDataSet(&dataset2, moniov);
592 }
catch (std::runtime_error &
e) {
600 std::map<EcalLogicID, MonPNMGPADat> dataset3;
619 for (
int i = 1;
i <= 10;
i++ ) {
626 float num01, num02, num03, num04;
627 float mean01, mean02, mean03, mean04;
628 float rms01, rms02, rms03, rms04;
635 if ( update01 || update02 || update03 || update04 ) {
641 std::cout <<
"PNs (" <<
i <<
") G01 " << num01 <<
" " << mean01 <<
" " << rms01 <<
" " << num03 <<
" " << mean03 <<
" " << rms03 << std::endl;
642 std::cout <<
"PNs (" <<
i <<
") G16 " << num02 <<
" " << mean02 <<
" " << rms02 <<
" " << num04 <<
" " << mean04 <<
" " << rms04 << std::endl;
686 }
catch (std::runtime_error &e) {
700 if (
ievt_ % 10 == 0 ) {
733 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/Gain01/EETPT amplitude %s G01").c_str(),
Numbers::sEE(ism).c_str());
739 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/Gain06/EETPT amplitude %s G06").c_str(),
Numbers::sEE(ism).c_str());
745 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/Gain12/EETPT amplitude %s G12").c_str(),
Numbers::sEE(ism).c_str());
751 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/Gain01/EETPT shape %s G01").c_str(),
Numbers::sEE(ism).c_str());
757 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/Gain06/EETPT shape %s G06").c_str(),
Numbers::sEE(ism).c_str());
763 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/Gain12/EETPT shape %s G12").c_str(),
Numbers::sEE(ism).c_str());
769 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/PN/Gain01/EETPT PNs amplitude %s G01").c_str(),
Numbers::sEE(ism).c_str());
771 i01_[ism-1] = UtilsClient::getHisto<TProfile*>( me,
cloneME_,
i01_[ism-1] );
775 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/PN/Gain16/EETPT PNs amplitude %s G16").c_str(),
Numbers::sEE(ism).c_str());
777 i02_[ism-1] = UtilsClient::getHisto<TProfile*>( me,
cloneME_,
i02_[ism-1] );
781 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/PN/Gain01/EETPT PNs pedestal %s G01").c_str(),
Numbers::sEE(ism).c_str());
783 i03_[ism-1] = UtilsClient::getHisto<TProfile*>( me,
cloneME_,
i03_[ism-1] );
787 sprintf(histo, (
prefixME_ +
"/EETestPulseTask/PN/Gain16/EETPT PNs pedestal %s G16").c_str(),
Numbers::sEE(ism).c_str());
789 i04_[ism-1] = UtilsClient::getHisto<TProfile*>( me,
cloneME_,
i04_[ism-1] );
810 float meanAmpl01, meanAmpl02, meanAmpl03;
812 int nCry01, nCry02, nCry03;
814 meanAmpl01 = meanAmpl02 = meanAmpl03 = 0.;
816 nCry01 = nCry02 = nCry03 = 0;
818 for (
int ix = 1; ix <= 50; ix++ ) {
819 for (
int iy = 1; iy <= 50; iy++ ) {
825 float num01, num02, num03;
826 float mean01, mean02, mean03;
827 float rms01, rms02, rms03;
834 meanAmpl01 += mean01;
839 meanAmpl02 += mean02;
844 meanAmpl03 += mean03;
851 if ( nCry01 > 0 ) meanAmpl01 /= float (nCry01);
852 if ( nCry02 > 0 ) meanAmpl02 /= float (nCry02);
853 if ( nCry03 > 0 ) meanAmpl03 /= float (nCry03);
855 for (
int ix = 1; ix <= 50; ix++ ) {
856 for (
int iy = 1; iy <= 50; iy++ ) {
865 if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
873 float numEventsinCry[3] = {0., 0., 0.};
875 if (
ha01_[ism-1] ) numEventsinCry[0] =
ha01_[ism-1]->GetBinEntries(
ha01_[ism-1]->GetBin(ix, iy));
876 if (
ha02_[ism-1] ) numEventsinCry[1] =
ha02_[ism-1]->GetBinEntries(
ha02_[ism-1]->GetBin(ix, iy));
877 if (
ha03_[ism-1] ) numEventsinCry[2] =
ha03_[ism-1]->GetBinEntries(
ha03_[ism-1]->GetBin(ix, iy));
883 float num01, num02, num03;
884 float mean01, mean02, mean03;
885 float rms01, rms02, rms03;
976 for (
int i = 1;
i <= 10;
i++ ) {
982 if ( (ism >= 3 && ism <= 4) || (ism >= 7 && ism <= 9) )
continue;
983 if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) )
continue;
993 float num01, num02, num03, num04;
994 float mean01, mean02, mean03, mean04;
995 float rms01, rms02, rms03, rms04;
1005 if ( update01 && update03 ) {
1021 if ( update02 && update04 ) {
1042 for (
int i = 1;
i <= 10;
i++ ) {
1044 if (
hs01_[ism-1] ) {
1052 if (
hs02_[ism-1] ) {
1060 if (
hs03_[ism-1] ) {
int adc(sample_type sample)
get the ADC sample (12 bits)
float pedPnRMSThreshold_[2]
static void printBadChannels(const MonitorElement *me, const T *hi, bool positive_only=false)
Print the bad channels.
Cache logicID vector from database.
MonitorElement * me_hs03_[18]
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * mea03_[18]
void setPedRMSG1(float mean)
void setBinContent(int binx, double content)
set content of bin (1-D)
static bool maskChannel(int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet)
static const int TESTPULSE_LOW_GAIN_RMS_ERROR
static int getFirstNonEmptyChannel(const TProfile2D *histo)
Find the first non empty bin.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void setADCRMSG1(float rms)
static int iy0EE(const int ism)
Some "id" conversions.
MonitorElement * me_hs02_[18]
static void maskBinContent(const MonitorElement *me, const int ix, const int iy)
Mask the bin content.
static const int PEDESTAL_HIGH_GAIN_MEAN_ERROR
static std::string sEE(const int ism)
void beginJob(void)
BeginJob.
float amplitudeThreshold_
void setADCMeanG1(float mean)
float pedPnExpectedMean_[2]
MonitorElement * mea01_[18]
void setADCMeanG6(float mean)
static const int TESTPULSE_MIDDLE_GAIN_MEAN_ERROR
void setTaskStatus(bool status)
static const int PEDESTAL_LOW_GAIN_RMS_ERROR
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static int indexEE(const int ism, const int ix, const int iy)
std::vector< int > MGPAGainsPN_
static const int PEDESTAL_HIGH_GAIN_RMS_ERROR
static bool maskPn(int ism, int i1, uint32_t bits, const EcalSubdetector subdet)
MonitorElement * meg01_[18]
MonitorElement * meg05_[18]
void setSamples(std::vector< float > &samples, int gain)
void beginRun(void)
BeginRun.
static const int TESTPULSE_MIDDLE_GAIN_RMS_ERROR
void setADCMeanG12(float mean)
static int iSM(const int ism, const EcalSubdetector subdet)
void setADCMeanG16(float mean)
static int icEE(const int ism, const int ix, const int iy)
MonitorElement * meg04_[18]
void setTaskStatus(bool status)
void removeElement(const std::string &name)
float amplitudeThresholdPnG16_
static const int TESTPULSE_HIGH_GAIN_RMS_ERROR
MonitorElement * meg03_[18]
MonitorElement * mea02_[18]
void setADCRMSG12(float rms)
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
std::string getName(Reflex::Type &cc)
MonitorElement * mer04_[18]
void setEntries(double nentries)
set # of entries
MonitorElement * mer05_[18]
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
float amplitudeThresholdPnG01_
Ecal Monitor Utils for Client.
static const int PEDESTAL_LOW_GAIN_MEAN_ERROR
static const int TESTPULSE_LOW_GAIN_MEAN_ERROR
MonitorElement * me_hs01_[18]
MonitorElement * meg02_[18]
void setADCRMSG6(float rms)
void setPedMeanG16(float mean)
static bool getBinStatus(const MonitorElement *me, const int ix, const int iy)
Returns true if the bin status is red/dark red.
void setADCRMSG1(float mean)
static int ix0EE(const int ism)
void setADCMeanG1(float mean)
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
void analyze(void)
Analyze.
void cleanup(void)
Cleanup.
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
EETestPulseClient(const edm::ParameterSet &ps)
Constructor.
static const int TESTPULSE_HIGH_GAIN_MEAN_ERROR
static bool validEE(const int ism, const int ix, const int iy)
void setADCRMSG16(float mean)
static bool getBinQuality(const MonitorElement *me, const int ix, const int iy)
Returns true if the bin quality is good or masked.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
static EcalLogicID getEcalLogicID(const char *name, const int id1=EcalLogicID::NULLID, const int id2=EcalLogicID::NULLID, const int id3=EcalLogicID::NULLID)
std::vector< int > MGPAGains_
int ism(int ieta, int iphi)
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)
virtual ~EETestPulseClient()
Destructor.
static bool getBinStatistics(const T *histo, const int ix, const int iy, float &num, float &mean, float &rms)
Returns true if the bin contains good statistical data.
void setPedMeanG1(float mean)
float pedPnDiscrepancyMean_[2]
void setPedRMSG16(float mean)
void setCurrentFolder(const std::string &fullpath)
std::vector< int > superModules_