Changeset 13785 for fact/tools/rootmacros
- Timestamp:
- 05/18/12 21:36:54 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/templateextractors.C
r13652 r13785 4 4 #include "templateextractors.h" 5 5 #include <stdlib.h> 6 6 7 using namespace std; 7 8 … … 262 263 << " Overlay" 263 264 << endl; 264 TH2F* hInputHisto Array= NULL;265 TH1F* hOutputMaxHisto Array= NULL;266 TH1F* hOutputMeanHisto Array= NULL;267 TH1F* hOutputMedianHisto Array= NULL;265 TH2F* hInputHisto = NULL; 266 TH1F* hOutputMaxHisto = NULL; 267 TH1F* hOutputMeanHisto = NULL; 268 TH1F* hOutputMedianHisto = NULL; 268 269 TH1* hTempHisto = NULL; 269 270 float max_prop = 0; … … 274 275 { 275 276 cout << "...setting pointers to histogramm arrays "; 277 cout << " for " << overlayType << "Overlay" << endl; 276 278 } 277 279 if (overlayType.Contains("Edge")) 278 280 { 279 hInputHisto Array = CurrentPixel->hEdgeOverlay[pulse_order];281 hInputHisto = (CurrentPixel->hEdgeOverlay[pulse_order]); 280 282 281 283 //Maximum Propability of Slices 282 hOutputMaxHisto Array = CurrentPixel->hPixelEdgeMax[pulse_order];284 hOutputMaxHisto = (CurrentPixel->hPixelEdgeMax[pulse_order]); 283 285 284 286 //Mean of Slices 285 hOutputMeanHisto Array = CurrentPixel->hPixelEdgeMean[pulse_order];287 hOutputMeanHisto = (CurrentPixel->hPixelEdgeMean[pulse_order]); 286 288 287 289 //Median of Slices 288 hOutputMedianHisto Array = CurrentPixel->hPixelEdgeMedian[pulse_order];290 hOutputMedianHisto = (CurrentPixel->hPixelEdgeMedian[pulse_order]); 289 291 } 290 292 else if (overlayType.Contains("Maximum")) 291 293 { 292 hInputHisto Array = CurrentPixel->hMaxOverlay[pulse_order];294 hInputHisto = (CurrentPixel->hMaxOverlay[pulse_order]); 293 295 294 296 //Maximum Propability of Slices 295 hOutputMaxHisto Array = CurrentPixel->hPixelMax[pulse_order];297 hOutputMaxHisto = (CurrentPixel->hPixelMax[pulse_order]); 296 298 297 299 //Mean of Slices 298 hOutputMeanHisto Array = CurrentPixel->hPixelMean[pulse_order];300 hOutputMeanHisto = (CurrentPixel->hPixelMean[pulse_order]); 299 301 300 302 //Median of Slices 301 hOutputMedianHisto Array = CurrentPixel->hPixelMedian[pulse_order];303 hOutputMedianHisto = (CurrentPixel->hPixelMedian[pulse_order]); 302 304 } 303 305 else 304 306 { 305 cout << endl << "Unknown Overlay Method-->aborting" << endl;307 cout << endl << overlayType << "Unknown Overlay Method-->aborting" << endl; 306 308 return; 307 309 } … … 311 313 } 312 314 313 if (verbosityLevel > 2) cout << "\t...calculation of " 314 << "pulse order " << pulse_order << endl; 315 316 cout << "################ " << endl; 317 // vector max_value_of to number of timeslices in Overlay Spectra 318 cout << "### " << hInputHistoArray; 319 cout << "################ " << endl; 320 321 // int nbins = hInputHistoArray->GetXaxis()->GetNbins(); 322 // cout << "###" << nbins << endl; 323 315 if (verbosityLevel > 2) 316 { 317 cout << "\t...calculation of " 318 << "pulse order " << pulse_order << endl; 319 } 324 320 325 321 // if (verbosityLevel > 2) cout << "\t...# slices processed " << nbins << endl; … … 328 324 { 329 325 330 hTempHisto = hInputHisto Array->ProjectionY("",TimeSlice,TimeSlice);326 hTempHisto = hInputHisto->ProjectionY("",TimeSlice,TimeSlice); 331 327 332 328 if (verbosityLevel > 3) … … 346 342 347 343 if (verbosityLevel > 4) cout << "\t\t\t\t MaxProb of Slice " << TimeSlice << ": " << max_prop << endl; 348 hOutputMaxHisto Array->SetBinContent(TimeSlice, max_prop );344 hOutputMaxHisto->SetBinContent(TimeSlice, max_prop ); 349 345 350 346 if (verbosityLevel > 4) cout << "\t\t\t\t Mean of Slice " << TimeSlice << ": " << mean << endl; 351 hOutputMeanHisto Array->SetBinContent(TimeSlice, mean );347 hOutputMeanHisto->SetBinContent(TimeSlice, mean ); 352 348 353 349 if (verbosityLevel > 4) cout << "\t\t\t\t Median of Slice " << TimeSlice << ": " << median << endl; 354 hOutputMedianHisto Array->SetBinContent(TimeSlice, median );355 // delete h1;350 hOutputMedianHisto->SetBinContent(TimeSlice, median ); 351 delete hTempHisto; 356 352 357 353 }//Loop over Timeslices … … 369 365 ) 370 366 { 367 // TSystem this_system(); 368 // this_system.cd(path); 369 // cout << this_system.pwd(); 370 // this_system.mkdir("CSV"); 371 371 path = CurrentPixel->CsvFileName( path, overlayMethod, order); 372 372 373 TH1F* * Max_histo_array= NULL;374 TH1F* * Median_histo_array= NULL;375 TH1F* * Mean_histo_array= NULL;373 TH1F* Max_histo = NULL; 374 TH1F* Median_histo = NULL; 375 TH1F* Mean_histo = NULL; 376 376 377 377 if (overlayMethod.Contains("Maximum")) 378 378 { 379 Max_histo_array = CurrentPixel->hPixelMax;380 Median_histo _array = CurrentPixel->hPixelMedian;381 Mean_histo _array = CurrentPixel->hPixelMean;379 Max_histo = CurrentPixel->hPixelMax[order]; 380 Median_histo = CurrentPixel->hPixelMedian[order]; 381 Mean_histo = CurrentPixel->hPixelMean[order]; 382 382 } 383 383 else if (overlayMethod.Contains("Edge")) 384 384 { 385 Max_histo _array = CurrentPixel->hPixelMax;386 Median_histo _array = CurrentPixel->hPixelMedian;387 Mean_histo _array = CurrentPixel->hPixelMean;385 Max_histo = CurrentPixel->hPixelMax[order]; 386 Median_histo = CurrentPixel->hPixelMedian[order]; 387 Mean_histo = CurrentPixel->hPixelMean[order]; 388 388 } 389 389 else … … 394 394 395 395 396 Int_t nbins = Max_histo _array[order]->GetXaxis()->GetNbins();396 Int_t nbins = Max_histo->GetXaxis()->GetNbins(); 397 397 398 398 if (verbosityLevel > 0) … … 421 421 { 422 422 out << TimeSlice << "," ; 423 out << Max_histo _array[order]->GetBinContent(TimeSlice) << ",";424 out << Mean_histo _array[order]->GetBinContent(TimeSlice) << ",";425 out << Median_histo _array[order]->GetBinContent(TimeSlice) << endl;423 out << Max_histo->GetBinContent(TimeSlice) << ","; 424 out << Mean_histo->GetBinContent(TimeSlice) << ","; 425 out << Median_histo->GetBinContent(TimeSlice) << endl; 426 426 } 427 427 out.close();
Note:
See TracChangeset
for help on using the changeset viewer.