- // Calculates the mean
- Int_t det, sm, row, col;
- Float_t gain;
- Float_t modmean = 0.;
- Float_t cellmean = 0.;
- Float_t detmean =0.;
-
- gaintree->Branch("det",&det,"det/I");
- gaintree->Branch("sm",&sm,"sm/I");
- gaintree->Branch("row",&row,"row/I");
- gaintree->Branch("col",&col,"col/I");
- gaintree->Branch("gain",&gain,"gain/F");
-
- for(Int_t idet = 0; idet < kDet; idet++)
- {
- if (fDetCount[idet]>0 )
- detmean=fDetIso[idet]/fDetCount[idet];
- for(Int_t ism = 0; ism < kMaxSMN; ism++)
- {
- if (fSMCount[idet][ism] > 0)
- modmean = fSMIso[idet][ism]/fSMCount[idet][ism];
- for(Int_t irow = 0; irow < kMaxRow; irow++)
- {
- for(Int_t icol = 0; icol < kMaxCol; icol++)
- {
- if (fCellCount[idet][ism][irow][icol] > 0.)
- {
- cellmean = fCellIso[idet][ism][irow][icol]/fCellCount[idet][ism][irow][icol];
- }
- det = idet;
- sm = ism;
- row = irow;
- col = icol;
- if (cellmean > 0.0 && fCellCount[idet][ism][irow][icol]>0.)
- {
- gain = cellmean/detmean;
- }
- else
- {
- gain = -1.;
- }
- //if(fCellCount[idet][ism][irow][icol]>0.) printf("CellCount =%f, gain= %f\n",fCellCount[idet][ism][irow][icol],gain);
- gaintree->Fill();
- }
- }
- }
- }
-
+ // Calculates the mean
+ Int_t det, sm, row, col;
+ Float_t gain;
+ Float_t modmean = 0.;
+ Float_t cellmean = 0.;
+
+ gaintree->Branch("det",&det,"det/I");
+ gaintree->Branch("sm",&sm,"sm/I");
+ gaintree->Branch("row",&row,"row/I");
+ gaintree->Branch("col",&col,"col/I");
+ gaintree->Branch("gain",&gain,"gain/F");
+
+ for(Int_t idet = 0; idet < kDet; idet++)
+ {
+ for(Int_t ism = 0; ism < kMaxSMN; ism++)
+ {
+ if (fSMCount[idet][ism] > 0)
+ modmean = fSMIso[idet][ism]/fSMCount[idet][ism];
+ for(Int_t irow = 0; irow < kMaxRow; irow++)
+ {
+ for(Int_t icol = 0; icol < kMaxCol; icol++)
+ {
+ if (fCellCount[idet][ism][irow][icol] > 0.)
+ {
+ cellmean = fCellIso[idet][ism][irow][icol]/fCellCount[idet][ism][irow][icol];
+ }
+ det = idet;
+ sm = ism;
+ row = irow;
+ col = icol;
+ if (cellmean > 0.0 && fCellCount[idet][ism][irow][icol]>0.)
+ {
+ gain = cellmean/modmean;
+ }
+ else
+ {
+ gain = 0.;
+ }
+ //if(fCellCount[idet][ism][irow][icol]>0.) printf("CellCount =%f, gain= %f\n",fCellCount[idet][ism][irow][icol],gain);
+ gaintree->Fill();
+ }
+ }
+ }
+ }
+