/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Validation/ValidRecTofTrack/ValidRecTofTrack-00-00-01/share/FillTofHisto.C

Go to the documentation of this file.
00001 void FillTofHisto(char *filename="TofValidNTuple.root"){
00002 
00003   TFile *fin = new TFile(filename,"READ");
00004   TTree *T = (TTree *)fin->Get("tof");
00005 
00006   double run, event, toftrk, trk, tofid;
00007   double status, raw, readout, counter, cluster;
00008   double barrel, east, layer, ncounter, neast, nwest;
00009   double path, zrhit, ph, tof, etof, beta;
00010   double texpe, texpmu, texppi, texpk, texpp;
00011   double toffe, toffmu, toffpi, toffk, toffp, toffpb;
00012   double sige, sigmu, sigpi, sigk, sigp, sigpb;
00013   double qual;
00014   double t0, errt0, errz, phi, errphi, energy, errenergy;
00015 
00016   T->SetBranchAddress("barrel",  &barrel  );
00017   T->SetBranchAddress("counter", &counter );
00018   T->SetBranchAddress("layer",   &layer   );
00019   T->SetBranchAddress("path",    &path    );
00020   T->SetBranchAddress("zrhit",   &zrhit   );
00021   T->SetBranchAddress("ph",      &ph      );
00022   T->SetBranchAddress("tof",     &tof     );
00023   T->SetBranchAddress("beta",    &beta    );
00024   T->SetBranchAddress("texpe",   &texpe   );
00025   T->SetBranchAddress("toffe",   &toffe   );
00026   T->SetBranchAddress("sige",    &sige    );
00027   T->SetBranchAddress("qual",    &qual    );
00028 
00029   TFile *fout = new TFile("TofValidHist.root","recreate");
00030 
00031   TH1F *Path1 = new TH1F("Path1", "path of inner layer", 100, 85.0, 185.0);
00032   TH1F *Path2 = new TH1F("Path2", "path of outer layer", 100, 85.0, 185.0);
00033   TH1F *PathE = new TH1F("Path",  "path of endcap", 80, 105.0, 185.0);
00034   TH1F *Z1    = new TH1F("Z1", "z of inner barrel", 115, -115.0, 115.0);
00035   TH1F *Z2    = new TH1F("Z2", "z of outer barrel", 115, -115.0, 115.0);
00036   TH1F *R     = new TH1F("R",  "R of endcap", 50, 80.0, 90.0);
00037   TH1F *Ph1   = new TH1F("Ph1", "pulse height of inner", 250, 0.0, 2500.0);
00038   TH1F *Ph2   = new TH1F("Ph2", "pulse height of outer", 250, 0.0, 2500.0);
00039   TH1F *PhE   = new TH1F("PhE", "pulse height of endcap", 250, 0.0, 2500.0);
00040   TH1F *Tof1  = new TH1F("Tof1", "tof of inner", 25, 0.0, 25.0);
00041   TH1F *Tof2  = new TH1F("Tof2", "tof of outer", 25, 0.0, 25.0);
00042   TH1F *TofE  = new TH1F("TofE", "tof of endcap", 25, 0.0, 25.0);
00043   TH1F *Qual  = new TH1F("Qual", "quality", 12, -1.0, 11.0);
00044 
00045 
00046   for(int i = 0; i < T->GetEntries(); i++){
00047   
00048     T->GetEntry(i);
00049     if( abs(counter-1.0)<0.1 ) {
00050       if( abs(barrel-1.0)<0.1 ) {
00051         if( abs(layer-1.0)<0.1 ) {
00052           Path1->Fill(path);
00053           Z1->Fill(zrhit);
00054           Ph1->Fill(ph);
00055           Tof1->Fill(tof);
00056         }
00057         else if( abs(layer-2.0)<0.1 ) {
00058           Path2->Fill(path);
00059           Z2->Fill(zrhit);
00060           Ph2->Fill(ph);
00061           Tof2->Fill(tof);
00062         }
00063       }
00064       else {
00065         PathE->Fill(path);
00066         R->Fill(zrhit);
00067         PhE->Fill(ph);
00068         TofE->Fill(tof);
00069       }
00070 
00071       Qual->Fill(qual);
00072     }
00073 
00074   }
00075 
00076   Path1->Write();
00077   Path2->Write();
00078   PathE->Write();
00079   Z1->Write();
00080   Z2->Write();
00081   R->Write();
00082   Ph1->Write();
00083   Ph2->Write();
00084   PhE->Write();
00085   Tof1->Write();
00086   Tof2->Write();
00087   TofE->Write();
00088   Qual->Write();
00089 
00090   fin->Close();
00091   fout->Close();
00092 
00093 }

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