13 hbheDigiCollectionTag_(ps.getParameter<edm::InputTag>(
"hbheDigiCollectionTag")),
14 hoDigiCollectionTag_(ps.getParameter<edm::InputTag>(
"hoDigiCollectionTag")),
15 hfDigiCollectionTag_(ps.getParameter<edm::InputTag>(
"hfDigiCollectionTag")) {
26 std::vector<MCWidthsBunch>::iterator bunch_it;
27 for(bunch_it=
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
29 if(!bunch_it->usedflag)
continue;
32 for(
int i = 0;
i != 4;
i++){
33 for(
int j = 0;
j != 10;
j++){
34 for(
int k = 0;
k != 10;
k++){
35 bunch_it->sig[
i][
j][
k] = (bunch_it->prod[
i][
j][
k]/bunch_it->num[
i][
j][
k]);
40 item.setValue(
i,
j,k,0.0);
50 if(bunch_it->detid.subdet() == 1){
51 for(
int i = 0;
i != 4;
i++){
52 for(
int j = 0;
j != 10;
j++){
53 for(
int k =
j;
k != 10;
k++)
58 if(bunch_it->detid.subdet() == 2){
59 for(
int i = 0;
i != 4;
i++){
60 for(
int j = 0;
j != 10;
j++){
61 for(
int k =
j;
k != 10;
k++)
66 if(bunch_it->detid.subdet() == 3){
67 for(
int i = 0;
i != 4;
i++){
68 for(
int j = 0;
j != 10;
j++){
69 for(
int k =
j;
k != 10;
k++)
74 if(bunch_it->detid.subdet() == 4){
75 for(
int i = 0;
i != 4;
i++){
76 for(
int j = 0;
j != 10;
j++){
77 for(
int k =
j;
k != 10;
k++)
91 std::cout <<
"Writing histograms..." << std::endl;
92 for(
int i = 0;
i != 10;
i++){
125 std::stringstream tempstringout;
127 runnum_string = tempstringout.str();
129 std::string rootfilename = runnum_string +
"-MCwidths.root";
130 theFile =
new TFile(rootfilename.c_str(),
"RECREATE");
132 for(
int i = 0;
i!= 10;
i++)
134 tempstringout.str(
"");
139 std::string histname = histname1 + histname2 + histname3;
140 HBMeans[
i] =
new TProfile(histname.c_str(),histname1.c_str(), 10, -0.50, 9.5);
142 histname = histname1 + histname2 + histname3;
143 HEMeans[
i] =
new TProfile(histname.c_str(),histname1.c_str(), 10, -0.50, 9.5);
145 histname = histname1 + histname2 + histname3;
146 HFMeans[
i] =
new TProfile(histname.c_str(),histname1.c_str(), 10, -0.50, 9.5);
148 histname = histname1 + histname2 + histname3;
149 HOMeans[
i] =
new TProfile(histname.c_str(),histname1.c_str(), 10, -0.50, 9.5);
155 std::vector<HcalGenericDetId> listEMap = myRefEMap->
allPrecisionId();
156 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++)
159 if(mygenid.isHcalDetId())
165 for(
int i = 0;
i != 4;
i++)
167 for(
int j = 0;
j != 10;
j++){
168 for(
int k = 0;
k != 10;
k++)
181 std::vector<MCWidthsBunch>::iterator bunch_it;
186 for(bunch_it =
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
187 if(bunch_it->detid.rawId() == digi.
id().
rawId())
break;
189 const HcalPedestal* peds = (myRefPeds->getValues( searchid ));
190 bunch_it->usedflag =
true;
192 for(
int ts = 0; ts != 10; ts++)
194 for(
int j = ts;
j != 10;
j++){
195 bunch_it->num[firstcapid][ts][
j] += 1;
196 bunch_it->prod[firstcapid][ts][
j] +=
197 ((digi.
sample(
j).
adc()-peds->getValue(firstcapid))
206 for(bunch_it =
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
207 if(bunch_it->detid.rawId() == digi.
id().
rawId())
break;
209 const HcalPedestal* peds = (myRefPeds->getValues( searchid ));
210 bunch_it->usedflag =
true;
212 for(
int ts = 0; ts != 10; ts++)
214 for(
int j = ts;
j != 10;
j++){
215 bunch_it->num[firstcapid][ts][
j] += 1;
216 bunch_it->prod[firstcapid][ts][
j] +=
217 ((digi.
sample(
j).
adc()-peds->getValue(firstcapid))
226 for(bunch_it =
Bunches.begin(); bunch_it !=
Bunches.end(); bunch_it++)
227 if(bunch_it->detid.rawId() == digi.
id().
rawId())
break;
229 const HcalPedestal* peds = (myRefPeds->getValues( searchid ));
230 bunch_it->usedflag =
true;
232 for(
int ts = 0; ts != 10; ts++)
234 for(
int j = ts;
j != 10;
j++){
235 bunch_it->num[firstcapid][ts][
j] += 1;
236 bunch_it->prod[firstcapid][ts][
j] +=
237 ((digi.
sample(
j).
adc()-peds->getValue(firstcapid))
T getUntrackedParameter(std::string const &, T const &) const
virtual ~HcalPedestalMCWidths()
HcalPedestalMCWidths(const edm::ParameterSet &ps)
edm::InputTag hbheDigiCollectionTag_
std::string widthsfilename
edm::InputTag hoDigiCollectionTag_
#define DEFINE_FWK_MODULE(type)
int adc() const
get the ADC sample
std::vector< T >::const_iterator const_iterator
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
const HcalTopology * theTopology
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::InputTag hfDigiCollectionTag_
const HcalQIESample & sample(int i) const
access a sample
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
std::vector< HcalGenericDetId > allPrecisionId() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) 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 addValues(const HcalCovarianceMatrix &myHcalCovarianceMatrix)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
const HcalDetId & id() const
const HcalDetId & id() const