Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:52

0001 #include <vector>
0002 
0003 void PlotGraphs( TH1F* full, TH1F* fast) {
0004 
0005   full->SetMarkerColor(4);                      
0006   full->SetLineColor(4);//blue                        
0007   full->SetLineWidth(2);                          
0008   full->SetLineStyle(3);
0009   //  full->SetMaximum(0.11);
0010   full->Draw();
0011 
0012 
0013   fast->SetMarkerStyle(25);                     
0014   fast->SetMarkerColor(2);                      
0015   fast->SetLineColor(2);//red                         
0016   fast->SetLineWidth(2);                          
0017   fast->Draw("same");
0018   
0019 }
0020 
0021 void Efficiency(unsigned int iter) {
0022   
0023   gROOT->Reset();
0024   TFile *f = new TFile("testTrackingIterations.root");
0025   //  TFile *f = new TFile("testTrackingIterations_fullstat.root");
0026   if(f->IsZombie() ) return;
0027   f->cd("DQMData"); 
0028 
0029   std::vector<char *> titleFull;
0030   std::vector<char *> titleFast;
0031   std::vector<char *> titleGen;
0032   titleFull.push_back("eff1Full_p_0_1");
0033   titleFull.push_back("eff1Full_p_1_2");
0034   titleFull.push_back("eff1Full_p_2_3");
0035   titleFull.push_back("eff1Full_p_3_4");
0036   titleFull.push_back("eff1Full_p_4_5");
0037   titleFull.push_back("eff1Full_p_5_6");
0038   titleFull.push_back("eff1Full_p_6_7");
0039   titleFull.push_back("eff1Full_p_7_8");
0040   titleFull.push_back("eff1Full_p_8_9");
0041   titleFull.push_back("eff1Full_p_9_10");
0042   titleFast.push_back("eff1Fast_p_0_1");
0043   titleFast.push_back("eff1Fast_p_1_2");
0044   titleFast.push_back("eff1Fast_p_2_3");
0045   titleFast.push_back("eff1Fast_p_3_4");
0046   titleFast.push_back("eff1Fast_p_4_5");
0047   titleFast.push_back("eff1Fast_p_5_6");
0048   titleFast.push_back("eff1Fast_p_6_7");
0049   titleFast.push_back("eff1Fast_p_7_8");
0050   titleFast.push_back("eff1Fast_p_8_9");
0051   titleFast.push_back("eff1Fast_p_9_10");
0052   titleGen.push_back("eff1Gen_p_0_1");
0053   titleGen.push_back("eff1Gen_p_1_2");
0054   titleGen.push_back("eff1Gen_p_2_3");
0055   titleGen.push_back("eff1Gen_p_3_4");
0056   titleGen.push_back("eff1Gen_p_4_5");
0057   titleGen.push_back("eff1Gen_p_5_6");
0058   titleGen.push_back("eff1Gen_p_6_7");
0059   titleGen.push_back("eff1Gen_p_7_8");
0060   titleGen.push_back("eff1Gen_p_8_9");
0061   titleGen.push_back("eff1Gen_p_9_10");
0062 
0063   TCanvas *c = new TCanvas("c","",1000, 600);
0064   c->Divide(3,4);
0065   TH2F* effFull;
0066   TH2F* effFast;
0067   TH2F* genPlot;
0068   genPlot = (TH2F*) gDirectory->Get("genEtaP");
0069   if ( iter == 0 ) { 
0070     effFull = (TH2F*) gDirectory->Get("eff0Full");
0071     effFast = (TH2F*) gDirectory->Get("eff0Fast");
0072   } else if ( iter == 1 ) { 
0073     effFull = (TH2F*) gDirectory->Get("eff1Full");
0074     effFast = (TH2F*) gDirectory->Get("eff1Fast");
0075   } else if ( iter == 2 ) { 
0076     effFull = (TH2F*) gDirectory->Get("eff2Full");
0077     effFast = (TH2F*) gDirectory->Get("eff2Fast");
0078   } else if ( iter == 3 ) { 
0079     effFull = (TH2F*) gDirectory->Get("eff3Full");
0080     effFast = (TH2F*) gDirectory->Get("eff3Fast");
0081   } else if ( iter == 4 ) { 
0082     effFull = (TH2F*) gDirectory->Get("eff4Full");
0083     effFast = (TH2F*) gDirectory->Get("eff4Fast");
0084   } else if ( iter == 5 ) { 
0085     effFull = (TH2F*) gDirectory->Get("eff5Full");
0086     effFast = (TH2F*) gDirectory->Get("eff5Fast");
0087   } else if ( iter == 11 ) { 
0088     effFull = (TH2F*) gDirectory->Get("eff1Full1");
0089     effFast = (TH2F*) gDirectory->Get("eff1Fast1");
0090   } else if ( iter == 12 ) { 
0091     effFull = (TH2F*) gDirectory->Get("eff1Full2");
0092     effFast = (TH2F*) gDirectory->Get("eff1Fast2");
0093   }
0094   for (unsigned imom=1;imom<11;++imom) {  
0095     genPlot->ProjectionX(titleGen[imom-1],10*(imom-1)+1,10*imom+1);
0096     effFull->ProjectionX(titleFull[imom-1],10*(imom-1)+1,10*imom+1);
0097     effFast->ProjectionX(titleFast[imom-1],10*(imom-1)+1,10*imom+1);
0098     TH1F* fast = (TH1F*) gDirectory->Get(titleFast[imom-1]);
0099     TH1F* full = (TH1F*) gDirectory->Get(titleFull[imom-1]);
0100     TH1F* gen = (TH1F*) gDirectory->Get(titleGen[imom-1]);
0101     fast->Divide(gen);
0102     full->Divide(gen);
0103     c->cd(imom);
0104     PlotGraphs(full,fast);
0105   }  
0106 
0107   
0108   TH1F* fast;
0109   TH1F* full;
0110   TH1F* gen;
0111   TH1F* fastp;
0112   TH1F* fullp;
0113   TH1F* genp;
0114   genPlot->ProjectionX();
0115   effFull->ProjectionX();
0116   effFast->ProjectionX();
0117   genPlot->ProjectionY();
0118   effFull->ProjectionY();
0119   effFast->ProjectionY();
0120   if ( iter == 0 ) { 
0121     fast = (TH1F*) gDirectory->Get("eff0Fast_px");
0122     full = (TH1F*) gDirectory->Get("eff0Full_px");
0123     fastp = (TH1F*) gDirectory->Get("eff0Fast_py");
0124     fullp = (TH1F*) gDirectory->Get("eff0Full_py");
0125   }else if ( iter == 1 ) { 
0126     fast = (TH1F*) gDirectory->Get("eff1Fast_px");
0127     full = (TH1F*) gDirectory->Get("eff1Full_px");
0128     fastp = (TH1F*) gDirectory->Get("eff1Fast_py");
0129     fullp = (TH1F*) gDirectory->Get("eff1Full_py");
0130   } else if ( iter == 2 ) { 
0131     fast = (TH1F*) gDirectory->Get("eff2Fast_px");
0132     full = (TH1F*) gDirectory->Get("eff2Full_px");
0133     fastp = (TH1F*) gDirectory->Get("eff2Fast_py");
0134     fullp = (TH1F*) gDirectory->Get("eff2Full_py");
0135   } else if ( iter == 3 ) { 
0136     fast = (TH1F*) gDirectory->Get("eff3Fast_px");
0137     full = (TH1F*) gDirectory->Get("eff3Full_px");
0138     fastp = (TH1F*) gDirectory->Get("eff3Fast_py");
0139     fullp = (TH1F*) gDirectory->Get("eff3Full_py");
0140   } else if ( iter == 4 ) { 
0141     fast = (TH1F*) gDirectory->Get("eff4Fast_px");
0142     full = (TH1F*) gDirectory->Get("eff4Full_px");
0143     fastp = (TH1F*) gDirectory->Get("eff4Fast_py");
0144     fullp = (TH1F*) gDirectory->Get("eff4Full_py");
0145   } else if ( iter == 5 ) { 
0146     fast = (TH1F*) gDirectory->Get("eff5Fast_px");
0147     full = (TH1F*) gDirectory->Get("eff5Full_px");
0148     fastp = (TH1F*) gDirectory->Get("eff5Fast_py");
0149     fullp = (TH1F*) gDirectory->Get("eff5Full_py");
0150   } else if ( iter == 11 ) { 
0151     fast = (TH1F*) gDirectory->Get("eff1Fast1_px");
0152     full = (TH1F*) gDirectory->Get("eff1Full1_px");
0153     fastp = (TH1F*) gDirectory->Get("eff1Fast1_py");
0154     fullp = (TH1F*) gDirectory->Get("eff1Full1_py");
0155   } else if ( iter == 12 ) { 
0156     fast = (TH1F*) gDirectory->Get("eff1Fast2_px");
0157     full = (TH1F*) gDirectory->Get("eff1Full2_px");
0158     fastp = (TH1F*) gDirectory->Get("eff1Fast2_py");
0159     fullp = (TH1F*) gDirectory->Get("eff1Full2_py");
0160   }
0161   gen = (TH1F*) gDirectory->Get("genEtaP_px");
0162   fast->Divide(gen);
0163   full->Divide(gen);
0164   c->cd(11);
0165   PlotGraphs(full,fast);
0166 
0167   genp = (TH1F*) gDirectory->Get("genEtaP_py");
0168   fastp->Divide(genp);
0169   fullp->Divide(genp);
0170   c->cd(12);
0171   PlotGraphs(fullp,fastp);
0172 
0173 }
0174 
0175 void Hits(unsigned int iter) {
0176   
0177   gROOT->Reset();
0178     TFile *f = new TFile("testTrackingIterations.root");
0179     //TFile *f = new TFile("testTrackingIterations_fullstat.root");
0180   if(f->IsZombie() ) return;
0181   f->cd("DQMData"); 
0182 
0183   std::vector<char *> titleFull;
0184   std::vector<char *> titleFast;
0185   titleFull.push_back("HitsFull_p_0_2");
0186   titleFull.push_back("HitsFull_p_2_4");
0187   titleFull.push_back("HitsFull_p_4_6");
0188   titleFull.push_back("HitsFull_p_6_8");
0189   titleFull.push_back("HitsFull_p_8_10");
0190   titleFull.push_back("HitsFull_Eta_0.0_0.5");
0191   titleFull.push_back("HitsFull_Eta_0.5_1.0");
0192   titleFull.push_back("HitsFull_Eta_1.0_1.5");
0193   titleFull.push_back("HitsFull_Eta_1.5_2.0");
0194   titleFull.push_back("HitsFull_Eta_2.0_2.8");
0195   titleFast.push_back("HitsFast_p_0_2");
0196   titleFast.push_back("HitsFast_p_2_4");
0197   titleFast.push_back("HitsFast_p_4_6");
0198   titleFast.push_back("HitsFast_p_6_8");
0199   titleFast.push_back("HitsFast_p_8_10");
0200   titleFast.push_back("HitsFast_Eta_0.0_0.6");
0201   titleFast.push_back("HitsFast_Eta_0.6_1.2");
0202   titleFast.push_back("HitsFast_Eta_1.2_1.8");
0203   titleFast.push_back("HitsFast_Eta_1.8_2.4");
0204   titleFast.push_back("HitsFast_Eta_2.4_3.0");
0205 
0206   TCanvas *c = new TCanvas("c","",1000, 600);
0207   c->Divide(3,4);
0208   TH2F* hitsFullP;
0209   TH2F* hitsFastP;
0210   TH2F* hitsFullEta;
0211   TH2F* hitsFastEta;
0212   if ( iter == 0 ) { 
0213     hitsFullP = (TH2F*) gDirectory->Get("Hits0PFull");
0214     hitsFastP = (TH2F*) gDirectory->Get("Hits0PFast");
0215     hitsFullEta = (TH2F*) gDirectory->Get("Hits0EtaFull");
0216     hitsFastEta = (TH2F*) gDirectory->Get("Hits0EtaFast");
0217   }else if ( iter == 1 ) { 
0218     hitsFullP = (TH2F*) gDirectory->Get("Hits1PFull");
0219     hitsFastP = (TH2F*) gDirectory->Get("Hits1PFast");
0220     hitsFullEta = (TH2F*) gDirectory->Get("Hits1EtaFull");
0221     hitsFastEta = (TH2F*) gDirectory->Get("Hits1EtaFast");
0222   } else if ( iter == 2 ) { 
0223     hitsFullP = (TH2F*) gDirectory->Get("Hits2PFull");
0224     hitsFastP = (TH2F*) gDirectory->Get("Hits2PFast");
0225     hitsFullEta = (TH2F*) gDirectory->Get("Hits2EtaFull");
0226     hitsFastEta = (TH2F*) gDirectory->Get("Hits2EtaFast");
0227   } else if ( iter == 3 ) { 
0228     hitsFullP = (TH2F*) gDirectory->Get("Hits3PFull");
0229     hitsFastP = (TH2F*) gDirectory->Get("Hits3PFast");
0230     hitsFullEta = (TH2F*) gDirectory->Get("Hits3EtaFull");
0231     hitsFastEta = (TH2F*) gDirectory->Get("Hits3EtaFast");
0232   } else if ( iter == 4 ) { 
0233     hitsFullP = (TH2F*) gDirectory->Get("Hits4PFull");
0234     hitsFastP = (TH2F*) gDirectory->Get("Hits4PFast");
0235     hitsFullEta = (TH2F*) gDirectory->Get("Hits4EtaFull");
0236     hitsFastEta = (TH2F*) gDirectory->Get("Hits4EtaFast");
0237   } else if ( iter == 5 ) { 
0238     hitsFullP = (TH2F*) gDirectory->Get("Hits5PFull");
0239     hitsFastP = (TH2F*) gDirectory->Get("Hits5PFast");
0240     hitsFullEta = (TH2F*) gDirectory->Get("Hits5EtaFull");
0241     hitsFastEta = (TH2F*) gDirectory->Get("Hits5EtaFast");
0242   }
0243   for (unsigned imom=1;imom<6;++imom) {  
0244     hitsFullP->ProjectionY(titleFull[imom-1],20*(imom-1)+1,20*imom+1);
0245     hitsFastP->ProjectionY(titleFast[imom-1],20*(imom-1)+1,20*imom+1);
0246     hitsFullEta->ProjectionY(titleFull[10-imom],3*(imom-1),max((unsigned int)28,30-3*(imom-1)));
0247     hitsFastEta->ProjectionY(titleFast[10-imom],3*(imom-1),max((unsigned int)28,30-3*(imom-1)));
0248     hitsFullEta->ProjectionY("cacaFull",3*imom,30-3*imom);
0249     hitsFastEta->ProjectionY("cacaFast",3*imom,30-3*imom);
0250 
0251     TH1F* fastP = (TH1F*) gDirectory->Get(titleFast[imom-1]);
0252     TH1F* fullP = (TH1F*) gDirectory->Get(titleFull[imom-1]);
0253     TH1F* fastEta = (TH1F*) gDirectory->Get(titleFast[10-imom]);
0254     TH1F* fullEta = (TH1F*) gDirectory->Get(titleFull[10-imom]);
0255     TH1F* fastEta2 = (TH1F*) gDirectory->Get("cacaFast");
0256     TH1F* fullEta2 = (TH1F*) gDirectory->Get("cacaFull");
0257     fastEta->Add(fastEta2,-1);
0258     fullEta->Add(fullEta2,-1);
0259     
0260     c->cd(imom);
0261     PlotGraphs(fullP,fastP);
0262     c->cd(12-imom);
0263     PlotGraphs(fullEta,fastEta);
0264   }  
0265   
0266 }
0267 
0268 void Layers(unsigned int iter) {
0269   
0270   gROOT->Reset();
0271     TFile *f = new TFile("testTrackingIterations.root");
0272   //TFile *f = new TFile("testTrackingIterations_fullstat.root");
0273   if(f->IsZombie() ) return;
0274   f->cd("DQMData"); 
0275 
0276   std::vector<char *> titleFull;
0277   std::vector<char *> titleFast;
0278   titleFull.push_back("LayersFull_p_0_2");
0279   titleFull.push_back("LayersFull_p_2_4");
0280   titleFull.push_back("LayersFull_p_4_6");
0281   titleFull.push_back("LayersFull_p_6_8");
0282   titleFull.push_back("LayersFull_p_8_10");
0283   titleFull.push_back("LayersFull_Eta_0.0_0.5");
0284   titleFull.push_back("LayersFull_Eta_0.5_1.0");
0285   titleFull.push_back("LayersFull_Eta_1.0_1.5");
0286   titleFull.push_back("LayersFull_Eta_1.5_2.0");
0287   titleFull.push_back("LayersFull_Eta_2.0_2.8");
0288   titleFast.push_back("LayersFast_p_0_2");
0289   titleFast.push_back("LayersFast_p_2_4");
0290   titleFast.push_back("LayersFast_p_4_6");
0291   titleFast.push_back("LayersFast_p_6_8");
0292   titleFast.push_back("LayersFast_p_8_10");
0293   titleFast.push_back("LayersFast_Eta_0.0_0.6");
0294   titleFast.push_back("LayersFast_Eta_0.6_1.2");
0295   titleFast.push_back("LayersFast_Eta_1.2_1.8");
0296   titleFast.push_back("LayersFast_Eta_1.8_2.4");
0297   titleFast.push_back("LayersFast_Eta_2.4_3.0");
0298 
0299   TCanvas *c = new TCanvas("c","",1000, 600);
0300   c->Divide(3,4);
0301   TH2F* layersFullP;
0302   TH2F* layersFastP;
0303   TH2F* layersFullEta;
0304   TH2F* layersFastEta;
0305   if ( iter == 0 ) { 
0306     layersFullP = (TH2F*) gDirectory->Get("Layers0PFull");
0307     layersFastP = (TH2F*) gDirectory->Get("Layers0PFast");
0308     layersFullEta = (TH2F*) gDirectory->Get("Layers0EtaFull");
0309     layersFastEta = (TH2F*) gDirectory->Get("Layers0EtaFast");
0310   } else if ( iter == 1 ) { 
0311     layersFullP = (TH2F*) gDirectory->Get("Layers1PFull");
0312     layersFastP = (TH2F*) gDirectory->Get("Layers1PFast");
0313     layersFullEta = (TH2F*) gDirectory->Get("Layers1EtaFull");
0314     layersFastEta = (TH2F*) gDirectory->Get("Layers1EtaFast");
0315   } else if ( iter == 2 ) { 
0316     layersFullP = (TH2F*) gDirectory->Get("Layers2PFull");
0317     layersFastP = (TH2F*) gDirectory->Get("Layers2PFast");
0318     layersFullEta = (TH2F*) gDirectory->Get("Layers2EtaFull");
0319     layersFastEta = (TH2F*) gDirectory->Get("Layers2EtaFast");
0320   } else if ( iter == 3 ) { 
0321     layersFullP = (TH2F*) gDirectory->Get("Layers3PFull");
0322     layersFastP = (TH2F*) gDirectory->Get("Layers3PFast");
0323     layersFullEta = (TH2F*) gDirectory->Get("Layers3EtaFull");
0324     layersFastEta = (TH2F*) gDirectory->Get("Layers3EtaFast");
0325   } else if ( iter == 4 ) { 
0326     layersFullP = (TH2F*) gDirectory->Get("Layers4PFull");
0327     layersFastP = (TH2F*) gDirectory->Get("Layers4PFast");
0328     layersFullEta = (TH2F*) gDirectory->Get("Layers4EtaFull");
0329     layersFastEta = (TH2F*) gDirectory->Get("Layers4EtaFast");
0330   } else if ( iter == 5 ) { 
0331     layersFullP = (TH2F*) gDirectory->Get("Layers5PFull");
0332     layersFastP = (TH2F*) gDirectory->Get("Layers5PFast");
0333     layersFullEta = (TH2F*) gDirectory->Get("Layers5EtaFull");
0334     layersFastEta = (TH2F*) gDirectory->Get("Layers5EtaFast");
0335   }
0336   for (unsigned imom=1;imom<6;++imom) {  
0337     layersFullP->ProjectionY(titleFull[imom-1],20*(imom-1)+1,20*imom+1);
0338     layersFastP->ProjectionY(titleFast[imom-1],20*(imom-1)+1,20*imom+1);
0339     layersFullEta->ProjectionY(titleFull[10-imom],3*(imom-1),max((unsigned int)28,30-3*(imom-1)));
0340     layersFastEta->ProjectionY(titleFast[10-imom],3*(imom-1),max((unsigned int)28,30-3*(imom-1)));
0341     layersFullEta->ProjectionY("cacaFull",3*imom,30-3*imom);
0342     layersFastEta->ProjectionY("cacaFast",3*imom,30-3*imom);
0343     TH1F* fastP = (TH1F*) gDirectory->Get(titleFast[imom-1]);
0344     ,    TH1F* fullP = (TH1F*) gDirectory->Get(titleFull[imom-1]);
0345     TH1F* fastEta = (TH1F*) gDirectory->Get(titleFast[10-imom]);
0346     TH1F* fullEta = (TH1F*) gDirectory->Get(titleFull[10-imom]);
0347     TH1F* fastEta2 = (TH1F*) gDirectory->Get("cacaFast");
0348     TH1F* fullEta2 = (TH1F*) gDirectory->Get("cacaFull");
0349     fastEta->Add(fastEta2,-1);
0350     fullEta->Add(fullEta2,-1);
0351     
0352     c->cd(imom);
0353     PlotGraphs(fullP,fastP);
0354     c->cd(12-imom);
0355     PlotGraphs(fullEta,fastEta);
0356   }  
0357   
0358 }
0359 
0360 
0361 void Seed(unsigned int iter) {
0362   
0363   gROOT->Reset();
0364     TFile *f = new TFile("testTrackingIterations.root");
0365     //TFile *f = new TFile("testTrackingIterations_fullstat.root");
0366   if(f->IsZombie() ) return;
0367   f->cd("DQMData"); 
0368 
0369   std::vector<char *> titleFull;
0370   std::vector<char *> titleFast;
0371   titleFull.push_back("SeedFull_p_0_2");
0372   titleFull.push_back("SeedFull_p_2_4");
0373   titleFull.push_back("SeedFull_p_4_6");
0374   titleFull.push_back("SeedFull_p_6_8");
0375   titleFull.push_back("SeedFull_p_8_10");
0376   titleFull.push_back("SeedFull_Eta_0.0_0.5");
0377   titleFull.push_back("SeedFull_Eta_0.5_1.0");
0378   titleFull.push_back("SeedFull_Eta_1.0_1.5");
0379   titleFull.push_back("SeedFull_Eta_1.5_2.0");
0380   titleFull.push_back("SeedFull_Eta_2.0_2.8");
0381   titleFast.push_back("SeedFast_p_0_2");
0382   titleFast.push_back("SeedFast_p_2_4");
0383   titleFast.push_back("SeedFast_p_4_6");
0384   titleFast.push_back("SeedFast_p_6_8");
0385   titleFast.push_back("SeedFast_p_8_10");
0386   titleFast.push_back("SeedFast_Eta_0.0_0.6");
0387   titleFast.push_back("SeedFast_Eta_0.6_1.2");
0388   titleFast.push_back("SeedFast_Eta_1.2_1.8");
0389   titleFast.push_back("SeedFast_Eta_1.8_2.4");
0390   titleFast.push_back("SeedFast_Eta_2.4_3.0");
0391 
0392   TCanvas *c = new TCanvas("c","",1000, 600);
0393   c->Divide(3,4);
0394   TH2F* seedFullP;
0395   TH2F* seedFastP;
0396   TH2F* seedFullEta;
0397   TH2F* seedFastEta;
0398   if ( iter == 3 ) { 
0399     seedFullP = (TH2F*) gDirectory->Get("Seed3PFull");
0400     seedFastP = (TH2F*) gDirectory->Get("Seed3PFast");
0401     seedFullEta = (TH2F*) gDirectory->Get("Seed3EtaFull");
0402     seedFastEta = (TH2F*) gDirectory->Get("Seed3EtaFast");
0403   }
0404   else   if ( iter == 5 ) { 
0405     seedFullP = (TH2F*) gDirectory->Get("Seed5PFull");
0406     seedFastP = (TH2F*) gDirectory->Get("Seed5PFast");
0407     seedFullEta = (TH2F*) gDirectory->Get("Seed5EtaFull");
0408     seedFastEta = (TH2F*) gDirectory->Get("Seed5EtaFast");
0409   }
0410   for (unsigned imom=1;imom<6;++imom) {  
0411     seedFullP->ProjectionY(titleFull[imom-1],20*(imom-1)+1,20*imom+1);
0412     seedFastP->ProjectionY(titleFast[imom-1],20*(imom-1)+1,20*imom+1);
0413     seedFullEta->ProjectionY(titleFull[10-imom],3*(imom-1),max((unsigned int)28,30-3*(imom-1)));
0414     seedFastEta->ProjectionY(titleFast[10-imom],3*(imom-1),max((unsigned int)28,30-3*(imom-1)));
0415     seedFullEta->ProjectionY("cacaFull",3*imom,30-3*imom);
0416     seedFastEta->ProjectionY("cacaFast",3*imom,30-3*imom);
0417 
0418     TH1F* fastP = (TH1F*) gDirectory->Get(titleFast[imom-1]);
0419     TH1F* fullP = (TH1F*) gDirectory->Get(titleFull[imom-1]);
0420     TH1F* fastEta = (TH1F*) gDirectory->Get(titleFast[10-imom]);
0421     TH1F* fullEta = (TH1F*) gDirectory->Get(titleFull[10-imom]);
0422     TH1F* fastEta2 = (TH1F*) gDirectory->Get("cacaFast");
0423     TH1F* fullEta2 = (TH1F*) gDirectory->Get("cacaFull");
0424     fastEta->Add(fastEta2,-1);
0425     fullEta->Add(fullEta2,-1);
0426     
0427     c->cd(imom);
0428     PlotGraphs(fullP,fastP);
0429     c->cd(12-imom);
0430     PlotGraphs(fullEta,fastEta);
0431   }  
0432   
0433 }
0434 
0435 
0436 
0437 void totalEfficiency(unsigned int iter) {
0438   
0439   gROOT->Reset();
0440 
0441     TFile *f = new TFile("testTrackingIterations.root");
0442   //TFile *f = new TFile("testTrackingIterations_fullstat.root");
0443   if(f->IsZombie() ) return;
0444   f->cd("DQMData"); 
0445 
0446   TCanvas *c = new TCanvas("c","",1000, 600);
0447   c->Divide(1,2);
0448   TH2F* iter0Fast;
0449   TH2F* iter1Fast;
0450   TH2F* iter2Fast;
0451   TH2F* iter3Fast;
0452   TH2F* iter4Fast;
0453   TH2F* iter5Fast;
0454   TH2F* iter0Full;
0455   TH2F* iter1Full;
0456   TH2F* iter2Full;
0457   TH2F* iter3Full;
0458   TH2F* iter4Full;
0459   TH2F* iter5Full;
0460   TH2F* genPlot;
0461   genPlot = (TH2F*) gDirectory->Get("genEtaP");
0462   iter0Full = (TH2F*) gDirectory->Get("eff0Full");
0463   iter0Fast = (TH2F*) gDirectory->Get("eff0Fast");
0464   iter1Full = (TH2F*) gDirectory->Get("eff1Full");
0465   iter1Fast = (TH2F*) gDirectory->Get("eff1Fast");
0466   iter2Full = (TH2F*) gDirectory->Get("eff2Full");
0467   iter2Fast = (TH2F*) gDirectory->Get("eff2Fast");
0468   iter3Full = (TH2F*) gDirectory->Get("eff3Full");
0469   iter3Fast = (TH2F*) gDirectory->Get("eff3Fast");
0470   iter4Full = (TH2F*) gDirectory->Get("eff4Full");
0471   iter4Fast = (TH2F*) gDirectory->Get("eff4Fast");
0472   iter5Full = (TH2F*) gDirectory->Get("eff5Full");
0473   iter5Fast = (TH2F*) gDirectory->Get("eff5Fast");
0474   
0475   TH1F* fast0;
0476   TH1F* full0;
0477   TH1F* fast1;
0478   TH1F* full1;
0479   TH1F* fast2;
0480   TH1F* full2;
0481   TH1F* fast3;
0482   TH1F* full3;
0483   TH1F* fast4;
0484   TH1F* full4;
0485   TH1F* fast5;
0486   TH1F* full5;
0487   TH1F* gen;
0488   TH1F* fastp0;
0489   TH1F* fullp0;
0490   TH1F* fastp1;
0491   TH1F* fullp1;
0492   TH1F* fastp2;
0493   TH1F* fullp2;
0494   TH1F* fastp3;
0495   TH1F* fullp3;
0496   TH1F* fastp4;
0497   TH1F* fullp4;
0498   TH1F* fastp5;
0499   TH1F* fullp5;
0500   TH1F* genp;
0501   genPlot->ProjectionX();
0502   iter0Full->ProjectionX("iter0Full_px");
0503   iter0Fast->ProjectionX("iter0Fast_px");
0504   iter1Full->ProjectionX("iter1Full_px");
0505   iter1Fast->ProjectionX("iter1Fast_px");
0506   iter2Full->ProjectionX("iter2Full_px");
0507   iter2Fast->ProjectionX("iter2Fast_px");
0508   iter3Full->ProjectionX("iter3Full_px");
0509   iter3Fast->ProjectionX("iter3Fast_px");
0510   iter4Full->ProjectionX("iter4Full_px");
0511   iter4Fast->ProjectionX("iter4Fast_px");
0512   iter5Full->ProjectionX("iter5Full_px");
0513   iter5Fast->ProjectionX("iter5Fast_px");
0514   genPlot->ProjectionY();
0515   iter0Full->ProjectionY("iter0Full_py");
0516   iter0Fast->ProjectionY("iter0Fast_py");
0517   iter1Full->ProjectionY("iter1Full_py");
0518   iter1Fast->ProjectionY("iter1Fast_py");
0519   iter2Full->ProjectionY("iter2Full_py");
0520   iter2Fast->ProjectionY("iter2Fast_py");
0521   iter3Full->ProjectionY("iter3Full_py");
0522   iter3Fast->ProjectionY("iter3Fast_py");
0523   iter4Full->ProjectionY("iter4Full_py");
0524   iter4Fast->ProjectionY("iter4Fast_py");
0525   iter5Full->ProjectionY("iter5Full_py");
0526   iter5Fast->ProjectionY("iter5Fast_py");
0527   fast0  = (TH1F*) gDirectory->Get("iter0Fast_px");
0528   full0  = (TH1F*) gDirectory->Get("iter0Full_px");
0529   fastp0 = (TH1F*) gDirectory->Get("iter0Fast_py");
0530   fullp0 = (TH1F*) gDirectory->Get("iter0Full_py");
0531   fast1  = (TH1F*) gDirectory->Get("iter1Fast_px");
0532   full1  = (TH1F*) gDirectory->Get("iter1Full_px");
0533   fastp1 = (TH1F*) gDirectory->Get("iter1Fast_py");
0534   fullp1 = (TH1F*) gDirectory->Get("iter1Full_py");
0535   fast2  = (TH1F*) gDirectory->Get("iter2Fast_px");
0536   full2  = (TH1F*) gDirectory->Get("iter2Full_px");
0537   fastp2 = (TH1F*) gDirectory->Get("iter2Fast_py");
0538   fullp2 = (TH1F*) gDirectory->Get("iter2Full_py");
0539   fast3  = (TH1F*) gDirectory->Get("iter3Fast_px");
0540   full3  = (TH1F*) gDirectory->Get("iter3Full_px");
0541   fastp3 = (TH1F*) gDirectory->Get("iter3Fast_py");
0542   fullp3 = (TH1F*) gDirectory->Get("iter3Full_py");
0543   fast4  = (TH1F*) gDirectory->Get("iter4Fast_px");
0544   full4  = (TH1F*) gDirectory->Get("iter4Full_px");
0545   fastp4 = (TH1F*) gDirectory->Get("iter4Fast_py");
0546   fullp4 = (TH1F*) gDirectory->Get("iter4Full_py");
0547   fast5  = (TH1F*) gDirectory->Get("iter5Fast_px");
0548   full5  = (TH1F*) gDirectory->Get("iter5Full_px");
0549   fastp5 = (TH1F*) gDirectory->Get("iter5Fast_py");
0550   fullp5 = (TH1F*) gDirectory->Get("iter5Full_py");
0551   gen = (TH1F*) gDirectory->Get("genEtaP_px");
0552   genp = (TH1F*) gDirectory->Get("genEtaP_py");
0553 
0554   if ( iter == 0 ) fast1 = fast0;
0555   if ( iter == 2 ) fast1 = fast2;
0556   if ( iter == 3 ) fast1 = fast3;
0557   if ( iter == 4 ) fast1 = fast4;
0558   if ( iter == 5 ) fast1 = fast5;
0559   if ( iter > 11 ) fast1->Add(fast2);
0560   if ( iter > 12 ) fast1->Add(fast3);
0561   fast1->Divide(gen);
0562   if ( iter == 0 ) full1 = full0;
0563   if ( iter == 2 ) full1 = full2;
0564   if ( iter == 3 ) full1 = full3;
0565   if ( iter == 4 ) full1 = full4;
0566   if ( iter == 5 ) full1 = full5;
0567   if ( iter > 11 ) full1->Add(full2);
0568   if ( iter > 12 ) full1->Add(full3);
0569   full1->Divide(gen);
0570   c->cd(1);
0571   PlotGraphs(full1,fast1);
0572 
0573   if ( iter == 0 ) fastp1 = fastp0;
0574   if ( iter == 2 ) fastp1 = fastp2;
0575   if ( iter == 3 ) fastp1 = fastp3;
0576   if ( iter == 4 ) fastp1 = fastp4;
0577   if ( iter == 5 ) fastp1 = fastp5;
0578   if ( iter > 11 ) fastp1->Add(fastp2);
0579   if ( iter > 12 ) fastp1->Add(fastp3);
0580   fastp1->Divide(genp);
0581   if ( iter == 0 ) fullp1 = fullp0;
0582   if ( iter == 2 ) fullp1 = fullp2;
0583   if ( iter == 3 ) fullp1 = fullp3;
0584   if ( iter == 4 ) fullp1 = fullp4;
0585   if ( iter == 5 ) fullp1 = fullp5;
0586   if ( iter > 11 ) fullp1->Add(fullp2);
0587   if ( iter > 12 ) fullp1->Add(fullp3);
0588   fullp1->Divide(genp);
0589   c->cd(2);
0590   PlotGraphs(fullp1,fastp1);
0591 
0592 }
0593 
0594 void SimTracks() {
0595   
0596   gROOT->Reset();
0597   TFile *f = new TFile("testTrackingIterations.root");
0598   //  TFile *f = new TFile("testTrackingIterations_fullstat.root");
0599   if(f->IsZombie() ) return;
0600   f->cd("DQMData"); 
0601 
0602   std::vector<char *> titleFull;
0603   std::vector<char *> titleFast;
0604   titleFull.push_back("eff1Full_p_0_1");
0605   titleFull.push_back("eff1Full_p_1_2");
0606   titleFull.push_back("eff1Full_p_2_3");
0607   titleFull.push_back("eff1Full_p_3_4");
0608   titleFull.push_back("eff1Full_p_4_5");
0609   titleFull.push_back("eff1Full_p_5_6");
0610   titleFull.push_back("eff1Full_p_6_7");
0611   titleFull.push_back("eff1Full_p_7_8");
0612   titleFull.push_back("eff1Full_p_8_9");
0613   titleFull.push_back("eff1Full_p_9_10");
0614   titleFast.push_back("eff1Fast_p_0_1");
0615   titleFast.push_back("eff1Fast_p_1_2");
0616   titleFast.push_back("eff1Fast_p_2_3");
0617   titleFast.push_back("eff1Fast_p_3_4");
0618   titleFast.push_back("eff1Fast_p_4_5");
0619   titleFast.push_back("eff1Fast_p_5_6");
0620   titleFast.push_back("eff1Fast_p_6_7");
0621   titleFast.push_back("eff1Fast_p_7_8");
0622   titleFast.push_back("eff1Fast_p_8_9");
0623   titleFast.push_back("eff1Fast_p_9_10");
0624 
0625   TCanvas *c = new TCanvas("c","",1000, 600);
0626   c->Divide(3,4);
0627   TH2F* effFull;
0628   TH2F* effFast;
0629   effFull = (TH2F*) gDirectory->Get("SimFull");
0630   effFast = (TH2F*) gDirectory->Get("SimFast");
0631   
0632   for (unsigned imom=1;imom<11;++imom) {  
0633     effFull->ProjectionX(titleFull[imom-1],10*(imom-1)+1,10*imom+1);
0634     effFast->ProjectionX(titleFast[imom-1],10*(imom-1)+1,10*imom+1);
0635     TH1F* fast = (TH1F*) gDirectory->Get(titleFast[imom-1]);
0636     TH1F* full = (TH1F*) gDirectory->Get(titleFull[imom-1]);
0637     c->cd(imom);
0638     PlotGraphs(full,fast);
0639   }  
0640 
0641   
0642   TH1F* fast;
0643   TH1F* full;
0644   TH1F* fastp;
0645   TH1F* fullp;
0646   effFull->ProjectionX();
0647   effFast->ProjectionX();
0648   effFull->ProjectionY();
0649   effFast->ProjectionY();
0650   
0651   fast = (TH1F*) gDirectory->Get("SimFast_px");
0652   full = (TH1F*) gDirectory->Get("SimFull_px");
0653   fastp = (TH1F*) gDirectory->Get("SimFast_py");
0654   fullp = (TH1F*) gDirectory->Get("SimFull_py");
0655   
0656   c->cd(11);
0657   PlotGraphs(full,fast);
0658   
0659   c->cd(12);
0660   PlotGraphs(fullp,fastp);
0661 
0662 }