From 98265ea8f1f8e67b3bcb705a88d7b2b3a875f563 Mon Sep 17 00:00:00 2001 From: Nhan Viet Tran Date: Tue, 17 Jun 2008 15:23:02 +0000 Subject: [PATCH] --- yaml --- r: 46011 b: "refs/heads/CMSSW_7_1_X" c: cf999317cbe8ba495ef86169d1d572cfda150772 h: "refs/heads/CMSSW_7_1_X" i: 46009: 5c19886110b60a955ea76f0b005b5b252b18f02e 46007: 31dff559dd5b64511351ced26fb9a3c8da403295 v: v3 --- [refs] | 2 +- .../plugins/TrackerGeometryCompare.cc | 8 +- .../scripts/comparisonPlots.cc | 134 ++++++++++-------- .../scripts/comparisonPlots.h | 4 +- .../scripts/comparisonScript.C | 10 +- .../scripts/comparisonScriptCSA08.C | 2 +- 6 files changed, 90 insertions(+), 70 deletions(-) diff --git a/[refs] b/[refs] index 93c13cb3588f2..6f425f5cb85d0 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: ac155dadd83efa75cad55c0508a57a2b9dd3d66c -"refs/heads/CMSSW_7_1_X": bdceb8d4e5a59282f43e52beeff95d732e2ad698 +"refs/heads/CMSSW_7_1_X": cf999317cbe8ba495ef86169d1d572cfda150772 diff --git a/trunk/Alignment/OfflineValidation/plugins/TrackerGeometryCompare.cc b/trunk/Alignment/OfflineValidation/plugins/TrackerGeometryCompare.cc index 2f2411b9cf4c3..483de2e280fd8 100644 --- a/trunk/Alignment/OfflineValidation/plugins/TrackerGeometryCompare.cc +++ b/trunk/Alignment/OfflineValidation/plugins/TrackerGeometryCompare.cc @@ -503,11 +503,11 @@ void TrackerGeometryCompare::fillTree(Alignable *refAli, AlgebraicVector diff){ } } // det module dimension - if (refAli->alignableObjectId() == align::AlignableDetUnit){ - if (refAli->mother()->alignableObjectId() != align::AlignableDet) _detDim = 1; - else if (refAli->mother()->alignableObjectId() == align::AlignableDet) _detDim = 2; + if (refAli->alignableObjectId() == align::AlignableDet){ + if (refAli->components().size() == 1) _detDim = 1; + else if (refAli->components().size() == 2) _detDim = 2; + else _detDim = 0; } - else _detDim = 0; diff --git a/trunk/Alignment/OfflineValidation/scripts/comparisonPlots.cc b/trunk/Alignment/OfflineValidation/scripts/comparisonPlots.cc index 868cfa6c0bfa5..6b21fdf178b51 100644 --- a/trunk/Alignment/OfflineValidation/scripts/comparisonPlots.cc +++ b/trunk/Alignment/OfflineValidation/scripts/comparisonPlots.cc @@ -53,49 +53,59 @@ void comparisonPlots::readTree(){ data->SetBranchAddress("detDim",&detDim_); } -void comparisonPlots::plot3x5(TCut Cut, char* dirName, bool savePlot, std::string plotName){ +void comparisonPlots::plot3x5(TCut Cut, char* dirName, bool savePlot, std::string plotName, bool autolimits){ // --------- create directory for histograms --------- //const char* dirName = Cut; TDirectory* plotDir = output->mkdir( dirName ); // --------- get right limits for histogram --------- - /* - TH1F* hr = new TH1F("hr", "hr", 200, 0, 200); - TH1F* hz = new TH1F("hz", "hz", 400, -200, 200); - TH1F* hphi = new TH1F("hphi", "hphi", 200, -3.15, 3.15); - TH1F* hdr = new TH1F("hdr", "hdr", 2000, -10, 10); - TH1F* hdz = new TH1F("hdz", "hdz", 2000, -10, 10); - TH1F* hrdphi = new TH1F("hrdphi", "hrdphi", 2000, -10, 10); - TH1F* hdx = new TH1F("hdx", "hy", 2000, -10, 10); - TH1F* hdy = new TH1F("hdy", "hy", 2000, -10, 10); - data->Project("hr","r",Cut); - data->Project("hz","z",Cut); - data->Project("hphi","phi",Cut); - data->Project("hdr","dr",Cut); - data->Project("hdz","dz",Cut); - data->Project("hrdphi","r*dphi",Cut); - data->Project("hdx","dx",Cut); - data->Project("hdy","dy",Cut); - double minimumR, maximumR; getHistMaxMin(hr, maximumR, minimumR, 0); - double minimumZ, maximumZ; getHistMaxMin(hz, maximumZ, minimumZ, 0); - double minimumPhi, maximumPhi; getHistMaxMin(hphi, maximumPhi, minimumPhi, 0); - double minimumDR, maximumDR; getHistMaxMin(hdr, maximumDR, minimumDR, 1); - double minimumDZ, maximumDZ; getHistMaxMin(hdz, maximumDZ, minimumDZ, 1); - double minimumRDPhi, maximumRDPhi; getHistMaxMin(hrdphi, maximumRDPhi, minimumRDPhi, 1); - double minimumDX, maximumDX; getHistMaxMin(hdx, maximumDX, minimumDX, 1); - double minimumDY, maximumDY; getHistMaxMin(hdy, maximumDY, minimumDY, 1); - */ - double minimumR = 0., maximumR = 200.; - double minimumZ = -200., maximumZ = 200.; - double minimumPhi = -3.15, maximumPhi = 3.15; - double minimumDR = -1, maximumDR = 1; - double minimumDZ = -1, maximumDZ = 1; - double minimumRDPhi = -1, maximumRDPhi = 1; - double minimumDX = -1, maximumDX = 1; - double minimumDY = -1, maximumDY = 1; - - + double minimumR, maximumR; + double minimumZ, maximumZ; + double minimumPhi, maximumPhi; + double minimumDR, maximumDR; + double minimumDZ, maximumDZ; + double minimumRDPhi, maximumRDPhi; + double minimumDX, maximumDX; + double minimumDY, maximumDY; + if (autolimits){ + // --------- get right limits for histogram --------- + TH1F* phr = new TH1F("phr", "phr", 200, 0, 200); + TH1F* phz = new TH1F("phz", "phz", 400, -200, 200); + TH1F* phphi = new TH1F("phphi", "phphi", 200, -3.15, 3.15); + TH1F* phdr = new TH1F("phdr", "phdr", 2000, -10, 10); + TH1F* phdz = new TH1F("phdz", "phdz", 2000, -10, 10); + TH1F* phrdphi = new TH1F("phrdphi", "phrdphi", 200, -10, 10); + TH1F* phdx = new TH1F("phdx", "phy", 2000, -10, 10); + TH1F* phdy = new TH1F("phdy", "phy", 2000, -10, 10); + data->Project("phr","r",Cut); + data->Project("phz","z",Cut); + data->Project("phphi","phi",Cut); + data->Project("phdr","dr",Cut); + data->Project("phdz","dz",Cut); + data->Project("phrdphi","r*dphi",Cut); + data->Project("phdx","dx",Cut); + data->Project("phdy","dy",Cut); + getHistMaxMin(phr, maximumR, minimumR, 0); + getHistMaxMin(phz, maximumZ, minimumZ, 0); + getHistMaxMin(phphi, maximumPhi, minimumPhi, 0); + getHistMaxMin(phdr, maximumDR, minimumDR, 1); + getHistMaxMin(phdz, maximumDZ, minimumDZ, 1); + getHistMaxMin(phrdphi, maximumRDPhi, minimumRDPhi, 1); + getHistMaxMin(phdx, maximumDX, minimumDX, 1); + getHistMaxMin(phdy, maximumDY, minimumDY, 1); + } + else{ + minimumR = 0., maximumR = 200.; + minimumZ = -200., maximumZ = 200.; + minimumPhi = -3.15, maximumPhi = 3.15; + minimumDR = -1, maximumDR = 1; + minimumDZ = -1, maximumDZ = 1; + minimumRDPhi = -1, maximumRDPhi = 1; + minimumDX = -1, maximumDX = 1; + minimumDY = -1, maximumDY = 1; + } + // --------- declare histograms --------- TH1F* h_dr = new TH1F("h_dr", "#Delta r", 2000, minimumDR, maximumDR); @@ -199,7 +209,7 @@ void comparisonPlots::plot3x5(TCut Cut, char* dirName, bool savePlot, std::strin } -void comparisonPlots::plot3x5Profile(TCut Cut, char* dirName, int nBins, bool savePlot, std::string plotName){ +void comparisonPlots::plot3x5Profile(TCut Cut, char* dirName, int nBins, bool savePlot, std::string plotName, bool autolimits){ // --------- create directory for histograms --------- //const char* dirName = Cut; @@ -208,7 +218,16 @@ void comparisonPlots::plot3x5Profile(TCut Cut, char* dirName, int nBins, bool sa s.append("_profile"); TDirectory* plotDir = output->mkdir( s.data() ); - /* + + double minimumR, maximumR; + double minimumZ, maximumZ; + double minimumPhi, maximumPhi; + double minimumDR, maximumDR; + double minimumDZ, maximumDZ; + double minimumRDPhi, maximumRDPhi; + double minimumDX, maximumDX; + double minimumDY, maximumDY; + if (autolimits){ // --------- get right limits for histogram --------- TH1F* phr = new TH1F("phr", "phr", 200, 0, 200); TH1F* phz = new TH1F("phz", "phz", 400, -200, 200); @@ -226,24 +245,25 @@ void comparisonPlots::plot3x5Profile(TCut Cut, char* dirName, int nBins, bool sa data->Project("phrdphi","r*dphi",Cut); data->Project("phdx","dx",Cut); data->Project("phdy","dy",Cut); - double minimumR, maximumR; getHistMaxMin(phr, maximumR, minimumR, 0); - double minimumZ, maximumZ; getHistMaxMin(phz, maximumZ, minimumZ, 0); - double minimumPhi, maximumPhi; getHistMaxMin(phphi, maximumPhi, minimumPhi, 0); - double minimumDR, maximumDR; getHistMaxMin(phdr, maximumDR, minimumDR, 1); - double minimumDZ, maximumDZ; getHistMaxMin(phdz, maximumDZ, minimumDZ, 1); - double minimumRDPhi, maximumRDPhi; getHistMaxMin(phrdphi, maximumRDPhi, minimumRDPhi, 1); - double minimumDX, maximumDX; getHistMaxMin(phdx, maximumDX, minimumDX, 1); - double minimumDY, maximumDY; getHistMaxMin(phdy, maximumDY, minimumDY, 1); - */ - double minimumR = 0., maximumR = 200.; - double minimumZ = -200., maximumZ = 200.; - double minimumPhi = -3.15, maximumPhi = 3.15; - double minimumDR = -1, maximumDR = 1; - double minimumDZ = -1, maximumDZ = 1; - double minimumRDPhi = -1, maximumRDPhi = 1; - double minimumDX = -1, maximumDX = 1; - double minimumDY = -1, maximumDY = 1; - + getHistMaxMin(phr, maximumR, minimumR, 0); + getHistMaxMin(phz, maximumZ, minimumZ, 0); + getHistMaxMin(phphi, maximumPhi, minimumPhi, 0); + getHistMaxMin(phdr, maximumDR, minimumDR, 1); + getHistMaxMin(phdz, maximumDZ, minimumDZ, 1); + getHistMaxMin(phrdphi, maximumRDPhi, minimumRDPhi, 1); + getHistMaxMin(phdx, maximumDX, minimumDX, 1); + getHistMaxMin(phdy, maximumDY, minimumDY, 1); + } + else{ + minimumR = 0., maximumR = 200.; + minimumZ = -200., maximumZ = 200.; + minimumPhi = -3.15, maximumPhi = 3.15; + minimumDR = -1, maximumDR = 1; + minimumDZ = -1, maximumDZ = 1; + minimumRDPhi = -1, maximumRDPhi = 1; + minimumDX = -1, maximumDX = 1; + minimumDY = -1, maximumDY = 1; + } // --------- declare histograms --------- TProfile* hprof_drVr = new TProfile("hprof_drVr","#Delta r vs. r",nBins,minimumR,maximumR,minimumDR,maximumDR); diff --git a/trunk/Alignment/OfflineValidation/scripts/comparisonPlots.h b/trunk/Alignment/OfflineValidation/scripts/comparisonPlots.h index c854b408b581e..61ac71b491e94 100644 --- a/trunk/Alignment/OfflineValidation/scripts/comparisonPlots.h +++ b/trunk/Alignment/OfflineValidation/scripts/comparisonPlots.h @@ -28,8 +28,8 @@ class comparisonPlots comparisonPlots(std::string filename, std::string outputDir, std::string outputFilename = "OUTPUT_comparison.root"); void readTree(); - void plot3x5(TCut Cut, char* dirName, bool savePlot = false, std::string plotName = "plot3x5.eps"); - void plot3x5Profile(TCut Cut, char* dirName, int nBins, bool savePlot = false, std::string plotName = "plot3x5Profile.eps"); + void plot3x5(TCut Cut, char* dirName, bool savePlot = false, std::string plotName = "plot3x5.eps", bool autolimits = false); + void plot3x5Profile(TCut Cut, char* dirName, int nBins, bool savePlot = false, std::string plotName = "plot3x5Profile.eps", bool autolimits = false); float arrowSize; void Write(); diff --git a/trunk/Alignment/OfflineValidation/scripts/comparisonScript.C b/trunk/Alignment/OfflineValidation/scripts/comparisonScript.C index 49df9e875c51a..e3d88b3174791 100644 --- a/trunk/Alignment/OfflineValidation/scripts/comparisonScript.C +++ b/trunk/Alignment/OfflineValidation/scripts/comparisonScript.C @@ -10,9 +10,9 @@ #include "TStyle.h" #include "TCut.h" -void comparisonScript(string inFile="../test/comparisonSurvey.root",string outDir="outputDir/") +void comparisonScript(string inFile="../test/testComparison.root",string outDir="outputDir/") { - gStyle->SetOptStat("emr"); + gStyle->SetOptStat("emr"); gROOT->ProcessLine(".L comparisonPlots.cc+"); // create plots object for given input @@ -22,7 +22,7 @@ void comparisonScript(string inFile="../test/comparisonSurvey.root",string outDi // ------------ COMMON CUTS ----------- // LEVEL CUT - which hierarchy to plot // for convention, see: http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/Alignment/CommonAlignment/interface/StructureType.h?view=log - TCut levelCut = "(level == 1)"; // plotting DetUnits + TCut levelCut = "(level == 2)"; // plotting Dets // SUBLEVEL CUT - plot only alignables belongnig to this subdetector TCut PXBCut = "(sublevel == 1)"; // PXB TCut PXFCut = "(sublevel == 2)"; // PXF @@ -53,8 +53,8 @@ void comparisonScript(string inFile="../test/comparisonSurvey.root",string outDi //again this time only for 2D modules c1.plot3x5( levelCut+Det2dCut, "Tracker2D",true,"Tracker2D.eps" ); - c1.plot3x5( levelCut+PXBCut+Det2dCut, "PXB2D", true, "PXB2D.eps" ); - c1.plot3x5( levelCut+PXFCut+Det2dCut, "PXF2D", true, "PXF2D.eps" ); + //c1.plot3x5( levelCut+PXBCut+Det2dCut, "PXB2D", true, "PXB2D.eps" ); + //c1.plot3x5( levelCut+PXFCut+Det2dCut, "PXF2D", true, "PXF2D.eps" ); c1.plot3x5( levelCut+TIBCut+Det2dCut, "TIB2D", true, "TIB2D.eps" ); c1.plot3x5( levelCut+TIDCut+Det2dCut, "TID2D", true, "TID2D.eps" ); c1.plot3x5( levelCut+TOBCut+Det2dCut, "TOB2D", true, "TOB2D.eps" ); diff --git a/trunk/Alignment/OfflineValidation/scripts/comparisonScriptCSA08.C b/trunk/Alignment/OfflineValidation/scripts/comparisonScriptCSA08.C index 9ff337cbef0e8..f6a0dff137da2 100644 --- a/trunk/Alignment/OfflineValidation/scripts/comparisonScriptCSA08.C +++ b/trunk/Alignment/OfflineValidation/scripts/comparisonScriptCSA08.C @@ -24,7 +24,7 @@ void comparisonScriptCSA08(){ // ------------ COMMON CUTS ----------- // LEVEL CUT - which hierarchy to plot // for convention, see: http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/Alignment/CommonAlignment/interface/StructureType.h?view=log - TCut levelCut = "(level == 1)"; // plotting DetUnits + TCut levelCut = "(level == 2)"; // plotting DetUnits // SUBLEVEL CUT - plot only alignables belongnig to this subdetector TCut PXBCut = "(sublevel == 1)"; // PXB TCut PXFCut = "(sublevel == 2)"; // PXF