void twoRootFiles(){ int bins = 24000; double min = 1; double max = bins+min; myCanvas(); TChain* outTreeCRM = new TChain("outTreeCRM"); outTreeCRM->Add("file1.root"); cout << "Cargando CRM con " << outTreeCRM->GetEntries() << " usuarios." << endl; TProfile *fechaID = new TProfile("fechaID","fechaID",bins,min,max,""); outTreeCRM->Draw("user.fVar1:user.fID>>fechaID","",""); outTreeCRM->Delete(); cout << fechaID->GetEntries() << " usuarios pasan mis cortes." << endl; for (int ID=1;ID<=4;ID++) cout << fechaID->GetBinContent(ID) << " "; cout << endl; TChain* outTree = new TChain("outTree"); outTree->Add("file2.root"); cout << "Cargando REPO con " << outTree->GetEntries() << " repasos. " << endl; TH1F *presID = new TH1F("presID","presID",bins,min,max); outTree->Draw("event.fParam1>>presID","",""); cout << presID->GetEntries() << " repasos pasan mis cortes." << endl; for (int ID=1;ID<=4;ID++) cout << presID->GetBinContent(ID) << " "; cout << endl; }