////////////////////////////////////////////////////////// // 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 analyse2_h #define analyse2_h #include #include #include #include #include //#include "Hit.h" //#include "Neutrino.h" //#include "Track.h" //#include "Vec3D.h" //#include "direction_cosines.h" // Header file for the classes stored in the TTree if any. /*class Neutrino { public: double bx_; // double by_; ///< bjorken x and y int ichan_; ///< interaction chanel int type_; ///< particle type (jetset convention) int cc_; }neutrino_; class Hit { public: // Data Members. int type_; ///< geant code of the origin track (k40=-1) unsigned int origin_; ///< track number that produces that hit (K40=0) double pure_dt_; ///< unsmeared time double pure_npe_; ///< unsmeard amplitude unsigned int ident_; ///< hit id unsigned int pm_id_; ///< ident of the pm that gave the Hit double dt_; ///< delta time refered to some event double npe_; }*HitList_;*/ /*class Track { public: unsigned int id_; ///< Unique identifier double E_; ///< Energy double t_; ///< time o bool valid_; ///< Boolean to ev. //Vec3D position_; }TrackList_;*/ class analyse2 { 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; //! analyse2(TTree *tree=0); virtual ~analyse2(); 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(); //f1 virtual Bool_t Notify(); virtual void Show(Long64_t entry = -1); }; #endif #ifdef analyse2_cxx analyse2::analyse2(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") ; // TTree *H2 = new TTree("PHYSICS","PHYSICS") ; 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); } analyse2::~analyse2() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t analyse2::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t analyse2::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(); //f1 Notify(); } return centry; } void analyse2::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("HitList_", &HitList_); // fChain->Branch("neutrino_", &neutrino_); //fChain->Branch("TrackList_", &TrackList_, 32000,99); // TBranch *b = // fChain->Branch("neutrino_", &neutrino_); //TBranch *b = fChain->Branch("TrackList_", &TrackList_); //N->fChain->Branch("Vec3D", &Vec3D_); //TBranch *b = fChain->Branch("neutrino_", &neutrino_); // TLeaf *TL = b->GetLeaf("MyLeaf"); //fChain->GetLeaf("neutrino_","MyLeaf"); //f1 Notify(); fChain->Write();/*add by me */ } /*f1 Bool_t analyse2::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 analyse2::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t analyse2::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef analyse_cxx