Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:03

0001 /*
0002 
0003 basic comparison plottig 
0004 using ntuples taken from files in ./root/ directory
0005 
0006 .x muonDBComparison.C
0007 
0008 */
0009 
0010 //#include "TTreeAnalysis.h"
0011 
0012 struct AlighnmentTTrees {
0013   TTree* DTWheels;
0014   TTree* DTStations;
0015   TTree* DTChambers;
0016   TTree* DTSuperLayers;
0017   TTree* DTLayers;     
0018   TTree* CSCStations;
0019   TTree* CSCChambers;
0020   TTree* CSCLayers;
0021 };
0022 
0023 /*
0024 struct AlighnmentTTreesAnalysis {
0025   TTreeAnalysis DTWheels;
0026   TTreeAnalysis DTChambers;
0027   TTreeAnalysis DTStations;
0028   TTreeAnalysis DTSuperLayers;
0029   TTreeAnalysis DTLayers;     
0030   TTreeAnalysis CSCStations;
0031   TTreeAnalysis CSCChambers;
0032   TTreeAnalysis CSCLayers;
0033 };
0034 */
0035 
0036 //----------------------------------------------------------------------------------------
0037 
0038 void importTreesFromFile(char *filename, TString dirname, AlighnmentTTrees *at, TString namePrf = "")
0039 {
0040   TFile* f = new TFile(filename);
0041 
0042   TTree* tmpTree_DTWheels      = (TTree*)f->Get((dirname+"/DTWheels").Data());
0043   TTree* tmpTree_DTStations    = (TTree*)f->Get((dirname+"/DTStations").Data());
0044   TTree* tmpTree_DTChambers    = (TTree*)f->Get((dirname+"/DTChambers").Data());
0045 //  TTree* tmpTree_DTSuperLayers = (TTree*)f->Get((dirname+"/DTSuperLayers").Data());
0046 //  TTree* tmpTree_DTLayers      = (TTree*)f->Get((dirname+"/DTLayers").Data());
0047 
0048   TTree* tmpTree_CSCStations = (TTree*)f->Get((dirname+"/CSCStations").Data());
0049   TTree* tmpTree_CSCChambers = (TTree*)f->Get((dirname+"/CSCChambers").Data());
0050 //  TTree* tmpTree_CSCLayers   = (TTree*)f->Get((dirname+"/CSCLayers").Data());
0051 
0052   gDirectory->Cd("Rint:/");
0053   at->DTWheels     = (TTree*) tmpTree_DTWheels->CopyTree("1");
0054   at->DTStations       = (TTree*) tmpTree_DTStations->CopyTree("1");
0055   at->DTChambers    = (TTree*) tmpTree_DTChambers->CopyTree("1");
0056 //  at->DTSuperLayers = (TTree*) tmpTree_DTSuperLayers->CopyTree("1");
0057 //  at->DTLayers       = (TTree*) tmpTree_DTLayers->CopyTree("1");
0058   
0059   at->CSCStations = (TTree*) tmpTree_CSCStations->CopyTree("1");
0060   at->CSCChambers = (TTree*) tmpTree_CSCChambers->CopyTree("1");
0061 //  at->CSCLayers   = (TTree*) tmpTree_CSCLayers->CopyTree("1");
0062   
0063   at->DTWheels     ->SetName((namePrf+"DTWheels"     ).Data());
0064   at->DTStations   ->SetName((namePrf+"DTStations"   ).Data());
0065   at->DTChambers   ->SetName((namePrf+"DTChambers"   ).Data());
0066 //  at->DTSuperLayers->SetName((namePrf+"DTSuperLayers").Data());
0067 //  at->DTLayers     ->SetName((namePrf+"DTLayers"     ).Data());
0068   at->CSCStations  ->SetName((namePrf+"CSCStations"  ).Data());
0069   at->CSCChambers  ->SetName((namePrf+"CSCChambers"  ).Data());
0070 //  at->CSCLayers    ->SetName((namePrf+"CSCLayers"    ).Data());
0071 
0072   f->Close();
0073 }
0074 
0075 //----------------------------------------------------------------------------------------
0076 
0077 void setupStyle()
0078 {
0079   gStyle->SetStatBorderSize(1);
0080   gStyle->SetStatStyle(3001);
0081   gStyle->SetOptStat(1111110);
0082   gStyle->SetOptFit(1111);
0083   gStyle->SetStatColor(0);
0084   gStyle->SetStatFontSize(0.03);
0085   gStyle->SetStatW(0.28);
0086   gStyle->SetStatH(0.32);
0087   gStyle->SetStatX(.99);
0088   gStyle->SetStatY(.99);
0089 
0090   gStyle->SetCanvasBorderMode(0);
0091   gStyle->SetPadTopMargin(0.13);
0092   gStyle->SetPadLeftMargin(0.16);
0093   gStyle->SetPadRightMargin(0.06);
0094   gStyle->SetTitleYOffset(1.2);
0095   gStyle->SetTitleXOffset(.65);
0096   gStyle->SetTitleYSize(0.07);
0097   gStyle->SetTitleXSize(0.07);
0098   gStyle->SetLabelSize(0.05);
0099   gStyle->SetLabelSize(0.05,"Y");
0100 
0101   gStyle->SetTitleBorderSize(0);
0102   //gStyle->SetTitleStyle(3001);
0103   gStyle->SetTitleColor(1);
0104   gStyle->SetTitleFillColor(0);
0105   gStyle->SetTitleFontSize(0.07);
0106   gStyle->SetTitleStyle(0);
0107 
0108 }
0109 
0110 //----------------------------------------------------------------------------------------
0111 
0112 void setupHisto(TH1F *h, char title[200], int color=-1, int lcolor=-1)
0113 {
0114   h->SetTitle(title);
0115   if (color>=0) h->SetFillColor(color);
0116   if (lcolor>=0) {
0117     h->SetLineColor(lcolor);
0118     h->SetLineWidth(2);
0119   }
0120 }
0121 
0122 //----------------------------------------------------------------------------------------
0123 
0124 void adjustRange(TH1F *h, TH1F *h1)
0125 {
0126   double ymax = (h->GetMaximum() > h1->GetMaximum()) ? h->GetMaximum() : h1->GetMaximum();
0127   h1->SetMaximum(ymax*1.05);
0128   //gPad->Update();
0129 }
0130 
0131 
0132 //----------------------------------------------------------------------------------------
0133 
0134 void compare2Alignments(
0135   char *filename,
0136   TString alment0="mockAlignment",
0137   TString alment1="ideal")
0138 {
0139   setupStyle();
0140   
0141   AlighnmentTTrees alignTrees[2];
0142 
0143   importTreesFromFile(filename, alment0, &alignTrees[0], alment0+"_");
0144   importTreesFromFile(filename, alment1, &alignTrees[1], alment1+"_");
0145 
0146 
0147 /*
0148   gSystem->CompileMacro("loadLookupTable.C","k");
0149   //gSystem->Load("loadLookupTable_C.so");
0150   loadLookupTable();
0151 //  populateDetData(atrees[0].DTWheels);
0152   for (int i=0; i<2; i++) {
0153     populateDetData(atrees[i].DTWheels);
0154     populateDetData(atrees[i].DTChambers);
0155     populateDetData(atrees[i].DTStations);
0156     populateDetData(atrees[i].DTSuperLayers);
0157     populateDetData(atrees[i].DTLayers);
0158     populateDetData(atrees[i].CSCStations);
0159     populateDetData(atrees[i].CSCChambers);
0160     populateDetData(atrees[i].CSCLayers);
0161   }
0162   
0163   AlighnmentTTreesAnalysis alignTreesAna[2];
0164   for (int i=0; i<2; i++) {
0165     alignTreesAna[i].DTWheels.Init(alignTrees[i].DTWheels);
0166     alignTreesAna[i].DTChambers.Init(alignTrees[i].DTChambers);
0167     alignTreesAna[i].DTStations.Init(alignTrees[i].DTStations);
0168     alignTreesAna[i].DTSuperLayers.Init(alignTrees[i].DTSuperLayers);
0169     alignTreesAna[i].DTLayers.Init(alignTrees[i].DTLayers);
0170     alignTreesAna[i].CSCStations.Init(alignTrees[i].CSCStations);
0171     alignTreesAna[i].CSCChambers.Init(alignTrees[i].CSCChambers);
0172     alignTreesAna[i].CSCLayers.Init(alignTrees[i].CSCLayers);
0173   }
0174 */
0175 
0176   alignTrees[0].DTWheels->AddFriend(alignTrees[1].DTWheels,"a");
0177   alignTrees[0].DTChambers->AddFriend(alignTrees[1].DTChambers,"a");
0178   alignTrees[0].DTStations->AddFriend(alignTrees[1].DTStations,"a");
0179 //  alignTrees[0].DTSuperLayers->AddFriend(alignTrees[1].DTSuperLayers,"a");
0180 //  alignTrees[0].DTLayers->AddFriend(alignTrees[1].DTLayers,"a");
0181   alignTrees[0].CSCStations->AddFriend(alignTrees[1].CSCStations,"a");
0182   alignTrees[0].CSCChambers->AddFriend(alignTrees[1].CSCChambers,"a");
0183 //  alignTrees[0].CSCLayers->AddFriend(alignTrees[1].CSCLayers,"a");
0184 
0185   /// ------ PLOTTING -------------
0186 
0187   char histostr[100], drawstr[300], cutstr[200], hsetupstr[200];
0188   //double nbin = 20, low = -0.15, high = 0.15;
0189   double nbin = 20, low = -0.05, high = 0.05;
0190   
0191   TCanvas *c1 = new TCanvas("c_barrel_dz","c_barrel_dz",1500,350);
0192   c1->Divide(5,1,0.001,0.001);
0193   TH1F *h_bz_[5];
0194   for (int i=-2; i<=2; i++) {
0195     c1->cd(i+3);
0196     sprintf(histostr,"h_bz_[%d]",i+2);
0197     //sprintf(drawstr,"z-a.z>>%s(%d,%f,%f)",histostr,nbin,low,high);
0198     sprintf(drawstr,"xhatx*dx+xhaty*dy+xhatz*dz>>%s(%d,%f,%f)",histostr,nbin,low,high);
0199     sprintf(cutstr, "structa==%d",i);
0200     //sprintf(hsetupstr,"wheel %d:  #Delta z;#Delta z;# chambers", i);
0201     sprintf(hsetupstr,"wheel %d:  #Delta x;#Delta x;# chambers", i);
0202     cout<<drawstr<<endl;
0203     alignTrees[0].DTChambers->Draw(drawstr,cutstr);
0204     h_bz_[i+2] = (TH1F*) gROOT->FindObject(histostr);
0205     setupHisto(h_bz_[i+2],hsetupstr, 3);
0206     h_bz_[i+2]->GetXaxis()->SetNdivisions(207);
0207   }
0208   c1->cd();
0209 
0210   
0211   //nbin = 20; low = -1.5; high = 1.5;
0212   nbin = 20; low = -.02; high = .02;
0213   
0214   TCanvas *c2 = new TCanvas("c_endcap_dz","c_endcap_dz",1200,700);
0215   c2->Divide(4,2,0.001,0.001);
0216   TH1F *h_edz_[9];
0217   int npad=1;
0218   for (int i=-4; i<=4; i++) {
0219     if (i==0) continue;
0220     c2->cd(npad++);
0221     sprintf(histostr,"h_edz_[%d]",i+4);
0222     //sprintf(drawstr,"z-a.z>>%s(%d,%f,%f)",histostr,nbin,low,high);
0223     sprintf(drawstr,"xhatx*dx+xhaty*dy+xhatz*dz>>%s(%d,%f,%f)",histostr,nbin,low,high);
0224     //sprintf(cutstr, "structa==%d",i);
0225     sprintf(cutstr, "structa==%d&&(!(structa==1&&(structb==1||structb==4)))",i);
0226     //sprintf(hsetupstr,"disk %d:  #Delta z;#Delta z;# chambers", i);
0227     sprintf(hsetupstr,"disk %d:  #Delta x;#Delta x;# chambers", i);
0228     cout<<drawstr<<endl;
0229     alignTrees[0].CSCChambers->Draw(drawstr,cutstr);
0230     h_edz_[i+4] = (TH1F*) gROOT->FindObject(histostr);
0231     setupHisto(h_edz_[i+4],hsetupstr, 3);
0232     h_edz_[i+4]->GetXaxis()->SetNdivisions(207);
0233   }
0234   c2->cd();
0235 
0236 
0237   //TCanvas *tc = new TCanvas("test","test",900,900);
0238   //tc->Divide(2,2);
0239   //tc->cd(1);
0240 
0241 
0242   /// ------ END PLOTTING -------------
0243   
0244   return;
0245  
0246   if (gROOT->IsBatch()) return;
0247   new TBrowser();
0248   TTreeViewer *treeview = new TTreeViewer();
0249 //  char tnames[8][50] = {"DTWheels","DTStations","DTChambers","DTSuperLayers","DTLayers" ,"CSCStations" ,"CSCChambers" ,"CSCLayers"};
0250   char tnames[8][50] = {"DTWheels","DTStations","DTChambers","CSCStations" ,"CSCChambers" };
0251   for (int i=0;i<8;i++)  {
0252     char nm[200];
0253     sprintf(nm,"%s_%s",alment0.Data(),tnames[i]);
0254     treeview->SetTreeName(nm);
0255   }
0256   for (int i=0;i<8;i++)  {
0257     char nm[200];
0258     sprintf(nm,"%s_%s",alment1.Data(),tnames[i]);
0259     treeview->SetTreeName(nm);
0260   }
0261 
0262 
0263 }
0264 
0265 
0266 
0267 //----------------------------------------------------------------------------------------
0268 
0269 void compare2AlignmentsSame(
0270   char *filename,
0271   TString alment0="fromAlignment",
0272   TString alment1="ideal")
0273 {
0274   setupStyle();
0275   
0276   AlighnmentTTrees alignTrees[2];
0277 
0278   importTreesFromFile(filename, alment0, &alignTrees[0], alment0+"_");
0279   importTreesFromFile(filename, alment1, &alignTrees[1], alment1+"_");
0280 
0281 
0282   alignTrees[0].DTWheels->AddFriend(alignTrees[1].DTWheels,"a");
0283   alignTrees[0].DTChambers->AddFriend(alignTrees[1].DTChambers,"a");
0284   alignTrees[0].DTStations->AddFriend(alignTrees[1].DTStations,"a");
0285 //  alignTrees[0].DTSuperLayers->AddFriend(alignTrees[1].DTSuperLayers,"a");
0286 //  alignTrees[0].DTLayers->AddFriend(alignTrees[1].DTLayers,"a");
0287   alignTrees[0].CSCStations->AddFriend(alignTrees[1].CSCStations,"a");
0288   alignTrees[0].CSCChambers->AddFriend(alignTrees[1].CSCChambers,"a");
0289 //  alignTrees[0].CSCLayers->AddFriend(alignTrees[1].CSCLayers,"a");
0290 
0291   /// ------ PLOTTING -------------
0292 
0293   char histostr[100], histostr1[100], drawstr[300], cutstr[200], hsetupstr[200];
0294   //double nbin = 20, low = -0.15, high = 0.15;
0295   double nbin = 20, low = -0.05, high = 0.05;
0296   
0297   TCanvas *c1 = (TCanvas*)gROOT->FindObject("c_barrel_dz");
0298   if (c1==NULL) return;
0299   TH1F *h_1;
0300   TH1F *h_bz_[5];
0301   for (int i=-2; i<=2; i++) {
0302     c1->cd(i+3);
0303     sprintf(histostr,"h_bz_s[%d]",i+2);
0304     sprintf(histostr1,"h_bz_[%d]",i+2);
0305     //sprintf(drawstr,"z-a.z>>%s(%d,%f,%f)",histostr,nbin,low,high);
0306     sprintf(drawstr,"xhatx*dx+xhaty*dy+xhatz*dz>>%s(%d,%f,%f)",histostr,nbin,low,high);
0307     sprintf(cutstr, "structa==%d",i);
0308     //sprintf(hsetupstr,"wheel %d:  #Delta z;#Delta z;# chambers", i);
0309     sprintf(hsetupstr,"wheel %d:  #Delta x;#Delta x;# chambers", i);
0310     cout<<drawstr<<endl;
0311     alignTrees[0].DTChambers->Draw(drawstr,cutstr,"same");
0312     h_bz_[i+2] = (TH1F*) gROOT->FindObject(histostr);
0313     setupHisto(h_bz_[i+2],hsetupstr, -1, 4);
0314     h_1 = (TH1F*) gROOT->FindObjectAny(histostr1);
0315     adjustRange(h_bz_[i+2],h_1);
0316   }
0317   c1->cd();
0318 
0319   
0320   //nbin = 20; low = -1.5; high = 1.5;
0321   nbin = 20; low = -.02; high = .02;
0322   
0323   TCanvas *c2 = (TCanvas*)gROOT->FindObject("c_endcap_dz");
0324   if (c2==NULL) return;
0325   TH1F *h_edz_[9];
0326   int npad=1;
0327   for (int i=-4; i<=4; i++) {
0328     if (i==0) continue;
0329     c2->cd(npad++);
0330     sprintf(histostr,"h_edz_s[%d]",i+4);
0331     sprintf(histostr1,"h_edz_[%d]",i+4);
0332     //sprintf(drawstr,"z-a.z>>%s(%d,%f,%f)",histostr,nbin,low,high);
0333     sprintf(drawstr,"xhatx*dx+xhaty*dy+xhatz*dz>>%s(%d,%f,%f)",histostr,nbin,low,high);
0334     //sprintf(cutstr, "structa==%d",i);
0335     sprintf(cutstr, "structa==%d&&(!(abs(structa)==1&&(structb==1||structb==4)))",i);
0336     //sprintf(hsetupstr,"disk %d:  #Delta z;#Delta z;# chambers", i);
0337     sprintf(hsetupstr,"disk %d:  #Delta x;#Delta x;# chambers", i);
0338     cout<<drawstr<<endl;
0339     alignTrees[0].CSCChambers->Draw(drawstr,cutstr,"same");
0340     h_edz_[i+4] = (TH1F*) gROOT->FindObject(histostr);
0341     setupHisto(h_edz_[i+4],hsetupstr, -1, 4);
0342     h_1 = (TH1F*) gROOT->FindObjectAny(histostr1);
0343     adjustRange(h_edz_[i+4],h_1);
0344   }
0345   c2->cd();
0346 
0347 
0348   //TCanvas *tc = new TCanvas("test","test",900,900);
0349   //tc->Divide(2,2);
0350   //tc->cd(1);
0351 
0352 
0353   /// ------ END PLOTTING -------------
0354   
0355   return;
0356  
0357   if (gROOT->IsBatch()) return;
0358   new TBrowser();
0359   TTreeViewer *treeview = new TTreeViewer();
0360 //  char tnames[8][50] = {"DTWheels","DTStations","DTChambers","DTSuperLayers","DTLayers" ,"CSCStations" ,"CSCChambers" ,"CSCLayers"};
0361   char tnames[8][50] = {"DTWheels","DTStations","DTChambers","CSCStations" ,"CSCChambers" };
0362   for (int i=0;i<8;i++)  {
0363     char nm[200];
0364     sprintf(nm,"%s_%s",alment0.Data(),tnames[i]);
0365     treeview->SetTreeName(nm);
0366   }
0367   for (int i=0;i<8;i++)  {
0368     char nm[200];
0369     sprintf(nm,"%s_%s",alment1.Data(),tnames[i]);
0370     treeview->SetTreeName(nm);
0371   }
0372 
0373 
0374 }
0375 
0376 
0377 
0378 //----------------------------------------------------------------------------------------
0379 
0380 void compareAlignmentsSeries(
0381   int N, 
0382   char files[10][255],
0383   TString alment0,
0384   TString alment)
0385 {
0386 //  gSystem->Load("TTreeAnalysis_C.so");
0387 
0388   setupStyle();
0389   
0390   AlighnmentTTrees alignTrees[10];
0391 
0392   char dum[100];
0393   sprintf(dum,"%s_",alment0.Data());
0394   importTreesFromFile(files[0], alment0, &alignTrees[0], alment0+"_");
0395   for (Int_t i=1; i<=N; i++) {
0396     sprintf(dum,"%s_%d_",alment.Data(),i);
0397     importTreesFromFile(files[i-1], alment, &alignTrees[i], dum);
0398 
0399     alignTrees[i].DTWheels->AddFriend(alignTrees[0].DTWheels,"a");
0400     alignTrees[i].DTChambers->AddFriend(alignTrees[0].DTChambers,"a");
0401     alignTrees[i].DTStations->AddFriend(alignTrees[0].DTStations,"a");
0402     //alignTrees[i].DTSuperLayers->AddFriend(alignTrees[0].DTSuperLayers,"a");
0403     //alignTrees[i].DTLayers->AddFriend(alignTrees[0].DTLayers,"a");
0404     alignTrees[i].CSCStations->AddFriend(alignTrees[0].CSCStations,"a");
0405     alignTrees[i].CSCChambers->AddFriend(alignTrees[0].CSCChambers,"a");
0406     //alignTrees[i].CSCLayers->AddFriend(alignTrees[0].CSCLayers,"a");
0407   }
0408   
0409   /// ------ PLOTTING -------------
0410 
0411   char histostr[100], drawstr[300], cutstr[200], hsetupstr[200];
0412   double nbin = 20, low = -0.15, high = 0.15;
0413   
0414   TCanvas *tc = new TCanvas("test","test",500,500);
0415 
0416 //  alignTrees[5].DTChambers->Draw(
0417 //    "atan2(y,x)-atan2(a.y,a.x)>>h_dphi(100)","structa==2");
0418 
0419 
0420   TCanvas *c1 = new TCanvas("c_barrel_dxloc","c_barrel_dxloc",1500,350);
0421   c1->Divide(5,1,0.001,0.001);
0422   TH1F *h_bdxloc_[6];
0423   h_bdxloc_[5] = new TH1F("hzero","hzero",5,0.5,5.5);
0424   h_bdxloc_[5]->SetStats(0);
0425   h_bdxloc_[5]->SetLineColor(4);
0426   for (int i=-2; i<=2; i++) {
0427     sprintf(histostr,"h_bdxloc_[%d]",i+2);
0428     cout<<histostr<<endl;
0429     h_bdxloc_[i+2] = new TH1F(histostr,histostr,5,0.5,5.5);
0430     sprintf(cutstr, "structa==%d",i);
0431     sprintf(hsetupstr,"wheel %d:  #Delta x;alignment #;#Delta x", i);
0432     tc->cd();
0433     for (int f=1; f<=5; f++) {
0434       alignTrees[f].DTChambers->Draw("xhatx*dx+xhaty*dy+xhatz*dz",cutstr );
0435 //        "sqrt(x*x+y*y)*atan2(sin(atan2(y,x)-atan2(a.y,a.x)),cos(atan2(y,x)-atan2(a.y,a.x)))");
0436 //        "atan2(sin(atan2(y,x)-atan2(a.y,a.x)),cos(atan2(y,x)-atan2(a.y,a.x)))",cutstr);
0437       h_bdxloc_[i+2]->SetBinContent(f,htemp->GetMean());
0438       h_bdxloc_[i+2]->SetBinError(f,htemp->GetRMS());
0439     }
0440     h_bdxloc_[i+2]->SetEntries(5);
0441     setupHisto(h_bdxloc_[i+2],hsetupstr, 8);
0442     c1->cd(i+3);
0443     h_bdxloc_[i+2]->Draw();
0444     h_bdxloc_[5]->Draw("same");
0445   }
0446   c1->cd();
0447 
0448 //return;
0449 
0450   TCanvas *c2 = new TCanvas("c_endcap_dxloc","c_endcap_dxloc",1200,700);
0451   c2->Divide(4,2,0.001,0.001);
0452   TH1F *h_edxloc_[10];
0453   h_edxloc_[9] = new TH1F("hezero","hezero",5,0.5,5.5);
0454   h_edxloc_[9]->SetStats(0);
0455   h_edxloc_[9]->SetLineColor(4);
0456   int npad=1;
0457   for (int i=-4; i<=4; i++) {
0458     if (i==0) continue;
0459     sprintf(histostr,"h_edxloc_[%d]",i+4);
0460     cout<<histostr<<endl;
0461     h_edxloc_[i+4] = new TH1F(histostr,histostr,5,0.5,5.5);
0462     //sprintf(cutstr, "structa==%d&&structb==1",i);
0463     sprintf(cutstr, "structa==%d",i);
0464     sprintf(hsetupstr,"disk %d:  #Delta x;alignment #;#Delta x", i);
0465     tc->cd();
0466     for (int f=1; f<=5; f++) {
0467       alignTrees[f].CSCChambers->Draw("xhatx*dx+xhaty*dy+xhatz*dz",cutstr );
0468 //        "sqrt(x*x+y*y)*atan2(sin(atan2(y,x)-atan2(a.y,a.x)),cos(atan2(y,x)-atan2(a.y,a.x)))",cutstr);
0469 //        "atan2(sin(atan2(y,x)-atan2(a.y,a.x)),cos(atan2(y,x)-atan2(a.y,a.x)))",cutstr);
0470       h_edxloc_[i+4]->SetBinContent(f,htemp->GetMean());
0471       h_edxloc_[i+4]->SetBinError(f,htemp->GetRMS());
0472     }
0473     h_edxloc_[i+4]->SetEntries(5);
0474     setupHisto(h_edxloc_[i+4],hsetupstr, 8);
0475     c2->cd(npad++);
0476     h_edxloc_[i+4]->Draw();
0477     h_edxloc_[9]->Draw("same");
0478   }
0479   c2->cd();
0480   //c2->Print("r1.ps");
0481   
0482 
0483 
0484   //TCanvas *tc = new TCanvas("test","test",900,900);
0485   //tc->Divide(2,2);
0486   //tc->cd(1);
0487 
0488 
0489   /// ------ END PLOTTING -------------
0490   
0491   return;
0492  
0493   if (gROOT->IsBatch()) return;
0494   new TBrowser();
0495   TTreeViewer *treeview = new TTreeViewer();
0496 //  char tnames[8][50] = {"DTWheels","DTStations","DTChambers","DTSuperLayers","DTLayers" ,"CSCStations" ,"CSCChambers" ,"CSCLayers"};
0497   char tnames[8][50] = {"DTWheels","DTStations","DTChambers","CSCStations" ,"CSCChambers" };
0498   for (int i=0;i<8;i++)  {
0499     char nm[200];
0500     sprintf(nm,"%s_%s",alment0.Data(),tnames[i]);
0501     treeview->SetTreeName(nm);
0502   }
0503   for (int i=0;i<8;i++)  {
0504     char nm[200];
0505     sprintf(nm,"%s_%s",alment.Data(),tnames[i]);
0506     treeview->SetTreeName(nm);
0507   }
0508 
0509 
0510 }
0511 
0512 
0513 //----------------------------------------------------------------------------------------
0514 
0515 void muonDBComparison()
0516 {
0517 
0518   //  files with series of alignments
0519 //  char files[5][255]={"root/roll0.root", "root/roll2.root", "root/roll4.root", "root/roll6.root", "root/roll8.root"};
0520   char files[5][255]={"root/tracker0.root", "root/tracker1.root", "root/tracker2.root", "root/tracker3.root", "root/tracker5.root"};
0521 
0522   // draw the series comparison
0523   compareAlignmentsSeries(5, files,"ideal","fromAlignment");
0524 
0525 
0526   // compare mock and ideal 
0527   compare2Alignments("root/first_examples.root", "mockAlignment", "ideal");
0528 
0529   // draw the same plots for real alignment overlayed
0530   compare2AlignmentsSame("root/first_examples.root", "fromAlignment","ideal");
0531 
0532 }