//Nella release 4 ci sono i TGraph e i fit sui TGraph. Ho perso così l'info in Z che avevo. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // ADD HEADER FILE HERE using namespace std; void example(TString dir, TString flist, TString treelist="+ALL"){ PamLevel2 *pam_event = new PamLevel2(dir,flist); // << create pamela event TChain *T = pam_event->GetPamTree(); CaloNuclei *cn = new CaloNuclei(pam_event); // CREATE CaloNuclei OBJECT GIVING PamLevel2 POINTER Int_t nevent = pam_event->GetEntries(); cout<< " Events= "<GetEntry(i); // get the entry, also pam_event->GetEntry is fine cn->Print(); // this will simply print on the terminal the determined CaloNuclei values Float_t mip1 = cn->Get_dEdx1(); // here how you can use the "old" dE/dx on the first plane if ( cn->Get_qpremeanN() > 0. && cn->Get_interplane()>9 ) { // other new variables // // do something // }; // if ( nrig > 5. ) caloz->Fill(mip1); // // if you want to do it for other tracks and not only for the track number 0 (default) you can do this way: // Float_t mipt[100]; memset(mipt,0.,100*sizeof(Float_t)); for (Int_t nt = 0; nt < pam_event->GetTrkLevel2()->GetNTracks(); nt++){ PamTrack *track = pam_event->GetTrack(nt); cn->Process(nt); if ( nt < 100 ) mipt[nt] = cn->Get_dEdx1(); if ( nt > 0 ){ cn->Print(); }; }; // } printf(" end!\n"); }; //