Changeset 13595 for fact/tools/rootmacros
- Timestamp:
- 05/08/12 11:49:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C
r13581 r13595 28 28 #include <TString.h> 29 29 #include <TObjArray.h> 30 #include <TF1.h> 30 31 31 32 #include <stdio.h> … … 468 469 maxPulseOrder, 469 470 verbosityLevel, 471 false, 472 NULL, 470 473 gPixelOverlayXaxisLeft, 471 474 gPixelOverlayXaxisRight, … … 534 537 removeRegionOnFallingEdge( *pZXings, 100); 535 538 findTimeOfHalfMaxLeft(*pZXings, Vcorr, gBSLMean, 5, 10, verbosityLevel ); 539 removeRegionWithToFlatSlope(*pZXings, 0.5); 536 540 if (verbosityLevel > 2) cout << "...done" << endl; 537 541 … … 577 581 // ) 578 582 // { 579 pixel[firstPixelOfSet]->Draw Histograms(583 pixel[firstPixelOfSet]->DrawOverlayHistograms( 580 584 cgpPixelPulses, 581 585 pulsesCanvasFrameNrs … … 634 638 if (ProduceGraphic) 635 639 { 636 pixel[pixelID]->Draw Histograms(640 pixel[pixelID]->DrawOverlayHistograms( 637 641 cgpPixelPulses, 638 642 pulsesCanvasFrameNrs … … 1033 1037 debugHistos[Ameas_].Draw(); 1034 1038 1039 TF1 *OneEdge; 1040 // vector<TF1*> MyEdges; 1041 int left = debugHistos[Ameas_].GetXaxis()->GetFirst(); 1042 int right = debugHistos[Ameas_].GetXaxis()->GetLast(); 1035 1043 vector<Region>::iterator reg; 1036 for (reg = pZXings->begin() ; reg < pZXings->end() ; reg++){ 1044 for (reg = pZXings->begin() ; reg < pZXings->end() ; reg++) 1045 { 1037 1046 if (reg->slopeOfRisingEdge < 0) 1038 1047 { 1039 1048 has_negative_slope = true; 1040 1049 cout << "Slope is: " << reg->slopeOfRisingEdge << endl; 1050 1051 // xBegin = (reg->halfRisingEdgePos - reg->distanceEdgeToMax); 1052 // yBegin = reg->interceptRisingEdge + reg->slopeOfRisingEdge * (xBegin) 1053 1054 OneEdge = new TF1( 1055 "OneEdge", 1056 "[0]*x+[1]", 1057 left, 1058 right 1059 ); 1060 1061 OneEdge->SetParameters( 1062 reg->slopeOfRisingEdge, 1063 reg->interceptRisingEdge 1064 ); 1065 1066 OneEdge->SetLineColor(kRed); 1067 OneEdge->SetLineWidth(1); 1068 // MyEdges.push_back(OneEdge); 1069 1070 OneEdge->Draw("SAME"); 1041 1071 } 1042 1043 } 1044 1045 cFiltered->cd(2); 1046 gPad->SetGrid(); 1047 debugHistos[Vcorr_].Draw(); 1048 1049 cFiltered->cd(3); 1050 gPad->SetGrid(); 1051 debugHistos[Vslide_].Draw(); 1052 1072 } 1073 1074 TLine *OneLine; 1053 1075 TBox *OneBox; 1054 vector<TBox*> MyBoxes;1076 // vector<TBox*> MyBoxes; 1055 1077 for (unsigned int i=0; i<pZXings->size(); i++){ 1056 1078 OneBox = new TBox( 1057 pZXings->at(i).maxPos -10 ,1058 pZXings->at(i).maxVal -0.5,1059 pZXings->at(i).maxPos +10 ,1060 pZXings->at(i).maxVal +0.5);1079 pZXings->at(i).maxPos -10 , 1080 pZXings->at(i).maxVal -0.5, 1081 pZXings->at(i).maxPos +10 , 1082 pZXings->at(i).maxVal +0.5); 1061 1083 OneBox->SetLineColor(kBlue); 1062 1084 OneBox->SetLineWidth(1); 1063 1085 OneBox->SetFillStyle(0); 1064 1086 OneBox->SetFillColor(kRed); 1065 MyBoxes.push_back(OneBox);1087 // MyBoxes.push_back(OneBox); 1066 1088 OneBox->Draw(); 1067 } 1089 1090 OneLine = new TLine( 1091 pZXings->at(i).halfRisingEdgePos, 1092 Ameas[pZXings->at(i).halfRisingEdgePos], 1093 pZXings->at(i).halfRisingEdgePos, 1094 pZXings->at(i).halfRisingEdgePos * pZXings->at(i).slopeOfRisingEdge + pZXings->at(i).interceptRisingEdge 1095 ); 1096 OneLine->SetLineColor(kBlue); 1097 OneLine->SetLineWidth(3); 1098 // MyBoxes.push_back(OneBox); 1099 OneLine->Draw(); 1100 } 1101 1102 cFiltered->cd(2); 1103 gPad->SetGrid(); 1104 debugHistos[Vcorr_].Draw(); 1105 1106 cFiltered->cd(3); 1107 gPad->SetGrid(); 1108 debugHistos[Vslide_].Draw(); 1109 1068 1110 1069 1111 // cFiltered->cd(3); … … 1086 1128 breakout=true; 1087 1129 } 1130 1131 1132 // for (unsigned int i=0; i<pZXings->size(); i++) 1133 // { 1134 // delete MyEdges.at(i) 1135 // delete MyBoxes.at(i); 1136 // } 1137 delete OneBox; 1138 delete OneEdge; 1139 delete OneLine; 1140 1141 // MyEdges.erase(); 1142 // MyBoxes.erase(); 1088 1143 } 1089 1144
Note:
See TracChangeset
for help on using the changeset viewer.