21 std::vector<MCWidthsBunch>::iterator bunch_it;
22 for(bunch_it=
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
24 if(!bunch_it->usedflag)
continue;
27 for(
int i = 0;
i != 4;
i++){
28 for(
int j = 0;
j != 10;
j++){
29 for(
int k = 0;
k != 10;
k++){
30 bunch_it->sig[
i][
j][
k] = (bunch_it->prod[
i][
j][
k]/bunch_it->num[
i][
j][
k]);
35 item.setValue(
i,
j,k,0.0);
45 if(bunch_it->detid.subdet() == 1){
46 for(
int i = 0;
i != 4;
i++){
47 for(
int j = 0;
j != 10;
j++){
48 for(
int k =
j;
k != 10;
k++)
53 if(bunch_it->detid.subdet() == 2){
54 for(
int i = 0;
i != 4;
i++){
55 for(
int j = 0;
j != 10;
j++){
56 for(
int k =
j;
k != 10;
k++)
61 if(bunch_it->detid.subdet() == 3){
62 for(
int i = 0;
i != 4;
i++){
63 for(
int j = 0;
j != 10;
j++){
64 for(
int k =
j;
k != 10;
k++)
69 if(bunch_it->detid.subdet() == 4){
70 for(
int i = 0;
i != 4;
i++){
71 for(
int j = 0;
j != 10;
j++){
72 for(
int k =
j;
k != 10;
k++)
86 std::cout <<
"Writing histograms..." << std::endl;
87 for(
int i = 0;
i != 10;
i++){
118 std::string runnum_string;
119 std::stringstream tempstringout;
121 runnum_string = tempstringout.str();
123 std::string rootfilename = runnum_string +
"-MCwidths.root";
124 theFile =
new TFile(rootfilename.c_str(),
"RECREATE");
126 for(
int i = 0;
i!= 10;
i++)
128 tempstringout.str(
"");
130 std::string histname3 = tempstringout.str();
131 std::string histname2 =
"Mean covariance TS ";
132 std::string histname1 =
"HB ";
133 std::string histname = histname1 + histname2 + histname3;
134 HBMeans[
i] =
new TProfile(histname.c_str(),histname1.c_str(), 10, -0.50, 9.5);
136 histname = histname1 + histname2 + histname3;
137 HEMeans[
i] =
new TProfile(histname.c_str(),histname1.c_str(), 10, -0.50, 9.5);
139 histname = histname1 + histname2 + histname3;
140 HFMeans[
i] =
new TProfile(histname.c_str(),histname1.c_str(), 10, -0.50, 9.5);
142 histname = histname1 + histname2 + histname3;
143 HOMeans[
i] =
new TProfile(histname.c_str(),histname1.c_str(), 10, -0.50, 9.5);
149 std::vector<HcalGenericDetId> listEMap = myRefEMap->
allPrecisionId();
150 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++)
153 if(mygenid.isHcalDetId())
159 for(
int i = 0;
i != 4;
i++)
161 for(
int j = 0;
j != 10;
j++){
162 for(
int k = 0;
k != 10;
k++)
175 std::vector<MCWidthsBunch>::iterator bunch_it;
180 for(bunch_it =
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
181 if(bunch_it->detid.rawId() == digi.
id().
rawId())
break;
183 const HcalPedestal* peds = (myRefPeds->getValues( searchid ));
184 bunch_it->usedflag =
true;
186 for(
int ts = 0; ts != 10; ts++)
188 for(
int j = ts;
j != 10;
j++){
189 bunch_it->num[firstcapid][ts][
j] += 1;
190 bunch_it->prod[firstcapid][ts][
j] +=
191 ((digi.
sample(
j).
adc()-peds->getValue(firstcapid))
200 for(bunch_it =
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
201 if(bunch_it->detid.rawId() == digi.
id().
rawId())
break;
203 const HcalPedestal* peds = (myRefPeds->getValues( searchid ));
204 bunch_it->usedflag =
true;
206 for(
int ts = 0; ts != 10; ts++)
208 for(
int j = ts;
j != 10;
j++){
209 bunch_it->num[firstcapid][ts][
j] += 1;
210 bunch_it->prod[firstcapid][ts][
j] +=
211 ((digi.
sample(
j).
adc()-peds->getValue(firstcapid))
220 for(bunch_it =
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
221 if(bunch_it->detid.rawId() == digi.
id().
rawId())
break;
223 const HcalPedestal* peds = (myRefPeds->getValues( searchid ));
224 bunch_it->usedflag =
true;
226 for(
int ts = 0; ts != 10; ts++)
228 for(
int j = ts;
j != 10;
j++){
229 bunch_it->num[firstcapid][ts][
j] += 1;
230 bunch_it->prod[firstcapid][ts][
j] +=
231 ((digi.
sample(
j).
adc()-peds->getValue(firstcapid))
T getUntrackedParameter(std::string const &, T const &) const
virtual ~HcalPedestalMCWidths()
HcalPedestalMCWidths(const edm::ParameterSet &ps)
std::string widthsfilename
#define DEFINE_FWK_MODULE(type)
int adc() const
get the ADC sample
std::vector< T >::const_iterator const_iterator
bool getByType(Handle< PROD > &result) const
const HcalQIESample & sample(int i) const
access a sample
const HcalDetId & id() const
uint32_t rawId() const
get the raw id
std::vector< MCWidthsBunch > Bunches
bool addValues(const HcalCovarianceMatrix &myHcalCovarianceMatrix, bool h2mode_=false)
const HcalQIESample & sample(int i) const
access a sample
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
std::vector< HcalGenericDetId > allPrecisionId() const
int capid() const
get the Capacitor id
const HcalQIESample & sample(int i) const
access a sample
T const * product() const
void setValue(int capid, int i, int j, float val)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
const HcalDetId & id() const
const HcalDetId & id() const