/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Validation/ValidRecMucTrack/ValidRecMucTrack-00-00-02/share/FillMucHisto.C

Go to the documentation of this file.
00001 void FillMucHisto(char *filename="MucValidNTuple.root"){
00002 
00003   TFile *fin = new TFile(filename,"READ");
00004   TTree *T = (TTree *)fin->Get("T");
00005 
00006   double depth, distance, deltaPhi, chi2;
00007   double maxHits, numLayers, numHits;
00008   double xPos, yPos, zPos;
00009 
00010   T->SetBranchAddress("depth",   &depth);
00011   T->SetBranchAddress("distance",&distance);
00012   T->SetBranchAddress("deltaPhi",&deltaPhi);
00013   T->SetBranchAddress("chi2",    &chi2);
00014   T->SetBranchAddress("maxHits", &maxHits);
00015   T->SetBranchAddress("numLayers",&numLayers);
00016   T->SetBranchAddress("numHits", &numHits);
00017   T->SetBranchAddress("xPos",    &xPos);
00018   T->SetBranchAddress("yPos",    &yPos);
00019   T->SetBranchAddress("zPos",    &zPos);
00020 
00021   TFile *fout    = new TFile("MucValidHist.root","recreate");
00022 
00023   TH1F *Depth    = new TH1F("Depth","penetrating depth",100,0,80);
00024   TH1F *Distance = new TH1F("Distance","distance match", 100, -20,20);
00025   TH1F *DeltaPhi = new TH1F("DeltaPhi","delta phi",100, 0, 3.14);
00026   TH1F *Chi2     = new TH1F("Chi2","Chi2",100,0,10);
00027   TH1F *MaxHits  = new TH1F("MaxHits","MaxHits",10,0,10);
00028   TH1F *NumLayers= new TH1F("NumLayers","NumLayers",10,0,10);
00029   TH1F *NumHits  = new TH1F("NumHits","NumHits",15,0,15);
00030   TH1F *XPos     = new TH1F("XPos","XPos",100,-300,300);
00031   TH1F *YPos     = new TH1F("YPos","YPos",100,-300,300);
00032   TH1F *ZPos     = new TH1F("ZPos","ZPos",100,-300,300);
00033 
00034 
00035   for(int i = 0; i < T->GetEntries(); i++){
00036   
00037     T->GetEntry(i);
00038     Depth->Fill(depth);
00039     Distance->Fill(distance);
00040     DeltaPhi->Fill(deltaPhi);
00041     Chi2->Fill(chi2);
00042     MaxHits->Fill(maxHits);
00043     NumLayers->Fill(numLayers);
00044     NumHits->Fill(numHits);
00045     XPos->Fill(xPos);
00046     YPos->Fill(yPos);
00047     ZPos->Fill(zPos);
00048 
00049   }
00050 
00051   Depth->Write();
00052   Distance->Write();
00053   DeltaPhi->Write();
00054   Chi2->Write();
00055   MaxHits->Write();
00056   NumLayers->Write();
00057   NumHits->Write();
00058   XPos->Write();
00059   YPos->Write();
00060   ZPos->Write();
00061 
00062   fin->Close();
00063   fout->Close();
00064 
00065 }

Generated on Tue Nov 29 23:14:46 2016 for BOSS_7.0.2 by  doxygen 1.4.7