Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46011
b: "refs/heads/CMSSW_7_1_X"
c: cf99931
h: "refs/heads/CMSSW_7_1_X"
i:
  46009: 5c19886
  46007: 31dff55
v: v3
  • Loading branch information
Nhan Viet Tran committed Jun 17, 2008
1 parent 2a0dcd8 commit 98265ea
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 70 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: ac155dadd83efa75cad55c0508a57a2b9dd3d66c
"refs/heads/CMSSW_7_1_X": bdceb8d4e5a59282f43e52beeff95d732e2ad698
"refs/heads/CMSSW_7_1_X": cf999317cbe8ba495ef86169d1d572cfda150772
Original file line number Diff line number Diff line change
Expand Up @@ -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;



Expand Down
134 changes: 77 additions & 57 deletions trunk/Alignment/OfflineValidation/scripts/comparisonPlots.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions trunk/Alignment/OfflineValidation/scripts/comparisonPlots.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions trunk/Alignment/OfflineValidation/scripts/comparisonScript.C
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 98265ea

Please sign in to comment.