|
|
Go to the documentation of this file.
35 for (
int i = 0;
i < 10;
i++) {
60 sprintf(
histo,
"EcalDigiTask Endcap occupancy z+");
63 sprintf(
histo,
"EcalDigiTask Endcap occupancy z-");
66 sprintf(
histo,
"EcalDigiTask Endcap multiplicity z+");
69 sprintf(
histo,
"EcalDigiTask Endcap multiplicity z-");
72 sprintf(
histo,
"EcalDigiTask Endcap global pulse shape");
75 for (
int i = 0;
i < 10;
i++) {
76 sprintf(
histo,
"EcalDigiTask Endcap analog pulse %02d",
i + 1);
79 sprintf(
histo,
"EcalDigiTask Endcap ADC pulse %02d Gain 0 - Saturated",
i + 1);
82 sprintf(
histo,
"EcalDigiTask Endcap ADC pulse %02d Gain 1",
i + 1);
85 sprintf(
histo,
"EcalDigiTask Endcap ADC pulse %02d Gain 6",
i + 1);
88 sprintf(
histo,
"EcalDigiTask Endcap ADC pulse %02d Gain 12",
i + 1);
91 sprintf(
histo,
"EcalDigiTask Endcap gain pulse %02d",
i + 1);
95 sprintf(
histo,
"EcalDigiTask Endcap pedestal for pre-sample");
98 sprintf(
histo,
"EcalDigiTask Endcap maximum position gt 100 ADC");
101 sprintf(
histo,
"EcalDigiTask Endcap maximum position gt 20 ADC");
104 sprintf(
histo,
"EcalDigiTask Endcap ADC counts after gain switch");
127 std::vector<double> eeAnalogSignal;
128 std::vector<double> eeADCCounts;
129 std::vector<double> eeADCGains;
137 for (
unsigned int digis = 0; digis < EcalDigiEE->
size(); ++digis) {
139 int nrSamples = eedf.
size();
143 if (eeid.
zside() > 0) {
147 }
else if (eeid.
zside() < 0) {
155 double pedestalPreSample = 0.;
156 double pedestalPreSampleAnalog = 0.;
157 int countsAfterGainSwitch = -1;
158 double higherGain = 1.;
159 int higherGainSample = 0;
162 eeAnalogSignal[
sample] = 0.;
174 if (Emax < eeAnalogSignal[
sample]) {
175 Emax = eeAnalogSignal[
sample];
180 pedestalPreSample += eeADCCounts[
sample];
185 (countsAfterGainSwitch < 0 && eeADCGains[
sample] == 0))) {
186 higherGain = eeADCGains[
sample];
187 higherGainSample =
sample;
188 countsAfterGainSwitch = 1;
191 if ((higherGain > 1 && (higherGainSample !=
sample) && (eeADCGains[
sample] == higherGain)) ||
192 (higherGain == 3 && (higherGainSample !=
sample) && (eeADCGains[
sample] == 0)) ||
193 (higherGain == 0 && (higherGainSample !=
sample) && ((eeADCGains[
sample] == 0) || (eeADCGains[
sample] == 3))))
194 countsAfterGainSwitch++;
196 pedestalPreSample /= 3.;
197 pedestalPreSampleAnalog /= 3.;
199 LogDebug(
"DigiInfo") <<
"Endcap Digi for EEDetId = " << eeid.
rawId() <<
" x,y " << eeid.
ix() <<
" " << eeid.
iy();
200 for (
int i = 0;
i < 10;
i++) {
201 LogDebug(
"DigiInfo") <<
"sample " <<
i <<
" ADC = " << eeADCCounts[
i] <<
" gain = " << eeADCGains[
i]
202 <<
" Analog = " << eeAnalogSignal[
i];
204 LogDebug(
"DigiInfo") <<
"Maximum energy = " << Emax <<
" in sample " <<
Pmax
205 <<
" Pedestal from pre-sample = " << pedestalPreSampleAnalog;
206 if (countsAfterGainSwitch > 0)
207 LogDebug(
"DigiInfo") <<
"Counts after switch " << countsAfterGainSwitch;
209 if (countsAfterGainSwitch > 0 && countsAfterGainSwitch < 5) {
210 edm::LogWarning(
"DigiWarning") <<
"Wrong number of counts after gain switch before next switch! "
211 << countsAfterGainSwitch;
212 for (
int i = 0;
i < 10;
i++) {
213 edm::LogWarning(
"DigiWarning") <<
"sample " <<
i <<
" ADC = " << eeADCCounts[
i] <<
" gain = " << eeADCGains[
i]
214 <<
" Analog = " << eeAnalogSignal[
i];
218 for (
int i = 0;
i < 10;
i++) {
224 if (eeADCGains[
i] == 0) {
227 }
else if (eeADCGains[
i] == 3) {
230 }
else if (eeADCGains[
i] == 2) {
233 }
else if (eeADCGains[
i] == 1) {
272 LogDebug(
"EcalDigi") <<
" Gains conversions: "
279 delete defaultRatios;
static constexpr int MAXSAMPLES
T const * product() const
MonitorElement * meEEDigiMultiplicityzp_
MonitorElement * meEEDigiADCgS_[10]
T const * product() const
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * meEEDigiADCGlobal_
MonitorElement * meEEDigiADCg6_[10]
T getUntrackedParameter(std::string const &, T const &) const
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
Log< level::Warning, false > LogWarning
MonitorElement * meEEPedestal_
MonitorElement * meEEDigiOccupancyzp_
EcalEndcapDigisValidation(const edm::ParameterSet &ps)
Constructor.
void checkCalibrations(edm::EventSetup const &c)
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())
float gain12Over6() const
void reserve(size_t isize)
MonitorElement * meEEDigiOccupancyzm_
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
std::map< int, double, std::less< int > > gainConv_
MonitorElement * meEEnADCafterSwitch_
MonitorElement * meEEMaximumgt100ADC_
MonitorElement * meEEDigiADCg1_[10]
constexpr uint32_t rawId() const
get the raw id
MonitorElement * meEEMaximumgt20ADC_
~EcalEndcapDigisValidation() override
Destructor.
MonitorElement * meEEDigiADCg12_[10]
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
edm::EDGetTokenT< EEDigiCollection > EEdigiCollectionToken_
MonitorElement * meEEDigiADCAnalog_[10]
MonitorElement * meEEDigiMultiplicityzm_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * meEEDigiGain_[10]
void analyze(edm::Event const &e, edm::EventSetup const &c) override
Analyze.
Namespace of DDCMS conversion namespace.