Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 void align(string path)
0003 {
0004   gSystem->Load("AlignLib_C.so");
0005 
0006 //   writeShifts(path);
0007 //   writePars(path);
0008 
0009   AlignPlots a(path + "shifts");
0010   a.iter(0);
0011   a.iter(100);
0012   a.iters();
0013   AlignPlots b(path + "pars");
0014   b.iter(0);
0015   b.iter(100);
0016   b.iters();
0017 
0018 //   if (!TFile((path + "histograms.root").c_str()).IsOpen()) return;
0019 // 
0020 //   string constraints[] = {"Det", "Pixel",
0021 //     "TPBLadder", "TPBLayer", "TPBHalfBarrel", "TPBBarrel",
0022 //     "TPEPanel", "TPEBlade", "TPEHalfDisk", "TPEHalfCylinder", "TPEEndcap"};
0023 // 
0024 //   for (int l = 0; l < 11; ++l)
0025 //   {
0026 //     writeSurvey(path, constraints[l]);
0027 //     AlignPlots c(path + "survey_" + constraints[l]);
0028 //     c.iters();
0029 //   }
0030 }
0031 
0032 void align(string path, unsigned int subdet, int minHit = 0)
0033 {
0034   gSystem->Load("AlignLib_C.so");
0035 
0036 //   writeShifts(path);
0037 //   writePars(path);
0038 
0039   vector<unsigned int> levels(1, subdet);
0040 
0041   AlignPlots a(path + "shifts", levels, minHit);
0042   a.iter(0);
0043   a.iter(100);
0044   a.iters();
0045   AlignPlots b(path + "pars", levels, minHit);
0046   b.iter(0);
0047   b.iter(100);
0048   b.iters();
0049 }
0050 
0051 void align()
0052 {
0053   string scenarios[] = {"idealStrip", "10pbStrip", "realStrip"};
0054   string constraints[] = {"tracks", "survey", "merged"};
0055 
0056   for (int i = 0; i < 3; ++i)
0057     for (int j = 0; j < 3; ++j)
0058     {
0059       string path = scenarios[i] + '/' + constraints[j] + "/main/";
0060       align(path);
0061       align(path, 1);
0062       align(path, 2);
0063       align(path, 2, 500);
0064     }
0065 }
0066 
0067 /*
0068 void align(TString path)
0069 {
0070   gStyle->SetOptStat(1110);
0071 
0072   TFile fu(path + "IOUserVariables.root");
0073   TFile fs(path + "shifts.root");
0074   TTree* tu = (TTree*)fu.Get("T9_10");
0075   TTree* ts = (TNtupleD*)fs.Get("t10");
0076   ts->AddFriend(tu, "tu");
0077 
0078   const char* vars[] = {"x", "y", "z", "a", "b", "g"};
0079 
0080   TCanvas c("c", "c", 1200, 800);
0081   c.Divide(3, 2);
0082 
0083   for (int i = 0; i < 6; ++i)
0084   {
0085     c.cd(i + 1);
0086     ts->Draw(vars[i], "Nhit > 500");
0087   }
0088 
0089   c.SaveAs(path + "shifts_hit500+.png");
0090 }
0091 
0092 void align(string file, int iter, unsigned int subdet, unsigned int layer)
0093 {
0094   TString vars[] = {'x', 'y', 'z', 'a', 'b', 'g'};
0095 
0096   char tree[] = {'t', '0' + iter, '\0'};
0097 
0098   TFile fin((file + ".root").c_str());
0099   TTree* t = (TTree*)fin.Get(tree);
0100 
0101   TCut cut1 = TString("subdetId(id) == ") + subdet;
0102   TCut cut2 = TString("layerNumber(id) == ") + layer;
0103 
0104   TCanvas c("c", "c", 1200, 800);
0105   c.Divide(3, 2);
0106 
0107   for (int i = 0; i < 6; ++i)
0108   {
0109     c.cd(i + 1);
0110     t->Draw(vars[i], cut1 && cut2);
0111   }
0112 
0113   TString out(file);
0114   out += iter; out += subdet == 3 ? "TIB" : "TOB";
0115   out += "Layer"; out += layer; out += ".png";
0116   c.SaveAs(out);
0117 }
0118 
0119 void align(string file, int iter)
0120 {
0121   gSystem->Load("NumbersAndNames_C.so");
0122 
0123   for (int l = 1; l <= 4; ++l) align(file, iter, Namer::TIB, l);
0124   for (int l = 1; l <= 5; ++l) align(file, iter, Namer::TOB, l);
0125 }
0126 
0127 void align(string file)
0128 {
0129   gSystem->Load("AlignLib_C.so");
0130   gSystem->Load("NumbersAndNames_C.so");
0131 
0132   for (int l = 1; l <= 4; ++l)
0133   {
0134     AlignPlots b("main/shifts", Namer::TIB, l); b.iters();
0135   }
0136 
0137   for (int l = 1; l <= 5; ++l)
0138   {
0139     AlignPlots b("main/shifts", Namer::TOB, l); b.iters();
0140   }
0141 }
0142 */