source: GLBFrejus/HEAD/run/TDSyst.C@ 2

Last change on this file since 2 was 2, checked in by campagne, 20 years ago

first import

File size: 1.8 KB
RevLine 
[2]1#define TDSyst_cxx
2#include "TDSyst.h"
3#include <TH2D.h>
4#include <TStyle.h>
5#include <TCanvas.h>
6#include <TGraph.h>
7
8#include <iostream>
9
10void TDSyst::Loop()
11{
12// In a ROOT session, you can do:
13// Root > .L TDSyst.C
14// Root > TDSyst t
15// Root > t.GetEntry(12); // Fill t data members with entry number 12
16// Root > t.Show(); // Show values of entry 12
17// Root > t.Show(16); // Read and show values of entry 16
18// Root > t.Loop(); // Loop on all entries
19//
20
21// This is the loop skeleton where:
22// jentry is the global entry number in the chain
23// ientry is the entry number in the current Tree
24// Note that the argument to GetEntry must be:
25// jentry for TChain::GetEntry
26// ientry for TTree::GetEntry and TBranch::GetEntry
27//
28// To read only selected branches, Insert statements like:
29// METHOD1:
30// fChain->SetBranchStatus("*",0); // disable all branches
31// fChain->SetBranchStatus("branchname",1); // activate branchname
32// METHOD2: replace line
33// fChain->GetEntry(jentry); //read all branches
34//by b_branchname->GetEntry(ientry); //read only this branch
35 if (fChain == 0) return;
36
37 const Double_t PI = TMath::Pi();
38
39
40 Long64_t nentries = fChain->GetEntriesFast();
41
42 Double_t sin2Cur = -999.;
43 Double_t deltaCur = -999.;
44
45 Int_t nbytes = 0, nb = 0;
46 for (Long64_t jentry=0; jentry<nentries;jentry++) {
47 Long64_t ientry = LoadTree(jentry);
48 if (ientry < 0) break;
49 nb = fChain->GetEntry(jentry); nbytes += nb;
50 // if (Cut(ientry) < 0) continue;
51 sin2Cur = TMath::Power(TMath::Sin(2.0 * theta13),2.0);
52 deltaCur= deltaCP/PI*180.0;
53
54// std::cout << deltaCur << " " << TMath::Log10(sin2Cur)
55// << ": chi2 " << chi2
56// << std::endl;
57 histo->Fill(deltaCur,TMath::Log10(sin2Cur),chi2);
58 }
59}//Loop
60
Note: See TracBrowser for help on using the repository browser.