////////////////////////////////////////////////////////// // This class has been automatically generated on // Fri May 10 11:32:20 2013 by ROOT version 5.32/02 // from TTree BCAL_shower_info/BCAL shower info // found on file: bigsample.smeared.bcal_tree.root ////////////////////////////////////////////////////////// #ifndef BCAL_shower_info_h #define BCAL_shower_info_h #include #include #include #include #include #include #include #include #include #include #include #include #include // Header file for the classes stored in the TTree if any. // Fixed size dimensions of array or collections stored in the TTree if any. class BCAL_shower_info : public TSelector { public : TTree *fChain; //!pointer to the analyzed TTree or TChain // Declaration of leaf types Float_t E_thrown; Float_t phi_thrown; Float_t theta_thrown; Float_t z_entry_thrown; Float_t vertex_z_thrown; Int_t nShowers; Bool_t match; Float_t matched_z_entry; Float_t matched_E_raw; Float_t matched_E; Float_t matched_sig_E; Float_t matched_t0; Float_t matched_sig_t; Float_t matched_x; Float_t matched_y; Float_t matched_z; Float_t matched_phi; Float_t matched_sig_phi; Float_t matched_theta; Float_t matched_sig_theta; Int_t matched_nCells; Bool_t no_conversions; Bool_t no_conversions_incident_particle; Int_t nPoints; Float_t E_truthcell[40]; //[nPoints] Float_t t_truthcell[40]; //[nPoints] Float_t z_truthcell[40]; //[nPoints] Float_t E_point[40]; //[nPoints] Float_t t_point[40]; //[nPoints] Float_t z_point[40]; //[nPoints] Float_t E_hit_up[40]; //[nPoints] Float_t E_hit_down[40]; //[nPoints] // List of branches TBranch *b_E_thrown; //! TBranch *b_phi_thrown; //! TBranch *b_theta_thrown; //! TBranch *b_z_entry_thrown; //! TBranch *b_vertex_z_thrown; //! TBranch *b_nShowers; //! TBranch *b_match; //! TBranch *b_matched_z_entry; //! TBranch *b_matched_E_raw; //! TBranch *b_matched_E; //! TBranch *b_matched_sig_E; //! TBranch *b_matched_t0; //! TBranch *b_matched_sig_t; //! TBranch *b_matched_x; //! TBranch *b_matched_y; //! TBranch *b_matched_z; //! TBranch *b_matched_phi; //! TBranch *b_matched_sig_phi; //! TBranch *b_matched_theta; //! TBranch *b_matched_sig_theta; //! TBranch *b_matched_nCells; //! TBranch *b_no_conversions; //! TBranch *b_no_conversions_incident_particle; //! TBranch *b_nPoints; //! TBranch *b_E_truthcell; //! TBranch *b_t_truthcell; //! TBranch *b_z_truthcell; //! TBranch *b_E_point; //! TBranch *b_t_point; //! TBranch *b_z_point; //! TBranch *b_E_hit_up; //! TBranch *b_E_hit_down; //! BCAL_shower_info(TTree * /*tree*/ =0) : fChain(0) { } virtual ~BCAL_shower_info() { } virtual Int_t Version() const { return 2; } virtual void Begin(TTree *tree); virtual void SlaveBegin(TTree *tree); virtual void Init(TTree *tree); virtual Bool_t Notify(); virtual Bool_t Process(Long64_t entry); virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; } virtual void SetOption(const char *option) { fOption = option; } virtual void SetObject(TObject *obj) { fObject = obj; } virtual void SetInputList(TList *input) { fInput = input; } virtual TList *GetOutputList() const { return fOutput; } virtual void SlaveTerminate(); virtual void Terminate(); ClassDef(BCAL_shower_info,0); //my stuff //static const int n_energies=11; static const int n_energies=9; static const int n_z_bins=40; TH1I *n_showers_hist[n_energies][n_z_bins]; TH1F *z_error_hist[n_energies][n_z_bins]; TH1F *E_match_hist[n_energies][n_z_bins]; TH1F *ratio_raw_thrown[n_energies][n_z_bins]; //count how many events have exactly one shower/event and >=1 shower/event int count_eq_one[n_energies][n_z_bins]; int count_gteq_one[n_energies][n_z_bins]; int count_eq_one_no_conversions[n_energies][n_z_bins]; int count_gteq_one_no_conversions[n_energies][n_z_bins]; //count # of conversions int count_conversions[n_energies][n_z_bins]; //total events in each bin int count_total[n_energies][n_z_bins]; int count_match[n_energies][n_z_bins]; //events with matching photn int count_match_no_conversions[n_energies][n_z_bins]; TH2F *n_showers_mean_hist; TH2F *gteq_one_hist; //1-(eq_one/gteq_one) TH2F *excess_showers_hist; TH2F *match_hist; TH2F *gteq_one_no_conversions_hist; TH2F *excess_showers_no_conversions_hist; TH2F *match_no_conversions_hist; TH2F *conversions_hist; }; #endif #ifdef BCAL_shower_info_cxx void BCAL_shower_info::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses and branch // pointers of the tree will be set. // It is normally not necessary to make changes to the generated // code, but the routine can be extended by the user if needed. // Init() will be called many times when running on PROOF // (once per file to be processed). // Set branch addresses and branch pointers if (!tree) return; fChain = tree; fChain->SetMakeClass(1); fChain->SetBranchAddress("E_thrown", &E_thrown, &b_E_thrown); fChain->SetBranchAddress("phi_thrown", &phi_thrown, &b_phi_thrown); fChain->SetBranchAddress("theta_thrown", &theta_thrown, &b_theta_thrown); fChain->SetBranchAddress("z_entry_thrown", &z_entry_thrown, &b_z_entry_thrown); fChain->SetBranchAddress("vertex_z_thrown", &vertex_z_thrown, &b_vertex_z_thrown); fChain->SetBranchAddress("nShowers", &nShowers, &b_nShowers); fChain->SetBranchAddress("match", &match, &b_match); fChain->SetBranchAddress("matched_z_entry", &matched_z_entry, &b_matched_z_entry); fChain->SetBranchAddress("matched_E_raw", &matched_E_raw, &b_matched_E_raw); fChain->SetBranchAddress("matched_E", &matched_E, &b_matched_E); fChain->SetBranchAddress("matched_sig_E", &matched_sig_E, &b_matched_sig_E); fChain->SetBranchAddress("matched_t0", &matched_t0, &b_matched_t0); fChain->SetBranchAddress("matched_sig_t", &matched_sig_t, &b_matched_sig_t); fChain->SetBranchAddress("matched_x", &matched_x, &b_matched_x); fChain->SetBranchAddress("matched_y", &matched_y, &b_matched_y); fChain->SetBranchAddress("matched_z", &matched_z, &b_matched_z); fChain->SetBranchAddress("matched_phi", &matched_phi, &b_matched_phi); fChain->SetBranchAddress("matched_sig_phi", &matched_sig_phi, &b_matched_sig_phi); fChain->SetBranchAddress("matched_theta", &matched_theta, &b_matched_theta); fChain->SetBranchAddress("matched_sig_theta", &matched_sig_theta, &b_matched_sig_theta); fChain->SetBranchAddress("matched_nCells", &matched_nCells, &b_matched_nCells); fChain->SetBranchAddress("no_conversions", &no_conversions, &b_no_conversions); fChain->SetBranchAddress("no_conversions_incident_particle", &no_conversions_incident_particle, &b_no_conversions_incident_particle); fChain->SetBranchAddress("nPoints", &nPoints, &b_nPoints); fChain->SetBranchAddress("E_truthcell", E_truthcell, &b_E_truthcell); fChain->SetBranchAddress("t_truthcell", t_truthcell, &b_t_truthcell); fChain->SetBranchAddress("z_truthcell", z_truthcell, &b_z_truthcell); fChain->SetBranchAddress("E_point", E_point, &b_E_point); fChain->SetBranchAddress("t_point", t_point, &b_t_point); fChain->SetBranchAddress("z_point", z_point, &b_z_point); fChain->SetBranchAddress("E_hit_up", E_hit_up, &b_E_hit_up); fChain->SetBranchAddress("E_hit_down", E_hit_down, &b_E_hit_down); } Bool_t BCAL_shower_info::Notify() { // The Notify() function is called when a new file is opened. This // can be either for a new TTree in a TChain or when when a new TTree // is started when using PROOF. It is normally not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. The return value is currently not used. return kTRUE; } #endif // #ifdef BCAL_shower_info_cxx