#include <AlignmentHistograms.h>
|
||||||||||||
|
Definition at line 51 of file AlignmentHistograms.cxx. References PlexScintMdlId::GetModule(), PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneView(), UgliGeomHandle::GetScintPlnHandleVector(), PlexStripEndId::GetStrip(), MSG, and UgliGeomHandle::xyz2uvz(). 00053 :fRootFileName(filename), 00054 fScale(1.06), 00055 fStripSampleSize(500), 00056 fMdlSampleSize(5000), 00057 fMinNumOfEntriesForFit(150), 00058 fnplanes(0), 00059 fnstrips(0), 00060 fNResidualBins(400), 00061 fResidualLimit(0.2), 00062 fResidualStripBinWidth(0.001), 00063 fResidualMdlBinWidth(0.001), 00064 fNResidualBinsStrip(60), 00065 fResidualLimitStrip(0.12), 00066 fNChargeBins(1000), 00067 fChargeLimit(10000.0), 00068 fNTrackChargeBins(2000), 00069 fTrackChargeLimit(100000.0), 00070 fNHitsBins(100), 00071 fTrackResidualRMSBins(1000), 00072 fTrackResidualRMSLimit(0.2), 00073 fNCosBins(600), 00074 fMdlRotationResidualBinWidth(0.4), 00075 fStripRotationResidualBinWidth(0.5), 00076 fMdlRotationResidualSampleSize(10000), 00077 fMuonPathLengthBinWidth(0.3), 00078 //Histograms from here down 00079 fChargesInAllHitStrip(0), 00080 fhCharge2dTracksU(0), 00081 fhCharge2dTracksV(0), 00082 fhNStrip2dTracksU(0), 00083 fhNStrip2dTracksV(0), 00084 fhCharge2dAltTracksU(0), 00085 fhCharge2dAltTracksV(0), 00086 fhNStrip2dAltTracksU(0), 00087 fhNStrip2dAltTracksV(0), 00088 fChargevsResidualHitStrips(0), 00089 fResidualAllStrips(0), 00090 fResidualVStrips(0), 00091 fResidualUStrips(0), 00092 fTrackResidualRMSVview(0), 00093 fTrackResidualRMSUview(0), 00094 fChargeHistogramRatio2dTracks(0), 00095 fChargeRatioOf2dTracks(0), 00096 fhFittedStripResidualvsPlane(0), 00097 fhFittedStripResidualSigmavsPlane(0), 00098 fhTrackHoughCosU(0), 00099 fhTrackHoughCosV(0), 00100 fhTrackHoughCosZ(0), 00101 fhSigmaOfTPosVview(0), 00102 fhSigmaOfTPosUview(0), 00103 fhSigmaOfTPosVviewAlt(0), 00104 fhSigmaOfTPosUviewAlt(0), 00105 fhHistogramStripResidualvsPlane(0), 00106 fhSampleStripResidualvsPlane(0), 00107 fhStripLongitudinalHitPos(0), 00108 fhResidualFitSigmavsMuonPathLength(0), 00109 fhResidualFitMeanvsMuonPathLength(0), 00110 fhResidualFitChi2vsMuonPathLength(0), 00111 fhResidualFitBinEntriesvsMuonPathLength(0), 00112 fhMuonPathLengthResidualFitSigma(0), 00113 fhMuonPathLengthResidualFitMean(0), 00114 fhMuonPathLengthResidualFitChi2(0), 00115 fhMuonPathLengthResidualFitBinEntries(0), 00116 fhNHigherChargeNonTrackPlaneHitsvsPlane(0), 00117 fhTrackChargeOverTotalChargeRatio(0), 00118 fhRoundingErrorY(0), 00119 fhRoundingErrorZ(0), 00120 fhCosX(0), 00121 fhCosY(0), 00122 fhCosZ(0), 00123 fhTrackLength(0), 00124 //2D histograms from here down 00125 f2hNumberOfTrackHitsPerStrip(0), 00126 f2hNumberOfTrackHitsPerModule(0), 00127 f2hChargevsResidualHitStrips(0), 00128 f2hResidualvsPlane(0), 00129 f2hMeanChargePlaneStrip(0), 00130 f2hMeanPathCorrChargePlaneStrip(0), 00131 f2hRoundingErrorY(0), 00132 f2hRoundingErrorZ(0), 00133 f2hCosXvsCosZ(0), 00134 f2hCosYvsCosZ(0), 00135 f2hCosYvsCosX(0), 00136 //Track TProfile histograms from here down 00137 fpTPosSigmavsCosZVview(0), 00138 fpTPosSigmavsCosZUview(0), 00139 fpTPosSigmavsTrackChargeVview(0), 00140 fpTPosSigmavsTrackChargeUview(0), 00141 fpTPosSigmavsTrackNStripsVview(0), 00142 fpTPosSigmavsTrackNStripsUview(0), 00143 fpTPosSigmavsTrackChargeRatioVview(0), 00144 fpTPosSigmavsTrackChargeRatioUview(0), 00145 fp3dTrackChargevsTrackChargeRatio(0), 00146 fp3dTrackChargevsTrackCosz(0), 00147 fp3dTrackNStripsvsCosz(0), 00148 fp3dTrackChargevsNStrips(0), 00149 fp3dTrackChargeRatiovsCosz(0), 00150 //Strip TProfile histograms 00151 fpResidualvsPlane(0), 00152 fpResidualvsCosZVview(0), 00153 fpResidualvsCosZUview(0), 00154 fpResidualvsTPosSigmaVview(0), 00155 fpResidualvsTPosSigmaUview(0), 00156 fpResidualvsStripChargeVview(0), 00157 fpResidualvsStripChargeUview(0), 00158 fpResidualvsTrackChargeVview(0), 00159 fpResidualvsTrackChargeUview(0), 00160 fpResidualvsTrackNStripsVview(0), 00161 fpResidualvsTrackNStripsUview(0), 00162 fpResidualvsTrackChargeRatioVview(0), 00163 fpResidualvsTrackChargeRatioUview(0), 00164 fpResidualvsMuonPathLength(0), 00165 fpMeanStripResponsevsResidual(0) 00166 { 00167 00168 MSG("Align", Msg::kInfo) << "Constructor AlignmentHistograms() " << endl; 00169 00170 fHistogramFile = new TFile(fRootFileName,"RECREATE"); 00171 00172 MSG("Align", Msg::kInfo) << "Created root file " << fHistogramFile->GetName() << endl; 00173 00174 fStripResidualDirectory = new TDirectory("StripResidualHistograms","StripResidualHistograms"); 00175 fModuleResidualDirectory = new TDirectory("ModuleResidual","ModuleResidual"); 00176 fPlaneResidualDirectory = new TDirectory("PlaneResidual","PlaneResidual"); 00177 fMdlRotationalResidualDirectory = new TDirectory("MdlRotationalResidual","MdlRotationalResidual"); 00178 fPlaneRotationalResidualDirectory = new TDirectory("PlaneRotationalResidual","PlaneRotationalResidual"); 00179 fStripRotationalResidualDirectory = new TDirectory("StripRotationalResidual","StripRotationalResidual"); 00180 fStripChargeDirectory = new TDirectory("StripChargeHistograms","StripChargeHistograms"); 00181 fPlanePlexDirectory = new TDirectory("PlanePlex","PlanePlex"); 00182 fStripAttenDirectory = new TDirectory("StripAttenuationHistograms","StripAttenuationHistograms"); 00183 fStripOccupancyDirectory = new TDirectory("StripOccupancy","StripOccupancy"); 00184 fResidualSummaryDirectory = new TDirectory("ResidualSummary","ResidualSummary"); 00185 fTrackDirectory = new TDirectory("TrackData","TrackData"); 00186 fHitPositionSummaryDirectory = new TDirectory("HitPositionSummary","HitPositionSummary"); 00187 fMultipleScatteringDirectory = new TDirectory("MultipleScattering","MultipleScattering"); 00188 00189 fHistogramFile -> cd(); 00190 00191 UgliGeomHandle ugh(vld); 00192 vector<UgliScintPlnHandle> uph = ugh.GetScintPlnHandleVector(); 00193 for(vector<UgliScintPlnHandle>::iterator it = uph.begin(); it != uph.end(); ++it){ 00194 00195 if(it -> GetPlaneNumber() > fnplanes) 00196 fnplanes = it -> GetPlaneNumber(); 00197 double plowerlimit = 100.0, pupperlimit = -100.0; 00198 00199 vector<UgliStripHandle> ushv = it -> GetStripHandleVector(); 00200 for(vector<UgliStripHandle>::iterator sit = ushv.begin(); sit != ushv.end(); ++sit){ 00201 PlexStripEndId plexid = sit -> GetSEId(); 00202 00203 if(plexid.GetStrip() > fnstrips) 00204 fnstrips = plexid.GetStrip(); 00205 00206 Double_t halflen = sit -> GetHalfLength(); 00207 TVector3 localWestEnd(+halflen, 0, 0); 00208 TVector3 localEastEnd(-halflen, 0, 0); 00209 TVector3 globalWestEndxyz = sit -> LocalToGlobal(localWestEnd); 00210 TVector3 globalEastEndxyz = sit -> LocalToGlobal(localEastEnd); 00211 TVector3 globalWestEnduvz = ugh.xyz2uvz(globalWestEndxyz); 00212 TVector3 globalEastEnduvz = ugh.xyz2uvz(globalEastEndxyz); 00213 00214 if(plexid.GetPlaneView() == PlaneView::kU){ 00215 if(plowerlimit > globalWestEnduvz.y()) 00216 plowerlimit = globalWestEnduvz.y(); 00217 if(pupperlimit < globalEastEnduvz.y()) 00218 pupperlimit = globalEastEnduvz.y(); 00219 } else { 00220 if(plowerlimit > globalEastEnduvz.x()) 00221 plowerlimit = globalEastEnduvz.x(); 00222 if(pupperlimit < globalWestEnduvz.x()) 00223 pupperlimit = globalWestEnduvz.x(); 00224 } 00225 } 00226 00227 PlexPlaneId planeid = it -> GetPlexPlaneId(); 00228 fpPlaneRotationalResidual[planeid] = 00229 GetPlaneRotationalResidualHistogram(planeid.GetPlane(), plowerlimit, pupperlimit); 00230 00231 vector<UgliScintMdlHandle> umhv = it -> GetScintMdlHandleVector(); 00232 for(vector<UgliScintMdlHandle>::iterator mit = umhv.begin(); mit != umhv.end(); ++mit){ 00233 PlexScintMdlId plexmdlid = mit -> GetPlexScintMdlId(); 00234 double mlowerlimit = 100.0, mupperlimit = -100.0; 00235 00236 for(vector<UgliStripHandle>::iterator sit = ushv.begin(); sit != ushv.end(); ++sit){ 00237 if(plexmdlid != (sit->GetScintMdlHandle()).GetPlexScintMdlId()) 00238 continue; 00239 00240 Double_t halflen = sit -> GetHalfLength(); 00241 Double_t lpos = sit -> GetLPosRelMdl(); 00242 00243 if(mlowerlimit > lpos - halflen) 00244 mlowerlimit = lpos - halflen; 00245 if(mupperlimit < lpos + halflen) 00246 mupperlimit = lpos + halflen; 00247 } 00248 00249 fpMdlRotationalResidual[plexmdlid] = 00250 GetMdlRotationalResidualHistogram(plexmdlid.GetPlane(), plexmdlid.GetModule(), 00251 mlowerlimit, mupperlimit); 00252 } 00253 } 00254 00255 fHistogramFile -> cd(); 00256 00257 fChargesInAllHitStrip = new TH1D("ChargesInAllHitStrip", 00258 "Charge in all hit strips", 00259 fNChargeBins, 0, fChargeLimit); 00260 fChargesInAllHitStrip -> GetXaxis() -> SetTitle("Raw ADC"); 00261 fChargesInAllHitStrip -> GetXaxis() -> CenterTitle(); 00262 00263 00264 fChargevsResidualHitStrips = new TH1D("ChargevsResidualHitStrips2h", 00265 "Charge of hit strip vs fited residual", 00266 2*fNResidualBins , -fResidualLimit, fResidualLimit); 00267 fChargevsResidualHitStrips -> GetXaxis() -> SetTitle("residual (m)"); 00268 fChargevsResidualHitStrips -> GetXaxis() -> CenterTitle(); 00269 fChargevsResidualHitStrips -> GetYaxis() -> SetTitle("Raw ADC"); 00270 fChargevsResidualHitStrips -> GetYaxis() -> CenterTitle(); 00271 00272 00273 f2hChargevsResidualHitStrips = new TH2D("ChargevsResidualHitStrips", 00274 "Charge of hit strip vs fited residual", 00275 2*fNResidualBins , -fResidualLimit, fResidualLimit, 00276 fNChargeBins, 0, fChargeLimit); 00277 f2hChargevsResidualHitStrips -> GetXaxis() -> SetTitle("residual (m)"); 00278 f2hChargevsResidualHitStrips -> GetXaxis() -> CenterTitle(); 00279 f2hChargevsResidualHitStrips -> GetYaxis() -> SetTitle("Raw ADC"); 00280 f2hChargevsResidualHitStrips -> GetYaxis() -> CenterTitle(); 00281 00282 fResidualSummaryDirectory -> cd(); 00283 00284 fResidualAllStrips = new TH1D("ResidualAllStrips", 00285 "Residuals of all strips", 00286 2*fNResidualBins , -fResidualLimit, fResidualLimit); 00287 fResidualAllStrips -> GetXaxis() -> SetTitle("residual (m)"); 00288 fResidualAllStrips -> GetXaxis() -> CenterTitle(); 00289 00290 00291 fResidualUStrips = new TH1D("ResidualUStrips", 00292 "Residuals of U strips", 00293 2*fNResidualBins , -fResidualLimit, fResidualLimit); 00294 fResidualUStrips -> GetXaxis() -> SetTitle("residual (m)"); 00295 fResidualUStrips -> GetXaxis() -> CenterTitle(); 00296 00297 00298 fResidualVStrips = new TH1D("ResidualVStrips", 00299 "Residuals of V strips", 00300 2*fNResidualBins , -fResidualLimit, fResidualLimit); 00301 fResidualVStrips -> GetXaxis() -> SetTitle("residual (m)"); 00302 fResidualVStrips -> GetXaxis() -> CenterTitle(); 00303 00304 f2hResidualvsPlane = new TH2D("ResidualvsPlane", 00305 "Residual vs plane number, all events", 00306 fnplanes, 0, fnplanes, 00307 2*fNResidualBins , -fResidualLimit, fResidualLimit); 00308 f2hResidualvsPlane -> GetYaxis() -> SetTitle("residual (m)"); 00309 f2hResidualvsPlane -> GetYaxis() -> CenterTitle(); 00310 f2hResidualvsPlane -> GetXaxis() -> SetTitle("plane number"); 00311 f2hResidualvsPlane -> GetXaxis() -> CenterTitle(); 00312 00313 fHistogramFile -> cd(); 00314 00315 f2hNumberOfTrackHitsPerStrip = new TH2D("NumberOfTrackHitsPerStrip", 00316 "Strip vs plane for track hits", 00317 fnplanes, 0, fnplanes, 00318 fnstrips, 0, fnstrips); 00319 f2hNumberOfTrackHitsPerStrip -> GetXaxis() -> SetTitle("plane number"); 00320 f2hNumberOfTrackHitsPerStrip -> GetXaxis() -> CenterTitle(); 00321 f2hNumberOfTrackHitsPerStrip -> GetYaxis() -> SetTitle("strip number"); 00322 f2hNumberOfTrackHitsPerStrip -> GetYaxis() -> CenterTitle(); 00323 00324 00325 f2hNumberOfTrackHitsPerModule = new TH2D("NumberOfTrackHitsPerModule", 00326 "Module vs plane for track hits", 00327 fnplanes, 0, fnplanes, 00328 5, 0, 5); 00329 f2hNumberOfTrackHitsPerModule -> GetXaxis() -> SetTitle("plane number"); 00330 f2hNumberOfTrackHitsPerModule -> GetXaxis() -> CenterTitle(); 00331 f2hNumberOfTrackHitsPerModule -> GetYaxis() -> SetTitle("module number"); 00332 f2hNumberOfTrackHitsPerModule -> GetYaxis() -> CenterTitle(); 00333 00334 00335 fResidualSummaryDirectory -> cd(); 00336 00337 //____________________________________________________________________________________________ 00338 fpMeanStripResponsevsResidual = new TProfile("MeanStripResponsevsResidual", 00339 "Response of scintilator vs residual, path length corrected", 00340 2*fNResidualBins , -fResidualLimit, fResidualLimit); 00341 fpMeanStripResponsevsResidual -> GetXaxis() -> SetTitle("residual (m)"); 00342 fpMeanStripResponsevsResidual -> GetXaxis() -> CenterTitle(); 00343 fpMeanStripResponsevsResidual -> GetYaxis() -> SetTitle("charge (ADC)"); 00344 fpMeanStripResponsevsResidual -> GetYaxis() -> CenterTitle(); 00345 00346 //_______________________________________________________________________________ 00347 fpResidualvsPlane = new TProfile("ProfileResidualvsPlane", 00348 "Residual vs plane number", 00349 fnplanes, 0.0, fnplanes, "s"); 00350 fpResidualvsPlane -> GetYaxis() -> SetTitle("residual (m)"); 00351 fpResidualvsPlane -> GetYaxis() -> CenterTitle(); 00352 00353 //_______________________________________________________________________________ 00354 fpResidualvsCosZVview = new TProfile("ResidualvsCosZVview", 00355 "Residual vs cos with Z axis V planes", 00356 100, -1.0, 1.0); 00357 fpResidualvsCosZVview -> GetYaxis() -> SetTitle("residual (m)"); 00358 fpResidualvsCosZVview -> GetYaxis() -> CenterTitle(); 00359 00360 fpResidualvsCosZUview = new TProfile("ResidualvsCosZUview", 00361 "Residual vs cos with Z axis U plane", 00362 100, -1.0, 1.0); 00363 fpResidualvsCosZUview -> GetYaxis() -> SetTitle("residual (m)"); 00364 fpResidualvsCosZUview -> GetYaxis() -> CenterTitle(); 00365 00366 //____________________________________________________________________________________________ 00367 fpResidualvsTPosSigmaVview = new TProfile("ResidualvsTPosSigmaVview", 00368 "Residual vs tpos error V planes", 00369 100, 0, 0.05); 00370 fpResidualvsTPosSigmaVview -> GetYaxis() -> SetTitle("residual (m)"); 00371 fpResidualvsTPosSigmaVview -> GetYaxis() -> CenterTitle(); 00372 fpResidualvsTPosSigmaVview -> GetXaxis() -> SetTitle("error in tpos (m)"); 00373 fpResidualvsTPosSigmaVview -> GetXaxis() -> CenterTitle(); 00374 00375 fpResidualvsTPosSigmaUview = new TProfile("ResidualvsTPosSigmaUview", 00376 "Residual vs tpos error U planes", 00377 100, 0, 0.05); 00378 fpResidualvsTPosSigmaUview -> GetYaxis() -> SetTitle("residual (m)"); 00379 fpResidualvsTPosSigmaUview -> GetYaxis() -> CenterTitle(); 00380 fpResidualvsTPosSigmaUview -> GetXaxis() -> SetTitle("error in tpos (m)"); 00381 fpResidualvsTPosSigmaUview -> GetXaxis() -> CenterTitle(); 00382 00383 //____________________________________________________________________________________________ 00384 fpResidualvsStripChargeVview = new TProfile("ResidualvsStripChargeVview", 00385 "Residual vs strip charge V planes", 00386 200, 0, 10000); 00387 fpResidualvsStripChargeVview -> GetYaxis() -> SetTitle("residual (m)"); 00388 fpResidualvsStripChargeVview -> GetYaxis() -> CenterTitle(); 00389 fpResidualvsStripChargeVview -> GetXaxis() -> SetTitle("strip charge (ADC)"); 00390 fpResidualvsStripChargeVview -> GetXaxis() -> CenterTitle(); 00391 00392 fpResidualvsStripChargeUview = new TProfile("ResidualvsStripChargeUview", 00393 "Residual vs strip charge U planes", 00394 200, 0, 10000); 00395 fpResidualvsStripChargeUview -> GetYaxis() -> SetTitle("residual (m)"); 00396 fpResidualvsStripChargeUview -> GetYaxis() -> CenterTitle(); 00397 fpResidualvsStripChargeUview -> GetXaxis() -> SetTitle("strip charge (ADC)"); 00398 fpResidualvsStripChargeUview -> GetXaxis() -> CenterTitle(); 00399 00400 //____________________________________________________________________________________________ 00401 fpResidualvsTrackChargeVview = new TProfile("ResidualvsTrackChargeVview", 00402 "Residual vs track charge V planes", 00403 100, 0, 60000); 00404 fpResidualvsTrackChargeVview -> GetYaxis() -> SetTitle("residual (m)"); 00405 fpResidualvsTrackChargeVview -> GetYaxis() -> CenterTitle(); 00406 fpResidualvsTrackChargeVview -> GetXaxis() -> SetTitle("track charge (ADC)"); 00407 fpResidualvsTrackChargeVview -> GetXaxis() -> CenterTitle(); 00408 00409 fpResidualvsTrackChargeUview = new TProfile("ResidualvsTrackChargeUview", 00410 "Residual vs track charge U planes", 00411 100, 0, 60000); 00412 fpResidualvsTrackChargeUview -> GetYaxis() -> SetTitle("residual (m)"); 00413 fpResidualvsTrackChargeUview -> GetYaxis() -> CenterTitle(); 00414 fpResidualvsTrackChargeUview -> GetXaxis() -> SetTitle("track charge (ADC)"); 00415 fpResidualvsTrackChargeUview -> GetXaxis() -> CenterTitle(); 00416 00417 //____________________________________________________________________________________________ 00418 fpResidualvsTrackNStripsVview = new TProfile("ResidualvsTrackNStripsVview", 00419 "Residual vs # of strips in track V planes", 00420 100, 0.0, 100.0); 00421 fpResidualvsTrackNStripsVview -> GetYaxis() -> SetTitle("residual (m)"); 00422 fpResidualvsTrackNStripsVview -> GetYaxis() -> CenterTitle(); 00423 fpResidualvsTrackNStripsVview -> GetXaxis() -> SetTitle("#strips"); 00424 fpResidualvsTrackNStripsVview -> GetXaxis() -> CenterTitle(); 00425 00426 fpResidualvsTrackNStripsUview = new TProfile("ResidualvsTrackNStripsUview", 00427 "Residual vs # of strips in track U planes", 00428 100, 0.0, 100.0); 00429 fpResidualvsTrackNStripsUview -> GetYaxis() -> SetTitle("residual (m)"); 00430 fpResidualvsTrackNStripsUview -> GetYaxis() -> CenterTitle(); 00431 fpResidualvsTrackNStripsUview -> GetXaxis() -> SetTitle("#strips"); 00432 fpResidualvsTrackNStripsUview -> GetXaxis() -> CenterTitle(); 00433 00434 //____________________________________________________________________________________________ 00435 fpResidualvsTrackChargeRatioVview = new TProfile("ResidualvsTrackChargeRatioVview", 00436 "Error in tpos vs # track/cand charge V planes", 00437 100, 0.0, 1.0); 00438 fpResidualvsTrackChargeRatioVview -> GetYaxis() -> SetTitle("error in tpos (m)"); 00439 fpResidualvsTrackChargeRatioVview -> GetYaxis() -> CenterTitle(); 00440 00441 fpResidualvsTrackChargeRatioUview = new TProfile("ResidualvsTrackChargeRatioUview", 00442 "Error in tpos vs # track/cand charge U planes", 00443 100, 0.0, 1.0); 00444 fpResidualvsTrackChargeRatioUview -> GetYaxis() -> SetTitle("error in tpos (m)"); 00445 fpResidualvsTrackChargeRatioUview -> GetYaxis() -> CenterTitle(); 00446 00447 //____________________________________________________________________________________________ 00448 fHistogramFile -> cd(); 00449 fMultipleScatteringDirectory -> cd(); 00450 00451 fpResidualvsMuonPathLength = new TProfile("ResidualvsMuonPathLength", 00452 "Residual vs muon path length in steel", 00453 40, 0.0, 20.0, "s"); 00454 fpResidualvsMuonPathLength -> GetYaxis() -> SetTitle("residual (m)"); 00455 fpResidualvsMuonPathLength -> GetYaxis() -> CenterTitle(); 00456 fpResidualvsMuonPathLength -> GetXaxis() -> SetTitle("muon path length (m)"); 00457 fpResidualvsMuonPathLength -> GetXaxis() -> CenterTitle(); 00458 00459 //____________________________________________________________________________________________ 00460 fpResidualvsMuonPathLengthPosCosZ = new TProfile("ResidualvsMuonPathLengthPosCosZ", 00461 "Residual vs muon path length in steel: cosz > 0", 00462 40, 0.0, 20.0, "s"); 00463 fpResidualvsMuonPathLengthPosCosZ -> GetYaxis() -> SetTitle("residual (m)"); 00464 fpResidualvsMuonPathLengthPosCosZ -> GetYaxis() -> CenterTitle(); 00465 fpResidualvsMuonPathLengthPosCosZ -> GetXaxis() -> SetTitle("muon path length (m)"); 00466 fpResidualvsMuonPathLengthPosCosZ -> GetXaxis() -> CenterTitle(); 00467 00468 //____________________________________________________________________________________________ 00469 fpResidualvsMuonPathLengthNegCosZ = new TProfile("ResidualvsMuonPathLengthNegCosZ", 00470 "Residual vs muon path length in steel: cosz < 0", 00471 40, 0.0, 20.0, "s"); 00472 fpResidualvsMuonPathLengthNegCosZ -> GetYaxis() -> SetTitle("residual (m)"); 00473 fpResidualvsMuonPathLengthNegCosZ -> GetYaxis() -> CenterTitle(); 00474 fpResidualvsMuonPathLengthNegCosZ -> GetXaxis() -> SetTitle("muon path length (m)"); 00475 fpResidualvsMuonPathLengthNegCosZ -> GetXaxis() -> CenterTitle(); 00476 00477 fHistogramFile -> cd(); 00478 00479 }
|
|
|
Definition at line 2862 of file AlignmentHistograms.cxx. References fHistogramFile, and MSG. 02863 {
02864 MSG("Align", Msg::kInfo) << "Destructor ~AlignmentHistograms()..." << endl
02865 << "Closing root file " << fHistogramFile->GetName() << endl;
02866 fHistogramFile -> Write();
02867 fHistogramFile -> Close();
02868 MSG("Align", Msg::kInfo) << "Destructor ~AlignmentHistograms() DONE" << endl;
02869 }
|
|
|
Definition at line 1728 of file AlignmentHistograms.cxx. References fhHitModuleResidual, fHistogramFile, fMdlResidualSample, MdlResidualStructure::fnstrip, fStripHistograms, MdlResidualStructure::fstripmean, fStripResidualFunctions, MdlResidualStructure::fstripsigma, PlexScintMdlId::GetModule(), PlexPlaneId::GetPlane(), GetSampleMeanSigmaSize(), MdlResidualStructure::hentries, MdlResidualStructure::hmean, MdlResidualStructure::hnstrip, MdlResidualStructure::hrms, MdlResidualStructure::hstripmean, MdlResidualStructure::hstripsigma, MdlResidualStructure::module, MSG, MdlResidualStructure::nsample, MdlResidualStructure::plane, MdlResidualStructure::samplemean, and MdlResidualStructure::samplesigma. Referenced by ProcessHistograms(). 01729 {
01730 MSG("Align", Msg::kInfo) << "AlignmentHistograms::AnalyzeModuleResiduals()..." <<endl;
01731
01732 map<PlexScintMdlId, MdlResidualStructure> AllMdlResidual;
01733 for(map<PlexScintMdlId, TH1D *>::iterator itr = fhHitModuleResidual.begin();
01734 itr != fhHitModuleResidual.end(); ++itr)
01735 {
01736 PlexScintMdlId plexid = itr -> first;
01737 TH1D *h = itr -> second;
01738 MdlResidualStructure mdl;
01739 mdl.hmean = h -> GetMean();
01740 mdl.hrms = h -> GetRMS();
01741 mdl.hentries = h -> GetEntries();
01742 mdl.plane = plexid.GetPlane();
01743 mdl.module = plexid.GetModule();
01744 pair<PlexScintMdlId, MdlResidualStructure>p(plexid, mdl);
01745 AllMdlResidual.insert(p);
01746 }
01747
01748
01749 map<PlexScintMdlId, vector<double> > MdlResidualSample;
01750 map<PlexScintMdlId, Double_t > MdlResidual, MdlResidualSigma, MdlResidualNStrip;
01751
01752 //filling map of mean strip residuals histogram for each module
01753 for( map<PlexStripEndId, StripHistograms>::iterator itr = fStripHistograms.begin();
01754 itr != fStripHistograms.end(); ++itr)
01755 {
01756 TH1D *h = (itr -> second).StripResidual;
01757 PlexScintMdlId plexid = (itr->first).GetScintMdlId();
01758 double mean = h -> GetMean();
01759 MdlResidualSample[plexid].push_back(mean);
01760 }
01761
01762 for(map<PlexScintMdlId, vector<double> >::const_iterator it = MdlResidualSample.begin();
01763 it != MdlResidualSample.end(); ++it){
01764 PlexScintMdlId plexid = it -> first;
01765 Double_t mean = 0.0, sigma = 0.0, size = 0.0;
01766
01767 if(!GetSampleMeanSigmaSize(it->second, mean, sigma, size))
01768 continue;
01769
01770 MdlResidual[plexid] = mean;
01771 MdlResidualSigma[plexid] = sigma;
01772 MdlResidualNStrip[plexid] = size;
01773 }
01774
01775 for(map<PlexScintMdlId, Double_t>::const_iterator it = MdlResidual.begin();
01776 it != MdlResidual.end(); ++it){
01777
01778 map<PlexScintMdlId, Double_t>::const_iterator fits = MdlResidualSigma.find(it -> first);
01779 if(fits == MdlResidualSigma.end()){
01780 MSG("Align", Msg::kError) <<"For "<<it->first<<" MdlResidualSigma is missing."<<endl;
01781 continue;
01782 }
01783
01784 map<PlexScintMdlId, Double_t>::const_iterator fitn = MdlResidualNStrip.find(it -> first);
01785 if(fitn == MdlResidualNStrip.end()){
01786 MSG("Align", Msg::kError) <<"For "<<it->first<<" MdlResidualNStrip is missing."<<endl;
01787 continue;
01788 }
01789
01790 map<PlexScintMdlId, MdlResidualStructure>::iterator mit = AllMdlResidual.find(it -> first);
01791 if(mit == AllMdlResidual.end()){
01792 MSG("Align", Msg::kError) <<"For "<<it->first<<" AllMdlResidual is missing."<<endl;
01793 continue;
01794 }
01795
01796 MdlResidualStructure &mdl = mit -> second;
01797 mdl.hstripmean = it -> second;
01798 mdl.hstripsigma = fits -> second;
01799 mdl.hnstrip = fitn -> second;
01800 }
01801
01802
01803 MdlResidualSample.clear();
01804 MdlResidual.clear();
01805 MdlResidualSigma.clear();
01806 MdlResidualNStrip.clear();
01807
01808 //filling map of mean strip residuals histogram for each module
01809 for(map<PlexStripEndId, TF1 *>::const_iterator it = fStripResidualFunctions.begin();
01810 it != fStripResidualFunctions.end(); ++it){
01811 PlexScintMdlId plexid = (it->first).GetScintMdlId();
01812 double mean = (it->second) -> GetParameter(1);
01813 MdlResidualSample[plexid].push_back(mean);
01814 }
01815
01816
01817 for(map<PlexScintMdlId, vector<double> >::const_iterator it = MdlResidualSample.begin();
01818 it != MdlResidualSample.end(); ++it){
01819
01820 PlexScintMdlId plexid = it -> first;
01821 Double_t mean = 0.0, sigma = 0.0, size = 0.0;
01822
01823 if(!GetSampleMeanSigmaSize(it->second, mean, sigma, size))
01824 continue;
01825
01826 MdlResidual[plexid] = mean;
01827 MdlResidualSigma[plexid] = sigma;
01828 MdlResidualNStrip[plexid] = size;
01829 }
01830
01831 for(map<PlexScintMdlId, Double_t>::const_iterator it = MdlResidual.begin();
01832 it != MdlResidual.end(); ++it){
01833
01834 map<PlexScintMdlId, Double_t>::const_iterator fits = MdlResidualSigma.find(it -> first);
01835 if(fits == MdlResidualSigma.end()){
01836 MSG("Align", Msg::kError) <<"For "<<it->first<<" MdlResidualSigma is missing."<<endl;
01837 continue;
01838 }
01839
01840 map<PlexScintMdlId, Double_t>::const_iterator fitn = MdlResidualNStrip.find(it -> first);
01841 if(fitn == MdlResidualNStrip.end()){
01842 MSG("Align", Msg::kError) <<"For "<<it->first<<" MdlResidualNStrip is missing."<<endl;
01843 continue;
01844 }
01845
01846 map<PlexScintMdlId, MdlResidualStructure>::iterator mit = AllMdlResidual.find(it -> first);
01847 if(mit == AllMdlResidual.end()){
01848 MSG("Align", Msg::kError) <<"For "<<it->first<<" AllMdlResidual is missing."<<endl;
01849 continue;
01850 }
01851
01852 MdlResidualStructure &mdl = mit -> second;
01853 mdl.fstripmean = it -> second;
01854 mdl.fstripsigma = fits -> second;
01855 mdl.fnstrip = fitn -> second;
01856 }
01857
01858
01859 for(map<PlexScintMdlId, vector<double> >::const_iterator itr = fMdlResidualSample.begin();
01860 itr != fMdlResidualSample.end(); ++itr){
01861
01862 Double_t mean = 0.0, sigma = 0.0, nsample = 0.0;
01863 if(!GetSampleMeanSigmaSize(itr->second, mean, sigma, nsample))
01864 continue;
01865
01866 map<PlexScintMdlId, MdlResidualStructure>::iterator mit = AllMdlResidual.find(itr -> first);
01867 if(mit == AllMdlResidual.end()){
01868 MSG("Align", Msg::kError) <<"For "<<itr->first<<" AllMdlResidual is missing."<<endl;
01869 continue;
01870 }
01871
01872 MdlResidualStructure &mdl = mit -> second;
01873 mdl.samplemean = mean;
01874 mdl.samplesigma = sigma;
01875 mdl.nsample = nsample;
01876 }
01877
01878
01879 fHistogramFile -> cd();
01880
01881 TTree *mtree = new TTree("MdlRes","Module residual data");
01882 Double_t hmean=0.0, hrms=0.0, hentries=0.0;
01883 Double_t samplemean=0.0, samplesigma=0.0, nsample=0.0;
01884 Double_t hstripmean=0.0, hstripsigma=0.0, hnstrip=0.0;
01885 Double_t fstripmean=0.0, fstripsigma=0.0, fnstrip=0.0;
01886 Int_t plane=0, module=0;
01887 UInt_t plexmdlid=0;
01888
01889 mtree -> Branch("hmean", &hmean, "hmean/D");
01890 mtree -> Branch("hrms", &hrms, "hrms/D");
01891 mtree -> Branch("hentries", &hentries, "hentries/D");
01892 mtree -> Branch("samplemean", &samplemean, "samplemean/D");
01893 mtree -> Branch("samplesigma", &samplesigma, "samplesigma/D");
01894 mtree -> Branch("nsample", &nsample, "nsample/D");
01895 mtree -> Branch("hstripmean", &hstripmean, "hstripmean/D");
01896 mtree -> Branch("hstripsigma", &hstripsigma, "hstripsigma/D");
01897 mtree -> Branch("hnstrip", &hnstrip, "hnstrip/D");
01898 mtree -> Branch("fstripmean", &fstripmean, "fstripmean/D");
01899 mtree -> Branch("fstripsigma", &fstripsigma, "fstripsigma/D");
01900 mtree -> Branch("fnstrip", &fnstrip, "fnstrip/D");
01901 mtree -> Branch("plane", &plane, "plane/I");
01902 mtree -> Branch("module", &module, "module/I");
01903 mtree -> Branch("plexmdlid", &plexmdlid, "plexmdlid/i");
01904
01905 for(map<PlexScintMdlId, MdlResidualStructure>::const_iterator mit = AllMdlResidual.begin();
01906 mit != AllMdlResidual.end(); ++mit){
01907 const MdlResidualStructure &mdl = mit -> second;
01908 hmean = mdl.hmean;
01909 hrms = mdl.hrms;
01910 hentries = mdl.hentries;
01911 samplemean = mdl.samplemean;
01912 samplesigma = mdl.samplesigma;
01913 nsample = mdl.nsample ;
01914 hstripmean = mdl.hstripmean;
01915 hstripsigma = mdl.hstripsigma;
01916 hnstrip = mdl.hnstrip;
01917 fstripmean = mdl.fstripmean;
01918 fstripsigma = mdl.fstripsigma;
01919 fnstrip = mdl.fnstrip;
01920 plane = mdl.plane;
01921 module = mdl.module;
01922 plexmdlid = (mit->first).GetEncoded();
01923 mtree -> Fill();
01924 }
01925
01926 MSG("Align", Msg::kInfo) << "AlignmentHistograms::AnalyzeModuleResiduals()... Done" <<endl;
01927 }
|
|
|
Definition at line 1497 of file AlignmentHistograms.cxx. References fhHistogramStripResidualvsPlane, fHistogramFile, fhPlaneResidual, fnplanes, fPlaneResidualDirectory, fResidualSummaryDirectory, fStripHistograms, PlexStripEndId::GetEncoded(), PlexPlaneId::GetNumStrips(), PlexPlaneId::GetPlane(), GetSampleMeanSigmaSize(), PlexStripEndId::GetStrip(), min(), MSG, and name. Referenced by ProcessHistograms(). 01498 {
01499
01500 MSG("Align", Msg::kInfo) << "AlignmentHistograms::AnalyzeStripResidualHistograms("
01501 << int(min) <<")..." << endl;
01502
01503 fHistogramFile -> cd();
01504
01505 Double_t mean=0.0, rms=0.0, hentries=0.0;
01506 Int_t plane=0, strip=0;
01507 UInt_t plexseid=0;
01508 TTree *stree = new TTree("StripRes","Strip residual histogram data");
01509 stree -> Branch("mean", &mean, "mean/D");
01510 stree -> Branch("rms", &rms, "rms/D");
01511 stree -> Branch("hentries", &hentries, "hentries/D");
01512 stree -> Branch("plane", &plane, "plane/I");
01513 stree -> Branch("strip", &strip, "strip/I");
01514 stree -> Branch("plexseid", &plexseid, "plexseid/i");
01515
01516 map<int, vector<double> > HistogramStripResidualvsPlane;
01517 for(map<PlexStripEndId, StripHistograms>::iterator itr = fStripHistograms.begin();
01518 itr != fStripHistograms.end(); ++itr)
01519 {
01520
01521 TH1D *h = (itr -> second).StripResidual;
01522 PlexStripEndId plexid = itr -> first;
01523 hentries = h -> GetEntries();
01524
01525 if(hentries < min)
01526 continue;
01527
01528 mean = h -> GetMean();
01529 rms = h -> GetRMS();
01530 plane = plexid.GetPlane();
01531 strip = plexid.GetStrip();
01532 plexseid = plexid.GetEncoded();
01533 stree -> Fill();
01534
01535 HistogramStripResidualvsPlane[plane].push_back(mean);
01536
01537 map<int, TH1D *>::iterator fit = fhPlaneResidual.find(plane);
01538 TH1D *hp = 0;
01539 if(fit == fhPlaneResidual.end()){
01540 fPlaneResidualDirectory -> cd();
01541 char name[80];
01542 char title[80];
01543 int nstrip = plexid.GetNumStrips();
01544 sprintf(name,"ResidualInPlane%03d", plane);
01545 sprintf(title,"Mean histogram residual vs strip #, plane %03d", plane);
01546 hp = new TH1D(name, title, nstrip, 0, nstrip);
01547 hp -> GetXaxis() -> SetTitle("strip #");
01548 hp -> GetXaxis() -> CenterTitle();
01549 hp -> GetYaxis() -> SetTitle("residual (m)");
01550 hp -> GetYaxis() -> CenterTitle();
01551 fhPlaneResidual[plane] = hp;
01552 fHistogramFile ->cd();
01553 } else
01554 hp = fit -> second;
01555
01556 int bin = hp -> FindBin(strip);
01557 hp -> SetBinContent(bin, mean);
01558 hp -> SetBinError(bin, rms);
01559 }
01560
01561 fResidualSummaryDirectory -> cd();
01562
01563 fhHistogramStripResidualvsPlane = new TH1D("StripHistogramResidualvsPlane",
01564 "Mean histogram strip residual vs plane number",
01565 fnplanes, 0, fnplanes);
01566 fhHistogramStripResidualvsPlane -> GetYaxis() -> SetTitle("residual (m)");
01567 fhHistogramStripResidualvsPlane -> GetYaxis() -> CenterTitle();
01568 fhHistogramStripResidualvsPlane -> GetXaxis() -> SetTitle("plane number");
01569 fhHistogramStripResidualvsPlane -> GetXaxis() -> CenterTitle();
01570
01571 //finding mean and sigma plane residual
01572 map<int, Double_t> residual, error;
01573 for(map<int, vector<double> >::iterator itr = HistogramStripResidualvsPlane.begin();
01574 itr != HistogramStripResidualvsPlane.end(); ++itr){
01575
01576 Double_t x = 0.0, xx = 0.0, size = 0.0;
01577 if(!GetSampleMeanSigmaSize(itr->second, x, xx, size))
01578 continue;
01579
01580 residual[itr->first] = x;
01581 error[itr->first] = xx;
01582 }
01583
01584 for(map<int, Double_t >::const_iterator itr = residual.begin();
01585 itr != residual.end(); ++itr){
01586
01587 map<int, Double_t >::const_iterator fit = error.find(itr->first);
01588 if(fit == error.end())
01589 continue;
01590
01591 int bin = fhHistogramStripResidualvsPlane -> FindBin(itr->first);
01592 fhHistogramStripResidualvsPlane -> SetBinContent(bin, itr -> second);
01593 fhHistogramStripResidualvsPlane -> SetBinError(bin, fit -> second);
01594 }
01595
01596 fHistogramFile ->cd();
01597 MSG("Align", Msg::kInfo) << "AlignmentHistograms::AnalyzeStripResidualHistograms("
01598 << int(min) <<")... Done" << endl;
01599 }
|
|
|
Definition at line 1603 of file AlignmentHistograms.cxx. References fHistogramFile, fhPlaneSampleResidual, fhSampleStripResidualvsPlane, fnplanes, fPlaneResidualDirectory, fResidualSummaryDirectory, fSampleStripResidual, fSampleStripResidualEntries, fSampleStripResidualSigma, fStripHistograms, fStripResidualSample, PlexStripEndId::GetEncoded(), PlexPlaneId::GetNumStrips(), PlexPlaneId::GetPlane(), GetSampleMeanSigmaSize(), PlexStripEndId::GetStrip(), MSG, and name. Referenced by ProcessHistograms(). 01604 {
01605 MSG("Align", Msg::kInfo) << "AlignmentHistograms::AnalyzeStripSampleResiduals()..." <<endl;
01606
01607 if(fStripResidualSample.empty()){
01608 MSG("Align", Msg::kWarning) <<"fStripResidualSample is empty. Bailing out." <<endl;
01609 return;
01610 }
01611
01612 fSampleStripResidual.clear();
01613 fSampleStripResidualSigma.clear();
01614 fSampleStripResidualEntries.clear();
01615
01616 fHistogramFile -> cd();
01617
01618 TTree *stree = new TTree("StripResSample","Results from strip residual samples");
01619
01620 Double_t mean=0.0, sigma=0.0, nsample=0.0, hmean = 0.0, hrms=0.0, hentries=0.0;
01621 Int_t plane=0, strip=0;
01622 UInt_t plexseid=0;
01623 stree -> Branch("mean", &mean, "mean/D");
01624 stree -> Branch("sigma", &sigma, "sigma/D");
01625 stree -> Branch("nsample", &nsample, "nsample/D");
01626 stree -> Branch("hmean", &hmean, "hmean/D");
01627 stree -> Branch("hrms", &hrms, "hrms/D");
01628 stree -> Branch("hentries", &hentries, "hentries/D");
01629 stree -> Branch("plane", &plane, "plane/I");
01630 stree -> Branch("strip", &strip, "strip/I");
01631 stree -> Branch("plexseid", &plexseid, "plexseid/i");
01632
01633 map<int, vector<double> > planeresidual;
01634 for(map<PlexStripEndId, vector<double> >::const_iterator itr = fStripResidualSample.begin();
01635 itr != fStripResidualSample.end(); ++itr){
01636
01637 if(!GetSampleMeanSigmaSize(itr->second, mean, sigma, nsample))
01638 continue;
01639
01640 PlexStripEndId plexid = itr->first;
01641 map<PlexStripEndId, StripHistograms>::iterator fit = fStripHistograms.find(plexid);
01642 if(fit == fStripHistograms.end()){
01643 MSG("Align", Msg::kError) << "Failed to find fStripHistograms"<<plexid<<endl;
01644 continue;
01645 }
01646
01647
01648 TH1D *h = (fit -> second).StripResidual;
01649 plane = plexid.GetPlane();
01650 strip = plexid.GetStrip();
01651 hmean = h -> GetMean();
01652 hrms = h -> GetRMS();
01653 hentries = h -> GetEntries();
01654 plexseid = plexid.GetEncoded();
01655 stree -> Fill();
01656
01657 fSampleStripResidual[plexid] = mean;
01658 fSampleStripResidualSigma[plexid] = sigma;
01659 fSampleStripResidualEntries[plexid] = nsample;
01660
01661 map<int, TH1D *>::iterator fitr = fhPlaneSampleResidual.find(plane);
01662 TH1D *hps=0;
01663 if(fitr == fhPlaneSampleResidual.end()){
01664 fPlaneResidualDirectory -> cd();
01665 char name[80];
01666 char title[80];
01667 int nstrip = plexid.GetNumStrips();
01668 sprintf(name,"SampleResidualInPlane%03d", plane);
01669 sprintf(title,"Mean sample residual vs strip #, plane %03d", plane);
01670 hps = new TH1D(name, title, nstrip, 0, nstrip);
01671 hps -> GetXaxis() -> SetTitle("strip #");
01672 hps -> GetXaxis() -> CenterTitle();
01673 hps -> GetYaxis() -> SetTitle("residual (m)");
01674 hps -> GetYaxis() -> CenterTitle();
01675 fhPlaneSampleResidual[plane] = hps;
01676 fHistogramFile ->cd();
01677 } else
01678 hps = fitr -> second;
01679
01680 int bin = hps -> FindBin(strip);
01681 hps -> SetBinContent(bin, mean);
01682 hps -> SetBinError(bin, sigma);
01683 planeresidual[plane].push_back(mean);
01684 }
01685
01686 fResidualSummaryDirectory -> cd();
01687
01688 fhSampleStripResidualvsPlane = new TH1D("StripSampleResidualvsPlane",
01689 "Plane mean of sample strip residuals vs plane number",
01690 fnplanes, 0, fnplanes);
01691 fhSampleStripResidualvsPlane -> GetXaxis() -> SetTitle("plane #");
01692 fhSampleStripResidualvsPlane -> GetXaxis() -> CenterTitle();
01693 fhSampleStripResidualvsPlane -> GetYaxis() -> SetTitle("Sample strip residual (m)");
01694 fhSampleStripResidualvsPlane -> GetYaxis() -> CenterTitle();
01695
01696 //finding mean and sigma plane residual
01697 map<int, Double_t> residual, error;
01698 for(map<int, vector<double> >::iterator itr = planeresidual.begin();
01699 itr != planeresidual.end(); ++itr){
01700 int plane = itr -> first;
01701 Double_t x = 0.0, xx = 0.0, size = 0.0;
01702
01703 if(!GetSampleMeanSigmaSize(itr->second, x, xx, size))
01704 continue;
01705
01706 residual[plane] = x;
01707 error[plane] = xx;
01708 }
01709
01710
01711 for(map<int, Double_t>::const_iterator itr = residual.begin();
01712 itr != residual.end(); ++itr){
01713 const int plane = itr -> first;
01714 int bin = fhSampleStripResidualvsPlane -> FindBin(plane);
01715 map<int, Double_t >::const_iterator fit = error.find(plane);
01716 if(fit == error.end())
01717 continue;
01718 fhSampleStripResidualvsPlane -> Fill(plane, itr -> second);
01719 fhSampleStripResidualvsPlane -> SetBinError(bin, fit -> second);
01720 }
01721
01722 fHistogramFile -> cd();
01723 MSG("Align", Msg::kInfo) << "AlignmentHistograms::AnalyzeStripSampleResiduals()... Done" <<endl;
01724 }
|
|
|
Definition at line 1112 of file AlignmentHistograms.cxx. References f2hMeanChargePlaneStrip, f2hMeanPathCorrChargePlaneStrip, fhCandStripCharge, fHistogramFile, fnplanes, fnstrips, fStripHistograms, PlexStripEndId::GetEncoded(), PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), min(), and MSG. Referenced by ProcessHistograms(). 01113 {
01114 MSG("Align", Msg::kInfo) << "AlignmentHistograms::CalculateStripCharge("<<int(min)<<")..."<< endl;
01115
01116 fHistogramFile -> cd();
01117
01118 f2hMeanChargePlaneStrip = new TH2D("StripMeanChargePlaneStrip",
01119 "Mean charge in strips on muon tracks",
01120 fnplanes, 0, fnplanes,
01121 fnstrips, 0, fnstrips);
01122
01123 f2hMeanPathCorrChargePlaneStrip = new TH2D("StripMeanPathCorrChargePlaneStrip",
01124 "Mean charge in strips on muon tracks",
01125 fnplanes, 0, fnplanes,
01126 fnstrips, 0, fnstrips);
01127
01128 TTree *stree = new TTree("StripCharge","Raw and path corrected strip charges");
01129
01130 Double_t charge=0.0, chargerms=0.0, hentries=0.0, overflow = 0.0;
01131 Double_t pcharge=0.0, pchargerms=0.0, pchentries=0.0, pcoverflow = 0.0;
01132 Double_t candcharge=0.0, candchargerms=0.0, candhentries=0.0, candoverflow = 0.0;
01133 Int_t plane=0, strip=0;
01134 UInt_t plexseid=0;
01135
01136 stree -> Branch("charge", &charge, "charge/D");
01137 stree -> Branch("chargerms", &chargerms, "chargerms/D");
01138 stree -> Branch("hentries", &hentries, "hentries/D");
01139 stree -> Branch("overflow", &overflow, "overflow/D");
01140 stree -> Branch("pcharge", &pcharge, "pcharge/D");
01141 stree -> Branch("pchargerms", &pchargerms, "pchargerms/D");
01142 stree -> Branch("pchentries", &pchentries, "pchentries/D");
01143 stree -> Branch("pcoverflow", &pcoverflow, "pcoverflow/D");
01144 stree -> Branch("candcharge", &candcharge, "candcharge/D");
01145 stree -> Branch("candchargerms", &candchargerms, "candchargerms/D");
01146 stree -> Branch("candhentries", &candhentries, "candhentries/D");
01147 stree -> Branch("candoverflow", &candoverflow, "candoverflow/D");
01148 stree -> Branch("plane", &plane, "plane/I");
01149 stree -> Branch("strip", &strip, "strip/I");
01150 stree -> Branch("plexseid", &plexseid, "plexseid/i");
01151
01152 for(map<PlexStripEndId, StripHistograms>::iterator sit = fStripHistograms.begin();
01153 sit != fStripHistograms.end(); ++sit){
01154
01155 TH1D *StripCharge = (sit->second).StripCharge;
01156 TH1D *StripChargePathCorr = (sit->second).StripChargePathCorr;
01157 PlexStripEndId plexid = sit->first;
01158
01159 charge = StripCharge -> GetMean();
01160 chargerms = StripCharge -> GetRMS();
01161 hentries = StripCharge -> GetEntries();
01162 int nbin = StripCharge -> GetNbinsX();
01163 overflow = StripCharge -> GetBinContent(nbin+1);
01164
01165 if(hentries < min)
01166 continue;
01167
01168 nbin = StripChargePathCorr -> GetNbinsX();
01169 pcharge = StripChargePathCorr -> GetMean();
01170 pchargerms = StripChargePathCorr -> GetRMS();
01171 pchentries = StripChargePathCorr -> GetEntries();
01172 pcoverflow = StripChargePathCorr -> GetBinContent(nbin+1);
01173
01174 map<PlexStripEndId, TH1D *>::iterator fit = fhCandStripCharge.find(plexid);
01175 if(fit == fhCandStripCharge.end())
01176 candcharge=0.0, candchargerms=0.0, candhentries=0.0, candoverflow = 0.0;
01177 else {
01178 TH1D *h = fit -> second;
01179 nbin = h -> GetNbinsX();
01180 candcharge = h -> GetMean();
01181 candchargerms = h -> GetRMS();
01182 candhentries = h -> GetEntries();
01183 candoverflow = h -> GetBinContent(nbin+1);
01184 }
01185
01186 plane = plexid.GetPlane();
01187 strip = plexid.GetStrip();
01188 plexseid = plexid.GetEncoded();
01189 stree -> Fill();
01190
01191 f2hMeanChargePlaneStrip -> Fill(plane, strip, charge);
01192 f2hMeanPathCorrChargePlaneStrip -> Fill(plane, strip, pcharge);
01193 }
01194
01195 MSG("Align", Msg::kInfo) << "AlignmentHistograms::CalculateStripCharge("<<int(min)<<")... Done"<< endl;
01196 }
|
|
||||||||||||
|
Definition at line 1968 of file AlignmentHistograms.cxx. References fh2TrackHitvsMaxChargeHit, fHistogramFile, fPlanePlexDirectory, PlexPlaneId::GetNumStrips(), PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), MSG, and name. 01970 {
01971
01972 if(trkstrip.GetPlane() != altstrip.GetPlane()){
01973 MSG("Align", Msg::kWarning) << "Using FillAlternativeTrackHits() for different planes" << endl;
01974 return;
01975 }
01976
01977 int plane = trkstrip.GetPlane();
01978 map<int, TH2D *>::iterator fit = fh2TrackHitvsMaxChargeHit.find(plane);
01979 if(fit == fh2TrackHitvsMaxChargeHit.end()){
01980 fPlanePlexDirectory -> cd();
01981 int nstrip = altstrip.GetNumStrips();
01982 char name[80];
01983 char title[80];
01984 sprintf(name,"AltHitPlane%03d", plane);
01985 sprintf(title,"Alternative higher charge hits in plane %03d", plane);
01986 TH2D *h = new TH2D(name, title, nstrip, 0, nstrip, nstrip, 0, nstrip);
01987 h -> GetXaxis() -> SetTitle("track strip #");
01988 h -> GetXaxis() -> CenterTitle();
01989 h -> GetYaxis() -> SetTitle("candidate strip #");
01990 h -> GetYaxis() -> CenterTitle();
01991 h -> Fill(trkstrip.GetStrip(), altstrip.GetStrip(), 1.0);
01992 fh2TrackHitvsMaxChargeHit[plane] = h;
01993 fHistogramFile -> cd();
01994 } else
01995 (fit->second) -> Fill(trkstrip.GetStrip(), altstrip.GetStrip(), 1.0);
01996 }
|
|
||||||||||||
|
Definition at line 592 of file AlignmentHistograms.cxx. References AlignmentStrip::charge, fChargeLimit, fhCandStripCharge, fHistogramFile, fNChargeBins, fStripChargeDirectory, PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), MSG, and name. 00594 {
00595
00596 map<PlexStripEndId, TH1D *>::iterator fit = fhCandStripCharge.find(plexid);
00597 if(fit == fhCandStripCharge.end()){
00598 fStripChargeDirectory -> cd();
00599 char name[100], title[100];
00600 int plane = plexid.GetPlane(), strip = plexid.GetStrip();
00601 sprintf(name,"CandChargeInPlane%03dStrip%03d", plane, strip);
00602 sprintf(title,"Candidate charge plane %03d, strip %03d", plane, strip);
00603 MSG("Align", Msg::kVerbose) << "Creating histogram " << name << endl;
00604 TH1D *h = new TH1D(name, title, fNChargeBins, 0, fChargeLimit);
00605 h -> GetXaxis() -> SetTitle("Raw ADC");
00606 h -> GetXaxis() -> CenterTitle();
00607 h -> Fill(astrip.charge);
00608 fHistogramFile -> cd();
00609 fhCandStripCharge[plexid] = h;
00610 } else
00611 (fit -> second) -> Fill(astrip.charge);
00612 }
|
|
||||||||||||||||||||
|
Definition at line 2083 of file AlignmentHistograms.cxx. References f2hCosXvsCosZ, f2hCosYvsCosX, f2hCosYvsCosZ, fhCosX, fhCosY, fhCosZ, fHistogramFile, fhTrackLength, and fTrackDirectory. 02085 {
02086 if(!fhCosX){
02087 fTrackDirectory -> cd();
02088 fhCosX = new TH1D("CosX", "Directional cosine with x axis", 100, -1.0, 1.0);
02089 fhCosY = new TH1D("CosY", "Directional cosine with y axis", 100, 0.0, 1.0);
02090 fhCosZ = new TH1D("CosZ", "Directional cosine with z axis", 100, -1.0, 1.0);
02091 fhTrackLength = new TH1D("TrackLength", "Track length in meter", 500, 0.0, 16.0);
02092
02093 f2hCosXvsCosZ = new TH2D("CosXvsCosZ", "CosX vs CosZ", 100, -1.0, 1.0, 100, -1.0, 1.0);
02094 f2hCosYvsCosZ = new TH2D("CosYvsCosZ", "CosY vs CosZ", 100, -1.0, 1.0, 100, 0.0, 1.0);
02095 f2hCosYvsCosX = new TH2D("CosYvsCosX", "CosY vs CosX", 100, -1.0, 1.0, 100, 0.0, 1.0);
02096 fHistogramFile -> cd();
02097 }
02098
02099 fhCosX -> Fill(cosx);
02100 fhCosY -> Fill(cosy);
02101 fhCosZ -> Fill(cosz);
02102 fhTrackLength -> Fill(length);
02103
02104 f2hCosXvsCosZ -> Fill(cosz, cosx);
02105 f2hCosYvsCosZ -> Fill(cosz, cosy);
02106 f2hCosYvsCosX -> Fill(cosx, cosy);
02107 }
|
|
||||||||||||||||
|
||||||||||||||||
|
||||||||||||
|
Definition at line 2034 of file AlignmentHistograms.cxx. References fHistogramFile, fHitPositionSummaryDirectory, fhSpecificMdlLongitudinalHitPos, fhStripLongitudinalHitPos, GetMdlIndex(), PlexScintMdlId::GetModule(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), PlexStripEndId::GetScintMdlId(), AlignmentStrip::lhitpos, and name. Referenced by FillHistograms(). 02036 {
02037 int ind = GetMdlIndex(plexid);
02038 map<int, TH1D *>::iterator fit = fhSpecificMdlLongitudinalHitPos.find(ind);
02039 if(fit == fhSpecificMdlLongitudinalHitPos.end()){
02040 fHitPositionSummaryDirectory -> cd();
02041 stringstream name;
02042 stringstream title;
02043 int module = plexid.GetScintMdlId().GetModule();
02044 string view;
02045 if(plexid.GetPlaneView() == PlaneView::kV)
02046 view = "V";
02047 else
02048 view = "U";
02049 string coverage, coveragel;
02050 if(plexid.GetPlaneCoverage() == PlaneCoverage::kNearPartial){
02051 coverage = "Partial";
02052 coveragel = "partial";
02053 } else {
02054 coverage = "Full";
02055 coveragel = "full";
02056 }
02057 name <<"LongitudinalHitPos"<<view<<"view"<<coverage<<"PlaneModule"<<module;
02058 title <<"Longitudinal hit pos in "<<view<<" view for "<<coveragel<<" plane and module # "<<module;
02059 TH1D *h = new TH1D(name.str().c_str(), title.str().c_str(), 800, -4.0, 4.0);
02060 h -> GetXaxis() -> SetTitle("hit position (m)");
02061 h -> GetXaxis() -> CenterTitle();
02062 h -> Fill(astrip.lhitpos);
02063 fhSpecificMdlLongitudinalHitPos[ind] = h;
02064
02065 if(!fhStripLongitudinalHitPos){
02066
02067 fhStripLongitudinalHitPos = new TH1D("StripLongitudinalHitPos",
02068 "Strip longitudinal hit position",
02069 800, -4.0, 4.0);
02070 fhStripLongitudinalHitPos -> GetXaxis() -> SetTitle("hit position relative to center of a strip (m)");
02071 fhStripLongitudinalHitPos -> GetXaxis() -> CenterTitle();
02072 }
02073 fHistogramFile -> cd();
02074 } else
02075 (fit->second) -> Fill(astrip.lhitpos);
02076
02077 fhStripLongitudinalHitPos -> Fill(astrip.lhitpos);
02078 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 838 of file AlignmentHistograms.cxx. References fhCharge2dAltTracksU, fhCharge2dAltTracksV, fHistogramFile, fhNStrip2dAltTracksU, fhNStrip2dAltTracksV, fhSigmaOfTPosUviewAlt, fhSigmaOfTPosVviewAlt, fNTrackChargeBins, fTrackChargeLimit, fTrackDirectory, fTrackResidualRMSBins, and fTrackResidualRMSLimit. 00841 {
00842
00843 if(!fhCharge2dAltTracksV){
00844 fTrackDirectory -> cd();
00845
00846 //______________________________________________________________________________________//
00847 fhCharge2dAltTracksV = new TH1D("Charge2dAltTracksV",
00848 "Charge in 2d V-view tracks",
00849 fNTrackChargeBins, 0, fTrackChargeLimit);
00850 fhCharge2dAltTracksV -> GetXaxis() -> SetTitle("Raw ADC");
00851 fhCharge2dAltTracksV -> GetXaxis() -> CenterTitle();
00852 //______________________________________________________________________________________//
00853 fhCharge2dAltTracksU = new TH1D("Charge2dAltTracksU",
00854 "Charge in 2d U-view tracks",
00855 fNTrackChargeBins, 0, fTrackChargeLimit);
00856 fhCharge2dAltTracksU -> GetXaxis() -> SetTitle("Raw ADC");
00857 fhCharge2dAltTracksU -> GetXaxis() -> CenterTitle();
00858
00859 //______________________________________________________________________________________//
00860 fhNStrip2dAltTracksV = new TH1D("NStrip2dAltTracksV",
00861 "Number of strips in 2d V view tracks",
00862 80, 0, 80);
00863 fhNStrip2dAltTracksV -> GetXaxis() -> SetTitle("Raw ADC");
00864 fhNStrip2dAltTracksV -> GetXaxis() -> CenterTitle();
00865 //______________________________________________________________________________________//
00866 fhNStrip2dAltTracksU = new TH1D("NStrip2dAltTracksU",
00867 "Number of strips in 2d U view tracks",
00868 80, 0, 80);
00869 fhNStrip2dAltTracksU -> GetXaxis() -> SetTitle("Raw ADC");
00870 fhNStrip2dAltTracksU -> GetXaxis() -> CenterTitle();
00871
00872 //______________________________________________________________________________________//
00873 fhSigmaOfTPosVviewAlt = new TH1D("SigmaOfTPosVviewAlt",
00874 "error in tpos from fit in V view for max charge track",
00875 fTrackResidualRMSBins, 0, fTrackResidualRMSLimit);
00876 fhSigmaOfTPosVviewAlt -> GetXaxis() -> SetTitle("tpos uncertainty (m)");
00877 fhSigmaOfTPosVviewAlt -> GetXaxis() -> CenterTitle();
00878 //______________________________________________________________________________________//
00879 fhSigmaOfTPosUviewAlt = new TH1D("SigmaOfTPosUviewAlt",
00880 "error in tpos from fit in U view for max charge track",
00881 fTrackResidualRMSBins, 0, fTrackResidualRMSLimit);
00882 fhSigmaOfTPosUviewAlt -> GetXaxis() -> SetTitle("tpos uncertainty (m)");
00883 fhSigmaOfTPosUviewAlt -> GetXaxis() -> CenterTitle();
00884
00885 fHistogramFile -> cd();
00886 }
00887
00888 fhCharge2dAltTracksV -> Fill(vcharge);
00889 fhCharge2dAltTracksU -> Fill(ucharge);
00890 fhNStrip2dAltTracksV -> Fill(nvstrip);
00891 fhNStrip2dAltTracksU -> Fill(nustrip);
00892 fhSigmaOfTPosVviewAlt -> Fill(vsigmatpos);
00893 fhSigmaOfTPosUviewAlt -> Fill(usigmatpos);
00894
00895 }
|
|
||||||||||||
|
Definition at line 1200 of file AlignmentHistograms.cxx. References fhHitModuleResidual, fHistogramFile, fhSpecificMdlResidual, fMdlResidualCurrentSample, fMdlResidualCurrentSampleSize, fMdlResidualSample, fMdlSampleSize, fModuleResidualDirectory, fNResidualBinsStrip, fPlaneResidualDirectory, fpPlaneResidual, fResidualLimitStrip, fResidualSummaryDirectory, GetMdlIndex(), PlexScintMdlId::GetModule(), PlexPlaneId::GetNumStrips(), PlexPlaneId::GetPlane(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), PlexStripEndId::GetScintMdlId(), PlexStripEndId::GetStrip(), and name. Referenced by FillHistograms(). 01202 {
01203
01204 const int plane = plexid.GetPlane();
01205 const int strip = plexid.GetStrip();
01206 PlexScintMdlId plexmdlid = plexid.GetScintMdlId();
01207 const int module = plexmdlid.GetModule();
01208
01209 map<PlexScintMdlId, unsigned int>::iterator miter = fMdlResidualCurrentSampleSize.find(plexmdlid);
01210 if(miter->second > fMdlSampleSize){
01211 double size = double(fMdlSampleSize);
01212 double mean = fMdlResidualCurrentSample[plexmdlid]/size;
01213 fMdlResidualSample[plexmdlid].push_back(mean);
01214 fMdlResidualCurrentSample[plexmdlid] = 0.0;
01215 miter->second = 0;
01216 } else {
01217 fMdlResidualCurrentSample[plexmdlid] += residual;
01218 miter->second += 1;
01219 }
01220
01221 map<PlexScintMdlId, TH1D *>::iterator mit = fhHitModuleResidual.find(plexmdlid);
01222 if(mit == fhHitModuleResidual.end()){
01223 fModuleResidualDirectory -> cd();
01224 char name[80];
01225 char title[80];
01226 sprintf(name,"ResidualInPlane%03dModule%02d", plane, module);
01227 sprintf(title,"Residual in hit module, plane %03d, module %03d", plane, module);
01228 TH1D *h = new TH1D(name, title, 5*fNResidualBinsStrip,
01229 -fResidualLimitStrip, fResidualLimitStrip);
01230 h -> GetXaxis() -> SetTitle("residual (m)");
01231 h -> GetXaxis() -> CenterTitle();
01232 h -> Fill(residual);
01233 fhHitModuleResidual[plexmdlid] = h;
01234 fHistogramFile -> cd();
01235 } else
01236 (mit->second) -> Fill(residual);
01237
01238
01239 //Fill residual histograms for different views, coverages and module #
01240 int ind = GetMdlIndex(plexid);
01241 map<int, TH1D *>::iterator mitr = fhSpecificMdlResidual.find(ind);
01242 if(mitr == fhSpecificMdlResidual.end()){
01243 fResidualSummaryDirectory -> cd();
01244 stringstream name;
01245 stringstream title;
01246 string view;
01247 if(plexid.GetPlaneView() == PlaneView::kV)
01248 view = "V";
01249 else
01250 view = "U";
01251 string coverage, coveragel;
01252 if(plexid.GetPlaneCoverage() == PlaneCoverage::kNearPartial){
01253 coverage = "Partial";
01254 coveragel = "partial";
01255 } else {
01256 coverage = "Full";
01257 coveragel = "full";
01258 }
01259 name <<"Residual"<<view<<"view"<<coverage<<"PlaneModule"<<module;
01260 title <<"Residual in "<<view<<" view for "<<coveragel<<" plane and module # "<<module;
01261 TH1D *h = new TH1D(name.str().c_str(), title.str().c_str(),
01262 5*fNResidualBinsStrip, -fResidualLimitStrip, fResidualLimitStrip);
01263 h -> GetXaxis() -> SetTitle("residual (m)");
01264 h -> GetXaxis() -> CenterTitle();
01265 h -> Fill(residual);
01266 fhSpecificMdlResidual[ind] = h;
01267 fHistogramFile -> cd();
01268 } else
01269 (mitr->second) -> Fill(residual);
01270
01271 map<int, TProfile *>::iterator spit = fpPlaneResidual.find(plane);
01272 if(spit == fpPlaneResidual.end()){
01273 fPlaneResidualDirectory -> cd();
01274 char name[80];
01275 char title[80];
01276 int nstrip = plexid.GetNumStrips();
01277 sprintf(name,"TProfileResidualInPlane%03d", plane);
01278 sprintf(title,"TProfile residual vs strip # in plane %03d", plane);
01279 TProfile *p = new TProfile(name, title, nstrip, 0.0, nstrip);
01280 p -> GetYaxis() -> SetTitle("residual (m)");
01281 p -> GetYaxis() -> CenterTitle();
01282 p -> GetXaxis() -> SetTitle("strip #");
01283 p -> GetXaxis() -> CenterTitle();
01284 p -> Fill(strip, residual);
01285 fpPlaneResidual[plane] = p;
01286 fHistogramFile -> cd();
01287 } else
01288 (spit->second) -> Fill(strip, residual);
01289
01290 }
|
|
|
Definition at line 2000 of file AlignmentHistograms.cxx. References fh2TrackHitvsMaxChargeHit, fhNHigherChargeNonTrackPlaneHitsvsPlane, fnplanes, and MSG. Referenced by ProcessHistograms(). 02001 {
02002 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FillNAlternativeTrackHits()..." << endl;
02003
02004 if(fh2TrackHitvsMaxChargeHit.empty()){
02005 MSG("Align", Msg::kWarning) << "fh2TrackHitvsMaxChargeHit is empty. Bailing out." << endl;
02006 return;
02007 }
02008
02009 fhNHigherChargeNonTrackPlaneHitsvsPlane = new TH1D("NHigherChargeNonTrackPlaneHitsvsPlane",
02010 "Number of hits with higher than track hit charge vs plane #",
02011 fnplanes, 0, fnplanes);
02012
02013 TTree *tree = new TTree("MaxChargeStrips","Candidate strips with charge higher than track strip in same plane");
02014 Int_t entries, plane=0;
02015 tree -> Branch("plane", &plane, "plane/I");
02016 tree -> Branch("entries", &entries, "entries/I");
02017
02018 for(map<int, TH2D *>::const_iterator it = fh2TrackHitvsMaxChargeHit.begin();
02019 it != fh2TrackHitvsMaxChargeHit.end(); ++it)
02020 {
02021 plane = it->first;
02022 double nentries = (it->second)->GetEntries();
02023 fhNHigherChargeNonTrackPlaneHitsvsPlane -> SetBinContent(plane, nentries);
02024 entries = (Int_t) nentries;
02025 tree -> Fill();
02026 }
02027
02028 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FillNAlternativeTrackHits()... Done" << endl;
02029 }
|
|
||||||||||||
|
Definition at line 1294 of file AlignmentHistograms.cxx. References fHistogramFile, PlexStripEndId::GetEncoded(), PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), and MSG. 01296 {
01297 MSG("Align", Msg::kVerbose) << "AlignmentHistograms::FillNumberOfHits()..." << endl;
01298
01299 fHistogramFile -> cd();
01300 TTree *stree = new TTree("StripHits","Number of track hits per strip");
01301
01302 Int_t nhits = 0, plane=0, strip=0, module=0;
01303 UInt_t plexseid=0;
01304
01305 stree -> Branch("nhits", &nhits, "nhits/I");
01306 stree -> Branch("plane", &plane, "plane/I");
01307 stree -> Branch("strip", &strip, "strip/I");
01308 stree -> Branch("plexseid", &plexseid, "plexseid/i");
01309
01310 for(map<PlexStripEndId, int>::const_iterator sit = shits.begin();
01311 sit != shits.end(); ++sit){
01312
01313 nhits = sit->second;
01314 plane = (sit->first).GetPlane();
01315 strip = (sit->first).GetStrip();
01316 plexseid = (sit->first).GetEncoded();
01317 stree -> Fill();
01318 }
01319
01320 TTree *mtree = new TTree("MdlHits","Number of track hits per module");
01321 UInt_t plexmdlid=0;
01322 mtree -> Branch("nhits", &nhits, "nhits/I");
01323 mtree -> Branch("plane", &plane, "plane/I");
01324 mtree -> Branch("module", &module, "module/I");
01325 mtree -> Branch("plexmdlid", &plexmdlid, "plexmdlid/i");
01326
01327 for(map<PlexScintMdlId, int>::const_iterator mit = mhits.begin();
01328 mit != mhits.end(); ++mit){
01329
01330 nhits = mit->second;
01331 plane = (mit->first).GetPlane();
01332 module = (mit->first).GetModule();
01333 plexmdlid = (mit->first).GetEncoded();
01334 mtree -> Fill();
01335 }
01336 MSG("Align", Msg::kVerbose) << "AlignmentHistograms::FillNumberOfHits()... Done" << endl;
01337 }
|
|
||||||||||||||||
|
Definition at line 1930 of file AlignmentHistograms.cxx. References fh2TrackvsCandStripsChargeRatio, fh2TrackvsCandStripsHits, fHistogramFile, fPlanePlexDirectory, PlexPlaneId::GetNumStrips(), PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), MSG, and name. 01933 {
01934
01935 if(trackstrip.GetPlane() != candstrip.GetPlane()){
01936 MSG("Align", Msg::kWarning) << "Using FillPlaneStrips() for different planes" << endl;
01937 return;
01938 }
01939
01940 int plane = trackstrip.GetPlane();
01941 map<int, TH2D *>::iterator fit = fh2TrackvsCandStripsChargeRatio.find(plane);
01942 if(fit == fh2TrackvsCandStripsChargeRatio.end()){
01943 fPlanePlexDirectory -> cd();
01944 int nstrip = candstrip.GetNumStrips();
01945 char name[80];
01946 char title[80];
01947 sprintf(name,"PlexInPlane%03d", plane);
01948 sprintf(title,"All candidate strip charges in plane %03d", plane);
01949 TH2D *h = new TH2D(name, title, nstrip, 0, nstrip, nstrip, 0, nstrip);
01950 h -> GetXaxis() -> SetTitle("track strip #");
01951 h -> GetXaxis() -> CenterTitle();
01952 h -> GetYaxis() -> SetTitle("candidate strip #");
01953 h -> GetYaxis() -> CenterTitle();
01954 fh2TrackvsCandStripsChargeRatio[plane] = h;
01955 h -> Fill(trackstrip.GetStrip(), candstrip.GetStrip(), chargeratio);
01956 sprintf(name,"NentriesInPlane%03d", plane);
01957 sprintf(title,"Number of entries in each bin for plane %03d", plane);
01958 fh2TrackvsCandStripsHits[plane] = new TH2D(name, title, nstrip, 0, nstrip, nstrip, 0, nstrip);
01959 fh2TrackvsCandStripsHits[plane] -> Fill(trackstrip.GetStrip(), candstrip.GetStrip(), 1.0);
01960 fHistogramFile -> cd();
01961 } else {
01962 (fit -> second) -> Fill(trackstrip.GetStrip(), candstrip.GetStrip(), chargeratio);
01963 fh2TrackvsCandStripsHits[plane] -> Fill(trackstrip.GetStrip(), candstrip.GetStrip(), 1.0);
01964 }
01965 }
|
|
||||||||||||||||
|
Definition at line 899 of file AlignmentHistograms.cxx. References fHistogramFile, fhResidualvsMuonPathLength, fMultipleScatteringDirectory, fMuonPathLengthBinWidth, fNResidualBinsStrip, fpResidualvsMuonPathLength, fpResidualvsMuonPathLengthNegCosZ, fpResidualvsMuonPathLengthPosCosZ, fResidualLimitStrip, and name. 00902 {
00903 if(coszsign)
00904 fpResidualvsMuonPathLengthPosCosZ -> Fill(length, residual, 1.0);
00905 else
00906 fpResidualvsMuonPathLengthNegCosZ -> Fill(length, residual, 1.0);
00907
00908 fpResidualvsMuonPathLength -> Fill(length, residual, 1.0);
00909
00910 int bin = int(length/fMuonPathLengthBinWidth);
00911 map<int, TH1D *>::iterator fit = fhResidualvsMuonPathLength.find(bin);
00912 if(fit == fhResidualvsMuonPathLength.end())
00913 {
00914 fMultipleScatteringDirectory -> cd();
00915 char name[80];
00916 char title[80];
00917 sprintf(name,"ResidualvsMuonPathLengthBin%02d", bin);
00918 sprintf(title,"Residual vs muon path length bin #%02d", bin);
00919 TH1D *h = new TH1D(name, title, fNResidualBinsStrip,
00920 -fResidualLimitStrip, fResidualLimitStrip);
00921 h -> GetXaxis() -> SetTitle("residual (m)");
00922 h -> GetXaxis() -> CenterTitle();
00923 h -> Fill(residual);
00924 fhResidualvsMuonPathLength[bin] = h;
00925 fHistogramFile -> cd();
00926 } else
00927 (fit->second) -> Fill(residual);
00928 }
|
|
||||||||||||||||
|
Definition at line 2841 of file AlignmentHistograms.cxx. References f2hRoundingErrorY, f2hRoundingErrorZ, fhRoundingErrorY, fhRoundingErrorZ, fnplanes, fnstrips, PlexPlaneId::GetPlane(), and PlexStripEndId::GetStrip(). 02844 {
02845 if(!f2hRoundingErrorY){
02846 f2hRoundingErrorY = new TH2D("RoundingErrorY2d", "Rounding error in y",
02847 fnplanes, 0, fnplanes, fnstrips, 0.0, fnstrips);
02848 f2hRoundingErrorZ = new TH2D("RoundingErrorZ2d", "Rounding error in z",
02849 fnplanes, 0, fnplanes, fnstrips, 0.0, fnstrips);
02850 fhRoundingErrorY = new TH1D("RoundingErrorY", "Rounding error in y", 1000, -2.0e-4, 2.0e-4);
02851 fhRoundingErrorZ = new TH1D("RoundingErrorZ", "Rounding error in z", 1000, -1.0e-4, 1.0e-4);
02852 }
02853
02854 f2hRoundingErrorY -> Fill(plexid.GetPlane(), plexid.GetStrip(), fabs(y));
02855 f2hRoundingErrorZ -> Fill(plexid.GetPlane(), plexid.GetStrip(), fabs(z));
02856 fhRoundingErrorY -> Fill(y);
02857 fhRoundingErrorZ -> Fill(z);
02858 }
|
|
|
Definition at line 931 of file AlignmentHistograms.cxx. 00932 {
00933 TTree *tree = new TTree("RunSummary","Run summary");
00934
00935 Int_t run, subrun;
00936 Double_t nrecord;
00937 Double_t ntrackvstrip, ntrackustrip, ncandvstrip, ncandustrip;
00938 Double_t trackvcharge, trackucharge, candvcharge, canducharge;
00939
00940 tree -> Branch("run", &run, "run/I");
00941 tree -> Branch("subrun", &subrun, "subrun/I");
00942 tree -> Branch("nrecord", &nrecord, "nrecord/D");
00943 tree -> Branch("ntrackvstrip", &ntrackvstrip, "ntrackvstrip/D");
00944 tree -> Branch("ntrackustrip", &ntrackustrip, "ntrackustrip/D");
00945 tree -> Branch("ncandvstrip", &ncandvstrip, "ncandvstrip/D");
00946 tree -> Branch("ncandustrip", &ncandustrip, "ncandustrip/D");
00947 tree -> Branch("trackvcharge", &trackvcharge, "trackvcharge/D");
00948 tree -> Branch("trackucharge", &trackucharge, "trackucharge/D");
00949 tree -> Branch("candvcharge", &candvcharge, "candvcharge/D");
00950 tree -> Branch("canducharge", &canducharge, "canducharge/D");
00951
00952 for(vector<RunSummary>::const_iterator it = rs.begin(); it != rs.end(); ++it){
00953 run = it -> run;
00954 subrun = it -> subrun;
00955 nrecord = it -> nrecord;
00956 ntrackvstrip = it -> ntrackvstrip;
00957 ntrackustrip = it -> ntrackustrip;
00958 ncandvstrip = it -> ncandvstrip;
00959 ncandustrip = it -> ncandustrip;
00960 trackvcharge = it -> trackvcharge;
00961 trackucharge = it -> trackucharge;
00962 candvcharge = it -> candvcharge;
00963 canducharge = it -> canducharge;
00964 tree -> Fill();
00965 }
00966 }
|
|
|
Definition at line 617 of file AlignmentHistograms.cxx. References fChargeHistogramRatio2dTracks, fChargeRatioOf2dTracks, fhCharge2dTracksU, fhCharge2dTracksV, fHistogramFile, fhNStrip2dTracksU, fhNStrip2dTracksV, fhSigmaOfTPosUview, fhSigmaOfTPosVview, fhTrackChargeOverTotalChargeRatio, fhTrackHoughCosU, fhTrackHoughCosV, fhTrackHoughCosZ, fNCosBins, fNTrackChargeBins, fp3dTrackChargeRatiovsCosz, fp3dTrackChargevsNStrips, fp3dTrackChargevsTrackChargeRatio, fp3dTrackChargevsTrackCosz, fp3dTrackNStripsvsCosz, fpTPosSigmavsCosZUview, fpTPosSigmavsCosZVview, fpTPosSigmavsTrackChargeRatioUview, fpTPosSigmavsTrackChargeRatioVview, fpTPosSigmavsTrackChargeUview, fpTPosSigmavsTrackChargeVview, fpTPosSigmavsTrackNStripsUview, fpTPosSigmavsTrackNStripsVview, fTrackChargeLimit, fTrackDirectory, fTrackResidualRMSBins, fTrackResidualRMSLimit, fTrackResidualRMSUview, fTrackResidualRMSVview, NtpAlignmentRecord::hcosz, MSG, NtpAlignmentRecord::ntrackustrip, NtpAlignmentRecord::ntrackvstrip, NtpAlignmentRecord::ucharge, NtpAlignmentRecord::usigmaoftpos, NtpAlignmentRecord::vcharge, and NtpAlignmentRecord::vsigmaoftpos. 00618 {
00619 if(!fhCharge2dTracksV){
00620 fTrackDirectory -> cd();
00621
00622 //______________________________________________________________________________________
00623 fp3dTrackChargevsTrackChargeRatio = new TProfile("TrackChargevsTrackChargeRatio",
00624 "3d track charge vs track charge/record charge",
00625 200, 0.0, 1.0);
00626
00627 //______________________________________________________________________________________
00628 fp3dTrackChargeRatiovsCosz = new TProfile("TrackChargeRatiovsCosz",
00629 "3d track charge/record charge vs Hough CosZ",
00630 200, -1.0, 1.0);
00631
00632 //______________________________________________________________________________________
00633 fp3dTrackChargevsTrackCosz = new TProfile("TrackChargevsTrackCosz",
00634 "3d track charge vs Hough CosZ",
00635 200, -1.0, 1.0);
00636
00637 //______________________________________________________________________________________
00638 fp3dTrackChargevsNStrips = new TProfile("TrackChargevsNStrips",
00639 "3d track charge vs # of strips",
00640 100, 0.0, 100.0);
00641
00642 //______________________________________________________________________________________
00643 fp3dTrackNStripsvsCosz = new TProfile("TrackNStripsvsCosz",
00644 "3d track # of strip vs Hough CosZ",
00645 200, -1.0, 1.0);
00646
00647 //____________________________________________________________________________________________
00648 fpTPosSigmavsCosZVview = new TProfile("TPosSigmavsCosZVview",
00649 "Error in tpos vs cosz V planes",
00650 100, -1.0, 1.0);
00651 fpTPosSigmavsCosZVview -> GetYaxis() -> SetTitle("error in tpos (m)");
00652 fpTPosSigmavsCosZVview -> GetYaxis() -> CenterTitle();
00653
00654 fpTPosSigmavsCosZUview = new TProfile("TPosSigmavsCosZUview",
00655 "Error in tpos vs cosz U planes",
00656 100, -1.0, 1.0);
00657 fpTPosSigmavsCosZUview -> GetYaxis() -> SetTitle("error in tpos (m)");
00658 fpTPosSigmavsCosZUview -> GetYaxis() -> CenterTitle();
00659
00660 //____________________________________________________________________________________________
00661 fpTPosSigmavsTrackChargeVview = new TProfile("TPosSigmavsTrackChargeVview",
00662 "Error in tpos vs track charge V planes",
00663 1000, 0.0, 100000);
00664 fpTPosSigmavsTrackChargeVview -> GetYaxis() -> SetTitle("error in tpos (m)");
00665 fpTPosSigmavsTrackChargeVview -> GetYaxis() -> CenterTitle();
00666 fpTPosSigmavsTrackChargeVview -> GetXaxis() -> SetTitle("2d track charge (ADC)");
00667 fpTPosSigmavsTrackChargeVview -> GetXaxis() -> CenterTitle();
00668
00669
00670 fpTPosSigmavsTrackChargeUview = new TProfile("TPosSigmavsTrackChargeUview",
00671 "Error in tpos vs # track charge U planes",
00672 1000, 0.0, 100000);
00673 fpTPosSigmavsTrackChargeUview -> GetYaxis() -> SetTitle("error in tpos (m)");
00674 fpTPosSigmavsTrackChargeUview -> GetYaxis() -> CenterTitle();
00675 fpTPosSigmavsTrackChargeUview -> GetXaxis() -> SetTitle("2d track charge (ADC)");
00676 fpTPosSigmavsTrackChargeUview -> GetXaxis() -> CenterTitle();
00677
00678 //____________________________________________________________________________________________
00679 fpTPosSigmavsTrackNStripsVview = new TProfile("TPosSigmavsTrackNStripsVview",
00680 "Error in tpos vs # of track V strips",
00681 100, 0.0, 100);
00682 fpTPosSigmavsTrackNStripsVview -> GetYaxis() -> SetTitle("error in tpos (m)");
00683 fpTPosSigmavsTrackNStripsVview -> GetYaxis() -> CenterTitle();
00684 fpTPosSigmavsTrackNStripsVview -> GetXaxis() -> SetTitle("#strips");
00685 fpTPosSigmavsTrackNStripsVview -> GetXaxis() -> CenterTitle();
00686
00687 fpTPosSigmavsTrackNStripsUview = new TProfile("TPosSigmavsTrackNStripsUview",
00688 "Error in tpos vs # of track U strips",
00689 100, 0.0, 100);
00690 fpTPosSigmavsTrackNStripsUview -> GetYaxis() -> SetTitle("error in tpos (m)");
00691 fpTPosSigmavsTrackNStripsUview -> GetYaxis() -> CenterTitle();
00692 fpTPosSigmavsTrackNStripsUview -> GetXaxis() -> SetTitle("#strips");
00693 fpTPosSigmavsTrackNStripsUview -> GetXaxis() -> CenterTitle();
00694
00695 //____________________________________________________________________________________________
00696 fpTPosSigmavsTrackChargeRatioVview = new TProfile("TPosSigmavsTrackChargeRatioVview",
00697 "Error in tpos vs # track/record charge V planes",
00698 100, 0.0, 1.0);
00699 fpTPosSigmavsTrackChargeRatioVview -> GetYaxis() -> SetTitle("error in tpos (m)");
00700 fpTPosSigmavsTrackChargeRatioVview -> GetYaxis() -> CenterTitle();
00701
00702 fpTPosSigmavsTrackChargeRatioUview = new TProfile("TPosSigmavsTrackChargeRatioUview",
00703 "Error in tpos vs # track/record charge U planes",
00704 100, 0.0, 1.0);
00705 fpTPosSigmavsTrackChargeRatioUview -> GetYaxis() -> SetTitle("error in tpos (m)");
00706 fpTPosSigmavsTrackChargeRatioUview -> GetYaxis() -> CenterTitle();
00707
00708 //______________________________________________________________________________________
00709 fhTrackChargeOverTotalChargeRatio = new TH1D("TrackChargeOverTotalChargeRatio",
00710 "Ratio of 3d track charge over total record charge",
00711 200, 0.0, 1.0);
00712
00713 //______________________________________________________________________________________//
00714 fhCharge2dTracksV = new TH1D("Charge2dTracksV",
00715 "Charge in 2d V view tracks",
00716 fNTrackChargeBins, 0, fTrackChargeLimit);
00717 fhCharge2dTracksV -> GetXaxis() -> SetTitle("Raw ADC");
00718 fhCharge2dTracksV -> GetXaxis() -> CenterTitle();
00719
00720 fhCharge2dTracksU = new TH1D("Charge2dTracksU",
00721 "Charge in 2d U view tracks",
00722 fNTrackChargeBins, 0, fTrackChargeLimit);
00723 fhCharge2dTracksU -> GetXaxis() -> SetTitle("Raw ADC");
00724 fhCharge2dTracksU -> GetXaxis() -> CenterTitle();
00725
00726 //______________________________________________________________________________________//
00727 fhNStrip2dTracksV = new TH1D("NStrip2dTracksV",
00728 "Number of strips in 2d V view tracks",
00729 80, 0, 80);
00730 fhNStrip2dTracksV -> GetXaxis() -> SetTitle("Raw ADC");
00731 fhNStrip2dTracksV -> GetXaxis() -> CenterTitle();
00732
00733 fhNStrip2dTracksU = new TH1D("NStrip2dTracksU",
00734 "Number of strips in 2d U view tracks",
00735 80, 0, 80);
00736 fhNStrip2dTracksU -> GetXaxis() -> SetTitle("Raw ADC");
00737 fhNStrip2dTracksU -> GetXaxis() -> CenterTitle();
00738
00739 //______________________________________________________________________________________//
00740 fhTrackHoughCosU = new TH1D("TrackHoughCosU",
00741 "Residual rms of 2d tracks in V view",
00742 fNCosBins, -1, 1);
00743 //______________________________________________________________________________________//
00744 fhTrackHoughCosV = new TH1D("TrackHoughCosV",
00745 "Residual rms of 2d tracks in V view",
00746 fNCosBins, -1, 1);
00747 //______________________________________________________________________________________//
00748 fhTrackHoughCosZ = new TH1D("TrackHoughCosZ",
00749 "Residual rms of 2d tracks in V view",
00750 fNCosBins, -1, 1);
00751 //______________________________________________________________________________________//
00752 fhSigmaOfTPosVview = new TH1D("SigmaOfTPosVview",
00753 "Error in tpos from fit in V view",
00754 fTrackResidualRMSBins, 0, fTrackResidualRMSLimit);
00755 fhSigmaOfTPosVview -> GetXaxis() -> SetTitle("tpos uncertainty (m)");
00756 fhSigmaOfTPosVview -> GetXaxis() -> CenterTitle();
00757
00758 fhSigmaOfTPosUview = new TH1D("SigmaOfTPosUview",
00759 "Error in tpos from fit in U view",
00760 fTrackResidualRMSBins, 0, fTrackResidualRMSLimit);
00761 fhSigmaOfTPosUview -> GetXaxis() -> SetTitle("tpos uncertainty (m)");
00762 fhSigmaOfTPosUview -> GetXaxis() -> CenterTitle();
00763 //______________________________________________________________________________________//
00764 fTrackResidualRMSVview = new TH1D ("TrackResidualRMSVview",
00765 "Roughly RMS of residuals along V view tracks",
00766 fTrackResidualRMSBins, 0, fTrackResidualRMSLimit);
00767 fTrackResidualRMSVview -> GetXaxis() -> SetTitle("track rms residual (m)");
00768 fTrackResidualRMSVview -> GetXaxis() -> CenterTitle();
00769
00770 fTrackResidualRMSUview = new TH1D ("TrackResidualRMSUview",
00771 "Roughly RMS of residuals along U view tracks",
00772 fTrackResidualRMSBins, 0, fTrackResidualRMSLimit);
00773 fTrackResidualRMSUview -> GetXaxis() -> SetTitle("track rms residual (m)");
00774 fTrackResidualRMSUview -> GetXaxis() -> CenterTitle();
00775
00776 //______________________________________________________________________________________//
00777 fChargeRatioOf2dTracks = new TH1D ("ChargeRatioOf2dTracks",
00778 "Ratio of track charge, V over U",
00779 100, 0, 5);
00780 //______________________________________________________________________________________//
00781 fChargeHistogramRatio2dTracks = new TH1D("ChargeHistogramRatio2dTracks",
00782 "Ratio of 2d track charge histograms, V over U",
00783 fNTrackChargeBins, 0, fTrackChargeLimit);
00784 fChargeHistogramRatio2dTracks -> GetXaxis() -> SetTitle("Raw ADC");
00785 fChargeHistogramRatio2dTracks -> GetXaxis() -> CenterTitle();
00786
00787 fHistogramFile->cd();
00788 }
00789
00790
00791 const Double_t &ucharge = ntprec -> ucharge;
00792 const Double_t &vcharge = ntprec -> vcharge;
00793 const Double_t &vcandcharge = ntprec -> vcandcharge;
00794 const Double_t &ucandcharge = ntprec -> ucandcharge;
00795 fhCharge2dTracksV -> Fill(vcharge);
00796 fhCharge2dTracksU -> Fill(ucharge);
00797 fhNStrip2dTracksV -> Fill(ntprec -> ntrackvstrip);
00798 fhNStrip2dTracksU -> Fill(ntprec -> ntrackustrip);
00799 fTrackResidualRMSVview -> Fill(ntprec -> vtrackrms);
00800 fTrackResidualRMSUview -> Fill(ntprec -> utrackrms);
00801 fhSigmaOfTPosVview -> Fill(ntprec -> vsigmaoftpos);
00802 fhSigmaOfTPosUview -> Fill(ntprec -> usigmaoftpos);
00803 fhTrackHoughCosV -> Fill(ntprec -> hcosv);
00804 fhTrackHoughCosU -> Fill(ntprec -> hcosu);
00805 fhTrackHoughCosZ -> Fill(ntprec -> hcosz);
00806
00807 if(ucharge > 1.0)
00808 fChargeRatioOf2dTracks -> Fill(vcharge/ucharge);
00809
00810 double sum = vcharge + ucharge + vcandcharge + ucandcharge;
00811 if(sum < 1.0){
00812 MSG("Align", Msg::kError) << "Total record charge is less than 1.0."<< endl;
00813 return;
00814 }
00815
00816 double ratio = (vcharge+ucharge)/sum;
00817 int nstrip = ntprec->ntrackvstrip + ntprec->ntrackustrip;
00818 fhTrackChargeOverTotalChargeRatio -> Fill(ratio);
00819
00820 //Fill TProfile histograms
00821 fpTPosSigmavsCosZVview -> Fill(ntprec->hcosz, ntprec->vsigmaoftpos);
00822 fpTPosSigmavsCosZUview -> Fill(ntprec->hcosz, ntprec->usigmaoftpos);
00823 fpTPosSigmavsTrackChargeVview -> Fill(ntprec->vcharge, ntprec->vsigmaoftpos);
00824 fpTPosSigmavsTrackChargeUview -> Fill(ntprec->ucharge, ntprec->usigmaoftpos);
00825 fpTPosSigmavsTrackNStripsVview -> Fill(ntprec->ntrackvstrip, ntprec->vsigmaoftpos);
00826 fpTPosSigmavsTrackNStripsUview -> Fill(ntprec->ntrackustrip, ntprec->usigmaoftpos);
00827 fpTPosSigmavsTrackChargeRatioVview -> Fill(ratio, ntprec->vsigmaoftpos);
00828 fpTPosSigmavsTrackChargeRatioUview -> Fill(ratio, ntprec->usigmaoftpos);
00829 fp3dTrackChargevsTrackChargeRatio -> Fill(ratio, vcharge+ucharge);
00830 fp3dTrackChargevsTrackCosz -> Fill(ntprec->hcosz, vcharge+ucharge);
00831 fp3dTrackNStripsvsCosz -> Fill(ntprec->hcosz, nstrip);
00832 fp3dTrackChargevsNStrips -> Fill(nstrip, vcharge+ucharge);
00833 fp3dTrackChargeRatiovsCosz -> Fill(ntprec->hcosz, ratio);
00834 }
|
|
|
Definition at line 2416 of file AlignmentHistograms.cxx. References fHistogramFile, fpPlaneResidual, GetSampleMeanSigmaSize(), min(), and MSG. Referenced by ProcessHistograms(). 02417 {
02418 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitPlaneResidualProfile("
02419 << int(min) <<")..."<<endl;
02420
02421 if(fpPlaneResidual.empty()){
02422 MSG("Align", Msg::kWarning) << "fpPlaneResidual is empty. Bailing out."<< endl;
02423 return;
02424 }
02425
02426 fHistogramFile -> cd();
02427
02428 TTree *ptree = new TTree("PlaneResProfile","Plane residuals vs strip number");
02429 Double_t par0=0.0, par1=0.0, par0err=0.0, par1err=0.0;
02430 Double_t chi2=0.0, ndgf=0.0, nbin=0.0, pentries=0.0;
02431 Double_t binerrmean=0.0, binerrsigma=0.0, binentmean=0.0, binentsigma=0.0;
02432 Int_t plane=0, nstrip=0;
02433
02434 ptree -> Branch("par0", &par0, "par0/D");
02435 ptree -> Branch("par1", &par1, "par1/D");
02436 ptree -> Branch("par0err", &par0err, "par0err/D");
02437 ptree -> Branch("par1err", &par1err, "par1err/D");
02438 ptree -> Branch("chi2", &chi2, "chi2/D");
02439 ptree -> Branch("ndgf", &ndgf, "ndgf/D");
02440 ptree -> Branch("nbin", &nbin, "nbin/D");
02441 ptree -> Branch("pentries", &pentries, "pentries/D");
02442 ptree -> Branch("binerrmean", &binerrmean, "binerrmean/D");
02443 ptree -> Branch("binerrsigma", &binerrsigma, "binerrsigma/D");
02444 ptree -> Branch("binentmean", &binentmean, "binentmean/D");
02445 ptree -> Branch("binentsigma", &binentsigma, "binentsigma/D");
02446 ptree -> Branch("plane", &plane, "plane/I");
02447 ptree -> Branch("nstrip", &nstrip, "nstrip/I");
02448
02449 for(map<int, TProfile *>::iterator pit = fpPlaneResidual.begin();
02450 pit != fpPlaneResidual.end(); ++pit){
02451
02452 TProfile *p = pit->second;
02453 int size = p -> GetNbinsX();
02454 nstrip = 0;
02455 vector<double> binentv, binerrv;
02456 for(int i = 0; i < size; ++i){
02457 binerrv.push_back(p -> GetBinError(i));
02458 binentv.push_back(p -> GetBinEntries(i));
02459 if(p -> GetBinEntries(i) > 1.0)
02460 nstrip++;
02461 }
02462
02463 if(p->GetEntries() < min)
02464 continue;
02465
02466 if(!GetSampleMeanSigmaSize(binerrv, binerrmean, binerrsigma, nbin) ||
02467 !GetSampleMeanSigmaSize(binentv, binentmean, binentsigma, nbin))
02468 nbin=0, binerrmean=0.0, binerrsigma=0.0, binentmean=0.0, binentsigma=0.0;
02469
02470
02471 char function[80];
02472 plane = pit -> first;
02473 sprintf(function,"FitPlaneResProfile%03d", plane);
02474 TF1 *f = new TF1(function, "pol1");
02475 p -> Fit(function, "QI");
02476 par0 = f -> GetParameter(0);
02477 par1 = f -> GetParameter(1);
02478 par0err = f -> GetParError(0);
02479 par1err = f -> GetParError(1);
02480 chi2 = f -> GetChisquare();
02481 ndgf = f -> GetNDF();
02482 pentries = p -> GetEntries();
02483 ptree -> Fill();
02484 }
02485
02486 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitPlaneResidualProfile("
02487 << int(min) <<")... Done"<<endl;
02488 }
|
|
|
Definition at line 969 of file AlignmentHistograms.cxx. References fHistogramFile, fhMuonPathLengthResidualFitBinEntries, fhMuonPathLengthResidualFitChi2, fhMuonPathLengthResidualFitMean, fhMuonPathLengthResidualFitSigma, fhResidualFitBinEntriesvsMuonPathLength, fhResidualFitChi2vsMuonPathLength, fhResidualFitMeanvsMuonPathLength, fhResidualFitSigmavsMuonPathLength, fhResidualvsMuonPathLength, fMultipleScatteringDirectory, fMuonPathLengthBinWidth, fResidualvsMuonPathLengthFit, fScale, min(), and MSG. Referenced by ProcessHistograms(). 00970 {
00971 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitResidualvsMuonPathLength("<<int(min)<<")..."<<endl;
00972
00973 if(fhResidualvsMuonPathLength.empty()){
00974 MSG("Align", Msg::kWarning) <<"fhResidualvsMuonPathLength is empty. Bailing out." <<endl;
00975 return;
00976 }
00977
00978 vector<double> meanv, sigmav, chi2v, binenv, meanerrv, sigmaerrv;
00979 for(map<int, TH1D *>::iterator itr = fhResidualvsMuonPathLength.begin();
00980 itr != fhResidualvsMuonPathLength.end(); ++itr)
00981 {
00982 int bin = itr -> first;
00983 TH1D *h = itr -> second;
00984 Stat_t nentries = h -> GetEntries();
00985 Double_t mean = h -> GetMean();
00986 Double_t sigma = h -> GetRMS();
00987 int maxbin = h -> GetMaximumBin();
00988 Double_t maxv = h -> GetBinContent(maxbin);
00989
00990 if(nentries < min)
00991 continue;
00992
00993 char function[80];
00994 sprintf(function, "muonfunctionbin%02d", bin);
00995 TF1 *f = new TF1(function, "gaus", mean - 2*sigma, mean + 2*sigma);
00996 f -> SetParameters(maxv, mean, sigma);
00997 h -> Fit(function, "RQI");
00998 mean = f -> GetParameter(1);
00999 sigma = f -> GetParameter(2);
01000 double meanerror = f -> GetParError(1);
01001 double sigmaerror = f -> GetParError(2);
01002 double chi2 = f -> GetChisquare();
01003 double ndgf = f -> GetNDF();
01004
01005 fResidualvsMuonPathLengthFit[bin] = f;
01006 meanv.push_back(mean);
01007 sigmav.push_back(sigma);
01008 meanerrv.push_back(meanerror);
01009 sigmaerrv.push_back(sigmaerror);
01010 binenv.push_back(nentries);
01011 if(ndgf>0)
01012 chi2v.push_back(chi2/ndgf);
01013 }
01014
01015 if(meanv.size()<2){
01016 MSG("Align", Msg::kWarning) << "FitResidualvsMuonPathLength is bailing out" <<endl;
01017 return;
01018 }
01019
01020 fMultipleScatteringDirectory -> cd();
01021
01022 double meanlimit = *max_element(meanv.begin(), meanv.end());
01023 double sigmalimit = *max_element(sigmav.begin(), sigmav.end());
01024 double chi2limit = *max_element(chi2v.begin(), chi2v.end());
01025 double binenlimit = *max_element(binenv.begin(), binenv.end());
01026 double sigmamin = *min_element(sigmav.begin(), sigmav.end());
01027 double chi2min = *min_element(chi2v.begin(), chi2v.end());
01028 double binenmin = *min_element(binenv.begin(), binenv.end());
01029
01030 int bins = meanv.size();
01031 double limit = fScale*fMuonPathLengthBinWidth*(double)bins;
01032 fhResidualFitSigmavsMuonPathLength = new TH1D("ResidualFitSigmavsMuonPathLength",
01033 "Residual fit sigma vs muon path length",
01034 bins, 0.0, limit);
01035 fhResidualFitSigmavsMuonPathLength -> GetXaxis() -> SetTitle("muon path length (m)");
01036 fhResidualFitSigmavsMuonPathLength -> GetXaxis() -> CenterTitle();
01037 fhResidualFitSigmavsMuonPathLength -> GetYaxis() -> SetTitle("sigma residual (m)");
01038 fhResidualFitSigmavsMuonPathLength -> GetYaxis() -> CenterTitle();
01039
01040 fhResidualFitMeanvsMuonPathLength = new TH1D("ResidualFitMeanvsMuonPathLength",
01041 "Residual fit mean vs muon path length",
01042 bins, 0.0, limit);
01043 fhResidualFitMeanvsMuonPathLength -> GetXaxis() -> SetTitle("muon path length (m)");
01044 fhResidualFitMeanvsMuonPathLength -> GetXaxis() -> CenterTitle();
01045 fhResidualFitMeanvsMuonPathLength -> GetYaxis() -> SetTitle("mean residual (m)");
01046 fhResidualFitMeanvsMuonPathLength -> GetYaxis() -> CenterTitle();
01047
01048 fhResidualFitChi2vsMuonPathLength = new TH1D("ResidualFitChi2vsMuonPathLength",
01049 "Residual fit chi2/NDGF vs muon path length",
01050 bins, 0.0, limit);
01051 fhResidualFitChi2vsMuonPathLength -> GetXaxis() -> SetTitle("muon path length (m)");
01052 fhResidualFitChi2vsMuonPathLength -> GetXaxis() -> CenterTitle();
01053 fhResidualFitChi2vsMuonPathLength -> GetYaxis() -> SetTitle("chi2 residual");
01054 fhResidualFitChi2vsMuonPathLength -> GetYaxis() -> CenterTitle();
01055
01056 fhResidualFitBinEntriesvsMuonPathLength = new TH1D("ResidualFitBinEntriesvsMuonPathLength",
01057 "Residual bin entries vs muon path length",
01058 bins, 0.0, limit);
01059 fhResidualFitBinEntriesvsMuonPathLength -> GetXaxis() -> SetTitle("muon path length (m)");
01060 fhResidualFitBinEntriesvsMuonPathLength -> GetXaxis() -> CenterTitle();
01061
01062 fhMuonPathLengthResidualFitMean = new TH1D("MuonPathLengthResidualFitMean",
01063 "Fit mean for muon path length residuals",
01064 50, -fScale*meanlimit, fScale*meanlimit);
01065 fhMuonPathLengthResidualFitMean -> GetXaxis() -> SetTitle("mean residual (m)");
01066 fhMuonPathLengthResidualFitMean -> GetXaxis() -> CenterTitle();
01067
01068 fhMuonPathLengthResidualFitSigma = new TH1D("MuonPathLengthResidualFitSigma",
01069 "Fit sigma for muon path length residuals",
01070 50, sigmamin/fScale, fScale*sigmalimit);
01071 fhMuonPathLengthResidualFitSigma -> GetXaxis() -> SetTitle("sigma residual (m)");
01072 fhMuonPathLengthResidualFitSigma -> GetXaxis() -> CenterTitle();
01073
01074 fhMuonPathLengthResidualFitChi2 = new TH1D("MuonPathLengthResidualFitChi2",
01075 "Fit chi2/NDGF for muon path length residuals",
01076 50, chi2min/fScale, fScale*chi2limit);
01077 fhMuonPathLengthResidualFitChi2 -> GetXaxis() -> SetTitle("chi2 residual");
01078 fhMuonPathLengthResidualFitChi2 -> GetXaxis() -> CenterTitle();
01079
01080 fhMuonPathLengthResidualFitBinEntries = new TH1D("MuonPathLengthResidualFitBinEntries",
01081 "Bin entries for muon path length residuals",
01082 50, binenmin/fScale, fScale*binenlimit);
01083
01084 for(unsigned int i = 0; i < meanv.size(); ++i){
01085 fhMuonPathLengthResidualFitMean -> Fill(meanv[i]);
01086 fhResidualFitMeanvsMuonPathLength -> SetBinContent(i, meanv[i]);
01087 fhResidualFitMeanvsMuonPathLength -> SetBinError(i, meanerrv[i]);
01088 }
01089
01090 for(unsigned int i = 0; i < sigmav.size(); ++i){
01091 fhMuonPathLengthResidualFitSigma -> Fill(sigmav[i]);
01092 fhResidualFitSigmavsMuonPathLength -> SetBinContent(i, sigmav[i]);
01093 fhResidualFitSigmavsMuonPathLength -> SetBinError(i, sigmaerrv[i]);
01094 }
01095
01096 for(unsigned int i = 0; i < chi2v.size(); ++i){
01097 fhMuonPathLengthResidualFitChi2 -> Fill(chi2v[i]);
01098 fhResidualFitChi2vsMuonPathLength -> SetBinContent(i, chi2v[i]);
01099 }
01100
01101 for(unsigned int i = 0; i < binenv.size(); ++i){
01102 fhMuonPathLengthResidualFitBinEntries -> Fill(binenv[i]);
01103 fhResidualFitBinEntriesvsMuonPathLength -> SetBinContent(i, binenv[i]);
01104 }
01105
01106 fHistogramFile -> cd();
01107 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitResidualvsMuonPathLength("<<int(min)<<")... Done"<<endl;
01108 }
|
|
||||||||||||
|
Definition at line 2110 of file AlignmentHistograms.cxx. References fhHitModuleResidual, fHistogramFile, fMdlRotationalResidualFunctions, fPlaneRotationalResidualFunctions, fpMdlRotationalResidual, fpPlaneRotationalResidual, fStripHistograms, PlexScintMdlId::GetEncoded(), PlexStripEndId::GetEncoded(), GetMdlIndex(), PlexScintMdlId::GetModule(), PlexPlaneId::GetPlane(), GetSampleMeanSigmaSize(), PlexStripEndId::GetScintMdlId(), PlexStripEndId::GetStrip(), and MSG. Referenced by ProcessHistograms(). 02111 {
02112 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitRotationalResiduals("
02113 << int(mdlmin) <<", "<< int(stripmin) << ")..." << endl;
02114
02115 if(fpMdlRotationalResidual.empty() || fStripHistograms.empty()){
02116 MSG("Align", Msg::kWarning) << "FitRotationalResiduals bailing out."<< endl;
02117 return;
02118 }
02119
02120 fHistogramFile -> cd();
02121 TTree *stree = new TTree("StripRotRes","Results of fitting strip rotational residuals");
02122 TTree *bstree = new TTree("StripRotResBins","Strip rotational residual histogram bin info");
02123 Double_t binerror = 0.0, binentries = 0.0;
02124 Double_t par0=0.0, par1=0.0, par0err=0.0, par1err=0.0, chi2=0.0, ndgf=0.0, nbin=0.0;
02125 Double_t hmean=0.0, hrms=0.0, hentries=0.0;
02126 Double_t binerrmean=0.0, binerrsigma=0.0, binentmean=0.0, binentsigma=0.0;
02127 Double_t binresidual=0.0;
02128 Int_t mdlindex=0, bin=0;
02129 Int_t plane=0, strip=0;
02130 UInt_t plexseid=0;
02131
02132 bstree -> Branch("binentries", &binentries, "binentries/D");
02133 bstree -> Branch("binerror", &binerror, "binerror/D");
02134 bstree -> Branch("bin", &bin, "bin/I");
02135 bstree -> Branch("binresidual", &binresidual, "binresidual/D");
02136 bstree -> Branch("mdlindex", &mdlindex, "mdlindex/I");
02137 bstree -> Branch("plane", &plane, "plane/I");
02138 bstree -> Branch("strip", &strip, "strip/I");
02139
02140 stree -> Branch("par0", &par0, "par0/D");
02141 stree -> Branch("par1", &par1, "par1/D");
02142 stree -> Branch("par0err", &par0err, "par0err/D");
02143 stree -> Branch("par1err", &par1err, "par1err/D");
02144 stree -> Branch("chi2", &chi2, "chi2/D");
02145 stree -> Branch("ndgf", &ndgf, "ndgf/D");
02146 stree -> Branch("nbin", &nbin, "nbin/D");
02147 stree -> Branch("hmean", &hmean, "hmean/D");
02148 stree -> Branch("hrms", &hrms, "hrms/D");
02149 stree -> Branch("hentries", &hentries, "hentries/D");
02150 stree -> Branch("binerrmean", &binerrmean, "binerrmean/D");
02151 stree -> Branch("binerrsigma", &binerrsigma, "binerrsigma/D");
02152 stree -> Branch("binentmean", &binentmean, "binentmean/D");
02153 stree -> Branch("binentsigma", &binentsigma, "binentsigma/D");
02154 stree -> Branch("plane", &plane, "plane/I");
02155 stree -> Branch("strip", &strip, "strip/I");
02156 stree -> Branch("plexseid", &plexseid, "plexseid/i");
02157
02158 int countstrips=0;
02159 map<PlexScintMdlId, vector<double> > StripPar0Map, StripPar1Map;
02160 for( map<PlexStripEndId, StripHistograms>::iterator sit = fStripHistograms.begin();
02161 sit != fStripHistograms.end(); ++sit)
02162 {
02163 TProfile *p = (sit->second).StripRotationalResidual;
02164 PlexStripEndId plexid = sit -> first;
02165
02166 mdlindex = GetMdlIndex(plexid);
02167 plane = plexid.GetPlane();
02168 strip = plexid.GetStrip();
02169
02170 int size = p -> GetNbinsX();
02171 vector<double> binentv, binerrv;
02172 for(int i = 0; i < size; ++i){
02173 bin = i;
02174 binerror = p -> GetBinError(i);
02175 binentries = p -> GetBinEntries(i);
02176 binresidual = p -> GetBinContent(i);
02177 binerrv.push_back(binerror);
02178 binentv.push_back(binentries);
02179 bstree -> Fill();
02180 }
02181
02182 if(p -> GetEntries() < stripmin)
02183 continue;
02184
02185 if(!GetSampleMeanSigmaSize(binerrv, binerrmean, binerrsigma, nbin) ||
02186 !GetSampleMeanSigmaSize(binentv, binentmean, binentsigma, nbin))
02187 nbin=0, binerrmean=0.0, binerrsigma=0.0, binentmean=0.0, binentsigma=0.0;
02188
02189 map<PlexStripEndId, StripHistograms>::iterator fsit = fStripHistograms.begin();
02190 if(fsit == fStripHistograms.end()){
02191 MSG("Align", Msg::kWarning) <<"Failed to find fStripHistograms"<<plexid<<endl;
02192 continue;
02193 }
02194 TH1D *h = (fsit -> second).StripResidual;
02195
02196 char function[80];
02197 sprintf(function,"FitRotResInPlane%03dStrip%03d", plane, strip);
02198 TF1 *f = new TF1(function, "pol1");
02199 int result = p -> Fit(function, "QI");
02200 par0 = f -> GetParameter(0);
02201 par1 = f -> GetParameter(1);
02202 par0err = f -> GetParError(0);
02203 par1err = f -> GetParError(1);
02204 chi2 = f -> GetChisquare();
02205 ndgf = f -> GetNDF();
02206 hmean = h -> GetMean();
02207 hrms = h -> GetRMS();
02208 hentries = h -> GetEntries();
02209 plexseid = plexid.GetEncoded();
02210 stree -> Fill();
02211
02212 StripPar0Map[plexid.GetScintMdlId()].push_back(f -> GetParameter(0));
02213 StripPar1Map[plexid.GetScintMdlId()].push_back(f -> GetParameter(1));
02214
02215 countstrips++;
02216 if(countstrips % 600 == 0){
02217 MsgFormat ffmt("%5.4f");
02218 MSG("Align", Msg::kInfo) <<"Fit "<<plexid<<" par0 = "<< ffmt(par0)
02219 <<", par1 = "<< ffmt(par1) <<", result = "<< result << endl;
02220 }
02221 }
02222
02223
02224 TTree *mtree = new TTree("MdlRotRes","Results of fitting module rotational residuals");
02225 TTree *bmtree = new TTree("MdlRotResBins","Module rotational residual histogram bin info");
02226 Int_t module=0;
02227 UInt_t plexmdlid=0;
02228 Double_t smeanpar0=0,smeanpar1=0, ssigmapar0=0, ssigmapar1=0, nstrip=0.0;
02229
02230 bmtree -> Branch("binentries", &binentries, "binentries/D");
02231 bmtree -> Branch("binerror", &binerror, "binerror/D");
02232 bmtree -> Branch("binresidual", &binresidual, "binresidual/D");
02233 bmtree -> Branch("bin", &bin, "bin/I");
02234 bmtree -> Branch("mdlindex", &mdlindex, "mdlindex/I");
02235 bmtree -> Branch("plane", &plane, "plane/I");
02236 bmtree -> Branch("module", &module, "module/I");
02237
02238 mtree -> Branch("par0", &par0, "par0/D");
02239 mtree -> Branch("par1", &par1, "par1/D");
02240 mtree -> Branch("par0err", &par0err, "par0err/D");
02241 mtree -> Branch("par1err", &par1err, "par1err/D");
02242 mtree -> Branch("chi2", &chi2, "chi2/D");
02243 mtree -> Branch("ndgf", &ndgf, "ndgf/D");
02244 mtree -> Branch("nbin", &nbin, "nbin/D");
02245 mtree -> Branch("hmean", &hmean, "hmean/D");
02246 mtree -> Branch("hrms", &hrms, "hrms/D");
02247 mtree -> Branch("hentries", &hentries, "hentries/D");
02248 mtree -> Branch("smeanpar0", &smeanpar0, "smeanpar0/D");
02249 mtree -> Branch("smeanpar1", &smeanpar1, "smeanpar1/D");
02250 mtree -> Branch("ssigmapar0", &ssigmapar0, "ssigmapar0/D");
02251 mtree -> Branch("ssigmapar1", &ssigmapar1, "ssigmapar1/D");
02252 mtree -> Branch("nstrip", &nstrip, "nstrip/D");
02253 mtree -> Branch("binerrmean", &binerrmean, "binerrmean/D");
02254 mtree -> Branch("binerrsigma", &binerrsigma, "binerrsigma/D");
02255 mtree -> Branch("binentmean", &binentmean, "binentmean/D");
02256 mtree -> Branch("binentsigma", &binentsigma, "binentsigma/D");
02257 mtree -> Branch("plane", &plane, "plane/I");
02258 mtree -> Branch("module", &module, "module/I");
02259 mtree -> Branch("plexmdlid", &plexmdlid, "plexmdlid/i");
02260
02261 int countmdls=0;
02262 for(map<PlexScintMdlId, TProfile *>::iterator mit = fpMdlRotationalResidual.begin();
02263 mit != fpMdlRotationalResidual.end(); ++mit){
02264
02265 PlexScintMdlId plexid = mit -> first;
02266 mdlindex = GetMdlIndex(plexid);
02267 plane = plexid.GetPlane();
02268 module = plexid.GetModule();
02269
02270 TProfile *p = mit->second;
02271 int size = p -> GetNbinsX();
02272 vector<double> binentv, binerrv;
02273 for(int i = 0; i < size; ++i){
02274 bin = i;
02275 binerror = p -> GetBinError(i);
02276 binentries = p -> GetBinEntries(i);
02277 binresidual = p -> GetBinContent(i);
02278 binerrv.push_back(binerror);
02279 binentv.push_back(binentries);
02280 bmtree -> Fill();
02281 }
02282
02283 if(p->GetEntries() < mdlmin)
02284 continue;
02285
02286 if(!GetSampleMeanSigmaSize(binerrv, binerrmean, binerrsigma, nbin) ||
02287 !GetSampleMeanSigmaSize(binentv, binentmean, binentsigma, nbin))
02288 nbin=0, binerrmean=0.0, binerrsigma=0.0, binentmean=0.0, binentsigma=0.0;
02289
02290 map<PlexScintMdlId, TH1D *>::iterator fmit = fhHitModuleResidual.find(plexid);
02291 if(fmit == fhHitModuleResidual.end()){
02292 MSG("Align", Msg::kWarning) <<"Failed to find fhHitModuleResidual"<<plexid<<endl;
02293 continue;
02294 }
02295 TH1D *h = fmit->second;
02296
02297 char function[80];
02298 sprintf(function,"FitRotResInPlane%03dModule%02d", plane, module);
02299 TF1 *f = new TF1(function, "pol1");
02300 int result = p -> Fit(function, "QI");
02301 par0 = f -> GetParameter(0);
02302 par1 = f -> GetParameter(1);
02303 par0err = f -> GetParError(0);
02304 par1err = f -> GetParError(1);
02305 chi2 = f -> GetChisquare();
02306 ndgf = f -> GetNDF();
02307 hmean = h -> GetMean();
02308 hrms = h -> GetRMS();
02309 hentries = h -> GetEntries();
02310 plexmdlid = plexid.GetEncoded();
02311
02312 map<PlexScintMdlId, vector<double> >::iterator mfit0 = StripPar0Map.find(plexid);
02313 map<PlexScintMdlId, vector<double> >::iterator mfit1 = StripPar1Map.find(plexid);
02314 if(mfit0 == StripPar0Map.end() || mfit1 == StripPar1Map.end()){
02315 smeanpar0=0.0, ssigmapar0=0.0, smeanpar1=0.0, ssigmapar1=0.0, nstrip=0.0;
02316 } else
02317 if(!GetSampleMeanSigmaSize(mfit0->second, smeanpar0, ssigmapar0, nstrip) ||
02318 !GetSampleMeanSigmaSize(mfit1->second, smeanpar1, ssigmapar1, nstrip))
02319 smeanpar0=0.0, ssigmapar0=0.0, smeanpar1=0.0, ssigmapar1=0.0, nstrip=0.0;
02320
02321 mtree -> Fill();
02322
02323 fMdlRotationalResidualFunctions[plexid] = f;
02324
02325 countmdls++;
02326 if(countmdls % 60 == 0){
02327 MsgFormat ffmt("%5.4f");
02328 MSG("Align", Msg::kInfo) <<"Fit "<<plexid<<" par0 = "<< ffmt(par0)
02329 <<", par1 = "<< ffmt(par1) <<", result = "<< result << endl;
02330 }
02331 }
02332
02333 TTree *ptree = new TTree("PlaneRotRes","Results of fitting module rotational residuals");
02334 TTree *bptree = new TTree("PlaneRotResBins","Module rotational residual histogram bin info");
02335
02336 bptree -> Branch("binentries", &binentries, "binentries/D");
02337 bptree -> Branch("binerror", &binerror, "binerror/D");
02338 bptree -> Branch("binresidual", &binresidual, "binresidual/D");
02339 bptree -> Branch("bin", &bin, "bin/I");
02340 bptree -> Branch("mdlindex", &mdlindex, "mdlindex/I");
02341 bptree -> Branch("plane", &plane, "plane/I");
02342 bptree -> Branch("module", &module, "module/I");
02343
02344 ptree -> Branch("par0", &par0, "par0/D");
02345 ptree -> Branch("par1", &par1, "par1/D");
02346 ptree -> Branch("par0err", &par0err, "par0err/D");
02347 ptree -> Branch("par1err", &par1err, "par1err/D");
02348 ptree -> Branch("chi2", &chi2, "chi2/D");
02349 ptree -> Branch("ndgf", &ndgf, "ndgf/D");
02350 ptree -> Branch("nbin", &nbin, "nbin/D");
02351 ptree -> Branch("hentries", &hentries, "hentries/D");
02352 ptree -> Branch("binerrmean", &binerrmean, "binerrmean/D");
02353 ptree -> Branch("binerrsigma", &binerrsigma, "binerrsigma/D");
02354 ptree -> Branch("binentmean", &binentmean, "binentmean/D");
02355 ptree -> Branch("binentsigma", &binentsigma, "binentsigma/D");
02356 ptree -> Branch("plane", &plane, "plane/I");
02357
02358
02359 int countplanes=0;
02360 for(map<PlexPlaneId, TProfile *>::iterator pit = fpPlaneRotationalResidual.begin();
02361 pit != fpPlaneRotationalResidual.end(); ++pit){
02362
02363 PlexPlaneId plexid = pit -> first;
02364 plane = plexid.GetPlane();
02365
02366 TProfile *p = pit->second;
02367 int size = p -> GetNbinsX();
02368 vector<double> binentv, binerrv;
02369 for(int i = 0; i < size; ++i){
02370 bin = i;
02371 binerror = p -> GetBinError(i);
02372 binentries = p -> GetBinEntries(i);
02373 binresidual = p -> GetBinContent(i);
02374 binerrv.push_back(binerror);
02375 binentv.push_back(binentries);
02376 bptree -> Fill();
02377 }
02378
02379 if(p->GetEntries() < mdlmin)
02380 continue;
02381
02382 if(!GetSampleMeanSigmaSize(binerrv, binerrmean, binerrsigma, nbin) ||
02383 !GetSampleMeanSigmaSize(binentv, binentmean, binentsigma, nbin))
02384 nbin=0, binerrmean=0.0, binerrsigma=0.0, binentmean=0.0, binentsigma=0.0;
02385
02386 char function[80];
02387 sprintf(function,"FitRotResInPlane%03d", plane);
02388 TF1 *f = new TF1(function, "pol1");
02389 int result = p -> Fit(function, "QI");
02390 par0 = f -> GetParameter(0);
02391 par1 = f -> GetParameter(1);
02392 par0err = f -> GetParError(0);
02393 par1err = f -> GetParError(1);
02394 chi2 = f -> GetChisquare();
02395 ndgf = f -> GetNDF();
02396 hentries = p -> GetEntries();
02397
02398 ptree -> Fill();
02399
02400 fPlaneRotationalResidualFunctions[plexid] = f;
02401
02402 countplanes++;
02403 if(countmdls % 10 == 0){
02404 MsgFormat ffmt("%5.4f");
02405 MSG("Align", Msg::kInfo) <<"Fit "<<plexid<<" par0 = "<< ffmt(par0)
02406 <<", par1 = "<< ffmt(par1) <<", result = "<< result << endl;
02407 }
02408 }
02409
02410 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitRotationalResiduals("
02411 << int(mdlmin) <<", "<< int(stripmin) << ")... Done" << endl;
02412 }
|
|
|
Definition at line 2491 of file AlignmentHistograms.cxx. References fHistogramFile, fStripHistograms, PlexStripEndId::GetEncoded(), PlexPlaneId::GetPlane(), PlexStripEndId::GetStrip(), min(), and MSG. 02492 {
02493
02494 min = 100.0;
02495 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitStripAttenuationHistograms("
02496 << int(min) <<")..."<<endl;
02497
02498 if(fStripHistograms.empty()){
02499 MSG("Align", Msg::kWarning) << "fStripHistograms is empty. Bailing out."<< endl;
02500 return;
02501 }
02502
02503 fHistogramFile -> cd();
02504
02505 TTree *stree = new TTree("StripAttenuation","StripAttenuation");
02506 Double_t par0=0.0, par1=0.0, par0err=0.0, par1err=0.0;
02507 Double_t chi2=0.0, ndgf=0.0, nbin=0.0, pentries=0.0;
02508 UInt_t plexseid=0;
02509 Int_t plane=0, strip=0;
02510
02511 stree -> Branch("par0", &par0, "par0/D");
02512 stree -> Branch("par1", &par1, "par1/D");
02513 stree -> Branch("par0err", &par0err, "par0err/D");
02514 stree -> Branch("par1err", &par1err, "par1err/D");
02515 stree -> Branch("chi2", &chi2, "chi2/D");
02516 stree -> Branch("ndgf", &ndgf, "ndgf/D");
02517 stree -> Branch("nbin", &nbin, "nbin/D");
02518 stree -> Branch("pentries", &pentries, "pentries/D");
02519 stree -> Branch("plexseid", &plexseid, "plexseid/i");
02520 stree -> Branch("plane", &plane, "plane/I");
02521 stree -> Branch("strip", &strip, "strip/I");
02522
02523 for(map<PlexStripEndId, StripHistograms>::iterator sit = fStripHistograms.begin();
02524 sit != fStripHistograms.end(); ++sit){
02525
02526 TProfile *p = (sit->second).StripAtten;
02527 nbin = p -> GetNbinsX();
02528
02529 if(p->GetEntries() < min)
02530 continue;
02531
02532 PlexStripEndId plexid = sit->first;
02533 plane = plexid.GetPlane();
02534 strip = plexid.GetStrip();
02535 plexseid = plexid.GetEncoded();
02536 char function[100];
02537 sprintf(function,"StripAttenuationPlane%03dStrip%03d", plane, strip);
02538 TF1 *f = new TF1(function, "expo");
02539 f -> SetParameters(6.0, -0.3);
02540 p -> Fit(function, "QIB");
02541 par0 = f -> GetParameter(0);
02542 par1 = f -> GetParameter(1);
02543 par0err = f -> GetParError(0);
02544 par1err = f -> GetParError(1);
02545 chi2 = f -> GetChisquare();
02546 ndgf = f -> GetNDF();
02547 pentries = p -> GetEntries();
02548 stree -> Fill();
02549 }
02550
02551 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitStripAttenuationHistograms("
02552 << int(min) <<")... Done"<<endl;
02553 }
|
|
|
Definition at line 1341 of file AlignmentHistograms.cxx. References fhFittedStripResidualSigmavsPlane, fhFittedStripResidualvsPlane, fHistogramFile, fnplanes, fResidualSummaryDirectory, fStripHistograms, fStripResidualFunctions, PlexStripEndId::GetEncoded(), PlexPlaneId::GetPlane(), GetSampleMeanSigmaSize(), PlexStripEndId::GetStrip(), min(), and MSG. Referenced by ProcessHistograms(). 01342 {
01343 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitStripResidualHistograms("<<int(min)<<")..." << endl;
01344
01345 if(fStripHistograms.empty()){
01346 MSG("Align", Msg::kWarning) <<"fStripHistograms is empty. Bailing out." <<endl;
01347 return;
01348 }
01349
01350 fResidualSummaryDirectory -> cd();
01351
01352 fhFittedStripResidualSigmavsPlane = new TH1D("StripFittedResidualSigmavsPlane",
01353 "Plane mean of fitted strip residuals sigmas vs plane number",
01354 fnplanes, 0, fnplanes);
01355 fhFittedStripResidualSigmavsPlane -> GetXaxis() -> SetTitle("plane #");
01356 fhFittedStripResidualSigmavsPlane -> GetXaxis() -> CenterTitle();
01357 fhFittedStripResidualSigmavsPlane -> GetYaxis() -> SetTitle("Fitted strip residual sigma (m)");
01358 fhFittedStripResidualSigmavsPlane -> GetYaxis() -> CenterTitle();
01359
01360 fhFittedStripResidualvsPlane = new TH1D("StripFittedResidualvsPlane",
01361 "Plane mean of fitted strip residuals vs plane number",
01362 fnplanes, 0, fnplanes);
01363 fhFittedStripResidualvsPlane -> GetYaxis() -> SetTitle("residual (m)");
01364 fhFittedStripResidualvsPlane -> GetYaxis() -> CenterTitle();
01365 fhFittedStripResidualvsPlane -> GetXaxis() -> SetTitle("plane number");
01366 fhFittedStripResidualvsPlane -> GetXaxis() -> CenterTitle();
01367
01368 fHistogramFile -> cd();
01369
01370 TTree *stree = new TTree("StripResFit","Results of fitting strip residuals");
01371
01372 Double_t mean=0.0, sigma=0.0, meanerr=0.0, sigmaerr=0.0, chi2=0.0, ndgf=0.0;
01373 Double_t hmean = 0.0, hrms=0.0, hentries=0.0;
01374 Int_t plane=0, strip=0;
01375 UInt_t plexseid=0;
01376
01377 stree -> Branch("mean", &mean, "mean/D");
01378 stree -> Branch("sigma", &sigma, "sigma/D");
01379 stree -> Branch("meanerr", &meanerr, "meanerr/D");
01380 stree -> Branch("sigmaerr", &sigmaerr, "sigmaerr/D");
01381 stree -> Branch("hmean", &hmean, "hmean/D");
01382 stree -> Branch("hrms", &hrms, "hrms/D");
01383 stree -> Branch("hentries", &hentries, "hentries/D");
01384 stree -> Branch("chi2", &chi2, "chi2/D");
01385 stree -> Branch("ndgf", &ndgf, "ndgf/D");
01386 stree -> Branch("plane", &plane, "plane/I");
01387 stree -> Branch("strip", &strip, "strip/I");
01388 stree -> Branch("plexseid", &plexseid, "plexseid/i");
01389
01390 int countstrips = 0;
01391 map<int, vector<double> > FittedStripResidualvsPlane;
01392 map<int, vector<double> > FittedStripResidualSigmavsPlane;
01393 for( map<PlexStripEndId, StripHistograms>::iterator itr = fStripHistograms.begin();
01394 itr != fStripHistograms.end(); ++itr)
01395 {
01396
01397 TH1D *h = (itr -> second).StripResidual;
01398 hmean = h -> GetMean();
01399 hrms = h -> GetRMS();
01400 hentries = h -> GetEntries();
01401
01402 if(hentries < min)
01403 continue;
01404
01405 PlexStripEndId plexid = itr -> first;
01406 map<PlexStripEndId, TF1 *>::iterator fit = fStripResidualFunctions.find(plexid);
01407 if(fit != fStripResidualFunctions.end()){
01408 MSG("Align", Msg::kWarning) <<"fStripResidualFunctions"<<itr->first
01409 <<" already exists. Bailing out." <<endl;
01410 return;
01411 }
01412
01413 char function[30];
01414 plane = plexid.GetPlane();
01415 strip = plexid.GetStrip();
01416 int maxbin = h -> GetMaximumBin();
01417 Double_t maxv = h -> GetBinContent(maxbin);
01418 sprintf(function, "functionp%03ds%03d", plane, strip);
01419 TF1 *f = new TF1(function, "gaus", hmean - 2*hrms, hmean + 2*hrms);
01420 f -> SetParameters(maxv, hmean, hrms);
01421 int result = h -> Fit(function, "RQI");
01422 mean = f -> GetParameter(1);
01423 sigma = f -> GetParameter(2);
01424 meanerr = f -> GetParError(1);
01425 sigmaerr = f -> GetParError(2);
01426 chi2 = f -> GetChisquare();
01427 ndgf = f -> GetNDF();
01428 plexseid = plexid.GetEncoded();
01429 stree -> Fill();
01430
01431 fStripResidualFunctions[plexid] = f;
01432 FittedStripResidualvsPlane[plane].push_back(mean);
01433 FittedStripResidualSigmavsPlane[plane].push_back(sigma);
01434
01435 countstrips++;
01436 if(countstrips % 600 == 0){
01437 MsgFormat ffmt("%5.4f");
01438 MSG("Align", Msg::kInfo) <<"Fit "<<plexid<<" mean = "<< ffmt(mean)
01439 <<", sigma = "<< ffmt(sigma) <<", result = "<< result << endl;
01440 }
01441 }
01442
01443 //finding mean and sigma plane residual
01444 map<int, Double_t> residualm, sigmam, errorm;
01445 for(map<int, vector<double> >::iterator itr = FittedStripResidualvsPlane.begin();
01446 itr != FittedStripResidualvsPlane.end(); ++itr){
01447
01448 Double_t x = 0.0, xx = 0.0, size = 0.0;
01449 if(!GetSampleMeanSigmaSize(itr->second, x, xx, size))
01450 continue;
01451
01452 residualm[itr->first] = x;
01453 errorm[itr->first] = xx;
01454 }
01455
01456 for(map<int, Double_t >::const_iterator itr = residualm.begin();
01457 itr != residualm.end(); ++itr){
01458
01459 map<int, Double_t >::const_iterator fit = errorm.find(itr->first);
01460 if(fit == errorm.end())
01461 continue;
01462
01463 int bin = fhFittedStripResidualvsPlane -> FindBin(itr->first);
01464 fhFittedStripResidualvsPlane -> SetBinContent(bin, itr -> second);
01465 fhFittedStripResidualvsPlane -> SetBinError(bin, fit -> second);
01466 }
01467
01468 errorm.clear();
01469 for(map<int, vector<double> >::iterator itr = FittedStripResidualSigmavsPlane.begin();
01470 itr != FittedStripResidualSigmavsPlane.end(); ++itr){
01471
01472 Double_t x = 0.0, xx = 0.0, size = 0.0;
01473 if(!GetSampleMeanSigmaSize(itr->second, x, xx, size))
01474 continue;
01475
01476 sigmam[itr->first] = x;
01477 errorm[itr->first] = xx;
01478 }
01479
01480 for(map<int, Double_t >::const_iterator itr = sigmam.begin();
01481 itr != sigmam.end(); ++itr){
01482
01483 map<int, Double_t >::const_iterator fit = errorm.find(itr->first);
01484 if(fit == errorm.end())
01485 continue;
01486
01487 int bin = fhFittedStripResidualSigmavsPlane -> FindBin(itr->first);
01488 fhFittedStripResidualSigmavsPlane -> SetBinContent(bin, itr -> second);
01489 fhFittedStripResidualSigmavsPlane -> SetBinError(bin, fit -> second);
01490 }
01491
01492 MSG("Align", Msg::kInfo) << "AlignmentHistograms::FitStripResidualHistograms("<<int(min)<<")... Done" << endl;
01493 }
|
|
|
Definition at line 2617 of file AlignmentHistograms.cxx. References PlexScintMdlId::GetModule(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), and MSG. 02618 {
02619 //Calculate index using the following formula: 100*a+10*b+c
02620 //where: a = 0 for U view and 1 for V view
02621 // b = 0 for Full and 1 for Partial
02622 // c = module #
02623 //I use this index to look up the histograms from map container
02624
02625 int a = 0, b = 0, c = 0;
02626 if(plexid.GetPlaneView() == PlaneView::kV)
02627 a = 1;
02628 else {
02629 if(plexid.GetPlaneView() != PlaneView::kU){
02630 MSG("Align", Msg::kError) <<plexid<< " is not U or V plane!" <<endl;
02631 return 0;
02632 }
02633 }
02634
02635 if(plexid.GetPlaneCoverage() == PlaneCoverage::kNearPartial)
02636 b = 1;
02637 else {
02638 if(plexid.GetPlaneCoverage() != PlaneCoverage::kNearFull){
02639 MSG("Align", Msg::kError) <<plexid<< " is not full or partial plane!" <<endl;
02640 return 0;
02641 }
02642 }
02643
02644 c = plexid.GetModule();
02645
02646 return a*100+b*10+c;
02647 }
|
|
|
Definition at line 2584 of file AlignmentHistograms.cxx. References PlexScintMdlId::GetModule(), PlexPlaneId::GetPlaneCoverage(), PlexPlaneId::GetPlaneView(), PlexStripEndId::GetScintMdlId(), and MSG. Referenced by FillLongitudinalHitPos(), FillModuleResidual(), and FitRotationalResiduals(). 02585 {
02586 //Calculate index using the following formula: 100*a+10*b+c
02587 //where: a = 0 for U view and 1 for V view
02588 // b = 0 for Full and 1 for Partial
02589 // c = module #
02590 //I use this index to look up the histograms from map container
02591
02592 int a = 0, b = 0, c = 0;
02593 if(plexid.GetPlaneView() == PlaneView::kV)
02594 a = 1;
02595 else {
02596 if(plexid.GetPlaneView() != PlaneView::kU){
02597 MSG("Align", Msg::kError) <<plexid<< " is not U or V plane!" <<endl;
02598 return 0;
02599 }
02600 }
02601
02602 if(plexid.GetPlaneCoverage() == PlaneCoverage::kNearPartial)
02603 b = 1;
02604 else {
02605 if(plexid.GetPlaneCoverage() != PlaneCoverage::kNearFull){
02606 MSG("Align", Msg::kError) <<plexid<< " is not full or partial plane!" <<endl;
02607 return 0;
02608 }
02609 }
02610
02611 c = plexid.GetScintMdlId().GetModule();
02612
02613 return a*100+b*10+c;
02614 }
|
|
||||||||||||||||||||
|
Definition at line 2806 of file AlignmentHistograms.cxx. References fHistogramFile, fMdlRotationalResidualDirectory, fMdlRotationResidualBinWidth, and name. 02808 {
02809 fMdlRotationalResidualDirectory -> cd();
02810 char name[100], title[100];
02811 sprintf(name,"RotResidualInPlane%03dModule%03d", plane, module);
02812 sprintf(title,"Profile rotational residuals plane %03d module %03d", plane, module);
02813 int nbin = int(fabs(high-low)/fMdlRotationResidualBinWidth);
02814 TProfile *p = new TProfile(name, title, nbin, low, high);
02815 p -> GetXaxis() -> SetTitle("position (m)");
02816 p -> GetXaxis() -> CenterTitle();
02817 p -> GetYaxis() -> SetTitle("residual (m)");
02818 p -> GetYaxis() -> CenterTitle();
02819 fHistogramFile -> cd();
02820 return p;
02821 }
|
|
||||||||||||
|
Definition at line 2694 of file AlignmentHistograms.cxx. References fChargeLimit, fHistogramFile, fNChargeBins, fStripChargeDirectory, MSG, and name. Referenced by FillHistograms(). 02695 {
02696 fStripChargeDirectory -> cd();
02697 char name[100], title[100];
02698 sprintf(name,"PathCorrChargeInPlane%03dStrip%03d", plane, strip);
02699 sprintf(title,"Path corrected charge plane %03d, strip %03d", plane, strip);
02700 MSG("Align", Msg::kVerbose) << "Creating histogram " << name << endl;
02701 TH1D *h = new TH1D(name, title, fNChargeBins, 0, fChargeLimit);
02702 h -> GetXaxis() -> SetTitle("Raw ADC");
02703 h -> GetXaxis() -> CenterTitle();
02704 fHistogramFile -> cd();
02705 return h;
02706 }
|
|
||||||||||||||||
|
Definition at line 2824 of file AlignmentHistograms.cxx. References fHistogramFile, fMdlRotationResidualBinWidth, fPlaneRotationalResidualDirectory, and name. 02825 {
02826 fPlaneRotationalResidualDirectory -> cd();
02827 char name[100], title[100];
02828 sprintf(name,"RotResidualInPlane%03d", plane);
02829 sprintf(title,"Profile rotational residuals plane %03d", plane);
02830 int nbin = int(2.0*fabs(high-low)/fMdlRotationResidualBinWidth);
02831 TProfile *p = new TProfile(name, title, nbin, low, high);
02832 p -> GetXaxis() -> SetTitle("position (m)");
02833 p -> GetXaxis() -> CenterTitle();
02834 p -> GetYaxis() -> SetTitle("residual (m)");
02835 p -> GetYaxis() -> CenterTitle();
02836 fHistogramFile -> cd();
02837 return p;
02838 }
|
|
||||||||||||||||||||
|
Definition at line 2650 of file AlignmentHistograms.cxx. Referenced by AnalyzeModuleResiduals(), AnalyzeStripResidualHistograms(), AnalyzeStripSampleResiduals(), FitPlaneResidualProfile(), FitRotationalResiduals(), and FitStripResidualHistograms(). 02652 {
02653 if(v.size() < 2)
02654 return false;
02655
02656 double x = 0.0, xx = 0.0;
02657 size = double(v.size());
02658
02659 for(vector<double>::const_iterator it = v.begin(); it != v.end(); ++it){
02660 double temp = *it;
02661 x += temp;
02662 xx += temp*temp;
02663 }
02664 x = x/size;
02665 xx = xx/size - x*x;
02666
02667 if(xx < 1.0e-16){
02668 MSG("Align", Msg::kError) << "xx/size - x*x = " << xx <<endl;
02669 return false;
02670 }
02671
02672 mean = x;
02673 sigma = pow(xx, 0.5);
02674 return true;
02675 }
|
|
||||||||||||||||
|
Definition at line 2741 of file AlignmentHistograms.cxx. References fHistogramFile, fStripAttenDirectory, MSG, and name. Referenced by FillHistograms(). 02742 {
02743 fStripAttenDirectory -> cd();
02744 char name[100], title[100];
02745 double binwidth = 0.4; // in meters
02746 int nbin = int(length/binwidth);
02747 sprintf(name,"ProfileStripAtten%03d_%03d", plane, strip);
02748 sprintf(title,"Strip attenuation plane %03d and strip %03d", plane, strip);
02749 MSG("Align", Msg::kVerbose) << "Creating " << name << " histogram with "<< nbin << " bins"<<endl;
02750 TProfile *h = new TProfile(name, title, nbin, 0.0, length);
02751 h -> GetXaxis() -> SetTitle("wls fiber length (m)");
02752 h -> GetXaxis() -> CenterTitle();
02753 h -> GetYaxis() -> SetTitle("charge (ADC)");
02754 h -> GetYaxis() -> CenterTitle();
02755 fHistogramFile -> cd();
02756 return h;
02757 }
|
|
||||||||||||
|
Definition at line 2679 of file AlignmentHistograms.cxx. References fChargeLimit, fHistogramFile, fNChargeBins, fStripChargeDirectory, MSG, and name. Referenced by FillHistograms(). 02680 {
02681 fStripChargeDirectory -> cd();
02682 char name[100], title[100];
02683 sprintf(name,"ChargeInPlane%03dStrip%03d", plane, strip);
02684 sprintf(title,"Charge plane %03d, strip %03d", plane, strip);
02685 MSG("Align", Msg::kVerbose) << "Creating histogram " << name << endl;
02686 TH1D *h = new TH1D(name, title, fNChargeBins, 0, fChargeLimit);
02687 h -> GetXaxis() -> SetTitle("Raw ADC");
02688 h -> GetXaxis() -> CenterTitle();
02689 fHistogramFile -> cd();
02690 return h;
02691 }
|
|
||||||||||||||||
|
Definition at line 2725 of file AlignmentHistograms.cxx. References fHistogramFile, fStripOccupancyDirectory, and name. Referenced by FillHistograms(). 02726 {
02727 fStripOccupancyDirectory -> cd();
02728 double binwidth = 0.04; // in meters
02729 int nbin = int(length/binwidth);
02730 char name[100], title[100];
02731 sprintf(name,"OccupancyInPlane%03dStrip%03d", plane, strip);
02732 sprintf(title,"Longitudinal occupancy, plane %03d, strip %03d", plane, strip);
02733 TH1D *h = new TH1D(name, title, nbin, -length/2.0, length/2.0);
02734 h -> GetXaxis() -> SetTitle("residual (m)");
02735 h -> GetXaxis() -> CenterTitle();
02736 fHistogramFile -> cd();
02737 return h;
02738 }
|
|
||||||||||||||||||||
|
Definition at line 2760 of file AlignmentHistograms.cxx. References fHistogramFile, fStripAttenDirectory, MSG, and name. Referenced by FillHistograms(). 02762 {
02763
02764 fStripAttenDirectory -> cd();
02765 char name[100], title[100];
02766 double binwidth = length/8.0; // in meters
02767 const int nbin = int(floor(length/binwidth));
02768 sprintf(name,"ProfileStripPigAtten%03d_%03d", plane, strip);
02769 sprintf(title,"Strip attenuation plane %03d and strip %03d", plane, strip);
02770 MSG("Align", Msg::kVerbose) << "Creating " << name << " histogram with "<< nbin << " bins"<<endl;
02771 Double_t bins[10];
02772 bins[0] = 0.0;
02773 bins[1] = pigtail;
02774 for(int i = 1; i <= 8; ++i)
02775 {
02776 double bin = i;
02777 bins[i+1] = bin*binwidth + pigtail;
02778 }
02779 TProfile *h = new TProfile(name, title, 9, bins);
02780 h -> GetXaxis() -> SetTitle("wls fiber length (m)");
02781 h -> GetXaxis() -> CenterTitle();
02782 h -> GetYaxis() -> SetTitle("charge (ADC)");
02783 h -> GetYaxis() -> CenterTitle();
02784 fHistogramFile -> cd();
02785 return h;
02786 }
|
|
||||||||||||
|
Definition at line 2709 of file AlignmentHistograms.cxx. References fHistogramFile, fNResidualBinsStrip, fResidualLimitStrip, fStripResidualDirectory, and name. Referenced by FillHistograms(). 02710 {
02711 fStripResidualDirectory -> cd();
02712 char name[100], title[100];
02713 sprintf(name,"ResidualInPlane%03dStrip%03d", plane, strip);
02714 sprintf(title,"Residual in hit strip, plane %03d, strip %03d", plane, strip);
02715 TH1D *h = new TH1D(name, title, 2*fNResidualBinsStrip,
02716 -fResidualLimitStrip, fResidualLimitStrip);
02717 h -> GetXaxis() -> SetTitle("residual (m)");
02718 h -> GetXaxis() -> CenterTitle();
02719 fHistogramFile -> cd();
02720 return h;
02721 }
|
|
||||||||||||||||
|
Definition at line 2789 of file AlignmentHistograms.cxx. References fHistogramFile, fStripRotationalResidualDirectory, fStripRotationResidualBinWidth, and name. Referenced by FillHistograms(). 02790 {
02791 fStripRotationalResidualDirectory -> cd();
02792 char name[100], title[100];
02793 sprintf(name,"RotResidualInPlane%03dStrip%03d", plane, strip);
02794 sprintf(title,"Profile rotational residuals plane %03d strip %03d", plane, strip);
02795 unsigned int nbin = int(floor(length/fStripRotationResidualBinWidth));
02796 TProfile *p = new TProfile(name, title, nbin, -length/2.0, length/2.0);
02797 p -> GetXaxis() -> SetTitle("position (m)");
02798 p -> GetXaxis() -> CenterTitle();
02799 p -> GetYaxis() -> SetTitle("residual (m)");
02800 p -> GetYaxis() -> CenterTitle();
02801 fHistogramFile -> cd();
02802 return p;
02803 }
|
|
|
|
Definition at line 336 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 342 of file AlignmentHistograms.h. Referenced by FillDirectionalCosines(). |
|
|
Definition at line 344 of file AlignmentHistograms.h. Referenced by FillDirectionalCosines(). |
|
|
Definition at line 343 of file AlignmentHistograms.h. Referenced by FillDirectionalCosines(). |
|
|
Definition at line 338 of file AlignmentHistograms.h. Referenced by CalculateStripCharge(). |
|
|
Definition at line 339 of file AlignmentHistograms.h. Referenced by CalculateStripCharge(). |
|
|
Definition at line 335 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 334 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 337 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 340 of file AlignmentHistograms.h. Referenced by FillRoundingErrors(). |
|
|
Definition at line 341 of file AlignmentHistograms.h. Referenced by FillRoundingErrors(). |
|
|
Definition at line 302 of file AlignmentHistograms.h. Referenced by FillTrackInfo(), and ProcessHistograms(). |
|
|
Definition at line 274 of file AlignmentHistograms.h. Referenced by FillCandStrip(), GetPathCorrStripChargeHistogram(), and GetStripChargeHistogram(). |
|
|
Definition at line 303 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 287 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 296 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 206 of file AlignmentHistograms.h. Referenced by FillAlternativeTrackHits(), and FillNAlternativeTrackHits(). |
|
|
Definition at line 202 of file AlignmentHistograms.h. Referenced by FillPlanePlex(). |
|
|
Definition at line 203 of file AlignmentHistograms.h. Referenced by FillPlanePlex(). |
|
|
Definition at line 257 of file AlignmentHistograms.h. Referenced by CalculateStripCharge(), and FillCandStrip(). |
|
|
Definition at line 292 of file AlignmentHistograms.h. Referenced by FillMaxChargeTrackInfo(). |
|
|
Definition at line 293 of file AlignmentHistograms.h. Referenced by FillMaxChargeTrackInfo(). |
|
|
Definition at line 288 of file AlignmentHistograms.h. Referenced by FillTrackInfo(), and ProcessHistograms(). |
|
|
Definition at line 289 of file AlignmentHistograms.h. Referenced by FillTrackInfo(), and ProcessHistograms(). |
|
|
Definition at line 329 of file AlignmentHistograms.h. Referenced by FillDirectionalCosines(). |
|
|
Definition at line 330 of file AlignmentHistograms.h. Referenced by FillDirectionalCosines(). |
|
|
Definition at line 331 of file AlignmentHistograms.h. Referenced by FillDirectionalCosines(). |
|
|
Definition at line 305 of file AlignmentHistograms.h. Referenced by FitStripResidualHistograms(). |
|
|
Definition at line 304 of file AlignmentHistograms.h. Referenced by FitStripResidualHistograms(). |
|
|
Definition at line 313 of file AlignmentHistograms.h. Referenced by AnalyzeStripResidualHistograms(). |
|
|
Definition at line 209 of file AlignmentHistograms.h. Referenced by AnalyzeModuleResiduals(), FillModuleResidual(), and FitRotationalResiduals(). |
|
|
|
Definition at line 159 of file AlignmentHistograms.h. Referenced by FillLongitudinalHitPos(). |
|
|
Definition at line 323 of file AlignmentHistograms.h. Referenced by FitResidualvsMuonPathLength(). |
|
|
Definition at line 322 of file AlignmentHistograms.h. Referenced by FitResidualvsMuonPathLength(). |
|
|
Definition at line 321 of file AlignmentHistograms.h. Referenced by FitResidualvsMuonPathLength(). |
|
|
Definition at line 320 of file AlignmentHistograms.h. Referenced by FitResidualvsMuonPathLength(). |
|
|
Definition at line 325 of file AlignmentHistograms.h. Referenced by FillNAlternativeTrackHits(). |
|
|
Definition at line 294 of file AlignmentHistograms.h. Referenced by FillMaxChargeTrackInfo(). |
|
|
Definition at line 295 of file AlignmentHistograms.h. Referenced by FillMaxChargeTrackInfo(). |
|
|
Definition at line 290 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 291 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 221 of file AlignmentHistograms.h. Referenced by AnalyzeStripResidualHistograms(). |
|
|
Definition at line 225 of file AlignmentHistograms.h. Referenced by AnalyzeStripSampleResiduals(). |
|
|
Definition at line 324 of file AlignmentHistograms.h. |
|
|
Definition at line 319 of file AlignmentHistograms.h. Referenced by FitResidualvsMuonPathLength(). |
|
|
Definition at line 318 of file AlignmentHistograms.h. Referenced by FitResidualvsMuonPathLength(). |
|
|
Definition at line 317 of file AlignmentHistograms.h. Referenced by FitResidualvsMuonPathLength(). |
|
|
Definition at line 316 of file AlignmentHistograms.h. Referenced by FitResidualvsMuonPathLength(). |
|
|
Definition at line 241 of file AlignmentHistograms.h. Referenced by FillResidualvsMuonPathLength(), and FitResidualvsMuonPathLength(). |
|
|
Definition at line 327 of file AlignmentHistograms.h. Referenced by FillRoundingErrors(). |
|
|
Definition at line 328 of file AlignmentHistograms.h. Referenced by FillRoundingErrors(). |
|
|
Definition at line 314 of file AlignmentHistograms.h. Referenced by AnalyzeStripSampleResiduals(). |
|
|
Definition at line 310 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 312 of file AlignmentHistograms.h. Referenced by FillMaxChargeTrackInfo(). |
|
|
Definition at line 309 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 311 of file AlignmentHistograms.h. Referenced by FillMaxChargeTrackInfo(). |
|
|
Definition at line 218 of file AlignmentHistograms.h. Referenced by FillLongitudinalHitPos(). |
|
|
Definition at line 215 of file AlignmentHistograms.h. Referenced by FillModuleResidual(). |
|
|
Definition at line 315 of file AlignmentHistograms.h. Referenced by FillLongitudinalHitPos(). |
|
|
Definition at line 326 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 306 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 307 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 308 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 332 of file AlignmentHistograms.h. Referenced by FillDirectionalCosines(). |
|
|
Definition at line 231 of file AlignmentHistograms.h. Referenced by FillHistograms(), and FillModuleResidual(). |
|
|
Definition at line 232 of file AlignmentHistograms.h. Referenced by FillHistograms(), and FillModuleResidual(). |
|
|
Definition at line 233 of file AlignmentHistograms.h. Referenced by AnalyzeModuleResiduals(), and FillModuleResidual(). |
|
|
Definition at line 155 of file AlignmentHistograms.h. Referenced by GetMdlRotationalResidualHistogram(). |
|
|
Definition at line 250 of file AlignmentHistograms.h. Referenced by FitRotationalResiduals(). |
|
|
Definition at line 281 of file AlignmentHistograms.h. Referenced by GetMdlRotationalResidualHistogram(), and GetPlaneRotationalResidualHistogram(). |
|
|
Definition at line 283 of file AlignmentHistograms.h. |
|
|
Definition at line 263 of file AlignmentHistograms.h. Referenced by FillModuleResidual(). |
|
|
Definition at line 264 of file AlignmentHistograms.h. |
|
|
Definition at line 153 of file AlignmentHistograms.h. |
|
|
Definition at line 147 of file AlignmentHistograms.h. Referenced by FillModuleResidual(). |
|
|
Definition at line 160 of file AlignmentHistograms.h. Referenced by FillResidualvsMuonPathLength(), and FitResidualvsMuonPathLength(). |
|
|
Definition at line 284 of file AlignmentHistograms.h. Referenced by FillResidualvsMuonPathLength(), and FitResidualvsMuonPathLength(). |
|
|
Definition at line 273 of file AlignmentHistograms.h. Referenced by FillCandStrip(), GetPathCorrStripChargeHistogram(), and GetStripChargeHistogram(). |
|
|
Definition at line 280 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 277 of file AlignmentHistograms.h. |
|
|
Definition at line 265 of file AlignmentHistograms.h. Referenced by AnalyzeStripResidualHistograms(), AnalyzeStripSampleResiduals(), CalculateStripCharge(), FillNAlternativeTrackHits(), FillRoundingErrors(), and FitStripResidualHistograms(). |
|
|
Definition at line 267 of file AlignmentHistograms.h. |
|
|
Definition at line 271 of file AlignmentHistograms.h. Referenced by FillModuleResidual(), FillResidualvsMuonPathLength(), and GetStripResidualHistogram(). |
|
|
Definition at line 266 of file AlignmentHistograms.h. Referenced by CalculateStripCharge(), and FillRoundingErrors(). |
|
|
Definition at line 275 of file AlignmentHistograms.h. Referenced by FillMaxChargeTrackInfo(), and FillTrackInfo(). |
|
|
Definition at line 359 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 358 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 355 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 356 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 357 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 150 of file AlignmentHistograms.h. Referenced by FillAlternativeTrackHits(), and FillPlanePlex(). |
|
|
Definition at line 148 of file AlignmentHistograms.h. Referenced by AnalyzeStripResidualHistograms(), AnalyzeStripSampleResiduals(), and FillModuleResidual(). |
|
|
Definition at line 156 of file AlignmentHistograms.h. Referenced by GetPlaneRotationalResidualHistogram(). |
|
|
Definition at line 254 of file AlignmentHistograms.h. Referenced by FitRotationalResiduals(). |
|
|
Definition at line 249 of file AlignmentHistograms.h. Referenced by FillHistograms(), and FitRotationalResiduals(). |
|
|
Definition at line 378 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 222 of file AlignmentHistograms.h. Referenced by FillModuleResidual(), and FitPlaneResidualProfile(). |
|
|
Definition at line 253 of file AlignmentHistograms.h. Referenced by FillHistograms(), and FitRotationalResiduals(). |
|
|
Definition at line 364 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 363 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 375 of file AlignmentHistograms.h. Referenced by FillResidualvsMuonPathLength(). |
|
|
Definition at line 377 of file AlignmentHistograms.h. Referenced by FillResidualvsMuonPathLength(). |
|
|
Definition at line 376 of file AlignmentHistograms.h. Referenced by FillResidualvsMuonPathLength(). |
|
|
Definition at line 362 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 368 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 367 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 366 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 365 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 374 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 373 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 370 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 369 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 372 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 371 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 348 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 347 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 354 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 353 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 350 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 349 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 352 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 351 of file AlignmentHistograms.h. Referenced by FillTrackInfo(). |
|
|
Definition at line 297 of file AlignmentHistograms.h. Referenced by FillHitStrip(). |
|
|
Definition at line 268 of file AlignmentHistograms.h. |
|