57 _nsamples(iConfig.getUntrackedParameter<unsigned
int>(
"nSamples", 10)),
58 _presample(iConfig.getUntrackedParameter<unsigned
int>(
"nPresamples", 2)),
59 _firstsample(iConfig.getUntrackedParameter<unsigned
int>(
"firstSample", 1)),
60 _lastsample(iConfig.getUntrackedParameter<unsigned
int>(
"lastSample", 2)),
61 _timingcutlow(iConfig.getUntrackedParameter<unsigned
int>(
"timingCutLow", 2)),
62 _timingcuthigh(iConfig.getUntrackedParameter<unsigned
int>(
"timingCutHigh", 9)),
63 _timingquallow(iConfig.getUntrackedParameter<unsigned
int>(
"timingQualLow", 3)),
64 _timingqualhigh(iConfig.getUntrackedParameter<unsigned
int>(
"timingQualHigh", 8)),
65 _ratiomincutlow(iConfig.getUntrackedParameter<double>(
"ratioMinCutLow", 0.4)),
66 _ratiomincuthigh(iConfig.getUntrackedParameter<double>(
"ratioMinCutHigh", 0.95)),
67 _ratiomaxcutlow(iConfig.getUntrackedParameter<double>(
"ratioMaxCutLow", 0.8)),
68 _presamplecut(iConfig.getUntrackedParameter<double>(
"presampleCut", 5.0)),
69 _niter(iConfig.getUntrackedParameter<unsigned
int>(
"nIter", 3)),
70 _alpha(iConfig.getUntrackedParameter<double>(
"alpha", 1.5076494)),
71 _beta(iConfig.getUntrackedParameter<double>(
"beta", 1.5136036)),
72 _nevtmax(iConfig.getUntrackedParameter<unsigned
int>(
"nEvtMax", 200)),
73 _noise(iConfig.getUntrackedParameter<double>(
"noise", 2.0)),
74 _chi2cut(iConfig.getUntrackedParameter<double>(
"chi2cut", 100.0)),
75 _ecalPart(iConfig.getUntrackedParameter<
std::
string>(
"ecalPart",
"EB")),
76 _qualpercent(iConfig.getUntrackedParameter<double>(
"qualPercent", 0.2)),
77 _debug(iConfig.getUntrackedParameter<
int>(
"debug", 0)),
116 for (
unsigned int j = 0;
j <
nCrys;
j++) {
175 std::stringstream nameabinitfile;
176 nameabinitfile <<
resdir_ <<
"/ABInit.root";
179 std::stringstream nameabfile;
180 std::stringstream
link;
181 nameabfile <<
resdir_ <<
"/AB.root";
184 test = fopen(nameabinitfile.str().c_str(),
"r");
185 if (
test ==
nullptr) {
191 TFile* fAB =
nullptr;
192 TTree* ABInit =
nullptr;
194 fAB =
new TFile(nameabinitfile.str().c_str());
197 ABInit = (TTree*)fAB->Get(
"ABCol0");
220 system(
link.str().c_str());
225 std::stringstream namefile;
226 namefile <<
resdir_ <<
"/AB.root";
241 DCCHeader = pDCCHeader.
product();
267 std::cout <<
" Wrong ecalPart in cfg file " << std::endl;
276 TheMapping = ecalmapping.
product();
278 std::cerr <<
"Error! can't get the product EcalMappingRcd" << std::endl;
289 int fed = headerItr->fedId();
293 runType = headerItr->getRunType();
294 runNum = headerItr->getRunNumber();
295 event = headerItr->getLV1();
297 dccID = headerItr->getDccInTCCCommand();
298 fedID = headerItr->fedId();
320 if (iter ==
colors.end()) {
346 EBDetId id_crystal(digiItr->id());
349 int etaG = id_crystal.ieta();
350 int phiG = id_crystal.iphi();
356 etaL = LocalCoord.first;
357 phiL = LocalCoord.second;
370 int xtal = elecid_crystal.
xtalId();
371 int channelID = 5 * (
strip - 1) + xtal - 1;
389 for (
unsigned int i = 0;
i < (*digiItr).size(); ++
i) {
391 adc[
i] = samp_crystal.adc();
392 adcG[
i] = samp_crystal.gainId();
438 EEDetId id_crystal(digiItr->id());
441 phi = id_crystal.ix();
442 eta = id_crystal.iy();
444 int iX = (
phi - 1) / 5 + 1;
445 int iY = (
eta - 1) / 5 + 1;
451 int channelID = elecid_crystal.
channelId() - 1;
474 if ((*digiItr).size() > 10)
475 std::cout <<
"SAMPLES SIZE > 10!" << (*digiItr).size() << std::endl;
479 for (
unsigned int i = 0;
i < (*digiItr).size(); ++
i) {
481 adc[
i] = samp_crystal.adc();
482 adcG[
i] = samp_crystal.gainId();
525 std::cout <<
"\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
526 std::cout <<
"\t+=+ Analyzing data: getting (alpha, beta) +=+" << std::endl;
554 std::cout <<
"\n\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;
555 std::cout <<
"\t+=+ Analyzing data: getting (alpha, beta) +=+" << std::endl;
556 TFile* fAB =
nullptr;
557 TTree* ABInit =
nullptr;
562 ABInit = (TTree*)fAB->Get(
"ABCol0");
568 double BadGainEvtPercentage = 0.0;
569 double BadTimingEvtPercentage = 0.0;
571 int nChanBadGain = 0;
572 int nChanBadTiming = 0;
574 for (
unsigned int i = 0;
i <
nCrys;
i++) {
589 double BadGainChanPercentage = double(nChanBadGain) / double(
nCrys);
590 double BadTimingChanPercentage = double(nChanBadTiming) / double(
nCrys);
598 std::cout <<
"\t+=+ ............................ WARNING! APD GAIN WAS NOT 1 +=+" << std::endl;
600 std::cout <<
"\t+=+ ............................ WARNING! TIMING WAS BAD +=+" << std::endl;
602 std::cout <<
"\t+=+ .................................... done +=+" << std::endl;
603 std::cout <<
"\t+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+" << std::endl;