The file cint.C shows an example of program which can be run via the CINT ROOT interpreter. To run it, just do: "root cint.C". If you are already inside "root", use ".x cint.C".
Interpreted analyses are well suited for small or medium size data samples, for which computer time is not the critical issue, while you want to code just few instructions, maybe interactively. You may also provide simplified C++ instructions to CINT, like:
{
gROOT->Reset();
gSystem->Exec("cd ../lib; make shared");
gSystem->Load("../lib/libAMSRoot.so");
AMSChain* ams = new AMSChain;
ams->Add("../files/test.root");
//ams->Add("http://pcamsf0.cern.ch/f2dah1/MC/AMS02/2004A/protons/el.pl1.10200/738197524.0000001.root");
//ams->Add("rfio:/castor/cern.ch/ams/MC/AMS02/2004A/protons/el.pl1.10200/738197524.0000001.root");
TFile* hfile = new TFile ("amstest.root", "RECREATE");
AMSEventList* list = new AMSEventList;
TH1F* hrig = new TH1F ("hrig", "Momentum (GeV)", 50, -10., 10.);
AMSEventR* pev = NULL;
while (pev = ams->GetEvent()) {
for (int i=0; i<pev->nParticle(); i++) {
ParticleR* part = pev->pParticle(i);
hrig->Fill(part->Momentum);
if (pev->nVertex()>0) {
list->Add(pev); // Add to list of selected events
pev->Fill(); // write it into output ROOT file
}
}
}
hrig->Draw();
hfile->Write();
list->Write("select.list");
printf("We have processed %d events\n", (int)ams->GetEntries());
printf("Histograms saved in '%s'\n", hfile->GetName());
}
1.3.9.1