Changeset 14942 for fact/tools
- Timestamp:
- 02/21/13 14:52:48 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/pixel.C
r14940 r14942 340 340 mVerbosityLevel 341 341 ); 342 343 // TFile f(outRootFileName.Data(),"recreate");344 // TVectorF chid(1);345 // chid[0] = mChid;346 // chid.Write("chid");347 // //// hMemberlist->Add( "chid" );348 349 // TVectorF MaxPulseOrder(1);350 // MaxPulseOrder[0] = mMaxPulseOrder;351 // hMemberlist->Add( &MaxPulseOrder );352 353 // TVectorF PixelOverlayXaxisLeft(1);354 // PixelOverlayXaxisLeft[0] = mPixelOverlayXaxisLeft;355 // hMemberlist->Add( &PixelOverlayXaxisLeft );356 357 // TVectorF PixelOverlayXaxisRight(1);358 // PixelOverlayXaxisRight[0] = mPixelOverlayXaxisRight;359 // hMemberlist->Add( &PixelOverlayXaxisRight );360 361 // TVectorF BSLMean(1);362 // BSLMean[0] = mBSLMean;363 // hMemberlist->Add( &BSLMean );364 365 // TVectorF GainMean(1);366 // GainMean[0] = mGainMean;367 // hMemberlist->Add( &GainMean );368 369 // SaveList(370 // outRootFileName,371 // CreateSubDirName( mChid ),372 // hMemberlist,373 // saveResults,374 // mVerbosityLevel375 // );376 377 378 379 380 342 /* 381 343 we also need to save same values: … … 1228 1190 } 1229 1191 1230 1192 void 1193 Pixel::SetRangeUser(float xMin, float xMax, int order) 1194 { 1195 hMaxOverlay[order]->GetXaxis()->SetRangeUser(xMin, xMax); 1196 hEdgeOverlay[order]->GetXaxis()->SetRangeUser(xMin, xMax); 1197 1198 hPixelMax[order]->GetXaxis()->SetRangeUser(xMin, xMax); 1199 hPixelMedian[order]->GetXaxis()->SetRangeUser(xMin, xMax); 1200 hPixelMean[order]->GetXaxis()->SetRangeUser(xMin, xMax); 1201 1202 hPixelEdgeMax[order]->GetXaxis()->SetRangeUser(xMin, xMax); 1203 hPixelEdgeMedian[order]->GetXaxis()->SetRangeUser(xMin, xMax); 1204 hPixelEdgeMean[order]->GetXaxis()->SetRangeUser(xMin, xMax); 1205 1206 return; 1207 } 1208 1209 void 1210 Pixel::NormalizeSamplesTH2F(TH2F* histo) 1211 { 1212 1213 int first = histo->GetXaxis()->GetFirst(); 1214 int last = histo->GetXaxis()->GetLast(); 1215 1216 TH2F *hTemp = new TH2F(*histo); 1217 hTemp->Reset(); 1218 1219 for (int i = first; i < last; i++) 1220 { 1221 TH1* hTemp1D = histo->ProjectionY("_px1", i, i+1); 1222 double integral = hTemp1D->Integral(); 1223 // double maximum = hTemp->GetBinContent(hTemp->GetMaximumBin()); 1224 hTemp1D->Scale(1/integral); 1225 // hTemp->Scale(1/maximum); 1226 int first_sl = hTemp1D->GetXaxis()->GetFirst(); 1227 int last_sl = hTemp1D->GetXaxis()->GetLast(); 1228 1229 for (int j = first_sl; j < last_sl; j++) 1230 { 1231 hTemp->SetBinContent(i, j, hTemp->GetBinContent(j)); 1232 } 1233 } 1234 1235 histo->Reset(); 1236 histo->Add(hTemp); 1237 1238 delete hTemp; 1239 return; 1240 } 1241 1242 void 1243 Pixel::Normalize2Dhistos(int order) 1244 { 1245 NormalizeSamplesTH2F(hMaxOverlay[order]); 1246 NormalizeSamplesTH2F(hEdgeOverlay[order]); 1247 return; 1248 } 1249 1250
Note:
See TracChangeset
for help on using the changeset viewer.