////////////////////////////////////////////////////////// // This class has been automatically generated on // Mon Nov 16 19:45:31 2020 by ROOT version 6.16/00 // from TTree MONTECARLO/MonteCarloEvent // found on file: MC_058887_mupage.root ////////////////////////////////////////////////////////// #ifndef analyse_h #define analyse_h #include #include #include #include #include #include "Track.h" #include "Vec3D.h" // Header file for the classes stored in the TTree if any. class analyse { public : // TFile *f = new TFile("analyse.root", "RECREATE"); 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. static constexpr Int_t kMaxeventNumber = 1; static constexpr Int_t kMaxeventType = 1; static constexpr Int_t kMaxneutrino = 1; static constexpr Int_t kMaxprimary = 1; static constexpr Int_t kMaxsecondary = 1; static constexpr Int_t kMaxearthmuon = 1; static constexpr Int_t kMaxearthlepton = 1; static constexpr Int_t kMaxseamuon = 1; static constexpr Int_t kMaxTrackList = 1; static constexpr Int_t kMaxHitList = 1; static constexpr Int_t kMaxRawHitList = 1; static constexpr Int_t kMaxW2list = 1; static constexpr Int_t kMaxWeights = 1; static constexpr Int_t kMaxW3list = 1; static constexpr Int_t kMaxeventTime = 1; static constexpr Int_t kMaxhasNeutrino = 1; static constexpr Int_t kMaxhasPrimary = 1; // Declaration of leaf types //Event *MONTECARLO; Int_t eventNumber_; Int_t eventType_; //Neutrino neutrino_; //Primary primary_; //vector secondary_; //vector earthmuon_; //vector earthlepton_; //vector seamuon_; //vector TrackList_; //std::vector HitList_; // Hit HitList_; //vector RawHitList_; vector W2list_; vector Weights_; vector W3list_; Double_t eventTime_; Bool_t hasNeutrino_; Bool_t hasPrimary_; map umap; // List of branches TBranch *b_MONTECARLO_eventNumber_; //! TBranch *b_MONTECARLO_eventType_; //! TBranch *b_MONTECARLO_W2list_; //! TBranch *b_MONTECARLO_Weights_; //! TBranch *b_MONTECARLO_W3list_; //! TBranch *b_MONTECARLO_eventTime_; //! TBranch *b_MONTECARLO_hasNeutrino_; //! TBranch *b_MONTECARLO_hasPrimary_; //! TBranch *b_MONTECARLO_umap; //! analyse(TTree *tree=0); virtual ~analyse(); 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 analyse_cxx analyse::analyse(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("MC_058887_mupage.root"); TFile *f = new TFile("analyse.root", "RECREATE"); TTree *ana = new TTree("MONTECARLO","MONTECARLO") ; if (!f || !f->IsOpen()) { //f = new TFile("MC_058887_mupage.root"); f = new TFile("analyse.root"); } tree=ana; f->GetObject("MONTECARLO",tree); // tree->Write(); it create the tree ->this importante*/ //f->Write(); } Init(tree); } analyse::~analyse() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t analyse::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t analyse::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 analyse::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->Branch("eventNumber_", &eventNumber_, "&b_MONTECARLO_eventNumber_"); fChain->Branch("eventType_", &eventType_, "&b_MONTECARLO_eventType_"); fChain->Branch("W2list_", &W2list_, "&b_MONTECARLO_W2list_"); fChain->Branch("Weights_", &Weights_, "&b_MONTECARLO_Weights_"); fChain->Branch("W3list_", &W3list_, "&b_MONTECARLO_W3list_"); fChain->Branch("eventTime_", &eventTime_, "&b_MONTECARLO_eventTime_"); fChain->Branch("hasNeutrino_", &hasNeutrino_, "&b_MONTECARLO_hasNeutrino_"); fChain->Branch("hasPrimary_", &hasPrimary_, "&b_MONTECARLO_hasPrimary_"); fChain->Branch("umap", &umap, "&b_MONTECARLO_umap"); fChain->Branch("TrackList_", &TrackList_);/**********this is *****/ Notify(); fChain->Write();/*add by me */ } Bool_t analyse::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. //f->Write();/*5*/ return kTRUE; } void analyse::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t analyse::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } //f->Write(); #endif // #ifdef analyse_cxx