Changeset 13590 for fact/tools
- Timestamp:
- 05/08/12 09:54:40 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/pixel.C
r13583 r13590 22 22 23 23 //} 24 //Pixel::Pixel( 25 // int pixelID, 26 // int maxPulsorder, 27 // int verbosityLevel, 28 // bool stats, 29 // TFile* filename 30 // ) 31 //{ 32 // mChid = pixelID; 33 // mStats = stats; 34 // mMaxPulseOrder = maxPulsorder; 35 // mVerbosityLevel = verbosityLevel; 36 37 // hMaxOverlay = new TH2F*[mMaxPulseOrder]; 38 // hEdgeOverlay = new TH2F*[mMaxPulseOrder]; 39 // hMaxProfile = new TProfile*[mMaxPulseOrder]; 40 // hEdgeProfile = new TProfile*[mMaxPulseOrder]; 41 42 // hList = new TObjArray; 43 44 // LoadPulseHistos( filename ); 45 //} 24 46 25 47 Pixel::Pixel( … … 27 49 int maxPulsorder, 28 50 int verbosityLevel, 51 bool stats, 52 // TFile* filename, 29 53 int pixelOverlayXaxisLeft, 30 54 int pixelOverlayXaxisRight, … … 35 59 { 36 60 mChid = pixelID; 61 mStats = stats; ///TODO: HANDOVER THE VALUE 37 62 mMaxPulseOrder = maxPulsorder; 38 63 mVerbosityLevel = verbosityLevel; … … 96 121 { 97 122 if (mVerbosityLevel > 2) cout << endl << "...book pixel histograms" << endl; 98 TString histo_name;99 TString histo_title;100 101 123 for (int order = 0; order < mMaxPulseOrder; order++) 102 124 { 103 histo_name = "hMaxOverlay"; 104 histo_name += mChid; 105 histo_name += "_"; 106 histo_name += order; 107 108 histo_title = "Overlay of detected pulses of one pulse order for one Pixel "; 109 histo_title += "[Pixel_Order] "; 110 histo_title += mChid; 111 histo_title += "_"; 112 histo_title += order; 113 114 if (mVerbosityLevel > 3) cout << "\t...booking " << histo_name << endl; 125 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hMaxOverlay", order) << endl; 115 126 hMaxOverlay[order]=new TH2F( 116 histo_name, 117 histo_title, 118 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight , 119 (-1*mPixelOverlayXaxisLeft)-0.5, 120 mPixelOverlayXaxisRight-0.5 , 121 512, 122 -55.5, 123 200.5 124 ); 125 /* 126 SetHistogramAttributes( 127 "PeakMaxGaus", 128 order, 129 gMaxGausAttrib, 130 MaxAmplOfFirstPulse 131 ); 132 */ 127 HistoName("hMaxOverlay", order), 128 HistoTitle("Overlay of detected pulses of", order), 129 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight , 130 (-1*mPixelOverlayXaxisLeft)-0.5, 131 mPixelOverlayXaxisRight-0.5 , 132 512, 133 -55.5, 134 200.5 135 ); 136 133 137 hMaxOverlay[order]->SetAxisRange( 134 138 mBSLMean - 5, … … 138 142 hMaxOverlay[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 139 143 //hMaxProfile->SetBit(TH2F::kCanRebin); 144 hMaxOverlay[order]->SetStats(mStats); 140 145 hList->Add( hMaxOverlay[order] ); 141 146 142 147 //------------------------------------------------------------------------ 143 /* 144 SetHistogramAttributes( 145 "PeakMaxGaus", 146 order, 147 gMaxGausAttrib, 148 MaxAmplOfFirstPulse 149 ); 150 */ 151 histo_name = "hEdgeOverlay"; 152 histo_name += mChid; 153 histo_name += "_"; 154 histo_name += order; 155 156 histo_title = "Overlay at rising edge of detected pulses of one pulse order for one Pixel "; 157 histo_title += "[Pixel_Order] "; 158 histo_title += mChid; 159 histo_title += "_"; 160 histo_title += order; 161 162 if (mVerbosityLevel > 3) cout << "\t...booking " << histo_name << endl; 148 149 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hEdgeOverlay", order) << endl; 163 150 hEdgeOverlay[order] = new TH2F( 164 histo_name,165 histo_title,151 HistoName("hEdgeOverlay", order), 152 HistoTitle("Overlay at rising edge of detected pulses of", order), 166 153 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight , 167 154 (-1*mPixelOverlayXaxisLeft)-0.5, … … 178 165 hEdgeOverlay[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 179 166 hEdgeOverlay[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 167 hEdgeOverlay[order]->SetStats(mStats); 180 168 hList->Add( hEdgeOverlay[order] ); 181 169 182 170 //------------------------------------------------------------------------ 183 /* 184 SetHistogramAttributes( 185 "PeakMaxGaus", 186 order, 187 gMaxGausAttrib, 188 MaxAmplOfFirstPulse 189 ); 190 */ 191 histo_name = "hMaxProfile"; 192 histo_name += mChid; 193 histo_name += "_"; 194 histo_name += order; 195 196 histo_title = "Mean value of each slice in overlay plot (Tprofile) "; 197 histo_title += "[Pixel_Order] "; 198 histo_title += mChid; 199 histo_title += "_"; 200 histo_title += order; 201 202 if (mVerbosityLevel > 3) cout << "\t...booking " << histo_name << endl; 171 172 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hMaxProfile", order) << endl; 203 173 hMaxProfile[order] = new TProfile( 204 histo_name,205 histo_title,174 HistoName("hMaxProfile", order), 175 HistoTitle("Mean value of each slice in overlay plot (Tprofile)", order), 206 176 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx 207 177 (-1*mPixelOverlayXaxisLeft)-0.5, //xlow … … 218 188 hMaxProfile[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 219 189 //hMaxProfile->SetBit(TH2F::kCanRebin); 190 hMaxProfile[order]->SetStats(mStats); 220 191 hList->Add( hMaxProfile[order] ); 221 192 222 193 223 194 //------------------------------------------------------------------------ 224 /* 225 SetHistogramAttributes( 226 "PeakMaxGaus", 227 order, 228 gMaxGausAttrib, 229 MaxAmplOfFirstPulse 230 ); 231 */ 232 histo_name = "hEdgeProfile"; 233 histo_name += mChid; 234 histo_name += "_"; 235 histo_name += order; 236 237 histo_title = "Mean value of each slice in overlay plot (Tprofile) "; 238 histo_title += "[Pixel_Order] "; 239 histo_title += mChid; 240 histo_title += "_"; 241 histo_title += order; 242 243 if (mVerbosityLevel > 3) cout << "\t...booking " << histo_name << endl; 195 196 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hEdgeProfile", order) << endl; 244 197 hEdgeProfile[order] = new TProfile( 245 histo_name,246 histo_title,198 HistoName("hEdgeProfile", order), 199 HistoTitle("Mean value of each slice in overlay plot (Tprofile)", order), 247 200 mPixelOverlayXaxisLeft + mPixelOverlayXaxisRight ,//nbinsx 248 201 (-1*mPixelOverlayXaxisLeft)-0.5, //xlow … … 260 213 hEdgeProfile[order]->GetYaxis()->SetTitle( "Amplitude [mV]" ); 261 214 //hMaxProfile->SetBit(TH2F::kCanRebin); 215 hEdgeProfile[order]->SetStats(mStats); 262 216 hList->Add( hEdgeProfile[order] ); 263 217 … … 299 253 int x_min = 0; 300 254 int x_max = 0; 301 TString histo_name;302 TString histo_title;303 255 304 256 for (int order =0; order < mMaxPulseOrder; order++) … … 310 262 if (mOptions.Contains("S")) 311 263 { 312 313 histo_name = "hSlopeRisingEdge"; 314 histo_name += mChid; 315 histo_name += "_"; 316 histo_name += order; 317 histo_title = "Distribution of rising edge's slope [Pixel_Order] "; 318 histo_title += mChid; 319 histo_title += "_"; 320 histo_title += order; 321 if (mVerbosityLevel > 3) cout << "\t...booking " << histo_name << endl; 264 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hSlopeRisingEdge", order) << endl; 322 265 hSlopeRisingEdge[order] = new TH1F ( 323 histo_name,324 histo_title,266 HistoName("hSlopeRisingEdge", order), 267 HistoTitle("Distribution of rising edge's slope", order), 325 268 600, 326 269 -10.1, 327 270 10.1 328 271 ); 272 hSlopeRisingEdge[order]->SetAxisRange( 273 -1, 274 7, 275 "X"); 329 276 hSlopeRisingEdge[order]->GetXaxis()->SetTitle( "Slope Amplitude/time [mV/timeslices]" ); 330 277 hSlopeRisingEdge[order]->GetYaxis()->SetTitle( "counts" ); 278 hSlopeRisingEdge[order]->SetStats(mStats); 331 279 hList->Add( hSlopeRisingEdge[order] ); 332 280 } … … 337 285 x_max = 35; 338 286 339 histo_name = "hRisingEdgeToMax"; 340 histo_name += mChid; 341 histo_name += "_"; 342 histo_name += order; 343 histo_title = "Distance from rising edge to pulse's maximum [Pixel_Order] "; 344 histo_title += mChid; 345 histo_title += "_"; 346 histo_title += order; 347 if (mVerbosityLevel > 3) cout << "\t...booking " << histo_name << endl; 287 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hRisingEdgeToMax", order) << endl; 348 288 hRisingEdgeToMax[order] = new TH1I ( 349 histo_name,350 histo_title,289 HistoName("hRisingEdgeToMax", order), 290 HistoTitle("Distance from rising edge to pulse's maximum", order), 351 291 x_max -x_min, 352 292 x_min, 353 293 x_max 354 294 ); 295 hSlopeRisingEdge[order]->SetAxisRange( 296 -5, 297 25, 298 "X"); 355 299 hRisingEdgeToMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 356 300 hRisingEdgeToMax[order]->GetYaxis()->SetTitle( "counts" ); 301 hRisingEdgeToMax[order]->SetStats(mStats); 357 302 hList->Add( hRisingEdgeToMax[order] ); 358 303 } … … 362 307 x_min = 10; 363 308 x_max = 290; 364 365 histo_name = "hPosOfMax"; 366 histo_name += mChid; 367 histo_name += "_"; 368 histo_name += order; 369 histo_title = "Distribution of pulse's maximum's positon [Pixel_Order] "; 370 histo_title += mChid; 371 histo_title += "_"; 372 histo_title += order; 373 if (mVerbosityLevel > 3) cout << "\t...booking " << histo_name << endl; 309 if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hPosOfMax", order) << endl; 374 310 hPosOfMax[order] = new TH1I ( 375 histo_name,376 histo_title,311 HistoName("hPosOfMax", order), 312 HistoTitle("Distribution of pulse's maximum's positon", order), 377 313 x_max - x_min, 378 314 x_min, … … 381 317 hPosOfMax[order]->GetXaxis()->SetTitle( "Timeslices [a.u.]" ); 382 318 hPosOfMax[order]->GetYaxis()->SetTitle( "counts" ); 319 hRisingEdgeToMax[order]->SetStats(mStats); 383 320 hList->Add( hPosOfMax[order] ); 384 321 } … … 571 508 //---------------------------------------------------------------------------- 572 509 510 void 511 Pixel::LoadPulseHistos( 512 TFile* filename 513 ) 514 { 515 filename->cd(); 516 filename->cd(CreateSubDirName( mChid )); 517 for (int order = 0; order < mMaxPulseOrder; order++) 518 { 519 hMaxOverlay[order] = (TH2F*)filename->Get( HistoName("hMaxOverlay", order) ); 520 hEdgeOverlay[order] = (TH2F*)filename->Get( HistoName("hEdgeOverlay", order) ); 521 hMaxProfile[order] = (TProfile*)filename->Get( HistoName("hMaxProfile", order) ); 522 hEdgeProfile[order] = (TProfile*)filename->Get( HistoName("hEdgeProfile", order) ); 523 } 524 } 525 526 TString 527 Pixel::HistoName( 528 TString histoname, 529 int order 530 ) 531 { 532 histoname += mChid; 533 histoname += "_"; 534 histoname += order; 535 return histoname; 536 } 537 538 TString 539 Pixel::HistoTitle( 540 TString histo_title, 541 int order 542 ) 543 { 544 histo_title += " [Pixel_Order] "; 545 histo_title += mChid; 546 histo_title += "_"; 547 histo_title += order; 548 return histo_title; 549 } 550 551 573 552 //============================= ACESS =================================== 574 553 //============================= INQUIRY ===================================
Note:
See TracChangeset
for help on using the changeset viewer.