|
|
Go to the documentation of this file.
36 for (
int i = 0;
i < 10;
i++) {
61 sprintf(
histo,
"EcalDigiTask Barrel occupancy");
64 sprintf(
histo,
"EcalDigiTask Barrel digis multiplicity");
67 sprintf(
histo,
"EcalDigiTask Barrel global pulse shape");
70 for (
int i = 0;
i < 10;
i++) {
71 sprintf(
histo,
"EcalDigiTask Barrel analog pulse %02d",
i + 1);
74 sprintf(
histo,
"EcalDigiTask Barrel ADC pulse %02d Gain 0 - Saturated",
i + 1);
77 sprintf(
histo,
"EcalDigiTask Barrel ADC pulse %02d Gain 1",
i + 1);
80 sprintf(
histo,
"EcalDigiTask Barrel ADC pulse %02d Gain 6",
i + 1);
83 sprintf(
histo,
"EcalDigiTask Barrel ADC pulse %02d Gain 12",
i + 1);
86 sprintf(
histo,
"EcalDigiTask Barrel gain pulse %02d",
i + 1);
90 sprintf(
histo,
"EcalDigiTask Barrel pedestal for pre-sample");
93 sprintf(
histo,
"EcalDigiTask Barrel maximum position gt 100 ADC");
96 sprintf(
histo,
"EcalDigiTask Barrel maximum position gt 10 ADC");
99 sprintf(
histo,
"EcalDigiTask Barrel ADC counts after gain switch");
122 std::vector<double> ebAnalogSignal;
123 std::vector<double> ebADCCounts;
124 std::vector<double> ebADCGains;
131 for (
unsigned int digis = 0; digis < EcalDigiEB->
size(); ++digis) {
133 int nrSamples = ebdf.
size();
143 double pedestalPreSample = 0.;
144 double pedestalPreSampleAnalog = 0.;
145 int countsAfterGainSwitch = -1;
146 double higherGain = 1.;
147 int higherGainSample = 0;
150 ebAnalogSignal[
sample] = 0.;
158 ebADCCounts[
sample] = (thisSample.
adc());
162 if (Emax < ebAnalogSignal[
sample]) {
163 Emax = ebAnalogSignal[
sample];
168 pedestalPreSample += ebADCCounts[
sample];
173 (countsAfterGainSwitch < 0 && ebADCGains[
sample] == 0))) {
174 higherGain = ebADCGains[
sample];
175 higherGainSample =
sample;
176 countsAfterGainSwitch = 1;
179 if ((higherGain > 1 && (higherGainSample !=
sample) && (ebADCGains[
sample] == higherGain)) ||
180 (higherGain == 3 && (higherGainSample !=
sample) && (ebADCGains[
sample] == 0)) ||
181 (higherGain == 0 && (higherGainSample !=
sample) &&
182 ((ebADCGains[
sample] == 3) || (ebADCGains[
sample] == 0)))) {
183 countsAfterGainSwitch++;
187 pedestalPreSample /= 3.;
188 pedestalPreSampleAnalog /= 3.;
190 LogDebug(
"DigiInfo") <<
"Barrel Digi for EBDetId = " << ebid.
rawId() <<
" eta,phi " << ebid.
ieta() <<
" "
192 for (
int i = 0;
i < 10;
i++) {
193 LogDebug(
"DigiInfo") <<
"sample " <<
i <<
" ADC = " << ebADCCounts[
i] <<
" gain = " << ebADCGains[
i]
194 <<
" Analog = " << ebAnalogSignal[
i];
196 LogDebug(
"DigiInfo") <<
"Maximum energy = " << Emax <<
" in sample " <<
Pmax
197 <<
" Pedestal from pre-sample = " << pedestalPreSampleAnalog;
198 if (countsAfterGainSwitch > 0)
199 LogDebug(
"DigiInfo") <<
"Counts after switch " << countsAfterGainSwitch;
201 if (countsAfterGainSwitch > 0 && countsAfterGainSwitch < 5) {
202 edm::LogWarning(
"DigiWarning") <<
"Wrong number of counts after gain switch before next switch! "
203 << countsAfterGainSwitch;
204 for (
int i = 0;
i < 10;
i++) {
205 edm::LogWarning(
"DigiWarning") <<
"sample " <<
i <<
" ADC = " << ebADCCounts[
i] <<
" gain = " << ebADCGains[
i]
206 <<
" Analog = " << ebAnalogSignal[
i];
210 for (
int i = 0;
i < 10;
i++) {
217 if (ebADCGains[
i] == 0) {
220 }
else if (ebADCGains[
i] == 3) {
223 }
else if (ebADCGains[
i] == 2) {
226 }
else if (ebADCGains[
i] == 1) {
263 LogDebug(
"EcalDigi") <<
" Gains conversions: "
270 delete defaultRatios;
static constexpr int MAXSAMPLES
T const * product() const
int ieta() const
get the crystal ieta
T const * product() const
MonitorElement * meEBDigiADCg12_[10]
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meEBMaximumgt10ADC_
MonitorElement * meEBDigiMultiplicity_
virtual void setCurrentFolder(std::string const &fullpath)
T getUntrackedParameter(std::string const &, T const &) const
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * meEBDigiADCg6_[10]
void checkCalibrations(edm::EventSetup const &c)
~EcalBarrelDigisValidation() override
Destructor.
edm::EDGetTokenT< EBDigiCollection > EBdigiCollection_
int gainId() const
get the gainId (2 bits)
int adc() const
get the ADC sample (12 bits)
std::map< int, double, std::less< int > > gainConv_
MonitorElement * meEBDigiADCAnalog_[10]
MonitorElement * meEBDigiADCgS_[10]
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 * meEBnADCafterSwitch_
float gain12Over6() const
void reserve(size_t isize)
MonitorElement * meEBDigiGain_[10]
MonitorElement * meEBDigiADCGlobal_
constexpr uint32_t rawId() const
get the raw id
MonitorElement * meEBPedestal_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * meEBDigiOccupancy_
int iphi() const
get the crystal iphi
MonitorElement * meEBMaximumgt100ADC_
MonitorElement * meEBDigiADCg1_[10]
void analyze(edm::Event const &e, edm::EventSetup const &c) override
Analyze.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Namespace of DDCMS conversion namespace.