Changeset 13610
- Timestamp:
- 05/09/12 12:52:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FPulseOverlay.C
r13602 r13610 178 178 void FillHistograms(Pixel*, vector<Region>*, int, int, int , int ); 179 179 void DrawTestHistograms( int); 180 voidProduceDebugHistos( vector<Region> *pZXings);180 bool ProduceDebugHistos( vector<Region> *pZXings); 181 181 bool UseThisPulse( int, int, int, int, int, int); 182 182 void UpdateCanvases( int, int, bool); … … 191 191 const char* datafilename = "/fact/raw/2011/11/09/20111109_006.fits.gz", 192 192 const char* drsfilename = "/fact/raw/2011/11/09/20111109_003.drs.fits.gz", 193 const char* OutRootFileName = "/home_nfs/isdc/jbbuss/analysis/FPulseTemplate/ test.root",194 bool ProduceGraphic = true,195 bool spikeDebug = true,196 bool debugPixel = true,193 const char* OutRootFileName = "/home_nfs/isdc/jbbuss/analysis/FPulseTemplate/20111109_006/Overlay/pulseoverlay.root", 194 bool ProduceGraphic = false, 195 bool spikeDebug = false, 196 bool debugPixel = false, 197 197 bool testmode = false, 198 198 bool saveResults = true, 199 199 int verbosityLevel = 1, // different verbosity levels can be implemented here 200 200 int firstevent = 1, // Hast to be between 1 and infinity NOT 0!!!! 201 int nevents = 100,202 int firstpixel = 15,203 int npixel = 3,204 int pixelSetSize = 40,201 int nevents = -1, 202 int firstpixel = 0, 203 int npixel = -1, 204 int pixelSetSize = 120, 205 205 int maxPulseOrder = 3, 206 206 int AmplWindowWidth = 14, //Width of Window for selection of pulses to histograms … … 386 386 //----------------------------------------------------------------------------- 387 387 388 if (spikeDebug) 389 BookDebugHistos(verbosityLevel ); 388 390 389 391 390 if (testmode) … … 565 564 if ( spikeDebug ) 566 565 { 567 ProduceDebugHistos( pZXings ); 566 BookDebugHistos(verbosityLevel ); 567 breakout = ProduceDebugHistos( pZXings ); 568 568 }// end of if(spikeDebug) 569 569 … … 1025 1025 //---------------------------------------------------------------------------- 1026 1026 1027 void 1027 bool 1028 1028 ProduceDebugHistos( 1029 1029 vector<Region>* pZXings … … 1045 1045 debugHistos[Vcfd2_].SetBinContent( sl, Vcfd2[sl] ); 1046 1046 } 1047 1047 1048 bool has_negative_slope = false; 1048 1049 cFiltered->cd(1); … … 1050 1051 debugHistos[Ameas_].Draw(); 1051 1052 1052 TF1 *OneEdge; 1053 // vector<TF1*> MyEdges; 1053 TF1 *OneEdge; 1054 TLine *OneLine; 1055 TBox *OneBox; 1056 vector<TF1*> MyEdges; 1057 vector<TBox*> MyBoxes; 1058 vector<TBox*> MyLines; 1059 1054 1060 int left = debugHistos[Ameas_].GetXaxis()->GetFirst(); 1055 1061 int right = debugHistos[Ameas_].GetXaxis()->GetLast(); … … 1060 1066 { 1061 1067 has_negative_slope = true; 1062 cout << "Slope is: " << reg->slopeOfRisingEdge << endl; 1068 } 1069 } 1070 1071 if (has_negative_slope) 1072 { 1073 for (unsigned int i=0; i<pZXings->size(); i++){ 1074 Region* reg = &pZXings->at(i); 1075 cout << "Slope is: " << reg->slopeOfRisingEdge << endl; 1063 1076 1064 1077 // xBegin = (reg->halfRisingEdgePos - reg->distanceEdgeToMax); 1065 1078 // yBegin = reg->interceptRisingEdge + reg->slopeOfRisingEdge * (xBegin) 1066 1079 1067 OneEdge = new TF1( 1068 "OneEdge", 1069 "[0]*x+[1]", 1070 left, 1071 right 1072 ); 1073 1074 OneEdge->SetParameters( 1075 reg->slopeOfRisingEdge, 1076 reg->interceptRisingEdge 1077 ); 1078 1079 OneEdge->SetLineColor(kRed); 1080 OneEdge->SetLineWidth(1); 1081 // MyEdges.push_back(OneEdge); 1082 1083 OneEdge->Draw("SAME"); 1084 } 1085 } 1086 1087 TLine *OneLine; 1088 TBox *OneBox; 1089 // vector<TBox*> MyBoxes; 1090 for (unsigned int i=0; i<pZXings->size(); i++){ 1091 OneBox = new TBox( 1092 pZXings->at(i).maxPos -10 , 1093 pZXings->at(i).maxVal -0.5, 1094 pZXings->at(i).maxPos +10 , 1095 pZXings->at(i).maxVal +0.5); 1096 OneBox->SetLineColor(kBlue); 1097 OneBox->SetLineWidth(1); 1098 OneBox->SetFillStyle(0); 1099 OneBox->SetFillColor(kRed); 1100 // MyBoxes.push_back(OneBox); 1101 OneBox->Draw(); 1102 1103 OneLine = new TLine( 1104 pZXings->at(i).halfRisingEdgePos, 1105 Ameas[pZXings->at(i).halfRisingEdgePos], 1106 pZXings->at(i).halfRisingEdgePos, 1107 pZXings->at(i).halfRisingEdgePos * pZXings->at(i).slopeOfRisingEdge + pZXings->at(i).interceptRisingEdge 1108 ); 1109 OneLine->SetLineColor(kBlue); 1110 OneLine->SetLineWidth(3); 1111 // MyBoxes.push_back(OneBox); 1112 OneLine->Draw(); 1080 OneEdge = new TF1( 1081 "OneEdge", 1082 "[0]*x+[1]", 1083 left, 1084 right 1085 ); 1086 1087 OneEdge->SetParameters( 1088 reg->slopeOfRisingEdge, 1089 reg->interceptRisingEdge 1090 ); 1091 1092 OneEdge->SetLineColor(kRed); 1093 OneEdge->SetLineWidth(1); 1094 MyEdges.push_back(OneEdge); 1095 1096 OneEdge->Draw("SAME"); 1097 // delete OneEdge; 1098 1099 OneBox = new TBox( 1100 pZXings->at(i).maxPos -10 , 1101 pZXings->at(i).maxVal -0.5, 1102 pZXings->at(i).maxPos +10 , 1103 pZXings->at(i).maxVal +0.5); 1104 OneBox->SetLineColor(kBlue); 1105 OneBox->SetLineWidth(1); 1106 OneBox->SetFillStyle(0); 1107 OneBox->SetFillColor(kRed); 1108 MyBoxes.push_back(OneBox); 1109 OneBox->Draw(); 1110 1111 OneLine = new TLine( 1112 pZXings->at(i).halfRisingEdgePos, 1113 Ameas[pZXings->at(i).halfRisingEdgePos], 1114 pZXings->at(i).halfRisingEdgePos, 1115 pZXings->at(i).halfRisingEdgePos * pZXings->at(i).slopeOfRisingEdge + pZXings->at(i).interceptRisingEdge 1116 ); 1117 OneLine->SetLineColor(kBlue); 1118 OneLine->SetLineWidth(3); 1119 MyLines.push_back(OneBox); 1120 OneLine->Draw(); 1113 1121 } 1114 1122 1115 1123 cFiltered->cd(2); 1116 1124 gPad->SetGrid(); 1117 debugHistos[Vcorr_].Draw(); 1125 debugHistos[Vslide_].Draw(); 1126 debugHistos[Vcorr_].Draw("SAME"); 1127 1128 for (unsigned int i=0; i<MyEdges.size(); i++){ 1129 MyEdges.at(i)->Draw("SAME"); 1130 } 1131 for (unsigned int i=0; i<MyBoxes.size(); i++){ 1132 MyBoxes.at(i)->Draw(); 1133 } 1134 for (unsigned int i=0; i<MyLines.size(); i++){ 1135 MyLines.at(i)->Draw(); 1136 } 1118 1137 1119 1138 cFiltered->cd(3); 1120 1139 gPad->SetGrid(); 1121 debugHistos[Vslide_].Draw(); 1140 debugHistos[Vcorr_].SetLineColor(kBlue); 1141 debugHistos[Vcorr_].Draw(); 1142 debugHistos[Ameas_].Draw("SAME"); 1143 debugHistos[Vslide_].SetLineColor(kRed); 1144 debugHistos[Vslide_].Draw("SAME"); 1145 debugHistos[Vcfd_].SetLineColor(kGreen); 1146 debugHistos[Vcfd_].Draw("SAME"); 1147 debugHistos[Vcfd2_].SetLineColor(kViolet); 1148 debugHistos[Vcfd2_].Draw("SAME"); 1149 for (unsigned int i=0; i<MyEdges.size(); i++){ 1150 MyEdges.at(i)->Draw("SAME"); 1151 } 1152 for (unsigned int i=0; i<MyBoxes.size(); i++){ 1153 MyBoxes.at(i)->Draw(); 1154 } 1155 for (unsigned int i=0; i<MyLines.size(); i++){ 1156 MyLines.at(i)->Draw(); 1157 } 1122 1158 1123 1159 … … 1128 1164 // zeroline->SetLineColor(kBlue); 1129 1165 // zeroline->Draw(); 1130 if (has_negative_slope) 1131 { 1166 1132 1167 cFiltered->Update(); 1133 1168 … … 1139 1174 timer.TurnOff(); 1140 1175 if (input=="q\n") { 1141 breakout=true; 1142 } 1143 1176 return true; 1177 } 1178 1179 MyLines.clear(); 1180 MyBoxes.clear(); 1181 MyEdges.clear(); 1144 1182 1145 1183 // for (unsigned int i=0; i<pZXings->size(); i++) … … 1148 1186 // delete MyBoxes.at(i); 1149 1187 // } 1150 delete OneBox;1151 delete OneEdge;1152 delete OneLine;1188 // delete OneBox; 1189 // delete OneEdge; 1190 // delete OneLine; 1153 1191 1154 1192 // MyEdges.erase(); … … 1159 1197 // do some Garbage collection ... 1160 1198 // all the Objects on the heap should be deleted here. 1161 1199 return false; 1162 1200 }// end of if(spikeDebug) 1163 1201
Note:
See TracChangeset
for help on using the changeset viewer.