40 if(
ievt < 1000)
return;
42 std::stringstream tempstringout;
43 tempstringout <<
ievt;
44 ievt_string = tempstringout.str();
48 std::cout <<
"Calculating Pedestal constants...\n";
49 std::vector<NewPedBunch>::iterator bunch_it;
50 for(bunch_it=
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
52 if(bunch_it->usedflag){
56 if(bunch_it->num[0][0]!=0) bunch_it->cap[0] /= bunch_it->num[0][0];
57 if(bunch_it->num[1][1]!=0) bunch_it->cap[1] /= bunch_it->num[1][1];
58 if(bunch_it->num[2][2]!=0) bunch_it->cap[2] /= bunch_it->num[2][2];
59 if(bunch_it->num[3][3]!=0) bunch_it->cap[3] /= bunch_it->num[3][3];
60 if(bunch_it->num[0][0]!=0) bunch_it->capfc[0] /= bunch_it->num[0][0];
61 if(bunch_it->num[1][1]!=0) bunch_it->capfc[1] /= bunch_it->num[1][1];
62 if(bunch_it->num[2][2]!=0) bunch_it->capfc[2] /= bunch_it->num[2][2];
63 if(bunch_it->num[3][3]!=0) bunch_it->capfc[3] /= bunch_it->num[3][3];
64 bunch_it->sig[0][0] = (bunch_it->prod[0][0]/bunch_it->num[0][0])-(bunch_it->cap[0]*bunch_it->cap[0]);
65 bunch_it->sig[0][1] = (bunch_it->prod[0][1]/bunch_it->num[0][1])-(bunch_it->cap[0]*bunch_it->cap[1]);
66 bunch_it->sig[0][2] = (bunch_it->prod[0][2]/bunch_it->num[0][2])-(bunch_it->cap[0]*bunch_it->cap[2]);
67 bunch_it->sig[0][3] = (bunch_it->prod[0][3]/bunch_it->num[0][3])-(bunch_it->cap[0]*bunch_it->cap[3]);
68 bunch_it->sig[1][0] = (bunch_it->prod[1][0]/bunch_it->num[1][0])-(bunch_it->cap[1]*bunch_it->cap[0]);
69 bunch_it->sig[1][1] = (bunch_it->prod[1][1]/bunch_it->num[1][1])-(bunch_it->cap[1]*bunch_it->cap[1]);
70 bunch_it->sig[1][2] = (bunch_it->prod[1][2]/bunch_it->num[1][2])-(bunch_it->cap[1]*bunch_it->cap[2]);
71 bunch_it->sig[1][3] = (bunch_it->prod[1][3]/bunch_it->num[1][3])-(bunch_it->cap[1]*bunch_it->cap[3]);
72 bunch_it->sig[2][0] = (bunch_it->prod[2][0]/bunch_it->num[2][0])-(bunch_it->cap[2]*bunch_it->cap[0]);
73 bunch_it->sig[2][1] = (bunch_it->prod[2][1]/bunch_it->num[2][1])-(bunch_it->cap[2]*bunch_it->cap[1]);
74 bunch_it->sig[2][2] = (bunch_it->prod[2][2]/bunch_it->num[2][2])-(bunch_it->cap[2]*bunch_it->cap[2]);
75 bunch_it->sig[2][3] = (bunch_it->prod[2][3]/bunch_it->num[2][3])-(bunch_it->cap[2]*bunch_it->cap[3]);
76 bunch_it->sig[3][0] = (bunch_it->prod[3][0]/bunch_it->num[3][0])-(bunch_it->cap[3]*bunch_it->cap[0]);
77 bunch_it->sig[3][1] = (bunch_it->prod[3][1]/bunch_it->num[3][1])-(bunch_it->cap[3]*bunch_it->cap[1]);
78 bunch_it->sig[3][2] = (bunch_it->prod[3][2]/bunch_it->num[3][2])-(bunch_it->cap[3]*bunch_it->cap[2]);
79 bunch_it->sig[3][3] = (bunch_it->prod[3][3]/bunch_it->num[3][3])-(bunch_it->cap[3]*bunch_it->cap[3]);
81 bunch_it->sigfc[0][0] = (bunch_it->prodfc[0][0]/bunch_it->num[0][0])-(bunch_it->capfc[0]*bunch_it->capfc[0]);
82 bunch_it->sigfc[0][1] = (bunch_it->prodfc[0][1]/bunch_it->num[0][1])-(bunch_it->capfc[0]*bunch_it->capfc[1]);
83 bunch_it->sigfc[0][2] = (bunch_it->prodfc[0][2]/bunch_it->num[0][2])-(bunch_it->capfc[0]*bunch_it->capfc[2]);
84 bunch_it->sigfc[0][3] = (bunch_it->prodfc[0][3]/bunch_it->num[0][3])-(bunch_it->capfc[0]*bunch_it->capfc[3]);
85 bunch_it->sigfc[1][0] = (bunch_it->prodfc[1][0]/bunch_it->num[1][0])-(bunch_it->capfc[1]*bunch_it->capfc[0]);
86 bunch_it->sigfc[1][1] = (bunch_it->prodfc[1][1]/bunch_it->num[1][1])-(bunch_it->capfc[1]*bunch_it->capfc[1]);
87 bunch_it->sigfc[1][2] = (bunch_it->prodfc[1][2]/bunch_it->num[1][2])-(bunch_it->capfc[1]*bunch_it->capfc[2]);
88 bunch_it->sigfc[1][3] = (bunch_it->prodfc[1][3]/bunch_it->num[1][3])-(bunch_it->capfc[1]*bunch_it->capfc[3]);
89 bunch_it->sigfc[2][0] = (bunch_it->prodfc[2][0]/bunch_it->num[2][0])-(bunch_it->capfc[2]*bunch_it->capfc[0]);
90 bunch_it->sigfc[2][1] = (bunch_it->prodfc[2][1]/bunch_it->num[2][1])-(bunch_it->capfc[2]*bunch_it->capfc[1]);
91 bunch_it->sigfc[2][2] = (bunch_it->prodfc[2][2]/bunch_it->num[2][2])-(bunch_it->capfc[2]*bunch_it->capfc[2]);
92 bunch_it->sigfc[2][3] = (bunch_it->prodfc[2][3]/bunch_it->num[2][3])-(bunch_it->capfc[2]*bunch_it->capfc[3]);
93 bunch_it->sigfc[3][0] = (bunch_it->prodfc[3][0]/bunch_it->num[3][0])-(bunch_it->capfc[3]*bunch_it->capfc[0]);
94 bunch_it->sigfc[3][1] = (bunch_it->prodfc[3][1]/bunch_it->num[3][1])-(bunch_it->capfc[3]*bunch_it->capfc[1]);
95 bunch_it->sigfc[3][2] = (bunch_it->prodfc[3][2]/bunch_it->num[3][2])-(bunch_it->capfc[3]*bunch_it->capfc[2]);
96 bunch_it->sigfc[3][3] = (bunch_it->prodfc[3][3]/bunch_it->num[3][3])-(bunch_it->capfc[3]*bunch_it->capfc[3]);
98 if(bunch_it->detid.subdet() == 1){
99 for(
int i = 0;
i != 4;
i++){
104 if(bunch_it->detid.subdet() == 2){
105 for(
int i = 0;
i != 4;
i++){
110 if(bunch_it->detid.subdet() == 3){
111 for(
int i = 0;
i != 4;
i++){
116 if(bunch_it->detid.subdet() == 4){
117 for(
int i = 0;
i != 4;
i++){
123 const HcalPedestal item(bunch_it->detid, bunch_it->cap[0], bunch_it->cap[1], bunch_it->cap[2], bunch_it->cap[3],
124 bunch_it->sig[0][0], bunch_it->sig[1][1], bunch_it->sig[2][2], bunch_it->sig[3][3]);
127 widthsp.setSigma(0,0,bunch_it->sig[0][0]);
128 widthsp.setSigma(0,1,bunch_it->sig[0][1]);
129 widthsp.setSigma(0,2,bunch_it->sig[0][2]);
130 widthsp.setSigma(0,3,bunch_it->sig[0][3]);
131 widthsp.setSigma(1,1,bunch_it->sig[1][1]);
132 widthsp.setSigma(1,2,bunch_it->sig[1][2]);
133 widthsp.setSigma(1,3,bunch_it->sig[1][3]);
134 widthsp.setSigma(2,2,bunch_it->sig[2][2]);
135 widthsp.setSigma(2,3,bunch_it->sig[2][3]);
136 widthsp.setSigma(3,3,bunch_it->sig[3][3]);
139 const HcalPedestal itemfc(bunch_it->detid, bunch_it->capfc[0], bunch_it->capfc[1], bunch_it->capfc[2], bunch_it->capfc[3],
140 bunch_it->sigfc[0][0], bunch_it->sigfc[1][1], bunch_it->sigfc[2][2], bunch_it->sigfc[3][3]);
143 widthspfc.setSigma(0,0,bunch_it->sigfc[0][0]);
144 widthspfc.setSigma(0,1,bunch_it->sigfc[0][1]);
145 widthspfc.setSigma(0,2,bunch_it->sigfc[0][2]);
146 widthspfc.setSigma(0,3,bunch_it->sigfc[0][3]);
147 widthspfc.setSigma(1,1,bunch_it->sigfc[1][1]);
148 widthspfc.setSigma(1,2,bunch_it->sigfc[1][2]);
149 widthspfc.setSigma(1,3,bunch_it->sigfc[1][3]);
150 widthspfc.setSigma(2,2,bunch_it->sigfc[2][2]);
151 widthspfc.setSigma(2,3,bunch_it->sigfc[2][3]);
152 widthspfc.setSigma(3,3,bunch_it->sigfc[3][3]);
std::string pedsADCfilename
HcalPedestalWidths * rawWidthsItem
HcalPedestals * rawPedsItemfc
HcalPedestals * rawPedsItem
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
HcalPedestalWidths * rawWidthsItemfc
bool addValues(const Item &myItem)
std::vector< NewPedBunch > Bunches