////////////////////////////////////////////////////////// // This class has been automatically generated on // Thu Jun 25 17:48:07 2020 by ROOT version 6.20/04 // from TTree B1Volume1/Volume 1 // found on file: /home/o/Otto.Schaile/myroot/proj3d/B1_1.root ////////////////////////////////////////////////////////// #ifndef B1Volume1_h #define B1Volume1_h #include #include #include // OS #include // Header file for the classes stored in the TTree if any. class B1Volume1 { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Fixed size dimensions of array or collections stored in the TTree if any. // Declaration of leaf types Double_t ParticleID; Double_t kinEnergy; Double_t MomentumDirection_x; Double_t MomentumDirection_y; Double_t MomentumDirection_z; Double_t PositionDirection_x; Double_t PositionDirection_y; Double_t PositionDirection_z; Double_t EndStepPos_x; Double_t EndStepPos_y; Double_t EndStepPos_z; Double_t ReleasedEnergy; // List of branches TBranch *b_ParticleID; //! TBranch *b_kinEnergy; //! TBranch *b_MomentumDirection_x; //! TBranch *b_MomentumDirection_y; //! TBranch *b_MomentumDirection_z; //! TBranch *b_PositionDirection_x; //! TBranch *b_PositionDirection_y; //! TBranch *b_PositionDirection_z; //! TBranch *b_EndStepPos_x; //! TBranch *b_EndStepPos_y; //! TBranch *b_EndStepPos_z; //! TBranch *b_ReleasedEnergy; //! // OS TH3F *fH3; TFile *fOut; B1Volume1(TTree *tree=0); virtual ~B1Volume1(); virtual Int_t Cut(Long64_t entry); virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Init(TTree *tree); virtual void Loop(); virtual Bool_t Notify(); virtual void Show(Long64_t entry = -1); }; #endif #ifdef B1Volume1_cxx B1Volume1::B1Volume1(TTree *tree) : fChain(0) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == 0) { TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("/home/o/Otto.Schaile/myroot/proj3d/B1_1.root"); if (!f || !f->IsOpen()) { f = new TFile("/home/o/Otto.Schaile/myroot/proj3d/B1_1.root"); } f->GetObject("B1Volume1",tree); } Init(tree); } B1Volume1::~B1Volume1() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t B1Volume1::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t B1Volume1::LoadTree(Long64_t entry) { // Set the environment to read one entry if (!fChain) return -5; Long64_t centry = fChain->LoadTree(entry); if (centry < 0) return centry; if (fChain->GetTreeNumber() != fCurrent) { fCurrent = fChain->GetTreeNumber(); Notify(); } return centry; } void B1Volume1::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; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("ParticleID", &ParticleID, &b_ParticleID); fChain->SetBranchAddress("kinEnergy", &kinEnergy, &b_kinEnergy); fChain->SetBranchAddress("MomentumDirection.x", &MomentumDirection_x, &b_MomentumDirection_x); fChain->SetBranchAddress("MomentumDirection.y", &MomentumDirection_y, &b_MomentumDirection_y); fChain->SetBranchAddress("MomentumDirection.z", &MomentumDirection_z, &b_MomentumDirection_z); fChain->SetBranchAddress("PositionDirection.x", &PositionDirection_x, &b_PositionDirection_x); fChain->SetBranchAddress("PositionDirection.y", &PositionDirection_y, &b_PositionDirection_y); fChain->SetBranchAddress("PositionDirection.z", &PositionDirection_z, &b_PositionDirection_z); fChain->SetBranchAddress("EndStepPos.x", &EndStepPos_x, &b_EndStepPos_x); fChain->SetBranchAddress("EndStepPos.y", &EndStepPos_y, &b_EndStepPos_y); fChain->SetBranchAddress("EndStepPos.z", &EndStepPos_z, &b_EndStepPos_z); fChain->SetBranchAddress("ReleasedEnergy", &ReleasedEnergy, &b_ReleasedEnergy); Notify(); // OS fOut = new TFile("B1Volume1_out.root", "RECREATE"); fH3 = new TH3F("h3DHit", "h3DHit", 40, -5., 5.,40, -5.,5.,40,-5,5.); } Bool_t B1Volume1::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; } void B1Volume1::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t B1Volume1::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef B1Volume1_cxx