|
|
Go to the documentation of this file.
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;
static constexpr int MAXSAMPLES
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.
Log< level::Warning, false > LogWarning
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_
bool getData(T &iHolder) const
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.
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > pAgc