37 for (
int i = 0;
i < 10;
i++) {
62 sprintf(
histo,
"EcalDigiTask Barrel occupancy");
65 sprintf(
histo,
"EcalDigiTask Barrel digis multiplicity");
68 sprintf(
histo,
"EcalDigiTask Barrel global pulse shape");
71 for (
int i = 0;
i < 10;
i++) {
72 sprintf(
histo,
"EcalDigiTask Barrel analog pulse %02d",
i + 1);
75 sprintf(
histo,
"EcalDigiTask Barrel ADC pulse %02d Gain 0 - Saturated",
i + 1);
78 sprintf(
histo,
"EcalDigiTask Barrel ADC pulse %02d Gain 1",
i + 1);
81 sprintf(
histo,
"EcalDigiTask Barrel ADC pulse %02d Gain 6",
i + 1);
84 sprintf(
histo,
"EcalDigiTask Barrel ADC pulse %02d Gain 12",
i + 1);
87 sprintf(
histo,
"EcalDigiTask Barrel gain pulse %02d",
i + 1);
91 sprintf(
histo,
"EcalDigiTask Barrel pedestal for pre-sample");
94 sprintf(
histo,
"EcalDigiTask Barrel maximum position gt 100 ADC");
97 sprintf(
histo,
"EcalDigiTask Barrel maximum position gt 10 ADC");
100 sprintf(
histo,
"EcalDigiTask Barrel ADC counts after gain switch");
123 std::vector<double> ebAnalogSignal;
124 std::vector<double> ebADCCounts;
125 std::vector<double> ebADCGains;
132 for (
unsigned int digis = 0; digis < EcalDigiEB->
size(); ++digis) {
134 int nrSamples = ebdf.
size();
144 double pedestalPreSample = 0.;
145 double pedestalPreSampleAnalog = 0.;
146 int countsAfterGainSwitch = -1;
147 double higherGain = 1.;
148 int higherGainSample = 0;
151 ebAnalogSignal[
sample] = 0.;
159 ebADCCounts[
sample] = (thisSample.
adc());
163 if (Emax < ebAnalogSignal[
sample]) {
164 Emax = ebAnalogSignal[
sample];
169 pedestalPreSample += ebADCCounts[
sample];
174 (countsAfterGainSwitch < 0 && ebADCGains[
sample] == 0))) {
175 higherGain = ebADCGains[
sample];
176 higherGainSample =
sample;
177 countsAfterGainSwitch = 1;
180 if ((higherGain > 1 && (higherGainSample !=
sample) && (ebADCGains[
sample] == higherGain)) ||
181 (higherGain == 3 && (higherGainSample !=
sample) && (ebADCGains[
sample] == 0)) ||
182 (higherGain == 0 && (higherGainSample !=
sample) &&
183 ((ebADCGains[
sample] == 3) || (ebADCGains[
sample] == 0)))) {
184 countsAfterGainSwitch++;
188 pedestalPreSample /= 3.;
189 pedestalPreSampleAnalog /= 3.;
191 LogDebug(
"DigiInfo") <<
"Barrel Digi for EBDetId = " << ebid.
rawId() <<
" eta,phi " << ebid.
ieta() <<
" " 193 for (
int i = 0;
i < 10;
i++) {
194 LogDebug(
"DigiInfo") <<
"sample " <<
i <<
" ADC = " << ebADCCounts[
i] <<
" gain = " << ebADCGains[
i]
195 <<
" Analog = " << ebAnalogSignal[
i];
197 LogDebug(
"DigiInfo") <<
"Maximum energy = " << Emax <<
" in sample " <<
Pmax 198 <<
" Pedestal from pre-sample = " << pedestalPreSampleAnalog;
199 if (countsAfterGainSwitch > 0)
200 LogDebug(
"DigiInfo") <<
"Counts after switch " << countsAfterGainSwitch;
202 if (countsAfterGainSwitch > 0 && countsAfterGainSwitch < 5) {
203 edm::LogWarning(
"DigiWarning") <<
"Wrong number of counts after gain switch before next switch! " 204 << countsAfterGainSwitch;
205 for (
int i = 0;
i < 10;
i++) {
206 edm::LogWarning(
"DigiWarning") <<
"sample " <<
i <<
" ADC = " << ebADCCounts[
i] <<
" gain = " << ebADCGains[
i]
207 <<
" Analog = " << ebAnalogSignal[
i];
211 for (
int i = 0;
i < 10;
i++) {
218 if (ebADCGains[
i] == 0) {
221 }
else if (ebADCGains[
i] == 3) {
224 }
else if (ebADCGains[
i] == 2) {
227 }
else if (ebADCGains[
i] == 1) {
262 LogDebug(
"EcalDigi") <<
" Gains conversions: " 269 delete defaultRatios;
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
std::map< int, double, std::less< int > > gainConv_
MonitorElement * meEBDigiADCgS_[10]
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * meEBnADCafterSwitch_
int iphi() const
get the crystal iphi
~EcalBarrelDigisValidation() override
Destructor.
MonitorElement * meEBMaximumgt100ADC_
T const * product() const
MonitorElement * meEBDigiADCAnalog_[10]
MonitorElement * meEBDigiMultiplicity_
MonitorElement * meEBDigiGain_[10]
int ieta() const
get the crystal ieta
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * meEBDigiADCg6_[10]
T getUntrackedParameter(std::string const &, T const &) const
void checkCalibrations(edm::EventSetup const &c)
void analyze(edm::Event const &e, edm::EventSetup const &c) override
Analyze.
edm::EDGetTokenT< EBDigiCollection > EBdigiCollection_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
EcalBarrelDigisValidation(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meEBDigiOccupancy_
MonitorElement * meEBDigiADCg1_[10]
Namespace of DDCMS conversion namespace.
void reserve(size_t isize)
float gain12Over6() const
MonitorElement * meEBPedestal_
constexpr uint32_t rawId() const
get the raw id
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * meEBDigiADCGlobal_
MonitorElement * meEBDigiADCg12_[10]
MonitorElement * meEBMaximumgt10ADC_
int adc() const
get the ADC sample (12 bits)
static constexpr int MAXSAMPLES
Log< level::Warning, false > LogWarning
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > pAgc
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
int gainId() const
get the gainId (2 bits)