Index: trunk/paper/sourceCode/CaloSegmentation.C
===================================================================
--- trunk/paper/sourceCode/CaloSegmentation.C	(revision 131)
+++ trunk/paper/sourceCode/CaloSegmentation.C	(revision 131)
@@ -0,0 +1,139 @@
+#include "TROOT.h"
+#include "TFile.h"
+#include "TTree.h"
+#include "TCanvas.h"
+#include "TProfile.h"
+#include "TF1.h"
+#include "TGraph.h"
+#include "TLegend.h"
+#include "TH2D.h"
+#include "TLine.h"
+#include "TBox.h"
+
+//#include "interface/FuncDef.h"
+
+void CALO()
+{
+//  setTDRStyle();
+  gROOT->Reset();
+  
+  TCanvas *c1 = new TCanvas("c1","Calo Segmentation",0,0,1000,650);
+  c1->SetGrayscale();
+  c1->cd();
+  
+  TH2D *Calo = new TH2D("","Calorimeter segmentation",100,-5,5,100,0,3.14);
+  //	TLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
+  
+  Calo->Draw();
+  
+  //Eta segmentation
+  double eta[41]={ 0., 0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, 0.783, 
+		   0.870, 0.957, 1.044, 1.131, 1.218, 1.305, 1.392, 1.479, 1.566, 1.653, 
+		   1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.868, 2.950, 
+		   3.125, 3.300, 3.475, 3.650, 3.825, 4.000, 4.175, 4.350, 4.525, 4.700, 5.000};
+  double phi[40]={ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+                   5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
+                   10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+                   10, 10, 10, 10, 10, 10, 10, 10, 20, 20};
+  
+  int color1=1,color2=2,color3=3,color4=4;
+  double xP1,xM1;
+  double yPhi;
+  for(int i=0;i<41;i++)
+    {
+      xP1=eta[i];
+      xM1=-eta[i];
+      
+      yPhi=0;
+      
+      
+      if(i!=40){
+	
+	double xPAv=eta[i+1];
+	float etasep=(xPAv-xP1);
+	
+	TBox *box = new TBox(xP1, 0,xPAv, 3.13);
+        TBox *boxN = new TBox(-xP1, 0,-xPAv, 3.13);
+	if(((int)phi[i]==5)){
+	  if(fabs(etasep - 0.087)<0.001){  box->SetFillColor(10);}
+	  if(fabs(etasep - 0.09)<0.001){  box->SetFillColor(kBlue-9);}
+	  if(fabs(etasep == 0.1) ){  box->SetFillColor(kBlue-8);}
+	  if(fabs(etasep == 0.113)){  box->SetFillColor(kBlue-7);}
+	  if(fabs(etasep == 0.129)){  box->SetFillColor(kBlue-6);}
+	  if(fabs(etasep == 0.15 )){  box->SetFillColor(kBlue-5);}
+	  if(fabs(etasep == 0.178)){  box->SetFillColor(kBlue-4);}
+	  if(fabs(etasep == 0.218)){  box->SetFillColor(kBlue-3);}
+	  if(fabs(etasep == 0.218)){  box->SetFillColor(kBlue-2);}
+	  if(fabs(etasep == 0.082)){  box->SetFillColor(kBlue-1);}
+	  if(fabs(etasep == 0.175)){  box->SetFillColor(kBlue+1);}
+	  if(fabs(etasep == 0.3  )){  box->SetFillColor(kBlue+2);}
+	}
+	
+	if(((int)phi[i]==10)){
+	  if(fabs(etasep - 0.087)<0.001){  box->SetFillColor(kRed-10);}
+	  if(fabs(etasep - 0.09 )<0.001){  box->SetFillColor(kRed-9);}
+	  if(fabs(etasep - 0.1  )<0.001){  box->SetFillColor(kRed-8);}
+	  if(fabs(etasep - 0.113)<0.001){  box->SetFillColor(kRed-7);}
+	  if(fabs(etasep - 0.129)<0.001){  box->SetFillColor(kRed-6);}
+	  if(fabs(etasep - 0.15 )<0.001){  box->SetFillColor(kRed-4);}
+	  if(fabs(etasep - 0.178)<0.001){  box->SetFillColor(kRed-5);}
+	  if(fabs(etasep - 0.218)<0.001){  box->SetFillColor(kRed-3);}
+          if(fabs(etasep - 0.218)<0.001){  box->SetFillColor(kRed-2);}
+	  if(fabs(etasep - 0.082)<0.001){  box->SetFillColor(kRed-1);}
+	  if(fabs(etasep - 0.175)<0.001){  box->SetFillColor(kRed);}
+	  if(fabs(etasep - 0.3  )<0.001){  box->SetFillColor(kRed+1);}
+	}
+	
+	if(((int)phi[i]==20)){
+	  if(fabs(etasep - 0.087)<0.001){  box->SetFillColor(kGreen-10);}
+	  if(fabs(etasep - 0.09 )<0.001){  box->SetFillColor(kGreen-9);}
+	  if(fabs(etasep - 0.1  )<0.001){  box->SetFillColor(kGreen-7);}
+	  if(fabs(etasep - 0.113)<0.001){  box->SetFillColor(kGreen-5);}
+	  if(fabs(etasep - 0.129)<0.001){  box->SetFillColor(kGreen-4);}
+	  if(fabs(etasep - 0.15 )<0.001){  box->SetFillColor(kGreen-3);}
+	  if(fabs(etasep - 0.178)<0.001){  box->SetFillColor(kGreen-2);}
+	  if(fabs(etasep - 0.218)<0.001){  box->SetFillColor(kGreen-1);}
+	  if(fabs(etasep - 0.218)<0.001){  box->SetFillColor(kGreen);}
+	  if(fabs(etasep - 0.082)<0.001){  box->SetFillColor(kGreen+1);}
+	  if(fabs(etasep - 0.175)<0.001){  box->SetFillColor(kGreen+2);}
+	  if(fabs(etasep - 0.3  )<0.001){  box->SetFillColor(kGreen+3);}
+	}
+        boxN->SetFillColor(box->GetFillColor());
+        boxN->Draw();
+	box->Draw();
+	
+	//Phi segmentation
+        
+	double phiThisEta=phi[i];
+	for(int j=0;j<100;j++)
+	  {
+	    double yPhiAv=yPhi;
+	    yPhi=yPhi+phiThisEta*3.14/180;
+	  if(yPhi>3.14)break;  
+	    
+	    TLine *phiEtaPos = new TLine(xP1, yPhi,xPAv, yPhi);
+	    phiEtaPos->Draw();
+	    TLine *phiEtaNeg = new TLine(-xP1, yPhi,-xPAv, yPhi);
+	    phiEtaNeg->Draw();
+	    j++;
+	  }
+      }
+      
+      TLine *etaPos = new TLine(xP1, 0.,xP1, 3.14);
+      etaPos->Draw();
+      
+      TLine *etaNeg = new TLine(xM1, 0.,xM1, 3.14);
+      etaNeg->Draw();
+      
+    }
+}
+
+
+
+void General()
+{
+CALO();
+  
+}
+
+
